code
stringlengths
2
1.05M
version https://git-lfs.github.com/spec/v1 oid sha256:61d8c61bb8bd7524336baba09577605596c2045d2a8be5baf97fd024b581d340 size 1763
version https://git-lfs.github.com/spec/v1 oid sha256:521934a911b136d41c9dbf107ce4f5883b15aa6c785c2bc54890a13de1fc0247 size 56660
/** * This file is part of Wizkers.io * * The MIT License (MIT) * Copyright (c) 2016 Edouard Lafargue, ed@wizkers.io * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the Software * is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * Graph S-Level on a frequency for a long time. * * @author Edouard Lafargue, ed@lafargue.name */ define(function(require) { 'use strict'; var frontend_driver = require('app/instruments/elecraft/driver_frontend'); return function() { var current_liveview = null; var current_numview = null; this.liveViewRef = function() { return current_liveview; }; this.numViewRef = function() { return current_numview; }; // Helper function: get driver capabilites. // returns a simple array of capabilities this.getCaps = function() { return ['LiveDisplay', 'NumDisplay', 'Recording']; }; // Return the type of data reading that this instrument generates. Can be used // by output plugins to accept data from this instrument or not. this.getDataType = function() { return [ 'transceiver' ]; } // This is a Backbone view this.getLiveDisplay = function(arg, callback) { require(['app/instruments/slevel_monitor/display_live'], function(view) { current_liveview = new view(arg); callback(current_liveview); }); }; // This is a Backbone view this.getNumDisplay = function(arg, callback) { require(['app/instruments/slevel_monitor/display_numeric'], function(view) { current_numview = new view(arg); callback(current_numview); }); }; // This is the front-end driver this.getDriver = function(callback, ins) { // This is a meta instrument: depending on the settings, we will create // different kinds of drivers; var it = ins.get('radio_type'); // CAREFUL: we are relying on the consistent naming conventions // in our drivers, in particular 'driver_frontend' and 'driver_backend' require(['app/instruments/' + it + '/driver_frontend'], function(d) { callback(new d()); }); }; // This is a browser implementation of the backend driver, when we // run the app fully in-browser on as a Cordova native app. this.getBackendDriver = function(arg, callback) { // See comment on getDriver above var it = instrumentManager.getInstrument().get('radio_type'); require(['app/instruments/' + it + '/driver_backend'], function(driver) { callback(new driver(arg)); }); }; // Render a log (or list of logs) for the device. this.getLogView = function(arg) { return null; } }; });
import {PADDING} from './constants'; import {stringToU8} from './encoding'; export function signedToUnsigned(signed) { return signed >>> 0; } export function xor(a, b) { return signedToUnsigned(a ^ b); } export function sumMod32(a, b) { return signedToUnsigned((a + b) | 0); } export function packFourBytes(byte1, byte2, byte3, byte4) { return signedToUnsigned(byte1 << 24 | byte2 << 16 | byte3 << 8 | byte4); } export function unpackFourBytes(pack) { return [ (pack >>> 24) & 0xFF, (pack >>> 16) & 0xFF, (pack >>> 8) & 0xFF, pack & 0xFF ]; } export function isString(val) { return typeof val === 'string'; } export function isBuffer(val) { return typeof val === 'object' && 'byteLength' in val; } export function isStringOrBuffer(val) { return isString(val) || isBuffer(val); } export function includes(obj, val) { let result = false; Object.keys(obj).forEach(key => { if (obj[key] === val) { result = true; } }); return result; } export function toUint8Array(val) { if (isString(val)) { return stringToU8(val); } else if (isBuffer(val)) { return new Uint8Array(val); } throw new Error('Unsupported type'); } export function expandKey(key) { if (key.length >= 72) { // 576 bits -> 72 bytes return key; } const longKey = []; while (longKey.length < 72) { for (let i = 0; i < key.length; i++) { longKey.push(key[i]); } } return new Uint8Array(longKey); } export function pad(bytes, padding) { const count = 8 - bytes.length % 8; if (count === 8 && bytes.length > 0 && padding !== PADDING.PKCS5) { return bytes; } const writer = new Uint8Array(bytes.length + count); const newBytes = []; let remaining = count; let padChar = 0; switch (padding) { case PADDING.PKCS5: { padChar = count; break; } case PADDING.ONE_AND_ZEROS: { newBytes.push(0x80); remaining--; break; } case PADDING.SPACES: { padChar = 0x20; break; } } while (remaining > 0) { if (padding === PADDING.LAST_BYTE && remaining === 1) { newBytes.push(count); break; } newBytes.push(padChar); remaining--; } writer.set(bytes); writer.set(newBytes, bytes.length); return writer; } export function unpad(bytes, padding) { let cutLength = 0; switch (padding) { case PADDING.LAST_BYTE: case PADDING.PKCS5: { const lastChar = bytes[bytes.length - 1]; if (lastChar <= 8) { cutLength = lastChar; } break; } case PADDING.ONE_AND_ZEROS: { let i = 1; while (i <= 8) { const char = bytes[bytes.length - i]; if (char === 0x80) { cutLength = i; break; } if (char !== 0) { break; } i++; } break; } case PADDING.NULL: case PADDING.SPACES: { const padChar = (padding === PADDING.SPACES) ? 0x20 : 0; let i = 1; while (i <= 8) { const char = bytes[bytes.length - i]; if (char !== padChar) { cutLength = i - 1; break; } i++; } break; } } return bytes.subarray(0, bytes.length - cutLength); }
(function(){ 'use strict'; angular.module('app') .factory('aboutFactory', aboutFactory); function aboutFactory(){ console.log('loaded aboutFactory'); var someValue = ''; var service = { save: save, someValue: someValue, validate: validate }; return service; function save() { console.log('save in factory aboutFactory'); } function validate() { console.log('validate in factory aboutFactory'); } } })();
$(function(){ // Pageing ‚ðÝ’è‚·‚邯Ahover ‚ł̉摜ƒ|ƒbƒvƒAƒbƒv‚ª–³Œø‚ɂȂéH var listOptions = { valueNames: [ 'idx', 'name'], page: 100, plugins: [ [ 'paging', { pagingClass: "topPaging", outerWindow: 2, left: 2, right: 2 }], [ 'paging', { pagingClass: "bottomPaging", innerWindow: 2, left: 2, right: 2 }] ] }; // var listOptions = { // valueNames: [ 'idx', 'name'], // page: 900 // }; var diffList = new List('diff_list', listOptions); imagePreview(); });
// @flow import { type State as PostsState } from '~/routes/Posts/modules/posts'; import { type State as SpotsState } from '~/routes/Spots/modules/spots'; import { type State as SpotEditState } from '~/routes/Spots/modules/spotEdit'; import { type State as SpotUsersState } from '~/routes/Spots/modules/spotUsers'; import { type State as DashboardState } from '~/routes/Dashboard/modules/dashboard'; export type AuthUserState = { isSignedIn: boolean, attributes: ?{ uid: string, provider: string, email: string, role: 'admin' | 'user', }, }; export type State = { dashboard: DashboardState, posts: PostsState, spots: SpotsState, spotUsers: SpotUsersState, spotEdit: SpotEditState, auth: { get: (key: 'user') => { toJS: () => AuthUserState } }, // wrapper for immutable };
import React from 'react' import {RouteHandler} from 'react-router' export default class Container extends React.Component { render () { return ( <div> <h1>Container</h1> <RouteHandler /> </div>) } }
define(['altair/facades/declare', 'altair/cartridges/extension/extensions/_Base', 'altair/Deferred', 'altair/plugins/node!path', 'altair/facades/mixin'], function (declare, _Base, Deferred, pathUtil, mixin) { return declare([_Base], { name: 'widget', _foundry: null, extend: function (Module, type) { Module.extendOnce({ widgetPath: './widgets', widget: function (named, options, config) { var _name = named, dfd, path, parts, instanceId, _options = options || {}, _config = config || {}; //default place to look for templates if (!_options.viewPaths) { //look relative to ourselves and relative to the altair runtime var p1 = this.resolvePath(this.viewPath || ''), p2 = this.nexus('Altair').resolvePath(''); _options.viewPaths = [p1]; //if we are calling this.widget() from a controller inside a web app, these should match //if we are calling it from inside a module or something else, these will probably no match. //i want to always make sure that ./views/ if (p1 !== p2) { _options.viewPaths.push(p2); } } //if it's a nexus name, pass it off if (named.search(':') > 0) { return this.nexus(named, _options, _config); } if (named.search(/\./) === -1) { dfd = new this.Deferred(); dfd.reject('You need to give your widget an instance id: this.widget(\'Name.instanceId\') -> this.widget(\'liquidfire:Forms/widgets/Form.create-user\')'); } else { //break out instance id parts = named.split('.'); _name = parts[0]; instanceId = parts[1]; path = this.resolvePath(pathUtil.join(this.widgetPath, _name.toLowerCase(), _name)); _config = mixin({ type: 'widget', name: this.name.split('/')[0] + '/widgets/' + _name }, _config); dfd = this.forge(path, _options, _config).then(function (widget) { widget.instanceId = instanceId; return _config.render ? widget.render(_config.template) : widget; }); } return dfd; } }); return this.inherited(arguments); } }); });
/* AngularJS v1.3.3 (c) 2010-2014 Google, Inc. http://angularjs.org License: MIT */ (function(T,U,t){'use strict';function v(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.3.3/"+(b?b+"/":"")+a;for(a=1;a<arguments.length;a++){c=c+(1==a?"?":"&")+"p"+(a-1)+"=";var d=encodeURIComponent,e;e=arguments[a];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;c+=d(e)}return Error(c)}}function Ra(b){if(null==b||Sa(b))return!1;var a=b.length;return b.nodeType=== la&&a?!0:I(b)||G(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function r(b,a,c){var d,e;if(b)if(u(b))for(d in b)"prototype"==d||"length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d)||a.call(c,b[d],d,b);else if(G(b)||Ra(b)){var f="object"!==typeof b;d=0;for(e=b.length;d<e;d++)(f||d in b)&&a.call(c,b[d],d,b)}else if(b.forEach&&b.forEach!==r)b.forEach(a,c,b);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d,b);return b}function Cd(b,a,c){for(var d=Object.keys(b).sort(),e=0;e<d.length;e++)a.call(c, b[d[e]],d[e]);return d}function kc(b){return function(a,c){b(c,a)}}function Dd(){return++kb}function lc(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function H(b){for(var a=b.$$hashKey,c=1,d=arguments.length;c<d;c++){var e=arguments[c];if(e)for(var f=Object.keys(e),g=0,h=f.length;g<h;g++){var k=f[g];b[k]=e[k]}}lc(b,a);return b}function aa(b){return parseInt(b,10)}function mc(b,a){return H(new (H(function(){},{prototype:b})),a)}function w(){}function ma(b){return b}function ba(b){return function(){return b}} function D(b){return"undefined"===typeof b}function A(b){return"undefined"!==typeof b}function L(b){return null!==b&&"object"===typeof b}function I(b){return"string"===typeof b}function W(b){return"number"===typeof b}function ea(b){return"[object Date]"===Ja.call(b)}function u(b){return"function"===typeof b}function lb(b){return"[object RegExp]"===Ja.call(b)}function Sa(b){return b&&b.window===b}function Ta(b){return b&&b.$evalAsync&&b.$watch}function Ua(b){return"boolean"===typeof b}function nc(b){return!(!b|| !(b.nodeName||b.prop&&b.attr&&b.find))}function Ed(b){var a={};b=b.split(",");var c;for(c=0;c<b.length;c++)a[b[c]]=!0;return a}function sa(b){return Q(b.nodeName||b[0].nodeName)}function Va(b,a){var c=b.indexOf(a);0<=c&&b.splice(c,1);return a}function Ca(b,a,c,d){if(Sa(b)||Ta(b))throw Wa("cpws");if(a){if(b===a)throw Wa("cpi");c=c||[];d=d||[];if(L(b)){var e=c.indexOf(b);if(-1!==e)return d[e];c.push(b);d.push(a)}if(G(b))for(var f=a.length=0;f<b.length;f++)e=Ca(b[f],null,c,d),L(b[f])&&(c.push(b[f]), d.push(e)),a.push(e);else{var g=a.$$hashKey;G(a)?a.length=0:r(a,function(b,c){delete a[c]});for(f in b)b.hasOwnProperty(f)&&(e=Ca(b[f],null,c,d),L(b[f])&&(c.push(b[f]),d.push(e)),a[f]=e);lc(a,g)}}else if(a=b)G(b)?a=Ca(b,[],c,d):ea(b)?a=new Date(b.getTime()):lb(b)?(a=new RegExp(b.source,b.toString().match(/[^\/]*$/)[0]),a.lastIndex=b.lastIndex):L(b)&&(e=Object.create(Object.getPrototypeOf(b)),a=Ca(b,e,c,d));return a}function ta(b,a){if(G(b)){a=a||[];for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}else if(L(b))for(c in a= a||{},b)if("$"!==c.charAt(0)||"$"!==c.charAt(1))a[c]=b[c];return a||b}function na(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&"object"==c)if(G(b)){if(!G(a))return!1;if((c=b.length)==a.length){for(d=0;d<c;d++)if(!na(b[d],a[d]))return!1;return!0}}else{if(ea(b))return ea(a)?na(b.getTime(),a.getTime()):!1;if(lb(b)&&lb(a))return b.toString()==a.toString();if(Ta(b)||Ta(a)||Sa(b)||Sa(a)||G(a))return!1;c={};for(d in b)if("$"!==d.charAt(0)&& !u(b[d])){if(!na(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c.hasOwnProperty(d)&&"$"!==d.charAt(0)&&a[d]!==t&&!u(a[d]))return!1;return!0}return!1}function Xa(b,a,c){return b.concat(Ya.call(a,c))}function oc(b,a){var c=2<arguments.length?Ya.call(arguments,2):[];return!u(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?a.apply(b,Xa(c,arguments,0)):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}function Fd(b,a){var c=a;"string"===typeof b&&"$"=== b.charAt(0)&&"$"===b.charAt(1)?c=t:Sa(a)?c="$WINDOW":a&&U===a?c="$DOCUMENT":Ta(a)&&(c="$SCOPE");return c}function Za(b,a){return"undefined"===typeof b?t:JSON.stringify(b,Fd,a?" ":null)}function pc(b){return I(b)?JSON.parse(b):b}function ua(b){b=y(b).clone();try{b.empty()}catch(a){}var c=y("<div>").append(b).html();try{return b[0].nodeType===mb?Q(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+Q(b)})}catch(d){return Q(c)}}function qc(b){try{return decodeURIComponent(b)}catch(a){}} function rc(b){var a={},c,d;r((b||"").split("&"),function(b){b&&(c=b.replace(/\+/g,"%20").split("="),d=qc(c[0]),A(d)&&(b=A(c[1])?qc(c[1]):!0,Jb.call(a,d)?G(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Kb(b){var a=[];r(b,function(b,d){G(b)?r(b,function(b){a.push(Da(d,!0)+(!0===b?"":"="+Da(b,!0)))}):a.push(Da(d,!0)+(!0===b?"":"="+Da(b,!0)))});return a.length?a.join("&"):""}function nb(b){return Da(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Da(b,a){return encodeURIComponent(b).replace(/%40/gi, "@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}function Gd(b,a){var c,d,e=ob.length;b=y(b);for(d=0;d<e;++d)if(c=ob[d]+a,I(c=b.attr(c)))return c;return null}function Hd(b,a){var c,d,e={};r(ob,function(a){a+="app";!c&&b.hasAttribute&&b.hasAttribute(a)&&(c=b,d=b.getAttribute(a))});r(ob,function(a){a+="app";var e;!c&&(e=b.querySelector("["+a.replace(":","\\:")+"]"))&&(c=e,d=e.getAttribute(a))});c&&(e.strictDi=null!==Gd(c,"strict-di"), a(c,d?[d]:[],e))}function sc(b,a,c){L(c)||(c={});c=H({strictDi:!1},c);var d=function(){b=y(b);if(b.injector()){var d=b[0]===U?"document":ua(b);throw Wa("btstrpd",d.replace(/</,"&lt;").replace(/>/,"&gt;"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng");d=Lb(a,c.strictDi);d.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector", d);c(b)(a)})}]);return d},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;T&&e.test(T.name)&&(c.debugInfoEnabled=!0,T.name=T.name.replace(e,""));if(T&&!f.test(T.name))return d();T.name=T.name.replace(f,"");va.resumeBootstrap=function(b){r(b,function(b){a.push(b)});d()}}function Id(){T.name="NG_ENABLE_DEBUG_INFO!"+T.name;T.location.reload()}function Jd(b){return va.element(b).injector().get("$$testability")}function Mb(b,a){a=a||"_";return b.replace(Kd,function(b,d){return(d?a:"")+b.toLowerCase()})} function Ld(){var b;tc||((oa=T.jQuery)&&oa.fn.on?(y=oa,H(oa.fn,{scope:Ka.scope,isolateScope:Ka.isolateScope,controller:Ka.controller,injector:Ka.injector,inheritedData:Ka.inheritedData}),b=oa.cleanData,oa.cleanData=function(a){var c;if(Nb)Nb=!1;else for(var d=0,e;null!=(e=a[d]);d++)(c=oa._data(e,"events"))&&c.$destroy&&oa(e).triggerHandler("$destroy");b(a)}):y=R,va.element=y,tc=!0)}function Ob(b,a,c){if(!b)throw Wa("areq",a||"?",c||"required");return b}function pb(b,a,c){c&&G(b)&&(b=b[b.length-1]); Ob(u(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function La(b,a){if("hasOwnProperty"===b)throw Wa("badname",a);}function uc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g<f;g++)d=a[g],b&&(b=(e=b)[d]);return!c&&u(b)?oc(e,b):b}function qb(b){var a=b[0];b=b[b.length-1];var c=[a];do{a=a.nextSibling;if(!a)break;c.push(a)}while(a!==b);return y(c)}function pa(){return Object.create(null)}function Md(b){function a(a,b,c){return a[b]|| (a[b]=c())}var c=v("$injector"),d=v("ng");b=a(b,"angular",Object);b.$$minErr=b.$$minErr||v;return a(b,"module",function(){var b={};return function(f,g,h){if("hasOwnProperty"===f)throw d("badname","module");g&&b.hasOwnProperty(f)&&(b[f]=null);return a(b,f,function(){function a(c,d,e,f){f||(f=b);return function(){f[e||"push"]([c,d,arguments]);return n}}if(!g)throw c("nomod",f);var b=[],d=[],e=[],q=a("$injector","invoke","push",d),n={_invokeQueue:b,_configBlocks:d,_runBlocks:e,requires:g,name:f,provider:a("$provide", "provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),animation:a("$animateProvider","register"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:q,run:function(a){e.push(a);return this}};h&&q(h);return n})}})}function Nd(b){H(b,{bootstrap:sc,copy:Ca,extend:H,equals:na,element:y,forEach:r,injector:Lb,noop:w,bind:oc,toJson:Za, fromJson:pc,identity:ma,isUndefined:D,isDefined:A,isString:I,isFunction:u,isObject:L,isNumber:W,isElement:nc,isArray:G,version:Od,isDate:ea,lowercase:Q,uppercase:rb,callbacks:{counter:0},getTestability:Jd,$$minErr:v,$$csp:$a,reloadWithDebugInfo:Id});ab=Md(T);try{ab("ngLocale")}catch(a){ab("ngLocale",[]).provider("$locale",Pd)}ab("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Qd});a.provider("$compile",vc).directive({a:Rd,input:wc,textarea:wc,form:Sd,script:Td,select:Ud,style:Vd, option:Wd,ngBind:Xd,ngBindHtml:Yd,ngBindTemplate:Zd,ngClass:$d,ngClassEven:ae,ngClassOdd:be,ngCloak:ce,ngController:de,ngForm:ee,ngHide:fe,ngIf:ge,ngInclude:he,ngInit:ie,ngNonBindable:je,ngPluralize:ke,ngRepeat:le,ngShow:me,ngStyle:ne,ngSwitch:oe,ngSwitchWhen:pe,ngSwitchDefault:qe,ngOptions:re,ngTransclude:se,ngModel:te,ngList:ue,ngChange:ve,pattern:xc,ngPattern:xc,required:yc,ngRequired:yc,minlength:zc,ngMinlength:zc,maxlength:Ac,ngMaxlength:Ac,ngValue:we,ngModelOptions:xe}).directive({ngInclude:ye}).directive(sb).directive(Bc); a.provider({$anchorScroll:ze,$animate:Ae,$browser:Be,$cacheFactory:Ce,$controller:De,$document:Ee,$exceptionHandler:Fe,$filter:Cc,$interpolate:Ge,$interval:He,$http:Ie,$httpBackend:Je,$location:Ke,$log:Le,$parse:Me,$rootScope:Ne,$q:Oe,$$q:Pe,$sce:Qe,$sceDelegate:Re,$sniffer:Se,$templateCache:Te,$templateRequest:Ue,$$testability:Ve,$timeout:We,$window:Xe,$$rAF:Ye,$$asyncCallback:Ze})}])}function bb(b){return b.replace($e,function(a,b,d,e){return e?d.toUpperCase():d}).replace(af,"Moz$1")}function Dc(b){b= b.nodeType;return b===la||!b||9===b}function Ec(b,a){var c,d,e=a.createDocumentFragment(),f=[];if(Pb.test(b)){c=c||e.appendChild(a.createElement("div"));d=(bf.exec(b)||["",""])[1].toLowerCase();d=ha[d]||ha._default;c.innerHTML=d[1]+b.replace(cf,"<$1></$2>")+d[2];for(d=d[0];d--;)c=c.lastChild;f=Xa(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";r(f,function(a){e.appendChild(a)});return e}function R(b){if(b instanceof R)return b;var a; I(b)&&(b=P(b),a=!0);if(!(this instanceof R)){if(a&&"<"!=b.charAt(0))throw Qb("nosel");return new R(b)}if(a){a=U;var c;b=(c=df.exec(b))?[a.createElement(c[1])]:(c=Ec(b,a))?c.childNodes:[]}Fc(this,b)}function Rb(b){return b.cloneNode(!0)}function tb(b,a){a||ub(b);if(b.querySelectorAll)for(var c=b.querySelectorAll("*"),d=0,e=c.length;d<e;d++)ub(c[d])}function Gc(b,a,c,d){if(A(d))throw Qb("offargs");var e=(d=vb(b))&&d.events,f=d&&d.handle;if(f)if(a)r(a.split(" "),function(a){if(A(c)){var d=e[a];Va(d|| [],c);if(d&&0<d.length)return}b.removeEventListener(a,f,!1);delete e[a]});else for(a in e)"$destroy"!==a&&b.removeEventListener(a,f,!1),delete e[a]}function ub(b,a){var c=b.ng339,d=c&&wb[c];d&&(a?delete d.data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),Gc(b)),delete wb[c],b.ng339=t))}function vb(b,a){var c=b.ng339,c=c&&wb[c];a&&!c&&(b.ng339=c=++ef,c=wb[c]={events:{},data:{},handle:t});return c}function Sb(b,a,c){if(Dc(b)){var d=A(c),e=!d&&a&&!L(a),f=!a;b=(b=vb(b,!e))&&b.data;if(d)b[a]= c;else{if(f)return b;if(e)return b&&b[a];H(b,a)}}}function Tb(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" "):!1}function Ub(b,a){a&&b.setAttribute&&r(a.split(" "),function(a){b.setAttribute("class",P((" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+P(a)+" "," ")))})}function Vb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");r(a.split(" "),function(a){a=P(a);-1=== c.indexOf(" "+a+" ")&&(c+=a+" ")});b.setAttribute("class",P(c))}}function Fc(b,a){if(a)if(a.nodeType)b[b.length++]=a;else{var c=a.length;if("number"===typeof c&&a.window!==a){if(c)for(var d=0;d<c;d++)b[b.length++]=a[d]}else b[b.length++]=a}}function Hc(b,a){return xb(b,"$"+(a||"ngController")+"Controller")}function xb(b,a,c){9==b.nodeType&&(b=b.documentElement);for(a=G(a)?a:[a];b;){for(var d=0,e=a.length;d<e;d++)if((c=y.data(b,a[d]))!==t)return c;b=b.parentNode||11===b.nodeType&&b.host}}function Ic(b){for(tb(b, !0);b.firstChild;)b.removeChild(b.firstChild)}function Jc(b,a){a||tb(b);var c=b.parentNode;c&&c.removeChild(b)}function ff(b,a){a=a||T;if("complete"===a.document.readyState)a.setTimeout(b);else y(a).on("load",b)}function Kc(b,a){var c=yb[a.toLowerCase()];return c&&Lc[sa(b)]&&c}function gf(b,a){var c=b.nodeName;return("INPUT"===c||"TEXTAREA"===c)&&Mc[a]}function hf(b,a){var c=function(c,e){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=a[e||c.type],g=f?f.length:0;if(g){if(D(c.immediatePropagationStopped)){var h= c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};1<g&&(f=ta(f));for(var k=0;k<g;k++)c.isImmediatePropagationStopped()||f[k].call(b,c)}};c.elem=b;return c}function Ma(b,a){var c=b&&b.$$hashKey;if(c)return"function"===typeof c&&(c=b.$$hashKey()),c;c=typeof b;return c="function"==c||"object"==c&&null!==b?b.$$hashKey= c+":"+(a||Dd)():c+":"+b}function cb(b,a){if(a){var c=0;this.nextUid=function(){return++c}}r(b,this.put,this)}function jf(b){return(b=b.toString().replace(Nc,"").match(Oc))?"function("+(b[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function Wb(b,a,c){var d;if("function"===typeof b){if(!(d=b.$inject)){d=[];if(b.length){if(a)throw I(c)&&c||(c=b.name||jf(b)),Ea("strictdi",c);a=b.toString().replace(Nc,"");a=a.match(Oc);r(a[1].split(kf),function(a){a.replace(lf,function(a,b,c){d.push(c)})})}b.$inject=d}}else G(b)? (a=b.length-1,pb(b[a],"fn"),d=b.slice(0,a)):pb(b,"fn",!0);return d}function Lb(b,a){function c(a){return function(b,c){if(L(b))r(b,kc(a));else return a(b,c)}}function d(a,b){La(a,"service");if(u(b)||G(b))b=q.instantiate(b);if(!b.$get)throw Ea("pget",a);return p[a+"Provider"]=b}function e(a,b){return function(){var c=s.invoke(b,this,t,a);if(D(c))throw Ea("undef",a);return c}}function f(a,b,c){return d(a,{$get:!1!==c?e(a,b):b})}function g(a){var b=[],c;r(a,function(a){function d(a){var b,c;b=0;for(c= a.length;b<c;b++){var e=a[b],f=q.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.put(a,!0);try{I(a)?(c=ab(a),b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):u(a)?b.push(q.invoke(a)):G(a)?b.push(q.invoke(a)):pb(a,"module")}catch(e){throw G(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ea("modulerr",a,e.stack||e.message||e);}}});return b}function h(b,c){function d(a){if(b.hasOwnProperty(a)){if(b[a]===k)throw Ea("cdep", a+" <- "+l.join(" <- "));return b[a]}try{return l.unshift(a),b[a]=k,b[a]=c(a)}catch(e){throw b[a]===k&&delete b[a],e;}finally{l.shift()}}function e(b,c,f,g){"string"===typeof f&&(g=f,f=null);var k=[];g=Wb(b,a,g);var h,l,n;l=0;for(h=g.length;l<h;l++){n=g[l];if("string"!==typeof n)throw Ea("itkn",n);k.push(f&&f.hasOwnProperty(n)?f[n]:d(n))}G(b)&&(b=b[h]);return b.apply(c,k)}return{invoke:e,instantiate:function(a,b,c){var d=function(){};d.prototype=(G(a)?a[a.length-1]:a).prototype;d=new d;a=e(a,d,b, c);return L(a)||u(a)?a:d},get:d,annotate:Wb,has:function(a){return p.hasOwnProperty(a+"Provider")||b.hasOwnProperty(a)}}}a=!0===a;var k={},l=[],m=new cb([],!0),p={$provide:{provider:c(d),factory:c(f),service:c(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:c(function(a,b){return f(a,ba(b),!1)}),constant:c(function(a,b){La(a,"constant");p[a]=b;n[a]=b}),decorator:function(a,b){var c=q.get(a+"Provider"),d=c.$get;c.$get=function(){var a=s.invoke(d,c);return s.invoke(b, null,{$delegate:a})}}}},q=p.$injector=h(p,function(){throw Ea("unpr",l.join(" <- "));}),n={},s=n.$injector=h(n,function(a){var b=q.get(a+"Provider");return s.invoke(b.$get,b,t,a)});r(g(b),function(a){s.invoke(a||w)});return s}function ze(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===sa(a))return b=a,!0});return b}function f(b){if(b){b.scrollIntoView();var c; c=g.yOffset;u(c)?c=c():nc(c)?(c=c[0],c="fixed"!==a.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):W(c)||(c=0);c&&(b=b.getBoundingClientRect().top,a.scrollBy(0,b-c))}else a.scrollTo(0,0)}function g(){var a=c.hash(),b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var h=a.document;b&&d.$watch(function(){return c.hash()},function(a,b){a===b&&""===a||ff(function(){d.$evalAsync(g)})});return g}]}function Ze(){this.$get=["$$rAF","$timeout", function(b,a){return b.supported?function(a){return b(a)}:function(b){return a(b,0,!1)}}]}function mf(b,a,c,d){function e(a){try{a.apply(null,Ya.call(arguments,1))}finally{if(x--,0===x)for(;B.length;)try{B.pop()()}catch(b){c.error(b)}}}function f(a,b){(function ya(){r(J,function(a){a()});z=b(ya,a)})()}function g(){h();k()}function h(){F=b.history.state;F=D(F)?null:F;na(F,S)&&(F=S);S=F}function k(){if(C!==m.url()||N!==F)C=m.url(),N=F,r(V,function(a){a(m.url(),F)})}function l(a){try{return decodeURIComponent(a)}catch(b){return a}} var m=this,p=a[0],q=b.location,n=b.history,s=b.setTimeout,O=b.clearTimeout,E={};m.isMock=!1;var x=0,B=[];m.$$completeOutstandingRequest=e;m.$$incOutstandingRequestCount=function(){x++};m.notifyWhenNoOutstandingRequests=function(a){r(J,function(a){a()});0===x?a():B.push(a)};var J=[],z;m.addPollFn=function(a){D(z)&&f(100,s);J.push(a);return a};var F,N,C=q.href,ca=a.find("base"),M=null;h();N=F;m.url=function(a,c,e){D(e)&&(e=null);q!==b.location&&(q=b.location);n!==b.history&&(n=b.history);if(a){var f= N===e;if(C!==a||d.history&&!f){var g=C&&Fa(C)===Fa(a);C=a;N=e;!d.history||g&&f?(g||(M=a),c?q.replace(a):q.href=a):(n[c?"replaceState":"pushState"](e,"",a),h(),N=F);return m}}else return M||q.href.replace(/%27/g,"'")};m.state=function(){return F};var V=[],X=!1,S=null;m.onUrlChange=function(a){if(!X){if(d.history)y(b).on("popstate",g);y(b).on("hashchange",g);X=!0}V.push(a);return a};m.$$checkUrlChange=k;m.baseHref=function(){var a=ca.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""}; var da={},A="",fa=m.baseHref();m.cookies=function(a,b){var d,e,f,g;if(a)b===t?p.cookie=encodeURIComponent(a)+"=;path="+fa+";expires=Thu, 01 Jan 1970 00:00:00 GMT":I(b)&&(d=(p.cookie=encodeURIComponent(a)+"="+encodeURIComponent(b)+";path="+fa).length+1,4096<d&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!"));else{if(p.cookie!==A)for(A=p.cookie,d=A.split("; "),da={},f=0;f<d.length;f++)e=d[f],g=e.indexOf("="),0<g&&(a=l(e.substring(0,g)),da[a]=== t&&(da[a]=l(e.substring(g+1))));return da}};m.defer=function(a,b){var c;x++;c=s(function(){delete E[c];e(a)},b||0);E[c]=!0;return c};m.defer.cancel=function(a){return E[a]?(delete E[a],O(a),e(w),!0):!1}}function Be(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new mf(b,d,a,c)}]}function Ce(){this.$get=function(){function b(b,d){function e(a){a!=p&&(q?q==a&&(q=a.n):q=a,f(a.n,a.p),f(a,p),p=a,p.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw v("$cacheFactory")("iid", b);var g=0,h=H({},d,{id:b}),k={},l=d&&d.capacity||Number.MAX_VALUE,m={},p=null,q=null;return a[b]={put:function(a,b){if(l<Number.MAX_VALUE){var c=m[a]||(m[a]={key:a});e(c)}if(!D(b))return a in k||g++,k[a]=b,g>l&&this.remove(q.key),b},get:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;e(b)}return k[a]},remove:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;b==p&&(p=b.p);b==q&&(q=b.n);f(b.n,b.p);delete m[a]}delete k[a];g--},removeAll:function(){k={};g=0;m={};p=q=null},destroy:function(){m= h=k=null;delete a[b]},info:function(){return H({},h,{size:g})}}}var a={};b.info=function(){var b={};r(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function Te(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function vc(b,a){function c(a,b){var c=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,d={};r(a,function(a,e){var f=a.match(c);if(!f)throw ia("iscp",b,e,a);d[e]={mode:f[1][0],collection:"*"===f[2],optional:"?"===f[3],attrName:f[4]||e}});return d}var d= {},e=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,f=/(([\w\-]+)(?:\:([^;]+))?;?)/,g=Ed("ngSrc,ngSrcset,src,srcset"),h=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,k=/^(on[a-z]+|formaction)$/;this.directive=function p(a,e){La(a,"directive");I(a)?(Ob(e,"directiveFactory"),d.hasOwnProperty(a)||(d[a]=[],b.factory(a+"Directive",["$injector","$exceptionHandler",function(b,e){var f=[];r(d[a],function(d,g){try{var h=b.invoke(d);u(h)?h={compile:ba(h)}:!h.compile&&h.link&&(h.compile=ba(h.link));h.priority=h.priority||0;h.index= g;h.name=h.name||a;h.require=h.require||h.controller&&h.name;h.restrict=h.restrict||"EA";L(h.scope)&&(h.$$isolateBindings=c(h.scope,h.name));f.push(h)}catch(k){e(k)}});return f}])),d[a].push(e)):r(a,kc(p));return this};this.aHrefSanitizationWhitelist=function(b){return A(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};var l=!0;this.debugInfoEnabled= function(a){return A(a)?(l=a,this):l};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,c,s,O,E,x,B,J,z,F){function N(a,b){try{a.addClass(b)}catch(c){}}function C(a,b,c,d,e){a instanceof y||(a=y(a));r(a,function(b,c){b.nodeType==mb&&b.nodeValue.match(/\S+/)&&(a[c]=y(b).wrap("<span></span>").parent()[0])});var f=ca(a,b,a,c,d,e);C.$$addScopeClass(a);var g=null;return function(b, c,d){Ob(b,"scope");d=d||{};var e=d.parentBoundTranscludeFn,h=d.transcludeControllers;d=d.futureParentElement;e&&e.$$boundTransclude&&(e=e.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==sa(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?y(T(g,y("<div>").append(a).html())):c?Ka.clone.call(a):a;if(h)for(var k in h)d.data("$"+k+"Controller",h[k].instance);C.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,e);return d}}function ca(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,q,s,p,B;if(n)for(B= Array(c.length),q=0;q<h.length;q+=3)f=h[q],B[f]=c[f];else B=c;q=0;for(s=h.length;q<s;)k=B[h[q++]],c=h[q++],f=h[q++],c?(c.scope?(l=a.$new(),C.$$addScopeInfo(y(k),l)):l=a,p=c.transcludeOnThisElement?M(a,c.transclude,e,c.elementTranscludeOnThisElement):!c.templateOnThisElement&&e?e:!e&&b?M(a,b):null,c(f,l,k,d,p)):f&&f(a,k.childNodes,t,e)}for(var h=[],k,l,q,s,n,p=0;p<a.length;p++){k=new W;l=V(a[p],[],k,0===p?d:t,e);(f=l.length?A(l,a[p],k,b,c,null,[],[],f):null)&&f.scope&&C.$$addScopeClass(k.$$element); k=f&&f.terminal||!(q=a[p].childNodes)||!q.length?null:ca(q,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||k)h.push(p,f,k),s=!0,n=n||f;f=null}return s?g:null}function M(a,b,c,d){return function(d,e,f,g,h){d||(d=a.$new(!1,h),d.$$transcluded=!0);return b(d,e,{parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:g})}}function V(b,c,g,h,k){var l=g.$attr,q;switch(b.nodeType){case la:fa(c,wa(sa(b)),"E",h,k);for(var s,n,B,O=b.attributes,E=0,J=O&&O.length;E< J;E++){var F=!1,x=!1;s=O[E];q=s.name;s=P(s.value);n=wa(q);if(B=za.test(n))q=Mb(n.substr(6),"-");var N=n.replace(/(Start|End)$/,""),C;a:{var z=N;if(d.hasOwnProperty(z)){C=void 0;for(var z=a.get(z+"Directive"),V=0,r=z.length;V<r;V++)if(C=z[V],C.multiElement){C=!0;break a}}C=!1}C&&n===N+"Start"&&(F=q,x=q.substr(0,q.length-5)+"end",q=q.substr(0,q.length-6));n=wa(q.toLowerCase());l[n]=q;if(B||!g.hasOwnProperty(n))g[n]=s,Kc(b,n)&&(g[n]=!0);R(b,c,s,n,B);fa(c,n,"A",h,k,F,x)}b=b.className;if(I(b)&&""!==b)for(;q= f.exec(b);)n=wa(q[2]),fa(c,n,"C",h,k)&&(g[n]=P(q[3])),b=b.substr(q.index+q[0].length);break;case mb:Y(c,b.nodeValue);break;case 8:try{if(q=e.exec(b.nodeValue))n=wa(q[1]),fa(c,n,"M",h,k)&&(g[n]=P(q[2]))}catch(ca){}}c.sort(v);return c}function X(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ia("uterdir",b,c);a.nodeType==la&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return y(d)}function S(a,b,c){return function(d, e,f,g,h){e=X(e[0],b,c);return a(d,e,f,g,h)}}function A(a,d,e,f,g,k,l,s,p){function B(a,b,c,d){if(a){c&&(a=S(a,c,d));a.require=K.require;a.directiveName=ga;if(M===K||K.$$isolateScope)a=Z(a,{isolateScope:!0});l.push(a)}if(b){c&&(b=S(b,c,d));b.require=K.require;b.directiveName=ga;if(M===K||K.$$isolateScope)b=Z(b,{isolateScope:!0});s.push(b)}}function J(a,b,c,d){var e,f="data",g=!1,k=c,l;if(I(b)){l=b.match(h);b=b.substring(l[0].length);l[3]&&(l[1]?l[3]=null:l[1]=l[3]);"^"===l[1]?f="inheritedData":"^^"=== l[1]&&(f="inheritedData",k=c.parent());"?"===l[2]&&(g=!0);e=null;d&&"data"===f&&(e=d[b])&&(e=e.instance);e=e||k[f]("$"+b+"Controller");if(!e&&!g)throw ia("ctreq",b,a);return e||null}G(b)&&(e=[],r(b,function(b){e.push(J(a,b,c,d))}));return e}function F(a,c,f,g,h){function k(a,b,c){var d;Ta(a)||(c=b,b=a,a=t);H&&(d=N);c||(c=H?V.parent():V);return h(a,b,d,c,Xb)}var n,p,B,x,N,db,V,S;d===f?(S=e,V=e.$$element):(V=y(f),S=new W(V,e));M&&(x=c.$new(!0));h&&(db=k,db.$$boundTransclude=h);z&&(ca={},N={},r(z,function(a){var b= {$scope:a===M||a.$$isolateScope?x:c,$element:V,$attrs:S,$transclude:db};B=a.controller;"@"==B&&(B=S[a.name]);b=E(B,b,!0,a.controllerAs);N[a.name]=b;H||V.data("$"+a.name+"Controller",b.instance);ca[a.name]=b}));if(M){C.$$addScopeInfo(V,x,!0,!(da&&(da===M||da===M.$$originalDirective)));C.$$addScopeClass(V,!0);g=ca&&ca[M.name];var X=x;g&&g.identifier&&!0===M.bindToController&&(X=g.instance);r(x.$$isolateBindings=M.$$isolateBindings,function(a,d){var e=a.attrName,f=a.optional,g,h,k,l;switch(a.mode){case "@":S.$observe(e, function(a){X[d]=a});S.$$observers[e].$$scope=c;S[e]&&(X[d]=b(S[e])(c));break;case "=":if(f&&!S[e])break;h=O(S[e]);l=h.literal?na:function(a,b){return a===b||a!==a&&b!==b};k=h.assign||function(){g=X[d]=h(c);throw ia("nonassign",S[e],M.name);};g=X[d]=h(c);f=function(a){l(a,X[d])||(l(a,g)?k(c,a=X[d]):X[d]=a);return g=a};f.$stateful=!0;f=a.collection?c.$watchCollection(S[e],f):c.$watch(O(S[e],f),null,h.literal);x.$on("$destroy",f);break;case "&":h=O(S[e]),X[d]=function(a){return h(c,a)}}})}ca&&(r(ca, function(a){a()}),ca=null);g=0;for(n=l.length;g<n;g++)p=l[g],$(p,p.isolateScope?x:c,V,S,p.require&&J(p.directiveName,p.require,V,N),db);var Xb=c;M&&(M.template||null===M.templateUrl)&&(Xb=x);a&&a(Xb,f.childNodes,t,h);for(g=s.length-1;0<=g;g--)p=s[g],$(p,p.isolateScope?x:c,V,S,p.require&&J(p.directiveName,p.require,V,N),db)}p=p||{};for(var x=-Number.MAX_VALUE,N,z=p.controllerDirectives,ca,M=p.newIsolateScopeDirective,da=p.templateDirective,fa=p.nonTlbTranscludeDirective,w=!1,Na=!1,H=p.hasElementTranscludeDirective, Y=e.$$element=y(d),K,ga,v,Ga=f,Q,R=0,za=a.length;R<za;R++){K=a[R];var zb=K.$$start,aa=K.$$end;zb&&(Y=X(d,zb,aa));v=t;if(x>K.priority)break;if(v=K.scope)K.templateUrl||(L(v)?(ya("new/isolated scope",M||N,K,Y),M=K):ya("new/isolated scope",M,K,Y)),N=N||K;ga=K.name;!K.templateUrl&&K.controller&&(v=K.controller,z=z||{},ya("'"+ga+"' controller",z[ga],K,Y),z[ga]=K);if(v=K.transclude)w=!0,K.$$tlb||(ya("transclusion",fa,K,Y),fa=K),"element"==v?(H=!0,x=K.priority,v=Y,Y=e.$$element=y(U.createComment(" "+ga+ ": "+e[ga]+" ")),d=Y[0],Ab(g,Ya.call(v,0),d),Ga=C(v,f,x,k&&k.name,{nonTlbTranscludeDirective:fa})):(v=y(Rb(d)).contents(),Y.empty(),Ga=C(v,f));if(K.template)if(Na=!0,ya("template",da,K,Y),da=K,v=u(K.template)?K.template(Y,e):K.template,v=Qc(v),K.replace){k=K;v=Pb.test(v)?Rc(T(K.templateNamespace,P(v))):[];d=v[0];if(1!=v.length||d.nodeType!==la)throw ia("tplrt",ga,"");Ab(g,Y,d);za={$attr:{}};v=V(d,[],za);var of=a.splice(R+1,a.length-(R+1));M&&D(v);a=a.concat(v).concat(of);Pc(e,za);za=a.length}else Y.html(v); if(K.templateUrl)Na=!0,ya("template",da,K,Y),da=K,K.replace&&(k=K),F=nf(a.splice(R,a.length-R),Y,e,g,w&&Ga,l,s,{controllerDirectives:z,newIsolateScopeDirective:M,templateDirective:da,nonTlbTranscludeDirective:fa}),za=a.length;else if(K.compile)try{Q=K.compile(Y,e,Ga),u(Q)?B(null,Q,zb,aa):Q&&B(Q.pre,Q.post,zb,aa)}catch(ba){c(ba,ua(Y))}K.terminal&&(F.terminal=!0,x=Math.max(x,K.priority))}F.scope=N&&!0===N.scope;F.transcludeOnThisElement=w;F.elementTranscludeOnThisElement=H;F.templateOnThisElement=Na; F.transclude=Ga;p.hasElementTranscludeDirective=H;return F}function D(a){for(var b=0,c=a.length;b<c;b++)a[b]=mc(a[b],{$$isolateScope:!0})}function fa(b,e,f,g,h,k,l){if(e===h)return null;h=null;if(d.hasOwnProperty(e)){var q;e=a.get(e+"Directive");for(var s=0,B=e.length;s<B;s++)try{q=e[s],(g===t||g>q.priority)&&-1!=q.restrict.indexOf(f)&&(k&&(q=mc(q,{$$start:k,$$end:l})),b.push(q),h=q)}catch(O){c(O)}}return h}function Pc(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;r(a,function(d,e){"$"!=e.charAt(0)&& (b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,f){"class"==f?(N(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function nf(a,b,c,d,e,f,g,h){var k=[],l,q,n=b[0],p=a.shift(),B=H({},p,{templateUrl:null,transclude:null,replace:null,$$originalDirective:p}),O=u(p.templateUrl)?p.templateUrl(b,c):p.templateUrl,E=p.templateNamespace; b.empty();s(J.getTrustedResourceUrl(O)).then(function(s){var F,J;s=Qc(s);if(p.replace){s=Pb.test(s)?Rc(T(E,P(s))):[];F=s[0];if(1!=s.length||F.nodeType!==la)throw ia("tplrt",p.name,O);s={$attr:{}};Ab(d,b,F);var x=V(F,[],s);L(p.scope)&&D(x);a=x.concat(a);Pc(c,s)}else F=n,b.html(s);a.unshift(B);l=A(a,F,c,e,b,p,f,g,h);r(d,function(a,c){a==F&&(d[c]=b[0])});for(q=ca(b[0].childNodes,e);k.length;){s=k.shift();J=k.shift();var z=k.shift(),C=k.shift(),x=b[0];if(!s.$$destroyed){if(J!==n){var S=J.className;h.hasElementTranscludeDirective&& p.replace||(x=Rb(F));Ab(z,y(J),x);N(y(x),S)}J=l.transcludeOnThisElement?M(s,l.transclude,C):C;l(q,s,x,d,J)}}k=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(k?(k.push(b),k.push(c),k.push(d),k.push(a)):(l.transcludeOnThisElement&&(a=M(b,l.transclude,e)),l(q,b,c,d,a)))}}function v(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function ya(a,b,c,d){if(b)throw ia("multidir",b.name,c.name,a,ua(d));}function Y(a,c){var d=b(c,!0);d&&a.push({priority:0, compile:function(a){a=a.parent();var b=!!a.length;b&&C.$$addBindingClass(a);return function(a,c){var e=c.parent();b||C.$$addBindingClass(e);C.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function T(a,b){a=Q(a||"html");switch(a){case "svg":case "math":var c=U.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function Ga(a,b){if("srcdoc"==b)return J.HTML;var c=sa(a);if("xlinkHref"==b||"form"==c&&"action"==b|| "img"!=c&&("src"==b||"ngSrc"==b))return J.RESOURCE_URL}function R(a,c,d,e,f){var h=b(d,!0);if(h){if("multiple"===e&&"select"===sa(a))throw ia("selmulti",ua(a));c.push({priority:100,compile:function(){return{pre:function(c,d,l){d=l.$$observers||(l.$$observers={});if(k.test(e))throw ia("nodomevents");l[e]&&(h=b(l[e],!0,Ga(a,e),g[e]||f))&&(l[e]=h(c),(d[e]||(d[e]=[])).$$inter=!0,(l.$$observers&&l.$$observers[e].$$scope||c).$watch(h,function(a,b){"class"===e&&a!=b?l.$updateClass(a,b):l.$set(e,a)}))}}}})}} function Ab(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=U.createDocumentFragment();a.appendChild(d);y(c).data(y(d).data());oa?(Nb=!0,oa.cleanData([d])):delete y.cache[d[y.expando]];d=1;for(e=b.length;d<e;d++)f=b[d],y(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function Z(a,b){return H(function(){return a.apply(null, arguments)},a,b)}function $(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,ua(d))}}var W=function(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a};W.prototype={$normalize:wa,$addClass:function(a){a&&0<a.length&&z.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&z.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=Sc(a,b);c&&c.length&&z.addClass(this.$$element,c);(c=Sc(b,a))&&c.length&&z.removeClass(this.$$element, c)},$set:function(a,b,d,e){var f=this.$$element[0],g=Kc(f,a),h=gf(f,a),f=a;g?(this.$$element.prop(a,b),e=g):h&&(this[h]=b,f=h);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Mb(a,"-"));g=sa(this.$$element);if("a"===g&&"href"===a||"img"===g&&"src"===a)this[a]=b=F(b,"src"===a);else if("img"===g&&"srcset"===a){for(var g="",h=P(b),k=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,k=/\s/.test(h)?k:/(,)/,h=h.split(k),k=Math.floor(h.length/2),l=0;l<k;l++)var q=2*l,g=g+F(P(h[q]),!0),g=g+(" "+P(h[q+ 1]));h=P(h[2*l]).split(/\s/);g+=F(P(h[0]),!0);2===h.length&&(g+=" "+P(h[1]));this[a]=b=g}!1!==d&&(null===b||b===t?this.$$element.removeAttr(e):this.$$element.attr(e,b));(a=this.$$observers)&&r(a[f],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=pa()),e=d[a]||(d[a]=[]);e.push(b);x.$evalAsync(function(){!e.$$inter&&c.hasOwnProperty(a)&&b(c[a])});return function(){Va(e,b)}}};var Na=b.startSymbol(),ga=b.endSymbol(),Qc="{{"==Na||"}}"==ga?ma:function(a){return a.replace(/\{\{/g, Na).replace(/}}/g,ga)},za=/^ngAttr[A-Z]/;C.$$addBindingInfo=l?function(a,b){var c=a.data("$binding")||[];G(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:w;C.$$addBindingClass=l?function(a){N(a,"ng-binding")}:w;C.$$addScopeInfo=l?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:w;C.$$addScopeClass=l?function(a,b){N(a,b?"ng-isolate-scope":"ng-scope")}:w;return C}]}function wa(b){return bb(b.replace(pf,""))}function Sc(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/), f=0;a:for(;f<d.length;f++){for(var g=d[f],h=0;h<e.length;h++)if(g==e[h])continue a;c+=(0<c.length?" ":"")+g}return c}function Rc(b){b=y(b);var a=b.length;if(1>=a)return b;for(;a--;)8===b[a].nodeType&&qf.call(b,a,1);return b}function De(){var b={},a=!1,c=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(a,c){La(a,"controller");L(a)?H(b,a):b[a]=c};this.allowGlobals=function(){a=!0};this.$get=["$injector","$window",function(d,e){function f(a,b,c,d){if(!a||!L(a.$scope))throw v("$controller")("noscp",d, b);a.$scope[b]=c}return function(g,h,k,l){var m,p,q;k=!0===k;l&&I(l)&&(q=l);I(g)&&(l=g.match(c),p=l[1],q=q||l[3],g=b.hasOwnProperty(p)?b[p]:uc(h.$scope,p,!0)||(a?uc(e,p,!0):t),pb(g,p,!0));if(k)return k=function(){},k.prototype=(G(g)?g[g.length-1]:g).prototype,m=new k,q&&f(h,q,m,p||g.name),H(function(){d.invoke(g,m,h,p);return m},{instance:m,identifier:q});m=d.instantiate(g,h,p);q&&f(h,q,m,p||g.name);return m}}]}function Ee(){this.$get=["$window",function(b){return y(b.document)}]}function Fe(){this.$get= ["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Yb(b,a){if(I(b)){b=b.replace(rf,"");var c=a("Content-Type");if(c&&0===c.indexOf(Tc)&&b.trim()||sf.test(b)&&tf.test(b))b=pc(b)}return b}function Uc(b){var a={},c,d,e;if(!b)return a;r(b.split("\n"),function(b){e=b.indexOf(":");c=Q(P(b.substr(0,e)));d=P(b.substr(e+1));c&&(a[c]=a[c]?a[c]+", "+d:d)});return a}function Vc(b){var a=L(b)?b:t;return function(c){a||(a=Uc(b));return c?a[Q(c)]||null:a}}function Wc(b,a,c){if(u(c))return c(b, a);r(c,function(c){b=c(b,a)});return b}function Ie(){var b=this.defaults={transformResponse:[Yb],transformRequest:[function(a){return L(a)&&"[object File]"!==Ja.call(a)&&"[object Blob]"!==Ja.call(a)?Za(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ta(Zb),put:ta(Zb),patch:ta(Zb)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},a=!1;this.useApplyAsync=function(b){return A(b)?(a=!!b,this):a};var c=this.interceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory", "$rootScope","$q","$injector",function(d,e,f,g,h,k){function l(a){function c(a){var b=H({},a);b.data=a.data?Wc(a.data,a.headers,d.transformResponse):a.data;a=a.status;return 200<=a&&300>a?b:h.reject(b)}var d={method:"get",transformRequest:b.transformRequest,transformResponse:b.transformResponse},e=function(a){var c=b.headers,d=H({},a.headers),e,f,c=H({},c.common,c[Q(a.method)]);a:for(e in c){a=Q(e);for(f in d)if(Q(f)===a)continue a;d[e]=c[e]}(function(a){var b;r(a,function(c,d){u(c)&&(b=c(),null!= b?a[d]=b:delete a[d])})})(d);return d}(a);H(d,a);d.headers=e;d.method=rb(d.method);var f=[function(a){e=a.headers;var d=Wc(a.data,Vc(e),a.transformRequest);D(d)&&r(e,function(a,b){"content-type"===Q(b)&&delete e[b]});D(a.withCredentials)&&!D(b.withCredentials)&&(a.withCredentials=b.withCredentials);return m(a,d,e).then(c,c)},t],g=h.when(d);for(r(n,function(a){(a.request||a.requestError)&&f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a= f.shift();var k=f.shift(),g=g.then(a,k)}g.success=function(a){g.then(function(b){a(b.data,b.status,b.headers,d)});return g};g.error=function(a){g.then(null,function(b){a(b.data,b.status,b.headers,d)});return g};return g}function m(c,f,k){function n(b,c,d,e){function f(){m(c,b,d,e)}N&&(200<=b&&300>b?N.put(r,[b,c,Uc(d),e]):N.remove(r));a?g.$applyAsync(f):(f(),g.$$phase||g.$apply())}function m(a,b,d,e){b=Math.max(b,0);(200<=b&&300>b?z.resolve:z.reject)({data:a,status:b,headers:Vc(d),config:c,statusText:e})} function J(){var a=l.pendingRequests.indexOf(c);-1!==a&&l.pendingRequests.splice(a,1)}var z=h.defer(),F=z.promise,N,C,r=p(c.url,c.params);l.pendingRequests.push(c);F.then(J,J);!c.cache&&!b.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(N=L(c.cache)?c.cache:L(b.cache)?b.cache:q);if(N)if(C=N.get(r),A(C)){if(C&&u(C.then))return C.then(J,J),C;G(C)?m(C[1],C[0],ta(C[2]),C[3]):m(C,200,{},"OK")}else N.put(r,F);D(C)&&((C=Xc(c.url)?e.cookies()[c.xsrfCookieName||b.xsrfCookieName]:t)&&(k[c.xsrfHeaderName|| b.xsrfHeaderName]=C),d(c.method,r,f,n,k,c.timeout,c.withCredentials,c.responseType));return F}function p(a,b){if(!b)return a;var c=[];Cd(b,function(a,b){null===a||D(a)||(G(a)||(a=[a]),r(a,function(a){L(a)&&(a=ea(a)?a.toISOString():Za(a));c.push(Da(b)+"="+Da(a))}))});0<c.length&&(a+=(-1==a.indexOf("?")?"?":"&")+c.join("&"));return a}var q=f("$http"),n=[];r(c,function(a){n.unshift(I(a)?k.get(a):k.invoke(a))});l.pendingRequests=[];(function(a){r(arguments,function(a){l[a]=function(b,c){return l(H(c|| {},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){r(arguments,function(a){l[a]=function(b,c,d){return l(H(d||{},{method:a,url:b,data:c}))}})})("post","put","patch");l.defaults=b;return l}]}function uf(){return new T.XMLHttpRequest}function Je(){this.$get=["$browser","$window","$document",function(b,a,c){return vf(b,uf,b.defer,a.angular.callbacks,c[0])}]}function vf(b,a,c,d,e){function f(a,b,c){var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0; m=function(a){f.removeEventListener("load",m,!1);f.removeEventListener("error",m,!1);e.body.removeChild(f);f=null;var g=-1,n="unknown";a&&("load"!==a.type||d[b].called||(a={type:"error"}),n=a.type,g="error"===a.type?404:200);c&&c(g,n)};f.addEventListener("load",m,!1);f.addEventListener("error",m,!1);e.body.appendChild(f);return m}return function(e,h,k,l,m,p,q,n){function s(){x&&x();B&&B.abort()}function O(a,d,e,f,g){z&&c.cancel(z);x=B=null;a(d,e,f,g);b.$$completeOutstandingRequest(w)}b.$$incOutstandingRequestCount(); h=h||b.url();if("jsonp"==Q(e)){var E="_"+(d.counter++).toString(36);d[E]=function(a){d[E].data=a;d[E].called=!0};var x=f(h.replace("JSON_CALLBACK","angular.callbacks."+E),E,function(a,b){O(l,a,d[E].data,"",b);d[E]=w})}else{var B=a();B.open(e,h,!0);r(m,function(a,b){A(a)&&B.setRequestHeader(b,a)});B.onload=function(){var a=B.statusText||"",b="response"in B?B.response:B.responseText,c=1223===B.status?204:B.status;0===c&&(c=b?200:"file"==Aa(h).protocol?404:0);O(l,c,b,B.getAllResponseHeaders(),a)};e= function(){O(l,-1,null,null,"")};B.onerror=e;B.onabort=e;q&&(B.withCredentials=!0);if(n)try{B.responseType=n}catch(J){if("json"!==n)throw J;}B.send(k||null)}if(0<p)var z=c(s,p);else p&&u(p.then)&&p.then(s)}}function Ge(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(a){return"\\\\\\"+a}function g(f,g,n,s){function O(c){return c.replace(l,b).replace(m, a)}function E(a){try{var b=a;a=n?e.getTrusted(n,b):e.valueOf(b);var c;if(s&&!A(a))c=a;else if(null==a)c="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=Za(a)}c=a}return c}catch(g){c=$b("interr",f,g.toString()),d(c)}}s=!!s;for(var x,B,J=0,z=[],F=[],N=f.length,C=[],r=[];J<N;)if(-1!=(x=f.indexOf(b,J))&&-1!=(B=f.indexOf(a,x+h)))J!==x&&C.push(O(f.substring(J,x))),J=f.substring(x+h,B),z.push(J),F.push(c(J,E)),J=B+k,r.push(C.length),C.push("");else{J!==N&&C.push(O(f.substring(J))); break}if(n&&1<C.length)throw $b("noconcat",f);if(!g||z.length){var M=function(a){for(var b=0,c=z.length;b<c;b++){if(s&&D(a[b]))return;C[r[b]]=a[b]}return C.join("")};return H(function(a){var b=0,c=z.length,e=Array(c);try{for(;b<c;b++)e[b]=F[b](a);return M(e)}catch(g){a=$b("interr",f,g.toString()),d(a)}},{exp:f,expressions:z,$$watchDelegate:function(a,b,c){var d;return a.$watchGroup(F,function(c,e){var f=M(c);u(b)&&b.call(this,f,c!==e?d:f,a);d=f},c)}})}}var h=b.length,k=a.length,l=new RegExp(b.replace(/./g, f),"g"),m=new RegExp(a.replace(/./g,f),"g");g.startSymbol=function(){return b};g.endSymbol=function(){return a};return g}]}function He(){this.$get=["$rootScope","$window","$q","$$q",function(b,a,c,d){function e(e,h,k,l){var m=a.setInterval,p=a.clearInterval,q=0,n=A(l)&&!l,s=(n?d:c).defer(),O=s.promise;k=A(k)?k:0;O.then(null,null,e);O.$$intervalId=m(function(){s.notify(q++);0<k&&q>=k&&(s.resolve(q),p(O.$$intervalId),delete f[O.$$intervalId]);n||b.$apply()},h);f[O.$$intervalId]=s;return O}var f={}; e.cancel=function(b){return b&&b.$$intervalId in f?(f[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete f[b.$$intervalId],!0):!1};return e}]}function Pd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "), SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return 1===b?"one":"other"}}}}function ac(b){b=b.split("/");for(var a=b.length;a--;)b[a]= nb(b[a]);return b.join("/")}function Yc(b,a){var c=Aa(b);a.$$protocol=c.protocol;a.$$host=c.hostname;a.$$port=aa(c.port)||wf[c.protocol]||null}function Zc(b,a){var c="/"!==b.charAt(0);c&&(b="/"+b);var d=Aa(b);a.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)?d.pathname.substring(1):d.pathname);a.$$search=rc(d.search);a.$$hash=decodeURIComponent(d.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function xa(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Fa(b){var a= b.indexOf("#");return-1==a?b:b.substr(0,a)}function bc(b){return b.substr(0,Fa(b).lastIndexOf("/")+1)}function cc(b,a){this.$$html5=!0;a=a||"";var c=bc(b);Yc(b,this);this.$$parse=function(a){var b=xa(c,a);if(!I(b))throw eb("ipthprfx",a,c);Zc(b,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Kb(this.$$search),b=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=ac(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$parseLinkUrl=function(d,e){if(e&& "#"===e[0])return this.hash(e.slice(1)),!0;var f,g;(f=xa(b,d))!==t?(g=f,g=(f=xa(a,f))!==t?c+(xa("/",f)||f):b+g):(f=xa(c,d))!==t?g=c+f:c==d+"/"&&(g=c);g&&this.$$parse(g);return!!g}}function dc(b,a){var c=bc(b);Yc(b,this);this.$$parse=function(d){var e=xa(b,d)||xa(c,d),e="#"==e.charAt(0)?xa(a,e):this.$$html5?e:"";if(!I(e))throw eb("ihshprfx",d,a);Zc(e,this);d=this.$$path;var f=/^\/[A-Z]:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));f.exec(e)||(d=(e=f.exec(d))?e[1]:d);this.$$path=d;this.$$compose()}; this.$$compose=function(){var c=Kb(this.$$search),e=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=ac(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$parseLinkUrl=function(a,c){return Fa(b)==Fa(a)?(this.$$parse(a),!0):!1}}function $c(b,a){this.$$html5=!0;dc.apply(this,arguments);var c=bc(b);this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;b==Fa(d)?f=d:(g=xa(c,d))?f=b+a+g:c===d+"/"&&(f=c);f&&this.$$parse(f);return!!f};this.$$compose= function(){var c=Kb(this.$$search),e=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=ac(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+a+this.$$url}}function Bb(b){return function(){return this[b]}}function ad(b,a){return function(c){if(D(c))return this[b];this[b]=a(c);this.$$compose();return this}}function Ke(){var b="",a={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(a){return A(a)?(b=a,this):b};this.html5Mode=function(b){return Ua(b)?(a.enabled=b,this):L(b)?(Ua(b.enabled)&&(a.enabled= b.enabled),Ua(b.requireBase)&&(a.requireBase=b.requireBase),Ua(b.rewriteLinks)&&(a.rewriteLinks=b.rewriteLinks),this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,f){function g(a,b,c){var e=k.url(),f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(g){throw k.url(e),k.$$state=f,g;}}function h(a,b){c.$broadcast("$locationChangeSuccess",k.absUrl(),a,k.$$state,b)}var k,l;l=d.baseHref();var m=d.url(),p;if(a.enabled){if(!l&&a.requireBase)throw eb("nobase");p=m.substring(0, m.indexOf("/",m.indexOf("//")+2))+(l||"/");l=e.history?cc:$c}else p=Fa(m),l=dc;k=new l(p,"#"+b);k.$$parseLinkUrl(m,m);k.$$state=d.state();var q=/^\s*(javascript|mailto):/i;f.on("click",function(b){if(a.rewriteLinks&&!b.ctrlKey&&!b.metaKey&&2!=b.which){for(var e=y(b.target);"a"!==sa(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var g=e.prop("href"),h=e.attr("href")||e.attr("xlink:href");L(g)&&"[object SVGAnimatedString]"===g.toString()&&(g=Aa(g.animVal).href);q.test(g)||!g||e.attr("target")||b.isDefaultPrevented()|| !k.$$parseLinkUrl(g,h)||(b.preventDefault(),k.absUrl()!=d.url()&&(c.$apply(),T.angular["ff-684208-preventDefault"]=!0))}});k.absUrl()!=m&&d.url(k.absUrl(),!0);var n=!0;d.onUrlChange(function(a,b){c.$evalAsync(function(){var d=k.absUrl(),e=k.$$state,f;k.$$parse(a);k.$$state=b;f=c.$broadcast("$locationChangeStart",a,d,b,e).defaultPrevented;k.absUrl()===a&&(f?(k.$$parse(d),k.$$state=e,g(d,!1,e)):(n=!1,h(d,e)))});c.$$phase||c.$digest()});c.$watch(function(){var a=d.url(),b=d.state(),f=k.$$replace,l=a!== k.absUrl()||k.$$html5&&e.history&&b!==k.$$state;if(n||l)n=!1,c.$evalAsync(function(){var d=k.absUrl(),e=c.$broadcast("$locationChangeStart",d,a,k.$$state,b).defaultPrevented;k.absUrl()===d&&(e?(k.$$parse(a),k.$$state=b):(l&&g(d,f,b===k.$$state?null:k.$$state),h(a,b)))});k.$$replace=!1});return k}]}function Le(){var b=!0,a=this;this.debugEnabled=function(a){return A(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)? "Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||w;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];r(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function qa(b,a){if("__defineGetter__"=== b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===b||"__proto__"===b)throw ja("isecfld",a);return b}function ra(b,a){if(b){if(b.constructor===b)throw ja("isecfn",a);if(b.window===b)throw ja("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw ja("isecdom",a);if(b===Object)throw ja("isecobj",a);}return b}function ec(b){return b.constant}function Oa(b,a,c,d){ra(b,d);a=a.split(".");for(var e,f=0;1<a.length;f++){e=qa(a.shift(),d);var g=ra(b[e],d);g||(g={},b[e]= g);b=g}e=qa(a.shift(),d);ra(b[e],d);return b[e]=c}function Pa(b){return"constructor"==b}function bd(b,a,c,d,e,f,g){qa(b,f);qa(a,f);qa(c,f);qa(d,f);qa(e,f);var h=function(a){return ra(a,f)},k=g||Pa(b)?h:ma,l=g||Pa(a)?h:ma,m=g||Pa(c)?h:ma,p=g||Pa(d)?h:ma,q=g||Pa(e)?h:ma;return function(f,g){var h=g&&g.hasOwnProperty(b)?g:f;if(null==h)return h;h=k(h[b]);if(!a)return h;if(null==h)return t;h=l(h[a]);if(!c)return h;if(null==h)return t;h=m(h[c]);if(!d)return h;if(null==h)return t;h=p(h[d]);return e?null== h?t:h=q(h[e]):h}}function xf(b,a){return function(c,d){return b(c,d,ra,a)}}function cd(b,a,c){var d=a.expensiveChecks,e=d?yf:zf,f=e[b];if(f)return f;var g=b.split("."),h=g.length;if(a.csp)f=6>h?bd(g[0],g[1],g[2],g[3],g[4],c,d):function(a,b){var e=0,f;do f=bd(g[e++],g[e++],g[e++],g[e++],g[e++],c,d)(a,b),b=t,a=f;while(e<h);return f};else{var k="";d&&(k+="s = eso(s, fe);\nl = eso(l, fe);\n");var l=d;r(g,function(a,b){qa(a,c);var e=(b?"s":'((l&&l.hasOwnProperty("'+a+'"))?l:s)')+"."+a;if(d||Pa(a))e="eso("+ e+", fe)",l=!0;k+="if(s == null) return undefined;\ns="+e+";\n"});k+="return s;";a=new Function("s","l","eso","fe",k);a.toString=ba(k);l&&(a=xf(a,c));f=a}f.sharedGetter=!0;f.assign=function(a,c){return Oa(a,b,c,b)};return e[b]=f}function fc(b){return u(b.valueOf)?b.valueOf():Af.call(b)}function Me(){var b=pa(),a=pa();this.$get=["$filter","$sniffer",function(c,d){function e(a){var b=a;a.sharedGetter&&(b=function(b,c){return a(b,c)},b.literal=a.literal,b.constant=a.constant,b.assign=a.assign);return b} function f(a,b){for(var c=0,d=a.length;c<d;c++){var e=a[c];e.constant||(e.inputs?f(e.inputs,b):-1===b.indexOf(e)&&b.push(e))}return b}function g(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=fc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function h(a,b,c,d){var e=d.$$inputs||(d.$$inputs=f(d.inputs,[])),h;if(1===e.length){var k=g,e=e[0];return a.$watch(function(a){var b=e(a);g(b,k)||(h=d(a),k=b&&fc(b));return h},b,c)}for(var l=[],q=0,n=e.length;q<n;q++)l[q]=g;return a.$watch(function(a){for(var b= !1,c=0,f=e.length;c<f;c++){var k=e[c](a);if(b||(b=!g(k,l[c])))l[c]=k&&fc(k)}b&&(h=d(a));return h},b,c)}function k(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;u(b)&&b.apply(this,arguments);A(a)&&d.$$postDigest(function(){A(f)&&e()})},c)}function l(a,b,c,d){function e(a){var b=!0;r(a,function(a){A(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,c,d){g=a;u(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function m(a, b,c,d){var e;return e=a.$watch(function(a){return d(a)},function(a,c,d){u(b)&&b.apply(this,arguments);e()},c)}function p(a,b){if(!b)return a;var c=a.$$watchDelegate,c=c!==l&&c!==k?function(c,d){var e=a(c,d);return b(e,c,d)}:function(c,d){var e=a(c,d),f=b(e,c,d);return A(e)?f:e};a.$$watchDelegate&&a.$$watchDelegate!==h?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=h,c.inputs=[a]);return c}var q={csp:d.csp,expensiveChecks:!1},n={csp:d.csp,expensiveChecks:!0};return function(d, f,g){var r,B,J;switch(typeof d){case "string":J=d=d.trim();var z=g?a:b;r=z[J];r||(":"===d.charAt(0)&&":"===d.charAt(1)&&(B=!0,d=d.substring(2)),g=g?n:q,r=new gc(g),r=(new fb(r,c,g)).parse(d),r.constant?r.$$watchDelegate=m:B?(r=e(r),r.$$watchDelegate=r.literal?l:k):r.inputs&&(r.$$watchDelegate=h),z[J]=r);return p(r,f);case "function":return p(d,f);default:return p(w,f)}}}]}function Oe(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return dd(function(a){b.$evalAsync(a)},a)}]}function Pe(){this.$get= ["$browser","$exceptionHandler",function(b,a){return dd(function(a){b.defer(a)},a)}]}function dd(b,a){function c(a,b,c){function d(b){return function(c){e||(e=!0,b.call(a,c))}}var e=!1;return[d(b),d(c)]}function d(){this.$$state={status:0}}function e(a,b){return function(c){b.call(a,c)}}function f(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,b(function(){var b,d,e;e=c.pending;c.processScheduled=!1;c.pending=t;for(var f=0,g=e.length;f<g;++f){d=e[f][0];b=e[f][c.status];try{u(b)?d.resolve(b(c.value)): 1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),a(h)}}}))}function g(){this.promise=new d;this.resolve=e(this,this.resolve);this.reject=e(this,this.reject);this.notify=e(this,this.notify)}var h=v("$q",TypeError);d.prototype={then:function(a,b,c){var d=new g;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&f(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return l(b, !0,a)},function(b){return l(b,!1,a)},b)}};g.prototype={resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(h("qcycle",a)):this.$$resolve(a))},$$resolve:function(b){var d,e;e=c(this,this.$$resolve,this.$$reject);try{if(L(b)||u(b))d=b&&b.then;u(d)?(this.promise.$$state.status=-1,d.call(b,e[0],e[1],this.notify)):(this.promise.$$state.value=b,this.promise.$$state.status=1,f(this.promise.$$state))}catch(g){e[1](g),a(g)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)}, $$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;f(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&b(function(){for(var b,e,f=0,g=d.length;f<g;f++){e=d[f][0];b=d[f][3];try{e.notify(u(b)?b(c):c)}catch(h){a(h)}}})}};var k=function(a,b){var c=new g;b?c.resolve(a):c.reject(a);return c.promise},l=function(a,b,c){var d=null;try{u(c)&&(d=c())}catch(e){return k(e,!1)}return d&&u(d.then)?d.then(function(){return k(a, b)},function(a){return k(a,!1)}):k(a,b)},m=function(a,b,c,d){var e=new g;e.resolve(a);return e.promise.then(b,c,d)},p=function n(a){if(!u(a))throw h("norslvr",a);if(!(this instanceof n))return new n(a);var b=new g;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};p.defer=function(){return new g};p.reject=function(a){var b=new g;b.reject(a);return b.promise};p.when=m;p.all=function(a){var b=new g,c=0,d=G(a)?[]:{};r(a,function(a,e){c++;m(a).then(function(a){d.hasOwnProperty(e)|| (d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise};return p}function Ye(){this.$get=["$window","$timeout",function(b,a){var c=b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame,d=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.mozCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}}; f.supported=e;return f}]}function Ne(){var b=10,a=v("$rootScope"),c=null,d=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$injector","$exceptionHandler","$parse","$browser",function(e,f,g,h){function k(){this.$id=++kb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$isolateBindings=null}function l(b){if(s.$$phase)throw a("inprog", s.$$phase);s.$$phase=b}function m(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function p(){}function q(){for(;x.length;)try{x.shift()()}catch(a){f(a)}d=null}function n(){null===d&&(d=h.defer(function(){s.$apply(q)}))}k.prototype={constructor:k,$new:function(a,b){function c(){d.$$destroyed=!0}var d;b=b||this;a?(d=new k,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=function(){this.$$watchers=this.$$nextSibling=this.$$childHead= this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$id=++kb;this.$$ChildScope=null},this.$$ChildScope.prototype=this),d=new this.$$ChildScope);d.$parent=b;d.$$prevSibling=b.$$childTail;b.$$childHead?(b.$$childTail.$$nextSibling=d,b.$$childTail=d):b.$$childHead=b.$$childTail=d;(a||b!=this)&&d.$on("$destroy",c);return d},$watch:function(a,b,d){var e=g(a);if(e.$$watchDelegate)return e.$$watchDelegate(this,b,d,e);var f=this.$$watchers,h={fn:b,last:p,get:e,exp:a,eq:!!d};c=null;u(b)|| (h.fn=w);f||(f=this.$$watchers=[]);f.unshift(h);return function(){Va(f,h);c=null}},$watchGroup:function(a,b){function c(){h=!1;k?(k=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});r(a,function(a,b){var k=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(k)});return function(){for(;f.length;)f.shift()()}}, $watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!D(e)){if(L(e))if(Ra(e))for(f!==m&&(f=m,s=f.length=0,l++),a=e.length,s!==a&&(l++,f.length=s=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==q&&(f=q={},s=0,l++);a=0;for(b in e)e.hasOwnProperty(b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(s++,f[b]=g,l++));if(s>a)for(b in l++,f)e.hasOwnProperty(b)||(s--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,h,k=1< b.length,l=0,p=g(a,c),m=[],q={},n=!0,s=0;return this.$watch(p,function(){n?(n=!1,b(e,e,d)):b(e,h,d);if(k)if(L(e))if(Ra(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)Jb.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var e,g,k,m,n,r,x=b,M,t=[],X,S;l("$digest");h.$$checkUrlChange();this===s&&null!==d&&(h.defer.cancel(d),q());c=null;do{r=!1;for(M=this;O.length;){try{S=O.shift(),S.scope.$eval(S.expression)}catch(A){f(A)}c=null}a:do{if(m=M.$$watchers)for(n=m.length;n--;)try{if(e= m[n])if((g=e.get(M))!==(k=e.last)&&!(e.eq?na(g,k):"number"===typeof g&&"number"===typeof k&&isNaN(g)&&isNaN(k)))r=!0,c=e,e.last=e.eq?Ca(g,null):g,e.fn(g,k===p?g:k,M),5>x&&(X=4-x,t[X]||(t[X]=[]),t[X].push({msg:u(e.exp)?"fn: "+(e.exp.name||e.exp.toString()):e.exp,newVal:g,oldVal:k}));else if(e===c){r=!1;break a}}catch(v){f(v)}if(!(m=M.$$childHead||M!==this&&M.$$nextSibling))for(;M!==this&&!(m=M.$$nextSibling);)M=M.$parent}while(M=m);if((r||O.length)&&!x--)throw s.$$phase=null,a("infdig",b,t);}while(r|| O.length);for(s.$$phase=null;E.length;)try{E.shift()()}catch(y){f(y)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;if(this!==s){for(var b in this.$$listenerCount)m(this,this.$$listenerCount[b],b);a.$$childHead==this&&(a.$$childHead=this.$$nextSibling);a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling= this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=w;this.$on=this.$watch=this.$watchGroup=function(){return w};this.$$listeners={};this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a){s.$$phase||O.length||h.defer(function(){O.length&&s.$digest()});O.push({scope:this,expression:a})},$$postDigest:function(a){E.push(a)},$apply:function(a){try{return l("$apply"), this.$eval(a)}catch(b){f(b)}finally{s.$$phase=null;try{s.$digest()}catch(c){throw f(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&x.push(b);n()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,m(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e, stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=Xa([h],arguments,1),l,m;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(m=d.length;l<m;l++)if(d[l])try{d[l].apply(null,k)}catch(p){f(p)}else d.splice(l,1),l--,m--;if(g)return h.currentScope=null,h;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e; for(var g=Xa([e],arguments,1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var s=new k,O=s.$$asyncQueue=[],E=s.$$postDigestQueue=[],x=s.$$applyAsyncQueue=[];return s}]}function Qd(){var b=/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*((https?|ftp|file|blob):|data:image\/)/; this.aHrefSanitizationWhitelist=function(a){return A(a)?(b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=d?a:b,f;f=Aa(c).href;return""===f||f.match(e)?c:"unsafe:"+f}}}function Bf(b){if("self"===b)return b;if(I(b)){if(-1<b.indexOf("***"))throw Ba("iwcard",b);b=ed(b).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+b+"$")}if(lb(b))return new RegExp("^"+b.source+"$");throw Ba("imatcher");}function fd(b){var a= [];A(b)&&r(b,function(b){a.push(Bf(b))});return a}function Re(){this.SCE_CONTEXTS=ka;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=fd(a));return b};this.resourceUrlBlacklist=function(b){arguments.length&&(a=fd(b));return a};this.$get=["$injector",function(c){function d(a,b){return"self"===a?Xc(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()}; b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var f=function(a){throw Ba("unsafe");};c.has("$sanitize")&&(f=c.get("$sanitize"));var g=e(),h={};h[ka.HTML]=e(g);h[ka.CSS]=e(g);h[ka.URL]=e(g);h[ka.JS]=e(g);h[ka.RESOURCE_URL]=e(h[ka.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ba("icontext",a,b);if(null===b||b===t||""===b)return b;if("string"!==typeof b)throw Ba("itype",a);return new c(b)},getTrusted:function(c,e){if(null=== e||e===t||""===e)return e;var g=h.hasOwnProperty(c)?h[c]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(c===ka.RESOURCE_URL){var g=Aa(e.toString()),p,q,n=!1;p=0;for(q=b.length;p<q;p++)if(d(b[p],g)){n=!0;break}if(n)for(p=0,q=a.length;p<q;p++)if(d(a[p],g)){n=!1;break}if(n)return e;throw Ba("insecurl",e.toString());}if(c===ka.HTML)return f(e);throw Ba("unsafe");},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function Qe(){var b=!0;this.enabled=function(a){arguments.length&& (b=!!a);return b};this.$get=["$parse","$sceDelegate",function(a,c){if(b&&8>Ha)throw Ba("iequirks");var d=ta(ka);d.isEnabled=function(){return b};d.trustAs=c.trustAs;d.getTrusted=c.getTrusted;d.valueOf=c.valueOf;b||(d.trustAs=d.getTrusted=function(a,b){return b},d.valueOf=ma);d.parseAs=function(b,c){var e=a(c);return e.literal&&e.constant?e:a(c,function(a){return d.getTrusted(b,a)})};var e=d.parseAs,f=d.getTrusted,g=d.trustAs;r(ka,function(a,b){var c=Q(b);d[bb("parse_as_"+c)]=function(b){return e(a, b)};d[bb("get_trusted_"+c)]=function(b){return f(a,b)};d[bb("trust_as_"+c)]=function(b){return g(a,b)}});return d}]}function Se(){this.$get=["$window","$document",function(b,a){var c={},d=aa((/android (\d+)/.exec(Q((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},g,h=/^(Moz|webkit|ms)(?=[A-Z])/,k=f.body&&f.body.style,l=!1,m=!1;if(k){for(var p in k)if(l=h.exec(p)){g=l[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in k&&"webkit"); l=!!("transition"in k||g+"Transition"in k);m=!!("animation"in k||g+"Animation"in k);!d||l&&m||(l=I(f.body.style.webkitTransition),m=I(f.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hasEvent:function(a){if("input"==a&&9==Ha)return!1;if(D(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:$a(),vendorPrefix:g,transitions:l,animations:m,android:d}}]}function Ue(){this.$get=["$templateCache","$http","$q",function(b,a,c){function d(e,f){d.totalPendingRequests++; var g=a.defaults&&a.defaults.transformResponse;if(G(g))for(var h=g,g=[],k=0;k<h.length;++k){var l=h[k];l!==Yb&&g.push(l)}else g===Yb&&(g=null);return a.get(e,{cache:b,transformResponse:g}).then(function(a){a=a.data;d.totalPendingRequests--;b.put(e,a);return a},function(){d.totalPendingRequests--;if(!f)throw ia("tpload",e);return c.reject()})}d.totalPendingRequests=0;return d}]}function Ve(){this.$get=["$rootScope","$browser","$location",function(b,a,c){return{findBindings:function(a,b,c){a=a.getElementsByClassName("ng-binding"); var g=[];r(a,function(a){var d=va.element(a).data("$binding");d&&r(d,function(d){c?(new RegExp("(^|\\s)"+ed(b)+"(\\s|\\||$)")).test(d)&&g.push(a):-1!=d.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,c){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var k=a.querySelectorAll("["+g[h]+"model"+(c?"=":"*=")+'"'+b+'"]');if(k.length)return k}},getLocation:function(){return c.url()},setLocation:function(a){a!==c.url()&&(c.url(a),b.$digest())},whenStable:function(b){a.notifyWhenNoOutstandingRequests(b)}}}]} function We(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(b,a,c,d,e){function f(f,k,l){var m=A(l)&&!l,p=(m?d:c).defer(),q=p.promise;k=a.defer(function(){try{p.resolve(f())}catch(a){p.reject(a),e(a)}finally{delete g[q.$$timeoutId]}m||b.$apply()},k);q.$$timeoutId=k;g[k]=p;return q}var g={};f.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),delete g[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return f}]}function Aa(b){Ha&&(Z.setAttribute("href", b),b=Z.href);Z.setAttribute("href",b);return{href:Z.href,protocol:Z.protocol?Z.protocol.replace(/:$/,""):"",host:Z.host,search:Z.search?Z.search.replace(/^\?/,""):"",hash:Z.hash?Z.hash.replace(/^#/,""):"",hostname:Z.hostname,port:Z.port,pathname:"/"===Z.pathname.charAt(0)?Z.pathname:"/"+Z.pathname}}function Xc(b){b=I(b)?Aa(b):b;return b.protocol===gd.protocol&&b.host===gd.host}function Xe(){this.$get=ba(T)}function Cc(b){function a(c,d){if(L(c)){var e={};r(c,function(b,c){e[c]=a(c,b)});return e}return b.factory(c+ "Filter",d)}this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];a("currency",hd);a("date",id);a("filter",Cf);a("json",Df);a("limitTo",Ef);a("lowercase",Ff);a("number",jd);a("orderBy",kd);a("uppercase",Gf)}function Cf(){return function(b,a,c){if(!G(b))return b;var d=typeof c,e=[];e.check=function(a,b){for(var c=0;c<e.length;c++)if(!e[c](a,b))return!1;return!0};"function"!==d&&(c="boolean"===d&&c?function(a,b){return va.equals(a,b)}:function(a,b){if(a&& b&&"object"===typeof a&&"object"===typeof b){for(var d in a)if("$"!==d.charAt(0)&&Jb.call(a,d)&&c(a[d],b[d]))return!0;return!1}b=(""+b).toLowerCase();return-1<(""+a).toLowerCase().indexOf(b)});var f=function(a,b){if("string"===typeof b&&"!"===b.charAt(0))return!f(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return c(a,b);case "object":switch(typeof b){case "object":return c(a,b);default:for(var d in a)if("$"!==d.charAt(0)&&f(a[d],b))return!0}return!1;case "array":for(d= 0;d<a.length;d++)if(f(a[d],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a={$:a};case "object":for(var g in a)(function(b){"undefined"!==typeof a[b]&&e.push(function(c){return f("$"==b?c:c&&c[b],a[b])})})(g);break;case "function":e.push(a);break;default:return b}d=[];for(g=0;g<b.length;g++){var h=b[g];e.check(h,g)&&d.push(h)}return d}}function hd(b){var a=b.NUMBER_FORMATS;return function(b,d,e){D(d)&&(d=a.CURRENCY_SYM);D(e)&&(e=2);return null== b?b:ld(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,e).replace(/\u00A4/g,d)}}function jd(b){var a=b.NUMBER_FORMATS;return function(b,d){return null==b?b:ld(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function ld(b,a,c,d,e){if(!isFinite(b)||L(b))return"";var f=0>b;b=Math.abs(b);var g=b+"",h="",k=[],l=!1;if(-1!==g.indexOf("e")){var m=g.match(/([\d\.]+)e(-?)(\d+)/);m&&"-"==m[2]&&m[3]>e+1?(g="0",b=0):(h=g,l=!0)}if(l)0<e&&-1<b&&1>b&&(h=b.toFixed(e));else{g=(g.split(md)[1]||"").length;D(e)&&(e=Math.min(Math.max(a.minFrac, g),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);0===b&&(f=!1);b=(""+b).split(md);g=b[0];b=b[1]||"";var m=0,p=a.lgSize,q=a.gSize;if(g.length>=p+q)for(m=g.length-p,l=0;l<m;l++)0===(m-l)%q&&0!==l&&(h+=c),h+=g.charAt(l);for(l=m;l<g.length;l++)0===(g.length-l)%p&&0!==l&&(h+=c),h+=g.charAt(l);for(;b.length<e;)b+="0";e&&"0"!==e&&(h+=d+b.substr(0,e))}k.push(f?a.negPre:a.posPre);k.push(h);k.push(f?a.negSuf:a.posSuf);return k.join("")}function Cb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b= ""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function $(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Cb(e,a,d)}}function Db(b,a){return function(c,d){var e=c["get"+b](),f=rb(a?"SHORT"+b:b);return d[f][e]}}function nd(b){var a=(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function od(b){return function(a){var c=nd(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))-+c;a=1+Math.round(a/ 6048E5);return Cb(a,b)}}function id(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=aa(b[9]+b[10]),g=aa(b[9]+b[11]));h.call(a,aa(b[1]),aa(b[2])-1,aa(b[3]));f=aa(b[4]||0)-f;g=aa(b[5]||0)-g;h=aa(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e,f){var g= "",h=[],k,l;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;I(c)&&(c=Hf.test(c)?aa(c):a(c));W(c)&&(c=new Date(c));if(!ea(c))return c;for(;e;)(l=If.exec(e))?(h=Xa(h,l,1),e=h.pop()):(h.push(e),e=null);f&&"UTC"===f&&(c=new Date(c.getTime()),c.setMinutes(c.getMinutes()+c.getTimezoneOffset()));r(h,function(a){k=Jf[a];g+=k?k(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Df(){return function(b){return Za(b,!0)}}function Ef(){return function(b,a){W(b)&&(b=b.toString()); if(!G(b)&&!I(b))return b;a=Infinity===Math.abs(Number(a))?Number(a):aa(a);if(I(b))return a?0<=a?b.slice(0,a):b.slice(a,b.length):"";var c=[],d,e;a>b.length?a=b.length:a<-b.length&&(a=-b.length);0<a?(d=0,e=a):(d=b.length+a,e=b.length);for(;d<e;d++)c.push(b[d]);return c}}function kd(b){return function(a,c,d){function e(a,b){return b?function(b,c){return a(c,b)}:a}function f(a,b){var c=typeof a,d=typeof b;return c==d?(ea(a)&&ea(b)&&(a=a.valueOf(),b=b.valueOf()),"string"==c&&(a=a.toLowerCase(),b=b.toLowerCase()), a===b?0:a<b?-1:1):c<d?-1:1}if(!Ra(a))return a;c=G(c)?c:[c];0===c.length&&(c=["+"]);c=c.map(function(a){var c=!1,d=a||ma;if(I(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))c="-"==a.charAt(0),a=a.substring(1);if(""===a)return e(function(a,b){return f(a,b)},c);d=b(a);if(d.constant){var l=d();return e(function(a,b){return f(a[l],b[l])},c)}}return e(function(a,b){return f(d(a),d(b))},c)});return Ya.call(a).sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(0!==e)return e}return 0},d))}}function Ia(b){u(b)&& (b={link:b});b.restrict=b.restrict||"AC";return ba(b)}function pd(b,a,c,d,e){var f=this,g=[],h=f.$$parentForm=b.parent().controller("form")||Eb;f.$error={};f.$$success={};f.$pending=t;f.$name=e(a.name||a.ngForm||"")(c);f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;f.$submitted=!1;h.$addControl(f);f.$rollbackViewValue=function(){r(g,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){r(g,function(a){a.$commitViewValue()})};f.$addControl=function(a){La(a.$name,"input");g.push(a); a.$name&&(f[a.$name]=a)};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];r(f.$pending,function(b,c){f.$setValidity(c,null,a)});r(f.$error,function(b,c){f.$setValidity(c,null,a)});Va(g,a)};qd({ctrl:this,$element:b,set:function(a,b,c){var d=a[b];d?-1===d.indexOf(c)&&d.push(c):a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(Va(d,c),0===d.length&&delete a[b])},parentForm:h,$animate:d});f.$setDirty= function(){d.removeClass(b,Qa);d.addClass(b,Fb);f.$dirty=!0;f.$pristine=!1;h.$setDirty()};f.$setPristine=function(){d.setClass(b,Qa,Fb+" ng-submitted");f.$dirty=!1;f.$pristine=!0;f.$submitted=!1;r(g,function(a){a.$setPristine()})};f.$setUntouched=function(){r(g,function(a){a.$setUntouched()})};f.$setSubmitted=function(){d.addClass(b,"ng-submitted");f.$submitted=!0;h.$setSubmitted()}}function hc(b){b.$formatters.push(function(a){return b.$isEmpty(a)?a:a.toString()})}function gb(b,a,c,d,e,f){var g= a[0].placeholder,h={},k=Q(a[0].type);if(!e.android){var l=!1;a.on("compositionstart",function(a){l=!0});a.on("compositionend",function(){l=!1;m()})}var m=function(b){if(!l){var e=a.val(),f=b&&b.type;Ha&&"input"===(b||h).type&&a[0].placeholder!==g?g=a[0].placeholder:("password"===k||c.ngTrim&&"false"===c.ngTrim||(e=P(e)),(d.$viewValue!==e||""===e&&d.$$hasNativeValidators)&&d.$setViewValue(e,f))}};if(e.hasEvent("input"))a.on("input",m);else{var p,q=function(a){p||(p=f.defer(function(){m(a);p=null}))}; a.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||q(a)});if(e.hasEvent("paste"))a.on("paste cut",q)}a.on("change",m);d.$render=function(){a.val(d.$isEmpty(d.$modelValue)?"":d.$viewValue)}}function Gb(b,a){return function(c,d){var e,f;if(ea(c))return c;if(I(c)){'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substring(1,c.length-1));if(Kf.test(c))return new Date(c);b.lastIndex=0;if(e=b.exec(c))return e.shift(),f=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(), HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(b,c){c<a.length&&(f[a[c]]=+b)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function hb(b,a,c,d){return function(e,f,g,h,k,l,m){function p(a){return A(a)?ea(a)?a:c(a):t}rd(e,f,g,h);gb(e,f,g,h,k,l);var q=h&&h.$options&&h.$options.timezone,n;h.$$parserName=b;h.$parsers.push(function(b){return h.$isEmpty(b)?null:a.test(b)?(b=c(b,n),"UTC"=== q&&b.setMinutes(b.getMinutes()-b.getTimezoneOffset()),b):t});h.$formatters.push(function(a){if(h.$isEmpty(a))n=null;else{if(!ea(a))throw Hb("datefmt",a);if((n=a)&&"UTC"===q){var b=6E4*n.getTimezoneOffset();n=new Date(n.getTime()+b)}return m("date")(a,d,q)}return""});if(A(g.min)||g.ngMin){var s;h.$validators.min=function(a){return h.$isEmpty(a)||D(s)||c(a)>=s};g.$observe("min",function(a){s=p(a);h.$validate()})}if(A(g.max)||g.ngMax){var r;h.$validators.max=function(a){return h.$isEmpty(a)||D(r)||c(a)<= r};g.$observe("max",function(a){r=p(a);h.$validate()})}h.$isEmpty=function(a){return!a||a.getTime&&a.getTime()!==a.getTime()}}}function rd(b,a,c,d){(d.$$hasNativeValidators=L(a[0].validity))&&d.$parsers.push(function(b){var c=a.prop("validity")||{};return c.badInput&&!c.typeMismatch?t:b})}function sd(b,a,c,d,e){if(A(d)){b=b(d);if(!b.constant)throw v("ngModel")("constexpr",c,d);return b(a)}return e}function qd(b){function a(a,b){b&&!f[a]?(l.addClass(e,a),f[a]=!0):!b&&f[a]&&(l.removeClass(e,a),f[a]= !1)}function c(b,c){b=b?"-"+Mb(b,"-"):"";a(ib+b,!0===c);a(td+b,!1===c)}var d=b.ctrl,e=b.$element,f={},g=b.set,h=b.unset,k=b.parentForm,l=b.$animate;f[td]=!(f[ib]=e.hasClass(ib));d.$setValidity=function(b,e,f){e===t?(d.$pending||(d.$pending={}),g(d.$pending,b,f)):(d.$pending&&h(d.$pending,b,f),ud(d.$pending)&&(d.$pending=t));Ua(e)?e?(h(d.$error,b,f),g(d.$$success,b,f)):(g(d.$error,b,f),h(d.$$success,b,f)):(h(d.$error,b,f),h(d.$$success,b,f));d.$pending?(a(vd,!0),d.$valid=d.$invalid=t,c("",null)):(a(vd, !1),d.$valid=ud(d.$error),d.$invalid=!d.$valid,c("",d.$valid));e=d.$pending&&d.$pending[b]?t:d.$error[b]?!1:d.$$success[b]?!0:null;c(b,e);k.$setValidity(b,e,d)}}function ud(b){if(b)for(var a in b)return!1;return!0}function ic(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e==b[m])continue a;c.push(e)}return c}function e(a){if(!G(a)){if(I(a))return a.split(" ");if(L(a)){var b=[];r(a,function(a,c){a&&(b=b.concat(c.split(" ")))}); return b}}return a}return{restrict:"AC",link:function(f,g,h){function k(a,b){var c=g.data("$classCounts")||{},d=[];r(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});g.data("$classCounts",c);return d.join(" ")}function l(b){if(!0===a||f.$index%2===a){var l=e(b||[]);if(!m){var n=k(l,1);h.$addClass(n)}else if(!na(b,m)){var s=e(m),n=d(l,s),l=d(s,l),n=k(n,1),l=k(l,-1);n&&n.length&&c.addClass(g,n);l&&l.length&&c.removeClass(g,l)}}m=ta(b)}var m;f.$watch(h[b],l,!0);h.$observe("class", function(a){l(f.$eval(h[b]))});"ngClass"!==b&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var l=e(f.$eval(h[b]));g===a?(g=k(l,1),h.$addClass(g)):(g=k(l,-1),h.$removeClass(g))}})}}}]}var Lf=/^\/(.+)\/([a-z]*)$/,Q=function(b){return I(b)?b.toLowerCase():b},Jb=Object.prototype.hasOwnProperty,rb=function(b){return I(b)?b.toUpperCase():b},Ha,y,oa,Ya=[].slice,qf=[].splice,Mf=[].push,Ja=Object.prototype.toString,Wa=v("ng"),va=T.angular||(T.angular={}),ab,kb=0;Ha=U.documentMode;w.$inject=[];ma.$inject= [];var G=Array.isArray,P=function(b){return I(b)?b.trim():b},ed=function(b){return b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},$a=function(){if(A($a.isActive_))return $a.isActive_;var b=!(!U.querySelector("[ng-csp]")&&!U.querySelector("[data-ng-csp]"));if(!b)try{new Function("")}catch(a){b=!0}return $a.isActive_=b},ob=["ng-","data-ng-","ng:","x-ng-"],Kd=/[A-Z]/g,tc=!1,Nb,la=1,mb=3,Od={full:"1.3.3",major:1,minor:3,dot:3,codeName:"undersea-arithmetic"};R.expando="ng339"; var wb=R.cache={},ef=1;R._data=function(b){return this.cache[b[this.expando]]||{}};var $e=/([\:\-\_]+(.))/g,af=/^moz([A-Z])/,Nf={mouseleave:"mouseout",mouseenter:"mouseover"},Qb=v("jqLite"),df=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Pb=/<|&#?\w+;/,bf=/<([\w:]+)/,cf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ha={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"], td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ha.optgroup=ha.option;ha.tbody=ha.tfoot=ha.colgroup=ha.caption=ha.thead;ha.th=ha.td;var Ka=R.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===U.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),R(T).on("load",a))},toString:function(){var b=[];r(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?y(this[b]):y(this[this.length+b])},length:0,push:Mf,sort:[].sort, splice:[].splice},yb={};r("multiple selected checked disabled readOnly required open".split(" "),function(b){yb[Q(b)]=b});var Lc={};r("input select option textarea button form details".split(" "),function(b){Lc[b]=!0});var Mc={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};r({data:Sb,removeData:ub},function(b,a){R[a]=b});r({data:Sb,inheritedData:xb,scope:function(b){return y.data(b,"$scope")||xb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return y.data(b, "$isolateScope")||y.data(b,"$isolateScopeNoTemplate")},controller:Hc,injector:function(b){return xb(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Tb,css:function(b,a,c){a=bb(a);if(A(c))b.style[a]=c;else return b.style[a]},attr:function(b,a,c){var d=Q(a);if(yb[d])if(A(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||w).specified?d:t;else if(A(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a, 2),null===b?t:b},prop:function(b,a,c){if(A(c))b[a]=c;else return b[a]},text:function(){function b(a,b){if(D(b)){var d=a.nodeType;return d===la||d===mb?a.textContent:""}a.textContent=b}b.$dv="";return b}(),val:function(b,a){if(D(a)){if(b.multiple&&"select"===sa(b)){var c=[];r(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(D(a))return b.innerHTML;tb(b,!0);b.innerHTML=a},empty:Ic},function(b,a){R.prototype[a]=function(a, d){var e,f,g=this.length;if(b!==Ic&&(2==b.length&&b!==Tb&&b!==Hc?a:d)===t){if(L(a)){for(e=0;e<g;e++)if(b===Sb)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}e=b.$dv;g=e===t?Math.min(g,1):g;for(f=0;f<g;f++){var h=b(this[f],a,d);e=e?e+h:h}return e}for(e=0;e<g;e++)b(this[e],a,d);return this}});r({removeData:ub,on:function a(c,d,e,f){if(A(f))throw Qb("onargs");if(Dc(c)){var g=vb(c,!0);f=g.events;var h=g.handle;h||(h=g.handle=hf(c,f));for(var g=0<=d.indexOf(" ")?d.split(" "):[d],k=g.length;k--;){d= g[k];var l=f[d];l||(f[d]=[],"mouseenter"===d||"mouseleave"===d?a(c,Nf[d],function(a){var c=a.relatedTarget;c&&(c===this||this.contains(c))||h(a,d)}):"$destroy"!==d&&c.addEventListener(d,h,!1),l=f[d]);l.push(e)}}},off:Gc,one:function(a,c,d){a=y(a);a.on(c,function f(){a.off(c,d);a.off(c,f)});a.on(c,d)},replaceWith:function(a,c){var d,e=a.parentNode;tb(a);r(new R(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];r(a.childNodes,function(a){a.nodeType=== la&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){var d=a.nodeType;if(d===la||11===d){c=new R(c);for(var d=0,e=c.length;d<e;d++)a.appendChild(c[d])}},prepend:function(a,c){if(a.nodeType===la){var d=a.firstChild;r(new R(c),function(c){a.insertBefore(c,d)})}},wrap:function(a,c){c=y(c).eq(0).clone()[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:Jc,detach:function(a){Jc(a,!0)},after:function(a,c){var d=a,e=a.parentNode; c=new R(c);for(var f=0,g=c.length;f<g;f++){var h=c[f];e.insertBefore(h,d.nextSibling);d=h}},addClass:Vb,removeClass:Ub,toggleClass:function(a,c,d){c&&r(c.split(" "),function(c){var f=d;D(f)&&(f=!Tb(a,c));(f?Vb:Ub)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Rb,triggerHandler:function(a,c,d){var e,f,g=c.type||c,h=vb(a);if(h=(h=h&&h.events)&& h[g])e={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:w,type:g,target:a},c.type&&(e=H(e,c)),c=ta(h),f=d?[e].concat(d):[e],r(c,function(c){e.isImmediatePropagationStopped()||c.apply(a,f)})}},function(a,c){R.prototype[c]=function(c,e,f){for(var g,h=0,k=this.length;h< k;h++)D(g)?(g=a(this[h],c,e,f),A(g)&&(g=y(g))):Fc(g,a(this[h],c,e,f));return A(g)?g:this};R.prototype.bind=R.prototype.on;R.prototype.unbind=R.prototype.off});cb.prototype={put:function(a,c){this[Ma(a,this.nextUid)]=c},get:function(a){return this[Ma(a,this.nextUid)]},remove:function(a){var c=this[a=Ma(a,this.nextUid)];delete this[a];return c}};var Oc=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,kf=/,/,lf=/^\s*(_?)(\S+?)\1\s*$/,Nc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ea=v("$injector");Lb.$$annotate=Wb;var Of= v("$animate"),Ae=["$provide",function(a){this.$$selectors={};this.register=function(c,d){var e=c+"-animation";if(c&&"."!=c.charAt(0))throw Of("notcsel",c);this.$$selectors[c.substr(1)]=e;a.factory(e,d)};this.classNameFilter=function(a){1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null);return this.$$classNameFilter};this.$get=["$$q","$$asyncCallback","$rootScope",function(a,d,e){function f(d){var f,g=a.defer();g.promise.$$cancelFn=function(){f&&f()};e.$$postDigest(function(){f= d(function(){g.resolve()})});return g.promise}function g(a,c){var d=[],e=[],f=pa();r((a.attr("class")||"").split(/\s+/),function(a){f[a]=!0});r(c,function(a,c){var g=f[c];!1===a&&g?e.push(c):!0!==a||g||d.push(c)});return 0<d.length+e.length&&[d.length?d:null,e.length?e:null]}function h(a,c,d){for(var e=0,f=c.length;e<f;++e)a[c[e]]=d}function k(){m||(m=a.defer(),d(function(){m.resolve();m=null}));return m.promise}function l(a,c){if(va.isObject(c)){var d=H(c.from||{},c.to||{});a.css(d)}}var m;return{animate:function(a, c,d){l(a,{from:c,to:d});return k()},enter:function(a,c,d,e){l(a,e);d?d.after(a):c.prepend(a);return k()},leave:function(a,c){a.remove();return k()},move:function(a,c,d,e){return this.enter(a,c,d,e)},addClass:function(a,c,d){return this.setClass(a,c,[],d)},$$addClassImmediately:function(a,c,d){a=y(a);c=I(c)?c:G(c)?c.join(" "):"";r(a,function(a){Vb(a,c)});l(a,d);return k()},removeClass:function(a,c,d){return this.setClass(a,[],c,d)},$$removeClassImmediately:function(a,c,d){a=y(a);c=I(c)?c:G(c)?c.join(" "): "";r(a,function(a){Ub(a,c)});l(a,d);return k()},setClass:function(a,c,d,e){var k=this,l=!1;a=y(a);var m=a.data("$$animateClasses");m?e&&m.options&&(m.options=va.extend(m.options||{},e)):(m={classes:{},options:e},l=!0);e=m.classes;c=G(c)?c:c.split(" ");d=G(d)?d:d.split(" ");h(e,c,!0);h(e,d,!1);l&&(m.promise=f(function(c){var d=a.data("$$animateClasses");a.removeData("$$animateClasses");if(d){var e=g(a,d.classes);e&&k.$$setClassImmediately(a,e[0],e[1],d.options)}c()}),a.data("$$animateClasses",m)); return m.promise},$$setClassImmediately:function(a,c,d,e){c&&this.$$addClassImmediately(a,c);d&&this.$$removeClassImmediately(a,d);l(a,e);return k()},enabled:w,cancel:w}}]}],ia=v("$compile");vc.$inject=["$provide","$$sanitizeUriProvider"];var pf=/^((?:x|data)[\:\-_])/i,Tc="application/json",Zb={"Content-Type":Tc+";charset=utf-8"},sf=/^\s*(\[|\{[^\{])/,tf=/[\}\]]\s*$/,rf=/^\)\]\}',?\n/,$b=v("$interpolate"),Pf=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,wf={http:80,https:443,ftp:21},eb=v("$location"),Qf={$$html5:!1, $$replace:!1,absUrl:Bb("$$absUrl"),url:function(a){if(D(a))return this.$$url;a=Pf.exec(a);a[1]&&this.path(decodeURIComponent(a[1]));(a[2]||a[1])&&this.search(a[3]||"");this.hash(a[5]||"");return this},protocol:Bb("$$protocol"),host:Bb("$$host"),port:Bb("$$port"),path:ad("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,c){switch(arguments.length){case 0:return this.$$search;case 1:if(I(a)||W(a))a=a.toString(),this.$$search=rc(a);else if(L(a))a=Ca(a, {}),r(a,function(c,e){null==c&&delete a[e]}),this.$$search=a;else throw eb("isrcharg");break;default:D(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:ad("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};r([$c,dc,cc],function(a){a.prototype=Object.create(Qf);a.prototype.state=function(c){if(!arguments.length)return this.$$state;if(a!==cc||!this.$$html5)throw eb("nostate");this.$$state=D(c)?null:c;return this}}); var ja=v("$parse"),Rf=Function.prototype.call,Sf=Function.prototype.apply,Tf=Function.prototype.bind,Ib=pa();r({"null":function(){return null},"true":function(){return!0},"false":function(){return!1},undefined:function(){}},function(a,c){a.constant=a.literal=a.sharedGetter=!0;Ib[c]=a});Ib["this"]=function(a){return a};Ib["this"].sharedGetter=!0;var jb=H(pa(),{"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return A(d)?A(e)?d+e:d:A(e)?e:t},"-":function(a,c,d,e){d=d(a,c);e=e(a,c);return(A(d)?d:0)-(A(e)?e:0)}, "*":function(a,c,d,e){return d(a,c)*e(a,c)},"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"===":function(a,c,d,e){return d(a,c)===e(a,c)},"!==":function(a,c,d,e){return d(a,c)!==e(a,c)},"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a, c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"!":function(a,c,d){return!d(a,c)},"=":!0,"|":!0}),Uf={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},gc=function(a){this.options=a};gc.prototype={constructor:gc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(a))this.readIdent(); else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var c=a+this.peek(),d=c+this.peek(2),e=jb[c],f=jb[d];jb[a]||e||f?(a=f?d:e?c:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,c){return-1!==c.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+ a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=A(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw ja("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index< this.text.length;){var d=Q(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:c,text:a,constant:!0,value:Number(a)})},readIdent:function(){for(var a=this.index;this.index<this.text.length;){var c= this.text.charAt(this.index);if(!this.isIdent(c)&&!this.isNumber(c))break;this.index++}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var g=this.text.charAt(this.index),e=e+g;if(f)"u"===g?(f=this.text.substring(this.index+1,this.index+5),f.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+f+"]"),this.index+=4,d+=String.fromCharCode(parseInt(f,16))): d+=Uf[g]||g,f=!1;else if("\\"===g)f=!0;else{if(g===a){this.index++;this.tokens.push({index:c,text:e,constant:!0,value:d});return}d+=g}this.index++}this.throwError("Unterminated quote",c)}};var fb=function(a,c,d){this.lexer=a;this.$filter=c;this.options=d};fb.ZERO=H(function(){return 0},{sharedGetter:!0,constant:!0});fb.prototype={constructor:fb,parse:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.statements();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]); a.literal=!!a.literal;a.constant=!!a.constant;return a},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var c,d;c=this.expect("(","[",".");)"("===c.text?(a=this.functionCall(a,d),d=null):"["===c.text?(d=a,a=this.objectIndex(a)):"."===c.text?(d=a,a= this.fieldAccess(a)):this.throwError("IMPOSSIBLE");return a},throwError:function(a,c){throw ja("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},peekToken:function(){if(0===this.tokens.length)throw ja("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){return this.peekAhead(0,a,c,d,e)},peekAhead:function(a,c,d,e,f){if(this.tokens.length>a){a=this.tokens[a];var g=a.text;if(g===c||g===d||g===e||g===f||!(c||d||e||f))return a}return!1},expect:function(a,c,d,e){return(a= this.peek(a,c,d,e))?(this.tokens.shift(),a):!1},consume:function(a){if(0===this.tokens.length)throw ja("ueoe",this.text);var c=this.expect(a);c||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return c},unaryFn:function(a,c){var d=jb[a];return H(function(a,f){return d(a,f,c)},{constant:c.constant,inputs:[c]})},binaryFn:function(a,c,d,e){var f=jb[c];return H(function(c,e){return f(c,e,a,d)},{constant:a.constant&&d.constant,inputs:!e&&[a,d]})},identifier:function(){for(var a=this.consume().text;this.peek(".")&& this.peekAhead(1).identifier&&!this.peekAhead(2,"(");)a+=this.consume().text+this.consume().text;return Ib[a]||cd(a,this.options,this.text)},constant:function(){var a=this.consume().value;return H(function(){return a},{constant:!0,literal:!0})},statements:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.filterChain()),!this.expect(";"))return 1===a.length?a[0]:function(c,d){for(var e,f=0,g=a.length;f<g;f++)e=a[f](c,d);return e}},filterChain:function(){for(var a= this.expression();this.expect("|");)a=this.filter(a);return a},filter:function(a){var c=this.$filter(this.consume().text),d,e;if(this.peek(":"))for(d=[],e=[];this.expect(":");)d.push(this.expression());var f=[a].concat(d||[]);return H(function(f,h){var k=a(f,h);if(e){e[0]=k;for(k=d.length;k--;)e[k+1]=d[k](f,h);return c.apply(t,e)}return c(k)},{constant:!c.$stateful&&f.every(ec),inputs:!c.$stateful&&f})},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary(),c,d; return(d=this.expect("="))?(a.assign||this.throwError("implies assignment but ["+this.text.substring(0,d.index)+"] can not be assigned to",d),c=this.ternary(),H(function(d,f){return a.assign(d,c(d,f),f)},{inputs:[a,c]})):a},ternary:function(){var a=this.logicalOR(),c;if(this.expect("?")&&(c=this.assignment(),this.consume(":"))){var d=this.assignment();return H(function(e,f){return a(e,f)?c(e,f):d(e,f)},{constant:a.constant&&c.constant&&d.constant})}return a},logicalOR:function(){for(var a=this.logicalAND(), c;c=this.expect("||");)a=this.binaryFn(a,c.text,this.logicalAND(),!0);return a},logicalAND:function(){var a=this.equality(),c;if(c=this.expect("&&"))a=this.binaryFn(a,c.text,this.logicalAND(),!0);return a},equality:function(){var a=this.relational(),c;if(c=this.expect("==","!=","===","!=="))a=this.binaryFn(a,c.text,this.equality());return a},relational:function(){var a=this.additive(),c;if(c=this.expect("<",">","<=",">="))a=this.binaryFn(a,c.text,this.relational());return a},additive:function(){for(var a= this.multiplicative(),c;c=this.expect("+","-");)a=this.binaryFn(a,c.text,this.multiplicative());return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a=this.binaryFn(a,c.text,this.unary());return a},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(fb.ZERO,a.text,this.unary()):(a=this.expect("!"))?this.unaryFn(a.text,this.unary()):this.primary()},fieldAccess:function(a){var c=this.text,d=this.consume().text,e=cd(d,this.options, c);return H(function(c,d,h){return e(h||a(c,d))},{assign:function(e,g,h){(h=a(e,h))||a.assign(e,h={});return Oa(h,d,g,c)}})},objectIndex:function(a){var c=this.text,d=this.expression();this.consume("]");return H(function(e,f){var g=a(e,f),h=d(e,f);qa(h,c);return g?ra(g[h],c):t},{assign:function(e,f,g){var h=qa(d(e,g),c);(g=ra(a(e,g),c))||a.assign(e,g={});return g[h]=f}})},functionCall:function(a,c){var d=[];if(")"!==this.peekToken().text){do d.push(this.expression());while(this.expect(","))}this.consume(")"); var e=this.text,f=d.length?[]:null;return function(g,h){var k=c?c(g,h):g,l=a(g,h,k)||w;if(f)for(var m=d.length;m--;)f[m]=ra(d[m](g,h),e);ra(k,e);if(l){if(l.constructor===l)throw ja("isecfn",e);if(l===Rf||l===Sf||l===Tf)throw ja("isecff",e);}k=l.apply?l.apply(k,f):l(f[0],f[1],f[2],f[3],f[4]);return ra(k,e)}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return H(function(c,d){for(var e= [],f=0,g=a.length;f<g;f++)e.push(a[f](c,d));return e},{literal:!0,constant:a.every(ec),inputs:a})},object:function(){var a=[],c=[];if("}"!==this.peekToken().text){do{if(this.peek("}"))break;var d=this.consume();d.constant?a.push(d.value):d.identifier?a.push(d.text):this.throwError("invalid key",d);this.consume(":");c.push(this.expression())}while(this.expect(","))}this.consume("}");return H(function(d,f){for(var g={},h=0,k=c.length;h<k;h++)g[a[h]]=c[h](d,f);return g},{literal:!0,constant:c.every(ec), inputs:c})}};var zf=pa(),yf=pa(),Af=Object.prototype.valueOf,Ba=v("$sce"),ka={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ia=v("$compile"),Z=U.createElement("a"),gd=Aa(T.location.href);Cc.$inject=["$provide"];hd.$inject=["$locale"];jd.$inject=["$locale"];var md=".",Jf={yyyy:$("FullYear",4),yy:$("FullYear",2,0,!0),y:$("FullYear",1),MMMM:Db("Month"),MMM:Db("Month",!0),MM:$("Month",2,1),M:$("Month",1,1),dd:$("Date",2),d:$("Date",1),HH:$("Hours",2),H:$("Hours",1),hh:$("Hours", 2,-12),h:$("Hours",1,-12),mm:$("Minutes",2),m:$("Minutes",1),ss:$("Seconds",2),s:$("Seconds",1),sss:$("Milliseconds",3),EEEE:Db("Day"),EEE:Db("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(Cb(Math[0<a?"floor":"ceil"](a/60),2)+Cb(Math.abs(a%60),2))},ww:od(2),w:od(1)},If=/((?:[^yMdHhmsaZEw']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|w+))(.*)/,Hf=/^\-?\d+$/;id.$inject=["$locale"];var Ff=ba(Q),Gf=ba(rb); kd.$inject=["$parse"];var Rd=ba({restrict:"E",compile:function(a,c){if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){var f="[object SVGAnimatedString]"===Ja.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}),sb={};r(yb,function(a,c){if("multiple"!=a){var d=wa("ng-"+c);sb[d]=function(){return{restrict:"A",priority:100,link:function(a,f,g){a.$watch(g[d],function(a){g.$set(c,!!a)})}}}}});r(Mc,function(a,c){sb[c]=function(){return{priority:100, link:function(a,e,f){if("ngPattern"===c&&"/"==f.ngPattern.charAt(0)&&(e=f.ngPattern.match(Lf))){f.$set("ngPattern",new RegExp(e[1],e[2]));return}a.$watch(f[c],function(a){f.$set(c,a)})}}}});r(["src","srcset","href"],function(a){var c=wa("ng-"+a);sb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,h=a;"href"===a&&"[object SVGAnimatedString]"===Ja.call(e.prop("href"))&&(h="xlinkHref",f.$attr[h]="xlink:href",g=null);f.$observe(c,function(c){c?(f.$set(h,c),Ha&&g&&e.prop(g,f[h])):"href"=== a&&f.$set(h,null)})}}}});var Eb={$addControl:w,$$renameControl:function(a,c){a.$name=c},$removeControl:w,$setValidity:w,$setDirty:w,$setPristine:w,$setSubmitted:w};pd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var wd=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:pd,compile:function(a){a.addClass(Qa).addClass(ib);return{pre:function(a,d,g,h){if(!("action"in g)){var k=function(c){a.$apply(function(){h.$commitViewValue();h.$setSubmitted()}); c.preventDefault?c.preventDefault():c.returnValue=!1};d[0].addEventListener("submit",k,!1);d.on("$destroy",function(){c(function(){d[0].removeEventListener("submit",k,!1)},0,!1)})}var l=h.$$parentForm,m=h.$name;m&&(Oa(a,m,h,m),g.$observe(g.name?"name":"ngForm",function(c){m!==c&&(Oa(a,m,t,m),m=c,Oa(a,m,h,m),l.$$renameControl(h,m))}));d.on("$destroy",function(){l.$removeControl(h);m&&Oa(a,m,t,m);H(h,Eb)})}}}}}]},Sd=wd(),ee=wd(!0),Kf=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/, Vf=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Wf=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Xf=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,xd=/^(\d{4})-(\d{2})-(\d{2})$/,yd=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,jc=/^(\d{4})-W(\d\d)$/,zd=/^(\d{4})-(\d\d)$/,Ad=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Yf=/(\s+|^)default(\s+|$)/,Hb=new v("ngModel"),Bd={text:function(a,c,d,e,f,g){gb(a, c,d,e,f,g);hc(e)},date:hb("date",xd,Gb(xd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":hb("datetimelocal",yd,Gb(yd,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:hb("time",Ad,Gb(Ad,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:hb("week",jc,function(a,c){if(ea(a))return a;if(I(a)){jc.lastIndex=0;var d=jc.exec(a);if(d){var e=+d[1],f=+d[2],g=d=0,h=0,k=0,l=nd(e),f=7*(f-1);c&&(d=c.getHours(),g=c.getMinutes(),h=c.getSeconds(),k=c.getMilliseconds());return new Date(e,0,l.getDate()+ f,d,g,h,k)}}return NaN},"yyyy-Www"),month:hb("month",zd,Gb(zd,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,g){rd(a,c,d,e);gb(a,c,d,e,f,g);e.$$parserName="number";e.$parsers.push(function(a){return e.$isEmpty(a)?null:Xf.test(a)?parseFloat(a):t});e.$formatters.push(function(a){if(!e.$isEmpty(a)){if(!W(a))throw Hb("numfmt",a);a=a.toString()}return a});if(d.min||d.ngMin){var h;e.$validators.min=function(a){return e.$isEmpty(a)||D(h)||a>=h};d.$observe("min",function(a){A(a)&&!W(a)&&(a=parseFloat(a, 10));h=W(a)&&!isNaN(a)?a:t;e.$validate()})}if(d.max||d.ngMax){var k;e.$validators.max=function(a){return e.$isEmpty(a)||D(k)||a<=k};d.$observe("max",function(a){A(a)&&!W(a)&&(a=parseFloat(a,10));k=W(a)&&!isNaN(a)?a:t;e.$validate()})}},url:function(a,c,d,e,f,g){gb(a,c,d,e,f,g);hc(e);e.$$parserName="url";e.$validators.url=function(a){return e.$isEmpty(a)||Vf.test(a)}},email:function(a,c,d,e,f,g){gb(a,c,d,e,f,g);hc(e);e.$$parserName="email";e.$validators.email=function(a){return e.$isEmpty(a)||Wf.test(a)}}, radio:function(a,c,d,e){D(d.name)&&c.attr("name",++kb);c.on("click",function(a){c[0].checked&&e.$setViewValue(d.value,a&&a.type)});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e,f,g,h,k){var l=sd(k,a,"ngTrueValue",d.ngTrueValue,!0),m=sd(k,a,"ngFalseValue",d.ngFalseValue,!1);c.on("click",function(a){e.$setViewValue(c[0].checked,a&&a.type)});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return a!==l};e.$formatters.push(function(a){return na(a, l)});e.$parsers.push(function(a){return a?l:m})},hidden:w,button:w,submit:w,reset:w,file:w},wc=["$browser","$sniffer","$filter","$parse",function(a,c,d,e){return{restrict:"E",require:["?ngModel"],link:{pre:function(f,g,h,k){k[0]&&(Bd[Q(h.type)]||Bd.text)(f,g,h,k[0],c,a,d,e)}}}}],ib="ng-valid",td="ng-invalid",Qa="ng-pristine",Fb="ng-dirty",vd="ng-pending",Zf=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,c,d,e,f,g,h,k,l, m){this.$modelValue=this.$viewValue=Number.NaN;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=t;this.$name=m(d.name||"",!1)(a);var p=f(d.ngModel),q=null,n=this,s=function(){var c=p(a);n.$options&&n.$options.getterSetter&&u(c)&&(c=c());return c},O=function(c){var d;n.$options&&n.$options.getterSetter&& u(d=p(a))?d(n.$modelValue):p.assign(a,n.$modelValue)};this.$$setOptions=function(a){n.$options=a;if(!(p.assign||a&&a.getterSetter))throw Hb("nonassign",d.ngModel,ua(e));};this.$render=w;this.$isEmpty=function(a){return D(a)||""===a||null===a||a!==a};var E=e.inheritedData("$formController")||Eb,x=0;qd({ctrl:this,$element:e,set:function(a,c){a[c]=!0},unset:function(a,c){delete a[c]},parentForm:E,$animate:g});this.$setPristine=function(){n.$dirty=!1;n.$pristine=!0;g.removeClass(e,Fb);g.addClass(e,Qa)}; this.$setUntouched=function(){n.$touched=!1;n.$untouched=!0;g.setClass(e,"ng-untouched","ng-touched")};this.$setTouched=function(){n.$touched=!0;n.$untouched=!1;g.setClass(e,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){h.cancel(q);n.$viewValue=n.$$lastCommittedViewValue;n.$render()};this.$validate=function(){W(n.$modelValue)&&isNaN(n.$modelValue)||this.$$parseAndValidate()};this.$$runValidators=function(a,c,d,e){function f(){var a=!0;r(n.$validators,function(e,f){var g=e(c,d); a=a&&g;h(f,g)});return a?!0:(r(n.$asyncValidators,function(a,c){h(c,null)}),!1)}function g(){var a=[],e=!0;r(n.$asyncValidators,function(f,g){var k=f(c,d);if(!k||!u(k.then))throw Hb("$asyncValidators",k);h(g,t);a.push(k.then(function(){h(g,!0)},function(a){e=!1;h(g,!1)}))});a.length?l.all(a).then(function(){k(e)},w):k(!0)}function h(a,c){m===x&&n.$setValidity(a,c)}function k(a){m===x&&e(a)}x++;var m=x;(function(a){var c=n.$$parserName||"parse";if(a===t)h(c,null);else if(h(c,a),!a)return r(n.$validators, function(a,c){h(c,null)}),r(n.$asyncValidators,function(a,c){h(c,null)}),!1;return!0})(a)?f()?g():k(!1):k(!1)};this.$commitViewValue=function(){var a=n.$viewValue;h.cancel(q);if(n.$$lastCommittedViewValue!==a||""===a&&n.$$hasNativeValidators)n.$$lastCommittedViewValue=a,n.$pristine&&(n.$dirty=!0,n.$pristine=!1,g.removeClass(e,Qa),g.addClass(e,Fb),E.$setDirty()),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var a=n.$$lastCommittedViewValue,c=a,d=D(c)?t:!0;if(d)for(var e=0;e<n.$parsers.length;e++)if(c= n.$parsers[e](c),D(c)){d=!1;break}W(n.$modelValue)&&isNaN(n.$modelValue)&&(n.$modelValue=s());var f=n.$modelValue,g=n.$options&&n.$options.allowInvalid;g&&(n.$modelValue=c,n.$modelValue!==f&&n.$$writeModelToScope());n.$$runValidators(d,c,a,function(a){g||(n.$modelValue=a?c:t,n.$modelValue!==f&&n.$$writeModelToScope())})};this.$$writeModelToScope=function(){O(n.$modelValue);r(n.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};this.$setViewValue=function(a,c){n.$viewValue=a;n.$options&&!n.$options.updateOnDefault|| n.$$debounceViewValueCommit(c)};this.$$debounceViewValueCommit=function(c){var d=0,e=n.$options;e&&A(e.debounce)&&(e=e.debounce,W(e)?d=e:W(e[c])?d=e[c]:W(e["default"])&&(d=e["default"]));h.cancel(q);d?q=h(function(){n.$commitViewValue()},d):k.$$phase?n.$commitViewValue():a.$apply(function(){n.$commitViewValue()})};a.$watch(function(){var a=s();if(a!==n.$modelValue){n.$modelValue=a;for(var c=n.$formatters,d=c.length,e=a;d--;)e=c[d](e);n.$viewValue!==e&&(n.$viewValue=n.$$lastCommittedViewValue=e,n.$render(), n.$$runValidators(t,a,e,w))}return a})}],te=function(){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Zf,priority:1,compile:function(a){a.addClass(Qa).addClass("ng-untouched").addClass(ib);return{pre:function(a,d,e,f){var g=f[0],h=f[1]||Eb;g.$$setOptions(f[2]&&f[2].$options);h.$addControl(g);e.$observe("name",function(a){g.$name!==a&&h.$$renameControl(g,a)});a.$on("$destroy",function(){h.$removeControl(g)})},post:function(a,d,e,f){var g=f[0];if(g.$options&&g.$options.updateOn)d.on(g.$options.updateOn, function(a){g.$$debounceViewValueCommit(a&&a.type)});d.on("blur",function(d){g.$touched||a.$apply(function(){g.$setTouched()})})}}}}},ve=ba({restrict:"A",require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),yc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){e&&(d.required=!0,e.$validators.required=function(a){return!d.required||!e.$isEmpty(a)},d.$observe("required",function(){e.$validate()}))}}},xc=function(){return{restrict:"A", require:"?ngModel",link:function(a,c,d,e){if(e){var f,g=d.ngPattern||d.pattern;d.$observe("pattern",function(a){I(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw v("ngPattern")("noregexp",g,a,ua(c));f=a||t;e.$validate()});e.$validators.pattern=function(a){return e.$isEmpty(a)||D(f)||f.test(a)}}}}},Ac=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("maxlength",function(a){f=aa(a)||0;e.$validate()});e.$validators.maxlength=function(a,c){return e.$isEmpty(a)|| c.length<=f}}}}},zc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("minlength",function(a){f=aa(a)||0;e.$validate()});e.$validators.minlength=function(a,c){return e.$isEmpty(a)||c.length>=f}}}}},ue=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,c,d,e){var f=c.attr(d.$attr.ngList)||", ",g="false"!==d.ngTrim,h=g?P(f):f;e.$parsers.push(function(a){if(!D(a)){var c=[];a&&r(a.split(h),function(a){a&&c.push(g?P(a):a)});return c}}); e.$formatters.push(function(a){return G(a)?a.join(f):t});e.$isEmpty=function(a){return!a||!a.length}}}},$f=/^(true|false|\d+)$/,we=function(){return{restrict:"A",priority:100,compile:function(a,c){return $f.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a)})}}}},xe=function(){return{restrict:"A",controller:["$scope","$attrs",function(a,c){var d=this;this.$options=a.$eval(c.ngModelOptions);this.$options.updateOn!==t? (this.$options.updateOnDefault=!1,this.$options.updateOn=P(this.$options.updateOn.replace(Yf,function(){d.$options.updateOnDefault=!0;return" "}))):this.$options.updateOnDefault=!0}]}},Xd=["$compile",function(a){return{restrict:"AC",compile:function(c){a.$$addBindingClass(c);return function(c,e,f){a.$$addBindingInfo(e,f.ngBind);e=e[0];c.$watch(f.ngBind,function(a){e.textContent=a===t?"":a})}}}}],Zd=["$interpolate","$compile",function(a,c){return{compile:function(d){c.$$addBindingClass(d);return function(d, f,g){d=a(f.attr(g.$attr.ngBindTemplate));c.$$addBindingInfo(f,d.expressions);f=f[0];g.$observe("ngBindTemplate",function(a){f.textContent=a===t?"":a})}}}}],Yd=["$sce","$parse","$compile",function(a,c,d){return{restrict:"A",compile:function(e,f){var g=c(f.ngBindHtml),h=c(f.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(e);return function(c,e,f){d.$$addBindingInfo(e,f.ngBindHtml);c.$watch(h,function(){e.html(a.getTrustedHtml(g(c))||"")})}}}}],$d=ic("",!0),be=ic("Odd",0),ae=ic("Even", 1),ce=Ia({compile:function(a,c){c.$set("ngCloak",t);a.removeClass("ng-cloak")}}),de=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Bc={},ag={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=wa("ng-"+a);Bc[c]=["$parse","$rootScope",function(d,e){return{restrict:"A",compile:function(f,g){var h=d(g[c],null,!0);return function(c,d){d.on(a, function(d){var f=function(){h(c,{$event:d})};ag[a]&&e.$$phase?c.$evalAsync(f):c.$apply(f)})}}}}]});var ge=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,k,l;c.$watch(e.ngIf,function(c){c?k||g(function(c,f){k=f;c[c.length++]=U.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)}):(l&&(l.remove(),l=null),k&&(k.$destroy(),k=null),h&&(l=qb(h.clone),a.leave(l).then(function(){l=null}), h=null))})}}}],he=["$templateRequest","$anchorScroll","$animate","$sce",function(a,c,d,e){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:va.noop,compile:function(f,g){var h=g.ngInclude||g.src,k=g.onload||"",l=g.autoscroll;return function(f,g,q,n,r){var t=0,E,x,B,v=function(){x&&(x.remove(),x=null);E&&(E.$destroy(),E=null);B&&(d.leave(B).then(function(){x=null}),x=B,B=null)};f.$watch(e.parseAsResourceUrl(h),function(e){var h=function(){!A(l)||l&&!f.$eval(l)||c()},q= ++t;e?(a(e,!0).then(function(a){if(q===t){var c=f.$new();n.template=a;a=r(c,function(a){v();d.enter(a,null,g).then(h)});E=c;B=a;E.$emit("$includeContentLoaded",e);f.$eval(k)}},function(){q===t&&(v(),f.$emit("$includeContentError",e))}),f.$emit("$includeContentRequested",e)):(v(),n.template=null)})}}}}],ye=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){/SVG/.test(d[0].toString())?(d.empty(),a(Ec(f.template,U).childNodes)(c,function(a){d.append(a)}, {futureParentElement:d})):(d.html(f.template),a(d.contents())(c))}}}],ie=Ia({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),je=Ia({terminal:!0,priority:1E3}),ke=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,f,g){var h=g.count,k=g.$attr.when&&f.attr(g.$attr.when),l=g.offset||0,m=e.$eval(k)||{},p={},q=c.startSymbol(),n=c.endSymbol(),s=/^when(Minus)?(.+)$/;r(g,function(a,c){s.test(c)&&(m[Q(c.replace("when","").replace("Minus", "-"))]=f.attr(g.$attr[c]))});r(m,function(a,e){p[e]=c(a.replace(d,q+h+"-"+l+n))});e.$watch(function(){var c=parseFloat(e.$eval(h));if(isNaN(c))return"";c in m||(c=a.pluralCat(c-l));return p[c](e)},function(a){f.text(a)})}}}],le=["$parse","$animate",function(a,c){var d=v("ngRepeat"),e=function(a,c,d,e,l,m,p){a[d]=e;l&&(a[l]=m);a.$index=c;a.$first=0===c;a.$last=c===p-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(c&1))};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,terminal:!0, $$tlb:!0,compile:function(f,g){var h=g.ngRepeat,k=U.createComment(" end ngRepeat: "+h+" "),l=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!l)throw d("iexp",h);var m=l[1],p=l[2],q=l[3],n=l[4],l=m.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!l)throw d("iidexp",m);var s=l[3]||l[1],A=l[2];if(q&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(q)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent)$/.test(q)))throw d("badident", q);var v,x,B,J,z={$id:Ma};n?v=a(n):(B=function(a,c){return Ma(c)},J=function(a){return a});return function(a,f,g,l,n){v&&(x=function(c,d,e){A&&(z[A]=c);z[s]=d;z.$index=e;return v(a,z)});var m=pa();a.$watchCollection(p,function(g){var l,p,C=f[0],v,z=pa(),E,H,w,D,G,u,I;q&&(a[q]=g);if(Ra(g))G=g,p=x||B;else{p=x||J;G=[];for(I in g)g.hasOwnProperty(I)&&"$"!=I.charAt(0)&&G.push(I);G.sort()}E=G.length;I=Array(E);for(l=0;l<E;l++)if(H=g===G?l:G[l],w=g[H],D=p(H,w,l),m[D])u=m[D],delete m[D],z[D]=u,I[l]=u;else{if(z[D])throw r(I, function(a){a&&a.scope&&(m[a.id]=a)}),d("dupes",h,D,w);I[l]={id:D,scope:t,clone:t};z[D]=!0}for(v in m){u=m[v];D=qb(u.clone);c.leave(D);if(D[0].parentNode)for(l=0,p=D.length;l<p;l++)D[l].$$NG_REMOVED=!0;u.scope.$destroy()}for(l=0;l<E;l++)if(H=g===G?l:G[l],w=g[H],u=I[l],u.scope){v=C;do v=v.nextSibling;while(v&&v.$$NG_REMOVED);u.clone[0]!=v&&c.move(qb(u.clone),null,y(C));C=u.clone[u.clone.length-1];e(u.scope,l,s,w,A,H,E)}else n(function(a,d){u.scope=d;var f=k.cloneNode(!1);a[a.length++]=f;c.enter(a, null,y(C));C=f;u.clone=a;z[u.id]=u;e(u.scope,l,s,w,A,H,E)});m=z})}}}}],me=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngShow,function(c){a[c?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],fe=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngHide,function(c){a[c?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],ne=Ia(function(a,c,d){a.$watch(d.ngStyle, function(a,d){d&&a!==d&&r(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),oe=["$animate",function(a){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var g=[],h=[],k=[],l=[],m=function(a,c){return function(){a.splice(c,1)}};c.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=k.length;d<e;++d)a.cancel(k[d]);d=k.length=0;for(e=l.length;d<e;++d){var s=qb(h[d].clone);l[d].$destroy();(k[d]=a.leave(s)).then(m(k,d))}h.length=0;l.length=0; (g=f.cases["!"+c]||f.cases["?"])&&r(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=U.createComment(" end ngSwitchWhen: ");h.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],pe=Ia({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),qe=Ia({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0, link:function(a,c,d,e,f){e.cases["?"]=e.cases["?"]||[];e.cases["?"].push({transclude:f,element:c})}}),se=Ia({restrict:"EAC",link:function(a,c,d,e,f){if(!f)throw v("ngTransclude")("orphan",ua(c));f(function(a){c.empty();c.append(a)})}}),Td=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],bg=v("ngOptions"),re=ba({restrict:"A",terminal:!0}),Ud=["$compile","$parse",function(a,c){var d=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/, e={$setViewValue:w};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var k=this,l={},m=e,p;k.databound=d.ngModel;k.init=function(a,c,d){m=a;p=d};k.addOption=function(c,d){La(c,'"option value"');l[c]=!0;m.$viewValue==c&&(a.val(c),p.parent()&&p.remove());d&&d[0].hasAttribute("selected")&&(d[0].selected=!0)};k.removeOption=function(a){this.hasOption(a)&&(delete l[a],m.$viewValue==a&&this.renderUnknownOption(a))};k.renderUnknownOption=function(c){c= "? "+Ma(c)+" ?";p.val(c);a.prepend(p);a.val(c);p.prop("selected",!0)};k.hasOption=function(a){return l.hasOwnProperty(a)};c.$on("$destroy",function(){k.renderUnknownOption=w})}],link:function(e,g,h,k){function l(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(z.parent()&&z.remove(),c.val(a),""===a&&u.prop("selected",!0)):D(a)&&u?c.val(""):e.renderUnknownOption(a)};c.on("change",function(){a.$apply(function(){z.parent()&&z.remove();d.$setViewValue(c.val())})})}function m(a,c,d){var e; d.$render=function(){var a=new cb(d.$viewValue);r(c.find("option"),function(c){c.selected=A(a.get(c.value))})};a.$watch(function(){na(e,d.$viewValue)||(e=ta(d.$viewValue),d.$render())});c.on("change",function(){a.$apply(function(){var a=[];r(c.find("option"),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}function p(e,f,g){function h(a,c,d){T[z]=d;F&&(T[F]=c);return a(e,T)}function k(a){var c;if(n)if(L&&G(a)){c=new cb([]);for(var d=0;d<a.length;d++)c.put(h(L,null,a[d]),!0)}else c= new cb(a);else L&&(a=h(L,null,a));return function(d,e){var f;f=L?L:w?w:E;return n?A(c.remove(h(f,d,e))):a===h(f,d,e)}}function l(){x||(e.$$postDigest(p),x=!0)}function m(a,c,d){a[c]=a[c]||0;a[c]+=d?1:-1}function p(){x=!1;var a={"":[]},c=[""],d,l,s,t,u;s=g.$viewValue;t=N(e)||[];var z=F?Object.keys(t).sort():t,w,y,G,E,S={};u=k(s);var P=!1,U,W;R={};for(E=0;G=z.length,E<G;E++){w=E;if(F&&(w=z[E],"$"===w.charAt(0)))continue;y=t[w];d=h(I,w,y)||"";(l=a[d])||(l=a[d]=[],c.push(d));d=u(w,y);P=P||d;y=h(D,w,y); y=A(y)?y:"";W=L?L(e,T):F?z[E]:E;L&&(R[W]=w);l.push({id:W,label:y,selected:d})}n||(v||null===s?a[""].unshift({id:"",label:"",selected:!P}):P||a[""].unshift({id:"?",label:"",selected:!0}));w=0;for(z=c.length;w<z;w++){d=c[w];l=a[d];Q.length<=w?(s={element:H.clone().attr("label",d),label:l.label},t=[s],Q.push(t),f.append(s.element)):(t=Q[w],s=t[0],s.label!=d&&s.element.attr("label",s.label=d));P=null;E=0;for(G=l.length;E<G;E++)d=l[E],(u=t[E+1])?(P=u.element,u.label!==d.label&&(m(S,u.label,!1),m(S,d.label, !0),P.text(u.label=d.label),P.prop("label",u.label)),u.id!==d.id&&P.val(u.id=d.id),P[0].selected!==d.selected&&(P.prop("selected",u.selected=d.selected),Ha&&P.prop("selected",u.selected))):(""===d.id&&v?U=v:(U=B.clone()).val(d.id).prop("selected",d.selected).attr("selected",d.selected).prop("label",d.label).text(d.label),t.push(u={element:U,label:d.label,id:d.id,selected:d.selected}),m(S,d.label,!0),P?P.after(U):s.element.append(U),P=U);for(E++;t.length>E;)d=t.pop(),m(S,d.label,!1),d.element.remove(); r(S,function(a,c){0<a?q.addOption(c):0>a&&q.removeOption(c)})}for(;Q.length>w;)Q.pop()[0].element.remove()}var u;if(!(u=s.match(d)))throw bg("iexp",s,ua(f));var D=c(u[2]||u[1]),z=u[4]||u[6],y=/ as /.test(u[0])&&u[1],w=y?c(y):null,F=u[5],I=c(u[3]||""),E=c(u[2]?u[1]:z),N=c(u[7]),L=u[8]?c(u[8]):null,R={},Q=[[{element:f,label:""}]],T={};v&&(a(v)(e),v.removeClass("ng-scope"),v.remove());f.empty();f.on("change",function(){e.$apply(function(){var a=N(e)||[],c;if(n)c=[],r(f.val(),function(d){d=L?R[d]:d;c.push("?"=== d?t:""===d?null:h(w?w:E,d,a[d]))});else{var d=L?R[f.val()]:f.val();c="?"===d?t:""===d?null:h(w?w:E,d,a[d])}g.$setViewValue(c);p()})});g.$render=p;e.$watchCollection(N,l);e.$watchCollection(function(){var a=N(e),c;if(a&&G(a)){c=Array(a.length);for(var d=0,f=a.length;d<f;d++)c[d]=h(D,d,a[d])}else if(a)for(d in c={},a)a.hasOwnProperty(d)&&(c[d]=h(D,d,a[d]));return c},l);n&&e.$watchCollection(function(){return g.$modelValue},l)}if(k[1]){var q=k[0];k=k[1];var n=h.multiple,s=h.ngOptions,v=!1,u,x=!1,B=y(U.createElement("option")), H=y(U.createElement("optgroup")),z=B.clone();h=0;for(var F=g.children(),w=F.length;h<w;h++)if(""===F[h].value){u=v=F.eq(h);break}q.init(k,v,z);n&&(k.$isEmpty=function(a){return!a||0===a.length});s?p(e,g,k):n?m(e,g,k):l(e,g,k,q)}}}}],Wd=["$interpolate",function(a){var c={addOption:w,removeOption:w};return{restrict:"E",priority:100,compile:function(d,e){if(D(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var l=d.parent(),m=l.data("$selectController")||l.parent().data("$selectController"); m&&m.databound||(m=c);f?a.$watch(f,function(a,c){e.$set("value",a);c!==a&&m.removeOption(c);m.addOption(a,d)}):m.addOption(e.value,d);d.on("$destroy",function(){m.removeOption(e.value)})}}}}],Vd=ba({restrict:"E",terminal:!1});T.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(Ld(),Nd(va),y(U).ready(function(){Hd(U,sc)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}</style>');
/** * Created by pomy on 5/4/16. */ 'use strict'; let $ = require('cheerio'); exports.parseList = function (lists) { let origin = 'https://segmentfault.com'; let sgLists = lists.map((index, list) => { let titleObj = $(list).find('.title a'); let title = titleObj.text(); let originUrl = origin + titleObj.attr('href'); let metaAuthor = $(list).find('.author a:first-child').text(); let metaTime = $(list).find('.author .split')[0].nextSibling.nodeValue; let avatarUrl = $(list).find('.author img').attr('src'); let a = $(list).find('.author a')[1]; let subjectUrl = origin + a.attribs.href; let subjectText = $(a).text(); return { listTitle:title, listOriginUrl: originUrl, listMetaAuthor: metaAuthor, listTime: metaTime, listAvatarUrl: avatarUrl, listSubjectUrl: subjectUrl, listSubjectText: subjectText }; }); return sgLists; }
import React, { PropTypes } from 'react'; import classNames from 'classnames'; import '../css/Components/SubSectionTitle'; const SubSectionTitle = ({ children, alternate, edge, italic }) => { const className = classNames({ SubSectionTitle: true, 'SubSectionTitle--alternate': alternate, 'SubSectionTitle--edge': edge, 'SubSectionTitle--italic': italic, }); return ( <h3 className={className}> {children} </h3> ); }; SubSectionTitle.propTypes = { children: PropTypes.node.isRequired, alternate: PropTypes.bool, edge: PropTypes.bool, italic: PropTypes.bool, }; SubSectionTitle.defaultProps = { alternate: false, edge: false, italic: false, }; export default SubSectionTitle;
"use strict"; const util = require('util'); const EventEmitter = require('events').EventEmitter; const https = require('https'); const ens = require('ens'); const is = require('is'); class SignatureDecipherer { constructor(args) { this.args = ens.obj(args); } validateArguments(args) { return new Promise((resolve, reject) => { if (!is.object(args)) reject('!is.object(args)'); else if (!is.object(args.ytplayer_config)) reject('!is.object(args.ytplayer_config)'); else if (!is.string(args.signature)) reject('!is.string(args.signature)'); else resolve(args); }); } getJsPlayerFromUrl(url) { return new Promise((resolve, reject) => { if (!is.string(url)) return reject('is.string(url)'); https.get(url, res => { let source = ''; res.on('data', chunk => source += chunk); res.on('end', () => resolve(source)); }).on('error', (err) => { reject(err); }); }); } validateJsPlayer(jsplayer) { return new Promise((resolve, reject) => { if (!is.string(jsplayer)) reject('!is.string(jsplayer)'); else if (jsplayer.length < 10000) reject('jsplayer.length < 10000'); else resolve(jsplayer); }); } getDecipherNameFromJsPlayer(jsplayer, decipher_function_name_re) { return new Promise((resolve, reject) => { let matches = decipher_function_name_re.exec(jsplayer); if (is.array(matches) && matches[1]) resolve(matches[1]); else reject('@name is.array(matches) && matches[1] not passed'); }); } getDecipherArgumentFromJsPlayer(jsplayer, decipher_argument_re) { return new Promise((resolve, reject) => { let matches = decipher_argument_re.exec(jsplayer); if (is.array(matches) && matches[1]) resolve(matches[1]); else reject('@argument is.array(matches) && matches[1] not passed'); }); } getDecipherBodyFromJsPlayer(jsplayer, decipher_function_body_re) { return new Promise((resolve, reject) => { let matches = decipher_function_body_re.exec(jsplayer); if (is.array(matches) && matches[1]) resolve(matches[1].replace(/\n/gm, '')); else reject('@body is.array(matches) && matches[1] not passed'); }); } getDecipherHelpersNameFromBody(body, decipher_helpers_name_re) { return new Promise((resolve, reject) => { let matches = decipher_helpers_name_re.exec(body); if (is.array(matches) && matches[1]) resolve(matches[1]); else reject('@helpers name is.array(matches) && matches[1] not passed'); }); } getDecipherHelpersBodyFromJsplayer(jsplayer, decipher_helpers_body_re) { return new Promise((resolve, reject) => { let matches = decipher_helpers_body_re.exec(jsplayer); if (is.array(matches) && matches[1]) resolve(matches[1].replace(/\n/gm, '')); else reject('@helpers body is.array(matches) && matches[1] not passed'); }); } makeDecipherFunction(args) { return new Promise((resolve, reject) => { let decipherFunction = new Function( [args.decipher_argument], `var ${args.decipher_helpers_name}={${args.decipher_helpers_body}};` + `${args.decipher_body}` ); resolve(decipherFunction); }); } decipherSignature(decipherFunction, signature) { return new Promise((resolve, reject) => { try { let deciphered_signature = decipherFunction(signature); resolve(deciphered_signature); } catch (err) { reject(err); } }); } } SignatureDecipherer.prototype.start = async function start() { let t = this; try { let args = await t.validateArguments(t.args); let jsplayer_url = 'https:' + args.ytplayer_config.assets.js; let unvalidated_jsplayer = await t.getJsPlayerFromUrl(jsplayer_url); let jsplayer = await t.validateJsPlayer(unvalidated_jsplayer); let decipher_name = await t.getDecipherNameFromJsPlayer( jsplayer, t.regexp.decipher_name ); let decipher_argument = await t.getDecipherArgumentFromJsPlayer( jsplayer, new RegExp(decipher_name + t.regexp.decipher_argument) ); let decipher_body = await t.getDecipherBodyFromJsPlayer( jsplayer, new RegExp(decipher_name + t.regexp.decipher_body) ); let decipher_helpers_name = await t.getDecipherHelpersNameFromBody( decipher_body, t.regexp.decipher_helpers_name ); let decipher_helpers_body = await t.getDecipherHelpersBodyFromJsplayer( jsplayer, new RegExp(decipher_helpers_name + t.regexp.decipher_helpers_body) ); let decipherFunction = await t.makeDecipherFunction({ decipher_name, decipher_argument, decipher_body, decipher_helpers_name, decipher_helpers_body }); let deciphered_signature = await t.decipherSignature( decipherFunction, args.signature ); t.emit('success', deciphered_signature); } catch (err) { t.emit('error', err); } }; SignatureDecipherer.prototype.regexp = { /** * Example: (the function call expression gets captured, in this case: sr) * sig||e.s){var h = e.sig||sr( */ decipher_name: /sig\|\|.+?\..+?\)\{var.+?\|\|(.+?)\(/, /** * Captures the first argument name of the decipher function * Gets prefixed with decipher name (in this case sr) * Example: (a will be captured) * sr=function(a){ ... } */ decipher_argument: '=function\\((.+?)\\)\\{[\\w\\W]+?\\}', /** * */ decipher_body: '=function\\(.+?\\)\\{([\\w\\W]+?)\\}', /** * */ decipher_helpers_name: /;(.+?)\..+?\(.+?\,.+?\);/, /** * */ decipher_helpers_body: '=\\{([\\w\\W\\.\\:]+?)\\};' }; util.inherits(SignatureDecipherer, EventEmitter); module.exports = SignatureDecipherer;
'use strict'; // Use Applicaion configuration module to register a new module ApplicationConfiguration.registerModule('game');
function Task(app) { this.app = app; } Task.prototype.listen = function() { var self = this; var reloadingProjectId = 0; // Change color $(document).on("click", ".color-square", function() { $(".color-square-selected").removeClass("color-square-selected"); $(this).addClass("color-square-selected"); $("#form-color_id").val($(this).data("color-id")); }); // Assign to me $(document).on("click", ".assign-me", function(e) { e.preventDefault(); var currentId = $(this).data("current-id"); var dropdownId = "#" + $(this).data("target-id"); if ($(dropdownId + ' option[value=' + currentId + ']').length) { $(dropdownId).val(currentId); } }); // Reload page when a destination project is changed $(document).on("change", "select.task-reload-project-destination", function() { if (reloadingProjectId > 0) { $(this).val(reloadingProjectId); } else { reloadingProjectId = $(this).val(); var url = $(this).data("redirect").replace(/PROJECT_ID/g, reloadingProjectId); $(".loading-icon").show(); $.ajax({ type: "GET", url: url, success: function(data, textStatus, request) { reloadingProjectId = 0; $(".loading-icon").hide(); self.app.popover.afterSubmit(data, request, self.app.popover); } }); } }); };
// // // MAIN JS // HASHBANG & COOKIEBANG if(typeof bang != 'undefined' && bang){ // cookie bang // bangs only on first load if(window.innerWidth > 1024 || document.documentElement.clientWidth > 1024){ document.cookie = 'big-screen=1; path=/'; } else{ document.cookie = 'big-screen=0; path=/'; } if(typeof hashbang !='undefined' && hashbang){ var host = window.location.host; var parts = window.location.pathname.replace(/^\/|\/$/g, '').split('/'); var slug = parts[0]; parts.shift(); if(typeof(parts)=="object") parts = parts.join('/'); var url = 'http://'+host+'/#!/'+slug+(parts.length>0?'/'+parts:'') } else{ var url = window.location.pathname; } if(document.cookie.indexOf("big-screen=")!=-1 || (typeof hashbang !='undefined' && hashbang)){ window.location.replace(url); } else{ window.cookieDisabled = true; } } // // // VARIABLES HOLDER window.waq = {}; // Document ready jQuery(document).ready(function($){ // Don't execute JS if we will bang anyway // if cookies are disabled, remove coverall if(window.cookieDisabled) $('.bang-coverall').remove(); if(typeof(hashbang)!='undefined' && hashbang) return; // // // USEFUL FUNCTIONS function minMax(n, min, max){ return n<min ? min : n>max ? max : n; } function cancelEvents(e){ e.stopPropagation(); // e.preventDefault(); } // // // SETUP $win = $(window); waq.$doc = $(document.documentElement); waq.$page = $('html,body'); waq.$wrapper = $('.wrapper', document.body); waq.$header = $('>header', waq.$wrapper); waq.$menu = $('nav', waq.$header); waq.$menu.$links = $('a', waq.$menu); waq.$menu.$toggle = $('<div class="menu-toggle"><i>Menu</i></div>'); waq.$logo = $('.logo', waq.$menu); waq.$intro = $('#intro', waq.$header); waq.$program = $('.program'); waq.$favorite = $('.single-session .toggle.favorite'); waq.$schedules = $('.schedule'); waq.$map = $('#gmap'); waq.$map.$viewport = $('.map-container .viewport'); waq.$feed = $('.feed'); waq.$blog = $('section.news'); waq.$expandables = $('.expandable'); // Animated width waq.$toggles = $('.toggle'); // Toggles waq.$tabs = $('.tab-trigger'); // Tabs waq.$stickys = $('.sticky'); waq.$profiles = $('.profile.has-social'); waq.$lazy = $('[lazy-load]'); waq.url = {}; waq.url.parts = window.location.hash.replace(/^\/|\/$/g, '').split('/'); waq.url.slug = waq.url.parts.indexOf('#!')==-1 ? waq.url.parts[0] : waq.url.parts[1]; waq.loggedin = waq.$wrapper.hasClass('logged-in'); waq.isTouch = waq.$doc.hasClass('touch'); // // // GET VAR FROM URL function getVarFromUrl(varname, offset){ if(typeof offset == 'undefined') offset = 1; var index = waq.url.parts.indexOf(varname); return waq.url.parts[index+offset]; } // // // SCROLLTO function scrollTo(arg){ var type = typeof(arg); if(type=='object'){ var $trigger = $(this); var $target = $( '#' + $trigger.parent().attr('class').split(" ")[0] ); if(!$target.length) return; arg.preventDefault(); arg.stopPropagation(); } else if(type=='string'){ var $target = $( '#' + arg ); if(!$target.length) return; } waq.$page.stop().animate({ scrollTop: $target.offset().top - 110 }, 800, $.bez([0.5, 0, 0.225, 1])); } waq.$menu.$links.on('click', scrollTo); // // // ACTIVATE MENU ITEMS ON SCROLL function activateMenuOnScroll(){ waq.$menu.$anchoredSections = $(); for(i=0;i<waq.$menu.$links.length; i++){ var $trigger = waq.$menu.$links.eq(i); var $section = $( '#' + $trigger.parent().attr('class').split(" ")[0] ); if($section.length) waq.$menu.$anchoredSections.push($section[0]); } if(waq.$menu.$anchoredSections.length){ waq.$menu.$anchoredSections.scrollEvents({ flag: 'anchor', offset: 150, topUp: function(e){ var slug = e.selection.attr('id'); var $target = waq.$menu.$links.parent().filter('.'+slug); waq.$menu.$links.parent().removeClass('active'); if($target.length){ $target.addClass('active'); // window.location.replace('#!/'+slug); }; }, topDown: function(e){ var slug = $(scrollEvents.selection[minMax(e.i-1,0,100)]).attr('id') var $target = waq.$menu.$links.parent().filter('.'+slug); waq.$menu.$links.parent().removeClass('active'); if($target.length){ $target.addClass('active'); // window.location.replace('#!/'+slug); } } }); } // dirty fix $win.on('load',function(){ waq.$menu.$links.parent().removeClass('active'); }); } activateMenuOnScroll(); // // // SCROLL TO HASHBANG waq.hash = window.location.hash; if(waq.hash.indexOf('!')!=-1){ var parts = waq.hash.replace(/^\/|\/$/g, '').split('/'); if(parts.length>1){ var slug = parts[1]; $win.on('load',function(){ if(window.scrollEvents.t < 5) scrollTo(slug); }); } } // // // STICKY NAV if(waq.$intro.length){ // enable function enableStickyNav(){ waq.$menu.sticky({ inverted: true, offset: 10, offsetBottom: 10, fixedTop: function(e){ e.selection.addClass('fixed top'); }, scrolling: function(e){ e.selection.removeClass('fixed top bottom'); }, fixedBottom: function(e){ e.selection.addClass('fixed bottom'); } }); } // disable function disableStickyNav(){ waq.$menu.sticky('destroy'); waq.$menu.removeClass('fixed top bottom'); } } // // // GENERAL STICKYS if(waq.$stickys.length){ //enable function enableStickys(){ for(var i=0; i<waq.$stickys.length; i++){ var $sticky = $(waq.$stickys[i]); var is_tabs = (!waq.$program.$sticky || $sticky[0] == waq.$program.$sticky[0]); $sticky.sticky({ offset: is_tabs ? 110 : 120, offsetBottom: is_tabs ? 30 : 30, container: is_tabs ? waq.$program : $sticky.parent(), reset: function(e){ e.selection.removeClass('fixed contained'); }, fixed: function(e){ e.selection.removeClass('contained').addClass('fixed'); }, contained: function(e){ e.selection.removeClass('fixed').addClass('contained'); } }); } if(waq.$program.length && waq.$program.$tabs) waq.$program.$tabs.isSticky = true; } // disable function disableStickys(){ waq.$stickys.sticky('destroy'); setTimeout(function(){ waq.$stickys.removeClass('contained fixed'); },300); if(waq.$program.length && waq.$program.$tabs) waq.$program.$tabs.isSticky = false; } } // // // ANIMATE EXPANDABLES if(waq.$expandables.length){ function enableExpandables(){ waq.$expandables.scrollEvents({ flag: 'expandable', round: 1000, travel: function(e){ var delta = minMax(e.data.delta()/0.66, 0, 1); e.data.selection[0].style.width = Math.round(delta*100)+'%'; } }); } function disableExpandables(){ waq.$expandables.scrollEvents('destroy'); } } // // // MOBILE SCHEDULES waq.enableMobileSchedules = function($schedules){ if(!waq.isMobile) return; for(var i=0; i<$schedules.length; i++){ var $schedule = $($schedules[i]); $schedule[0].$headers = $('thead th', $schedule); $schedule[0].$rows = $('tbody tr', $schedule); $schedule.off('touchstart', cancelEvents).on('touchstart', cancelEvents); for(var r=0; r<$schedule[0].$rows.length; r++){ var $row = $schedule[0].$rows[r]; var $cells = $('td',$row); $cells.wrapAll('<div class="swiper"></div>'); for(var c=0; c<$cells.length; c++){ var $cell = $($cells[c]); var $location = $cell.find('[location]'); if($location.length){ var locationID = $location.attr('location'); var $refHeader = $schedule[0].$headers.find('[location="'+locationID+'"]'); if($refHeader){ var $clonedHeader = $refHeader.clone(); $cell.find('.location').prepend($clonedHeader); $cell[0].$clonedHeader = $clonedHeader; } } } } } } waq.disableMobileSchedules = function($schedules){ if(waq.isMobile) return; for(var i=0; i<$schedules.length; i++){ var $schedule = $($schedules[i]); $schedule[0].$headers = $('thead th', $schedule); $schedule[0].$rows = $('tbody tr', $schedule); $schedule.off('touchstart', cancelEvents); for(var r=0; r<$schedule[0].$rows.length; r++){ var $row = $schedule[0].$rows[r]; var $cells = $('td',$row); for(var c=0; c<$cells.length; c++){ var $cell = $($cells[c]); if($cell[0].$clonedHeader){ $cell[0].$clonedHeader.remove(); } } $cells.unwrap(); } } } // // // TOGGLE HANDLER function toggleBtn(){ var $trigger = $(this); var active = $trigger.toggleClass('active').hasClass('active'); var content = $trigger.attr('toggle-content'); if(content) $trigger.attr('toggle-content', $trigger.children().eq(0).html()).children().eq(0).html(content); } if(waq.$toggles.length){ waq.$toggles.on('click', toggleBtn); } if(waq.isTouch && waq.$profiles.length){ waq.$profiles.on('click', toggleBtn) .find('a').on('click', function(e){ e.stopPropagation(); }); } function toggleMenu(){ waq.$page.toggleClass('menu-active'); } // // // PROGRAM (navigate between schedules) if(waq.$program.length && waq.$schedules.length){ // // // TABS waq.$program.$tabs = $('.days .toggle', waq.$program); waq.$program.$sticky = $('.sticky', waq.$program); waq.$program.$header = $('hgroup', waq.$program); // loop setup for tabs for(var i=0; i<waq.$program.$tabs.length; i++){ var $tab = $(waq.$program.$tabs[i]); $tab[0].$schedule = waq.$schedules.filter('[schedule='+$tab.attr('schedule')+']') $tab[0].$schedule[0].$sessions = $tab[0].$schedule.find('.session'); } function toggleSchedule(e){ var $trigger = $(this); var $schedule = $trigger[0].$schedule; var $previousTab = waq.$program.$tabs.filter('.active'); var $previousSchedule = waq.$schedules.filter('.active'); $previousTab.removeClass('active'); $previousSchedule.removeClass('active'); // if(waq.isMobile) destroyMobileSchedule($previousSchedule); $trigger.addClass('active'); $schedule.addClass('active'); // if(waq.isMobile) initMobileSchedule($previousSchedule); if(waq.$program.$tabs.isSticky) waq.$program.$sticky.sticky('update'); $.cookie('schedule', $schedule.attr('schedule'), { path: '/' }); e.stopPropagation(); } // // // FILTERS waq.$program.activeFilters = []; waq.$program.$filters = $('.filters .filter.toggle', waq.$program); waq.$program.$sessions = $('.session', waq.$program).not('.lunch, .pause'); //loop setup for sessions for(var i=0; i<waq.$program.$sessions.length; i++){ waq.$program.$sessions[i].activeFilters = []; } function toggleFiltersNav(e){ e.data.$contents.slideToggle({duration:540, easing:$.bez([0.5, 0, 0.225, 1])}); } function toggleFilter(e){ var $toggle = $(this); var id = $toggle.attr('theme'); if(id){ var active = waq.$program.activeFilters.indexOf(id); var $sessions = waq.$program.$sessions.filter('[themes*="|'+id+'|"]'); if(active==-1){ // was not active waq.$program.activeFilters.push(id); if(waq.$program.activeFilters.length==1) waq.$program.$sessions.addClass('disabled'); for(var i=0; i<$sessions.length; i++) $($sessions[i]).removeClass('disabled')[0].activeFilters.push(id); } else{ // was active waq.$program.activeFilters.splice(active, 1); for(var i=0; i<$sessions.length; i++){ for(var key in $sessions[i].activeFilters) if(key==id) $sessions[i].activeFilters.splice(key, 1); if(!$sessions[i].activeFilters.length) $($sessions[i]).addClass('disabled'); } } // remove all class disabled if no filters enabled if(waq.$program.activeFilters.length==0) waq.$program.$sessions.removeClass('disabled'); } } waq.$program.$tabs.on('click', toggleSchedule); waq.$program.$filters.on('click', toggleFilter); if(getVarFromUrl('filtre')) waq.$program.$filters.filter('[theme="'+getVarFromUrl('filtre')+'"]').trigger('click'); } // // // FAVORITES function toggleFavorite(e){ var $trigger = $(this); var $toggles = $trigger[0].$toggles; var activated = $trigger.hasClass('active'); var added = []; var removed = []; if(!waq.loggedin){ // pop dialog box here... if(activated) $trigger.trigger('click'); e.preventDefault(); e.stopPropagation(); return false; } if($toggles){ var $previousFavorites = $toggles.filter('.active'); $previousFavorites.removeClass('active'); for(var p=0; p<$previousFavorites.length; p++) removed.push($($previousFavorites[p]).attr('session')); } if(activated) added.push($trigger.attr('session')) else removed.push($trigger.attr('session')); $.ajax({ type: "POST", url: '/mon-horaire/update', datatype: 'json', data: { add: added, remove: removed } }); } // // // INIT SCHEDULE'S FAVORITE TOGGLES waq.initFavorites = function($schedules){ if(!$schedules.length) return; $schedules.$toggles = $('.favorite', $schedules); $schedules.$toggles.off('click', toggleBtn).on('click', toggleBtn); var spanned = 0; // get toggles on the same row for(var i=0; i<$schedules.$toggles.length; i++){ var $trigger = $($schedules.$toggles[i]); var $row = $trigger.closest('tr'); var spanned = $trigger.closest('td').attr('rowspan'); if(!$trigger[0].$toggles) $trigger[0].$toggles = $(); $trigger[0].$toggles = $trigger[0].$toggles.add($row.find($schedules.$toggles).not($trigger)); // if session spans on other rows, add toggles to $el.toggles if(spanned){ for(var r=1; r<spanned; r++){ $row = $row.next('tr'); var $next_triggers = $('.favorite', $row); for(var t=0; t<$next_triggers.length; t++){ var $next_trigger = $next_triggers[t]; if(!$next_trigger.$toggles) $next_trigger.$toggles = $(); $trigger[0].$toggles = $trigger[0].$toggles.add($next_trigger); $next_trigger.$toggles.push($trigger[0]); } } } } // bind click event $schedules.$toggles.on('click', toggleFavorite); } waq.initFavorites(waq.$schedules); // // // INIT SINGLE FAVORITE if(waq.$favorite.length) waq.$favorite.on('click', toggleFavorite); // // // TABS if(waq.$tabs.length){ waq.$tabs.tabs({ activate: waq.$tabs.index(waq.$tabs.filter('.active')), type: 'tabs', animation: false, content: $('.tab-content') }); } // // // DRAWERS function enableFiltersDrawer($triggers, $contents){ $contents.hide(); $triggers.removeClass('active').on('click', {$contents: $contents}, toggleFiltersNav); } function disableFiltersDrawer($triggers, $contents){ $contents.show(); $triggers.removeClass('active').off('click',toggleFiltersNav); } if(waq.$program.length){ waq.$program.$filtersNavToggle = $('.title.toggle', waq.$program); waq.$program.$filtersNavContent = $('.content', waq.$program); enableFiltersDrawer(waq.$program.$filtersNavToggle ,waq.$program.$filtersNavContent); } if(waq.$blog.length){ waq.$blog.$filtersNavToggle = $('.title.toggle', waq.$blog); waq.$blog.$filtersNavContent = $('.content', waq.$blog); enableFiltersDrawer(waq.$blog.$filtersNavToggle ,waq.$blog.$filtersNavContent); } // // // GOOGLE MAP if(waq.$map.length && google){ function initGoogleMap(){ waq.$map.latLng = new google.maps.LatLng( parseFloat(waq.$map.attr('lat')), parseFloat(waq.$map.attr('lng')) ); waq.map = window.initMap( waq.$map, // map placeholder waq.$map.latLng, // marker latLng waq.$map.$viewport // viewport used for offset center ); if(waq.isTouch) window.setMobileMap(waq.map) else window.setDesktopMap(waq.map); } google.maps.event.addDomListener(window, 'load', initGoogleMap); } // // // FORCE UPDATE STICKYS waq.updateStickys = function(){ window.raf.on('nextframe', function(){ waq.$stickys.sticky('update'); }); } // // // LAZY LOAD waq.lazyLoad = function(lazy){ $.ajax({ url: lazy.url, success: function(data){ $data = $(data); lazy.$container.append($data); if(lazy.callbacks){ for(var c=0; c<lazy.callbacks.length; c++){ var callback = lazy.callbacks[c]; if(typeof waq[callback] == 'function'){ waq[callback](lazy.$container); } } } lazy.$container.removeAttr('lazy-load lazy-callback'); }, complete: function(){ // start next lazy load waq.lazyCounter++; if(waq.lazyCounter<waq.lazyQueue.length){ waq.lazyLoad(waq.lazyQueue[waq.lazyCounter]); } } }); } if(waq.$lazy.length){ waq.lazyQueue = []; waq.lazyCounter = 0; // build queue for(var l=0; l<waq.$lazy.length; l++){ var $lazy = $(waq.$lazy[l]); waq.lazyQueue.push({ $container: $lazy, url: $lazy.attr('lazy-load'), callbacks: $lazy.attr('lazy-callback').split('|') }); } // init queue waq.lazyLoad(waq.lazyQueue[0]); } // // // BREAK POINTS // // // > 1200px function largerThan1200(e){ if(waq.$intro.length) enableStickyNav(); if(e=='init') return; // Exit here at init -------------------------- waq.$menu.appendTo(waq.$header); waq.$logo.prependTo(waq.$menu); waq.$menu.$toggle.remove(); } // < 1200px function smallerThan1200(e){ waq.$menu.insertBefore(waq.$wrapper); waq.$logo.insertBefore(waq.$menu); waq.$menu.$toggle.addClass('hidden').prependTo(waq.$logo); waq.$menu.$toggle.on('click', toggleMenu); waq.$menu.$links.on('click', toggleMenu); window.raf.on('nextframe', function(){waq.$menu.$toggle.removeClass('hidden')} ); if(e=='init') return; // Exit here at init -------------------------- if(waq.$intro.length) disableStickyNav(); } // // // > 1024px function largerThan1024(e){ $.cookie('big-screen', 1, { path: '/' }); waq.isMobile = false; if(waq.$expandables.length) enableExpandables(); if(waq.$stickys.length) enableStickys(); if(e=='init') return; // Exit here at init -------------------------- if(waq.$schedules.length) waq.disableMobileSchedules(waq.$schedules); $win.scrollEvents('update'); } // // // < 1024px function smallerThan1024(e){ waq.isMobile = true; $.cookie('big-screen', 0, { path: '/' }); if(waq.$schedules.length) waq.enableMobileSchedules(waq.$schedules); if(e=='init') return; // Exit here at init -------------------------- if(waq.$stickys.length) disableStickys(); if(waq.$expandables.length) disableExpandables(); } $win.breakpoints([ { width: 1200, callback: { larger: largerThan1200, smaller: smallerThan1200 } }, { width: 1024, callback: { larger: largerThan1024, smaller: smallerThan1024 } } ]); });
import Ember from 'ember'; import layout from '../templates/components/total-num-widget'; export default Ember.Component.extend({ layout: layout });
var express = require('express'); var router = express.Router(); const uuid = require('node-uuid'); var monk = require('monk'); var db = monk('localhost:27017/Measurements'); /* GET form. */ router.get('/', function(req, res) { res.render('registerGroup'); }); /* POST form. */ router.post('/', function(req, res) { var collection = db.get('Building'); var bhb = uuid.v4(); collection.insert({ id: uuid.v4(), name: req.body.name, description: req.body.description, address : req.body.dddress, createdAt: Date.now(), }, function(err, pi){ if (err) throw err; res.render('././index', {"time": "time" }); //res.send('ok', 200); //res.render('registerGroup'); }); }); module.exports = router;
/* @flow */ import config from '../config' import { perf } from '../util/perf' import { initProxy } from './proxy' import { initState } from './state' import { initRender } from './render' import { initEvents } from './events' import { initLifecycle, callHook } from './lifecycle' import { initProvide, initInjections } from './inject' import { extend, mergeOptions, formatComponentName } from '../util/index' let uid = 0 export function initMixin (Vue: Class<Component>) { Vue.prototype._init = function (options?: Object) { /* istanbul ignore if */ if (process.env.NODE_ENV !== 'production' && config.performance && perf) { perf.mark('init') } const vm: Component = this // a uid vm._uid = uid++ // a flag to avoid this being observed vm._isVue = true // merge options if (options && options._isComponent) { // optimize internal component instantiation // since dynamic options merging is pretty slow, and none of the // internal component options needs special treatment. initInternalComponent(vm, options) } else { vm.$options = mergeOptions( resolveConstructorOptions(vm.constructor), options || {}, vm ) } /* istanbul ignore else */ if (process.env.NODE_ENV !== 'production') { initProxy(vm) } else { vm._renderProxy = vm } // expose real self vm._self = vm initLifecycle(vm) initEvents(vm) initRender(vm) callHook(vm, 'beforeCreate') initInjections(vm) // resolve injections before data/props initState(vm) initProvide(vm) // resolve provide after data/props callHook(vm, 'created') /* istanbul ignore if */ if (process.env.NODE_ENV !== 'production' && config.performance && perf) { vm._name = formatComponentName(vm, false) perf.mark('init end') perf.measure(`${vm._name} init`, 'init', 'init end') } if (vm.$options.el) { vm.$mount(vm.$options.el) } } } function initInternalComponent (vm: Component, options: InternalComponentOptions) { const opts = vm.$options = Object.create(vm.constructor.options) // doing this because it's faster than dynamic enumeration. opts.parent = options.parent opts.propsData = options.propsData opts._parentVnode = options._parentVnode opts._parentListeners = options._parentListeners opts._renderChildren = options._renderChildren opts._componentTag = options._componentTag opts._parentElm = options._parentElm opts._refElm = options._refElm if (options.render) { opts.render = options.render opts.staticRenderFns = options.staticRenderFns } } export function resolveConstructorOptions (Ctor: Class<Component>) { let options = Ctor.options if (Ctor.super) { const superOptions = resolveConstructorOptions(Ctor.super) const cachedSuperOptions = Ctor.superOptions if (superOptions !== cachedSuperOptions) { // super option changed, // need to resolve new options. Ctor.superOptions = superOptions // check if there are any late-modified/attached options (#4976) const modifiedOptions = resolveModifiedOptions(Ctor) // update base extend options if (modifiedOptions) { extend(Ctor.extendOptions, modifiedOptions) } options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions) if (options.name) { options.components[options.name] = Ctor } } } return options } function resolveModifiedOptions (Ctor: Class<Component>): ?Object { let modified const latest = Ctor.options const sealed = Ctor.sealedOptions for (const key in latest) { if (latest[key] !== sealed[key]) { if (!modified) modified = {} modified[key] = dedupe(latest[key], sealed[key]) } } return modified } function dedupe (latest, sealed) { // compare latest and sealed to ensure lifecycle hooks won't be duplicated // between merges if (Array.isArray(latest)) { const res = [] sealed = Array.isArray(sealed) ? sealed : [sealed] for (let i = 0; i < latest.length; i++) { if (sealed.indexOf(latest[i]) < 0) { res.push(latest[i]) } } return res } else { return latest } }
module.exports = { spec : function() { return { name : 'appendFileWrite', desc : 'To append content into a file handler', fields : [ {type:'string',name:'name',description:'the name of the file handler to write',required:true}, {type:'string',name:'content',description:'the content message to append into file handler'} ] } } , process : function(ctx, step, checkNext) { ctx.openFileWritesHandler[step.name] += step.content; process.nextTick(checkNext); } }
describe('list-test-results', function () { beforeEach(function () { this.setUpHandler({ commandModule: './suite-result/list-test-results', clientMethod: 'getSuiteResultTestResults', clientMethodResponse: [ { name: 'My result', _id: '12345', passing: true }, { name: 'My other result', _id: '23456', passing: false }, ], }) }) it('should throw an error', async function () { await this.testRejection() }) it('should print JSON', async function () { await this.testJsonOutput({ handlerInput: { suiteResultId: 'my-suite-result-id', offset: 5, }, expectedClientArgs: ['my-suite-result-id', { offset: 5 }], expectedOutput: [ '[{"name":"My result","_id":"12345","passing":true},{"name":"My other result","_id":"23456","passing":false}]', ], }) }) it('should print plain text', async function () { await this.testPlainOutput({ handlerInput: { suiteResultId: 'my-suite-result-id', offset: 5, }, expectedClientArgs: ['my-suite-result-id', { offset: 5 }], expectedOutput: [ ['\u001b[32m✓\u001b[39m My result (12345)'], ['\u001b[31m✖️\u001b[39m My other result (23456)'], ], }) }) })
var List = require('../models/List'); module.exports = function (server) { var validateRequest = require("../auth/validateRequest"); server.get("/api/v1/bucketList/data/list", function (req, res, next) { validateRequest.validate(req, res, function () { List.find({ user : req.params.token },function (err, list) { res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' }); res.end(JSON.stringify(list)); }); }); return next(); }); server.get('/api/v1/bucketList/data/item/:id', function (req, res, next) { validateRequest.validate(req, res, function () { List.find({ _id: req.params.id }, function (err, data) { res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' }); res.end(JSON.stringify(data)); }); }); return next(); }); server.post('/api/v1/bucketList/data/item', function (req, res, next) { validateRequest.validate(req, res, function () { var item = req.params; var instance = new List(item); instance.save( function (err, data) { res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' }); res.end(JSON.stringify(data)); }); }); return next(); }); server.put('/api/v1/bucketList/data/item/:id', function (req, res, next) { validateRequest.validate(req, res, function () { List.findOne({ _id: req.params.id }, function (err, data) { // merge req.params/product with the server/product // logic similar to jQuery.extend(); to merge 2 objects. /* for (var n in data) { updProd[n] = data[n]; }*/ //var updProd = {}; // updated products for (var n in req.params) { if (n != "id") { data[n] = req.params[n]; } } data.save( function (err, data) { if (err) { // duplicate key error console.log(err, "update err"); /*if (err.code == 11000) http://www.mongodb.org/about/contributors/error-codes/*/ { res.writeHead(400, { 'Content-Type': 'application/json; charset=utf-8' }); res.end(JSON.stringify({ error: err, message: err })); } } else { res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' }); res.end(JSON.stringify(data)); } }); }); }); return next(); }); server.del('/api/v1/bucketList/data/item/:id', function (req, res, next) { validateRequest.validate(req, res, function () { List.remove({ _id: req.params.id }, function (err, data) { res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' }); res.end(JSON.stringify(data)); }); return next(); }); }); }
(function( $ ) { $.fn.limit = function( params ) { var options = $.extend( { "chars": 100, "counter": "#result", "backendValidation": true, "warning": 5 }, params); if (this.is("textarea, input")) { this.attr("maxlength", options.chars); } this.on("keyup", function(e){ var countRule = options.backendValidation; var text = $(this).val(); var count = countChars(text, countRule); updateLength(this.id, count.lines, options.chars); if (count.counter > options.chars) { var difference = count.counter - options.chars; text = text.slice(0, text.length - difference); $(this).val(text); count = countChars(text, countRule); updateLength(this.id, count.lines, options.chars); } $(options.counter).html(options.chars - count.counter); if (options.chars - count.counter <= options.warning) { $(options.counter).addClass('warn'); } else { $(options.counter).removeClass('warn'); } }); return this; }; function countChars(text, countRule) { var count = 0; var lines = 0; text.split('').forEach(function(v) { count += 1; if ((v.charCodeAt(0) == 10) && (countRule === true)) { count += 1; } if ((v.charCodeAt(0) == 10) && (countRule === false)) { lines += 1; } }); return { counter: count, lines: lines }; } function updateLength(el, lines, chars) { $('#'+el).attr("maxlength", chars + lines); } })(jQuery);
(function(module) { var Cloudflare = require('./libs/services/cloudflare'), BigQueryApi = require('./libs/services/big_query/api'); module.exports = { handler: function() { const awsFile = './config/aws.json', projectFile = './config/auth.json', awsConfig = require(awsFile), projectData = require(projectFile), bigQueryConfig = { projectId: projectData['project_id'], keyFilename: projectFile }; BigQueryApi.default = new BigQueryApi(bigQueryConfig).connect(); cloudflare = new Cloudflare(awsConfig); cloudflare.fetchAll(); } }; })(module);
require("./26.js"); require("./52.js"); require("./104.js"); require("./207.js"); module.exports = 208;
/*jslint white:false plusplus:false browser:true nomen:false */ /*globals window, funcyTag*/ var div=funcyTag('div'), p=funcyTag('p'); var color = funcyTag.color; function build_example_html() { var t, c; t = div( p( { cssColor: c = color(0xFF0000) }, 'color(0xFF0000) = red = ' + c), p( { cssColor: c = color('#0F0') }, "color('#0F0') = green = " + c), p( { cssColor: c = color('#0000FF') }, "color('#0000FF') = blue = " + c), p( { cssColor: c = color(255,0,0,0.5) }, "color(255,0,0,0.5) = opaque red = " + c), p( { cssColor: c = color('#00ff00',0.5) }, "color('#00ff00',0.5) = opaque green = " + c), p( { cssColor: c = color(0x0000FF,0.5) }, "color(0x0000FF,0.5) = opaque blue = " + c), p( { cssColor: c = color(0xff0000).add(color(0x0000ff)) }, 'color(0xff0000).add(color(0x0000ff)) = red+blue = magenta = ' + c), p( { cssColor: c = color(0xff00).sub(color(0x888888)) }, 'green - gray = dark green = ' + c), p( { cssColor: c = color(0xff0000).mix(color(0x00ff00),0.75) }, 'color(0xff0000).mix(color(0x00ff00),0.75) = 75%red,25%green = ' + c), p( { cssColor: c = color(0xff0000).mix(color(0x00ff00),0.60).mix(color(0x0000ff),0.50) }, "c = color(0xff0000).mix(color(0x00ff00),0.60).mix(color(0x0000ff),0.50) = 30%red,20%green,50%blue = " + c), p( { cssColor: c = c.g(0) }, 'c = c.g(0) (remove green) = ' + c ), p( { cssColor: c = c.b(0) }, 'c = c.b(0) (remove blue) = ' + c), p( { cssColor: c = c.a(0.5) }, 'c = c.a(0.5) (set opacity to 0.5) = ' + c) ); return String(t); } window.onload = function() { document.getElementById('container').innerHTML = build_example_html(); };
angular.module('configuration.identity.authentication', ['configuration.identity', 'configuration.state', 'ngCookies', 'ui.router']) .controller('authenticationController', function($scope, $state, $location, authenticationService) { $scope.signIn = function (username, password) { authenticationService.authenticate(username, password) .then(function (identity) { $scope.authenticationError = false; authenticationService.setCredentials(identity, password); $state.go('page.home'); }, function (error) { $scope.authenticationError = true; }); }; }) .service('authenticationService', function($q, $http, $resource, $cookies, $rootScope, restConfigService, identityService, Base64) { var Authentication = $resource(restConfigService.getAuthenticationOperation()); var _loginEvent = function(identity) { $rootScope.$broadcast('auth.login', identity); }; var _logoutEvent = function() { $rootScope.$broadcast('auth.logout'); }; return { clear: function () { delete $cookies.currentUserId; $http.defaults.headers.common.Authorization = 'Basic '; _logoutEvent(); identityService.clear(); }, authenticate: function (username, password, callback) { return Authentication.save({username : username, password: password}).$promise; }, setCredentials: function (identity, password) { var authData = Base64.encode(identity.username + ':' + password); identity.authData = authData; identityService.update(identity); $cookies.currentUserId = identity.id; $http.defaults.headers.common['Authorization'] = 'Basic ' + authData; //_loginEvent(); }, isAuthenticated: function() { return $q.when(identityService.getIdentity() || identityService.ping()) .then(function(identity) { if(!identity) { return false; } _loginEvent(identity); return true; }, function() { return false; }); } }; }) .factory('Base64', function () { /* jshint ignore:start */ var keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; return { encode: function (input) { var output = ""; var chr1, chr2, chr3 = ""; var enc1, enc2, enc3, enc4 = ""; var i = 0; do { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); chr1 = chr2 = chr3 = ""; enc1 = enc2 = enc3 = enc4 = ""; } while (i < input.length); return output; }, decode: function (input) { var output = ""; var chr1, chr2, chr3 = ""; var enc1, enc2, enc3, enc4 = ""; var i = 0; // remove all characters that are not A-Z, a-z, 0-9, +, /, or = var base64test = /[^A-Za-z0-9\+\/\=]/g; if (base64test.exec(input)) { window.alert("There were invalid base64 characters in the input text.\n" + "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" + "Expect errors in decoding."); } input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); do { enc1 = keyStr.indexOf(input.charAt(i++)); enc2 = keyStr.indexOf(input.charAt(i++)); enc3 = keyStr.indexOf(input.charAt(i++)); enc4 = keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } chr1 = chr2 = chr3 = ""; enc1 = enc2 = enc3 = enc4 = ""; } while (i < input.length); return output; } }; /* jshint ignore:end */ }) .config(function($stateProvider) { $stateProvider .state('page.login', { url: '/login', controller: 'authenticationController', templateUrl: 'modules/configuration/identity/partial/login.html' }) .state('page.logout', { url: '/logout', controller: 'authenticationController', templateUrl: 'modules/configuration/identity/partial/logout.html' }); }) .run(function($rootScope, $state, authenticationService) { $rootScope.$on('$stateChangeStart', function (event, toState) { authenticationService.isAuthenticated().then(function(isAuthenticated) { if(toState.name !== 'page.login' && !isAuthenticated) { $state.go('page.login'); event.preventDefault(); } else if(toState.name === 'page.login' && isAuthenticated) { $state.go('page.home'); event.preventDefault(); } }); }); });
'use strict';var f, aa = "undefined" != typeof window && window === this ? this : "undefined" != typeof global ? global : this; function ba() { aa.Symbol || (aa.Symbol = ca); ba = function() { }; } var da = 0; function ca(a) { return "jscomp_symbol_" + a + da++; } function ea() { ba(); aa.Symbol.iterator || (aa.Symbol.iterator = aa.Symbol("iterator")); ea = function() { }; } function fa(a) { ea(); if (a[aa.Symbol.iterator]) { return a[aa.Symbol.iterator](); } if (!(a instanceof Array || "string" == typeof a || a instanceof String)) { throw new TypeError(a + " is not iterable"); } var b = 0; return {next:function() { return b == a.length ? {done:!0} : {done:!1, value:a[b++]}; }}; } var m = this; function n(a) { return void 0 !== a; } function ga() { } function ha(a) { a.Ha = function() { return a.Oc ? a.Oc : a.Oc = new a; }; } function ia(a) { var b = typeof a; if ("object" == b) { if (a) { if (a instanceof Array) { return "array"; } if (a instanceof Object) { return b; } var c = Object.prototype.toString.call(a); if ("[object Window]" == c) { return "object"; } if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { return "array"; } if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { return "function"; } } else { return "null"; } } else { if ("function" == b && "undefined" == typeof a.call) { return "object"; } } return b; } function p(a) { return "array" == ia(a); } function ja(a) { var b = ia(a); return "array" == b || "object" == b && "number" == typeof a.length; } function r(a) { return "string" == typeof a; } function u(a) { return "function" == ia(a); } function ka(a) { var b = typeof a; return "object" == b && null != a || "function" == b; } function w(a) { return a[ma] || (a[ma] = ++na); } var ma = "closure_uid_" + (1E9 * Math.random() >>> 0), na = 0; function oa(a, b, c) { return a.call.apply(a.bind, arguments); } function pa(a, b, c) { if (!a) { throw Error(); } if (2 < arguments.length) { var d = Array.prototype.slice.call(arguments, 2); return function() { var c = Array.prototype.slice.call(arguments); Array.prototype.unshift.apply(c, d); return a.apply(b, c); }; } return function() { return a.apply(b, arguments); }; } function x(a, b, c) { x = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? oa : pa; return x.apply(null, arguments); } function qa(a, b) { var c = Array.prototype.slice.call(arguments, 1); return function() { var b = c.slice(); b.push.apply(b, arguments); return a.apply(this, b); }; } var ra = Date.now || function() { return +new Date; }; function y(a, b) { function c() { } c.prototype = b.prototype; a.m = b.prototype; a.prototype = new c; a.prototype.constructor = a; a.be = function(a, c, g) { for (var h = Array(arguments.length - 2), k = 2;k < arguments.length;k++) { h[k - 2] = arguments[k]; } return b.prototype[c].apply(a, h); }; } ;function sa(a, b) { this.code = a; this.state = z[a] || ta; this.message = b || ""; var c = this.state.replace(/((?:^|\s+)[a-z])/g, function(a) { return a.toUpperCase().replace(/^[\s\xa0]+/g, ""); }), d = c.length - 5; if (0 > d || c.indexOf("Error", d) != d) { c += "Error"; } this.name = c; c = Error(this.message); c.name = this.name; this.stack = c.stack || ""; } y(sa, Error); var ta = "unknown error", z = {15:"element not selectable", 11:"element not visible"}; z[31] = ta; z[30] = ta; z[24] = "invalid cookie domain"; z[29] = "invalid element coordinates"; z[12] = "invalid element state"; z[32] = "invalid selector"; z[51] = "invalid selector"; z[52] = "invalid selector"; z[17] = "javascript error"; z[405] = "unsupported operation"; z[34] = "move target out of bounds"; z[27] = "no such alert"; z[7] = "no such element"; z[8] = "no such frame"; z[23] = "no such window"; z[28] = "script timeout"; z[33] = "session not created"; z[10] = "stale element reference"; z[21] = "timeout"; z[25] = "unable to set cookie"; z[26] = "unexpected alert open"; z[13] = ta; z[9] = "unknown command"; sa.prototype.toString = function() { return this.name + ": " + this.message; }; function ua(a) { var b = a.status; if (0 == b) { return a; } b = b || 13; a = a.value; if (!a || !ka(a)) { throw new sa(b, a + ""); } throw new sa(b, a.message + ""); } ;function A() { 0 != va && (wa[w(this)] = this); this.Da = this.Da; this.Ea = this.Ea; } var va = 0, wa = {}; A.prototype.Da = !1; A.prototype.O = function() { if (!this.Da && (this.Da = !0, this.v(), 0 != va)) { var a = w(this); delete wa[a]; } }; function xa(a, b) { a.Da ? b.call(void 0) : (a.Ea || (a.Ea = []), a.Ea.push(n(void 0) ? x(b, void 0) : b)); } A.prototype.v = function() { if (this.Ea) { for (;this.Ea.length;) { this.Ea.shift()(); } } }; function B(a) { a && "function" == typeof a.O && a.O(); } ;function ya(a) { if (Error.captureStackTrace) { Error.captureStackTrace(this, ya); } else { var b = Error().stack; b && (this.stack = b); } a && (this.message = String(a)); } y(ya, Error); ya.prototype.name = "CustomError"; var Ba; function Ca(a, b) { for (var c = a.split("%s"), d = "", e = Array.prototype.slice.call(arguments, 1);e.length && 1 < c.length;) { d += c.shift() + e.shift(); } return d + c.join("%s"); } var Da = String.prototype.trim ? function(a) { return a.trim(); } : function(a) { return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, ""); }; function Ea(a) { if (!Fa.test(a)) { return a; } -1 != a.indexOf("&") && (a = a.replace(Ga, "&amp;")); -1 != a.indexOf("<") && (a = a.replace(Ha, "&lt;")); -1 != a.indexOf(">") && (a = a.replace(Ia, "&gt;")); -1 != a.indexOf('"') && (a = a.replace(Ja, "&quot;")); -1 != a.indexOf("'") && (a = a.replace(Ka, "&#39;")); -1 != a.indexOf("\x00") && (a = a.replace(La, "&#0;")); return a; } var Ga = /&/g, Ha = /</g, Ia = />/g, Ja = /"/g, Ka = /'/g, La = /\x00/g, Fa = /[\x00&<>"']/, Ma = String.prototype.repeat ? function(a, b) { return a.repeat(b); } : function(a, b) { return Array(b + 1).join(a); }; function Na(a, b) { return a < b ? -1 : a > b ? 1 : 0; } function Oa(a) { return String(a).replace(/\-([a-z])/g, function(a, c) { return c.toUpperCase(); }); } function Pa(a) { var b = r(void 0) ? "undefined".replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08") : "\\s"; return a.replace(new RegExp("(^" + (b ? "|[" + b + "]+" : "") + ")([a-z])", "g"), function(a, b, e) { return b + e.toUpperCase(); }); } ;function Qa(a, b) { b.unshift(a); ya.call(this, Ca.apply(null, b)); b.shift(); } y(Qa, ya); Qa.prototype.name = "AssertionError"; function Ra(a, b) { throw new Qa("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1)); } ;function Sa() { var a = Ta; return a[a.length - 1]; } var Ua = Array.prototype.indexOf ? function(a, b, c) { return Array.prototype.indexOf.call(a, b, c); } : function(a, b, c) { c = null == c ? 0 : 0 > c ? Math.max(0, a.length + c) : c; if (r(a)) { return r(b) && 1 == b.length ? a.indexOf(b, c) : -1; } for (;c < a.length;c++) { if (c in a && a[c] === b) { return c; } } return -1; }, C = Array.prototype.forEach ? function(a, b, c) { Array.prototype.forEach.call(a, b, c); } : function(a, b, c) { for (var d = a.length, e = r(a) ? a.split("") : a, g = 0;g < d;g++) { g in e && b.call(c, e[g], g, a); } }, Va = Array.prototype.filter ? function(a, b, c) { return Array.prototype.filter.call(a, b, c); } : function(a, b, c) { for (var d = a.length, e = [], g = 0, h = r(a) ? a.split("") : a, k = 0;k < d;k++) { if (k in h) { var l = h[k]; b.call(c, l, k, a) && (e[g++] = l); } } return e; }, Wa = Array.prototype.map ? function(a, b, c) { return Array.prototype.map.call(a, b, c); } : function(a, b, c) { for (var d = a.length, e = Array(d), g = r(a) ? a.split("") : a, h = 0;h < d;h++) { h in g && (e[h] = b.call(c, g[h], h, a)); } return e; }, Xa = Array.prototype.some ? function(a, b, c) { return Array.prototype.some.call(a, b, c); } : function(a, b, c) { for (var d = a.length, e = r(a) ? a.split("") : a, g = 0;g < d;g++) { if (g in e && b.call(c, e[g], g, a)) { return !0; } } return !1; }, Ya = Array.prototype.every ? function(a, b, c) { return Array.prototype.every.call(a, b, c); } : function(a, b, c) { for (var d = a.length, e = r(a) ? a.split("") : a, g = 0;g < d;g++) { if (g in e && !b.call(c, e[g], g, a)) { return !1; } } return !0; }; function Za(a, b) { return 0 <= Ua(a, b); } function $a(a, b) { var c = Ua(a, b), d; (d = 0 <= c) && Array.prototype.splice.call(a, c, 1); return d; } function ab(a) { return Array.prototype.concat.apply(Array.prototype, arguments); } function bb(a) { var b = a.length; if (0 < b) { for (var c = Array(b), d = 0;d < b;d++) { c[d] = a[d]; } return c; } return []; } function cb(a, b, c, d) { Array.prototype.splice.apply(a, db(arguments, 1)); } function db(a, b, c) { return 2 >= arguments.length ? Array.prototype.slice.call(a, b) : Array.prototype.slice.call(a, b, c); } ;function fb(a, b, c) { for (var d in a) { b.call(c, a[d], d, a); } } function gb(a) { var b = [], c = 0, d; for (d in a) { b[c++] = a[d]; } return b; } var hb = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); function ib(a, b) { for (var c, d, e = 1;e < arguments.length;e++) { d = arguments[e]; for (c in d) { a[c] = d[c]; } for (var g = 0;g < hb.length;g++) { c = hb[g], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]); } } } function jb(a) { var b = arguments.length; if (1 == b && p(arguments[0])) { return jb.apply(null, arguments[0]); } if (b % 2) { throw Error("Uneven number of arguments"); } for (var c = {}, d = 0;d < b;d += 2) { c[arguments[d]] = arguments[d + 1]; } return c; } ;function kb(a) { if (a.ja && "function" == typeof a.ja) { return a.ja(); } if (r(a)) { return a.split(""); } if (ja(a)) { for (var b = [], c = a.length, d = 0;d < c;d++) { b.push(a[d]); } return b; } return gb(a); } ;function lb(a, b) { this.b = {}; this.a = []; this.j = this.c = 0; var c = arguments.length; if (1 < c) { if (c % 2) { throw Error("Uneven number of arguments"); } for (var d = 0;d < c;d += 2) { this.ra(arguments[d], arguments[d + 1]); } } else { if (a) { if (a instanceof lb) { d = a.cb(), c = a.ja(); } else { var c = [], e = 0; for (d in a) { c[e++] = d; } d = c; c = gb(a); } for (e = 0;e < d.length;e++) { this.ra(d[e], c[e]); } } } } f = lb.prototype; f.ja = function() { mb(this); for (var a = [], b = 0;b < this.a.length;b++) { a.push(this.b[this.a[b]]); } return a; }; f.cb = function() { mb(this); return this.a.concat(); }; f.clear = function() { this.b = {}; this.j = this.c = this.a.length = 0; }; function nb(a, b) { ob(a.b, b) && (delete a.b[b], a.c--, a.j++, a.a.length > 2 * a.c && mb(a)); } function mb(a) { if (a.c != a.a.length) { for (var b = 0, c = 0;b < a.a.length;) { var d = a.a[b]; ob(a.b, d) && (a.a[c++] = d); b++; } a.a.length = c; } if (a.c != a.a.length) { for (var e = {}, c = b = 0;b < a.a.length;) { d = a.a[b], ob(e, d) || (a.a[c++] = d, e[d] = 1), b++; } a.a.length = c; } } function pb(a, b) { return ob(a.b, b) ? a.b[b] : void 0; } f.ra = function(a, b) { ob(this.b, a) || (this.c++, this.a.push(a), this.j++); this.b[a] = b; }; f.forEach = function(a, b) { for (var c = this.cb(), d = 0;d < c.length;d++) { var e = c[d]; a.call(b, pb(this, e), e, this); } }; f.clone = function() { return new lb(this); }; function ob(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } ;var qb = /^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/; function rb(a, b) { if (a) { for (var c = a.split("&"), d = 0;d < c.length;d++) { var e = c[d].indexOf("="), g = null, h = null; 0 <= e ? (g = c[d].substring(0, e), h = c[d].substring(e + 1)) : g = c[d]; b(g, h ? decodeURIComponent(h.replace(/\+/g, " ")) : ""); } } } ;function sb(a, b) { this.j = this.L = this.c = ""; this.o = null; this.l = this.h = ""; this.a = !1; var c; a instanceof sb ? (this.a = n(b) ? b : a.a, tb(this, a.c), this.L = a.L, this.j = a.j, ub(this, a.o), this.h = a.h, vb(this, a.b.clone()), this.l = a.l) : a && (c = String(a).match(qb)) ? (this.a = !!b, tb(this, c[1] || "", !0), this.L = wb(c[2] || ""), this.j = wb(c[3] || "", !0), ub(this, c[4]), this.h = wb(c[5] || "", !0), vb(this, c[6] || "", !0), this.l = wb(c[7] || "")) : (this.a = !!b, this.b = new xb(null, 0, this.a)); } sb.prototype.toString = function() { var a = [], b = this.c; b && a.push(yb(b, zb, !0), ":"); var c = this.j; if (c || "file" == b) { a.push("//"), (b = this.L) && a.push(yb(b, zb, !0), "@"), a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g, "%$1")), c = this.o, null != c && a.push(":", String(c)); } if (c = this.h) { this.j && "/" != c.charAt(0) && a.push("/"), a.push(yb(c, "/" == c.charAt(0) ? Ab : Bb, !0)); } (c = this.b.toString()) && a.push("?", c); (c = this.l) && a.push("#", yb(c, Cb)); return a.join(""); }; sb.prototype.clone = function() { return new sb(this); }; function tb(a, b, c) { a.c = c ? wb(b, !0) : b; a.c && (a.c = a.c.replace(/:$/, "")); } function ub(a, b) { if (b) { b = Number(b); if (isNaN(b) || 0 > b) { throw Error("Bad port number " + b); } a.o = b; } else { a.o = null; } } function vb(a, b, c) { b instanceof xb ? (a.b = b, Db(a.b, a.a)) : (c || (b = yb(b, Eb)), a.b = new xb(b, 0, a.a)); } function wb(a, b) { return a ? b ? decodeURI(a.replace(/%25/g, "%2525")) : decodeURIComponent(a) : ""; } function yb(a, b, c) { return r(a) ? (a = encodeURI(a).replace(b, Fb), c && (a = a.replace(/%25([0-9a-fA-F]{2})/g, "%$1")), a) : null; } function Fb(a) { a = a.charCodeAt(0); return "%" + (a >> 4 & 15).toString(16) + (a & 15).toString(16); } var zb = /[#\/\?@]/g, Bb = /[\#\?:]/g, Ab = /[\#\?]/g, Eb = /[\#\?@]/g, Cb = /#/g; function xb(a, b, c) { this.c = this.a = null; this.b = a || null; this.j = !!c; } function Gb(a) { a.a || (a.a = new lb, a.c = 0, a.b && rb(a.b, function(b, c) { a.add(decodeURIComponent(b.replace(/\+/g, " ")), c); })); } f = xb.prototype; f.add = function(a, b) { Gb(this); this.b = null; a = Hb(this, a); var c = pb(this.a, a); c || this.a.ra(a, c = []); c.push(b); this.c = this.c + 1; return this; }; function Ib(a, b) { Gb(a); b = Hb(a, b); ob(a.a.b, b) && (a.b = null, a.c = a.c - pb(a.a, b).length, nb(a.a, b)); } f.clear = function() { this.a = this.b = null; this.c = 0; }; f.cb = function() { Gb(this); for (var a = this.a.ja(), b = this.a.cb(), c = [], d = 0;d < b.length;d++) { for (var e = a[d], g = 0;g < e.length;g++) { c.push(b[d]); } } return c; }; f.ja = function(a) { Gb(this); var b = []; if (r(a)) { var c = a; Gb(this); c = Hb(this, c); ob(this.a.b, c) && (b = ab(b, pb(this.a, Hb(this, a)))); } else { for (a = this.a.ja(), c = 0;c < a.length;c++) { b = ab(b, a[c]); } } return b; }; f.toString = function() { if (this.b) { return this.b; } if (!this.a) { return ""; } for (var a = [], b = this.a.cb(), c = 0;c < b.length;c++) { for (var d = b[c], e = encodeURIComponent(String(d)), d = this.ja(d), g = 0;g < d.length;g++) { var h = e; "" !== d[g] && (h += "=" + encodeURIComponent(String(d[g]))); a.push(h); } } return this.b = a.join("&"); }; f.clone = function() { var a = new xb; a.b = this.b; this.a && (a.a = this.a.clone(), a.c = this.c); return a; }; function Hb(a, b) { var c = String(b); a.j && (c = c.toLowerCase()); return c; } function Db(a, b) { b && !a.j && (Gb(a), a.b = null, a.a.forEach(function(a, b) { var e = b.toLowerCase(); b != e && (Ib(this, b), Ib(this, e), 0 < a.length && (this.b = null, this.a.ra(Hb(this, e), bb(a)), this.c = this.c + a.length)); }, a)); a.j = b; } ;function Jb() { this.a = ""; } Jb.prototype.Nc = !0; Jb.prototype.Xb = function() { return this.a; }; Jb.prototype.toString = function() { return "SafeStyle{" + this.a + "}"; }; function Kb(a) { var b = new Jb; b.a = a; return b; } Kb(""); var Lb; a: { var Mb = m.navigator; if (Mb) { var Nb = Mb.userAgent; if (Nb) { Lb = Nb; break a; } } Lb = ""; } function D(a) { return -1 != Lb.indexOf(a); } ;function Ob() { this.a = ""; this.b = Pb; this.Ub = null; } Ob.prototype.Gd = !0; Ob.prototype.Nc = !0; Ob.prototype.Xb = function() { return this.a; }; Ob.prototype.toString = function() { return "SafeHtml{" + this.a + "}"; }; function Qb(a) { if (a instanceof Ob && a.constructor === Ob && a.b === Pb) { return a.a; } Ra("expected object of type SafeHtml, got '" + a + "' of type " + ia(a)); return "type_error:SafeHtml"; } function Rb(a) { if (a instanceof Ob) { return a; } var b; a instanceof Ob ? b = a : (b = null, a.Gd && (b = a.Ub), a = Ea(a.Nc ? a.Xb() : String(a)), b = Sb(a, b)); a = Qb(b).replace(/(\r\n|\r|\n)/g, "<br>"); return Sb(a, b.Ub); } var Pb = {}; function Sb(a, b) { var c = new Ob; c.a = a; c.Ub = b; return c; } Sb("<!DOCTYPE html>", 0); var Tb = Sb("", 0); Sb("<br>", 0); function Ub(a) { this.a = new lb; if (a) { a = kb(a); for (var b = a.length, c = 0;c < b;c++) { this.add(a[c]); } } } function Vb(a) { var b = typeof a; return "object" == b && a || "function" == b ? "o" + w(a) : b.substr(0, 1) + a; } f = Ub.prototype; f.add = function(a) { this.a.ra(Vb(a), a); }; f.clear = function() { this.a.clear(); }; f.contains = function(a) { a = Vb(a); return ob(this.a.b, a); }; f.ja = function() { return this.a.ja(); }; f.clone = function() { return new Ub(this); }; var Wb = D("Opera") || D("OPR"), E = D("Trident") || D("MSIE"), Xb = D("Edge"), Yb = Xb || E, G = D("Gecko") && !(-1 != Lb.toLowerCase().indexOf("webkit") && !D("Edge")) && !(D("Trident") || D("MSIE")) && !D("Edge"), H = -1 != Lb.toLowerCase().indexOf("webkit") && !D("Edge"), Zb = D("Macintosh"); function $b() { var a = Lb; if (G) { return /rv\:([^\);]+)(\)|;)/.exec(a); } if (Xb) { return /Edge\/([\d\.]+)/.exec(a); } if (E) { return /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a); } if (H) { return /WebKit\/(\S+)/.exec(a); } } function ac() { var a = m.document; return a ? a.documentMode : void 0; } var bc = function() { if (Wb && m.opera) { var a; var b = m.opera.version; try { a = b(); } catch (c) { a = b; } return a; } a = ""; (b = $b()) && (a = b ? b[1] : ""); return E && (b = ac(), null != b && b > parseFloat(a)) ? String(b) : a; }(), cc = {}; function I(a) { var b; if (!(b = cc[a])) { b = 0; for (var c = Da(String(bc)).split("."), d = Da(String(a)).split("."), e = Math.max(c.length, d.length), g = 0;0 == b && g < e;g++) { var h = c[g] || "", k = d[g] || "", l = /(\d*)(\D*)/g, q = /(\d*)(\D*)/g; do { var t = l.exec(h) || ["", "", ""], v = q.exec(k) || ["", "", ""]; if (0 == t[0].length && 0 == v[0].length) { break; } b = Na(0 == t[1].length ? 0 : parseInt(t[1], 10), 0 == v[1].length ? 0 : parseInt(v[1], 10)) || Na(0 == t[2].length, 0 == v[2].length) || Na(t[2], v[2]); } while (0 == b); } b = cc[a] = 0 <= b; } return b; } function dc(a) { return Number(ec) >= a; } var fc = m.document, ec = fc && E ? ac() || ("CSS1Compat" == fc.compatMode ? parseInt(bc, 10) : 5) : void 0; function gc(a, b, c, d, e) { this.reset(a, b, c, d, e); } gc.prototype.a = null; var hc = 0; gc.prototype.reset = function(a, b, c, d, e) { "number" == typeof e || hc++; this.j = d || ra(); this.l = a; this.c = b; this.b = c; delete this.a; }; function ic(a) { this.l = a; this.a = this.c = this.j = this.b = null; } function jc(a, b) { this.name = a; this.value = b; } jc.prototype.toString = function() { return this.name; }; var kc = new jc("SHOUT", 1200), lc = new jc("SEVERE", 1E3), mc = new jc("WARNING", 900), nc = new jc("INFO", 800), oc = new jc("CONFIG", 700), pc = new jc("FINE", 500), qc = new jc("FINER", 400), rc = new jc("FINEST", 300); function sc(a) { if (a.j) { return a.j; } if (a.b) { return sc(a.b); } Ra("Root logger has no level set."); return null; } ic.prototype.log = function(a, b, c) { if (a.value >= sc(this).value) { for (u(b) && (b = b()), a = new gc(a, String(b), this.l), c && (a.a = c), c = "log:" + a.c, m.console && (m.console.timeStamp ? m.console.timeStamp(c) : m.console.markTimeline && m.console.markTimeline(c)), m.msWriteProfilerMark && m.msWriteProfilerMark(c), c = this;c;) { b = c; var d = a; if (b.a) { for (var e = 0, g = void 0;g = b.a[e];e++) { g(d); } } c = c.b; } } }; function tc(a, b) { a.log(qc, b, void 0); } var uc = {}, vc = null; function wc() { vc || (vc = new ic(""), uc[""] = vc, vc.j = oc); } function xc(a) { wc(); var b; if (!(b = uc[a])) { b = new ic(a); var c = a.lastIndexOf("."), d = a.substr(c + 1), c = xc(a.substr(0, c)); c.c || (c.c = {}); c.c[d] = b; b.b = c; uc[a] = b; } return b; } ;function yc() { this.a = ra(); } var zc = new yc; yc.prototype.reset = function() { this.a = ra(); }; function Ac(a) { this.j = a || ""; this.l = zc; } Ac.prototype.a = !0; Ac.prototype.b = !0; Ac.prototype.c = !1; function Bc(a) { return 10 > a ? "0" + a : String(a); } function Cc(a) { Ac.call(this, a); } y(Cc, Ac); function Dc() { this.j = x(this.l, this); this.a = new Cc; this.a.b = !1; this.a.c = !1; this.b = this.a.a = !1; this.c = ""; this.h = {}; } function Ec(a, b) { if (b != a.b) { var c; wc(); c = vc; if (b) { var d = a.j; c.a || (c.a = []); c.a.push(d); } else { (c = c.a) && $a(c, a.j); } a.b = b; } } Dc.prototype.l = function(a) { if (!this.h[a.b]) { var b; b = this.a; var c = []; c.push(b.j, " "); if (b.b) { var d = new Date(a.j); c.push("[", Bc(d.getFullYear() - 2E3) + Bc(d.getMonth() + 1) + Bc(d.getDate()) + " " + Bc(d.getHours()) + ":" + Bc(d.getMinutes()) + ":" + Bc(d.getSeconds()) + "." + Bc(Math.floor(d.getMilliseconds() / 10)), "] "); } var d = (a.j - b.l.a) / 1E3, e = d.toFixed(3), g = 0; if (1 > d) { g = 2; } else { for (;100 > d;) { g++, d *= 10; } } for (;0 < g--;) { e = " " + e; } c.push("[", e, "s] "); c.push("[", a.b, "] "); c.push(a.c); b.c && (d = a.a) && c.push("\n", d instanceof Error ? d.message : d.toString()); b.a && c.push("\n"); b = c.join(""); if (c = Fc) { switch(a.l) { case kc: Gc(c, "info", b); break; case lc: Gc(c, "error", b); break; case mc: Gc(c, "warn", b); break; default: Gc(c, "debug", b); } } else { this.c += b; } } }; var Fc = m.console; function Gc(a, b, c) { if (a[b]) { a[b](c); } else { a.log(c); } } ;var Hc = !E || dc(9), Ic = !E || dc(9), Jc = E && !I("9"); !H || I("528"); G && I("1.9b") || E && I("8") || Wb && I("9.5") || H && I("528"); G && !I("8") || E && I("9"); function J(a, b) { this.type = a; this.l = this.target = b; this.h = !1; this.Xc = !0; } J.prototype.o = function() { this.h = !0; }; J.prototype.b = function() { this.Xc = !1; }; function Kc(a) { Kc[" "](a); return a; } Kc[" "] = ga; function Lc(a, b) { try { return Kc(a[b]), !0; } catch (c) { } return !1; } ;function K(a, b) { J.call(this, a ? a.type : ""); this.j = this.l = this.target = null; this.a = this.clientY = this.clientX = 0; this.metaKey = this.shiftKey = this.altKey = this.ctrlKey = !1; this.state = null; this.L = !1; this.c = null; if (a) { var c = this.type = a.type, d = a.changedTouches ? a.changedTouches[0] : null; this.target = a.target || a.srcElement; this.l = b; var e = a.relatedTarget; e ? G && (Lc(e, "nodeName") || (e = null)) : "mouseover" == c ? e = a.fromElement : "mouseout" == c && (e = a.toElement); this.j = e; null === d ? (this.clientX = void 0 !== a.clientX ? a.clientX : a.pageX, this.clientY = void 0 !== a.clientY ? a.clientY : a.pageY) : (this.clientX = void 0 !== d.clientX ? d.clientX : d.pageX, this.clientY = void 0 !== d.clientY ? d.clientY : d.pageY); this.a = a.keyCode || 0; this.ctrlKey = a.ctrlKey; this.altKey = a.altKey; this.shiftKey = a.shiftKey; this.metaKey = a.metaKey; this.L = Zb ? a.metaKey : a.ctrlKey; this.state = a.state; this.c = a; a.defaultPrevented && this.b(); } } y(K, J); var Mc = [1, 4, 2]; function Nc(a) { return (Hc ? 0 == a.c.button : "click" == a.type ? !0 : !!(a.c.button & Mc[0])) && !(H && Zb && a.ctrlKey); } K.prototype.o = function() { K.m.o.call(this); this.c.stopPropagation ? this.c.stopPropagation() : this.c.cancelBubble = !0; }; K.prototype.b = function() { K.m.b.call(this); var a = this.c; if (a.preventDefault) { a.preventDefault(); } else { if (a.returnValue = !1, Jc) { try { if (a.ctrlKey || 112 <= a.keyCode && 123 >= a.keyCode) { a.keyCode = -1; } } catch (b) { } } } }; var Oc = "closure_listenable_" + (1E6 * Math.random() | 0); function Pc(a) { return !(!a || !a[Oc]); } var Qc = 0; function Rc(a, b, c, d, e) { this.listener = a; this.a = null; this.src = b; this.type = c; this.sb = !!d; this.Eb = e; this.key = ++Qc; this.Ya = this.rb = !1; } function Sc(a) { a.Ya = !0; a.listener = null; a.a = null; a.src = null; a.Eb = null; } ;function Tc(a) { this.src = a; this.a = {}; this.b = 0; } Tc.prototype.add = function(a, b, c, d, e) { var g = a.toString(); a = this.a[g]; a || (a = this.a[g] = [], this.b++); var h = Uc(a, b, d, e); -1 < h ? (b = a[h], c || (b.rb = !1)) : (b = new Rc(b, this.src, g, !!d, e), b.rb = c, a.push(b)); return b; }; function Vc(a, b) { var c = b.type; if (!(c in a.a)) { return !1; } var d = $a(a.a[c], b); d && (Sc(b), 0 == a.a[c].length && (delete a.a[c], a.b--)); return d; } function Wc(a, b, c, d, e) { a = a.a[b.toString()]; b = -1; a && (b = Uc(a, c, d, e)); return -1 < b ? a[b] : null; } function Uc(a, b, c, d) { for (var e = 0;e < a.length;++e) { var g = a[e]; if (!g.Ya && g.listener == b && g.sb == !!c && g.Eb == d) { return e; } } return -1; } ;var Xc = "closure_lm_" + (1E6 * Math.random() | 0), Yc = {}, Zc = 0; function L(a, b, c, d, e) { if (p(b)) { for (var g = 0;g < b.length;g++) { L(a, b[g], c, d, e); } return null; } c = $c(c); return Pc(a) ? a.w(b, c, d, e) : ad(a, b, c, !1, d, e); } function ad(a, b, c, d, e, g) { if (!b) { throw Error("Invalid event type"); } var h = !!e, k = bd(a); k || (a[Xc] = k = new Tc(a)); c = k.add(b, c, d, e, g); if (c.a) { return c; } d = cd(); c.a = d; d.src = a; d.listener = c; if (a.addEventListener) { a.addEventListener(b.toString(), d, h); } else { if (a.attachEvent) { a.attachEvent(dd(b.toString()), d); } else { throw Error("addEventListener and attachEvent are unavailable."); } } Zc++; return c; } function cd() { var a = ed, b = Ic ? function(c) { return a.call(b.src, b.listener, c); } : function(c) { c = a.call(b.src, b.listener, c); if (!c) { return c; } }; return b; } function fd(a, b, c, d, e) { if (p(b)) { for (var g = 0;g < b.length;g++) { fd(a, b[g], c, d, e); } } else { c = $c(c), Pc(a) ? a.L.add(String(b), c, !0, d, e) : ad(a, b, c, !0, d, e); } } function gd(a, b, c, d, e) { if (p(b)) { for (var g = 0;g < b.length;g++) { gd(a, b[g], c, d, e); } } else { c = $c(c), Pc(a) ? a.na(b, c, d, e) : a && (a = bd(a)) && (b = Wc(a, b, c, !!d, e)) && hd(b); } } function hd(a) { if ("number" == typeof a || !a || a.Ya) { return !1; } var b = a.src; if (Pc(b)) { return Vc(b.L, a); } var c = a.type, d = a.a; b.removeEventListener ? b.removeEventListener(c, d, a.sb) : b.detachEvent && b.detachEvent(dd(c), d); Zc--; (c = bd(b)) ? (Vc(c, a), 0 == c.b && (c.src = null, b[Xc] = null)) : Sc(a); return !0; } function id(a) { if (a) { if (Pc(a)) { a.lb(void 0); } else { if (a = bd(a)) { var b = 0, c; for (c in a.a) { for (var d = a.a[c].concat(), e = 0;e < d.length;++e) { hd(d[e]) && ++b; } } } } } } function dd(a) { return a in Yc ? Yc[a] : Yc[a] = "on" + a; } function jd(a, b, c, d) { var e = !0; if (a = bd(a)) { if (b = a.a[b.toString()]) { for (b = b.concat(), a = 0;a < b.length;a++) { var g = b[a]; g && g.sb == c && !g.Ya && (g = kd(g, d), e = e && !1 !== g); } } } return e; } function kd(a, b) { var c = a.listener, d = a.Eb || a.src; a.rb && hd(a); return c.call(d, b); } function ed(a, b) { if (a.Ya) { return !0; } if (!Ic) { var c; if (!(c = b)) { a: { c = ["window", "event"]; for (var d = m, e;e = c.shift();) { if (null != d[e]) { d = d[e]; } else { c = null; break a; } } c = d; } } e = c; c = new K(e, this); d = !0; if (!(0 > e.keyCode || void 0 != e.returnValue)) { a: { var g = !1; if (0 == e.keyCode) { try { e.keyCode = -1; break a; } catch (l) { g = !0; } } if (g || void 0 == e.returnValue) { e.returnValue = !0; } } e = []; for (g = c.l;g;g = g.parentNode) { e.push(g); } for (var g = a.type, h = e.length - 1;!c.h && 0 <= h;h--) { c.l = e[h]; var k = jd(e[h], g, !0, c), d = d && k; } for (h = 0;!c.h && h < e.length;h++) { c.l = e[h], k = jd(e[h], g, !1, c), d = d && k; } } return d; } return kd(a, new K(b, this)); } function bd(a) { a = a[Xc]; return a instanceof Tc ? a : null; } var ld = "__closure_events_fn_" + (1E9 * Math.random() >>> 0); function $c(a) { if (u(a)) { return a; } a[ld] || (a[ld] = function(b) { return a.handleEvent(b); }); return a[ld]; } ;function md(a, b) { a && a.log(mc, b, void 0); } function nd(a, b) { a && a.log(nc, b, void 0); } ;var od = !E || dc(9), pd = !G && !E || E && dc(9) || G && I("1.9.1"), qd = E && !I("9"); function M(a, b) { this.x = n(a) ? a : 0; this.y = n(b) ? b : 0; } f = M.prototype; f.clone = function() { return new M(this.x, this.y); }; f.toString = function() { return "(" + this.x + ", " + this.y + ")"; }; function rd(a, b) { return new M(a.x - b.x, a.y - b.y); } f.ceil = function() { this.x = Math.ceil(this.x); this.y = Math.ceil(this.y); return this; }; f.floor = function() { this.x = Math.floor(this.x); this.y = Math.floor(this.y); return this; }; f.round = function() { this.x = Math.round(this.x); this.y = Math.round(this.y); return this; }; function sd(a, b) { this.width = a; this.height = b; } f = sd.prototype; f.clone = function() { return new sd(this.width, this.height); }; f.toString = function() { return "(" + this.width + " x " + this.height + ")"; }; f.ceil = function() { this.width = Math.ceil(this.width); this.height = Math.ceil(this.height); return this; }; f.floor = function() { this.width = Math.floor(this.width); this.height = Math.floor(this.height); return this; }; f.round = function() { this.width = Math.round(this.width); this.height = Math.round(this.height); return this; }; function N(a) { return a ? new td(O(a)) : Ba || (Ba = new td); } function ud(a, b) { fb(b, function(b, d) { "style" == d ? a.style.cssText = b : "class" == d ? a.className = b : "for" == d ? a.htmlFor = b : vd.hasOwnProperty(d) ? a.setAttribute(vd[d], b) : 0 == d.lastIndexOf("aria-", 0) || 0 == d.lastIndexOf("data-", 0) ? a.setAttribute(d, b) : a[d] = b; }); } var vd = {cellpadding:"cellPadding", cellspacing:"cellSpacing", colspan:"colSpan", frameborder:"frameBorder", height:"height", maxlength:"maxLength", role:"role", rowspan:"rowSpan", type:"type", usemap:"useMap", valign:"vAlign", width:"width"}; function wd(a) { a = a.document; a = "CSS1Compat" == a.compatMode ? a.documentElement : a.body; return new sd(a.clientWidth, a.clientHeight); } function xd(a) { return a.scrollingElement ? a.scrollingElement : H || "CSS1Compat" != a.compatMode ? a.body || a.documentElement : a.documentElement; } function yd(a) { return a ? zd(a) : window; } function zd(a) { return a.parentWindow || a.defaultView; } function Ad(a, b, c) { return Bd(document, arguments); } function Bd(a, b) { var c = b[0], d = b[1]; if (!od && d && (d.name || d.type)) { c = ["<", c]; d.name && c.push(' name="', Ea(d.name), '"'); if (d.type) { c.push(' type="', Ea(d.type), '"'); var e = {}; ib(e, d); delete e.type; d = e; } c.push(">"); c = c.join(""); } c = a.createElement(c); d && (r(d) ? c.className = d : p(d) ? c.className = d.join(" ") : ud(c, d)); 2 < b.length && Cd(a, c, b, 2); return c; } function Cd(a, b, c, d) { function e(c) { c && b.appendChild(r(c) ? a.createTextNode(c) : c); } for (;d < c.length;d++) { var g = c[d]; !ja(g) || ka(g) && 0 < g.nodeType ? e(g) : C(Dd(g) ? bb(g) : g, e); } } function Ed(a, b) { Cd(O(a), a, arguments, 1); } function Fd(a) { for (var b;b = a.firstChild;) { a.removeChild(b); } } function Gd(a) { return a && a.parentNode ? a.parentNode.removeChild(a) : null; } function Hd(a, b) { if (!a || !b) { return !1; } if (a.contains && 1 == b.nodeType) { return a == b || a.contains(b); } if ("undefined" != typeof a.compareDocumentPosition) { return a == b || !!(a.compareDocumentPosition(b) & 16); } for (;b && a != b;) { b = b.parentNode; } return b == a; } function O(a) { return 9 == a.nodeType ? a : a.ownerDocument || a.document; } function Id(a, b) { if ("textContent" in a) { a.textContent = b; } else { if (3 == a.nodeType) { a.data = b; } else { if (a.firstChild && 3 == a.firstChild.nodeType) { for (;a.lastChild != a.firstChild;) { a.removeChild(a.lastChild); } a.firstChild.data = b; } else { Fd(a), a.appendChild(O(a).createTextNode(String(b))); } } } } var Jd = {SCRIPT:1, STYLE:1, HEAD:1, IFRAME:1, OBJECT:1}, Kd = {IMG:" ", BR:"\n"}; function Ld(a, b) { b ? a.tabIndex = 0 : (a.tabIndex = -1, a.removeAttribute("tabIndex")); } function Md(a) { a = a.getAttributeNode("tabindex"); return null != a && a.specified; } function Nd(a) { a = a.tabIndex; return "number" == typeof a && 0 <= a && 32768 > a; } function Od(a) { var b = []; Pd(a, b, !1); return b.join(""); } function Pd(a, b, c) { if (!(a.nodeName in Jd)) { if (3 == a.nodeType) { c ? b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g, "")) : b.push(a.nodeValue); } else { if (a.nodeName in Kd) { b.push(Kd[a.nodeName]); } else { for (a = a.firstChild;a;) { Pd(a, b, c), a = a.nextSibling; } } } } } function Dd(a) { if (a && "number" == typeof a.length) { if (ka(a)) { return "function" == typeof a.item || "string" == typeof a.item; } if (u(a)) { return "function" == typeof a.item; } } return !1; } function td(a) { this.a = a || m.document || document; } f = td.prototype; f.g = function(a) { return r(a) ? this.a.getElementById(a) : a; }; f.C = function(a, b, c) { return Bd(this.a, arguments); }; function Qd(a) { return "CSS1Compat" == a.a.compatMode; } function Rd(a) { var b = a.a; a = xd(b); b = zd(b); return E && I("10") && b.pageYOffset != a.scrollTop ? new M(a.scrollLeft, a.scrollTop) : new M(b.pageXOffset || a.scrollLeft, b.pageYOffset || a.scrollTop); } f.yc = Gd; function Sd(a) { return pd && void 0 != a.children ? a.children : Va(a.childNodes, function(a) { return 1 == a.nodeType; }); } f.contains = Hd; f.fd = Id; function P(a, b, c, d) { this.top = a; this.right = b; this.bottom = c; this.left = d; } f = P.prototype; f.clone = function() { return new P(this.top, this.right, this.bottom, this.left); }; f.toString = function() { return "(" + this.top + "t, " + this.right + "r, " + this.bottom + "b, " + this.left + "l)"; }; f.contains = function(a) { return this && a ? a instanceof P ? a.left >= this.left && a.right <= this.right && a.top >= this.top && a.bottom <= this.bottom : a.x >= this.left && a.x <= this.right && a.y >= this.top && a.y <= this.bottom : !1; }; function Td(a, b) { var c = b.x < a.left ? b.x - a.left : b.x > a.right ? b.x - a.right : 0, d = b.y < a.top ? b.y - a.top : b.y > a.bottom ? b.y - a.bottom : 0; return Math.sqrt(c * c + d * d); } f.ceil = function() { this.top = Math.ceil(this.top); this.right = Math.ceil(this.right); this.bottom = Math.ceil(this.bottom); this.left = Math.ceil(this.left); return this; }; f.floor = function() { this.top = Math.floor(this.top); this.right = Math.floor(this.right); this.bottom = Math.floor(this.bottom); this.left = Math.floor(this.left); return this; }; f.round = function() { this.top = Math.round(this.top); this.right = Math.round(this.right); this.bottom = Math.round(this.bottom); this.left = Math.round(this.left); return this; }; function Ud(a, b, c, d) { this.left = a; this.top = b; this.width = c; this.height = d; } f = Ud.prototype; f.clone = function() { return new Ud(this.left, this.top, this.width, this.height); }; function Vd(a) { return new P(a.top, a.left + a.width, a.top + a.height, a.left); } f.toString = function() { return "(" + this.left + ", " + this.top + " - " + this.width + "w x " + this.height + "h)"; }; f.contains = function(a) { return a instanceof Ud ? this.left <= a.left && this.left + this.width >= a.left + a.width && this.top <= a.top && this.top + this.height >= a.top + a.height : a.x >= this.left && a.x <= this.left + this.width && a.y >= this.top && a.y <= this.top + this.height; }; f.ceil = function() { this.left = Math.ceil(this.left); this.top = Math.ceil(this.top); this.width = Math.ceil(this.width); this.height = Math.ceil(this.height); return this; }; f.floor = function() { this.left = Math.floor(this.left); this.top = Math.floor(this.top); this.width = Math.floor(this.width); this.height = Math.floor(this.height); return this; }; f.round = function() { this.left = Math.round(this.left); this.top = Math.round(this.top); this.width = Math.round(this.width); this.height = Math.round(this.height); return this; }; function Wd(a, b, c) { if (r(b)) { (b = Xd(a, b)) && (a.style[b] = c); } else { for (var d in b) { c = a; var e = b[d], g = Xd(c, d); g && (c.style[g] = e); } } } var Yd = {}; function Xd(a, b) { var c = Yd[b]; if (!c) { var d = Oa(b), c = d; void 0 === a.style[d] && (d = (H ? "Webkit" : G ? "Moz" : E ? "ms" : Wb ? "O" : null) + Pa(d), void 0 !== a.style[d] && (c = d)); Yd[b] = c; } return c; } function Zd(a, b) { var c = O(a); return c.defaultView && c.defaultView.getComputedStyle && (c = c.defaultView.getComputedStyle(a, null)) ? c[b] || c.getPropertyValue(b) || "" : ""; } function $d(a, b) { return Zd(a, b) || (a.currentStyle ? a.currentStyle[b] : null) || a.style && a.style[b]; } function ae(a, b, c) { var d; b instanceof M ? (d = b.x, b = b.y) : (d = b, b = c); a.style.left = be(d, !1); a.style.top = be(b, !1); } function ce(a) { a = a ? O(a) : document; return !E || dc(9) || Qd(N(a)) ? a.documentElement : a.body; } function de(a) { var b; try { b = a.getBoundingClientRect(); } catch (c) { return {left:0, top:0, right:0, bottom:0}; } E && a.ownerDocument.body && (a = a.ownerDocument, b.left -= a.documentElement.clientLeft + a.body.clientLeft, b.top -= a.documentElement.clientTop + a.body.clientTop); return b; } function ee(a) { if (E && !dc(8)) { return a.offsetParent; } var b = O(a), c = $d(a, "position"), d = "fixed" == c || "absolute" == c; for (a = a.parentNode;a && a != b;a = a.parentNode) { if (11 == a.nodeType && a.host && (a = a.host), c = $d(a, "position"), d = d && "static" == c && a != b.documentElement && a != b.body, !d && (a.scrollWidth > a.clientWidth || a.scrollHeight > a.clientHeight || "fixed" == c || "absolute" == c || "relative" == c)) { return a; } } return null; } function fe(a) { for (var b = new P(0, Infinity, Infinity, 0), c = N(a), d = c.a.body, e = c.a.documentElement, g = xd(c.a);a = ee(a);) { if (!(E && 0 == a.clientWidth || H && 0 == a.clientHeight && a == d) && a != d && a != e && "visible" != $d(a, "overflow")) { var h = ge(a), k = new M(a.clientLeft, a.clientTop); h.x += k.x; h.y += k.y; b.top = Math.max(b.top, h.y); b.right = Math.min(b.right, h.x + a.clientWidth); b.bottom = Math.min(b.bottom, h.y + a.clientHeight); b.left = Math.max(b.left, h.x); } } d = g.scrollLeft; g = g.scrollTop; b.left = Math.max(b.left, d); b.top = Math.max(b.top, g); c = wd(zd(c.a) || window); b.right = Math.min(b.right, d + c.width); b.bottom = Math.min(b.bottom, g + c.height); return 0 <= b.top && 0 <= b.left && b.bottom > b.top && b.right > b.left ? b : null; } function ge(a) { var b = O(a), c = new M(0, 0), d = ce(b); if (a == d) { return c; } a = de(a); b = Rd(N(b)); c.x = a.left + b.x; c.y = a.top + b.y; return c; } function he(a, b, c) { if (b instanceof sd) { c = b.height, b = b.width; } else { if (void 0 == c) { throw Error("missing height argument"); } } a.style.width = be(b, !0); a.style.height = be(c, !0); } function be(a, b) { "number" == typeof a && (a = (b ? Math.round(a) : a) + "px"); return a; } function ie(a) { var b = je; if ("none" != $d(a, "display")) { return b(a); } var c = a.style, d = c.display, e = c.visibility, g = c.position; c.visibility = "hidden"; c.position = "absolute"; c.display = "inline"; a = b(a); c.display = d; c.position = g; c.visibility = e; return a; } function je(a) { var b = a.offsetWidth, c = a.offsetHeight, d = H && !b && !c; return n(b) && !d || !a.getBoundingClientRect ? new sd(b, c) : (a = de(a), new sd(a.right - a.left, a.bottom - a.top)); } function ke(a) { var b = ge(a); a = ie(a); return new Ud(b.x, b.y, a.width, a.height); } function le(a, b) { var c = a.style; "opacity" in c ? c.opacity = b : "MozOpacity" in c ? c.MozOpacity = b : "filter" in c && (c.filter = "" === b ? "" : "alpha(opacity=" + 100 * Number(b) + ")"); } function Q(a, b) { a.style.display = b ? "" : "none"; } function me(a) { return "rtl" == $d(a, "direction"); } var ne = G ? "MozUserSelect" : H || Xb ? "WebkitUserSelect" : null; function oe(a, b, c) { c = c ? null : a.getElementsByTagName("*"); if (ne) { if (b = b ? "none" : "", a.style && (a.style[ne] = b), c) { a = 0; for (var d;d = c[a];a++) { d.style && (d.style[ne] = b); } } } else { if (E || Wb) { if (b = b ? "on" : "", a.setAttribute("unselectable", b), c) { for (a = 0;d = c[a];a++) { d.setAttribute("unselectable", b); } } } } } function pe(a, b) { if (/^\d+px?$/.test(b)) { return parseInt(b, 10); } var c = a.style.left, d = a.runtimeStyle.left; a.runtimeStyle.left = a.currentStyle.left; a.style.left = b; var e = a.style.pixelLeft; a.style.left = c; a.runtimeStyle.left = d; return e; } function qe(a, b) { var c = a.currentStyle ? a.currentStyle[b] : null; return c ? pe(a, c) : 0; } var re = {thin:2, medium:4, thick:6}; function se(a, b) { if ("none" == (a.currentStyle ? a.currentStyle[b + "Style"] : null)) { return 0; } var c = a.currentStyle ? a.currentStyle[b + "Width"] : null; return c in re ? re[c] : pe(a, c); } ;function te(a) { A.call(this); this.b = a; this.a = {}; } y(te, A); var ue = []; te.prototype.w = function(a, b, c, d) { p(b) || (b && (ue[0] = b.toString()), b = ue); for (var e = 0;e < b.length;e++) { var g = L(a, b[e], c || this.handleEvent, d || !1, this.b || this); if (!g) { break; } this.a[g.key] = g; } return this; }; te.prototype.na = function(a, b, c, d, e) { if (p(b)) { for (var g = 0;g < b.length;g++) { this.na(a, b[g], c, d, e); } } else { c = c || this.handleEvent, e = e || this.b || this, c = $c(c), d = !!d, b = Pc(a) ? Wc(a.L, String(b), c, d, e) : a ? (a = bd(a)) ? Wc(a, b, c, d, e) : null : null, b && (hd(b), delete this.a[b.key]); } return this; }; function ve(a) { fb(a.a, function(a, c) { this.a.hasOwnProperty(c) && hd(a); }, a); a.a = {}; } te.prototype.v = function() { te.m.v.call(this); ve(this); }; te.prototype.handleEvent = function() { throw Error("EventHandler.handleEvent not implemented"); }; function R() { A.call(this); this.L = new Tc(this); this.cd = this; this.pb = null; } y(R, A); R.prototype[Oc] = !0; f = R.prototype; f.nc = function(a) { this.pb = a; }; f.removeEventListener = function(a, b, c, d) { gd(this, a, b, c, d); }; f.D = function(a) { var b, c = this.pb; if (c) { for (b = [];c;c = c.pb) { b.push(c); } } var c = this.cd, d = a.type || a; if (r(a)) { a = new J(a, c); } else { if (a instanceof J) { a.target = a.target || c; } else { var e = a; a = new J(d, c); ib(a, e); } } var e = !0, g; if (b) { for (var h = b.length - 1;!a.h && 0 <= h;h--) { g = a.l = b[h], e = we(g, d, !0, a) && e; } } a.h || (g = a.l = c, e = we(g, d, !0, a) && e, a.h || (e = we(g, d, !1, a) && e)); if (b) { for (h = 0;!a.h && h < b.length;h++) { g = a.l = b[h], e = we(g, d, !1, a) && e; } } return e; }; f.v = function() { R.m.v.call(this); this.lb(); this.pb = null; }; f.w = function(a, b, c, d) { return this.L.add(String(a), b, !1, c, d); }; f.na = function(a, b, c, d) { var e; e = this.L; a = String(a).toString(); if (a in e.a) { var g = e.a[a]; b = Uc(g, b, c, d); -1 < b ? (Sc(g[b]), Array.prototype.splice.call(g, b, 1), 0 == g.length && (delete e.a[a], e.b--), e = !0) : e = !1; } else { e = !1; } return e; }; f.lb = function(a) { var b; if (this.L) { b = this.L; a = a && a.toString(); var c = 0, d; for (d in b.a) { if (!a || d == a) { for (var e = b.a[d], g = 0;g < e.length;g++) { ++c, Sc(e[g]); } delete b.a[d]; b.b--; } } b = c; } else { b = 0; } return b; }; function we(a, b, c, d) { b = a.L.a[String(b)]; if (!b) { return !0; } b = b.concat(); for (var e = !0, g = 0;g < b.length;++g) { var h = b[g]; if (h && !h.Ya && h.sb == c) { var k = h.listener, l = h.Eb || h.src; h.rb && Vc(a.L, h); e = !1 !== k.call(l, d) && e; } } return e && 0 != d.Xc; } ;function xe() { } ha(xe); xe.prototype.a = 0; function S(a) { R.call(this); this.a = a || N(); this.Fa = ye; this.pa = null; this.J = !1; this.b = null; this.T = void 0; this.M = this.j = this.l = null; } y(S, R); S.prototype.ab = xe.Ha(); var ye = null; function Ae(a, b) { switch(a) { case 1: return b ? "disable" : "enable"; case 2: return b ? "highlight" : "unhighlight"; case 4: return b ? "activate" : "deactivate"; case 8: return b ? "select" : "unselect"; case 16: return b ? "check" : "uncheck"; case 32: return b ? "focus" : "blur"; case 64: return b ? "open" : "close"; } throw Error("Invalid component state"); } f = S.prototype; f.P = function() { return this.pa || (this.pa = ":" + (this.ab.a++).toString(36)); }; f.g = function() { return this.b; }; function T(a) { a.T || (a.T = new te(a)); return a.T; } function Be(a, b) { if (a == b) { throw Error("Unable to set parent component"); } if (b && a.l && a.pa && Ce(a.l, a.pa) && a.l != b) { throw Error("Unable to set parent component"); } a.l = b; S.m.nc.call(a, b); } f.nc = function(a) { if (this.l && this.l != a) { throw Error("Method not supported"); } S.m.nc.call(this, a); }; f.I = function() { this.b = this.a.a.createElement("DIV"); }; function De(a, b, c) { if (a.J) { throw Error("Component already rendered"); } a.b || a.I(); b ? b.insertBefore(a.b, c || null) : a.a.a.body.appendChild(a.b); a.l && !a.l.J || a.V(); } f.V = function() { this.J = !0; Ee(this, function(a) { !a.J && a.g() && a.V(); }); }; f.ea = function() { Ee(this, function(a) { a.J && a.ea(); }); this.T && ve(this.T); this.J = !1; }; f.v = function() { this.J && this.ea(); this.T && (this.T.O(), delete this.T); Ee(this, function(a) { a.O(); }); this.b && Gd(this.b); this.l = this.b = this.M = this.j = null; S.m.v.call(this); }; f.la = function(a, b) { this.qb(a, Fe(this), b); }; f.qb = function(a, b, c) { if (a.J && (c || !this.J)) { throw Error("Component already rendered"); } if (0 > b || b > Fe(this)) { throw Error("Child component index out of bounds"); } this.M && this.j || (this.M = {}, this.j = []); if (a.l == this) { var d = a.P(); this.M[d] = a; $a(this.j, a); } else { var d = this.M, e = a.P(); if (null !== d && e in d) { throw Error('The object already contains the key "' + e + '"'); } d[e] = a; } Be(a, this); cb(this.j, b, 0, a); a.J && this.J && a.l == this ? (c = this.Ia(), b = c.childNodes[b] || null, b != a.g() && c.insertBefore(a.g(), b)) : c ? (this.b || this.I(), b = U(this, b + 1), De(a, this.Ia(), b ? b.b : null)) : this.J && !a.J && a.b && a.b.parentNode && 1 == a.b.parentNode.nodeType && a.V(); }; f.Ia = function() { return this.b; }; function Ge(a) { null == a.Fa && (a.Fa = me(a.J ? a.b : a.a.a.body)); return a.Fa; } function Fe(a) { return a.j ? a.j.length : 0; } function Ce(a, b) { var c; a.M && b ? (c = a.M, c = (null !== c && b in c ? c[b] : void 0) || null) : c = null; return c; } function U(a, b) { return a.j ? a.j[b] || null : null; } function Ee(a, b, c) { a.j && C(a.j, b, c); } function He(a, b) { return a.j && b ? Ua(a.j, b) : -1; } f.removeChild = function(a, b) { if (a) { var c = r(a) ? a : a.P(); a = Ce(this, c); if (c && a) { var d = this.M; c in d && delete d[c]; $a(this.j, a); b && (a.ea(), a.b && Gd(a.b)); Be(a, null); } } if (!a) { throw Error("Child is not in parent component"); } return a; }; function Ie() { S.call(this); } y(Ie, S); f = Ie.prototype; f.jc = null; f.v = function() { id(this.g()); hd(this.jc); this.jc = null; Ie.m.v.call(this); }; f.I = function() { var a = this.a.C("DIV", "banner"); Wd(a, "position", "absolute"); Wd(a, "top", "0"); L(a, "click", x(this.Kb, this, !1)); this.b = a; this.Lb(); this.jc = L(yd(this.a.a) || window, "resize", this.Lb, !1, this); }; f.Kb = function(a) { Q(this.g(), a); this.Lb(); }; f.Lb = function() { if (!this.g().style.display) { var a = yd(this.a.a) || window, b = Rd(this.a).x, c = ie(this.g()); ae(this.g(), Math.max(b + wd(a || window).width / 2 - c.width / 2, 0), 0); } }; function Je(a, b, c) { J.call(this, a, b); this.data = c; } y(Je, J); var Ke; function Le(a, b) { b ? a.setAttribute("role", b) : a.removeAttribute("role"); } function Me(a, b, c) { p(c) && (c = c.join(" ")); var d = "aria-" + b; "" === c || void 0 == c ? (Ke || (Ke = {atomic:!1, autocomplete:"none", dropeffect:"none", haspopup:!1, live:"off", multiline:!1, multiselectable:!1, orientation:"vertical", readonly:!1, relevant:"additions text", required:!1, sort:"none", busy:!1, disabled:!1, hidden:!1, invalid:"false"}), c = Ke, b in c ? a.setAttribute(d, c[b]) : a.removeAttribute(d)) : a.setAttribute(d, c); } ;function Ne(a) { if (a.classList) { return a.classList; } a = a.className; return r(a) && a.match(/\S+/g) || []; } function Oe(a, b) { return a.classList ? a.classList.contains(b) : Za(Ne(a), b); } function Pe(a, b) { a.classList ? a.classList.add(b) : Oe(a, b) || (a.className += 0 < a.className.length ? " " + b : b); } function Qe(a, b) { if (a.classList) { C(b, function(b) { Pe(a, b); }); } else { var c = {}; C(Ne(a), function(a) { c[a] = !0; }); C(b, function(a) { c[a] = !0; }); a.className = ""; for (var d in c) { a.className += 0 < a.className.length ? " " + d : d; } } } function Re(a, b) { a.classList ? a.classList.remove(b) : Oe(a, b) && (a.className = Va(Ne(a), function(a) { return a != b; }).join(" ")); } function Se(a, b) { a.classList ? C(b, function(b) { Re(a, b); }) : a.className = Va(Ne(a), function(a) { return !Za(b, a); }).join(" "); } ;function Te(a, b, c, d, e) { if (!(E || Xb || H && I("525"))) { return !0; } if (Zb && e) { return Ue(a); } if (e && !d) { return !1; } "number" == typeof b && (b = Ve(b)); if (!c && (17 == b || 18 == b || Zb && 91 == b)) { return !1; } if ((H || Xb) && d && c) { switch(a) { case 220: ; case 219: ; case 221: ; case 192: ; case 186: ; case 189: ; case 187: ; case 188: ; case 190: ; case 191: ; case 192: ; case 222: return !1; } } if (E && d && b == a) { return !1; } switch(a) { case 13: return !0; case 27: return !(H || Xb); } return Ue(a); } function Ue(a) { if (48 <= a && 57 >= a || 96 <= a && 106 >= a || 65 <= a && 90 >= a || (H || Xb) && 0 == a) { return !0; } switch(a) { case 32: ; case 43: ; case 63: ; case 64: ; case 107: ; case 109: ; case 110: ; case 111: ; case 186: ; case 59: ; case 189: ; case 187: ; case 61: ; case 188: ; case 190: ; case 191: ; case 192: ; case 222: ; case 219: ; case 220: ; case 221: return !0; default: return !1; } } function Ve(a) { if (G) { a = We(a); } else { if (Zb && H) { a: { switch(a) { case 93: a = 91; break a; } } } } return a; } function We(a) { switch(a) { case 61: return 187; case 59: return 186; case 173: return 189; case 224: return 91; case 0: return 224; default: return a; } } ;function Xe(a, b, c) { R.call(this); this.target = a; this.M = b || a; this.h = c || new Ud(NaN, NaN, NaN, NaN); this.l = O(a); this.a = new te(this); xa(this, qa(B, this.a)); this.j = this.c = this.F = this.B = this.clientY = this.clientX = 0; this.o = !0; this.b = !1; L(this.M, ["touchstart", "mousedown"], this.Zc, !1, this); } y(Xe, R); var Ye = m.document && m.document.documentElement && !!m.document.documentElement.setCapture; f = Xe.prototype; f.ka = function(a) { this.o = a; }; f.v = function() { Xe.m.v.call(this); gd(this.M, ["touchstart", "mousedown"], this.Zc, !1, this); ve(this.a); Ye && this.l.releaseCapture(); this.M = this.target = null; }; f.Zc = function(a) { var b = "mousedown" == a.type; if (!this.o || this.b || b && !Nc(a)) { this.D("earlycancel"); } else { if (this.D(new Ze("start", this, a.clientX, a.clientY))) { this.b = !0; a.b(); var b = this.l, c = b.documentElement, d = !Ye; this.a.w(b, ["touchmove", "mousemove"], this.xd, d); this.a.w(b, ["touchend", "mouseup"], this.tb, d); Ye ? (c.setCapture(!1), this.a.w(c, "losecapture", this.tb)) : this.a.w(yd(b), "blur", this.tb); this.G && this.a.w(this.G, "scroll", this.Qd, d); this.clientX = this.B = a.clientX; this.clientY = this.F = a.clientY; this.c = this.target.offsetLeft; this.j = this.target.offsetTop; this.T = Rd(N(this.l)); } } }; f.tb = function(a) { ve(this.a); Ye && this.l.releaseCapture(); this.b ? (this.b = !1, this.D(new Ze("end", this, a.clientX, a.clientY, 0, $e(this, this.c), af(this, this.j)))) : this.D("earlycancel"); }; f.xd = function(a) { if (this.o) { var b = 1 * (a.clientX - this.clientX), c = a.clientY - this.clientY; this.clientX = a.clientX; this.clientY = a.clientY; if (!this.b) { var d = this.B - this.clientX, e = this.F - this.clientY; if (0 < d * d + e * e) { if (this.D(new Ze("start", this, a.clientX, a.clientY))) { this.b = !0; } else { this.Da || this.tb(a); return; } } } c = bf(this, b, c); b = c.x; c = c.y; this.b && this.D(new Ze("beforedrag", this, a.clientX, a.clientY, 0, b, c)) && (cf(this, a, b, c), a.b()); } }; function bf(a, b, c) { var d = Rd(N(a.l)); b += d.x - a.T.x; c += d.y - a.T.y; a.T = d; a.c += b; a.j += c; return new M($e(a, a.c), af(a, a.j)); } f.Qd = function(a) { var b = bf(this, 0, 0); a.clientX = this.clientX; a.clientY = this.clientY; cf(this, a, b.x, b.y); }; function cf(a, b, c, d) { a.target.style.left = c + "px"; a.target.style.top = d + "px"; a.D(new Ze("drag", a, b.clientX, b.clientY, 0, c, d)); } function $e(a, b) { var c = a.h, d = isNaN(c.left) ? null : c.left, c = isNaN(c.width) ? 0 : c.width; return Math.min(null != d ? d + c : Infinity, Math.max(null != d ? d : -Infinity, b)); } function af(a, b) { var c = a.h, d = isNaN(c.top) ? null : c.top, c = isNaN(c.height) ? 0 : c.height; return Math.min(null != d ? d + c : Infinity, Math.max(null != d ? d : -Infinity, b)); } function Ze(a, b, c, d, e, g, h) { J.call(this, a); this.clientX = c; this.clientY = d; this.left = n(g) ? g : b.c; this.top = n(h) ? h : b.j; } y(Ze, J); function df(a, b, c) { this.j = c; this.c = a; this.l = b; this.b = 0; this.a = null; } df.prototype.put = function(a) { this.l(a); this.b < this.j && (this.b++, a.next = this.a, this.a = a); }; function ef() { this.b = this.a = null; } var gf = new df(function() { return new ff; }, function(a) { a.reset(); }, 100); ef.prototype.add = function(a, b) { var c; 0 < gf.b ? (gf.b--, c = gf.a, gf.a = c.next, c.next = null) : c = gf.c(); c.Ra = a; c.scope = b; c.next = null; this.b ? this.b.next = c : this.a = c; this.b = c; }; function hf() { var a = jf, b = null; a.a && (b = a.a, a.a = a.a.next, a.a || (a.b = null), b.next = null); return b; } function ff() { this.next = this.scope = this.Ra = null; } ff.prototype.reset = function() { this.next = this.scope = this.Ra = null; }; function kf(a) { m.setTimeout(function() { throw a; }, 0); } var lf; function mf() { var a = m.MessageChannel; "undefined" === typeof a && "undefined" !== typeof window && window.postMessage && window.addEventListener && !D("Presto") && (a = function() { var a = document.createElement("IFRAME"); a.style.display = "none"; a.src = ""; document.documentElement.appendChild(a); var b = a.contentWindow, a = b.document; a.open(); a.write(""); a.close(); var c = "callImmediate" + Math.random(), d = "file:" == b.location.protocol ? "*" : b.location.protocol + "//" + b.location.host, a = x(function(a) { if (("*" == d || a.origin == d) && a.data == c) { this.port1.onmessage(); } }, this); b.addEventListener("message", a, !1); this.port1 = {}; this.port2 = {postMessage:function() { b.postMessage(c, d); }}; }); if ("undefined" !== typeof a && !D("Trident") && !D("MSIE")) { var b = new a, c = {}, d = c; b.port1.onmessage = function() { if (n(c.next)) { c = c.next; var a = c.rc; c.rc = null; a(); } }; return function(a) { d.next = {rc:a}; d = d.next; b.port2.postMessage(0); }; } return "undefined" !== typeof document && "onreadystatechange" in document.createElement("SCRIPT") ? function(a) { var b = document.createElement("SCRIPT"); b.onreadystatechange = function() { b.onreadystatechange = null; b.parentNode.removeChild(b); b = null; a(); a = null; }; document.documentElement.appendChild(b); } : function(a) { m.setTimeout(a, 0); }; } ;function nf(a, b) { of || pf(); qf || (of(), qf = !0); jf.add(a, b); } var of; function pf() { if (m.Promise && m.Promise.resolve) { var a = m.Promise.resolve(void 0); of = function() { a.then(rf); }; } else { of = function() { var a = rf; !u(m.setImmediate) || m.Window && m.Window.prototype && !D("Edge") && m.Window.prototype.setImmediate == m.setImmediate ? (lf || (lf = mf()), lf(a)) : m.setImmediate(a); }; } } var qf = !1, jf = new ef; function rf() { for (var a = null;a = hf();) { try { a.Ra.call(a.scope); } catch (b) { kf(b); } gf.put(a); } qf = !1; } ;function sf(a, b, c) { if (u(a)) { c && (a = x(a, c)); } else { if (a && "function" == typeof a.handleEvent) { a = x(a.handleEvent, a); } else { throw Error("Invalid listener argument"); } } return 2147483647 < Number(b) ? -1 : m.setTimeout(a, b || 0); } ;var tf = E ? 'javascript:""' : "about:blank"; function uf(a) { R.call(this); this.a = a; a = E ? "focusout" : "blur"; this.b = L(this.a, E ? "focusin" : "focus", this, !E); this.c = L(this.a, a, this, !E); } y(uf, R); uf.prototype.handleEvent = function(a) { var b = new K(a.c); b.type = "focusin" == a.type || "focus" == a.type ? "focusin" : "focusout"; this.D(b); }; uf.prototype.v = function() { uf.m.v.call(this); hd(this.b); hd(this.c); delete this.a; }; function vf(a, b) { this.c = a; this.b = b; } ;function wf(a, b) { R.call(this); this.c = new te(this); this.lc(a || null); b && (this.$a = b); } y(wf, R); f = wf.prototype; f.fa = null; f.qc = null; f.ba = !1; f.hc = -1; f.$a = "toggle_display"; f.g = function() { return this.fa; }; f.lc = function(a) { if (this.ba) { throw Error("Can not change this state of the popup while showing."); } this.fa = a; }; f.za = function(a) { this.G && this.G.stop(); this.B && this.B.stop(); if (a) { if (!this.ba && this.ic()) { if (!this.fa) { throw Error("Caller must call setElement before trying to show the popup"); } this.ib(); a = O(this.fa); this.c.w(a, "mousedown", this.Tc, !0); if (E) { var b; try { b = a.activeElement; } catch (d) { } for (;b && "IFRAME" == b.nodeName;) { try { var c = b.contentDocument || b.contentWindow.document; } catch (d) { break; } a = c; b = a.activeElement; } this.c.w(a, "mousedown", this.Tc, !0); this.c.w(a, "deactivate", this.Sc); } else { this.c.w(a, "blur", this.Sc); } "toggle_display" == this.$a ? (this.fa.style.visibility = "visible", Q(this.fa, !0)) : "move_offscreen" == this.$a && this.ib(); this.ba = !0; this.hc = ra(); this.G ? (fd(this.G, "end", this.Bb, !1, this), this.G.play()) : this.Bb(); } } else { xf(this); } }; f.ib = ga; function xf(a, b) { a.ba && a.D({type:"beforehide", target:b}) && (a.c && ve(a.c), a.ba = !1, ra(), a.B ? (fd(a.B, "end", qa(a.sc, b), !1, a), a.B.play()) : a.sc(b)); } f.sc = function(a) { "toggle_display" == this.$a ? this.Fd() : "move_offscreen" == this.$a && (this.fa.style.top = "-10000px"); this.hb(a); }; f.Fd = function() { this.fa.style.visibility = "hidden"; Q(this.fa, !1); }; f.ic = function() { return this.D("beforeshow"); }; f.Bb = function() { this.D("show"); }; f.hb = function(a) { this.D({type:"hide", target:a}); }; f.Tc = function(a) { a = a.target; Hd(this.fa, a) || yf(this, a) || 150 > ra() - this.hc || xf(this, a); }; f.Sc = function(a) { var b = O(this.fa); if ("undefined" != typeof document.activeElement) { if (a = b.activeElement, !a || Hd(this.fa, a) || "BODY" == a.tagName) { return; } } else { if (a.target != b) { return; } } 150 > ra() - this.hc || xf(this); }; function yf(a, b) { return Xa(a.qc || [], function(a) { return b === a || Hd(a, b); }); } f.v = function() { wf.m.v.call(this); this.c.O(); B(this.G); B(this.B); delete this.fa; delete this.c; delete this.qc; }; function zf(a, b) { S.call(this, b); this.Pa = !!a; this.B = null; } y(zf, S); f = zf.prototype; f.Vb = null; f.ya = !1; f.da = null; f.X = null; f.ma = null; f.Rb = !1; f.Y = function() { return "goog-modalpopup"; }; f.ub = function() { return this.da; }; f.I = function() { zf.m.I.call(this); var a = this.g(), b = Da(this.Y()).split(" "); Qe(a, b); Ld(a, !0); Q(a, !1); this.Pa && !this.X && (a = this.a, b = r(void 0) ? Kb(void 0).Xb() : "", this.X = a.C("iframe", {frameborder:0, style:"border:0;vertical-align:bottom;" + b, src:tf}), this.X.className = this.Y() + "-bg", Q(this.X, !1), le(this.X, 0)); this.da || (this.da = this.a.C("DIV", this.Y() + "-bg"), Q(this.da, !1)); this.ma || (this.ma = this.a.a.createElement("SPAN"), Q(this.ma, !1), Ld(this.ma, !0), this.ma.style.position = "absolute"); }; f.Wc = function() { this.Rb = !1; }; f.V = function() { if (this.X) { var a = this.g(); a.parentNode && a.parentNode.insertBefore(this.X, a); } a = this.g(); a.parentNode && a.parentNode.insertBefore(this.da, a); zf.m.V.call(this); a = this.g(); a.parentNode && a.parentNode.insertBefore(this.ma, a.nextSibling); this.Vb = new uf(this.a.a); T(this).w(this.Vb, "focusin", this.Md); Af(this, !1); }; f.ea = function() { this.ya && this.Z(!1); B(this.Vb); zf.m.ea.call(this); Gd(this.X); Gd(this.da); Gd(this.ma); }; f.Z = function(a) { if (a != this.ya) { if (this.G && this.G.stop(), this.U && this.U.stop(), this.F && this.F.stop(), this.K && this.K.stop(), this.J && Af(this, a), a) { if (this.D("beforeshow")) { try { this.B = this.a.a.activeElement; } catch (e) { } this.kc(); Bf(this); T(this).w(zd(this.a.a), "resize", this.kc); Cf(this, !0); this.xc(); this.ya = !0; this.G && this.U ? (fd(this.G, "end", this.Ab, !1, this), this.U.play(), this.G.play()) : this.Ab(); } } else { if (this.D("beforehide")) { T(this).na(zd(this.a.a), "resize", this.kc); this.ya = !1; this.F && this.K ? (fd(this.F, "end", this.zb, !1, this), this.K.play(), this.F.play()) : this.zb(); a: { try { var b = this.a, c = b.a.body, d = b.a.activeElement || c; if (!this.B || this.B == c) { this.B = null; break a; } (d == c || b.contains(this.g(), d)) && this.B.focus(); } catch (e) { } this.B = null; } } } } }; function Af(a, b) { a.ca || (a.ca = new vf(a.b, a.a)); var c = a.ca; if (b) { c.a || (c.a = []); for (var d = Sd(c.b.a.body), e = 0;e < d.length;e++) { var g = d[e], h; if (h = g != c.c) { h = g.getAttribute("aria-hidden"), h = !(null == h || void 0 == h ? 0 : String(h)); } h && (Me(g, "hidden", !0), c.a.push(g)); } } else { if (c.a) { for (e = 0;e < c.a.length;e++) { c.a[e].removeAttribute("aria-hidden"); } c.a = null; } } } function Cf(a, b) { a.X && Q(a.X, b); a.da && Q(a.da, b); Q(a.g(), b); Q(a.ma, b); } f.Ab = function() { this.D("show"); }; f.zb = function() { Cf(this, !1); this.D("hide"); }; f.kc = function() { this.X && Q(this.X, !1); this.da && Q(this.da, !1); var a = this.a.a, b = wd(yd(a) || window || window), c = Math.max(b.width, Math.max(a.body.scrollWidth, a.documentElement.scrollWidth)), a = Math.max(b.height, Math.max(a.body.scrollHeight, a.documentElement.scrollHeight)); this.X && (Q(this.X, !0), he(this.X, c, a)); this.da && (Q(this.da, !0), he(this.da, c, a)); }; function Bf(a) { var b = yd(a.a.a) || window; if ("fixed" == $d(a.g(), "position")) { var c = 0, d = 0 } else { d = Rd(a.a), c = d.x, d = d.y; } var e = ie(a.g()), b = wd(b || window), c = Math.max(c + b.width / 2 - e.width / 2, 0), d = Math.max(d + b.height / 2 - e.height / 2, 0); ae(a.g(), c, d); ae(a.ma, c, d); } f.Md = function(a) { this.Rb ? this.Wc() : a.target == this.ma && sf(this.xc, 0, this); }; f.xc = function() { try { E && this.a.a.body.focus(), this.g().focus(); } catch (a) { } }; f.v = function() { B(this.G); this.G = null; B(this.F); this.F = null; B(this.U); this.U = null; B(this.K); this.K = null; zf.m.v.call(this); }; function V(a, b, c) { zf.call(this, b, c); this.o = a || "modal-dialog"; this.c = W(W(new Df, Ef, !0), Ff, !1, !0); } y(V, zf); f = V.prototype; f.Rc = !0; f.Qb = .5; f.ad = ""; f.bc = null; f.va = null; f.Za = null; f.Ma = null; f.$c = null; f.ta = null; f.bb = null; f.oa = null; f.Y = function() { return this.o; }; function Gf(a, b) { a.ad = b; a.Ma && Id(a.Ma, b); } function Hf(a, b) { a.bc = b; a.bb && (a.bb.innerHTML = Qb(b)); } f.Ia = function() { this.g() || De(this, void 0); return this.bb; }; f.ub = function() { this.g() || De(this, void 0); return V.m.ub.call(this); }; function If(a, b) { var c = Da(a.o + "-title-draggable").split(" "); a.g() && (b ? Qe(a.Za, c) : Se(a.Za, c)); b && !a.va ? (a.va = new Xe(a.g(), a.Za), Qe(a.Za, c), L(a.va, "start", a.Yd, !1, a)) : !b && a.va && (a.va.O(), a.va = null); } f.I = function() { V.m.I.call(this); var a = this.g(), b = this.a; this.Za = b.C("DIV", this.o + "-title", this.Ma = b.C("SPAN", {className:this.o + "-title-text", id:this.P()}, this.ad), this.ta = b.C("SPAN", this.o + "-title-close")); Ed(a, this.Za, this.bb = b.C("DIV", this.o + "-content"), this.oa = b.C("DIV", this.o + "-buttons")); Le(this.Ma, "heading"); Le(this.ta, "button"); Ld(this.ta, !0); Me(this.ta, "label", Jf); this.$c = this.Ma.id; Le(a, "dialog"); Me(a, "labelledby", this.$c || ""); this.bc && (this.bb.innerHTML = Qb(this.bc)); Q(this.ta, !0); this.c && (a = this.c, a.xa = this.oa, Kf(a)); Q(this.oa, !!this.c); this.Qb = this.Qb; this.g() && (a = this.ub()) && le(a, this.Qb); }; f.V = function() { V.m.V.call(this); T(this).w(this.g(), "keydown", this.Uc).w(this.g(), "keypress", this.Uc); T(this).w(this.oa, "click", this.Id); If(this, !0); T(this).w(this.ta, "click", this.Sd); var a = this.g(); Le(a, "dialog"); "" !== this.Ma.id && Me(a, "labelledby", this.Ma.id); if (!this.Rc) { this.Rc = !1; if (this.J) { var a = this.a, b = this.ub(); a.yc(this.X); a.yc(b); } this.ya && Af(this, !1); } }; f.ea = function() { this.ya && this.Z(!1); If(this, !1); V.m.ea.call(this); }; f.Z = function(a) { a != this.ya && (this.J || De(this, void 0), V.m.Z.call(this, a)); }; f.Ab = function() { V.m.Ab.call(this); this.D(Lf); }; f.zb = function() { V.m.zb.call(this); this.D(Mf); }; f.Yd = function() { var a = this.a.a, b = wd(yd(a) || window || window), c = Math.max(a.body.scrollWidth, b.width), a = Math.max(a.body.scrollHeight, b.height), d = ie(this.g()); "fixed" == $d(this.g(), "position") ? this.va.h = new Ud(0, 0, Math.max(0, b.width - d.width), Math.max(0, b.height - d.height)) : this.va.h = new Ud(0, 0, c - d.width, a - d.height); }; f.Sd = function() { Nf(this); }; function Nf(a) { var b = a.c, c = b && b.Sb; c ? a.D(new Of(c, pb(b, c))) && a.Z(!1) : a.Z(!1); } f.v = function() { this.oa = this.ta = null; V.m.v.call(this); }; f.Id = function(a) { a: { for (a = a.target;null != a && a != this.oa;) { if ("BUTTON" == a.tagName) { break a; } a = a.parentNode; } a = null; } a && !a.disabled && (a = a.name, this.D(new Of(a, pb(this.c, a))) && this.Z(!1)); }; f.Uc = function(a) { var b = !1, c = !1, d = this.c, e = a.target; if ("keydown" == a.type) { if (27 == a.a) { var g = d && d.Sb, e = "SELECT" == e.tagName && !e.disabled; g && !e ? (c = !0, b = this.D(new Of(g, pb(d, g)))) : e || (b = !0); } else { if (9 == a.a && a.shiftKey && e == this.g()) { this.Rb = !0; try { this.ma.focus(); } catch (t) { } sf(this.Wc, 0, this); } } } else { if (13 == a.a) { if ("BUTTON" == e.tagName && !e.disabled) { g = e.name; } else { if (e == this.ta) { Nf(this); } else { if (d) { var h = d.Tb, k; if (k = h) { a: { k = d.xa.getElementsByTagName("BUTTON"); for (var l = 0, q;q = k[l];l++) { if (q.name == h || q.id == h) { k = q; break a; } } k = null; } } e = ("TEXTAREA" == e.tagName || "SELECT" == e.tagName || "A" == e.tagName) && !e.disabled; !k || k.disabled || e || (g = h); } } } g && d && (c = !0, b = this.D(new Of(g, String(pb(d, g))))); } else { e == this.ta && 32 == a.a && Nf(this); } } if (b || c) { a.o(), a.b(); } b && this.Z(!1); }; function Of(a, b) { this.type = Pf; this.key = a; this.caption = b; } y(Of, J); var Pf = "dialogselect", Mf = "afterhide", Lf = "aftershow"; function Df(a) { a || N(); lb.call(this); } y(Df, lb); f = Df.prototype; f.Tb = null; f.xa = null; f.Sb = null; f.ra = function(a, b, c, d) { lb.prototype.ra.call(this, a, b); c && (this.Tb = a); d && (this.Sb = a); return this; }; function W(a, b, c, d) { return a.ra(b.key, b.caption, c, d); } function Kf(a) { if (a.xa) { a.xa.innerHTML = Qb(Tb); var b = N(a.xa); a.forEach(function(a, d) { var e = b.C("BUTTON", {name:d}, a); d == this.Tb && (e.className = "goog-buttonset-default"); this.xa.appendChild(e); }, a); } } f.g = function() { return this.xa; }; var Jf = "Close", Ef = {key:"ok", caption:"OK"}, Ff = {key:"cancel", caption:"Cancel"}, Qf = {key:"yes", caption:"Yes"}, Rf = {key:"no", caption:"No"}, Sf = {key:"save", caption:"Save"}, Tf = {key:"continue", caption:"Continue"}; "undefined" != typeof document && (W(new Df, Ef, !0, !0), W(W(new Df, Ef, !0), Ff, !1, !0), W(W(new Df, Qf, !0), Rf, !1, !0), W(W(W(new Df, Qf), Rf, !0), Ff, !1, !0), W(W(W(new Df, Tf), Sf), Ff, !0, !0)); function Uf() { V.call(this, void 0, !0); this.c = W(new Df, Ef, !0, !0); if (this.oa) { if (this.c) { var a = this.c; a.xa = this.oa; Kf(a); } else { this.oa.innerHTML = Qb(Tb); } Q(this.oa, !!this.c); } Vf(this, Wf); } y(Uf, V); var Wf = 0; Uf.prototype.A = Wf; Uf.prototype.v = function() { delete this.A; Uf.m.v.call(this); }; function Vf(a, b) { a.A = b; switch(b) { case 1: Gf(a, "Screenshot"); break; default: Gf(a, "Taking Screenshot..."), Hf(a, Rb("")); } } ;function Xf() { S.call(this); } y(Xf, S); Xf.prototype.I = function() { this.b = this.a.C("DIV", "server-info"); Yf(this); }; function Yf(a, b, c, d) { var e = []; b && e.push(b); c && e.push("v" + c); d && e.push("r" + d); Id(a.g(), e.length ? e.join("\u00a0\u00a0|\u00a0\u00a0") : "Server info unavailable"); } ;function Zf(a, b) { R.call(this); a && $f(this, a, b); } y(Zf, R); f = Zf.prototype; f.Ta = null; f.Ib = null; f.fc = null; f.Jb = null; f.ga = -1; f.Aa = -1; f.Ob = !1; var ag = {3:13, 12:144, 63232:38, 63233:40, 63234:37, 63235:39, 63236:112, 63237:113, 63238:114, 63239:115, 63240:116, 63241:117, 63242:118, 63243:119, 63244:120, 63245:121, 63246:122, 63247:123, 63248:44, 63272:46, 63273:36, 63275:35, 63276:33, 63277:34, 63289:144, 63302:45}, bg = {Up:38, Down:40, Left:37, Right:39, Enter:13, F1:112, F2:113, F3:114, F4:115, F5:116, F6:117, F7:118, F8:119, F9:120, F10:121, F11:122, F12:123, "U+007F":46, Home:36, End:35, PageUp:33, PageDown:34, Insert:45}, cg = E || Xb || H && I("525"), dg = Zb && G; f = Zf.prototype; f.vd = function(a) { if (H || Xb) { if (17 == this.ga && !a.ctrlKey || 18 == this.ga && !a.altKey || Zb && 91 == this.ga && !a.metaKey) { this.Aa = this.ga = -1; } } -1 == this.ga && (a.ctrlKey && 17 != a.a ? this.ga = 17 : a.altKey && 18 != a.a ? this.ga = 18 : a.metaKey && 91 != a.a && (this.ga = 91)); cg && !Te(a.a, this.ga, a.shiftKey, a.ctrlKey, a.altKey) ? this.handleEvent(a) : (this.Aa = Ve(a.a), dg && (this.Ob = a.altKey)); }; f.wd = function(a) { this.Aa = this.ga = -1; this.Ob = a.altKey; }; f.handleEvent = function(a) { var b = a.c, c, d, e = b.altKey; E && "keypress" == a.type ? c = this.Aa : (H || Xb) && "keypress" == a.type ? c = this.Aa : Wb && !H ? c = this.Aa : (c = b.keyCode || this.Aa, d = b.charCode || 0, dg && (e = this.Ob), Zb && 63 == d && 224 == c && (c = 191)); d = c = Ve(c); var g = b.keyIdentifier; c ? 63232 <= c && c in ag ? d = ag[c] : 25 == c && a.shiftKey && (d = 9) : g && g in bg && (d = bg[g]); a = d == this.ga; this.ga = d; b = new eg(d, 0, a, b); b.altKey = e; this.D(b); }; f.g = function() { return this.Ta; }; function $f(a, b, c) { a.Jb && fg(a); a.Ta = b; a.Ib = L(a.Ta, "keypress", a, c); a.fc = L(a.Ta, "keydown", a.vd, c, a); a.Jb = L(a.Ta, "keyup", a.wd, c, a); } function fg(a) { a.Ib && (hd(a.Ib), hd(a.fc), hd(a.Jb), a.Ib = null, a.fc = null, a.Jb = null); a.Ta = null; a.ga = -1; a.Aa = -1; } f.v = function() { Zf.m.v.call(this); fg(this); }; function eg(a, b, c, d) { K.call(this, d); this.type = "key"; this.a = a; this.repeat = c; } y(eg, K); function gg() { } var hg; ha(gg); var ig = {button:"pressed", checkbox:"checked", menuitem:"selected", menuitemcheckbox:"checked", menuitemradio:"checked", radio:"checked", tab:"selected", treeitem:"selected"}; f = gg.prototype; f.wb = function() { }; f.Va = function(a) { return a.a.C("DIV", jg(this, a).join(" "), a.Ja); }; function kg(a, b, c) { if (a = a.g ? a.g() : a) { var d = [b]; E && !I("7") && (d = lg(Ne(a), b), d.push(b)); (c ? Qe : Se)(a, d); } } f.Bc = function(a) { Ge(a) && this.Ec(a.g(), !0); a.isEnabled() && this.xb(a, !0); }; f.Dc = function(a, b) { oe(a, !b, !E && !Wb); }; f.Ec = function(a, b) { kg(a, this.Y() + "-rtl", b); }; f.Cc = function(a) { var b; return a.W & 32 && (b = a.g()) ? Md(b) && Nd(b) : !1; }; f.xb = function(a, b) { var c; if (a.W & 32 && (c = a.g())) { if (!b && a.A & 32) { try { c.blur(); } catch (d) { } a.A & 32 && a.Fc(); } (Md(c) && Nd(c)) != b && Ld(c, b); } }; f.Zb = function(a, b, c) { var d = a.g(); if (d) { var e = mg(this, b); e && kg(a, e, c); this.ua(d, b, c); } }; f.ua = function(a, b, c) { hg || (hg = {1:"disabled", 8:"selected", 16:"checked", 64:"expanded"}); b = hg[b]; var d = a.getAttribute("role") || null; d && (d = ig[d] || b, b = "checked" == b || "selected" == b ? d : b); b && Me(a, b, c); }; function ng(a, b) { if (a && (Fd(a), b)) { if (r(b)) { Id(a, b); } else { var c = function(b) { if (b) { var c = O(a); a.appendChild(r(b) ? c.createTextNode(b) : b); } }; p(b) ? C(b, c) : !ja(b) || "nodeType" in b ? c(b) : C(bb(b), c); } } } f.Y = function() { return "goog-control"; }; function jg(a, b) { var c = a.Y(), d = [c], e = a.Y(); e != c && d.push(e); c = b.A; for (e = [];c;) { var g = c & -c; e.push(mg(a, g)); c &= ~g; } d.push.apply(d, e); (c = b.wc) && d.push.apply(d, c); E && !I("7") && d.push.apply(d, lg(d)); return d; } function lg(a, b) { var c = []; b && (a = ab(a, [b])); C([], function(d) { !Ya(d, qa(Za, a)) || b && !Za(d, b) || c.push(d.join("_")); }); return c; } function mg(a, b) { if (!a.a) { var c = a.Y(); c.replace(/\xa0|\s/g, " "); a.a = {1:c + "-disabled", 2:c + "-hover", 4:c + "-active", 8:c + "-selected", 16:c + "-checked", 32:c + "-focused", 64:c + "-open"}; } return a.a[b]; } ;function og(a, b) { if (!a) { throw Error("Invalid class name " + a); } if (!u(b)) { throw Error("Invalid decorator function " + b); } } var pg = {}; function X(a, b, c) { S.call(this, c); if (!b) { b = this.constructor; for (var d;b;) { d = w(b); if (d = pg[d]) { break; } b = b.m ? b.m.constructor : null; } b = d ? u(d.Ha) ? d.Ha() : new d : null; } this.c = b; this.Ja = n(a) ? a : null; } y(X, S); f = X.prototype; f.Ja = null; f.A = 0; f.W = 39; f.Pb = 255; f.La = 0; f.wc = null; f.cc = !0; function qg(a, b) { a.J && b != a.cc && rg(a, b); a.cc = b; } f.I = function() { var a = this.c.Va(this); this.b = a; var b = this.c.wb(); if (b) { var c = a.getAttribute("role") || null; b != c && Le(a, b); } this.c.Dc(a, !1); }; f.Ia = function() { return this.g(); }; f.V = function() { X.m.V.call(this); var a = this.c, b = this.b; this.isEnabled() || a.ua(b, 1, !this.isEnabled()); this.W & 8 && a.ua(b, 8, !!(this.A & 8)); this.W & 16 && a.ua(b, 16, !!(this.A & 16)); this.W & 64 && a.ua(b, 64, !!(this.A & 64)); this.c.Bc(this); this.W & -2 && (this.cc && rg(this, !0), this.W & 32 && (a = this.g())) && (b = this.h || (this.h = new Zf), $f(b, a), T(this).w(b, "key", this.gb).w(a, "focus", this.kd).w(a, "blur", this.Fc)); }; function rg(a, b) { var c = T(a), d = a.g(); b ? (c.w(d, "mouseover", a.ac).w(d, "mousedown", a.yb).w(d, "mouseup", a.Db).w(d, "mouseout", a.dc), a.jb != ga && c.w(d, "contextmenu", a.jb), E && (c.w(d, "dblclick", a.Ic), a.B || (a.B = new sg(a), xa(a, qa(B, a.B))))) : (c.na(d, "mouseover", a.ac).na(d, "mousedown", a.yb).na(d, "mouseup", a.Db).na(d, "mouseout", a.dc), a.jb != ga && c.na(d, "contextmenu", a.jb), E && (c.na(d, "dblclick", a.Ic), B(a.B), a.B = null)); } f.ea = function() { X.m.ea.call(this); this.h && fg(this.h); this.isEnabled() && this.c.xb(this, !1); }; f.v = function() { X.m.v.call(this); this.h && (this.h.O(), delete this.h); delete this.c; this.B = this.wc = this.Ja = null; }; function tg(a) { a = a.Ja; if (!a) { return ""; } if (!r(a)) { if (p(a)) { a = Wa(a, Od).join(""); } else { if (qd && null !== a && "innerText" in a) { a = a.innerText.replace(/(\r\n|\r|\n)/g, "\n"); } else { var b = []; Pd(a, b, !0); a = b.join(""); } a = a.replace(/ \xAD /g, " ").replace(/\xAD/g, ""); a = a.replace(/\u200B/g, ""); qd || (a = a.replace(/ +/g, " ")); " " != a && (a = a.replace(/^\s*/, "")); } } return a.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, ""); } f.isEnabled = function() { return !(this.A & 1); }; f.ka = function(a) { var b = this.l; b && "function" == typeof b.isEnabled && !b.isEnabled() || !ug(this, 1, !a) || (a || (vg(this, !1), wg(this, !1)), this.c.xb(this, a), xg(this, 1, !a, !0)); }; function wg(a, b) { ug(a, 2, b) && xg(a, 2, b); } function vg(a, b) { ug(a, 4, b) && xg(a, 4, b); } function yg(a, b) { ug(a, 8, b) && xg(a, 8, b); } function zg(a, b) { ug(a, 64, b) && xg(a, 64, b); } function xg(a, b, c, d) { d || 1 != b ? a.W & b && c != !!(a.A & b) && (a.c.Zb(a, b, c), a.A = c ? a.A | b : a.A & ~b) : a.ka(!c); } function Ag(a, b, c) { if (a.J && a.A & b && !c) { throw Error("Component already rendered"); } !c && a.A & b && xg(a, b, !1); a.W = c ? a.W | b : a.W & ~b; } function Y(a, b) { return !!(a.Pb & b) && !!(a.W & b); } function ug(a, b, c) { return !!(a.W & b) && !!(a.A & b) != c && (!(a.La & b) || a.D(Ae(b, c))) && !a.Da; } f.ac = function(a) { (!a.j || !Hd(this.g(), a.j)) && this.D("enter") && this.isEnabled() && Y(this, 2) && wg(this, !0); }; f.dc = function(a) { a.j && Hd(this.g(), a.j) || !this.D("leave") || (Y(this, 4) && vg(this, !1), Y(this, 2) && wg(this, !1)); }; f.jb = ga; f.yb = function(a) { this.isEnabled() && (Y(this, 2) && wg(this, !0), Nc(a) && (Y(this, 4) && vg(this, !0), this.c && this.c.Cc(this) && this.g().focus())); Nc(a) && a.b(); }; f.Db = function(a) { this.isEnabled() && (Y(this, 2) && wg(this, !0), this.A & 4 && this.kb(a) && Y(this, 4) && vg(this, !1)); }; f.Ic = function(a) { this.isEnabled() && this.kb(a); }; f.kb = function(a) { if (Y(this, 16)) { var b = !(this.A & 16); ug(this, 16, b) && xg(this, 16, b); } Y(this, 8) && yg(this, !0); Y(this, 64) && zg(this, !(this.A & 64)); b = new J("action", this); a && (b.altKey = a.altKey, b.ctrlKey = a.ctrlKey, b.metaKey = a.metaKey, b.shiftKey = a.shiftKey, b.L = a.L); return this.D(b); }; f.kd = function() { Y(this, 32) && ug(this, 32, !0) && xg(this, 32, !0); }; f.Fc = function() { Y(this, 4) && vg(this, !1); Y(this, 32) && ug(this, 32, !1) && xg(this, 32, !1); }; f.gb = function(a) { return this.isEnabled() && this.$b(a) ? (a.b(), a.o(), !0) : !1; }; f.$b = function(a) { return 13 == a.a && this.kb(a); }; if (!u(X)) { throw Error("Invalid component class " + X); } if (!u(gg)) { throw Error("Invalid renderer class " + gg); } var Bg = w(X); pg[Bg] = gg; og("goog-control", function() { return new X(null); }); function sg(a) { A.call(this); this.b = a; this.a = !1; this.c = new te(this); xa(this, qa(B, this.c)); a = this.b.b; this.c.w(a, "mousedown", this.l).w(a, "mouseup", this.h).w(a, "click", this.j); } y(sg, A); var Cg = !E || dc(9); sg.prototype.l = function() { this.a = !1; }; sg.prototype.h = function() { this.a = !0; }; function Dg(a, b) { if (!Cg) { return a.button = 0, a.type = b, a; } var c = document.createEvent("MouseEvents"); c.initMouseEvent(b, a.bubbles, a.cancelable, a.view || null, a.detail, a.screenX, a.screenY, a.clientX, a.clientY, a.ctrlKey, a.altKey, a.shiftKey, a.metaKey, 0, a.relatedTarget || null); return c; } sg.prototype.j = function(a) { if (this.a) { this.a = !1; } else { var b = a.c, c = b.button, d = b.type, e = Dg(b, "mousedown"); this.b.yb(new K(e, a.l)); e = Dg(b, "mouseup"); this.b.Db(new K(e, a.l)); Cg || (b.button = c, b.type = d); } }; sg.prototype.v = function() { this.b = null; sg.m.v.call(this); }; function Eg() { } y(Eg, gg); ha(Eg); f = Eg.prototype; f.Y = function() { return "goog-tab"; }; f.wb = function() { return "tab"; }; f.Va = function(a) { var b = Eg.m.Va.call(this, a); (a = a.Sa()) && this.sa(b, a); return b; }; f.Sa = function(a) { return a.title || ""; }; f.sa = function(a, b) { a && (a.title = b || ""); }; function Fg(a, b, c) { X.call(this, a, b || Eg.Ha(), c); Ag(this, 8, !0); this.La |= 9; } y(Fg, X); Fg.prototype.Sa = function() { return this.o; }; Fg.prototype.sa = function(a) { this.c.sa(this.g(), a); this.Yc(a); }; Fg.prototype.Yc = function(a) { this.o = a; }; og("goog-tab", function() { return new Fg(null); }); function Gg(a) { this.b = a; } ha(Gg); function Hg(a, b) { a && (a.tabIndex = b ? 0 : -1); } function Ig(a, b) { var c = b.g(); oe(c, !0, G); E && (c.hideFocus = !0); var d = a.b; d && Le(c, d); } Gg.prototype.Y = function() { return "goog-container"; }; Gg.prototype.a = function(a) { var b = this.Y(), c = [b, a.Ba == Jg ? b + "-horizontal" : b + "-vertical"]; a.isEnabled() || c.push(b + "-disabled"); return c; }; function Kg(a, b, c) { S.call(this, c); this.vb = b || Gg.Ha(); this.Ba = a || Lg; } y(Kg, S); var Jg = "horizontal", Lg = "vertical"; f = Kg.prototype; f.gc = null; f.eb = null; f.vb = null; f.Ba = null; f.fb = !0; f.Ua = !0; f.H = -1; f.R = null; f.Xa = !1; f.qa = null; function Mg(a) { return a.gc || a.g(); } f.I = function() { this.b = this.a.C("DIV", this.vb.a(this).join(" ")); }; f.Ia = function() { return this.g(); }; f.V = function() { Kg.m.V.call(this); Ee(this, function(a) { a.J && Ng(this, a); }, this); var a = this.g(); Ig(this.vb, this); Og(this, this.fb); T(this).w(this, "enter", this.rd).w(this, "highlight", this.ud).w(this, "unhighlight", this.Dd).w(this, "open", this.yd).w(this, "close", this.pd).w(a, "mousedown", this.jd).w(O(a), "mouseup", this.qd).w(a, ["mousedown", "mouseup", "mouseover", "mouseout", "contextmenu"], this.od); Pg(this); }; function Pg(a) { var b = T(a), c = Mg(a); b.w(c, "focus", a.Ac).w(c, "blur", a.gd).w(a.eb || (a.eb = new Zf(Mg(a))), "key", a.hd); } f.ea = function() { Qg(this, -1); this.R && zg(this.R, !1); this.Xa = !1; Kg.m.ea.call(this); }; f.v = function() { Kg.m.v.call(this); this.eb && (this.eb.O(), this.eb = null); this.vb = this.R = this.qa = this.gc = null; }; f.rd = function() { return !0; }; f.ud = function(a) { var b = He(this, a.target); if (-1 < b && b != this.H) { var c = U(this, this.H); c && wg(c, !1); this.H = b; c = U(this, this.H); this.Xa && vg(c, !0); this.R && c != this.R && (c.W & 64 ? zg(c, !0) : zg(this.R, !1)); } b = this.g(); null != a.target.g() && Me(b, "activedescendant", a.target.g().id); }; f.Dd = function(a) { a.target == U(this, this.H) && (this.H = -1); this.g().removeAttribute("aria-activedescendant"); }; f.yd = function(a) { (a = a.target) && a != this.R && a.l == this && (this.R && zg(this.R, !1), this.R = a); }; f.pd = function(a) { a.target == this.R && (this.R = null); var b = this.g(), c = a.target.g(); b && a.target.A & 2 && c && (a = "", c && (a = c.id), Me(b, "activedescendant", a)); }; f.jd = function(a) { this.Ua && (this.Xa = !0); var b = Mg(this); b && Md(b) && Nd(b) ? b.focus() : a.b(); }; f.qd = function() { this.Xa = !1; }; f.od = function(a) { var b; a: { b = a.target; if (this.qa) { for (var c = this.g();b && b !== c;) { var d = b.id; if (d in this.qa) { b = this.qa[d]; break a; } b = b.parentNode; } } b = null; } if (b) { switch(a.type) { case "mousedown": b.yb(a); break; case "mouseup": b.Db(a); break; case "mouseover": b.ac(a); break; case "mouseout": b.dc(a); break; case "contextmenu": b.jb(a); } } }; f.Ac = function() { }; f.gd = function() { Qg(this, -1); this.Xa = !1; this.R && zg(this.R, !1); }; f.hd = function(a) { return this.isEnabled() && this.fb && (0 != Fe(this) || this.gc) && Rg(this, a) ? (a.b(), a.o(), !0) : !1; }; function Rg(a, b) { var c = U(a, a.H); if (c && "function" == typeof c.gb && c.gb(b) || a.R && a.R != c && "function" == typeof a.R.gb && a.R.gb(b)) { return !0; } if (b.shiftKey || b.ctrlKey || b.metaKey || b.altKey) { return !1; } switch(b.a) { case 27: Mg(a).blur(); break; case 36: Sg(a); break; case 35: Tg(a); break; case 38: if (a.Ba == Lg) { Ug(a); } else { return !1; } break; case 37: if (a.Ba == Jg) { Ge(a) ? Vg(a) : Ug(a); } else { return !1; } break; case 40: if (a.Ba == Lg) { Vg(a); } else { return !1; } break; case 39: if (a.Ba == Jg) { Ge(a) ? Ug(a) : Vg(a); } else { return !1; } break; default: return !1; } return !0; } function Ng(a, b) { var c = b.g(), c = c.id || (c.id = b.P()); a.qa || (a.qa = {}); a.qa[c] = b; } f.la = function(a, b) { Kg.m.la.call(this, a, b); }; f.qb = function(a, b, c) { a.La |= 2; a.La |= 64; Ag(a, 32, !1); qg(a, !1); var d = a.l == this ? He(this, a) : -1; Kg.m.qb.call(this, a, b, c); a.J && this.J && Ng(this, a); a = d; -1 == a && (a = Fe(this)); a == this.H ? this.H = Math.min(Fe(this) - 1, b) : a > this.H && b <= this.H ? this.H++ : a < this.H && b > this.H && this.H--; }; f.removeChild = function(a, b) { if (a = r(a) ? Ce(this, a) : a) { var c = He(this, a); -1 != c && (c == this.H ? (wg(a, !1), this.H = -1) : c < this.H && this.H--); var d = a.g(); d && d.id && this.qa && (c = this.qa, d = d.id, d in c && delete c[d]); } a = Kg.m.removeChild.call(this, a, b); qg(a, !0); return a; }; function Og(a, b) { a.fb = b; var c = a.g(); c && (Q(c, b), Hg(Mg(a), a.Ua && a.fb)); } f.isEnabled = function() { return this.Ua; }; f.ka = function(a) { this.Ua != a && this.D(a ? "enable" : "disable") && (a ? (this.Ua = !0, Ee(this, function(a) { a.bd ? delete a.bd : a.ka(!0); })) : (Ee(this, function(a) { a.isEnabled() ? a.ka(!1) : a.bd = !0; }), this.Xa = this.Ua = !1), Hg(Mg(this), a && this.fb)); }; function Qg(a, b) { var c = U(a, b); c ? wg(c, !0) : -1 < a.H && wg(U(a, a.H), !1); } function Sg(a) { Wg(a, function(a, c) { return (a + 1) % c; }, Fe(a) - 1); } function Tg(a) { Wg(a, function(a, c) { a--; return 0 > a ? c - 1 : a; }, 0); } function Vg(a) { Wg(a, function(a, c) { return (a + 1) % c; }, a.H); } function Ug(a) { Wg(a, function(a, c) { a--; return 0 > a ? c - 1 : a; }, a.H); } function Wg(a, b, c) { c = 0 > c ? He(a, a.R) : c; var d = Fe(a); c = b.call(a, c, d); for (var e = 0;e <= d;) { var g = U(a, c); if (g && g.isEnabled() && g.W & 2) { a.mc(c); break; } e++; c = b.call(a, c, d); } } f.mc = function(a) { Qg(this, a); }; function Xg() { this.b = "tablist"; } y(Xg, Gg); ha(Xg); Xg.prototype.Y = function() { return "goog-tab-bar"; }; Xg.prototype.a = function(a) { var b = Xg.m.a.call(this, a); if (!this.c) { var c = this.Y(); this.c = jb(Yg, c + "-top", Zg, c + "-bottom", $g, c + "-start", ah, c + "-end"); } b.push(this.c[a.c]); return b; }; function bh(a, b, c) { a = a || Yg; if (this.g()) { throw Error("Component already rendered"); } this.Ba = a == $g || a == ah ? Lg : Jg; this.c = a; Kg.call(this, this.Ba, b || Xg.Ha(), c); ch(this); } y(bh, Kg); var Yg = "top", Zg = "bottom", $g = "start", ah = "end"; f = bh.prototype; f.aa = null; f.V = function() { bh.m.V.call(this); ch(this); }; f.v = function() { bh.m.v.call(this); this.aa = null; }; f.removeChild = function(a, b) { dh(this, a); return bh.m.removeChild.call(this, a, b); }; f.mc = function(a) { bh.m.mc.call(this, a); eh(this, U(this, a)); }; function eh(a, b) { b ? yg(b, !0) : a.aa && yg(a.aa, !1); } function dh(a, b) { if (b && b == a.aa) { for (var c = He(a, b), d = c - 1;b = U(a, d);d--) { if (b.isEnabled()) { eh(a, b); return; } } for (c += 1;b = U(a, c);c++) { if (b.isEnabled()) { eh(a, b); return; } } eh(a, null); } } f.Bd = function(a) { this.aa && this.aa != a.target && yg(this.aa, !1); this.aa = a.target; }; f.Cd = function(a) { a.target == this.aa && (this.aa = null); }; f.zd = function(a) { dh(this, a.target); }; f.Ad = function(a) { dh(this, a.target); }; f.Ac = function() { U(this, this.H) || Qg(this, He(this, this.aa || U(this, 0))); }; function ch(a) { T(a).w(a, "select", a.Bd).w(a, "unselect", a.Cd).w(a, "disable", a.zd).w(a, "hide", a.Ad); } og("goog-tab-bar", function() { return new bh; }); function fh() { S.call(this); } y(fh, S); fh.prototype.h = null; fh.prototype.v = function() { delete this.h; fh.m.v.call(this); }; fh.prototype.I = function() { this.b = this.a.C("DIV", "control-block"); this.h && (C(this.h, this.c, this), this.h = null); }; fh.prototype.c = function(a) { var b = this.g(); b ? (b.childNodes.length && b.appendChild(this.a.a.createTextNode("\u00a0\u00a0|\u00a0\u00a0")), b.appendChild(a)) : (this.h || (this.h = []), this.h.push(a)); }; function gh(a) { V.call(this, void 0, !0); Gf(this, a); L(this, Pf, this.Oa, !1, this); } y(gh, V); gh.prototype.I = function() { gh.m.I.call(this); var a = this.Ia(), b = this.tc(); a.appendChild(b); }; gh.prototype.Z = function(a) { gh.m.Z.call(this, a); a && this.D("show"); }; gh.prototype.Oa = function(a) { "ok" == a.key && this.Lc() && this.D("action"); }; function hh(a) { gh.call(this, "Create a New Session"); this.h = Wa(a, function(a) { return r(a) ? {browserName:a} : a; }); L(this, "show", this.Vd, !1, this); } y(hh, gh); f = hh.prototype; f.Ga = null; f.v = function() { delete this.h; delete this.Ga; hh.m.v.call(this); }; f.tc = function() { function a(a) { var d = a.browserName; (a = a.version) && (d += " " + a); return b.C("OPTION", null, d); } var b = this.a; this.Ga = b.C("SELECT", null, a("")); C(this.h, function(b) { b = a(b); this.Ga.appendChild(b); }, this); return b.C("LABEL", null, "Browser:\u00a0", this.Ga); }; f.Yb = function() { return this.h[this.Ga.selectedIndex - 1]; }; f.Lc = function() { return !!this.Ga.selectedIndex; }; f.Vd = function() { this.Ga.selectedIndex = 0; }; function ih(a) { S.call(this); this.U = a; } y(ih, S); ih.prototype.v = function() { delete this.U; ih.m.v.call(this); }; ih.prototype.I = function() { var a = this.a; this.b = a.C("FIELDSET", null, a.C("LEGEND", null, this.U), this.uc()); }; ih.prototype.uc = function() { return null; }; function jh() { } y(jh, gg); ha(jh); f = jh.prototype; f.wb = function() { return "button"; }; f.ua = function(a, b, c) { switch(b) { case 8: ; case 16: Me(a, "pressed", c); break; default: ; case 64: ; case 1: jh.m.ua.call(this, a, b, c); } }; f.Va = function(a) { var b = jh.m.Va.call(this, a); this.sa(b, a.Sa()); var c = a.ia; c && this.zc(b, c); a.W & 16 && this.ua(b, 16, !!(a.A & 16)); return b; }; f.zc = ga; f.Sa = function(a) { return a.title; }; f.sa = function(a, b) { a && (b ? a.title = b : a.removeAttribute("title")); }; f.Y = function() { return "goog-button"; }; function kh() { } y(kh, jh); ha(kh); f = kh.prototype; f.wb = function() { }; f.Va = function(a) { qg(a, !1); a.Pb &= -256; Ag(a, 32, !1); return a.a.C("BUTTON", {"class":jg(this, a).join(" "), disabled:!a.isEnabled(), title:a.Sa() || "", value:a.ia || ""}, tg(a) || ""); }; f.Bc = function(a) { T(a).w(a.g(), "click", a.kb); }; f.Dc = ga; f.Ec = ga; f.Cc = function(a) { return a.isEnabled(); }; f.xb = ga; f.Zb = function(a, b, c) { kh.m.Zb.call(this, a, b, c); (a = a.g()) && 1 == b && (a.disabled = c); }; f.zc = function(a, b) { a && (a.value = b); }; f.ua = ga; function lh(a, b, c) { X.call(this, a, b || kh.Ha(), c); } y(lh, X); f = lh.prototype; f.Sa = function() { return this.F; }; f.sa = function(a) { this.F = a; this.c.sa(this.g(), a); }; f.Yc = function(a) { this.F = a; }; f.v = function() { lh.m.v.call(this); delete this.ia; delete this.F; }; f.V = function() { lh.m.V.call(this); if (this.W & 32) { var a = this.g(); a && T(this).w(a, "keyup", this.$b); } }; f.$b = function(a) { return 13 == a.a && "key" == a.type || 32 == a.a && "keyup" == a.type ? this.kb(a) : 32 == a.a; }; og("goog-button", function() { return new lh(null); }); function mh(a) { a = String(a); if (/^\s*$/.test(a) ? 0 : /^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g, "@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g, "]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g, ""))) { try { return eval("(" + a + ")"); } catch (b) { } } throw Error("Invalid JSON string: " + a); } function nh() { } function oh(a, b) { var c = []; ph(a, b, c); return c.join(""); } function ph(a, b, c) { if (null == b) { c.push("null"); } else { if ("object" == typeof b) { if (p(b)) { var d = b; b = d.length; c.push("["); for (var e = "", g = 0;g < b;g++) { c.push(e), ph(a, d[g], c), e = ","; } c.push("]"); return; } if (b instanceof String || b instanceof Number || b instanceof Boolean) { b = b.valueOf(); } else { c.push("{"); e = ""; for (d in b) { Object.prototype.hasOwnProperty.call(b, d) && (g = b[d], "function" != typeof g && (c.push(e), qh(d, c), c.push(":"), ph(a, g, c), e = ",")); } c.push("}"); return; } } switch(typeof b) { case "string": qh(b, c); break; case "number": c.push(isFinite(b) && !isNaN(b) ? String(b) : "null"); break; case "boolean": c.push(String(b)); break; case "function": c.push("null"); break; default: throw Error("Unknown type: " + typeof b);; } } } var rh = {'"':'\\"', "\\":"\\\\", "/":"\\/", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\u000b"}, sh = /\uffff/.test("\uffff") ? /[\\\"\x00-\x1f\x7f-\uffff]/g : /[\\\"\x00-\x1f\x7f-\xff]/g; function qh(a, b) { b.push('"', a.replace(sh, function(a) { var b = rh[a]; b || (b = "\\u" + (a.charCodeAt(0) | 65536).toString(16).substr(1), rh[a] = b); return b; }), '"'); } ;function th(a, b) { var c = Array.prototype.slice.call(arguments), d = c.shift(); if ("undefined" == typeof d) { throw Error("[goog.string.format] Template required"); } return d.replace(/%([0\-\ \+]*)(\d+)?(\.(\d+))?([%sfdiu])/g, function(a, b, d, k, l, q, t, v) { if ("%" == q) { return "%"; } var F = c.shift(); if ("undefined" == typeof F) { throw Error("[goog.string.format] Not enough arguments"); } arguments[0] = F; return uh[q].apply(null, arguments); }); } var uh = {s:function(a, b, c) { return isNaN(c) || "" == c || a.length >= Number(c) ? a : a = -1 < b.indexOf("-", 0) ? a + Ma(" ", Number(c) - a.length) : Ma(" ", Number(c) - a.length) + a; }, f:function(a, b, c, d, e) { d = a.toString(); isNaN(e) || "" == e || (d = parseFloat(a).toFixed(e)); var g; g = 0 > Number(a) ? "-" : 0 <= b.indexOf("+") ? "+" : 0 <= b.indexOf(" ") ? " " : ""; 0 <= Number(a) && (d = g + d); if (isNaN(c) || d.length >= Number(c)) { return d; } d = isNaN(e) ? Math.abs(a).toString() : Math.abs(a).toFixed(e); a = Number(c) - d.length - g.length; return d = 0 <= b.indexOf("-", 0) ? g + d + Ma(" ", a) : g + Ma(0 <= b.indexOf("0", 0) ? "0" : " ", a) + d; }, d:function(a, b, c, d, e, g, h, k) { return uh.f(parseInt(a, 10), b, c, d, 0, g, h, k); }}; uh.i = uh.d; uh.u = uh.d; function vh() { this.a = new nh; } function wh(a) { var b = new vh; if (null == a) { return []; } if (r(a)) { if (/^[\s\xa0]*$/.test(a)) { return []; } a = mh(a); } var c = []; xh(b, a, c, 0); return c; } function xh(a, b, c, d) { var e = ia(b); switch(e) { case "null": ; case "boolean": ; case "number": ; case "string": a = oh(a.a, b); c.push(yh(a, e)); break; case "array": c.push("["); for (e = e = 0;e < b.length;e++) { 0 < e && c.push(","), c.push("\n"), c.push(Ma(" ", d + 2)), xh(a, b[e], c, d + 2); } 0 < e && (c.push("\n"), c.push(Ma(" ", d))); c.push("]"); break; case "object": c.push("{"); var e = 0, g; for (g in b) { b.hasOwnProperty(g) && (0 < e && c.push(","), c.push("\n"), c.push(Ma(" ", d + 2)), c.push(zh(oh(a.a, g))), c.push(":", " "), xh(a, b[g], c, d + 2), e++); } 0 < e && (c.push("\n"), c.push(Ma(" ", d))); c.push("}"); break; default: a = oh(a.a, ""), c.push(yh(a, "unknown")); } } function zh(a) { return "" + a + ""; } function yh(a, b) { return th("", b) + a + ""; } ;function Ah(a, b, c, d, e, g, h, k) { var l, q; if (l = c.offsetParent) { var t = "HTML" == l.tagName || "BODY" == l.tagName; t && "static" == $d(l, "position") || (q = ge(l), t || (t = (t = me(l)) && G ? -l.scrollLeft : !t || Yb && I("8") || "visible" == $d(l, "overflowX") ? l.scrollLeft : l.scrollWidth - l.clientWidth - l.scrollLeft, q = rd(q, new M(t, l.scrollTop)))); } l = q || new M; q = ke(a); if (t = fe(a)) { var v = new Ud(t.left, t.top, t.right - t.left, t.bottom - t.top), t = Math.max(q.left, v.left), F = Math.min(q.left + q.width, v.left + v.width); if (t <= F) { var za = Math.max(q.top, v.top), v = Math.min(q.top + q.height, v.top + v.height); za <= v && (q.left = t, q.top = za, q.width = F - t, q.height = v - za); } } t = N(a); za = N(c); if (t.a != za.a) { F = t.a.body; var za = zd(za.a), v = new M(0, 0), Aa = yd(O(F)); if (Lc(Aa, "parent")) { var ze = F; do { var eb; Aa == za ? eb = ge(ze) : (eb = de(ze), eb = new M(eb.left, eb.top)); v.x += eb.x; v.y += eb.y; } while (Aa && Aa != za && Aa != Aa.parent && (ze = Aa.frameElement) && (Aa = Aa.parent)); } F = rd(v, ge(F)); !E || dc(9) || Qd(t) || (F = rd(F, Rd(t))); q.left += F.x; q.top += F.y; } a = Bh(a, b); b = q.left; a & 4 ? b += q.width : a & 2 && (b += q.width / 2); b = new M(b, q.top + (a & 1 ? q.height : 0)); b = rd(b, l); e && (b.x += (a & 4 ? -1 : 1) * e.x, b.y += (a & 1 ? -1 : 1) * e.y); var la; h && (la = fe(c)) && (la.top -= l.y, la.right -= l.x, la.bottom -= l.y, la.left -= l.x); return Ch(b, c, d, g, la, h, k); } function Ch(a, b, c, d, e, g, h) { a = a.clone(); var k = Bh(b, c); c = ie(b); h = h ? h.clone() : c.clone(); a = a.clone(); h = h.clone(); var l = 0; if (d || 0 != k) { k & 4 ? a.x -= h.width + (d ? d.right : 0) : k & 2 ? a.x -= h.width / 2 : d && (a.x += d.left), k & 1 ? a.y -= h.height + (d ? d.bottom : 0) : d && (a.y += d.top); } if (g) { if (e) { d = a; k = h; l = 0; 65 == (g & 65) && (d.x < e.left || d.x >= e.right) && (g &= -2); 132 == (g & 132) && (d.y < e.top || d.y >= e.bottom) && (g &= -5); d.x < e.left && g & 1 && (d.x = e.left, l |= 1); if (g & 16) { var q = d.x; d.x < e.left && (d.x = e.left, l |= 4); d.x + k.width > e.right && (k.width = Math.min(e.right - d.x, q + k.width - e.left), k.width = Math.max(k.width, 0), l |= 4); } d.x + k.width > e.right && g & 1 && (d.x = Math.max(e.right - k.width, e.left), l |= 1); g & 2 && (l = l | (d.x < e.left ? 16 : 0) | (d.x + k.width > e.right ? 32 : 0)); d.y < e.top && g & 4 && (d.y = e.top, l |= 2); g & 32 && (q = d.y, d.y < e.top && (d.y = e.top, l |= 8), d.y + k.height > e.bottom && (k.height = Math.min(e.bottom - d.y, q + k.height - e.top), k.height = Math.max(k.height, 0), l |= 8)); d.y + k.height > e.bottom && g & 4 && (d.y = Math.max(e.bottom - k.height, e.top), l |= 2); g & 8 && (l = l | (d.y < e.top ? 64 : 0) | (d.y + k.height > e.bottom ? 128 : 0)); e = l; } else { e = 256; } l = e; } g = new Ud(0, 0, 0, 0); g.left = a.x; g.top = a.y; g.width = h.width; g.height = h.height; e = l; if (e & 496) { return e; } ae(b, new M(g.left, g.top)); h = new sd(g.width, g.height); c == h || c && h && c.width == h.width && c.height == h.height || (c = h, a = Qd(N(O(b))), !E || I("10") || a && I("8") ? (b = b.style, G ? b.MozBoxSizing = "border-box" : H ? b.WebkitBoxSizing = "border-box" : b.boxSizing = "border-box", b.width = Math.max(c.width, 0) + "px", b.height = Math.max(c.height, 0) + "px") : (h = b.style, a ? (E ? (a = qe(b, "paddingLeft"), g = qe(b, "paddingRight"), d = qe(b, "paddingTop"), k = qe(b, "paddingBottom"), a = new P(d, g, k, a)) : (a = Zd(b, "paddingLeft"), g = Zd(b, "paddingRight"), d = Zd(b, "paddingTop"), k = Zd(b, "paddingBottom"), a = new P(parseFloat(d), parseFloat(g), parseFloat(k), parseFloat(a))), E && !dc(9) ? (g = se(b, "borderLeft"), d = se(b, "borderRight"), k = se(b, "borderTop"), b = se(b, "borderBottom"), b = new P(k, d, b, g)) : (g = Zd(b, "borderLeftWidth"), d = Zd(b, "borderRightWidth"), k = Zd(b, "borderTopWidth"), b = Zd(b, "borderBottomWidth"), b = new P(parseFloat(k), parseFloat(d), parseFloat(b), parseFloat(g))), h.pixelWidth = c.width - b.left - a.left - a.right - b.right, h.pixelHeight = c.height - b.top - a.top - a.bottom - b.bottom) : (h.pixelWidth = c.width, h.pixelHeight = c.height))); return e; } function Bh(a, b) { return (b & 8 && me(a) ? b ^ 4 : b) & -9; } ;function Dh() { } Dh.prototype.a = function() { }; function Eh(a, b, c) { this.b = a; this.c = b; this.j = c; } y(Eh, Dh); Eh.prototype.a = function(a, b, c) { Ah(this.b, this.c, a, b, void 0, c, this.j); }; function Fh(a, b) { this.b = a instanceof M ? a : new M(a, b); } y(Fh, Dh); Fh.prototype.a = function(a, b, c, d) { Ah(ce(a), 0, a, b, this.b, c, null, d); }; function Gh(a, b) { this.ab = b || void 0; wf.call(this, a); } y(Gh, wf); Gh.prototype.ib = function() { if (this.ab) { var a = !this.ba && "move_offscreen" != this.$a, b = this.g(); a && (b.style.visibility = "hidden", Q(b, !0)); this.ab.a(b, 8, this.Oa); a && Q(b, !1); } }; function Hh(a, b, c) { this.b = c || (a ? N(r(a) ? document.getElementById(a) : a) : N()); Gh.call(this, this.b.C("DIV", {style:"position:absolute;display:none;"})); this.l = new M(1, 1); this.M = new Ub; this.h = null; a && Ih(this, a); null != b && Id(this.g(), b); } y(Hh, Gh); var Jh = []; f = Hh.prototype; f.N = null; f.ld = "goog-tooltip"; f.Mc = 0; function Ih(a, b) { b = r(b) ? document.getElementById(b) : b; a.M.add(b); L(b, "mouseover", a.Hc, !1, a); L(b, "mouseout", a.Cb, !1, a); L(b, "mousemove", a.Wa, !1, a); L(b, "focus", a.Gc, !1, a); L(b, "blur", a.Cb, !1, a); } f.Wb = function() { return this.Mc; }; f.lc = function(a) { var b = this.g(); b && Gd(b); Hh.m.lc.call(this, a); a ? (b = this.b.a.body, b.insertBefore(a, b.lastChild), B(this.h), this.h = new uf(this.g()), xa(this, qa(B, this.h)), L(this.h, "focusin", this.Qa, void 0, this), L(this.h, "focusout", this.mb, void 0, this)) : (B(this.h), this.h = null); }; function Kh(a) { return a.j ? a.ba ? 4 : 1 : a.T ? 3 : a.ba ? 2 : 0; } f.Gb = function(a) { if (!this.ba) { return !1; } var b = ge(this.g()), c = ie(this.g()); return b.x <= a.x && a.x <= b.x + c.width && b.y <= a.y && a.y <= b.y + c.height; }; f.ic = function() { if (!wf.prototype.ic.call(this)) { return !1; } if (this.a) { for (var a, b = 0;a = Jh[b];b++) { Hd(a.g(), this.a) || a.za(!1); } } Za(Jh, this) || Jh.push(this); a = this.g(); a.className = this.ld; this.Qa(); L(a, "mouseover", this.ec, !1, this); L(a, "mouseout", this.Kc, !1, this); Lh(this); return !0; }; f.hb = function() { $a(Jh, this); for (var a = this.g(), b, c = 0;b = Jh[c];c++) { b.a && Hd(a, b.a) && b.za(!1); } this.Pa && this.Pa.mb(); gd(a, "mouseover", this.ec, !1, this); gd(a, "mouseout", this.Kc, !1, this); this.a = void 0; 0 == Kh(this) && (this.pa = !1); wf.prototype.hb.call(this); }; f.Qc = function(a, b) { this.a == a && this.M.contains(this.a) && (this.pa || !this.ae ? (this.za(!1), this.ba || (this.a = a, this.ab = b || Mh(this, 0) || void 0, this.ba && this.ib(), this.za(!0))) : this.a = void 0); this.j = void 0; }; f.Pc = function(a) { this.T = void 0; if (a == this.a) { a = this.b; var b; a: { var c = a.a; try { b = c && c.activeElement; break a; } catch (d) { } b = null; } b = b && this.g() && a.contains(this.g(), b); null != this.N && (this.N == this.g() || this.M.contains(this.N)) || b || this.o && this.o.N || this.za(!1); } }; function Nh(a, b) { var c = Rd(a.b); a.l.x = b.clientX + c.x; a.l.y = b.clientY + c.y; } f.Hc = function(a) { var b = Oh(this, a.target); this.N = b; this.Qa(); b != this.a && (this.a = b, this.j || (this.j = sf(x(this.Qc, this, b, void 0), 500)), Ph(this), Nh(this, a)); }; function Oh(a, b) { try { for (;b && !a.M.contains(b);) { b = b.parentNode; } return b; } catch (c) { return null; } } f.Wa = function(a) { Nh(this, a); this.pa = !0; }; f.Gc = function(a) { this.N = a = Oh(this, a.target); this.pa = !0; if (this.a != a) { this.a = a; var b = Mh(this, 1); this.Qa(); this.j || (this.j = sf(x(this.Qc, this, a, b), 500)); Ph(this); } }; function Mh(a, b) { if (0 == b) { var c = a.l.clone(); return new Qh(c); } return new Rh(a.N); } function Ph(a) { if (a.a) { for (var b, c = 0;b = Jh[c];c++) { Hd(b.g(), a.a) && (b.o = a, a.Pa = b); } } } f.Cb = function(a) { var b = Oh(this, a.target), c = Oh(this, a.j); b != c && (b == this.N && (this.N = null), Lh(this), this.pa = !1, !this.ba || a.j && Hd(this.g(), a.j) ? this.a = void 0 : this.mb()); }; f.ec = function() { var a = this.g(); this.N != a && (this.Qa(), this.N = a); }; f.Kc = function(a) { var b = this.g(); this.N != b || a.j && Hd(b, a.j) || (this.N = null, this.mb()); }; function Lh(a) { a.j && (m.clearTimeout(a.j), a.j = void 0); } f.mb = function() { 2 == Kh(this) && (this.T = sf(x(this.Pc, this, this.a), this.Wb())); }; f.Qa = function() { this.T && (m.clearTimeout(this.T), this.T = void 0); }; f.v = function() { var a; this.za(!1); Lh(this); for (var b = this.M.ja(), c = 0;a = b[c];c++) { gd(a, "mouseover", this.Hc, !1, this), gd(a, "mouseout", this.Cb, !1, this), gd(a, "mousemove", this.Wa, !1, this), gd(a, "focus", this.Gc, !1, this), gd(a, "blur", this.Cb, !1, this); } this.M.clear(); this.g() && Gd(this.g()); this.N = null; delete this.b; Hh.m.v.call(this); }; function Qh(a, b) { Fh.call(this, a, b); } y(Qh, Fh); Qh.prototype.a = function(a, b, c) { b = ce(a); b = fe(b); c = c ? new P(c.top + 10, c.right, c.bottom, c.left + 10) : new P(10, 0, 0, 10); Ch(this.b, a, 8, c, b, 9) & 496 && Ch(this.b, a, 8, c, b, 5); }; function Rh(a) { Eh.call(this, a, 5); } y(Rh, Eh); Rh.prototype.a = function(a, b, c) { var d = new M(10, 0); Ah(this.b, this.c, a, b, d, c, 9) & 496 && Ah(this.b, 4, a, 1, d, c, 5); }; function Sh(a, b, c) { Hh.call(this, a, b, c); } y(Sh, Hh); f = Sh.prototype; f.vc = !1; f.nb = !1; f.Bb = function() { Sh.m.Bb.call(this); this.K = Vd(ke(this.g())); this.a && (this.Fa = Vd(ke(this.a))); this.nb = this.vc; L(this.b.a, "mousemove", this.Wa, !1, this); }; f.hb = function() { gd(this.b.a, "mousemove", this.Wa, !1, this); this.Fa = this.K = null; this.nb = !1; Sh.m.hb.call(this); }; f.Gb = function(a) { if (this.F) { var b = ge(this.g()), c = ie(this.g()); return b.x - this.F.left <= a.x && a.x <= b.x + c.width + this.F.right && b.y - this.F.top <= a.y && a.y <= b.y + c.height + this.F.bottom; } return Sh.m.Gb.call(this, a); }; function Th(a, b) { if (a.Fa && a.Fa.contains(b) || a.Gb(b)) { return !0; } var c = a.o; return !!c && c.Gb(b); } f.Pc = function(a) { this.T = void 0; a != this.a || Th(this, this.l) || this.N || this.o && this.o.N || G && 0 == this.l.x && 0 == this.l.y || this.za(!1); }; f.Wa = function(a) { var b = this.ba; if (this.K) { var c = Rd(this.b), c = new M(a.clientX + c.x, a.clientY + c.y); Th(this, c) ? b = !1 : this.nb && (b = Td(this.K, c) >= Td(this.K, this.l)); } if (b) { if (this.mb(), this.N = null, b = this.o) { b.N = null; } } else { 3 == Kh(this) && this.Qa(); } Sh.m.Wa.call(this, a); }; f.ec = function() { this.N != this.g() && (this.nb = !1, this.N = this.g()); }; f.Wb = function() { return this.nb ? 100 : Sh.m.Wb.call(this); }; function Uh() { Hh.call(this, void 0, void 0, void 0); var a = this.b; this.ca = a.a.createElement("PRE"); this.U = a.C("BUTTON", null, "Close"); L(this.U, "click", x(this.za, this, !1)); a = a.C("DIV", null, this.ca, a.a.createElement("HR"), a.C("DIV", {style:"text-align: center;"}, this.U)); this.g().appendChild(a); } y(Uh, Sh); Uh.prototype.v = function() { id(this.U); delete this.U; delete this.ca; Uh.m.v.call(this); }; function Vh() { S.call(this); this.c = new fh; this.la(this.c); this.B = new V(void 0, !0); Gf(this.B, "Delete session?"); Hf(this.B, Rb("Are you sure you want to delete this session?")); L(this.B, Pf, this.Oa, !1, this); this.F = new lh("Delete Session"); this.la(this.F); L(this.F, "action", x(this.B.Z, this.B, !0)); this.h = new lh("Take Screenshot"); this.la(this.h); L(this.h, "action", this.Pa, !1, this); this.o = new Uh; this.o.F = new P(5, 5, 5, 5); this.o.vc = !0; var a = this.o, b = new P(10, 0, 0, 0); null == b || b instanceof P ? a.Oa = b : a.Oa = new P(b, void 0, void 0, void 0); a.ba && a.ib(); this.o.Mc = 250; } y(Vh, S); Vh.prototype.v = function() { this.o.O(); this.B.O(); delete this.c; delete this.G; delete this.K; delete this.U; delete this.B; delete this.o; delete this.h; delete this.F; delete this.ca; Vh.m.v.call(this); }; Vh.prototype.I = function() { this.h.I(); this.F.I(); this.c.I(); var a = this.a; this.G = a.C("DIV", "goog-tab-content empty-view", "No Sessions"); this.U = a.a.createElement("SPAN"); this.ca = a.C("DIV", "todo", "\u00a0"); this.ca.disabled = !0; this.c.c(this.U); var b; this.c.c(b = a.C("SPAN", "session-capabilities", "Capabilities")); this.c.c(this.h.g()); this.c.c(this.F.g()); this.K = a.C("DIV", "goog-tab-content", this.c.g(), this.ca); this.b = a.C("DIV", null, this.G, this.K, a.C("DIV", "goog-tab-bar-clear")); Wh(this, null); Ih(this.o, b); }; function Wh(a, b) { var c = !!b; Q(a.G, !c); Q(a.K, c); if (b) { Id(a.U, b.P()); for (var c = a.o.ca, d = wh(b.a || {}), e = "", g = 0;g < d.length;g++) { var h = d[g], e = e + (h instanceof Ob ? Qb(h) : h) } c.innerHTML = e; Xh(b.a, "takesScreenshot") ? (a.h.ka(!0), a.h.sa("")) : (a.h.ka(!1), a.h.sa("Screenshots not supported")); } } Vh.prototype.Oa = function(a) { "ok" == a.key && this.D("delete"); }; Vh.prototype.Pa = function() { this.D("screenshot"); }; function Yh(a) { ih.call(this, "Sessions"); this.c = new bh($g, null); this.o = new Vh; this.B = new hh(a); this.G = this.a.C("BUTTON", null, "Create Session"); this.K = this.a.C("BUTTON", null, "Refresh Sessions"); this.F = new fh; this.h = []; this.ca = setInterval(x(this.$d, this), 300); this.la(this.c); this.la(this.o); this.la(this.F); this.ka(!1); this.F.c(this.G); this.F.c(this.K); L(this.G, "click", x(this.B.Z, this.B, !0)); L(this.K, "click", x(this.D, this, "refresh")); L(this.c, "select", this.Rd, !1, this); L(this.B, "action", this.Jd, !1, this); } y(Yh, ih); f = Yh.prototype; f.v = function() { id(this.G); id(this.K); clearInterval(this.ca); this.B.O(); delete this.B; delete this.c; delete this.o; delete this.F; delete this.h; delete this.ca; Yh.m.v.call(this); }; f.uc = function() { this.c.I(); this.o.I(); this.F.I(); return this.a.C("DIV", "session-container", this.F.g(), this.c.g(), this.o.g()); }; f.ka = function(a) { a ? (this.G.removeAttribute("disabled"), this.K.removeAttribute("disabled")) : (this.G.setAttribute("disabled", "disabled"), this.K.setAttribute("disabled", "disabled")); }; function Zh(a) { return (a = a.c.aa) ? a.Ka : null; } f.$d = function() { if (this.h.length) { var a = this.h[0].Ja, a = 5 === a.length ? "." : a + "."; C(this.h, function(b) { var c = a; ng(b.g(), c); b.Ja = c; }); } }; function $h(a) { var b = ie(a.c.g()); a = a.o; b = b.height + 20; Wd(a.G, "height", b + "px"); Wd(a.K, "height", b + "px"); } f.pc = function(a) { a = new ai(a); var b = this.h.shift(), c = He(this.c, b); 0 > c ? this.c.la(a, !0) : (this.c.qb(a, c, !0), this.c.removeChild(b, !0)); $h(this); eh(this.c, a); }; function bi(a, b) { var c = new lb; C(b, function(a) { c.ra(a.P(), a); }); for (var d = a.c, e = d.aa, g = [], h = Fe(d) - a.h.length, k = 0;k < h;++k) { g.push(U(d, k)); } C(g, function(a) { var b = a.Ka.P(), g = pb(c, b); g ? (nb(c, b), a.Ka = g) : (d.removeChild(a, !0), e === a && (e = null)); }, a); C(a.h, function(a) { d.removeChild(a, !0); }); a.h = []; C(c.ja(), a.pc, a); e ? (Wh(a.o, e.Ka), eh(d, e)) : Fe(d) ? eh(d, U(d, 0)) : Wh(a.o, null); } f.Jd = function() { var a = "."; this.h.length && (a = this.h[0].Ja); a = new Fg(a, null, this.a); a.ka(!1); this.h.push(a); this.c.la(a, !0); $h(this); this.D(new Je("create", this, this.B.Yb())); }; f.Rd = function() { var a = this.c.aa; Wh(this.o, a ? a.Ka : null); }; function ai(a) { var b = Xh(a.a, "browserName") || "unknown browser", b = b.toLowerCase().replace(/(^|\b)[a-z]/g, function(a) { return a.toUpperCase(); }); Fg.call(this, b); this.Ka = a; } y(ai, Fg); ai.prototype.v = function() { delete this.Ka; ai.m.v.call(this); }; function ci(a, b) { S.call(this, b); this.h = a || ""; } var di; y(ci, S); f = ci.prototype; f.wa = null; function ei() { null != di || (di = "placeholder" in document.createElement("INPUT")); return di; } f.Fb = !1; f.I = function() { this.b = this.a.C("INPUT", {type:"text"}); }; f.V = function() { ci.m.V.call(this); var a = new te(this); a.w(this.g(), "focus", this.Jc); a.w(this.g(), "blur", this.nd); ei() ? this.c = a : (G && a.w(this.g(), ["keypress", "keydown", "keyup"], this.sd), a.w(yd(O(this.g())), "load", this.Ed), this.c = a, fi(this)); gi(this); this.g().a = this; }; f.ea = function() { ci.m.ea.call(this); this.c && (this.c.O(), this.c = null); this.g().a = null; }; function fi(a) { !a.o && a.c && a.g().form && (a.c.w(a.g().form, "submit", a.td), a.o = !0); } f.v = function() { ci.m.v.call(this); this.c && (this.c.O(), this.c = null); }; f.Jc = function() { this.Fb = !0; Re(this.g(), "label-input-label"); if (!ei() && !hi(this) && !this.B) { var a = this, b = function() { a.g() && (a.g().value = ""); }; E ? sf(b, 10) : b(); } }; f.nd = function() { ei() || (this.c.na(this.g(), "click", this.Jc), this.wa = null); this.Fb = !1; gi(this); }; f.sd = function(a) { 27 == a.a && ("keydown" == a.type ? this.wa = this.g().value : "keypress" == a.type ? this.g().value = this.wa : "keyup" == a.type && (this.wa = null), a.b()); }; f.td = function() { hi(this) || (this.g().value = "", sf(this.md, 10, this)); }; f.md = function() { hi(this) || (this.g().value = this.h); }; f.Ed = function() { gi(this); }; function hi(a) { return !!a.g() && "" != a.g().value && a.g().value != a.h; } f.clear = function() { this.g().value = ""; null != this.wa && (this.wa = ""); }; f.reset = function() { hi(this) && (this.clear(), gi(this)); }; function gi(a) { var b = a.g(); ei() ? a.g().placeholder != a.h && (a.g().placeholder = a.h) : fi(a); Me(b, "label", a.h); hi(a) ? (b = a.g(), Re(b, "label-input-label")) : (a.B || a.Fb || (b = a.g(), Pe(b, "label-input-label")), ei() || sf(a.Xd, 10, a)); } f.ka = function(a) { this.g().disabled = !a; var b = this.g(); a ? Re(b, "label-input-label-disabled") : Pe(b, "label-input-label-disabled"); }; f.isEnabled = function() { return !this.g().disabled; }; f.Xd = function() { !this.g() || hi(this) || this.Fb || (this.g().value = this.h); }; function ii() { gh.call(this, "Open WebDriverJS Script"); L(this, "show", this.Wd, !1, this); this.h = new ci("Script URL"); this.la(this.h); } y(ii, gh); f = ii.prototype; f.v = function() { delete this.h; ii.m.v.call(this); }; f.tc = function() { var a = Ad("A", {href:"https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs", target:"_blank"}, "WebDriverJS"); this.h.I(); Pe(this.h.g(), "url-input"); var b = this.a; return b.C("DIV", null, b.C("P", null, "Open a page that has the ", a, " client. The page will be opened with the query parameters required to communicate with the server."), this.h.g()); }; f.Wd = function() { this.h.clear(); this.h.g().focus(); this.h.g().blur(); }; f.Yb = function() { var a = this.h; return null != a.wa ? a.wa : hi(a) ? a.g().value : ""; }; f.Lc = function() { return hi(this.h); }; function ji() { lh.call(this, "Load Script"); this.o = new ii; L(this.o, "action", this.G, !1, this); L(this, "action", x(this.o.Z, this.o, !0)); } y(ji, lh); ji.prototype.v = function() { this.o.O(); delete this.o; ji.m.v.call(this); }; ji.prototype.G = function() { this.D(new Je("loadscript", this, this.o.Yb())); }; function ki(a) { this.a = a; this.b = {}; } function li(a, b, c) { a.b[b] = c; return a; } ;function mi() { } ;function ni(a) { this.a = {}; a && oi(this, a); } y(ni, mi); function oi(a, b) { var c = b instanceof ni ? b.a : b, d; for (d in c) { if (c.hasOwnProperty(d)) { var e = a, g = d, h = c[d]; null != h ? e.a[g] = h : delete e.a[g]; } } return a; } function Xh(a, b) { var c = null; a.a.hasOwnProperty(b) && (c = a.a[b]); return null != c ? c : null; } ni.prototype.has = function(a) { return !!Xh(this, a); }; function pi(a, b) { this.b = a; this.a = oi(new ni, b); } pi.prototype.P = function() { return this.b; }; pi.prototype.toJSON = function() { return this.P(); }; function qi() { this.j = {}; } qi.prototype.h = function(a, b) { var c = Array.prototype.slice.call(arguments, 1), d = this.j[a]; if (d) { for (var e = 0;e < d.length;) { var g = d[e]; g.Ra.apply(g.scope, c); d[e] === g && (d[e].Td ? d.splice(e, 1) : e += 1); } } }; function ri(a, b) { var c = a.j[b]; c || (c = a.j[b] = []); return c; } function si(a, b, c, d) { b = ri(a, b); for (var e = b.length, g = 0;g < e;++g) { if (b[g].Ra == c) { return a; } } b.push({Ra:c, scope:d, Td:!0}); return a; } function ti(a, b, c, d) { return si(a, b, c, d); } qi.prototype.lb = function(a) { n(a) ? delete this.j[a] : this.j = {}; return this; }; if (!u(Error.captureStackTrace)) { try { throw Error(); } catch (a) { } } ;/* Portions of this code are from the Dojo toolkit, received under the BSD License: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Dojo Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function Z(a, b, c) { var d = pc; 1 < a ? d = rc : 0 < a && (d = qc); "function" === typeof b && (b = b.bind(c)); (a = ui) && a.log(d, b, void 0); } var ui = xc("webdriver.promise"); function vi(a) { ya.call(this, a); this.name = "CancellationError"; this.a = !1; } y(vi, ya); function wi(a, b) { var c; if (a instanceof vi) { return new vi(b ? b + ": " + a.message : a.message); } if (b) { return c = b, a && (c += ": " + a), new vi(c); } a && (c = a + ""); return new vi(c); } function xi() { vi.call(this, "ControlFlow was reset"); this.name = "FlowResetError"; this.a = !0; } y(xi, vi); function yi(a) { if (a instanceof yi) { return a; } var b = ""; a && (b = ": " + ("string" === typeof a.message ? a.message : a)); vi.call(this, "Task was discarded due to a previous failure" + b); this.name = "DiscardedTaskError"; this.a = !0; } y(yi, vi); function zi() { ya.call(this, "Multiple unhandled promise rejections reported"); this.name = "MultipleUnhandledRejectionError"; } y(zi, ya); function Ai(a) { a.prototype.then = a.prototype.then; try { Object.defineProperty(a.prototype, "$webdriver_Thenable", {value:!0, enumerable:!1}); } catch (b) { a.prototype.$webdriver_Thenable = !0; } } function Bi(a) { if (!a) { return !1; } try { return !!a.$webdriver_Thenable; } catch (b) { return !1; } } ba(); var Ci = Symbol("on cancel"); function Di(a, b) { w(this); this.j = b || Sa() || Ei; this.b = this.c = this.Mb = null; this.A = "pending"; this.l = !1; this.ia = void 0; this.a = null; this[Ci] = null; try { var c = this; a(function(a) { Fi(c, "fulfilled", a); }, function(a) { Fi(c, "rejected", a); }); } catch (d) { Fi(this, "rejected", d); } } f = Di.prototype; f.toString = function() { return "Promise::" + w(this) + ' {[[PromiseStatus]]: "' + this.A + '"}'; }; function Fi(a, b, c) { if ("pending" === a.A) { c === a && (c = new TypeError("A promise may not resolve to itself"), b = "rejected"); a.c = null; a.A = "blocked"; if ("rejected" !== b) { if (Bi(c)) { c.then(a.ob.bind(a, "fulfilled"), a.ob.bind(a, "rejected")); return; } if (ka(c)) { try { var d = c.then; } catch (e) { a.A = "rejected"; a.ia = e; Gi(a); return; } if ("function" === typeof d) { Hi(a, c, d); return; } } } "rejected" === b && (c instanceof Error || ka(c) && (r(c.message) || c.ce)) && c.stack && a.Mb && (c.stack += "\nFrom: " + (a.Mb.stack || a.Mb)); a.A = b; a.ia = c; Gi(a); } } function Hi(a, b, c) { function d(b) { g || (g = !0, a.ob("rejected", b)); } function e(b) { g || (g = !0, a.ob("fulfilled", b)); } var g = !1; try { c.call(b, e, d); } catch (h) { d(h); } } f.ob = function(a, b) { "blocked" === this.A && (this.A = "pending", Fi(this, a, b)); }; function Gi(a) { Z(2, function() { return a + " scheduling notifications"; }, a); a[Ci] = null; a.ia instanceof vi && a.ia.a && (a.b = null); a.a || (a.a = Ii(a.j)); a.l || "rejected" !== a.A || a.ia instanceof vi || Ji(a.a, a); Ki(a.a, a); } f.cancel = function(a) { function b(a) { return "pending" === a.A || "blocked" === a.A; } b(this) && (this.c && b(this.c) ? this.c.cancel(a) : (a = wi(a), this[Ci] && (this[Ci](a), this[Ci] = null), "blocked" === this.A ? this.ob("rejected", a) : Fi(this, "rejected", a))); }; f.Hb = function() { return "pending" === this.A; }; f.then = function(a, b) { return Li(this, a, b, "then"); }; f.oc = function(a) { return Li(this, null, a, "catch"); }; f.Na = function(a) { return this.oc(a); }; function Li(a, b, c, d) { if (!u(b) && !u(c)) { return a; } a.l = !0; a.a && Mi(a.a, a); b = new Ni(a.j, a.Hd.bind(a, b, c), d, void 0); b.a.c = a; if ("pending" === a.A || "blocked" === a.A) { a.b || (a.b = []), a.b.push(b), b.j = !0; } Oi(Ii(a.j), b); return b.a; } f.Hd = function(a, b) { var c = a; "rejected" === this.A && (c = b); if (u(c)) { return "GeneratorFunction" === c.constructor.name ? Pi(c, null, this.ia) : c(this.ia); } if ("rejected" === this.A) { throw this.ia; } return this.ia; }; Ai(Di); function Qi(a) { function b(a) { if (a === e) { throw new TypeError("May not resolve a Deferred with itself"); } } var c, d; this.a = new Di(function(a, b) { c = a; d = b; }, a); var e = this; this.h = function(a) { b(a); c(a); }; this.c = function(a) { b(a); d(a); }; } f = Qi.prototype; f.Hb = function() { return this.a.Hb(); }; f.cancel = function(a) { this.a.cancel(a); }; f.then = function(a, b) { return this.a.then(a, b); }; f.oc = function(a) { return this.a.oc(a); }; f.Na = function(a) { return this.a.Na(a); }; Ai(Qi); function Ri() { this.j = {}; this.l = this.c = this.a = this.b = null; } y(Ri, qi); f = Ri.prototype; f.toString = function() { return Si(this); }; f.reset = function() { Ti(this, new xi); this.h(Ui); this.lb(); this.c && (this.c.cancel(), this.c = null); }; function Si(a) { function b(a, c) { var e = a.toString(); a === d && (e = "(active) " + e); var l = c + "| "; a.S && (a.S.q.A !== Vi ? (e += "\n" + l + "(pending) " + a.S.Ca, e += "\n" + b(a.S.q, l + "| ")) : e += "\n" + l + "(blocked) " + a.S.Ca); a.$ && a.$.forEach(function(a) { e += "\n" + l + a; }); a.ha && a.ha.forEach(function(a) { return e += "\n" + l + a; }); return c + e; } var c = "ControlFlow::" + w(a), d = a.b; if (!a.a || !a.a.size) { return c; } a = fa(a.a); for (var e = a.next();!e.done;e = a.next()) { c += "\n" + b(e.value, "| "); } return c; } function Ii(a) { if (a.b) { return a.b; } a.b = new Wi(a); a.a || (a.a = new Set); a.a.add(a.b); ti(si(a.b, "end", a.Od, a), "error", a.Pd, a); nf(function() { return a.b = null; }, a); Xi(a.b); return a.b; } f.async = function(a, b, c) { nf(function() { this.b = null; var d = Ii(this); try { Yi(d, a.bind(b, c)); } catch (g) { var e = wi(g, "Function passed to ControlFlow.async() threw"); e.a = !0; Zi(d, e); } finally { this.b = null; } }, this); }; f.Od = function(a) { var b = this; this.a && (this.a.delete(a), Z(1, function() { return a + " has finished"; }), Z(1, function() { return b.a.size + " queues remain\n" + b; }, this), this.a.size || (this.c = new $i(this.Zd, this))); }; f.Pd = function(a, b) { this.a && this.a.delete(b); Ti(this, wi(a, "There was an uncaught error in the control flow")); this.c && (this.c.cancel(), this.c = null); this.l && (clearInterval(this.l), this.l = null); ri(this, aj).length ? this.h(aj, a) : kf(a); }; function Ti(a, b) { b.a = !0; if (a.a) { for (var c = fa(a.a), d = c.next();!d.done;d = c.next()) { d = d.value, d.lb(), Zi(d, b); } a.a.clear(); a.a = null; } } f.Zd = function() { var a = this; Z(1, function() { return "Going idle: " + a; }); this.l && (clearInterval(this.l), this.l = null); this.c = null; this.h(bj); }; var bj = "idle", Ui = "reset", aj = "uncaughtException"; function $i(a, b) { this.a = !1; nf(function() { this.a || a.call(b); }, this); } $i.prototype.cancel = function() { this.a = !0; }; function Ni(a, b, c, d) { Qi.call(this, a); this.o = b; this.l = c; this.b = null; this.j = !1; d && (a = this.a, c = d.top, b = Error(this.l), b.name = d.name, Error.captureStackTrace ? Error.captureStackTrace(b, c) : (b ? (d = b.stack || b.b || "", c = b + "\n", 0 == d.lastIndexOf(c, 0) && (d = d.substring(c.length))) : d = "", b.stack = b.toString(), d && (b.stack += "\n" + d)), a.Mb = b); } y(Ni, Qi); Ni.prototype.toString = function() { return "Task::" + w(this) + "<" + this.l + ">"; }; var Vi = "finished"; function Wi(a) { this.j = {}; w(this); w(this); this.a = a; this.ha = []; this.S = this.$ = null; this.A = "new"; this.b = new Set; } y(Wi, qi); Wi.prototype.toString = function() { return "TaskQueue::" + w(this); }; function Ji(a, b) { Z(2, function() { return a + " registering unhandled rejection: " + b; }, a); a.b.add(b); } function Mi(a, b) { a.b.delete(b) && Z(2, function() { return a + " clearing unhandled rejection: " + b; }, a); } function Oi(a, b) { if ("new" !== a.A) { throw Error("TaskQueue has started: " + a); } if (b.b) { throw Error("Task is already scheduled in another queue"); } a.ha.push(b); b.b = a; b.a[Ci] = a.l.bind(a, b); Z(1, function() { return a + ".enqueue(" + b + ")"; }, a); Z(2, function() { return a.a.toString(); }, a); } function Ki(a, b) { if (a.A === Vi) { throw Error("cannot interrupt a finished q(" + a + ")"); } a.S && a.S.Ca.a === b && (a.S.Ca.a.a = null, a.S = null, nf(a.c, a)); b.b && (b.b.forEach(function(a) { a.j = !1; a.b || (a.a[Ci] = this.l.bind(this, a), a.b === this && -1 !== this.ha.indexOf(a)) || (a.b && cj(a.b, a), a.b = this, this.$ || (this.$ = []), this.$.push(a)); }, a), b.b = null, Z(2, function() { return a + " interrupted\n" + a.a; }, a)); } function Xi(a) { if ("new" !== a.A) { throw Error("TaskQueue has already started"); } nf(a.c, a); } function Zi(a, b) { var c; b instanceof xi ? c = b : c = new yi(b); a.$ && a.$.length && (a.$.forEach(function(a) { return a.c(c); }), a.$ = []); a.ha && a.ha.length && (a.ha.forEach(function(a) { return a.c(c); }), a.ha = []); a.S ? (Z(2, function() { return a + ".abort(); cancelling pending task"; }, a), a.S.Ca.cancel(b)) : (Z(2, function() { return a + ".abort(); emitting error event"; }, a), a.h("error", b, a)); } Wi.prototype.c = function() { if (this.A !== Vi && (this.A = "started", null == this.S && !dj(this))) { var a; do { a = ej(this); } while (a && !a.a.Hb()); if (a) { var b = this, c = new Wi(this.a); ti(ti(c, "end", function() { b.S && b.S.Ca.h(d); }), "error", function(a) { Bi(d) && d.cancel(wi(a)); b.S.Ca.c(a); }); Z(2, function() { return b + " created " + c + " for " + a; }); var d = void 0; try { this.S = {Ca:a, q:c}, a.a.a = this, d = Yi(c, a.o), Xi(c); } catch (g) { Zi(c, g); } } else { var e = this; this.A = Vi; this.ha = []; this.$ = null; Z(2, function() { return e + ".emit(end)"; }, this); this.h("end", this); } } }; function Yi(a, b) { try { return Ta.push(a.a), a.a.b = a, b(); } finally { a.a.b = null, Ta.pop(); } } function dj(a) { if (!a.b.size) { return !1; } for (var b = new Set, c = fa(a.b), d = c.next();!d.done;d = c.next()) { b.add(d.value.ia); } a.b.clear(); b = 1 === b.size ? b.values().next().value : new zi; Z(1, function() { return a + " aborting due to unhandled rejections"; }, a); Zi(a, b); return !0; } function cj(a, b) { var c; if (a.$ && (c = a.$.indexOf(b), -1 != c)) { b.b = null; a.$.splice(c, 1); return; } c = a.ha.indexOf(b); -1 != c && (b.b = null, a.ha.splice(c, 1)); } Wi.prototype.l = function(a, b) { this.S && this.S.Ca === a ? Zi(this.S.q, b) : cj(this, a); }; function ej(a) { for (var b = void 0, c = {};;) { a.$ && (b = a.$.shift()); !b && a.ha && (b = a.ha.shift()); if (b && b.j) { c.Nb = a, Z(2, function(a) { return function() { return a.Nb + " skipping blocked task " + b; }; }(c), a), b = b.b = null; } else { break; } c = {Nb:c.Nb}; } return b; } var Ei = new Ri, Ta = []; function Pi(a, b, c) { function d(a) { g(k.next, a); } function e(a) { g(k["throw"], a); } function g(a, b) { if (h.Hb()) { try { var c = a.call(k, b); } catch (g) { h.c(g); return; } if (c.done) { h.h(c.value); } else { var c = c.value, v = d, F = e; c && ka(c) && "function" === typeof c.then ? c.then(v, F) : c && ka(c) && u(c.dd) ? c.dd(v, F) : v && v(c); } } } if ("GeneratorFunction" !== a.constructor.name) { throw new TypeError("Input is not a GeneratorFunction: " + a.constructor.name); } var h = new Qi, k = a.apply(b, db(arguments, 2)); d(); return h.a; } ;function fj(a, b) { A.call(this); this.b = xc("remote.ui.Client"); this.h = new Dc; Ec(this.h, !0); this.M = a; this.o = b; this.c = new Ie; this.L = new Xf; this.a = new Yh(gj); this.j = new Uf; this.l = new ji; L(this.a, "create", this.Kd, !1, this); L(this.a, "delete", this.Ld, !1, this); L(this.a, "refresh", this.Vc, !1, this); L(this.a, "screenshot", this.Ud, !1, this); L(this.l, "loadscript", this.Nd, !1, this); } y(fj, A); var gj = "android;chrome;firefox;internet explorer;iphone;opera".split(";"); f = fj.prototype; f.v = function() { this.c.O(); this.a.O(); this.j.O(); this.l.O(); Ec(this.h, !1); delete this.b; delete this.o; delete this.h; delete this.a; delete this.c; delete this.j; delete this.l; fj.m.v.call(this); }; function hj(a) { De(a.c, void 0); a.c.Kb(!1); De(a.a, void 0); De(a.L, void 0); De(a.l, void 0); a.a.o.c.c(a.l.g()); ij(a).then(x(function() { this.a.ka(!0); this.Vc(); }, a)); } function jj(a, b) { a.c.Kb(!1); return kj(a.o, b).then(ua); } function lj(a, b, c) { var d = a.b; d && d.log(lc, b + "\n" + c, void 0); c = a.c; c.a.fd(c.g(), b); c.Lb(); a.c.Kb(!0); } function ij(a) { nd(a.b, "Retrieving server status..."); return jj(a, new ki("getStatus")).then(x(function(a) { var c = a.value || {}; (a = c.os) && a.name && (a = a.name + (a.version ? " " + a.version : "")); c = c.build; Yf(this.L, a, c && c.version, c && c.revision); }, a)); } f.Vc = function() { nd(this.b, "Refreshing sessions..."); var a = this; jj(this, new ki("getSessions")).then(function(b) { b = b.value; b = Wa(b, function(a) { return new pi(a.id, a.capabilities); }); bi(a.a, b); }).Na(function(b) { lj(a, "Unable to refresh session list.", b); }); }; f.Kd = function(a) { nd(this.b, "Creating new session for " + a.data.browserName); a = li(new ki("newSession"), "desiredCapabilities", a.data); var b = this; jj(this, a).then(function(a) { a = new pi(a.sessionId, a.value); b.a.pc(a); }).Na(function(a) { lj(b, "Unable to create new session.", a); a = b.a; var d = a.h.shift(); d && (a.c.removeChild(d, !0), $h(a)); }); }; f.Ld = function() { var a = Zh(this.a); if (a) { nd(this.b, "Deleting session: " + a.P()); var b = li(new ki("quit"), "sessionId", a.P()), c = this; jj(this, b).then(function() { for (var b = c.a, e = b.c.aa, g, h = Fe(b.c), k = 0;k < h;++k) { var l = U(b.c, k); if (l.Ka.P() == a.P()) { g = l; break; } } g && (b.c.removeChild(g, !0), g.O(), e == g && Fe(b.c) ? (b = b.c, eh(b, U(b, 0))) : Wh(b.o, null)); }).Na(function(a) { lj(c, "Unable to delete session.", a); }); } else { md(this.b, "Cannot delete session; no session selected!"); } }; f.Nd = function(a) { var b = Zh(this.a); if (b) { a = new sb(a.data); a.b.add("wdsid", b.P()); a.b.add("wdurl", this.M); var c = li(li(new ki("get"), "sessionId", b.P()), "url", a.toString()); nd(this.b, "In session(" + b.P() + "), loading " + a); jj(this, c).Na(x(function(a) { lj(this, "Unable to load URL", a); }, this)); } else { md(this.b, "Cannot load url: " + a.data + "; no session selected!"); } }; f.Ud = function() { var a = Zh(this.a); if (a) { nd(this.b, "Taking screenshot: " + a.P()); a = li(new ki("screenshot"), "sessionId", a.P()); Vf(this.j, Wf); this.j.Z(!0); var b = this; jj(this, a).then(function(a) { var d = b.j; a = a.value; if (d.ya) { Vf(d, 1); a = "data:image/png;base64," + a; var e = d.a; a = e.C("A", {href:a, target:"_blank"}, e.C("IMG", {src:a})); Hf(d, Rb("")); d.Ia().appendChild(a); Bf(d); } }).Na(function(a) { b.j.Z(!1); lj(b, "Unable to take screenshot.", a); }); } else { md(this.b, "Cannot take screenshot; no session selected!"); } }; function mj(a) { this.a = a; this.b = {}; this.c = xc("webdriver.http.Executor"); } function kj(a, b) { var c = a.b[b.a] || nj[b.a]; if (!c) { throw Error("Unrecognized command: " + b.a); } var d = b.b, e = oj(c.path, d), g = new pj(c.method, e, d), h = a.c; tc(h, function() { return ">>>\n" + g; }); return qj(a.a, g).then(function(a) { tc(h, function() { return "<<<\n" + a; }); return rj(a); }); } function oj(a, b) { var c = a.match(/\/:(\w+)\b/g); if (c) { for (var d = 0;d < c.length;++d) { var e = c[d].substring(2); if (e in b) { var g = b[e]; g && g.ELEMENT && (g = g.ELEMENT); a = a.replace(c[d], "/" + g); delete b[e]; } else { throw Error("Missing required parameter: " + e); } } } return a; } function rj(a) { try { return JSON.parse(a.a); } catch (c) { } var b = {status:0, value:a.a.replace(/\r\n/g, "\n")}; 199 < a.status && 300 > a.status || (b.status = 404 == a.status ? 9 : 13); return b; } var nj = function() { function a(a) { return c("POST", a); } function b(a) { return c("GET", a); } function c(a, b) { return {method:a, path:b}; } return (new function() { var a = {}; this.put = function(b, c) { a[b] = c; return this; }; this.ed = function() { return a; }; }).put("getStatus", b("/status")).put("newSession", a("/session")).put("getSessions", b("/sessions")).put("getSessionCapabilities", b("/session/:sessionId")).put("quit", c("DELETE", "/session/:sessionId")).put("close", c("DELETE", "/session/:sessionId/window")).put("getCurrentWindowHandle", b("/session/:sessionId/window_handle")).put("getWindowHandles", b("/session/:sessionId/window_handles")).put("getCurrentUrl", b("/session/:sessionId/url")).put("get", a("/session/:sessionId/url")).put("goBack", a("/session/:sessionId/back")).put("goForward", a("/session/:sessionId/forward")).put("refresh", a("/session/:sessionId/refresh")).put("addCookie", a("/session/:sessionId/cookie")).put("getCookies", b("/session/:sessionId/cookie")).put("deleteAllCookies", c("DELETE", "/session/:sessionId/cookie")).put("deleteCookie", c("DELETE", "/session/:sessionId/cookie/:name")).put("findElement", a("/session/:sessionId/element")).put("findElements", a("/session/:sessionId/elements")).put("getActiveElement", a("/session/:sessionId/element/active")).put("findChildElement", a("/session/:sessionId/element/:id/element")).put("findChildElements", a("/session/:sessionId/element/:id/elements")).put("clearElement", a("/session/:sessionId/element/:id/clear")).put("clickElement", a("/session/:sessionId/element/:id/click")).put("sendKeysToElement", a("/session/:sessionId/element/:id/value")).put("submitElement", a("/session/:sessionId/element/:id/submit")).put("getElementText", b("/session/:sessionId/element/:id/text")).put("getElementTagName", b("/session/:sessionId/element/:id/name")).put("isElementSelected", b("/session/:sessionId/element/:id/selected")).put("isElementEnabled", b("/session/:sessionId/element/:id/enabled")).put("isElementDisplayed", b("/session/:sessionId/element/:id/displayed")).put("getElementLocation", b("/session/:sessionId/element/:id/location")).put("getElementSize", b("/session/:sessionId/element/:id/size")).put("getElementAttribute", b("/session/:sessionId/element/:id/attribute/:name")).put("getElementValueOfCssProperty", b("/session/:sessionId/element/:id/css/:propertyName")).put("elementEquals", b("/session/:sessionId/element/:id/equals/:other")).put("takeElementScreenshot", b("/session/:sessionId/element/:id/screenshot")).put("switchToWindow", a("/session/:sessionId/window")).put("maximizeWindow", a("/session/:sessionId/window/:windowHandle/maximize")).put("getWindowPosition", b("/session/:sessionId/window/:windowHandle/position")).put("setWindowPosition", a("/session/:sessionId/window/:windowHandle/position")).put("getWindowSize", b("/session/:sessionId/window/:windowHandle/size")).put("setWindowSize", a("/session/:sessionId/window/:windowHandle/size")).put("switchToFrame", a("/session/:sessionId/frame")).put("getPageSource", b("/session/:sessionId/source")).put("getTitle", b("/session/:sessionId/title")).put("executeScript", a("/session/:sessionId/execute")).put("executeAsyncScript", a("/session/:sessionId/execute_async")).put("screenshot", b("/session/:sessionId/screenshot")).put("setTimeout", a("/session/:sessionId/timeouts")).put("setScriptTimeout", a("/session/:sessionId/timeouts/async_script")).put("implicitlyWait", a("/session/:sessionId/timeouts/implicit_wait")).put("mouseMoveTo", a("/session/:sessionId/moveto")).put("mouseClick", a("/session/:sessionId/click")).put("mouseDoubleClick", a("/session/:sessionId/doubleclick")).put("mouseButtonDown", a("/session/:sessionId/buttondown")).put("mouseButtonUp", a("/session/:sessionId/buttonup")).put("mouseMoveTo", a("/session/:sessionId/moveto")).put("sendKeysToActiveElement", a("/session/:sessionId/keys")).put("touchSingleTap", a("/session/:sessionId/touch/click")).put("touchDoubleTap", a("/session/:sessionId/touch/doubleclick")).put("touchDown", a("/session/:sessionId/touch/down")).put("touchUp", a("/session/:sessionId/touch/up")).put("touchMove", a("/session/:sessionId/touch/move")).put("touchScroll", a("/session/:sessionId/touch/scroll")).put("touchLongPress", a("/session/:sessionId/touch/longclick")).put("touchFlick", a("/session/:sessionId/touch/flick")).put("acceptAlert", a("/session/:sessionId/accept_alert")).put("dismissAlert", a("/session/:sessionId/dismiss_alert")).put("getAlertText", b("/session/:sessionId/alert_text")).put("setAlertValue", a("/session/:sessionId/alert_text")).put("getLog", a("/session/:sessionId/log")).put("getAvailableLogTypes", b("/session/:sessionId/log/types")).put("getSessionLogs", a("/logs")).put("uploadFile", a("/session/:sessionId/file")).ed(); }(); function sj(a) { var b = [], c; for (c in a) { b.push(c + ": " + a[c]); } return b.join("\n"); } function pj(a, b, c) { this.method = a; this.path = b; this.data = c || {}; this.a = {Accept:"application/json; charset=utf-8"}; } pj.prototype.toString = function() { return [this.method + " " + this.path + " HTTP/1.1", sj(this.a), "", JSON.stringify(this.data)].join("\n"); }; function tj(a, b, c) { this.status = a; this.a = c; this.b = {}; for (var d in b) { this.b[d.toLowerCase()] = b[d]; } } function uj(a) { var b = {}; if (a.getAllResponseHeaders) { var c = a.getAllResponseHeaders(); c && (c = c.replace(/\r\n/g, "\n").split("\n"), C(c, function(a) { a = a.split(/\s*:\s*/, 2); a[0] && (b[a[0]] = a[1] || ""); })); } return new tj(a.status || 200, b, a.responseText.replace(/\0/g, "")); } tj.prototype.toString = function() { var a = sj(this.b), b = ["HTTP/1.1 " + this.status, a]; a && b.push(""); this.a && b.push(this.a); return b.join("\n"); }; function vj() { } ;var wj; function xj() { } y(xj, vj); function yj() { var a; a: { var b = wj; if (!b.a && "undefined" == typeof XMLHttpRequest && "undefined" != typeof ActiveXObject) { for (var c = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"], d = 0;d < c.length;d++) { var e = c[d]; try { new ActiveXObject(e); a = b.a = e; break a; } catch (g) { } } throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed"); } a = b.a; } return a ? new ActiveXObject(a) : new XMLHttpRequest; } wj = new xj; function zj(a) { this.a = a; } function qj(a, b) { var c = a.a + b.path; return new Di(function(a, e) { var g = yj(); g.open(b.method, c, !0); g.onload = function() { a(uj(g)); }; g.onerror = function() { e(Error(["Unable to send request: ", b.method, " ", c, "\nOriginal request:\n", b].join(""))); }; for (var h in b.a) { g.setRequestHeader(h, b.a[h] + ""); } g.send(JSON.stringify(b.data)); }); } ;function Aj() { var a = window.location, a = [a.protocol, "//", a.host, a.pathname.replace(/\/static\/resource(?:\/[^\/]*)?$/, "")].join(""), b = new mj(new zj(a)); hj(new fj(a, b)); } var Bj = ["init"], Cj = m; Bj[0] in Cj || !Cj.execScript || Cj.execScript("var " + Bj[0]); for (var Dj;Bj.length && (Dj = Bj.shift());) { !Bj.length && n(Aj) ? Cj[Dj] = Aj : Cj[Dj] ? Cj = Cj[Dj] : Cj = Cj[Dj] = {}; } ;
module("traversing"); test("find(String)", function() { expect(3); equals( 'Yahoo', jQuery('#foo').find('.blogTest').text(), 'Check for find' ); // using contents will get comments regular, text, and comment nodes var j = jQuery("#nonnodes").contents(); equals( j.find("div").length, 0, "Check node,textnode,comment to find zero divs" ); same( jQuery("#main").find("> div").get(), q("foo", "moretests", "tabindex-tests", "liveHandlerOrder", "siblingTest"), "find child elements" ); }); test("is(String)", function() { expect(26); ok( jQuery('#form').is('form'), 'Check for element: A form must be a form' ); ok( !jQuery('#form').is('div'), 'Check for element: A form is not a div' ); ok( jQuery('#mark').is('.blog'), 'Check for class: Expected class "blog"' ); ok( !jQuery('#mark').is('.link'), 'Check for class: Did not expect class "link"' ); ok( jQuery('#simon').is('.blog.link'), 'Check for multiple classes: Expected classes "blog" and "link"' ); ok( !jQuery('#simon').is('.blogTest'), 'Check for multiple classes: Expected classes "blog" and "link", but not "blogTest"' ); ok( jQuery('#en').is('[lang="en"]'), 'Check for attribute: Expected attribute lang to be "en"' ); ok( !jQuery('#en').is('[lang="de"]'), 'Check for attribute: Expected attribute lang to be "en", not "de"' ); ok( jQuery('#text1').is('[type="text"]'), 'Check for attribute: Expected attribute type to be "text"' ); ok( !jQuery('#text1').is('[type="radio"]'), 'Check for attribute: Expected attribute type to be "text", not "radio"' ); ok( jQuery('#text2').is(':disabled'), 'Check for pseudoclass: Expected to be disabled' ); ok( !jQuery('#text1').is(':disabled'), 'Check for pseudoclass: Expected not disabled' ); ok( jQuery('#radio2').is(':checked'), 'Check for pseudoclass: Expected to be checked' ); ok( !jQuery('#radio1').is(':checked'), 'Check for pseudoclass: Expected not checked' ); ok( jQuery('#foo').is(':has(p)'), 'Check for child: Expected a child "p" element' ); ok( !jQuery('#foo').is(':has(ul)'), 'Check for child: Did not expect "ul" element' ); ok( jQuery('#foo').is(':has(p):has(a):has(code)'), 'Check for childs: Expected "p", "a" and "code" child elements' ); ok( !jQuery('#foo').is(':has(p):has(a):has(code):has(ol)'), 'Check for childs: Expected "p", "a" and "code" child elements, but no "ol"' ); ok( !jQuery('#foo').is(0), 'Expected false for an invalid expression - 0' ); ok( !jQuery('#foo').is(null), 'Expected false for an invalid expression - null' ); ok( !jQuery('#foo').is(''), 'Expected false for an invalid expression - ""' ); ok( !jQuery('#foo').is(undefined), 'Expected false for an invalid expression - undefined' ); // test is() with comma-seperated expressions ok( jQuery('#en').is('[lang="en"],[lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); ok( jQuery('#en').is('[lang="de"],[lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); ok( jQuery('#en').is('[lang="en"] , [lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); ok( jQuery('#en').is('[lang="de"] , [lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); }); test("index()", function() { expect(1); equals( jQuery("#text2").index(), 2, "Returns the index of a child amongst its siblings" ) }); test("index(Object|String|undefined)", function() { expect(16); var elements = jQuery([window, document]), inputElements = jQuery('#radio1,#radio2,#check1,#check2'); // Passing a node equals( elements.index(window), 0, "Check for index of elements" ); equals( elements.index(document), 1, "Check for index of elements" ); equals( inputElements.index(document.getElementById('radio1')), 0, "Check for index of elements" ); equals( inputElements.index(document.getElementById('radio2')), 1, "Check for index of elements" ); equals( inputElements.index(document.getElementById('check1')), 2, "Check for index of elements" ); equals( inputElements.index(document.getElementById('check2')), 3, "Check for index of elements" ); equals( inputElements.index(window), -1, "Check for not found index" ); equals( inputElements.index(document), -1, "Check for not found index" ); // Passing a jQuery object // enabled since [5500] equals( elements.index( elements ), 0, "Pass in a jQuery object" ); equals( elements.index( elements.eq(1) ), 1, "Pass in a jQuery object" ); equals( jQuery("#form :radio").index( jQuery("#radio2") ), 1, "Pass in a jQuery object" ); // Passing a selector or nothing // enabled since [6330] equals( jQuery('#text2').index(), 2, "Check for index amongst siblings" ); equals( jQuery('#form').children().eq(4).index(), 4, "Check for index amongst siblings" ); equals( jQuery('#radio2').index('#form :radio') , 1, "Check for index within a selector" ); equals( jQuery('#form :radio').index( jQuery('#radio2') ), 1, "Check for index within a selector" ); equals( jQuery('#radio2').index('#form :text') , -1, "Check for index not found within a selector" ); }); test("filter(Selector)", function() { expect(5); same( jQuery("#form input").filter(":checked").get(), q("radio2", "check1"), "filter(String)" ); same( jQuery("p").filter("#ap, #sndp").get(), q("ap", "sndp"), "filter('String, String')" ); same( jQuery("p").filter("#ap,#sndp").get(), q("ap", "sndp"), "filter('String,String')" ); // using contents will get comments regular, text, and comment nodes var j = jQuery("#nonnodes").contents(); equals( j.filter("span").length, 1, "Check node,textnode,comment to filter the one span" ); equals( j.filter("[name]").length, 0, "Check node,textnode,comment to filter the one span" ); }); test("filter(Function)", function() { expect(2); same( jQuery("p").filter(function() { return !jQuery("a", this).length }).get(), q("sndp", "first"), "filter(Function)" ); same( jQuery("p").filter(function(i, elem) { return !jQuery("a", elem).length }).get(), q("sndp", "first"), "filter(Function) using arg" ); }); test("filter(Element)", function() { expect(1); var element = document.getElementById("text1"); same( jQuery("#form input").filter(element).get(), q("text1"), "filter(Element)" ); }); test("filter(Array)", function() { expect(1); var elements = [ document.getElementById("text1") ]; same( jQuery("#form input").filter(elements).get(), q("text1"), "filter(Element)" ); }); test("filter(jQuery)", function() { expect(1); var elements = jQuery("#text1"); same( jQuery("#form input").filter(elements).get(), q("text1"), "filter(Element)" ); }) test("closest()", function() { expect(10); same( jQuery("body").closest("body").get(), q("body"), "closest(body)" ); same( jQuery("body").closest("html").get(), q("html"), "closest(html)" ); same( jQuery("body").closest("div").get(), [], "closest(div)" ); same( jQuery("#main").closest("span,#html").get(), q("html"), "closest(span,#html)" ); same( jQuery("div:eq(1)").closest("div:first").get(), [], "closest(div:first)" ); same( jQuery("div").closest("body:first div:last").get(), q("fx-tests"), "closest(body:first div:last)" ); // Test .closest() limited by the context var jq = jQuery("#nothiddendivchild"); same( jq.closest("html", document.body).get(), [], "Context limited." ); same( jq.closest("body", document.body).get(), [], "Context limited." ); same( jq.closest("#nothiddendiv", document.body).get(), q("nothiddendiv"), "Context not reached." ); //Test that .closest() returns unique'd set equals( jQuery('#main p').closest('#main').length, 1, "Closest should return a unique set" ); }); test("closest(Array)", function() { expect(7); same( jQuery("body").closest(["body"]), [{selector:"body", elem:document.body, level:1}], "closest([body])" ); same( jQuery("body").closest(["html"]), [{selector:"html", elem:document.documentElement, level:2}], "closest([html])" ); same( jQuery("body").closest(["div"]), [], "closest([div])" ); same( jQuery("#yahoo").closest(["div"]), [{"selector":"div", "elem": document.getElementById("foo"), "level": 3}, { "selector": "div", "elem": document.getElementById("main"), "level": 4 }], "closest([div])" ); same( jQuery("#main").closest(["span,#html"]), [{selector:"span,#html", elem:document.documentElement, level:4}], "closest([span,#html])" ); same( jQuery("body").closest(["body","html"]), [{selector:"body", elem:document.body, level:1}, {selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" ); same( jQuery("body").closest(["span","html"]), [{selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" ); }); test("not(Selector)", function() { expect(7); equals( jQuery("#main > p#ap > a").not("#google").length, 2, "not('selector')" ); same( jQuery("p").not(".result").get(), q("firstp", "ap", "sndp", "en", "sap", "first"), "not('.class')" ); same( jQuery("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" ); same( jQuery("#form option").not("option.emptyopt:contains('Nothing'),[selected],[value='1']").get(), q("option1c", "option1d", "option2c", "option3d", "option3e", "option4e","option5b"), "not('complex selector')"); same( jQuery('#ap *').not('code').get(), q("google", "groups", "anchor1", "mark"), "not('tag selector')" ); same( jQuery('#ap *').not('code, #mark').get(), q("google", "groups", "anchor1"), "not('tag, ID selector')" ); same( jQuery('#ap *').not('#mark, code').get(), q("google", "groups", "anchor1"), "not('ID, tag selector')"); }); test("not(Element)", function() { expect(1); var selects = jQuery("#form select"); same( selects.not( selects[1] ).get(), q("select1", "select3", "select4", "select5"), "filter out DOM element"); }); test("not(Function)", function() { same( jQuery("p").not(function() { return jQuery("a", this).length }).get(), q("sndp", "first"), "not(Function)" ); }); test("not(Array)", function() { expect(2); equals( jQuery("#main > p#ap > a").not(document.getElementById("google")).length, 2, "not(DOMElement)" ); equals( jQuery("p").not(document.getElementsByTagName("p")).length, 0, "not(Array-like DOM collection)" ); }); test("not(jQuery)", function() { expect(1); same( jQuery("p").not(jQuery("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" ); }); test("has(Element)", function() { expect(2); var obj = jQuery("#main").has(jQuery("#sndp")[0]); same( obj.get(), q("main"), "Keeps elements that have the element as a descendant" ); var multipleParent = jQuery("#main, #header").has(jQuery("#sndp")[0]); same( obj.get(), q("main"), "Does not include elements that do not have the element as a descendant" ); }); test("has(Selector)", function() { expect(3); var obj = jQuery("#main").has("#sndp"); same( obj.get(), q("main"), "Keeps elements that have any element matching the selector as a descendant" ); var multipleParent = jQuery("#main, #header").has("#sndp"); same( obj.get(), q("main"), "Does not include elements that do not have the element as a descendant" ); var multipleHas = jQuery("#main").has("#sndp, #first"); same( multipleHas.get(), q("main"), "Only adds elements once" ); }); test("has(Arrayish)", function() { expect(3); var simple = jQuery("#main").has(jQuery("#sndp")); same( simple.get(), q("main"), "Keeps elements that have any element in the jQuery list as a descendant" ); var multipleParent = jQuery("#main, #header").has(jQuery("#sndp")); same( multipleParent.get(), q("main"), "Does not include elements that do not have an element in the jQuery list as a descendant" ); var multipleHas = jQuery("#main").has(jQuery("#sndp, #first")); same( simple.get(), q("main"), "Only adds elements once" ); }); test("andSelf()", function() { expect(4); same( jQuery("#en").siblings().andSelf().get(), q("sndp", "en", "sap"), "Check for siblings and self" ); same( jQuery("#foo").children().andSelf().get(), q("foo", "sndp", "en", "sap"), "Check for children and self" ); same( jQuery("#sndp, #en").parent().andSelf().get(), q("foo","sndp","en"), "Check for parent and self" ); same( jQuery("#groups").parents("p, div").andSelf().get(), q("main", "ap", "groups"), "Check for parents and self" ); }); test("siblings([String])", function() { expect(5); same( jQuery("#en").siblings().get(), q("sndp", "sap"), "Check for siblings" ); same( jQuery("#sndp").siblings(":has(code)").get(), q("sap"), "Check for filtered siblings (has code child element)" ); same( jQuery("#sndp").siblings(":has(a)").get(), q("en", "sap"), "Check for filtered siblings (has anchor child element)" ); same( jQuery("#foo").siblings("form, b").get(), q("form", "floatTest", "lengthtest", "name-tests", "testForm"), "Check for multiple filters" ); var set = q("sndp", "en", "sap"); same( jQuery("#en, #sndp").siblings().get(), set, "Check for unique results from siblings" ); }); test("children([String])", function() { expect(3); same( jQuery("#foo").children().get(), q("sndp", "en", "sap"), "Check for children" ); same( jQuery("#foo").children(":has(code)").get(), q("sndp", "sap"), "Check for filtered children" ); same( jQuery("#foo").children("#en, #sap").get(), q("en", "sap"), "Check for multiple filters" ); }); test("parent([String])", function() { expect(5); equals( jQuery("#groups").parent()[0].id, "ap", "Simple parent check" ); equals( jQuery("#groups").parent("p")[0].id, "ap", "Filtered parent check" ); equals( jQuery("#groups").parent("div").length, 0, "Filtered parent check, no match" ); equals( jQuery("#groups").parent("div, p")[0].id, "ap", "Check for multiple filters" ); same( jQuery("#en, #sndp").parent().get(), q("foo"), "Check for unique results from parent" ); }); test("parents([String])", function() { expect(5); equals( jQuery("#groups").parents()[0].id, "ap", "Simple parents check" ); equals( jQuery("#groups").parents("p")[0].id, "ap", "Filtered parents check" ); equals( jQuery("#groups").parents("div")[0].id, "main", "Filtered parents check2" ); same( jQuery("#groups").parents("p, div").get(), q("ap", "main"), "Check for multiple filters" ); same( jQuery("#en, #sndp").parents().get(), q("foo", "main", "dl", "body", "html"), "Check for unique results from parents" ); }); test("parentsUntil([String])", function() { expect(9); var parents = jQuery("#groups").parents(); same( jQuery("#groups").parentsUntil().get(), parents.get(), "parentsUntil with no selector (nextAll)" ); same( jQuery("#groups").parentsUntil(".foo").get(), parents.get(), "parentsUntil with invalid selector (nextAll)" ); same( jQuery("#groups").parentsUntil("#html").get(), parents.not(':last').get(), "Simple parentsUntil check" ); equals( jQuery("#groups").parentsUntil("#ap").length, 0, "Simple parentsUntil check" ); same( jQuery("#groups").parentsUntil("#html, #body").get(), parents.slice( 0, 3 ).get(), "Less simple parentsUntil check" ); same( jQuery("#groups").parentsUntil("#html", "div").get(), jQuery("#main").get(), "Filtered parentsUntil check" ); same( jQuery("#groups").parentsUntil("#html", "p,div,dl").get(), parents.slice( 0, 3 ).get(), "Multiple-filtered parentsUntil check" ); equals( jQuery("#groups").parentsUntil("#html", "span").length, 0, "Filtered parentsUntil check, no match" ); same( jQuery("#groups, #ap").parentsUntil("#html", "p,div,dl").get(), parents.slice( 0, 3 ).get(), "Multi-source, multiple-filtered parentsUntil check" ); }); test("next([String])", function() { expect(4); equals( jQuery("#ap").next()[0].id, "foo", "Simple next check" ); equals( jQuery("#ap").next("div")[0].id, "foo", "Filtered next check" ); equals( jQuery("#ap").next("p").length, 0, "Filtered next check, no match" ); equals( jQuery("#ap").next("div, p")[0].id, "foo", "Multiple filters" ); }); test("prev([String])", function() { expect(4); equals( jQuery("#foo").prev()[0].id, "ap", "Simple prev check" ); equals( jQuery("#foo").prev("p")[0].id, "ap", "Filtered prev check" ); equals( jQuery("#foo").prev("div").length, 0, "Filtered prev check, no match" ); equals( jQuery("#foo").prev("p, div")[0].id, "ap", "Multiple filters" ); }); test("nextAll([String])", function() { expect(4); var elems = jQuery('#form').children(); same( jQuery("#label-for").nextAll().get(), elems.not(':first').get(), "Simple nextAll check" ); same( jQuery("#label-for").nextAll('input').get(), elems.not(':first').filter('input').get(), "Filtered nextAll check" ); same( jQuery("#label-for").nextAll('input,select').get(), elems.not(':first').filter('input,select').get(), "Multiple-filtered nextAll check" ); same( jQuery("#label-for, #hidden1").nextAll('input,select').get(), elems.not(':first').filter('input,select').get(), "Multi-source, multiple-filtered nextAll check" ); }); test("prevAll([String])", function() { expect(4); var elems = jQuery( jQuery('#form').children().slice(0, 12).get().reverse() ); same( jQuery("#area1").prevAll().get(), elems.get(), "Simple prevAll check" ); same( jQuery("#area1").prevAll('input').get(), elems.filter('input').get(), "Filtered prevAll check" ); same( jQuery("#area1").prevAll('input,select').get(), elems.filter('input,select').get(), "Multiple-filtered prevAll check" ); same( jQuery("#area1, #hidden1").prevAll('input,select').get(), elems.filter('input,select').get(), "Multi-source, multiple-filtered prevAll check" ); }); test("nextUntil([String])", function() { expect(11); var elems = jQuery('#form').children().slice( 2, 12 ); same( jQuery("#text1").nextUntil().get(), jQuery("#text1").nextAll().get(), "nextUntil with no selector (nextAll)" ); same( jQuery("#text1").nextUntil(".foo").get(), jQuery("#text1").nextAll().get(), "nextUntil with invalid selector (nextAll)" ); same( jQuery("#text1").nextUntil("#area1").get(), elems.get(), "Simple nextUntil check" ); equals( jQuery("#text1").nextUntil("#text2").length, 0, "Simple nextUntil check" ); same( jQuery("#text1").nextUntil("#area1, #radio1").get(), jQuery("#text1").next().get(), "Less simple nextUntil check" ); same( jQuery("#text1").nextUntil("#area1", "input").get(), elems.not("button").get(), "Filtered nextUntil check" ); same( jQuery("#text1").nextUntil("#area1", "button").get(), elems.not("input").get(), "Filtered nextUntil check" ); same( jQuery("#text1").nextUntil("#area1", "button,input").get(), elems.get(), "Multiple-filtered nextUntil check" ); equals( jQuery("#text1").nextUntil("#area1", "div").length, 0, "Filtered nextUntil check, no match" ); same( jQuery("#text1, #hidden1").nextUntil("#area1", "button,input").get(), elems.get(), "Multi-source, multiple-filtered nextUntil check" ); same( jQuery("#text1").nextUntil("[class=foo]").get(), jQuery("#text1").nextAll().get(), "Non-element nodes must be skipped, since they have no attributes" ); }); test("prevUntil([String])", function() { expect(10); var elems = jQuery("#area1").prevAll(); same( jQuery("#area1").prevUntil().get(), elems.get(), "prevUntil with no selector (prevAll)" ); same( jQuery("#area1").prevUntil(".foo").get(), elems.get(), "prevUntil with invalid selector (prevAll)" ); same( jQuery("#area1").prevUntil("label").get(), elems.not(':last').get(), "Simple prevUntil check" ); equals( jQuery("#area1").prevUntil("#button").length, 0, "Simple prevUntil check" ); same( jQuery("#area1").prevUntil("label, #search").get(), jQuery("#area1").prev().get(), "Less simple prevUntil check" ); same( jQuery("#area1").prevUntil("label", "input").get(), elems.not(':last').not("button").get(), "Filtered prevUntil check" ); same( jQuery("#area1").prevUntil("label", "button").get(), elems.not(':last').not("input").get(), "Filtered prevUntil check" ); same( jQuery("#area1").prevUntil("label", "button,input").get(), elems.not(':last').get(), "Multiple-filtered prevUntil check" ); equals( jQuery("#area1").prevUntil("label", "div").length, 0, "Filtered prevUntil check, no match" ); same( jQuery("#area1, #hidden1").prevUntil("label", "button,input").get(), elems.not(':last').get(), "Multi-source, multiple-filtered prevUntil check" ); }); test("contents()", function() { expect(12); equals( jQuery("#ap").contents().length, 9, "Check element contents" ); ok( jQuery("#iframe").contents()[0], "Check existance of IFrame document" ); var ibody = jQuery("#loadediframe").contents()[0].body; ok( ibody, "Check existance of IFrame body" ); equals( jQuery("span", ibody).text(), "span text", "Find span in IFrame and check its text" ); jQuery(ibody).append("<div>init text</div>"); equals( jQuery("div", ibody).length, 2, "Check the original div and the new div are in IFrame" ); equals( jQuery("div:last", ibody).text(), "init text", "Add text to div in IFrame" ); jQuery("div:last", ibody).text("div text"); equals( jQuery("div:last", ibody).text(), "div text", "Add text to div in IFrame" ); jQuery("div:last", ibody).remove(); equals( jQuery("div", ibody).length, 1, "Delete the div and check only one div left in IFrame" ); equals( jQuery("div", ibody).text(), "span text", "Make sure the correct div is still left after deletion in IFrame" ); jQuery("<table/>", ibody).append("<tr><td>cell</td></tr>").appendTo(ibody); jQuery("table", ibody).remove(); equals( jQuery("div", ibody).length, 1, "Check for JS error on add and delete of a table in IFrame" ); // using contents will get comments regular, text, and comment nodes var c = jQuery("#nonnodes").contents().contents(); equals( c.length, 1, "Check node,textnode,comment contents is just one" ); equals( c[0].nodeValue, "hi", "Check node,textnode,comment contents is just the one from span" ); }); test("add(String|Element|Array|undefined)", function() { expect(16); same( jQuery("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" ); same( jQuery("#sndp").add( jQuery("#en")[0] ).add( jQuery("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" ); ok( jQuery([]).add(jQuery("#form")[0].elements).length >= 13, "Check elements from array" ); // For the time being, we're discontinuing support for jQuery(form.elements) since it's ambiguous in IE // use jQuery([]).add(form.elements) instead. //equals( jQuery([]).add(jQuery("#form")[0].elements).length, jQuery(jQuery("#form")[0].elements).length, "Array in constructor must equals array in add()" ); var divs = jQuery("<div/>").add("#sndp"); ok( !divs[0].parentNode, "Make sure the first element is still the disconnected node." ); divs = jQuery("<div>test</div>").add("#sndp"); equals( divs[0].parentNode.nodeType, 11, "Make sure the first element is still the disconnected node." ); divs = jQuery("#sndp").add("<div/>"); ok( !divs[1].parentNode, "Make sure the first element is still the disconnected node." ); var tmp = jQuery("<div/>"); var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>").appendTo(tmp)).add(jQuery("<p id='x2'>xxx</p>").appendTo(tmp)); equals( x[0].id, "x1", "Check on-the-fly element1" ); equals( x[1].id, "x2", "Check on-the-fly element2" ); var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>").appendTo(tmp)[0]).add(jQuery("<p id='x2'>xxx</p>").appendTo(tmp)[0]); equals( x[0].id, "x1", "Check on-the-fly element1" ); equals( x[1].id, "x2", "Check on-the-fly element2" ); var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>")).add(jQuery("<p id='x2'>xxx</p>")); equals( x[0].id, "x1", "Check on-the-fly element1" ); equals( x[1].id, "x2", "Check on-the-fly element2" ); var x = jQuery([]).add("<p id='x1'>xxx</p>").add("<p id='x2'>xxx</p>"); equals( x[0].id, "x1", "Check on-the-fly element1" ); equals( x[1].id, "x2", "Check on-the-fly element2" ); var notDefined; equals( jQuery([]).add(notDefined).length, 0, "Check that undefined adds nothing" ); ok( jQuery([]).add( document.getElementById('form') ).length >= 13, "Add a form (adds the elements)" ); }); test("add(String, Context)", function() { expect(6); equals( jQuery(document).add("#form").length, 2, "Make sure that using regular context document still works." ); equals( jQuery(document.body).add("#form").length, 2, "Using a body context." ); equals( jQuery(document.body).add("#html").length, 1, "Using a body context." ); equals( jQuery(document).add("#form", document).length, 2, "Use a passed in document context." ); equals( jQuery(document).add("#form", document.body).length, 2, "Use a passed in body context." ); equals( jQuery(document).add("#html", document.body).length, 1, "Use a passed in body context." ); });
var kmval = {}; kmval.validationChecks = { num : /^[\-]{0,1}[0-9]+(\.[0-9]{1,12})?$/, int : /^[\-]{0,1}[0-9]+$/, bit : /^[01]$/, guid : /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i, email : /^[a-zA-Z0-9.!#$%&’*+\=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/, // W3C HTML5 spec (methinks) username : /^[a-z0-9]{3,20}$/i, password : /^.{5,50}$/, grmobile : /^69[0-9]{8}$/, grzip : /^[1-9]{1}[0-9]{4}$/, // Greek zipcode because... blah grdoy : /^[1-9]{1}[0-9]{3}$/, // Greek DOY Code - actually just a 4-digit ID vatno : /^[0-9]{9}$/, // This is the Greek VAT No. Actually it should be checked more thoroughly, but let's just with the "only 9 digits" rule anystring : /^.+$/, }; /** * Validation Rule object * @param {string|function} value - The value to be validated, or a function returning it * @param {function|RegExp|any} rule - A RegExp that can be one of the pre-defined rules, or a custom one. Alternatively, it may be a value or function returning a RegExp object or an exact value * @param {boolean} required - Whether the value is required or not (because may not be required, but still needs to follow validation rules if supplied) * @param {string|object} element - The selector or jQuery object of the element that holds the value. Needed if we have no value passed * @param {string|object|array} css - The css class to apply when there is a problem * @param {object|object[]} linked - A validationRule or array of validationRule objects that also need to be true, for the current validation to pass * */ kmval.validationRule = function ( value, rule, required, element, css, linked ) { this.value = value; this.rule = rule; this.required = required; this.element = element; this.css = css; this.linked = linked; }; /** * Runs a RegExp-based check on values * @param {object} rule - The validation rule to run. Should be a valid validationRule object * @param {boolean} retvalue - If the test is successful, defines whether to return the value (when true) or a true/false result */ kmval.validateInput = function ( rule, retvalue ) { var res; var $el; retvalue = retvalue || false; if ( rule.element ) { $el = rule.element.constructor === String ? $(rule.element) : rule.element; // if we've been given a string, convert to jQuery object if ($el.length > 1) { // make sure we're working with only one element // radiobuttons need to be handled differently since the selector may return an array of them // normally we should be more strict, but lets base our 'is-it-a-radio' check only on the first element for now if ($el.first().prop('type') === 'radio') { // select the checked one // or if none is checked, return nothing $el = $el.filter(':checked'); //$el = undefined; } else { $el = $el.first(); } } } if (rule.value && rule.value.constructor === Function) { // function as a value rule.value = rule.value(); // execute function and feed the result back into the value } if (( rule.value === undefined ) && $el) { // no value was given, get it 'live' from the element (through jquery .val()) rule.value = $el.val(); } if ( rule.required && !rule.value ) // value is required but empty { res = false; } else if ( !rule.required && !rule.value ) // value is not required and empty { res = true; } else { // required or not, value is validated if (rule.rule.constructor === Function) { // function as a rule - needs to return a RegExp rule.rule = rule.rule(rule.value); // execute function and feed the result back into the rule } if (rule.rule.constructor === RegExp) { // object is treated as RegExp, so test against it res = rule.rule.test( rule.value ); } else { // not an object, so check for exact value match res = rule.rule === rule.value; } } // if the result is an error, css-process it (set 'on') // if all is good, remove any css from previous attempts (set 'off) kmval.setValidationCSS( !res ? 'on' : 'off' , rule, $el ); //------------------------------ if ( !res ) { return false; } return ( retvalue ? rule.value : true ); }; /** * Adds or removes the a rule's css classes to a specified element * @param {string} onoff - Set to 'on' if the rules should be added, or 'off' if they should be removed * @param {object} rule - The related rule object * @param {object} $el - The jQuery object for the related element */ kmval.setValidationCSS = function ( onoff, rule, $el) { var add = onoff === 'on' ? true : false; if ( rule.css && rule.css.constructor === Array ) { for (var e = 0; e < rule.css.length; e++) { $el = $(rule.css[e].el); if (add) { $el.addClass( rule.css[e].css ); } else { $el.removeClass( rule.css[e].css ); } } } if ( rule.css && rule.css.constructor === Object ) { if (add) { $(rule.css.el).addClass( rule.css.css ); } else { $(rule.css.el).removeClass( rule.css.css ); } } if ( rule.css && rule.css.constructor === String && $el ) { if (add) { $el.addClass( rule.css ); } else { $el.removeClass( rule.css ); } } }; /** * Runs a RegExp-based check on a given form, based on a rules object * @param {Array} objChecks - Array of 'check' objects describing the validation logic */ kmval.validateForm = function ( arChecks, stopAtFirst ) { if (typeof arChecks === 'undefined' || arChecks.length === 0) { return false; } var chk = {}; // copy of rule element so that we don't mess up the original object var res; var ret = true; var $el; var evnt = ''; stopAtFirst = stopAtFirst || false; for (var i = 0; i < arChecks.length; i++) { // create the copy chk = { value: arChecks[i].value, rule: arChecks[i].rule, required: arChecks[i].required, element: arChecks[i].element, css: arChecks[i].css, linked: arChecks[i].linked, }; res = kmval.validateInput( chk ); if (!res) { // for debugging info only console.log('Check failed for ' + JSON.stringify( chk )); ret = false; $el = ( arChecks[i].element.constructor === jQuery ? arChecks[i].element : $(arChecks[i].element) ); // add jQuery event to reset css on keypress (since the data is being changed and as such validation result is obsolete) // we namespace the event as 'pgval', in order to access it later on without messing up any other handlers // like before we check (based on the first element in case of an array), if we got a radiobutton or a checkbox // we need to do this because these two are more likely to be changed using a mouse instead of the keyboard if ($el.first().prop('type') === 'radio' || $el.first().prop('type') === 'checkbox') { evnt = 'change.pgval'; } else { evnt = 'keydown.pgval'; } $el.on(evnt, chk, function(event) { // reset any validation css kmval.setValidationCSS( 'off', event.data, $(this) ); // remove event so it doesn't fire again $(this).off(evnt); }); if (stopAtFirst) return false; } } return ret; }; kmval.resetForm = function ( arChecks ) { var $el, chk = {}; if (typeof arChecks === 'undefined' || arChecks.length === 0) { return false; } for (var i = 0; i < arChecks.length; i++) { // create the copy chk = { value: arChecks[i].value, rule: arChecks[i].rule, required: arChecks[i].required, element: arChecks[i].element, css: arChecks[i].css, linked: arChecks[i].linked, }; $el = ( arChecks[i].element.constructor === jQuery ? arChecks[i].element : $(arChecks[i].element) ); kmval.setValidationCSS( 'off', chk, $el ); } }; // For my friend MS... Cheers mate
/** * ### Search plugin * * Adds search functionality to jsTree. */ /*globals jQuery, define, exports, require, document */ (function (factory) { "use strict"; if (typeof define === 'function' && define.amd) { define('jstree.search', ['jquery','jstree'], factory); } else if(typeof exports === 'object') { factory(require('jquery'), require('jstree')); } else { factory(jQuery, jQuery.jstree); } }(function ($, jstree, undefined) { "use strict"; if($.jstree.plugins.search) { return; } /** * stores all defaults for the search plugin * @name $.jstree.defaults.search * @plugin search */ $.jstree.defaults.search = { /** * a jQuery-like AJAX config, which jstree uses if a server should be queried for results. * * A `str` (which is the search string) parameter will be added with the request. The expected result is a JSON array with nodes that need to be opened so that matching nodes will be revealed. * Leave this setting as `false` to not query the server. * @name $.jstree.defaults.search.ajax * @plugin search */ ajax : false, /** * Indicates if the search should be fuzzy or not (should `chnd3` match `child node 3`). Default is `true`. * @name $.jstree.defaults.search.fuzzy * @plugin search */ fuzzy : true, /** * Indicates if the search should be case sensitive. Default is `false`. * @name $.jstree.defaults.search.case_sensitive * @plugin search */ case_sensitive : false, /** * Indicates if the tree should be filtered to show only matching nodes (keep in mind this can be a heavy on large trees in old browsers). Default is `false`. * @name $.jstree.defaults.search.show_only_matches * @plugin search */ show_only_matches : false, /** * Indicates if all nodes opened to reveal the search result, should be closed when the search is cleared or a new search is performed. Default is `true`. * @name $.jstree.defaults.search.close_opened_onclear * @plugin search */ close_opened_onclear : true }; $.jstree.plugins.search = function (options, parent) { this.bind = function () { parent.bind.call(this); this._data.search.str = ""; this._data.search.dom = $(); this._data.search.res = []; this._data.search.opn = []; if(this.settings.search.show_only_matches) { this.element .on("search.jstree", function (e, data) { if(data.nodes.length) { $(this).find("li").hide().filter('.jstree-last').filter(function() { return this.nextSibling; }).removeClass('jstree-last'); data.nodes.parentsUntil(".jstree").addBack().show() .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); }); } }) .on("clear_search.jstree", function (e, data) { if(data.nodes.length) { $(this).find("li").css("display","").filter('.jstree-last').filter(function() { return this.nextSibling; }).removeClass('jstree-last'); } }); } }; /** * used to search the tree nodes for a given string * @name search(str [, skip_async]) * @param {String} str the search string * @param {Boolean} skip_async if set to true server will not be queried even if configured * @plugin search * @trigger search.jstree */ this.search = function (str, skip_async) { if(str === false || $.trim(str) === "") { return this.clear_search(); } var s = this.settings.search, a = s.ajax ? $.extend({}, s.ajax) : false, f = null, r = [], p = [], i, j; if(this._data.search.res.length) { this.clear_search(); } if(!skip_async && a !== false) { if(!a.data) { a.data = {}; } a.data.str = str; return $.ajax(s.ajax).done($.proxy(function (d) { this._search_load(d, str); }, this)); } this._data.search.str = str; this._data.search.dom = $(); this._data.search.res = []; this._data.search.opn = []; f = new $.vakata.search(str, true, { caseSensitive : s.case_sensitive, fuzzy : s.fuzzy }); $.each(this._model.data, function (i, v) { if(v.text && f.search(v.text).isMatch) { r.push(i); p = p.concat(v.parents); } }); if(r.length) { p = $.vakata.array_unique(p); this._search_open(p); for(i = 0, j = r.length; i < j; i++) { f = this.get_node(r[i], true); if(f) { this._data.search.dom = this._data.search.dom.add(f); } } this._data.search.res = r; this._data.search.dom.children(".jstree-anchor").addClass('jstree-search'); } /** * triggered after search is complete * @event * @name search.jstree * @param {jQuery} nodes a jQuery collection of matching nodes * @param {String} str the search string * @param {Array} res a collection of objects represeing the matching nodes * @plugin search */ this.trigger('search', { nodes : this._data.search.dom, str : str, res : this._data.search.res }); }; /** * used to clear the last search (removes classes and shows all nodes if filtering is on) * @name clear_search() * @plugin search * @trigger clear_search.jstree */ this.clear_search = function () { this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search"); if(this.settings.search.close_opened_onclear) { this.close_node(this._data.search.opn, 0); } /** * triggered after search is complete * @event * @name clear_search.jstree * @param {jQuery} nodes a jQuery collection of matching nodes (the result from the last search) * @param {String} str the search string (the last search string) * @param {Array} res a collection of objects represeing the matching nodes (the result from the last search) * @plugin search */ this.trigger('clear_search', { 'nodes' : this._data.search.dom, str : this._data.search.str, res : this._data.search.res }); this._data.search.str = ""; this._data.search.res = []; this._data.search.opn = []; this._data.search.dom = $(); }; /** * opens nodes that need to be opened to reveal the search results. Used only internally. * @private * @name _search_open(d) * @param {Array} d an array of node IDs * @plugin search */ this._search_open = function (d) { var t = this; $.each(d.concat([]), function (i, v) { v = document.getElementById(v); if(v) { if(t.is_closed(v)) { t._data.search.opn.push(v.id); t.open_node(v, function () { t._search_open(d); }, 0); } } }); }; /** * loads nodes that need to be opened to reveal the search results. Used only internally. * @private * @name _search_load(d, str) * @param {Array} d an array of node IDs * @param {String} str the search string * @plugin search */ this._search_load = function (d, str) { var res = true, t = this, m = t._model.data; $.each(d.concat([]), function (i, v) { if(m[v]) { if(!m[v].state.loaded) { t.load_node(v, function () { t._search_load(d, str); }); res = false; } } }); if(res) { this.search(str, true); } }; }; // helpers (function ($) { // from http://kiro.me/projects/fuse.html $.vakata.search = function(pattern, txt, options) { options = options || {}; if(options.fuzzy !== false) { options.fuzzy = true; } pattern = options.caseSensitive ? pattern : pattern.toLowerCase(); var MATCH_LOCATION = options.location || 0, MATCH_DISTANCE = options.distance || 100, MATCH_THRESHOLD = options.threshold || 0.6, patternLen = pattern.length, matchmask, pattern_alphabet, match_bitapScore, search; if(patternLen > 32) { options.fuzzy = false; } if(options.fuzzy) { matchmask = 1 << (patternLen - 1); pattern_alphabet = (function () { var mask = {}, i = 0; for (i = 0; i < patternLen; i++) { mask[pattern.charAt(i)] = 0; } for (i = 0; i < patternLen; i++) { mask[pattern.charAt(i)] |= 1 << (patternLen - i - 1); } return mask; }()); match_bitapScore = function (e, x) { var accuracy = e / patternLen, proximity = Math.abs(MATCH_LOCATION - x); if(!MATCH_DISTANCE) { return proximity ? 1.0 : accuracy; } return accuracy + (proximity / MATCH_DISTANCE); }; } search = function (text) { text = options.caseSensitive ? text : text.toLowerCase(); if(pattern === text || text.indexOf(pattern) !== -1) { return { isMatch: true, score: 0 }; } if(!options.fuzzy) { return { isMatch: false, score: 1 }; } var i, j, textLen = text.length, scoreThreshold = MATCH_THRESHOLD, bestLoc = text.indexOf(pattern, MATCH_LOCATION), binMin, binMid, binMax = patternLen + textLen, lastRd, start, finish, rd, charMatch, score = 1, locations = []; if (bestLoc !== -1) { scoreThreshold = Math.min(match_bitapScore(0, bestLoc), scoreThreshold); bestLoc = text.lastIndexOf(pattern, MATCH_LOCATION + patternLen); if (bestLoc !== -1) { scoreThreshold = Math.min(match_bitapScore(0, bestLoc), scoreThreshold); } } bestLoc = -1; for (i = 0; i < patternLen; i++) { binMin = 0; binMid = binMax; while (binMin < binMid) { if (match_bitapScore(i, MATCH_LOCATION + binMid) <= scoreThreshold) { binMin = binMid; } else { binMax = binMid; } binMid = Math.floor((binMax - binMin) / 2 + binMin); } binMax = binMid; start = Math.max(1, MATCH_LOCATION - binMid + 1); finish = Math.min(MATCH_LOCATION + binMid, textLen) + patternLen; rd = new Array(finish + 2); rd[finish + 1] = (1 << i) - 1; for (j = finish; j >= start; j--) { charMatch = pattern_alphabet[text.charAt(j - 1)]; if (i === 0) { rd[j] = ((rd[j + 1] << 1) | 1) & charMatch; } else { rd[j] = ((rd[j + 1] << 1) | 1) & charMatch | (((lastRd[j + 1] | lastRd[j]) << 1) | 1) | lastRd[j + 1]; } if (rd[j] & matchmask) { score = match_bitapScore(i, j - 1); if (score <= scoreThreshold) { scoreThreshold = score; bestLoc = j - 1; locations.push(bestLoc); if (bestLoc > MATCH_LOCATION) { start = Math.max(1, 2 * MATCH_LOCATION - bestLoc); } else { break; } } } } if (match_bitapScore(i + 1, MATCH_LOCATION) > scoreThreshold) { break; } lastRd = rd; } return { isMatch: bestLoc >= 0, score: score }; }; return txt === true ? { 'search' : search } : search(txt); }; }(jQuery)); // include the search plugin by default // $.jstree.defaults.plugins.push("search"); }));
'use strict'; module.exports = NotificationController; NotificationController.$inject = ['NotificationService', 'UsersService', '$uibModal', '$scope', 'toaster', '$state']; function NotificationController(NotificationService, UsersService, $uibModal, $scope, toaster, $state) { /************************************************ * VARIABLES ************************************************/ var vm = this; vm.messages = []; vm.user = null; vm.messagesState = "1"; vm.inboxMessages = []; vm.archivedMessages = []; vm.isCollapsed = true; /************************************************ * METHODS ************************************************/ vm.getNotification = getNotifications; vm.viewNotification = viewNotification; vm.archiveMessage = archiveMessage; vm.unarchiveMessage = unarchiveMessage; function init() { getNotifications(); getUserInfo(); } /** * @name getNotification * @description gets the notifications */ function getNotifications() { vm.inboxMessages = []; vm.archivedMessages = []; NotificationService.getNotificationAll().then(function (response) { if (!!response.data.data.notifications.length) { var notificationList = response.data.data.notifications; notificationList.forEach(function (notification) { console.log(notification); notification.date = moment(notification.date).format('DD-MM-YYYY'); if (notification.status === '0' || notification.status === '1') vm.inboxMessages.push(notification); else vm.archivedMessages.push(notification); }); } }); } function viewNotification(notification) { $state.go("notification_detail", { id: notification.id }); } /** * @name archiveMessage * @description change the state of a message to archived * @param _notification */ function archiveMessage(_notification) { NotificationService.updateNotification(_notification.id, 2).then(function () { getNotification(); }); } /** * @name archiveMessage * @description change the state of a message to archived * @param _notification */ function unarchiveMessage(_notification) { NotificationService.updateNotification(_notification.id, 1).then(function () { getNotification(); }); } /** * @name getUserInfo * @description Gets user info */ function getUserInfo() { UsersService.getUserInfo().then(_setUserInfo); /** * @name _setUserInfo * @description gets the user info * @param response * @private */ function _setUserInfo(response) { vm.user = response.data.data.user; } } init(); }
var BASE_URL = require('../base_url'); var KEYWORDS_URL = BASE_URL + '/title/%s/keywords?ref_=tt_stry_kw'; var cheerio = require('cheerio'); var format = require('util').format; /** * Parse keywords from keywords page of a movie * @param {string} body keywords html page * @return {array} keywords */ function parse_keywords (body) { var $ = cheerio.load(body); var keywords = []; var anchors = $('#keywords_content a'); anchors.each(function (index, element) { var path = $(this).attr('href'); keywords.push({ name: $(this).text(), href: BASE_URL + path, id: path.split(/\?|\//)[2] }); }); return keywords; } module.exports = { url: function (imdb_id) { return format(KEYWORDS_URL, imdb_id); }, jobs: [ { key: 'keywords', parse_method: parse_keywords } ] };
"use strict"; var core_1 = require("@angular/core"); exports.CONFIG_INITIALIZER = new core_1.OpaqueToken('Config initializer'); function ConfigInitializer(config) { var reflect = window['Reflect']; var getOwnMetadata = reflect.getOwnMetadata; var defineMetadata = reflect.defineMetadata; return function ConfigInitializerDecorator(targetConstructor) { var metaInformation = getOwnMetadata('annotations', targetConstructor); var propMetaInformation = getOwnMetadata('propMetadata', targetConstructor); var designParamtypesInformation = getOwnMetadata('design:paramtypes', targetConstructor); var parametersInformation = getOwnMetadata('parameters', targetConstructor); function newConstructor(configInitializer) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } configInitializer(config); return targetConstructor.apply(this, args); } defineMetadata('annotations', metaInformation, newConstructor); defineMetadata('propMetadata', propMetaInformation, newConstructor); defineMetadata('parameters', parametersInformation, newConstructor); defineMetadata('design:paramtypes', [ new core_1.Inject(exports.CONFIG_INITIALIZER) ].concat(designParamtypesInformation), newConstructor); newConstructor.prototype = targetConstructor.prototype; return newConstructor; }; } exports.ConfigInitializer = ConfigInitializer; //# sourceMappingURL=index.js.map
export * from "./users"; export * from "./claims"; export * from "./links"; export * from "./tokens"; //# sourceMappingURL=index.js.map
'use strict'; /** * Module dependencies. */ var should = require('should'), mongoose = require('mongoose'), User = mongoose.model('User'), Stockrecord = mongoose.model('Stockrecord'); /** * Globals */ var user, stockrecord; /** * Unit tests */ describe('Stockrecord Model Unit Tests:', function() { beforeEach(function(done) { user = new User({ firstName: 'Full', lastName: 'Name', displayName: 'Full Name', email: 'test@test.com', username: 'username', password: 'password' }); user.save(function() { stockrecord = new Stockrecord({ // Add model fields // ... }); done(); }); }); describe('Method Save', function() { it('should be able to save without problems', function(done) { return stockrecord.save(function(err) { should.not.exist(err); done(); }); }); }); afterEach(function(done) { Stockrecord.remove().exec(); User.remove().exec(); done(); }); });
import chai from 'chai'; import isUUID from 'chai-uuid'; import models from '../../models'; import modelMock from '../modelMock.json'; chai.use(isUUID); const expect = chai.expect; const Archives = models.Archives; const { validArchive, inValidArchive } = modelMock; describe('Archive Model', () => { describe('Properties and Associations:', () => { const archive = new Archives(validArchive); it('should be an instance of Archives model', () => { expect(archive).to.be.an.instanceof(Archives); }); it('should be an instance of Sequelize.Model', () => { expect(archive).to.be.an.instanceof(models.Sequelize.Model); }); it('should have a messageId property', () => { expect(archive).to.have.property('messageId'); }); it('should have an userId property', () => { expect(archive).to.have.property('userId'); }); it('should have a createdAt property', () => { expect(archive).to.have.property('createdAt'); }); it('should have an updatedAt property', () => { expect(archive).to.have.property('updatedAt'); }); it('should define properties from argument to constructor', () => { expect(archive.userId).to.equal(validArchive.userId); expect(archive.messageId).to.equal(validArchive.messageId); }); }); describe('Creating an Archive with invalid attributes', () => { it('should return database error if userId invalid', () => Archives.create({ userId: inValidArchive.userId, messageId: validArchive.messageId }) .catch((errors) => { expect(errors.name).to.equal('SequelizeDatabaseError'); })); it('should return database error if messageId is not valid', () => Archives.create({ userId: validArchive.userId, messageId: inValidArchive.messageId }) .catch((errors) => { expect(errors.name).to.equal('SequelizeDatabaseError'); })); }); describe('Create new Archive and save to database', () => { before((done) => { Archives.create(validArchive) .then(() => { done(); }); }); it('should be written to database without errors', () => Archives.findOne({ where: { userId: validArchive.userId } }) .then((fromDb) => { expect(fromDb.userId).to.equal(validArchive.userId); expect(fromDb.messageId).to.equal(validArchive.messageId); })); }); });
var _msg ={ "$lang": "zh", "app.name": "马克飞象<b>专业版</b>", "app.title": "马克飞象 - 专为印象笔记打造的Markdown编辑器", "app.description": "专为印象笔记打造的Markdown编辑器", "Preparing": "加载中", "Evernote International": "Evernote International", "Link Evernote": "绑定Evernote International账号", "Save Evernote": "保存到Evernote International", "Link account first": "请先绑定账号", "Welcome document": "使用说明", "FAQ": "常见问题", "About": "关于", "Logout": "退出账号", "Settings": "设置", "Link with Evernote": "绑定 Evernote International 账号", "Link with Yinxiang": "绑定印象笔记账号", "CURRENT DOCUMENT": "当前文档", "Delete document": "删除文档", "Donate": "捐赠", "Get Chrome app": "下载离线客户端", "SYSTEM": "系统", "Swtich to basic version": "切换至免费版", "Quick help": "快捷帮助", "Export to disk": "导出 Markdown", "Export to PDF": "导出 PDF", "Preview document": "预览文档", "Back to edit": "返回编辑", "Export as": "导出", "VIP expired": "已过期", "Renew": "续费", "VIP to": "会员至", "Share link": "分享链接", "Stop share": "停止分享", "Search file": "搜索文件", "Open file": "打开文件", "Open in new window": "在新窗口中打开", "Open in Evernote": "在 Evernote 中打开", "Select document": "文档管理", "Sync list from Evernote": "从 Evernote 同步笔记列表", "Key bindings": "键盘模式", "Default layout": "默认布局", "Preview": "预览区", "Editor": "编辑器", "Toolbar": "工具栏", "Note saved in Evernote": "Evernote 中的笔记正文", "With title": "带标题", "With tags": "带标签", "Show line number": "显示行号", "Basic": "常规", "Style": "样式", "Preview font": "文档字体", "Editor font": "编辑器字体", "DEFAULT": "正在使用默认字体", "Code highlight": "代码高亮", "None": "无", "Custom render CSS": "自定义渲染CSS", "FONT_TIP": "示例:Arial, 微软雅黑", "FONT_TIP2": "请使用<a href='http://zh.wikipedia.org/zh/%E7%AD%89%E5%AE%BD%E5%AD%97%E4%BD%93' target='_blank'>等宽字体</a>,否则可能导致光标错位。", "FONT_TIP3": "示例: \"Courier New\", 宋体", "Auto sync": "自动同步", "AUTO_SYNC_HINT": "每10分钟自动同步至 Evernote,以保证数据安全", "FIRST_AUTO_SYNC_TITLE": "提示", "FIRST_AUTO_SYNC_HINT": "当前笔记已经有一段时间未同步到 Evernote,是否立即同步?", "VIM_HINT": "(部分 Markdown 快捷键将变为 Ctrl + Alt + *)", "EMACS_HINT": "(所有 Markdown 快捷键将变为 Ctrl + Alt + *)", "CSS_HINT": "/**\n设置你自己的CSS。例如:\nh1 {\n border-bottom: 1px solid #ccc;\n line-height:1.6;\n}\nbody {\n background:#FDFFD0\n}\n**/\n", "Markdown syntax": "Markdown 语法", "Editor theme": "编辑器主题", "Toggle resize": "切换全屏", "Local draft. Click to sync.": "本地缓存,点击同步", "Syncing": "正在同步", "Synced": "已同步", "Have changes. Click to sync.": "有改动,点击同步", "Readonly mode": "只读模式", "New document": "新建文档", "Profile": "账号", "Cancel": "取消", "OK": "确定", "File Conflict": "文件冲突", "FILE_CONFLICT_MSG": "检测到本地有尚未同步的修改,将打开本地版本。请仔细对比本地与Evernote中的内容,以决定同步或删除本地版本。操作前请做好备份。", "Hyperlink": "插入链接", "Please provide the link URL and an optional title:": "请填写链接URL以及描述(可选):", "Image": "插入图片", "Please provide the image URL:": "请填写图片URL:", "Import local image...": "插入本地图片...", "Delete": "删除文件", "Are you sure you want to delete?": "确定删除<code id='remove-filename'></code>?", "NOTE:": "注意:", "This will not delete the data on Evernote": "如果已同步到Evernote, Evernote中的内容将不会删除", "Sync Note Error": "同步文件失败", "Error code:": "错误码:", "TIP_IMG_INSERT": "马克飞象支持从剪切板直接复制图片,截屏粘贴试试。", "MISSING_IMAGES_HINT": "文档中有图片插入失败,请更正后再保存。有任何问题,请先备份好相关内容,反馈至 hustgock@gmail.com。<blockquote>注:马克飞象从 Evernote 中打开笔记有一定概率载入图片失败,如果是这种情况,请不用着急,删除本地缓存,再次从 Evernote 打开即可。</blockquote>", "Thanks for your support!": "感谢支持!", "Please confirm your payment status:": "请确认刚才的支付结果:", "No, I had problems": "不,我遇到了问题", "Accomplished": "支付成功", "Payment success": "支付成功", "Order No.": "订单号", "Due": "到期时间", "Payment failed?": "支付不成功?", "Sorry, order not found": "抱歉,未找到订单信息", "PAY_FAILED_HINT": "如果支付遇到了问题,或者支付成功后但状态没有更新,请不要着急,可以随时联系 hustgock@gmail.com 人工处理。", "SHARE_LINK_HINT": "公开链接可以让你轻松分享笔记给其他人。", "MESSAGE": { "UNAUTHORIZED_NOTE": "没有权限打开该笔记,请检查账号状态", "ERROR_OPEN_FILE": "打开文件失败", "READONLY_MODE": "检测到该文件正在被另一窗口编辑,开启只读模式", "Syncing": "正在同步", "Downloading image": "下载图片中", "Fail to insert image": "插入图片失败", "NOT_AUTHED": "尚未绑定账号", "Fetching from Evernote": "正在从 Evernote 读取笔记", "Successfully link with Evernote": "绑定账号成功!", "Server error": "服务器内部错误。请联系hustgock@gmail.com", "Loading file": "载入文件中", "EXCEED_NOTE_LIMIT": "超过笔记内容限制", "EXCEED_ACCOUNT_LIMIT": "账户剩余容量不足", "AUTH_ERROR": "Evernote认证错误,请重新绑定账号", "AUTH_EXPIRED": "Evernote认证已过期,请重新绑定账号。", "RATE_LIMIT": "一小时内操作太频繁,请下个整点时刻再重试操作。", "ILLEGAL_CONTENT": "内容含有非法字符", "UNKNOWN": "未知错误", "BAD_DATA_FORMAT": "数据格式有误", "PERMISSION_DENIED": "权限不足", "INTERNAL_ERROR": "内部错误", "DATA_REQUIRED": "缺少必需内容", "Open": "打开", "Waiting": "等待中", "Done": "完成", "Error": "出错了", "SAME_OPEN": "文件已在当前窗口打开", "VIP_EXPIRED": "会员服务已过期,<a href='javascript:void(0)' vine-click='VIP_CHARGE'>请续费</a>。", "TRIAL_COUNT_EXCEED": "试用服务已过期,<a href='javascript:void(0)' vine-click='VIP_CHARGE'>请购买会员服务</a>。", "DB_DAMAGE": "本地缓存数据库已损坏,请及时将文档同步至Evernote,并联系开发者。", "Sync note first.": "请先同步文档。", "BACKEND": "http://app.maxiang.info" } }.MESSAGE var MSG = function(key){ return _msg[key] || key }
import test from 'ava'; import VK from '../'; const app = { clientId: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', redirectUri: 'REDIRECT_URI', scope: ['offline', 'photos'] }; test('pre-site-auth checks', t => { const vk = new VK(); return vk.performSiteAuth().catch(err => { t.ok(err, 'throws when no code provided'); }); }); test('auth url rendering', t => { const vk = new VK(app); t.is(vk.renderAuthUrl(), 'https://oauth.vk.com/authorize?scope=65540&v=5.37&client_id=CLIENT_ID&redirect_uri=REDIRECT_URI', 'auth URL rendered correctly'); t.end(); }); test.serial('site authentication', t => { const vk = new VK(app); return vk.performSiteAuth({code: 'test'}).catch(() => { t.pass('#performSiteAuth() returns Promise'); }); }); test.serial('server authentication', t => { const vk = new VK(app); return vk.performServerAuth().catch(() => { t.pass('#performServerAuth() returns Promise'); }); });
import { reversePalette } from 'styled-theme/composer'; const theme = {}; theme.palette = { primary: ['#1976d2', '#2196f3', '#71bcf7', '#c2e2fb'], secondary: ['#c2185b', '#e91e63', '#f06292', '#f8bbd0'], danger: ['#d32f2f', '#f44336', '#f8877f', '#ffcdd2'], alert: ['#ffa000', '#ffc107', '#ffd761', '#ffecb3'], success: ['#388e3c', '#4caf50', '#7cc47f', '#c8e6c9'], grayscale: ['#212121', '#616161', '#9e9e9e', '#bdbdbd', '#e0e0e0', '#eeeeee', '#ffffff'], white: ['#fff', '#fff', '#eee'], }; theme.reversePalette = reversePalette(theme.palette); theme.fonts = { primary: 'Helvetica Neue, Helvetica, Roboto, sans-serif', pre: 'Consolas, Liberation Mono, Menlo, Courier, monospace', quote: 'Georgia, serif', }; export default theme;
const {EventEmitter} = require('events'); const {StringDecoder} = require('string_decoder'); const defaultShell = require('default-shell'); const {getDecoratedEnv} = require('./plugins'); const {productName, version} = require('./package'); const config = require('./config'); const createNodePtyError = () => new Error( '`node-pty` failed to load. Typically this means that it was built incorrectly. Please check the `readme.md` to more info.' ); let spawn; try { spawn = require('node-pty').spawn; } catch (err) { throw createNodePtyError(); } const envFromConfig = config.getConfig().env || {}; // Max duration to batch session data before sending it to the renderer process. const BATCH_DURATION_MS = 16; // Max size of a session data batch. Note that this value can be exceeded by ~4k // (chunk sizes seem to be 4k at the most) const BATCH_MAX_SIZE = 200 * 1024; // Data coming from the pty is sent to the renderer process for further // vt parsing and rendering. This class batches data to minimize the number of // IPC calls. It also reduces GC pressure and CPU cost: each chunk is prefixed // with the window ID which is then stripped on the renderer process and this // overhead is reduced with batching. class DataBatcher extends EventEmitter { constructor(uid) { super(); this.uid = uid; this.decoder = new StringDecoder('utf8'); this.reset(); } reset() { this.data = this.uid; this.timeout = null; } write(chunk) { if (this.data.length + chunk.length >= BATCH_MAX_SIZE) { // We've reached the max batch size. Flush it and start another one if (this.timeout) { clearTimeout(this.timeout); this.timeout = null; } this.flush(); } this.data += this.decoder.write(chunk); if (!this.timeout) { this.timeout = setTimeout(() => this.flush(), BATCH_DURATION_MS); } } flush() { // Reset before emitting to allow for potential reentrancy const data = this.data; this.reset(); this.emit('flush', data); } } module.exports = class Session extends EventEmitter { constructor(options) { super(); this.pty = null; this.batcher = null; this.shell = null; this.ended = false; this.init(options); } init({uid, rows, cols: columns, cwd, shell, shellArgs}) { const osLocale = require('os-locale'); const baseEnv = Object.assign( {}, process.env, { LANG: osLocale.sync() + '.UTF-8', TERM: 'xterm-256color', COLORTERM: 'truecolor', TERM_PROGRAM: productName, TERM_PROGRAM_VERSION: version }, envFromConfig ); // Electron has a default value for process.env.GOOGLE_API_KEY // We don't want to leak this to the shell // See https://github.com/zeit/hyper/issues/696 if (baseEnv.GOOGLE_API_KEY && process.env.GOOGLE_API_KEY === baseEnv.GOOGLE_API_KEY) { delete baseEnv.GOOGLE_API_KEY; } const defaultShellArgs = ['--login']; try { this.pty = spawn(shell || defaultShell, shellArgs || defaultShellArgs, { cols: columns, rows, cwd, env: getDecoratedEnv(baseEnv) }); } catch (err) { if (/is not a function/.test(err.message)) { throw createNodePtyError(); } else { throw err; } } this.batcher = new DataBatcher(uid); this.pty.on('data', chunk => { if (this.ended) { return; } this.batcher.write(chunk); }); this.batcher.on('flush', data => { this.emit('data', data); }); this.pty.on('exit', () => { if (!this.ended) { this.ended = true; this.emit('exit'); } }); this.shell = shell || defaultShell; } exit() { this.destroy(); } write(data) { if (this.pty) { this.pty.write(data); } else { //eslint-disable-next-line no-console console.warn('Warning: Attempted to write to a session with no pty'); } } resize({cols, rows}) { if (this.pty) { try { this.pty.resize(cols, rows); } catch (err) { //eslint-disable-next-line no-console console.error(err.stack); } } else { //eslint-disable-next-line no-console console.warn('Warning: Attempted to resize a session with no pty'); } } destroy() { if (this.pty) { try { this.pty.kill(); } catch (err) { //eslint-disable-next-line no-console console.error('exit error', err.stack); } } else { //eslint-disable-next-line no-console console.warn('Warning: Attempted to destroy a session with no pty'); } this.emit('exit'); this.ended = true; } };
/* * Module dependencies */ var express = require('express') , stylus = require('stylus') , nib = require('nib') , morgan = require('morgan') , bootstrap = require('bootstrap-stylus') var app = express() function compile(str, path) { return stylus(str) .set('filename', path) .use(nib()) .use(bootstrap()) } app.set('views', __dirname + '/views') app.set('view engine', 'jade') app.use(stylus.middleware( { src: __dirname + '/public' , compile: compile } )) app.use(express.static(__dirname + '/public')) function tinseth(og, boiltime, acid, grams, liters) { var fg = 1.65 * Math.pow(0.000125, og - 1) var ft = (1 - Math.pow(Math.E, -0.04 * boiltime)) / 4.15 var utilization = fg * ft var aau = ((acid / 100) * grams * 1000) / liters return utilization * aau } // Alcohol by volume function abv(og, sg) { return (((og - sg) / 0.75) * 100).toFixed(2) } function asArray(val) { return Array.isArray(val) ? val : [val] } app.get('/calcibu', function (req, res) { var volume = req.query.volume.length === 0 ? 0 : Number(req.query.volume) var og = req.query.og.length === 0 ? 0 : Number(req.query.og) var whops = req.query.weighthops.length === 0 ? [] : asArray(req.query.weighthops).map((v) => Number(v)) var acids = req.query.acid.length === 0 ? [] : asArray(req.query.acid).map((v) => Number(v)) var boiltimes = req.query.boiltime.length === 0 ? [] : asArray(req.query.boiltime).map((v) => Number(v)) var calcs = whops.map((v, i) => tinseth(og, boiltimes[i], acids[i], whops[i], volume)) res.json({ "total" : calcs.reduce((p, c) => p + c, 0).toFixed(2), "calcs" : calcs.map(v => v.toFixed(2)) }) }) app.get('/calcabv', function (req, res) { var og = req.query.og.length === 0 ? 0 : Number(req.query.og) var sg = req.query.sg.length === 0 ? 0 : Number(req.query.sg) res.json({ "total" : abv(og, sg) + "%" }) }) app.get('/abv', function (req, res) { res.render('abv', {title : 'ABV'}) }) app.get('/', function (req, res) { res.render('ibu', {title : 'IBU'}) }) app.listen(3000)
(function(angular, undefined) { 'use strict'; var app = angular.module('nerdamigo.urlStateHelper', []); app.service('$urlStateHelper', [function () { var $urlStateHelperService = this; $urlStateHelperService.unregister = function (aParameter) { console.log('Unregistering ' + aParameter); }; $urlStateHelperService.register = function ($scope, aParameter) { $scope.$on('$destroy', function () { $urlStateHelperService.unregister(aParameter); }); }; return $urlStateHelperService; }]); })(angular);
/** * Tests the ArrayBag object */ 'use strict' const _ = require('underscore') const path = require('path') const mock = { fs: require('mock-fs'), env: require('mock-env') } const assert = require('chai').assert const mockery = require('mockery') const decache = require('decache') const errors = require('../lib/errors') const ArrayBag = require('../lib/arraybag') const util = require('./util') describe('ArrayBag Tests', () => { before(() => { mockery.registerAllowables(['../../lib/arraybag', '../lib/arraybag', './nothere', 'path', 'debug', './errors']) }) after(() => { mockery.deregisterAll() }) let mod = path.resolve("./arraybag.js") let data = { "foo": "bar", "bar": "baz", "baz": "foo" } it ('Should look to the ARRAYBAG environment variable', () => { assert.equal(ArrayBag.FILENAME, "arraybag.js", "Default FILENAME not returned") mock.env.morph(() => { assert.equal(ArrayBag.FILENAME, "config.js", "FILENAME was supposed set through environment") }, {ARRAYBAG: "config.js"}) }) it('Should have getters with defaults', () => { let bag = new ArrayBag() bag.data["foo"] = "bar" assert.equal(bag.get("foo"), "bar") assert.equal(bag.get("bar", "baz"), "baz") assert.throw(() => { bag.get("baz") }, errors.ArrayBagUndefinedKeyError) }) it('Should have setters', () => { let bag = new ArrayBag() bag.data["foo"] = "bar" bag.set("bar", "baz") assert.equal(bag.data["bar"], "baz", "Could not set the key properly") assert.equal(bag.set("bar", "foo"), "baz", "Setting the value Should return the previous value") bag.set("bar") assert.isUndefined(bag.data["bar"], "The value was not deleted properly") assert.isUndefined(bag.data["baz"], "Somehow baz has already been set") }) it('Should allow freezing', () => { let bag = new ArrayBag() bag.data = _.clone(data) bag.freeze() assert(Object.isFrozen(bag.data), "The data was not frozen") assert.throws(() => { bag.data["foo"] = "baz" }, TypeError) assert.throws(() => { delete bag.data["foo"] }, TypeError) assert.throws(() => { bag.set("foo") }, TypeError) assert.throws(() => { bag.set("foo", "baz") }, TypeError) }) it ('Should proxy keys', () => { let bag = new ArrayBag() bag.data = data assert.deepEqual(bag.keys(), Object.keys(data), "Keys are not being proxied properly") let _data = _.clone(data) delete _data["foo"] delete bag.data["foo"] assert.deepEqual(bag.keys(), Object.keys(_data), "Keys Should change as the data object changes") }) it ('Should properly display which keys are available', () => { let bag = new ArrayBag() assert.isUndefined(bag.data["foo"], "Somehow the foo key has been set") assert(!bag.has("foo"), "ArrayBag thinks it has a key that it does not") bag.data["foo"] = "bar" assert(bag.has("foo"), "ArrayBag thinks it does not have a key that it does") }) it ('Should load the arraybag.js file', () => { mockery.enable() mockery.registerSubstitute(mod, util.getMock("arraybag")) let bag = ArrayBag.load() assert.equal(bag.data["foo"], "bar", "Did not properly grab the arraybag file") mockery.deregisterSubstitute(mod) mockery.registerSubstitute(mod, util.getMock("object")) bag = ArrayBag.load() assert.equal(bag.data["foo"], "bar", "Did not properly convert the object file") mockery.deregisterSubstitute(mod) mockery.disable() assert.throws(() => { let bag = ArrayBag.load() }, errors.ArrayBagNotFoundError) }) it ('Should not suppress errors', () => { mockery.enable() mockery.registerSubstitute(mod, util.getMock("syntax-error")) assert.throws(() => { ArrayBag.load() }, SyntaxError) mockery.deregisterSubstitute(mod) // Module not found mockery.registerSubstitute(mod, util.getMock("import-error")) assert.throws(() => { ArrayBag.load() }, Error, "Cannot find module './nothere'") mockery.deregisterSubstitute(mod) mockery.disable() }) it ('Should register arraybags', () => { mockery.enable() mockery.registerSubstitute(mod, util.getMock("object")) decache("../lib/arraybag") let bag = ArrayBag.registry("./") assert.equal(bag.data["foo"], "bar", "Did not register properly") let _bag = ArrayBag.registry("./") assert.equal(bag, _bag, "The bags should be the same from cache") assert(Object.isFrozen(bag.data), "The data was not frozen") assert.throw(() => { bag.data["foo"] = "baz" }, TypeError) mockery.deregisterSubstitute(mod) ArrayBag.invalidate("./") mockery.registerSubstitute(mod, util.getMock("arraybag")) bag = ArrayBag.registry("./", false) assert(!Object.isFrozen(bag.data), "The data was frozen") assert.doesNotThrow(() => { bag.data["foo"] = "baz" }, TypeError) decache('../lib/arraybag') mockery.deregisterSubstitute(mod) mockery.disable() }) })
/** * Cross-Origin Resource Sharing (CORS) Settings * (sails.config.cors) * * CORS is like a more modern version of JSONP-- it allows your server/API * to successfully respond to requests from client-side JavaScript code * running on some other domain (e.g. google.com) * Unlike JSONP, it works with POST, PUT, and DELETE requests * * For more information on CORS, check out: * http://en.wikipedia.org/wiki/Cross-origin_resource_sharing * * Note that any of these settings (besides 'allRoutes') can be changed on a per-route basis * by adding a "cors" object to the route configuration: * * '/get foo': { * controller: 'foo', * action: 'bar', * cors: { * origin: 'http://foobar.com,https://owlhoot.com' * } * } * * For more information on this configuration file, see: * http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.cors.html * */ module.exports.cors = { /*************************************************************************** * * * Allow CORS on all routes by default? If not, you must enable CORS on a * * per-route basis by either adding a "cors" configuration object to the * * route config, or setting "cors:true" in the route config to use the * * default settings below. * * * ***************************************************************************/ // allRoutes: true, /*************************************************************************** * * * Which domains which are allowed CORS access? This can be a * * comma-delimited list of hosts (beginning with http:// or https://) or * * "*" to allow all domains CORS access. * * * ***************************************************************************/ // origin: '*', /*************************************************************************** * * * Allow cookies to be shared for CORS requests? * * * ***************************************************************************/ // credentials: true, /*************************************************************************** * * * Which methods should be allowed for CORS requests? This is only used in * * response to preflight requests (see article linked above for more info) * * * ***************************************************************************/ // methods: 'GET, POST, PUT, DELETE, OPTIONS, HEAD', /*************************************************************************** * * * Which headers should be allowed for CORS requests? This is only used in * * response to preflight requests. * * * ***************************************************************************/ // headers: 'content-type' };
/* eslint-disable */ //@TODO: Add Prepend let instance = null; class TweetStorm { constructor() { if (!instance) { instance = this; } return instance.main; } main(originalText, config = {}) { let { paginationText = `($i/$n)`, ellipses = '...', ellipsesEnabled = true, delimiter = ' ', maxParts = 999, startingCount = 1 } = config; let parts = [], final, remaining = true, text = `${originalText}`; let defaultTemplate = `${ellipses} ${paginationText}`, append = ellipsesEnabled ? defaultTemplate : ` ${paginationText}`, //Add space appendLength = append.length; // return immediately in an array of one tweet if it'll fit into a single tweet if (text.length <= 140) { return [text] }; // offset is n-startingCount, but you cant start from a negative number let offset = (startingCount - 1 >= 0 ? startingCount - 1 : 0); while (remaining && parts.length < maxParts && maxParts !== 0) { /** * Once we've reached a total of 10 chars, our `n` (the total) is now +1 characters * because of the extra place val. But only if our template even has `n`. */ if ((parts.length + offset) === 10 && paginationText.indexOf('$n') !== -1) { appendLength++; } // I don't think it will reach 100, we should put a max of 999 anyway. if ((parts.length + offset) === 100 && paginationText.indexOf('$n') !== -1) { appendLength++; } /** * If it's the last tweet that'll fit in 140-appendLength, then end it here. */ if (text.length <= (140 - appendLength)) { remaining = false; // This is the last piece so +1 index and length. let _paginationText = paginationText.replace('$i', (parts.length + offset + 1)); _paginationText = _paginationText.replace('$n', parts.length + offset+ 1); parts.push(text.concat(` ${_paginationText}`)); break; } // Straight up maximum amount you can fit minus the appendLength let sample = text.substring(0, 140 - appendLength); // Get the index of the last space of the slice let delimIndex = sample.lastIndexOf(delimiter); let slice; // If there isn't a delimiter left, just cut it off at wherever it ends if (delimIndex === -1) { slice = sample; text = text.substring(slice.length); } else { // Get text from the beginning of substring (except chop off the delimiter) until the index of the last space slice = sample.substring(0, delimIndex); // Change what text is for next iteration, chop off delimiter text = text.substring(delimIndex + delimiter.length); } // Push to arr parts.push(slice); } // Change total in append str. append = append.replace('$n', parts.length + offset); // Go through array and append appender. It's 2n but more correct way of doing it. final = parts.map((part, index) => { // Add the counter, except for the last one which we added earlier already. return (index === parts.length - 1 ? part : part.concat(append.replace('$i', index + offset + 1))); }); return final; } } instance = new TweetStorm(); export default instance;
import { createAction } from 'redux-act'; export const signIn = createAction( 'sign in' ); export const signInSuccess = createAction( 'sign in success' ); export const signInFailure = createAction( 'sign in failure' ); export const reducer = { [signIn]: state => ({ ...state, signIn: { ...state.signIn, loading: true, loaded: false } }), [signInSuccess]: state => ({ ...state, signIn: { ...state.signIn, loading: false, loaded: true } }), [signInFailure]: state => ({ ...state, signIn: { ...state.signIn, loading: false, loaded: false } }) };
import {execSync} from 'child_process'; import tryCatch from 'try-catch'; import shortdate from 'shortdate'; import {readPackageUpSync} from 'read-pkg-up'; import buildCommand from './build-command.js'; export default (versionNew) => { const [error, {packageJson} = {}] = tryCatch(readPackageUpSync); if (error) throw `error reading package.json: ${error.message}`; const isV = /^v/.test(versionNew); const version = `v${packageJson.version}`; const gitFix = buildCommand('fix', version); const gitFeature = buildCommand('feature', version); if (!isV && versionNew) versionNew = 'v' + versionNew; const fix = execSync(gitFix, {encoding: 'utf8'}); const feature = execSync(gitFeature, {encoding: 'utf8'}); let head = shortdate(); let data = ''; if (versionNew) head += ', ' + versionNew; head += '\n\n'; if (fix || feature) { data = head; if (fix) { data += 'fix:' + '\n'; data += fix + '\n'; } if (fix && feature) data += '\n'; if (feature) { data += 'feature:' + '\n'; data += feature + '\n'; } } if (!data) throw Error(`No new feature and fix commits from ${version}`); return data; };
/** * Copyright reelyActive 2015-2019 * We believe in an open Internet of Things */ const Raddec = require('raddec'); /** * EmulationManager Class * Manages the emulation of wireless devices. */ class EmulationManager { /** * EmulationManager constructor * @param {Object} options The options as a JSON object. * @constructor */ constructor(options, database) { options = options || {}; this.emulator = options.emulator; } /** * Create emulation(s). * @param {Object} emulation The emulation of the device(s). * @param {callback} callback Function to call on completion. */ create(emulation, callback) { let emulations = {}; emulateShowcaseKit(this.emulator, emulation); // TODO: other options return callback(201, { emulations: emulations }); } /** * Retrieve an existing emulation. * @param {String} id The id of the emulated device. * @param {String} type The type of id of the emulated device. * @param {callback} callback Function to call on completion. */ retrieve(id, type, callback) { let identifier = id + '/' + type; let emulations = {}; emulations[identifier] = {}; // TODO return callback(200, { emulations: emulations }); } /** * Create/replace an emulation. * @param {String} id The id of the emulated device. * @param {String} type The type of id of the emulated device. * @param {Object} emulation The emulation of the device. * @param {callback} callback Function to call on completion. */ replace(id, type, emulation, callback) { let identifier = id + '/' + type; let emulations = {}; emulations[identifier] = {}; // TODO //return callback(201, { emulations: emulations }); return callback(200, { emulations: emulations }); } /** * Remove an existing emulation. * @param {String} id The id of the emulated device. * @param {String} type The type of id of the emulated device. * @param {callback} callback Function to call on completion. */ remove(id, type, callback) { return callback(200); } } /** * Emulate a showcase kit. * @param {Starling} instance The Starling instance. * @param {Object} options The emulation options. */ function emulateShowcaseKit(instance, options) { let transmitterIds = [ 'fa4eda7a0000', 'fa4eda7a0001', 'fa4eda7a0002', 'fa4eda7a0003', 'fa4eda7a0004', 'fa4eda7a0005', 'fa4eda7a0006', 'fa4eda7a0007', 'fa4eda7a0008', 'fa4eda7a0009', 'fa4eda7a000a', 'fa4eda7a000b', 'fa4eda7a000c' ]; let transmitterIdTypes = [ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 ]; let receiverIds = [ '001bc509408fa4e0', '001bc509408fa4e1', '001bc509408fa4e2' ]; let receiverIdTypes = [ 1, 1, 1 ]; let delayMilliseconds = Math.floor(1000 / transmitterIds.length); function emitNextRaddec(transmitterIndex) { let raddec = new Raddec({ transmitterId: transmitterIds[transmitterIndex], transmitterIdType: transmitterIdTypes[transmitterIndex] }); let receiverIndex = Math.floor(Math.random() * receiverIds.length); let rssi = Math.round((Math.random() * 20) - 70); // TODO: observe options raddec.addDecoding({ receiverId: receiverIds[receiverIndex], receiverIdType: receiverIdTypes[receiverIndex], rssi: rssi }); let nextTransmitterIndex = ++transmitterIndex % transmitterIds.length; setTimeout(emitNextRaddec, delayMilliseconds, nextTransmitterIndex); instance.emit('raddec', raddec); } emitNextRaddec(0); } module.exports = EmulationManager;
import baseClone from './base/baseClone' import baseIsEqual from './base/baseIsEqual' //import Keyed from '../protocols/Keyed' import getKey from './getKey' import hasKey from './hasKey' import isImmutable from './isImmutable' import isImmutableSeq from './isImmutableSeq' import isImmutableStack from './isImmutableStack' import isKeyed from './isKeyed' export default function setKey(data, key, value) { if (data == null) { return data } const dataValue = getKey(data, key) if (!(hasKey(data, key) && baseIsEqual(dataValue, value)) || (value === undefined && !(hasKey(data, key)))) { if (isImmutable(data)) { if (isImmutableSeq(data)) { if (isKeyed(data)) { //TODO BRN: This is SLOW... figure out a better way data = data.map((othValue, othKey) => othKey === key ? value : othValue) } else { data = data.splice(key, 1, value) } } else if (isImmutableStack(data)) { data = data.splice(key, 1, value) } else { data = data.set(key, value) } } else { data = baseClone(data) data[key] = value } } return data }
'use strict'; /* global describe, it, before, beforeEach, after, afterEach */ const expect = require('expect.js'); const helpers = require('../index.js'); describe('return-methods', () => { const response = require('./response'); describe('return204', () => { it('return 204 successfully', () => { const res = response(); helpers.return204(undefined, undefined, res, undefined); expect(res.statusValue).to.eql(204); }); it('return 204 returns error', (done) => { const res = response(); const error = new Error(); helpers.return204(error, undefined, res, (err) => { expect(err).to.eql(error); done(); }); }); }); describe('return400', () => { it('return 400 successfully', () => { const res = response(); helpers.return400(undefined, undefined, res, undefined); expect(res.statusValue).to.eql(400); }); it('return 400 returns error', (done) => { const res = response(); const error = new Error(); helpers.return400(error, undefined, res, (err) => { expect(err).to.eql(error); done(); }); }); }); describe('return404', () => { it('return 404 successfully', () => { const res = response(); helpers.return404(undefined, undefined, res, undefined); expect(res.statusValue).to.eql(404); }); it('return 404 returns error', (done) => { const res = response(); const error = new Error(); helpers.return404(error, undefined, res, (err) => { expect(err).to.eql(error); done(); }); }); }); });
/* * Vide - v0.5.1 * Easy as hell jQuery plugin for video backgrounds. * http://vodkabears.github.io/vide/ * * Made by Ilya Makarov * Under MIT License */ !(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof exports === 'object') { factory(require('jquery')); } else { factory(root.jQuery); } })(this, function($) { 'use strict'; /** * Name of the plugin * @private * @const * @type {String} */ var PLUGIN_NAME = 'vide'; /** * Default settings * @private * @const * @type {Object} */ var DEFAULTS = { volume: 1, playbackRate: 1, muted: true, loop: true, autoplay: true, position: '50% 50%', posterType: 'detect', resizing: true, bgColor: 'transparent', className: '' }; /** * Not implemented error message * @private * @const * @type {String} */ var NOT_IMPLEMENTED_MSG = 'Not implemented'; /** * Parse a string with options * @private * @param {String} str * @returns {Object|String} */ function parseOptions(str) { var obj = {}; var delimiterIndex; var option; var prop; var val; var arr; var len; var i; // Remove spaces around delimiters and split arr = str.replace(/\s*:\s*/g, ':').replace(/\s*,\s*/g, ',').split(','); // Parse a string for (i = 0, len = arr.length; i < len; i++) { option = arr[i]; // Ignore urls and a string without colon delimiters if ( option.search(/^(http|https|ftp):\/\//) !== -1 || option.search(':') === -1 ) { break; } delimiterIndex = option.indexOf(':'); prop = option.substring(0, delimiterIndex); val = option.substring(delimiterIndex + 1); // If val is an empty string, make it undefined if (!val) { val = undefined; } // Convert a string value if it is like a boolean if (typeof val === 'string') { val = val === 'true' || (val === 'false' ? false : val); } // Convert a string value if it is like a number if (typeof val === 'string') { val = !isNaN(val) ? +val : val; } obj[prop] = val; } // If nothing is parsed if (prop == null && val == null) { return str; } return obj; } /** * Parse a position option * @private * @param {String} str * @returns {Object} */ function parsePosition(str) { str = '' + str; // Default value is a center var args = str.split(/\s+/); var x = '50%'; var y = '50%'; var len; var arg; var i; for (i = 0, len = args.length; i < len; i++) { arg = args[i]; // Convert values if (arg === 'left') { x = '0%'; } else if (arg === 'right') { x = '100%'; } else if (arg === 'top') { y = '0%'; } else if (arg === 'bottom') { y = '100%'; } else if (arg === 'center') { if (i === 0) { x = '50%'; } else { y = '50%'; } } else { if (i === 0) { x = arg; } else { y = arg; } } } return { x: x, y: y }; } /** * Search a poster * @private * @param {String} path * @param {Function} callback */ function findPoster(path, callback) { var onLoad = function() { callback(this.src); }; $('<img src="' + path + '.gif">').on('load', onLoad); $('<img src="' + path + '.jpg">').on('load', onLoad); $('<img src="' + path + '.jpeg">').on('load', onLoad); $('<img src="' + path + '.png">').on('load', onLoad); } /** * Vide constructor * @param {HTMLElement} element * @param {Object|String} path * @param {Object|String} options * @constructor */ function Vide(element, path, options) { this.$element = $(element); // Parse path if (typeof path === 'string') { path = parseOptions(path); } // Parse options if (!options) { options = {}; } else if (typeof options === 'string') { options = parseOptions(options); } // Remove an extension if (typeof path === 'string') { path = path.replace(/\.\w*$/, ''); } else if (typeof path === 'object') { for (var i in path) { if (path.hasOwnProperty(i)) { path[i] = path[i].replace(/\.\w*$/, ''); } } } this.settings = $.extend({}, DEFAULTS, options); this.path = path; // https://github.com/VodkaBears/Vide/issues/110 try { this.init(); } catch (e) { if (e.message !== NOT_IMPLEMENTED_MSG) { throw e; } } } /** * Initialization * @public */ Vide.prototype.init = function() { var vide = this; var path = vide.path; var poster = path; var sources = ''; var $element = vide.$element; var settings = vide.settings; var position = parsePosition(settings.position); var posterType = settings.posterType; var $video; var $wrapper; // Set styles of a video wrapper $wrapper = vide.$wrapper = $('<div>') .addClass(settings.className) .css({ position: 'absolute', 'z-index': -1, top: 0, left: 0, bottom: 0, right: 0, overflow: 'hidden', '-webkit-background-size': 'cover', '-moz-background-size': 'cover', '-o-background-size': 'cover', 'background-size': 'cover', 'background-color': settings.bgColor, 'background-repeat': 'no-repeat', 'background-position': position.x + ' ' + position.y }); // Get a poster path if (typeof path === 'object') { if (path.poster) { poster = path.poster; } else { if (path.mp4) { poster = path.mp4; } else if (path.webm) { poster = path.webm; } else if (path.ogv) { poster = path.ogv; } } } // Set a video poster if (posterType === 'detect') { findPoster(poster, function(url) { $wrapper.css('background-image', 'url(' + url + ')'); }); } else if (posterType !== 'none') { $wrapper.css('background-image', 'url(' + poster + '.' + posterType + ')'); } // If a parent element has a static position, make it relative if ($element.css('position') === 'static') { $element.css('position', 'relative'); } $element.prepend($wrapper); if (typeof path === 'object') { if (path.mp4) { sources += '<source src="' + path.mp4 + '.mp4" type="video/mp4">'; } if (path.webm) { sources += '<source src="' + path.webm + '.webm" type="video/webm">'; } if (path.ogv) { sources += '<source src="' + path.ogv + '.ogv" type="video/ogg">'; } $video = vide.$video = $('<video>' + sources + '</video>'); } else { $video = vide.$video = $('<video>' + '<source src="' + path + '.mp4" type="video/mp4">' + '<source src="' + path + '.webm" type="video/webm">' + '<source src="' + path + '.ogv" type="video/ogg">' + '</video>'); } // https://github.com/VodkaBears/Vide/issues/110 try { $video // Set video properties .prop({ autoplay: settings.autoplay, loop: settings.loop, volume: settings.volume, muted: settings.muted, defaultMuted: settings.muted, playbackRate: settings.playbackRate, defaultPlaybackRate: settings.playbackRate }); } catch (e) { throw new Error(NOT_IMPLEMENTED_MSG); } // Video alignment $video.css({ margin: 'auto', position: 'absolute', 'z-index': -1, top: position.y, left: position.x, '-webkit-transform': 'translate(-' + position.x + ', -' + position.y + ')', '-ms-transform': 'translate(-' + position.x + ', -' + position.y + ')', '-moz-transform': 'translate(-' + position.x + ', -' + position.y + ')', transform: 'translate(-' + position.x + ', -' + position.y + ')', // Disable visibility, while loading visibility: 'hidden', opacity: 0 }) // Resize a video, when it's loaded .one('canplaythrough.' + PLUGIN_NAME, function() { vide.resize(); }) // Make it visible, when it's already playing .one('playing.' + PLUGIN_NAME, function() { $video.css({ visibility: 'visible', opacity: 1 }); $wrapper.css('background-image', 'none'); }); // Resize event is available only for 'window' // Use another code solutions to detect DOM elements resizing $element.on('resize.' + PLUGIN_NAME, function() { if (settings.resizing) { vide.resize(); } }); // Append a video $wrapper.append($video); }; /** * Get a video element * @public * @returns {HTMLVideoElement} */ Vide.prototype.getVideoObject = function() { return this.$video[0]; }; /** * Resize a video background * @public */ Vide.prototype.resize = function() { if (!this.$video) { return; } var $wrapper = this.$wrapper; var $video = this.$video; var video = $video[0]; // Get a native video size var videoHeight = video.videoHeight; var videoWidth = video.videoWidth; // Get a wrapper size var wrapperHeight = $wrapper.height(); var wrapperWidth = $wrapper.width(); if (wrapperWidth / videoWidth > wrapperHeight / videoHeight) { $video.css({ // +2 pixels to prevent an empty space after transformation width: wrapperWidth + 2, height: 'auto' }); } else { $video.css({ width: 'auto', // +2 pixels to prevent an empty space after transformation height: wrapperHeight + 2 }); } }; /** * Destroy a video background * @public */ Vide.prototype.destroy = function() { delete $[PLUGIN_NAME].lookup[this.index]; this.$video && this.$video.off(PLUGIN_NAME); this.$element.off(PLUGIN_NAME).removeData(PLUGIN_NAME); this.$wrapper.remove(); }; /** * Special plugin object for instances. * @public * @type {Object} */ $[PLUGIN_NAME] = { lookup: [] }; /** * Plugin constructor * @param {Object|String} path * @param {Object|String} options * @returns {JQuery} * @constructor */ $.fn[PLUGIN_NAME] = function(path, options) { var instance; this.each(function() { instance = $.data(this, PLUGIN_NAME); // Destroy the plugin instance if exists instance && instance.destroy(); // Create the plugin instance instance = new Vide(this, path, options); instance.index = $[PLUGIN_NAME].lookup.push(instance) - 1; $.data(this, PLUGIN_NAME, instance); }); return this; }; $(document).ready(function() { var $window = $(window); // Window resize event listener $window.on('resize.' + PLUGIN_NAME, function() { for (var len = $[PLUGIN_NAME].lookup.length, i = 0, instance; i < len; i++) { instance = $[PLUGIN_NAME].lookup[i]; if (instance && instance.settings.resizing) { instance.resize(); } } }); // https://github.com/VodkaBears/Vide/issues/68 $window.on('unload.' + PLUGIN_NAME, function() { return false; }); // Auto initialization // Add 'data-vide-bg' attribute with a path to the video without extension // Also you can pass options throw the 'data-vide-options' attribute // 'data-vide-options' must be like 'muted: false, volume: 0.5' $(document).find('[data-' + PLUGIN_NAME + '-bg]').each(function(i, element) { var $element = $(element); var options = $element.data(PLUGIN_NAME + '-options'); var path = $element.data(PLUGIN_NAME + '-bg'); $element[PLUGIN_NAME](path, options); }); }); });
/** * First we will load all of this project's JavaScript dependencies which * includes Vue and other libraries. It is a great starting point when * building robust, powerful web applications using Vue and Laravel. */ require('./bootstrap'); /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application * or customize the JavaScript scaffolding to fit your unique needs. */ /* Vue.component('example', require('./components/Example.vue')); const app = new Vue({ el: '#app' }); */
function ChangeBackgroundControl(container) { FigureOperation.call(this, container); this.render('Bg'); } ChangeBackgroundControl.prototype = Object.create(FigureOperation.prototype); ChangeBackgroundControl.prototype.visit = function(figure) { FigureOperation.prototype.visit.call(this, figure); var view = figure.getView(); if(figure instanceof Circle) { view.style.backgroundColor = "#f00"; } else if(figure instanceof Rectangle) { view.style.backgroundColor = "#0f0"; } else { view.style.backgroundColor = this._getRandomColor(); } };
var strategyRouter = express.Router(); //restful接口规范 strategyRouter.get("/admin",strategyControl.admin); strategyRouter.get("/strategy",strategyControl.strategyList); strategyRouter.get("/strategy/:sid",strategyControl.previews); strategyRouter.post("/strategy",strategyControl.strategyAdd); strategyRouter.delete("/strategy/:sid",strategyControl.strategyDel); module.exports = strategyRouter;
/** * Description here: * * @author Yure Pereira * @since 26-06-2016 * @version 1.0.0 */ var modal = (function($, w, d, u) { "use strict"; var Modal = new Function(); var template = null, modalTemplate = null, path = '../js/parcial/', opend = false, _this = new Modal(); //Queue to execution. var queue = { alert: [], popup: [] }; var partialTemplate = { //Partial template for alert modal alert: { url: path + 'alert.html', selector: { modal: '.f3-modal', title: '.f3-title > h1', close: '.f3-close', body: '.f3-body', footer: '.f3-footer', okay: '.btn-f3-ok' }, cacheHTML: null }, //Partial template for popup modal popup: { url: path + 'popup.html', selector: { modal: '.f3-modal', close: '.f3-close', body: '.f3-body', }, cacheHTML: null }, comfirm: '', form: '', iframe: '' }; //Default values of variables and functions var defaultSetting = { action: { open: function(selector, callback, parameters) { var element = $(selector); element.addClass('f3-opend'); //Model state opend opend = true; callback = typeof callback == 'function' ? callback : function() {}; parameters = Array.isArray(parameters) ? parameters : []; element.fadeIn(300, function() { callback.apply(null, parameters); }); }, close: function(selector, callback, parameters) { var element = $(selector); //Model state closed opend = false; callback = typeof callback == 'function' ? callback : function() {}; parameters = Array.isArray(parameters) ? parameters : []; element.fadeOut(300, function() { $(this).remove(); callback.apply(null, parameters); //If queue length bigger then 0 run next in queue for (var modal in queue) { if (queue.hasOwnProperty(modal) && queue[modal].length > 0) { //Find modal function name var fn = _this['_' + modal]; if (typeof fn === 'function') { fn.apply(null, [queue[modal].shift()]); } } } }); }, isOpend: function() { return opend; } } }; Modal.prototype._init = function(callback, parameters) { //Generic code here. if (typeof callback === 'function') { callback.apply(null, parameters); } }; /** * @param {object} config { * @example * _alert({ * title: '', * message: '', * callbackClosed: function() {} * }) * */ Modal.prototype._alert = function(config) { //Load template alert var init = function(data) { _this._init(function(data) { modalTemplate = $(data); var modal = modalTemplate.find(partialTemplate.alert.selector.modal), title = modalTemplate.find(partialTemplate.alert.selector.title), close = modalTemplate.find(partialTemplate.alert.selector.close), body = modalTemplate.find(partialTemplate.alert.selector.body), footer = modalTemplate.find(partialTemplate.alert.selector.footer), btnOkay = modalTemplate.find(partialTemplate.alert.selector.okay); title.html(config.title); body.html(config.message); //Callback Closed config.callbackClosed = config.hasOwnProperty('callbackClosed') && typeof config.callbackClosed == 'function' ? config.callbackClosed : null; //Events close.click(function() { defaultSetting.action.close.apply(this, [partialTemplate.alert.selector.modal, config.callbackClosed]); }); btnOkay.click(function() { defaultSetting.action.close.apply(this, [partialTemplate.alert.selector.modal, config.callbackClosed]); }); if (!opend) { //Add alert modal on the page document. modalTemplate.attr('style', 'display: none'); $(d.body).append(modalTemplate); defaultSetting.action.open(partialTemplate.alert.selector.modal); } else { queue.alert.push(config); } }, [data]); }; var cacheData = partialTemplate.alert.cacheHTML; if (cacheData != null) { init.apply(null, [cacheData]); } else { $.get(partialTemplate.alert.url, function(data) { init.apply(null, [data]); //Save cache html page modal alert. partialTemplate.alert.cacheHTML = data; }).fail(function() { throw 'Error: without internet access.'; //alert('Error: without internet access.'); }); } }; /** * @param {object} config { * @example * _popup({ * content: '', * callbackClosed: function() {} * }) * */ Modal.prototype._popup = function(config) { //Init popup config var init = function(data) { _this._init(function(data) { modalTemplate = $(data); var modal = modalTemplate.find(partialTemplate.popup.selector.modal), close = modalTemplate.find(partialTemplate.popup.selector.close), body = modalTemplate.find(partialTemplate.popup.selector.body); body.html(config.content); //Callback Closed config.callbackClosed = config.hasOwnProperty('callbackClosed') && typeof config.callbackClosed == 'function' ? config.callbackClosed : null; //Events close.click(function() { defaultSetting.action.close.apply(this, [partialTemplate.popup.selector.modal, config.callbackClosed]); }); if (!opend) { modalTemplate.attr('style', 'display: none'); $(d.body).append(modalTemplate); defaultSetting.action.open(partialTemplate.popup.selector.modal); } else { queue.popup.push(config); } }, [data]); }; var cacheData = partialTemplate.popup.cacheHTML; if (cacheData != null) { init.apply(this, [cacheData]); } else { $.get(partialTemplate.popup.url, function(data) { init.apply(this, [data]); //Save cache html page modal popup. partialTemplate.popup.cacheHTML = data; }).fail(function() { throw 'Error: without internet access.'; //alert('Error: without internet access.'); }); } }; return { alert: _this._alert, popup: _this._popup, isOpend: function() { return defaultSetting.action.isOpend(); } }; })(jQuery, window, document);
/*globals module:true */ module.exports = function (grunt) { 'use strict'; grunt.config('copy', { app : { files : [ { expand : true, cwd : 'app/', src : [ '**', '!paths.json', '!main.js', '!config/config.local.json', '!config/config.production.json', '!config/config.staging.json', '!**/*.jade', '!**/*.css', '!**/*.scss' ], dest : 'build/' } ] }, reload : { files : [ { expand : true, cwd : 'app/', src : [ '**', '!vendor/**/*', '!paths.json', '!dependencies/**/*', '!main.js', '!index.html', '!config/config.local.json', '!config/config.production.json', '!config/config.staging.json', '!config/constants.js', '!**/*.jade', '!**/*.css', '!**/*.scss' ], dest : 'build/' } ] }, tests : { files : [ { expand : true, cwd : 'tests/', src : [ '**', '!paths.json', '!main.template.json' ], dest : 'build/tests/' } ] }, cordova : { files : [ { expand : true, cwd : 'build/', src : [ '**', '!paths.json', '!main.template.json' ], dest : 'mobileBuild/www' } ] } }); };
/* * Filename: system.js */ var SystemUnknown = require(__dirname+'/unknown/unknown.js'); var self = this; /** * Create a new System that let users create sub-system. * @return {System} */ function System() { self._directory = 'system'; self._document = 'system.html'; self._filename = ''; // Will be set self._filepath = ''; // Will be set self._proxies = {}; // Will be set self._linktitle = 'Unknown'; self._style = 'body { background-color: #ffffff; }'; // Default self._title = 'System'; // Default } System.prototype.directory = function() { return self._directory; } System.prototype.setdirectory = function(fnOrValue) { self._directory = fnOrValue; } System.prototype.document = function() { return self._document; } System.prototype.setdocument = function(fnOrValue) { self._document = fnOrValue; } System.prototype.filename = function() { return self._filename; } System.prototype.setfilename = function(fnOrValue) { self._filename = fnOrValue; } System.prototype.filepath = function() { return self._filepath; } System.prototype.setfilepath = function(fnOrValue) { self._filepath = fnOrValue; } System.prototype.linktitle = function() { return self._linktitle; } System.prototype.setlinktitle = function(fnOrValue) { self._linktitle = fnOrValue; } System.prototype.proxies = function() { return self._proxies; } System.prototype.setproxies = function(fnOrValue) { self._proxies = fnOrValue; } System.prototype.style = function() { return self._style; } System.prototype.setstyle = function(fnOrValue) { self._style = fnOrValue; } System.prototype.title = function() { return self._title; } System.prototype.settitle = function(fnOrValue) { self._title = fnOrValue; } System.prototype.append = function() {} // Will be set System.prototype.buildHtml = function() {} // Will be set System.prototype.ensureExists = function() {} // Will be set System.prototype.unknown = function() { console.log('documentations documentation unknown called') /* Creates the ./documentations/documentation/documentation.html page */ var _document = 'system.html'; // this.document(); /* The _document should be 'system.html' */ var _directory = 'system'; // this.directory(); /* The _directory should be 'system' */ var _subdirectory = 'unknown'; var _subdocument = 'unknown.html'; var _proxies = this.proxies(); var _filepath = this.filepath(); var _title = this.title(); var _style = this.style(); var _linktitle = this.linktitle(); var _styleArray = []; var _scriptArray = []; var _headArray = []; var _bodyArray = []; var _path = _proxies().proxy().libraries().library().path(); this._systemunknown = new SystemUnkown(); /* START OPENING UP ALL BELOW LOGIC STEP BY STEP */ console.log('documentations documentation uml sequencediagram system ------------------- CHECKPOINT 000 --------------------- OK') console.log('documentations documentation uml sequencediagram system - _document: ', _document) this._systemunknown.setfilename(_document); console.log('documentations documentation uml sequencediagram system - _path.join(_filepath, _directory): ', _path.join(_filepath, _directory)) this._systemunknown.setfilepath(_path.join(_filepath, _directory)); // The _directory should be '.\docs\documentations' */ this._systemunknown.setproxies(_proxies); this._systemunknown.append = this.append; // Assign the function, don't call it this._systemunknown.buildHtml = this.buildHtml; // Assign the function, don't call it this._systemunknown.ensureExists = this.ensureExists; // Assign the function, don't call it var _jsdom = _proxies().proxy().libraries().library().jsdom(); var _htmlDocument = _jsdom.jsdom().implementation.createHTMLDocument(''); /* Title: System */ var _titleElem = _htmlDocument.createElement('title'); _titleElem.innerHTML = _title; console.log('documentations documentation uml sequencediagram system - documentation _titleElem: ', _titleElem) /* Style: Tether */ var _styleElem = _htmlDocument.createElement('link'); console.log('documentations documentation uml sequencediagram system - documentation _styleElem: ', _styleElem) _styleElem.setAttribute("rel", "stylesheet"); _styleElem.setAttribute("type", "text/css"); _styleElem.setAttribute("href", "../../../../../../assets/asset/tether/dist/css/tether.min.css"); console.log('documentations documentation uml sequencediagram system - documentation _styleElem: ', _styleElem) _styleArray.push(_styleElem); /* Style: Bootstrap */ var _styleElem = _htmlDocument.createElement('link'); console.log('documentations documentation uml sequencediagram system - documentation _styleElem: ', _styleElem) _styleElem.setAttribute("rel", "stylesheet"); _styleElem.setAttribute("type", "text/css"); _styleElem.setAttribute("href", "../../../../../../assets/asset/bootstrap/dist/css/bootstrap.min.css"); console.log('documentations documentation uml sequencediagram system - documentation _styleElem: ', _styleElem) _styleArray.push(_styleElem); /* Style: Bootstrap - sticky footer */ var _styleElem = _htmlDocument.createElement('link'); console.log('documentations documentation uml sequencediagram system _styleElem: ', _styleElem) _styleElem.setAttribute("rel", "stylesheet"); _styleElem.setAttribute("type", "text/css"); _styleElem.setAttribute("href", "../../../../../../assets/asset/bootstrap/dist/css/sticky-footer-navbar.css"); console.log('documentations documentation uml sequencediagram system _styleElem: ', _styleElem) _styleArray.push(_styleElem); /* Style: inline */ var _styleElem = _htmlDocument.createElement('link'); console.log('documentations documentation uml sequencediagram system - documentation _styleElem: ', _styleElem) _styleElem.innerHTML = _style; console.log('documentations documentation uml sequencediagram system - documentation _styleElem: ', _styleElem) _styleArray.push(_styleElem); /* Head */ _headArray.push(_titleElem); _styleArray.forEach(function(styleElem) { _headArray.push(styleElem); // Possible to add more elements to head }, _headArray); console.log('documentations documentation uml sequencediagram system - documentation _headArray: ', _headArray) /* * Body */ /* Navbar */ var _navElem = _htmlDocument.createElement("nav"); _navElem.setAttribute("class", "navbar navbar-light bg-faded"); var _ulElem = _htmlDocument.createElement("ul"); _ulElem.setAttribute("class", "nav navbar-nav"); var _liElem = _htmlDocument.createElement("li"); _liElem.setAttribute("class", "nav-item active"); var _aElem = _htmlDocument.createElement("a"); _aElem.setAttribute("class", "nav-link"); _aElem.setAttribute("href", "#"); _aElem.innerHTML = _title; _liElem.appendChild(_aElem); _ulElem.appendChild(_liElem); _navElem.appendChild(_ulElem); _bodyArray.push(_navElem); /* Container */ var _divElem = _htmlDocument.createElement("div"); _divElem.setAttribute("class", "container") /* List */ var _ulElem = _htmlDocument.createElement('ul'); _ulElem.setAttribute("class", "list-group"); console.log('documentations documentation uml sequencediagram system - documentation _ulElem: ', _ulElem) var _liElem = _htmlDocument.createElement('li'); _liElem.setAttribute("class", "list-group-item"); console.log('documentations documentation uml sequencediagram system - documentation _liElem: ', _liElem) var _aElem = _htmlDocument.createElement('a'); console.log('documentations documentation uml sequencediagram system - documentation _aElem: ', _aElem) console.log('documentations documentation uml sequencediagram system ------------------- CHECKPOINT 001 ---------------------') /* The _subdirectory should be 'documentation' */ /* The _subdocument should be 'documentation.html' */ console.log('documentations documentation uml sequencediagram system - href:', "./" + _subdirectory + "/" + _subdocument) console.log('documentations documentation uml sequencediagram system ------------------- CHECKPOINT 002 ---------------------') _aElem.setAttribute("href", "./" + _subdirectory + "/" + _subdocument); _aElem.innerHTML = _linktitle; _liElem.appendChild(_aElem); _ulElem.appendChild(_liElem); _divElem.appendChild(_ulElem); _bodyArray.push(_divElem); // Possible to add more elements to body console.log('documentations documentation uml sequencediagram system - documentation _bodyArray: ', _bodyArray) /* Footer */ var _footerElem = _htmlDocument.createElement("footer"); _footerElem.setAttribute("class", "footer"); var _divElem = _htmlDocument.createElement("div"); _divElem.setAttribute("class", "container"); var _spanElem = _htmlDocument.createElement("span"); _spanElem.setAttribute("class", "text_muted"); _spanElem.innerHTML = "Generated on: " +new Date; _divElem.appendChild(_spanElem); _footerElem.appendChild(_divElem); _bodyArray.push(_footerElem); /* Scripts, put at bottom of body to make the page load faster */ /* Script: JQuery */ var _scriptElem = _htmlDocument.createElement('script'); _scriptElem.setAttribute("type", "text/javascript"); _scriptElem.setAttribute("src", "../../../../../../assets/asset/jquery/dist/js/jquery.min.js"); console.log('documentations documentation uml sequencediagram system - documentation _scriptElem: ', _scriptElem) _scriptArray.push(_scriptElem); /* Script: Tether */ var _scriptElem = _htmlDocument.createElement('script'); _scriptElem.setAttribute("type", "text/javascript"); _scriptElem.setAttribute("src", "../../../../../../assets/asset/tether/dist/js/tether.min.js"); console.log('documentations documentation uml sequencediagram system - documentation _scriptElem: ', _scriptElem) _scriptArray.push(_scriptElem); /* Script: Bootstrap */ var _scriptElem = _htmlDocument.createElement('script'); _scriptElem.setAttribute("type", "text/javascript"); _scriptElem.setAttribute("src", "../../../../../../assets/asset/bootstrap/dist/js/bootstrap.min.js"); console.log('documentations documentation uml sequencediagram system - documentation _scriptElem: ', _scriptElem) _scriptArray.push(_scriptElem); /* Script: Raphael */ var _scriptElem = _htmlDocument.createElement('script'); _scriptElem.setAttribute("type", "text/javascript"); _scriptElem.setAttribute("src", "../../../../../../assets/asset/raphael/dist/js/raphael.min.js"); console.log('documentations documentation uml sequencediagram system - documentation _scriptElem: ', _scriptElem) _scriptArray.push(_scriptElem); _scriptArray.forEach(function(scriptElem) { _bodyArray.push(scriptElem); }, _bodyArray); this._systemunknown.append(_headArray, _bodyArray); return this._systemunknown; } module.exports = System;
//creates new short list based upon slider value - still needs to include a mapping function. rackObj.txtinEl.value = "600 feet"; // rackObj.distanceEl.addEventListener('submit', function(e){ // e.preventDefault(); // rackObj.distance = parseInt(rackObj.sliderEl.value); // // marker.setMap(null); // console.log(rackObj.distance); // // closeRacksFinder(uLat, uLong, this.distance); // }) rackObj.sliderEl.addEventListener('change', function(e) { e.preventDefault(); rackObj.txtinEl.value = parseInt(rackObj.sliderEl.value); console.log(parseInt(rackObj.sliderEl.value)); }) rackObj.txtinEl.addEventListener('change', function(e) { e.preventDefault(); rackObj.sliderEl.value = parseInt(rackObj.txtinEl.value); console.log('txtinel changed my value!'); })
/** * Created by Sean on 3/21/2015. */ var scraper = require('./lib/scrapers/clubScraper'); //var injScraper = require('./lib/scrapers/injuryScraper'); var mongoose = require('mongoose'); var db = mongoose.connect('mongodb://localhost:27017/fcscraper'); mongoose.connection.on('error', function () { console.error('MongoDB Connection Error. Make sure MongoDB is running.'); }); function runScraper() { scraper.scrape('http://www.soccerstats.com/widetable.asp?league=england', 'england1'); scraper.scrape('http://www.soccerstats.com/widetable.asp?league=spain', 'spain1'); scraper.scrape('http://www.soccerstats.com/widetable.asp?league=germany', 'germany1'); scraper.scrape('http://www.soccerstats.com/widetable.asp?league=italy', 'italy1'); scraper.scrape('http://www.soccerstats.com/widetable.asp?league=france', 'france1'); scraper.scrape('http://www.soccerstats.com/widetable.asp?league=portugal', 'portugal1'); //injScraper.scrape('http://www.whoout.com/football/premier-league/', 'england1_i'); //injScraper.scrape('http://www.whoout.com/football/primera-division/', 'spain1_i'); } module.exports = runScraper();
/** * Maximum Product Subarray * * Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has * the largest product. * * Example 1: * * Input: [2,3,-2,4] * Output: 6 * Explanation: [2,3] has the largest product 6. * * Example 2: * * Input: [-2,0,-1] * Output: 0 * Explanation: The result cannot be 2, because [-2,-1] is not a subarray. */ /** * @param {number[]} nums * @return {number} */ const maxProduct = nums => { let res = nums[0]; let min = nums[0]; let max = nums[0]; for (let i = 1; i < nums.length; i++) { if (nums[i] > 0) { max = Math.max(nums[i], max * nums[i]); min = Math.min(nums[i], min * nums[i]); } else { const tmp = max; max = Math.max(nums[i], min * nums[i]); min = Math.min(nums[i], tmp * nums[i]); } res = Math.max(res, max); } return res; }; export { maxProduct };
const $ = require("jquery"); const BigNumber = require('bignumber.js'); var _ = require('lodash'); const candiesRobot = function(nbOfCandies, durationInM, minusCandiesArray) { let candiesAdded = 0, currentNbInJar = nbOfCandies; const minimum = 5, replenishTo = nbOfCandies; for (let timeSpent = 0; timeSpent < durationInM - 1; timeSpent++) { let toAdd = 0; currentNbInJar = currentNbInJar - minusCandiesArray[timeSpent]; if (currentNbInJar < minimum) { toAdd = replenishTo - currentNbInJar; currentNbInJar = currentNbInJar + toAdd; } candiesAdded = candiesAdded + toAdd; } // console.log(candiesAdded); return candiesAdded; }; const minimumNb = function (nbToCompare) { const middle = 'int', prefix = 'min(int, ', suffix = ')', nbOfSuffix = nbToCompare - 1, nbOfPrefix = nbToCompare - 1; let allPrefixes = prefix.repeat(nbOfPrefix); let allSuffixes = suffix.repeat(nbOfSuffix); const totalCalls = allPrefixes + middle + allSuffixes; // console.log (totalCalls); return(totalCalls); }; /** * Bad complexity, but is working very well for n < 4. * Gets shaky at n=4 and impossible at n=5. */ const melodiousPwd = function (pwdLength) { const vowels = ['a', 'e', 'i', 'o', 'u'], consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z'], vowelsNb = vowels.length, consonantsNb = consonants.length; let result = []; const addLetters = function(curr, nbMissing) { let lastIsVowel = (/^[aeiou]$/i).test(curr.substr(curr.length - 1)); let oldCurr = curr; if (curr.length === pwdLength) { return result.push(curr); } else if (curr.length === 0) { for (let consonantIndex = 0; consonantIndex < consonantsNb; consonantIndex++) { curr = oldCurr + consonants[consonantIndex]; addLetters(curr, nbMissing - 1); } for (let vowelIndex = 0; vowelIndex < vowelsNb; vowelIndex++) { curr = oldCurr + vowels[vowelIndex]; addLetters(curr, nbMissing - 1); } } else if (lastIsVowel) { //add consonant for (let consonantIndex = 0; consonantIndex < consonantsNb; consonantIndex++) { curr = oldCurr + consonants[consonantIndex]; addLetters(curr, nbMissing - 1); } } else { //add each vowels for (let vowelIndex = 0; vowelIndex < vowelsNb; vowelIndex++) { curr = oldCurr + vowels[vowelIndex]; addLetters(curr, nbMissing - 1); } } }; addLetters('', pwdLength); console.log(result.toString().split(',').join('\n')); return(result); }; const poles = function(nbOfPoles, nbOfStacks, arrayPoles) { let totalCost = 0, movingCost; if (nbOfStacks > 1) { for (let i = 1 ; i < nbOfStacks ; i++) { movingCost = arrayPoles[i].weight * (arrayPoles[i].height - arrayPoles[0].height); totalCost = totalCost + movingCost; } for (let i = nbOfStacks + 1; i < nbOfPoles; i++) { movingCost = arrayPoles[i].weight * (arrayPoles[i].height - arrayPoles[nbOfStacks].height); totalCost = totalCost + movingCost; } } else { for (let i = 1 ; i < nbOfPoles ; i++) { movingCost = arrayPoles[i].weight * (arrayPoles[i].height - arrayPoles[0].height); totalCost = totalCost + movingCost; } } return (totalCost); } module.exports.candiesRobot = candiesRobot; module.exports.minimumNb = minimumNb; module.exports.melodiousPwd = melodiousPwd; module.exports.poles = poles;
/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'blockquote', 'ca', { toolbar: 'Bloc de cita' } );
/** * Javascript Class Helper * @author Tom Flidr | tomflidr(at)gmail(dot)com * @version 1.2 * @date 2016-07-18 * @usage var ClassName = Class({ Extend: ParentClassName, Static: { staticMethod: function () { // call parent static method with same name this.parent(param1, param2, ...); // call any other parent static method this.parent.otherParentStaticMethod(param1, param2, ...); } }, Constructor: function () { // call parent Constructor this.parent(param1, param2); // call any other parent dynamic method this.parent.otherParentDynamicMethod(param1, param2, ...); }, dynamicMethod: function () { // call parent dynamic method with same name this.parent(param1, param2); // call any other parent dynamic method this.parent.otherParentDynamicMethod(param1, param2, ...); } }); */ var Class = (function (_globalScope) { // function.prototype.bind Polyfill for Object.create('ClassName, [/* arguments*/]): // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind Function.prototype.bind||(Function.prototype.bind=function(a){if(typeof this!=='function'){throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');}var b=[].slice,c='prototype',d=b.call(arguments,1),e=this,f=function(){},g=function(){return e.apply(this instanceof f?this:a,d.concat(b.call(arguments)))};if(this[c]){f[c]=this[c]}g[c]=new f();return g}); // Class helper definition var $class = function () { var _args = [].slice.apply(arguments), _constants = $class.Constants, _defaultClassName = 'Class', _result; if (typeof (_args[0]) == 'string') { return $class._defineNamedClass(_args[0], _args.length > 1 ? _args[1] : {}); } else { _result = $class._defineClass(_args[0], _defaultClassName); _result[_constants.Namespace] = ''; _result[_constants.Fullname] = _defaultClassName; return _result; } }; $class.Constants = { 'ClassImprint' : '$classImprint', 'InstanceImprint' : '$instanceImprint', 'Extend' : 'Extend', 'Static' : 'Static', 'Constructor' : 'Constructor', 'Name' : 'Name', 'Namespace' : 'Namespace', 'Fullname' : 'Fullname', 'self' : 'self', 'parent' : 'parent' }; $class._keywords = {}; $class.ClassImprintBaseName = 'class{0}'; $class.InstanceImprintBaseName = 'instance{0}'; $class._classImprintCounter = 0; $class._instanceImprintCounter = 0; $class._actualLevels = [ {},// dynamic methods parent calls actual level under instanceImprint key {} // static methods parent calls actual level under classImprint key ]; $class._classParents = {}; $class.CustomizeSyntax = function (constants) { var value = ''; for (var key in constants) { value = constants[key]; $class._keywords[value] = true; $class.Constants[key] = value; }; }; $class.CustomizeSyntax($class.Constants); $class.Create = function (fullName, args) { var _explodedName = fullName.split('.'), _namePart = '', _currentScope = _globalScope; for (var i = 0, l = _explodedName.length; i < l; i += 1) { _namePart = _explodedName[i]; if (!(_namePart in _currentScope)) { throw new Error("Class '" + fullName + "' doesn't exist!"); } _currentScope = _currentScope[_namePart]; } args.unshift(_currentScope); return new (_currentScope.bind.apply(_currentScope, args))(); }; $class.Define = function (fullName, cfg) { return $class._defineNamedClass(fullName, cfg || {}); }; $class._defineNamedClass = function (fullName, cfg) { var _explodedName = fullName.split('.'), _name = _explodedName.pop(), _namePart = '', _constants = $class.Constants, _currentScope = _globalScope, _result; for (var i = 0, l = _explodedName.length; i < l; i += 1) { _namePart = _explodedName[i]; if (!(_namePart in _currentScope)) { _currentScope[_namePart] = {}; } _currentScope = _currentScope[_namePart]; } if (cfg.toString === {}.toString) { cfg.toString = function () { return '[object ' + fullName + ']'; } } _result = $class._defineClass(cfg, _name); _result[_constants.Namespace] = _explodedName.join('.'); _result[_constants.Fullname] = fullName; _currentScope[_name] = _result; return _result; }; $class._defineClass = function (cfg, _name) { var _constants = $class.Constants, _extend = _constants.Extend, _nameStr = _constants.Name, _classImprint = _constants.ClassImprint, _self = _constants.self, _currentClassImprint = '', _parentClassImprint = ''; // create internal class constructor from basic javascript function var Class = function () { return $class._constructor(cfg, this, [].slice.apply(arguments)); }; var _classDefinition = Class; // imprints for parent calls if (cfg[_extend]) { if (typeof (cfg[_extend][_classImprint]) == 'function') { _parentClassImprint = cfg[_extend][_classImprint](); } else { _parentClassImprint = $class._completeClassImprint(); cfg[_extend][_classImprint] = function () { return _parentClassImprint }; } } _currentClassImprint = $class._completeClassImprint(); _classDefinition[_classImprint] = function () { return _currentClassImprint }; // extend parent and current dynamic and static elements (including constructor) $class._extendParentPrototype(_classDefinition, cfg); $class._extendParentStatic(_classDefinition, cfg); $class._declareCurrentPrototype(_classDefinition, cfg); $class._declareCurrentStatic(_classDefinition, cfg); // store current Class object in local property for later use _classDefinition[_self] = _classDefinition; // to find parent definition by imprint traversing - parent calls - store parent class definition in static place if (cfg[_extend]) { _classDefinition[_self][_extend] = cfg[_extend]; $class._classParents[_currentClassImprint] = _parentClassImprint; } // to get anytime inside instance class definition without naming it: _classDefinition.prototype[_self] = _classDefinition; // define parent calls helper in static methods $class._declareParentStaticCalls(_classDefinition); // return function with prototype - ready to use like: var instance = new ClassName(); _classDefinition[_nameStr] = _name; return _classDefinition; }; $class._constructor = function (_cfg, _context, _args) { var _constants = $class.Constants, _constructorStr = _constants.Constructor, _instanceImprint = ''; if (_context === _globalScope) { if (typeof (_cfg[_constructorStr]) == 'function') { _cfg[_constructorStr].apply(_context, _args); } else { throw new Error("Class definition is not possible to call as function, it's necessary to create instance with 'new' keyword before class definition."); } } else { // fingerprint for dynamic parent calls _instanceImprint = $class._completeInstanceImprint(); _context[_constants.InstanceImprint] = function () { return _instanceImprint }; // define parent calls helper in dynamic methods in later binding here after instance is created - to work with 'this' context properly $class._declareParentDynamicCalls(_context); // call defined constructor return _context[_constructorStr].apply(_context, _args); } }; $class._completeClassImprint = function () { var _result = $class.ClassImprintBaseName.replace('{0}', $class._classImprintCounter); $class._classImprintCounter += 1; return _result; }; $class._completeInstanceImprint = function () { var _result = $class.InstanceImprintBaseName.replace('{0}', $class._instanceImprintCounter); $class._instanceImprintCounter += 1; return _result; }; $class._extendParentPrototype = function (classDefinition, cfg) { var _constants = $class.Constants, _nameStr = _constants.Name, _prototype = 'prototype', _dynamicName = '', _cfgExtend = cfg[_constants.Extend]; var Prototype = function () { }, _currentProto; if (_cfgExtend) { /*if (Object.create) { classDefinition[_prototype] = Object.create(_cfgExtend[_prototype]); } else {*/ if (_cfgExtend) Prototype[_prototype] = _cfgExtend[_prototype]; classDefinition[_prototype] = new Prototype(); //} } _currentProto = classDefinition[_prototype]; for (_dynamicName in _currentProto) { if ( typeof(_currentProto[_dynamicName]) == 'function' && typeof(_currentProto[_dynamicName][_nameStr]) != 'string' ) _currentProto[_dynamicName][_nameStr] = _dynamicName; } }; $class._extendParentStatic = function (classDefinition, cfg) { var _staticName = '', _constants = $class.Constants, _nameStr = _constants.Name, _cfgExtend = cfg[_constants.Extend]; if (_cfgExtend) { for (_staticName in _cfgExtend) { if (!($class._keywords[_staticName] === true)) { classDefinition[_staticName] = _cfgExtend[_staticName]; if (typeof(_cfgExtend[_staticName]) == 'function') classDefinition[_staticName][_nameStr] = _staticName; } } } }; $class._declareCurrentPrototype = function (classDefinition, cfg) { var _classPrototype = classDefinition.prototype, _constants = $class.Constants, _nameStr = _constants.Name, _constructor = _constants.Constructor, _dynamicName = ''; for (_dynamicName in cfg) { if (!($class._keywords[_dynamicName] === true)) { _classPrototype[_dynamicName] = cfg[_dynamicName]; if (typeof(cfg[_dynamicName]) == 'function') _classPrototype[_dynamicName][_nameStr] = _dynamicName; } } if (cfg[_constructor]) { _classPrototype[_constructor] = cfg[_constructor]; _classPrototype[_constructor][_nameStr] = _constructor; } _classPrototype[_constants.InstanceImprint] = function () { return '' }; }; $class._declareCurrentStatic = function (classDefinition, cfg) { var _staticName = '', _constants = $class.Constants, _nameStr = _constants.Name, _cfgStatic = cfg[_constants.Static]; if (_cfgStatic) { for (_staticName in _cfgStatic) { if (!($class._keywords[_staticName] === true)) { classDefinition[_staticName] = _cfgStatic[_staticName]; if (typeof(_cfgStatic[_staticName]) == 'function') classDefinition[_staticName][_nameStr] = _staticName; } } } }; $class._declareParentDynamicCalls = function (_context) { var _constants = $class.Constants, _nameStr = _constants.Name, _parent = _constants.parent, _self = _constants.self, _prototypeStr = 'prototype', _dynamicName = '', _currentDefinition = _context[_self], _parentDefinition = _currentDefinition[_self][_constants.Extend], _parentDefinitionPrototype, _clsProtoParent; _currentDefinition[_prototypeStr][_parent] = function () { return $class._parentCall(this, arguments.callee.caller[_nameStr], [].slice.apply(arguments), 0); }; _clsProtoParent = _currentDefinition[_prototypeStr][_parent]; if (_parentDefinition) { _parentDefinitionPrototype = _parentDefinition[_prototypeStr]; for (_dynamicName in _parentDefinitionPrototype) { if (typeof(_parentDefinitionPrototype[_dynamicName]) == 'function' && !($class._keywords[_dynamicName] === true)) { _clsProtoParent[_dynamicName] = $class._declareParentDynamicCallsProvider(_context, _dynamicName); } } } }; $class._declareParentDynamicCallsProvider = function (_context, _dynamicName) { return function () { return $class._parentCall(_context, _dynamicName, [].slice.apply(arguments), 0); }; }; $class._declareParentStaticCalls = function (_currentDefinition) { var _constants = $class.Constants, _nameStr = _constants.Name, _parent = _constants.parent, _staticName = '', _parentDefinition = _currentDefinition[_constants.Extend], _clsParent; _currentDefinition[_parent] = function () { return $class._parentCall(this, arguments.callee.caller[_nameStr], [].slice.apply(arguments), 1); }; _clsParent = _currentDefinition[_parent]; if (_parentDefinition) { for (_staticName in _parentDefinition) { if (typeof(_parentDefinition[_staticName]) == 'function' && !Boolean($class._keywords[_staticName])) { _clsParent[_staticName] = $class._declareParentStaticCallsProvider(_currentDefinition, _staticName); } } } }; $class._declareParentStaticCallsProvider = function (_context, _staticName) { return function () { return $class._parentCall(_context, _staticName, [].slice.apply(arguments), 1); }; }; $class._parentCall = function (_context, _methodName, _args, _imprintsIndex) { var _result, _constants = $class.Constants, _classImprintStr = _constants.ClassImprint, _instanceImprintStr = _constants.InstanceImprint, _selfStr = _constants.self, _instanceImprintValue = _context[_imprintsIndex ? _classImprintStr : _instanceImprintStr](), _contextClassDefinition = _context[_selfStr], _contextClassImprintValue = _contextClassDefinition[_classImprintStr](), _parentClassImprint = $class._getParentClassImprint( _contextClassImprintValue, _instanceImprintValue, _imprintsIndex ), _parentClassDefinition = $class._getParentClassDefinition( _contextClassDefinition, _parentClassImprint ), _parentMethod = _imprintsIndex ? _parentClassDefinition[_methodName] : _parentClassDefinition.prototype[_methodName], _parentMethodType = typeof (_parentMethod); if (_parentMethodType == 'undefined') { try { throw "No parent method named: '" + _methodName + "'."; } catch (e) { console.log(e.stack); } } else if (_parentMethodType != 'function') { throw "Parent method '" + _methodName + "' is not a function."; }; _result = _parentMethod.apply(_context, _args); delete $class._actualLevels[_imprintsIndex][_instanceImprintValue]; return _result; }; $class._getParentClassImprint = function (_contextClassImprint, _instanceImprint, _imprintsIndex) { var _levels = $class._actualLevels[_imprintsIndex], _currentImprint = '', _parentImprint = ''; if (typeof (_levels[_instanceImprint]) == 'undefined') { _levels[_instanceImprint] = _contextClassImprint; } _currentImprint = _levels[_instanceImprint]; _parentImprint = $class._classParents[_currentImprint]; if (!_parentImprint) { // no parent class definition throw new Error("No parent class defined."); } _levels[_instanceImprint] = _parentImprint; return _parentImprint; }; $class._getParentClassDefinition = function (_currentClassDefinition, _parentClassImprint) { var _constants = $class.Constants, _extendStr = _constants.Extend, _classImprintStr = _constants.ClassImprint, _success = false, _parentClassDefinition; while (true) { if (typeof (_currentClassDefinition[_extendStr]) == 'undefined') break; _parentClassDefinition = _currentClassDefinition[_extendStr]; if (_parentClassDefinition[_classImprintStr]() == _parentClassImprint) { _success = true; break; } _currentClassDefinition = _parentClassDefinition; } if (!_success) { throw new Error("No parent class definition found for class imprint: '" + _parentClassImprint + "'."); } return _parentClassDefinition; }; _globalScope.Class = $class; return $class; })(Boolean(typeof (module) !== 'undefined' && module.exports) ? global : this);
/** * @module slimdom */ if (typeof define !== 'function') { var define = require('amdefine')(module); } define( [ './Node', './mutations/MutationRecord', './util' ], function( Node, MutationRecord, util, undefined) { 'use strict'; /** * The CharacterData abstract interface represents a Node object that contains characters. This is an abstract * interface, meaning there aren't any object of type CharacterData: it is implemented by other interfaces, * like Text, Comment, or ProcessingInstruction which aren't abstract. * * @class CharacterData * @extends Node * * @constructor * * @param {number} type The Node type to assign to this CharacterData object * @param {string} data Is a string representing the textual data contained in this object. */ function CharacterData(type, data) { if (!arguments.length) return; Node.call(this, type); /** * Holds the data value. * * @property _data * @type {String} * @private */ this._data = '' + data; } CharacterData.prototype = new Node(); CharacterData.prototype.constructor = CharacterData; /** * A string representing the textual data contained in this object. * * @class CharacterData * @property data * @type {string} */ Object.defineProperty(CharacterData.prototype, 'data', { enumerable: true, configurable: false, get: function() { return this._data; }, set: function(newValue) { this.replaceData(0, this._data.length, newValue); } }); /** * nodeValue is a string representing the textual data contained in this CharacterData node. * * @class CharacterData * @property nodeValue * @type {string} */ Object.defineProperty(CharacterData.prototype, 'nodeValue', { enumerable: true, configurable: false, get: function() { return this._data; } }); /** * The length of the string used as textual data for this CharacterData node. * * @class CharacterData * @property length * @type {Number} */ Object.defineProperty(CharacterData.prototype, 'length', { enumerable: true, configurable: false, get: function() { return this._data.length; } }); /** * Returns a string containing the part of CharacterData.data of the specified length and starting at the * specified offset. * * @method substringData * * @param {number} offset An integer between 0 and the length of the string. * @param {number} [count] An integer between 0 and the length of the string. * * @return {string} The substring extracted from the textual data of this CharacterData node. */ CharacterData.prototype.substringData = function(offset, count) { return this._data.substr(offset, count); }; /** * Appends the given string to the CharacterData.data string; when this method returns, data contains the * concatenated string. * * @method appendData * * @param {string} data Is a string representing the textual data to append to the CharacterData node. */ CharacterData.prototype.appendData = function(data) { this.replaceData(this.length, 0, data); }; /** * Inserts the specified characters, at the specified offset, in the CharacterData.data string; when this method * returns, data contains the modified string. * * @method insertData * * @param {number} offset An integer between 0 and the length of the string. * @param {string} data Is a string representing the textual data to insert into the CharacterData node. */ CharacterData.prototype.insertData = function(offset, data) { this.replaceData(offset, 0, data); }; /** * Removes the specified amount of characters, starting at the specified offset, from the CharacterData.data * string; when this method returns, data contains the shortened string. * * @method deleteData * * @param {number} offset An integer between 0 and the length of the string. * @param {number} [count] An integer between 0 and the length of the string. Omitting count means 'delete * from offset to end' */ CharacterData.prototype.deleteData = function(offset, count) { // Omitting count means 'delete from offset to end' if (count === undefined) count = this.length - offset; this.replaceData(offset, count, ''); }; /** * Replaces the specified amount of characters, starting at the specified offset, with the specified string; * when this method returns, data contains the modified string. * * @method replaceData * * @param {number} offset An integer between 0 and the length of the string. * @param {number} count An integer between 0 and the length of the string. * @param {string} data Is a string representing the textual data to use as replacement for the * CharacterData node. */ CharacterData.prototype.replaceData = function(offset, count, data) { var length = this.length; if (offset > length) offset = length; if (offset + count > length) count = length - offset; var before = this.substringData(0, offset), after = this.substringData(offset + count), newData = before + data + after; if (newData !== this._data) { // Queue mutation record var record = new MutationRecord('characterData', this); record.oldValue = this._data; util.queueMutationRecord(record); // Replace data this._data = newData; } // Update ranges var document = this.ownerDocument || this; for (var iRange = 0, nRanges = document.ranges.length; iRange < nRanges; ++iRange) { var range = document.ranges[iRange]; if (range.startContainer === this && range.startOffset > offset && range.startOffset <= offset + count) range.setStart(range.startContainer, offset); if (range.endContainer === this && range.endOffset > offset && range.endOffset <= offset + count) range.setEnd(range.endContainer, offset); var startOffset = range.startOffset, endOffset = range.endOffset; if (range.startContainer === this && startOffset > offset + count) { range.setStart(range.startContainer, startOffset - count + data.length); } if (range.endContainer === this && endOffset > offset + count) { range.setEnd(range.endContainer, endOffset - count + data.length); } } }; return CharacterData; } );
import { IconCheckCircle, IconErrorCircle } from 'packages/icon' export default { name: 'CStep', props: { stepKey: String, title: String, description: String, status: String }, inject: { $steps: { default: null } }, computed: { currentStatus() { const { status } = this if (status) { return status } if (this.$steps.currentKey) { const { currentKey, steps: siblings } = this.$steps const currentStep = siblings.findIndex(step => { return step.stepKey === currentKey }) const index = siblings.indexOf(this) if (index === currentStep) { return 'process' } if (index < currentStep || Number(currentKey) === siblings.length + 1) { return 'finish' } return 'wait' } return 'wait' } }, mounted() { this.$steps?.steps.push(this) }, destroyed() { if (!this.$steps || !Array.isArray(this.$steps.steps)) { return } this.$steps.steps = this.$steps?.steps.filter(step => step !== this) }, methods: { getIcon() { const { stepKey, currentStatus, $scopedSlots } = this if ($scopedSlots.icon?.()) { return $scopedSlots.icon?.() } if (currentStatus === 'finish') return <IconCheckCircle /> if (currentStatus === 'error') return <IconErrorCircle /> return <span class="c-step__icon-num">{stepKey}</span> } }, render(h) { const { $scopedSlots, description } = this const classNames = [ 'c-step', `c-step--${this.currentStatus}`, description ? null : 'c-step--has-no-desc' ] const { isDot } = this.$steps const iconOrDot = isDot ? ( <div class="c-step__dot"></div> ) : ( <div class="c-step__icon">{this.getIcon()}</div> ) const titleContent = $scopedSlots.title?.() || this.title const descContent = $scopedSlots.description?.() || this.description return ( <div class={classNames}> {iconOrDot} <div class="c-step__content"> <div class="c-step__title">{titleContent}</div> <div class="c-step__desc">{descContent}</div> </div> </div> ) } }
new Promise(r => { console.log("A") r() }).then( async (resp) => { console.log("B") new Promise(async (resolve)=> { console.log("C1") throw new Error('xxx') }).then(r => { console.log("C2") }) return }).then( r => { console.log("D") }) new Promise(r => { console.log("E") })
module.exports = { FILE_PATH : __dirname + '/uploads', ENCODE_PATH : __dirname + '/encode', HOST : 'localhost' };
'use strict'; System.config({ baseURL: '/' });
var A4Object = /** @class */ (function () { function A4Object(name, sort) { // modifiers to the shape: this.sprite_offs_x = 0; this.sprite_offs_y = 0; this.pixel_width = 0; // if these are != 0 they are used, otherwise, widht/height are calculated from the current Animation this.pixel_height = 0; this.pixel_tallness = 0; //layer:number; this.map = null; this.animations = null; this.currentAnimation = A4_ANIMATION_IDLE; this.previousSeeThrough = null; this.cycle = 0; this.deadRequest = false; // this is set to true, when the script "die" is executed // pixel width/height cache: this.pixel_width_cache_cycle = -1; this.pixel_width_cache = 0; this.pixel_height_cache = 0; // attributes: this.gold = 0; this.takeable = false; this.usable = false; this.interacteable = false; this.burrowed = false; this.canSwim = false; this.canWalk = true; this.drawDarkIfNoLight = true; // If this is set to false, turning the light off will not affect this object // this is used, for example, for objects that emit their own light this.direction = A4_DIRECTION_NONE; // scripts: this.eventScripts = new Array(A4_NEVENTS); // script excution queues (these contain scripts that are pending execution, will be executed in the next "cycle"): this.scriptQueues = []; // story state: this.storyState = {}; this.lastTimeStoryStateChanged = 0; // agendas: this.agendas = []; // list of properties that the AI will perceive this object having: this.perceptionProperties = []; this.ID = "" + A4Object.s_nextID++; this.name = name; this.sort = sort; this.animations = new Array(A4_N_ANIMATIONS); for (var i = 0; i < A4_N_ANIMATIONS; i++) this.animations[i] = null; } A4Object.prototype.loadObjectAdditionalContent = function (xml, game, of, objectsToRevisit_xml, objsctsToRevisit_object) { // add animations: var animations_xml = getElementChildrenByTag(xml, "animation"); for (var i = 0; i < animations_xml.length; i++) { var animation_xml = animations_xml[i]; var a = A4Animation.fromXML(animation_xml, game); for (var idx = 0; idx < A4_N_ANIMATIONS; idx++) { if (animationNames[idx] == animation_xml.getAttribute("name")) { this.setAnimation(idx, a); a = null; break; } } if (a != null) console.error("A4ObjectFactory: not supported animation " + animation_xml.getAttribute("name")); } // set attributes (we allow them to be either "attribute" tags, or the "property" tags set by TILED): var canWalkSet = false; var canSwimSet = false; var attributes_xml = getElementChildrenByTag(xml, "attribute"); for (var i = 0; i < attributes_xml.length; i++) { var attribute_xml = attributes_xml[i]; var a_name = attribute_xml.getAttribute("name"); if (a_name == "canSwim") { canSwimSet = true; this.canSwim = false; if (attribute_xml.getAttribute("value") == "true") this.canSwim = true; } else if (a_name == "canWalk") { canWalkSet = true; this.canWalk = false; if (attribute_xml.getAttribute("value") == "true") this.canWalk = true; } else if (!this.loadObjectAttribute(attribute_xml)) { console.error("Unknown attribute: " + a_name + " for object " + xml.getAttribute("class")); } } var properties_l_xml = getFirstElementChildByTag(xml, "properties"); if (properties_l_xml != null) { var properties_xml = getElementChildrenByTag(properties_l_xml, "property"); for (var i = 0; i < properties_xml.length; i++) { var attribute_xml = properties_xml[i]; var a_name = attribute_xml.getAttribute("name"); if (a_name == "canSwim") { canSwimSet = true; this.canSwim = false; if (attribute_xml.getAttribute("value") == "true") this.canSwim = true; } else if (a_name == "canWalk") { canWalkSet = true; this.canWalk = false; if (attribute_xml.getAttribute("value") == "true") this.canWalk = true; } else if (!this.loadObjectAttribute(attribute_xml)) { console.error("Unknown attribute: " + a_name + " for object " + xml.getAttribute("class")); } } } if (canWalkSet) { if (!canSwimSet) this.canSwim = !this.canWalk; } else { if (canSwimSet) this.canWalk = !this.canSwim; } // loading scripts: { // on start: var onstarts_xml = getElementChildrenByTag(xml, "onStart"); for (var i = 0; i < onstarts_xml.length; i++) { var onstart_xml = onstarts_xml[i]; var tmpq = null; // let onstart_xml_l:NodeListOf<Element> = onstart_xml.children; var onstart_xml_l = onstart_xml.children; for (var j = 0; j < onstart_xml_l.length; j++) { var script_xml = onstart_xml_l[j]; var s = A4Script.fromXML(script_xml); if (tmpq == null) tmpq = new A4ScriptExecutionQueue(this, null, null, null); tmpq.scripts.push(s); } if (tmpq != null) this.scriptQueues.push(tmpq); } // on end: var onends_xml = getElementChildrenByTag(xml, "onEnd"); for (var i = 0; i < onends_xml.length; i++) { var onend_xml = onends_xml[i]; // let script_xml_l:NodeListOf<Element> = onend_xml.children; var script_xml_l = onend_xml.children; for (var j = 0; j < script_xml_l.length; j++) { var script_xml = script_xml_l[j]; var s = A4Script.fromXML(script_xml); if (this.eventScripts[A4_EVENT_END] == null) this.eventScripts[A4_EVENT_END] = []; this.eventScripts[A4_EVENT_END].push(new A4EventRule(A4_EVENT_END, s, false, 0, 0)); } } // event rules: var eventrules_xml = getElementChildrenByTag(xml, "eventRule"); for (var i = 0; i < eventrules_xml.length; i++) { var rule_xml = eventrules_xml[i]; var r = A4EventRule.fromXML(rule_xml); if (this.eventScripts[r.event] == null) this.eventScripts[r.event] = []; this.eventScripts[r.event].push(r); } } // perception properties: this.perceptionProperties = []; for (var _i = 0, _a = getElementChildrenByTag(xml, "perceptionProperty"); _i < _a.length; _i++) { var prop_xml = _a[_i]; this.perceptionProperties.push(prop_xml.getAttribute("value")); } // the coordinates in the xml files are of the top-left of the object (as it's easier to // edit it this way in Tiled), so, we need to correct by adding tallness: if (xml.getAttribute("x") != null) { this.x = Number(xml.getAttribute("x")); this.y = Number(xml.getAttribute("y")) + this.pixel_tallness; } this.pixel_height -= this.pixel_tallness; }; A4Object.prototype.loadObjectAttribute = function (attribute_xml) { var name = attribute_xml.getAttribute("name"); /* if (name == "ID") { this.ID = attribute_xml.getAttribute("value"); if (A4Object.s_nextID <= Number(this.ID)) A4Object.s_nextID = Number(this.ID)+1; return true; } else */ if (name == "name") { this.name = attribute_xml.getAttribute("value"); return true; } else if (name == "gold" || name == "value") { this.gold = Number(attribute_xml.getAttribute("value")); return true; } else if (name == "takeable") { this.takeable = false; if (attribute_xml.getAttribute("value") == "true") this.takeable = true; return true; } else if (name == "usable" || name == "useable") { this.usable = false; if (attribute_xml.getAttribute("value") == "true") this.usable = true; return true; } else if (name == "interacteable") { this.interacteable = false; if (attribute_xml.getAttribute("value") == "true") this.interacteable = true; return true; } else if (name == "burrowed") { this.burrowed = false; if (attribute_xml.getAttribute("value") == "true") this.burrowed = true; return true; } else if (name == "direction") { this.direction = Number(attribute_xml.getAttribute("value")); this.currentAnimation = A4_ANIMATION_IDLE_LEFT + this.direction; // console.log(this.name + ".direction = " + this.direction); return true; } else if (name == "tallness") { this.pixel_tallness = Number(attribute_xml.getAttribute("value")); return true; } else if (name == "sprite_offs_x") { this.sprite_offs_x = Number(attribute_xml.getAttribute("value")); return true; } else if (name == "sprite_offs_y") { this.sprite_offs_y = Number(attribute_xml.getAttribute("value")); return true; } else if (name == "pixel_width") { this.pixel_width = Number(attribute_xml.getAttribute("value")); return true; } else if (name == "pixel_height") { this.pixel_height = Number(attribute_xml.getAttribute("value")); return true; } else if (name == "drawDarkIfNoLight") { this.drawDarkIfNoLight = false; if (attribute_xml.getAttribute("value") == "true") this.drawDarkIfNoLight = true; return true; } return false; }; A4Object.prototype.revisitObject = function (xml, game) { }; A4Object.prototype.pushScripttoExecute = function (script, map, game, otherCharacter) { var sq = new A4ScriptExecutionQueue(this, map, game, otherCharacter); sq.scripts.push(script); this.addScriptQueue(sq); }; A4Object.prototype.saveToXML = function (game, type, saveLocation) { var xmlString = "<object id=\"" + this.ID + "\""; if (type == 0) { xmlString += " type=\"" + this.sort.name + "\""; xmlString += " completeRedefinition=\"true\""; } else if (type == 1) { xmlString += " name=\"" + this.name + "\""; xmlString += " type=\"Bridge\""; } else if (type == 2) { xmlString += " name=\"" + this.name + "\""; xmlString += " type=\"BridgeDestination\""; } if (saveLocation) { // Coordinates in xml do not take tallness into account (it's easier to see it this way // in Tiled), so, we correct by subtracting tallness: xmlString += " x=\"" + this.x + "\""; xmlString += " y=\"" + (this.y - this.pixel_tallness) + "\""; xmlString += " width=\"" + this.getPixelWidth() + "\""; xmlString += " height=\"" + (this.getPixelHeight() + this.pixel_tallness) + "\""; } xmlString += ">\n"; xmlString += this.savePropertiesToXML(game) + "\n"; for (var _i = 0, _a = this.perceptionProperties; _i < _a.length; _i++) { var prop = _a[_i]; xmlString += "<perceptionProperty value=\"" + prop + "\"/>\n"; } xmlString += "</object>"; return xmlString; }; A4Object.prototype.saveToXMLForMainFile = function (game, tag, mapNumber) { var xmlString = ""; xmlString += "<" + tag + " id=\"" + this.ID + "\"" + " type=\"" + this.sort.name + "\"" + " completeRedefinition=\"true\"" + " x=\"" + this.x + "\"" + " y=\"" + this.y + "\"" + " map=\"" + mapNumber + "\">\n"; xmlString += this.savePropertiesToXML(game); xmlString += "</" + tag + ">"; return xmlString; }; A4Object.prototype.savePropertiesToXML = function (game) { var xmlString = ""; for (var i = 0; i < A4_N_ANIMATIONS; i++) { if (this.animations[i] != null) { xmlString += this.animations[i].saveToXML(animationNames[i]) + "\n"; } } if (this.name != null) xmlString += this.saveObjectAttributeToXML("name", this.name) + "\n"; if (this.gold > 0) xmlString += this.saveObjectAttributeToXML("gold", this.gold) + "\n"; if (this.isCharacter() || this.isVehicle()) { xmlString += this.saveObjectAttributeToXML("canWalk", this.canWalk) + "\n"; xmlString += this.saveObjectAttributeToXML("canSwim", this.canSwim) + "\n"; } xmlString += this.saveObjectAttributeToXML("takeable", this.takeable) + "\n"; xmlString += this.saveObjectAttributeToXML("usable", this.usable) + "\n"; xmlString += this.saveObjectAttributeToXML("interacteable", this.interacteable) + "\n"; xmlString += this.saveObjectAttributeToXML("burrowed", this.burrowed) + "\n"; xmlString += this.saveObjectAttributeToXML("direction", this.direction) + "\n"; if (this.pixel_tallness != 0) xmlString += this.saveObjectAttributeToXML("tallness", this.pixel_tallness) + "\n"; if (this.sprite_offs_x != 0) xmlString += this.saveObjectAttributeToXML("sprite_offs_x", this.sprite_offs_x) + "\n"; if (this.sprite_offs_y != 0) xmlString += this.saveObjectAttributeToXML("sprite_offs_y", this.sprite_offs_y) + "\n"; if (this.pixel_width != 0) xmlString += this.saveObjectAttributeToXML("pixel_width", this.pixel_width) + "\n"; if (this.pixel_height != 0) xmlString += this.saveObjectAttributeToXML("pixel_height", this.pixel_height + this.pixel_tallness) + "\n"; if (!this.drawDarkIfNoLight) xmlString += this.saveObjectAttributeToXML("drawDarkIfNoLight", this.drawDarkIfNoLight) + "\n"; var onStarttagOpen = false; for (var v in this.storyState) { if (!onStarttagOpen) { xmlString += "<onStart>\n"; onStarttagOpen = true; } xmlString += "<storyState variable=\"" + v + "\"" + " value=\"" + this.storyState[v] + "\"" + " scope=\"object\"/>\n"; } if (onStarttagOpen) xmlString += "</onStart>\n"; // each execution queue goes to its own "onStart" block: for (var _i = 0, _a = this.scriptQueues; _i < _a.length; _i++) { var seq = _a[_i]; xmlString += "<onStart>\n"; for (var _b = 0, _c = seq.scripts; _b < _c.length; _b++) { var s = _c[_b]; xmlString += s.saveToXML() + "\n"; } xmlString += "</onStart>\n"; } if (this.deadRequest) { xmlString += "<onStart>\n"; xmlString += "<die/>\n"; xmlString += "</onStart>\n"; } if (this.agendas.length > 0) { xmlString += "<onStart>\n"; // create a script for the agenda for (var _d = 0, _e = this.agendas; _d < _e.length; _d++) { var a = _e[_d]; xmlString += "<addAgenda agenda=\"" + a.name + "\"" + " duration=\"" + a.duration + "\"" + " loop=\"" + a.loop + "\"" + " cycle=\"" + a.cycle + "\">\n"; for (var _f = 0, _g = a.entries; _f < _g.length; _f++) { var ae = _g[_f]; xmlString += "<entry time=\"" + ae.time + "\">\n"; for (var _h = 0, _j = ae.scripts; _h < _j.length; _h++) { var s = _j[_h]; xmlString += s.saveToXML() + "\n"; } xmlString += "</entry>\n"; } xmlString += "</addAgenda>\n"; } xmlString += "</onStart>\n"; } // rules: for (var i = 0; i < A4_NEVENTS; i++) { if (this.eventScripts[i] != null) { for (var _k = 0, _l = this.eventScripts[i]; _k < _l.length; _k++) { var er = _l[_k]; xmlString += er.saveToXML() + "\n"; } } } return xmlString; }; A4Object.prototype.saveObjectAttributeToXML = function (property, value) { return "<attribute name=\"" + property + "\" value=\"" + value + "\"/>"; }; A4Object.prototype.update = function (game) { this.executeScriptQueues(game); // this has to be done first, since "onStart" is put here if (this.cycle == 0) this.event(A4_EVENT_START, null, this.map, game); if (this.eventScripts[A4_EVENT_TIMER] != null) { for (var _i = 0, _a = this.eventScripts[A4_EVENT_TIMER]; _i < _a.length; _i++) { var r = _a[_i]; r.execute(this, this.map, game, null); } } if (this.eventScripts[A4_EVENT_STORYSTATE] != null) { for (var _b = 0, _c = this.eventScripts[A4_EVENT_STORYSTATE]; _b < _c.length; _b++) { var r = _c[_b]; r.execute(this, this.map, game, null); } } var toDelete = []; for (var _d = 0, _e = this.agendas; _d < _e.length; _d++) { var a = _e[_d]; if (a.execute(this, this.map, game, null)) toDelete.push(a); } for (var _f = 0, toDelete_1 = toDelete; _f < toDelete_1.length; _f++) { var a = toDelete_1[_f]; var idx = this.agendas.indexOf(a); this.agendas.splice(idx, 1); } if (this.map != null) { // only for those items actually on a map (and not inside of others) // change to the proper animation given the current direction: if (this.currentAnimation == A4_ANIMATION_IDLE && this.direction != A4_DIRECTION_NONE) { this.currentAnimation = this.direction + 1; } if (this.animations[this.currentAnimation] != null) { if (!this.animations[this.currentAnimation].update()) { if (this.previousSeeThrough != this.animations[this.currentAnimation].seeThrough) { //console.log("object " + this.name + " changed seeThrough from " + this.previousSeeThrough + " to " + !this.previousSeeThrough); this.map.reevaluateVisibilityRequest(); this.previousSeeThrough = !this.previousSeeThrough; } } } } if (this.deadRequest) return false; this.cycle++; return true; }; A4Object.prototype.draw = function (offsetx, offsety, game) { if (this.currentAnimation >= 0 && this.animations[this.currentAnimation] != null) { // debugging: draw the base of the object in red color to check collisions // ctx.fillStyle = "red"; // ctx.fillRect((this.x + offsetx) - this.sprite_offs_x, // (this.y + offsety) - this.sprite_offs_y, // this.getPixelWidth(), this.getPixelHeight()); this.animations[this.currentAnimation].draw((this.x + offsetx) - this.sprite_offs_x, (this.y + offsety) - this.sprite_offs_y - this.pixel_tallness); } }; A4Object.prototype.drawDark = function (offsetx, offsety, game) { if (this.drawDarkIfNoLight) { if (this.currentAnimation >= 0 && this.animations[this.currentAnimation] != null) { this.animations[this.currentAnimation].drawDark((this.x + offsetx) - this.sprite_offs_x, (this.y + offsety) - this.sprite_offs_y - this.pixel_tallness); } } else { this.draw(offsetx, offsety - this.pixel_tallness, game); } }; // this executes all the A4EventRules with the given event: A4Object.prototype.event = function (event, otherCharacter, map, game) { if (this.eventScripts[event] == null) return false; for (var _i = 0, _a = this.eventScripts[event]; _i < _a.length; _i++) { var rule = _a[_i]; rule.executeEffects(this, map, game, otherCharacter); } return true; }; A4Object.prototype.eventWithID = function (event, ID, otherCharacter, map, game) { }; A4Object.prototype.eventWithObject = function (event, otherCharacter, object, map, game) { if (this.eventScripts[event] == null) return; for (var _i = 0, _a = this.eventScripts[event]; _i < _a.length; _i++) { var rule = _a[_i]; if (event == A4_EVENT_RECEIVE || event == A4_EVENT_ACTION_TAKE || event == A4_EVENT_ACTION_DROP || event == A4_EVENT_ACTION_USE || event == A4_EVENT_ACTION_INTERACT || event == A4_EVENT_ACTION_CHOP || event == A4_EVENT_ACTION_GIVE || event == A4_EVENT_ACTION_SELL || event == A4_EVENT_ACTION_BUY) { if (rule.item == null || object.name == rule.item || object.is_a_string(rule.item)) { rule.executeEffects(this, map, game, otherCharacter); } } else { console.error("eventWithObject for event " + event + ", is undefined\n"); } } }; A4Object.prototype.eventWithInteger = function (event, value, otherCharacter, map, game) { if (this.eventScripts[event] == null) return; for (var _i = 0, _a = this.eventScripts[event]; _i < _a.length; _i++) { var rule = _a[_i]; console.error("eventWithInteger for event " + event + " is undefined, cannot execute rule: " + rule); } }; A4Object.prototype.executeScriptQueues = function (game) { var toDelete = []; for (var _i = 0, _a = this.scriptQueues; _i < _a.length; _i++) { var seb = _a[_i]; while (true) { var s = seb.scripts[0]; var retval = s.execute((seb.object == null ? this : seb.object), (seb.map == null ? this.map : seb.map), (seb.game == null ? game : seb.game), seb.otherCharacter); if (retval == SCRIPT_FINISHED) { seb.scripts.splice(0, 1); if (seb.scripts.length == 0) { toDelete.push(seb); break; } } else if (retval == SCRIPT_NOT_FINISHED) { break; } else if (retval == SCRIPT_FAILED) { toDelete.push(seb); break; } } } for (var _b = 0, toDelete_2 = toDelete; _b < toDelete_2.length; _b++) { var seb = toDelete_2[_b]; var idx = this.scriptQueues.indexOf(seb); this.scriptQueues.splice(idx, 1); } }; A4Object.prototype.addScriptQueue = function (seq) { this.scriptQueues.push(seq); }; A4Object.prototype.addEventRule = function (event, r) { if (this.eventScripts[event] == null) this.eventScripts[event] = []; this.eventScripts[event].push(r); }; A4Object.prototype.setStoryStateVariable = function (variable, value, game) { // console.log("A4Object.setStoryStateVariable ("+this.ID+"): " + variable + " = " + value + " (at time " + game.cycle + ")"); this.storyState[variable] = value; this.lastTimeStoryStateChanged = game.cycle; }; A4Object.prototype.getStoryStateVariable = function (variable) { return this.storyState[variable]; }; A4Object.prototype.warp = function (x, y, map) { var reAdd = true; if (this.map != null) reAdd = this.map.removeObject(this); this.x = x; this.y = y; this.map = map; if (reAdd && this.map != null) this.map.addObject(this); }; A4Object.prototype.getPixelWidth = function () { if (this.pixel_width > 0) return this.pixel_width; if (this.pixel_width_cache_cycle == this.cycle) return this.pixel_width_cache; if (this.currentAnimation < 0) return 0; var a = this.animations[this.currentAnimation]; if (a == null) return 0; this.pixel_width_cache = a.getPixelWidth(); this.pixel_height_cache = a.getPixelHeight() - this.pixel_tallness; this.pixel_width_cache_cycle = this.cycle; return this.pixel_width_cache; }; A4Object.prototype.getPixelHeight = function () { if (this.pixel_height > 0) return this.pixel_height; if (this.pixel_width_cache_cycle == this.cycle) return this.pixel_height_cache; if (this.currentAnimation < 0) return 0; var a = this.animations[this.currentAnimation]; if (a == null) return 0; this.pixel_width_cache = a.getPixelWidth(); this.pixel_height_cache = a.getPixelHeight() - this.pixel_tallness; this.pixel_width_cache_cycle = this.cycle; return this.pixel_height_cache; }; A4Object.prototype.setAnimation = function (idx, a) { this.animations[idx] = a; }; A4Object.prototype.getAnimation = function (idx) { return this.animations[idx]; }; A4Object.prototype.getCurrentAnimation = function () { return this.animations[this.currentAnimation]; }; A4Object.prototype.die = function () { this.deadRequest = true; }; A4Object.prototype.isWalkable = function () { return true; }; A4Object.prototype.isHeavy = function () { return false; }; // this is used by pressure plates A4Object.prototype.isPlayer = function () { return false; }; // isInteracteable():boolean {return false;} A4Object.prototype.isKey = function () { return false; }; A4Object.prototype.isCharacter = function () { return false; }; A4Object.prototype.isDoor = function () { return false; }; A4Object.prototype.isVehicle = function () { return false; }; A4Object.prototype.isAICharacter = function () { return false; }; A4Object.prototype.isTrigger = function () { return false; }; A4Object.prototype.isPushable = function () { return false; }; A4Object.prototype.respawns = function () { return false; }; A4Object.prototype.seeThrough = function () { var a = this.animations[this.currentAnimation]; if (a == null) return true; return a.seeThrough; }; A4Object.prototype.collision = function (x2, y2, dx2, dy2) { var dx = this.getPixelWidth(); var dy = this.getPixelHeight(); if (this.x + dx > x2 && x2 + dx2 > this.x && this.y + dy > y2 && y2 + dy2 > this.y) return true; return false; }; A4Object.prototype.collisionObject = function (o2) { var dx = this.getPixelWidth(); var dy = this.getPixelHeight(); var dx2 = o2.getPixelWidth(); var dy2 = o2.getPixelHeight(); if (this.x + dx > o2.x && o2.x + dx2 > this.x && this.y + dy > o2.y && o2.y + dy2 > this.y) return true; return false; }; A4Object.prototype.collisionObjectOffset = function (xoffs, yoffs, o2) { var dx = this.getPixelWidth(); var dy = this.getPixelHeight(); var dx2 = o2.getPixelWidth(); var dy2 = o2.getPixelHeight(); if (this.x + xoffs + dx > o2.x && o2.x + dx2 > this.x + xoffs && this.y + yoffs + dy > o2.y && o2.y + dy2 > this.y + yoffs) return true; return false; }; A4Object.prototype.canMove = function (direction, treatBridgesAsWalls) { if (treatBridgesAsWalls) { if (this.canMoveWithoutGoingThroughABridge(direction)) return true; return false; } if (this.map.walkableConsideringVehicles(this.x + direction_x_inc[direction] * this.map.tileWidth, this.y + direction_y_inc[direction] * this.map.tileHeight, this.getPixelWidth(), this.getPixelHeight(), this)) return true; return false; }; A4Object.prototype.canMoveIgnoringObject = function (direction, treatBridgesAsWalls, toIgnore) { if (treatBridgesAsWalls) { if (this.canMoveWithoutGoingThroughABridgeIgnoringObject(direction, toIgnore)) return true; return false; } if (this.map.walkableIgnoringObject(this.x + direction_x_inc[direction] * this.map.tileWidth, this.y + direction_y_inc[direction] * this.map.tileHeight, this.getPixelWidth(), this.getPixelHeight(), this, toIgnore)) return true; return false; }; A4Object.prototype.canMoveWithoutGoingThroughABridge = function (direction) { if (this.map.getBridge(Math.floor(this.x + direction_x_inc[direction] * this.map.tileWidth + this.getPixelWidth() / 2), Math.floor(this.y + direction_y_inc[direction] * this.map.tileHeight + this.getPixelHeight() / 2)) != null) return false; if (this.map.walkableConsideringVehicles(this.x + direction_x_inc[direction] * this.map.tileWidth, this.y + direction_y_inc[direction] * this.map.tileHeight, this.getPixelWidth(), this.getPixelHeight(), this)) return true; return false; }; A4Object.prototype.canMoveWithoutGoingThroughABridgeIgnoringObject = function (direction, toIgnore) { if (this.map.getBridge(Math.floor(this.x + direction_x_inc[direction] * this.map.tileWidth + this.getPixelWidth() / 2), Math.floor(this.y + direction_y_inc[direction] * this.map.tileHeight + this.getPixelHeight() / 2)) != null) return false; if (this.map.walkableIgnoringObject(this.x + direction_x_inc[direction] * this.map.tileWidth, this.y + direction_y_inc[direction] * this.map.tileHeight, this.getPixelWidth(), this.getPixelHeight(), this, toIgnore)) return true; return false; }; A4Object.prototype.pixelDistance = function (o2) { var dx = 0; if (this.x > o2.x + o2.getPixelWidth()) { dx = this.x - (o2.x + o2.getPixelWidth()); } else if (o2.x > this.x + this.getPixelWidth()) { dx = o2.x - (this.x + this.getPixelWidth()); } var dy = 0; if (this.y > o2.y + o2.getPixelHeight()) { dy = this.y - (o2.y + o2.getPixelHeight()); } else if (o2.y > this.y + this.getPixelHeight()) { dy = o2.y - (this.y + this.getPixelHeight()); } return dx + dy; }; A4Object.prototype.pixelDistanceBetweenCentersOffset = function (o2, o2xoff, o2yoff) { var dx = (this.x + this.getPixelWidth() / 2) - (o2xoff + o2.x + o2.getPixelWidth() / 2); var dy = (this.y + this.getPixelHeight() / 2) - (o2yoff + o2.y + o2.getPixelHeight() / 2); return Math.sqrt(dx * dx + dy * dy); }; A4Object.prototype.addAgenda = function (a) { this.removeAgenda(a.name); this.agendas.push(a); }; A4Object.prototype.removeAgenda = function (agenda) { for (var _i = 0, _a = this.agendas; _i < _a.length; _i++) { var a2 = _a[_i]; if (a2.name == agenda) { var idx = this.agendas.indexOf(a2); this.agendas.splice(idx, 1); return; } } }; A4Object.prototype.objectRemoved = function (o) { }; A4Object.prototype.findObjectByName = function (name) { return null; }; A4Object.prototype.findObjectByID = function (ID) { return null; }; // sorts: A4Object.prototype.is_a = function (s) { return this.sort.is_a(s); }; A4Object.prototype.is_a_string = function (s) { return this.sort.is_a_string(s); }; A4Object.s_nextID = 10000; // start with a high-enough number so that there is no collisions with the maps return A4Object; }());
import React from "react" import Matter from "matter-js" const wsClient = new WebSocket('ws://patricks-macbook-pro.local:8080') let isCalibrating = false; const config = { canvas: { width: window.outerWidth - 20, height: window.outerHeight - 100 }, walls: { color: '#aaa' }, paddles: { color: '#79f' }, puck: { color: '#f77' }, calibrate: [{x: 0, y: 0}, {x: 0, y: 0}] }; function calibrateControllers(data){ config.calibrate[0].x = data.x config.calibrate[0].y = data.y } let game = {} const Engine = Matter.Engine, Render = Matter.Render, World = Matter.World, Bodies = Matter.Bodies, Events = Matter.Events, Body = Matter.Body function createWall(engine, x, y, w, h) { var body = Bodies.rectangle(x, y, w, h, {isStatic: true}); body.render.fillStyle = config.walls.color; body.render.strokeStyle = body.render.fillStyle; World.add(engine.world, [body]); return body; } function createPaddle(engine, x, y) { var body = Bodies.circle(x, y, 40); body.mass = 100; body.frictionAir = 0.15; body.render.fillStyle = config.paddles.color; body.render.strokeStyle = body.render.fillStyle; World.add(engine.world, [body]); return body; } function createPuck(engine, x, y) { var body = Bodies.circle(x, y, 30); body.restitution = 1; body.frictionAir = 0.001; body.render.fillStyle = config.puck.color; body.render.strokeStyle = body.render.fillStyle; World.add(engine.world, [body]); return body; } function createObjects(game) { var engine = game.engine; var w = config.canvas.width; var h = config.canvas.height; // Top createWall(engine, w / 2, 5, w, 10); // Bottom createWall(engine, w / 2, h - 5, w, 10); // Left createWall(engine, 5, 65, 10, 110); createWall(engine, 5, h - 65, 10, 110); // Right createWall(engine, w - 5, 65, 10, 110); createWall(engine, w - 5, h - 64, 10, 110); // Create the paddles game.paddleA = createPaddle(engine, 100, h / 2); game.paddleB = createPaddle(engine, w - 100, h / 2); // Create the puck game.puck = createPuck(engine, w / 2, h / 2); } function update(game) { updatePaddle(game); updatePuck(game); } function randomizeGame(game) { var w = config.canvas.width; var h = config.canvas.height; Body.setPosition(game.paddleA, { x: Math.random() * (w / 2 - 20) + 10, y: Math.random() * (h - 20) + 10 }); Body.setPosition(game.paddleB, { x: w - Math.random() * (w / 2 - 20) + 10, y: Math.random() * (h - 20) + 10 }); Body.setPosition(game.puck, { x: Math.random() * (w - 20) + 10, y: Math.random() * (h - 20) + 10 }); Body.setVelocity(game.puck, { x: Math.random() * 20 - 10, y: Math.random() * 20 - 10 }); } function updatePaddle(game, data) { if (data){ let {x, y, acceleration, paddleId = 0} = data; x = x + (-1 * config.calibrate[0].x) y = y + (-1 * config.calibrate[0].y) var f = 0.1; var min = 0.0; var force = {x: 0, y: 0}; var paddle = paddleId == 0 ? game.paddleA : game.paddleA; var directions = [0, 0, 0, 0]; if (x > min) { force.y -= f; directions[0] = 1; } if (y > min) { force.x += f; directions[1] = 1; } if (x < min * -1) { force.y += f; directions[2] = 1; } if (y < min * -1) { force.x -= f; directions[3] = 1; } if (directions[0] || directions[1] || directions[2] || directions[3]) { Body.applyForce(paddle, paddle.position, force); } if (paddleId == 0){ if (paddle.position.x > config.canvas.width / 2 - 40) { // Keep paddle on correct side var offset = (config.canvas.width / 2 - 40) - paddle.position.x; Body.applyForce(paddle, paddle.position, {x: offset * 0.05, y: 0}); } if (paddle.position.x < 40) { // Keep paddle out of goal var offset = 40 - paddle.position.x; Body.applyForce(paddle, paddle.position, {x: offset * 0.05, y: 0}); } } else { if (paddle.position.x < config.canvas.width / 2 + 40) { // Keep paddle on correct side var offset = (config.canvas.width / 2 + 40) - paddle.position.x; Body.applyForce(paddle, paddle.position, {x: offset * 0.05, y: 0}); } if (paddle.position.x > config.canvas.width - 40) { // Keep paddle out of goal var offset = (config.canvas.width - 40) - paddle.position.x; Body.applyForce(paddle, paddle.position, {x: offset * 0.05, y: 0}); } } } else { return } } function updatePuck(game) { var puck = game.puck; if (puck.position.x < -30) { randomizeGame(game); } if (puck.position.x > config.canvas.width + 30) { randomizeGame(game); } } export default class Canvas extends React.Component { _calibrate(){ isCalibrating = true; } componentDidMount(){ // Create instance of matter.js engine var engine = Engine.create({ render: { element: this._container, options: { width: config.canvas.width, height: config.canvas.height, wireframes: false } } }); game.engine = engine; // Disable gravity engine.world.gravity.y = 0; // Create game objects createObjects(game); wsClient.onopen = () => { console.log('connected') } wsClient.onmessage = (message) => { const data = JSON.parse(message.data) updatePaddle(game, data) if (isCalibrating) { calibrateControllers(data) isCalibrating = false; } } // Maintain keyboard state var keyStates = {}; game.keyStates = keyStates; document.onkeydown = function(evt) { keyStates[evt.keyCode] = true; }; document.onkeyup = function(evt) { delete keyStates[evt.keyCode]; }; // Listen for update event Events.on(engine, 'beforeUpdate', function(evt) { update(game); }); // run the engine Engine.run(engine); } render(){ return ( <div> <button onClick={this._calibrate}>Calibrate</button> <div ref={c => {this._container = c}}></div> </div> ) } }
angular.module('app', []); angular.module('app').controller('mainCtrl', function mainCtrl($scope) { }); angular.module('app').directive('emperor', function myTransclude() { return { scope: 'true', link: { pre: function (scope, element, attributes, ctrl, transclude) { element.data('name', 'The Emperor'); scope.master = 'The Emperor'; } } } }); angular.module('app').directive('vader', function myTransclude() { return { scope: 'true', link: { pre: function (scope, element, attributes) { element.data('name', 'Vader'); element.data('master', scope.master); console.log('Vader\'s master is ', scope.master); } } } }); angular.module('app').directive('starkiller', function myTransclude() { return { scope: 'true', link: { pre: function (scope, element, attributes) { element.data('name', 'Starkiller'); element.data('master', scope.master); console.log('Starkiller\'s master is ', scope.master); } } } });
var GameLayer = cc.Layer.extend({ mapPanel : null, ui : null, score : 0, level : 0, steps : 0, limitStep : 0, targetScore : 0, map : null, /** * 糖果还在移动,不接受再次点击 */ moving : false, ctor: function () { this._super(); var size = cc.winSize; var bg = new cc.Sprite(res.bg); this.addChild(bg,1); bg.x = size.width /2; bg.y = size.height /2; var clippingPanel = new cc.ClippingNode(); this.addChild(clippingPanel,2); this.mapPanel = new cc.Layer(); this.mapPanel.x = (size.width - Constant.CANDY_WIDTH*Constant.MAP_SIZE)/2; this.mapPanel.y = (size.height - Constant.CANDY_WIDTH*Constant.MAP_SIZE)/2; clippingPanel.addChild(this.mapPanel,1); var stencil = new cc.DrawNode(); stencil.drawRect( cc.p(this.mapPanel.x,this.mapPanel.y), cc.p(this.mapPanel.x+Constant.CANDY_WIDTH*Constant.MAP_SIZE,this.mapPanel.y+Constant.CANDY_WIDTH*Constant.MAP_SIZE), cc.color(0,0,0), 1, cc.color(0,0,0)); clippingPanel.stencil = stencil; if("touches" in cc.sys.capabilities){ cc.eventManager.addListener({ event: cc.EventListener.TOUCH_ONE_BY_ONE, onTouchBegan: this._onTouchBegan.bind(this) },this.mapPanel); } else { cc.eventManager.addListener({ event: cc.EventListener.MOUSE, onMouseDown: this._onMouseDown.bind(this) },this.mapPanel); } this._init(); this.ui = new GameUI(this); this.addChild(this.ui,3); return true; }, _init: function () { //初始化糖果矩阵 this.steps = 0; this.level = Storage.getCurrentLevel(); this.score = Storage.getCurrentScore(); this.limitStep = Constant.levels[this.level].limitStep; this.targetScore = Constant.levels[this.level].targetScore; this.map = []; for(var i = 0 ; i < Constant.MAP_SIZE; i++){ var column = []; for(var j = 0; j < Constant.MAP_SIZE; j++){ var candy = Candy.createRandomType(i,j); this.mapPanel.addChild(candy); candy.x = i * Constant.CANDY_WIDTH + Constant.CANDY_WIDTH /2; candy.y = j * Constant.CANDY_WIDTH + Constant.CANDY_WIDTH/2; column.push(candy); } this.map.push(column); } }, _onTouchBegan: function (touch, event) { var column = Math.floor((touch.getLocation().x - this.mapPanel.x)/Constant.CANDY_WIDTH); var row = Math.floor((touch.getLocation().y - this.mapPanel.y)/Constant.CANDY_WIDTH); this._popCandy(column, row); return true; }, _onMouseDown: function (event) { var column = Math.floor((event.getLocationX() - this.mapPanel.x)/Constant.CANDY_WIDTH); var row = Math.floor((event.getLocationY() - this.mapPanel.y)/Constant.CANDY_WIDTH); this._popCandy(column, row); }, _popCandy: function (column, row) { if(this.moving) return; var joinCandys = [this.map[column][row]]; var index = 0; var pushIntoCandys = function(element){ if(joinCandys.indexOf(element) < 0) joinCandys.push(element); }; while(index < joinCandys.length){ var candy = joinCandys[index]; if(this._checkCandyExist(candy.column-1, candy.row) && this.map[candy.column-1][candy.row].type == candy.type){ pushIntoCandys(this.map[candy.column-1][candy.row]); } if(this._checkCandyExist(candy.column+1, candy.row) && this.map[candy.column+1][candy.row].type == candy.type){ pushIntoCandys(this.map[candy.column+1][candy.row]); } if(this._checkCandyExist(candy.column, candy.row-1) && this.map[candy.column][candy.row-1].type == candy.type){ pushIntoCandys(this.map[candy.column][candy.row-1]); } if(this._checkCandyExist(candy.column, candy.row+1) && this.map[candy.column][candy.row+1].type == candy.type){ pushIntoCandys(this.map[candy.column][candy.row+1]); } index++; } if(joinCandys.length <= 1) return; this.steps++; this.moving = true; for (var i = 0; i < joinCandys.length; i++) { var candy = joinCandys[i]; this.mapPanel.removeChild(candy); this.map[candy.column][candy.row] = null; } this.score += joinCandys.length*joinCandys.length; this._generateNewCandy(); this._checkSucceedOrFail(); }, _checkCandyExist: function (i,j) {//判断行和列是否在矩形范围内 if(i >= 0 && i < Constant.MAP_SIZE && j >= 0 && j < Constant.MAP_SIZE){ return true; } return false; }, _generateNewCandy: function () { var maxTime = 0; for(var i = 0 ; i < Constant.MAP_SIZE; i++){ var missCount = 0; for(var j = 0 ; j < this.map[i].length; j++){ var candy = this.map[i][j]; if(!candy){ candy = Candy.createRandomType(i,Constant.MAP_SIZE + missCount); this.mapPanel.addChild(candy); candy.x = candy.column * Constant.CANDY_WIDTH + Constant.CANDY_WIDTH/2; candy.y = candy.row * Constant.CANDY_WIDTH + Constant.CANDY_WIDTH/2; this.map[i][candy.row] = candy; missCount ++; } else { var fallLength = missCount; if(fallLength > 0){ var duration = Math.sqrt(2 * fallLength / Constant.FALL_ACCELERATION); if(duration > maxTime){ maxTime = duration; } var move = cc.moveTo(duration,candy.x,candy.y - Constant.CANDY_WIDTH*fallLength).easing(cc.easeIn(2));//easeIn参数是幂,以几次幂加速 candy.runAction(move); candy.row -= fallLength; this.map[i][j] = null; this.map[i][candy.row] = candy; } } } //移除超出地图的临时元素位置 for(var j = this.map[i].length; j>= Constant.MAP_SIZE; j--){ this.map[i].splice(j,1); } } this.scheduleOnce(this._finishCandyFalls.bind(this), maxTime); }, _finishCandyFalls: function () { this.moving = false; }, _checkSucceedOrFail: function () { if(this.score > this.targetScore){ this.ui.showSuccess(); this.score += (this.limitStep - this.steps) * 30; Storage.setCurrentLevel(this.level+1); Storage.setCurrentScore(this.score); this.scheduleOnce(function(){ cc.director.runScene(new GameScene()); }, 3); }else if(this.steps >= this.limitStep){ this.ui.showFail(); Storage.setCurrentLevel(0); Storage.setCurrentScore(0); this.scheduleOnce(function(){ cc.director.runScene(new GameScene()); }, 3); } } }); var GameScene = cc.Scene.extend({ onEnter:function () { this._super(); var layer = new GameLayer(); this.addChild(layer); } });
/*global expect*/ describe('positive assertion', function() { it('assert that a number is positive', function() { expect(3, 'to be positive'); }); it('throws when the assertion fails', function() { expect( function() { expect(0, 'to be positive'); }, 'to throw exception', 'expected 0 to be positive' ); }); });
var express = require('express') var router = express.Router() router.get('/', (req, res) => { res.redirect('/#/search') }) module.exports = router
function postGenerator(locals){ var posts = locals.posts.sort('-date').toArray(); var length = posts.length; return posts.map(function(post, i){ var layout = post.layout; var path = post.path; if (!layout || layout === 'false'){ return { path: path, data: post.content }; } else { if (i) post.prev = posts[i - 1]; if (i < length - 1) post.next = posts[i + 1]; var layouts = ['post', 'page', 'index']; if (layout !== 'post') layouts.unshift(layout); return { path: path, layout: layouts, data: post }; } }); } module.exports = postGenerator;
'use strict'; const _ = require('lodash'), Promise = require('bluebird'), EventEmitter = require('events').EventEmitter, Instance = require('./instance'), ScalingError = require('../../common/error/scaling'), winston = require('winston'); module.exports = class Manager extends EventEmitter { constructor(config, stats, providers) { super(); this._config = config; this._stats = stats; this._providers = providers; this._managedInstances = new Map(); this._aliveInstances = []; this._aliveInstancesMap = new Map(); this._domains = new Map(); this._config.scaling.required = this._config.scaling.required || this._config.scaling.min; } get instances() { return Array.from(this._managedInstances.values()); } get aliveInstances() { return this._aliveInstances; } get stats() { return this.instances.map((i) => i.stats); } waitForAliveInstances(count) { winston.debug('[Manager] waitForAliveInstances: count=%d', count); if (this._aliveInstances.length === count) { return Promise.resolve(); } else { return Promise .delay(2000) .then(() => this.waitForAliveInstances(count)); } } start() { const self = this; winston.debug('[Manager] start'); self._checkIntervalTimeout = setInterval(checkInstances, self._config.checkDelay); //////////// function checkInstances() { winston.debug('[Manager] checkInstances'); Promise.map(self._providers, (provider) => provider.models .then((models) => assignProviderToModels(models, provider)) ) .then((modelsByProvider) => _.flatten(modelsByProvider)) .then(updateInstances) .then(adjustInstances) .catch((err) => { if (err instanceof ScalingError) { self.emit('scaling:error', err); } winston.error('[Manager] Error: Cannot update or adjust instances:', err); }); //////////// function assignProviderToModels(models, provider) { models.forEach((model) => { model.provider = provider; }); provider.instancesCount = models.length; return models; } function updateInstances(models) { const existingNames = Array.from(self._managedInstances.keys()); models.forEach((model) => { const name = model.name; // Get provider const provider = model.provider; delete model.provider; let instance = self._managedInstances.get(name); if (instance) { // Modify instance.model = model; const idx = existingNames.indexOf(name); if (idx >= 0) { existingNames.splice(idx, 1); } } else { // Add winston.debug('[Manager] checkInstances: add:', model.toString()); instance = new Instance(self, self._stats, provider, self._config); self._managedInstances.set(name, instance); registerEvents(instance); instance.model = model; } }); // Remove existingNames.forEach((name) => { const instance = self._managedInstances.get(name); winston.debug('[Manager] checkInstances: remove:', instance.model.toString()); self._managedInstances.delete(name); instance.removedFromManager(); }); //////////// function registerEvents(inst) { inst.on('status:updated', () => self.emit('status:updated', inst.stats)); inst.on('alive:updated', (alive) => { const name = inst.name; if (alive && !inst.removing) { self._aliveInstances.push(inst); self._aliveInstancesMap.set(name, inst); } else { // If instance is not alive OR instance is alived but is asked to be removed // we remove the instance from the alive pool const idx = self._aliveInstances.indexOf(inst); if (idx >= 0) { self._aliveInstances.splice(idx, 1); } self._aliveInstancesMap.delete(name); } self.emit('alive:updated', inst.stats); }); } } function adjustInstances() { const managedCount = self._managedInstances.size; winston.debug('[Manager] adjustInstances: required:%d / actual:%d', self._config.scaling.required, managedCount); if (managedCount > self._config.scaling.required) { // Too much const count = managedCount - self._config.scaling.required; winston.debug('[Manager] adjustInstances: remove %d instances', count); const instances = _(Array.from(self._managedInstances.values())) .sampleSize(count) .filter((instance) => !instance.model.locked) // only unlocked instance can be removed .value(); return Promise.map(instances, (instance) => instance.remove()); } else if (managedCount < self._config.scaling.required) { // Not enough const count = self._config.scaling.required - managedCount; winston.debug('[Manager] adjustInstances: add %d instances', count); return createInstances(count); } //////////// function createInstances(cnt) { const counters = buildCounters(); // Split the count const countersAvailable = counters.slice(0); let i = 0; while (i < cnt && countersAvailable.length > 0) { const counterIdx = Math.floor(Math.random() * countersAvailable.length), counter = countersAvailable[counterIdx]; if (counter.max >= 0 && counter.count >= counter.max) { countersAvailable.splice(counterIdx, 1); } else { counter.count++; i++; } } const countersFilled = counters.filter((counter) => counter.count > 0); if (countersFilled.length <= 0) { throw new ScalingError(cnt, false); } return Promise.map(countersFilled, (counter) => counter.provider.createInstances(counter.count) ); //////////// function buildCounters() { return self._providers.map((provider) => { const counter = { count: 0, provider, }; if (provider._config.max) { counter.max = Math.max(0, provider._config.max - provider.instancesCount); } return counter; }); } } } } } /** * For testing purpose */ crashRandomInstance() { const names = Array.from(this._managedInstances.keys()); const randomName = names[Math.floor(Math.random() * names.length)]; winston.debug('[Manager] crashRandomInstance: name=%s', randomName); const instance = this._managedInstances.get(randomName); return instance.remove(); } stop() { const self = this; winston.debug('[Manager] stop'); self._config.scaling.required = 0; self.emit('scaling:updated', self._config.scaling); return waitForNoInstance() .then(() => { if (self._checkIntervalTimeout) { clearInterval(self._checkIntervalTimeout); } }); //////////// function waitForNoInstance() { return new Promise((resolve) => { checkNoInstance(); //////////// function checkNoInstance() { const managedCount = self._managedInstances.size; if (managedCount <= 0) { resolve(); } else { setTimeout(checkNoInstance, self._config.checkDelay); } } }); } } getNextRunningInstanceForDomain(domain, forceName) { const self = this; if (self._aliveInstances.length <= 0) { return; } domain = domain || ''; let nextInstance; if (forceName) { nextInstance = self._aliveInstancesMap.get(forceName); } if (!nextInstance) { const actualInstance = self._domains.get(domain); nextInstance = getNextRunningInstance(actualInstance); } self._domains.set(domain, nextInstance); return nextInstance; //////////// function getNextRunningInstance(instance) { if (self._aliveInstances.length <= 0) { return; } let idx; if (instance) { idx = self._aliveInstances.indexOf(instance); if (idx >= 0) { ++idx; if (idx >= self._aliveInstances.length) { idx = 0; } } else { idx = 0; } } else { idx = 0; } if (idx >= self._aliveInstances.length) { return; } return self._aliveInstances[idx]; } } /* getFirstInstance(forceName) { if (this._aliveInstances.length <= 0) { return; } let nextInstance; if (forceName) { nextInstance = this._aliveInstancesMap.get(forceName); } if (!nextInstance) { nextInstance = this._aliveInstances[0]; } return nextInstance; } */ requestReceived() { if (this._config.scaling.required <= 0) { // Shutdown return; } if (this._config.scaling.required !== this._config.scaling.max) { this._config.scaling.required = this._config.scaling.max; this.emit('scaling:updated', this._config.scaling); } if (this._scaleDownTimeout) { clearTimeout(this._scaleDownTimeout); } this._scaleDownTimeout = setTimeout(() => { this._config.scaling.required = this._config.scaling.min; this.emit('scaling:updated', this._config.scaling); }, this._config.scaling.downscaleDelay); } removeInstance(name) { const instance = this._managedInstances.get(name); if (!instance) { return; } return instance.remove(); } };
/* * The MIT License (MIT) * Copyright (c) 2016 Jim Liu * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (function( global, factory ) { if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` // (such as Node.js), expose a factory as module.exports. // This accentuates the need for the creation of a real `window`. // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info. module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Support: Firefox 18+ // Can't be in strict mode, several libs including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) //"use strict";
import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import Icon from 'react-geomicons'; import { Overlay, Panel, PanelHeader, Text, Close, Space, Heading, Divider, ButtonCircle, } from 'rebass'; import { Flex } from 'reflexbox'; import FadeInTransition from './FadeInTransition'; import FadeImage from './FadeImage'; import PlayPause from './PlayPause'; import { actions as appActions, selectors as appSelectors } from '../app'; import { selectors as mosaicSelectors } from '../mosaic'; import { selectors as recommendedSelectors } from '../recommended'; import { getAlbumArtUrlForTrack } from '../utils'; const styles = require('./TrackInfoModal.css'); const TrackInfoModal = ({ isModalOpen, selectedTrack, windowWidth, actions }) => { const mapPitchClassToKey = (pitchClass) => { switch (pitchClass) { case 0: return 'C'; case 1: return 'C♯/D♭'; case 2: return 'D'; case 3: return 'D♯/E♭'; case 4: return 'E'; case 5: return 'F'; case 6: return 'F♯/G♭'; case 7: return 'G'; case 8: return 'G♯/A♭'; case 9: return 'A'; case 10: return 'A♯/B♭'; case 11: return 'B'; default: return 'UNKNOWN'; } }; const mapMode = mode => (mode === 1 ? 'major' : 'minor'); return ( selectedTrack ? <FadeInTransition> <Overlay key="modal" open={isModalOpen} onDismiss={() => actions.closeModal()} className={styles.overflowHidden}> <Panel> <PanelHeader> <Text> {`${selectedTrack.getIn(['artists', 0, 'name'])} - ${selectedTrack.get('name')}`} </Text> <Space auto /> <Close onClick={() => actions.closeModal()} /> </PanelHeader> <Flex flexColumn={windowWidth <= 480} style={{ marginTop: '-16px', marginRight: '-16px' }} align="center" > <FadeImage src={getAlbumArtUrlForTrack(selectedTrack)} style={{ width: '300px', height: '300px', marginRight: '16px', marginTop: '16px', }} /> <Flex mt={2} mr={2} wrap flexColumn style={{ width: '300px' }}> <Heading color="black" level={3}> {selectedTrack.get('name')} </Heading> <Text color="black" > {selectedTrack.get('artists').map(a => a.get('name')).join(', ')} </Text> <Text color="black"> {selectedTrack.getIn(['album', 'name'])} </Text> <Divider ml={0} width={150} /> <Flex flexColumn={windowWidth > 480} style={{ marginTop: '-16px' }}> <Flex flexColumn mt={2}> <Text color="black"> {`${Math.round(selectedTrack.get('tempo'))} bpm`} </Text> <Text color="black"> { `${mapPitchClassToKey(selectedTrack.get('key'))} ${mapMode(selectedTrack.get('mode'))}` } </Text> </Flex> <Space auto /> <Flex mt={2}> <PlayPause previewUrl={selectedTrack.get('preview_url')} /> <ButtonCircle ml={1} size={48} backgroundColor="green" title="Open in Spotify" href={selectedTrack.getIn(['external_urls', 'spotify'])} target="_blank" > <Icon fill="white" height="32px" name="external" width="32px" /> </ButtonCircle> </Flex> </Flex> </Flex> </Flex> </Panel> </Overlay> </FadeInTransition> : null ); }; TrackInfoModal.propTypes = { actions: PropTypes.object.isRequired, isModalOpen: PropTypes.bool.isRequired, windowWidth: PropTypes.number.isRequired, selectedTrack: PropTypes.object, }; TrackInfoModal.defaultProps = { windowWidth: 0, selectedTrack: null, }; const mapStateToProps = state => ( { isModalOpen: appSelectors.getIsModalOpen(state), selectedTrack: mosaicSelectors.getTrack(state, appSelectors.getSelectedTrackId(state)) || recommendedSelectors.getRecommendedTrack(state, appSelectors.getSelectedTrackId(state)), } ); const mapDispatchToProps = dispatch => ( { actions: bindActionCreators({ ...appActions }, dispatch), } ); export default connect(mapStateToProps, mapDispatchToProps)(TrackInfoModal);
$(document).ready(function(){ // update when author type is changed $('#AUTHOR-Type').on('change', function(){ reflectTypeChange($('.edit-form'), 'author', $('#AUTHOR-Type option:selected').text()); }); // make sure correct author type is filled in var selectedType = $('#AUTHOR-Type').attr('value'); $('#AUTHOR-Type option').each(function(){ var option = $(this); if (option.val() == selectedType) { option.prop('selected', true); return false; } }); $('#AUTHOR-Type').trigger('change'); $('.object').quotify({objectType: 'author', size: 'large'}); var defaultFunction = function(){ return ''; }; $('.search-authors').searchify({ type: 'authors' }); $('.show-authors').searchify({ type: 'authors', isDefault: true, searchFunction: defaultFunction, data: (typeof init_authors !== 'undefined' ? init_authors : null) }); $('.quotes-by-author').searchify({ type: 'quotes', isDefault: true, cols: 2, searchInput: null, objectsToShow: 10, searchFunction: function(){ return 'author=' + $('.object').data('author-tr-id') + '&sort=' + $('#sortOrder').val(); } }); $('.works-by-author').searchify({ type: 'works', isDefault: true, showAuthor: false, searchInput: null, searchFunction: function(){ return 'author=' + $('.object').data('author-tr-id'); } }); // on changing sort order, trigger search $('#sortOrder').on('change', function(){ $('.quotes-by-author').trigger('search'); }); });
var q = require('q'), http = require('http'), fs = require('fs'); function getData(path){ var deferred = q.defer(); var url = 'data/'+path+'.json'; fs.readFile(url, 'utf8', function (err, data) { if (err) throw err; obj = JSON.parse(data); deferred.resolve(obj); }); return deferred.promise; }; getData('parsed_questions').then(function(data){ var questions = {}; var count = 0; questions["5"] = {}; questions["5"]["1"] = {}; questions["6"] = {}; questions["6"]["1"] = {}; questions["6"]["2"] = {}; questions["6"]["3"] = {}; questions["6"]["4"] = {}; questions["7"] = {}; questions["7"]["1"] = {}; for(var key in data){ var item = {}; item.id = key; item.title = data[key].title; item.post_timestamp = data[key].post_timestamp; item.signatures_count = data[key].signatures_count; item.content = data[key].content; item.policyTitle = '推動「台北安居」&「創藝飛翔」計畫 讓原民在北市快樂生活'; if(count < 4){ item.candidateID = "5"; item.policyID = "1"; questions["5"]["1"][key] = item; }else if(count >= 4 && count < 10){ item.candidateID = "6"; item.policyID = "1"; questions["6"]["1"][key] = item; }else if(count >= 10 && count < 14){ item.candidateID = "6"; item.policyID = "2"; questions["6"]["2"][key] = item; }else if(count >=14 && count < 20){ item.candidateID = "6"; item.policyID = "3"; questions["6"]["3"][key] = item; }else if(count >= 20 && count < 35){ item.candidateID = "6"; item.policyID = "4"; questions["6"]["4"][key] = item; }else{ item.candidateID = "7"; item.policyID = "1"; questions["7"]["1"][key] = item; } count++; //console.log(questions); } //Save to json fs.writeFile("data/questions.json", JSON.stringify(questions), function(err) { if(err) { console.log(err); } else { console.log(" - File saved : question."); } }); });
module.exports = function(client) { /** * Connected to server. * * @event connected * @params {string} address * @params {integer} port */ client.addListener('connected', function (address, port) { // Do your stuff. }); };
import { default as msgActionCreators } from './msg' import { default as displayControlActionCreator } from './displayControl' export default { ...msgActionCreators, ...displayControlActionCreator }
import { NativeModules, } from 'react-native'; const {SegmentAnalytics} = NativeModules; export default { setup: function (configKey: string) { SegmentAnalytics.setup(configKey); }, identify: function (userId: string, traits: Object) { SegmentAnalytics.identify(userId, traits); }, track: function (trackText: string, properties: Object) { SegmentAnalytics.track(trackText, properties); }, screen: function (screenName: string, properties: Object) { SegmentAnalytics.screen(screenName, properties); }, alias: function (newId: string) { SegmentAnalytics.alias(newId); } };
var io = require('socket.io')(8080); var userHash = {}; io.on('connection', function (socket) { console.log(socket.id + ' has connected!'); // 接続開始カスタムイベント(接続元ユーザを保存し、他ユーザへ通知) socket.on("connected", function (name) { var msg = name + "が入室しました"; console.log(msg); userHash[socket.id] = name; io.sockets.emit("publish", [msg]); }); // メッセージ送信カスタムイベント socket.on("publish", function (data) { console.log("publish: " + data); io.sockets.emit("publish", data); }); // 接続終了組み込みイベント(接続元ユーザを削除し、他ユーザへ通知) socket.on("disconnect", function () { if (userHash[socket.id]) { var msg = userHash[socket.id] + "が退出しました"; console.log(msg); delete userHash[socket.id]; io.sockets.emit("publish", msg); } }); });
/** * Keyboard completion code. */ import autocomplete from './autocomplete'; export default { completion: function (e) { var element = e.target; var doc = element.ownerDocument; var selection = doc.getSelection(); var focusNode = selection.focusNode; // if it's not an editable element // don't trigger anything if(!autocomplete.isEditable(element)) { return true; } if(selection.rangeCount) { var range = selection.getRangeAt(0); var caretPos = range.endOffset; } // First get the cursor position autocomplete.cursorPosition = autocomplete.getCursorPosition(element); // Then get the word at the positon var word = autocomplete.getSelectedWord({ element: element }); autocomplete.cursorPosition.word = word; if (word.text) { // Find a matching Quicktext shortcut in the bg script window.App.settings.getQuicktextsShortcut(word.text, function (quicktexts) { if (quicktexts.length) { // replace with the first quicktext found autocomplete.replaceWith({ element: element, quicktext: quicktexts[0], focusNode: focusNode }); } }); } } };
import React from 'react' import styled from 'styled-components' import { Button } from '../../action/button' import { pxToRem } from '../../../helpers/utils/typography' import classNames from 'classnames' const StyledButtonGroup = styled.div` display: flex; justify-content: center; .k-ButtonGroup__button { position: relative; z-index: 0; min-width: auto; width: auto; border-radius: 0; &:not(:last-child) { margin-right: ${pxToRem(-1)}; } &:first-child { border-top-left-radius: var(--border-radius-s); border-bottom-left-radius: var(--border-radius-s); } &:last-child { border-top-right-radius: var(--border-radius-s); border-bottom-right-radius: var(--border-radius-s); } &:active, &:hover { z-index: 1; } &.k-ButtonGroup__button--isActive { z-index: 2; } &:focus-visible { z-index: 3; } } ` export const ButtonGroup = ({ className, ...props }) => ( <StyledButtonGroup role="group" {...props} className={classNames('k-ButtonGroup', className)} /> ) const ButtonGroupButton = ({ className, active, ...props }) => ( <Button {...props} active={active} className={classNames('k-ButtonGroup__button', className, { 'k-ButtonGroup__button--isActive': active, })} /> ) ButtonGroup.Button = ButtonGroupButton
describe('material.components.expansionPanels', function () { var panel; var group; var scope; var content; var $mdUtil; var $timeout; var $animate; // disable all css transitions so test wont fail var disableAnimationStyles = ''+ '-webkit-transition: none !important;'+ '-moz-transition: none !important;'+ '-ms-transition: none !important;'+ '-o-transition: none !important;'+ 'transition: none !important;'; window.onload = function () { var animationStyles = document.createElement('style'); animationStyles.type = 'text/css'; animationStyles.innerHTML = '* {' + disableAnimationStyles + '}'; document.head.appendChild(animationStyles); }; beforeEach(module('ngAnimateMock')); beforeEach(module('material.components.expansionPanels')); beforeEach(inject(function(_$mdUtil_, _$timeout_, _$animate_) { $mdUtil = _$mdUtil_; // getComputedStyle does not work in phantomjs. mock out method $mdUtil.hasComputedStyle = function () { return false; }; $timeout = _$timeout_; $animate = _$animate_; })); // destroy all created scopes and elements afterEach(function () { if (scope == undefined) { return; } scope.$destroy(); panel.remove(); panel = undefined; scope = undefined; if (group) { group.scope().$destroy(); group.remove(); group = undefined; } if (content) { content.remove(); content = undefined; } }); // --- Expansion Panel Service --- describe('$mdExpansionPanel Service', function () { it('should find instance by id with sync method', inject(function($mdExpansionPanel) { var element = getDirective({componentId: 'expansionPanelId'}); var instance = $mdExpansionPanel('expansionPanelId'); expect(instance).toBeDefined(); })); it('should find instance by id with async method', inject(function($mdExpansionPanel) { var instance; $mdExpansionPanel().waitFor('expansionPanelId').then(function(inst) { instance = inst; }); expect(instance).toBeUndefined(); var element = getDirective({componentId: 'expansionPanelId'}); $timeout.flush(); expect(instance).toBeDefined(); })); it('should expand panel', inject(function($mdExpansionPanel) { var element = getDirective({componentId: 'expansionPanelId'}); $mdExpansionPanel('expansionPanelId').expand(); flushAnimations(); expect(element.hasClass('md-open')).toBe(true); })); it('should collapse panel', inject(function($mdExpansionPanel) { var element = getDirective({componentId: 'expansionPanelId'}); $mdExpansionPanel('expansionPanelId').expand(); $mdExpansionPanel('expansionPanelId').collapse(); flushAnimations(); expect(element.hasClass('md-close')).toBe(true); })); it('should remove panel', inject(function($mdExpansionPanel) { var element = getDirective({componentId: 'expansionPanelId'}); $mdExpansionPanel('expansionPanelId').remove(); expect(element.scope()).toBeUndefined(); })); it('should call onRemove callabck', inject(function($mdExpansionPanel) { var obj = { callback: function () {} }; spyOn(obj, 'callback'); var element = getDirective({componentId: 'expansionPanelId'}); $mdExpansionPanel('expansionPanelId').onRemove(obj.callback); $mdExpansionPanel('expansionPanelId').remove(); expect(obj.callback).toHaveBeenCalled(); })); it('should add a click catcher', inject(function($mdExpansionPanel) { var element = getDirective({componentId: 'expansionPanelId'}); $mdExpansionPanel('expansionPanelId').addClickCatcher(); expect(element.parent().find('md-backdrop')).toBeDefined(); })); it('should call clickback', inject(function($mdExpansionPanel) { var obj = { callback: function () {} }; spyOn(obj, 'callback'); var element = getDirective({componentId: 'expansionPanelId'}); $mdExpansionPanel('expansionPanelId').addClickCatcher(obj.callback); element.parent().find('md-backdrop').triggerHandler('click'); expect(obj.callback).toHaveBeenCalled(); })); it('should remove click catcher', inject(function($mdExpansionPanel) { var element = getDirective({componentId: 'expansionPanelId'}); $mdExpansionPanel('expansionPanelId').addClickCatcher(); $mdExpansionPanel('expansionPanelId').removeClickCatcher(); expect(element.parent().find('md-backdrop').length).toEqual(0); })); it('should return false for isOpen', inject(function($mdExpansionPanel) { var element = getDirective({componentId: 'expansionPanelId'}); expect($mdExpansionPanel('expansionPanelId').isOpen()).toBe(false); })); it('should return true for isOpen', inject(function($mdExpansionPanel) { var element = getDirective({componentId: 'expansionPanelId'}); $mdExpansionPanel('expansionPanelId').expand(); flushAnimations(); expect($mdExpansionPanel('expansionPanelId').isOpen()).toBe(true); })); }); // --- Expansion Panel Group Service --- describe('$mdExpansionPanelGroup Service', function () { it('should find instance by id using sync method', inject(function($mdExpansionPanelGroup) { var element = getGroupDirective(); var instance = $mdExpansionPanelGroup('expansionPanelGroupId'); expect(instance).toBeDefined(); })); it('should find instance by id usign async method', inject(function($mdExpansionPanelGroup) { var instance; $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { instance = inst; }); expect(instance).toBeUndefined(); var element = getGroupDirective(); $timeout.flush(); expect(instance).toBeDefined(); })); it('should register panel and add it', inject(function($mdExpansionPanelGroup) { var instance; var panelInstance; $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { instance = inst; inst.register('panelName', { template: getTemplate(), controller: function () {} }); inst.add('panelName').then(function (_panelInstance) { panelInstance = _panelInstance; }); }); var element = getGroupDirective(); $timeout.flush(); expect(panelInstance).toBeDefined(); })); it('should remove added panel', inject(function($mdExpansionPanelGroup) { var instance; $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { instance = inst; inst.add({ template: getTemplate({componentId: 'expansionPanelId'}), controller: function () {} }).then(function () { inst.remove('expansionPanelId'); }); }); var element = getGroupDirective(); $timeout.flush(); expect(element[0].querySelector('[md-component-id="expansionPanelId"]')).toBe(null); })); it('should remove all panels', inject(function($mdExpansionPanelGroup) { var instance; $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { instance = inst; inst.add({ template: getTemplate({componentId: 'expansionPanelOne'}), controller: function () {} }); inst.add({ template: getTemplate({componentId: 'expansionPanelTwo'}), controller: function () {} }).then(function () { inst.removeAll(); }); }); var element = getGroupDirective(); $timeout.flush(); expect(element[0].querySelector('[md-component-id="expansionPanelOne"]')).toBe(null); expect(element[0].querySelector('[md-component-id="expansionPanelTwo"]')).toBe(null); })); it('should get all panel instances', inject(function($mdExpansionPanelGroup) { var instance; var all = []; $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { instance = inst; inst.add({ template: getTemplate({componentId: 'expansionPanelOne'}), controller: function () {} }); inst.add({ template: getTemplate({componentId: 'expansionPanelTwo'}), controller: function () {} }).then(function () { all = inst.getAll(); }); }); var element = getGroupDirective(); $timeout.flush(); expect(all.length).toBe(2); })); it('should get opened panel instances', inject(function($mdExpansionPanelGroup) { var instance; var open = []; $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { instance = inst; inst.add({ template: getTemplate({componentId: 'expansionPanelOne'}), controller: function () {} }); inst.add({ template: getTemplate({componentId: 'expansionPanelTwo'}), controller: function () {} }).then(function (panelInst) { panelInst.expand().then(function () { open = inst.getOpen(); }) }); }); var element = getGroupDirective(); $timeout.flush(); expect(open.length).toBe(1); })); it('should collapse all panels', inject(function($mdExpansionPanelGroup) { var instance; var open = []; $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { instance = inst; inst.add({ template: getTemplate({componentId: 'expansionPanelOne'}), controller: function () {} }); inst.add({ template: getTemplate({componentId: 'expansionPanelTwo'}), controller: function () {} }).then(function (panelInst) { panelInst.expand().then(function () { instance.collapseAll(); open = inst.getOpen(); }) }); }); var element = getGroupDirective(); $timeout.flush(); expect(open.length).toBe(0); })); it('should call onChange callback', inject(function($mdExpansionPanelGroup) { var obj = { callback: function () {} }; spyOn(obj, 'callback'); $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { inst.onChange(obj.callback); inst.add({ template: getTemplate({componentId: 'expansionPanelId'}), controller: function () {} }); }); var element = getGroupDirective(); $timeout.flush(); expect(obj.callback).toHaveBeenCalled(); })); it('should not call onChange callback', inject(function($mdExpansionPanelGroup) { var obj = { callback: function () {} }; spyOn(obj, 'callback'); $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { var change = inst.onChange(obj.callback); change(); inst.add({ template: getTemplate({componentId: 'expansionPanelId'}), controller: function () {} }); }); var element = getGroupDirective(); $timeout.flush(); expect(obj.callback).not.toHaveBeenCalled(); })); it('should return count', inject(function($mdExpansionPanelGroup) { var instance; $mdExpansionPanelGroup().waitFor('expansionPanelGroupId').then(function(inst) { instance = inst; inst.add({ template: getTemplate({componentId: 'expansionPanelId'}), controller: function () {} }); }); var element = getGroupDirective(); $timeout.flush(); expect(instance.count()).toBe(1); })); }); // ---- Expansion Panel Directive --- describe('md-expansion-panel directive', function () { it('should have `tabindex` attribute', function () { var element = getDirective(); expect(element.attr('tabindex')).not.toBe(undefined); }); it('should set `tabindex` to `-1` if `disabled`', function () { var element = getDirective({disabled: true}); expect(element.attr('tabindex')).toEqual('-1'); }); it('should set `tabindex` to `-1` if `ng-disabled` is true', function () { var element = getDirective({ngDisabled: 'isDisabled'}); scope.isDisabled = true; scope.$digest(); expect(element.attr('tabindex')).toEqual('-1'); }); it('should set `tabindex` to `0` if `ng-disabled` is false', function () { var element = getDirective({ngDisabled: 'isDisabled'}); scope.isDisabled = false; scope.$digest(); expect(element.attr('tabindex')).toEqual('0'); }); it('should set `tabindex` to `0` if `ng-disabled` is not set', function () { var element = getDirective({ngDisabled: 'isDisabled'}); scope.isDisabled = undefined; scope.$digest(); expect(element.attr('tabindex')).toEqual('0'); }); it('should thow errors on invalid markup', inject(function($compile, $rootScope) { function buildBadPanelOne() { $compile('<md-expansion-panel></md-expansion-panel>')($rootScope); } function buildBadPanelTwo() { $compile('<md-expansion-panel><md-expansion-panel-collapsed></md-expansion-panel-collapsed></md-expansion-panel>')($rootScope); } expect(buildBadPanelOne).toThrow(); expect(buildBadPanelTwo).toThrow(); })); it('should add `md-open` class on expand', function () { var element = getDirective(); expandPanel(); expect(element.hasClass('md-open')).toBe(true); }); it('should add `md-close` class on collapse', function () { var element = getDirective(); expandPanel(); collapsePanel(); expect(element.hasClass('md-close')).toBe(true); }); it('should remove panel', inject(function($mdExpansionPanel) { var element = getDirective(); element.scope().$panel.remove(); expect(element.scope()).toBeUndefined(); })); it('should return false for isOpen', inject(function($mdExpansionPanel) { var element = getDirective(); expect(element.scope().$panel.isOpen()).toBe(false); })); it('should return true for isOpen', inject(function($mdExpansionPanel) { var element = getDirective(); element.scope().$panel.expand(); flushAnimations(); expect(element.scope().$panel.isOpen()).toBe(true); })); describe('Focused', function () { it('should be the focused element', function () { var element = getDirective(); focusPanel(); expect(document.activeElement).toBe(element[0]); }); it('should Expand on `enter` keydown', function () { var element = getDirective(); focusPanel(); pressKey(13); expect(element.hasClass('md-open')).toBe(true); }); it('should Collapse on `escape` keydown', function () { var element = getDirective(); expandPanel(); focusPanel(); pressKey(27); expect(element.hasClass('md-close')).toBe(true); }); }); // --- expanded Directive --- describe('md-expansion-panel-expanded directive', function () { describe('Expanded', function () { it('should have `md-show` class', function () { var element = getDirective(); expandPanel(); expect(element.find('md-expansion-panel-expanded').hasClass('md-show')).toBe(true); }); describe('Animating', function () { it('should have `md-overflow` class', function () { var element = getDirective(); expandPanel(); expect(element.find('md-expansion-panel-expanded').hasClass('md-overflow')).toBe(true); }); }); describe('After Animating', function () { it('should not have `md-overflow` class', function () { var element = getDirective(); expandPanel(); flushAnimations(); expect(element.find('md-expansion-panel-expanded').hasClass('md-overflow')).toBe(false); }); it('should not have `max-height` style', function () { var element = getDirective(); expandPanel(); flushAnimations(); expect(element.find('md-expansion-panel-expanded').css('max-height')).toBe('none'); }); }); }); describe('Expanded with height set', function () { it('should have `max-height` style', function () { var element = getDirective({height: 300}); expandPanel(); flushAnimations(); expect(element.find('md-expansion-panel-expanded').css('max-height')).toBe('300px'); }); it('should have `md-scroll-y` class', function () { var element = getDirective({height: 300}); expandPanel(); flushAnimations(); expect(element.find('md-expansion-panel-expanded').hasClass('md-scroll-y')).toBe(true); }); }); describe('Collapse', function () { it('should have `md-hide` class', function () { var element = getDirective(); expandPanel(); collapsePanel(); expect(element.find('md-expansion-panel-expanded').hasClass('md-hide')).toBe(true); }); it('should have `md-overflow` class', function () { var element = getDirective(); expandPanel(); collapsePanel(); expect(element.find('md-expansion-panel-expanded').hasClass('md-overflow')).toBe(true); }); describe('After Animating', function () { it('should not have `md-hide` class', function () { var element = getDirective(); expandPanel(); flushAnimations(); collapsePanel(); flushAnimations(); expect(element.find('md-expansion-panel-expanded').hasClass('md-hide')).toBe(false); }); }); }); }); // --- collapsed Directive ---- describe('md-expansion-panel-collapsed directive', function () { describe('Expanded', function () { it('should have `md-hide` class', function () { var element = getDirective(); expandPanel(); expect(element.find('md-expansion-panel-collapsed').hasClass('md-hide')).toBe(true); }); it('should not have `md-show` class', function () { var element = getDirective(); expandPanel(); expect(element.find('md-expansion-panel-collapsed').hasClass('md-show')).toBe(false); }); it('should have `width` style', function () { var element = getDirective(); expandPanel(); expect(element.find('md-expansion-panel-collapsed').css('width')).toBeDefined(); }); describe('After Animating', function () { it('should have `md-absolute` class', function () { var element = getDirective(); expandPanel(); flushAnimations(); expect(element.find('md-expansion-panel-collapsed').hasClass('md-absolute')).toBe(true); }); it('should not have `md-hide` style', function () { var element = getDirective(); expandPanel(); flushAnimations(); expect(element.find('md-expansion-panel-collapsed').hasClass('md-hide')).toBe(false); }); it('should add `max-hight` to `md-expansion-panel`', function () { var element = getDirective(); expandPanel(); flushAnimations(); expect(element.css('min-height')).toBeDefined(); }); }); describe('Collapsed', function () { it('should have `md-show` class', function () { var element = getDirective(); expandPanel(); collapsePanel(); expect(element.find('md-expansion-panel-collapsed').hasClass('md-show')).toBe(true); }); it('should have `width` style', function () { var element = getDirective(); expandPanel(); expect(element.find('md-expansion-panel-collapsed').css('width')).toBeDefined(); }); describe('After Animating', function () { it('should not have `md-absolute` class', function () { var element = getDirective(); expandPanel(); flushAnimations(); collapsePanel(); flushAnimations(); expect(element.find('md-expansion-panel-collapsed').hasClass('md-absolute')).toBe(false); }); it('should not have `width` style', function () { var element = getDirective(); expandPanel(); flushAnimations(); collapsePanel(); flushAnimations(); expect(element.find('md-expansion-panel-collapsed').css('width')).toBe(''); }); it('should remove `max-hight` from `md-expansion-panel`', function () { var element = getDirective(); expandPanel(); flushAnimations(); collapsePanel(); flushAnimations(); expect(element.css('min-height')).toBe(''); }); }); }); }); }); // --- Header Directive ---- describe('md-expansion-panel-header directive', function () { describe('On Scroll', function () { it('should have `md-stick` class', inject(function($$rAF) { var element = getDirective({content: true}); expandPanel(); flushAnimations(); content[0].scrollTop = 80; content.triggerHandler({ type: 'scroll', target: {scrollTop: 80} }); $$rAF.flush(); expect(element.find('md-expansion-panel-header').hasClass('md-stick')).toBe(true); })); }); describe('On Scroll Top', function () { it('should not have `md-stick` class', inject(function($$rAF) { var element = getDirective({content: true}); expandPanel(); flushAnimations(); content[0].scrollTop = 0; content.triggerHandler({ type: 'scroll', target: {scrollTop: 0} }); $$rAF.flush(); expect(element.find('md-expansion-panel-header').hasClass('md-stick')).toBe(false); })); }); describe('No Sticky', function () { it('should not have `md-stick` class', inject(function($$rAF) { var element = getDirective({content: true, headerNoStick: true}); expandPanel(); flushAnimations(); content[0].scrollTop = 80; content.triggerHandler({ type: 'scroll', target: {scrollTop: 80} }); $$rAF.flush(); expect(element.find('md-expansion-panel-header').hasClass('md-stick')).toBe(false); })); }); }); // --- Foooter Directive ---- describe('md-expansion-panel-footer directive', function () { describe('On Scroll', function () { it('should have `md-stick` class', inject(function($$rAF) { var element = getDirective({content: true}); expandPanel(); flushAnimations(); content[0].scrollTop = 80; content.triggerHandler({ type: 'scroll', target: {scrollTop: 80} }); $$rAF.flush(); expect(element.find('md-expansion-panel-footer').hasClass('md-stick')).toBe(true); })); }); describe('On Scroll Bottom', function () { it('should not have `md-stick` class', inject(function($$rAF) { var element = getDirective({content: true}); expandPanel(); flushAnimations(); content[0].scrollTop = 1000; content.triggerHandler({ type: 'scroll', target: {scrollTop: 1000} }); $$rAF.flush(); expect(element.find('md-expansion-panel-footer').hasClass('md-stick')).toBe(false); })); }); describe('No Sticky', function () { it('should not have `md-stick` class', inject(function($$rAF) { var element = getDirective({content: true, footerNoStick: true}); expandPanel(); flushAnimations(); content[0].scrollTop = 80; content.triggerHandler({ type: 'scroll', target: {scrollTop: 80} }); $$rAF.flush(); expect(element.find('md-expansion-panel-footer').hasClass('md-stick')).toBe(false); })); }); }); }); // --- Helpers ------------------- function getDirective(options) { options = options || {}; var template = getTemplate(options); inject(function($compile, $rootScope) { scope = $rootScope.$new(); panel = $compile(template)(scope); }); document.body.appendChild(panel[0]); if (options.content) { content = panel; panel = content.find('md-expansion-panel'); } panel.scope().$digest(); return panel; } function getTemplate(options) { options = options || {}; return $mdUtil.supplant('{2}' + '<md-expansion-panel {0}{6}{7}>'+ '><md-expansion-panel-collapsed>'+ '<div class="md-title">Title</div>'+ '<div class="md-summary">Summary</div>'+ '</md-expansion-panel-collapsed>'+ '<md-expansion-panel-expanded{1}>'+ '<md-expansion-panel-header{4}>'+ '<div class="md-title">Expanded Title</div>'+ '<div class="md-summary">Expanded Summary</div>'+ '</md-expansion-panel-header>'+ '<md-expansion-panel-content>'+ '<h4>Content</h4>'+ '<p>Put content in here</p>'+ '</md-expansion-panel-content>'+ '<md-expansion-panel-footer{5}>'+ '<div flex></div>'+ '<md-button class="md-warn">Collapse</md-button>'+ '</md-expansion-panel-footer>'+ '</md-expansion-panel-expanded>'+ '</md-expansion-panel>{3}', [ options.disabled ? 'disabled' : '', options.height ? ' height="'+options.height+'" ' : '', options.content ? '<md-content style="height: 160px;">' : '', options.content ? '</md-content>' : '', options.headerNoStick ? ' md-no-sticky ' : '', options.footerNoStick ? ' md-no-sticky ' : '', options.componentId ? ' md-component-id="'+options.componentId+'" ' : '', options.ngDisabled ? ' ng-disabled="'+options.ngDisabled+'" ' : '' ]); } function getGroupDirective(options) { options = options || {}; var template = $mdUtil.supplant('' + '<md-expansion-panel-group {0} {1} md-component-id="expansionPanelGroupId">'+ '</md-expansion-panel-group>', [ options.multiple ? ' multiple ' : '', options.autoExpand ? ' auto-exapnd ' : '' ]); inject(function($compile, $rootScope) { group = $compile(template)($rootScope.$new()); }); document.body.appendChild(group[0]); group.scope().$digest(); return group; } function expandPanel() { panel.find('md-expansion-panel-collapsed').triggerHandler('click'); panel.scope().$digest(); } function collapsePanel() { panel.scope().$panel.collapse(); panel.scope().$digest(); } function focusPanel() { panel.focus(); panel.scope().$digest(); } function pressKey(keycode) { panel.triggerHandler({ type: 'keydown', keyCode: keycode }); panel.scope().$digest(); } function flushAnimations() { $animate.flush(); $timeout.flush(); } });
function fn() { return true; } for (var i = 0; fn(); i++) { }
export const iosRewindOutline = {"viewBox":"0 0 512 512","children":[{"name":"path","attribs":{"d":"M464,155v201.9L280.5,256L464,155 M240,156v77.7v27.1v95.6L64,256l176-100.2 M256,128L32,256l224,128V260.8L480,384V128\r\n\tL256,251.2V128L256,128z"},"children":[]}]};
/* PLUGIN: hideEmailAddress Converts a string into an email address: sample: <a href="mailto:test.email(a)some.domain.com">test.email<span class="hideEmail-at"></span>some.domain.com</a> => <a href="test.email@some.domain.com">test.email@some.domain.com</a> include CSS: .email-address { span.hideEmail-at::before { content:"\0040"; // @ } } <fradot> */ (function($) { $.fn.hideEmailAddress = function(options) { return this.each(function() { var $_self = $(this); var _atex = /\(a\)(?!\s)/; // href var href = $_self.attr('href') .replace(_atex,'@'); $_self.attr('href',href).html(href.replace('mailto\:','')); }); }; })(jQuery);
module.exports = { loadPriority: 410, initialize: function(api, next){ api.actions = {}; api.actions.actions = {}; api.actions.versions = {}; api.actions.preProcessors = {}; api.actions.postProcessors = {}; api.actions.addPreProcessor = function(func, priority) { if(!priority) priority = api.config.general.defaultMiddlewarePriority; priority = Number(priority); // ensure priority is numeric if(!api.actions.preProcessors[priority]) api.actions.preProcessors[priority] = []; return api.actions.preProcessors[priority].push(func); } api.actions.addPostProcessor = function(func, priority) { if(!priority) priority = api.config.general.defaultMiddlewarePriority; priority = Number(priority); // ensure priority is numeric if(!api.actions.postProcessors[priority]) api.actions.postProcessors[priority] = []; return api.actions.postProcessors[priority].push(func); } api.actions.validateAction = function(action){ var fail = function(msg){ api.log(msg + '; exiting.', 'emerg'); process.exit(); } if(action.inputs === undefined){ action.inputs = {}; } if(typeof action.name !== 'string' || action.name.length < 1){ fail('an action is missing \'action.name\''); return false; } else if(typeof action.description !== 'string' || action.description.length < 1){ fail('Action ' + action.name + ' is missing \'action.description\''); return false; } else if(typeof action.run !== 'function'){ fail('Action ' + action.name + ' has no run method'); return false; } else if(api.connections !== null && api.connections.allowedVerbs.indexOf(action.name) >= 0){ fail(action.name + ' is a reserved verb for connections. choose a new name'); return false; } else { return true; } } api.actions.loadFile = function(fullFilePath, reload){ if(reload === null){ reload = false; } var loadMessage = function(action){ var msgString = ''; if(reload){ msgString = 'action (re)loaded: ' + action.name + ' @ v' + action.version + ', ' + fullFilePath; } else { msgString = 'action loaded: ' + action.name + ' @ v' + action.version + ', ' + fullFilePath; } api.log(msgString, 'debug'); } api.watchFileAndAct(fullFilePath, function(){ api.actions.loadFile(fullFilePath, true); api.params.buildPostVariables(); api.routes.loadRoutes(); }) try { var collection = require(fullFilePath); for(var i in collection){ var action = collection[i]; if(action.version === null || action.version === undefined){ action.version = 1.0 } if(api.actions.actions[action.name] === null || api.actions.actions[action.name] === undefined){ api.actions.actions[action.name] = {} } api.actions.actions[action.name][action.version] = action; if(api.actions.versions[action.name] === null || api.actions.versions[action.name] === undefined){ api.actions.versions[action.name] = []; } api.actions.versions[action.name].push(action.version); api.actions.versions[action.name].sort(); api.actions.validateAction(api.actions.actions[action.name][action.version]); loadMessage(action); } } catch(err){ try { api.exceptionHandlers.loader(fullFilePath, err); delete api.actions.actions[action.name][action.version]; } catch(err2) { throw err; } } } api.config.general.paths.action.forEach(function(p){ api.utils.recursiveDirectoryGlob(p).forEach(function(f){ api.actions.loadFile(f); }); }) next(); } }
// JavaScript Variables and Objects // I paired [by myself, with:] on this challenge. // __________________________________________ // Write your code below. // __________________________________________ // Test Code: Do not alter code below this line. var secretNumber = 7; var password = "just open the door"; var allowedIn =false; var members = ['John','s','s','Mary'] function assert(test, message, test_number) { if (!test) { console.log(test_number + "false"); throw "ERROR: " + message; } console.log(test_number + "true"); return true; } assert( (typeof secretNumber === 'number'), "The value of secretNumber should be a number.", "1. " ) assert( secretNumber === 7, "The value of secretNumber should be 7.", "2. " ) assert( typeof password === 'string', "The value of password should be a string.", "3. " ) assert( password === "just open the door", "The value of password should be 'just open the door'.", "4. " ) assert( typeof allowedIn === 'boolean', "The value of allowedIn should be a boolean.", "5. " ) assert( allowedIn === false, "The value of allowedIn should be false.", "6. " ) assert( members instanceof Array, "The value of members should be an array", "7. " ) assert( members[0] === "John", "The first element in the value of members should be 'John'.", "8. " ) assert( members[3] === "Mary", "The fourth element in the value of members should be 'Mary'.", "9. " )
(function () { 'use strict'; function listViewItemTemplate(itemPromise) { return itemPromise.then(function (item) { var template = document.querySelector('.artist--template'); if(template === null) return; var el = template.cloneNode(true); var artist = el.querySelector('.artist'); artist.querySelector('img').src = item.data.image; artist.setAttribute('data-id', item.data.id); artist.querySelector('.artist__name').innerHTML = item.data.name; if(Umf.schedule.isArtistInSchedule(item.data.id)) artist.classList.add('added'); return artist; }); } function artistClickEvent(e) { var artist = e.target.querySelector('.artist'); var artistId = parseInt(artist.getAttribute('data-id')); if(Umf.schedule.isArtistInSchedule(artistId)) { Umf.schedule.remove(artistId); artist.classList.remove('added'); } else { Umf.schedule.add(artistId); artist.classList.add('added'); } } function resizeListView() { var listView = document.querySelector('#listView'); if(listView === null) return; listView.style.height = (window.innerHeight - 50) + 'px'; } var ControlConstructor = WinJS.UI.Pages.define('/pages/lineup/lineup.html', { ready: function (element, options) { options = options || {}; this._data = WinJS.Binding.as({ }); var artists = new WinJS.Binding.List(Umf.artists); var lv = element.querySelector('#listView'); lv.winControl.itemDataSource = artists.dataSource; lv.winControl.itemTemplate = listViewItemTemplate; lv.winControl.addEventListener('iteminvoked', artistClickEvent); window.addEventListener('resize', resizeListView); resizeListView(); WinJS.Binding.processAll(element, this._data); }, }); })();
/* * HomePage * * This is the first thing users see of our App, at the '/' route * * NOTE: while this component should technically be a stateless functional * component (SFC), hot reloading does not currently support SFCs. If hot * reloading is not a neccessity for you then you can refactor it and remove * the linting exception. */ import React from 'react' import AllImagesContainer from 'containers/AllImages' import AllTextContainer from 'containers/AllText' import Image from 'components/Image' import Text from 'components/Text' import Masonry from 'react-masonry-component' const masonryOptions = { transitionDuration: 0 } const AllImages = AllImagesContainer(({list}) => <Masonry className='my-gallery-class' elementType='div' options={masonryOptions} disableImagesLoaded={false} updateOnEachImageLoad={false} > {list.map(element => <Image {...element} key={element.id_str || element.id} /> )} </Masonry> ) const style = { position: 'absolute', left: 0, top: 0, height: '100vh', width: '100vw' } const AllText = AllTextContainer(({list}) => <div style={style}> <Masonry className={'my-gallery-class'} elementType={'div'} options={masonryOptions} disableImagesLoaded={false} updateOnEachImageLoad={false} > {list.map(element => <Text {...element} key={element.id_str || element.id} />)} </Masonry> </div> ) export default class HomePage extends React.Component { // eslint-disable-line react/prefer-stateless-function render () { return ( <div> <AllImages /> <AllText /> </div> ) } }
import { render } from '@testing-library/preact/pure'; import TestContainer from 'mocha-test-container-support'; import { query as domQuery, queryAll as domQueryAll } from 'min-dom'; import { insertCoreStyles, changeInput } from 'test/TestHelper'; import ReferenceSelect from 'src/entries/ReferenceSelect'; insertCoreStyles(); const noop = () => {}; describe('<ReferenceSelect>', function() { let container; beforeEach(function() { container = TestContainer.get(this); }); it('should render', function() { // given const result = createReferenceSelect({ container }); // then expect(domQuery('.bio-properties-panel-select', result.container)).to.exist; }); it('should render options', function() { // given const getOptions = () => [ { label: 'option A', value: 'A' }, { label: 'option B', value: 'B' }, { label: 'option C', value: 'C' } ]; // when const result = createReferenceSelect({ container, getOptions }); const select = domQuery('.bio-properties-panel-select', result.container); // then expect(domQueryAll('option', select)).to.have.length(3); }); it('should update', function() { // given const getOptions = () => [ { label: 'option A', value: 'A' }, { label: 'option B', value: 'B' }, { label: 'option C', value: 'C' } ]; const updateSpy = sinon.spy(); const result = createReferenceSelect({ container, setValue: updateSpy, getOptions }); const select = domQuery('.bio-properties-panel-input', result.container); // when changeInput(select, 'B'); // then expect(updateSpy).to.have.been.calledWith('B'); }); }); // helpers //////////////////// function createReferenceSelect(options = {}) { const { autoFocuEntry, element, id = 'select', description, label, getValue = noop, setValue = noop, getOptions = noop, container } = options; return render( <ReferenceSelect autoFocuEntry={ autoFocuEntry } element={ element } id={ id } label={ label } description={ description } getValue={ getValue } setValue={ setValue } getOptions={ getOptions } />, { container } ); }
"use strict"; var Materials = (function () { function Materials() { } return Materials; }()); exports.Materials = Materials; //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9zaGFyZWQvbWF0ZXJpYWxzL21hdGVyaWFsLm1vZGVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQTtJQUFBO0lBR0EsQ0FBQztJQUFELGdCQUFDO0FBQUQsQ0FIQSxBQUdDLElBQUE7QUFIWSxpQkFBUyxZQUdyQixDQUFBIiwiZmlsZSI6ImFwcC9zaGFyZWQvbWF0ZXJpYWxzL21hdGVyaWFsLm1vZGVsLmpzIiwic291cmNlc0NvbnRlbnQiOlsiXHJcbmV4cG9ydCBjbGFzcyBNYXRlcmlhbHMge1xyXG5cdGlkOiBudW1iZXI7XHJcblx0bmFtZTogc3RyaW5nO1xyXG59Il19
version https://git-lfs.github.com/spec/v1 oid sha256:b5653dcc3f2ea224011589d238e324df81a9bfb5cb71ba008b8992d5ff49a0ed size 235056
var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var expressValidator = require('express-validator'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var session = require('express-session'); var mongo = require('mongodb'); var db = require('monk')('localhost/nodeblog'); var multer = require('multer'); var flash = require('connect-flash'); var events = require('./routes/events'); // var login = require('./routes/login'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'pug'); //app.use(multer({dest: './public/images/uploads'})); app.locals.moment = require('moment'); app.locals.truncateText = (text, length) => { return text.substring(0, length); } // uncomment after placing your favicon in /public //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); //express session app.use(session({ secret: 'secret', saveUninitialized: true, resave: true })) // Express Validator app.use(expressValidator({ errorFormatter: (param, msg, value) => { var namespace = param.split('.') , root = namespace.shift() , formParam = root; while(namespace.length) { formParam += '[' + namespace.shift() + ']'; } return { param : formParam, msg : msg, value : value }; } })); //Connect flash app.use(flash()); app.use((req, res, next) => { res.locals.messages = require('express-messages')(req, res); next(); }); //makes db accessible to all routes app.use((req, res, next) => { req.db = db; next(); }) // app.use('/', login); app.use('/', events); // catch 404 and forward to error handler app.use((req, res, next) => { var err = new Error('Not Found'); err.status = 404; next(err); }); // error handlers // development error handler // will print stacktrace if (app.get('env') === 'development') { app.use((err, req, res, next) => { res.status(err.status || 500); res.render('error', { message: err.message, error: err }); }); } // production error handler // no stacktraces leaked to user app.use((err, req, res, next) => { res.status(err.status || 500); res.render('error', { message: err.message, error: {} }); }); module.exports = app;
import action from 'src/state/action'; import t from './types'; export const nextPlayer = () => ({ type: t.GET_NEXT_PLAYER }); export const updateCurrentPlayer = current => action(t.SET_CURRENT_PLAYER, { current }); export const playerIsBot = () => action(t.PLAYER_IS_BOT, { isBot: true }); export const playerIsHuman = () => action(t.PLAYER_IS_HUMAN, { isBot: false });