/*******************************************************************************
 * @license
 * 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
 ******************************************************************************/

/*******************************************************************************
 * @license
 * 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
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2016 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
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 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
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 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
 ******************************************************************************/

/**
 * @license RequireJS i18n 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/i18n for details
 */

/*******************************************************************************
 * @license
 * 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). 
 * 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * 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).
 *
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2015 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) 2002 Douglas Crockford  (www.JSLint.com)

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.
*/

/*******************************************************************************
 * @license
 * Copyright (c) 2016 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
 *******************************************************************************/

/*

  The MIT License (MIT)

  Copyright (c) 2007-2013 Einar Lielmanis and contributors.

  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.

 JS Beautifier
---------------


  Written by Einar Lielmanis, <einar@jsbeautifier.org>
      http://jsbeautifier.org/

  Originally converted to javascript by Vital, <vital76@gmail.com>
  "End braces on own line" added by Chris J. Shull, <chrisjshull@gmail.com>
  Parsing improvements for brace-less statements by Liam Newman <bitwiseman@gmail.com>


  Usage:
    js_beautify(js_source_text);
    js_beautify(js_source_text, options);

  The options are:
    indent_size (default 4)          - indentation size,
    indent_char (default space)      - character to indent with,
    preserve_newlines (default true) - whether existing line breaks should be preserved,
    max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk,

    jslint_happy (default false) - if true, then jslint-stricter mode is enforced.

            jslint_happy        !jslint_happy
            ---------------------------------
            function ()         function()

            switch () {         switch() {
            case 1:               case 1:
              break;                break;
            }                   }

    space_after_anon_function (default false) - should the space before an anonymous function's parens be added, "function()" vs "function ()",
          NOTE: This option is overriden by jslint_happy (i.e. if jslint_happy is true, space_after_anon_function is true by design)

    brace_style (default "collapse") - "collapse-preserve-inline" | "collapse" | "expand" | "end-expand" | "none"
            put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are.

    space_before_conditional (default true) - should the space before conditional statement be added, "if(true)" vs "if (true)",

    unescape_strings (default false) - should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65"

    wrap_line_length (default unlimited) - lines should wrap at next opportunity after this number of characters.
          NOTE: This is not a hard limit. Lines will continue until a point where a newline would
                be preserved if it were present.

    end_with_newline (default false)  - end output with a newline


    e.g

    js_beautify(js_source_text, {
      'indent_size': 1,
      'indent_char': '\t'
    });

*/

// if (a) if (b) if(c) d(); else e(); else f();

/*******************************************************************************
 * @license
 * Copyright (c) 2016 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) Microsoft Corporation. All rights reserved.
     *  Licensed under the MIT License. See License.txt in the project root for license information.
     *--------------------------------------------------------------------------------------------*/

