/*

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
     IBM Corporation - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
     IBM Corporation - initial API and implementation
*/
(function(v,z){"function"===typeof define&&define.amd?define("orion/Deferred",z):"object"===typeof exports?module.exports=z():(v.orion=v.orion||{},v.orion.Deferred=z())})(this,function(){function v(){for(var p;p=L.shift();)p();c=!1}function z(p){L.push(p);c||(c=!0,f())}function C(c){return function(f){c(f)}}function H(){function c(){for(var p;p=h.shift();){var f=p.deferred,s="fulfilled"===e?"resolve":"reject";p=p[s];if("function"===typeof p)try{var q=p(b),D=q&&("object"===typeof q||"function"===typeof q)&&
q.then;if("function"===typeof D)if(q===f.promise)f.reject(new TypeError);else{var w=q.cancel;"function"===typeof w?f._parentCancel=w.bind(q):delete f._parentCancel;D.call(q,C(f.resolve),C(f.reject),C(f.progress))}else f.resolve(q)}catch(E){f.reject(E)}else f[s](b)}}function f(x){delete q._parentCancel;e="rejected";b=x;h.length&&z(c)}function D(x){function w(b){return function(c){(!e||"assumed"===e)&&b(c)}}delete q._parentCancel;try{var s=x&&("object"===typeof x||"function"===typeof x)&&x.then;if("function"===
typeof s)if(x===q)f(new TypeError);else{e="assumed";var v=x&&x.cancel;if("function"!==typeof v){var C=new H;x=C.promise;try{s(C.resolve,C.reject,C.progress)}catch(L){C.reject(L)}v=x.cancel;s=x.then}b=x;s.call(x,w(D),w(f));q._parentCancel=v.bind(x)}else e="fulfilled",b=x,h.length&&z(c)}catch(B){w(f)(B)}}function w(){var b=q._parentCancel;b?(delete q._parentCancel,b()):e||(b=Error("Cancel"),b.name="Cancel",f(b))}var b,e,h=[],q=this;this.resolve=function(b){e||D(b);return q};this.reject=function(b){e||
f(b);return q};this.progress=function(b){e||h.forEach(function(c){if(c.progress)try{c.progress(b)}catch(p){}});return q.promise};this.cancel=function(){q._parentCancel?setTimeout(w,0):w();return q};this.then=function(b,f,s){var w=new H;w._parentCancel=q.promise.cancel;h.push({resolve:b,reject:f,progress:s,deferred:w});("fulfilled"===e||"rejected"===e)&&z(c);return w.promise};this.promise={then:q.then,cancel:q.cancel}}var L=[],c=!1,f=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var c=
process.nextTick;return function(){c(v)}}if("function"===typeof MutationObserver){var f=document.createElement("div");(new MutationObserver(v)).observe(f,{attributes:!0});return function(){f.setAttribute("class","_tick")}}return function(){setTimeout(v,0)}}();H.all=function(c,f){function D(c,f){h||(e[c]=f,0===--b&&q.resolve(e))}function w(b,c){if(!h){if(f)try{D(b,f(c));return}catch(p){c=p}q.reject(c)}}var b=c.length,e=[],h=!1,q=new H;q.then(void 0,function(){h=!0;c.forEach(function(b){b.cancel&&b.cancel()})});
0===b?q.resolve(e):c.forEach(function(b,c){b.then(D.bind(void 0,c),w.bind(void 0,c))});return q.promise};H.when=function(c,f,D,w){var b;c&&"function"===typeof c.then||(b=new H,b.resolve(c),c=b.promise);return c.then(f,D,w)};return H});
(function(v,z){"function"===typeof define&&define.amd?define("orion/plugin",["orion/Deferred"],z):"object"===typeof exports?module.exports=z(require("orion/Deferred")):(v.orion=v.orion||{},v.orion.PluginProvider=z(v.orion.Deferred))})(this,function(v){function z(z,v){this.__objectId=z;this.__methods=v}return function(C){function H(b){h&&("undefined"===typeof ArrayBuffer&&(b=JSON.stringify(b)),h===self?h.postMessage(b):h.postMessage(b,"*"))}function L(){var c=[];Object.keys(T).forEach(function(b){var f=
T[b];c.push({serviceId:b,names:f.names,methods:f.methods,properties:f.properties})});return{headers:b||{},services:c}}function c(b,c){if(c&&c instanceof XMLHttpRequest){var f,e;try{f=c.status,e=c.statusText}catch(p){f=0,e=""}return{status:f||0,statusText:e}}return c}function f(b){var f=b?JSON.parse(JSON.stringify(b,c)):b;b instanceof Error&&(f.__isError=!0,f.message=f.message||b.message,f.name=f.name||b.name);return f}function p(b){if(!h)return(new v).reject(Error("plugin not connected"));b.id=String(q++);
var c=new v;S[b.id]=c;c.then(null,function(c){e&&(c instanceof Error&&"Cancel"===c.name)&&B({requestId:b.id,method:"cancel",params:c.message?[c.message]:[]})});var f=Object.prototype.toString;b.params.forEach(function(e,p){if("[object Object]"===f.call(e)&&!(e instanceof z)){var q,h;for(q in e)"[object Function]"===f.call(e[q])&&(h=h||[],h.push(q));if(h){var s=x++;N[s]=e;q=function(){delete N[s]};c.then(q,q);b.params[p]=new z(s,h)}}});B(b);return c.promise}function E(b,c){b||0===b?B({id:b,result:null,
error:c}):console.log(c)}function D(b,c,e,q){q.forEach(function(b,c){if(b&&"undefined"!==typeof b.__objectId){var f={};b.__methods.forEach(function(c){f[c]=function(){return p({objectId:b.__objectId,method:c,params:Array.prototype.slice.call(arguments)})}});q[c]=f}});var h=void 0===typeof b?null:{id:b,result:null,error:null};try{var w=e.apply(c,q);h&&(w&&"function"===typeof w.then?(s[b]=w,w.then(function(c){delete s[b];h.result=c;B(h)},function(c){s[b]&&(delete s[b],h.error=f(c),B(h))},function(){B({responseId:b,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(h.result=w,B(h)))}catch(x){h&&(h.error=f(x),B(h))}}function w(b){if(!(b.source!==h&&"undefined"!==typeof window)){b="string"!==typeof b.data?b.data:JSON.parse(b.data);try{if(b.method){var c=b.method,f=b.params||[];if("serviceId"in b){var e=T[b.serviceId];e||E(b.id,"service not found");e=e.implementation;c in e?D(b.id,e,e[c],f):E(b.id,"method not found")}else if("objectId"in b){var p=N[b.objectId];p||E(b.id,"object not found");!c in
p?D(b.id,p,p[c],f):E(b.id,"method not found")}else if("requestId"in b){var q=s[b.requestId];q&&("cancel"===c&&q.cancel)&&q.cancel.apply(q,f)}else if("responseId"in b){var w=S[b.responseId];w&&("progress"===c&&w.progress)&&w.progress.apply(w,f)}else throw Error("Bad method: "+b.method);}else{var x=S[String(b.id)];delete S[String(b.id)];b.error?x.reject(b.error):x.resolve(b.result)}}catch(z){console.log("Plugin._messageHandler "+z)}}}var b=C,e=!1,h=null,q=0,x=0,xa=0,s={},S={},N={},T={},B=H;this.updateHeaders=
function(c){if(e)throw Error("Cannot update headers. Plugin Provider is connected");b=c};this.registerServiceProvider=this.registerService=function(b,c,f){if(e)throw Error("Cannot register service. Plugin Provider is connected");"string"===typeof b?b=[b]:Array.isArray(b)||(b=[]);var p=null,q=[];for(p in c)"function"===typeof c[p]&&q.push(p);T[xa++]={names:b,methods:q,implementation:c,properties:f||{},listeners:{}}};this.connect=function(b,c){if(!e){if("undefined"===typeof window)h=self;else if(window!==
window.parent)h=window.parent;else if(null!==window.opener)h=window.opener;else{c&&c("No valid plugin target");return}addEventListener("message",w,!1);var f={method:"plugin",params:[L()]};H(f);e=!0}b&&b()};this.disconnect=function(){e&&(removeEventListener("message",w),h=null,e=!1)}}});this.JSON||(this.JSON={});
(function(){function v(c){return 10>c?"0"+c:c}function z(c){L.lastIndex=0;return L.test(c)?'"'+c.replace(L,function(c){var b=p[c];return"string"===typeof b?b:"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+c+'"'}function C(p,w){var b,e,h,q,x=c,v,s=w[p];s&&("object"===typeof s&&"function"===typeof s.toJSON)&&(s=s.toJSON(p));"function"===typeof E&&(s=E.call(w,p,s));switch(typeof s){case "string":return z(s);case "number":return isFinite(s)?String(s):"null";case "boolean":case "null":return String(s);
case "object":if(!s)return"null";c+=f;v=[];if("[object Array]"===Object.prototype.toString.apply(s)){q=s.length;for(b=0;b<q;b+=1)v[b]=C(b,s)||"null";h=0===v.length?"[]":c?"[\n"+c+v.join(",\n"+c)+"\n"+x+"]":"["+v.join(",")+"]";c=x;return h}if(E&&"object"===typeof E){q=E.length;for(b=0;b<q;b+=1)e=E[b],"string"===typeof e&&(h=C(e,s))&&v.push(z(e)+(c?": ":":")+h)}else for(e in s)Object.hasOwnProperty.call(s,e)&&(h=C(e,s))&&v.push(z(e)+(c?": ":":")+h);h=0===v.length?"{}":c?"{\n"+c+v.join(",\n"+c)+"\n"+
x+"}":"{"+v.join(",")+"}";c=x;return h}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(c){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+v(this.getUTCMonth()+1)+"-"+v(this.getUTCDate())+"T"+v(this.getUTCHours())+":"+v(this.getUTCMinutes())+":"+v(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(c){return this.valueOf()});var H=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
L=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,c,f,p={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},E;"function"!==typeof JSON.stringify&&(JSON.stringify=function(p,w,b){var e;f=c="";if("number"===typeof b)for(e=0;e<b;e+=1)f+=" ";else"string"===typeof b&&(f=b);if((E=w)&&"function"!==typeof w&&("object"!==typeof w||"number"!==typeof w.length))throw Error("JSON.stringify");return C("",{"":p})});
"function"!==typeof JSON.parse&&(JSON.parse=function(c,f){function b(c,e){var p,v,s=c[e];if(s&&"object"===typeof s)for(p in s)Object.hasOwnProperty.call(s,p)&&(v=b(s,p),void 0!==v?s[p]=v:delete s[p]);return f.call(c,e,s)}var e;c=String(c);H.lastIndex=0;H.test(c)&&(c=c.replace(H,function(b){return"\\u"+("0000"+b.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(c.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+c+")"),"function"===typeof f?b({"":e},""):e;throw new SyntaxError("JSON.parse");})})();
var JSLINT=function(){function v(){}function z(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function C(a,b){for(var d in b)z(b,d)&&(a[d]=b[d])}function H(){n.safe||(n.rhino&&C(J,sb),n.devel&&C(J,tb),n.browser&&C(J,ub),n.node&&C(J,vb),n.windows&&C(J,wb),n.widget&&C(J,xb))}function L(a,b,d){throw{name:"JSLintError",line:b,character:d,message:a+" ("+Math.floor(100*(b/oa.length))+"% scanned)."};}function c(k,b,d,c,Aa,t){var f;b=b||a;"(end)"===b.id&&(b=g);f=b.line||0;b=b.from||0;d={id:"(error)",
raw:k,evidence:oa[f-1]||"",line:f,character:b,a:d,b:c,c:Aa,d:t};d.reason=k.supplant(d);JSLINT.errors.push(d);n.passfail&&L("Stopping. ",f,b);Ba+=1;Ba>=n.maxerr&&L("Too many errors.",f,b);return d}function f(a,b,d,A,g,f,n){return c(a,{line:b,from:d},A,g,f,n)}function p(a,b,d,A,g,f){a=c(a,b,d,A,g,f);L("Stopping, unable to continue.",a.line,a.character)}function E(a,b,d,c,g,f,n){return p(a,{line:b,from:d},c,g,f,n)}function D(k,b){n.safe&&m["(global)"]&&"boolean"!==typeof J[k]?c("ADsafe global: "+k+".",
g):"hasOwnProperty"===k&&c("'hasOwnProperty' is a really bad name.");z(m,k)&&!m["(global)"]&&c(!0===m[k]?"'{a}' was used before it was defined.":"'{a}' is already defined.",a,k);m[k]=b;m["(global)"]?(hb[k]=m,z(ca,k)&&(c("'{a}' was used before it was defined.",a,k),delete ca[k])):K[k]=m}function w(a){a=a||0;for(var b=0,d;b<=a;)(d=Ca[b])||(d=Ca[b]=Y.token()),b+=1;return d}function b(b,l){switch(g.id){case "(number)":"."===a.id&&c("A dot following a number can be confused with a decimal point.",g);break;
case "-":("-"===a.id||"--"===a.id)&&c("Confusing minusses.");break;case "+":("+"===a.id||"++"===a.id)&&c("Confusing plusses.")}if("(string)"===g.type||g.identifier)Oa=g.value;b&&a.id!==b&&(l?"(end)"===a.id?c("Unmatched '{a}'.",l,l.id):c("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",a,b,l.id,l.line,a.value):("(identifier)"!==a.type||a.value!==b)&&c("Expected '{a}' and instead saw '{b}'.",a,b,a.value));O=g;for(g=a;;){a=Ca.shift()||Y.token();if("(end)"===a.id||"(error)"===a.id)break;
if("special"===a.type){var d=void 0,A=void 0,Aa=void 0,f=a.value,e=d=void 0;switch(f){case "*/":p("Unbegun comment.");break;case "/*members":case "/*member":f="/*members";da||(da={});A=da;break;case "/*jslint":n.safe&&c("ADsafe restriction.");A=n;Aa=yb;break;case "/*global":n.safe&&c("ADsafe restriction."),A=J}d=Y.token();a:for(;;){for(;;){if("special"===d.type&&"*/"===d.value)break a;if("(endline)"!==d.id&&","!==d.id)break;d=Y.token()}"(string)"!==d.type&&("(identifier)"!==d.type&&"/*members"!==
f)&&p("Bad option.",d);e=Y.token();":"===e.id?(e=Y.token(),A===da&&p("Expected '{a}' and instead saw '{b}'.",d,"*/",":"),"indent"===d.value&&"/*jslint"===f?(d=+e.value,("number"!==typeof d||!isFinite(d)||0>=d||Math.floor(d)!==d)&&p("Expected a small integer and instead saw '{a}'.",e,e.value),A.white=!0,A.indent=d):"maxerr"===d.value&&"/*jslint"===f?(d=+e.value,("number"!==typeof d||!isFinite(d)||0>=d||Math.floor(d)!==d)&&p("Expected a small integer and instead saw '{a}'.",e,e.value),A.maxerr=d):"maxlen"===
d.value&&"/*jslint"===f?(d=+e.value,("number"!==typeof d||!isFinite(d)||0>=d||Math.floor(d)!==d)&&p("Expected a small integer and instead saw '{a}'.",e,e.value),A.maxlen=d):"true"===e.value?A[d.value]=!0:"false"===e.value?A[d.value]=!1:p("Bad option value.",e),d=Y.token()):("/*jslint"===f&&p("Missing option value.",d),A[d.value]=!1,d=e)}Aa&&H()}else if("(endline)"!==a.id)break}}function e(k,l){var d;"(end)"===a.id&&p("Unexpected early end of program.",g);b();n.safe&&("boolean"===typeof J[g.value]&&
"("!==a.id&&"."!==a.id)&&c("ADsafe violation.",g);l&&(Oa="anonymous",m["(verb)"]=g.value);if(!0===l&&g.fud)d=g.fud();else{if(g.nud)d=g.nud();else{if("(number)"===a.type&&"."===g.id)return c("A leading decimal point can be confused with a dot: '.{a}'.",g,a.value),b(),g;p("Expected an identifier and instead saw '{a}'.",g,g.id)}for(;k<a.lbp;)b(),g.led?d=g.led(d):p("Expected an operator and instead saw '{a}'.",g,g.id)}return d}function h(b,l){b=b||g;l=l||a;(n.white||"styleproperty"===y||"style"===y)&&
b.character!==l.from&&b.line===l.line&&c("Unexpected space after '{a}'.",l,b.value)}function q(b,c){b=b||g;c=c||a;n.white&&!b.comment&&b.line===c.line&&h(b,c)}function x(b,l){n.white&&(b=b||g,l=l||a,b.line===l.line&&b.character===l.from&&c("Missing space after '{a}'.",a,b.value))}function xa(b,l){b=b||g;l=l||a;!n.laxbreak&&b.line!==l.line?c("Bad line breaking before '{a}'.",l,l.id):n.white&&(b=b||g,l=l||a,b.character===l.from&&c("Missing space after '{a}'.",a,b.value))}function s(b){n.white&&"(end)"!==
a.id&&(b=F+(b||0),a.from!==b&&c("Expected '{a}' to have an indentation at {b} instead at {c}.",a,a.value,b,a.from))}function S(b){b=b||g;b.line!==a.line&&c("Line breaking error '{a}'.",b,b.value)}function N(){g.line!==a.line?n.laxbreak||c("Bad line breaking before '{a}'.",g,a.id):g.character!==a.from&&n.white&&c("Unexpected space after '{a}'.",a,g.value);b(",");x(g,a)}function T(a,b){var d=Q[a];if(!d||"object"!==typeof d)Q[a]=d={id:a,lbp:b,value:a};return d}function B(a){return T(a,0)}function aa(a,
b){var d=B(a);d.identifier=d.reserved=!0;d.fud=b;return d}function ga(a,b){var d=aa(a,b);d.block=!0;return d}function Na(a){var b=a.id.charAt(0);if("a"<=b&&"z">=b||"A"<=b&&"Z">=b)a.identifier=a.reserved=!0;return a}function V(a,b){var d=T(a,150);Na(d);d.nud="function"===typeof b?b:function(){this.right=e(150);this.arity="unary";if("++"===this.id||"--"===this.id)n.plusplus?c("Unexpected use of '{a}'.",this,this.id):(!this.right.identifier||this.right.reserved)&&("."!==this.right.id&&"["!==this.right.id)&&
c("Bad operand.",this);return this};return d}function ya(a,b){var d=B(a);d.type=a;d.nud=b;return d}function I(a,b){var d=ya(a,b);d.identifier=d.reserved=!0;return d}function X(a,b){return I(a,function(){if("this"===this.id||"arguments"===this.id||"eval"===this.id)Pa&&m["(global)"]?c("Strict violation.",this):n.safe&&c("ADsafe violation.",this);return this})}function P(b,c,d,A){b=T(b,d);Na(b);b.led=function(b){A||(xa(O,g),x(g,a));if("function"===typeof c)return c(b,this);this.left=b;this.right=e(d);
return this};return b}function ba(b,l){var d=T(b,100);d.led=function(b){xa(O,g);x(g,a);var d=e(100);b&&"NaN"===b.id||d&&"NaN"===d.id?c("Use the isNaN function to compare with NaN.",this):l&&l.apply(this,[b,d]);"!"===b.id&&c("Confusing use of '{a}'.",b,"!");"!"===d.id&&c("Confusing use of '{a}'.",b,"!");this.left=b;this.right=d;return this};return d}function za(a){return a&&("(number)"===a.type&&0===+a.value||"(string)"===a.type&&" "===a.value||"true"===a.type||"false"===a.type||"undefined"===a.type||
"null"===a.type)}function ha(a,b){T(a,20).exps=!0;return P(a,function(a,b){var k;b.left=a;!1===J[a.value]&&!0===K[a.value]["(global)"]&&c("Read only.",a);if(n.safe){k=a;do"boolean"===typeof J[k.value]&&c("ADsafe violation.",k),k=k.left;while(k)}if(a){if("."===a.id||"["===a.id)return(!a.left||"arguments"===a.left.value)&&c("Bad assignment.",b),b.right=e(19),b;if(a.identifier&&!a.reserved)return"exception"===m[a.value]&&c("Do not assign to the exception parameter.",a),b.right=e(19),b;a===Q["function"]&&
c("Expected an identifier in an assignment and instead saw a function invocation.",g)}p("Bad assignment.",b)},20)}function ia(a,b,d){a=T(a,d);Na(a);a.led="function"===typeof b?b:function(a){n.bitwise&&c("Unexpected use of '{a}'.",this,this.id);this.left=a;this.right=e(d);return this};return a}function ja(b){T(b,20).exps=!0;return P(b,function(b,d){n.bitwise&&c("Unexpected use of '{a}'.",d,d.id);x(O,g);x(g,a);if(b){if("."===b.id||"["===b.id||b.identifier&&!b.reserved)return e(19),d;b===Q["function"]&&
c("Expected an identifier in an assignment, and instead saw a function invocation.",g);return d}p("Bad assignment.",d)},20)}function ib(a,b){var d=T(a,150);d.led=function(a){n.plusplus?c("Unexpected use of '{a}'.",this,this.id):(!a.identifier||a.reserved)&&("."!==a.id&&"["!==a.id)&&c("Bad operand.",this);this.left=a;return this};return d}function Qa(){if(a.identifier)return b(),n.safe&&Ra[g.value]?c("ADsafe violation: '{a}'.",g,g.value):g.reserved&&!n.es5&&c("Expected an identifier and instead saw '{a}' (a reserved word).",
g,g.id),g.value}function pa(){var b=Qa();if(b)return b;"function"===g.id&&"("===a.id?c("Missing name in function statement."):p("Expected an identifier and instead saw '{a}'.",a,a.value)}function Da(b){var l=0,d;if(!(";"!==a.id||Sa))for(;;){d=w(l);if(d.reach)break;if("(endline)"!==d.id){if("function"===d.id){c("Inner functions should be listed at the top of the outer function.",d);break}c("Unreachable '{a}' after '{b}'.",d,d.value,b);break}l+=1}}function Ta(k){var l=F,d=K,A=a;if(";"===A.id)c("Unnecessary semicolon.",
A),b(";");else return A.identifier&&(!A.reserved&&":"===w().id)&&(b(),b(":"),K=Object.create(d),D(A.value,"label"),a.labelled||c("Label '{a}' on {b} statement.",a,A.value,a.value),Ua.test(A.value+":")&&c("Label '{a}' looks like a javascript url.",A,A.value),a.label=A.value,A=a),k||s(),k=e(0,!0),A.block||(!k||!k.exps?c("Expected an assignment or function call and instead saw an expression.",g):"("===k.id&&"new"===k.left.id&&c("Do not use 'new' for side effects."),";"!==a.id?f("Missing semicolon.",
g.line,g.from+g.value.length):(h(g,a),b(";"),x(g,a))),F=l,K=d,k}function jb(){return"use strict"===a.value?(b(),b(";"),Pa=!0):!1}function qa(k){var l=[],d;k&&(!jb()&&n.strict)&&c('Missing "use strict" statement.',a);if(n.adsafe)switch(k){case "script":ka||("ADSAFE"!==a.value||"."!==w(0).id||"id"!==w(1).value&&"go"!==w(1).value)&&p("ADsafe violation: Missing ADSAFE.id or ADSAFE.go.",a);"ADSAFE"===a.value&&("."===w(0).id&&"id"===w(1).value)&&(ka&&p("ADsafe violation.",a),b("ADSAFE"),b("."),b("id"),
b("("),a.value!==U&&p("ADsafe violation: id does not match.",a),b("(string)"),b(")"),b(";"),ka=!0);break;case "lib":if("ADSAFE"===a.value)return b("ADSAFE"),b("."),b("lib"),b("("),b("(string)"),N(),k=e(0),"function"!==k.id&&p("The second argument to lib must be a function.",k),(d=(d=k.funct["(params)"])&&d.join(", "))&&"lib"!==d&&p("Expected '{a}' and instead saw '{b}'.",k,"(lib)","("+d+")"),b(")"),b(";"),l;p("ADsafe lib violation.")}for(;!a.reach&&"(end)"!==a.id;)";"===a.id?(c("Unnecessary semicolon."),
b(";")):l.push(Ta());return l}function W(k){var l,d=ra,A=F,f=K,e;ra=k;K=Object.create(K);x(g,a);e=a;if("{"===a.id){b("{");if("}"!==a.id||g.line!==a.line){for(F+=n.indent;!k&&a.from>F;)F+=n.indent;k||jb();l=qa();F-=n.indent;s()}b("}",e);F=A}else c("Expected '{a}' and instead saw '{b}'.",a,"{",a.value),Sa=!0,l=[Ta()],Sa=!1;m["(verb)"]=null;K=f;ra=d;return l}function kb(){return this}function Ea(a){da&&"boolean"!==typeof da[a]&&c("Unexpected /*member '{a}'.",g,a);ea[a]="number"===typeof ea[a]?ea[a]+
1:1}function Va(a){var b=a.value;a=a.line;var d=ca[b];"function"===typeof d&&(d=!1);d?d[d.length-1]!==a&&d.push(a):(d=[a],ca[b]=d)}function Wa(){if(a.identifier)return b(),!0}function Fa(){"-"===a.id&&(b("-"),h(),S());if("(number)"===a.type)return b("(number)"),!0}function Xa(){if("(string)"===a.type)return b(),!0}function Z(){var k,l,d;if(a.identifier){d=a.value;if("rgb"===d||"rgba"===d){b();b("(");for(k=0;3>k;k+=1)k&&b(","),l=a.value,"(number)"!==a.type||0>l?(c("Expected a positive number and instead saw '{a}'",
a,l),b()):(b(),"%"===a.id?(b("%"),100<l&&c("Expected a percentage and instead saw '{a}'",g,l)):255<l&&c("Expected a small number and instead saw '{a}'",g,l));"rgba"===d&&(b(","),l=+a.value,("(number)"!==a.type||0>l||1<l)&&c("Expected a number between 0 and 1 and instead saw '{a}'",a,l),b(),"%"===a.id&&(c("Unexpected '%'."),b("%")));b(")");return!0}if(!0===zb[a.value])return b(),!0}else if("(color)"===a.type)return b(),!0;return!1}function G(){"-"===a.id&&(b("-"),h(),S());return"(number)"===a.type?
(b(),"(string)"!==a.type&&!0===lb[a.value]?(h(),b()):0!==+g.value&&c("Expected a linear unit and instead saw '{a}'.",a,a.value),!0):!1}function la(){if(a.identifier)switch(a.value){case "thin":case "medium":case "thick":return b(),!0}else return G()}function sa(){if(a.identifier){if("auto"===a.value)return b(),!0}else return G()}function fa(){var k,l;if(a.identifier&&"url"===a.value){a=Y.range("(",")");l=a.value;k=l.charAt(0);if('"'===k||"'"===k)l.slice(-1)!==k?c("Bad url string."):(l=l.slice(1,-1),
0<=l.indexOf(k)&&c("Bad url string."));l||c("Missing url.");b();n.safe&&mb.test(l)&&p("ADsafe URL violation.");ta.push(l);return!0}return!1}function Ya(c){var l=0,d,A,g,f=0;switch(typeof c){case "function":return c();case "string":return a.identifier&&a.value===c?(b(),!0):!1}for(;;){if(l>=c.length)return!1;g=c[l];l+=1;if(!0===g)break;else"number"===typeof g?(d=g,g=c[l],l+=1):d=1;for(A=!1;0<d;)if(Ya(g))A=!0,d-=1;else break;if(A)return!0}f=l;for(d=[];;){g=!1;for(l=f;l<c.length;l+=1)if(!d[l]&&Ya(Ga[c[l]])){g=
A=!0;d[l]=!0;break}if(!g)return A}}function nb(){for(var k;!("}"===a.id||"(end)"===a.id||R&&a.id===R);){for(;";"===a.id;)c("Misplaced ';'."),b(";");for(k=void 0;"*"===a.id||"#"===a.id||"_"===a.value;)n.css||c("Unexpected '{a}'.",a,a.value),b();"-"===a.id?(n.css||c("Unexpected '{a}'.",a,a.value),b("-"),a.identifier||c("Expected a non-standard style attribute and instead saw '{a}'.",a,a.value),b(),k=Za):(a.identifier?z(Ga,a.value)?k=Ga[a.value]:(k=Za,n.css||c("Unrecognized style attribute '{a}'.",a,
a.value)):c("Excepted a style attribute, and instead saw '{a}'.",a,a.value),b());b(":");a.identifier&&"inherit"===a.value?b():Ya(k)||(c("Unexpected token '{a}'.",a,a.value),b());"!"===a.id&&(b("!"),h(),a.identifier&&"important"===a.value?b():c("Expected '{a}' and instead saw '{b}'.",a,"important",a.value));"}"===a.id||a.id===R?c("Missing '{a}'.",a,";"):b(";")}}function $a(){if(a.identifier)z(ab,a.value)||c("Expected a tagName, and instead saw {a}.",a,a.value),b();else switch(a.id){case "\x3e":case "+":b();
$a();break;case ":":b(":");switch(a.value){case "active":case "after":case "before":case "checked":case "disabled":case "empty":case "enabled":case "first-child":case "first-letter":case "first-line":case "first-of-type":case "focus":case "hover":case "last-of-type":case "link":case "only-of-type":case "root":case "target":case "visited":b();break;case "lang":b();b("(");a.identifier||c("Expected a lang code, and instead saw :{a}.",a,a.value);b(")");break;case "nth-child":case "nth-last-child":case "nth-last-of-type":case "nth-of-type":b();
b("(");a:if("(number)"===a.id)b(),"n"===a.value&&a.identifier&&(h(),b(),"+"===a.id&&(h(),b("+"),h(),b("(number)")));else{switch(a.value){case "odd":case "even":if(a.identifier){b();break a}}c("Unexpected token '{a}'.",a,a.value)}b(")");break;case "not":b();b("(");":"===a.id&&"not"===w(0).value&&c("Nested not.");$a();b(")");break;default:c("Expected a pseudo, and instead saw :{a}.",a,a.value)}break;case "#":b("#");a.identifier||c("Expected an id, and instead saw #{a}.",a,a.value);b();break;case "*":b("*");
break;case ".":b(".");a.identifier||c("Expected a class, and instead saw #.{a}.",a,a.value);b();break;case "[":b("[");a.identifier||c("Expected an attribute, and instead saw [{a}].",a,a.value);b();if("\x3d"===a.id||"~\x3d"===a.value||"$\x3d"===a.value||"|\x3d"===a.value||"*\x3d"===a.id||"^\x3d"===a.id)b(),"(string)"!==a.type&&c("Expected a string, and instead saw {a}.",a,a.value),b();b("]");break;default:p("Expected a CSS selector, and instead saw {a}.",a,a.value)}}function ob(){for(var k;"@"===a.id;)if(k=
w(),k.identifier&&"import"===k.value)b("@"),b(),fa()||(c("Expected '{a}' and instead saw '{b}'.",a,"url",a.value),b()),b(";");else break;for(;"\x3c/"!==a.id&&"(end)"!==a.id;){a:{k=void 0;if("{"===a.id)c("Expected a style pattern, and instead saw '{a}'.",a,a.id);else if("@"===a.id){b("@");k=a.value;if(a.identifier&&!0===Ab[k]){b();break a}c("Expected an at-rule, and instead saw @{a}.",a,k)}for(;;){$a();if("\x3c/"===a.id||"{"===a.id||"(end)"===a.id)break a;","===a.id&&N()}}y="styleproperty";";"===a.id?
b(";"):(b("{"),nb(),y="style",b("}"))}}function bb(){var c=Qa(!0);c||("(string)"===a.id?(c=a.value,b()):"(number)"===a.id&&(c=a.value.toString(),b()));return c}function Ha(c){var l,d=K;K=Object.create(d);l=m={"(name)":c||'"'+Oa+'"',"(line)":a.line,"(context)":m,"(breakage)":0,"(loopage)":0,"(scope)":K};g.funct=m;ua.push(m);c&&D(c,"function");c=m;var A;a:{var f=a,e=[];b("(");q();if(")"===a.id)b(")"),q(O,g);else for(;;)if(A=pa(),e.push(A),D(A,"parameter"),","===a.id)N();else{b(")",f);q(O,g);A=e;break a}A=
void 0}c["(params)"]=A;W(!1);K=d;m["(last)"]=g.line;m=m["(context)"];return l}function cb(k){var l,d;m["(onevar)"]&&n.onevar?c("Too many var statements."):m["(global)"]||(m["(onevar)"]=!0);for(this.first=[];;){x(g,a);l=pa();m["(global)"]&&!1===J[l]&&c("Redefinition of '{a}'.",g,l);D(l,"unused");if(k)break;d=g;this.first.push(g);"\x3d"===a.id&&(x(g,a),b("\x3d"),x(g,a),"undefined"===a.id&&c("It is not necessary to initialize '{a}' to 'undefined'.",g,l),"\x3d"===w(0).id&&a.identifier&&p("Variable {a} was not declared correctly.",
a,a.value),l=e(0),d.first=l);if(","!==a.id)break;N()}return this}function db(){function k(){var d={},k=a;b("{");if("}"!==a.id)for(;;){if("(end)"===a.id)p("Missing '}' to match '{' from line {a}.",a,k.line);else if("}"===a.id){c("Unexpected comma.",g);break}else","===a.id?p("Unexpected comma.",a):"(string)"!==a.id&&c("Expected a string and instead saw {a}.",a,a.value);!0===d[a.value]?c("Duplicate key '{a}'.",a,a.value):"__proto__"===a.value?c("Stupid key '{a}'.",a,a.value):d[a.value]=!0;b();b(":");
db();if(","!==a.id)break;b(",")}b("}")}function l(){var d=a;b("[");if("]"!==a.id)for(;;){if("(end)"===a.id)p("Missing ']' to match '[' from line {a}.",a,d.line);else if("]"===a.id){c("Unexpected comma.",g);break}else","===a.id&&p("Unexpected comma.",a);db();if(","!==a.id)break;b(",")}b("]")}switch(a.id){case "{":k();break;case "[":l();break;case "true":case "false":case "null":case "(number)":case "(string)":b();break;case "-":b("-");g.character!==a.from&&c("Unexpected space after '-'.",g);h(g,a);
b("(number)");break;default:p("Expected a JSON value.",a)}}function pb(a){var b=[],d;for(d in a)z(a,d)&&b.push(d);return b}var U,ka,va,Oa,Ia,Ab={media:!0,"font-face":!0,page:!0},Bb={"\x3c":!0,"\x3c\x3d":!0,"\x3d\x3d":!0,"\x3d\x3d\x3d":!0,"!\x3d\x3d":!0,"!\x3d":!0,"\x3e":!0,"\x3e\x3d":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0},Ra={arguments:!0,callee:!0,caller:!0,constructor:!0,eval:!0,prototype:!0,stack:!0,unwatch:!0,valueOf:!0,watch:!0},yb={adsafe:!0,bitwise:!0,browser:!0,cap:!0,css:!0,debug:!0,devel:!0,
eqeqeq:!0,es5:!0,evil:!0,forin:!0,fragment:!0,immed:!0,laxbreak:!0,newcap:!0,node:!0,nomen:!0,on:!0,onevar:!0,passfail:!0,plusplus:!0,regexp:!0,rhino:!0,undef:!0,safe:!0,windows:!0,strict:!0,sub:!0,white:!0,widget:!0},ub={addEventListener:!1,blur:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,defaultStatus:!1,document:!1,event:!1,focus:!1,frames:!1,getComputedStyle:!1,history:!1,Image:!1,length:!1,location:!1,moveBy:!1,moveTo:!1,name:!1,navigator:!1,onbeforeunload:!0,onblur:!0,onerror:!0,
onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,opener:!1,Option:!1,parent:!1,print:!1,removeEventListener:!1,resizeBy:!1,resizeTo:!1,screen:!1,scroll:!1,scrollBy:!1,scrollTo:!1,setInterval:!1,setTimeout:!1,status:!1,top:!1,window:!1,XMLHttpRequest:!1},Ga,Za,zb={aliceblue:!0,antiquewhite:!0,aqua:!0,aquamarine:!0,azure:!0,beige:!0,bisque:!0,black:!0,blanchedalmond:!0,blue:!0,blueviolet:!0,brown:!0,burlywood:!0,cadetblue:!0,chartreuse:!0,chocolate:!0,coral:!0,cornflowerblue:!0,cornsilk:!0,crimson:!0,
cyan:!0,darkblue:!0,darkcyan:!0,darkgoldenrod:!0,darkgray:!0,darkgreen:!0,darkkhaki:!0,darkmagenta:!0,darkolivegreen:!0,darkorange:!0,darkorchid:!0,darkred:!0,darksalmon:!0,darkseagreen:!0,darkslateblue:!0,darkslategray:!0,darkturquoise:!0,darkviolet:!0,deeppink:!0,deepskyblue:!0,dimgray:!0,dodgerblue:!0,firebrick:!0,floralwhite:!0,forestgreen:!0,fuchsia:!0,gainsboro:!0,ghostwhite:!0,gold:!0,goldenrod:!0,gray:!0,green:!0,greenyellow:!0,honeydew:!0,hotpink:!0,indianred:!0,indigo:!0,ivory:!0,khaki:!0,
lavender:!0,lavenderblush:!0,lawngreen:!0,lemonchiffon:!0,lightblue:!0,lightcoral:!0,lightcyan:!0,lightgoldenrodyellow:!0,lightgreen:!0,lightpink:!0,lightsalmon:!0,lightseagreen:!0,lightskyblue:!0,lightslategray:!0,lightsteelblue:!0,lightyellow:!0,lime:!0,limegreen:!0,linen:!0,magenta:!0,maroon:!0,mediumaquamarine:!0,mediumblue:!0,mediumorchid:!0,mediumpurple:!0,mediumseagreen:!0,mediumslateblue:!0,mediumspringgreen:!0,mediumturquoise:!0,mediumvioletred:!0,midnightblue:!0,mintcream:!0,mistyrose:!0,
moccasin:!0,navajowhite:!0,navy:!0,oldlace:!0,olive:!0,olivedrab:!0,orange:!0,orangered:!0,orchid:!0,palegoldenrod:!0,palegreen:!0,paleturquoise:!0,palevioletred:!0,papayawhip:!0,peachpuff:!0,peru:!0,pink:!0,plum:!0,powderblue:!0,purple:!0,red:!0,rosybrown:!0,royalblue:!0,saddlebrown:!0,salmon:!0,sandybrown:!0,seagreen:!0,seashell:!0,sienna:!0,silver:!0,skyblue:!0,slateblue:!0,slategray:!0,snow:!0,springgreen:!0,steelblue:!0,tan:!0,teal:!0,thistle:!0,tomato:!0,turquoise:!0,violet:!0,wheat:!0,white:!0,
whitesmoke:!0,yellow:!0,yellowgreen:!0},ma,eb,lb={"%":!0,cm:!0,em:!0,ex:!0,"in":!0,mm:!0,pc:!0,pt:!0,px:!0},Ja,tb={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},Cb={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"/":"\\/","\\":"\\\\"},m,wa="closure exception global label outer unused var".split(" "),ua,hb,ab={a:{},abbr:{},acronym:{},address:{},applet:{},area:{empty:!0,parent:" map "},article:{},aside:{},audio:{},b:{},base:{empty:!0,parent:" head "},bdo:{},big:{},blockquote:{},
body:{parent:" html noframes "},br:{empty:!0},button:{},canvas:{parent:" body p div th td "},caption:{parent:" table "},center:{},cite:{},code:{},col:{empty:!0,parent:" table colgroup "},colgroup:{parent:" table "},command:{parent:" menu "},datalist:{},dd:{parent:" dl "},del:{},details:{},dialog:{},dfn:{},dir:{},div:{},dl:{},dt:{parent:" dl "},em:{},embed:{},fieldset:{},figure:{},font:{},footer:{},form:{},frame:{empty:!0,parent:" frameset "},frameset:{parent:" html frameset "},h1:{},h2:{},h3:{},h4:{},
h5:{},h6:{},head:{parent:" html "},header:{},hgroup:{},html:{parent:"*"},hr:{empty:!0},i:{},iframe:{},img:{empty:!0},input:{empty:!0},ins:{},kbd:{},keygen:{},label:{},legend:{parent:" details fieldset figure "},li:{parent:" dir menu ol ul "},link:{empty:!0,parent:" head "},map:{},mark:{},menu:{},meta:{empty:!0,parent:" head noframes noscript "},meter:{},nav:{},noframes:{parent:" html body "},noscript:{parent:" body head noframes "},object:{},ol:{},optgroup:{parent:" select "},option:{parent:" optgroup select "},
output:{},p:{},param:{empty:!0,parent:" applet object "},pre:{},progress:{},q:{},rp:{},rt:{},ruby:{},samp:{},script:{empty:!0,parent:" body div frame head iframe p pre span "},section:{},select:{},small:{},span:{},source:{},strong:{},style:{parent:" head ",empty:!0},sub:{},sup:{},table:{},tbody:{parent:" table "},td:{parent:" tr "},textarea:{},tfoot:{parent:" table "},th:{parent:" tr "},thead:{parent:" table "},time:{},title:{parent:" head "},tr:{parent:" table tbody thead tfoot "},tt:{},u:{},ul:{},
"var":{},video:{}},Ka,ca,ra,F,na,oa,Ca,ea,da,vb={Buffer:!1,clearInterval:!1,clearTimeout:!1,console:!1,exports:!1,global:!1,module:!1,process:!1,require:!1,setInterval:!1,setTimeout:!1,__filename:!1,__dirname:!1},a,Sa,n,J,fb,O,sb={defineClass:!1,deserialize:!1,gc:!1,help:!1,load:!1,loadClass:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},K,wb={ActiveXObject:!1,CScript:!1,Debug:!1,Enumerator:!1,System:!1,VBArray:!1,WScript:!1},
La,M,Db={Array:!1,Boolean:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,isFinite:!1,isNaN:!1,JSON:!1,Math:!1,Number:!1,Object:!1,parseInt:!1,parseFloat:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,TypeError:!1,URIError:!1},Eb={E:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,PI:!0,SQRT1_2:!0,SQRT2:!0,MAX_VALUE:!0,MIN_VALUE:!0,NEGATIVE_INFINITY:!0,POSITIVE_INFINITY:!0},Pa,Q={},Ma,g,ta,Ba,xb=
{alert:!0,animator:!0,appleScript:!0,beep:!0,bytesToUIString:!0,Canvas:!0,chooseColor:!0,chooseFile:!0,chooseFolder:!0,closeWidget:!0,COM:!0,convertPathToHFS:!0,convertPathToPlatform:!0,CustomAnimation:!0,escape:!0,FadeAnimation:!0,filesystem:!0,Flash:!0,focusWidget:!0,form:!0,FormField:!0,Frame:!0,HotKey:!0,Image:!0,include:!0,isApplicationRunning:!0,iTunes:!0,konfabulatorVersion:!0,log:!0,md5:!0,MenuItem:!0,MoveAnimation:!0,openURL:!0,play:!0,Point:!0,popupMenu:!0,preferenceGroups:!0,preferences:!0,
print:!0,prompt:!0,random:!0,Rectangle:!0,reloadWidget:!0,ResizeAnimation:!0,resolvePath:!0,resumeUpdates:!0,RotateAnimation:!0,runCommand:!0,runCommandInBg:!0,saveAs:!0,savePreferences:!0,screen:!0,ScrollBar:!0,showWidgetPreferences:!0,sleep:!0,speak:!0,Style:!0,suppressUpdates:!0,system:!0,tellWidget:!0,Text:!0,TextArea:!0,Timer:!0,unescape:!0,updateNow:!0,URL:!0,Web:!0,widget:!0,Window:!0,XMLDOM:!0,XMLHttpRequest:!0,yahooCheckLogin:!0,yahooLogin:!0,yahooLogout:!0},y,R,gb=/@cc|<\/?|script|\]*s\]|<\s*!|&lt/i,
Fb=/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,Gb=/^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/(\*(jslint|members?|global)?|=|\/)?|\*[\/=]?|\+[+=]?|-[\-=]?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/,qb=/^\s*(['"=>\/&#]|<(?:\/|\!(?:--)?)?|[a-zA-Z][a-zA-Z0-9_\-]*|[0-9]+|--)/,Hb=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,
Ib=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Jb=/[>&]|<[\/!]?|--/,Kb=/\*\/|\/\*/,rb=/^([a-zA-Z_$][a-zA-Z0-9_$]*)$/,Ua=/^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i,mb=/&|\+|\u00AD|\.\.|\/\*|%[^;]|base64|url|expression|data|mailto/i,Lb=/[^a-zA-Z0-9+\-_\/ ]/,Mb=/[\[\]\/\\"'*<>.&:(){}+=#]/,Nb={outer:qb,html:qb,style:/^\s*([{:#%.=,>+\[\]@()"';]|\*=?|\$=|\|=|\^=|~=|[a-zA-Z_][a-zA-Z0-9_\-]*|[0-9]+|<\/|\/\*)/,
styleproperty:/^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/};"function"!==typeof Object.create&&(Object.create=function(a){v.prototype=a;return new v});String.prototype.entityify=function(){return this.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;")};String.prototype.isAlpha=function(){return"a"<=this&&"z\uffff">=this||"A"<=this&&"Z\uffff">=this};String.prototype.isDigit=function(){return"0"<=this&&"9">=this};String.prototype.supplant=
function(a){return this.replace(/\{([^{}]*)\}/g,function(b,d){var c=a[d];return"string"===typeof c||"number"===typeof c?c:b})};String.prototype.name=function(){return rb.test(this)?this:Hb.test(this)?'"'+this.replace(Ib,function(a){var b=Cb[a];return b?b:"\\u"+("0000"+a.charCodeAt().toString(16)).slice(-4)})+'"':'"'+this+'"'};var Y=function(){function a(){var b;if(e>=oa.length)return!1;d=1;t=oa[e];e+=1;b=t.search(/ \t/);0<=b&&f("Mixed spaces and tabs.",e,b+1);t=t.replace(/\t/g,Ma);b=t.search(Fb);
0<=b&&f("Unsafe character.",e,b);n.maxlen&&n.maxlen<t.length&&f("Line too long.",e,t.length);return!0}function b(a,k){var l,g;g="(color)"===a?{type:a}:"(punctuator)"===a||"(identifier)"===a&&z(Q,k)?Q[k]||Q["(error)"]:Q[a];g=Object.create(g);("(string)"===a||"(range)"===a)&&Ua.test(k)&&f("Script URL.",e,c);"(identifier)"===a&&(g.identifier=!0,"__iterator__"===k||"__proto__"===k?E("Reserved name '{a}'.",e,c,k):n.nomen&&("_"===k.charAt(0)||"_"===k.charAt(k.length-1))&&f("Unexpected {a} in '{b}'.",e,
c,"dangling '_'",k));g.value=k;g.line=e;g.character=d;g.from=c;l=g.id;"(endline)"!==l&&(fb=l&&(0<="(,\x3d:[!\x26|?{};".indexOf(l.charAt(l.length-1))||"return"===l));return g}var d,c,e,t;return{init:function(b){oa="string"===typeof b?b.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n"):b;e=0;a();c=1},range:function(a,k){var g,n="";c=d;for(t.charAt(0)!==a&&E("Expected '{a}' and instead saw '{b}'.",e,d,a,t.charAt(0));;){t=t.slice(1);d+=1;g=t.charAt(0);switch(g){case "":E("Missing '{a}'.",e,d,g);break;
case k:return t=t.slice(1),d+=1,b("(range)",n);case R:case "\\":f("Unexpected '{a}'.",e,d,g)}n+=g}},token:function(){function p(a){if(a=a.exec(t))return r=a[0].length,a=a[1],u=a.charAt(0),t=t.substr(r),c=d+r-a.length,d+=r,a}function q(g){function p(a){var b=parseInt(t.substr(h+1,a),16);h+=a;32<=b&&(126>=b&&34!==b&&92!==b&&39!==b)&&f("Unnecessary escapement.",e,d);d+=a;m=String.fromCharCode(b)}var m,h,r="";na&&'"'!==g&&f("Strings must use doublequote.",e,d);if(R===g||"scriptstring"===y&&!R)return b("(punctuator)",
g);for(h=0;;){for(;h>=t.length;)h=0,("html"!==y||!a())&&E("Unclosed string.",e,c);m=t.charAt(h);if(m===g)return d+=1,t=t.substr(h+1),b("(string)",r,g);if(" ">m){if("\n"===m||"\r"===m)break;f("Control character in string: {a}.",e,d+h,t.slice(0,h))}else if(m===R)f("Bad HTML string",e,d+h);else if("\x3c"===m)n.safe&&"html"===y?f("ADsafe string violation.",e,d+h):"/"===t.charAt(h+1)&&(y||n.safe)?f("Expected '\x3c\\/' and instead saw '\x3c/'.",e,d):"!"===t.charAt(h+1)&&(y||n.safe)&&f("Unexpected '\x3c!' in a string.",
e,d);else if("\\"===m)if("html"===y)n.safe&&f("ADsafe string violation.",e,d+h);else if("styleproperty"===y)h+=1,d+=1,m=t.charAt(h),m!==g&&f("Escapement in style string.",e,d+h);else switch(h+=1,d+=1,m=t.charAt(h),m){case R:f("Bad HTML string",e,d+h);break;case "\\":case "'":case '"':case "/":break;case "b":m="\b";break;case "f":m="\f";break;case "n":m="\n";break;case "r":m="\r";break;case "t":m="\t";break;case "u":p(4);break;case "v":m="\v";break;case "x":na&&f("Avoid \\x-.",e,d);p(2);break;default:f("Bad escapement.",
e,d)}r+=m;d+=1;h+=1}}for(var m,u,h,r,s;;){if(!t)return b(a()?"(endline)":"(end)","");for(;"outer"===y&&!(m=t.search(Jb),0===m);)if(0<m){d+=1;t=t.slice(m);break}else if(!a())return b("(end)","");if(h=p(Nb[y]||Gb)){if(u.isAlpha()||"_"===u||"$"===u)return b("(identifier)",h);if(u.isDigit())return"style"!==y&&!isFinite(Number(h))&&f("Bad number '{a}'.",e,d,h),"style"!==y&&("styleproperty"!==y&&t.substr(0,1).isAlpha())&&f("Missing space after '{a}'.",e,d,h),"0"===u&&(m=h.substr(1,1),m.isDigit()?"."!==
g.id&&"styleproperty"!==y&&f("Don't use extra leading zeros '{a}'.",e,d,h):na&&("x"===m||"X"===m)&&f("Avoid 0x-. '{a}'.",e,d,h)),"."===h.substr(h.length-1)&&f("A trailing decimal point can be confused with a dot '{a}'.",e,d,h),b("(number)",h);switch(h){case '"':case "'":return q(h);case "//":La||y&&"script"!==y?f("Unexpected comment.",e,d):"script"===y&&/<\s*\//i.test(t)?f("Unexpected \x3c/ in comment.",e,d):(n.safe||"script"===y)&&gb.test(t)&&f("Dangerous comment.",e,d);t="";g.comment=!0;break;case "/*":(La||
y&&"script"!==y&&"style"!==y&&"styleproperty"!==y)&&f("Unexpected comment.",e,d);for(n.safe&&gb.test(t)&&f("ADsafe comment violation.",e,d);;){m=t.search(Kb);if(0<=m)break;a()?n.safe&&gb.test(t)&&f("ADsafe comment violation.",e,d):E("Unclosed comment.",e,d)}d+=m+2;"/"===t.substr(m,1)&&E("Nested comment.",e,d);t=t.substr(m+2);g.comment=!0;break;case "/*members":case "/*member":case "/*jslint":case "/*global":case "*/":return{value:h,type:"special",line:e,character:d,from:c};case "":break;case "/":"/\x3d"===
g.id&&E("A regular expression literal can be confused with '/\x3d'.",e,c);if(fb){for(r=h=0;;){m=!0;u=t.charAt(r);r+=1;switch(u){case "":E("Unclosed regular expression.",e,c);return;case "/":0<h&&f("Unescaped '{a}'.",e,c+r,"/");u=t.substr(0,r-1);for(s={g:!0,i:!0,m:!0};!0===s[t.charAt(r)];)s[t.charAt(r)]=!1,r+=1;d+=r;t=t.substr(r);s=t.charAt(0);("/"===s||"*"===s)&&E("Confusing regular expression.",e,c);return b("(regexp)",u);case "\\":u=t.charAt(r);" ">u?f("Unexpected control character in regular expression.",
e,c+r):"\x3c"===u&&f("Unexpected escaped character '{a}' in regular expression.",e,c+r,u);r+=1;break;case "(":h+=1;m=!1;if("?"===t.charAt(r))switch(r+=1,t.charAt(r)){case ":":case "\x3d":case "!":r+=1;break;default:f("Expected '{a}' and instead saw '{b}'.",e,c+r,":",t.charAt(r))}break;case "|":m=!1;break;case ")":0===h?f("Unescaped '{a}'.",e,c+r,")"):h-=1;break;case " ":for(s=1;" "===t.charAt(r);)r+=1,s+=1;1<s&&f("Spaces are hard to count. Use {{a}}.",e,c+r,s);break;case "[":u=t.charAt(r);"^"===u&&
(r+=1,n.regexp&&f("Insecure '{a}'.",e,c+r,u));s=!1;"]"===u&&(f("Empty class.",e,c+r-1),s=!0);a:do switch(u=t.charAt(r),r+=1,u){case "[":case "^":f("Unescaped '{a}'.",e,c+r,u);s=!0;break;case "-":s?s=!1:(f("Unescaped '{a}'.",e,c+r,"-"),s=!0);break;case "]":s||f("Unescaped '{a}'.",e,c+r-1,"-");break a;case "\\":u=t.charAt(r);" ">u?f("Unexpected control character in regular expression.",e,c+r):"\x3c"===u&&f("Unexpected escaped character '{a}' in regular expression.",e,c+r,u);r+=1;s=!0;break;case "/":f("Unescaped '{a}'.",
e,c+r-1,"/");s=!0;break;case "\x3c":"script"===y&&(u=t.charAt(r),("!"===u||"/"===u)&&f("HTML confusion in regular expression '\x3c{a}'.",e,c+r,u));s=!0;break;default:s=!0}while(u);break;case ".":n.regexp&&f("Insecure '{a}'.",e,c+r,u);break;case "]":case "?":case "{":case "}":case "+":case "*":f("Unescaped '{a}'.",e,c+r,u);break;case "\x3c":"script"===y&&(u=t.charAt(r),("!"===u||"/"===u)&&f("HTML confusion in regular expression '\x3c{a}'.",e,c+r,u))}if(m)switch(t.charAt(r)){case "?":case "+":case "*":r+=
1;"?"===t.charAt(r)&&(r+=1);break;case "{":r+=1;u=t.charAt(r);("0">u||"9"<u)&&f("Expected a number and instead saw '{a}'.",e,c+r,u);r+=1;for(s=+u;;){u=t.charAt(r);if("0">u||"9"<u)break;r+=1;s=+u+10*s}m=s;if(","===u&&(r+=1,m=Infinity,u=t.charAt(r),"0"<=u&&"9">=u)){r+=1;for(m=+u;;){u=t.charAt(r);if("0">u||"9"<u)break;r+=1;m=+u+10*m}}"}"!==t.charAt(r)?f("Expected '{a}' and instead saw '{b}'.",e,c+r,"}",u):r+=1;"?"===t.charAt(r)&&(r+=1);s>m&&f("'{a}' should not be greater than '{b}'.",e,c+r,s,m)}}u=t.substr(0,
r-1);d+=r;t=t.substr(r);return b("(regexp)",u)}return b("(punctuator)",h);case "\x3c!--":r=e;for(u=d;;){m=t.indexOf("--");if(0<=m)break;m=t.indexOf("\x3c!");0<=m&&E("Nested HTML comment.",e,d+m);a()||E("Unclosed HTML comment.",r,u)}r=t.indexOf("\x3c!");0<=r&&r<m&&E("Nested HTML comment.",e,d+r);d+=m;"\x3e"!==t[m+2]&&E("Expected --\x3e.",e,d);d+=3;t=t.slice(m+3);break;case "#":if("html"===y||"styleproperty"===y){for(;;){u=t.charAt(0);if(("0">u||"9"<u)&&("a">u||"f"<u)&&("A">u||"F"<u))break;d+=1;t=t.substr(1);
h+=u}4!==h.length&&7!==h.length&&f("Bad hex color '{a}'.",e,c+r,h);return b("(color)",h)}return b("(punctuator)",h);default:if("outer"===y&&"\x26"===u){d+=1;for(t=t.substr(1);;){u=t.charAt(0);d+=1;t=t.substr(1);if(";"===u)break;"0"<=u&&"9">=u||("a"<=u&&"z">=u||"#"===u)||E("Bad entity",e,c+r,d)}break}return b("(punctuator)",h)}}else{for(u=h="";t&&"!">t;)t=t.substr(1);if(t){if("html"===y)return h=t.charAt(0),t=t.substr(1),b("(error)",h);E("Unexpected '{a}'.",e,d,t.substr(0,1))}}}}}}();Za=[fa,function(){for(;;)if(a.identifier)switch(a.value.toLowerCase()){case "url":fa();
break;case "expression":c("Unexpected expression '{a}'.",a,a.value);b();break;default:b()}else{if(";"===a.id||"!"===a.id||"(end)"===a.id||"}"===a.id)return!0;b()}}];ma="none hidden dotted dashed solid double ridge inset outset".split(" ");eb=["auto","always","avoid","left","right"];Ja=["auto","hidden","scroll","visible"];Ga={background:[!0,"background-attachment","background-color","background-image","background-position","background-repeat"],"background-attachment":["scroll","fixed"],"background-color":["transparent",
Z],"background-image":["none",fa],"background-position":[2,[G,"top","bottom","left","right","center"]],"background-repeat":["repeat","repeat-x","repeat-y","no-repeat"],border:[!0,"border-color","border-style","border-width"],"border-bottom":[!0,"border-bottom-color","border-bottom-style","border-bottom-width"],"border-bottom-color":Z,"border-bottom-style":ma,"border-bottom-width":la,"border-collapse":["collapse","separate"],"border-color":["transparent",4,Z],"border-left":[!0,"border-left-color",
"border-left-style","border-left-width"],"border-left-color":Z,"border-left-style":ma,"border-left-width":la,"border-right":[!0,"border-right-color","border-right-style","border-right-width"],"border-right-color":Z,"border-right-style":ma,"border-right-width":la,"border-spacing":[2,G],"border-style":[4,ma],"border-top":[!0,"border-top-color","border-top-style","border-top-width"],"border-top-color":Z,"border-top-style":ma,"border-top-width":la,"border-width":[4,la],bottom:[G,"auto"],"caption-side":["bottom",
"left","right","top"],clear:["both","left","none","right"],clip:[function(){var k;if(a.identifier&&"rect"===a.value){b();b("(");for(k=0;4>k;k+=1)if(!G()){c("Expected a number and instead saw '{a}'.",a,a.value);break}b(")");return!0}return!1},"auto"],color:Z,content:["open-quote","close-quote","no-open-quote","no-close-quote",Xa,fa,function(){return a.identifier&&"counter"===a.value?(b(),b("("),b(),","===a.id&&(N(),"(string)"!==a.type&&c("Expected a string and instead saw '{a}'.",a,a.value),b()),b(")"),
!0):a.identifier&&"counters"===a.value?(b(),b("("),a.identifier||c("Expected a name and instead saw '{a}'.",a,a.value),b(),","===a.id&&(N(),"(string)"!==a.type&&c("Expected a string and instead saw '{a}'.",a,a.value),b()),","===a.id&&(N(),"(string)"!==a.type&&c("Expected a string and instead saw '{a}'.",a,a.value),b()),b(")"),!0):!1},function(){return a.identifier&&"attr"===a.value?(b(),b("("),a.identifier||c("Expected a name and instead saw '{a}'.",a,a.value),b(),b(")"),!0):!1}],"counter-increment":[Wa,
"none"],"counter-reset":[Wa,"none"],cursor:[fa,"auto","crosshair","default","e-resize","help","move","n-resize","ne-resize","nw-resize","pointer","s-resize","se-resize","sw-resize","w-resize","text","wait"],direction:["ltr","rtl"],display:"block compact inline inline-block inline-table list-item marker none run-in table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group".split(" "),"empty-cells":["show","hide"],"float":["left",
"none","right"],font:["caption","icon","menu","message-box","small-caption","status-bar",!0,"font-size","font-style","font-weight","font-family"],"font-family":function(){for(;";"!==a.id;){!Wa()&&!Xa()&&c("Expected a name and instead saw '{a}'.",a,a.value);if(","!==a.id)return!0;N()}},"font-size":["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller",G],"font-size-adjust":["none",Fa],"font-stretch":"normal wider narrower ultra-condensed extra-condensed condensed semi-condensed semi-expanded expanded extra-expanded".split(" "),
"font-style":["normal","italic","oblique"],"font-variant":["normal","small-caps"],"font-weight":["normal","bold","bolder","lighter",Fa],height:[G,"auto"],left:[G,"auto"],"letter-spacing":["normal",G],"line-height":["normal",function(){"-"===a.id&&(b("-"),h());return"(number)"===a.type?(b(),"(string)"!==a.type&&!0===lb[a.value]&&(h(),b()),!0):!1}],"list-style":[!0,"list-style-image","list-style-position","list-style-type"],"list-style-image":["none",fa],"list-style-position":["inside","outside"],"list-style-type":"circle disc square decimal decimal-leading-zero lower-roman upper-roman lower-greek lower-alpha lower-latin upper-alpha upper-latin hebrew katakana hiragana-iroha katakana-oroha none".split(" "),
margin:[4,sa],"margin-bottom":sa,"margin-left":sa,"margin-right":sa,"margin-top":sa,"marker-offset":[G,"auto"],"max-height":[G,"none"],"max-width":[G,"none"],"min-height":G,"min-width":G,opacity:Fa,outline:[!0,"outline-color","outline-style","outline-width"],"outline-color":["invert",Z],"outline-style":"dashed dotted double groove inset none outset ridge solid".split(" "),"outline-width":la,overflow:Ja,"overflow-x":Ja,"overflow-y":Ja,padding:[4,G],"padding-bottom":G,"padding-left":G,"padding-right":G,
"padding-top":G,"page-break-after":eb,"page-break-before":eb,position:["absolute","fixed","relative","static"],quotes:[8,Xa],right:[G,"auto"],"table-layout":["auto","fixed"],"text-align":["center","justify","left","right"],"text-decoration":["none","underline","overline","line-through","blink"],"text-indent":G,"text-shadow":["none",4,[Z,G]],"text-transform":["capitalize","uppercase","lowercase","none"],top:[G,"auto"],"unicode-bidi":["normal","embed","bidi-override"],"vertical-align":["baseline","bottom",
"sub","super","top","text-top","middle","text-bottom",G],visibility:["visible","hidden","collapse"],"white-space":"normal nowrap pre pre-line pre-wrap inherit".split(" "),width:[G,"auto"],"word-spacing":["normal",G],"word-wrap":["break-word","normal"],"z-index":["auto",Fa]};ya("(number)",kb);ya("(string)",kb);Q["(identifier)"]={type:"(identifier)",lbp:0,identifier:!0,nud:function(){var a=this.value,b=K[a],d;"function"===typeof b?b=void 0:"boolean"===typeof b&&(d=m,m=ua[0],D(a,"var"),b=m,m=d);if(m===
b)switch(m[a]){case "unused":m[a]="var";break;case "label":c("'{a}' is a statement label.",g,a)}else if(m["(global)"])n.undef&&"boolean"!==J[a]&&c("'{a}' is not defined.",g,a),Va(g);else switch(m[a]){case "closure":case "function":case "var":case "unused":c("'{a}' used out of scope.",g,a);break;case "label":c("'{a}' is a statement label.",g,a);break;case "outer":case "global":break;default:if(!0===b)m[a]=!0;else if(null===b)c("'{a}' is not allowed.",g,a),Va(g);else if("object"!==typeof b)n.undef?
c("'{a}' is not defined.",g,a):m[a]=!0,Va(g);else switch(b[a]){case "function":case "var":case "unused":b[a]="closure";m[a]=b["(global)"]?"global":"outer";break;case "closure":case "parameter":m[a]=b["(global)"]?"global":"outer";break;case "label":c("'{a}' is a statement label.",g,a)}}return this},led:function(){p("Expected an operator and instead saw '{a}'.",a,a.value)}};ya("(regexp)",function(){return this});B("(endline)");B("(begin)");B("(end)").reach=!0;B("\x3c/").reach=!0;B("\x3c!");B("\x3c!--");
B("--\x3e");B("(error)").reach=!0;B("}").reach=!0;B(")");B("]");B('"').reach=!0;B("'").reach=!0;B(";");B(":").reach=!0;B(",");B("#");B("@");I("else");I("case").reach=!0;I("catch");I("default").reach=!0;I("finally");X("arguments");X("eval");X("false");X("Infinity");X("NaN");X("null");X("this");X("true");X("undefined");ha("\x3d","assign",20);ha("+\x3d","assignadd",20);ha("-\x3d","assignsub",20);ha("*\x3d","assignmult",20);ha("/\x3d","assigndiv",20).nud=function(){p("A regular expression literal can be confused with '/\x3d'.")};
ha("%\x3d","assignmod",20);ja("\x26\x3d","assignbitand",20);ja("|\x3d","assignbitor",20);ja("^\x3d","assignbitxor",20);ja("\x3c\x3c\x3d","assignshiftleft",20);ja("\x3e\x3e\x3d","assignshiftright",20);ja("\x3e\x3e\x3e\x3d","assignshiftrightunsigned",20);P("?",function(a,c){c.left=a;c.right=e(10);b(":");c["else"]=e(10);return c},30);P("||","or",40);P("\x26\x26","and",50);ia("|","bitor",70);ia("^","bitxor",80);ia("\x26","bitand",90);ba("\x3d\x3d",function(a,b){n.eqeqeq?c("Expected '{a}' and instead saw '{b}'.",
this,"\x3d\x3d\x3d","\x3d\x3d"):za(a)?c("Use '{a}' to compare with '{b}'.",this,"\x3d\x3d\x3d",a.value):za(b)&&c("Use '{a}' to compare with '{b}'.",this,"\x3d\x3d\x3d",b.value);return this});ba("\x3d\x3d\x3d");ba("!\x3d",function(a,b){n.eqeqeq?c("Expected '{a}' and instead saw '{b}'.",this,"!\x3d\x3d","!\x3d"):za(a)?c("Use '{a}' to compare with '{b}'.",this,"!\x3d\x3d",a.value):za(b)&&c("Use '{a}' to compare with '{b}'.",this,"!\x3d\x3d",b.value);return this});ba("!\x3d\x3d");ba("\x3c");ba("\x3e");
ba("\x3c\x3d");ba("\x3e\x3d");ia("\x3c\x3c","shiftleft",120);ia("\x3e\x3e","shiftright",120);ia("\x3e\x3e\x3e","shiftrightunsigned",120);P("in","in",120);P("instanceof","instanceof",120);P("+",function(a,b){var d=e(130);if(a&&d&&"(string)"===a.id&&"(string)"===d.id)return a.value+=d.value,a.character=d.character,Ua.test(a.value)&&c("JavaScript URL.",a),a;b.left=a;b.right=d;return b},130);V("+","num");P("-","sub",130);V("-","neg");P("*","mult",140);P("/","div",140);P("%","mod",140);ib("++","postinc");
V("++","preinc");Q["++"].exps=!0;ib("--","postdec");V("--","predec");Q["--"].exps=!0;V("delete",function(){var b=e(0);(!b||"."!==b.id&&"["!==b.id)&&c("Expected '{a}' and instead saw '{b}'.",a,".",a.value);this.first=b;return this}).exps=!0;V("~",function(){n.bitwise&&c("Unexpected '{a}'.",this,"~");e(150);return this});V("!",function(){this.right=e(150);this.arity="unary";!0===Bb[this.right.id]&&c("Confusing use of '{a}'.",this,"!");return this});V("typeof","typeof");V("new",function(){var k=e(155),
l;if(k&&"function"!==k.id)if(k.identifier)switch(k["new"]=!0,k.value){case "Object":c("Use the object literal notation {}.",g);break;case "Array":return"("!==a.id?c("Use the array literal notation [].",g):(b("("),")"===a.id?c("Use the array literal notation [].",g):(l=e(0),k.dimension=l,("(number)"===l.id&&/[.+\-Ee]/.test(l.value)||"-"===l.id&&!l.right||"(string)"===l.id||"["===l.id||"{"===l.id||"true"===l.id||"false"===l.id||"null"===l.id||"undefined"===l.id||"Infinity"===l.id)&&c("Use the array literal notation [].",
g),")"!==a.id&&p("Use the array literal notation [].",g)),b(")")),this.first=k,this;case "Number":case "String":case "Boolean":case "Math":case "JSON":c("Do not use {a} as a constructor.",g,k.value);break;case "Function":n.evil||c("The Function constructor is eval.");break;case "Date":case "RegExp":break;default:"function"!==k.id&&(l=k.value.substr(0,1),n.newcap&&("A">l||"Z"<l)&&c("A constructor name should start with an uppercase letter.",g))}else"."!==k.id&&("["!==k.id&&"("!==k.id)&&c("Bad constructor.",
g);else c("Weird construction. Delete 'new'.",this);h(g,a);"("!==a.id&&c("Missing '()' invoking a constructor.");this.first=k;return this});Q["new"].exps=!0;P(".",function(k,e){h(O,g);var d=pa();"string"===typeof d&&Ea(d);e.left=k;e.right=d;!n.evil&&k&&"document"===k.value&&("write"===d||"writeln"===d)?c("document.write can be a form of eval.",k):n.adsafe&&(k&&"ADSAFE"===k.value)&&("id"===d||"lib"===d?c("ADsafe violation.",e):"go"===d&&("script"!==y?c("ADsafe violation.",e):(va||"("!==a.id||"(string)"!==
w(0).id||w(0).value!==U||","!==w(1).id)&&p("ADsafe violation: go.",e),va=!0,ka=!1));if(!n.evil&&("eval"===d||"execScript"===d))c("eval is evil.");else if(n.safe)for(;;){!0===Ra[d]&&c("ADsafe restricted word '{a}'.",g,d);if("boolean"!==typeof J[k.value]||"("===a.id)break;if(!0===Eb[d]){"."===a.id&&c("ADsafe violation.",e);break}if("."!==a.id){c("ADsafe violation.",e);break}b(".");g.left=e;g.right=d;e=g;d=pa();"string"===typeof d&&Ea(d)}return e},160,!0);P("(",function(k,l){h(O,g);q();var d=0,f=[];
k&&("(identifier)"===k.type?k.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&"Number"!==k.value&&("String"!==k.value&&"Boolean"!==k.value&&"Date"!==k.value)&&("Math"===k.value?c("Math is not a function.",k):n.newcap&&c("Missing 'new' prefix when invoking a constructor.",k)):"."===k.id&&n.safe&&("Math"===k.left.value&&"random"===k.right)&&c("ADsafe violation.",k));if(")"!==a.id)for(;;){f[f.length]=e(10);d+=1;if(","!==a.id)break;N()}b(")");n.immed&&("function"===k.id&&")"!==a.id)&&c("Wrap the entire immediate function invocation in parens.",
l);q(O,g);"object"===typeof k&&("parseInt"===k.value&&1===d&&c("Missing radix parameter.",k),n.evil||("eval"===k.value||"Function"===k.value||"execScript"===k.value?c("eval is evil.",k):f[0]&&("(string)"===f[0].id&&("setTimeout"===k.value||"setInterval"===k.value))&&c("Implied eval is evil. Pass a function instead of a string.",k)),!k.identifier&&("."!==k.id&&"["!==k.id&&"("!==k.id&&"\x26\x26"!==k.id&&"||"!==k.id&&"?"!==k.id)&&c("Bad invocation.",k));l.left=k;return l},155,!0).exps=!0;V("(",function(){q();
var k=e(0);b(")",this);q(O,g);n.immed&&"function"===k.id&&("("===a.id?c("Move the invocation into the parens that contain the function.",a):c("Do not wrap function literals in parens unless they are to be immediately invoked.",this));return k});P("[",function(a,l){q();var d=e(0),f;d&&"(string)"===d.type?(n.safe&&!0===Ra[d.value]?c("ADsafe restricted word '{a}'.",l,d.value):!n.evil&&("eval"===d.value||"execScript"===d.value)?c("eval is evil.",l):n.safe&&("_"===d.value.charAt(0)||"-"===d.value.charAt(0))&&
c("ADsafe restricted subscript '{a}'.",l,d.value),Ea(d.value),!n.sub&&rb.test(d.value)&&(f=Q[d.value],(!f||!f.reserved)&&c("['{a}'] is better written in dot notation.",d,d.value))):(!d||"(number)"!==d.type||0>d.value)&&n.safe&&c("ADsafe subscripting.");b("]",l);q(O,g);l.left=a;l.right=d;return l},160,!0);V("[",function(){var k=g.line!==a.line;this.first=[];k&&(F+=n.indent,a.from===F+n.indent&&(F+=n.indent));for(;"(end)"!==a.id;){for(;","===a.id;)c("Extra comma."),b(",");if("]"===a.id)break;k&&g.line!==
a.line&&s();this.first.push(e(10));if(","===a.id){if(N(),"]"===a.id){c("Extra comma.",g);break}}else break}k&&(F-=n.indent,s());b("]",this);return this},160);(function(k){k.nud=function(){var k,d,f,q,t={};if(k=g.line!==a.line)F+=n.indent,a.from===F+n.indent&&(F+=n.indent);for(;"}"!==a.id;){k&&s();if("get"===a.value&&":"!==w().id)b("get"),n.es5||p("get/set are ES5 features."),(f=bb())||p("Missing property name."),q=a,h(g,a),d=Ha(f),m["(loopage)"]&&c("Don't make functions within a loop.",q),(d=d["(params)"])&&
c("Unexpected parameter '{a}' in get {b} function.",q,d[0],f),h(g,a),b(","),s(),b("set"),q=bb(),f!==q&&p("Expected {a} and instead saw {b}.",g,f,q),q=a,h(g,a),d=Ha(f),d=d["(params)"],(!d||1!==d.length||"value"!==d[0])&&c("Expected (value) in set {a} function.",q,f);else{f=bb();if("string"!==typeof f)break;b(":");x(g,a);e(10)}!0===t[f]&&c("Duplicate member '{a}'.",a,f);t[f]=!0;Ea(f);if(","===a.id)N(),","===a.id?c("Extra comma.",g):"}"===a.id&&c("Extra comma.",g);else break}k&&(F-=n.indent,s());b("}",
this);return this};k.fud=function(){p("Expected to see a statement and instead saw a block.",g)}})(B("{"));aa("var",cb).exps=!0;ga("function",function(){ra&&c("Function statements cannot be placed in blocks. Use a function expression or move the statement to the top of the outer function.",g);var b=pa();h(g,a);D(b,"unused");Ha(b);"("===a.id&&a.line===g.line&&p("Function statements are not invocable. Wrap the whole function invocation in parens.");return this});V("function",function(){var b=Qa();b?
h(g,a):x(g,a);Ha(b);m["(loopage)"]&&c("Don't make functions within a loop.");return this});ga("if",function(){var k=a;b("(");x(this,k);q();e(20);"\x3d"===a.id&&(c("Expected a conditional expression and instead saw an assignment."),b("\x3d"),e(20));b(")",k);q(O,g);W(!0);"else"===a.id&&(x(g,a),b("else"),"if"===a.id||"switch"===a.id?Ta(!0):W(!0));return this});ga("try",function(){var e,l;n.adsafe&&c("ADsafe try violation.",this);W(!1);"catch"===a.id&&(b("catch"),x(g,a),b("("),l=K,K=Object.create(l),
e=a.value,"(identifier)"!==a.type?c("Expected an identifier and instead saw '{a}'.",a,e):D(e,"exception"),b(),b(")"),W(!1),e=!0,K=l);if("finally"===a.id)b("finally"),W(!1);else return e||p("Expected '{a}' and instead saw '{b}'.",a,"catch",a.value),this});ga("while",function(){var k=a;m["(breakage)"]+=1;m["(loopage)"]+=1;b("(");x(this,k);q();e(20);"\x3d"===a.id&&(c("Expected a conditional expression and instead saw an assignment."),b("\x3d"),e(20));b(")",k);q(O,g);W(!0);m["(breakage)"]-=1;m["(loopage)"]-=
1;return this}).labelled=!0;I("with");ga("switch",function(){var k=a,l=!1;m["(breakage)"]+=1;b("(");x(this,k);q();this.condition=e(20);b(")",k);q(O,g);x(g,a);k=a;b("{");x(g,a);F+=n.indent;for(this.cases=[];;)switch(a.id){case "case":switch(m["(verb)"]){case "break":case "case":case "continue":case "return":case "switch":case "throw":break;default:c("Expected a 'break' statement before 'case'.",g)}s(-n.indent);b("case");this.cases.push(e(20));l=!0;b(":");m["(verb)"]="case";break;case "default":switch(m["(verb)"]){case "break":case "continue":case "return":case "throw":break;
default:c("Expected a 'break' statement before 'default'.",g)}s(-n.indent);b("default");l=!0;b(":");break;case "}":F-=n.indent;s();b("}",k);(1===this.cases.length||"true"===this.condition.id||"false"===this.condition.id)&&c("This 'switch' should be an 'if'.",this);m["(breakage)"]-=1;m["(verb)"]=void 0;return;case "(end)":p("Missing '{a}'.",a,"}");return;default:if(l)switch(g.id){case ",":p("Each value should have its own case label.");return;case ":":qa();break;default:p("Missing ':' on a case clause.",
g)}else p("Expected '{a}' and instead saw '{b}'.",a,"case",a.value)}}).labelled=!0;aa("debugger",function(){n.debug||c("All 'debugger' statements should be removed.");return this}).exps=!0;(function(){var k=aa("do",function(){m["(breakage)"]+=1;m["(loopage)"]+=1;this.first=W(!0);b("while");var k=a;x(g,k);b("(");q();e(20);"\x3d"===a.id&&(c("Expected a conditional expression and instead saw an assignment."),b("\x3d"),e(20));b(")",k);q(O,g);m["(breakage)"]-=1;m["(loopage)"]-=1;return this});k.labelled=
!0;k.exps=!0})();ga("for",function(){var k=n.forin,l;l=a;m["(breakage)"]+=1;m["(loopage)"]+=1;b("(");x(this,l);q();if("in"===w("var"===a.id?1:0).id){if("var"===a.id)b("var"),cb(!0);else{switch(m[a.value]){case "unused":m[a.value]="var";break;case "var":break;default:c("Bad for in variable '{a}'.",a,a.value)}b()}b("in");e(20);b(")",l);l=W(!0);!k&&(1<l.length||"object"!==typeof l[0]||"if"!==l[0].value)&&c("The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",
this)}else{if(";"!==a.id)if("var"===a.id)b("var"),cb();else for(;;){e(0,"for");if(","!==a.id)break;N()}S(g);b(";");";"!==a.id&&(e(20),"\x3d"===a.id&&(c("Expected a conditional expression and instead saw an assignment."),b("\x3d"),e(20)));S(g);b(";");";"===a.id&&p("Expected '{a}' and instead saw '{b}'.",a,")",";");if(")"!==a.id)for(;;){e(0,"for");if(","!==a.id)break;N()}b(")",l);q(O,g);W(!0)}m["(breakage)"]-=1;m["(loopage)"]-=1;return this}).labelled=!0;aa("break",function(){var e=a.value;0===m["(breakage)"]&&
c("Unexpected '{a}'.",a,this.value);S(this);";"!==a.id&&g.line===a.line&&("label"!==m[e]?c("'{a}' is not a statement label.",a,e):K[e]!==m&&c("'{a}' is out of scope.",a,e),this.first=a,b());Da("break");return this}).exps=!0;aa("continue",function(){var e=a.value;0===m["(breakage)"]&&c("Unexpected '{a}'.",a,this.value);S(this);";"!==a.id?g.line===a.line&&("label"!==m[e]?c("'{a}' is not a statement label.",a,e):K[e]!==m&&c("'{a}' is out of scope.",a,e),this.first=a,b()):m["(loopage)"]||c("Unexpected '{a}'.",
a,this.value);Da("continue");return this}).exps=!0;aa("return",function(){S(this);"(regexp)"===a.id&&c("Wrap the /regexp/ literal in parens to disambiguate the slash operator.");";"!==a.id&&!a.reach&&(x(g,a),this.first=e(20));Da("return");return this}).exps=!0;aa("throw",function(){S(this);x(g,a);this.first=e(20);Da("throw");return this}).exps=!0;I("void");I("class");I("const");I("enum");I("export");I("extends");I("import");I("super");I("let");I("yield");I("implements");I("interface");I("package");
I("private");I("protected");I("public");I("static");var $=function(e,l){var d,f;JSLINT.errors=[];J=Object.create(Db);if(l){d=l.predef;if(d instanceof Array)for(f=0;f<d.length;f+=1)J[d[f]]=!0;l.adsafe&&(l.safe=!0);l.safe&&(l.browser=!1,l.css=!1,l.debug=!1,l.devel=!1,l.eqeqeq=!0,l.evil=!1,l.forin=!1,l.nomen=!0,l.on=!1,l.rhino=!1,l.safe=!0,l.windows=!1,l.strict=!0,l.sub=!1,l.undef=!0,l.widget=!1,J.Date=null,J.eval=null,J.Function=null,J.Object=null,J.ADSAFE=!1,J.lib=!1);n=l}else n={};n.indent=n.indent||
4;n.maxerr=n.maxerr||50;U="";va=ka=!1;Ia={};if(n.approved)for(f=0;f<n.approved.length;f+=1)Ia[n.approved[f]]=n.approved[f];else Ia.test="test";Ma="";for(f=0;f<n.indent;f+=1)Ma+=" ";F=1;K=hb=Object.create(J);m={"(global)":!0,"(name)":"(global)","(scope)":K,"(breakage)":0,"(loopage)":0};ua=[m];Ka={};ta=[];y=La=!1;M=null;ea={};da=null;ca={};ra=!1;Ca=[];na=!1;Ba=0;Y.init(e);fb=!0;Pa=!1;O=g=a=Q["(begin)"];H();try{b();if("\x3c"===a.value.charAt(0)){a:{var h,t,s,q,w,u,v,r=n.white,E;y="html";R="";for(M=null;;){switch(a.value){case "\x3c":y=
"html";b("\x3c");t={};u=a;u.identifier||c("Bad identifier {a}.",u,u.value);q=u.value;n.cap&&(q=q.toLowerCase());u.name=q;b();M||(M=[],d=q,"html"!==d&&!n.fragment&&("div"===d&&n.adsafe?p("ADSAFE: Use the fragment option."):p("Expected '{a}' and instead saw '{b}'.",g,"html",d)),n.adsafe&&("html"===d&&p("Currently, ADsafe does not operate on whole HTML documents. It operates on \x3cdiv\x3e fragments and .js files.",g),n.fragment?"div"!==d&&p("ADsafe violation: Wrap the widget in a div.",g):p("Use the fragment option.",
g)),n.browser=!0,H());v=ab[q];"object"!==typeof v&&p("Unrecognized tag '\x3c{a}\x3e'.",u,q);s=v.empty;for(u.type=q;;){if("/"===a.id){b("/");"\x3e"!==a.id&&c("Expected '{a}' and instead saw '{b}'.",a,"\x3e",a.value);break}if(a.id&&"\x3e"===a.id.substr(0,1))break;a.identifier||(("(end)"===a.id||"(error)"===a.id)&&p("Missing '\x3e'.",a),c("Bad identifier."));n.white=!0;x(g,a);h=a.value;n.white=r;b();!n.cap&&h!==h.toLowerCase()&&c("Attribute '{a}' not all lower case.",a,h);h=h.toLowerCase();R="";z(t,
h)&&c("Attribute '{a}' repeated.",a,h);"on"===h.slice(0,2)?(n.on||c("Avoid HTML event handlers."),y="scriptstring",b("\x3d"),w=a.id,'"'!==w&&"'"!==w&&p("Missing quote."),R=w,E=n.white,n.white=!1,b(w),qa("on"),n.white=E,a.id!==w&&p("Missing close quote on script attribute."),y="html",R="",b(w),v=!1):"style"===h?(y="scriptstring",b("\x3d"),w=a.id,'"'!==w&&"'"!==w&&p("Missing quote."),y="styleproperty",R=w,b(w),nb(),y="html",R="",b(w),v=!1):"\x3d"===a.id?(b("\x3d"),v=a.value,!a.identifier&&('"'!==a.id&&
"'"!==a.id&&"(string)"!==a.type&&"(number)"!==a.type&&"(color)"!==a.type)&&c("Expected an attribute value and instead saw '{a}'.",g,h),b()):v=!0;t[h]=v;d=h;f=v;var B=void 0,D=void 0;"id"===d?(B="string"===typeof f?f.toUpperCase():"",!0===Ka[B]&&c("Duplicate id\x3d'{a}'.",a,f),/^[A-Za-z][A-Za-z0-9._:\-]*$/.test(f)?n.adsafe&&(U?f.slice(0,U.length)!==U?c("ADsafe violation: An id must have a '{a}' prefix",a,U):/^[A-Z]+_[A-Z]+$/.test(f)||c("ADSAFE violation: bad id."):(U=f,/^[A-Z]+_$/.test(f)||c("ADSAFE violation: bad id."))):
c("Bad id: '{a}'.",a,f),D=f.search(Mb),0<=D&&c("Unexpected character '{a}' in {b}.",g,f.charAt(D),d),Ka[B]=!0):"class"===d||"type"===d||"name"===d?(D=f.search(Lb),0<=D&&c("Unexpected character '{a}' in {b}.",g,f.charAt(D),d),Ka[B]=!0):"href"===d||"background"===d||"content"===d||"data"===d||0<=d.indexOf("src")||0<=d.indexOf("url")?(n.safe&&mb.test(f)&&p("ADsafe URL violation."),ta.push(f)):"for"===d?n.adsafe&&(U?f.slice(0,U.length)!==U?c("ADsafe violation: An id must have a '{a}' prefix",a,U):/^[A-Z]+_[A-Z]+$/.test(f)||
c("ADSAFE violation: bad id."):c("ADSAFE violation: bad id.")):"name"===d&&n.adsafe&&0<=f.indexOf("_")&&c("ADsafe name violation.")}d=q;f=t;var B=void 0,C=ab[d],D=void 0;La=!1;C||p("Unrecognized tag '\x3c{a}\x3e'.",a,d===d.toLowerCase()?d:d+" (capitalization error)");if(0<M.length)if("html"===d&&p("Too many \x3chtml\x3e tags.",g),D=C.parent)0>D.indexOf(" "+M[M.length-1].name+" ")&&p("A '\x3c{a}\x3e' must be within '\x3c{b}\x3e'.",g,d,D);else if(!n.adsafe&&!n.fragment){B=M.length;do 0>=B&&p("A '\x3c{a}\x3e' must be within '\x3c{b}\x3e'.",
g,d,"body"),B-=1;while("body"!==M[B].name)}switch(d){case "div":n.adsafe&&(1===M.length&&!U)&&c("ADSAFE violation: missing ID_.");break;case "script":y="script";b("\x3e");F=a.from;f.lang&&c("lang is deprecated.",g);n.adsafe&&1!==M.length&&c("ADsafe script placement violation.",g);f.src?(n.adsafe&&(!ka||!Ia[f.src])&&c("ADsafe unapproved script source.",g),f.type&&c("type is unnecessary.",g)):(va&&p("ADsafe script violation.",g),qa("script"));y="html";b("\x3c/");!a.identifier&&"script"!==a.value&&c("Expected '{a}' and instead saw '{b}'.",
a,"script",a.value);b();y="outer";break;case "style":y="style";b("\x3e");ob();y="html";b("\x3c/");!a.identifier&&"style"!==a.value&&c("Expected '{a}' and instead saw '{b}'.",a,"style",a.value);b();y="outer";break;case "input":switch(f.type){case "radio":case "checkbox":case "button":case "reset":case "submit":break;case "text":case "password":case "file":case "hidden":case "image":n.adsafe&&"off"!==f.autocomplete&&c("ADsafe autocomplete violation.");break;default:c("Bad input type.")}break;case "applet":case "body":case "embed":case "frame":case "frameset":case "head":case "iframe":case "noembed":case "noframes":case "object":case "param":n.adsafe&&
c("ADsafe violation: Disallowed tag: "+d)}s||M.push(u);y="outer";b("\x3e");break;case "\x3c/":y="html";b("\x3c/");a.identifier||c("Bad identifier.");q=a.value;n.cap&&(q=q.toLowerCase());b();M||p("Unexpected '{a}'.",a,"\x3c/"+q+"\x3e");(u=M.pop())||p("Unexpected '{a}'.",a,"\x3c/"+q+"\x3e");u.name!==q&&p("Expected '{a}' and instead saw '{b}'.",a,"\x3c/"+u.name+"\x3e","\x3c/"+q+"\x3e");"\x3e"!==a.id&&p("Missing '{a}'.",a,"\x3e");y="outer";b("\x3e");break;case "\x3c!":n.safe&&c("ADsafe HTML violation.");
for(y="html";;){b();if("\x3e"===a.id||"(end)"===a.id)break;0<=a.value.indexOf("--")&&c("Unexpected --.");0<=a.value.indexOf("\x3c")&&c("Unexpected \x3c.");0<=a.value.indexOf("\x3e")&&c("Unexpected \x3e.")}y="outer";b("\x3e");break;case "(end)":break a;default:"(end)"===a.id?p("Missing '{a}'.",a,"\x3c/"+M[M.length-1].value+"\x3e"):b()}if(M&&0===M.length&&(n.adsafe||!n.fragment||"(end)"===a.id))break}"(end)"!==a.id&&p("Unexpected material after the end.")}n.adsafe&&!va&&c("ADsafe violation: Missing ADSAFE.go.",
this)}else switch(a.id){case "{":case "[":na=n.laxbreak=!0;db();break;case "@":case "*":case "#":case ".":case ":":y="style";b();("@"!==g.id||!a.identifier||"charset"!==a.value||1!==g.line||1!==g.from)&&p('A css file should begin with @charset "UTF-8";');b();"(string)"!==a.type&&"UTF-8"!==a.value&&p('A css file should begin with @charset "UTF-8";');b();b(";");ob();break;default:n.adsafe&&n.fragment&&p("Expected '{a}' and instead saw '{b}'.",a,"\x3cdiv\x3e",a.value),qa("lib")}b("(end)")}catch(G){G&&
JSLINT.errors.push({reason:G.message,line:G.line||a.line,character:G.character||a.from},null)}return 0===JSLINT.errors.length};$.data=function(){var a={functions:[]},b;b=[];var c,e,f,g,h=[];$.errors.length&&(a.errors=$.errors);na&&(a.json=!0);for(g in ca)z(ca,g)&&b.push({name:g,line:ca[g]});0<b.length&&(a.implieds=b);0<ta.length&&(a.urls=ta);b=pb(K);0<b.length&&(a.globals=b);for(e=1;e<ua.length;e+=1){c=ua[e];b={};for(f=0;f<wa.length;f+=1)b[wa[f]]=[];for(g in c)z(c,g)&&"("!==g.charAt(0)&&(f=c[g],"[object Array]"===
Object.prototype.toString.apply(b[f])&&(b[f].push(g),"unused"===f&&h.push({name:g,line:c["(line)"],"function":c["(name)"]})));for(f=0;f<wa.length;f+=1)0===b[wa[f]].length&&delete b[wa[f]];b.name=c["(name)"];b.param=c["(params)"];b.line=c["(line)"];b.last=c["(last)"];a.functions.push(b)}0<h.length&&(a.unused=h);for(g in ea)if("number"===typeof ea[g]){a.member=ea;break}return a};$.report=function(a){function b(a,c){var d,e,f;if(c){m.push("\x3cdiv\x3e\x3ci\x3e"+a+"\x3c/i\x3e ");c=c.sort();for(e=0;e<
c.length;e+=1)c[e]!==f&&(f=c[e],m.push((d?", ":"")+f),d=!0);m.push("\x3c/div\x3e")}}var c=$.data(),e=[],f,g,h;f="";var n,m=[];if(c.errors||c.implieds||c.unused){g=!0;m.push("\x3cdiv id\x3derrors\x3e\x3ci\x3eError:\x3c/i\x3e");if(c.errors)for(h=0;h<c.errors.length;h+=1)if(e=c.errors[h])f=e.evidence||"",m.push("\x3cp\x3eProblem"+(isFinite(e.line)?" at line "+e.line+" character "+e.character:"")+": "+e.reason.entityify()+"\x3c/p\x3e\x3cp class\x3devidence\x3e"+(f&&(80<f.length?f.slice(0,77)+"...":f).entityify())+
"\x3c/p\x3e");if(c.implieds){e=[];for(h=0;h<c.implieds.length;h+=1)e[h]="\x3ccode\x3e"+c.implieds[h].name+"\x3c/code\x3e\x26nbsp;\x3ci\x3e"+c.implieds[h].line+"\x3c/i\x3e";m.push("\x3cp\x3e\x3ci\x3eImplied global:\x3c/i\x3e "+e.join(", ")+"\x3c/p\x3e")}if(c.unused){e=[];for(h=0;h<c.unused.length;h+=1)e[h]="\x3ccode\x3e\x3cu\x3e"+c.unused[h].name+"\x3c/u\x3e\x3c/code\x3e\x26nbsp;\x3ci\x3e"+c.unused[h].line+"\x3c/i\x3e \x3ccode\x3e"+c.unused[h]["function"]+"\x3c/code\x3e";m.push("\x3cp\x3e\x3ci\x3eUnused variable:\x3c/i\x3e "+
e.join(", ")+"\x3c/p\x3e")}c.json&&m.push("\x3cp\x3eJSON: bad.\x3c/p\x3e");m.push("\x3c/div\x3e")}if(!a){m.push("\x3cbr\x3e\x3cdiv id\x3dfunctions\x3e");c.urls&&b("URLs\x3cbr\x3e",c.urls,"\x3cbr\x3e");"style"===y?m.push("\x3cp\x3eCSS.\x3c/p\x3e"):c.json&&!g?m.push("\x3cp\x3eJSON: good.\x3c/p\x3e"):c.globals?m.push("\x3cdiv\x3e\x3ci\x3eGlobal\x3c/i\x3e "+c.globals.sort().join(", ")+"\x3c/div\x3e"):m.push("\x3cdiv\x3e\x3ci\x3eNo new global variables introduced.\x3c/i\x3e\x3c/div\x3e");for(h=0;h<c.functions.length;h+=
1)a=c.functions[h],m.push("\x3cbr\x3e\x3cdiv class\x3dfunction\x3e\x3ci\x3e"+a.line+"-"+a.last+"\x3c/i\x3e "+(a.name||"")+"("+(a.param?a.param.join(", "):"")+")\x3c/div\x3e"),b("\x3cbig\x3e\x3cb\x3eUnused\x3c/b\x3e\x3c/big\x3e",a.unused),b("Closure",a.closure),b("Variable",a["var"]),b("Exception",a.exception),b("Outer",a.outer),b("Global",a.global),b("Label",a.label);if(c.member){e=pb(c.member);if(e.length){e=e.sort();f="\x3cbr\x3e\x3cpre id\x3dmembers\x3e/*members ";g=10;for(h=0;h<e.length;h+=1)a=
e[h],n=a.name(),72<g+n.length&&(m.push(f+"\x3cbr\x3e"),f="    ",g=1),g+=n.length+2,1===c.member[a]&&(n="\x3ci\x3e"+n+"\x3c/i\x3e"),h<e.length-1&&(n+=", "),f+=n;m.push(f+"\x3cbr\x3e*/\x3c/pre\x3e")}m.push("\x3c/div\x3e")}}return m.join("")};$.jslint=$;$.edition="2010-04-06";return $}();define("orion/jslintworker",function(){});
define("orion/objects",[],function(){function v(v){for(var C=Object.prototype.hasOwnProperty,H=1,L=arguments.length;H<L;H++){var c=arguments[H],f;for(f in c)C.call(c,f)&&(v[f]=c[f])}return v}return{clone:function(z){if(Array.isArray(z))return Array.prototype.slice.call(z);var C=Object.create(Object.getPrototypeOf(z));v(C,z);return C},mixin:v,toArray:function(v){return Array.isArray(v)?v:[v]}}});
define("plugins/jslintPlugin",["orion/plugin","orion/jslintworker","orion/objects"],function(v,z,C){function H(f,p){var v;JSLINT(p,c);v=JSLINT.data();var D=[],w;if(v.errors){var b=v.errors;for(w=0;w<b.length;w++){var e=b[w];if(e){var h=e.character-1,q=h+1;e.evidence&&(h=e.evidence.substring(h).search(/.\b/),-1<h&&(q+=h));e.description=e.reason;e.start=e.character;e.end=q;q=[["Expected '{'","Statement body should be inside '{ }' braces."],"Missing semicolon","Extra comma","Missing property name","Unmatched ",
" and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"];h=e.description;if(-1===h.indexOf("Dangerous comment"))for(var x=0;x<q.length;x++){var z=q[x],s="string"===typeof z?null:z[1];if(-1!==h.indexOf("string"===typeof z?z:z[0])&&s)e.description=s}else e=null;e&&D.push(e)}}}if(v.functions){v=v.functions;var C;for(w=0;w<v.length;w++)if(b=v[w],(e=b.unused)&&0!==e.length){C||(C=p.split(/\r?\n/));h=(q='"'===b.name[0])?b.name.substring(1,b.name.length-1):b.name;x=C[b.line-
1];for(z=0;z<e.length;z++)s=x.indexOf(h),s=q?x.indexOf("function",s):x.lastIndexOf("function",s),-1!==s&&D.push({reason:"Function declares unused variable '"+e[z]+"'.",line:b.line,character:s+1,end:s+8,severity:"warning"})}}return{problems:D}}var L={bitwise:!1,eqeqeq:!0,es5:!0,immed:!0,indent:1,maxerr:300,newcap:!0,nomen:!1,onevar:!1,plusplus:!1,regexp:!0,strict:!1,undef:!0,white:!1},c=L;v=new v({name:"Orion JSLint Service",version:"1.0",description:"This plugin provides JSLint functionality for validating JSON."});
v.registerService(["orion.edit.validator"],{updated:function(f){if(f&&"string"===typeof f.options&&(f=f.options,!/^\s*$/.test(f))){var p={},v=!1;f.split(/,/).forEach(function(c){var f=/\s*(\w+)\s*:\s*(\w+)\s*/.exec(c);null===f?console.log("JSLint ignoring bad option: "+c):(p[f[1]]=f[2],v=!0)});c={};C.mixin(c,L,p);v&&console.log("JSLint using user-provided options: {"+Object.keys(p).map(function(c){return c+":"+p[c]}).join(",")+"}")}},computeProblems:function(c,p){return c.getText().then(H.bind(null,
p))}},{contentType:["application/json"]});v.connect()});
//@ sourceMappingURL=jslintPlugin.js.map