/*******************************************************************************
 * @license
 * Copyright (c) 2017 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
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2016 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). 
 * 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2016 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).
 *
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2014, 2017 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(e,t){"function"==typeof define&&define.amd?define("orion/Deferred",t):"object"==typeof exports?module.exports=t():(e.orion=e.orion||{},e.orion.Deferred=t())}(this,function(){function e(){for(var e;e=a.shift();)e();o=!1}function t(e){a.push(e),o||(o=!0,s())}function n(e){return function(t){e(t)}}function r(e,t,r){try{var i=e(t),a=i&&("object"==typeof i||"function"==typeof i)&&i.then;if("function"==typeof a)if(i===r.promise)r.reject(new TypeError);else{var o=i.cancel;"function"==typeof o?r._parentCancel=o.bind(i):delete r._parentCancel,a.call(i,n(r.resolve),n(r.reject),n(r.progress))}else r.resolve(i)}catch(s){r.reject(s)}}function i(){function e(){for(var e;e=l.shift();){var t=e.deferred,n="fulfilled"===c?"resolve":"reject",i=e[n];"function"==typeof i?r(i,s,t):t[n](s)}}function n(n){delete u._parentCancel,c="rejected",s=n,l.length&&t(e)}function a(r){function o(e){return function(t){c&&"assumed"!==c||e(t)}}delete u._parentCancel;try{var d=r&&("object"==typeof r||"function"==typeof r)&&r.then;if("function"==typeof d)if(r===u)n(new TypeError);else{c="assumed";var f=r&&r.cancel;if("function"!=typeof f){var p=new i;r=p.promise;try{d(p.resolve,p.reject,p.progress)}catch(h){p.reject(h)}f=r.cancel,d=r.then}s=r,d.call(r,o(a),o(n)),u._parentCancel=f.bind(r)}else c="fulfilled",s=r,l.length&&t(e)}catch(m){o(n)(m)}}function o(){var e=u._parentCancel;if(e)delete u._parentCancel,e();else if(!c){var t=new Error("Cancel");t.name="Cancel",n(t)}}var s,c,l=[],u=this;this.resolve=function(e){return c||a(e),u},this.reject=function(e){return c||n(e),u},this.progress=function(e){return c||l.forEach(function(t){if(t.progress)try{t.progress(e)}catch(n){}}),u.promise},this.cancel=function(){return u._parentCancel?setTimeout(o,0):o(),u},this.then=function(n,r,a){var o=new i;return o._parentCancel=u.promise.cancel,l.push({resolve:n,reject:r,progress:a,deferred:o}),("fulfilled"===c||"rejected"===c)&&t(e),o.promise},this.promise={then:u.then,cancel:u.cancel}}var a=[],o=!1,s=function(){if("undefined"!=typeof process&&"function"==typeof process.nextTick){var t=process.nextTick;return function(){t(e)}}if("function"==typeof MutationObserver){var n=document.createElement("div"),r=new MutationObserver(e);return r.observe(n,{attributes:!0}),function(){n.setAttribute("class","_tick")}}return function(){setTimeout(e,0)}}();return i.all=function(e,t){function n(e,t){s||(o[e]=t,0===--a&&c.resolve(o))}function r(e,r){if(!s){if(t)try{return void n(e,t(r))}catch(i){r=i}c.reject(r)}}var a=e.length,o=[],s=!1,c=new i;return c.then(void 0,function(){s=!0,e.forEach(function(e){e.cancel&&e.cancel()})}),0===a?c.resolve(o):e.forEach(function(e,t){e.then(n.bind(void 0,t),r.bind(void 0,t))}),c.promise},i.when=function(e,t,n,r){var a,o;return e&&"function"==typeof e.then?a=e:(o=new i,o.resolve(e),a=o.promise),a.then(t,n,r)},i}),define("orion/EventTarget",[],function(){function e(){this._namedListeners={}}return e.prototype={dispatchEvent:function(e){if(!e.type)throw new Error("unspecified type");var t=this._namedListeners[e.type];return t&&t.forEach(function(t){try{"function"==typeof t?t(e):t.handleEvent(e)}catch(n){"undefined"!=typeof console&&console.log(n)}}),!e.defaultPrevented},addEventListener:function(e,t){("function"==typeof t||t.handleEvent)&&(this._namedListeners[e]=this._namedListeners[e]||[],this._namedListeners[e].push(t))},removeEventListener:function(e,t){var n=this._namedListeners[e];if(n)for(var r=0;r<n.length;r++)if(n[r]===t){1===n.length?delete this._namedListeners[e]:n.splice(r,1);break}}},e.prototype.constructor=e,e.attach=function(t){var n=new e;t.dispatchEvent=n.dispatchEvent.bind(n),t.addEventListener=n.addEventListener.bind(n),t.removeEventListener=n.removeEventListener.bind(n)},e}),function(e,t){"function"==typeof define&&define.amd?define("orion/plugin",["orion/Deferred","orion/EventTarget"],t):"object"==typeof exports?module.exports=t(require("orion/Deferred"),require("orion/EventTarget")):(e.orion=e.orion||{},e.orion.PluginProvider=t(e.orion.Deferred,e.orion.EventTarget))}(this,function(e,t){function n(e,t){var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;n.sort(),r.sort();for(var i=0,a=n.length;a>i;i++){var o=n[i];if(o!==r[i])return!1;var s=e[o],c=t[o];if(s!==c&&JSON.stringify(s)!==JSON.stringify(c))return!1}return!0}function r(e,t){this.__objectId=e,this.__methods=t}function i(i,a){function o(e,t){t=t||U,t&&("undefined"==typeof ArrayBuffer&&(e=JSON.stringify(e)),t===self||L?t.postMessage(e):t.postMessage(e,"*"))}function s(e){"undefined"!=typeof localStorage&&localStorage.pluginLogging&&console.log(e+"("+(Date.now()-I)+"ms)="+self.location)}function c(){var e=Date.now();M&&4e3>e-M||(M=e,o({method:"loading"}),s("heartbeat"))}function l(){var e=[];return Object.keys(R).forEach(function(t){var n=R[t];e.push({serviceId:t,names:n.names,methods:n.methods,properties:n.properties})}),{updateRegistry:!!K,headers:w||{},services:e}}function u(e,t){if(t&&t instanceof XMLHttpRequest){var n,r;try{n=t.status,r=t.statusText}catch(i){n=0,r=""}return{status:n||0,statusText:r}}return t}function d(e){var t=e?JSON.parse(JSON.stringify(e,u)):e;return e instanceof Error&&(t.__isError=!0,t.message=t.message||e.message,t.name=t.name||e.name),t}function f(t,n){if(n=n||U,!n)return(new e).reject(new Error("plugin not connected"));t.id=String(k++);var i=new e;O[t.id]=i,i.then(null,function(e){E&&e instanceof Error&&"Cancel"===e.name&&N({requestId:t.id,method:"cancel",params:e.message?[e.message]:[]},n)});var a=Object.prototype.toString;return t.params.forEach(function(e,n){if("[object Object]"===a.call(e)&&!(e instanceof r)){var o,s;for(o in e)"[object Function]"===a.call(e[o])&&(s=s||[],s.push(o));if(s){var c=T++;C[c]=e;var l=function(){delete C[c]};i.then(l,l),t.params[n]=new r(c,s)}}}),N(t,n),i.promise}function p(e,t,n){e||0===e?N({id:e,result:null,error:t},n):console.log(t)}function h(e,t,n,r,i){r.forEach(function(e,t){if(e&&"undefined"!=typeof e.__objectId){var n={};e.__methods.forEach(function(t){n[t]=function(){return f({objectId:e.__objectId,method:t,params:Array.prototype.slice.call(arguments)},i)}}),r[t]=n}});var a="undefined"==typeof e?null:{id:e,result:null,error:null};try{var o=n.apply(t,r);if(!a)return;o&&"function"==typeof o.then?(S[e]=o,o.then(function(t){delete S[e],a.result=t,N(a,i)},function(t){S[e]&&(delete S[e],a.error=d(t),N(a,i))},function(){N({responseId:e,method:"progress",params:Array.prototype.slice.call(arguments)},i)})):(a.result=o,N(a,i))}catch(s){a&&(a.error=d(s),N(a,i))}}function m(e,t){if(L||e.source===U||"undefined"==typeof window){var n=e.data,r="string"!=typeof n?n:JSON.parse(n);try{if(r.method){var i=r.method,a=r.params||[];if("serviceId"in r){var o=R[r.serviceId];o?(o=o.implementation,i in o?h(r.id,o,o[i],a,t):p(r.id,"method not found",t)):p(r.id,"service not found",t)}else if("objectId"in r){var s=C[r.objectId];s?i in s?h(r.id,s,s[i],a,t):p(r.id,"method not found",t):p(r.id,"object not found",t)}else if("requestId"in r){var c=S[r.requestId];c&&"cancel"===i&&c.cancel&&c.cancel.apply(c,a)}else if("responseId"in r){var l=O[r.responseId];l&&"progress"===i&&l.progress&&l.progress.apply(l,a)}else{if("plugin"!==r.method)throw new Error("Bad method: "+r.method);var u=r.params[0];_({services:u.services})}}else if(r.id){var d=O[String(r.id)];d&&(delete O[String(r.id)],r.error?d.reject(r.error):d.resolve(r.result))}}catch(f){console.log("Plugin._messageHandler "+f)}}}function g(e){var n={};if(e.methods&&(e.methods.forEach(function(t){n[t]=function(){var n={serviceId:e.serviceId,method:t,params:Array.prototype.slice.call(arguments)};return f(n)}}),n.addEventListener&&n.removeEventListener&&t)){var i=new t,a=T++;C[a]={handleEvent:i.dispatchEvent.bind(i)};var o=new r(a,["handleEvent"]),s=n.addEventListener;n.addEventListener=function(e,t){i._namedListeners[e]||s(e,o),i.addEventListener(e,t)};var c=n.removeEventListener;n.removeEventListener=function(e,t){i.removeEventListener(e,t),i._namedListeners[e]||c(e,o)}}return n}function v(e){var t=JSON.parse(JSON.stringify(e.properties)),n=e.names||e.type||[];return Array.isArray(n)||(n=[n]),t.objectClass=n,t}function b(e){if(K){var t=g(e),n=v(e),r=K.registerService(e.names||e.type,t,n);j[e.serviceId]={registration:r,proxy:t}}}function _(e){var t=y||[];if(y=e.services||[],!n(y,t)){var r=[];y.forEach(function(e){var t=e.serviceId;r.push(t);var i=j[t];if(i){if(n(e.methods,Object.keys(i.proxy))){var a=v(e),o=i.registration.getReference(),s={};return o.getPropertyKeys().forEach(function(e){s[e]=o.getProperty(e)}),void(n(a,s)||i.registration.setProperties(a))}i.registration.unregister(),delete j[t]}b(e)}),Object.keys(j).forEach(function(e){-1===r.indexOf(e)&&(j[e].registration.unregister(),delete j[e])})}x&&(x(),x=null)}var y,x,w=i,E=!1,k=0,T=0,A=0,S={},O={},C={},R={},j={},K=a,D=[],L=!1,U=null;"undefined"==typeof window?self.postMessage?U=self:L=!0:window!==window.parent?U=window.parent:null!==window.opener&&(U=window.opener);var N=o,B=function(e){o({method:"error",error:d(e.error)})};addEventListener("error",B);var M,I=Date.now();c(),L&&self.addEventListener("connect",function(e){var t=e.ports[0];if(D.push(t),E){var n={method:"plugin",params:[l()]};o(n,t)}else c();t.addEventListener("message",function(e){m(e,t)}),t.start()}),this.updateHeaders=function(e){if(E)throw new Error("Cannot update headers. Plugin Provider is connected");w=e},this.registerService=function(e,t,n){if(E)throw new Error("Cannot register service. Plugin Provider is connected");"string"==typeof e?e=[e]:Array.isArray(e)||(e=[]);var r=null,i=[];for(r in t)"function"==typeof t[r]&&i.push(r);R[A++]={names:e,methods:i,implementation:t,properties:n||{},listeners:{}},c()},this.registerServiceProvider=this.registerService,this.connect=function(e,t){if(E)return void(e&&e());removeEventListener("error",B);var n={method:"plugin",params:[l()]};if(!L){if(!U)return void(t&&t("No valid plugin target"));addEventListener("message",m,!1),o(n)}if("undefined"!=typeof window){var r=document.getElementsByTagName("head")[0]||document.documentElement,i=r.getElementsByTagName("title")[0];i||(i=document.createElement("title"),i.textContent=w?w.name:"",r.appendChild(i))}D.forEach(function(e){o(n,e)}),E=!0,K?x=e:e&&e()},this.disconnect=function(){E&&(removeEventListener("message",m),D.forEach(function(e){e.close()}),D=null,U=null,E=!1)}}return i}),define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(e,t){function n(e,t,n){this._properties=n||{},this._properties["service.id"]=e,this._properties.objectClass=t,this._properties["service.names"]=t}function r(e,t,n){this._serviceId=e,this._serviceReference=t,this._internalRegistry=n}function i(t,n){function r(r){return function(){var i;try{if(!n())throw new Error("Service was unregistered");var a=t[r].apply(t,Array.prototype.slice.call(arguments));if(a&&"function"==typeof a.then)return a;i=new e,i.resolve(a)}catch(o){i=new e,i.reject(o)}return i.promise}}var i;for(i in t)"function"==typeof t[i]&&(this[i]=r(i))}function a(e,t){this.type=e,this.serviceReference=t}function o(){this._entries=[],this._namedReferences={},this._serviceEventTarget=new t;var e=this;this._internalRegistry={isRegistered:function(t){return e._entries[t]?!0:!1},unregisterService:function(t){var n=e._entries[t];if(!n)throw new Error("Service has already been unregistered: "+t);var r=n.reference;e._serviceEventTarget.dispatchEvent(new a("unregistering",r)),e._entries[t]=null;var i=r.getProperty("objectClass");i.forEach(function(t){for(var n=e._namedReferences[t],i=0;i<n.length;i++)if(n[i]===r){1===n.length?delete e._namedReferences[t]:n.splice(i,1);break}})},modifyService:function(t){var n=e._entries[t];if(!n)throw new Error("Service not found while trying to send modified event: "+t);var r=n.reference;e._serviceEventTarget.dispatchEvent(new a("modified",r))}}}return n.prototype={getPropertyKeys:function(){var e,t=[];for(e in this._properties)this._properties.hasOwnProperty(e)&&t.push(e);return t},getProperty:function(e){return this._properties[e]}},n.prototype.constructor=n,r.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw new Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(e){var t=this._serviceReference._properties;this._serviceReference._properties=e||{},e["service.id"]=this._serviceId,e.objectClass=t.objectClass,e["service.names"]=t["service.names"],this._internalRegistry.modifyService(this._serviceId)}},r.prototype.constructor=r,o.prototype={getService:function(e){var t;if("string"==typeof e){var n=this._namedReferences[e];n&&n.some(function(e){return t=this._entries[e.getProperty("service.id")].service,!!t},this)}else{var r=this._entries[e.getProperty("service.id")];r&&(t=r.service)}return t||null},getServiceReferences:function(e){if(e)return this._namedReferences[e]?this._namedReferences[e]:[];var t=[];return this._entries.forEach(function(e){e&&t.push(e.reference)}),t},registerService:function(e,t,o){if("undefined"==typeof t||null===t)throw new Error("invalid service");"string"==typeof e?e=[e]:Array.isArray(e)||(e=[]);var s=this._entries.length,c=new n(s,e,o),l=this._namedReferences;e.forEach(function(e){l[e]=l[e]||[],l[e].push(c)});var u=new i(t,this._internalRegistry.isRegistered.bind(null,s));this._entries.push({reference:c,service:u});var d=this._internalRegistry;return this._serviceEventTarget.dispatchEvent(new a("registered",c)),new r(s,c,d)},addEventListener:function(e,t){this._serviceEventTarget.addEventListener(e,t)},removeEventListener:function(e,t){this._serviceEventTarget.removeEventListener(e,t)}},o.prototype.constructor=o,{ServiceRegistry:o}}),define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},operator:{match:"(\\+|-|!|=|>|<|&|(\\|\\|))+",name:"punctuation.operator"},doc_block:{begin:"/\\*\\*",end:"\\*/",name:"comment.block.documentation",beginCaptures:{0:{name:"comment.block.documentation.start"}},endCaptures:{0:{name:"comment.block.documentation.end"}},patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"meta.documentation.annotation"},{match:"<[^\\s>]*>",name:"meta.documentation.tag"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",repository:{comment_singleLine:{match:{match:"(//).*",literal:"//"},name:"comment.line.double-slash",captures:{1:{name:"comment.line.double-slash.start"}},patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block",beginCaptures:{0:{name:"comment.block.start"}},endCaptures:{0:{name:"comment.block.end"}},patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}}),define("orion/editor/stylers/application_json/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["false","true"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.json",contentTypes:["application/json"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.json"}]}),{id:n[n.length-1].id,grammars:n,keywords:t}}),define("orion/editor/stylers/application_schema_json/syntax",["orion/editor/stylers/application_json/syntax"],function(e){var t=["additionalItems","additionalProperties","allOf","anyOf","default","definitions","dependencies","description","enum","exclusiveMaximum","exclusiveMinimum","format","id","maximum","maxItems","maxLength","maxProperties","minimum","minItems","minLength","minProperties","multipleOf","not","oneOf","patternProperties","pattern","properties","required","title","type","uniqueItems"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.json.schema",contentTypes:["application/schema+json"],patterns:[{include:"orion.json"},{match:"(?:\\$schema|(?:\\b(?:"+t.join("|")+")))\\b",name:"keyword.operator.schema.json"}]}),{id:n[n.length-1].id,grammars:n,keywords:t}}),function(){"use strict";function e(e,t,n,r,i,a){t[e]&&(n.push(e),(t[e]===!0||1===t[e])&&r.push(i+e+"/"+a))}function t(e,t,n,r,i){var a=r+t+"/"+i;require._fileExists(e.toUrl(a+".js"))&&n.push(a)}function n(e,t,r){var i;for(i in t)!t.hasOwnProperty(i)||e.hasOwnProperty(i)&&!r?"object"==typeof t[i]&&(!e[i]&&t[i]&&(e[i]={}),n(e[i],t[i],r)):e[i]=t[i]}var r=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(i){var a=i.config?i.config():{};return a=a||{},{version:"2.0.6",load:function(i,o,s,c){c=c||{},c.locale&&(a.locale=c.locale);var l,u,d,f=r.exec(i),p=f[1],h=f[4],m=f[5],g=h.split("-"),v=[],b={},_="";if(f[5]?(p=f[1],l=p+m):(l=i,m=f[4],h=a.locale,h||(h=a.locale="undefined"==typeof navigator?"root":(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage||"root").toLowerCase()),g=h.split("-")),c.isBuild){for(v.push(l),t(o,"root",v,p,m),u=0;u<g.length;u++)d=g[u],_+=(_?"-":"")+d,t(o,_,v,p,m);if(c.locales){var y,x;for(y=0;y<c.locales.length;y++)for(h=c.locales[y],g=h.split("-"),_="",x=0;x<g.length;x++)d=g[x],_+=(_?"-":"")+d,t(o,_,v,p,m)}o(v,function(){s()})}else o([l],function(t){var r,i=[];for(e("root",t,i,v,p,m),u=0;u<g.length;u++)r=g[u],_+=(_?"-":"")+r,e(_,t,i,v,p,m);o(v,function(){var e,r,a;for(e=i.length-1;e>-1&&i[e];e--)a=i[e],r=t[a],(r===!0||1===r)&&(r=o(p+a+"/"+m)),n(b,r);s(b)})})}}})}(),define("orion/jslint/nls/messages",["module"],function(e){var t=e.config();return t&&t.root?t:{root:!0}}),define("orion/jslint/nls/root/messages",{"Stopping.":"Stopping. (${0}% scanned)","Too many errors.":"Too many errors. (${0}% scanned)","Stopping, unable to continue.":"Stopping, unable to continue. (${0}% scanned)","'{a}' is a reserved key.":"'${0}' is a reserved key.","'{a}' should not be greater than '{b}'.":"'${0}' should not be greater than '${1}'.","A regular expression literal can be confused with '/='.":"A regular expression literal can be confused with '/='.","A trailing decimal point can be confused with a dot '{a}'.":"A trailing decimal point can be confused with a dot '${0}'.","ADsafe comment violation.":"ADsafe comment violation.","ADsafe string violation.":"ADsafe string violation.","Avoid \\x-.":"Avoid \\x-.","Avoid 0x-. '{a}'.":"Avoid 0x-. '${0}'.","Bad escapement.":"Bad escapement.","Bad hex color '{a}'.":"Bad hex color '${0}'.","Bad HTML string":"Bad HTML string","Bad identifier {a}.":"Bad identifier ${0}.","Bad number '{a}'.":"Bad number '${0}'.","Confusing regular expression.":"Confusing regular expression.","Control character in string: {a}.":"Control character in string: ${0}.","Dangerous comment.":"Dangerous comment.","Don't use extra leading zeros '{a}'.":"Don't use extra leading zeros '${0}'.","Duplicate key '{a}'.":"Duplicate key '${0}'.","Empty class.":"Empty class.","Escapement in style string.":"Escapement in style string.","Expected '<\\/' and instead saw '</'.":"Expected '<\\/' and instead saw '</'.","Expected {a} and instead saw {b}.":"Expected ${0} and instead saw ${1}.","Expected '{a}' and instead saw '{b}'.":"Expected '${0}' and instead saw '${1}'.","Expected a number and instead saw '{a}'.":"Expected a number and instead saw '${0}'.","Expected a string and instead saw {a}.":"Expected a string and instead saw ${0}.","Expected a JSON value.":"Expected a JSON value.","HTML confusion in regular expression '<{a}'.":"HTML confusion in regular expression '<${0}'.","Insecure '{a}'.":"Insecure '${0}'.","Missing ']' to match '[' from line {a}.":"Missing '}' to match '{' from line ${0}.","Missing '}' to match '{' from line {a}.":"Missing '}' to match '{' from line ${0}.","Missing semicolon.":"Missing semicolon.","Missing space after '{a}'.":"Missing space after '${0}'.","Nested comment.":"Nested comment.","Spaces are hard to count. Use {{a}}.":"Spaces are hard to count. Use {${0}}.","Strings must use doublequote.":"Strings must use doublequote.","Unclosed comment.":"Unclosed comment.","Unclosed regular expression.":"Unclosed regular expression.","Unclosed string.":"Unclosed string.","Unescaped '{a}'.":"Unescaped '${0}'.","Unexpected </ in comment.":"Unexpected </ in comment.","Unexpected {a} in '{b}'.":"Unexpected ${0} in '${1}'.","Unexpected '{a}'.":"Unexpected '${0}'.","Unexpected '<!' in a string.":"Unexpected '<!' in a string.","Unexpected comma.":"Unexpected comma.","Unexpected comment.":"Unexpected comment.","Unexpected control character in regular expression.":"Unexpected control character in regular expression.","Unexpected escaped character '{a}' in regular expression.":"Unexpected escaped character '${0}' in regular expression.","Unexpected space after '-'.":"Unexpected space after '-'.","Unexpected space after '{a}'.":"Unexpected space after '${0}'.","Unnecessary escapement.":"Unnecessary escapement."}),define("orion/i18nUtil",[],function(){function e(e){var t=/\$\{([^\}]+)\}/g,n=arguments;return 2===n.length&&n[1]&&"object"==typeof n[1]?e.replace(t,function(e,t){return n[1][t]}):e.replace(t,function(e,t){return n[(t<<0)+1]})}return{formatMessage:e}}),this.JSON||(this.JSON={}),function(){function f(e){return 10>e?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,a,o,s=gap,c=t[e];switch(c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,o=[],"[object Array]"===Object.prototype.toString.apply(c)){for(a=c.length,n=0;a>n;n+=1)o[n]=str(n,c)||"null";return i=0===o.length?"[]":gap?"[\n"+gap+o.join(",\n"+gap)+"\n"+s+"]":"["+o.join(",")+"]",gap=s,i}if(rep&&"object"==typeof rep)for(a=rep.length,n=0;a>n;n+=1)r=rep[n],"string"==typeof r&&(i=str(r,c),i&&o.push(quote(r)+(gap?": ":":")+i));else for(r in c)Object.hasOwnProperty.call(c,r)&&(i=str(r,c),i&&o.push(quote(r)+(gap?": ":":")+i));return i=0===o.length?"{}":gap?"{\n"+gap+o.join(",\n"+gap)+"\n"+s+"}":"{"+o.join(",")+"}",gap=s,i}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;n>r;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&"object"==typeof i)for(n in i)Object.hasOwnProperty.call(i,n)&&(r=walk(i,n),void 0!==r?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}();var JSLINT=function(){function e(){}function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e,n){var r;for(r in n)t(n,r)&&(e[r]=n[r])}function r(){Zt.safe||(Zt.rhino&&n(Ht,wn),Zt.devel&&n(Ht,vn),Zt.browser&&n(Ht,hn),Zt.node&&n(Ht,xn),Zt.windows&&n(Ht,En),Zt.widget&&n(Ht,Sn))}function i(e,t,n){throw{name:"JSLintError",line:t,character:n,message:e+" ("+Math.floor(t/zt.length*100)+"% scanned)."}}function a(e,t,n,r,a,o){var s,c,l;return t=t||Wt,"(end)"===t.id&&(t=an),c=t.line||0,s=t.from||0,l={id:"(error)",raw:e,evidence:zt[c-1]||"",line:c,character:s,a:n,b:r,c:a,d:o},l.reason=e.supplant(l),JSLINT.errors.push(l),Zt.passfail&&i("Stopping. ",c,s),sn+=1,sn>=Zt.maxerr&&i("Too many errors.",c,s),l}function o(e,t,n,r,i,o,s){return a(e,{line:t,from:n},r,i,o,s)}function s(e,t,n,r,o,s){var c=a(e,t,n,r,o,s);i("Stopping, unable to continue.",c.line,c.character)}function c(e,t,n,r,i,a,o){return s(e,{line:t,from:n},r,i,a,o)}function l(e,n){Zt.safe&&Ut["(global)"]&&"boolean"!=typeof Ht[e]?a("ADsafe global: "+e+".",an):"hasOwnProperty"===e&&a("'hasOwnProperty' is a really bad name."),t(Ut,e)&&!Ut["(global)"]&&a(Ut[e]===!0?"'{a}' was used before it was defined.":"'{a}' is already defined.",Wt,e),Ut[e]=n,Ut["(global)"]?(Bt[e]=Ut,t(It,e)&&(a("'{a}' was used before it was defined.",Wt,e),delete It[e])):Yt[e]=Ut}function u(){var e,t,n,i,o,c=Wt.value;switch(c){case"*/":s("Unbegun comment.");break;case"/*members":case"/*member":c="/*members",Jt||(Jt={}),t=Jt;break;case"/*jslint":Zt.safe&&a("ADsafe restriction."),t=Zt,n=pn;break;case"/*global":Zt.safe&&a("ADsafe restriction."),t=Ht}i=qn.token();e:for(;;){for(;;){if("special"===i.type&&"*/"===i.value)break e;if("(endline)"!==i.id&&","!==i.id)break;i=qn.token()}"(string)"!==i.type&&"(identifier)"!==i.type&&"/*members"!==c&&s("Bad option.",i),o=qn.token(),":"===o.id?(o=qn.token(),t===Jt&&s("Expected '{a}' and instead saw '{b}'.",i,"*/",":"),"indent"===i.value&&"/*jslint"===c?(e=+o.value,("number"!=typeof e||!isFinite(e)||0>=e||Math.floor(e)!==e)&&s("Expected a small integer and instead saw '{a}'.",o,o.value),t.white=!0,t.indent=e):"maxerr"===i.value&&"/*jslint"===c?(e=+o.value,("number"!=typeof e||!isFinite(e)||0>=e||Math.floor(e)!==e)&&s("Expected a small integer and instead saw '{a}'.",o,o.value),t.maxerr=e):"maxlen"===i.value&&"/*jslint"===c?(e=+o.value,("number"!=typeof e||!isFinite(e)||0>=e||Math.floor(e)!==e)&&s("Expected a small integer and instead saw '{a}'.",o,o.value),t.maxlen=e):"true"===o.value?t[i.value]=!0:"false"===o.value?t[i.value]=!1:s("Bad option value.",o),i=qn.token()):("/*jslint"===c&&s("Missing option value.",i),t[i.value]=!1,i=o)}n&&r()}function d(e){for(var t,n=e||0,r=0;n>=r;)t=qt[r],t||(t=qt[r]=qn.token()),r+=1;return t}function f(e,t){switch(an.id){case"(number)":"."===Wt.id&&a("A dot following a number can be confused with a decimal point.",an);break;case"-":("-"===Wt.id||"--"===Wt.id)&&a("Confusing minusses.");break;case"+":("+"===Wt.id||"++"===Wt.id)&&a("Confusing plusses.")}for(("(string)"===an.type||an.identifier)&&(Ot=an.value),e&&Wt.id!==e&&(t?"(end)"===Wt.id?a("Unmatched '{a}'.",t,t.id):a("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",Wt,e,t.id,t.line,Wt.value):("(identifier)"!==Wt.type||Wt.value!==e)&&a("Expected '{a}' and instead saw '{b}'.",Wt,e,Wt.value)),Gt=an,an=Wt;;){if(Wt=qt.shift()||qn.token(),"(end)"===Wt.id||"(error)"===Wt.id)return;if("special"===Wt.type)u();else if("(endline)"!==Wt.id)break}}function p(e,t){var n;if("(end)"===Wt.id&&s("Unexpected early end of program.",an),f(),Zt.safe&&"boolean"==typeof Ht[an.value]&&"("!==Wt.id&&"."!==Wt.id&&a("ADsafe violation.",an),t&&(Ot="anonymous",Ut["(verb)"]=an.value),t===!0&&an.fud)n=an.fud();else{if(an.nud)n=an.nud();else{if("(number)"===Wt.type&&"."===an.id)return a("A leading decimal point can be confused with a dot: '.{a}'.",an,Wt.value),f(),an;s("Expected an identifier and instead saw '{a}'.",an,an.id)}for(;e<Wt.lbp;)f(),an.led?n=an.led(n):s("Expected an operator and instead saw '{a}'.",an,an.id)}return n}function h(e,t){e=e||an,t=t||Wt,(Zt.white||"styleproperty"===cn||"style"===cn)&&e.character!==t.from&&e.line===t.line&&a("Unexpected space after '{a}'.",t,e.value)}function m(e,t){e=e||an,t=t||Wt,Zt.white&&!e.comment&&e.line===t.line&&h(e,t)}function g(e,t){Zt.white&&(e=e||an,t=t||Wt,e.line===t.line&&e.character===t.from&&a("Missing space after '{a}'.",Wt,e.value))}function v(e,t){e=e||an,t=t||Wt,Zt.laxbreak||e.line===t.line?Zt.white&&(e=e||an,t=t||Wt,e.character===t.from&&a("Missing space after '{a}'.",Wt,e.value)):a("Bad line breaking before '{a}'.",t,t.id)}function b(e){var t;Zt.white&&"(end)"!==Wt.id&&(t=Ft+(e||0),Wt.from!==t&&a("Expected '{a}' to have an indentation at {b} instead at {c}.",Wt,Wt.value,t,Wt.from))}function _(e){e=e||an,e.line!==Wt.line&&a("Line breaking error '{a}'.",e,e.value)}function y(){an.line!==Wt.line?Zt.laxbreak||a("Bad line breaking before '{a}'.",an,Wt.id):an.character!==Wt.from&&Zt.white&&a("Unexpected space after '{a}'.",Wt,an.value),f(","),g(an,Wt)}function x(e,t){var n=An[e];return n&&"object"==typeof n||(An[e]=n={id:e,lbp:t,value:e}),n}function w(e){return x(e,0)}function E(e,t){var n=w(e);return n.identifier=n.reserved=!0,n.fud=t,n}function k(e,t){var n=E(e,t);return n.block=!0,n}function T(e){var t=e.id.charAt(0);return(t>="a"&&"z">=t||t>="A"&&"Z">=t)&&(e.identifier=e.reserved=!0),e}function A(e,t){var n=x(e,150);return T(n),n.nud="function"==typeof t?t:function(){return this.right=p(150),this.arity="unary",("++"===this.id||"--"===this.id)&&(Zt.plusplus?a("Unexpected use of '{a}'.",this,this.id):this.right.identifier&&!this.right.reserved||"."===this.right.id||"["===this.right.id||a("Bad operand.",this)),this},n}function S(e,t){var n=w(e);return n.type=e,n.nud=t,n}function O(e,t){var n=S(e,t);return n.identifier=n.reserved=!0,n}function C(e){return O(e,function(){return("this"===this.id||"arguments"===this.id||"eval"===this.id)&&(nn&&Ut["(global)"]?a("Strict violation.",this):Zt.safe&&a("ADsafe violation.",this)),this})}function R(e,t,n,r){var i=x(e,n);return T(i),i.led=function(e){return r||(v(Gt,an),g(an,Wt)),"function"==typeof t?t(e,this):(this.left=e,this.right=p(n),this)},i}function j(e,t){var n=x(e,100);return n.led=function(e){v(Gt,an),g(an,Wt);var n=p(100);return e&&"NaN"===e.id||n&&"NaN"===n.id?a("Use the isNaN function to compare with NaN.",this):t&&t.apply(this,[e,n]),"!"===e.id&&a("Confusing use of '{a}'.",e,"!"),"!"===n.id&&a("Confusing use of '{a}'.",e,"!"),this.left=e,this.right=n,this},n}function K(e){return e&&("(number)"===e.type&&0===+e.value||"(string)"===e.type&&" "===e.value||"true"===e.type||"false"===e.type||"undefined"===e.type||"null"===e.type)
}function D(e){return x(e,20).exps=!0,R(e,function(e,t){var n;if(t.left=e,Ht[e.value]===!1&&Yt[e.value]["(global)"]===!0&&a("Read only.",e),Zt.safe){n=e;do"boolean"==typeof Ht[n.value]&&a("ADsafe violation.",n),n=n.left;while(n)}if(e){if("."===e.id||"["===e.id)return e.left&&"arguments"!==e.left.value||a("Bad assignment.",t),t.right=p(19),t;if(e.identifier&&!e.reserved)return"exception"===Ut[e.value]&&a("Do not assign to the exception parameter.",e),t.right=p(19),t;e===An["function"]&&a("Expected an identifier in an assignment and instead saw a function invocation.",an)}s("Bad assignment.",t)},20)}function L(e,t,n){var r=x(e,n);return T(r),r.led="function"==typeof t?t:function(e){return Zt.bitwise&&a("Unexpected use of '{a}'.",this,this.id),this.left=e,this.right=p(n),this},r}function U(e){return x(e,20).exps=!0,R(e,function(e,t){return Zt.bitwise&&a("Unexpected use of '{a}'.",t,t.id),g(Gt,an),g(an,Wt),e?"."===e.id||"["===e.id||e.identifier&&!e.reserved?(p(19),t):(e===An["function"]&&a("Expected an identifier in an assignment, and instead saw a function invocation.",an),t):void s("Bad assignment.",t)},20)}function N(e){var t=x(e,150);return t.led=function(e){return Zt.plusplus?a("Unexpected use of '{a}'.",this,this.id):e.identifier&&!e.reserved||"."===e.id||"["===e.id||a("Bad operand.",this),this.left=e,this},t}function B(){return Wt.identifier?(f(),Zt.safe&&fn[an.value]?a("ADsafe violation: '{a}'.",an,an.value):an.reserved&&!Zt.es5&&a("Expected an identifier and instead saw '{a}' (a reserved word).",an,an.id),an.value):void 0}function M(){var e=B();return e?e:void("function"===an.id&&"("===Wt.id?a("Missing name in function statement."):s("Expected an identifier and instead saw '{a}'.",Wt,Wt.value))}function I(e){var t,n=0;if(";"===Wt.id&&!Xt)for(;;){if(t=d(n),t.reach)return;if("(endline)"!==t.id){if("function"===t.id){a("Inner functions should be listed at the top of the outer function.",t);break}a("Unreachable '{a}' after '{b}'.",t,t.value,e);break}n+=1}}function P(e){var t,n=Ft,r=Yt,i=Wt;return";"===i.id?(a("Unnecessary semicolon.",i),void f(";")):(i.identifier&&!i.reserved&&":"===d().id&&(f(),f(":"),Yt=Object.create(r),l(i.value,"label"),Wt.labelled||a("Label '{a}' on {b} statement.",Wt,i.value,Wt.value),Bn.test(i.value+":")&&a("Label '{a}' looks like a javascript url.",i,i.value),Wt.label=i.value,i=Wt),e||b(),t=p(0,!0),i.block||(t&&t.exps?"("===t.id&&"new"===t.left.id&&a("Do not use 'new' for side effects."):a("Expected an assignment or function call and instead saw an expression.",an),";"!==Wt.id?o("Missing semicolon.",an.line,an.from+an.value.length):(h(an,Wt),f(";"),g(an,Wt))),Ft=n,Yt=r,t)}function F(){return"use strict"===Wt.value?(f(),f(";"),nn=!0,!0):!1}function V(e){var t,n,r=[];if(e&&!F()&&Zt.strict&&a('Missing "use strict" statement.',Wt),Zt.adsafe)switch(e){case"script":At||("ADSAFE"!==Wt.value||"."!==d(0).id||"id"!==d(1).value&&"go"!==d(1).value)&&s("ADsafe violation: Missing ADSAFE.id or ADSAFE.go.",Wt),"ADSAFE"===Wt.value&&"."===d(0).id&&"id"===d(1).value&&(At&&s("ADsafe violation.",Wt),f("ADSAFE"),f("."),f("id"),f("("),Wt.value!==Tt&&s("ADsafe violation: id does not match.",Wt),f("(string)"),f(")"),f(";"),At=!0);break;case"lib":if("ADSAFE"===Wt.value)return f("ADSAFE"),f("."),f("lib"),f("("),f("(string)"),y(),t=p(0),"function"!==t.id&&s("The second argument to lib must be a function.",t),n=t.funct["(params)"],n=n&&n.join(", "),n&&"lib"!==n&&s("Expected '{a}' and instead saw '{b}'.",t,"(lib)","("+n+")"),f(")"),f(";"),r;s("ADsafe lib violation.")}for(;!Wt.reach&&"(end)"!==Wt.id;)";"===Wt.id?(a("Unnecessary semicolon."),f(";")):r.push(P());return r}function z(e){var t,n,r=Pt,i=Ft,o=Yt;if(Pt=e,Yt=Object.create(Yt),g(an,Wt),n=Wt,"{"===Wt.id){if(f("{"),"}"!==Wt.id||an.line!==Wt.line){for(Ft+=Zt.indent;!e&&Wt.from>Ft;)Ft+=Zt.indent;e||F(),t=V(),Ft-=Zt.indent,b()}f("}",n),Ft=i}else a("Expected '{a}' and instead saw '{b}'.",Wt,"{",Wt.value),Xt=!0,t=[P()],Xt=!1;return Ut["(verb)"]=null,Yt=o,Pt=r,t}function q(){return this}function $(e){Jt&&"boolean"!=typeof Jt[e]&&a("Unexpected /*member '{a}'.",an,e),"number"==typeof $t[e]?$t[e]+=1:$t[e]=1}function J(e){var t=e.value,n=e.line,r=It[t];"function"==typeof r&&(r=!1),r?r[r.length-1]!==n&&r.push(n):(r=[n],It[t]=r)}function W(){return Wt.identifier?(f(),!0):void 0}function X(){return"-"===Wt.id&&(f("-"),h(),_()),"(number)"===Wt.type?(f("(number)"),!0):void 0}function Z(){return"(string)"===Wt.type?(f(),!0):void 0}function H(){var e,t,n;if(Wt.identifier){if(n=Wt.value,"rgb"===n||"rgba"===n){for(f(),f("("),e=0;3>e;e+=1)e&&f(","),t=Wt.value,"(number)"!==Wt.type||0>t?(a("Expected a positive number and instead saw '{a}'",Wt,t),f()):(f(),"%"===Wt.id?(f("%"),t>100&&a("Expected a percentage and instead saw '{a}'",an,t)):t>255&&a("Expected a small number and instead saw '{a}'",an,t));return"rgba"===n&&(f(","),t=+Wt.value,("(number)"!==Wt.type||0>t||t>1)&&a("Expected a number between 0 and 1 and instead saw '{a}'",Wt,t),f(),"%"===Wt.id&&(a("Unexpected '%'."),f("%"))),f(")"),!0}if(mn[Wt.value]===!0)return f(),!0}else if("(color)"===Wt.type)return f(),!0;return!1}function Q(){return"-"===Wt.id&&(f("-"),h(),_()),"(number)"===Wt.type?(f(),"(string)"!==Wt.type&&gn[Wt.value]===!0?(h(),f()):0!==+an.value&&a("Expected a linear unit and instead saw '{a}'.",Wt,Wt.value),!0):!1}function G(){return"-"===Wt.id&&(f("-"),h()),"(number)"===Wt.type?(f(),"(string)"!==Wt.type&&gn[Wt.value]===!0&&(h(),f()),!0):!1}function Y(){if(!Wt.identifier)return Q();switch(Wt.value){case"thin":case"medium":case"thick":return f(),!0}}function et(){return Wt.identifier?"auto"===Wt.value?(f(),!0):void 0:Q()}function tt(){return Wt.identifier&&"attr"===Wt.value?(f(),f("("),Wt.identifier||a("Expected a name and instead saw '{a}'.",Wt,Wt.value),f(),f(")"),!0):!1}function nt(){for(;";"!==Wt.id;){if(W()||Z()||a("Expected a name and instead saw '{a}'.",Wt,Wt.value),","!==Wt.id)return!0;y()}}function rt(){return Wt.identifier&&"counter"===Wt.value?(f(),f("("),!Wt.identifier,f(),","===Wt.id&&(y(),"(string)"!==Wt.type&&a("Expected a string and instead saw '{a}'.",Wt,Wt.value),f()),f(")"),!0):Wt.identifier&&"counters"===Wt.value?(f(),f("("),Wt.identifier||a("Expected a name and instead saw '{a}'.",Wt,Wt.value),f(),","===Wt.id&&(y(),"(string)"!==Wt.type&&a("Expected a string and instead saw '{a}'.",Wt,Wt.value),f()),","===Wt.id&&(y(),"(string)"!==Wt.type&&a("Expected a string and instead saw '{a}'.",Wt,Wt.value),f()),f(")"),!0):!1}function it(){var e;if(Wt.identifier&&"rect"===Wt.value){for(f(),f("("),e=0;4>e;e+=1)if(!Q()){a("Expected a number and instead saw '{a}'.",Wt,Wt.value);break}return f(")"),!0}return!1}function at(){var e,t;return Wt.identifier&&"url"===Wt.value?(Wt=qn.range("(",")"),t=Wt.value,e=t.charAt(0),('"'===e||"'"===e)&&(t.slice(-1)!==e?a("Bad url string."):(t=t.slice(1,-1),t.indexOf(e)>=0&&a("Bad url string."))),t||a("Missing url."),f(),Zt.safe&&Mn.test(t)&&s("ADsafe URL violation."),on.push(t),!0):!1}function ot(){for(var e;"*"===Wt.id||"#"===Wt.id||"_"===Wt.value;)Zt.css||a("Unexpected '{a}'.",Wt,Wt.value),f();return"-"===Wt.id?(Zt.css||a("Unexpected '{a}'.",Wt,Wt.value),f("-"),Wt.identifier||a("Expected a non-standard style attribute and instead saw '{a}'.",Wt,Wt.value),f(),jt):(Wt.identifier?t(Rt,Wt.value)?e=Rt[Wt.value]:(e=jt,Zt.css||a("Unrecognized style attribute '{a}'.",Wt,Wt.value)):a("Excepted a style attribute, and instead saw '{a}'.",Wt,Wt.value),f(),e)}function st(e){var t,n,r,i,a,o=0,s=0;switch(typeof e){case"function":return e();case"string":return Wt.identifier&&Wt.value===e?(f(),!0):!1}for(;;){if(o>=e.length)return!1;if(a=e[o],o+=1,a===!0)break;for("number"==typeof a?(t=a,a=e[o],o+=1):t=1,r=!1;t>0&&st(a);)r=!0,t-=1;if(r)return!0}for(s=o,n=[];;){for(i=!1,o=s;o<e.length;o+=1)if(!n[o]&&st(Rt[e[o]])){r=!0,i=!0,n[o]=!0;break}if(!i)return r}}function ct(){if("(number)"===Wt.id)return f(),void("n"===Wt.value&&Wt.identifier&&(h(),f(),"+"===Wt.id&&(h(),f("+"),h(),f("(number)"))));switch(Wt.value){case"odd":case"even":if(Wt.identifier)return void f()}a("Unexpected token '{a}'.",Wt,Wt.value)}function lt(){for(var e;;){if("}"===Wt.id||"(end)"===Wt.id||ln&&Wt.id===ln)return;for(;";"===Wt.id;)a("Misplaced ';'."),f(";");e=ot(),f(":"),Wt.identifier&&"inherit"===Wt.value?f():st(e)||(a("Unexpected token '{a}'.",Wt,Wt.value),f()),"!"===Wt.id&&(f("!"),h(),Wt.identifier&&"important"===Wt.value?f():a("Expected '{a}' and instead saw '{b}'.",Wt,"important",Wt.value)),"}"===Wt.id||Wt.id===ln?a("Missing '{a}'.",Wt,";"):f(";")}}function ut(){if(Wt.identifier)t(yn,Wt.value)||a("Expected a tagName, and instead saw {a}.",Wt,Wt.value),f();else switch(Wt.id){case">":case"+":f(),ut();break;case":":switch(f(":"),Wt.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":f();break;case"lang":f(),f("("),Wt.identifier||a("Expected a lang code, and instead saw :{a}.",Wt,Wt.value),f(")");break;case"nth-child":case"nth-last-child":case"nth-last-of-type":case"nth-of-type":f(),f("("),ct(),f(")");break;case"not":f(),f("("),":"===Wt.id&&"not"===d(0).value&&a("Nested not."),ut(),f(")");break;default:a("Expected a pseudo, and instead saw :{a}.",Wt,Wt.value)}break;case"#":f("#"),Wt.identifier||a("Expected an id, and instead saw #{a}.",Wt,Wt.value),f();break;case"*":f("*");break;case".":f("."),Wt.identifier||a("Expected a class, and instead saw #.{a}.",Wt,Wt.value),f();break;case"[":f("["),Wt.identifier||a("Expected an attribute, and instead saw [{a}].",Wt,Wt.value),f(),("="===Wt.id||"~="===Wt.value||"$="===Wt.value||"|="===Wt.value||"*="===Wt.id||"^="===Wt.id)&&(f(),"(string)"!==Wt.type&&a("Expected a string, and instead saw {a}.",Wt,Wt.value),f()),f("]");break;default:s("Expected a CSS selector, and instead saw {a}.",Wt,Wt.value)}}function dt(){var e;if("{"===Wt.id)a("Expected a style pattern, and instead saw '{a}'.",Wt,Wt.id);else if("@"===Wt.id){if(f("@"),e=Wt.value,Wt.identifier&&un[e]===!0)return f(),e;a("Expected an at-rule, and instead saw @{a}.",Wt,e)}for(;;){if(ut(),"</"===Wt.id||"{"===Wt.id||"(end)"===Wt.id)return"";","===Wt.id&&y()}}function ft(){for(var e;"@"===Wt.id&&(e=d(),e.identifier&&"import"===e.value);)f("@"),f(),at()||(a("Expected '{a}' and instead saw '{b}'.",Wt,"url",Wt.value),f()),f(";");for(;"</"!==Wt.id&&"(end)"!==Wt.id;)dt(),cn="styleproperty",";"===Wt.id?f(";"):(f("{"),lt(),cn="style",f("}"))}function pt(e){"html"===e||Zt.fragment||("div"===e&&Zt.adsafe?s("ADSAFE: Use the fragment option."):s("Expected '{a}' and instead saw '{b}'.",an,"html",e)),Zt.adsafe&&("html"===e&&s("Currently, ADsafe does not operate on whole HTML documents. It operates on <div> fragments and .js files.",an),Zt.fragment?"div"!==e&&s("ADsafe violation: Wrap the widget in a div.",an):s("Use the fragment option.",an)),Zt.browser=!0,r()}function ht(e,t,n){var r,i;"id"===t?(r="string"==typeof n?n.toUpperCase():"",Mt[r]===!0&&a("Duplicate id='{a}'.",Wt,n),/^[A-Za-z][A-Za-z0-9._:\-]*$/.test(n)?Zt.adsafe&&(Tt?n.slice(0,Tt.length)!==Tt?a("ADsafe violation: An id must have a '{a}' prefix",Wt,Tt):/^[A-Z]+_[A-Z]+$/.test(n)||a("ADSAFE violation: bad id."):(Tt=n,/^[A-Z]+_$/.test(n)||a("ADSAFE violation: bad id."))):a("Bad id: '{a}'.",Wt,n),i=n.search(Vn),i>=0&&a("Unexpected character '{a}' in {b}.",an,n.charAt(i),t),Mt[r]=!0):"class"===t||"type"===t||"name"===t?(i=n.search(Fn),i>=0&&a("Unexpected character '{a}' in {b}.",an,n.charAt(i),t),Mt[r]=!0):"href"===t||"background"===t||"content"===t||"data"===t||t.indexOf("src")>=0||t.indexOf("url")>=0?(Zt.safe&&Mn.test(n)&&s("ADsafe URL violation."),on.push(n)):"for"===t?Zt.adsafe&&(Tt?n.slice(0,Tt.length)!==Tt?a("ADsafe violation: An id must have a '{a}' prefix",Wt,Tt):/^[A-Z]+_[A-Z]+$/.test(n)||a("ADSAFE violation: bad id."):a("ADSAFE violation: bad id.")):"name"===t&&Zt.adsafe&&n.indexOf("_")>=0&&a("ADsafe name violation.")}function mt(e,t){var n,r,i=yn[e];if(en=!1,i||s("Unrecognized tag '<{a}>'.",Wt,e===e.toLowerCase()?e:e+" (capitalization error)"),tn.length>0)if("html"===e&&s("Too many <html> tags.",an),r=i.parent)r.indexOf(" "+tn[tn.length-1].name+" ")<0&&s("A '<{a}>' must be within '<{b}>'.",an,e,r);else if(!Zt.adsafe&&!Zt.fragment){n=tn.length;do 0>=n&&s("A '<{a}>' must be within '<{b}>'.",an,e,"body"),n-=1;while("body"!==tn[n].name)}switch(e){case"div":Zt.adsafe&&1===tn.length&&!Tt&&a("ADSAFE violation: missing ID_.");break;case"script":cn="script",f(">"),Ft=Wt.from,t.lang&&a("lang is deprecated.",an),Zt.adsafe&&1!==tn.length&&a("ADsafe script placement violation.",an),t.src?(!Zt.adsafe||At&&Ct[t.src]||a("ADsafe unapproved script source.",an),t.type&&a("type is unnecessary.",an)):(St&&s("ADsafe script violation.",an),V("script")),cn="html",f("</"),Wt.identifier||"script"===Wt.value||a("Expected '{a}' and instead saw '{b}'.",Wt,"script",Wt.value),f(),cn="outer";break;case"style":cn="style",f(">"),ft(),cn="html",f("</"),Wt.identifier||"style"===Wt.value||a("Expected '{a}' and instead saw '{b}'.",Wt,"style",Wt.value),f(),cn="outer";break;case"input":switch(t.type){case"radio":case"checkbox":case"button":case"reset":case"submit":break;case"text":case"password":case"file":case"hidden":case"image":Zt.adsafe&&"off"!==t.autocomplete&&a("ADsafe autocomplete violation.");break;default:a("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":Zt.adsafe&&a("ADsafe violation: Disallowed tag: "+e)}}function gt(e){return"</"+e+">"}function vt(){var e,n,r,i,o,c,l,u,d=Zt.white;for(cn="html",ln="",tn=null;;){switch(Wt.value){case"<":for(cn="html",f("<"),n={},c=Wt,c.identifier||a("Bad identifier {a}.",c,c.value),i=c.value,Zt.cap&&(i=i.toLowerCase()),c.name=i,f(),tn||(tn=[],pt(i)),l=yn[i],"object"!=typeof l&&s("Unrecognized tag '<{a}>'.",c,i),r=l.empty,c.type=i;;){if("/"===Wt.id){f("/"),">"!==Wt.id&&a("Expected '{a}' and instead saw '{b}'.",Wt,">",Wt.value);break}if(Wt.id&&">"===Wt.id.substr(0,1))break;Wt.identifier||(("(end)"===Wt.id||"(error)"===Wt.id)&&s("Missing '>'.",Wt),a("Bad identifier.")),Zt.white=!0,g(an,Wt),e=Wt.value,Zt.white=d,f(),Zt.cap||e===e.toLowerCase()||a("Attribute '{a}' not all lower case.",Wt,e),e=e.toLowerCase(),ln="",t(n,e)&&a("Attribute '{a}' repeated.",Wt,e),"on"===e.slice(0,2)?(Zt.on||a("Avoid HTML event handlers."),cn="scriptstring",f("="),o=Wt.id,'"'!==o&&"'"!==o&&s("Missing quote."),ln=o,u=Zt.white,Zt.white=!1,f(o),V("on"),Zt.white=u,Wt.id!==o&&s("Missing close quote on script attribute."),cn="html",ln="",f(o),l=!1):"style"===e?(cn="scriptstring",f("="),o=Wt.id,'"'!==o&&"'"!==o&&s("Missing quote."),cn="styleproperty",ln=o,f(o),lt(),cn="html",ln="",f(o),l=!1):"="===Wt.id?(f("="),l=Wt.value,Wt.identifier||'"'===Wt.id||"'"===Wt.id||"(string)"===Wt.type||"(number)"===Wt.type||"(color)"===Wt.type||a("Expected an attribute value and instead saw '{a}'.",an,e),f()):l=!0,n[e]=l,ht(i,e,l)}mt(i,n),r||tn.push(c),cn="outer",f(">");break;case"</":cn="html",f("</"),Wt.identifier||a("Bad identifier."),i=Wt.value,Zt.cap&&(i=i.toLowerCase()),f(),tn||s("Unexpected '{a}'.",Wt,gt(i)),c=tn.pop(),c||s("Unexpected '{a}'.",Wt,gt(i)),c.name!==i&&s("Expected '{a}' and instead saw '{b}'.",Wt,gt(c.name),gt(i)),">"!==Wt.id&&s("Missing '{a}'.",Wt,">"),cn="outer",f(">");break;case"<!":for(Zt.safe&&a("ADsafe HTML violation."),cn="html";f(),">"!==Wt.id&&"(end)"!==Wt.id;)Wt.value.indexOf("--")>=0&&a("Unexpected --."),Wt.value.indexOf("<")>=0&&a("Unexpected <."),Wt.value.indexOf(">")>=0&&a("Unexpected >.");cn="outer",f(">");break;case"(end)":return;default:"(end)"===Wt.id?s("Missing '{a}'.",Wt,"</"+tn[tn.length-1].value+">"):f()}if(tn&&0===tn.length&&(Zt.adsafe||!Zt.fragment||"(end)"===Wt.id))break}"(end)"!==Wt.id&&s("Unexpected material after the end.")}function bt(){var e=B(!0);return e||("(string)"===Wt.id?(e=Wt.value,f()):"(number)"===Wt.id&&(e=Wt.value.toString(),f())),e}function _t(){var e,t=Wt,n=[];if(f("("),m(),")"===Wt.id)return f(")"),void m(Gt,an);for(;;){if(e=M(),n.push(e),l(e,"parameter"),","!==Wt.id)return f(")",t),m(Gt,an),n;y()}}function yt(e){var t,n=Yt;return Yt=Object.create(n),Ut={"(name)":e||'"'+Ot+'"',"(line)":Wt.line,"(context)":Ut,"(breakage)":0,"(loopage)":0,"(scope)":Yt},t=Ut,an.funct=Ut,Nt.push(Ut),e&&l(e,"function"),Ut["(params)"]=_t(),z(!1),Yt=n,Ut["(last)"]=an.line,Ut=Ut["(context)"],t}function xt(e){var t,n,r;for(Ut["(onevar)"]&&Zt.onevar?a("Too many var statements."):Ut["(global)"]||(Ut["(onevar)"]=!0),this.first=[];(g(an,Wt),t=M(),Ut["(global)"]&&Ht[t]===!1&&a("Redefinition of '{a}'.",an,t),l(t,"unused"),!e)&&(n=an,this.first.push(an),"="===Wt.id&&(g(an,Wt),f("="),g(an,Wt),"undefined"===Wt.id&&a("It is not necessary to initialize '{a}' to 'undefined'.",an,t),"="===d(0).id&&Wt.identifier&&s("Variable {a} was not declared correctly.",Wt,Wt.value),r=p(0),n.first=r),","===Wt.id);)y();return this}function wt(){function e(){var e={},t=Wt;if(f("{"),"}"!==Wt.id)for(;;){if("(end)"===Wt.id)s("Missing '}' to match '{' from line {a}.",Wt,t.line);else{if("}"===Wt.id){a("Unexpected comma.",an);break}","===Wt.id?s("Unexpected comma.",Wt):"(string)"!==Wt.id&&a("Expected a string and instead saw {a}.",Wt,Wt.value)}if(e[Wt.value]===!0?a("Duplicate key '{a}'.",Wt,Wt.value):"__proto__"===Wt.value?a("'{a}' is a reserved key.",Wt,Wt.value):e[Wt.value]=!0,f(),f(":"),wt(),","!==Wt.id)break;f(",")}f("}")}function t(){var e=Wt;if(f("["),"]"!==Wt.id)for(;;){if("(end)"===Wt.id)s("Missing ']' to match '[' from line {a}.",Wt,e.line);else{if("]"===Wt.id){a("Unexpected comma.",an);break}","===Wt.id&&s("Unexpected comma.",Wt)}if(wt(),","!==Wt.id)break;f(",")}f("]")}switch(Wt.id){case"{":e();break;case"[":t();break;case"true":case"false":case"null":case"(number)":case"(string)":f();break;case"-":f("-"),an.character!==Wt.from&&a("Unexpected space after '-'.",an),h(an,Wt),f("(number)");break;default:s("Expected a JSON value.",Wt)}}function Et(e){return"[object Array]"===Object.prototype.toString.apply(e)}function kt(e){var n,r=[];for(n in e)t(e,n)&&r.push(n);return r}var Tt,At,St,Ot,Ct,Rt,jt,Kt,Dt,Lt,Ut,Nt,Bt,Mt,It,Pt,Ft,Vt,zt,qt,$t,Jt,Wt,Xt,Zt,Ht,Qt,Gt,Yt,en,tn,nn,rn,an,on,sn,cn,ln,un={media:!0,"font-face":!0,page:!0},dn={"<":!0,"<=":!0,"==":!0,"===":!0,"!==":!0,"!=":!0,">":!0,">=":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0},fn={arguments:!0,callee:!0,caller:!0,constructor:!0,eval:!0,prototype:!0,stack:!0,unwatch:!0,valueOf:!0,watch:!0},pn={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,mixed_spaces_tabs:!0},hn={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},mn={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},gn={"%":!0,cm:!0,em:!0,ex:!0,"in":!0,mm:!0,pc:!0,pt:!0,px:!0},vn={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},bn={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"/":"\\/","\\":"\\\\"},_n=["closure","exception","global","label","outer","unused","var"],yn={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:{}},xn={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},wn={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},En={ActiveXObject:!1,CScript:!1,Debug:!1,Enumerator:!1,System:!1,VBArray:!1,WScript:!1},kn={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},Tn={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},An={},Sn={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},On=/@cc|<\/?|script|\]*s\]|<\s*!|&lt/i,Cn=/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,Rn=/^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/(\*(jslint|members?|global)?|=|\/)?|\*[\/=]?|\+[+=]?|-[\-=]?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/,jn=/^\s*(['"=>\/&#]|<(?:\/|\!(?:--)?)?|[a-zA-Z][a-zA-Z0-9_\-]*|[0-9]+|--)/,Kn=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,Dn=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Ln=/[>&]|<[\/!]?|--/,Un=/\*\/|\/\*/,Nn=/^([a-zA-Z_$][a-zA-Z0-9_$]*)$/,Bn=/^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i,Mn=/&|\+|\u00AD|\.\.|\/\*|%[^;]|base64|url|expression|data|mailto/i,In=/^\s*([{:#%.=,>+\[\]@()"';]|\*=?|\$=|\|=|\^=|~=|[a-zA-Z_][a-zA-Z0-9_\-]*|[0-9]+|<\/|\/\*)/,Pn=/^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/,Fn=/[^a-zA-Z0-9+\-_\/ ]/,Vn=/[\[\]\/\\"'*<>.&:(){}+=#]/,zn={outer:jn,html:jn,style:In,styleproperty:Pn};"function"!=typeof Object.create&&(Object.create=function(t){return e.prototype=t,new e}),String.prototype.entityify=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},String.prototype.isAlpha=function(){return this>="a"&&"z">=this||this>="A"&&"Z">=this},String.prototype.isDigit=function(){return this>="0"&&"9">=this},String.prototype.supplant=function(e){return this.replace(/\{([^{}]*)\}/g,function(t,n){var r=e[n];return"string"==typeof r||"number"==typeof r?r:t})},String.prototype.name=function(){return Nn.test(this)?this:Kn.test(this)?'"'+this.replace(Dn,function(e){var t=bn[e];return t?t:"\\u"+("0000"+e.charCodeAt().toString(16)).slice(-4)})+'"':'"'+this+'"'};var qn=function(){function e(){var e;return a>=zt.length?!1:(r=1,s=zt[a],a+=1,e=s.search(/ \t/),e>=0&&Zt.mixed_spaces_tabs&&o("Mixed spaces and tabs.",a,e+1),s=s.replace(/\t/g,rn),e=s.search(Cn),e>=0&&o("Unsafe character.",a,e),Zt.maxlen&&Zt.maxlen<s.length&&o("Line too long.",a,s.length),!0)}function n(e,n){var s,l;return l="(color)"===e?{type:e}:"(punctuator)"===e||"(identifier)"===e&&t(An,n)?An[n]||An["(error)"]:An[e],l=Object.create(l),("(string)"===e||"(range)"===e)&&Bn.test(n)&&o("Script URL.",a,i),"(identifier)"===e&&(l.identifier=!0,"__iterator__"===n||"__proto__"===n?c("Reserved name '{a}'.",a,i,n):!Zt.nomen||"_"!==n.charAt(0)&&"_"!==n.charAt(n.length-1)||o("Unexpected {a} in '{b}'.",a,i,"dangling '_'",n)),l.value=n,l.line=a,l.character=r,l.from=i,s=l.id,"(endline)"!==s&&(Qt=s&&("(,=:[!&|?{};".indexOf(s.charAt(s.length-1))>=0||"return"===s)),l}var r,i,a,s;return{init:function(t){zt="string"==typeof t?t.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n"):t,a=0,e(),i=1},range:function(e,t){var l,u="";for(i=r,s.charAt(0)!==e&&c("Expected '{a}' and instead saw '{b}'.",a,r,e,s.charAt(0));;){switch(s=s.slice(1),r+=1,l=s.charAt(0)){case"":c("Missing '{a}'.",a,r,l);break;case t:return s=s.slice(1),r+=1,n("(range)",u);case ln:case"\\":o("Unexpected '{a}'.",a,r,l)}u+=l}},token:function(){function t(e){var t,n=e.exec(s);return n?(b=n[0].length,t=n[1],d=t.charAt(0),s=s.substr(b),i=r+b-t.length,r+=b,t):void 0}function l(t){function l(e){var t=parseInt(s.substr(d+1,e),16);d+=e,t>=32&&126>=t&&34!==t&&92!==t&&39!==t&&o("Unnecessary escapement.",a,r),r+=e,u=String.fromCharCode(t)}var u,d,f="";if(Vt&&'"'!==t&&o("Strings must use doublequote.",a,r),ln===t||"scriptstring"===cn&&!ln)return n("(punctuator)",t);for(d=0;;){for(;d>=s.length;)d=0,"html"===cn&&e()||c("Unclosed string.",a,i);if(u=s.charAt(d),u===t)return r+=1,s=s.substr(d+1),n("(string)",f,t);if(" ">u){if("\n"===u||"\r"===u)break;o("Control character in string: {a}.",a,r+d,s.slice(0,d))}else if(u===ln)o("Bad HTML string",a,r+d);else if("<"===u)Zt.safe&&"html"===cn?o("ADsafe string violation.",a,r+d):"/"===s.charAt(d+1)&&(cn||Zt.safe)?o("Expected '<\\/' and instead saw '</'.",a,r):"!"===s.charAt(d+1)&&(cn||Zt.safe)&&o("Unexpected '<!' in a string.",a,r);else if("\\"===u)if("html"===cn)Zt.safe&&o("ADsafe string violation.",a,r+d);else if("styleproperty"===cn)d+=1,r+=1,u=s.charAt(d),u!==t&&o("Escapement in style string.",a,r+d);else switch(d+=1,r+=1,u=s.charAt(d)){case ln:o("Bad HTML string",a,r+d);break;case"\\":case"'":case'"':case"/":break;case"b":u="\b";break;case"f":u="\f";break;case"n":u="\n";break;case"r":u="\r";break;case"t":u="	";break;case"u":l(4);break;case"v":u="";break;case"x":Vt&&o("Avoid \\x-.",a,r),l(2);break;default:o("Bad escapement.",a,r)}f+=u,r+=1,d+=1}}for(var u,d,f,p,h,m,g,v,b,_,y,x;;){if(!s)return n(e()?"(endline)":"(end)","");for(;"outer"===cn&&(v=s.search(Ln),0!==v);){if(v>0){r+=1,s=s.slice(v);break}if(!e())return n("(end)","")}if(x=t(zn[cn]||Rn)){if(d.isAlpha()||"_"===d||"$"===d)return n("(identifier)",x);if(d.isDigit())return"style"===cn||isFinite(Number(x))||o("Bad number '{a}'.",a,r,x),"style"!==cn&&"styleproperty"!==cn&&s.substr(0,1).isAlpha()&&o("Missing space after '{a}'.",a,r,x),"0"===d&&(h=x.substr(1,1),h.isDigit()?"."!==an.id&&"styleproperty"!==cn&&o("Don't use extra leading zeros '{a}'.",a,r,x):!Vt||"x"!==h&&"X"!==h||o("Avoid 0x-. '{a}'.",a,r,x)),"."===x.substr(x.length-1)&&o("A trailing decimal point can be confused with a dot '{a}'.",a,r,x),n("(number)",x);switch(x){case'"':case"'":return l(x);case"//":en||cn&&"script"!==cn?o("Unexpected comment.",a,r):"script"===cn&&/<\s*\//i.test(s)?o("Unexpected </ in comment.",a,r):(Zt.safe||"script"===cn)&&On.test(s)&&o("Dangerous comment.",a,r),s="",an.comment=!0;break;case"/*":for((en||cn&&"script"!==cn&&"style"!==cn&&"styleproperty"!==cn)&&o("Unexpected comment.",a,r),Zt.safe&&On.test(s)&&o("ADsafe comment violation.",a,r);v=s.search(Un),!(v>=0);)e()?Zt.safe&&On.test(s)&&o("ADsafe comment violation.",a,r):c("Unclosed comment.",a,r);r+=v+2,"/"===s.substr(v,1)&&c("Nested comment.",a,r),s=s.substr(v+2),an.comment=!0;break;case"/*members":case"/*member":case"/*jslint":case"/*global":case"*/":return{value:x,type:"special",line:a,character:r,from:i};case"":break;case"/":if("/="===an.id&&c("A regular expression literal can be confused with '/='.",a,i),Qt){for(m=0,p=0,b=0;;){switch(u=!0,d=s.charAt(b),b+=1,d){case"":return void c("Unclosed regular expression.",a,i);case"/":for(m>0&&o("Unescaped '{a}'.",a,i+b,"/"),d=s.substr(0,b-1),y={g:!0,i:!0,m:!0};y[s.charAt(b)]===!0;)y[s.charAt(b)]=!1,b+=1;return r+=b,s=s.substr(b),y=s.charAt(0),("/"===y||"*"===y)&&c("Confusing regular expression.",a,i),n("(regexp)",d);case"\\":d=s.charAt(b)," ">d?o("Unexpected control character in regular expression.",a,i+b):"<"===d&&o("Unexpected escaped character '{a}' in regular expression.",a,i+b,d),b+=1;break;case"(":if(m+=1,u=!1,"?"===s.charAt(b))switch(b+=1,s.charAt(b)){case":":case"=":case"!":b+=1;
break;default:o("Expected '{a}' and instead saw '{b}'.",a,i+b,":",s.charAt(b))}else p+=1;break;case"|":u=!1;break;case")":0===m?o("Unescaped '{a}'.",a,i+b,")"):m-=1;break;case" ":for(y=1;" "===s.charAt(b);)b+=1,y+=1;y>1&&o("Spaces are hard to count. Use {{a}}.",a,i+b,y);break;case"[":d=s.charAt(b),"^"===d&&(b+=1,Zt.regexp&&o("Insecure '{a}'.",a,i+b,d)),y=!1,"]"===d&&(o("Empty class.",a,i+b-1),y=!0);e:do switch(d=s.charAt(b),b+=1,d){case"[":case"^":o("Unescaped '{a}'.",a,i+b,d),y=!0;break;case"-":y?y=!1:(o("Unescaped '{a}'.",a,i+b,"-"),y=!0);break;case"]":y||o("Unescaped '{a}'.",a,i+b-1,"-");break e;case"\\":d=s.charAt(b)," ">d?o("Unexpected control character in regular expression.",a,i+b):"<"===d&&o("Unexpected escaped character '{a}' in regular expression.",a,i+b,d),b+=1,y=!0;break;case"/":o("Unescaped '{a}'.",a,i+b-1,"/"),y=!0;break;case"<":"script"===cn&&(d=s.charAt(b),("!"===d||"/"===d)&&o("HTML confusion in regular expression '<{a}'.",a,i+b,d)),y=!0;break;default:y=!0}while(d);break;case".":Zt.regexp&&o("Insecure '{a}'.",a,i+b,d);break;case"]":case"?":case"{":case"}":case"+":case"*":o("Unescaped '{a}'.",a,i+b,d);break;case"<":"script"===cn&&(d=s.charAt(b),("!"===d||"/"===d)&&o("HTML confusion in regular expression '<{a}'.",a,i+b,d))}if(u)switch(s.charAt(b)){case"?":case"+":case"*":b+=1,"?"===s.charAt(b)&&(b+=1);break;case"{":for(b+=1,d=s.charAt(b),("0">d||d>"9")&&o("Expected a number and instead saw '{a}'.",a,i+b,d),b+=1,_=+d;d=s.charAt(b),!("0">d||d>"9");)b+=1,_=+d+10*_;if(g=_,","===d&&(b+=1,g=1/0,d=s.charAt(b),d>="0"&&"9">=d))for(b+=1,g=+d;d=s.charAt(b),!("0">d||d>"9");)b+=1,g=+d+10*g;"}"!==s.charAt(b)?o("Expected '{a}' and instead saw '{b}'.",a,i+b,"}",d):b+=1,"?"===s.charAt(b)&&(b+=1),_>g&&o("'{a}' should not be greater than '{b}'.",a,i+b,_,g)}}return d=s.substr(0,b-1),r+=b,s=s.substr(b),n("(regexp)",d)}return n("(punctuator)",x);case"<!--":for(b=a,d=r;v=s.indexOf("--"),!(v>=0);)v=s.indexOf("<!"),v>=0&&c("Nested HTML comment.",a,r+v),e()||c("Unclosed HTML comment.",b,d);b=s.indexOf("<!"),b>=0&&v>b&&c("Nested HTML comment.",a,r+b),r+=v,">"!==s[v+2]&&c("Expected -->.",a,r),r+=3,s=s.slice(v+3);break;case"#":if("html"===cn||"styleproperty"===cn){for(;d=s.charAt(0),!(("0">d||d>"9")&&("a">d||d>"f")&&("A">d||d>"F"));)r+=1,s=s.substr(1),x+=d;return 4!==x.length&&7!==x.length&&o("Bad hex color '{a}'.",a,i+b,x),n("(color)",x)}return n("(punctuator)",x);default:if("outer"===cn&&"&"===d){for(r+=1,s=s.substr(1);d=s.charAt(0),r+=1,s=s.substr(1),";"!==d;)d>="0"&&"9">=d||d>="a"&&"z">=d||"#"===d||c("Bad entity",a,i+b,r);break}return n("(punctuator)",x)}}else{for(x="",d="";s&&"!">s;)s=s.substr(1);if(s){if("html"===cn)return f=s.charAt(0),s=s.substr(1),n("(error)",f);c("Unexpected '{a}'.",a,r,s.substr(0,1))}}}}}}();jt=[at,function(){for(;;)if(Wt.identifier)switch(Wt.value.toLowerCase()){case"url":at();break;case"expression":a("Unexpected expression '{a}'.",Wt,Wt.value),f();break;default:f()}else{if(";"===Wt.id||"!"===Wt.id||"(end)"===Wt.id||"}"===Wt.id)return!0;f()}}],Kt=["none","hidden","dotted","dashed","solid","double","ridge","inset","outset"],Dt=["auto","always","avoid","left","right"],Lt=["auto","hidden","scroll","visible"],Rt={background:[!0,"background-attachment","background-color","background-image","background-position","background-repeat"],"background-attachment":["scroll","fixed"],"background-color":["transparent",H],"background-image":["none",at],"background-position":[2,[Q,"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":H,"border-bottom-style":Kt,"border-bottom-width":Y,"border-collapse":["collapse","separate"],"border-color":["transparent",4,H],"border-left":[!0,"border-left-color","border-left-style","border-left-width"],"border-left-color":H,"border-left-style":Kt,"border-left-width":Y,"border-right":[!0,"border-right-color","border-right-style","border-right-width"],"border-right-color":H,"border-right-style":Kt,"border-right-width":Y,"border-spacing":[2,Q],"border-style":[4,Kt],"border-top":[!0,"border-top-color","border-top-style","border-top-width"],"border-top-color":H,"border-top-style":Kt,"border-top-width":Y,"border-width":[4,Y],bottom:[Q,"auto"],"caption-side":["bottom","left","right","top"],clear:["both","left","none","right"],clip:[it,"auto"],color:H,content:["open-quote","close-quote","no-open-quote","no-close-quote",Z,at,rt,tt],"counter-increment":[W,"none"],"counter-reset":[W,"none"],cursor:[at,"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"],"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":nt,"font-size":["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller",Q],"font-size-adjust":["none",X],"font-stretch":["normal","wider","narrower","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded"],"font-style":["normal","italic","oblique"],"font-variant":["normal","small-caps"],"font-weight":["normal","bold","bolder","lighter",X],height:[Q,"auto"],left:[Q,"auto"],"letter-spacing":["normal",Q],"line-height":["normal",G],"list-style":[!0,"list-style-image","list-style-position","list-style-type"],"list-style-image":["none",at],"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"],margin:[4,et],"margin-bottom":et,"margin-left":et,"margin-right":et,"margin-top":et,"marker-offset":[Q,"auto"],"max-height":[Q,"none"],"max-width":[Q,"none"],"min-height":Q,"min-width":Q,opacity:X,outline:[!0,"outline-color","outline-style","outline-width"],"outline-color":["invert",H],"outline-style":["dashed","dotted","double","groove","inset","none","outset","ridge","solid"],"outline-width":Y,overflow:Lt,"overflow-x":Lt,"overflow-y":Lt,padding:[4,Q],"padding-bottom":Q,"padding-left":Q,"padding-right":Q,"padding-top":Q,"page-break-after":Dt,"page-break-before":Dt,position:["absolute","fixed","relative","static"],quotes:[8,Z],right:[Q,"auto"],"table-layout":["auto","fixed"],"text-align":["center","justify","left","right"],"text-decoration":["none","underline","overline","line-through","blink"],"text-indent":Q,"text-shadow":["none",4,[H,Q]],"text-transform":["capitalize","uppercase","lowercase","none"],top:[Q,"auto"],"unicode-bidi":["normal","embed","bidi-override"],"vertical-align":["baseline","bottom","sub","super","top","text-top","middle","text-bottom",Q],visibility:["visible","hidden","collapse"],"white-space":["normal","nowrap","pre","pre-line","pre-wrap","inherit"],width:[Q,"auto"],"word-spacing":["normal",Q],"word-wrap":["break-word","normal"],"z-index":["auto",X]},S("(number)",q),S("(string)",q),An["(identifier)"]={type:"(identifier)",lbp:0,identifier:!0,nud:function(){var e,t=this.value,n=Yt[t];if("function"==typeof n?n=void 0:"boolean"==typeof n&&(e=Ut,Ut=Nt[0],l(t,"var"),n=Ut,Ut=e),Ut===n)switch(Ut[t]){case"unused":Ut[t]="var";break;case"label":a("'{a}' is a statement label.",an,t)}else if(Ut["(global)"])Zt.undef&&"boolean"!==Ht[t]&&a("'{a}' is not defined.",an,t),J(an);else switch(Ut[t]){case"closure":case"function":case"var":case"unused":a("'{a}' used out of scope.",an,t);break;case"label":a("'{a}' is a statement label.",an,t);break;case"outer":case"global":break;default:if(n===!0)Ut[t]=!0;else if(null===n)a("'{a}' is not allowed.",an,t),J(an);else if("object"!=typeof n)Zt.undef?a("'{a}' is not defined.",an,t):Ut[t]=!0,J(an);else switch(n[t]){case"function":case"var":case"unused":n[t]="closure",Ut[t]=n["(global)"]?"global":"outer";break;case"closure":case"parameter":Ut[t]=n["(global)"]?"global":"outer";break;case"label":a("'{a}' is a statement label.",an,t)}}return this},led:function(){s("Expected an operator and instead saw '{a}'.",Wt,Wt.value)}},S("(regexp)",function(){return this}),w("(endline)"),w("(begin)"),w("(end)").reach=!0,w("</").reach=!0,w("<!"),w("<!--"),w("-->"),w("(error)").reach=!0,w("}").reach=!0,w(")"),w("]"),w('"').reach=!0,w("'").reach=!0,w(";"),w(":").reach=!0,w(","),w("#"),w("@"),O("else"),O("case").reach=!0,O("catch"),O("default").reach=!0,O("finally"),C("arguments"),C("eval"),C("false"),C("Infinity"),C("NaN"),C("null"),C("this"),C("true"),C("undefined"),D("=","assign",20),D("+=","assignadd",20),D("-=","assignsub",20),D("*=","assignmult",20),D("/=","assigndiv",20).nud=function(){s("A regular expression literal can be confused with '/='.")},D("%=","assignmod",20),U("&=","assignbitand",20),U("|=","assignbitor",20),U("^=","assignbitxor",20),U("<<=","assignshiftleft",20),U(">>=","assignshiftright",20),U(">>>=","assignshiftrightunsigned",20),R("?",function(e,t){return t.left=e,t.right=p(10),f(":"),t["else"]=p(10),t},30),R("||","or",40),R("&&","and",50),L("|","bitor",70),L("^","bitxor",80),L("&","bitand",90),j("==",function(e,t){return Zt.eqeqeq?a("Expected '{a}' and instead saw '{b}'.",this,"===","=="):K(e)?a("Use '{a}' to compare with '{b}'.",this,"===",e.value):K(t)&&a("Use '{a}' to compare with '{b}'.",this,"===",t.value),this}),j("==="),j("!=",function(e,t){return Zt.eqeqeq?a("Expected '{a}' and instead saw '{b}'.",this,"!==","!="):K(e)?a("Use '{a}' to compare with '{b}'.",this,"!==",e.value):K(t)&&a("Use '{a}' to compare with '{b}'.",this,"!==",t.value),this}),j("!=="),j("<"),j(">"),j("<="),j(">="),L("<<","shiftleft",120),L(">>","shiftright",120),L(">>>","shiftrightunsigned",120),R("in","in",120),R("instanceof","instanceof",120),R("+",function(e,t){var n=p(130);return e&&n&&"(string)"===e.id&&"(string)"===n.id?(e.value+=n.value,e.character=n.character,Bn.test(e.value)&&a("JavaScript URL.",e),e):(t.left=e,t.right=n,t)},130),A("+","num"),R("-","sub",130),A("-","neg"),R("*","mult",140),R("/","div",140),R("%","mod",140),N("++","postinc"),A("++","preinc"),An["++"].exps=!0,N("--","postdec"),A("--","predec"),An["--"].exps=!0,A("delete",function(){var e=p(0);return(!e||"."!==e.id&&"["!==e.id)&&a("Expected '{a}' and instead saw '{b}'.",Wt,".",Wt.value),this.first=e,this}).exps=!0,A("~",function(){return Zt.bitwise&&a("Unexpected '{a}'.",this,"~"),p(150),this}),A("!",function(){return this.right=p(150),this.arity="unary",dn[this.right.id]===!0&&a("Confusing use of '{a}'.",this,"!"),this}),A("typeof","typeof"),A("new",function(){var e,t=p(155);if(t&&"function"!==t.id)if(t.identifier)switch(t["new"]=!0,t.value){case"Object":a("Use the object literal notation {}.",an);break;case"Array":return"("!==Wt.id?a("Use the array literal notation [].",an):(f("("),")"===Wt.id?a("Use the array literal notation [].",an):(e=p(0),t.dimension=e,("(number)"===e.id&&/[.+\-Ee]/.test(e.value)||"-"===e.id&&!e.right||"(string)"===e.id||"["===e.id||"{"===e.id||"true"===e.id||"false"===e.id||"null"===e.id||"undefined"===e.id||"Infinity"===e.id)&&a("Use the array literal notation [].",an),")"!==Wt.id&&s("Use the array literal notation [].",an)),f(")")),this.first=t,this;case"Number":case"String":case"Boolean":case"Math":case"JSON":a("Do not use {a} as a constructor.",an,t.value);break;case"Function":Zt.evil||a("The Function constructor is eval.");break;case"Date":case"RegExp":break;default:"function"!==t.id&&(e=t.value.substr(0,1),Zt.newcap&&("A">e||e>"Z")&&a("A constructor name should start with an uppercase letter.",an))}else"."!==t.id&&"["!==t.id&&"("!==t.id&&a("Bad constructor.",an);else a("Weird construction. Delete 'new'.",this);return h(an,Wt),"("!==Wt.id&&a("Missing '()' invoking a constructor."),this.first=t,this}),An["new"].exps=!0,R(".",function(e,t){h(Gt,an);var n=M();if("string"==typeof n&&$(n),t.left=e,t.right=n,Zt.evil||!e||"document"!==e.value||"write"!==n&&"writeln"!==n?Zt.adsafe&&e&&"ADSAFE"===e.value&&("id"===n||"lib"===n?a("ADsafe violation.",t):"go"===n&&("script"!==cn?a("ADsafe violation.",t):(St||"("!==Wt.id||"(string)"!==d(0).id||d(0).value!==Tt||","!==d(1).id)&&s("ADsafe violation: go.",t),St=!0,At=!1)):a("document.write can be a form of eval.",e),Zt.evil||"eval"!==n&&"execScript"!==n){if(Zt.safe)for(;fn[n]===!0&&a("ADsafe restricted word '{a}'.",an,n),"boolean"==typeof Ht[e.value]&&"("!==Wt.id;){if(Tn[n]===!0){"."===Wt.id&&a("ADsafe violation.",t);break}if("."!==Wt.id){a("ADsafe violation.",t);break}f("."),an.left=t,an.right=n,t=an,n=M(),"string"==typeof n&&$(n)}}else a("eval is evil.");return t},160,!0),R("(",function(e,t){h(Gt,an),m();var n=0,r=[];if(e&&("(identifier)"===e.type?e.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&"Number"!==e.value&&"String"!==e.value&&"Boolean"!==e.value&&"Date"!==e.value&&("Math"===e.value?a("Math is not a function.",e):Zt.newcap&&a("Missing 'new' prefix when invoking a constructor.",e)):"."===e.id&&Zt.safe&&"Math"===e.left.value&&"random"===e.right&&a("ADsafe violation.",e)),")"!==Wt.id)for(;r[r.length]=p(10),n+=1,","===Wt.id;)y();return f(")"),Zt.immed&&"function"===e.id&&")"!==Wt.id&&a("Wrap the entire immediate function invocation in parens.",t),m(Gt,an),"object"==typeof e&&("parseInt"===e.value&&1===n&&a("Missing radix parameter.",e),Zt.evil||("eval"===e.value||"Function"===e.value||"execScript"===e.value?a("eval is evil.",e):!r[0]||"(string)"!==r[0].id||"setTimeout"!==e.value&&"setInterval"!==e.value||a("Implied eval is evil. Pass a function instead of a string.",e)),e.identifier||"."===e.id||"["===e.id||"("===e.id||"&&"===e.id||"||"===e.id||"?"===e.id||a("Bad invocation.",e)),t.left=e,t},155,!0).exps=!0,A("(",function(){m();var e=p(0);return f(")",this),m(Gt,an),Zt.immed&&"function"===e.id&&("("===Wt.id?a("Move the invocation into the parens that contain the function.",Wt):a("Do not wrap function literals in parens unless they are to be immediately invoked.",this)),e}),R("[",function(e,t){m();var n,r=p(0);return r&&"(string)"===r.type?(Zt.safe&&fn[r.value]===!0?a("ADsafe restricted word '{a}'.",t,r.value):Zt.evil||"eval"!==r.value&&"execScript"!==r.value?!Zt.safe||"_"!==r.value.charAt(0)&&"-"!==r.value.charAt(0)||a("ADsafe restricted subscript '{a}'.",t,r.value):a("eval is evil.",t),$(r.value),!Zt.sub&&Nn.test(r.value)&&(n=An[r.value],n&&n.reserved||a("['{a}'] is better written in dot notation.",r,r.value))):(!r||"(number)"!==r.type||r.value<0)&&Zt.safe&&a("ADsafe subscripting."),f("]",t),m(Gt,an),t.left=e,t.right=r,t},160,!0),A("[",function(){var e=an.line!==Wt.line;for(this.first=[],e&&(Ft+=Zt.indent,Wt.from===Ft+Zt.indent&&(Ft+=Zt.indent));"(end)"!==Wt.id;){for(;","===Wt.id;)a("Extra comma."),f(",");if("]"===Wt.id)break;if(e&&an.line!==Wt.line&&b(),this.first.push(p(10)),","!==Wt.id)break;if(y(),"]"===Wt.id){a("Extra comma.",an);break}}return e&&(Ft-=Zt.indent,b()),f("]",this),this},160),function(e){e.nud=function(){var e,t,n,r,i,o,c={};for(e=an.line!==Wt.line,e&&(Ft+=Zt.indent,Wt.from===Ft+Zt.indent&&(Ft+=Zt.indent));"}"!==Wt.id;){if(e&&b(),"get"===Wt.value&&":"!==d().id)f("get"),Zt.es5||s("get/set are ES5 features."),n=bt(),n||s("Missing property name."),o=Wt,h(an,Wt),t=yt(n),Ut["(loopage)"]&&a("Don't make functions within a loop.",o),i=t["(params)"],i&&a("Unexpected parameter '{a}' in get {b} function.",o,i[0],n),h(an,Wt),f(","),b(),f("set"),r=bt(),n!==r&&s("Expected {a} and instead saw {b}.",an,n,r),o=Wt,h(an,Wt),t=yt(n),i=t["(params)"],i&&1===i.length&&"value"===i[0]||a("Expected (value) in set {a} function.",o,n);else{if(n=bt(),"string"!=typeof n)break;f(":"),g(an,Wt),p(10)}if(c[n]===!0&&a("Duplicate member '{a}'.",Wt,n),c[n]=!0,$(n),","!==Wt.id)break;y(),","===Wt.id?a("Extra comma.",an):"}"===Wt.id&&a("Extra comma.",an)}return e&&(Ft-=Zt.indent,b()),f("}",this),this},e.fud=function(){s("Expected to see a statement and instead saw a block.",an)}}(w("{")),E("var",xt).exps=!0,k("function",function(){Pt&&a("Function statements cannot be placed in blocks. Use a function expression or move the statement to the top of the outer function.",an);var e=M();return h(an,Wt),l(e,"unused"),yt(e),"("===Wt.id&&Wt.line===an.line&&s("Function statements are not invocable. Wrap the whole function invocation in parens."),this}),A("function",function(){var e=B();return e?h(an,Wt):g(an,Wt),yt(e),Ut["(loopage)"]&&a("Don't make functions within a loop."),this}),k("if",function(){var e=Wt;return f("("),g(this,e),m(),p(20),"="===Wt.id&&(a("Expected a conditional expression and instead saw an assignment."),f("="),p(20)),f(")",e),m(Gt,an),z(!0),"else"===Wt.id&&(g(an,Wt),f("else"),"if"===Wt.id||"switch"===Wt.id?P(!0):z(!0)),this}),k("try",function(){var e,t,n;return Zt.adsafe&&a("ADsafe try violation.",this),z(!1),"catch"===Wt.id&&(f("catch"),g(an,Wt),f("("),n=Yt,Yt=Object.create(n),t=Wt.value,"(identifier)"!==Wt.type?a("Expected an identifier and instead saw '{a}'.",Wt,t):l(t,"exception"),f(),f(")"),z(!1),e=!0,Yt=n),"finally"===Wt.id?(f("finally"),void z(!1)):(e||s("Expected '{a}' and instead saw '{b}'.",Wt,"catch",Wt.value),this)}),k("while",function(){var e=Wt;return Ut["(breakage)"]+=1,Ut["(loopage)"]+=1,f("("),g(this,e),m(),p(20),"="===Wt.id&&(a("Expected a conditional expression and instead saw an assignment."),f("="),p(20)),f(")",e),m(Gt,an),z(!0),Ut["(breakage)"]-=1,Ut["(loopage)"]-=1,this}).labelled=!0,O("with"),k("switch",function(){var e=Wt,t=!1;for(Ut["(breakage)"]+=1,f("("),g(this,e),m(),this.condition=p(20),f(")",e),m(Gt,an),g(an,Wt),e=Wt,f("{"),g(an,Wt),Ft+=Zt.indent,this.cases=[];;)switch(Wt.id){case"case":switch(Ut["(verb)"]){case"break":case"case":case"continue":case"return":case"switch":case"throw":break;default:a("Expected a 'break' statement before 'case'.",an)}b(-Zt.indent),f("case"),this.cases.push(p(20)),t=!0,f(":"),Ut["(verb)"]="case";break;case"default":switch(Ut["(verb)"]){case"break":case"continue":case"return":case"throw":break;default:a("Expected a 'break' statement before 'default'.",an)}b(-Zt.indent),f("default"),t=!0,f(":");break;case"}":return Ft-=Zt.indent,b(),f("}",e),(1===this.cases.length||"true"===this.condition.id||"false"===this.condition.id)&&a("This 'switch' should be an 'if'.",this),Ut["(breakage)"]-=1,void(Ut["(verb)"]=void 0);case"(end)":return void s("Missing '{a}'.",Wt,"}");default:if(t)switch(an.id){case",":return void s("Each value should have its own case label.");case":":V();break;default:s("Missing ':' on a case clause.",an)}else s("Expected '{a}' and instead saw '{b}'.",Wt,"case",Wt.value)}}).labelled=!0,E("debugger",function(){return Zt.debug||a("All 'debugger' statements should be removed."),this}).exps=!0,function(){var e=E("do",function(){Ut["(breakage)"]+=1,Ut["(loopage)"]+=1,this.first=z(!0),f("while");var e=Wt;return g(an,e),f("("),m(),p(20),"="===Wt.id&&(a("Expected a conditional expression and instead saw an assignment."),f("="),p(20)),f(")",e),m(Gt,an),Ut["(breakage)"]-=1,Ut["(loopage)"]-=1,this});e.labelled=!0,e.exps=!0}(),k("for",function(){var e,t=Zt.forin,n=Wt;if(Ut["(breakage)"]+=1,Ut["(loopage)"]+=1,f("("),g(this,n),m(),"in"===d("var"===Wt.id?1:0).id){if("var"===Wt.id)f("var"),xt(!0);else{switch(Ut[Wt.value]){case"unused":Ut[Wt.value]="var";break;case"var":break;default:a("Bad for in variable '{a}'.",Wt,Wt.value)}f()}return f("in"),p(20),f(")",n),e=z(!0),!t&&(e.length>1||"object"!=typeof e[0]||"if"!==e[0].value)&&a("The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",this),Ut["(breakage)"]-=1,Ut["(loopage)"]-=1,this}if(";"!==Wt.id)if("var"===Wt.id)f("var"),xt();else for(;p(0,"for"),","===Wt.id;)y();if(_(an),f(";"),";"!==Wt.id&&(p(20),"="===Wt.id&&(a("Expected a conditional expression and instead saw an assignment."),f("="),p(20))),_(an),f(";"),";"===Wt.id&&s("Expected '{a}' and instead saw '{b}'.",Wt,")",";"),")"!==Wt.id)for(;p(0,"for"),","===Wt.id;)y();return f(")",n),m(Gt,an),z(!0),Ut["(breakage)"]-=1,Ut["(loopage)"]-=1,this}).labelled=!0,E("break",function(){var e=Wt.value;return 0===Ut["(breakage)"]&&a("Unexpected '{a}'.",Wt,this.value),_(this),";"!==Wt.id&&an.line===Wt.line&&("label"!==Ut[e]?a("'{a}' is not a statement label.",Wt,e):Yt[e]!==Ut&&a("'{a}' is out of scope.",Wt,e),this.first=Wt,f()),I("break"),this}).exps=!0,E("continue",function(){var e=Wt.value;return 0===Ut["(breakage)"]&&a("Unexpected '{a}'.",Wt,this.value),_(this),";"!==Wt.id?an.line===Wt.line&&("label"!==Ut[e]?a("'{a}' is not a statement label.",Wt,e):Yt[e]!==Ut&&a("'{a}' is out of scope.",Wt,e),this.first=Wt,f()):Ut["(loopage)"]||a("Unexpected '{a}'.",Wt,this.value),I("continue"),this}).exps=!0,E("return",function(){return _(this),"(regexp)"===Wt.id&&a("Wrap the /regexp/ literal in parens to disambiguate the slash operator."),";"===Wt.id||Wt.reach||(g(an,Wt),this.first=p(20)),I("return"),this}).exps=!0,E("throw",function(){return _(this),g(an,Wt),this.first=p(20),I("throw"),this}).exps=!0,O("void"),O("class"),O("const"),O("enum"),O("export"),O("extends"),O("import"),O("super"),O("let"),O("yield"),O("implements"),O("interface"),O("package"),O("private"),O("protected"),O("public"),O("static");var $n=function(e,t){var n,i;if(JSLINT.errors=[],Ht=Object.create(kn),t){if(n=t.predef,n instanceof Array)for(i=0;i<n.length;i+=1)Ht[n[i]]=!0;t.adsafe&&(t.safe=!0),t.safe&&(t.browser=!1,t.css=!1,t.debug=!1,t.devel=!1,t.eqeqeq=!0,t.evil=!1,t.forin=!1,t.nomen=!0,t.on=!1,t.rhino=!1,t.safe=!0,t.windows=!1,t.strict=!0,t.sub=!1,t.undef=!0,t.widget=!1,Ht.Date=null,Ht.eval=null,Ht.Function=null,Ht.Object=null,Ht.ADSAFE=!1,Ht.lib=!1),Zt=t}else Zt={};if(Zt.indent=Zt.indent||4,Zt.maxerr=Zt.maxerr||50,Tt="",At=!1,St=!1,Ct={},Zt.approved)for(i=0;i<Zt.approved.length;i+=1)Ct[Zt.approved[i]]=Zt.approved[i];else Ct.test="test";for(rn="",i=0;i<Zt.indent;i+=1)rn+=" ";Ft=1,Bt=Object.create(Ht),Yt=Bt,Ut={"(global)":!0,"(name)":"(global)","(scope)":Yt,"(breakage)":0,"(loopage)":0},Nt=[Ut],Mt={},on=[],en=!1,cn=!1,tn=null,$t={},Jt=null,It={},Pt=!1,qt=[],Vt=!1,sn=0,qn.init(e),Qt=!0,nn=!1,Gt=an=Wt=An["(begin)"],r();try{if(f(),"<"===Wt.value.charAt(0))vt(),Zt.adsafe&&!St&&a("ADsafe violation: Missing ADSAFE.go.",this);else switch(Wt.id){case"{":case"[":Zt.laxbreak=!0,Vt=!0,wt();break;case"@":case"*":case"#":case".":case":":cn="style",f(),"@"===an.id&&Wt.identifier&&"charset"===Wt.value&&1===an.line&&1===an.from||s('A css file should begin with @charset "UTF-8";'),f(),"(string)"!==Wt.type&&"UTF-8"!==Wt.value&&s('A css file should begin with @charset "UTF-8";'),f(),f(";"),ft();break;default:Zt.adsafe&&Zt.fragment&&s("Expected '{a}' and instead saw '{b}'.",Wt,"<div>",Wt.value),V("lib")}f("(end)")}catch(o){o&&JSLINT.errors.push({reason:o.message,line:o.line||Wt.line,character:o.character||Wt.from},null)}return 0===JSLINT.errors.length};return $n.data=function(){var e,n,r,i,a,o,s,c={functions:[]},l=[],u=[],d=[];$n.errors.length&&(c.errors=$n.errors),Vt&&(c.json=!0);for(o in It)t(It,o)&&l.push({name:o,line:It[o]});for(l.length>0&&(c.implieds=l),on.length>0&&(c.urls=on),n=kt(Yt),n.length>0&&(c.globals=n),i=1;i<Nt.length;i+=1){for(r=Nt[i],e={},a=0;a<_n.length;a+=1)e[_n[a]]=[];for(o in r)t(r,o)&&"("!==o.charAt(0)&&(s=r[o],Et(e[s])&&(e[s].push(o),"unused"===s&&d.push({name:o,line:r["(line)"],"function":r["(name)"]})));for(a=0;a<_n.length;a+=1)0===e[_n[a]].length&&delete e[_n[a]];e.name=r["(name)"],e.param=r["(params)"],e.line=r["(line)"],e.last=r["(last)"],c.functions.push(e)}d.length>0&&(c.unused=d),u=[];for(o in $t)if("number"==typeof $t[o]){c.member=$t;break}return c},$n.report=function(e){function t(e,t){var n,r,i;if(t){for(h.push("<div><i>"+e+"</i> "),t=t.sort(),r=0;r<t.length;r+=1)t[r]!==i&&(i=t[r],h.push((n?", ":"")+i),n=!0);h.push("</div>")}}var n,r,i,a,o,s,c,l,u,d=$n.data(),f=[],p="",h=[];if(d.errors||d.implieds||d.unused){if(i=!0,h.push("<div id=errors><i>Error:</i>"),d.errors)for(o=0;o<d.errors.length;o+=1)n=d.errors[o],n&&(r=n.evidence||"",h.push("<p>Problem"+(isFinite(n.line)?" at line "+n.line+" character "+n.character:"")+": "+n.reason.entityify()+"</p><p class=evidence>"+(r&&(r.length>80?r.slice(0,77)+"...":r).entityify())+"</p>"));if(d.implieds){for(u=[],o=0;o<d.implieds.length;o+=1)u[o]="<code>"+d.implieds[o].name+"</code>&nbsp;<i>"+d.implieds[o].line+"</i>";h.push("<p><i>Implied global:</i> "+u.join(", ")+"</p>")}if(d.unused){for(u=[],o=0;o<d.unused.length;o+=1)u[o]="<code><u>"+d.unused[o].name+"</u></code>&nbsp;<i>"+d.unused[o].line+"</i> <code>"+d.unused[o]["function"]+"</code>";h.push("<p><i>Unused variable:</i> "+u.join(", ")+"</p>")}d.json&&h.push("<p>JSON: bad.</p>"),h.push("</div>")}if(!e){for(h.push("<br><div id=functions>"),d.urls&&t("URLs<br>",d.urls,"<br>"),h.push("style"===cn?"<p>CSS.</p>":d.json&&!i?"<p>JSON: good.</p>":d.globals?"<div><i>Global</i> "+d.globals.sort().join(", ")+"</div>":"<div><i>No new global variables introduced.</i></div>"),o=0;o<d.functions.length;o+=1)a=d.functions[o],h.push("<br><div class=function><i>"+a.line+"-"+a.last+"</i> "+(a.name||"")+"("+(a.param?a.param.join(", "):"")+")</div>"),t("<big><b>Unused</b></big>",a.unused),t("Closure",a.closure),t("Variable",a["var"]),t("Exception",a.exception),t("Outer",a.outer),t("Global",a.global),t("Label",a.label);if(d.member){if(f=kt(d.member),f.length){for(f=f.sort(),p="<br><pre id=members>/*members ",c=10,o=0;o<f.length;o+=1)s=f[o],l=s.name(),c+l.length>72&&(h.push(p+"<br>"),p="    ",c=1),c+=l.length+2,1===d.member[s]&&(l="<i>"+l+"</i>"),o<f.length-1&&(l+=", "),p+=l;h.push(p+"<br>*/</pre>")}h.push("</div>")}}return h.join("")},$n.jslint=$n,$n.edition="2010-04-06",$n}();define("plugins/languages/json/jslint",function(){}),define("plugins/languages/json/validator",["i18n!orion/jslint/nls/messages","orion/i18nUtil","plugins/languages/json/jslint"],function(e,t){function n(e){return!this.project||this.project&&0!==e.location.indexOf(this.project.Location)?this.getFileClient().getProject(e.location,{names:[u]}).then(function(e){return this.project=e,r.call(this,this.project.Location,u)}.bind(this)):r.call(this,this.project.Location,u)}function r(e,t){var n=this.project?this.project.Location:e;n.lastIndexOf("/")!==n.length-1&&(n+="/");var r=n+t;return this.getFileClient().read(r,!1,!1,{readIfExists:!0}).then(function(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return null}return null},function(){return null})}function i(e){this.registry=e,this.project=null,this.fileClient=null}function a(e,t){return JSLINT(e,t),JSLINT.data()}function o(e,t){var n,r=a(t,e),i=[];if(r.errors){var o=r.errors;for(n=0;n<o.length;n++){var l=o[n];if(l){var u=l.character-1,d=u+1;if(l.evidence){var f=l.evidence.substring(u).search(/.\b/);f>-1&&(d+=f)}l.description=c(l),l.start=l.character,l.end=d,l=s(l),l&&i.push(l)}}}if(r.functions){var p,h=r.functions;for(n=0;n<h.length;n++){var m=h[n],g=m.unused;if(g&&0!==g.length){p||(p=t.split(/\r?\n/));for(var v='"'===m.name[0],b=v?m.name.substring(1,m.name.length-1):m.name,_=p[m.line-1],y=0;y<g.length;y++){var x=_.indexOf(b),w=v?_.indexOf("function",x):_.lastIndexOf("function",x);-1!==w&&i.push({reason:"Function declares unused variable '"+g[y]+"'.",line:m.line,character:w+1,end:w+"function".length,severity:"warning"})}}}}return{problems:i}}function s(e){var t=[["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"],n=e.description;if(-1===n.indexOf("Dangerous comment")){for(var r=0;r<t.length;r++){var i=t[r],a="string"==typeof i?i:i[0],o="string"==typeof i?null:i[1];-1!==n.indexOf(a)&&o&&(e.description=o)}return"Unexpected comma."===e.raw&&(e.id="no-comma-dangle"),e}return null}function c(n){var r=n.raw;if(r){if("string"==typeof e[r])return r.match(/\{a\}|\{b\}|\{c\}|\{d\}/)?t.formatMessage(e[r],n.a,n.b,n.c,n.d):e[r]}else{var i=/(.*)\(([0-9]*)\%/.exec(n.reason);if(i)return t.formatMessage(e[i[1].trim()],i[2]);if(e[n.reason.trim()])return t.formatMessage(e[n.reason.trim()],"100")}return n.reason}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,mixed_spaces_tabs:!1},u=".jslintrc";return i.prototype.getFileClient=function(){return this.fileClient||(this.fileClient=this.registry.getService("orion.core.file.client")),this.fileClient},i.prototype.computeProblems=function(e){return e.getFileMetadata().then(function(t){return n.call(this,t).then(function(t){var n=t||l;return e.getText().then(function(e){return o(n,e)})})}.bind(this))},i}),define("plugins/languages/json/beautifier",[],function(){function e(e){return 10===e||13===e||8232===e||8233==e}function t(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}}function n(e,n){return 65>e?36===e:91>e?!0:97>e?95===e:123>e?!0:65535>=e?e>=170&&c.test(String.fromCharCode(e)):n===!1?!1:t(e,u)}function r(e,n){return 48>e?36===e:58>e?!0:65>e?!1:91>e?!0:97>e?95===e:123>e?!0:65535>=e?e>=170&&l.test(String.fromCharCode(e)):n===!1?!1:t(e,u)||t(e,d)}function i(t,i){function o(e,t){for(var n=0;n<t.length;n+=1)if(t[n]===e)return!0;return!1}function s(e){return e.replace(/^\s+|\s+$/g,"")}function c(e){return e.replace(/^\s+/g,"")}function l(e){e=e||h.before_newline;var t=Object.values(h);if(!o(e,t))throw new Error("Invalid Option Value: The option 'operator_position' must be one of the following values\n"+t+"\nYou passed in: '"+e+"'");return e}function u(t,n){"use strict";function r(e,t){var n=0;e&&(n=e.indentation_level,!W.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level));var r={mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:e?e.line_indent_level:n,start_line_index:W.get_line_number(),ternary_depth:0};return r}function i(e){var t=e.newlines,n=at.keep_array_indentation&&E(et.mode);if(n)for(var r=0;t>r;r+=1)v(r>0);else if(at.max_preserve_newlines&&t>at.max_preserve_newlines&&(t=at.max_preserve_newlines),at.preserve_newlines&&e.newlines>1){v();for(var i=1;t>i;i+=1)v(!0)}H=e,it[H.type]()}function u(e){e=e.replace(acorn.allLineBreaks,"\n");for(var t=[],n=e.indexOf("\n");-1!==n;)t.push(e.substring(0,n)),e=e.substring(n+1),n=e.indexOf("\n");return e.length&&t.push(e),t}function d(e){if(e=void 0===e?!1:e,!W.just_added_newline()){var t=at.preserve_newlines&&H.wanted_newline||e,n=o(et.last_text,Z.positionable_operators)||o(H.text,Z.positionable_operators);if(n){var r=o(et.last_text,Z.positionable_operators)&&o(at.operator_position,m)||o(H.text,Z.positionable_operators);t=t&&r}if(t)v(!1,!0);else if(at.wrap_line_length){if("TK_RESERVED"===Q&&o(et.last_text,lt))return;var i=W.current_line.get_character_count()+H.text.length+(W.space_before_token?1:0);i>=at.wrap_line_length&&v(!1,!0)}}}function v(e,t){if(!t&&";"!==et.last_text&&","!==et.last_text&&"="!==et.last_text&&"TK_OPERATOR"!==Q)for(;et.mode===g.Statement&&!et.if_block&&!et.do_block;)T();W.add_new_line(e)&&(et.multiline_frame=!0)}function b(){W.just_added_newline()&&(at.keep_array_indentation&&E(et.mode)&&H.wanted_newline?(W.current_line.push(H.whitespace_before),W.space_before_token=!1):W.set_indent(et.indentation_level)&&(et.line_indent_level=et.indentation_level))}function _(e){if(W.raw)return void W.add_raw_token(H);if(at.comma_first&&"TK_COMMA"===Q&&W.just_added_newline()&&","===W.previous_line.last()){var t=W.previous_line.pop();W.previous_line.is_empty()&&(W.previous_line.push(t),W.trim(!0),W.current_line.pop(),W.trim()),b(),W.add_token(","),W.space_before_token=!0
}e=e||H.text,b(),W.add_token(e)}function y(){et.indentation_level+=1}function x(){et.indentation_level>0&&(!et.parent||et.indentation_level>et.parent.indentation_level)&&(et.indentation_level-=1)}function w(e){et?(nt.push(et),tt=et):tt=r(null,e),et=r(tt,e)}function E(e){return e===g.ArrayLiteral}function k(e){return o(e,[g.Expression,g.ForInitializer,g.Conditional])}function T(){nt.length>0&&(tt=et,et=nt.pop(),tt.mode===g.Statement&&W.remove_redundant_indentation(tt))}function A(){return et.parent.mode===g.ObjectLiteral&&et.mode===g.Statement&&(":"===et.last_text&&0===et.ternary_depth||"TK_RESERVED"===Q&&o(et.last_text,["get","set"]))}function S(){return"TK_RESERVED"===Q&&o(et.last_text,["var","let","const"])&&"TK_WORD"===H.type||"TK_RESERVED"===Q&&"do"===et.last_text||"TK_RESERVED"===Q&&o(et.last_text,["return","throw"])&&!H.wanted_newline||"TK_RESERVED"===Q&&"else"===et.last_text&&("TK_RESERVED"!==H.type||"if"!==H.text)||"TK_END_EXPR"===Q&&(tt.mode===g.ForInitializer||tt.mode===g.Conditional)||"TK_WORD"===Q&&et.mode===g.BlockStatement&&!et.in_case&&"--"!==H.text&&"++"!==H.text&&"function"!==G&&"TK_WORD"!==H.type&&"TK_RESERVED"!==H.type||et.mode===g.ObjectLiteral&&(":"===et.last_text&&0===et.ternary_depth||"TK_RESERVED"===Q&&o(et.last_text,["get","set"]))?(w(g.Statement),y(),"TK_RESERVED"===Q&&o(et.last_text,["var","let","const"])&&"TK_WORD"===H.type&&(et.declaration_statement=!0),A()||d("TK_RESERVED"===H.type&&o(H.text,["do","for","if","while"])),!0):!1}function O(e,t){for(var n=0;n<e.length;n++){var r=s(e[n]);if(r.charAt(0)!==t)return!1}return!0}function C(e,t){for(var n,r=0,i=e.length;i>r;r++)if(n=e[r],n&&0!==n.indexOf(t))return!1;return!0}function R(e){return o(e,["case","return","do","if","throw","else"])}function j(e){var t=X+(e||0);return 0>t||t>=ot.length?null:ot[t]}function K(){S();var e=g.Expression;if("["===H.text){if("TK_WORD"===Q||")"===et.last_text)return"TK_RESERVED"===Q&&o(et.last_text,Z.line_starters)&&(W.space_before_token=!0),w(e),_(),y(),void(at.space_in_paren&&(W.space_before_token=!0));e=g.ArrayLiteral,E(et.mode)&&("["===et.last_text||","===et.last_text&&("]"===G||"}"===G))&&(at.keep_array_indentation||v())}else"TK_RESERVED"===Q&&"for"===et.last_text?e=g.ForInitializer:"TK_RESERVED"===Q&&o(et.last_text,["if","while"])&&(e=g.Conditional);";"===et.last_text||"TK_START_BLOCK"===Q?v():"TK_END_EXPR"===Q||"TK_START_EXPR"===Q||"TK_END_BLOCK"===Q||"."===et.last_text?d(H.wanted_newline):"TK_RESERVED"===Q&&"("===H.text||"TK_WORD"===Q||"TK_OPERATOR"===Q?"TK_RESERVED"===Q&&("function"===et.last_word||"typeof"===et.last_word)||"*"===et.last_text&&"function"===G?at.space_after_anon_function&&(W.space_before_token=!0):"TK_RESERVED"!==Q||!o(et.last_text,Z.line_starters)&&"catch"!==et.last_text||at.space_before_conditional&&(W.space_before_token=!0):W.space_before_token=!0,"("===H.text&&"TK_RESERVED"===Q&&"await"===et.last_word&&(W.space_before_token=!0),"("===H.text&&("TK_EQUALS"===Q||"TK_OPERATOR"===Q)&&(A()||d()),"("===H.text&&"TK_WORD"!==Q&&"TK_RESERVED"!==Q&&d(),w(e),_(),at.space_in_paren&&(W.space_before_token=!0),y()}function D(){for(;et.mode===g.Statement;)T();et.multiline_frame&&d("]"===H.text&&E(et.mode)&&!at.keep_array_indentation),at.space_in_paren&&("TK_START_EXPR"!==Q||at.space_in_empty_paren?W.space_before_token=!0:(W.trim(),W.space_before_token=!1)),"]"===H.text&&at.keep_array_indentation?(_(),T()):(T(),_()),W.remove_redundant_indentation(tt),et.do_while&&tt.mode===g.Conditional&&(tt.mode=g.Expression,et.do_block=!1,et.do_while=!1)}function L(){var e=j(1),t=j(2);w(t&&(o(t.text,[":",","])&&o(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||o(e.text,["get","set"])&&o(t.type,["TK_WORD","TK_RESERVED"]))?o(G,["class","interface"])?g.BlockStatement:g.ObjectLiteral:"TK_OPERATOR"===Q&&"=>"===et.last_text?g.BlockStatement:o(Q,["TK_EQUALS","TK_START_EXPR","TK_COMMA","TK_OPERATOR"])||"TK_RESERVED"===Q&&o(et.last_text,["return","throw","import"])?g.ObjectLiteral:g.BlockStatement);var n=!e.comments_before.length&&"}"===e.text,r=n&&"function"===et.last_word&&"TK_END_EXPR"===Q;if("expand"===at.brace_style||"none"===at.brace_style&&H.wanted_newline)"TK_OPERATOR"!==Q&&(r||"TK_EQUALS"===Q||"TK_RESERVED"===Q&&R(et.last_text)&&"else"!==et.last_text)?W.space_before_token=!0:v(!1,!0);else{if("collapse-preserve-inline"===at.brace_style){var i=0,a=null;et.inline_frame=!0;do if(i+=1,a=j(i),a.wanted_newline){et.inline_frame=!1;break}while("TK_EOF"!==a.type&&("TK_END_BLOCK"!==a.type||a.opened!==H))}!E(tt.mode)||"TK_START_EXPR"!==Q&&"TK_COMMA"!==Q?"TK_OPERATOR"!==Q&&"TK_START_EXPR"!==Q&&("TK_START_BLOCK"===Q?v():W.space_before_token=!0):(("TK_COMMA"===Q||at.space_in_paren)&&(W.space_before_token=!0),"collapse-preserve-inline"===at.brace_style&&("TK_COMMA"===Q||"TK_START_EXPR"===Q&&et.inline_frame)&&(d(),tt.multiline_frame=tt.multiline_frame||et.multiline_frame,et.multiline_frame=!1))}_(),y()}function U(){for(;et.mode===g.Statement;)T();var e="TK_START_BLOCK"===Q;"expand"===at.brace_style?e||v():e||(et.inline_frame?W.space_before_token=!0:E(et.mode)&&at.keep_array_indentation?(at.keep_array_indentation=!1,v(),at.keep_array_indentation=!0):v()),T(),_()}function N(){if("TK_RESERVED"===H.type)if(o(H.text,["set","get"])&&et.mode!==g.ObjectLiteral)H.type="TK_WORD";else if(o(H.text,["as","from"])&&!et.import_block)H.type="TK_WORD";else if(et.mode===g.ObjectLiteral){var e=j(1);":"===e.text&&(H.type="TK_WORD")}if(S()||!H.wanted_newline||k(et.mode)||"TK_OPERATOR"===Q&&"--"!==et.last_text&&"++"!==et.last_text||"TK_EQUALS"===Q||!at.preserve_newlines&&"TK_RESERVED"===Q&&o(et.last_text,["var","let","const","set","get"])||v(),et.do_block&&!et.do_while){if("TK_RESERVED"===H.type&&"while"===H.text)return W.space_before_token=!0,_(),W.space_before_token=!0,void(et.do_while=!0);v(),et.do_block=!1}if(et.if_block)if(et.else_block||"TK_RESERVED"!==H.type||"else"!==H.text){for(;et.mode===g.Statement;)T();et.if_block=!1,et.else_block=!1}else et.else_block=!0;if("TK_RESERVED"===H.type&&("case"===H.text||"default"===H.text&&et.in_case_statement))return v(),(et.case_body||at.jslint_happy)&&(x(),et.case_body=!1),_(),et.in_case=!0,void(et.in_case_statement=!0);if("TK_RESERVED"===H.type&&"function"===H.text&&((o(et.last_text,["}",";"])||W.just_added_newline()&&!o(et.last_text,["[","{",":","=",","]))&&(W.just_added_blankline()||H.comments_before.length||(v(),v(!0))),"TK_RESERVED"===Q||"TK_WORD"===Q?"TK_RESERVED"===Q&&o(et.last_text,["get","set","new","return","export","async"])?W.space_before_token=!0:"TK_RESERVED"===Q&&"default"===et.last_text&&"export"===G?W.space_before_token=!0:v():"TK_OPERATOR"===Q||"="===et.last_text?W.space_before_token=!0:(et.multiline_frame||!k(et.mode)&&!E(et.mode))&&v()),("TK_COMMA"===Q||"TK_START_EXPR"===Q||"TK_EQUALS"===Q||"TK_OPERATOR"===Q)&&(A()||d()),"TK_RESERVED"===H.type&&o(H.text,["function","get","set"]))return _(),void(et.last_word=H.text);if(rt="NONE","TK_END_BLOCK"===Q?"TK_RESERVED"===H.type&&o(H.text,["else","catch","finally","from"])?"expand"===at.brace_style||"end-expand"===at.brace_style||"none"===at.brace_style&&H.wanted_newline?rt="NEWLINE":(rt="SPACE",W.space_before_token=!0):rt="NEWLINE":"TK_SEMICOLON"===Q&&et.mode===g.BlockStatement?rt="NEWLINE":"TK_SEMICOLON"===Q&&k(et.mode)?rt="SPACE":"TK_STRING"===Q?rt="NEWLINE":"TK_RESERVED"===Q||"TK_WORD"===Q||"*"===et.last_text&&"function"===G?rt="SPACE":"TK_START_BLOCK"===Q?rt=et.inline_frame?"SPACE":"NEWLINE":"TK_END_EXPR"===Q&&(W.space_before_token=!0,rt="NEWLINE"),"TK_RESERVED"===H.type&&o(H.text,Z.line_starters)&&")"!==et.last_text&&(rt="else"===et.last_text||"export"===et.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===H.type&&o(H.text,["else","catch","finally"]))if("TK_END_BLOCK"!==Q||tt.mode!==g.BlockStatement||"expand"===at.brace_style||"end-expand"===at.brace_style||"none"===at.brace_style&&H.wanted_newline)v();else{W.trim(!0);var t=W.current_line;"}"!==t.last()&&v(),W.space_before_token=!0}else"NEWLINE"===rt?"TK_RESERVED"===Q&&R(et.last_text)?W.space_before_token=!0:"TK_END_EXPR"!==Q?"TK_START_EXPR"===Q&&"TK_RESERVED"===H.type&&o(H.text,["var","let","const"])||":"===et.last_text||("TK_RESERVED"===H.type&&"if"===H.text&&"else"===et.last_text?W.space_before_token=!0:v()):"TK_RESERVED"===H.type&&o(H.text,Z.line_starters)&&")"!==et.last_text&&v():et.multiline_frame&&E(et.mode)&&","===et.last_text&&"}"===G?v():"SPACE"===rt&&(W.space_before_token=!0);_(),et.last_word=H.text,"TK_RESERVED"===H.type&&("do"===H.text?et.do_block=!0:"if"===H.text?et.if_block=!0:"import"===H.text?et.import_block=!0:et.import_block&&"TK_RESERVED"===H.type&&"from"===H.text&&(et.import_block=!1))}function B(){for(S()&&(W.space_before_token=!1);et.mode===g.Statement&&!et.if_block&&!et.do_block;)T();et.import_block&&(et.import_block=!1),_()}function M(){S()?W.space_before_token=!0:"TK_RESERVED"===Q||"TK_WORD"===Q||et.inline_frame?W.space_before_token=!0:"TK_COMMA"===Q||"TK_START_EXPR"===Q||"TK_EQUALS"===Q||"TK_OPERATOR"===Q?A()||d():v(),_()}function I(){S(),et.declaration_statement&&(et.declaration_assignment=!0),W.space_before_token=!0,_(),W.space_before_token=!0}function P(){_(),W.space_before_token=!0,et.declaration_statement?(k(et.parent.mode)&&(et.declaration_assignment=!1),et.declaration_assignment?(et.declaration_assignment=!1,v(!1,!0)):at.comma_first&&d()):et.mode===g.ObjectLiteral||et.mode===g.Statement&&et.parent.mode===g.ObjectLiteral?(et.mode===g.Statement&&T(),et.inline_frame||v()):at.comma_first&&d()}function F(){if(S(),"TK_RESERVED"===Q&&R(et.last_text))return W.space_before_token=!0,void _();if("*"===H.text&&"TK_DOT"===Q)return void _();if("::"===H.text)return void _();if("TK_OPERATOR"===Q&&o(at.operator_position,m)&&d(),":"===H.text&&et.in_case)return et.case_body=!0,y(),_(),v(),void(et.in_case=!1);var e=!0,t=!0,n=!1,r="*"===H.text&&"TK_RESERVED"===Q&&"function"===et.last_text,i=o(H.text,["-","+"])&&(o(Q,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||o(et.last_text,Z.line_starters)||","===et.last_text);if(":"===H.text?0===et.ternary_depth?e=!1:(et.ternary_depth-=1,n=!0):"?"===H.text&&(et.ternary_depth+=1),!i&&!r&&at.preserve_newlines&&o(H.text,Z.positionable_operators)){var a=":"===H.text,s=a&&n,c=a&&!n;switch(at.operator_position){case h.before_newline:return W.space_before_token=!c,_(),(!a||s)&&d(),void(W.space_before_token=!0);case h.after_newline:return W.space_before_token=!0,!a||s?j(1).wanted_newline?v(!1,!0):d():W.space_before_token=!1,_(),void(W.space_before_token=!0);case h.preserve_newline:return c||d(),e=!(W.just_added_newline()||c),W.space_before_token=e,_(),void(W.space_before_token=!0)}}o(H.text,["--","++","!","~"])||i?(e=!1,t=!1,!H.wanted_newline||"--"!==H.text&&"++"!==H.text||v(!1,!0),";"===et.last_text&&k(et.mode)&&(e=!0),"TK_RESERVED"===Q?e=!0:"TK_END_EXPR"===Q?e=!("]"===et.last_text&&("--"===H.text||"++"===H.text)):"TK_OPERATOR"===Q&&(e=o(H.text,["--","-","++","+"])&&o(et.last_text,["--","-","++","+"]),o(H.text,["+","-"])&&o(et.last_text,["--","++"])&&(t=!0)),(et.mode!==g.BlockStatement||et.inline_frame)&&et.mode!==g.Statement||"{"!==et.last_text&&";"!==et.last_text||v()):r&&(e=!1,t=!1),W.space_before_token=W.space_before_token||e,_(),W.space_before_token=t}function V(){if(W.raw)return W.add_raw_token(H),void(H.directives&&"end"===H.directives.preserve&&(W.raw=at.test_output_raw));if(H.directives)return v(!1,!0),_(),"start"===H.directives.preserve&&(W.raw=!0),void v(!1,!0);if(!e(H.text.charCodeAt(0))&&!H.wanted_newline)return W.space_before_token=!0,_(),void(W.space_before_token=!0);var t,n=u(H.text),r=!1,i=!1,a=H.whitespace_before,o=a.length;for(v(!1,!0),n.length>1&&(r=O(n.slice(1),"*"),i=C(n.slice(1),a)),_(n[0]),t=1;t<n.length;t++)v(!1,!0),r?_(" "+c(n[t])):i&&n[t].length>o?_(n[t].substring(o)):W.add_token(n[t]);v(!1,!0)}function z(){H.wanted_newline?v(!1,!0):W.trim(!0),W.space_before_token=!0,_(),v(!1,!0)}function q(){S(),"TK_RESERVED"===Q&&R(et.last_text)?W.space_before_token=!0:d(")"===et.last_text&&at.break_chained_methods),_()}function $(){_(),"\n"===H.text[H.text.length-1]&&v()}function J(){for(;et.mode===g.Statement;)T()}var W,X,Z,H,Q,G,Y,et,tt,nt,rt,it,at,ot=[],st="";for(it={TK_START_EXPR:K,TK_END_EXPR:D,TK_START_BLOCK:L,TK_END_BLOCK:U,TK_WORD:N,TK_RESERVED:N,TK_SEMICOLON:B,TK_STRING:M,TK_EQUALS:I,TK_OPERATOR:F,TK_COMMA:P,TK_BLOCK_COMMENT:V,TK_COMMENT:z,TK_DOT:q,TK_UNKNOWN:$,TK_EOF:J},n=n?n:{},at={},void 0!==n.braces_on_own_line&&(at.brace_style=n.braces_on_own_line?"expand":"collapse"),at.brace_style=n.brace_style?n.brace_style:at.brace_style?at.brace_style:"collapse","expand-strict"===at.brace_style&&(at.brace_style="expand"),at.indent_size=n.indent_size?parseInt(n.indent_size,10):4,at.indent_char=n.indent_char?n.indent_char:" ",at.eol=n.eol?n.eol:"auto",at.preserve_newlines=void 0===n.preserve_newlines?!0:n.preserve_newlines,at.break_chained_methods=void 0===n.break_chained_methods?!1:n.break_chained_methods,at.max_preserve_newlines=void 0===n.max_preserve_newlines?0:parseInt(n.max_preserve_newlines,10),at.space_in_paren=void 0===n.space_in_paren?!1:n.space_in_paren,at.space_in_empty_paren=void 0===n.space_in_empty_paren?!1:n.space_in_empty_paren,at.jslint_happy=void 0===n.jslint_happy?!1:n.jslint_happy,at.space_after_anon_function=void 0===n.space_after_anon_function?!1:n.space_after_anon_function,at.keep_array_indentation=void 0===n.keep_array_indentation?!1:n.keep_array_indentation,at.space_before_conditional=void 0===n.space_before_conditional?!0:n.space_before_conditional,at.unescape_strings=void 0===n.unescape_strings?!1:n.unescape_strings,at.wrap_line_length=void 0===n.wrap_line_length?0:parseInt(n.wrap_line_length,10),at.e4x=void 0===n.e4x?!1:n.e4x,at.end_with_newline=void 0===n.end_with_newline?!1:n.end_with_newline,at.comma_first=void 0===n.comma_first?!1:n.comma_first,at.operator_position=l(n.operator_position),at.test_output_raw=void 0===n.test_output_raw?!1:n.test_output_raw,at.jslint_happy&&(at.space_after_anon_function=!0),n.indent_with_tabs&&(at.indent_char="	",at.indent_size=1),"auto"===at.eol&&(at.eol="\n",t&&a.test(t||"")&&(at.eol=t.match(a)[0])),at.eol=at.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),Y="";at.indent_size>0;)Y+=at.indent_char,at.indent_size-=1;var ct=0;if(t&&t.length){for(;" "===t.charAt(ct)||"	"===t.charAt(ct);)st+=t.charAt(ct),ct+=1;t=t.substring(ct)}Q="TK_START_BLOCK",G="",W=new f(Y,st),W.raw=at.test_output_raw,nt=[],w(g.BlockStatement),this.beautify=function(){function e(){return n=j()}var n,r;for(Z=new p(t,at,Y),ot=Z.tokenize(),X=0;e();){for(var a=0;a<n.comments_before.length;a++)i(n.comments_before[a]);i(n),G=et.last_text,Q=n.type,et.last_text=n.text,X+=1}return r=W.get_code(),at.end_with_newline&&(r+="\n"),"\n"!==at.eol&&(r=r.replace(/[\n]/g,at.eol)),r};var lt=["break","contiue","return","throw"]}function d(e){var t=0,n=-1,r=[],i=!0;this.set_indent=function(r){t=e.baseIndentLength+r*e.indent_length,n=r},this.get_character_count=function(){return t},this.is_empty=function(){return i},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),t+=e.length,i=!1},this.pop=function(){var e=null;return i||(e=r.pop(),t-=e.length,i=0===r.length),e},this.remove_indent=function(){n>0&&(n-=1,t-=e.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),t-=1;i=0===r.length},this.toString=function(){var t="";return this._empty||(n>=0&&(t=e.indent_cache[n]),t+=r.join("")),t}}function f(e,t){t=t||"",this.indent_cache=[t],this.baseIndentLength=t.length,this.indent_length=e.length,this.raw=!1;var n=[];this.baseIndentString=t,this.indent_string=e,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new d(this),n.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return n.length},this.add_new_line=function(e){return 1===this.get_line_number()&&this.just_added_newline()?!1:e||!this.just_added_newline()?(this.raw||this.add_outputline(),!0):!1},this.get_code=function(){var e=n.join("\n").replace(/[\r\n\t ]+$/,"");return e},this.set_indent=function(e){if(n.length>1){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==g.ForInitializer&&e.mode!==g.Conditional)for(var t=e.start_line_index,r=n.length;r>t;)n[t].remove_indent(),t++},this.trim=function(r){for(r=void 0===r?!1:r,this.current_line.trim(e,t);r&&n.length>1&&this.current_line.is_empty();)n.pop(),this.current_line=n[n.length-1],this.current_line.trim();this.previous_line=n.length>1?n[n.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){if(this.just_added_newline()){if(1===n.length)return!0;var e=n[n.length-2];return e.is_empty()}return!1}}function p(t,i){function a(e){if(!e.match(A))return null;var t={};S.lastIndex=0;for(var n=S.exec(e);n;)t[n[1]]=n[2],n=S.exec(e);return t}function c(){var c,A=[];if(g=0,b="",x>=w)return["","TK_EOF"];var S;S=y.length?y[y.length-1]:new v("TK_START_BLOCK","{");var R=t.charAt(x);for(x+=1;o(R,u);){if(e(R.charCodeAt(0))?("\n"!==R||"\r"!==t.charAt(x-2))&&(g+=1,A=[]):A.push(R),x>=w)return["","TK_EOF"];R=t.charAt(x),x+=1}if(A.length&&(b=A.join("")),d.test(R)||"."===R&&d.test(t.charAt(x))){var j=!0,K=!0,D=d;for("0"===R&&w>x&&/[XxOoBb]/.test(t.charAt(x))?(j=!1,K=!1,D=/[Bb]/.test(t.charAt(x))?f:/[Oo]/.test(t.charAt(x))?p:h,R+=t.charAt(x),x+=1):"."===R?j=!1:(R="",x-=1);w>x&&D.test(t.charAt(x));)R+=t.charAt(x),x+=1,j&&w>x&&"."===t.charAt(x)?(R+=t.charAt(x),x+=1,j=!1):K&&w>x&&/[Ee]/.test(t.charAt(x))&&(R+=t.charAt(x),x+=1,w>x&&/[+-]/.test(t.charAt(x))&&(R+=t.charAt(x),x+=1),K=!1,j=!1);return[R,"TK_WORD"]}if(n(t.charCodeAt(x-1))){if(w>x)for(;r(t.charCodeAt(x))&&(R+=t.charAt(x),x+=1,x!==w););return"TK_DOT"===S.type||"TK_RESERVED"===S.type&&o(S.text,["set","get"])||!o(R,E)?[R,"TK_WORD"]:"in"===R?[R,"TK_OPERATOR"]:[R,"TK_RESERVED"]}if("("===R||"["===R)return[R,"TK_START_EXPR"];if(")"===R||"]"===R)return[R,"TK_END_EXPR"];if("{"===R)return[R,"TK_START_BLOCK"];if("}"===R)return[R,"TK_END_BLOCK"];if(";"===R)return[R,"TK_SEMICOLON"];if("/"===R){var L,U="";if("*"===t.charAt(x)){x+=1,k.lastIndex=x,L=k.exec(t),U="/*"+L[0],x+=L[0].length;var N=a(U);return N&&"start"===N.ignore&&(O.lastIndex=x,L=O.exec(t),U+=L[0],x+=L[0].length),U=U.replace(acorn.allLineBreaks,"\n"),[U,"TK_BLOCK_COMMENT",N]}if("/"===t.charAt(x))return x+=1,T.lastIndex=x,L=T.exec(t),U="//"+L[0],x+=L[0].length,[U,"TK_COMMENT"]}var B=/^<([-a-zA-Z:0-9_.]+|{.+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{.+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.+?}))*\s*(\/?)\s*>/;if("`"===R||"'"===R||'"'===R||("/"===R||i.e4x&&"<"===R&&t.slice(x-1).match(B))&&("TK_RESERVED"===S.type&&o(S.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===S.type&&")"===S.text&&S.parent&&"TK_RESERVED"===S.parent.type&&o(S.parent.text,["if","while","for"])||o(S.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var M=R,I=!1,P=!1;if(c=R,"/"===M)for(var F=!1;w>x&&(I||F||t.charAt(x)!==M)&&!e(t.charCodeAt(x));)c+=t.charAt(x),I?I=!1:(I="\\"===t.charAt(x),"["===t.charAt(x)?F=!0:"]"===t.charAt(x)&&(F=!1)),x+=1;else if(i.e4x&&"<"===M){var V=/<(\/?)([-a-zA-Z:0-9_.]+|{.+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{.+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.+?}))*\s*(\/?)\s*>/g,z=t.slice(x-1),q=V.exec(z);if(q&&0===q.index){for(var $=q[2],J=0;q;){var W=!!q[1],X=q[2],Z=!!q[q.length-1]||"![CDATA["===X.slice(0,8);if(X!==$||Z||(W?--J:++J),0>=J)break;q=V.exec(z)}var H=q?q.index+q[0].length:z.length;return z=z.slice(0,H),x+=H-1,z=z.replace(acorn.allLineBreaks,"\n"),[z,"TK_STRING"]}}else{var Q=function(n,r,i){for(var a;w>x&&(a=t.charAt(x),I||a!==n&&(r||!e(a.charCodeAt(0))));)(I||r)&&e(a.charCodeAt(0))?("\r"===a&&"\n"===t.charAt(x+1)&&(x+=1,a=t.charAt(x)),c+="\n"):c+=a,I?(("x"===a||"u"===a)&&(P=!0),I=!1):I="\\"===a,x+=1,i&&-1!==c.indexOf(i,c.length-i.length)&&("`"===n?Q("}",r,"`"):Q("`",r,"${"))};"`"===M?Q("`",!0,"${"):Q(M)}if(P&&i.unescape_strings&&(c=l(c)),w>x&&t.charAt(x)===M&&(c+=M,x+=1,"/"===M))for(;w>x&&n(t.charCodeAt(x));)c+=t.charAt(x),x+=1;return[c,"TK_STRING"]}if("#"===R){if(0===y.length&&"!"===t.charAt(x)){for(c=R;w>x&&"\n"!==R;)R=t.charAt(x),c+=R,x+=1;return[s(c)+"\n","TK_UNKNOWN"]}var G="#";if(w>x&&d.test(t.charAt(x))){do R=t.charAt(x),G+=R,x+=1;while(w>x&&"#"!==R&&"="!==R);return"#"===R||("["===t.charAt(x)&&"]"===t.charAt(x+1)?(G+="[]",x+=2):"{"===t.charAt(x)&&"}"===t.charAt(x+1)&&(G+="{}",x+=2)),[G,"TK_WORD"]}}if("<"===R&&("?"===t.charAt(x)||"%"===t.charAt(x))){C.lastIndex=x-1;var Y=C.exec(t);if(Y)return R=Y[0],x+=R.length-1,R=R.replace(acorn.allLineBreaks,"\n"),[R,"TK_STRING"]}if("<"===R&&"<!--"===t.substring(x-1,x+3)){for(x+=3,R="<!--";!e(t.charCodeAt(x))&&w>x;)R+=t.charAt(x),x++;return _=!0,[R,"TK_COMMENT"]}if("-"===R&&_&&"-->"===t.substring(x-1,x+2))return _=!1,x+=2,["-->","TK_COMMENT"];if("."===R)return[R,"TK_DOT"];if(o(R,m)){for(;w>x&&o(R+t.charAt(x),m)&&(R+=t.charAt(x),x+=1,!(x>=w)););return","===R?[R,"TK_COMMA"]:"="===R?[R,"TK_EQUALS"]:[R,"TK_OPERATOR"]}return[R,"TK_UNKNOWN"]}function l(e){for(var t,n=!1,r="",i=0,a="",o=0;n||i<e.length;)if(t=e.charAt(i),i++,n){if(n=!1,"x"===t)a=e.substr(i,2),i+=2;else{if("u"!==t){r+="\\"+t;continue}a=e.substr(i,4),i+=4}if(!a.match(/^[0123456789abcdefABCDEF]+$/))return e;if(o=parseInt(a,16),o>=0&&32>o){r+="x"===t?"\\x"+a:"\\u"+a;continue}if(34===o||39===o||92===o)r+="\\"+String.fromCharCode(o);else{if("x"===t&&o>126&&255>=o)return e;r+=String.fromCharCode(o)}}else"\\"===t?n=!0:r+=t;return r}var u="\n\r	 ".split(""),d=/[0-9]/,f=/[01]/,p=/[01234567]/,h=/[0123456789abcdefABCDEF]/;this.positionable_operators="!= !== % & && * ** + - / : < << <= == === > >= >> >>> ? ^ | ||".split(" ");var m=this.positionable_operators.concat("! %= &= *= **= ++ += , -- -= /= :: <<= = => >>= >>>= ^= |= ~".split(" "));this.line_starters="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var g,b,_,y,x,w,E=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),k=/([\s\S]*?)((?:\*\/)|$)/g,T=/([^\n\r\u2028\u2029]*)/g,A=/\/\* beautify( \w+[:]\w+)+ \*\//g,S=/ (\w+)[:](\w+)/g,O=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,C=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;this.tokenize=function(){w=t.length,x=0,_=!1,y=[];for(var e,n,r,i=null,a=[],o=[];!n||"TK_EOF"!==n.type;){for(r=c(),e=new v(r[1],r[0],g,b);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=r[2]),o.push(e),r=c(),e=new v(r[1],r[0],g,b);o.length&&(e.comments_before=o,o=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=n,a.push(i),i=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&i&&("]"===e.text&&"["===i.text||")"===e.text&&"("===i.text||"}"===e.text&&"{"===i.text)&&(e.parent=i.parent,e.opened=i,i=a.pop()),y.push(e),n=e}return y}}var h={before_newline:"before-newline",after_newline:"after-newline",preserve_newline:"preserve-newline"},m=[h.before_newline,h.preserve_newline],g={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"},v=function(e,t,n,r,i){this.type=e,this.text=t,this.comments_before=[],this.newlines=n||0,this.wanted_newline=n>0,this.whitespace_before=r||"",this.parent=i||null,this.opened=null,this.directives=null},b=new u(t,i);return b.beautify()}var a=/\r\n?|\n|\u2028|\u2029/,o="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ",s="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏０-９＿",c=new RegExp("["+o+"]"),l=new RegExp("["+o+s+"]"),u=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,99,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,287,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,1288,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,16481,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,1340,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],d=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,168,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,316,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,20855,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,3617,6,792618,239];return Object.values||(Object.values=function(e){if(e!==Object(e))throw new TypeError("Object.values called on a non-object");var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(e[t]);return n}),{js_beautify:i}}),define("plugins/languages/json/jsonFormatter",["orion/Deferred","plugins/languages/json/beautifier"],function(e,t){function n(){i.setDefaults()}function r(e,n,r){return e.getSelection().then(function(i){var a=i.start,o=i.end;return o!==a?e.getText(a,o).then(function(i){var s=t.js_beautify(i,r);return s?n.resolve(e.setText(s,a,o)):n.reject(),n}):e.getText().then(function(i){var a=t.js_beautify(i,r);return a?n.resolve(e.setText(a)):n.reject(),n})})}var i={defaults:{indent_char:" ",preserve_newlines:!0,indent_level:0,indent_size:4,eol:"\n",wrap_line_length:0,end_with_newline:!1},setOption:function(e,t,n){if(Array.isArray(this.rules[e])){var r=this.rules[e];n?(r[1]=r[1]||{},r[1][n]=t):r[0]=t}else this.rules[e]=t},setDefaults:function(){this.rules=Object.create(null);for(var e=Object.keys(this.defaults),t=0;t<e.length;t++){var n=e[t];this.rules[n]=this.defaults[n]}}};return n.prototype.format=function(t){var n=new e;return r(t,n,i.rules),n},n.prototype.updated=function(e){if(e){var t,n,r,a,o="json.config.format"===e.pid,s=Object.keys(e);for(t=0;t<s.length;t++)n=s[t],a=n,n=n.replace(/^json_/,""),r=n,o&&i.rules[n]!==i.defaults[n]||i.setOption(r,e[a])}},n}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("plugins/languages/json/parser",["require","exports"],e)}(function(e,t){"use strict";function n(e,t){function n(t,n){for(var r=0,i=0;t>r||!n;){var a=e.charCodeAt(f);if(a>=48&&57>=a)i=16*i+a-48;else if(a>=65&&70>=a)i=16*i+a-65+10;else{if(!(a>=97&&102>=a))break;i=16*i+a-97+10}f++,r++}return t>r&&(i=-1),i}function o(e){f=e,h="",v=0,b=g.Unknown,_=m.None}function s(){var t=f;if(48===e.charCodeAt(f))f++;else for(f++;f<e.length&&a(e.charCodeAt(f));)f++;if(f<e.length&&46===e.charCodeAt(f)){if(f++,!(f<e.length&&a(e.charCodeAt(f))))return _=m.UnexpectedEndOfNumber,e.substring(t,f);for(f++;f<e.length&&a(e.charCodeAt(f));)f++}var n=f;if(f<e.length&&(69===e.charCodeAt(f)||101===e.charCodeAt(f)))if(f++,(f<e.length&&43===e.charCodeAt(f)||45===e.charCodeAt(f))&&f++,f<e.length&&a(e.charCodeAt(f))){for(f++;f<e.length&&a(e.charCodeAt(f));)f++;n=f}else _=m.UnexpectedEndOfNumber;return e.substring(t,n)}function c(){for(var t="",r=f;;){if(f>=p){t+=e.substring(r,f),_=m.UnexpectedEndOfString;break}var a=e.charCodeAt(f);if(34===a){t+=e.substring(r,f),f++;break}if(92!==a){if(i(a)){t+=e.substring(r,f),_=m.UnexpectedEndOfString;break}f++}else{if(t+=e.substring(r,f),f++,f>=p){_=m.UnexpectedEndOfString;break}switch(a=e.charCodeAt(f++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="	";break;case 117:var o=n(4,!0);o>=0?t+=String.fromCharCode(o):_=m.InvalidUnicode;break;default:_=m.InvalidEscapeCharacter}r=f}}return t}function l(){if(h="",_=m.None,v=f,f>=p)return v=p,b=g.EOF;var t=e.charCodeAt(f);if(r(t)){do f++,h+=String.fromCharCode(t),t=e.charCodeAt(f);while(r(t));return b=g.Trivia}if(i(t))return f++,h+=String.fromCharCode(t),13===t&&10===e.charCodeAt(f)&&(f++,h+="\n"),b=g.LineBreakTrivia;switch(t){case 123:return f++,b=g.OpenBraceToken;case 125:return f++,b=g.CloseBraceToken;case 91:return f++,b=g.OpenBracketToken;case 93:return f++,b=g.CloseBracketToken;case 58:return f++,b=g.ColonToken;case 44:return f++,b=g.CommaToken;case 34:return f++,h=c(),b=g.StringLiteral;case 47:var n=f-1;if(47===e.charCodeAt(f+1)){for(f+=2;p>f&&!i(e.charCodeAt(f));)f++;return h=e.substring(n,f),b=g.LineCommentTrivia}if(42===e.charCodeAt(f+1)){f+=2;for(var o=p-1,l=!1;o>f;){var d=e.charCodeAt(f);if(42===d&&47===e.charCodeAt(f+1)){f+=2,l=!0;break}f++}return l||(f++,_=m.UnexpectedEndOfComment),h=e.substring(n,f),b=g.BlockCommentTrivia}return h+=String.fromCharCode(t),f++,b=g.Unknown;case 45:if(h+=String.fromCharCode(t),f++,f===p||!a(e.charCodeAt(f)))return b=g.Unknown;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return h+=s(),b=g.NumericLiteral;default:for(;p>f&&u(t);)f++,t=e.charCodeAt(f);if(v!==f){switch(h=e.substring(v,f)){case"true":return b=g.TrueKeyword;case"false":return b=g.FalseKeyword;case"null":return b=g.NullKeyword}return b=g.Unknown}return h+=String.fromCharCode(t),f++,b=g.Unknown}}function u(e){if(r(e)||i(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:return!1}return!0}function d(){var e;do e=l();while(e>=g.LineCommentTrivia&&e<=g.Trivia);return e}void 0===t&&(t=!1);var f=0,p=e.length,h="",v=0,b=g.Unknown,_=m.None;return{setPosition:o,getPosition:function(){return f},scan:t?d:l,getToken:function(){return b},getTokenValue:function(){return h},getTokenOffset:function(){return v
},getTokenLength:function(){return f-v},getTokenError:function(){return _}}}function r(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&8203>=e||8239===e||8287===e||12288===e||65279===e}function i(e){return 10===e||13===e||8232===e||8233===e}function a(e){return e>=48&&57>=e}function o(e,t){var r,i,a=n(e),o=[],s=0;do switch(i=a.getPosition(),r=a.scan()){case g.LineCommentTrivia:case g.BlockCommentTrivia:case g.EOF:s!==i&&o.push(e.substring(s,i)),void 0!==t&&o.push(a.getTokenValue().replace(/[^\r\n]/g,t)),s=a.getPosition()}while(r!==g.EOF);return o.join("")}function s(e){switch(e){case v.InvalidSymbol:return"error.invalidSymbol";case v.InvalidNumberFormat:return"error.invalidNumberFormat";case v.PropertyNameExpected:return"error.propertyNameExpected";case v.ValueExpected:return"error.valueExpected";case v.ColonExpected:return"error.colonExpected";case v.CommaExpected:return"error.commaExpected";case v.CloseBraceExpected:return"error.closeBraceExpected";case v.CloseBracketExpected:return"error.closeBracketExpected";case v.EndOfFileExpected:return"error.endOfFileExpected";default:return""}}function c(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return"null"}}function l(e,t){function n(e,t,n,r){o.value=e,o.offset=t,o.length=n,o.type=r,o.columnOffset=void 0,a=o}var r=[],i=new Object,a=void 0,o={value:void 0,offset:void 0,length:void 0,type:void 0},s=!1;try{h(e,{onObjectBegin:function(e){if(e>=t)throw i;a=void 0,s=t>e,r.push("")},onObjectProperty:function(e,a,o){if(a>t)throw i;if(n(e,a,o,"property"),r[r.length-1]=e,a+o>=t)throw i},onObjectEnd:function(e){if(e>=t)throw i;a=void 0,r.pop()},onArrayBegin:function(e){if(e>=t)throw i;a=void 0,r.push(0)},onArrayEnd:function(e){if(e>=t)throw i;a=void 0,r.pop()},onLiteralValue:function(e,r,a){if(r>t)throw i;if(n(e,r,a,c(e)),r+a>=t)throw i},onSeparator:function(e,n){if(n>=t)throw i;if(":"===e&&"property"===a.type)a.columnOffset=n,s=!1,a=void 0;else if(","===e){var o=r[r.length-1];"number"==typeof o?r[r.length-1]=o+1:(s=!0,r[r.length-1]=""),a=void 0}}})}catch(l){if(l!==i)throw l}return""===r[r.length-1]&&r.pop(),{path:r,previousNode:a,isAtPropertyKey:s,matches:function(e){for(var t=0,n=0;t<e.length&&n<r.length;n++)if(e[t]===r[n]||"*"===e[t])t++;else if("**"!==e[t])return!1;return t===e.length}}}function u(e,t,n){function r(e){Array.isArray(a)?a.push(e):i&&(a[i]=e)}void 0===t&&(t=[]);var i=null,a=[],o=[],s={onObjectBegin:function(){var e={};r(e),o.push(a),a=e,i=null},onObjectProperty:function(e){i=e},onObjectEnd:function(){a=o.pop()},onArrayBegin:function(){var e=[];r(e),o.push(a),a=e,i=null},onArrayEnd:function(){a=o.pop()},onLiteralValue:r,onError:function(e){t.push({error:e})}};return h(e,s,n),a[0]}function d(e,t,n){function r(e){"property"===a.type&&(a.length=e-a.offset,a=a.parent)}function i(e){return a.children.push(e),e}void 0===t&&(t=[]);var a={type:"array",offset:-1,length:-1,children:[]},o={onObjectBegin:function(e){a=i({type:"object",offset:e,length:-1,parent:a,children:[]})},onObjectProperty:function(e,t,n){a=i({type:"property",offset:t,length:-1,parent:a,children:[]}),a.children.push({type:"string",value:e,offset:t,length:n,parent:a})},onObjectEnd:function(e,t){a.length=e+t-a.offset,a=a.parent,r(e+t)},onArrayBegin:function(e){a=i({type:"array",offset:e,length:-1,parent:a,children:[]})},onArrayEnd:function(e,t){a.length=e+t-a.offset,a=a.parent,r(e+t)},onLiteralValue:function(e,t,n){i({type:c(e),offset:t,length:n,parent:a,value:e}),r(t+n)},onSeparator:function(e,t){"property"===a.type&&(":"===e?a.columnOffset=t:","===e&&r(t))},onError:function(e,n,r){t.push({error:e,offset:n,length:r})}};h(e,o,n);var s=a.children[0];return s&&delete s.parent,s}function f(e,t){if(!e)return void 0;for(var n=e,r=0,i=t;r<i.length;r++){var a=i[r];if("string"==typeof a){if("object"!==n.type)return void 0;for(var o=!1,s=0,c=n.children;s<c.length;s++){var l=c[s];if(l.children[0].value===a){n=l.children[1],o=!0;break}}if(!o)return void 0}else{var u=a;if("array"!==n.type||0>u||u>=n.children.length)return void 0;n=n.children[u]}}return n}function p(e){if("array"===e.type)return e.children.map(p);if("object"===e.type){for(var t={},n=0,r=e.children;n<r.length;n++){var i=r[n];t[i.children[0].value]=p(i.children[1])}return t}return e.value}function h(e,t,r){function i(e){return e?function(){return e(h.getTokenOffset(),h.getTokenLength())}:function(){return!0}}function a(e){return e?function(t){return e(t,h.getTokenOffset(),h.getTokenLength())}:function(){return!0}}function o(){for(;;){var e=h.scan();switch(e){case g.LineCommentTrivia:case g.BlockCommentTrivia:T&&s(v.InvalidSymbol);break;case g.Unknown:s(v.InvalidSymbol);break;case g.Trivia:case g.LineBreakTrivia:break;default:return e}}}function s(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),k(e),t.length+n.length>0)for(var r=h.getToken();r!==g.EOF;){if(-1!==t.indexOf(r)){o();break}if(-1!==n.indexOf(r))break;r=o()}}function c(e){var t=h.getTokenValue();return e?w(t):b(t),o(),!0}function l(){switch(h.getToken()){case g.NumericLiteral:var e=0;try{e=JSON.parse(h.getTokenValue()),"number"!=typeof e&&(s(v.InvalidNumberFormat),e=0)}catch(t){s(v.InvalidNumberFormat)}w(e);break;case g.NullKeyword:w(null);break;case g.TrueKeyword:w(!0);break;case g.FalseKeyword:w(!1);break;default:return!1}return o(),!0}function u(){return h.getToken()!==g.StringLiteral?(s(v.PropertyNameExpected,[],[g.CloseBraceToken,g.CommaToken]),!1):(c(!1),h.getToken()===g.ColonToken?(E(":"),o(),p()||s(v.ValueExpected,[],[g.CloseBraceToken,g.CommaToken])):s(v.ColonExpected,[],[g.CloseBraceToken,g.CommaToken]),!0)}function d(){m(),o();for(var e=!1;h.getToken()!==g.CloseBraceToken&&h.getToken()!==g.EOF;)h.getToken()===g.CommaToken?(e||s(v.ValueExpected,[],[]),E(","),o()):e&&s(v.CommaExpected,[],[]),u()||s(v.ValueExpected,[],[g.CloseBraceToken,g.CommaToken]),e=!0;return _(),h.getToken()!==g.CloseBraceToken?s(v.CloseBraceExpected,[g.CloseBraceToken],[]):o(),!0}function f(){y(),o();for(var e=!1;h.getToken()!==g.CloseBracketToken&&h.getToken()!==g.EOF;)h.getToken()===g.CommaToken?(e||s(v.ValueExpected,[],[]),E(","),o()):e&&s(v.CommaExpected,[],[]),p()||s(v.ValueExpected,[],[g.CloseBracketToken,g.CommaToken]),e=!0;return x(),h.getToken()!==g.CloseBracketToken?s(v.CloseBracketExpected,[g.CloseBracketToken],[]):o(),!0}function p(){switch(h.getToken()){case g.OpenBracketToken:return f();case g.OpenBraceToken:return d();case g.StringLiteral:return c(!0);default:return l()}}var h=n(e,!1),m=i(t.onObjectBegin),b=a(t.onObjectProperty),_=i(t.onObjectEnd),y=i(t.onArrayBegin),x=i(t.onArrayEnd),w=a(t.onLiteralValue),E=a(t.onSeparator),k=a(t.onError),T=r&&r.disallowComments;return o(),h.getToken()===g.EOF?!0:p()?(h.getToken()!==g.EOF&&s(v.EndOfFileExpected,[],[]),!0):(s(v.ValueExpected,[],[]),!1)}var m;!function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter"}(m=t.ScanError||(t.ScanError={}));var g;!function(e){e[e.Unknown=0]="Unknown",e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.EOF=16]="EOF"}(g=t.SyntaxKind||(t.SyntaxKind={})),t.createScanner=n,t.stripComments=o;var v;!function(e){e[e.InvalidSymbol=0]="InvalidSymbol",e[e.InvalidNumberFormat=1]="InvalidNumberFormat",e[e.PropertyNameExpected=2]="PropertyNameExpected",e[e.ValueExpected=3]="ValueExpected",e[e.ColonExpected=4]="ColonExpected",e[e.CommaExpected=5]="CommaExpected",e[e.CloseBraceExpected=6]="CloseBraceExpected",e[e.CloseBracketExpected=7]="CloseBracketExpected",e[e.EndOfFileExpected=8]="EndOfFileExpected"}(v=t.ParseErrorCode||(t.ParseErrorCode={})),t.getParseErrorMessage=s,t.getLocation=l,t.parse=u,t.parseTree=d,t.findNodeAtLocation=f,t.getNodeValue=p,t.visit=h}),define("plugins/languages/json/jsonAstManager",["orion/Deferred","plugins/languages/json/parser"],function(e,t){function n(e){o=e}function r(e){if(o){var t=o.getService("orion.core.metrics.client");t&&t.logTiming("language tools","parse",e,"application/json")}}function i(e){return"string"==typeof e?e:e&&e.location?e.location:"unknown"}function a(e){var n=Date.now(),i=[];try{var a=t.parseTree(e,i,{})}catch(o){}return a.errors=i,r(Date.now()-n),a}var o,s=new Map;return n.prototype.getAST=function(t){return t.getFileMetadata().then(function(n){var r=i(n),o=s.get(r);return o?(new e).resolve(o):t.getText().then(function(e){return o=a(e),s.set(r,o),o})})},n.prototype.onModelChanging=function(e){s["delete"](i(e.file))},n.prototype.onFileChanged=function(e){e&&"Changed"===e.type&&Array.isArray(e.modified)&&e.modified.forEach(function(e){"string"==typeof e&&s["delete"](i(e))})},n}),define("plugins/languages/json/nls/messages",["module"],function(e){var t=e.config();return t&&t.root?t:{root:!0}}),define("plugins/languages/json/nls/root/messages",{pluginName:"Orion JSON Support",pluginDescription:"This plugin provides JSON support for Orion.",jsonFormatter:"Orion JSON formatting support",jsonFormattingOptions:"Formatting Settings for JSON",jsonFormatting:"JSON Formatting",indentation_space:"space",indentation_tab:"tab",json_indent_char:"Indentation character:",json_indent_size:"Indentation size:",indentation_unix:"Unix",indentation_mac:"Mac",indentation_windows:"Windows",json_eol:"Character(s) to use as line terminators:",json_end_with_newline:"End ouput with newline:"}),define("plugins/languages/json/jsonPlugin",["orion/plugin","orion/serviceregistry","orion/editor/stylers/application_json/syntax","orion/editor/stylers/application_schema_json/syntax","plugins/languages/json/validator","plugins/languages/json/jsonFormatter","plugins/languages/json/jsonAstManager","i18n!plugins/languages/json/nls/messages"],function(e,t,n,r,i,a,o,s){var c={name:s.pluginName,version:"1.0",description:s.pluginDescription},l=new t.ServiceRegistry,u=new e(c,l),d=new o(l),f=new a;u.registerService("orion.core.contenttype",{},{contentTypes:[{id:"application/json","extends":"text/plain",name:"JSON",extension:["json"],imageClass:"file-sprite-javascript modelDecorationSprite"},{id:"jslint/config","extends":"application/json",name:"JSLint Configuration Files",extension:["jslintrc"],imageClass:"file-sprite-javascript modelDecorationSprite"}]}),u.registerService("orion.edit.model",{onModelChanging:d.onModelChanging.bind(d)},{contentType:["application/json"]}),u.registerService(["orion.edit.validator"],new i(l),{contentType:["application/json"]}),u.registerServiceProvider("orion.edit.format",f,{contentType:["application/json"],id:"orion.format.json.formatter",name:s.jsonFormatter}),u.registerService("orion.cm.managedservice",f,{pid:"json.config.format"});var p=" ",h="	",m=[{label:s.indentation_space,value:p},{label:s.indentation_tab,value:h}],g="\n",v="\r",b="\n\r",_=[{label:s.indentation_unix,value:g},{label:s.indentation_mac,value:v},{label:s.indentation_windows,value:b}];u.registerServiceProvider("orion.core.setting",{},{settings:[{pid:"json.config.format",name:s.jsonFormattingOptions,tags:"beautify json formatting".split(" "),category:"jsonFormatting",categoryLabel:s.jsonFormatting,properties:[{id:"json_indent_size",name:s.json_indent_size,type:"number",defaultValue:4},{id:"json_indent_char",name:s.json_indent_char,type:"string",defaultValue:p,options:m},{id:"json_eol",name:s.json_eol,type:"string",defaultValue:g,options:_},{id:"json_end_with_newline",name:s.json_end_with_newline,type:"boolean",defaultValue:!1}]}]});var y=Object.create(null);n.grammars.forEach(function(e){y[e.id]=e}),r.grammars.forEach(function(e){y[e.id]=e}),Object.keys(y).forEach(function(e){u.registerService("orion.edit.highlighter",{},y[e])}),u.connect(function(){var e=l.getService("orion.core.file.client");e&&e.addEventListener("Changed",d.onFileChanged.bind(d))})});