From 561d8b92feb94418c39c11878409f06f7bd1240c Mon Sep 17 00:00:00 2001 From: Deepak Grover Date: Mon, 4 Jun 2018 14:07:05 +0530 Subject: [PATCH] build v0.9.0 --- app/app.component.js | 3 +- app/app.component.js.map | 2 +- app/shared/urlShare.js | 19 +- app/shared/urlShare.js.map | 2 +- dist/angular/build.js | 22 +- dist/angular/build.min.js | 22 +- dist/css/vendor.min.css | 29 +- dist/js/vendor.js | 9929 ++++++++++++++++++++---------------- dist/js/vendor.min.js | 78 +- mirage.appcache | 2 +- 10 files changed, 5532 insertions(+), 4576 deletions(-) diff --git a/app/app.component.js b/app/app.component.js index 61a5e8306..ddc1f1e73 100644 --- a/app/app.component.js +++ b/app/app.component.js @@ -107,11 +107,12 @@ var AppComponent = (function () { var config = null; var isDefault = window.location.href.indexOf('#?default=true') > -1 ? true : false; var isInputState = window.location.href.indexOf('input_state=') > -1 ? true : false; + var isApp = window.location.href.indexOf('app=') > -1 ? true : false; if (isDefault) { config = this.defaultApp; return cb(config); } - else if (!isInputState) { + else if (!isInputState && !isApp) { return cb('learn'); } else { diff --git a/app/app.component.js.map b/app/app.component.js.map index 27d61113b..65acf2198 100644 --- a/app/app.component.js.map +++ b/app/app.component.js.map @@ -1 +1 @@ -{"version":3,"file":"app.component.js","sourceRoot":"","sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAA2D,eAAe,CAAC,CAAA;AAG3E,gCAA+B,0BAA0B,CAAC,CAAA;AAC1D,gCAA+B,0BAA0B,CAAC,CAAA;AAC1D,2BAA2B,qBAAqB,CAAC,CAAA;AAEjD,2BAA2B,qBAAqB,CAAC,CAAA;AACjD,yBAAyB,mBAAmB,CAAC,CAAA;AAU7C;IAEC,sBAAmB,cAA8B,EAAS,cAA8B,EAAS,UAAsB;QAApG,mBAAc,GAAd,cAAc,CAAgB;QAAS,mBAAc,GAAd,cAAc,CAAgB;QAAS,eAAU,GAAV,UAAU,CAAY;QAEhH,WAAM,GAAG,KAAK,CAAC;QACf,cAAS,GAAY,KAAK,CAAC;QAC3B,oBAAe,GAAY,KAAK,CAAC;QAKjC,iBAAY,GAAW,IAAI,CAAC;QAC5B,WAAM,GAAW;YACvB,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;SACR,CAAC;QACK,mBAAc,GAAQ,EAAE,CAAC;QACzB,eAAU,GAAG;YACnB,IAAI,EAAE,EAAE;YACR,GAAG,EAAE,EAAE;SACP,CAAC;QACK,YAAO,GAAW,WAAW,CAAC;QAC9B,mBAAc,GAAY,IAAI,CAAC;QAC/B,eAAU,GAAW,EAAE,CAAC;QACxB,mBAAc,GAAW,KAAK,CAAC;QAG/B,YAAO,GAAY,KAAK,CAAC;QACzB,kBAAa,GAAY,KAAK,CAAC;QAC/B,aAAQ,GAAQ,EAAE,CAAC;QACnB,cAAS,GAAQ,EAAE,CAAC;QACpB,mBAAc,GAAG,IAAI,uBAAU,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,qBAAgB,GAAG,IAAI,uBAAU,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;QACjE,kBAAa,GAAG,IAAI,uBAAU,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC;QAC5D,aAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC1B,sBAAiB,GAAG,IAAI,CAAC;QACzB,wBAAmB,GAAG,IAAI,CAAC;QAC3B,YAAO,GAAW,KAAK,CAAC;QAG/B,WAAM,GAAG,IAAI,CAAC;QACd,cAAS,GAAG,KAAK,CAAC;QAKX,kBAAa,GAAG,KAAK,CAAC;QACtB,iBAAY,GAAW,UAAU,CAAC;QAClC,iBAAY,GAAY,IAAI,CAAC;QAC7B,mBAAc,GAAQ;YAC5B,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE,mCAAmC;YAC5C,OAAO,EAAE,QAAQ;YACjB,MAAM,EAAE,QAAQ;SAChB,CAAC;QACK,eAAU,GAAQ;YACxB,OAAO,EAAE,eAAe;YACxB,GAAG,EAAE,6EAA6E;SAClF,CAAC;QACK,gBAAW,GAAY,KAAK,CAAC;IA5DsF,CAAC;IA8D3H,+BAAQ,GAAR,cAAa,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;IAErC,mCAAY,GAAZ,UAAa,IAAI;QAChB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,+BAAQ,GAAR;QACC,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;QAC3F,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC;QACnH,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC;QACnH,oBAAoB;QACpB,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,kBAAkB,MAAM;YACvB,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,EAAE,CAAA,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC;gBAC7B,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,CAAC;YACD,EAAE,CAAA,CAAC,MAAM,IAAI,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC;gBACjC,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC7B,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,EAAE,CAAA,CAAC,MAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;oBAC3C,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;gBACjD,CAAC;gBACD,IAAI,CAAC,cAAc,EAAE,CAAC;YACvB,CAAC;QACF,CAAC;IACF,CAAC;IAED,kCAAW,GAAX,UAAY,OAAO;QAClB,IAAI,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC;QAClD,IAAI,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC;IACrD,CAAC;IAED,oEAAoE;IACpE,mCAAY,GAAZ,UAAa,EAAE;QACd,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,IAAI,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;QACnF,IAAI,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;QACpF,EAAE,CAAA,CAAC,SAAS,CAAC,CAAC,CAAC;YACd,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;YACzB,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAA,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;YACzB,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;QACpB,CAAC;QACD,IAAI,CAAC,CAAC;YACL,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,UAAC,IAAI;gBACpC,IAAI,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC;gBAC9B,EAAE,CAAA,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1C,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;gBAC1B,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,EAAE,CAAC,IAAI,CAAC,CAAC;gBACV,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,oBAAoB;IACpB,iCAAU,GAAV;QACC,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAED,cAAc;IACd,iCAAU,GAAV;QACC,IAAI,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,IAAI,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACzD,UAAU,CAAC,IAAI,CAAC,UAAS,GAAG;YAC3B,IAAI,CAAC;gBACJ,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;gBACtB,IAAI,cAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBACtC,IAAI,OAAO,GAAG,EAAE,CAAC;gBACjB;oBACC,EAAE,CAAA,CAAC,cAAY,IAAI,cAAY,CAAC,MAAM,CAAC,CAAC,CAAC;wBACxC,cAAY,CAAC,OAAO,CAAC,UAAS,OAAO,EAAE,KAAK;4BAC3C,EAAE,CAAA,CAAC,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC;gCAC/B,cAAY,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;4BAC/B,CAAC;wBACF,CAAC,CAAC,CAAA;oBACH,CAAC;oBACG,GAAG,GAAG;wBACT,OAAO,EAAE,MAAM;wBACf,GAAG,EAAE,OAAO;qBACZ,CAAC;oBACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBACrB,cAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;oBALnB,GAAG;gBARR,GAAG,CAAA,CAAC,IAAI,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC;;iBAc9B;gBACD,8BAA8B;gBAC9B,EAAE,CAAA,CAAC,CAAC,cAAY,CAAC,MAAM,CAAC,CAAC,CAAC;oBACzB,IAAI,GAAG,GAAG;wBACT,OAAO,EAAE,WAAW;wBACpB,GAAG,EAAE,OAAO;qBACZ,CAAC;oBACF,cAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACxB,CAAC;gBACD,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;oBACrB,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,cAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBACvC,CAAC;gBACD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,cAAY,CAAC,CAAC,CAAC;gBACzE,IAAI,CAAC,WAAW,EAAE,CAAC;YACpB,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAChB,CAAC;QACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,UAAS,CAAC;YAC7B,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,+BAA+B;IAC/B,qCAAc,GAAd;QACC,IAAI,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACxD,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,EAAE,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC7B,CAAC;IACF,CAAC;IAED,4BAA4B;IAC5B,kCAAW,GAAX;QACC,IAAI,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC1D,EAAE,CAAA,CAAC,QAAQ,CAAC,CAAC,CAAC;YACb,IAAI,CAAC;gBACJ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACtC,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACpB,CAAC;QACF,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,oCAAoC;IACpC,mCAAY,GAAZ;QACC,IAAI,CAAC;YACJ,IAAI,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YAChD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACV,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACvC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAChC,CAAC;QACF,CAAE;QAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;IACf,CAAC;IAED,8BAA8B;IAC9B,qCAAc,GAAd,UAAe,GAAG,EAAE,OAAO;QAC1B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;QAC3C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,GAAG,GAAG;YACT,OAAO,EAAE,OAAO;YAChB,GAAG,EAAE,GAAG;SACR,CAAC;QACF,IAAI,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC1D,EAAE,CAAA,CAAC,QAAQ,CAAC,CAAC,CAAC;YACb,IAAI,CAAC;gBACJ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACtC,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACpB,CAAC;QACF,CAAC;QACD,EAAE,CAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAS,GAAG;gBAChD,MAAM,CAAC,GAAG,CAAC,OAAO,KAAK,OAAO,CAAC;YAChC,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,sCAAe,GAAf;QACC,IAAI,CAAC,OAAO,GAAI,IAAI,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG;YACb,WAAW,EAAE;gBACZ,MAAM,EAAE,EAAE;gBACV,QAAQ,EAAE,EAAE;gBACZ,OAAO,EAAE,IAAI;aACb;YACD,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC;YACV,IAAI,EAAE,EAAE;SACR,CAAC;IACH,CAAC;IAED,oCAAa,GAAb;QACC,EAAE,CAAA,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;YAC1B,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC3B,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;IACD,8BAAO,GAAP;QACC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,GAAG,KAAK,GAAG,IAAI,CAAC;IACxD,CAAC;IAED,sCAAsC;IACtC,uBAAuB;IACvB,wCAAwC;IACxC,8BAAO,GAAP,UAAQ,SAAS;QAChB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAClC,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;QAC1B,IAAI,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QACzC,EAAE,CAAA,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;QAC5C,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;YACtC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC;IAED,+BAA+B;IAC/B,iCAAU,GAAV;QACC,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,UAAS,GAAG;YACjD,IAAI,CAAC;gBACJ,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;gBACtB,IAAI,MAAM,GAAG,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC/C,EAAE,CAAA,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;oBACxF,IAAI,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC;oBAC3D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;oBACvB,EAAE,CAAA,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;2BACzE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;wBACzC,IAAI,CAAC,SAAS,CAAC;4BACd,KAAK,EAAE,qCAAqC;4BAC5C,OAAO,EAAE,sEAAsE;yBAC/E,CAAC,CAAC;oBACJ,CAAC;gBACF,CAAC;YACF,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAChB,CAAC;QACF,CAAC,CAAC,CAAC,KAAK,CAAC,UAAS,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,eAAe;IACf,kCAAW,GAAX,UAAY,SAAS;QACpB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,UAAS,IAAI;YACnD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,8BAA8B,GAAG,IAAI,GAAG,KAAK,CAAC;YACvF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAC7D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC1D,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC;YAE5B,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;gBAChB,IAAI,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAChD,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;oBAC3B,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;gBACtC,CAAC;gBACD,EAAE,CAAA,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;oBACxB,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;gBAClC,CAAC;gBACD,EAAE,CAAA,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;oBAChC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC;oBACjD,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;oBAC5B,UAAU,CAAC,cAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;gBACpF,CAAC;gBACD,EAAE,CAAA,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;oBACzB,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;gBACpC,CAAC;gBACD,EAAE,CAAA,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAC3B,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;gBACxC,CAAC;YACF,CAAC;YAED,iBAAiB;YACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;YAC3D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;YACjD,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YAC1B,UAAU,CAAC;gBACV,EAAE,CAAA,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;oBAC5B,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACzB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,IAAI,CAAC,eAAe,EAAE,CAAC;gBACxB,CAAC;gBACD,oCAAoC;YACrC,CAAC,EAAE,GAAG,CAAC,CAAC;QAET,CAAC,CAAC,CAAC,KAAK,CAAC,UAAS,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACf,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,IAAI,CAAC,SAAS,CAAC;gBACd,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE,kIAAmI;aAC5I,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,kCAAkC;IAClC,kCAAW,GAAX,UAAY,UAAe;QAC1B,IAAI,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;QACtD,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,GAAG,CAAC,CAAC,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QACD,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAClB,IAAI,CAAC,SAAS,CAAC;gBACd,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,GAAC,2GAA2G;aACxI,CAAC,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,KAAK,CAAC;IACd,CAAC;IAED,+BAAQ,GAAR,UAAS,YAAY;QACpB,IAAI,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACrD,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;YACf,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACjC,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,UAAS,KAAK;gBACzC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,YAAY,CAAC,GAAG,CAAC;YAC3E,CAAC,CAAC,CAAC;YACH,IAAI,OAAK,CAAC;YACV,EAAE,CAAA,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;gBACrB,OAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBACrB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;gBACvB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;gBAC7B,IAAI,CAAC,MAAM,GAAG,OAAK,CAAC,MAAM,CAAC;gBAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC5C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,UAAS,GAAG;oBAAZ,iBAuBzC;oBAtBA,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;oBACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;oBAC7D,IAAI,CAAC,eAAe,EAAE,CAAC;oBACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;oBACtB,IAAI,CAAC,MAAM,GAAG,OAAK,CAAC,MAAM,CAAC;oBAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;oBACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;oBACpC,IAAI,CAAC,aAAa,GAAG,OAAK,CAAC,aAAa,CAAC;oBACzC,iBAAiB;oBACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;oBAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;oBAC3D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;oBAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;oBACjD,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;oBAC1B,UAAU,CAAC;wBACV,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;wBACxD,EAAE,CAAA,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;4BAC5B,KAAI,CAAC,gBAAgB,EAAE,CAAC;wBACzB,CAAC;wBAAC,IAAI,CAAC,CAAC;4BACP,KAAI,CAAC,eAAe,EAAE,CAAC;wBACxB,CAAC;oBACH,CAAC,EAAE,GAAG,CAAC,CAAC;gBACR,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;gBACd,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,OAAK,CAAC,IAAI,CAAC;gBAClC,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,OAAK,CAAC,GAAG,CAAC;gBAChC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;YAC7B,CAAC;QACF,CAAC;IACF,CAAC;IAED,kCAAW,GAAX,UAAY,YAAY;QACvB,IAAI,CAAC,kBAAkB,GAAG,YAAY,CAAC;QACvC,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IACD,yCAAkB,GAAlB,UAAmB,WAAgB;QAClC,EAAE,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;YAC5C,IAAI,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC;YAC3C,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,UAAS,KAAU,EAAE,KAAa;gBAC7D,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;oBACxE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACtC,CAAC;YACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACd,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAS,KAAU,EAAE,KAAa;gBAC5D,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;oBACxE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACrC,CAAC;YACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACd,IAAI,CAAC;gBACJ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;YAC3E,CAAE;YAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;QACf,CAAC;QACD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAChC,CAAC;IAED,+BAAQ,GAAR;QACC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG;YACjB,IAAI,EAAE,EAAE;YACR,GAAG,EAAE,EAAE;SACP,CAAC;QACF,IAAI,CAAC,YAAY,IAAI,OAAO,CAAC;QAC7B,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,oCAAa,GAAb;QACC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IAC5C,CAAC;IAED,aAAa;IACb,gCAAS,GAAT,UAAU,UAAe;QACxB,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,YAAY,GAAG;YAClB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;YAC1B,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;QACF,IAAI,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;QACvD,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,UAAS,KAAK,EAAE,KAAK;YAChD,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;gBAClE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACtC,CAAC;QACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACd,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/B,IAAI,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACtD,IAAI,CAAC;YACJ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QAC3E,CAAE;QAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;QACd,CAAC,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,wBAAwB;IACxB,2BAAI,GAAJ,UAAK,IAAS;QACb,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,UAAS,IAAI;YAC7C,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACf,CAAC;IAED,YAAY;IACZ,iCAAU,GAAV,UAAW,GAAQ;QAClB,IAAI,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;QAChC,IAAI,cAAc,GAAG,GAAG,CAAC,cAAc,GAAG,GAAG,CAAC,cAAc,GAAG,KAAK,CAAC;QACrE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YACvC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,UAAS,IAAI;gBAC5D,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;YAChH,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAEd,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;gBAChC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,UAAS,IAAI;oBAC5D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;gBACjE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACf,CAAC;QACF,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,kCAAW,GAAX,UAAY,GAAW;QACtB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QAEpB,iBAAiB;QACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC;IAED,8BAAO,GAAP,UAAQ,QAAa;QACpB,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;YAC/B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAClD,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,iBAAiB,CAAC,CAAC,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC;YACzD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAC9C,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC;YACpC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAC5D,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,mBAAmB,CAAC,CAAC,CAAC;YAC1C,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,KAAK,CAAC;QACzC,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC;YACrC,IAAI,CAAC,mBAAmB,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC3C,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC;YACrC,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC;QACpC,CAAC;QACD,iBAAiB;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC;IAED,uCAAgB,GAAhB;QACC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;YAChB,UAAU,EAAE,KAAK;YACjB,oBAAoB,EAAE,aAAa;YACnC,kBAAkB,EAAE,WAAW;SAC/B,CAAC,CAAC;QACH;YACC,IAAI,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YACtC,CAAC,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACnD,IAAI,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YACpC,IAAI,YAAY,GAAG,UAAU,CAAC;YAC9B,EAAE,CAAA,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAChD,YAAY,IAAI,EAAE,CAAC;YACpB,CAAC;YACD,EAAE,CAAA,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAChD,YAAY,IAAI,GAAG,CAAC;YACrB,CAAC;YACD,EAAE,CAAA,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC/C,YAAY,IAAI,GAAG,CAAC;YACrB,CAAC;YACD,UAAU,CAAC;gBACV,CAAC,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;gBACnD,CAAC,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACzD,CAAC,EAAE,GAAG,CAAC,CAAC;QACT,CAAC;QACD,UAAU,EAAE,CAAC;QACb,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACpC,CAAC;IACD,sCAAe,GAAf;QACC,IAAI,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;QACpC,CAAC,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,GAAE,GAAG,CAAC,CAAC;QACtD,CAAC,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACvD,CAAC;IAED,gCAAS,GAAT,UAAU,cAAmB;QAC5B,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC;IACtC,CAAC;IAED,gCAAS,GAAT,UAAU,IAAS;QAClB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,UAAU,CAAC;YACV,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAClC,EAAE,CAAA,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACtC,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,UAAU,CAAC;oBACV,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACtC,CAAC,EAAE,GAAG,CAAC,CAAC;YACT,CAAC;QACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,+BAAQ,GAAR;QACC,IAAI,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,gCAAS,GAAT;QACC,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,wCAAiB,GAAjB,UAAkB,QAAa;QAC9B,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,IAAI,GAAG,KAAK,CAAC;IACnD,CAAC;IApoBF;QAAC,gBAAS,CAAC;YACV,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,0BAA0B;YACvC,SAAS,EAAE,CAAC,gCAAc,EAAE,gCAAc,EAAE,uBAAU,CAAC;SACvD,CAAC;;oBAAA;IAioBF,mBAAC;AAAD,CAAC,AA/nBD,IA+nBC;AA/nBY,oBAAY,eA+nBxB,CAAA"} \ No newline at end of file +{"version":3,"file":"app.component.js","sourceRoot":"","sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAA2D,eAAe,CAAC,CAAA;AAG3E,gCAA+B,0BAA0B,CAAC,CAAA;AAC1D,gCAA+B,0BAA0B,CAAC,CAAA;AAC1D,2BAA2B,qBAAqB,CAAC,CAAA;AAEjD,2BAA2B,qBAAqB,CAAC,CAAA;AACjD,yBAAyB,mBAAmB,CAAC,CAAA;AAU7C;IAEC,sBAAmB,cAA8B,EAAS,cAA8B,EAAS,UAAsB;QAApG,mBAAc,GAAd,cAAc,CAAgB;QAAS,mBAAc,GAAd,cAAc,CAAgB;QAAS,eAAU,GAAV,UAAU,CAAY;QAEhH,WAAM,GAAG,KAAK,CAAC;QACf,cAAS,GAAY,KAAK,CAAC;QAC3B,oBAAe,GAAY,KAAK,CAAC;QAKjC,iBAAY,GAAW,IAAI,CAAC;QAC5B,WAAM,GAAW;YACvB,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;SACR,CAAC;QACK,mBAAc,GAAQ,EAAE,CAAC;QACzB,eAAU,GAAG;YACnB,IAAI,EAAE,EAAE;YACR,GAAG,EAAE,EAAE;SACP,CAAC;QACK,YAAO,GAAW,WAAW,CAAC;QAC9B,mBAAc,GAAY,IAAI,CAAC;QAC/B,eAAU,GAAW,EAAE,CAAC;QACxB,mBAAc,GAAW,KAAK,CAAC;QAG/B,YAAO,GAAY,KAAK,CAAC;QACzB,kBAAa,GAAY,KAAK,CAAC;QAC/B,aAAQ,GAAQ,EAAE,CAAC;QACnB,cAAS,GAAQ,EAAE,CAAC;QACpB,mBAAc,GAAG,IAAI,uBAAU,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,qBAAgB,GAAG,IAAI,uBAAU,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;QACjE,kBAAa,GAAG,IAAI,uBAAU,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC;QAC5D,aAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC1B,sBAAiB,GAAG,IAAI,CAAC;QACzB,wBAAmB,GAAG,IAAI,CAAC;QAC3B,YAAO,GAAW,KAAK,CAAC;QAG/B,WAAM,GAAG,IAAI,CAAC;QACd,cAAS,GAAG,KAAK,CAAC;QAKX,kBAAa,GAAG,KAAK,CAAC;QACtB,iBAAY,GAAW,UAAU,CAAC;QAClC,iBAAY,GAAY,IAAI,CAAC;QAC7B,mBAAc,GAAQ;YAC5B,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE,mCAAmC;YAC5C,OAAO,EAAE,QAAQ;YACjB,MAAM,EAAE,QAAQ;SAChB,CAAC;QACK,eAAU,GAAQ;YACxB,OAAO,EAAE,eAAe;YACxB,GAAG,EAAE,6EAA6E;SAClF,CAAC;QACK,gBAAW,GAAY,KAAK,CAAC;IA5DsF,CAAC;IA8D3H,+BAAQ,GAAR,cAAa,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;IAErC,mCAAY,GAAZ,UAAa,IAAI;QAChB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,+BAAQ,GAAR;QACC,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;QAC3F,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC;QACnH,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC;QACnH,oBAAoB;QACpB,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,kBAAkB,MAAM;YACvB,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,EAAE,CAAA,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC;gBAC7B,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,CAAC;YACD,EAAE,CAAA,CAAC,MAAM,IAAI,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC;gBACjC,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC7B,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,EAAE,CAAA,CAAC,MAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;oBAC3C,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;gBACjD,CAAC;gBACD,IAAI,CAAC,cAAc,EAAE,CAAC;YACvB,CAAC;QACF,CAAC;IACF,CAAC;IAED,kCAAW,GAAX,UAAY,OAAO;QAClB,IAAI,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC;QAClD,IAAI,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC;IACrD,CAAC;IAED,oEAAoE;IACpE,mCAAY,GAAZ,UAAa,EAAE;QACd,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,IAAI,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;QACnF,IAAI,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;QACpF,IAAI,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;QACrE,EAAE,CAAA,CAAC,SAAS,CAAC,CAAC,CAAC;YACd,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;YACzB,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAA,CAAC,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACnC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;QACpB,CAAC;QACD,IAAI,CAAC,CAAC;YACL,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,UAAC,IAAI;gBACpC,IAAI,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC;gBAC9B,EAAE,CAAA,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1C,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;gBAC1B,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,EAAE,CAAC,IAAI,CAAC,CAAC;gBACV,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,oBAAoB;IACpB,iCAAU,GAAV;QACC,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAED,cAAc;IACd,iCAAU,GAAV;QACC,IAAI,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,IAAI,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACzD,UAAU,CAAC,IAAI,CAAC,UAAS,GAAG;YAC3B,IAAI,CAAC;gBACJ,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;gBACtB,IAAI,cAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBACtC,IAAI,OAAO,GAAG,EAAE,CAAC;gBACjB;oBACC,EAAE,CAAA,CAAC,cAAY,IAAI,cAAY,CAAC,MAAM,CAAC,CAAC,CAAC;wBACxC,cAAY,CAAC,OAAO,CAAC,UAAS,OAAO,EAAE,KAAK;4BAC3C,EAAE,CAAA,CAAC,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC;gCAC/B,cAAY,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;4BAC/B,CAAC;wBACF,CAAC,CAAC,CAAA;oBACH,CAAC;oBACG,GAAG,GAAG;wBACT,OAAO,EAAE,MAAM;wBACf,GAAG,EAAE,OAAO;qBACZ,CAAC;oBACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBACrB,cAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;oBALnB,GAAG;gBARR,GAAG,CAAA,CAAC,IAAI,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC;;iBAc9B;gBACD,8BAA8B;gBAC9B,EAAE,CAAA,CAAC,CAAC,cAAY,CAAC,MAAM,CAAC,CAAC,CAAC;oBACzB,IAAI,GAAG,GAAG;wBACT,OAAO,EAAE,WAAW;wBACpB,GAAG,EAAE,OAAO;qBACZ,CAAC;oBACF,cAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACxB,CAAC;gBACD,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;oBACrB,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,cAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBACvC,CAAC;gBACD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,cAAY,CAAC,CAAC,CAAC;gBACzE,IAAI,CAAC,WAAW,EAAE,CAAC;YACpB,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAChB,CAAC;QACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,UAAS,CAAC;YAC7B,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,+BAA+B;IAC/B,qCAAc,GAAd;QACC,IAAI,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACxD,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,EAAE,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC7B,CAAC;IACF,CAAC;IAED,4BAA4B;IAC5B,kCAAW,GAAX;QACC,IAAI,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC1D,EAAE,CAAA,CAAC,QAAQ,CAAC,CAAC,CAAC;YACb,IAAI,CAAC;gBACJ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACtC,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACpB,CAAC;QACF,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,oCAAoC;IACpC,mCAAY,GAAZ;QACC,IAAI,CAAC;YACJ,IAAI,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YAChD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACV,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACvC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAChC,CAAC;QACF,CAAE;QAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;IACf,CAAC;IAED,8BAA8B;IAC9B,qCAAc,GAAd,UAAe,GAAG,EAAE,OAAO;QAC1B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;QAC3C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,GAAG,GAAG;YACT,OAAO,EAAE,OAAO;YAChB,GAAG,EAAE,GAAG;SACR,CAAC;QACF,IAAI,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC1D,EAAE,CAAA,CAAC,QAAQ,CAAC,CAAC,CAAC;YACb,IAAI,CAAC;gBACJ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACtC,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACpB,CAAC;QACF,CAAC;QACD,EAAE,CAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAS,GAAG;gBAChD,MAAM,CAAC,GAAG,CAAC,OAAO,KAAK,OAAO,CAAC;YAChC,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,sCAAe,GAAf;QACC,IAAI,CAAC,OAAO,GAAI,IAAI,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG;YACb,WAAW,EAAE;gBACZ,MAAM,EAAE,EAAE;gBACV,QAAQ,EAAE,EAAE;gBACZ,OAAO,EAAE,IAAI;aACb;YACD,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC;YACV,IAAI,EAAE,EAAE;SACR,CAAC;IACH,CAAC;IAED,oCAAa,GAAb;QACC,EAAE,CAAA,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;YAC1B,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC3B,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;IACD,8BAAO,GAAP;QACC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,GAAG,KAAK,GAAG,IAAI,CAAC;IACxD,CAAC;IAED,sCAAsC;IACtC,uBAAuB;IACvB,wCAAwC;IACxC,8BAAO,GAAP,UAAQ,SAAS;QAChB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAClC,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;QAC1B,IAAI,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QACzC,EAAE,CAAA,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;QAC5C,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;YACtC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC;IAED,+BAA+B;IAC/B,iCAAU,GAAV;QACC,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,UAAS,GAAG;YACjD,IAAI,CAAC;gBACJ,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;gBACtB,IAAI,MAAM,GAAG,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC/C,EAAE,CAAA,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;oBACxF,IAAI,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC;oBAC3D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;oBACvB,EAAE,CAAA,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;2BACzE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;wBACzC,IAAI,CAAC,SAAS,CAAC;4BACd,KAAK,EAAE,qCAAqC;4BAC5C,OAAO,EAAE,sEAAsE;yBAC/E,CAAC,CAAC;oBACJ,CAAC;gBACF,CAAC;YACF,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAChB,CAAC;QACF,CAAC,CAAC,CAAC,KAAK,CAAC,UAAS,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,eAAe;IACf,kCAAW,GAAX,UAAY,SAAS;QACpB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,UAAS,IAAI;YACnD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,8BAA8B,GAAG,IAAI,GAAG,KAAK,CAAC;YACvF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAC7D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC1D,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC;YAE5B,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;gBAChB,IAAI,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAChD,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;oBAC3B,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;gBACtC,CAAC;gBACD,EAAE,CAAA,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;oBACxB,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;gBAClC,CAAC;gBACD,EAAE,CAAA,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;oBAChC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC;oBACjD,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;oBAC5B,UAAU,CAAC,cAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;gBACpF,CAAC;gBACD,EAAE,CAAA,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;oBACzB,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;gBACpC,CAAC;gBACD,EAAE,CAAA,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAC3B,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;gBACxC,CAAC;YACF,CAAC;YAED,iBAAiB;YACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;YAC3D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;YACjD,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YAC1B,UAAU,CAAC;gBACV,EAAE,CAAA,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;oBAC5B,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACzB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,IAAI,CAAC,eAAe,EAAE,CAAC;gBACxB,CAAC;gBACD,oCAAoC;YACrC,CAAC,EAAE,GAAG,CAAC,CAAC;QAET,CAAC,CAAC,CAAC,KAAK,CAAC,UAAS,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACf,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,IAAI,CAAC,SAAS,CAAC;gBACd,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE,kIAAmI;aAC5I,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,kCAAkC;IAClC,kCAAW,GAAX,UAAY,UAAe;QAC1B,IAAI,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;QACtD,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,GAAG,CAAC,CAAC,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QACD,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAClB,IAAI,CAAC,SAAS,CAAC;gBACd,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,GAAC,2GAA2G;aACxI,CAAC,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,KAAK,CAAC;IACd,CAAC;IAED,+BAAQ,GAAR,UAAS,YAAY;QACpB,IAAI,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACrD,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;YACf,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACjC,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,UAAS,KAAK;gBACzC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,YAAY,CAAC,GAAG,CAAC;YAC3E,CAAC,CAAC,CAAC;YACH,IAAI,OAAK,CAAC;YACV,EAAE,CAAA,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;gBACrB,OAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBACrB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;gBACvB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;gBAC7B,IAAI,CAAC,MAAM,GAAG,OAAK,CAAC,MAAM,CAAC;gBAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC5C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,UAAS,GAAG;oBAAZ,iBAuBzC;oBAtBA,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;oBACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;oBAC7D,IAAI,CAAC,eAAe,EAAE,CAAC;oBACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;oBACtB,IAAI,CAAC,MAAM,GAAG,OAAK,CAAC,MAAM,CAAC;oBAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;oBACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;oBACpC,IAAI,CAAC,aAAa,GAAG,OAAK,CAAC,aAAa,CAAC;oBACzC,iBAAiB;oBACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;oBAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;oBAC3D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;oBAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;oBACjD,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;oBAC1B,UAAU,CAAC;wBACV,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;wBACxD,EAAE,CAAA,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;4BAC5B,KAAI,CAAC,gBAAgB,EAAE,CAAC;wBACzB,CAAC;wBAAC,IAAI,CAAC,CAAC;4BACP,KAAI,CAAC,eAAe,EAAE,CAAC;wBACxB,CAAC;oBACH,CAAC,EAAE,GAAG,CAAC,CAAC;gBACR,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;gBACd,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,OAAK,CAAC,IAAI,CAAC;gBAClC,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,OAAK,CAAC,GAAG,CAAC;gBAChC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;YAC7B,CAAC;QACF,CAAC;IACF,CAAC;IAED,kCAAW,GAAX,UAAY,YAAY;QACvB,IAAI,CAAC,kBAAkB,GAAG,YAAY,CAAC;QACvC,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IACD,yCAAkB,GAAlB,UAAmB,WAAgB;QAClC,EAAE,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;YAC5C,IAAI,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC;YAC3C,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,UAAS,KAAU,EAAE,KAAa;gBAC7D,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;oBACxE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACtC,CAAC;YACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACd,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAS,KAAU,EAAE,KAAa;gBAC5D,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;oBACxE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACrC,CAAC;YACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACd,IAAI,CAAC;gBACJ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;YAC3E,CAAE;YAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;QACf,CAAC;QACD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAChC,CAAC;IAED,+BAAQ,GAAR;QACC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG;YACjB,IAAI,EAAE,EAAE;YACR,GAAG,EAAE,EAAE;SACP,CAAC;QACF,IAAI,CAAC,YAAY,IAAI,OAAO,CAAC;QAC7B,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,oCAAa,GAAb;QACC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IAC5C,CAAC;IAED,aAAa;IACb,gCAAS,GAAT,UAAU,UAAe;QACxB,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,YAAY,GAAG;YAClB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;YAC1B,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;QACF,IAAI,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;QACvD,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,UAAS,KAAK,EAAE,KAAK;YAChD,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;gBAClE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACtC,CAAC;QACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACd,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/B,IAAI,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACtD,IAAI,CAAC;YACJ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QAC3E,CAAE;QAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;QACd,CAAC,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,wBAAwB;IACxB,2BAAI,GAAJ,UAAK,IAAS;QACb,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,UAAS,IAAI;YAC7C,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACf,CAAC;IAED,YAAY;IACZ,iCAAU,GAAV,UAAW,GAAQ;QAClB,IAAI,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;QAChC,IAAI,cAAc,GAAG,GAAG,CAAC,cAAc,GAAG,GAAG,CAAC,cAAc,GAAG,KAAK,CAAC;QACrE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YACvC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,UAAS,IAAI;gBAC5D,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;YAChH,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAEd,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;gBAChC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,UAAS,IAAI;oBAC5D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;gBACjE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACf,CAAC;QACF,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,kCAAW,GAAX,UAAY,GAAW;QACtB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QAEpB,iBAAiB;QACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC;IAED,8BAAO,GAAP,UAAQ,QAAa;QACpB,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;YAC/B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAClD,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,iBAAiB,CAAC,CAAC,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC;YACzD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAC9C,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC;YACpC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAC5D,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,mBAAmB,CAAC,CAAC,CAAC;YAC1C,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,KAAK,CAAC;QACzC,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC;YACrC,IAAI,CAAC,mBAAmB,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC3C,CAAC;QACD,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC;YACrC,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC;QACpC,CAAC;QACD,iBAAiB;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC;IAED,uCAAgB,GAAhB;QACC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;YAChB,UAAU,EAAE,KAAK;YACjB,oBAAoB,EAAE,aAAa;YACnC,kBAAkB,EAAE,WAAW;SAC/B,CAAC,CAAC;QACH;YACC,IAAI,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YACtC,CAAC,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACnD,IAAI,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YACpC,IAAI,YAAY,GAAG,UAAU,CAAC;YAC9B,EAAE,CAAA,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAChD,YAAY,IAAI,EAAE,CAAC;YACpB,CAAC;YACD,EAAE,CAAA,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAChD,YAAY,IAAI,GAAG,CAAC;YACrB,CAAC;YACD,EAAE,CAAA,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC/C,YAAY,IAAI,GAAG,CAAC;YACrB,CAAC;YACD,UAAU,CAAC;gBACV,CAAC,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;gBACnD,CAAC,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACzD,CAAC,EAAE,GAAG,CAAC,CAAC;QACT,CAAC;QACD,UAAU,EAAE,CAAC;QACb,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACpC,CAAC;IACD,sCAAe,GAAf;QACC,IAAI,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;QACpC,CAAC,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,GAAE,GAAG,CAAC,CAAC;QACtD,CAAC,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACvD,CAAC;IAED,gCAAS,GAAT,UAAU,cAAmB;QAC5B,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC;IACtC,CAAC;IAED,gCAAS,GAAT,UAAU,IAAS;QAClB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,UAAU,CAAC;YACV,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAClC,EAAE,CAAA,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACtC,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,UAAU,CAAC;oBACV,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACtC,CAAC,EAAE,GAAG,CAAC,CAAC;YACT,CAAC;QACF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,+BAAQ,GAAR;QACC,IAAI,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,gCAAS,GAAT;QACC,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,wCAAiB,GAAjB,UAAkB,QAAa;QAC9B,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,IAAI,GAAG,KAAK,CAAC;IACnD,CAAC;IAroBF;QAAC,gBAAS,CAAC;YACV,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,0BAA0B;YACvC,SAAS,EAAE,CAAC,gCAAc,EAAE,gCAAc,EAAE,uBAAU,CAAC;SACvD,CAAC;;oBAAA;IAkoBF,mBAAC;AAAD,CAAC,AAhoBD,IAgoBC;AAhoBY,oBAAY,eAgoBxB,CAAA"} \ No newline at end of file diff --git a/app/shared/urlShare.js b/app/shared/urlShare.js index 1e900d5df..d9c4bcb4f 100644 --- a/app/shared/urlShare.js +++ b/app/shared/urlShare.js @@ -64,6 +64,18 @@ exports.UrlShare.prototype.decryptUrl = function (cb) { resolve({ error: error, data: data }); }); } + else if (_this.queryParams && _this.queryParams.app) { + try { + var config = JSON.parse(_this.queryParams.app); + var data = { + config: config + }; + resolve({ error: null, data: data }); + } + catch (e) { + resolve({ error: e }); + } + } else { resolve({ error: 'Empty url' }); } @@ -127,9 +139,12 @@ exports.UrlShare.prototype.decompress = function (compressed, cb) { } }; exports.UrlShare.prototype.getQueryParameters = function (str) { - var hash = window.location.hash.split('#'); + var tempurl = decodeURIComponent(window.location.href); + var hash = tempurl.split('#'); if (hash.length > 1) { - return (str || hash[1]).replace(/(^\?)/, '').split("&").map(function (n) { return n = n.split("="), this[n[0]] = n[1], this; }.bind({}))[0]; + return (str || hash[1]).replace(/(^\?)/, '').split("&").map(function (n) { + return n = n.split("="), this[n[0]] = n[1], this; + }.bind({}))[0]; } else { return null; diff --git a/app/shared/urlShare.js.map b/app/shared/urlShare.js.map index 485d922c7..24c5d1ca5 100644 --- a/app/shared/urlShare.js.map +++ b/app/shared/urlShare.js.map @@ -1 +1 @@ -{"version":3,"file":"urlShare.js","sourceRoot":"","sources":["urlShare.ts"],"names":[],"mappings":";AACW,gBAAQ,GAAG;IACrB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IAClB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;IACxB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACjB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;AACf,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,SAAS,GAAG;IAC9B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;AACpB,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,SAAS,GAAG,UAAS,MAAW;IAClD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,SAAS,EAAE,CAAC;AAClB,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,SAAS,GAAG;IAC9B,EAAE,CAAA,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;QACjD,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;IAC1C,CAAC;IACD,EAAE,CAAA,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACtD,CAAC;IACD,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,IAAI,CAAC;QACJ,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC;QACvC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAC7B,CAAE;IAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;IACb,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,oBAAoB,KAAK,EAAE,UAAU;QACpC,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACX,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC;YACtB,EAAE,CAAA,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxD,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;YACvE,CAAC;YACD,IAAI,QAAQ,GAAG,gBAAgB,GAAG,UAAU,CAAC;YAC7C,GAAG,CAAA,CAAC,IAAI,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;gBACpC,EAAE,CAAA,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC;oBAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9C,QAAQ,IAAI,GAAG,GAAC,MAAM,GAAC,GAAG,GAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBACrD,CAAC;YACF,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC;QACjC,CAAC;IACF,CAAC;AACF,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,UAAU,GAAG,UAAS,EAAE;IAAX,iBAoB/B;IAnBA,MAAM,CAAC,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAClC,KAAI,CAAC,WAAW,GAAG,KAAI,CAAC,kBAAkB,EAAE,CAAC;QAC7C,EAAE,CAAC,CAAC,KAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;YACnC,KAAI,CAAC,UAAU,CAAC,KAAI,CAAC,WAAW,CAAC,WAAW,EAAE,UAAS,KAAK,EAAE,IAAI;gBAChE,EAAE,CAAA,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;oBACrC,IAAI,CAAC,MAAM,GAAG;wBACb,OAAO,EAAE,IAAI,CAAC,OAAO;wBACrB,GAAG,EAAE,IAAI,CAAC,GAAG;qBACb,CAAC;gBACH,CAAC;gBAAC,EAAE,CAAA,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;oBACnC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAC5B,CAAC;gBACD,OAAO,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC;QACJ,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,OAAO,CAAC,EAAC,KAAK,EAAC,WAAW,EAAC,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,YAAY,GAAG,UAAS,IAAI;IAC9C,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC;IAC1B,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,EAAE,CAAA,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC;QACvB,SAAS,GAAG,2CAA2C,GAAC,UAAU,CAAC;IACpE,CAAC;IACD,IAAI,CAAC,CAAC;QACL,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAE,gBAAgB,GAAC,UAAU,CAAC;IACjG,CAAC;IACD,MAAM,CAAC,SAAS,CAAC;AAClB,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,UAAU,GAAG;IAC/B,IAAI,SAAS,GAAG,uDAAuD,GAAC,IAAI,CAAC,GAAG,CAAC;IACjF,MAAM,CAAC,SAAS,CAAC;AAClB,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAS,SAAS,EAAE,EAAE;IACnD,EAAE,CAAA,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC;IACxC,CAAC;IAAC,IAAI,CAAC,CAAC;QACR,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,UAAS,GAAG,EAAE,KAAK;YAC7C,IAAI,CAAC;gBACN,IAAI,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACpC,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACnC,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACb,EAAE,CAAC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,UAAU,GAAG,UAAS,UAAU,EAAE,EAAE;IACtD,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,EAAE,CAAA,CAAC,UAAU,CAAC,CAAC,CAAC;QACf,IAAI,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACnD,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,UAAS,GAAG,EAAE,KAAK;YACzE,IAAI,aAAa,GAAG,GAAG,CAAC;YACxB,IAAI,CAAC;gBACJ,EAAE,CAAA,CAAC,aAAa,CAAC,CAAC,CAAC;oBAClB,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;oBAC1C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;oBACnC,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;gBACzB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,EAAE,CAAC,WAAW,CAAC,CAAC;gBACjB,CAAC;YACA,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACb,EAAE,CAAC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;AACF,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAS,GAAG;IACnD,IAAI,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,EAAE,CAAA,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAS,CAAC,IAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAC,IAAI,CAAA,CAAA,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtI,CAAC;IAAC,IAAI,CAAC,CAAC;QACN,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;AACF,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"urlShare.js","sourceRoot":"","sources":["urlShare.ts"],"names":[],"mappings":";AACW,gBAAQ,GAAG;IACrB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IAClB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;IACxB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACjB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;AACf,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,SAAS,GAAG;IAC9B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;AACpB,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,SAAS,GAAG,UAAS,MAAW;IAClD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,SAAS,EAAE,CAAC;AAClB,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,SAAS,GAAG;IAC9B,EAAE,CAAA,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;QACjD,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;IAC1C,CAAC;IACD,EAAE,CAAA,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACtD,CAAC;IACD,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,IAAI,CAAC;QACJ,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC;QACvC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAC7B,CAAE;IAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;IACb,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,oBAAoB,KAAK,EAAE,UAAU;QACpC,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACX,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC;YACtB,EAAE,CAAA,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxD,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;YACvE,CAAC;YACD,IAAI,QAAQ,GAAG,gBAAgB,GAAG,UAAU,CAAC;YAC7C,GAAG,CAAA,CAAC,IAAI,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;gBACpC,EAAE,CAAA,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC;oBAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9C,QAAQ,IAAI,GAAG,GAAC,MAAM,GAAC,GAAG,GAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBACrD,CAAC;YACF,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC;QACjC,CAAC;IACF,CAAC;AACF,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,UAAU,GAAG,UAAS,EAAE;IAAX,iBA8B/B;IA7BA,MAAM,CAAC,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAClC,KAAI,CAAC,WAAW,GAAG,KAAI,CAAC,kBAAkB,EAAE,CAAC;QAC7C,EAAE,CAAC,CAAC,KAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;YAClC,KAAI,CAAC,UAAU,CAAC,KAAI,CAAC,WAAW,CAAC,WAAW,EAAE,UAAS,KAAK,EAAE,IAAI;gBACjE,EAAE,CAAA,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;oBACrC,IAAI,CAAC,MAAM,GAAG;wBACb,OAAO,EAAE,IAAI,CAAC,OAAO;wBACrB,GAAG,EAAE,IAAI,CAAC,GAAG;qBACb,CAAC;gBACH,CAAC;gBAAC,EAAE,CAAA,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;oBACnC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAC5B,CAAC;gBACD,OAAO,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC;QACJ,CAAC;QAAC,IAAI,CAAC,EAAE,CAAA,CAAC,KAAI,CAAC,WAAW,IAAI,KAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YACpD,IAAI,CAAC;gBACJ,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;gBAChD,IAAM,IAAI,GAAG;oBACZ,QAAA,MAAM;iBACN,CAAA;gBACD,OAAO,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;YACpC,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,OAAO,CAAC,EAAC,KAAK,EAAE,CAAC,EAAC,CAAC,CAAC;YACrB,CAAC;QACF,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,OAAO,CAAC,EAAC,KAAK,EAAC,WAAW,EAAC,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,YAAY,GAAG,UAAS,IAAI;IAC9C,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC;IAC1B,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,EAAE,CAAA,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC;QACvB,SAAS,GAAG,2CAA2C,GAAC,UAAU,CAAC;IACpE,CAAC;IACD,IAAI,CAAC,CAAC;QACL,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAE,gBAAgB,GAAC,UAAU,CAAC;IACjG,CAAC;IACD,MAAM,CAAC,SAAS,CAAC;AAClB,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,UAAU,GAAG;IAC/B,IAAI,SAAS,GAAG,uDAAuD,GAAC,IAAI,CAAC,GAAG,CAAC;IACjF,MAAM,CAAC,SAAS,CAAC;AAClB,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAS,SAAS,EAAE,EAAE;IACnD,EAAE,CAAA,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC;IACxC,CAAC;IAAC,IAAI,CAAC,CAAC;QACR,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,UAAS,GAAG,EAAE,KAAK;YAC7C,IAAI,CAAC;gBACN,IAAI,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACpC,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACnC,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACb,EAAE,CAAC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,UAAU,GAAG,UAAS,UAAU,EAAE,EAAE;IACtD,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,EAAE,CAAA,CAAC,UAAU,CAAC,CAAC,CAAC;QACf,IAAI,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACnD,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,UAAS,GAAG,EAAE,KAAK;YACzE,IAAI,aAAa,GAAG,GAAG,CAAC;YACxB,IAAI,CAAC;gBACJ,EAAE,CAAA,CAAC,aAAa,CAAC,CAAC,CAAC;oBAClB,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;oBAC1C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;oBACnC,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;gBACzB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,EAAE,CAAC,WAAW,CAAC,CAAC;gBACjB,CAAC;YACA,CAAE;YAAA,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;gBACb,EAAE,CAAC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;AACF,CAAC,CAAA;AAED,gBAAQ,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAS,GAAG;IACnD,IAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzD,IAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAS,CAAC;YACrE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAA;QAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;AACF,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/angular/build.js b/dist/angular/build.js index 45ae3bb4b..c01cda3c6 100644 --- a/dist/angular/build.js +++ b/dist/angular/build.js @@ -108,11 +108,12 @@ var AppComponent = (function () { var config = null; var isDefault = window.location.href.indexOf('#?default=true') > -1 ? true : false; var isInputState = window.location.href.indexOf('input_state=') > -1 ? true : false; + var isApp = window.location.href.indexOf('app=') > -1 ? true : false; if (isDefault) { config = this.defaultApp; return cb(config); } - else if (!isInputState) { + else if (!isInputState && !isApp) { return cb('learn'); } else { @@ -8829,6 +8830,18 @@ exports.UrlShare.prototype.decryptUrl = function (cb) { resolve({ error: error, data: data }); }); } + else if (_this.queryParams && _this.queryParams.app) { + try { + var config = JSON.parse(_this.queryParams.app); + var data = { + config: config + }; + resolve({ error: null, data: data }); + } + catch (e) { + resolve({ error: e }); + } + } else { resolve({ error: 'Empty url' }); } @@ -8892,9 +8905,12 @@ exports.UrlShare.prototype.decompress = function (compressed, cb) { } }; exports.UrlShare.prototype.getQueryParameters = function (str) { - var hash = window.location.hash.split('#'); + var tempurl = decodeURIComponent(window.location.href); + var hash = tempurl.split('#'); if (hash.length > 1) { - return (str || hash[1]).replace(/(^\?)/, '').split("&").map(function (n) { return n = n.split("="), this[n[0]] = n[1], this; }.bind({}))[0]; + return (str || hash[1]).replace(/(^\?)/, '').split("&").map(function (n) { + return n = n.split("="), this[n[0]] = n[1], this; + }.bind({}))[0]; } else { return null; diff --git a/dist/angular/build.min.js b/dist/angular/build.min.js index efdd88733..827980525 100644 --- a/dist/angular/build.min.js +++ b/dist/angular/build.min.js @@ -1,17 +1,17 @@ -!function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("./shared/appbase.service"),a=t("./shared/storage.service"),u=t("./shared/docService"),c=t("./shared/editorHook"),l=t("./shared/urlShare"),p=function(){function t(t,e,n){this.appbaseService=t,this.storageService=e,this.docService=n,this.BRANCH="dev",this.connected=!1,this.initial_connect=!1,this.detectChange=null,this.config={url:"",appname:"",username:"",password:"",host:""},this.savedQueryList=[],this.query_info={name:"",tag:""},this.sort_by="createdAt",this.sort_direction=!0,this.searchTerm="",this.searchByMethod="tag",this.sidebar=!1,this.hide_url_flag=!1,this.appsList=[],this.errorInfo={},this.editorHookHelp=new c.EditorHook({editorId:"editor"}),this.responseHookHelp=new c.EditorHook({editorId:"responseBlock"}),this.errorHookHelp=new c.EditorHook({editorId:"errorEditor"}),this.urlShare=new l.UrlShare,this.result_time_taken=null,this.result_random_token=null,this.version="2.0",this.active=!0,this.submitted=!1,this.setLayoutFlag=!1,this.responseMode="historic",this.isAppbaseApp=!0,this.deleteItemInfo={title:"Confirm Deletion",message:"Do you want to delete this query?",yesText:"Delete",noText:"Cancel"},this.defaultApp={appname:"2016primaries",url:"https://Uy82NeW8e:c7d02cce-94cc-4b60-9b17-7e7325195851@scalr.api.appbase.io"},this.appSelected=!1}return t.prototype.onSubmit=function(){this.submitted=!0},t.prototype.setDocSample=function(t){this.docLink=t},t.prototype.ngOnInit=function(){function t(t){this.setInitialValue(),this.getQueryList(),this.getAppsList(),"master"===this.BRANCH&&this.EsSpecific(),t&&"learn"===t?($("#learnModal").modal("show"),this.initial_connect=!0):(t&&t.url&&t.appname&&this.setLocalConfig(t.url,t.appname),this.getLocalConfig())}$("body").removeClass("is-loadingApp"),this.queryParams=this.urlShare.getQueryParameters(),this.allowHF=!this.queryParams||!this.queryParams.hasOwnProperty("hf"),this.allowF=!!this.allowHF&&(!this.queryParams||!this.queryParams.hasOwnProperty("f")),this.allowH=!!this.allowHF&&(!this.queryParams||!this.queryParams.hasOwnProperty("h")),this.detectConfig(t.bind(this))},t.prototype.ngOnChanges=function(t){t.selectedQuery.previousValue,t.selectedQuery.currentValue},t.prototype.detectConfig=function(t){var e=null,n=window.location.href.indexOf("#?default=true")>-1,r=window.location.href.indexOf("input_state=")>-1;return n?(e=this.defaultApp,t(e)):r?void this.urlShare.decryptUrl().then(function(e){var n=e.data;t(n&&n.config?n.config:null)}):t("learn")},t.prototype.EsSpecific=function(){this.getIndices()},t.prototype.getIndices=function(){var t=document.URL.split("/_plugin/")[0],e=this.appbaseService.getIndices(t);e.then(function(e){try{var n,r=e.json(),i=this.getAppsList(),o=[],s=function(e){i&&i.length&&i.forEach(function(t,n){t.appname===e&&i.splice(n,1)}),n={appname:e,url:t},o.push(e),i.push(n)};for(var a in r.indices)s(a);if(!i.length){var n={appname:"sampleapp",url:t};i.push(n)}this.config.url||(this.config.url=i[0].url),this.storageService.set("mirage-appsList",JSON.stringify(i)),this.getAppsList()}catch(u){console.log(u)}}.bind(this))["catch"](function(t){console.log("Not able to get the version.")})},t.prototype.getLocalConfig=function(){var t=this.storageService.get("mirage-url"),e=this.storageService.get("mirage-appname");this.getAppsList(),null!=t?(this.config.url=t,this.config.appname=e,this.connect(!1)):this.initial_connect=!0},t.prototype.getAppsList=function(){var t=this.storageService.get("mirage-appsList");if(t)try{this.appsList=JSON.parse(t)}catch(e){this.appsList=[]}return this.appsList},t.prototype.getQueryList=function(){try{var t=this.storageService.get("queryList");t&&(this.savedQueryList=JSON.parse(t),this.sort(this.savedQueryList))}catch(e){}},t.prototype.setLocalConfig=function(t,e){this.storageService.set("mirage-url",t),this.storageService.set("mirage-appname",e);var n={appname:e,url:t},r=this.storageService.get("mirage-appsList");if(r)try{this.appsList=JSON.parse(r)}catch(i){this.appsList=[]}this.appsList.length&&(this.appsList=this.appsList.filter(function(t){return t.appname!==e})),this.appsList.push(n),this.storageService.set("mirage-appsList",JSON.stringify(this.appsList))},t.prototype.setInitialValue=function(){this.mapping=null,this.types=[],this.selectedTypes=[],this.result={resultQuery:{type:"",result:[],"final":"{}"},output:{},queryId:1,sort:[]}},t.prototype.connectHandle=function(){this.connected?(this.initial_connect=!0,this.connected=!1,this.urlShare.inputs={},this.urlShare.createUrl()):this.connect(!0)},t.prototype.hideUrl=function(){this.hide_url_flag=!this.hide_url_flag},t.prototype.connect=function(t){this.connected=!1,this.initial_connect=!1;var e=(this.config.appname,this.config.url),n=this.appbaseService.filterurl(e);console.log(this.config,n),n?(this.config.username=n.username,this.config.password=n.password,this.config.host=n.url,this.appbaseService.setAppbase(this.config),this.getVersion(),this.getMappings(t)):console.log("Not able to filter url",e)},t.prototype.getVersion=function(){var t=this;this.appbaseService.getVersion().then(function(e){try{var n=e.json(),r=n&&n[t.config.appname];if(r&&r.settings&&r.settings.index&&r.settings.index.version){var i=r.settings.index.version.created_string;t.version=i,"2"!==t.version.split(".")[0]&&"5"!==t.version.split(".")[0]&&"6"!==t.version.split(".")[0]&&t.errorShow({title:"Elasticsearch Version Not Supported",message:"Mirage only supports v2.x, v5.x and v6.x* of Elasticsearch Query DSL"})}}catch(o){console.log(o)}})["catch"](function(t){console.log("Not able to get the version.")})},t.prototype.getMappings=function(t){var e=this;this.appbaseService.getMappings().then(function(n){if(e.isAppbaseApp="https://scalr.api.appbase.io"===e.config.host,e.connected=!0,e.setInitialValue(),e.finalUrl=e.config.host+"/"+e.config.appname,e.mapping=n,e.types=e.seprateType(n),e.setLocalConfig(e.config.url,e.config.appname),e.detectChange+="done",!t){var r=e.urlShare.decryptedData;r.mapping&&(e.mapping=r.mapping),r.types&&(e.types=r.types),r.selectedTypes&&(e.selectedTypes=r.selectedTypes,e.detectChange="check",setTimeout(function(){$("#setType").val(e.selectedTypes).trigger("change")},300)),r.result&&(e.result=r.result),r.finalUrl&&(e.finalUrl=r.finalUrl)}e.urlShare.inputs.config=e.config,e.urlShare.inputs.selectedTypes=e.selectedTypes,e.urlShare.inputs.result=e.result,e.urlShare.inputs.finalUrl=e.finalUrl,e.urlShare.createUrl(),setTimeout(function(){$("body").width()>768?e.setLayoutResizer():e.setMobileLayout()},300)})["catch"](function(t){console.log(t),e.initial_connect=!0,e.errorShow({title:"Authentication Error",message:"It looks like your app name, username, password combination doesn't match. Check your url and appname and then connect it again."})})},t.prototype.seprateType=function(t){var e=t[this.config.appname].mappings,n=[];for(var r in e)n.push(r);return n.length||this.errorShow({title:"Type does not exist.",message:this.config.appname+" does not contain any type mapping. You should *first* create a type mapping to perform query operations."}),n},t.prototype.newQuery=function(t){var e=this.storageService.get("queryList");if(e){var n,r=JSON.parse(e),i=r.filter(function(e){return e.name===t.name&&e.tag===t.tag});i.length&&(n=i[0],this.connected=!1,this.initial_connect=!1,this.config=n.config,this.appbaseService.setAppbase(this.config),this.appbaseService.get("/_mapping").then(function(t){var e=this,r=t.json();this.finalUrl=this.config.host+"/"+this.config.appname,this.setInitialValue(),this.connected=!0,this.result=n.result,this.mapping=r,this.types=this.seprateType(r),this.selectedTypes=n.selectedTypes,this.urlShare.inputs.config=this.config,this.urlShare.inputs.selectedTypes=this.selectedTypes,this.urlShare.inputs.result=this.result,this.urlShare.inputs.finalUrl=this.finalUrl,this.urlShare.createUrl(),setTimeout(function(){$("#setType").val(e.selectedTypes).trigger("change"),$("body").width()>768?e.setLayoutResizer():e.setMobileLayout()},300)}.bind(this)),this.query_info.name=n.name,this.query_info.tag=n.tag,this.detectChange="check")}},t.prototype.deleteQuery=function(t){this.currentDeleteQuery=t,$("#confirmModal").modal("show")},t.prototype.confirmDeleteQuery=function(t){if(t&&this.currentDeleteQuery){var e=this.currentDeleteQuery;this.getQueryList(),this.savedQueryList.forEach(function(t,n){t.name===e.name&&t.tag===e.tag&&this.savedQueryList.splice(n,1)}.bind(this)),this.filteredQuery.forEach(function(t,n){t.name===e.name&&t.tag===e.tag&&this.filteredQuery.splice(n,1)}.bind(this));try{this.storageService.set("queryList",JSON.stringify(this.savedQueryList))}catch(n){}}this.currentDeleteQuery=null},t.prototype.clearAll=function(){this.setInitialValue(),this.query_info={name:"",tag:""},this.detectChange+="check",this.editorHookHelp.setValue("")},t.prototype.sidebarToggle=function(){this.sidebar=!this.sidebar},t.prototype.saveQuery=function(t){this.getQueryList();var e=(new Date).getTime(),n={name:this.query_info.name,tag:this.query_info.tag,config:this.config,selectedTypes:this.selectedTypes,result:this.result,version:this.version},r=t?t:n;r.createdAt=e,this.savedQueryList.forEach(function(t,e){t.name===r.name&&t.tag===r.tag&&this.savedQueryList.splice(e,1)}.bind(this)),this.savedQueryList.push(r),this.sort(this.savedQueryList);JSON.stringify(this.savedQueryList);try{this.storageService.set("queryList",JSON.stringify(this.savedQueryList))}catch(i){}$("#saveQueryModal").modal("hide")},t.prototype.sort=function(t){this.sort_by="createdAt",this.filteredQuery=t.sortBy(function(t){return-t[this.sort_by]}.bind(this))},t.prototype.searchList=function(t){var e=t.searchTerm,n=t.searchByMethod?t.searchByMethod:"tag";this.searchTerm=e,this.searchByMethod=n,this.searchTerm.trim().length>1?(this.filteredQuery=this.savedQueryList.filter(function(t){return!(!t[this.searchByMethod]||t[this.searchByMethod].indexOf(this.searchTerm)===-1)}.bind(this)),this.filteredQuery.length||(this.filteredQuery=this.savedQueryList.filter(function(t){return t.name.indexOf(this.searchTerm)!==-1}.bind(this)))):this.filteredQuery=this.savedQueryList,this.sort(this.filteredQuery)},t.prototype.setFinalUrl=function(t){this.finalUrl=t,this.urlShare.inputs.finalUrl=this.finalUrl,this.urlShare.createUrl()},t.prototype.setProp=function(t){"finalUrl"===t.name&&(this.finalUrl=t.value,this.urlShare.inputs.finalUrl=this.finalUrl),"availableFields"===t.name&&(this.result.resultQuery.availableFields=t.value,this.urlShare.inputs.result=this.result),"selectedTypes"===t.name&&(this.selectedTypes=t.value,this.urlShare.inputs.selectedTypes=this.selectedTypes),"result_time_taken"===t.name&&(this.result_time_taken=t.value),"random_token"===t.name&&(this.result_random_token=t.value),"responseMode"===t.name&&(this.responseMode=t.value),this.urlShare.createUrl()},t.prototype.setLayoutResizer=function(){function t(){var t=$(window).height();$(".features-section").css("height",t);var n=$("body").height(),r=n;e.allowHF&&e.allowF&&!e.allowH&&(r-=15),e.allowHF&&e.allowH&&!e.allowF&&(r-=140),e.allowHF&&e.allowH&&e.allowF&&(r-=166),setTimeout(function(){$("#mirage-container").css("height",r),$("#paneCenter, #paneEast").css("height",r)},300)}this.setLayoutFlag=!0;var e=this;$("body").layout({east__size:"50%",center__paneSelector:"#paneCenter",east__paneSelector:"#paneEast"}),t(),$(window).on("resize",t)},t.prototype.setMobileLayout=function(){var t=$("body").height();$("#mirage-container").css("height",t-116),$("#paneCenter, #paneEast").css("height",t)},t.prototype.setConfig=function(t){this.config.appname=t.appname,this.config.url=t.url},t.prototype.errorShow=function(t){var e=this;this.errorInfo=t,$("#errorModal").modal("show");var n=t.message;e.errorHookHelp.focus(n),setTimeout(function(){e.errorHookHelp.focus(n),$("#errorModal").hasClass("in")?e.errorHookHelp.setValue(n):setTimeout(function(){e.errorHookHelp.setValue(n)},300)}.bind(this),500)},t.prototype.viewData=function(){var t=this.urlShare.dejavuLink();window.open(t,"_blank")},t.prototype.openLearn=function(){$("#learnModal").modal("show")},t.prototype.onAppSelectChange=function(t){this.appSelected=!!t.trim()},t=r([o.Component({selector:"my-app",templateUrl:"./app/app.component.html",providers:[s.AppbaseService,a.StorageService,u.DocService]}),i("design:paramtypes",[s.AppbaseService,a.StorageService,u.DocService])],t)}();n.AppComponent=p},{"./shared/appbase.service":51,"./shared/docService":52,"./shared/editorHook":53,"./shared/storage.service":58,"./shared/urlShare":59,"@angular/core":62}],2:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/platform-browser"),a=t("@angular/forms"),u=t("@angular/http"),c=t("./app.component"),l=t("./queryBlocks/queryBlocks.component"),p=t("./jsonEditor/jsonEditor.component"),h=t("./result/result.component"),f=t("./features/save/save.query.component"),d=t("./features/list/list.query.component"),y=t("./features/share/share.url.component"),m=t("./features/modal/error-modal.component"),v=t("./features/confirm/confirm-modal.component"),g=t("./features/appselect/appselect.component"),_=t("./features/docSidebar/docsidebar.component"),b=t("./features/learn/learn.component"),w=t("./queryBlocks/boolquery/boolquery.component"),E=t("./queryBlocks/types/types.component"),O=t("./queryBlocks/singlequery/singlequery.component"),C=t("./queryBlocks/editable/editable.component"),S=t("./queryBlocks/select2/select2.component"),x=t("./features/subscribe/subscribe.component"),P=t("./features/subscribe/AuthOperation"),T=t("./queryBlocks/singlequery/queries/match.query"),N=t("./queryBlocks/singlequery/queries/match_phrase.query"),k=t("./queryBlocks/singlequery/queries/match_phase_prefix.query"),A=t("./queryBlocks/singlequery/queries/range.query"),R=t("./queryBlocks/singlequery/queries/gt.query"),I=t("./queryBlocks/singlequery/queries/lt.query"),q=t("./queryBlocks/singlequery/queries/term.query"),M=t("./queryBlocks/singlequery/queries/exists.query"),j=t("./queryBlocks/singlequery/queries/terms.query"),F=t("./queryBlocks/singlequery/queries/prefix.query"),D=t("./queryBlocks/singlequery/queries/multi-match.query"),L=t("./queryBlocks/singlequery/queries/query_string.query"),V=t("./queryBlocks/singlequery/queries/simple_query_string.query"),Q=t("./queryBlocks/singlequery/queries/missing.query"),U=t("./queryBlocks/singlequery/queries/wildcard.query"),B=t("./queryBlocks/singlequery/queries/regexp.query"),H=t("./queryBlocks/singlequery/queries/fuzzy.query"),z=t("./queryBlocks/singlequery/queries/ids.query"),G=t("./queryBlocks/singlequery/queries/common.query"),W=t("./queryBlocks/singlequery/queries/geodistance.query"),J=t("./queryBlocks/singlequery/queries/geoboundingbox.query"),$=t("./queryBlocks/singlequery/queries/geodistancerange.query"),K=t("./queryBlocks/singlequery/queries/geopolygon.query"),X=t("./queryBlocks/singlequery/queries/geohashcell.query"),Z=t("./queryBlocks/singlequery/queries/geoshape.query"),Y=t("./queryBlocks/singlequery/queries/span_term.query"),tt=t("./queryBlocks/singlequery/queries/span_first.query"),et=t("./shared/pipes/prettyJson"),nt=t("./shared/pipes/prettyTime"),rt=t("./features/list/time/time.component"),it=t("./queryBlocks/sortBlock/sortBlock.component"),ot=function(){function t(){}return t=r([o.NgModule({imports:[s.BrowserModule,a.FormsModule,u.HttpModule],declarations:[c.AppComponent,l.QueryBlocksComponent,p.JsonEditorComponent,h.ResultComponent,f.SaveQueryComponent,d.ListQueryComponent,y.ShareUrlComponent,g.AppselectComponent,m.ErrorModalComponent,_.DocSidebarComponent,v.ConfirmModalComponent,b.LearnModalComponent,w.BoolqueryComponent,E.TypesComponent,it.SortBlockComponent,O.SinglequeryComponent,C.EditableComponent,S.select2Component,x.SubscribeModalComponent,P.AuthOperation,C.EditableComponent,O.SinglequeryComponent,S.select2Component,T.MatchQuery,N.Match_phraseQuery,k.Match_phase_prefixQuery,A.RangeQuery,R.GtQuery,I.LtQuery,q.TermQuery,j.TermsQuery,M.ExistsQuery,D.MultiMatchQuery,L.QueryStringQuery,V.SimpleQueryStringQuery,Q.MissingQuery,F.PrefixQuery,U.WildcardQuery,B.RegexpQuery,H.FuzzyQuery,z.IdsQuery,W.GeoDistanceQuery,J.GeoBoundingBoxQuery,$.GeoDistanceRangeQuery,K.GeoPolygonQuery,X.GeoHashCellQuery,Z.GeoShapeQuery,G.CommonQuery,Y.SpanTermQuery,tt.SpanFirstQuery,et.prettyJson,rt.TimeComponent,nt.prettyTime],bootstrap:[c.AppComponent]}),i("design:paramtypes",[])],t)}();n.AppModule=ot},{"./app.component":1,"./features/appselect/appselect.component":4,"./features/confirm/confirm-modal.component":5,"./features/docSidebar/docsidebar.component":6,"./features/learn/learn.component":7,"./features/list/list.query.component":8,"./features/list/time/time.component":9,"./features/modal/error-modal.component":10,"./features/save/save.query.component":11,"./features/share/share.url.component":12,"./features/subscribe/AuthOperation":13,"./features/subscribe/subscribe.component":14,"./jsonEditor/jsonEditor.component":15,"./queryBlocks/boolquery/boolquery.component":16,"./queryBlocks/editable/editable.component":17,"./queryBlocks/queryBlocks.component":18,"./queryBlocks/select2/select2.component":19,"./queryBlocks/singlequery/queries/common.query":20,"./queryBlocks/singlequery/queries/exists.query":21,"./queryBlocks/singlequery/queries/fuzzy.query":22,"./queryBlocks/singlequery/queries/geoboundingbox.query":23,"./queryBlocks/singlequery/queries/geodistance.query":24,"./queryBlocks/singlequery/queries/geodistancerange.query":25,"./queryBlocks/singlequery/queries/geohashcell.query":26,"./queryBlocks/singlequery/queries/geopolygon.query":27,"./queryBlocks/singlequery/queries/geoshape.query":28,"./queryBlocks/singlequery/queries/gt.query":29,"./queryBlocks/singlequery/queries/ids.query":30,"./queryBlocks/singlequery/queries/lt.query":31,"./queryBlocks/singlequery/queries/match.query":32,"./queryBlocks/singlequery/queries/match_phase_prefix.query":33,"./queryBlocks/singlequery/queries/match_phrase.query":34,"./queryBlocks/singlequery/queries/missing.query":35,"./queryBlocks/singlequery/queries/multi-match.query":36,"./queryBlocks/singlequery/queries/prefix.query":37,"./queryBlocks/singlequery/queries/query_string.query":38,"./queryBlocks/singlequery/queries/range.query":39,"./queryBlocks/singlequery/queries/regexp.query":40,"./queryBlocks/singlequery/queries/simple_query_string.query":41,"./queryBlocks/singlequery/queries/span_first.query":42,"./queryBlocks/singlequery/queries/span_term.query":43,"./queryBlocks/singlequery/queries/term.query":44,"./queryBlocks/singlequery/queries/terms.query":45,"./queryBlocks/singlequery/queries/wildcard.query":46,"./queryBlocks/singlequery/singlequery.component":47,"./queryBlocks/sortBlock/sortBlock.component":48,"./queryBlocks/types/types.component":49,"./result/result.component":50,"./shared/pipes/prettyJson":55,"./shared/pipes/prettyTime":56,"@angular/core":62,"@angular/forms":63,"@angular/http":64,"@angular/platform-browser":66}],3:[function(t,e,n){"use strict";var r=t("@angular/platform-browser-dynamic"),i=t("./app.module");r.platformBrowserDynamic().bootstrapModule(i.AppModule)},{"./app.module":2,"@angular/platform-browser-dynamic":65}],4:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.onAppSelectChange=new o.EventEmitter,this.setConfig=new o.EventEmitter,this.filteredApps=[],this.appFocus=!1}return t.prototype.ngOnInit=function(){this.onAppSelectChange.emit(this.config.appname)},t.prototype.ngOnChanges=function(){this.onAppSelectChange.emit(this.config.appname)},t.prototype.handleInput=function(){this.filteredApps=this.getFilterApp(),this.filteredApps.length?this.appFocus=!0:this.appFocus=!1,this.onAppSelectChange.emit(this.config.appname)},t.prototype.getFilterApp=function(){return this.appsList.filter(function(t,e){return""===this.config.appname||""!==this.config.appname&&t.appname.toUpperCase().indexOf(this.config.appname.toUpperCase())!==-1}.bind(this))},t.prototype.focusInput=function(){this.filteredApps=this.getFilterApp(),this.filteredApps.length&&(this.appFocus=!0),this.onAppSelectChange.emit(this.config.appname)},t.prototype.blurInput=function(){setTimeout(function(){this.appFocus=!1}.bind(this),500),this.onAppSelectChange.emit(this.config.appname)},t.prototype.setApp=function(t){this.setConfig.emit(t),this.onAppSelectChange.emit(t.appname)},r([o.Input(),i("design:type",Object)],t.prototype,"appsList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"config",void 0),r([o.Input(),i("design:type",Boolean)],t.prototype,"connected",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"onAppSelectChange",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setConfig",void 0),t=r([o.Component({selector:"appselect",templateUrl:"./app/features/appselect/appselect.component.html",inputs:["setConfig","onAppSelectChange"]}),i("design:paramtypes",[])],t)}();n.AppselectComponent=s},{"@angular/core":62}],5:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.callback=new o.EventEmitter}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(){},t.prototype.confirm=function(t){this.callback.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"info",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"callback",void 0),t=r([o.Component({selector:"confirm-modal",templateUrl:"./app/features/confirm/confirm-modal.component.html",inputs:["callback"]}),i("design:paramtypes",[])],t)}();n.ConfirmModalComponent=s},{"@angular/core":62}],6:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/platform-browser"),a=function(){function t(t){this.sanitizer=t,this.setDocSample=new o.EventEmitter,this.open=!1}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){t.docLink.currentValue&&(this.url=this.sanitizer.bypassSecurityTrustResourceUrl(t.docLink.currentValue),this.open=!0)},t.prototype.close=function(){this.setDocSample.emit(null),this.open=!1},r([o.Input(),i("design:type",Object)],t.prototype,"docLink",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"doc-sidebar",templateUrl:"./app/features/docSidebar/docsidebar.component.html",inputs:["setDocSample"]}),i("design:paramtypes",[s.DomSanitizer])],t)}();n.DocSidebarComponent=a},{"@angular/core":62,"@angular/platform-browser":66}],7:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/http"),a=t("../subscribe/AuthOperation"),u=t("../../shared/storage.service"),c=function(){function t(t,e){this.http=t,this.storageService=e,this.saveQuery=new o.EventEmitter,this.newQuery=new o.EventEmitter,this.queries=[],this.subscribeOption="major",this.profile=null,this.serverAddress="https://ossauth.appbase.io",this.updateStatus=this.updateStatus.bind(this)}return t.prototype.loadLearn=function(){var t=this;this.http.get("./app/shared/default.data.json").toPromise().then(function(e){var n=e.json();n.queries.forEach(function(e){t.saveQuery.emit(e)}),setTimeout(function(){t.newQuery.emit(n.queries[0])},500),$("#learnModal").modal("hide"),$("#learnInfoModal").modal("show")})["catch"](function(t){console.log(t)})},t.prototype.updateStatus=function(t){this.profile=t.profile},t.prototype.subscribe=function(){this.authOperation.login(this.subscribeOption)},r([o.Output(),i("design:type",Object)],t.prototype,"saveQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"newQuery",void 0),r([o.ViewChild(a.AuthOperation),i("design:type",a.AuthOperation)],t.prototype,"authOperation",void 0),t=r([o.Component({selector:"learn-modal",templateUrl:"./app/features/learn/learn.component.html",inputs:["saveQuery","newQuery"]}),i("design:paramtypes",[s.Http,u.StorageService])],t)}();n.LearnModalComponent=c},{"../../shared/storage.service":58,"../subscribe/AuthOperation":13,"@angular/core":62,"@angular/http":64}],8:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.newQuery=new o.EventEmitter,this.deleteQuery=new o.EventEmitter,this.clearAll=new o.EventEmitter,this.sort=new o.EventEmitter,this.searchList=new o.EventEmitter,this.direction=!1}return t.prototype.ngOnInit=function(){},t.prototype.applyQuery=function(t){var e=this.savedQueryList.filter(function(e){return e.name===t.name&&e.tag===t.tag});e.length&&this.newQuery.emit(e[0])},t.prototype.applyDeleteQuery=function(t){this.deleteQuery.emit(t)},t.prototype.applyClearAll=function(){this.clearAll.emit(null)},t.prototype.applySearchList=function(){this.searchList.emit({searchTerm:this.searchTerm,searchByMethod:this.searchByMethod})},t.prototype.tagApply=function(t,e,n){this.searchTerm=e,this.searchByMethod=n,this.applySearchList(),t.stopPropagation()},r([o.Input(),i("design:type",Object)],t.prototype,"savedQueryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"sort_by",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"sort_direction",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"searchTerm",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"filteredQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"newQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"deleteQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"clearAll",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"sort",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"searchList",void 0),t=r([o.Component({selector:"list-query",templateUrl:"./app/features/list/list.query.component.html",inputs:["newQuery","deleteQuery","clearAll","searchByMethod"]}),i("design:paramtypes",[])],t)}();n.ListQueryComponent=s},{"@angular/core":62}],9:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.ngOnInit=function(){this.setTimeInterval(!1)},t.prototype.ngOnChanges=function(){},t.prototype.setTimeInterval=function(t){this.time=t?this.time+1:this.time-1,t=!t,setTimeout(function(){this.setTimeInterval(t)}.bind(this),6e4)},r([o.Input(),i("design:type",Object)],t.prototype,"time",void 0),t=r([o.Component({selector:"time-relative",template:'\n\t\t\t\t\t{{time | prettyTime}}\n\t\t\t\t'}),i("design:paramtypes",[])],t)}();n.TimeComponent=s},{"@angular/core":62}],10:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.callback=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.errorHookHelp.applyEditor({lineNumbers:!1,lineWrapping:!0})},t.prototype.ngOnChanges=function(){},r([o.Input(),i("design:type",Object)],t.prototype,"info",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"errorHookHelp",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"callback",void 0),t=r([o.Component({selector:"error-modal",templateUrl:"./app/features/modal/error-modal.component.html",inputs:["callback"]}),i("design:paramtypes",[])],t)}();n.ErrorModalComponent=s},{"@angular/core":62}],11:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){ -if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("../../shared/storage.service"),a=function(){function t(t){this.storageService=t,this.query_info={name:"",tag:""}}return t.prototype.openModal=function(){$("#saveQueryModal").modal("show")},t.prototype.save=function(){var t={mapping:this.mapping,config:this.config,name:this.query_info.name,tag:this.query_info.tag};this.queryList.push(t);try{this.storageService.set("queryList",JSON.stringify(this.queryList))}catch(e){}console.log(this.queryList)},t=r([o.Component({selector:"save-query",templateUrl:"./app/features/save/save.query.component.html",inputs:["config","mapping","queryList"],providers:[s.StorageService]}),i("design:paramtypes",[s.StorageService])],t)}();n.SaveQueryComponent=a},{"../../shared/storage.service":58,"@angular/core":62}],12:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.ngOnInit=function(){var t={title:"Share Url",content:'',html:!0,trigger:"click"};$(".share-btn").popover(t),$(".share-btn").on("shown.bs.popover",function(){this.shareClick()}.bind(this)),$(".share-btn").on("hidden.bs.popover",function(){$(".share_content .success-msg").hide()}.bind(this))},t.prototype.ngOnChanges=function(){},t.prototype.shareClick=function(){var t=this.urlShare.convertToUrl("gh-pages");$("#for-share").val(t);var e=document.getElementById("for-share"),n=this.copyToClipboard(e);n&&$(".share_content .success-msg").show()},t.prototype.copyToClipboard=function(t){var e,n,r,i="_hiddenCopyText_",o="INPUT"===t.tagName||"TEXTAREA"===t.tagName;o?(r=t,e=t.selectionStart,n=t.selectionEnd):(r=document.getElementById(i),r||(r=document.createElement("textarea"),r.style.position="absolute",r.style.left="-9999px",r.style.top="0",r.id=i,document.body.appendChild(r)),r.textContent=t.textContent);var s=document.activeElement;r.focus(),r.setSelectionRange(0,r.value.length);var a;try{a=document.execCommand("copy")}catch(u){a=!1}return s&&"function"==typeof s.focus&&s.focus(),o?t.setSelectionRange(e,n):r.textContent="",a},r([o.Input(),i("design:type",Object)],t.prototype,"urlShare",void 0),t=r([o.Component({selector:"share-url",templateUrl:"./app/features/share/share.url.component.html"}),i("design:paramtypes",[])],t)}();n.ShareUrlComponent=s},{"@angular/core":62}],13:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/http"),a=t("../../shared/storage.service"),u=function(){function t(t,e){this.http=t,this.storageService=e,this.updateStatus=new o.EventEmitter,this.serverAddress="https://ossauth.appbase.io",this.access_token_applied=!1}return t.prototype.ngOnInit=function(){var t={domain:"appbaseio.auth0.com",clientID:"tCy6GxnrsyKec3UxXCuYLhU6XWFCMgRD",callbackURL:location.href,callbackOnLocationHash:!0};this.auth0=new Auth0(t),this.init.call(this)},t.prototype.init=function(){var t=this;this.parseHash.call(this);var e=this.parseHash.bind(this);setTimeout(function(){console.log("hash watching Activated!"),window.onhashchange=function(){!t.access_token_applied&&location.hash.indexOf("access_token")>-1&&(console.log("access_token found!"),e())}},300)},t.prototype.isTokenExpired=function(t){var e=this.auth0.decodeJwt(t),n=(new Date).getTime()/1e3;return e.exp-1?(this.access_token_applied=!0,this.restoreStates()):this.getUserProfile()},t.prototype.show_sign_in=function(){},t.prototype.restoreStates=function(){var t=location.href.split("#")[0],e=this.storageService.get("savedState"),n=t;n+=e&&e.indexOf("access_token")<0?e:"#",window.location.href=n,location.reload()},t.prototype.getUserProfile=function(){var t=this.serverAddress+"/api/getUserProfile",e=this.storageService.get("subscribeOption")&&"null"!==this.storageService.get("subscribeOption")?this.storageService.get("subscribeOption"):null,n={token:this.storageService.get("mirage_id_token"),origin_app:"MIRAGE",email_preference:e};$.ajax({type:"POST",url:t,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(n)}).done(function(t){this.storageService.set("subscribeOption",null),this.updateStatus.emit({profile:t.message})}.bind(this)).fail(function(t){console.error(t)})},t.prototype.parseHash=function(){var t=this.storageService.get("mirage_id_token");if(null===t||this.isTokenExpired(t)){var e=this.auth0.parseHash(window.location.hash);e&&e.idToken?(this.storageService.set("mirage_id_token",e.idToken),this.show_logged_in(e.idToken)):e&&e.error?(console.log("error: "+e.error),this.show_sign_in()):this.show_sign_in()}else this.show_logged_in(t)},r([o.Output(),i("design:type",Object)],t.prototype,"updateStatus",void 0),t=r([o.Component({selector:"auth-operation",template:""}),i("design:paramtypes",[s.Http,a.StorageService])],t)}();n.AuthOperation=u},{"../../shared/storage.service":58,"@angular/core":62,"@angular/http":64}],14:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/http"),a=t("./AuthOperation"),u=function(){function t(t){this.http=t,this.options={option1:{value:"major",text:"New MIRAGE releases"},option2:{value:"all",text:"Limited major updates"}},this.subscribeOption="major",this.profile=null,this.updateStatus=this.updateStatus.bind(this)}return t.prototype.open=function(){$("#subscribeModal").modal("show")},t.prototype.updateStatus=function(t){this.profile=t.profile},t.prototype.subscribe=function(){this.authOperation.login(this.subscribeOption)},r([o.ViewChild(a.AuthOperation),i("design:type",a.AuthOperation)],t.prototype,"authOperation",void 0),t=r([o.Component({selector:"subscribe-modal",templateUrl:"./app/features/subscribe/subscribe.component.html"}),i("design:paramtypes",[s.Http])],t)}();n.SubscribeModalComponent=u},{"./AuthOperation":13,"@angular/core":62,"@angular/http":64}],15:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("../shared/appbase.service"),a=function(){function t(t){this.appbaseService=t,this.streamPopoverInfo={trigger:"hover",placement:"right",content:"Stream is avtive, waiting for data updates .."},this.setProp=new o.EventEmitter,this.errorShow=new o.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;this.editorHookHelp.applyEditor(),$("#resultModal").modal({show:!1,backdrop:"static"}),$("#resultModal").on("hide.bs.modal",function(){$('#resultTabs a[href="#resultJson"]').tab("show"),t.responseHookHelp.focus('{"Loading": "please wait......"}');var e={name:"result_time_taken",value:null};t.setProp.emit(e)})},t.prototype.runQuery=function(){var t=this;this.appbaseService.setAppbase(this.config);var e=this.checkValidQuery();if(e.flag)$("#resultModal").modal("show"),this.appbaseService.posturl(t.finalUrl,e.payload).then(function(e){t.result.isWatching=!1;var n={name:"result_time_taken",value:e.json().took};t.setProp.emit(n);var r={name:"random_token",value:Math.random()};t.setProp.emit(r),t.result.output=JSON.stringify(e.json(),null,2),$("#resultModal").hasClass("in")?t.responseHookHelp.setValue(t.result.output):setTimeout(function(){t.responseHookHelp.setValue(t.result.output)},300)})["catch"](function(e){$("#resultModal").modal("hide"),t.result.isWatching=!1,t.result.output=JSON.stringify(e,null,4);var n={title:"Response Error",message:t.result.output};t.errorShow.emit(n)}),"stream"===this.responseMode&&this.setStream(e);else{var n={title:"Json validation",message:e.message};this.errorShow.emit(n)}},t.prototype.setStream=function(t){var e=this,n=$("#setType").val(),r=t.payload;setTimeout(function(){$(".stream-signal").show(),$(".stream-signal").popover(e.streamPopoverInfo)},300),this.appbaseService.searchStream(n,r).on("data",this.onStreamData.bind(this)).on("error",this.onStreamError.bind(this))},t.prototype.onStreamData=function(t){$(".stream-signal").addClass("warning").addClass("success");var e=JSON.stringify(t,null,2);$("#resultModal").hasClass("in")?this.responseHookHelp.prepend(e+"\n"):setTimeout(function(){this.responseHookHelp.prepend(e+"\n")},300)},t.prototype.onStreamError=function(t){setTimeout(function(){$(".stream-signal").hide()},300)},t.prototype.checkValidQuery=function(){var t=this.editorHookHelp.getValue();t=t.trim();var e={flag:!0,payload:null,message:null};if(this.result.resultQuery.result.forEach(function(t){t.internal.forEach(function(t){""!==t.field&&""!==t.query||(e.flag=!1)})}),e.flag&&t&&""!=t)try{e.payload=JSON.parse(t)}catch(n){e.message="Json is not valid."}else e.flag=!1,e.message=" Please complete your query first.";return e},t.prototype.setPropIn=function(){var t={name:"finalUrl",value:this.finalUrl};this.setProp.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"finalUrl",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",String)],t.prototype,"responseMode",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setProp",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"errorShow",void 0),t=r([o.Component({selector:"query-jsoneditor",templateUrl:"./app/jsonEditor/jsonEditor.component.html",inputs:["config","editorHookHelp","responseHookHelp","setProp","errorShow"],providers:[s.AppbaseService]}),i("design:paramtypes",[s.AppbaseService])],t)}();n.JsonEditorComponent=a},{"../shared/appbase.service":51,"@angular/core":62}],16:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.queryList=this.queryList,this.removeArray=[],this.query=this.query,this.informationList={nested:{title:"nested",content:'Nested query allows you to run a query against the nested documents and filter parent docs by those that have at least one nested document matching the query.\n\t\t\t\tRead more'},has_child:{title:"has_child",content:'has_child filter accepts a query and the child type to run against, and results in parent documents that have child docs matching the query.\n\t\t\t\tRead more'},has_parent:{title:"has_parent",content:'has_parent query accepts a query and a parent type. The query is executed in the parent document space, which is specified by the parent type, and returns child documents which associated parents have matched.\n\t\t\t\tRead more'},parent_id:{title:"parent_id",content:'parent_id query can be used to find child documents which belong to a particular parent. \n\t\t\t\tRead more'}},this.joiningQuery=[""],this.setJoiningQuery=new o.EventEmitter,this.setDocSample=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.allFields=this.result.resultQuery.availableFields,this.exeBuild()},t.prototype.ngOnChanges=function(){this.allFields=this.result.resultQuery.availableFields},t.prototype.addSubQuery=function(t){this.addBoolQuery(t)},t.prototype.removeInQuery=function(t){var e=this.result.resultQuery.result;this.removeArray.push(t);var n=!0;e.forEach(function(e,r){e.parent_id==t&&(this.removeInQuery(e.id),n=!1)}.bind(this)),n&&this.removeArray.forEach(function(t){e.forEach(function(n,r){n.id==t&&e.splice(r,1)}.bind(this))}.bind(this)),this.buildQuery()},t.prototype.exeBuild=function(){var t=this;setTimeout(function(){return t.buildQuery()},300)},t.prototype.booleanChange=function(t){this.query.boolparam=t,this.exeBuild()},t.prototype.joiningQueryChange=function(t){t.val&&(t=this.joiningQuery.indexOf(t.val)),this.joiningQueryParam=t,this.setJoiningQuery.emit({param:t,allFields:this.allFields}),this.exeBuild()},t.prototype.show_hidden_btns=function(t){$(".bool_query").removeClass("show_hidden"),$(t.currentTarget).addClass("show_hidden"),t.stopPropagation()},t.prototype.hide_hidden_btns=function(){$(".bool_query").removeClass("show_hidden")},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQueryParam",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setJoiningQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"bool-query",templateUrl:"./app/queryBlocks/boolquery/boolquery.component.html",inputs:["config","query","queryList","addQuery","removeQuery","addBoolQuery","queryFormat","buildQuery","buildInsideQuery","buildSubQuery","createQuery","setQueryFormat","editorHookHelp","urlShare","setDocSample"]}),i("design:paramtypes",[])],t)}();n.BoolqueryComponent=s},{"@angular/core":62}],17:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.callback=new o.EventEmitter,this.setDocSample=new o.EventEmitter}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(){},t.prototype.ngAfterViewInit=function(){},t.prototype.editable_on=function(t){$(".editable-pack").removeClass("on"),$(t.currentTarget).parents(".editable-pack").addClass("on"),"select2"==this.editableInput&&$(t.currentTarget).parents(".editable-pack").find("select").select2("open"),"select"==this.editableInput&&$(t.currentTarget).parents(".editable-pack").find("select").focus().simulate("mousedown")},t.prototype.editable_off=function(t){setTimeout(function(){if($(".editable-pack").removeClass("on"),"undefined"!=typeof this.passWithCallback){var t={external:this.passWithCallback,value:this.editableModal};this.callback.emit(t)}else this.callback.emit(this.editableModal)}.bind(this),300)},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"editableField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"editableInput",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"querySelector",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selector",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"editableModal",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"passWithCallback",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"callback",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"editable",templateUrl:"./app/queryBlocks/editable/editable.component.html",inputs:["editPlaceholder","callback","selectOption","informationList","showInfoFlag","searchOff","setDocSample"]}),i("design:paramtypes",[])],t)}();n.EditableComponent=s},{"@angular/core":62}],18:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("../shared/queryList"),a=function(){function t(){this.queryList=s.queryList,this.queryFormat={internal:{field:"",query:"",selectedField:"",selectedQuery:"",input:"",analyzeTest:"",type:""},bool:{boolparam:0,parent_id:0,id:0,internal:[],minimum_should_match:"",path:"",type:"",xid:0,parent_type:"",score_mode:""}},this.joiningQuery=[""],this.joiningQueryParam=0,this.popoverInfo={stream:{trigger:"hover",placement:"top",content:"Shows an interactive stream of results, useful when your data is changing quickly.",container:"body"},historic:{trigger:"hover",placement:"top",content:"Shows historical results, useful when your data is not changing quickly.",container:"body"}},this.saveQuery=new o.EventEmitter,this.setProp=new o.EventEmitter,this.setDocSample=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.handleEditable(),this.joiningQuery=this.result.joiningQuery},t.prototype.ngOnChanges=function(t){this.joiningQuery=this.result.joiningQuery,(t&&t.isAppbaseApp&&t.isAppbaseApp.currentValue||t.selectedTypes&&t.selectedTypes.currentValue.length)&&this.setPopover()},t.prototype.addBoolQuery=function(t){if(this.selectedTypes){var e=JSON.parse(JSON.stringify(this.queryFormat.bool)),n=JSON.parse(JSON.stringify(this.queryFormat.internal));e.internal.push(n),e.id=this.result.queryId,e.parent_id=t,this.result.queryId+=1,this.result.resultQuery.result.push(e),this.buildQuery()}else alert("Select type first.")},t.prototype.removeQuery=function(){this.result.resultQuery.result=[],this.buildQuery()},t.prototype.addSortBlock=function(){var t={selectedField:"",order:"asc",availableOptionalParams:[]};this.result.sort.push(t)},t.prototype.removeSortBlock=function(){this.result.sort=[],this.buildQuery()},t.prototype.addQuery=function(t){var e=this,n=JSON.parse(JSON.stringify(e.queryFormat.internal));t.internal.push(n),this.buildQuery()},t.prototype.buildQuery=function(){var t=this,e=this.result.resultQuery.result,n={};if(e.length){var r={};e.length>1?n.query={bool:r}:e[0].availableQuery&&e[0].internal.length>1?n.query={bool:r}:"must"===t.queryList.boolQuery[e[0].boolparam]?n.query=r:n.query={bool:r},e.forEach(function(e){e.availableQuery=t.buildInsideQuery(e)});var i=!0;e.forEach(function(n){e.forEach(function(e){if(e.parent_id==n.id){var r={bool:{}},o=t.queryList.boolQuery[e.boolparam];r.bool[o]=e.availableQuery,"should"===o&&(r.bool.minimum_should_match=e.minimum_should_match),"nested"===t.joiningQuery[t.joiningQueryParam]&&(r.bool.nested.path=e.path,r.bool.nested.score_mode=e.score_mode,i=!1),n.availableQuery.push(r)}})}),e.forEach(function(o){if(0===o.parent_id){var s=t.queryList.boolQuery[o.boolparam];t.joiningQuery&&"nested"===t.joiningQuery[t.joiningQueryParam]?(r.nested={path:o.path,score_mode:o.score_mode,query:{bool:(a={},a[s]=o.availableQuery,a)}},i=!1):t.joiningQuery&&"has_child"===t.joiningQuery[t.joiningQueryParam]?r[s]={has_child:{type:o.type,score_mode:o.score_mode,query:o.availableQuery}}:t.joiningQuery&&"has_parent"===t.joiningQuery[t.joiningQueryParam]?r[s]={has_parent:{parent_type:o.parent_type,query:o.availableQuery}}:t.joiningQuery&&"parent_id"===t.joiningQuery[t.joiningQueryParam]?r[s]={parent_id:{type:o.type,id:o.xid}}:o.internal.length>1||"must"!==s?r[s]=o.availableQuery:e.length>1?r[s]=o.availableQuery:(r=o.availableQuery[0],n.query=r),"should"===s?r.minimum_should_match=o.minimum_should_match:r.hasOwnProperty("minimum_should_match")&&delete r.minimum_should_match}var a}),i||(n.query=n.query.bool)}else this.selectedTypes.length&&(n.query={match_all:{}});t.result.sort&&t.result.sort.map(function(t){if(t.selectedField){n.hasOwnProperty("sort")||(n.sort=[]);var e={};t._geo_distance?(r={},r._geo_distance=(i={},i[t.selectedField]={lat:t._geo_distance.lat,lon:t._geo_distance.lon},i.order=t.order,i.distance_type=t._geo_distance.distance_type,i.unit=t._geo_distance.unit||"m",i),e=r,t.mode&&(e._geo_distance.mode=t.mode)):(o={},o[t.selectedField]={order:t.order},e=o,t.mode&&(e[t.selectedField].mode=t.mode),t.missing&&(e[t.selectedField].missing=t.missing)),n.sort.push(e)}var r,i,o}),this.result.resultQuery["final"]=JSON.stringify(n,null,2);try{this.editorHookHelp.setValue(t.result.resultQuery["final"])}catch(o){console.log(o)}try{this.urlShare.inputs.result=this.result,this.urlShare.createUrl()}catch(o){console.log(o)}},t.prototype.buildInsideQuery=function(t){var e=[];return t.internal.forEach(function(t){var e=!1;t.appliedQuery=this.createQuery(t,e)}.bind(this)),t.internal.forEach(function(t){e.push(t.appliedQuery)}),e},t.prototype.buildSubQuery=function(){var t=this.result.resultQuery.result[0];t.forEach(function(e){0!=e.parent_id&&t.forEach(function(t){e.parent_id==t.id&&t.appliedQuery.bool.must.push(e.appliedQuery)}.bind(this))}.bind(this))},t.prototype.createQuery=function(t,e){var n={query:"*",field:"*",queryFlag:!0,fieldFlag:!0};if(""!==t.analyzeTest&&""!==t.type&&""!==t.query||(n.queryFlag=!1),""===t.field&&(n.fieldFlag=!1),n.queryFlag)return t.appliedQuery;n.fieldFlag&&(n.field=t.selectedField);var r=this.setQueryFormat(n.query,n.field,t);return r},t.prototype.setQueryFormat=function(t,e,n){var r={};return r[t]={},r[t][e]=n.input,r},t.prototype.toggleBoolQuery=function(){this.result.resultQuery.result.length<1&&this.selectedTypes.length>0?this.addBoolQuery(0):this.removeQuery()},t.prototype.toggleSortQuery=function(){this.result.sort?(console.log("coming"),this.result.sort.length<1&&this.selectedTypes.length>0?this.addSortBlock():this.removeSortBlock()):(this.result.sort=[],this.addSortBlock())},t.prototype.handleEditable=function(){$("body").on("click",function(t){var e=$(t.target);e.hasClass(".editable-pack")||e.parents(".editable-pack").length||$(".editable-pack").removeClass("on")})},t.prototype.openModal=function(){$("#saveQueryModal").modal("show")},t.prototype.setPropIn=function(t){this.setProp.emit(t)},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},t.prototype.setJoiningQueryEve=function(t){this.joiningQueryParam=t.param,this.result.resultQuery.availableFields=t.allFields,this.buildQuery()},t.prototype.setPopover=function(){var t=this;setTimeout(function(){$(".responseMode .stream").popover(t.popoverInfo.stream),$(".responseMode .historic").popover(t.popoverInfo.historic)},1e3)},t.prototype.changeMode=function(t){this.responseMode=t;var e={name:"responseMode",value:t};this.setProp.emit(e)},r([o.Input(),i("design:type",Boolean)],t.prototype,"isAppbaseApp",void 0),r([o.Input(),i("design:type",String)],t.prototype,"responseMode",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"query_info",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"savedQueryList",void 0),r([o.Input(),i("design:type",String)],t.prototype,"finalUrl",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"urlShare",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"config",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"saveQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setProp",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"query-blocks",templateUrl:"./app/queryBlocks/queryBlocks.component.html",inputs:["detectChange","editorHookHelp","saveQuery","setProp","setDocSample"]}),i("design:paramtypes",[])],t)}();n.QueryBlocksComponent=a},{"../shared/queryList":57,"@angular/core":62}],19:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("../../shared/globalshare.service"),a=t("../../shared/docService"),u=function(){function t(t,e){this.globalShare=t,this.docService=e,this.callback=new o.EventEmitter,this.setDocSample=new o.EventEmitter}return t.prototype.ngOnChanges=function(){},t.prototype.ngAfterContentInit=function(){setTimeout(function(){var t;t=this.querySelector&&this.selector?$(this.querySelector).find("."+this.selector).find("select"):$("."+this.selector).find("select"),"undefined"!=typeof this.passWithCallback&&(this.querySelector&&this.selector?t=$(this.querySelector).find("."+this.selector+"-"+this.passWithCallback).find("select"):this.selector&&(t=$("."+this.selector+"-"+this.passWithCallback).find("select"))),this.setSelect2(t,function(e){var n={val:e,selector:t};"undefined"!=typeof this.passWithCallback&&(n.external=this.passWithCallback),this.callback.emit(n)}.bind(this))}.bind(this),300)},t.prototype.setSelect2=function(t,e){var n={placeholder:"Select from the option"};this.searchOff&&(n.minimumResultsForSearch=-1),t.select2(n),t.on("change",function(n){e(t.val())}.bind(this)),this.showInfoFlag&&t.on("select2:open",function(){this.setPopover.apply(this),$(".select2-search__field").keyup(function(){this.setPopover.apply(this)}.bind(this)),$(".select2-search__field").keydown(function(){this.setPopover.apply(this)}.bind(this))}.bind(this))},t.prototype.setPopover=function(){setTimeout(function(){var t=$("li.select2-results__option");t.each(function(t,e){var n=$(e).html(),r=this.getInformation(n);$(e).popover(r),$(e).on("shown.bs.popover",this.setLink.bind(this)),this.setLink()}.bind(this))}.bind(this),300)},t.prototype.getInformation=function(t){var t=this.informationList[t];return t.html=!0,t.trigger="click hover",t.placement="right",t.delay={show:50,hide:50},t},t.prototype.setLink=function(){var t=this;setTimeout(function(){$(".popover a").unbind("click").on("click",function(e){e.preventDefault();var n=e.target.href;t.setDocSample.emit(n)})}.bind(this),500)},r([o.Input(),i("design:type",Object)],t.prototype,"querySelector",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selector",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"showInfoFlag",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"passWithCallback",void 0),r([o.Input(),i("design:type",Boolean)],t.prototype,"searchOff",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"informationList",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"callback",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"select2",templateUrl:"./app/queryBlocks/select2/select2.component.html",inputs:["selectModal","selectOptions","setDocSample"],providers:[s.GlobalShare,a.DocService]}),i("design:paramtypes",[s.GlobalShare,a.DocService])],t)}();n.select2Component=u},{"../../shared/docService":52,"../../shared/globalshare.service":54,"@angular/core":62}],20:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="common",this.queryName="*",this.fieldName="*",this.information={title:"Common Terms",content:'Returns common terms matches by avoiding noise from high frequency terms with a cutoff frequency parameter.\n\t\t\t\tRead more'},this.informationList={minimum_should_match:{title:"minimum_should_match",content:'Specify a minimum number or % of low frequency terms which must be present in matches.'},low_freq_operator:{title:"low_freq_operator",content:"Specify 'and' (defaults to 'or') to make all terms required."}},this.default_options=["low_freq_operator","minimum_should_match"],this.singleOption={ -name:"",value:""},this.optionRows=[],this.inputs={query:{placeholder:"Query",value:""},cutoff_frequency:{placeholder:"Cutoff frequency",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery.common[this.fieldName].query&&(this.inputs.query.value=this.appliedQuery.common[this.fieldName].query),this.appliedQuery.common[this.fieldName].cutoff_frequency&&(this.inputs.cutoff_frequency.value=this.appliedQuery.common[this.fieldName].cutoff_frequency);for(var t in this.appliedQuery[this.current_query][this.fieldName])if(["query","cutoff_frequency"].indexOf(t)===-1){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.getFormat=function(){"common"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={query:this.inputs.query.value,cutoff_frequency:this.inputs.cutoff_frequency.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]={query:this.inputs.query.value,cutoff_frequency:this.inputs.cutoff_frequency.value},t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"common-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.CommonQuery=s},{"@angular/core":62}],21:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="exists",this.queryName="*",this.fieldName="*",this.information={title:"Exists",content:'Returns matches where the field value is not null. \n\t\t\t\t\tRead more'},this.queryFormat={}}return t.prototype.ngOnInit=function(){try{this.appliedQuery[this.current_query].field&&(this.appliedQuery[this.current_query].field=this.fieldName)}catch(t){}this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={field:this.fieldName},t},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"exists-query",template:'\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.ExistsQuery=s},{"@angular/core":62}],22:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="fuzzy",this.queryName="*",this.fieldName="*",this.information={title:"Fuzzy",content:'Returns matches within the edit distance specified by the fuzziness parameter.\n\t\t\t\t\tRead more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '},fuzziness:{title:"fuzziness",content:'The maximum edit distance. Defaults to AUTO.'},prefix_length:{title:"prefix_length",content:'The number of initial characters which will not be "fuzzified". Defaults to 0.'},max_expansions:{title:"max_expansions",content:'The maximum number of terms that the fuzzy query will expand to. Defaults to 50.'}},this.default_options=["boost","fuzziness","prefix_length","max_expansions"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query][this.fieldName])if(this.appliedQuery[this.current_query][this.fieldName]){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].value;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("value"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}else this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName]}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={value:this.inputs.input.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]=this.inputs.input.value,t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"fuzzy-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
',inputs:["getQueryFormat","querySelector","querySelector"]}),i("design:paramtypes",[])],t)}();n.FuzzyQuery=s},{"@angular/core":62}],23:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_bounding_box",this.information={title:"Geo Bounding Box Query",content:'Returns matches within a bounding box area. Specified with top left and bottom right (lat, long) values.\n Read more'},this.informationList={_name:{title:"_name",content:'Optional name field to identify the query.'},ignore_malformed:{title:"ignore_malformed",content:'Set to true to accept geo points with invalid latitude or longitude (default is false).'},type:{title:"type",content:'Set to memory if the query will be executed in memory, otherwise set to indexed.'}},this.default_options=["_name","ignore_malformed","type"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={top_left_lat:{placeholder:"TL_latitude",value:""},top_left_lon:{placeholder:"TL_longitude",value:""},bottom_right_lat:{placeholder:"BR_latitude",value:""},bottom_right_lon:{placeholder:"BR_longitude",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].top_left.lat&&(this.inputs.top_left_lat.value=this.appliedQuery[this.current_query][this.fieldName].top_left.lat),this.appliedQuery[this.current_query][this.fieldName].top_left.lon&&(this.inputs.top_left_lon.value=this.appliedQuery[this.current_query][this.fieldName].top_left.lon),this.appliedQuery[this.current_query][this.fieldName].bottom_right.lat&&(this.inputs.bottom_right_lat.value=this.appliedQuery[this.current_query][this.fieldName].bottom_right.lat),this.appliedQuery[this.current_query][this.fieldName].bottom_right.lon&&(this.inputs.bottom_right_lon.value=this.appliedQuery[this.current_query][this.fieldName].bottom_right.lon);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("top_left"!=t&&"bottom_right"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=(e={},e[this.queryName]=(n={},n[this.fieldName]={top_left:{lat:this.inputs.top_left_lat.value,lon:this.inputs.top_left_lon.value},bottom_right:{lat:this.inputs.bottom_right_lat.value,lon:this.inputs.bottom_right_lon.value}},n),e);return this.optionRows.forEach(function(e){t[this.queryName][e.name]=e.value}.bind(this)),t;var e,n},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-bounding-box-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoBoundingBoxQuery=s},{"@angular/core":62}],24:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_distance",this.information={title:"Geo Distance Query",content:'Returns matches within a specific distance from a geo-point field.\n Read more'},this.informationList={distance_type:{title:"distance_type",content:'How to compute the distance. Can either be sloppy_arc (default), arc\n (slightly more precise but significantly slower) or plane (faster, but inaccurate on long distances and close to the poles).'},optimize_bbox:{title:"optimize_bbox",content:'Defaults to memory which will do in memory bounding box checks before the distance check. Can also have values of indexed to use indexed value check, or none which disables bounding box optimization.'},_name:{title:"_name",content:'Optional name field to identify the query.'},ignore_malformed:{title:"ignore_malformed",content:'Set to true to accept geo points with invalid latitude or longitude (default is false).'}},this.default_options=["distance_type","optimize_bbox","_name","ignore_malformed"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={lat:{placeholder:"Latitude",value:""},lon:{placeholder:"Longitude",value:""},distance:{placeholder:"Distance (with unit)",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].lat&&(this.inputs.lat.value=this.appliedQuery[this.current_query][this.fieldName].lat),this.appliedQuery[this.current_query][this.fieldName].lon&&(this.inputs.lon.value=this.appliedQuery[this.current_query][this.fieldName].lon),this.appliedQuery[this.current_query][this.fieldName].distance&&(this.inputs.distance.value=this.appliedQuery[this.current_query][this.fieldName].distance);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("lat"!=t&&"lon"!=t&&"distance"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={distance:this.inputs.distance.value},t[this.queryName][this.fieldName]={lat:this.inputs.lat.value,lon:this.inputs.lon.value},this.optionRows.forEach(function(e){t[this.queryName][e.name]=e.value}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-distance-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoDistanceQuery=s},{"@angular/core":62}],25:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_distance_range",this.information={title:"Geo Distance Range Query",content:'Filters documents that exists within a range from a specific geo point.\n Read more'},this.informationList={distance_type:{title:"distance_type",content:'How to compute the distance. Can either be sloppy_arc (default), arc\n (slightly more precise but significantly slower) or plane (faster, but inaccurate on long distances and close to the poles).'},optimize_bbox:{ -title:"optimize_bbox",content:'Defaults to memory which will do in memory bounding box checks before the distance check. Can also have values of indexed to use indexed value check, or none which disables bounding box optimization.'},_name:{title:"_name",content:'Optional name field to identify the query.'},ignore_malformed:{title:"ignore_malformed",content:'Set to true to accept geo points with invalid latitude or longitude (default is false).'}},this.default_options=["distance_type","optimize_bbox","_name","ignore_malformed"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={lat:{placeholder:"Latitude",value:""},lon:{placeholder:"Longitude",value:""},from:{placeholder:"From (with unit)",value:""},to:{placeholder:"To (with unit)",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){try{this.appliedQuery[this.current_query][this.fieldName].lat&&(this.inputs.lat.value=this.appliedQuery[this.current_query][this.fieldName].lat),this.appliedQuery[this.current_query][this.fieldName].lon&&(this.inputs.lon.value=this.appliedQuery[this.current_query][this.fieldName].lon),this.appliedQuery[this.current_query][this.fieldName].from&&(this.inputs.from.value=this.appliedQuery[this.current_query][this.fieldName].from),this.appliedQuery[this.current_query][this.fieldName].to&&(this.inputs.to.value=this.appliedQuery[this.current_query][this.fieldName].to);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("lat"!=t&&"lon"!=t&&"from"!=t&&"to"!=t){({name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]})}}catch(e){}this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=(e={},e[this.queryName]=(n={},n[this.fieldName]={lat:this.inputs.lat.value,lon:this.inputs.lon.value},n.from=this.inputs.from.value,n.to=this.inputs.to.value,n),e);return this.optionRows.forEach(function(e){t[this.queryName][e.name]=e.value}.bind(this)),t;var e,n},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-distance-range-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n\t\t\t\t\t\t\t\t\t\t\n
\n\t\t\t\t\t\t\t\t
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoDistanceRangeQuery=s},{"@angular/core":62}],26:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geohash_cell",this.information={title:"Geohash Cell Query",content:'Returns geo_point matches in proximity of the specified geohash cell.

\n\t\t\t\tA geohash cell is defined by setting additional properties to the geo_point mapping type.
\n Read more'},this.informationList={neighbors:{title:"neighbors",content:'When set to true, it returns matches next to the specified geohash cell.'}},this.default_options=["neighbors"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={lat:{placeholder:"Latitude",value:""},lon:{placeholder:"Longitude",value:""},precision:{placeholder:"Precision",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].lat&&(this.inputs.lat.value=this.appliedQuery[this.current_query][this.fieldName].lat),this.appliedQuery[this.current_query][this.fieldName].lon&&(this.inputs.lon.value=this.appliedQuery[this.current_query][this.fieldName].lon),this.appliedQuery[this.current_query].precision&&(this.inputs.precision.value=this.appliedQuery[this.current_query].precision);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("lat"!=t&&"lon"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=(e={},e[this.queryName]=(n={},n[this.fieldName]={lat:this.inputs.lat.value,lon:this.inputs.lon.value},n.precision=this.inputs.precision.value,n),e);return this.optionRows.forEach(function(e){t[this.queryName][e.name]=e.value}.bind(this)),t;var e,n},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geohash-cell-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoHashCellQuery=s},{"@angular/core":62}],27:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_polygon",this.information={title:"Geo Polygon Query",content:'Return matches that fall within a specified polygon shape.\n Read more'},this.informationList={_name:{title:"_name",content:'Optional name field to identify the query.'},ignore_malformed:{title:"ignore_malformed",content:'Set to true to accept geo points with invalid latitude or longitude (default is false).'}},this.default_options=["_name","ignore_malformed"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={points:{placeholder:"points",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].points&&(this.inputs.points.value=this.appliedQuery[this.current_query][this.fieldName].points);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("points"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=this.inputs.points.value;try{t=JSON.parse(t)}catch(e){}var n=(r={},r[this.queryName]=(i={},i[this.fieldName]={points:t},i),r);return this.optionRows.forEach(function(t){n[this.queryName][t.name]=t.value}.bind(this)),n;var r,i},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-polygon-query",template:'\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoPolygonQuery=s},{"@angular/core":62}],28:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_shape",this.information={title:"Geo Shape Query",content:'Return matches that have a shape that relates with the query shape. A relation can be an intersection, subset, superset, or a disjoint.\n Read more'},this.informationList={relation:{title:"relation",content:'Defines the relation to match for, can be one of intersects, disjoint, within or contains.'}},this.default_options=["relation"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={type:{placeholder:"Type",value:""},coordinates:{placeholder:"Pass an Array",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].shape.type&&(this.inputs.type.value=this.appliedQuery[this.current_query][this.fieldName].shape.type),this.appliedQuery[this.current_query][this.fieldName].shape.coordinates&&(this.inputs.coordinates.value=this.appliedQuery[this.current_query][this.fieldName].shape.coordinates);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("shape"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=this.inputs.coordinates.value;try{t=JSON.parse(t)}catch(e){}var n=(r={},r[this.queryName]=(i={},i[this.fieldName]={shape:{type:this.inputs.type.value,coordinates:t}},i),r);return this.optionRows.forEach(function(t){n[this.queryName][this.fieldName][t.name]=t.value}.bind(this)),n;var r,i},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-shape-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoShapeQuery=s},{"@angular/core":62}],29:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="gt",this.information={title:"Greater Than",content:'Returns term values greater than the specified value. \n\t\t\t\t\tRead more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '}},this.default_options=["boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={gt:{placeholder:"Greater than",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery.range[this.fieldName][this.current_query]){this.inputs.gt.value=this.appliedQuery.range[this.fieldName].gt;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("gt"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}}catch(n){}this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,"gt"==this.selectedQuery&&(this.optionRows=[],this.getFormat()))},t.prototype.getFormat=function(){"gt"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={range:{}};return t.range[this.fieldName]={gt:this.inputs.gt.value},this.optionRows.forEach(function(e){t.range[this.fieldName][e.name]=e.value}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"gt-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
', +!function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("./shared/appbase.service"),a=t("./shared/storage.service"),u=t("./shared/docService"),c=t("./shared/editorHook"),l=t("./shared/urlShare"),p=function(){function t(t,e,n){this.appbaseService=t,this.storageService=e,this.docService=n,this.BRANCH="dev",this.connected=!1,this.initial_connect=!1,this.detectChange=null,this.config={url:"",appname:"",username:"",password:"",host:""},this.savedQueryList=[],this.query_info={name:"",tag:""},this.sort_by="createdAt",this.sort_direction=!0,this.searchTerm="",this.searchByMethod="tag",this.sidebar=!1,this.hide_url_flag=!1,this.appsList=[],this.errorInfo={},this.editorHookHelp=new c.EditorHook({editorId:"editor"}),this.responseHookHelp=new c.EditorHook({editorId:"responseBlock"}),this.errorHookHelp=new c.EditorHook({editorId:"errorEditor"}),this.urlShare=new l.UrlShare,this.result_time_taken=null,this.result_random_token=null,this.version="2.0",this.active=!0,this.submitted=!1,this.setLayoutFlag=!1,this.responseMode="historic",this.isAppbaseApp=!0,this.deleteItemInfo={title:"Confirm Deletion",message:"Do you want to delete this query?",yesText:"Delete",noText:"Cancel"},this.defaultApp={appname:"2016primaries",url:"https://Uy82NeW8e:c7d02cce-94cc-4b60-9b17-7e7325195851@scalr.api.appbase.io"},this.appSelected=!1}return t.prototype.onSubmit=function(){this.submitted=!0},t.prototype.setDocSample=function(t){this.docLink=t},t.prototype.ngOnInit=function(){function t(t){this.setInitialValue(),this.getQueryList(),this.getAppsList(),"master"===this.BRANCH&&this.EsSpecific(),t&&"learn"===t?($("#learnModal").modal("show"),this.initial_connect=!0):(t&&t.url&&t.appname&&this.setLocalConfig(t.url,t.appname),this.getLocalConfig())}$("body").removeClass("is-loadingApp"),this.queryParams=this.urlShare.getQueryParameters(),this.allowHF=!this.queryParams||!this.queryParams.hasOwnProperty("hf"),this.allowF=!!this.allowHF&&(!this.queryParams||!this.queryParams.hasOwnProperty("f")),this.allowH=!!this.allowHF&&(!this.queryParams||!this.queryParams.hasOwnProperty("h")),this.detectConfig(t.bind(this))},t.prototype.ngOnChanges=function(t){t.selectedQuery.previousValue,t.selectedQuery.currentValue},t.prototype.detectConfig=function(t){var e=null,n=window.location.href.indexOf("#?default=true")>-1,r=window.location.href.indexOf("input_state=")>-1,i=window.location.href.indexOf("app=")>-1;return n?(e=this.defaultApp,t(e)):r||i?void this.urlShare.decryptUrl().then(function(e){var n=e.data;t(n&&n.config?n.config:null)}):t("learn")},t.prototype.EsSpecific=function(){this.getIndices()},t.prototype.getIndices=function(){var t=document.URL.split("/_plugin/")[0],e=this.appbaseService.getIndices(t);e.then(function(e){try{var n,r=e.json(),i=this.getAppsList(),o=[],s=function(e){i&&i.length&&i.forEach(function(t,n){t.appname===e&&i.splice(n,1)}),n={appname:e,url:t},o.push(e),i.push(n)};for(var a in r.indices)s(a);if(!i.length){var n={appname:"sampleapp",url:t};i.push(n)}this.config.url||(this.config.url=i[0].url),this.storageService.set("mirage-appsList",JSON.stringify(i)),this.getAppsList()}catch(u){console.log(u)}}.bind(this))["catch"](function(t){console.log("Not able to get the version.")})},t.prototype.getLocalConfig=function(){var t=this.storageService.get("mirage-url"),e=this.storageService.get("mirage-appname");this.getAppsList(),null!=t?(this.config.url=t,this.config.appname=e,this.connect(!1)):this.initial_connect=!0},t.prototype.getAppsList=function(){var t=this.storageService.get("mirage-appsList");if(t)try{this.appsList=JSON.parse(t)}catch(e){this.appsList=[]}return this.appsList},t.prototype.getQueryList=function(){try{var t=this.storageService.get("queryList");t&&(this.savedQueryList=JSON.parse(t),this.sort(this.savedQueryList))}catch(e){}},t.prototype.setLocalConfig=function(t,e){this.storageService.set("mirage-url",t),this.storageService.set("mirage-appname",e);var n={appname:e,url:t},r=this.storageService.get("mirage-appsList");if(r)try{this.appsList=JSON.parse(r)}catch(i){this.appsList=[]}this.appsList.length&&(this.appsList=this.appsList.filter(function(t){return t.appname!==e})),this.appsList.push(n),this.storageService.set("mirage-appsList",JSON.stringify(this.appsList))},t.prototype.setInitialValue=function(){this.mapping=null,this.types=[],this.selectedTypes=[],this.result={resultQuery:{type:"",result:[],"final":"{}"},output:{},queryId:1,sort:[]}},t.prototype.connectHandle=function(){this.connected?(this.initial_connect=!0,this.connected=!1,this.urlShare.inputs={},this.urlShare.createUrl()):this.connect(!0)},t.prototype.hideUrl=function(){this.hide_url_flag=!this.hide_url_flag},t.prototype.connect=function(t){this.connected=!1,this.initial_connect=!1;var e=(this.config.appname,this.config.url),n=this.appbaseService.filterurl(e);console.log(this.config,n),n?(this.config.username=n.username,this.config.password=n.password,this.config.host=n.url,this.appbaseService.setAppbase(this.config),this.getVersion(),this.getMappings(t)):console.log("Not able to filter url",e)},t.prototype.getVersion=function(){var t=this;this.appbaseService.getVersion().then(function(e){try{var n=e.json(),r=n&&n[t.config.appname];if(r&&r.settings&&r.settings.index&&r.settings.index.version){var i=r.settings.index.version.created_string;t.version=i,"2"!==t.version.split(".")[0]&&"5"!==t.version.split(".")[0]&&"6"!==t.version.split(".")[0]&&t.errorShow({title:"Elasticsearch Version Not Supported",message:"Mirage only supports v2.x, v5.x and v6.x* of Elasticsearch Query DSL"})}}catch(o){console.log(o)}})["catch"](function(t){console.log("Not able to get the version.")})},t.prototype.getMappings=function(t){var e=this;this.appbaseService.getMappings().then(function(n){if(e.isAppbaseApp="https://scalr.api.appbase.io"===e.config.host,e.connected=!0,e.setInitialValue(),e.finalUrl=e.config.host+"/"+e.config.appname,e.mapping=n,e.types=e.seprateType(n),e.setLocalConfig(e.config.url,e.config.appname),e.detectChange+="done",!t){var r=e.urlShare.decryptedData;r.mapping&&(e.mapping=r.mapping),r.types&&(e.types=r.types),r.selectedTypes&&(e.selectedTypes=r.selectedTypes,e.detectChange="check",setTimeout(function(){$("#setType").val(e.selectedTypes).trigger("change")},300)),r.result&&(e.result=r.result),r.finalUrl&&(e.finalUrl=r.finalUrl)}e.urlShare.inputs.config=e.config,e.urlShare.inputs.selectedTypes=e.selectedTypes,e.urlShare.inputs.result=e.result,e.urlShare.inputs.finalUrl=e.finalUrl,e.urlShare.createUrl(),setTimeout(function(){$("body").width()>768?e.setLayoutResizer():e.setMobileLayout()},300)})["catch"](function(t){console.log(t),e.initial_connect=!0,e.errorShow({title:"Authentication Error",message:"It looks like your app name, username, password combination doesn't match. Check your url and appname and then connect it again."})})},t.prototype.seprateType=function(t){var e=t[this.config.appname].mappings,n=[];for(var r in e)n.push(r);return n.length||this.errorShow({title:"Type does not exist.",message:this.config.appname+" does not contain any type mapping. You should *first* create a type mapping to perform query operations."}),n},t.prototype.newQuery=function(t){var e=this.storageService.get("queryList");if(e){var n,r=JSON.parse(e),i=r.filter(function(e){return e.name===t.name&&e.tag===t.tag});i.length&&(n=i[0],this.connected=!1,this.initial_connect=!1,this.config=n.config,this.appbaseService.setAppbase(this.config),this.appbaseService.get("/_mapping").then(function(t){var e=this,r=t.json();this.finalUrl=this.config.host+"/"+this.config.appname,this.setInitialValue(),this.connected=!0,this.result=n.result,this.mapping=r,this.types=this.seprateType(r),this.selectedTypes=n.selectedTypes,this.urlShare.inputs.config=this.config,this.urlShare.inputs.selectedTypes=this.selectedTypes,this.urlShare.inputs.result=this.result,this.urlShare.inputs.finalUrl=this.finalUrl,this.urlShare.createUrl(),setTimeout(function(){$("#setType").val(e.selectedTypes).trigger("change"),$("body").width()>768?e.setLayoutResizer():e.setMobileLayout()},300)}.bind(this)),this.query_info.name=n.name,this.query_info.tag=n.tag,this.detectChange="check")}},t.prototype.deleteQuery=function(t){this.currentDeleteQuery=t,$("#confirmModal").modal("show")},t.prototype.confirmDeleteQuery=function(t){if(t&&this.currentDeleteQuery){var e=this.currentDeleteQuery;this.getQueryList(),this.savedQueryList.forEach(function(t,n){t.name===e.name&&t.tag===e.tag&&this.savedQueryList.splice(n,1)}.bind(this)),this.filteredQuery.forEach(function(t,n){t.name===e.name&&t.tag===e.tag&&this.filteredQuery.splice(n,1)}.bind(this));try{this.storageService.set("queryList",JSON.stringify(this.savedQueryList))}catch(n){}}this.currentDeleteQuery=null},t.prototype.clearAll=function(){this.setInitialValue(),this.query_info={name:"",tag:""},this.detectChange+="check",this.editorHookHelp.setValue("")},t.prototype.sidebarToggle=function(){this.sidebar=!this.sidebar},t.prototype.saveQuery=function(t){this.getQueryList();var e=(new Date).getTime(),n={name:this.query_info.name,tag:this.query_info.tag,config:this.config,selectedTypes:this.selectedTypes,result:this.result,version:this.version},r=t?t:n;r.createdAt=e,this.savedQueryList.forEach(function(t,e){t.name===r.name&&t.tag===r.tag&&this.savedQueryList.splice(e,1)}.bind(this)),this.savedQueryList.push(r),this.sort(this.savedQueryList);JSON.stringify(this.savedQueryList);try{this.storageService.set("queryList",JSON.stringify(this.savedQueryList))}catch(i){}$("#saveQueryModal").modal("hide")},t.prototype.sort=function(t){this.sort_by="createdAt",this.filteredQuery=t.sortBy(function(t){return-t[this.sort_by]}.bind(this))},t.prototype.searchList=function(t){var e=t.searchTerm,n=t.searchByMethod?t.searchByMethod:"tag";this.searchTerm=e,this.searchByMethod=n,this.searchTerm.trim().length>1?(this.filteredQuery=this.savedQueryList.filter(function(t){return!(!t[this.searchByMethod]||t[this.searchByMethod].indexOf(this.searchTerm)===-1)}.bind(this)),this.filteredQuery.length||(this.filteredQuery=this.savedQueryList.filter(function(t){return t.name.indexOf(this.searchTerm)!==-1}.bind(this)))):this.filteredQuery=this.savedQueryList,this.sort(this.filteredQuery)},t.prototype.setFinalUrl=function(t){this.finalUrl=t,this.urlShare.inputs.finalUrl=this.finalUrl,this.urlShare.createUrl()},t.prototype.setProp=function(t){"finalUrl"===t.name&&(this.finalUrl=t.value,this.urlShare.inputs.finalUrl=this.finalUrl),"availableFields"===t.name&&(this.result.resultQuery.availableFields=t.value,this.urlShare.inputs.result=this.result),"selectedTypes"===t.name&&(this.selectedTypes=t.value,this.urlShare.inputs.selectedTypes=this.selectedTypes),"result_time_taken"===t.name&&(this.result_time_taken=t.value),"random_token"===t.name&&(this.result_random_token=t.value),"responseMode"===t.name&&(this.responseMode=t.value),this.urlShare.createUrl()},t.prototype.setLayoutResizer=function(){function t(){var t=$(window).height();$(".features-section").css("height",t);var n=$("body").height(),r=n;e.allowHF&&e.allowF&&!e.allowH&&(r-=15),e.allowHF&&e.allowH&&!e.allowF&&(r-=140),e.allowHF&&e.allowH&&e.allowF&&(r-=166),setTimeout(function(){$("#mirage-container").css("height",r),$("#paneCenter, #paneEast").css("height",r)},300)}this.setLayoutFlag=!0;var e=this;$("body").layout({east__size:"50%",center__paneSelector:"#paneCenter",east__paneSelector:"#paneEast"}),t(),$(window).on("resize",t)},t.prototype.setMobileLayout=function(){var t=$("body").height();$("#mirage-container").css("height",t-116),$("#paneCenter, #paneEast").css("height",t)},t.prototype.setConfig=function(t){this.config.appname=t.appname,this.config.url=t.url},t.prototype.errorShow=function(t){var e=this;this.errorInfo=t,$("#errorModal").modal("show");var n=t.message;e.errorHookHelp.focus(n),setTimeout(function(){e.errorHookHelp.focus(n),$("#errorModal").hasClass("in")?e.errorHookHelp.setValue(n):setTimeout(function(){e.errorHookHelp.setValue(n)},300)}.bind(this),500)},t.prototype.viewData=function(){var t=this.urlShare.dejavuLink();window.open(t,"_blank")},t.prototype.openLearn=function(){$("#learnModal").modal("show")},t.prototype.onAppSelectChange=function(t){this.appSelected=!!t.trim()},t=r([o.Component({selector:"my-app",templateUrl:"./app/app.component.html",providers:[s.AppbaseService,a.StorageService,u.DocService]}),i("design:paramtypes",[s.AppbaseService,a.StorageService,u.DocService])],t)}();n.AppComponent=p},{"./shared/appbase.service":51,"./shared/docService":52,"./shared/editorHook":53,"./shared/storage.service":58,"./shared/urlShare":59,"@angular/core":62}],2:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/platform-browser"),a=t("@angular/forms"),u=t("@angular/http"),c=t("./app.component"),l=t("./queryBlocks/queryBlocks.component"),p=t("./jsonEditor/jsonEditor.component"),h=t("./result/result.component"),f=t("./features/save/save.query.component"),d=t("./features/list/list.query.component"),y=t("./features/share/share.url.component"),m=t("./features/modal/error-modal.component"),v=t("./features/confirm/confirm-modal.component"),g=t("./features/appselect/appselect.component"),_=t("./features/docSidebar/docsidebar.component"),b=t("./features/learn/learn.component"),w=t("./queryBlocks/boolquery/boolquery.component"),E=t("./queryBlocks/types/types.component"),O=t("./queryBlocks/singlequery/singlequery.component"),C=t("./queryBlocks/editable/editable.component"),S=t("./queryBlocks/select2/select2.component"),x=t("./features/subscribe/subscribe.component"),P=t("./features/subscribe/AuthOperation"),T=t("./queryBlocks/singlequery/queries/match.query"),N=t("./queryBlocks/singlequery/queries/match_phrase.query"),k=t("./queryBlocks/singlequery/queries/match_phase_prefix.query"),A=t("./queryBlocks/singlequery/queries/range.query"),R=t("./queryBlocks/singlequery/queries/gt.query"),I=t("./queryBlocks/singlequery/queries/lt.query"),q=t("./queryBlocks/singlequery/queries/term.query"),M=t("./queryBlocks/singlequery/queries/exists.query"),j=t("./queryBlocks/singlequery/queries/terms.query"),F=t("./queryBlocks/singlequery/queries/prefix.query"),D=t("./queryBlocks/singlequery/queries/multi-match.query"),L=t("./queryBlocks/singlequery/queries/query_string.query"),V=t("./queryBlocks/singlequery/queries/simple_query_string.query"),Q=t("./queryBlocks/singlequery/queries/missing.query"),U=t("./queryBlocks/singlequery/queries/wildcard.query"),B=t("./queryBlocks/singlequery/queries/regexp.query"),H=t("./queryBlocks/singlequery/queries/fuzzy.query"),z=t("./queryBlocks/singlequery/queries/ids.query"),G=t("./queryBlocks/singlequery/queries/common.query"),W=t("./queryBlocks/singlequery/queries/geodistance.query"),J=t("./queryBlocks/singlequery/queries/geoboundingbox.query"),$=t("./queryBlocks/singlequery/queries/geodistancerange.query"),K=t("./queryBlocks/singlequery/queries/geopolygon.query"),X=t("./queryBlocks/singlequery/queries/geohashcell.query"),Z=t("./queryBlocks/singlequery/queries/geoshape.query"),Y=t("./queryBlocks/singlequery/queries/span_term.query"),tt=t("./queryBlocks/singlequery/queries/span_first.query"),et=t("./shared/pipes/prettyJson"),nt=t("./shared/pipes/prettyTime"),rt=t("./features/list/time/time.component"),it=t("./queryBlocks/sortBlock/sortBlock.component"),ot=function(){function t(){}return t=r([o.NgModule({imports:[s.BrowserModule,a.FormsModule,u.HttpModule],declarations:[c.AppComponent,l.QueryBlocksComponent,p.JsonEditorComponent,h.ResultComponent,f.SaveQueryComponent,d.ListQueryComponent,y.ShareUrlComponent,g.AppselectComponent,m.ErrorModalComponent,_.DocSidebarComponent,v.ConfirmModalComponent,b.LearnModalComponent,w.BoolqueryComponent,E.TypesComponent,it.SortBlockComponent,O.SinglequeryComponent,C.EditableComponent,S.select2Component,x.SubscribeModalComponent,P.AuthOperation,C.EditableComponent,O.SinglequeryComponent,S.select2Component,T.MatchQuery,N.Match_phraseQuery,k.Match_phase_prefixQuery,A.RangeQuery,R.GtQuery,I.LtQuery,q.TermQuery,j.TermsQuery,M.ExistsQuery,D.MultiMatchQuery,L.QueryStringQuery,V.SimpleQueryStringQuery,Q.MissingQuery,F.PrefixQuery,U.WildcardQuery,B.RegexpQuery,H.FuzzyQuery,z.IdsQuery,W.GeoDistanceQuery,J.GeoBoundingBoxQuery,$.GeoDistanceRangeQuery,K.GeoPolygonQuery,X.GeoHashCellQuery,Z.GeoShapeQuery,G.CommonQuery,Y.SpanTermQuery,tt.SpanFirstQuery,et.prettyJson,rt.TimeComponent,nt.prettyTime],bootstrap:[c.AppComponent]}),i("design:paramtypes",[])],t)}();n.AppModule=ot},{"./app.component":1,"./features/appselect/appselect.component":4,"./features/confirm/confirm-modal.component":5,"./features/docSidebar/docsidebar.component":6,"./features/learn/learn.component":7,"./features/list/list.query.component":8,"./features/list/time/time.component":9,"./features/modal/error-modal.component":10,"./features/save/save.query.component":11,"./features/share/share.url.component":12,"./features/subscribe/AuthOperation":13,"./features/subscribe/subscribe.component":14,"./jsonEditor/jsonEditor.component":15,"./queryBlocks/boolquery/boolquery.component":16,"./queryBlocks/editable/editable.component":17,"./queryBlocks/queryBlocks.component":18,"./queryBlocks/select2/select2.component":19,"./queryBlocks/singlequery/queries/common.query":20,"./queryBlocks/singlequery/queries/exists.query":21,"./queryBlocks/singlequery/queries/fuzzy.query":22,"./queryBlocks/singlequery/queries/geoboundingbox.query":23,"./queryBlocks/singlequery/queries/geodistance.query":24,"./queryBlocks/singlequery/queries/geodistancerange.query":25,"./queryBlocks/singlequery/queries/geohashcell.query":26,"./queryBlocks/singlequery/queries/geopolygon.query":27,"./queryBlocks/singlequery/queries/geoshape.query":28,"./queryBlocks/singlequery/queries/gt.query":29,"./queryBlocks/singlequery/queries/ids.query":30,"./queryBlocks/singlequery/queries/lt.query":31,"./queryBlocks/singlequery/queries/match.query":32,"./queryBlocks/singlequery/queries/match_phase_prefix.query":33,"./queryBlocks/singlequery/queries/match_phrase.query":34,"./queryBlocks/singlequery/queries/missing.query":35,"./queryBlocks/singlequery/queries/multi-match.query":36,"./queryBlocks/singlequery/queries/prefix.query":37,"./queryBlocks/singlequery/queries/query_string.query":38,"./queryBlocks/singlequery/queries/range.query":39,"./queryBlocks/singlequery/queries/regexp.query":40,"./queryBlocks/singlequery/queries/simple_query_string.query":41,"./queryBlocks/singlequery/queries/span_first.query":42,"./queryBlocks/singlequery/queries/span_term.query":43,"./queryBlocks/singlequery/queries/term.query":44,"./queryBlocks/singlequery/queries/terms.query":45,"./queryBlocks/singlequery/queries/wildcard.query":46,"./queryBlocks/singlequery/singlequery.component":47,"./queryBlocks/sortBlock/sortBlock.component":48,"./queryBlocks/types/types.component":49,"./result/result.component":50,"./shared/pipes/prettyJson":55,"./shared/pipes/prettyTime":56,"@angular/core":62,"@angular/forms":63,"@angular/http":64,"@angular/platform-browser":66}],3:[function(t,e,n){"use strict";var r=t("@angular/platform-browser-dynamic"),i=t("./app.module");r.platformBrowserDynamic().bootstrapModule(i.AppModule)},{"./app.module":2,"@angular/platform-browser-dynamic":65}],4:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.onAppSelectChange=new o.EventEmitter,this.setConfig=new o.EventEmitter,this.filteredApps=[],this.appFocus=!1}return t.prototype.ngOnInit=function(){this.onAppSelectChange.emit(this.config.appname)},t.prototype.ngOnChanges=function(){this.onAppSelectChange.emit(this.config.appname)},t.prototype.handleInput=function(){this.filteredApps=this.getFilterApp(),this.filteredApps.length?this.appFocus=!0:this.appFocus=!1,this.onAppSelectChange.emit(this.config.appname)},t.prototype.getFilterApp=function(){return this.appsList.filter(function(t,e){return""===this.config.appname||""!==this.config.appname&&t.appname.toUpperCase().indexOf(this.config.appname.toUpperCase())!==-1}.bind(this))},t.prototype.focusInput=function(){this.filteredApps=this.getFilterApp(),this.filteredApps.length&&(this.appFocus=!0),this.onAppSelectChange.emit(this.config.appname)},t.prototype.blurInput=function(){setTimeout(function(){this.appFocus=!1}.bind(this),500),this.onAppSelectChange.emit(this.config.appname)},t.prototype.setApp=function(t){this.setConfig.emit(t),this.onAppSelectChange.emit(t.appname)},r([o.Input(),i("design:type",Object)],t.prototype,"appsList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"config",void 0),r([o.Input(),i("design:type",Boolean)],t.prototype,"connected",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"onAppSelectChange",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setConfig",void 0),t=r([o.Component({selector:"appselect",templateUrl:"./app/features/appselect/appselect.component.html",inputs:["setConfig","onAppSelectChange"]}),i("design:paramtypes",[])],t)}();n.AppselectComponent=s},{"@angular/core":62}],5:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.callback=new o.EventEmitter}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(){},t.prototype.confirm=function(t){this.callback.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"info",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"callback",void 0),t=r([o.Component({selector:"confirm-modal",templateUrl:"./app/features/confirm/confirm-modal.component.html",inputs:["callback"]}),i("design:paramtypes",[])],t)}();n.ConfirmModalComponent=s},{"@angular/core":62}],6:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/platform-browser"),a=function(){function t(t){this.sanitizer=t,this.setDocSample=new o.EventEmitter,this.open=!1}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){t.docLink.currentValue&&(this.url=this.sanitizer.bypassSecurityTrustResourceUrl(t.docLink.currentValue),this.open=!0)},t.prototype.close=function(){this.setDocSample.emit(null),this.open=!1},r([o.Input(),i("design:type",Object)],t.prototype,"docLink",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"doc-sidebar",templateUrl:"./app/features/docSidebar/docsidebar.component.html",inputs:["setDocSample"]}),i("design:paramtypes",[s.DomSanitizer])],t)}();n.DocSidebarComponent=a},{"@angular/core":62,"@angular/platform-browser":66}],7:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/http"),a=t("../subscribe/AuthOperation"),u=t("../../shared/storage.service"),c=function(){function t(t,e){this.http=t,this.storageService=e,this.saveQuery=new o.EventEmitter,this.newQuery=new o.EventEmitter,this.queries=[],this.subscribeOption="major",this.profile=null,this.serverAddress="https://ossauth.appbase.io",this.updateStatus=this.updateStatus.bind(this)}return t.prototype.loadLearn=function(){var t=this;this.http.get("./app/shared/default.data.json").toPromise().then(function(e){var n=e.json();n.queries.forEach(function(e){t.saveQuery.emit(e)}),setTimeout(function(){t.newQuery.emit(n.queries[0])},500),$("#learnModal").modal("hide"),$("#learnInfoModal").modal("show")})["catch"](function(t){console.log(t)})},t.prototype.updateStatus=function(t){this.profile=t.profile},t.prototype.subscribe=function(){this.authOperation.login(this.subscribeOption)},r([o.Output(),i("design:type",Object)],t.prototype,"saveQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"newQuery",void 0),r([o.ViewChild(a.AuthOperation),i("design:type",a.AuthOperation)],t.prototype,"authOperation",void 0),t=r([o.Component({selector:"learn-modal",templateUrl:"./app/features/learn/learn.component.html",inputs:["saveQuery","newQuery"]}),i("design:paramtypes",[s.Http,u.StorageService])],t)}();n.LearnModalComponent=c},{"../../shared/storage.service":58,"../subscribe/AuthOperation":13,"@angular/core":62,"@angular/http":64}],8:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.newQuery=new o.EventEmitter,this.deleteQuery=new o.EventEmitter,this.clearAll=new o.EventEmitter,this.sort=new o.EventEmitter,this.searchList=new o.EventEmitter,this.direction=!1}return t.prototype.ngOnInit=function(){},t.prototype.applyQuery=function(t){var e=this.savedQueryList.filter(function(e){return e.name===t.name&&e.tag===t.tag});e.length&&this.newQuery.emit(e[0])},t.prototype.applyDeleteQuery=function(t){this.deleteQuery.emit(t)},t.prototype.applyClearAll=function(){this.clearAll.emit(null)},t.prototype.applySearchList=function(){this.searchList.emit({searchTerm:this.searchTerm,searchByMethod:this.searchByMethod})},t.prototype.tagApply=function(t,e,n){this.searchTerm=e,this.searchByMethod=n,this.applySearchList(),t.stopPropagation()},r([o.Input(),i("design:type",Object)],t.prototype,"savedQueryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"sort_by",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"sort_direction",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"searchTerm",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"filteredQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"newQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"deleteQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"clearAll",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"sort",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"searchList",void 0),t=r([o.Component({selector:"list-query",templateUrl:"./app/features/list/list.query.component.html",inputs:["newQuery","deleteQuery","clearAll","searchByMethod"]}),i("design:paramtypes",[])],t)}();n.ListQueryComponent=s},{"@angular/core":62}],9:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.ngOnInit=function(){this.setTimeInterval(!1)},t.prototype.ngOnChanges=function(){},t.prototype.setTimeInterval=function(t){this.time=t?this.time+1:this.time-1,t=!t,setTimeout(function(){this.setTimeInterval(t)}.bind(this),6e4)},r([o.Input(),i("design:type",Object)],t.prototype,"time",void 0),t=r([o.Component({selector:"time-relative",template:'\n\t\t\t\t\t{{time | prettyTime}}\n\t\t\t\t'}),i("design:paramtypes",[])],t)}();n.TimeComponent=s},{"@angular/core":62}],10:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.callback=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.errorHookHelp.applyEditor({lineNumbers:!1,lineWrapping:!0})},t.prototype.ngOnChanges=function(){},r([o.Input(),i("design:type",Object)],t.prototype,"info",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"errorHookHelp",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"callback",void 0),t=r([o.Component({selector:"error-modal",templateUrl:"./app/features/modal/error-modal.component.html",inputs:["callback"]}),i("design:paramtypes",[])],t)}();n.ErrorModalComponent=s},{"@angular/core":62}],11:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s), +s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("../../shared/storage.service"),a=function(){function t(t){this.storageService=t,this.query_info={name:"",tag:""}}return t.prototype.openModal=function(){$("#saveQueryModal").modal("show")},t.prototype.save=function(){var t={mapping:this.mapping,config:this.config,name:this.query_info.name,tag:this.query_info.tag};this.queryList.push(t);try{this.storageService.set("queryList",JSON.stringify(this.queryList))}catch(e){}console.log(this.queryList)},t=r([o.Component({selector:"save-query",templateUrl:"./app/features/save/save.query.component.html",inputs:["config","mapping","queryList"],providers:[s.StorageService]}),i("design:paramtypes",[s.StorageService])],t)}();n.SaveQueryComponent=a},{"../../shared/storage.service":58,"@angular/core":62}],12:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.ngOnInit=function(){var t={title:"Share Url",content:'',html:!0,trigger:"click"};$(".share-btn").popover(t),$(".share-btn").on("shown.bs.popover",function(){this.shareClick()}.bind(this)),$(".share-btn").on("hidden.bs.popover",function(){$(".share_content .success-msg").hide()}.bind(this))},t.prototype.ngOnChanges=function(){},t.prototype.shareClick=function(){var t=this.urlShare.convertToUrl("gh-pages");$("#for-share").val(t);var e=document.getElementById("for-share"),n=this.copyToClipboard(e);n&&$(".share_content .success-msg").show()},t.prototype.copyToClipboard=function(t){var e,n,r,i="_hiddenCopyText_",o="INPUT"===t.tagName||"TEXTAREA"===t.tagName;o?(r=t,e=t.selectionStart,n=t.selectionEnd):(r=document.getElementById(i),r||(r=document.createElement("textarea"),r.style.position="absolute",r.style.left="-9999px",r.style.top="0",r.id=i,document.body.appendChild(r)),r.textContent=t.textContent);var s=document.activeElement;r.focus(),r.setSelectionRange(0,r.value.length);var a;try{a=document.execCommand("copy")}catch(u){a=!1}return s&&"function"==typeof s.focus&&s.focus(),o?t.setSelectionRange(e,n):r.textContent="",a},r([o.Input(),i("design:type",Object)],t.prototype,"urlShare",void 0),t=r([o.Component({selector:"share-url",templateUrl:"./app/features/share/share.url.component.html"}),i("design:paramtypes",[])],t)}();n.ShareUrlComponent=s},{"@angular/core":62}],13:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/http"),a=t("../../shared/storage.service"),u=function(){function t(t,e){this.http=t,this.storageService=e,this.updateStatus=new o.EventEmitter,this.serverAddress="https://ossauth.appbase.io",this.access_token_applied=!1}return t.prototype.ngOnInit=function(){var t={domain:"appbaseio.auth0.com",clientID:"tCy6GxnrsyKec3UxXCuYLhU6XWFCMgRD",callbackURL:location.href,callbackOnLocationHash:!0};this.auth0=new Auth0(t),this.init.call(this)},t.prototype.init=function(){var t=this;this.parseHash.call(this);var e=this.parseHash.bind(this);setTimeout(function(){console.log("hash watching Activated!"),window.onhashchange=function(){!t.access_token_applied&&location.hash.indexOf("access_token")>-1&&(console.log("access_token found!"),e())}},300)},t.prototype.isTokenExpired=function(t){var e=this.auth0.decodeJwt(t),n=(new Date).getTime()/1e3;return e.exp-1?(this.access_token_applied=!0,this.restoreStates()):this.getUserProfile()},t.prototype.show_sign_in=function(){},t.prototype.restoreStates=function(){var t=location.href.split("#")[0],e=this.storageService.get("savedState"),n=t;n+=e&&e.indexOf("access_token")<0?e:"#",window.location.href=n,location.reload()},t.prototype.getUserProfile=function(){var t=this.serverAddress+"/api/getUserProfile",e=this.storageService.get("subscribeOption")&&"null"!==this.storageService.get("subscribeOption")?this.storageService.get("subscribeOption"):null,n={token:this.storageService.get("mirage_id_token"),origin_app:"MIRAGE",email_preference:e};$.ajax({type:"POST",url:t,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(n)}).done(function(t){this.storageService.set("subscribeOption",null),this.updateStatus.emit({profile:t.message})}.bind(this)).fail(function(t){console.error(t)})},t.prototype.parseHash=function(){var t=this.storageService.get("mirage_id_token");if(null===t||this.isTokenExpired(t)){var e=this.auth0.parseHash(window.location.hash);e&&e.idToken?(this.storageService.set("mirage_id_token",e.idToken),this.show_logged_in(e.idToken)):e&&e.error?(console.log("error: "+e.error),this.show_sign_in()):this.show_sign_in()}else this.show_logged_in(t)},r([o.Output(),i("design:type",Object)],t.prototype,"updateStatus",void 0),t=r([o.Component({selector:"auth-operation",template:""}),i("design:paramtypes",[s.Http,a.StorageService])],t)}();n.AuthOperation=u},{"../../shared/storage.service":58,"@angular/core":62,"@angular/http":64}],14:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/http"),a=t("./AuthOperation"),u=function(){function t(t){this.http=t,this.options={option1:{value:"major",text:"New MIRAGE releases"},option2:{value:"all",text:"Limited major updates"}},this.subscribeOption="major",this.profile=null,this.updateStatus=this.updateStatus.bind(this)}return t.prototype.open=function(){$("#subscribeModal").modal("show")},t.prototype.updateStatus=function(t){this.profile=t.profile},t.prototype.subscribe=function(){this.authOperation.login(this.subscribeOption)},r([o.ViewChild(a.AuthOperation),i("design:type",a.AuthOperation)],t.prototype,"authOperation",void 0),t=r([o.Component({selector:"subscribe-modal",templateUrl:"./app/features/subscribe/subscribe.component.html"}),i("design:paramtypes",[s.Http])],t)}();n.SubscribeModalComponent=u},{"./AuthOperation":13,"@angular/core":62,"@angular/http":64}],15:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("../shared/appbase.service"),a=function(){function t(t){this.appbaseService=t,this.streamPopoverInfo={trigger:"hover",placement:"right",content:"Stream is avtive, waiting for data updates .."},this.setProp=new o.EventEmitter,this.errorShow=new o.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;this.editorHookHelp.applyEditor(),$("#resultModal").modal({show:!1,backdrop:"static"}),$("#resultModal").on("hide.bs.modal",function(){$('#resultTabs a[href="#resultJson"]').tab("show"),t.responseHookHelp.focus('{"Loading": "please wait......"}');var e={name:"result_time_taken",value:null};t.setProp.emit(e)})},t.prototype.runQuery=function(){var t=this;this.appbaseService.setAppbase(this.config);var e=this.checkValidQuery();if(e.flag)$("#resultModal").modal("show"),this.appbaseService.posturl(t.finalUrl,e.payload).then(function(e){t.result.isWatching=!1;var n={name:"result_time_taken",value:e.json().took};t.setProp.emit(n);var r={name:"random_token",value:Math.random()};t.setProp.emit(r),t.result.output=JSON.stringify(e.json(),null,2),$("#resultModal").hasClass("in")?t.responseHookHelp.setValue(t.result.output):setTimeout(function(){t.responseHookHelp.setValue(t.result.output)},300)})["catch"](function(e){$("#resultModal").modal("hide"),t.result.isWatching=!1,t.result.output=JSON.stringify(e,null,4);var n={title:"Response Error",message:t.result.output};t.errorShow.emit(n)}),"stream"===this.responseMode&&this.setStream(e);else{var n={title:"Json validation",message:e.message};this.errorShow.emit(n)}},t.prototype.setStream=function(t){var e=this,n=$("#setType").val(),r=t.payload;setTimeout(function(){$(".stream-signal").show(),$(".stream-signal").popover(e.streamPopoverInfo)},300),this.appbaseService.searchStream(n,r).on("data",this.onStreamData.bind(this)).on("error",this.onStreamError.bind(this))},t.prototype.onStreamData=function(t){$(".stream-signal").addClass("warning").addClass("success");var e=JSON.stringify(t,null,2);$("#resultModal").hasClass("in")?this.responseHookHelp.prepend(e+"\n"):setTimeout(function(){this.responseHookHelp.prepend(e+"\n")},300)},t.prototype.onStreamError=function(t){setTimeout(function(){$(".stream-signal").hide()},300)},t.prototype.checkValidQuery=function(){var t=this.editorHookHelp.getValue();t=t.trim();var e={flag:!0,payload:null,message:null};if(this.result.resultQuery.result.forEach(function(t){t.internal.forEach(function(t){""!==t.field&&""!==t.query||(e.flag=!1)})}),e.flag&&t&&""!=t)try{e.payload=JSON.parse(t)}catch(n){e.message="Json is not valid."}else e.flag=!1,e.message=" Please complete your query first.";return e},t.prototype.setPropIn=function(){var t={name:"finalUrl",value:this.finalUrl};this.setProp.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"finalUrl",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",String)],t.prototype,"responseMode",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setProp",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"errorShow",void 0),t=r([o.Component({selector:"query-jsoneditor",templateUrl:"./app/jsonEditor/jsonEditor.component.html",inputs:["config","editorHookHelp","responseHookHelp","setProp","errorShow"],providers:[s.AppbaseService]}),i("design:paramtypes",[s.AppbaseService])],t)}();n.JsonEditorComponent=a},{"../shared/appbase.service":51,"@angular/core":62}],16:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.queryList=this.queryList,this.removeArray=[],this.query=this.query,this.informationList={nested:{title:"nested",content:'Nested query allows you to run a query against the nested documents and filter parent docs by those that have at least one nested document matching the query.\n\t\t\t\tRead more'},has_child:{title:"has_child",content:'has_child filter accepts a query and the child type to run against, and results in parent documents that have child docs matching the query.\n\t\t\t\tRead more'},has_parent:{title:"has_parent",content:'has_parent query accepts a query and a parent type. The query is executed in the parent document space, which is specified by the parent type, and returns child documents which associated parents have matched.\n\t\t\t\tRead more'},parent_id:{title:"parent_id",content:'parent_id query can be used to find child documents which belong to a particular parent. \n\t\t\t\tRead more'}},this.joiningQuery=[""],this.setJoiningQuery=new o.EventEmitter,this.setDocSample=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.allFields=this.result.resultQuery.availableFields,this.exeBuild()},t.prototype.ngOnChanges=function(){this.allFields=this.result.resultQuery.availableFields},t.prototype.addSubQuery=function(t){this.addBoolQuery(t)},t.prototype.removeInQuery=function(t){var e=this.result.resultQuery.result;this.removeArray.push(t);var n=!0;e.forEach(function(e,r){e.parent_id==t&&(this.removeInQuery(e.id),n=!1)}.bind(this)),n&&this.removeArray.forEach(function(t){e.forEach(function(n,r){n.id==t&&e.splice(r,1)}.bind(this))}.bind(this)),this.buildQuery()},t.prototype.exeBuild=function(){var t=this;setTimeout(function(){return t.buildQuery()},300)},t.prototype.booleanChange=function(t){this.query.boolparam=t,this.exeBuild()},t.prototype.joiningQueryChange=function(t){t.val&&(t=this.joiningQuery.indexOf(t.val)),this.joiningQueryParam=t,this.setJoiningQuery.emit({param:t,allFields:this.allFields}),this.exeBuild()},t.prototype.show_hidden_btns=function(t){$(".bool_query").removeClass("show_hidden"),$(t.currentTarget).addClass("show_hidden"),t.stopPropagation()},t.prototype.hide_hidden_btns=function(){$(".bool_query").removeClass("show_hidden")},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQueryParam",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setJoiningQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"bool-query",templateUrl:"./app/queryBlocks/boolquery/boolquery.component.html",inputs:["config","query","queryList","addQuery","removeQuery","addBoolQuery","queryFormat","buildQuery","buildInsideQuery","buildSubQuery","createQuery","setQueryFormat","editorHookHelp","urlShare","setDocSample"]}),i("design:paramtypes",[])],t)}();n.BoolqueryComponent=s},{"@angular/core":62}],17:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.callback=new o.EventEmitter,this.setDocSample=new o.EventEmitter}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(){},t.prototype.ngAfterViewInit=function(){},t.prototype.editable_on=function(t){$(".editable-pack").removeClass("on"),$(t.currentTarget).parents(".editable-pack").addClass("on"),"select2"==this.editableInput&&$(t.currentTarget).parents(".editable-pack").find("select").select2("open"),"select"==this.editableInput&&$(t.currentTarget).parents(".editable-pack").find("select").focus().simulate("mousedown")},t.prototype.editable_off=function(t){setTimeout(function(){if($(".editable-pack").removeClass("on"),"undefined"!=typeof this.passWithCallback){var t={external:this.passWithCallback,value:this.editableModal};this.callback.emit(t)}else this.callback.emit(this.editableModal)}.bind(this),300)},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"editableField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"editableInput",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"querySelector",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selector",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"editableModal",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"passWithCallback",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"callback",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"editable",templateUrl:"./app/queryBlocks/editable/editable.component.html",inputs:["editPlaceholder","callback","selectOption","informationList","showInfoFlag","searchOff","setDocSample"]}),i("design:paramtypes",[])],t)}();n.EditableComponent=s},{"@angular/core":62}],18:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("../shared/queryList"),a=function(){function t(){this.queryList=s.queryList,this.queryFormat={internal:{field:"",query:"",selectedField:"",selectedQuery:"",input:"",analyzeTest:"",type:""},bool:{boolparam:0,parent_id:0,id:0,internal:[],minimum_should_match:"",path:"",type:"",xid:0,parent_type:"",score_mode:""}},this.joiningQuery=[""],this.joiningQueryParam=0,this.popoverInfo={stream:{trigger:"hover",placement:"top",content:"Shows an interactive stream of results, useful when your data is changing quickly.",container:"body"},historic:{trigger:"hover",placement:"top",content:"Shows historical results, useful when your data is not changing quickly.",container:"body"}},this.saveQuery=new o.EventEmitter,this.setProp=new o.EventEmitter,this.setDocSample=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.handleEditable(),this.joiningQuery=this.result.joiningQuery},t.prototype.ngOnChanges=function(t){this.joiningQuery=this.result.joiningQuery,(t&&t.isAppbaseApp&&t.isAppbaseApp.currentValue||t.selectedTypes&&t.selectedTypes.currentValue.length)&&this.setPopover()},t.prototype.addBoolQuery=function(t){if(this.selectedTypes){var e=JSON.parse(JSON.stringify(this.queryFormat.bool)),n=JSON.parse(JSON.stringify(this.queryFormat.internal));e.internal.push(n),e.id=this.result.queryId,e.parent_id=t,this.result.queryId+=1,this.result.resultQuery.result.push(e),this.buildQuery()}else alert("Select type first.")},t.prototype.removeQuery=function(){this.result.resultQuery.result=[],this.buildQuery()},t.prototype.addSortBlock=function(){var t={selectedField:"",order:"asc",availableOptionalParams:[]};this.result.sort.push(t)},t.prototype.removeSortBlock=function(){this.result.sort=[],this.buildQuery()},t.prototype.addQuery=function(t){var e=this,n=JSON.parse(JSON.stringify(e.queryFormat.internal));t.internal.push(n),this.buildQuery()},t.prototype.buildQuery=function(){var t=this,e=this.result.resultQuery.result,n={};if(e.length){var r={};e.length>1?n.query={bool:r}:e[0].availableQuery&&e[0].internal.length>1?n.query={bool:r}:"must"===t.queryList.boolQuery[e[0].boolparam]?n.query=r:n.query={bool:r},e.forEach(function(e){e.availableQuery=t.buildInsideQuery(e)});var i=!0;e.forEach(function(n){e.forEach(function(e){if(e.parent_id==n.id){var r={bool:{}},o=t.queryList.boolQuery[e.boolparam];r.bool[o]=e.availableQuery,"should"===o&&(r.bool.minimum_should_match=e.minimum_should_match),"nested"===t.joiningQuery[t.joiningQueryParam]&&(r.bool.nested.path=e.path,r.bool.nested.score_mode=e.score_mode,i=!1),n.availableQuery.push(r)}})}),e.forEach(function(o){if(0===o.parent_id){var s=t.queryList.boolQuery[o.boolparam];t.joiningQuery&&"nested"===t.joiningQuery[t.joiningQueryParam]?(r.nested={path:o.path,score_mode:o.score_mode,query:{bool:(a={},a[s]=o.availableQuery,a)}},i=!1):t.joiningQuery&&"has_child"===t.joiningQuery[t.joiningQueryParam]?r[s]={has_child:{type:o.type,score_mode:o.score_mode,query:o.availableQuery}}:t.joiningQuery&&"has_parent"===t.joiningQuery[t.joiningQueryParam]?r[s]={has_parent:{parent_type:o.parent_type,query:o.availableQuery}}:t.joiningQuery&&"parent_id"===t.joiningQuery[t.joiningQueryParam]?r[s]={parent_id:{type:o.type,id:o.xid}}:o.internal.length>1||"must"!==s?r[s]=o.availableQuery:e.length>1?r[s]=o.availableQuery:(r=o.availableQuery[0],n.query=r),"should"===s?r.minimum_should_match=o.minimum_should_match:r.hasOwnProperty("minimum_should_match")&&delete r.minimum_should_match}var a}),i||(n.query=n.query.bool)}else this.selectedTypes.length&&(n.query={match_all:{}});t.result.sort&&t.result.sort.map(function(t){if(t.selectedField){n.hasOwnProperty("sort")||(n.sort=[]);var e={};t._geo_distance?(r={},r._geo_distance=(i={},i[t.selectedField]={lat:t._geo_distance.lat,lon:t._geo_distance.lon},i.order=t.order,i.distance_type=t._geo_distance.distance_type,i.unit=t._geo_distance.unit||"m",i),e=r,t.mode&&(e._geo_distance.mode=t.mode)):(o={},o[t.selectedField]={order:t.order},e=o,t.mode&&(e[t.selectedField].mode=t.mode),t.missing&&(e[t.selectedField].missing=t.missing)),n.sort.push(e)}var r,i,o}),this.result.resultQuery["final"]=JSON.stringify(n,null,2);try{this.editorHookHelp.setValue(t.result.resultQuery["final"])}catch(o){console.log(o)}try{this.urlShare.inputs.result=this.result,this.urlShare.createUrl()}catch(o){console.log(o)}},t.prototype.buildInsideQuery=function(t){var e=[];return t.internal.forEach(function(t){var e=!1;t.appliedQuery=this.createQuery(t,e)}.bind(this)),t.internal.forEach(function(t){e.push(t.appliedQuery)}),e},t.prototype.buildSubQuery=function(){var t=this.result.resultQuery.result[0];t.forEach(function(e){0!=e.parent_id&&t.forEach(function(t){e.parent_id==t.id&&t.appliedQuery.bool.must.push(e.appliedQuery)}.bind(this))}.bind(this))},t.prototype.createQuery=function(t,e){var n={query:"*",field:"*",queryFlag:!0,fieldFlag:!0};if(""!==t.analyzeTest&&""!==t.type&&""!==t.query||(n.queryFlag=!1),""===t.field&&(n.fieldFlag=!1),n.queryFlag)return t.appliedQuery;n.fieldFlag&&(n.field=t.selectedField);var r=this.setQueryFormat(n.query,n.field,t);return r},t.prototype.setQueryFormat=function(t,e,n){var r={};return r[t]={},r[t][e]=n.input,r},t.prototype.toggleBoolQuery=function(){this.result.resultQuery.result.length<1&&this.selectedTypes.length>0?this.addBoolQuery(0):this.removeQuery()},t.prototype.toggleSortQuery=function(){this.result.sort?(console.log("coming"),this.result.sort.length<1&&this.selectedTypes.length>0?this.addSortBlock():this.removeSortBlock()):(this.result.sort=[],this.addSortBlock())},t.prototype.handleEditable=function(){$("body").on("click",function(t){var e=$(t.target);e.hasClass(".editable-pack")||e.parents(".editable-pack").length||$(".editable-pack").removeClass("on")})},t.prototype.openModal=function(){$("#saveQueryModal").modal("show")},t.prototype.setPropIn=function(t){this.setProp.emit(t)},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},t.prototype.setJoiningQueryEve=function(t){this.joiningQueryParam=t.param,this.result.resultQuery.availableFields=t.allFields,this.buildQuery()},t.prototype.setPopover=function(){var t=this;setTimeout(function(){$(".responseMode .stream").popover(t.popoverInfo.stream),$(".responseMode .historic").popover(t.popoverInfo.historic)},1e3)},t.prototype.changeMode=function(t){this.responseMode=t;var e={name:"responseMode",value:t};this.setProp.emit(e)},r([o.Input(),i("design:type",Boolean)],t.prototype,"isAppbaseApp",void 0),r([o.Input(),i("design:type",String)],t.prototype,"responseMode",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"query_info",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"savedQueryList",void 0),r([o.Input(),i("design:type",String)],t.prototype,"finalUrl",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"urlShare",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"config",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"saveQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setProp",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"query-blocks",templateUrl:"./app/queryBlocks/queryBlocks.component.html",inputs:["detectChange","editorHookHelp","saveQuery","setProp","setDocSample"]}),i("design:paramtypes",[])],t)}();n.QueryBlocksComponent=a},{"../shared/queryList":57,"@angular/core":62}],19:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("../../shared/globalshare.service"),a=t("../../shared/docService"),u=function(){function t(t,e){this.globalShare=t,this.docService=e,this.callback=new o.EventEmitter,this.setDocSample=new o.EventEmitter}return t.prototype.ngOnChanges=function(){},t.prototype.ngAfterContentInit=function(){setTimeout(function(){var t;t=this.querySelector&&this.selector?$(this.querySelector).find("."+this.selector).find("select"):$("."+this.selector).find("select"),"undefined"!=typeof this.passWithCallback&&(this.querySelector&&this.selector?t=$(this.querySelector).find("."+this.selector+"-"+this.passWithCallback).find("select"):this.selector&&(t=$("."+this.selector+"-"+this.passWithCallback).find("select"))),this.setSelect2(t,function(e){var n={val:e,selector:t};"undefined"!=typeof this.passWithCallback&&(n.external=this.passWithCallback),this.callback.emit(n)}.bind(this))}.bind(this),300)},t.prototype.setSelect2=function(t,e){var n={placeholder:"Select from the option"};this.searchOff&&(n.minimumResultsForSearch=-1),t.select2(n),t.on("change",function(n){e(t.val())}.bind(this)),this.showInfoFlag&&t.on("select2:open",function(){this.setPopover.apply(this),$(".select2-search__field").keyup(function(){this.setPopover.apply(this)}.bind(this)),$(".select2-search__field").keydown(function(){this.setPopover.apply(this)}.bind(this))}.bind(this))},t.prototype.setPopover=function(){setTimeout(function(){var t=$("li.select2-results__option");t.each(function(t,e){var n=$(e).html(),r=this.getInformation(n);$(e).popover(r),$(e).on("shown.bs.popover",this.setLink.bind(this)),this.setLink()}.bind(this))}.bind(this),300)},t.prototype.getInformation=function(t){var t=this.informationList[t];return t.html=!0,t.trigger="click hover",t.placement="right",t.delay={show:50,hide:50},t},t.prototype.setLink=function(){var t=this;setTimeout(function(){$(".popover a").unbind("click").on("click",function(e){e.preventDefault();var n=e.target.href;t.setDocSample.emit(n)})}.bind(this),500)},r([o.Input(),i("design:type",Object)],t.prototype,"querySelector",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selector",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"showInfoFlag",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"passWithCallback",void 0),r([o.Input(),i("design:type",Boolean)],t.prototype,"searchOff",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"informationList",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"callback",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"select2",templateUrl:"./app/queryBlocks/select2/select2.component.html",inputs:["selectModal","selectOptions","setDocSample"],providers:[s.GlobalShare,a.DocService]}),i("design:paramtypes",[s.GlobalShare,a.DocService])],t)}();n.select2Component=u},{"../../shared/docService":52,"../../shared/globalshare.service":54,"@angular/core":62}],20:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="common",this.queryName="*",this.fieldName="*",this.information={title:"Common Terms",content:'Returns common terms matches by avoiding noise from high frequency terms with a cutoff frequency parameter.\n\t\t\t\tRead more'},this.informationList={minimum_should_match:{title:"minimum_should_match",content:'Specify a minimum number or % of low frequency terms which must be present in matches.'},low_freq_operator:{title:"low_freq_operator",content:"Specify 'and' (defaults to 'or') to make all terms required."}},this.default_options=["low_freq_operator","minimum_should_match"], +this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={query:{placeholder:"Query",value:""},cutoff_frequency:{placeholder:"Cutoff frequency",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery.common[this.fieldName].query&&(this.inputs.query.value=this.appliedQuery.common[this.fieldName].query),this.appliedQuery.common[this.fieldName].cutoff_frequency&&(this.inputs.cutoff_frequency.value=this.appliedQuery.common[this.fieldName].cutoff_frequency);for(var t in this.appliedQuery[this.current_query][this.fieldName])if(["query","cutoff_frequency"].indexOf(t)===-1){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.getFormat=function(){"common"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={query:this.inputs.query.value,cutoff_frequency:this.inputs.cutoff_frequency.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]={query:this.inputs.query.value,cutoff_frequency:this.inputs.cutoff_frequency.value},t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"common-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.CommonQuery=s},{"@angular/core":62}],21:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="exists",this.queryName="*",this.fieldName="*",this.information={title:"Exists",content:'Returns matches where the field value is not null. \n\t\t\t\t\tRead more'},this.queryFormat={}}return t.prototype.ngOnInit=function(){try{this.appliedQuery[this.current_query].field&&(this.appliedQuery[this.current_query].field=this.fieldName)}catch(t){}this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={field:this.fieldName},t},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"exists-query",template:'\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.ExistsQuery=s},{"@angular/core":62}],22:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="fuzzy",this.queryName="*",this.fieldName="*",this.information={title:"Fuzzy",content:'Returns matches within the edit distance specified by the fuzziness parameter.\n\t\t\t\t\tRead more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '},fuzziness:{title:"fuzziness",content:'The maximum edit distance. Defaults to AUTO.'},prefix_length:{title:"prefix_length",content:'The number of initial characters which will not be "fuzzified". Defaults to 0.'},max_expansions:{title:"max_expansions",content:'The maximum number of terms that the fuzzy query will expand to. Defaults to 50.'}},this.default_options=["boost","fuzziness","prefix_length","max_expansions"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query][this.fieldName])if(this.appliedQuery[this.current_query][this.fieldName]){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].value;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("value"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}else this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName]}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={value:this.inputs.input.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]=this.inputs.input.value,t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"fuzzy-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
',inputs:["getQueryFormat","querySelector","querySelector"]}),i("design:paramtypes",[])],t)}();n.FuzzyQuery=s},{"@angular/core":62}],23:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_bounding_box",this.information={title:"Geo Bounding Box Query",content:'Returns matches within a bounding box area. Specified with top left and bottom right (lat, long) values.\n Read more'},this.informationList={_name:{title:"_name",content:'Optional name field to identify the query.'},ignore_malformed:{title:"ignore_malformed",content:'Set to true to accept geo points with invalid latitude or longitude (default is false).'},type:{title:"type",content:'Set to memory if the query will be executed in memory, otherwise set to indexed.'}},this.default_options=["_name","ignore_malformed","type"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={top_left_lat:{placeholder:"TL_latitude",value:""},top_left_lon:{placeholder:"TL_longitude",value:""},bottom_right_lat:{placeholder:"BR_latitude",value:""},bottom_right_lon:{placeholder:"BR_longitude",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].top_left.lat&&(this.inputs.top_left_lat.value=this.appliedQuery[this.current_query][this.fieldName].top_left.lat),this.appliedQuery[this.current_query][this.fieldName].top_left.lon&&(this.inputs.top_left_lon.value=this.appliedQuery[this.current_query][this.fieldName].top_left.lon),this.appliedQuery[this.current_query][this.fieldName].bottom_right.lat&&(this.inputs.bottom_right_lat.value=this.appliedQuery[this.current_query][this.fieldName].bottom_right.lat),this.appliedQuery[this.current_query][this.fieldName].bottom_right.lon&&(this.inputs.bottom_right_lon.value=this.appliedQuery[this.current_query][this.fieldName].bottom_right.lon);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("top_left"!=t&&"bottom_right"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=(e={},e[this.queryName]=(n={},n[this.fieldName]={top_left:{lat:this.inputs.top_left_lat.value,lon:this.inputs.top_left_lon.value},bottom_right:{lat:this.inputs.bottom_right_lat.value,lon:this.inputs.bottom_right_lon.value}},n),e);return this.optionRows.forEach(function(e){t[this.queryName][e.name]=e.value}.bind(this)),t;var e,n},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-bounding-box-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoBoundingBoxQuery=s},{"@angular/core":62}],24:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_distance",this.information={title:"Geo Distance Query",content:'Returns matches within a specific distance from a geo-point field.\n Read more'},this.informationList={distance_type:{title:"distance_type",content:'How to compute the distance. Can either be sloppy_arc (default), arc\n (slightly more precise but significantly slower) or plane (faster, but inaccurate on long distances and close to the poles).'},optimize_bbox:{title:"optimize_bbox",content:'Defaults to memory which will do in memory bounding box checks before the distance check. Can also have values of indexed to use indexed value check, or none which disables bounding box optimization.'},_name:{title:"_name",content:'Optional name field to identify the query.'},ignore_malformed:{title:"ignore_malformed",content:'Set to true to accept geo points with invalid latitude or longitude (default is false).'}},this.default_options=["distance_type","optimize_bbox","_name","ignore_malformed"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={lat:{placeholder:"Latitude",value:""},lon:{placeholder:"Longitude",value:""},distance:{placeholder:"Distance (with unit)",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].lat&&(this.inputs.lat.value=this.appliedQuery[this.current_query][this.fieldName].lat),this.appliedQuery[this.current_query][this.fieldName].lon&&(this.inputs.lon.value=this.appliedQuery[this.current_query][this.fieldName].lon),this.appliedQuery[this.current_query][this.fieldName].distance&&(this.inputs.distance.value=this.appliedQuery[this.current_query][this.fieldName].distance);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("lat"!=t&&"lon"!=t&&"distance"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={distance:this.inputs.distance.value},t[this.queryName][this.fieldName]={lat:this.inputs.lat.value,lon:this.inputs.lon.value},this.optionRows.forEach(function(e){t[this.queryName][e.name]=e.value}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-distance-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoDistanceQuery=s},{"@angular/core":62}],25:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_distance_range",this.information={title:"Geo Distance Range Query",content:'Filters documents that exists within a range from a specific geo point.\n Read more'},this.informationList={distance_type:{title:"distance_type",content:'How to compute the distance. Can either be sloppy_arc (default), arc\n (slightly more precise but significantly slower) or plane (faster, but inaccurate on long distances and close to the poles).' +},optimize_bbox:{title:"optimize_bbox",content:'Defaults to memory which will do in memory bounding box checks before the distance check. Can also have values of indexed to use indexed value check, or none which disables bounding box optimization.'},_name:{title:"_name",content:'Optional name field to identify the query.'},ignore_malformed:{title:"ignore_malformed",content:'Set to true to accept geo points with invalid latitude or longitude (default is false).'}},this.default_options=["distance_type","optimize_bbox","_name","ignore_malformed"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={lat:{placeholder:"Latitude",value:""},lon:{placeholder:"Longitude",value:""},from:{placeholder:"From (with unit)",value:""},to:{placeholder:"To (with unit)",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){try{this.appliedQuery[this.current_query][this.fieldName].lat&&(this.inputs.lat.value=this.appliedQuery[this.current_query][this.fieldName].lat),this.appliedQuery[this.current_query][this.fieldName].lon&&(this.inputs.lon.value=this.appliedQuery[this.current_query][this.fieldName].lon),this.appliedQuery[this.current_query][this.fieldName].from&&(this.inputs.from.value=this.appliedQuery[this.current_query][this.fieldName].from),this.appliedQuery[this.current_query][this.fieldName].to&&(this.inputs.to.value=this.appliedQuery[this.current_query][this.fieldName].to);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("lat"!=t&&"lon"!=t&&"from"!=t&&"to"!=t){({name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]})}}catch(e){}this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=(e={},e[this.queryName]=(n={},n[this.fieldName]={lat:this.inputs.lat.value,lon:this.inputs.lon.value},n.from=this.inputs.from.value,n.to=this.inputs.to.value,n),e);return this.optionRows.forEach(function(e){t[this.queryName][e.name]=e.value}.bind(this)),t;var e,n},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-distance-range-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n\t\t\t\t\t\t\t\t\t\t\n
\n\t\t\t\t\t\t\t\t
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoDistanceRangeQuery=s},{"@angular/core":62}],26:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geohash_cell",this.information={title:"Geohash Cell Query",content:'Returns geo_point matches in proximity of the specified geohash cell.

\n\t\t\t\tA geohash cell is defined by setting additional properties to the geo_point mapping type.
\n Read more'},this.informationList={neighbors:{title:"neighbors",content:'When set to true, it returns matches next to the specified geohash cell.'}},this.default_options=["neighbors"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={lat:{placeholder:"Latitude",value:""},lon:{placeholder:"Longitude",value:""},precision:{placeholder:"Precision",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].lat&&(this.inputs.lat.value=this.appliedQuery[this.current_query][this.fieldName].lat),this.appliedQuery[this.current_query][this.fieldName].lon&&(this.inputs.lon.value=this.appliedQuery[this.current_query][this.fieldName].lon),this.appliedQuery[this.current_query].precision&&(this.inputs.precision.value=this.appliedQuery[this.current_query].precision);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("lat"!=t&&"lon"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=(e={},e[this.queryName]=(n={},n[this.fieldName]={lat:this.inputs.lat.value,lon:this.inputs.lon.value},n.precision=this.inputs.precision.value,n),e);return this.optionRows.forEach(function(e){t[this.queryName][e.name]=e.value}.bind(this)),t;var e,n},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geohash-cell-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoHashCellQuery=s},{"@angular/core":62}],27:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_polygon",this.information={title:"Geo Polygon Query",content:'Return matches that fall within a specified polygon shape.\n Read more'},this.informationList={_name:{title:"_name",content:'Optional name field to identify the query.'},ignore_malformed:{title:"ignore_malformed",content:'Set to true to accept geo points with invalid latitude or longitude (default is false).'}},this.default_options=["_name","ignore_malformed"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={points:{placeholder:"points",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].points&&(this.inputs.points.value=this.appliedQuery[this.current_query][this.fieldName].points);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("points"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=this.inputs.points.value;try{t=JSON.parse(t)}catch(e){}var n=(r={},r[this.queryName]=(i={},i[this.fieldName]={points:t},i),r);return this.optionRows.forEach(function(t){n[this.queryName][t.name]=t.value}.bind(this)),n;var r,i},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-polygon-query",template:'\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoPolygonQuery=s},{"@angular/core":62}],28:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="geo_shape",this.information={title:"Geo Shape Query",content:'Return matches that have a shape that relates with the query shape. A relation can be an intersection, subset, superset, or a disjoint.\n Read more'},this.informationList={relation:{title:"relation",content:'Defines the relation to match for, can be one of intersects, disjoint, within or contains.'}},this.default_options=["relation"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={type:{placeholder:"Type",value:""},coordinates:{placeholder:"Pass an Array",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery[this.current_query][this.fieldName].shape.type&&(this.inputs.type.value=this.appliedQuery[this.current_query][this.fieldName].shape.type),this.appliedQuery[this.current_query][this.fieldName].shape.coordinates&&(this.inputs.coordinates.value=this.appliedQuery[this.current_query][this.fieldName].shape.coordinates);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("shape"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t=this.inputs.coordinates.value;try{t=JSON.parse(t)}catch(e){}var n=(r={},r[this.queryName]=(i={},i[this.fieldName]={shape:{type:this.inputs.type.value,coordinates:t}},i),r);return this.optionRows.forEach(function(t){n[this.queryName][this.fieldName][t.name]=t.value}.bind(this)),n;var r,i},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"geo-shape-query",template:'\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GeoShapeQuery=s},{"@angular/core":62}],29:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="gt",this.information={title:"Greater Than",content:'Returns term values greater than the specified value. \n\t\t\t\t\tRead more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '}},this.default_options=["boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={gt:{placeholder:"Greater than",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery.range[this.fieldName][this.current_query]){this.inputs.gt.value=this.appliedQuery.range[this.fieldName].gt;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("gt"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}}catch(n){}this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,"gt"==this.selectedQuery&&(this.optionRows=[],this.getFormat()))},t.prototype.getFormat=function(){"gt"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={range:{}};return t.range[this.fieldName]={gt:this.inputs.gt.value},this.optionRows.forEach(function(e){t.range[this.fieldName][e.name]=e.value}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"gt-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
', inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.GtQuery=s},{"@angular/core":62}],30:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.information={title:"Ids",content:'Returns matches that only have the provided ids (_id field). \n\t\t\t\t\tRead more'},this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){try{if(this.appliedQuery.ids)try{this.inputs.input.value=this.appliedQuery.ids.values.join(",")}catch(t){this.inputs.input.value=this.appliedQuery.ids.values}}catch(t){}this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat())},t.prototype.getFormat=function(){"ids"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};t[this.queryName]={values:[],type:this.selectedTypes};try{t[this.queryName].values=this.inputs.input.value.split(",")}catch(e){t[this.queryName].values=[]}return t},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"ids-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.IdsQuery=s},{"@angular/core":62}],31:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="lt",this.information={title:"Less Than",content:'Returns term values less than the specified value. \n\t\t\t\t\tRead more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '}},this.default_options=["boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={lt:{placeholder:"Less than",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery.range[this.fieldName].lt){this.inputs.lt.value=this.appliedQuery.range[this.fieldName].lt;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("lt"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){"lt"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={range:{}};return t.range[this.fieldName]={lt:this.inputs.lt.value},this.optionRows.forEach(function(e){t.range[this.fieldName][e.name]=e.value}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"lt-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.LtQuery=s},{"@angular/core":62}],32:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="match",this.queryName="*",this.fieldName="*",this.information={title:"Match",content:'Returns matches by doing a full-text search, is used as the go to query.\n\t\t\t\t\tRead more'},this.informationList={operator:{title:"operator",content:"The operator flag can be set to 'OR' or 'AND' to control the boolean clauses."},zero_terms_query:{title:"zero_terms_query",content:'Accepts none (default) and all which corresponds to a match_all query.'},cutoff_frequency:{title:"cutoff_frequency",content:'cutoff_frequency allows specifying frequency threshold where high frequency terms are moved into an optional subquery.'},type:{title:"type",content:'There are three types of match query: boolean (default), phrase, and phrase_prefix'},analyzer:{title:"analyzer",content:'The analyzer used to analyze each term of the query when creating composite queries.'},max_expansions:{title:"max_expansions",content:'The maximum number of terms that the query will expand to. Defaults to 50.'}},this.default_options=["operator","zero_terms_query","cutoff_frequency","type","analyzer","max_expansions"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query][this.selectedField])if(this.appliedQuery[this.current_query][this.fieldName].hasOwnProperty("query")){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].query;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("query"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}else this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName]}catch(n){}this.filterOptions(),this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.optionRows=[],this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={query:this.inputs.input.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]=this.inputs.input.value,t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",String)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",String)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"match-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.MatchQuery=s},{"@angular/core":62}],33:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="match_phrase_prefix",this.information={title:"Match Phrase with a Prefix",content:'Returns matches similar to Match Phrase except the last term of the query text can be a prefix.\n\t\t\t\t\tRead more'},this.informationList={analyzer:{title:"analyzer",content:'analyzer can be set to control for the analysis process on the query text.'},max_expansions:{title:"max_expansions",content:'The maximum number of terms that the query will expand to. Defaults to 50.'}},this.default_options=["analyzer","max_expansions"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Prefix",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery.match_phrase_prefix[this.fieldName])if(this.appliedQuery[this.current_query][this.fieldName]&&"object"==typeof this.appliedQuery[this.current_query][this.fieldName]){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].query;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("query"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}else this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName]}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){"match_phrase_prefix"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={query:this.inputs.input.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]=this.inputs.input.value,t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"match-phase-prefix-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.Match_phase_prefixQuery=s},{"@angular/core":62}],34:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="match_phrase",this.information={title:"Match Phrase",content:'Returns matches by interpreting the query as a phrase.\n\t\t\t\t\tRead more'},this.informationList={analyzer:{title:"analyzer",content:'analyzer can be set to control for the analysis process on the query text.'}},this.inputs={input:{placeholder:"Input",value:""}},this.default_options=["analyzer"],this.singleOption={name:"",value:""},this.optionRows=[],this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query][this.selectedField])if(this.appliedQuery[this.current_query][this.fieldName]&&"object"==typeof this.appliedQuery[this.current_query][this.fieldName]){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].query;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("query"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}else this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName]}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){"match_phrase"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={query:this.inputs.input.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]=this.inputs.input.value,t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"match_phrase-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.Match_phraseQuery=s},{"@angular/core":62}],35:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="missing",this.queryName="*",this.fieldName="*",this.information={title:"Missing",content:'Returns matches where the field value is null. \n\t\t\t\t\tRead more'},this.informationList={existence:{title:"existence",content:'When set to false (defaults to true), matches where the field has no value will not be returned.'},null_value:{title:"null_value",content:'When set to false (defaults to true), matches where the field has null value will not be returned.'}},this.default_options=["existence","null_value"],this.singleOption={name:"",value:""},this.optionRows=[],this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query].field){this.appliedQuery[this.current_query].field=this.fieldName;for(var t in this.appliedQuery[this.current_query])if("field"!=t){var e={name:t,value:this.appliedQuery[this.current_query][t]};this.optionRows.push(e)}}}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={field:this.fieldName},this.optionRows.forEach(function(e){t[this.queryName][e.name]=e.value}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"missing-query",template:'\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.MissingQuery=s},{"@angular/core":62 }],36:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="multi_match",this.queryName="*",this.fieldName="*",this.information={title:"Multi Match",content:'Returns matches by doing a full-text search on multiple fields.\n\t\t\t\t\tRead more'},this.informationList={operator:{title:"operator",content:"The operator flag can be set to 'OR' or 'AND' to control the boolean clauses."},fields:{title:"fields",content:'Specify one or more fields separated by comma to run a multi-field query.'},type:{title:"type",content:'There are three types of match query: boolean (default), phrase, and phrase_prefix'}},this.default_options=["operator","fields","type"],this.placeholders={fields:"Comma seprated values"},this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query]){var t=this.appliedQuery[this.current_query];if(this.inputs.input.value=t.query,t.fields.length>1){var e=JSON.parse(JSON.stringify(t.fields));e.splice(0,1),e=e.join(",");var n={name:"fields",value:e};this.optionRows.push(n)}for(var r in t)if("fields"!=r&&"query"!=r){var n={name:r,value:t[r]};this.optionRows.push(n)}}}catch(i){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={},e=[this.fieldName];return t[this.queryName]={query:this.inputs.input.value,fields:e},this.optionRows.length&&this.optionRows.forEach(function(n){if("fields"!=n.name)t[this.queryName][n.name]=n.value;else{var r=n.value.split(",");e=e.concat(r),t[this.queryName].fields=e}}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",String)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",String)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"multi_match-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.MultiMatchQuery=s},{"@angular/core":62}],37:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="prefix",this.queryName="*",this.fieldName="*",this.information={title:"Prefix",content:'Returns results based on term prefix match.\n\t\t\t\t\tRead more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '}},this.default_options=["boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query][this.fieldName])if(this.appliedQuery[this.current_query][this.fieldName].hasOwnProperty("value")){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].value;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("value"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}else this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName]}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={value:this.inputs.input.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]=this.inputs.input.value,t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"prefix-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.PrefixQuery=s},{"@angular/core":62}],38:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="query_string",this.queryName="*",this.fieldName="*",this.information={title:"Query String",content:'Returns matches based on a query that uses a query parser in order to parse its content.\n\t\t\t\t\tRead more'},this.informationList={default_field:{title:"default_field",content:'The default field for query terms if no prefix field is specified.'},fields:{title:"fields",content:'Specify one or more fields separated by comma to run a multi-field query.'},use_dis_max:{title:"use_dis_max",content:'Should the queries be combined using dis_max (set it to true), or a bool query (set it to false). Defaults to true.'}},this.default_options=["default_field","fields","use_dis_max"],this.placeholders={fields:"Comma separated values"},this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query]){var t=this.appliedQuery[this.current_query];if(this.inputs.input.value=t.query,t.fields.length>1){var e=JSON.parse(JSON.stringify(t.fields));e.splice(0,1),e=e.join(",");var n={name:"fields",value:e};this.optionRows.push(n)}for(var r in t)if("fields"!=r&&"query"!=r){var n={name:r,value:t[r]};this.optionRows.push(n)}}}catch(i){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={},e=[this.fieldName];return t[this.queryName]={query:this.inputs.input.value,fields:e},this.optionRows.length&&this.optionRows.forEach(function(n){if("fields"!=n.name)t[this.queryName][n.name]=n.value;else{var r=n.value.split(",");e=e.concat(r),t[this.queryName].fields=e}}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",String)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",String)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"query_string-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.QueryStringQuery=s},{"@angular/core":62}],39:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="range",this.information={title:"Range",content:'Returns term values within the specified range. \n\t\t\t\tRead more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '}},this.default_options=["boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={gte:{placeholder:"From",value:""},lte:{placeholder:"To",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{this.appliedQuery.range[this.fieldName].gte&&(this.inputs.gte.value=this.appliedQuery.range[this.fieldName].gte),this.appliedQuery.range[this.fieldName].lte&&(this.inputs.lte.value=this.appliedQuery.range[this.fieldName].lte);for(var t in this.appliedQuery[this.current_query][this.fieldName])if("gte"!=t&&"lte"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){"range"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},t[this.queryName][this.fieldName]={gte:this.inputs.gte.value,lte:this.inputs.lte.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"range-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.RangeQuery=s},{"@angular/core":62}],40:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="regexp",this.queryName="*",this.fieldName="*",this.information={title:"Regexp",content:'Returns matches based on regular expression term queries.\n\t\t\t\t\tRead more'},this.informationList={flags:{title:"flags",content:'Possible flags are ALL (default), ANYSTRING, COMPLEMENT, EMPTY, INTERSECTION, INTERVAL, or NONE.'},max_determinized_states:{title:"max_determinized_states",content:'Controls the max number of determinized automaton states (defaults to 10000).'},boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '}},this.default_options=["flags","max_determinized_states","boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query][this.selectedField])if(this.appliedQuery[this.current_query][this.fieldName].value){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].value;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("value"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}else this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName]}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={value:this.inputs.input.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]=this.inputs.input.value,t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"regexp-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.RegexpQuery=s},{"@angular/core":62}],41:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="simple_query_string",this.queryName="*",this.fieldName="*",this.information={title:"Simple Query String",content:'Returns matches based on SimpleQueryParser to parse its context. Simple Query String discards invalid parts of the query and never throws an exception.\n\t\t\t\t\tRead more'},this.informationList={fields:{title:"fields",content:'Specify one or more fields separated by comma to run a multi-field query.'},default_operator:{title:"default_operator",content:"he default operator used if no explicit operator is specified. Can be either 'AND' or 'OR'."},analyzer:{title:"analyzer",content:'The analyzer used to analyze each term of the query when creating composite queries.'}},this.default_options=["fields","default_operator","analyzer"],this.placeholders={fields:"Comma seprated values"},this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query]){var t=this.appliedQuery[this.current_query];if(this.inputs.input.value=t.query,t.fields.length>1){var e=JSON.parse(JSON.stringify(t.fields)); e.splice(0,1),e=e.join(",");var n={name:"fields",value:e};this.optionRows.push(n)}for(var r in t)if("fields"!=r&&"query"!=r){var n={name:r,value:t[r]};this.optionRows.push(n)}}}catch(i){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={},e=[this.fieldName];return t[this.queryName]={query:this.inputs.input.value,fields:e},this.optionRows.length&&this.optionRows.forEach(function(n){if("fields"!=n.name)t[this.queryName][n.name]=n.value;else{var r=n.value.split(",");e=e.concat(r),t[this.queryName].fields=e}}.bind(this)),t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",String)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",String)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"simple_query_string-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.SimpleQueryStringQuery=s},{"@angular/core":62}],42:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="span_first",this.information={title:"Span First",content:'Matches spans near the beginning of a field. The span first query maps to Lucene SpanFirstQuery.\n Read more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0'}},this.default_options=["boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""},end:{placeholder:"End",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query].match.span_term[this.selectedField]){this.inputs.input.value=this.appliedQuery[this.current_query].match.span_term[this.fieldName].value,this.inputs.end.value=this.appliedQuery[this.current_query].end;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("value"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={match:{span_term:(e={},e[this.fieldName]={},e)}},this.optionRows.length?(t[this.queryName].match.span_term[this.fieldName].value=this.inputs.input.value,t[this.queryName].end=this.inputs.end.value,this.optionRows.forEach(function(e){t[this.queryName].match.span_term[this.fieldName][e.name]=e.value}.bind(this))):(t[this.queryName].match.span_term[this.fieldName].value=this.inputs.input.value,t[this.queryName].end=this.inputs.end.value),t;var e},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"span-first-query",template:'\n
\n \n \n \n
\n
\n \n \n \n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.SpanFirstQuery=s},{"@angular/core":62}],43:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="span_term",this.information={title:"Span Term",content:'Matches spans containing a term. The span term query maps to Lucene SpanTermQuery.\n Read more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0'}},this.default_options=["boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query][this.selectedField]){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].value;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("value"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat())},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]=(e={},e[this.fieldName]={},e),this.optionRows.length?(t[this.queryName][this.fieldName].value=this.inputs.input.value,this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName].value=this.inputs.input.value,t;var e},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"span-term-query",template:'\n
\n \n \n \n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.SpanTermQuery=s},{"@angular/core":62}],44:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.current_query="term",this.information={title:"Term",content:'Returns matches with the exact term value.\n\t\t\t\t\tRead more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '}},this.default_options=["boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query][this.selectedField])if(this.appliedQuery[this.current_query][this.fieldName].value){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].value;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("value"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}else this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName]}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){"term"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={value:this.inputs.input.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]=this.inputs.input.value,t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"term-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.TermQuery=s},{"@angular/core":62}],45:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.queryName="*",this.fieldName="*",this.information={title:"Terms",content:'Returns matches with one of the exact values from the provided terms. \n\t\t\t\t\tRead more'},this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){try{if(this.appliedQuery.terms[this.fieldName])try{this.inputs.input.value=this.appliedQuery.terms[this.fieldName].join(" ")}catch(t){this.inputs.input.value=this.appliedQuery.terms[this.fieldName]}}catch(t){}this.getFormat()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat())},t.prototype.getFormat=function(){"terms"===this.queryName&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};t[this.queryName]={};try{t[this.queryName][this.fieldName]=this.inputs.input.value.split(",")}catch(e){t[this.queryName][this.fieldName]=this.inputs.input.value.join(",")}return t},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"terms-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.TermsQuery=s},{"@angular/core":62}],46:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.getQueryFormat=new o.EventEmitter,this.current_query="wildcard",this.queryName="*",this.fieldName="*",this.information={title:"Wildcard",content:'Returns matches based on a wildcard expression.\n\t\t\t\t\tRead more'},this.informationList={boost:{title:"boost",content:'Sets the boost value of the query, defaults to 1.0 '}},this.default_options=["boost"],this.singleOption={name:"",value:""},this.optionRows=[],this.inputs={input:{placeholder:"Input",value:""}},this.queryFormat={}}return t.prototype.ngOnInit=function(){this.options=JSON.parse(JSON.stringify(this.default_options));try{if(this.appliedQuery[this.current_query][this.selectedField])if(this.appliedQuery[this.current_query][this.fieldName].value){this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName].value;for(var t in this.appliedQuery[this.current_query][this.fieldName])if("value"!=t){var e={name:t,value:this.appliedQuery[this.current_query][this.fieldName][t]};this.optionRows.push(e)}}else this.inputs.input.value=this.appliedQuery[this.current_query][this.fieldName]}catch(n){}this.getFormat(),this.filterOptions()},t.prototype.ngOnChanges=function(){""!=this.selectedField&&this.selectedField!==this.fieldName&&(this.fieldName=this.selectedField,this.getFormat()),""!=this.selectedQuery&&this.selectedQuery!==this.queryName&&(this.queryName=this.selectedQuery,this.getFormat(),this.optionRows=[])},t.prototype.getFormat=function(){this.queryName===this.current_query&&(this.queryFormat=this.setFormat(),this.getQueryFormat.emit(this.queryFormat))},t.prototype.setFormat=function(){var t={};return t[this.queryName]={},this.optionRows.length?(t[this.queryName][this.fieldName]={value:this.inputs.input.value},this.optionRows.forEach(function(e){t[this.queryName][this.fieldName][e.name]=e.value}.bind(this))):t[this.queryName][this.fieldName]=this.inputs.input.value,t},t.prototype.selectOption=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.optionRows[t.external].name=t.val,this.filterOptions(),setTimeout(function(){this.getFormat()}.bind(this),300)},t.prototype.filterOptions=function(){this.options=this.default_options.filter(function(t){var e=!0;return this.optionRows.forEach(function(n){n.name===t&&(e=!1)}),e}.bind(this))},t.prototype.addOption=function(){var t=JSON.parse(JSON.stringify(this.singleOption));this.filterOptions(),this.optionRows.push(t)},t.prototype.removeOption=function(t){this.optionRows.splice(t,1),this.filterOptions(),this.getFormat()},r([o.Input(),i("design:type",Object)],t.prototype,"queryList",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedField",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"appliedQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedQuery",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"getQueryFormat",void 0),t=r([o.Component({selector:"wildcard-query",template:'\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t',inputs:["getQueryFormat","querySelector"]}),i("design:paramtypes",[])],t)}();n.WildcardQuery=s},{"@angular/core":62}],47:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("./queries/match.query"),a=t("./queries/match_phrase.query"),u=t("./queries/match_phase_prefix.query"),c=t("./queries/range.query"),l=t("./queries/gt.query"),p=t("./queries/lt.query"),h=t("./queries/term.query"),f=t("./queries/exists.query"),d=t("./queries/terms.query"),y=t("./queries/prefix.query"),m=t("./queries/multi-match.query"),v=t("./queries/query_string.query"),g=t("./queries/simple_query_string.query"),_=t("./queries/missing.query"),b=t("./queries/wildcard.query"),w=t("./queries/regexp.query"),E=t("./queries/fuzzy.query"),O=t("./queries/ids.query"),C=t("./queries/common.query"),S=t("./queries/geodistance.query"),x=t("./queries/geoboundingbox.query"),P=t("./queries/geodistancerange.query"),T=t("./queries/geopolygon.query"),N=t("./queries/geohashcell.query"),k=t("./queries/geoshape.query"),A=t("./queries/span_term.query"),R=t("./queries/span_first.query"),I=function(){ -function t(){this.queryList=this.queryList,this.removeArray=[],this.selector={field:"field-select",query:"query-select"},this.joiningQuery=[""],this.setDocSample=new o.EventEmitter,this.informationList={}}return t.prototype.ngOnInit=function(){this.querySelector=".query-"+this.queryIndex+"-"+this.internalIndex,this.allFields=this.result.resultQuery.availableFields.slice()},t.prototype.ngOnChanges=function(){var t=this;this.allFields=this.result.resultQuery.availableFields.slice(),this.querySelector=".query-"+this.queryIndex+"-"+this.internalIndex,setTimeout(function(){if(t.result.resultQuery.availableFields=t.checkAvailableFields(),t.query.selectedField){var e=t.getField(t.query.selectedField);e.length||t.removeQuery()}},300)},t.prototype.ngAfterViewInit=function(){this.informationList={match:this.matchQuery.information,match_phrase:this.match_phraseQuery.information,match_phrase_prefix:this.match_phase_prefixQuery.information,range:this.rangeQuery.information,gt:this.gtQuery.information,lt:this.ltQuery.information,term:this.termQuery.information,terms:this.termsQuery.information,exists:this.existsQuery.information,multi_match:this.multiMatchQuery.information,query_string:this.queryStringQuery.information,simple_query_string:this.simpleQueryStringQuery.information,missing:this.missingQuery.information,prefix:this.prefixQuery.information,wildcard:this.wildcardQuery.information,regexp:this.regexpQuery.information,fuzzy:this.fuzzyQuery.information,ids:this.idsQuery.information,common:this.commonQuery.information,geo_distance:this.geoDistanceQuery.information,geo_bounding_box:this.geoBoundingBoxQuery.information,geo_distance_range:this.geoDistanceRangeQuery.information,geo_polygon:this.geoPolygonQuery.information,geohash_cell:this.geoHashCellQuery.information,geo_shape:this.geoShapeQuery.information,span_term:this.spanTermQuery.information,span_first:this.spanFirstQuery.information}},t.prototype.checkAvailableFields=function(){var t=this.allFields,e=this.mapping[this.config.appname].mappings;if("nested"==this.joiningQuery[this.joiningQueryParam]){var n={};this.selectedTypes.forEach(function(t){Object.assign(n,e[t].properties)});var r=function(e){"nested"===n[e].type&&(t=t.filter(function(t){return t.name.indexOf(e+".")>-1}))};for(var i in n)r(i)}if("has_child"==this.joiningQuery[this.joiningQueryParam]){t=[];for(var o in e)if(e[o].hasOwnProperty("_parent")){var s=e[o].properties;for(var a in s){var u="undefined"!=typeof s[a].index?s[a].index:null,i={name:a,type:s[a].type,index:u};switch(i.type){case"long":case"integer":case"short":case"byte":case"double":case"float":case"date":i.type="numeric";break;case"text":case"keyword":i.type="string"}t.push(i)}}}return t},t.prototype.getQueryFormat=function(t){this.query.appliedQuery=t,this.buildQuery()},t.prototype.removeQuery=function(){this.internal.splice(this.internalIndex,1),this.buildQuery()},t.prototype.analyzeTest=function(t){$(t.selector).parents(".editable-pack").removeClass("on"),this.query.field=this.getField(t.val)[0],this.query.analyzeTest="not_analyzed"===this.query.field.index?"not_analyzed":"analyzed",this.query.type=this.query.field.type,this.query.selectedField=t.val},t.prototype.queryCallback=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.query.query=t.val,this.query.selectedQuery=this.queryList[this.query.analyzeTest][this.query.type][this.query.query],this.buildQuery()},t.prototype.exeBuild=function(){var t=this;setTimeout(function(){return t.buildQuery()},300)},t.prototype.getField=function(t){return this.result.resultQuery.availableFields.filter(function(e){return e.name===t})},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"query",void 0),r([o.Input(),i("design:type",String)],t.prototype,"boolQueryName",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQueryParam",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),r([o.ViewChild(s.MatchQuery),i("design:type",s.MatchQuery)],t.prototype,"matchQuery",void 0),r([o.ViewChild(a.Match_phraseQuery),i("design:type",a.Match_phraseQuery)],t.prototype,"match_phraseQuery",void 0),r([o.ViewChild(u.Match_phase_prefixQuery),i("design:type",u.Match_phase_prefixQuery)],t.prototype,"match_phase_prefixQuery",void 0),r([o.ViewChild(c.RangeQuery),i("design:type",c.RangeQuery)],t.prototype,"rangeQuery",void 0),r([o.ViewChild(l.GtQuery),i("design:type",l.GtQuery)],t.prototype,"gtQuery",void 0),r([o.ViewChild(p.LtQuery),i("design:type",p.LtQuery)],t.prototype,"ltQuery",void 0),r([o.ViewChild(h.TermQuery),i("design:type",h.TermQuery)],t.prototype,"termQuery",void 0),r([o.ViewChild(d.TermsQuery),i("design:type",d.TermsQuery)],t.prototype,"termsQuery",void 0),r([o.ViewChild(y.PrefixQuery),i("design:type",y.PrefixQuery)],t.prototype,"prefixQuery",void 0),r([o.ViewChild(f.ExistsQuery),i("design:type",f.ExistsQuery)],t.prototype,"existsQuery",void 0),r([o.ViewChild(m.MultiMatchQuery),i("design:type",m.MultiMatchQuery)],t.prototype,"multiMatchQuery",void 0),r([o.ViewChild(v.QueryStringQuery),i("design:type",v.QueryStringQuery)],t.prototype,"queryStringQuery",void 0),r([o.ViewChild(g.SimpleQueryStringQuery),i("design:type",g.SimpleQueryStringQuery)],t.prototype,"simpleQueryStringQuery",void 0),r([o.ViewChild(_.MissingQuery),i("design:type",_.MissingQuery)],t.prototype,"missingQuery",void 0),r([o.ViewChild(b.WildcardQuery),i("design:type",b.WildcardQuery)],t.prototype,"wildcardQuery",void 0),r([o.ViewChild(w.RegexpQuery),i("design:type",w.RegexpQuery)],t.prototype,"regexpQuery",void 0),r([o.ViewChild(E.FuzzyQuery),i("design:type",E.FuzzyQuery)],t.prototype,"fuzzyQuery",void 0),r([o.ViewChild(O.IdsQuery),i("design:type",O.IdsQuery)],t.prototype,"idsQuery",void 0),r([o.ViewChild(C.CommonQuery),i("design:type",C.CommonQuery)],t.prototype,"commonQuery",void 0),r([o.ViewChild(S.GeoDistanceQuery),i("design:type",S.GeoDistanceQuery)],t.prototype,"geoDistanceQuery",void 0),r([o.ViewChild(x.GeoBoundingBoxQuery),i("design:type",x.GeoBoundingBoxQuery)],t.prototype,"geoBoundingBoxQuery",void 0),r([o.ViewChild(P.GeoDistanceRangeQuery),i("design:type",P.GeoDistanceRangeQuery)],t.prototype,"geoDistanceRangeQuery",void 0),r([o.ViewChild(T.GeoPolygonQuery),i("design:type",T.GeoPolygonQuery)],t.prototype,"geoPolygonQuery",void 0),r([o.ViewChild(N.GeoHashCellQuery),i("design:type",N.GeoHashCellQuery)],t.prototype,"geoHashCellQuery",void 0),r([o.ViewChild(k.GeoShapeQuery),i("design:type",k.GeoShapeQuery)],t.prototype,"geoShapeQuery",void 0),r([o.ViewChild(A.SpanTermQuery),i("design:type",A.SpanTermQuery)],t.prototype,"spanTermQuery",void 0),r([o.ViewChild(R.SpanFirstQuery),i("design:type",R.SpanFirstQuery)],t.prototype,"spanFirstQuery",void 0),t=r([o.Component({selector:"single-query",templateUrl:"./app/queryBlocks/singlequery/singlequery.component.html",inputs:["config","queryList","addQuery","internal","internalIndex","queryIndex","buildQuery","buildInsideQuery","buildSubQuery","createQuery","setQueryFormat","editorHookHelp","urlShare","setDocLink","setDocSample"]}),i("design:paramtypes",[])],t)}();n.SinglequeryComponent=I},{"./queries/common.query":20,"./queries/exists.query":21,"./queries/fuzzy.query":22,"./queries/geoboundingbox.query":23,"./queries/geodistance.query":24,"./queries/geodistancerange.query":25,"./queries/geohashcell.query":26,"./queries/geopolygon.query":27,"./queries/geoshape.query":28,"./queries/gt.query":29,"./queries/ids.query":30,"./queries/lt.query":31,"./queries/match.query":32,"./queries/match_phase_prefix.query":33,"./queries/match_phrase.query":34,"./queries/missing.query":35,"./queries/multi-match.query":36,"./queries/prefix.query":37,"./queries/query_string.query":38,"./queries/range.query":39,"./queries/regexp.query":40,"./queries/simple_query_string.query":41,"./queries/span_first.query":42,"./queries/span_term.query":43,"./queries/term.query":44,"./queries/terms.query":45,"./queries/wildcard.query":46,"@angular/core":62}],48:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.queryList=this.queryList,this.removeArray=[],this.query=this.query,this.allFields=[],this.distanceTypeList=["sloppy_arc","arc","plane"],this.informationList={min:{title:"min",content:'Pick the lowest value.'},max:{title:"max",content:'Pick the highest value.'},sum:{title:"sum",content:'Use the sum of all values as sort value. Only applicable for number based array fields.'},avg:{title:"avg",content:'Use the average of all values as sort value. Only applicable for number based array fields.'},median:{title:"median",content:'Use the median of all values as sort value. Only applicable for number based array fields.'}},this.optionalParamsInformation={mode:{title:"mode",content:'The mode option controls what array value is picked for sorting the document it belongs to.\n Read more'},missing:{title:"missing",content:'The missing parameter specifies how docs which are missing the field should be treated. The value can be set to _last, _first, or a custom value.\n Read more'},nested:{title:"nested",content:'Allows sorting withing nested objects\n Read more'},_geo_distance:{title:"_geo_distance",content:'Allow to sort by _geo_distance.\n Read more'}},this.distanceTypeInformation={sloppy_arc:{title:"sloppy_arc",content:'Default distance type'},arc:{title:"arc",content:'slightly more precise but significantly slower.'},plane:{title:"plane",content:'faster, but inaccurate on long distances and close to the poles.'}},this.joiningQuery=[""],this.setDocSample=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.result.resultQuery.hasOwnProperty("availableFields")&&(this.allFields=this.result.resultQuery.availableFields.map(function(t){return t.name}))},t.prototype.ngOnChanges=function(){this.result.resultQuery.hasOwnProperty("availableFields")&&(this.allFields=this.result.resultQuery.availableFields.map(function(t){return t.name}))},t.prototype.exeBuild=function(){var t=this;setTimeout(function(){return t.buildQuery()},300)},t.prototype.initSort=function(){var t={selectedField:"",order:"asc",availableOptionalParams:[],modeList:[]};this.result.sort.push(t),this.exeBuild()},t.prototype.deleteSort=function(){this.result.sort=[],this.exeBuild()},t.prototype.sortFieldCallback=function(t){var e=this.result.sort[t.external],n=!1;e.selectedField=t.val,e.availableOptionalParams=[],e.mode||""==e.mode||e.availableOptionalParams.push("mode"),e.missing||""==e.missing||e.availableOptionalParams.push("missing"),this.result.resultQuery.availableFields.map(function(r){if(r.name===t.val)if("geo_point"===r.type){var i=e.availableOptionalParams.indexOf("missing");i>-1&&e.availableOptionalParams.splice(i,1),e.hasOwnProperty("missing")&&delete e.missing,n=!0,e.modeList=["min","max","avg","median"],e._geo_distance={distance_type:"sloppy_arc",lat:"",lon:"",unit:""}}else e.modeList=["min","max","sum","avg","median"]}),n||delete e._geo_distance,this.exeBuild()},t.prototype.sortModeCallback=function(t){this.result.sort[t.external].mode=t.val,this.exeBuild()},t.prototype.sortDistanceTypeCallback=function(t){this.result.sort[t.external]._geo_distance.distance_type=t.val,this.exeBuild()},t.prototype.sortOptionalCallback=function(t){var e=this.result.sort[t.external],n=e.availableOptionalParams.indexOf(t.val);n>-1&&e.availableOptionalParams.splice(n,1),e[t.val]=""},t.prototype.setSortOrder=function(t,e){this.result.sort[e].order=t,this.exeBuild()},t.prototype.removeSortQuery=function(t){this.result.sort.splice(t,1),this.exeBuild()},t.prototype.removeSortOptionalQuery=function(t,e){this.result.sort[t].availableOptionalParams.push(e),delete this.result.sort[t][e],this.exeBuild()},t.prototype.show_hidden_btns=function(t){$(".bool_query").removeClass("show_hidden"),$(t.currentTarget).addClass("show_hidden"),t.stopPropagation()},t.prototype.hide_hidden_btns=function(){$(".bool_query").removeClass("show_hidden")},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQueryParam",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"sort-block",templateUrl:"./app/queryBlocks/sortBlock/sortBlock.component.html",inputs:["config","query","queryList","addQuery","removeQuery","addBoolQuery","queryFormat","buildQuery","buildInsideQuery","buildSubQuery","createQuery","setQueryFormat","editorHookHelp","urlShare","setDocSample"]}),i("design:paramtypes",[])],t)}();n.SortBlockComponent=s},{"@angular/core":62}],49:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.setProp=new o.EventEmitter,this.buildQuery=new o.EventEmitter}return t.prototype.ngOnChanges=function(t){if(t.detectChange&&this.types.length){var e=$("#setType");e.attr("class").indexOf("selec2")>-1&&e.select2("destroy").html(""),e.select2({placeholder:"Select types to apply query",tags:!1,data:this.createTokenData(this.types)}),e.on("change",function(t){this.changeType(e.val())}.bind(this))}},t.prototype.createTokenData=function(t){var e=[];return t.forEach(function(t){var n={id:t,text:t};e.push(n)}),e},t.prototype.changeType=function(t){function e(t,n){void 0===n&&(n=null);var i={};for(var o in t){if(i[o]=t[o],t[o].fields)for(var s in t[o].fields){var a=o+"."+s;a=n?n+"."+a:a,i[a]=t[o].fields[s]}if(t[o].properties){for(var s in t[o].properties){var a=o+"."+s;a=n?n+"."+a:a,i[a]=t[o].properties[s]}e.call(this,t[o].properties,o)}"nested"===t[o].type&&this.result.joiningQuery.indexOf("nested")<0&&this.result.joiningQuery.push("nested")}for(var u in i){var c="undefined"!=typeof i[u].index?i[u].index:null,l={name:u,type:i[u].type,index:c};switch(l.type){case"long":case"integer":case"short":case"byte":case"double":case"float":case"date":l.type="numeric";break;case"text":case"keyword":l.type="string"}r.push(l)}}var n,r=[],i=this.mapping[this.config.appname].mappings;this.result.joiningQuery=[""],t&&t.length?(t.forEach(function(t){var n=i[t].properties;e.call(this,n)}.bind(this)),this.setUrl(t),n={name:"selectedTypes",value:t},this.setProp.emit(n)):(n={name:"selectedTypes",value:[]},this.setProp.emit(n),this.setUrl([])),n={name:"availableFields",value:r},this.setProp.emit(n);for(var o in i)i[o].hasOwnProperty("_parent")&&t&&t.indexOf(i[o]._parent.type)>-1&&this.result.joiningQuery.indexOf("has_child")<0&&(this.result.joiningQuery.push("has_child"),this.result.joiningQuery.push("has_parent"),this.result.joiningQuery.push("parent_id"))},t.prototype.setUrl=function(t){var e=t;if(this.finalUrl){var n=this.finalUrl.split("/"),r="";if(n[3]=this.config.appname,n.length>4)n[4]=e.join(","),n[5]="_search",r=n.join("/");else{var i="/"+e.join(",");e.length||(i=""),r=this.finalUrl+i+"/_search"}var o={name:"finalUrl",value:r};this.setProp.emit(o)}else console.log("Finalurl is not present");setTimeout(function(){this.buildQuery.emit(null)}.bind(this),300)},r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"config",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",String)],t.prototype,"finalUrl",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"urlShare",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setProp",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"buildQuery",void 0),t=r([o.Component({selector:"types",templateUrl:"./app/queryBlocks/types/types.component.html",inputs:["detectChange","setProp","buildQuery"]}),i("design:paramtypes",[])],t)}();n.TypesComponent=s},{"@angular/core":62}],50:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/platform-browser"),a=function(){function t(t){this.sanitizer=t,this.urlAvailable=!1,this.dejavuDomain="https://opensource.appbase.io/dejavu/live/"}return t.prototype.ngOnInit=function(){this.responseHookHelp.applyEditor({readOnly:!0})},t.prototype.ngOnChanges=function(t){if(t&&t.result_random_token){var e=t.result_random_token.previousValue,n=t.result_random_token.currentValue;if(n&&e!==n&&this.editorHookHelp){var r=this.editorHookHelp.getValue();if(r){console.log(this.selectedTypes),r=r.trim(),r=JSON.parse(r);var i={query:r,type:this.selectedTypes};this.url=this.sanitizeUrl(this.dejavuDomain),setTimeout(function(){var t=this.dejavuDomain+"#?input_state="+this.urlShare.url;t=t+"&hf=false&sidebar=false&subscribe=false&query="+JSON.stringify(i),this.url=this.sanitizeUrl(t),console.log(this.url)}.bind(this),300),this.urlAvailable=!0}}}},t.prototype.sanitizeUrl=function(t){return this.sanitizer.bypassSecurityTrustResourceUrl(t)},r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",String)],t.prototype,"responseMode",void 0),t=r([o.Component({selector:"query-result",templateUrl:"./app/result/result.component.html",inputs:["mapping","config","editorHookHelp","urlShare","responseHookHelp","result_time_taken","result_random_token","types","result","config","responseHookHelp","result_time_taken"]}),i("design:paramtypes",[s.DomSanitizer])],t)}();n.ResultComponent=a},{"@angular/core":62,"@angular/platform-browser":66}],51:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/http");t("rxjs/add/operator/toPromise");var a=function(){function t(t){this.http=t,this.requestParam={url:null,auth:null},this.config={username:null,password:null},this.resultStream=null}return t.prototype.setAppbase=function(t){this.config.username=t.username,this.config.password=t.password,this.requestParam.pureurl=t.url,t.appname?this.requestParam.url=t.url+"/"+t.appname:this.requestParam.url=t.url;var e={url:"https://scalr.api.appbase.io",app:t.appname};t.username&&(e.credentials=t.username+":"+t.password,this.requestParam.auth="Basic "+btoa(t.username+":"+t.password)),this.appbaseRef=new Appbase(e)},t.prototype.get=function(t){var e={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(e.Authorization=this.requestParam.auth);var n=new s.Headers(e),r=this.requestParam.url.replace(this.config.username+":"+this.config.password+"@",""),i=r+t+"/";return this.http.get(i,{headers:n}).toPromise()},t.prototype.getMappings=function(){function t(t){var n={"Content-Type":"application/json;charset=UTF-8"};e.requestParam.auth&&(n.Authorization=e.requestParam.auth);var r=new s.Headers(n),i=e.requestParam.url.replace(e.config.username+":"+e.config.password+"@",""),o=i+t+"/";return console.log(o),e.http.get(o,{headers:r}).toPromise()}var e=this;return new Promise(function(e,n){t("/_mapping").then(function(n){var r=n.json();t("/_alias").then(function(t){var n=t.json();for(var i in n)for(var o in n[i].aliases)r[o]=r[i];e(r)})["catch"](function(t){e(r)})})["catch"](function(t){n(t)})})},t.prototype.getVersion=function(){var t={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(t.Authorization=this.requestParam.auth);var e=new s.Headers(t),n=this.requestParam.url.replace(this.config.username+":"+this.config.password+"@",""),r=n+"/_settings?human";return console.log(r),this.http.get(r,{headers:e}).toPromise()},t.prototype.post=function(t,e){var n=JSON.stringify(e),r={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(r.Authorization=this.requestParam.auth);var i=new s.Headers(r);return this.http.post(this.requestParam.url+t,n,{headers:i}).toPromise()},t.prototype.posturl=function(t,e){var n=JSON.stringify(e),r={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(r.Authorization=this.requestParam.auth);var i=new s.Headers(r);return this.http.post(t,n,{headers:i}).toPromise()},t.prototype.put=function(t,e){var n={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(n.Authorization=this.requestParam.auth);var r=new s.Headers(n);return this.http.put(this.requestParam.url+t,e,{headers:r}).toPromise()},t.prototype["delete"]=function(t){var e={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(e.Authorization=this.requestParam.auth);var n=new s.Headers(e);return this.http["delete"](this.requestParam.url+t,{headers:n}).toPromise()},t.prototype.handleError=function(t){console.error("An error occurred",t)},t.prototype.getIndices=function(t){var e=this.filterurl(t);return this.setAppbase(e),this.get("/_stats/indices")},t.prototype.filterurl=function(t){if(t){var e={username:null,password:null,url:t},n=t.split(":");try{e.username=n[1].replace("//","");var r=t.split("://");if(n[2]){var i=n[2].split("@");e.password=i[0],t.indexOf("@")!==-1&&(e.url=r[0]+"://"+i[1],n[3]&&(e.url+=":"+n[3]))}}catch(o){console.log(o)}return e}return null},t.prototype.searchStream=function(t,e){return this.resultStream&&this.resultStream.stop(),this.resultStream=this.appbaseRef.searchStream({type:t,body:e}),this.resultStream},t=r([o.Injectable(),i("design:paramtypes",[s.Http])],t)}();n.AppbaseService=a},{"@angular/core":62,"@angular/http":64,"rxjs/add/operator/toPromise":74}],52:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("rxjs/BehaviorSubject"),a=function(){function t(){this._navItemSource=new s.BehaviorSubject(""),this.navItem$=this._navItemSource.asObservable()}return t.prototype.emitNavChangeEvent=function(t){this._navItemSource.next(t)},t=r([o.Injectable(),i("design:paramtypes",[])],t)}();n.DocService=a},{"@angular/core":62,"rxjs/BehaviorSubject":67}],53:[function(t,e,n){"use strict";n.EditorHook=function(t){this.editorId=t.editorId,this.$editor="#"+t.editorId},n.EditorHook.prototype.applyEditor=function(t){var e=this;this.settings=t;var n={lineNumbers:!0,mode:"javascript",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,tabSize:2,extraKeys:{"Ctrl-Q":function(t){t.foldCode(t.getCursor())}},foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]},r=t?jQuery.extend(n,t):n;e.editor=CodeMirror.fromTextArea(document.getElementById(e.editorId),r)},n.EditorHook.prototype.setValue=function(t){this.editor&&this.editor.setValue&&this.editor.setValue(t)},n.EditorHook.prototype.focus=function(t){this.editor.toTextArea(),this.applyEditor(this.settings),this.setValue(t)},n.EditorHook.prototype.getValue=function(){return this.editor.getValue()},n.EditorHook.prototype.getInstance=function(){return this.editor},n.EditorHook.prototype.prepend=function(t){var e=t.split(/\r\n|\r|\n/).length;this.editor.replaceRange(t,{line:0,ch:0});for(var n=0;n=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.informationList={}}return t.prototype.setValue=function(t,e){this[t]=e,console.log(this.informationList)},t.prototype.getValue=function(t){return console.log(this),console.log(t,this[t]),this[t]},t=r([o.Injectable(),i("design:paramtypes",[])],t)}();n.GlobalShare=s},{"@angular/core":62}],55:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.transform=function(t){return JSON.stringify(t,null,4)},t=r([o.Pipe({name:"prettyJson"}),i("design:paramtypes",[])],t)}();n.prettyJson=s},{"@angular/core":62}],56:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.transform=function(t){return moment(t).fromNow(!0)},t=r([o.Pipe({name:"prettyTime"}),i("design:paramtypes",[])],t)}();n.prettyTime=s},{"@angular/core":62}],57:[function(t,e,n){"use strict";n.queryList={analyzed:{string:["match","match_phrase","term","terms","exists","missing","multi_match","query_string","prefix","wildcard","regexp","fuzzy","simple_query_string","match_phrase_prefix","ids","common","span_term","span_first"],numeric:["match","range","gt","lt","exists","missing","ids","common"],geo_point:["geo_distance","geo_distance_range","geo_bounding_box","geo_polygon","geohash_cell"],geo_shape:["geo_shape"]},not_analyzed:{string:["term","exists","terms","prefix"],numeric:["match","range","gt","lt"],geo_point:["geo_distance","geo_bounding_box","geo_distance_range","geo_polygon","geohash_cell"]},boolQuery:["must","must_not","should","filter"],allowedDataTypes:["string","text","keyword","date","numeric","geo_point","geo_shape"]}},{}],58:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.set=function(t,e){window.localStorage.setItem(t,e)},t.prototype.get=function(t){return window.localStorage.getItem(t)},t=r([o.Injectable(),i("design:paramtypes",[])],t)}();n.StorageService=s},{"@angular/core":62}],59:[function(t,e,n){"use strict";n.UrlShare=function(){this.secret="e",this.decryptedData={},this.inputs={},this.url=""},n.UrlShare.prototype.getInputs=function(){return this.inputs},n.UrlShare.prototype.setInputs=function(t){this.inputs=t,this.createUrl()},n.UrlShare.prototype.createUrl=function(){function t(t,e){if(!t){this.url=e,window.location.href.indexOf("#?default=true")>-1&&(window.location.href=window.location.href.split("?default=true")[0]);var n="#?input_state="+e;for(var r in this.queryParams)"input_state"!==r&&(console.log(r,this.queryParams[r]),n+="&"+r+"="+this.queryParams[r]);window.location.href=n}}this.inputs&&this.inputs.config&&(this.inputs.appname=this.inputs.config.appname,this.inputs.url=this.inputs.config.url),this.inputs.selectedTypes&&(this.inputs.selectedType=this.inputs.selectedTypes);var e=JSON.parse(JSON.stringify(this.inputs));try{delete e.result.resultQuery["final"],delete e.result.output}catch(n){}JSON.stringify(e);this.compress(e,t.bind(this))},n.UrlShare.prototype.decryptUrl=function(t){var e=this;return new Promise(function(t,n){e.queryParams=e.getQueryParameters(),e.queryParams.input_state?e.decompress(e.queryParams.input_state,function(e,n){n&&n.appname&&n.url&&(n.config={appname:n.appname,url:n.url}),n&&n.config&&(n.appname=n.config.appname,n.url=n.config.url),t({error:e, -data:n})}):t({error:"Empty url"})})},n.UrlShare.prototype.convertToUrl=function(t){var e=this.url,n="";return n="gh-pages"==t?"appbaseio.github.io/mirage/#?input_state="+e:window.location.protocol+"//"+window.location.host+"#?input_state="+e},n.UrlShare.prototype.dejavuLink=function(){var t="http://appbaseio.github.io/dejavu/live/#?input_state="+this.url;return t},n.UrlShare.prototype.compress=function(t,e){if(!t)return e("Input should not be empty");var n=JSON.stringify(t);JSONURL.compress(n,9,function(t,n){try{var r=SafeEncode.buffer(t);e(null,SafeEncode.encode(r))}catch(i){e(i)}})},n.UrlShare.prototype.decompress=function(t,e){var n=this;if(!t)return e("Empty");var r=SafeEncode.buffer(t);JSONURL.decompress(SafeEncode.decode(r),function(t,r){var i=t;try{i?(i=JSON.parse(i),n.decryptedData=i,e(null,i)):e("Not found")}catch(o){e(o)}})},n.UrlShare.prototype.getQueryParameters=function(t){var e=window.location.hash.split("#");return e.length>1?(t||e[1]).replace(/(^\?)/,"").split("&").map(function(t){return t=t.split("="),this[t[0]]=t[1],this}.bind({}))[0]:null}},{}],60:[function(t,e,n){(function(r){!function(r,i){"object"==typeof n&&"undefined"!=typeof e?i(n,t("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],i):i((r.ng=r.ng||{},r.ng.common=r.ng.common||{}),r.ng.core)}(this,function(t,e){"use strict";function n(t){return t.name||typeof t}function i(t){return void 0!==t&&null!==t}function o(t){return void 0===t||null===t}function s(t){return"object"==typeof t&&null!==t}function a(t){return Array.isArray(t)}function u(t){return t instanceof Date&&!isNaN(t.valueOf())}function c(t){if("string"==typeof t)return t;if(void 0===t||null===t)return""+t;if(t.overriddenName)return t.overriddenName;if(t.name)return t.name;var e=t.toString(),n=e.indexOf("\n");return n===-1?e:e.substring(0,n)}function l(t){return null!==t&&("function"==typeof t||"object"==typeof t)}function p(){if(o(L))if(i(A.Symbol)&&i(Symbol.iterator))L=Symbol.iterator;else for(var t=Object.getOwnPropertyNames(Map.prototype),e=0;e0&&e.startsWith(t)?e.substring(t.length):e}function f(t){return/\/index.html$/g.test(t)?t.substring(0,t.length-11):t}function d(t,e,n){var r="="+t;return e.indexOf(r)>-1?r:n.getPluralCategory(t)}function y(t,e){"string"==typeof e&&(e=parseInt(e,10));var n=e,r=n.toString().replace(/^[^.]*\.?/,""),i=Math.floor(Math.abs(n)),o=r.length,s=parseInt(r,10),a=parseInt(n.toString().replace(/^[^.]*\.?|0+$/g,""),10)||0,u=t.split("-")[0].toLowerCase();switch(u){case"af":case"asa":case"az":case"bem":case"bez":case"bg":case"brx":case"ce":case"cgg":case"chr":case"ckb":case"ee":case"el":case"eo":case"es":case"eu":case"fo":case"fur":case"gsw":case"ha":case"haw":case"hu":case"jgo":case"jmc":case"ka":case"kk":case"kkj":case"kl":case"ks":case"ksb":case"ky":case"lb":case"lg":case"mas":case"mgo":case"ml":case"mn":case"nb":case"nd":case"ne":case"nn":case"nnh":case"nyn":case"om":case"or":case"os":case"ps":case"rm":case"rof":case"rwk":case"saq":case"seh":case"sn":case"so":case"sq":case"ta":case"te":case"teo":case"tk":case"tr":case"ug":case"uz":case"vo":case"vun":case"wae":case"xog":return 1===n?j.One:j.Other;case"agq":case"bas":case"cu":case"dav":case"dje":case"dua":case"dyo":case"ebu":case"ewo":case"guz":case"kam":case"khq":case"ki":case"kln":case"kok":case"ksf":case"lrc":case"lu":case"luo":case"luy":case"mer":case"mfe":case"mgh":case"mua":case"mzn":case"nmg":case"nus":case"qu":case"rn":case"rw":case"sbp":case"twq":case"vai":case"yav":case"yue":case"zgh":case"ak":case"ln":case"mg":case"pa":case"ti":return n===Math.floor(n)&&n>=0&&n<=1?j.One:j.Other;case"am":case"as":case"bn":case"fa":case"gu":case"hi":case"kn":case"mr":case"zu":return 0===i||1===n?j.One:j.Other;case"ar":return 0===n?j.Zero:1===n?j.One:2===n?j.Two:n%100===Math.floor(n%100)&&n%100>=3&&n%100<=10?j.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=99?j.Many:j.Other;case"ast":case"ca":case"de":case"en":case"et":case"fi":case"fy":case"gl":case"it":case"nl":case"sv":case"sw":case"ur":case"yi":return 1===i&&0===o?j.One:j.Other;case"be":return n%10===1&&n%100!==11?j.One:n%10===Math.floor(n%10)&&n%10>=2&&n%10<=4&&!(n%100>=12&&n%100<=14)?j.Few:n%10===0||n%10===Math.floor(n%10)&&n%10>=5&&n%10<=9||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=14?j.Many:j.Other;case"br":return n%10===1&&n%100!==11&&n%100!==71&&n%100!==91?j.One:n%10===2&&n%100!==12&&n%100!==72&&n%100!==92?j.Two:n%10===Math.floor(n%10)&&(n%10>=3&&n%10<=4||n%10===9)&&!(n%100>=10&&n%100<=19||n%100>=70&&n%100<=79||n%100>=90&&n%100<=99)?j.Few:0!==n&&n%1e6===0?j.Many:j.Other;case"bs":case"hr":case"sr":return 0===o&&i%10===1&&i%100!==11||s%10===1&&s%100!==11?j.One:0===o&&i%10===Math.floor(i%10)&&i%10>=2&&i%10<=4&&!(i%100>=12&&i%100<=14)||s%10===Math.floor(s%10)&&s%10>=2&&s%10<=4&&!(s%100>=12&&s%100<=14)?j.Few:j.Other;case"cs":case"sk":return 1===i&&0===o?j.One:i===Math.floor(i)&&i>=2&&i<=4&&0===o?j.Few:0!==o?j.Many:j.Other;case"cy":return 0===n?j.Zero:1===n?j.One:2===n?j.Two:3===n?j.Few:6===n?j.Many:j.Other;case"da":return 1===n||0!==a&&(0===i||1===i)?j.One:j.Other;case"dsb":case"hsb":return 0===o&&i%100===1||s%100===1?j.One:0===o&&i%100===2||s%100===2?j.Two:0===o&&i%100===Math.floor(i%100)&&i%100>=3&&i%100<=4||s%100===Math.floor(s%100)&&s%100>=3&&s%100<=4?j.Few:j.Other;case"ff":case"fr":case"hy":case"kab":return 0===i||1===i?j.One:j.Other;case"fil":return 0===o&&(1===i||2===i||3===i)||0===o&&i%10!==4&&i%10!==6&&i%10!==9||0!==o&&s%10!==4&&s%10!==6&&s%10!==9?j.One:j.Other;case"ga":return 1===n?j.One:2===n?j.Two:n===Math.floor(n)&&n>=3&&n<=6?j.Few:n===Math.floor(n)&&n>=7&&n<=10?j.Many:j.Other;case"gd":return 1===n||11===n?j.One:2===n||12===n?j.Two:n===Math.floor(n)&&(n>=3&&n<=10||n>=13&&n<=19)?j.Few:j.Other;case"gv":return 0===o&&i%10===1?j.One:0===o&&i%10===2?j.Two:0!==o||i%100!==0&&i%100!==20&&i%100!==40&&i%100!==60&&i%100!==80?0!==o?j.Many:j.Other:j.Few;case"he":return 1===i&&0===o?j.One:2===i&&0===o?j.Two:0!==o||n>=0&&n<=10||n%10!==0?j.Other:j.Many;case"is":return 0===a&&i%10===1&&i%100!==11||0!==a?j.One:j.Other;case"ksh":return 0===n?j.Zero:1===n?j.One:j.Other;case"kw":case"naq":case"se":case"smn":return 1===n?j.One:2===n?j.Two:j.Other;case"lag":return 0===n?j.Zero:0!==i&&1!==i||0===n?j.Other:j.One;case"lt":return n%10!==1||n%100>=11&&n%100<=19?n%10===Math.floor(n%10)&&n%10>=2&&n%10<=9&&!(n%100>=11&&n%100<=19)?j.Few:0!==s?j.Many:j.Other:j.One;case"lv":case"prg":return n%10===0||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19||2===o&&s%100===Math.floor(s%100)&&s%100>=11&&s%100<=19?j.Zero:n%10===1&&n%100!==11||2===o&&s%10===1&&s%100!==11||2!==o&&s%10===1?j.One:j.Other;case"mk":return 0===o&&i%10===1||s%10===1?j.One:j.Other;case"mt":return 1===n?j.One:0===n||n%100===Math.floor(n%100)&&n%100>=2&&n%100<=10?j.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19?j.Many:j.Other;case"pl":return 1===i&&0===o?j.One:0===o&&i%10===Math.floor(i%10)&&i%10>=2&&i%10<=4&&!(i%100>=12&&i%100<=14)?j.Few:0===o&&1!==i&&i%10===Math.floor(i%10)&&i%10>=0&&i%10<=1||0===o&&i%10===Math.floor(i%10)&&i%10>=5&&i%10<=9||0===o&&i%100===Math.floor(i%100)&&i%100>=12&&i%100<=14?j.Many:j.Other;case"pt":return n===Math.floor(n)&&n>=0&&n<=2&&2!==n?j.One:j.Other;case"ro":return 1===i&&0===o?j.One:0!==o||0===n||1!==n&&n%100===Math.floor(n%100)&&n%100>=1&&n%100<=19?j.Few:j.Other;case"ru":case"uk":return 0===o&&i%10===1&&i%100!==11?j.One:0===o&&i%10===Math.floor(i%10)&&i%10>=2&&i%10<=4&&!(i%100>=12&&i%100<=14)?j.Few:0===o&&i%10===0||0===o&&i%10===Math.floor(i%10)&&i%10>=5&&i%10<=9||0===o&&i%100===Math.floor(i%100)&&i%100>=11&&i%100<=14?j.Many:j.Other;case"shi":return 0===i||1===n?j.One:n===Math.floor(n)&&n>=2&&n<=10?j.Few:j.Other;case"si":return 0===n||1===n||0===i&&1===s?j.One:j.Other;case"sl":return 0===o&&i%100===1?j.One:0===o&&i%100===2?j.Two:0===o&&i%100===Math.floor(i%100)&&i%100>=3&&i%100<=4||0!==o?j.Few:j.Other;case"tzm":return n===Math.floor(n)&&n>=0&&n<=1||n===Math.floor(n)&&n>=11&&n<=99?j.One:j.Other;default:return j.Other}}function m(t,e){if(i(t))for(var n=0;n0&&!t.startsWith("/")&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)},t.prototype.go=function(t,e){void 0===e&&(e=""),this._platformStrategy.pushState(null,"",t,e)},t.prototype.replaceState=function(t,e){void 0===e&&(e=""),this._platformStrategy.replaceState(null,"",t,e)},t.prototype.forward=function(){this._platformStrategy.forward()},t.prototype.back=function(){this._platformStrategy.back()},t.prototype.subscribe=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),this._subject.subscribe({next:t,error:e,complete:n})},t.normalizeQueryParams=function(t){return t.length>0&&"?"!=t.substring(0,1)?"?"+t:t},t.joinWithSlash=function(t,e){if(0==t.length)return e;if(0==e.length)return t;var n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e},t.stripTrailingSlash=function(t){return/\/$/g.test(t)&&(t=t.substring(0,t.length-1)),t},t.decorators=[{type:e.Injectable}],t.ctorParameters=[{type:I}],t}(),Q=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},U=function(t){function n(e,n){t.call(this),this._platformLocation=e,this._baseHref="",i(n)&&(this._baseHref=n)}return Q(n,t),n.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},n.prototype.getBaseHref=function(){return this._baseHref},n.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.hash;return i(e)||(e="#"),e.length>0?e.substring(1):e},n.prototype.prepareExternalUrl=function(t){var e=V.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e},n.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+V.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(t,e,i)},n.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+V.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,i)},n.prototype.forward=function(){this._platformLocation.forward()},n.prototype.back=function(){this._platformLocation.back()},n.decorators=[{type:e.Injectable}],n.ctorParameters=[{type:R},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[q]}]}],n}(I),B=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},H=function(t){function n(e,n){if(t.call(this),this._platformLocation=e,o(n)&&(n=this._platformLocation.getBaseHrefFromDOM()),o(n))throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=n}return B(n,t),n.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},n.prototype.getBaseHref=function(){return this._baseHref},n.prototype.prepareExternalUrl=function(t){return V.joinWithSlash(this._baseHref,t)},n.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.pathname+V.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?""+e+n:e},n.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+V.normalizeQueryParams(r));this._platformLocation.pushState(t,e,i)},n.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+V.normalizeQueryParams(r));this._platformLocation.replaceState(t,e,i)},n.prototype.forward=function(){this._platformLocation.forward()},n.prototype.back=function(){this._platformLocation.back()},n.decorators=[{type:e.Injectable}],n.ctorParameters=[{type:R},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[q]}]}],n}(I),z=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},G=function(){function t(){}return t}(),W=function(t){function n(e){t.call(this),this._locale=e}return z(n,t),n.prototype.getPluralCategory=function(t){var e=y(this._locale,t);switch(e){case j.Zero:return"zero";case j.One:return"one";case j.Two:return"two";case j.Few:return"few";case j.Many:return"many";default:return"other"}},n.decorators=[{type:e.Injectable}],n.ctorParameters=[{type:void 0,decorators:[{type:e.Inject,args:[e.LOCALE_ID]}]}],n}(G);!function(t){t[t.Zero=0]="Zero",t[t.One=1]="One",t[t.Two=2]="Two",t[t.Few=3]="Few",t[t.Many=4]="Many",t[t.Other=5]="Other"}(j||(j={}));var J,$=(function(){return(new Map).keys().next?function(t){for(var e,n=t.keys();!(e=n.next()).done;)t.set(e.value,null)}:function(t){t.forEach(function(e,n){t.set(n,null)})}}(),function(){try{if((new Map).values().next)return function(t,e){return e?Array.from(t.values()):Array.from(t.keys())}}catch(t){}return function(t,e){var n=new Array(t.size),r=0;return t.forEach(function(t,i){n[r]=e?t:i,r++}),n}}(),function(){function t(){}return t.createFixedSize=function(t){return new Array(t)},t.createGrowableSize=function(t){return new Array(t)},t.clone=function(t){return t.slice(0)},t.forEachWithIndex=function(t,e){for(var n=0;n-1&&(t.splice(n,1),!0)},t.clear=function(t){t.length=0},t.isEmpty=function(t){return 0==t.length},t.fill=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=null),t.fill(e,n,null===r?t.length:r)},t.equals=function(t,e){if(t.length!=e.length)return!1;for(var n=0;nr&&(n=s,r=a)}}return n},t.flatten=function(t){var e=[];return m(t,e),e},t.addAll=function(t,e){for(var n=0;n=Ts&&t<=Is||t==xa}function G(t){return ea<=t&&t<=na}function W(t){return t>=fa&&t<=Ea||t>=ra&&t<=aa}function J(t){return t>=fa&&t<=ya||t>=ra&&t<=oa||G(t)}function $(t,n){if(e.isDevMode()&&!i(n)){if(!u(n))throw new Error("Expected '"+t+"' to be an array of strings.");for(var r=0;r;" or "&#x;" syntax'}function mt(t){return!z(t)||t===Ps}function vt(t){return z(t)||t===Ys||t===Js||t===Vs||t===Ms||t===Zs}function gt(t){return(tna)}function _t(t){return t==Ks||t==Ps||!J(t)}function bt(t){return t==Ks||t==Ps||!W(t)}function wt(t,e,n){var r=!!n&&t.indexOf(n.start,e)==e;return t.charCodeAt(e)==Oa&&!r}function Et(t){return t===Zs||W(t)}function Ot(t,e){return Ct(t)==Ct(e)}function Ct(t){return t>=fa&&t<=Ea?t-fa+ra:t}function St(t){for(var e,n=[],r=0;r0&&t[t.length-1]===e}function Pt(t){return Nt(Tt(t.nodes).join("")+("["+t.meaning+"]"))}function Tt(t){return t.map(function(t){return t.visit(fu,null)})}function Nt(t){var e=kt(t),n=Rt(e),r=8*e.length,i=new Array(80),o=[1732584193,4023233417,2562383102,271733878,3285377520],s=o[0],a=o[1],u=o[2],c=o[3],l=o[4];n[r>>5]|=128<<24-r%32,n[(r+64>>9<<4)+15]=r;for(var p=0;p>>4&15).toString(16)+(15&S).toString(16)}return C.toLowerCase();var x,P}function kt(t){for(var e="",n=0;n>>6,128|63&r):r<=65535?e+=String.fromCharCode(224|r>>>12,128|r>>>6&63,128|63&r):r<=2097151&&(e+=String.fromCharCode(240|r>>>18,128|r>>>12&63,128|r>>>6&63,128|63&r))}return e}function At(t,e){if(e<0||e>=t.length)throw new Error("index="+e+' is out of range in "'+t+'"');var n,r=t.charCodeAt(e);return r>=55296&&r<=57343&&t.length>e+1&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?1024*(r-55296)+n-56320+65536:r}function Rt(t){for(var e=Array(t.length>>>2),n=0;n>>2]|=(255&t.charCodeAt(n))<<8*(3-n&3);return e}function It(t){for(var e="",n=0;n<4*t.length;n++)e+=String.fromCharCode(t[n>>>2]>>>8*(3-n&3)&255);return e}function qt(t,e,n,r){return t<20?[e&n|~e&r,1518500249]:t<40?[e^n^r,1859775393]:t<60?[e&n|e&r|n&r,2400959708]:[e^n^r,3395469782]}function Mt(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n}function jt(t,e){return t<>>32-e}function Ft(t){var e=new Cu(Ou,t);return function(t,n,r){return e.toI18nMessage(t,n,r)}}function Dt(t){return t.split(Su)[1]}function Lt(t,e,n,r){var i=new Iu(n,r);return i.extract(t,e)}function Vt(t,e,n,r,i){var o=new Iu(r,i);return o.merge(t,e,n)}function Qt(t){return t instanceof Za&&t.value&&t.value.startsWith("i18n")}function Ut(t){return t instanceof Za&&t.value&&"/i18n"===t.value}function Bt(t){return t.attrs.find(function(t){return t.name===Tu})||null}function Ht(t){if(!t)return["",""];var e=t.indexOf("|");return e==-1?["",t]:[t.slice(0,e),t.slice(e+1)]}function zt(t){return ju}function Gt(t){var e=t.getMessageMap(),n={};return Object.keys(e).forEach(function(t){n[t]=e[t].placeholders}),n}function Wt(t){var e=t.getMessageMap(),n={};return Object.keys(e).forEach(function(t){n[t]=e[t].placeholderToMsgIds}),n}function Jt(t){return t.map(function(t){return t.visit(Qu)}).join("")}function $t(t){return Wu.reduce(function(t,e){return t.replace(e[0],e[1])},t)}function Kt(t){switch(t.toLowerCase()){case"br":return"lb";case"img":return"image";default:return"x-"+t}}function Xt(t){return new Vo({name:t.name,moduleUrl:t.moduleUrl,reference:el.resolveIdentifier(t.name,t.moduleUrl,t.runtime)})}function Zt(t){return new Ho({identifier:t})}function Yt(t){return Zt(Xt(t))}function te(t,e){var n=el.resolveEnum(t.reference,e);return new Vo({name:t.name+"."+e,moduleUrl:t.moduleUrl,reference:n})}function ee(t){var e=new kl;return new Tl(ht(e,t),e.isExpanded,e.errors)}function ne(t,e){var n=t.cases.map(function(t){Pl.indexOf(t.value)!=-1||t.value.match(/^=\d+$/)||e.push(new Nl(t.valueSourceSpan,'Plural cases should be "=" or one of '+Pl.join(", ")));var n=ee(t.expression);return e.push.apply(e,n.errors),new Xa("template",[new Ka("ngPluralCase",""+t.value,t.valueSourceSpan)],n.nodes,t.sourceSpan,t.sourceSpan,t.sourceSpan)}),r=new Ka("[ngPlural]",t.switchValue,t.switchValueSourceSpan);return new Xa("ng-container",[r],n,t.sourceSpan,t.sourceSpan,t.sourceSpan)}function re(t,e){var n=t.cases.map(function(t){var n=ee(t.expression);return e.push.apply(e,n.errors),new Xa("template",[new Ka("ngSwitchCase",""+t.value,t.valueSourceSpan)],n.nodes,t.sourceSpan,t.sourceSpan,t.sourceSpan)}),r=new Ka("[ngSwitch]",t.switchValue,t.switchValueSourceSpan);return new Xa("ng-container",[r],n,t.sourceSpan,t.sourceSpan,t.sourceSpan)}function ie(t,e){var n=e.useExisting,r=e.useValue,i=e.deps;return new Uo({token:t.token,useClass:t.useClass,useExisting:n,useFactory:t.useFactory,useValue:r,deps:i,multi:t.multi})}function oe(t,e){var n=e.eager,r=e.providers;return new ti(t.token,t.multiProvider,t.eager||n,r,t.providerType,t.lifecycleHooks,t.sourceSpan)}function se(t,e,r,i){return void 0===i&&(i=null),i||(i=[]),n(t)&&t.forEach(function(t){if(u(t))se(t,e,r,i);else{var o=void 0;t instanceof Uo?o=t:t instanceof zo?o=new Uo({token:new Ho({identifier:t}),useClass:t}):r.push(new Rl("Unknown provider type "+t,e)),n(o)&&i.push(o)}}),i}function ae(e,n,r){var i=new Map;e.forEach(function(e){var o=new Uo({token:new Ho({identifier:e.type}),useClass:e.type});ue([o],e.isComponent?t.ProviderAstType.Component:t.ProviderAstType.Directive,!0,n,r,i)});var o=e.filter(function(t){return t.isComponent}).concat(e.filter(function(t){return!t.isComponent}));return o.forEach(function(e){ue(se(e.providers,n,r),t.ProviderAstType.PublicService,!1,n,r,i),ue(se(e.viewProviders,n,r),t.ProviderAstType.PrivateService,!1,n,r,i)}),i}function ue(t,e,r,i,o,s){t.forEach(function(t){var a=s.get(t.token.reference);if(n(a)&&a.multiProvider!==t.multi&&o.push(new Rl("Mixing multi and non multi provider is not possible for token "+a.token.name,i)),a)t.multi||ai.clear(a.providers),a.providers.push(t);else{var u=t.token.identifier&&t.token.identifier instanceof zo?t.token.identifier.lifecycleHooks:[];a=new ti(t.token,t.multi,r||u.length>0,[t],e,u,i),s.set(t.token.reference,a)}})}function ce(t){var e=new Map;return n(t.viewQueries)&&t.viewQueries.forEach(function(t){return pe(e,t)}),t.type.diDeps.forEach(function(t){n(t.viewQuery)&&pe(e,t.viewQuery)}),e}function le(t){var e=new Map;return t.forEach(function(t){n(t.queries)&&t.queries.forEach(function(t){return pe(e,t)}),t.type.diDeps.forEach(function(t){n(t.query)&&pe(e,t.query)})}),e}function pe(t,e){e.selectors.forEach(function(n){var r=t.get(n.reference);r||(r=[],t.set(n.reference,r)),r.push(e)})}function he(t){if(i(t)||0===t.length||"/"==t[0])return!1;var e=t.match(Ll);return null===e||"package"==e[1]||"asset"==e[1]}function fe(t,e,r){var i=[],o=Vr.replaceAllMapped(r,Dl,function(r){var o=n(r[1])?r[1]:r[2];return he(o)?(i.push(t.resolve(e,o)),""):r[0]});return new Fl(o,i)}function de(t){var e=null,n=null,r=null,i=!1,o=null;t.attrs.forEach(function(t){var s=t.name.toLowerCase();s==Vl?e=t.value:s==Hl?n=t.value:s==Bl?r=t.value:t.name==Jl?i=!0:t.name==$l&&t.value.length>0&&(o=t.value)}),e=ye(e);var s=t.name.toLowerCase(),a=Ru.OTHER;return g(s)[1]==Ql?a=Ru.NG_CONTENT:s==Gl?a=Ru.STYLE:s==Wl?a=Ru.SCRIPT:s==Ul&&r==zl&&(a=Ru.STYLESHEET),new Xl(a,e,n,i,o)}function ye(t){return null===t||0===t.length?"*":t}function me(t){return t.trim().split(/\s+/g)}function ve(t,e){var n=new di,r=g(t)[1];n.setElement(r);for(var i=0;i0&&2==t.keyframes.length){var e=Ee(t.keyframes[0])[0],n=Ee(t.keyframes[1])[0];return 0===Object.keys(e).length&&0===Object.keys(n).length}return!1}function Ee(t){return t.styles.styles}function Oe(t,e){var n=[];t.styles.styles.forEach(function(t){s(t)?n.push(t):e.push(new gh("State based animations cannot contain references to other states"))});var r=new Bp(n),i=t.stateNameExpr.split(/\s*,\s*/);return i.map(function(t){return new Lp(t,r)})}function Ce(t,e,n){var r=new fh,i=[],o=t.stateChangeExpr.split(/\s*,\s*/);o.forEach(function(t){Se(t,n).forEach(function(t){i.push(t)})});var s=xe(t.steps),a=Te(s,e,n),u=Ie(a,0,r,e,n);0==n.length&&qe(u,r,n);var c=u instanceof zp?u:new Wp([u]);return new Qp(i,c)}function Se(t,e){var r=[],i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(!n(i)||i.length<4)return e.push(new gh("the provided "+t+" is not of a supported format")),r;var o=i[1],s=i[2],a=i[3];r.push(new Vp(o,a));var u=o==cl&&a==cl;return"<"!=s[0]||u||r.push(new Vp(a,o)),r}function xe(t){return u(t)?new Do(t):t}function Pe(t,e,n){var r=[];return t.styles.forEach(function(t){o(t)?ai.addAll(r,Ae(t,e,n)):r.push(t)}),r}function Te(t,e,n){var r=ke(t,e,n);return t instanceof Lo?new Lo(r):new Do(r)}function Ne(t,e){if(s(e)&&t.length>0){var n=t.length-1,r=t[n];if(s(r))return void(t[n]=si.merge(r,e))}t.push(e)}function ke(t,e,r){var i;if(!(t instanceof Fo))return[t];i=t.steps;var o,s=[];return i.forEach(function(t){if(t instanceof Mo)n(o)||(o=[]),Pe(t,e,r).forEach(function(t){Ne(o,t)});else{if(n(o)&&(s.push(new Mo(0,o)),o=null),t instanceof jo){var i=t.styles;i instanceof Mo?i.styles=Pe(i,e,r):i instanceof qo&&i.steps.forEach(function(t){t.styles=Pe(t,e,r)})}else if(t instanceof Fo){var a=ke(t,e,r);t=t instanceof Lo?new Lo(a):new Do(a)}s.push(t)}}),n(o)&&s.push(new Mo(0,o)),s}function Ae(t,e,r){var i=[];if(":"!=t[0])r.push(new gh('Animation states via styles must be prefixed with a ":"'));else{var o=t.substring(1),a=e[o];n(a)?a.styles.forEach(function(t){s(t)&&i.push(t)}):r.push(new gh('Unable to apply styles due to missing a state: "'+o+'"'))}return i}function Re(t,e,r,i,o){var s=t.steps.length,a=0;t.steps.forEach(function(t){return a+=n(t.offset)?1:0}),a>0&&a=0;d--)w();return l.map(function(t){return new Hp(t[0],new Bp([t[1]]))})}function Ie(t,e,r,i,o){var s,a=0,u=e;if(t instanceof Fo){var c,l=0,p=[],h=t instanceof Lo;if(t.steps.forEach(function(t){var s=h?u:e;if(t instanceof Mo)return t.styles.forEach(function(t){var e=t;Object.keys(e).forEach(function(t){r.insertAtTime(t,s,e[t])})}),void(c=t.styles);var f=Ie(t,s,r,i,o);if(n(c)){if(t instanceof Fo){var d=new Bp(c);p.push(new Up(d,[],0,0,""))}else{var y=f;ai.addAll(y.startingStyles.styles,c)}c=null}var m=f.playTime;e+=m,a+=m,l=ph.max(m,l),p.push(f)}),n(c)){var f=new Bp(c);p.push(new Up(f,[],0,0,""))}h?(s=new Gp(p),a=l,e=u+a):s=new Wp(p)}else if(t instanceof jo){var d,y=Me(t.timings,o),m=t.styles;if(m instanceof qo)d=Re(m,e,r,i,o);else{var v=m,g=mh,_=new Bp(v.styles),b=new Hp(g,_);d=[b]}s=new Up(new Bp([]),d,y.duration,y.delay,y.easing),a=y.duration+y.delay,e+=a,d.forEach(function(t){return t.styles.styles.forEach(function(t){return Object.keys(t).forEach(function(n){r.insertAtTime(n,e,t[n])})})})}else s=new Up(null,[],0,0,"");return s.playTime=a,s.startTime=u,s}function qe(t,e,n){if(t instanceof Up&&t.keyframes.length>0){var r=t.keyframes;if(1==r.length){var i=r[0],o=je(i,t.startTime,t.playTime,e,n);t.keyframes=[o,i]}}else t instanceof zp&&t.steps.forEach(function(t){return qe(t,e,n)})}function Me(t,e){var r,s=/^([\.\d]+)(m?s)(?:\s+([\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?/i,a=0,u=null;if(o(t)){var c=t.match(s);if(null===c)return e.push(new gh('The provided timing value "'+t+'" is invalid.')),new wh(0,0,null);var l=parseFloat(c[1]),p=c[2];"s"==p&&(l*=vh),r=ph.floor(l);var h=c[3],f=c[4];if(n(h)){var d=parseFloat(h);n(f)&&"s"==f&&(d*=vh),a=ph.floor(d)}var y=c[5];i(y)||(u=y)}else r=t;return new wh(r,a,u)}function je(t,e,r,i,o){var s={},a=e+r;return t.styles.styles.forEach(function(t){Object.keys(t).forEach(function(r){var u=t[r];if("offset"!=r){var c,l,p,h=i.indexOfAtOrBeforeTime(r,e);n(h)?(c=i.getByIndex(r,h),p=c.value,l=i.getByIndex(r,h+1)):p=hl,n(l)&&!l.matches(a,u)&&o.push(new gh('The animated CSS property "'+r+'" unexpectedly changes between steps "'+c.time+'ms" and "'+a+'ms" at "'+l.time+'ms"')),s[r]=p}})}),new Hp(yh,new Bp([s]))}function Fe(t,e){return void 0===e&&(e=null),F(t,new Eh,e)}function De(t,e,r){if(e===r)return t;for(var i=to,o=e;o!==r&&n(o.declarationElement.view);)o=o.declarationElement.view,i=i.prop("parent");if(o!==r)throw new Error("Internal error: Could not calculate a property in a parent view: "+t);if(t instanceof Ki){var s=t;(r.fields.some(function(t){return t.name==s.name})||r.getters.some(function(t){return t.name==s.name}))&&(i=i.cast(r.classType))}return E(to.name,i,t)}function Le(t,e){var n=[L(t)];return e&&n.push(no),to.prop("parentInjector").callMethod("get",n)}function Ve(t,e){return"viewFactory_"+t.type.name+e}function Qe(t){for(var e=[],n=P([]),r=0;r0&&(n=n.callMethod(Ii.ConcatArray,[P(e)]),e=[]),n=n.callMethod(Ii.ConcatArray,[i])):e.push(i)}return e.length>0&&(n=n.callMethod(Ii.ConcatArray,[P(e)])),n}function Ue(t,e,n,r){r.fields.push(new lo(n.name,null));var i=e0?A(t).lowerEquals(qh.requestNodeIndex).and(qh.requestNodeIndex.lowerEquals(A(t+e))):A(t).identical(qh.requestNodeIndex),new yo(qh.token.identical(L(n.token)).and(i),[new uo(r)])}function $e(t,e,n,r,i,o){var s,a,u=o.view;if(r?(s=P(n),a=new Ci(xi)):(s=n[0],a=n[0].type),a||(a=xi),i)u.fields.push(new lo(t,a)),u.createMethod.addStmt(to.prop(t).set(s).toStmt());else{var c="_"+t;u.fields.push(new lo(c,a));var l=new Sh(u);l.resetDebugInfo(o.nodeIndex,o.sourceAst),l.addStmt(new yo(to.prop(c).isBlank(),[to.prop(c).set(s).toStmt()])),l.addStmt(new uo(to.prop(c))),u.getters.push(new ho(t,l.finish(),a))}return to.prop(t)}function Ke(t,e){for(var n=null,r=t.pipeMetas.length-1;r>=0;r--){var i=t.pipeMetas[r];if(i.name==e){n=i;break}}if(!n)throw new Error("Illegal state: Could not find pipe "+e+" although the parser should have detected this error!");return n}function Xe(t,e){return e>0?Nc.EMBEDDED:t.type.isHost?Nc.HOST:Nc.COMPONENT}function Ze(t,e,n,r,i){var o=new zh(t,e,r,i),s=n.visit(o,Kl.Expression);return new Bh(s,o.needsValueUnwrapper,o.temporaryCount)}function Ye(t,e,n,r){var i=new zh(t,e,null,r),o=[];return an(n.visit(i,Kl.Statement),o),nn(i.temporaryCount,r,o),o}function tn(t,e){return"tmp_"+t+"_"+e}function en(t,e){return new oo(tn(t,e),no)}function nn(t,e,n){for(var r=t-1;r>=0;r--)n.unshift(en(e,r))}function rn(t,e){if(t!==Kl.Statement)throw new Error("Expected a statement, but saw "+e)}function on(t,e){if(t!==Kl.Expression)throw new Error("Expected an expression, but saw "+e)}function sn(t,e){return t===Kl.Statement?e.toStmt():e}function an(t,e){u(t)?t.forEach(function(t){return an(t,e)}):e.push(t)}function un(t,e,n){var r=[];return t.forEach(function(t){n.view.bindings.push(new Uh(n,t));var e=Gh.getOrCreate(n,t.target,t.name,t.phase,r);e.addAction(t,null,null)}),e.forEach(function(t){var e=n.instances.get(Zt(t.directive.type).reference);t.hostEvents.forEach(function(i){n.view.bindings.push(new Uh(n,i));var o=Gh.getOrCreate(n,i.target,i.name,i.phase,r);o.addAction(i,t.directive,e)})}),r.forEach(function(t){return t.finishMethod()}),r}function cn(t,e,n){Object.keys(t.directive.outputs).forEach(function(r){var i=t.directive.outputs[r];n.filter(function(t){return t.eventName==i}).forEach(function(t){t.listenToDirective(e,r)})})}function ln(t){t.forEach(function(t){t.eventPhase?t.listenToAnimation():t.listenToRenderer()})}function pn(t){return t instanceof ao?t.expr:t instanceof uo?t.value:null}function hn(t){return Vr.replaceAll(t,/[^a-zA-Z_]/g,"_")}function fn(t,e,n){var r=n.view,i=r.detectChangesInInputsMethod,o=t.directive.type.lifecycleHooks;o.indexOf(bc.OnChanges)!==-1&&t.inputs.length>0&&i.addStmt(new yo(Mh.changes.notIdentical(no),[e.callMethod("ngOnChanges",[Mh.changes]).toStmt()])),o.indexOf(bc.OnInit)!==-1&&i.addStmt(new yo(Wh.and(Jh),[e.callMethod("ngOnInit",[]).toStmt()])),o.indexOf(bc.DoCheck)!==-1&&i.addStmt(new yo(Jh,[e.callMethod("ngDoCheck",[]).toStmt()]))}function dn(t,e,n){var r=n.view,i=t.type.lifecycleHooks,o=r.afterContentLifecycleCallbacksMethod;o.resetDebugInfo(n.nodeIndex,n.sourceAst),i.indexOf(bc.AfterContentInit)!==-1&&o.addStmt(new yo(Wh,[e.callMethod("ngAfterContentInit",[]).toStmt()])),i.indexOf(bc.AfterContentChecked)!==-1&&o.addStmt(e.callMethod("ngAfterContentChecked",[]).toStmt())}function yn(t,e,n){var r=n.view,i=t.type.lifecycleHooks,o=r.afterViewLifecycleCallbacksMethod;o.resetDebugInfo(n.nodeIndex,n.sourceAst),i.indexOf(bc.AfterViewInit)!==-1&&o.addStmt(new yo(Wh,[e.callMethod("ngAfterViewInit",[]).toStmt()])),i.indexOf(bc.AfterViewChecked)!==-1&&o.addStmt(e.callMethod("ngAfterViewChecked",[]).toStmt())}function mn(t,e,n){var r=n.view.destroyMethod;r.resetDebugInfo(n.nodeIndex,n.sourceAst),t.lifecycleHooks.indexOf(bc.OnDestroy)!==-1&&r.addStmt(e.callMethod("ngOnDestroy",[]).toStmt())}function vn(t,e,n){var r=n.destroyMethod;t.type.lifecycleHooks.indexOf(bc.OnDestroy)!==-1&&r.addStmt(e.callMethod("ngOnDestroy",[]).toStmt())}function gn(t){return to.prop("_expr_"+t)}function _n(t){return C("currVal_"+t)}function bn(t,e,n,r,i,o,s,a){var u=Ze(t,i,r,Mh.valUnwrapper,a);if(u.expression){if(u.temporaryCount)for(var c=0;c0}));return u}function Qn(t,e,n){var r,i=[new Wi(Ah.viewUtils.name,x(Xt(Ol.ViewUtils))),new Wi(Ah.parentInjector.name,x(Xt(Ol.Injector))),new Wi(Ah.declarationEl.name,x(Xt(Ol.AppElement)))],o=[];if(r=t.component.template.templateUrl==t.component.type.moduleUrl?t.component.type.moduleUrl+" class "+t.component.type.name+" - inline template":t.component.template.templateUrl,0===t.viewIndex){var s=T(t.animations.map(function(t){return[t.name,t.fnExp]}));o=[new yo(n.identical(no),[n.set(Ah.viewUtils.callMethod("createRenderComponentType",[A(t.genConfig.genDebugInfo?r:""),A(t.component.template.ngContentSelectors.length),Nh.fromValue(t.component.template.encapsulation),t.styles,s])).toStmt()])]}return k(i,o.concat([new uo(C(e.name).instantiate(e.constructorMethod.params.map(function(t){return C(t.name)})))]),x(Xt(Ol.AppView),[zn(t)])).toDeclStmt(t.viewFactory.name,[Di.Final])}function Un(t){var e=no,n=[];t.viewType===Nc.COMPONENT&&(e=Rh.renderer.callMethod("createViewRoot",[to.prop("declarationAppElement").prop("nativeElement")]),n=[tf.set(e).toDeclStmt(x(t.genConfig.renderTypes.renderNode),[Di.Final])]);var r;return r=t.viewType===Nc.HOST?t.nodes[0].appElement:no,n.concat(t.createMethod.finish(),[to.callMethod("init",[Qe(t.rootNodesOrAppElements),P(t.nodes.map(function(t){return t.renderNode})),P(t.disposables),P(t.subscriptions)]).toStmt(),new uo(r)])}function Bn(t){var e=[];if(t.animationBindingsMethod.isEmpty()&&t.detectChangesInInputsMethod.isEmpty()&&t.updateContentQueriesMethod.isEmpty()&&t.afterContentLifecycleCallbacksMethod.isEmpty()&&t.detectChangesRenderPropertiesMethod.isEmpty()&&t.updateViewQueriesMethod.isEmpty()&&t.afterViewLifecycleCallbacksMethod.isEmpty())return e;ai.addAll(e,t.animationBindingsMethod.finish()),ai.addAll(e,t.detectChangesInInputsMethod.finish()),e.push(to.callMethod("detectContentChildrenChanges",[Mh.throwOnChange]).toStmt());var n=t.updateContentQueriesMethod.finish().concat(t.afterContentLifecycleCallbacksMethod.finish());n.length>0&&e.push(new yo(N(Mh.throwOnChange),n)),ai.addAll(e,t.detectChangesRenderPropertiesMethod.finish()),e.push(to.callMethod("detectViewChildrenChanges",[Mh.throwOnChange]).toStmt());var r=t.updateViewQueriesMethod.finish().concat(t.afterViewLifecycleCallbacksMethod.finish());r.length>0&&e.push(new yo(N(Mh.throwOnChange),r));var i=[],o=O(e);return o.has(Mh.changed.name)&&i.push(Mh.changed.set(A(!0)).toDeclStmt(Pi)),o.has(Mh.changes.name)&&i.push(Mh.changes.set(no).toDeclStmt(new Si(x(Xt(Ol.SimpleChange))))),o.has(Mh.valUnwrapper.name)&&i.push(Mh.valUnwrapper.set(S(Xt(Ol.ValueUnwrapper)).instantiate([])).toDeclStmt(null,[Di.Final])),i.concat(e)}function Hn(t,e){return t.length>0?t.concat([new uo(e)]):t}function zn(t){return t.viewType===Nc.COMPONENT?x(t.component.type):xi}function Gn(t){var e;return e=t.viewType===Nc.COMPONENT?gc(t.component.changeDetection)?_c.CheckAlways:_c.CheckOnce:_c.CheckAlways}function Wn(t){return t.dependencies.forEach(function(t){if(t instanceof nf){var e=t;e.placeholder.moduleUrl=$n(e.comp.moduleUrl)}else if(t instanceof rf){var n=t;n.placeholder.name=Kn(n.comp),n.placeholder.moduleUrl=$n(n.comp.moduleUrl)}}),t.statements}function Jn(t,e){return t.dependencies.forEach(function(t){t.valuePlaceholder.moduleUrl=Xn(t.moduleUrl,t.isShimmed,e)}),t.statements}function $n(t){var e=Yn(t);return e[0]+".ngfactory"+e[1]}function Kn(t){return t.name+"NgFactory"}function Xn(t,e,n){return e?t+".shim"+n:""+t+n}function Zn(t){if(!t.isComponent)throw new Error("Could not compile '"+t.type.name+"' because it is not a component.")}function Yn(t){if(t.endsWith(".d.ts"))return[t.slice(0,-5),".ts"];var e=t.lastIndexOf(".");return e!==-1?[t.substring(0,e),t.substring(e)]:[t,""]}function tr(){return new df(hf)}function er(t){var e=rr(t);return e&&e[Hh.Scheme]||""}function nr(t,e,r,i,o,s,a){var u=[];return n(t)&&u.push(t+":"),n(r)&&(u.push("//"),n(e)&&u.push(e+"@"),u.push(r),n(i)&&u.push(":"+i)),n(o)&&u.push(o),n(s)&&u.push("?"+s),n(a)&&u.push("#"+a),u.join("")}function rr(t){return t.match(yf)}function ir(t){if("/"==t)return"/";for(var e="/"==t[0]?"/":"",n="/"===t[t.length-1]?"/":"",r=t.split("/"),i=[],o=0,s=0;s0?i.pop():o++;break;default:i.push(a)}}if(""==e){for(;o-- >0;)i.unshift("..");0===i.length&&i.push(".")}return e+i.join("/")+n}function or(t){var e=t[Hh.Path];return e=i(e)?"":ir(e),t[Hh.Path]=e,nr(t[Hh.Scheme],t[Hh.UserInfo],t[Hh.Domain],t[Hh.Port],e,t[Hh.QueryData],t[Hh.Fragment])}function sr(t,e){var r=rr(encodeURI(e)),o=rr(t);if(n(r[Hh.Scheme]))return or(r);r[Hh.Scheme]=o[Hh.Scheme];for(var s=Hh.Scheme;s<=Hh.Port;s++)i(r[s])&&(r[s]=o[s]);if("/"==r[Hh.Path][0])return or(r);var a=o[Hh.Path];i(a)&&(a="/");var u=a.lastIndexOf("/");return a=a.substring(0,u+1)+r[Hh.Path],r[Hh.Path]=a,or(r)}function ar(t,e){return new $o({type:t.type,isComponent:t.isComponent,selector:t.selector,exportAs:t.exportAs,changeDetection:t.changeDetection,inputs:t.inputs,outputs:t.outputs,hostListeners:t.hostListeners,hostProperties:t.hostProperties,hostAttributes:t.hostAttributes,providers:t.providers,viewProviders:t.viewProviders,queries:t.queries,viewQueries:t.viewQueries,entryComponents:t.entryComponents,template:e})}function ur(t){return t instanceof e.Directive}function cr(t,e){var n=_f.get(t),r=bf.get(t);return el.hasLifecycleHook(e,n,r)}function lr(t){return t instanceof e.NgModule}function pr(t){return t instanceof e.Pipe}function hr(t,e,n,r){return void 0===n&&(n=[]),void 0===r&&(r=new Set),t.forEach(function(t){if(!r.has(t.type.reference)){r.add(t.type.reference);var i=e?t.importedModules.concat(t.exportedModules):t.exportedModules;hr(i,e,n,r),n.push(t)}}),n}function fr(t,n){if(void 0===n&&(n=[]),t)for(var r=0;r0?o.push(a):(o.length>0&&(r.push(o.join("")),n.push(wd),o=[]),n.push(a)),a==_d&&i++}return o.length>0&&(r.push(o.join("")),n.push(wd)),new Od(n.join(""),r)}function kr(t){var e="styles";return t&&(e+="_"+t.type.name),e}function Ar(t){if(!t.isComponent)throw new Error("Could not compile '"+t.type.name+"' because it is not a component.")}function Rr(t,e){for(var n=0,r=e;n=0;e--)if(void 0!==t[e])return t[e]}function jr(t){var e=[];return t.forEach(function(t){return t&&e.push.apply(e,t)}),e}var Fr;Fr="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:r:window;var Dr=Fr;Dr.assert=function(t){};var Lr=Object.getPrototypeOf({}),Vr=function(){function t(){}return t.fromCharCode=function(t){return String.fromCharCode(t)},t.charCodeAt=function(t,e){return t.charCodeAt(e)},t.split=function(t,e){return t.split(e)},t.equals=function(t,e){return t===e},t.stripLeft=function(t,e){if(t&&t.length){for(var n=0,r=0;r=0&&t[r]==e;r--)n--;t=t.substring(0,n)}return t},t.replace=function(t,e,n){return t.replace(e,n)},t.replaceAll=function(t,e,n){return t.replace(e,n)},t.slice=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=null),t.slice(e,null===n?void 0:n)},t.replaceAllMapped=function(t,e,n){return t.replace(e,function(){for(var t=[],e=0;ee?1:0},t}(),Qr=function(){function t(t){void 0===t&&(t=[]),this.parts=t}return t.prototype.add=function(t){this.parts.push(t)},t.prototype.toString=function(){return this.parts.join("")},t}(),Ur=function(){function t(){}return t.toFixed=function(t,e){return t.toFixed(e)},t.equal=function(t,e){return t===e},t.parseIntAutoRadix=function(t){var e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e},t.parseInt=function(t,e){if(10==e){if(/^(\-|\+)?[0-9]+$/.test(t))return parseInt(t,e)}else if(16==e){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(t))return parseInt(t,e)}else{var n=parseInt(t,e);if(!isNaN(n))return n}throw new Error("Invalid integer literal when parsing "+t+" in base "+e)},Object.defineProperty(t,"NaN",{get:function(){return NaN},enumerable:!0,configurable:!0}),t.isNumeric=function(t){return!isNaN(t-parseFloat(t))},t.isNaN=function(t){return isNaN(t)},t.isInteger=function(t){return Number.isInteger(t)},t}(),Br=function(){function t(t,e,n){this.value=t,this.ngContentIndex=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitText(this,e)},t}(),Hr=function(){function t(t,e,n){this.value=t,this.ngContentIndex=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitBoundText(this,e)},t}(),zr=function(){function t(t,e,n){this.name=t,this.value=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitAttr(this,e)},t}(),Gr=function(){function e(t,e,n,r,i,o){this.name=t,this.type=e,this.securityContext=n,this.value=r,this.unit=i,this.sourceSpan=o}return e.prototype.visit=function(t,e){return t.visitElementProperty(this,e)},Object.defineProperty(e.prototype,"isAnimation",{get:function(){return this.type===t.PropertyBindingType.Animation},enumerable:!0,configurable:!0}),e}(),Wr=function(){function t(t,e,n,r,i){this.name=t,this.target=e,this.phase=n,this.handler=r,this.sourceSpan=i}return t.prototype.visit=function(t,e){return t.visitEvent(this,e)},Object.defineProperty(t.prototype,"fullName",{get:function(){return n(this.target)?this.target+":"+this.name:this.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAnimation",{get:function(){return!!this.phase},enumerable:!0,configurable:!0}),t}(),Jr=function(){function t(t,e,n){this.name=t,this.value=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitReference(this,e)},t}(),$r=function(){function t(t,e,n){this.name=t,this.value=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitVariable(this,e)},t}(),Kr=function(){function t(t,e,n,r,i,o,s,a,u,c,l){this.name=t,this.attrs=e,this.inputs=n,this.outputs=r,this.references=i,this.directives=o,this.providers=s,this.hasViewContainer=a,this.children=u,this.ngContentIndex=c,this.sourceSpan=l}return t.prototype.visit=function(t,e){return t.visitElement(this,e)},t}(),Xr=function(){function t(t,e,n,r,i,o,s,a,u,c){this.attrs=t,this.outputs=e,this.references=n,this.variables=r,this.directives=i,this.providers=o,this.hasViewContainer=s,this.children=a,this.ngContentIndex=u,this.sourceSpan=c}return t.prototype.visit=function(t,e){return t.visitEmbeddedTemplate(this,e)},t}(),Zr=function(){function t(t,e,n,r){this.directiveName=t,this.templateName=e,this.value=n,this.sourceSpan=r}return t.prototype.visit=function(t,e){return t.visitDirectiveProperty(this,e)},t}(),Yr=function(){function t(t,e,n,r,i){this.directive=t,this.inputs=e,this.hostProperties=n,this.hostEvents=r,this.sourceSpan=i}return t.prototype.visit=function(t,e){return t.visitDirective(this,e)},t}(),ti=function(){function t(t,e,n,r,i,o,s){this.token=t,this.multiProvider=e,this.eager=n,this.providers=r,this.providerType=i,this.lifecycleHooks=o,this.sourceSpan=s}return t.prototype.visit=function(t,e){return null},t}();t.ProviderAstType,function(t){t[t.PublicService=0]="PublicService",t[t.PrivateService=1]="PrivateService",t[t.Component=2]="Component",t[t.Directive=3]="Directive",t[t.Builtin=4]="Builtin"}(t.ProviderAstType||(t.ProviderAstType={}));var ei=function(){function t(t,e,n){this.index=t,this.ngContentIndex=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitNgContent(this,e)},t}();t.PropertyBindingType,function(t){t[t.Property=0]="Property",t[t.Attribute=1]="Attribute",t[t.Class=2]="Class",t[t.Style=3]="Style",t[t.Animation=4]="Animation"}(t.PropertyBindingType||(t.PropertyBindingType={}));var ni,ri=function(){try{if(1===new Map([[1,2]]).size)return function(t){return new Map(t)}}catch(t){}return function(t){for(var e=new Map,n=0;n-1&&(t.splice(n,1),!0)},t.clear=function(t){t.length=0},t.isEmpty=function(t){return 0==t.length},t.fill=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=null),t.fill(e,n,null===r?t.length:r)},t.equals=function(t,e){if(t.length!=e.length)return!1;for(var n=0;nr&&(n=s,r=a)}}return n},t.flatten=function(t){var e=[];return v(t,e),e},t.addAll=function(t,e){for(var n=0;n",harr:"↔",hArr:"⇔",hearts:"♥",hellip:"…",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",image:"ℑ",infin:"∞","int":"∫",Iota:"Ι",iota:"ι",iquest:"¿",isin:"∈",Iuml:"Ï",iuml:"ï",Kappa:"Κ",kappa:"κ",Lambda:"Λ",lambda:"λ",lang:"⟨",laquo:"«",larr:"←",lArr:"⇐",lceil:"⌈",ldquo:"“",le:"≤",lfloor:"⌊",lowast:"∗",loz:"◊",lrm:"‎",lsaquo:"‹",lsquo:"‘",lt:"<",macr:"¯",mdash:"—",micro:"µ",middot:"·",minus:"−",Mu:"Μ",mu:"μ",nabla:"∇",nbsp:" ",ndash:"–",ne:"≠",ni:"∋",not:"¬",notin:"∉",nsub:"⊄",Ntilde:"Ñ",ntilde:"ñ",Nu:"Ν",nu:"ν",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",OElig:"Œ",oelig:"œ",Ograve:"Ò",ograve:"ò",oline:"‾",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",oplus:"⊕",or:"∨",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",otimes:"⊗",Ouml:"Ö",ouml:"ö",para:"¶",permil:"‰",perp:"⊥",Phi:"Φ",phi:"φ",Pi:"Π",pi:"π",piv:"ϖ",plusmn:"±",pound:"£",prime:"′",Prime:"″",prod:"∏",prop:"∝",Psi:"Ψ",psi:"ψ",quot:'"',radic:"√",rang:"⟩",raquo:"»",rarr:"→",rArr:"⇒",rceil:"⌉",rdquo:"”",real:"ℜ",reg:"®",rfloor:"⌋",Rho:"Ρ",rho:"ρ",rlm:"‏",rsaquo:"›",rsquo:"’",sbquo:"‚",Scaron:"Š",scaron:"š",sdot:"⋅",sect:"§",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sim:"∼",spades:"♠",sub:"⊂",sube:"⊆",sum:"∑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supe:"⊇",szlig:"ß",Tau:"Τ",tau:"τ",there4:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thinsp:" ",THORN:"Þ",thorn:"þ",tilde:"˜",times:"×",trade:"™",Uacute:"Ú",uacute:"ú",uarr:"↑",uArr:"⇑",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",Uuml:"Ü",uuml:"ü",weierp:"℘",Xi:"Ξ",xi:"ξ",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ",Yuml:"Ÿ",Zeta:"Ζ",zeta:"ζ",zwj:"‍",zwnj:"‌"},li=function(){function t(t){var e=this,n=void 0===t?{}:t,r=n.closedByChildren,i=n.requiredParents,o=n.implicitNamespacePrefix,s=n.contentType,a=void 0===s?ni.PARSABLE_DATA:s,u=n.closedByParent,c=void 0!==u&&u,l=n.isVoid,p=void 0!==l&&l,h=n.ignoreFirstLf,f=void 0!==h&&h;this.closedByChildren={},this.closedByParent=!1,this.canSelfClose=!1,r&&r.length>0&&r.forEach(function(t){return e.closedByChildren[t]=!0}),this.isVoid=p,this.closedByParent=c||p,i&&i.length>0&&(this.requiredParents={},this.parentToAdd=i[0],i.forEach(function(t){return e.requiredParents[t]=!0})),this.implicitNamespacePrefix=o,this.contentType=a,this.ignoreFirstLf=f}return t.prototype.requireExtraParent=function(t){if(!this.requiredParents)return!1;if(!t)return!0;var e=t.toLowerCase();return 1!=this.requiredParents[e]&&"template"!=e},t.prototype.isClosedByChild=function(t){return this.isVoid||t.toLowerCase()in this.closedByChildren},t}(),pi={base:new li({isVoid:!0}),meta:new li({isVoid:!0}),area:new li({isVoid:!0}),embed:new li({isVoid:!0}),link:new li({isVoid:!0}),img:new li({isVoid:!0}),input:new li({isVoid:!0}),param:new li({isVoid:!0}),hr:new li({isVoid:!0}),br:new li({isVoid:!0}),source:new li({isVoid:!0}),track:new li({isVoid:!0}),wbr:new li({isVoid:!0}),p:new li({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new li({closedByChildren:["tbody","tfoot"]}),tbody:new li({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new li({closedByChildren:["tbody"],closedByParent:!0}),tr:new li({closedByChildren:["tr"],requiredParents:["tbody","tfoot","thead"],closedByParent:!0}),td:new li({closedByChildren:["td","th"],closedByParent:!0}),th:new li({closedByChildren:["td","th"],closedByParent:!0}),col:new li({requiredParents:["colgroup"],isVoid:!0}),svg:new li({implicitNamespacePrefix:"svg"}),math:new li({implicitNamespacePrefix:"math"}),li:new li({closedByChildren:["li"],closedByParent:!0}),dt:new li({closedByChildren:["dt","dd"]}),dd:new li({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new li({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new li({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new li({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new li({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new li({closedByChildren:["optgroup"],closedByParent:!0}),option:new li({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new li({ignoreFirstLf:!0}),listing:new li({ignoreFirstLf:!0}),style:new li({contentType:ni.RAW_TEXT}),script:new li({contentType:ni.RAW_TEXT}),title:new li({contentType:ni.ESCAPABLE_RAW_TEXT}),textarea:new li({contentType:ni.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})},hi=new li,fi=new RegExp("(\\:not\\()|([-\\w]+)|(?:\\.([-\\w]+))|(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|(\\))|(\\s*,\\s*)","g"),di=function(){function t(){this.element=null,this.classNames=[],this.attrs=[],this.notSelectors=[]}return t.parse=function(e){var n,r=[],i=function(t,e){e.notSelectors.length>0&&!e.element&&0==e.classNames.length&&0==e.attrs.length&&(e.element="*"),t.push(e)},o=new t,s=o,a=!1;for(fi.lastIndex=0;n=fi.exec(e);){if(n[1]){if(a)throw new Error("Nesting :not is not allowed in a selector");a=!0,s=new t,o.notSelectors.push(s)}if(n[2]&&s.setElement(n[2]),n[3]&&s.addClassName(n[3]),n[4]&&s.addAttribute(n[4],n[5]),n[6]&&(a=!1,s=o),n[7]){if(a)throw new Error("Multiple selectors in :not are not supported");i(r,o),o=s=new t}}return i(r,o),r},t.prototype.isElementSelector=function(){return this.hasElementSelector()&&0==this.classNames.length&&0==this.attrs.length&&0===this.notSelectors.length},t.prototype.hasElementSelector=function(){return!!this.element},t.prototype.setElement=function(t){void 0===t&&(t=null),this.element=t},t.prototype.getMatchingElementTemplate=function(){for(var t=this.element||"div",e=this.classNames.length>0?' class="'+this.classNames.join(" ")+'"':"",n="",r=0;r":"<"+t+e+n+">"},t.prototype.addAttribute=function(t,e){void 0===e&&(e=""),this.attrs.push(t,e&&e.toLowerCase()||"")},t.prototype.addClassName=function(t){this.classNames.push(t.toLowerCase())},t.prototype.toString=function(){var t=this.element||"";if(this.classNames&&this.classNames.forEach(function(e){return t+="."+e}),this.attrs)for(var e=0;e1&&(n=new mi(t),this._listContexts.push(n));for(var r=0;r0&&(!this.listContext||!this.listContext.alreadyMatched)){var r=yi.createNotMatcher(this.notSelectors);n=!r.match(t,null)}return!n||!e||this.listContext&&this.listContext.alreadyMatched||(this.listContext&&(this.listContext.alreadyMatched=!0),e(this.selector,this.cbContext)),n},t}(),gi=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};!function(t){t[t.Const=0]="Const"}(ui||(ui={}));var _i,bi=function(){function t(t){void 0===t&&(t=null),this.modifiers=t,t||(this.modifiers=[])}return t.prototype.hasModifier=function(t){return this.modifiers.indexOf(t)!==-1},t}();!function(t){t[t.Dynamic=0]="Dynamic",t[t.Bool=1]="Bool",t[t.String=2]="String",t[t.Int=3]="Int",t[t.Number=4]="Number",t[t.Function=5]="Function"}(_i||(_i={}));var wi,Ei=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.name=e}return gi(e,t),e.prototype.visitType=function(t,e){return t.visitBuiltintType(this,e)},e}(bi),Oi=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,r),this.value=e,this.typeParams=n}return gi(e,t),e.prototype.visitType=function(t,e){return t.visitExternalType(this,e)},e}(bi),Ci=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.of=e}return gi(e,t),e.prototype.visitType=function(t,e){return t.visitArrayType(this,e)},e}(bi),Si=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.valueType=e}return gi(e,t),e.prototype.visitType=function(t,e){return t.visitMapType(this,e)},e}(bi),xi=new Ei(_i.Dynamic),Pi=new Ei(_i.Bool),Ti=(new Ei(_i.Int),new Ei(_i.Number)),Ni=new Ei(_i.String),ki=new Ei(_i.Function);!function(t){t[t.Equals=0]="Equals",t[t.NotEquals=1]="NotEquals",t[t.Identical=2]="Identical",t[t.NotIdentical=3]="NotIdentical",t[t.Minus=4]="Minus",t[t.Plus=5]="Plus",t[t.Divide=6]="Divide",t[t.Multiply=7]="Multiply",t[t.Modulo=8]="Modulo",t[t.And=9]="And",t[t.Or=10]="Or",t[t.Lower=11]="Lower",t[t.LowerEquals=12]="LowerEquals",t[t.Bigger=13]="Bigger",t[t.BiggerEquals=14]="BiggerEquals"}(wi||(wi={}));var Ai,Ri=function(){function t(t){this.type=t}return t.prototype.prop=function(t){return new Ki(this,t)},t.prototype.key=function(t,e){return void 0===e&&(e=null),new Xi(this,t,e)},t.prototype.callMethod=function(t,e){return new Li(this,t,e)},t.prototype.callFn=function(t){return new Vi(this,t)},t.prototype.instantiate=function(t,e){return void 0===e&&(e=null),new Qi(this,t,e)},t.prototype.conditional=function(t,e){return void 0===e&&(e=null),new Hi(this,t,e)},t.prototype.equals=function(t){return new $i(wi.Equals,this,t)},t.prototype.notEquals=function(t){return new $i(wi.NotEquals,this,t)},t.prototype.identical=function(t){return new $i(wi.Identical,this,t)},t.prototype.notIdentical=function(t){return new $i(wi.NotIdentical,this,t)},t.prototype.minus=function(t){return new $i(wi.Minus,this,t)},t.prototype.plus=function(t){return new $i(wi.Plus,this,t)},t.prototype.divide=function(t){return new $i(wi.Divide,this,t)},t.prototype.multiply=function(t){return new $i(wi.Multiply,this,t)},t.prototype.modulo=function(t){return new $i(wi.Modulo,this,t)},t.prototype.and=function(t){return new $i(wi.And,this,t)},t.prototype.or=function(t){return new $i(wi.Or,this,t)},t.prototype.lower=function(t){return new $i(wi.Lower,this,t)},t.prototype.lowerEquals=function(t){return new $i(wi.LowerEquals,this,t)},t.prototype.bigger=function(t){return new $i(wi.Bigger,this,t)},t.prototype.biggerEquals=function(t){return new $i(wi.BiggerEquals,this,t)},t.prototype.isBlank=function(){return this.equals(no)},t.prototype.cast=function(t){return new Gi(this,t)},t.prototype.toStmt=function(){return new ao(this)},t}();!function(t){t[t.This=0]="This",t[t.Super=1]="Super",t[t.CatchError=2]="CatchError",t[t.CatchStack=3]="CatchStack"}(Ai||(Ai={}));var Ii,qi=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),o(e)?(this.name=e,this.builtin=null):(this.name=null,this.builtin=e)}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitReadVarExpr(this,e)},e.prototype.set=function(t){return new Mi(this.name,t)},e}(Ri),Mi=function(t){function e(e,r,i){void 0===i&&(i=null),t.call(this,n(i)?i:r.type),this.name=e,this.value=r}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitWriteVarExpr(this,e)},e.prototype.toDeclStmt=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=null),new oo(this.name,this.value,t,e)},e}(Ri),ji=function(t){function e(e,r,i,o){void 0===o&&(o=null),t.call(this,n(o)?o:i.type),this.receiver=e,this.index=r,this.value=i}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitWriteKeyExpr(this,e)},e}(Ri),Fi=function(t){function e(e,r,i,o){void 0===o&&(o=null),t.call(this,n(o)?o:i.type),this.receiver=e,this.name=r,this.value=i}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitWritePropExpr(this,e)},e}(Ri);!function(t){t[t.ConcatArray=0]="ConcatArray",t[t.SubscribeObservable=1]="SubscribeObservable",t[t.Bind=2]="Bind"}(Ii||(Ii={}));var Di,Li=function(t){function e(e,n,r,i){void 0===i&&(i=null),t.call(this,i),this.receiver=e,this.args=r,o(n)?(this.name=n,this.builtin=null):(this.name=null,this.builtin=n)}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitInvokeMethodExpr(this,e)},e}(Ri),Vi=function(t){function e(e,n,r){void 0===r&&(r=null),t.call(this,r),this.fn=e,this.args=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitInvokeFunctionExpr(this,e)},e}(Ri),Qi=function(t){function e(e,n,r){t.call(this,r),this.classExpr=e,this.args=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitInstantiateExpr(this,e)},e}(Ri),Ui=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.value=e}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitLiteralExpr(this,e)},e}(Ri),Bi=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,n),this.value=e,this.typeParams=r}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitExternalExpr(this,e)},e}(Ri),Hi=function(t){function e(e,r,i,o){void 0===i&&(i=null),void 0===o&&(o=null),t.call(this,n(o)?o:r.type),this.condition=e,this.falseCase=i,this.trueCase=r}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitConditionalExpr(this,e)},e}(Ri),zi=function(t){function e(e){t.call(this,Pi),this.condition=e}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitNotExpr(this,e)},e}(Ri),Gi=function(t){function e(e,n){t.call(this,n),this.value=e}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitCastExpr(this,e)},e}(Ri),Wi=function(){function t(t,e){void 0===e&&(e=null),this.name=t,this.type=e}return t}(),Ji=function(t){function e(e,n,r){void 0===r&&(r=null),t.call(this,r),this.params=e,this.statements=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitFunctionExpr(this,e)},e.prototype.toDeclStmt=function(t,e){return void 0===e&&(e=null),new so(t,this.params,this.statements,this.type,e)},e}(Ri),$i=function(t){function e(e,r,i,o){void 0===o&&(o=null),t.call(this,n(o)?o:r.type),this.operator=e,this.rhs=i,this.lhs=r}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitBinaryOperatorExpr(this,e)},e}(Ri),Ki=function(t){function e(e,n,r){void 0===r&&(r=null),t.call(this,r),this.receiver=e,this.name=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitReadPropExpr(this,e)},e.prototype.set=function(t){return new Fi(this.receiver,this.name,t)},e}(Ri),Xi=function(t){function e(e,n,r){void 0===r&&(r=null),t.call(this,r),this.receiver=e,this.index=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitReadKeyExpr(this,e)},e.prototype.set=function(t){return new ji(this.receiver,this.index,t)},e}(Ri),Zi=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.entries=e}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitLiteralArrayExpr(this,e)},e}(Ri),Yi=function(t){function e(e,r){void 0===r&&(r=null),t.call(this,r),this.entries=e,this.valueType=null,n(r)&&(this.valueType=r.valueType)}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitLiteralMapExpr(this,e)},e}(Ri),to=new qi(Ai.This),eo=new qi(Ai.Super),no=(new qi(Ai.CatchError),new qi(Ai.CatchStack),new Ui(null,null));!function(t){t[t.Final=0]="Final",t[t.Private=1]="Private"}(Di||(Di={}));var ro,io=function(){function t(t){void 0===t&&(t=null),this.modifiers=t,t||(this.modifiers=[])}return t.prototype.hasModifier=function(t){return this.modifiers.indexOf(t)!==-1},t}(),oo=function(t){function e(e,r,i,o){void 0===i&&(i=null),void 0===o&&(o=null),t.call(this,o),this.name=e,this.value=r,this.type=n(i)?i:r.type}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitDeclareVarStmt(this,e)},e}(io),so=function(t){function e(e,n,r,i,o){void 0===i&&(i=null),void 0===o&&(o=null),t.call(this,o),this.name=e,this.params=n,this.statements=r,this.type=i}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitDeclareFunctionStmt(this,e)},e}(io),ao=function(t){function e(e){t.call(this),this.expr=e}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitExpressionStmt(this,e)},e}(io),uo=function(t){function e(e){t.call(this),this.value=e}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitReturnStmt(this,e)},e}(io),co=function(){function t(t,e){void 0===t&&(t=null),this.type=t,this.modifiers=e,e||(this.modifiers=[])}return t.prototype.hasModifier=function(t){return this.modifiers.indexOf(t)!==-1},t}(),lo=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,n,r),this.name=e}return gi(e,t),e}(co),po=function(t){function e(e,n,r,i,o){void 0===i&&(i=null),void 0===o&&(o=null),t.call(this,i,o),this.name=e,this.params=n,this.body=r}return gi(e,t),e}(co),ho=function(t){function e(e,n,r,i){void 0===r&&(r=null),void 0===i&&(i=null),t.call(this,r,i),this.name=e,this.body=n}return gi(e,t),e}(co),fo=function(t){function e(e,n,r,i,o,s,a){void 0===a&&(a=null),t.call(this,a),this.name=e,this.parent=n,this.fields=r,this.getters=i,this.constructorMethod=o,this.methods=s}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitDeclareClassStmt(this,e)},e}(io),yo=function(t){function e(e,n,r){void 0===r&&(r=[]),t.call(this),this.condition=e,this.trueCase=n,this.falseCase=r}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitIfStmt(this,e)},e}(io),mo=(function(t){function e(e){t.call(this),this.comment=e}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitCommentStmt(this,e)},e}(io),function(t){function e(e,n){t.call(this),this.bodyStmts=e,this.catchStmts=n}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitTryCatchStmt(this,e)},e}(io)),vo=function(t){function e(e){t.call(this),this.error=e}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitThrowStmt(this,e)},e}(io),go=function(){function t(){}return t.prototype.visitReadVarExpr=function(t,e){return t},t.prototype.visitWriteVarExpr=function(t,e){return new Mi(t.name,t.value.visitExpression(this,e))},t.prototype.visitWriteKeyExpr=function(t,e){return new ji(t.receiver.visitExpression(this,e),t.index.visitExpression(this,e),t.value.visitExpression(this,e))},t.prototype.visitWritePropExpr=function(t,e){return new Fi(t.receiver.visitExpression(this,e),t.name,t.value.visitExpression(this,e))},t.prototype.visitInvokeMethodExpr=function(t,e){var r=n(t.builtin)?t.builtin:t.name;return new Li(t.receiver.visitExpression(this,e),r,this.visitAllExpressions(t.args,e),t.type)},t.prototype.visitInvokeFunctionExpr=function(t,e){return new Vi(t.fn.visitExpression(this,e),this.visitAllExpressions(t.args,e),t.type)},t.prototype.visitInstantiateExpr=function(t,e){return new Qi(t.classExpr.visitExpression(this,e),this.visitAllExpressions(t.args,e),t.type)},t.prototype.visitLiteralExpr=function(t,e){return t},t.prototype.visitExternalExpr=function(t,e){return t},t.prototype.visitConditionalExpr=function(t,e){return new Hi(t.condition.visitExpression(this,e),t.trueCase.visitExpression(this,e),t.falseCase.visitExpression(this,e))},t.prototype.visitNotExpr=function(t,e){return new zi(t.condition.visitExpression(this,e))},t.prototype.visitCastExpr=function(t,e){return new Gi(t.value.visitExpression(this,e),e)},t.prototype.visitFunctionExpr=function(t,e){return t},t.prototype.visitBinaryOperatorExpr=function(t,e){return new $i(t.operator,t.lhs.visitExpression(this,e),t.rhs.visitExpression(this,e),t.type)},t.prototype.visitReadPropExpr=function(t,e){return new Ki(t.receiver.visitExpression(this,e),t.name,t.type)},t.prototype.visitReadKeyExpr=function(t,e){return new Xi(t.receiver.visitExpression(this,e),t.index.visitExpression(this,e),t.type)},t.prototype.visitLiteralArrayExpr=function(t,e){return new Zi(this.visitAllExpressions(t.entries,e))},t.prototype.visitLiteralMapExpr=function(t,e){var n=this;return new Yi(t.entries.map(function(t){return[t[0],t[1].visitExpression(n,e)]}))},t.prototype.visitAllExpressions=function(t,e){var n=this;return t.map(function(t){return t.visitExpression(n,e)})},t.prototype.visitDeclareVarStmt=function(t,e){return new oo(t.name,t.value.visitExpression(this,e),t.type,t.modifiers)},t.prototype.visitDeclareFunctionStmt=function(t,e){return t},t.prototype.visitExpressionStmt=function(t,e){return new ao(t.expr.visitExpression(this,e))},t.prototype.visitReturnStmt=function(t,e){return new uo(t.value.visitExpression(this,e))},t.prototype.visitDeclareClassStmt=function(t,e){return t},t.prototype.visitIfStmt=function(t,e){return new yo(t.condition.visitExpression(this,e),this.visitAllStatements(t.trueCase,e),this.visitAllStatements(t.falseCase,e))},t.prototype.visitTryCatchStmt=function(t,e){return new mo(this.visitAllStatements(t.bodyStmts,e),this.visitAllStatements(t.catchStmts,e))},t.prototype.visitThrowStmt=function(t,e){return new vo(t.error.visitExpression(this,e))},t.prototype.visitCommentStmt=function(t,e){return t},t.prototype.visitAllStatements=function(t,e){var n=this;return t.map(function(t){return t.visitStatement(n,e)})},t}(),_o=function(){function t(){}return t.prototype.visitReadVarExpr=function(t,e){return t},t.prototype.visitWriteVarExpr=function(t,e){return t.value.visitExpression(this,e),t},t.prototype.visitWriteKeyExpr=function(t,e){return t.receiver.visitExpression(this,e),t.index.visitExpression(this,e),t.value.visitExpression(this,e),t},t.prototype.visitWritePropExpr=function(t,e){return t.receiver.visitExpression(this,e),t.value.visitExpression(this,e),t},t.prototype.visitInvokeMethodExpr=function(t,e){return t.receiver.visitExpression(this,e),this.visitAllExpressions(t.args,e),t},t.prototype.visitInvokeFunctionExpr=function(t,e){return t.fn.visitExpression(this,e),this.visitAllExpressions(t.args,e),t},t.prototype.visitInstantiateExpr=function(t,e){return t.classExpr.visitExpression(this,e),this.visitAllExpressions(t.args,e),t},t.prototype.visitLiteralExpr=function(t,e){return t},t.prototype.visitExternalExpr=function(t,e){return t},t.prototype.visitConditionalExpr=function(t,e){return t.condition.visitExpression(this,e),t.trueCase.visitExpression(this,e),t.falseCase.visitExpression(this,e),t},t.prototype.visitNotExpr=function(t,e){return t.condition.visitExpression(this,e),t},t.prototype.visitCastExpr=function(t,e){return t.value.visitExpression(this,e),t},t.prototype.visitFunctionExpr=function(t,e){return t},t.prototype.visitBinaryOperatorExpr=function(t,e){return t.lhs.visitExpression(this,e),t.rhs.visitExpression(this,e),t},t.prototype.visitReadPropExpr=function(t,e){return t.receiver.visitExpression(this,e),t},t.prototype.visitReadKeyExpr=function(t,e){return t.receiver.visitExpression(this,e),t.index.visitExpression(this,e),t},t.prototype.visitLiteralArrayExpr=function(t,e){return this.visitAllExpressions(t.entries,e),t},t.prototype.visitLiteralMapExpr=function(t,e){var n=this;return t.entries.forEach(function(t){return t[1].visitExpression(n,e)}),t},t.prototype.visitAllExpressions=function(t,e){var n=this;t.forEach(function(t){return t.visitExpression(n,e)})},t.prototype.visitDeclareVarStmt=function(t,e){return t.value.visitExpression(this,e),t},t.prototype.visitDeclareFunctionStmt=function(t,e){return t},t.prototype.visitExpressionStmt=function(t,e){return t.expr.visitExpression(this,e),t},t.prototype.visitReturnStmt=function(t,e){return t.value.visitExpression(this,e),t},t.prototype.visitDeclareClassStmt=function(t,e){return t},t.prototype.visitIfStmt=function(t,e){return t.condition.visitExpression(this,e),this.visitAllStatements(t.trueCase,e),this.visitAllStatements(t.falseCase,e),t},t.prototype.visitTryCatchStmt=function(t,e){return this.visitAllStatements(t.bodyStmts,e),this.visitAllStatements(t.catchStmts,e),t},t.prototype.visitThrowStmt=function(t,e){return t.error.visitExpression(this,e),t},t.prototype.visitCommentStmt=function(t,e){return t},t.prototype.visitAllStatements=function(t,e){var n=this;t.forEach(function(t){return t.visitStatement(n,e)})},t}(),bo=function(t){function e(e,n){t.call(this),this._varName=e,this._newValue=n}return gi(e,t),e.prototype.visitReadVarExpr=function(t,e){return t.name==this._varName?this._newValue:t},e}(go),wo=function(t){function e(){t.apply(this,arguments),this.varNames=new Set}return gi(e,t),e.prototype.visitReadVarExpr=function(t,e){return this.varNames.add(t.name),null},e}(_o),Eo="",Oo=/([A-Z])/g,Co=function(){function t(){}return t.prototype.visitArray=function(t,e){var n=this;return t.map(function(t){return F(t,n,e)})},t.prototype.visitStringMap=function(t,e){var n=this,r={};return Object.keys(t).forEach(function(i){r[i]=F(t[i],n,e)}),r},t.prototype.visitPrimitive=function(t,e){return t},t.prototype.visitOther=function(t,e){return t},t}(),So=function(){function t(t,e){void 0===e&&(e=null),this.syncResult=t,this.asyncResult=e,e||(this.asyncResult=Promise.resolve(t))}return t}(),xo=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Po=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/,To=function(){function t(){}return Object.defineProperty(t.prototype,"identifier",{get:function(){return V()},enumerable:!0,configurable:!0}),t}(),No=function(){function t(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.name=t,this.definitions=e}return t}(),ko=function(){function t(){}return t}(),Ao=function(t){function e(e,n){t.call(this),this.stateNameExpr=e,this.styles=n}return xo(e,t),e}(ko),Ro=function(t){function e(e,n){t.call(this),this.stateChangeExpr=e,this.steps=n}return xo(e,t),e}(ko),Io=function(){function t(){}return t}(),qo=function(t){function e(e){void 0===e&&(e=[]),t.call(this),this.steps=e}return xo(e,t),e}(Io),Mo=function(t){function e(e,n){void 0===n&&(n=null),t.call(this),this.offset=e,this.styles=n}return xo(e,t),e}(Io),jo=function(t){function e(e,n){void 0===e&&(e=0),void 0===n&&(n=null),t.call(this),this.timings=e,this.styles=n}return xo(e,t),e}(Io),Fo=function(t){function e(e){void 0===e&&(e=null),t.call(this),this.steps=e}return xo(e,t),e}(Io),Do=function(t){function e(e){void 0===e&&(e=null),t.call(this,e)}return xo(e,t),e}(Fo),Lo=function(t){function e(e){void 0===e&&(e=null),t.call(this,e)}return xo(e,t),e}(Fo),Vo=function(){function t(t){var e=void 0===t?{}:t,n=e.reference,r=e.name,i=e.moduleUrl,o=e.prefix,s=e.value;this.reference=n,this.name=r,this.prefix=o,this.moduleUrl=i,this.value=s}return Object.defineProperty(t.prototype,"identifier",{get:function(){return this},enumerable:!0,configurable:!0}),t}(),Qo=function(){function t(t){var e=void 0===t?{}:t,n=e.isAttribute,r=e.isSelf,i=e.isHost,o=e.isSkipSelf,s=e.isOptional,a=e.isValue,u=e.query,c=e.viewQuery,l=e.token,h=e.value;this.isAttribute=p(n),this.isSelf=p(r),this.isHost=p(i),this.isSkipSelf=p(o),this.isOptional=p(s),this.isValue=p(a),this.query=u,this.viewQuery=c,this.token=l,this.value=h}return t}(),Uo=function(){function t(t){var e=t.token,n=t.useClass,r=t.useValue,i=t.useExisting,o=t.useFactory,s=t.deps,a=t.multi;this.token=e,this.useClass=n,this.useValue=r,this.useExisting=i,this.useFactory=o,this.deps=l(s),this.multi=p(a)}return t}(),Bo=function(t){function e(e){var n=e.reference,r=e.name,i=e.moduleUrl,o=e.prefix,s=e.diDeps,a=e.value;t.call(this,{reference:n,name:r,prefix:o,moduleUrl:i,value:a}),this.diDeps=B(s)}return xo(e,t),e}(Vo),Ho=function(){function t(t){var e=t.value,n=t.identifier,r=t.identifierIsInstance;this.value=e,this.identifier=n,this.identifierIsInstance=p(r)}return Object.defineProperty(t.prototype,"reference",{get:function(){return n(this.identifier)?this.identifier.reference:this.value},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return n(this.value)?j(this.value):this.identifier.name},enumerable:!0,configurable:!0}),t}(),zo=function(t){function e(e){var n=void 0===e?{}:e,r=n.reference,i=n.name,o=n.moduleUrl,s=n.prefix,a=n.isHost,u=n.value,c=n.diDeps,l=n.lifecycleHooks;t.call(this,{reference:r,name:i,moduleUrl:o,prefix:s,value:u}),this.isHost=p(a),this.diDeps=B(c),this.lifecycleHooks=B(l)}return xo(e,t),e}(Vo),Go=function(){function t(t){var e=void 0===t?{}:t,n=e.selectors,r=e.descendants,i=e.first,o=e.propertyName,s=e.read;this.selectors=n,this.descendants=p(r),this.first=p(i),this.propertyName=o,this.read=s}return t}(),Wo=function(){function t(t){var e=void 0===t?{}:t,n=e.moduleUrl,r=e.styles,i=e.styleUrls;this.moduleUrl=n,this.styles=B(r),this.styleUrls=B(i)}return t}(),Jo=function(){function t(t){var e=void 0===t?{}:t,r=e.encapsulation,i=e.template,o=e.templateUrl,s=e.styles,a=e.styleUrls,u=e.externalStylesheets,c=e.animations,l=e.ngContentSelectors,p=e.interpolation;if(this.encapsulation=r,this.template=i,this.templateUrl=o,this.styles=B(s),this.styleUrls=B(a),this.externalStylesheets=B(u),this.animations=n(c)?ai.flatten(c):[],this.ngContentSelectors=n(l)?l:[],n(p)&&2!=p.length)throw new Error("'interpolation' should have a start and an end symbol.");this.interpolation=p}return t}(),$o=function(){function t(t){var e=void 0===t?{}:t,n=e.type,r=e.isComponent,i=e.selector,o=e.exportAs,s=e.changeDetection,a=e.inputs,u=e.outputs,c=e.hostListeners,l=e.hostProperties,p=e.hostAttributes,h=e.providers,f=e.viewProviders,d=e.queries,y=e.viewQueries,m=e.entryComponents,v=e.template;this.type=n,this.isComponent=r,this.selector=i,this.exportAs=o,this.changeDetection=s,this.inputs=a,this.outputs=u,this.hostListeners=c,this.hostProperties=l,this.hostAttributes=p,this.providers=B(h),this.viewProviders=B(f),this.queries=B(d),this.viewQueries=B(y),this.entryComponents=B(m),this.template=v}return t.create=function(e){var r=void 0===e?{}:e,i=r.type,o=r.isComponent,s=r.selector,a=r.exportAs,u=r.changeDetection,c=r.inputs,l=r.outputs,h=r.host,f=r.providers,d=r.viewProviders,y=r.queries,m=r.viewQueries,v=r.entryComponents,g=r.template,_={},b={},w={};n(h)&&Object.keys(h).forEach(function(t){var e=h[t],r=t.match(Po);null===r?w[t]=e:n(r[1])?b[r[1]]=e:n(r[2])&&(_[r[2]]=e)});var E={};n(c)&&c.forEach(function(t){var e=I(t,[t,t]);E[e[0]]=e[1]});var O={};return n(l)&&l.forEach(function(t){var e=I(t,[t,t]);O[e[0]]=e[1]}),new t({type:i,isComponent:p(o),selector:s,exportAs:a,changeDetection:u,inputs:E,outputs:O,hostListeners:_,hostProperties:b,hostAttributes:w,providers:f,viewProviders:d,queries:y,viewQueries:m,entryComponents:v,template:g})},Object.defineProperty(t.prototype,"identifier",{get:function(){return this.type},enumerable:!0,configurable:!0}),t}(),Ko=function(){function t(t){var e=void 0===t?{}:t,n=e.type,r=e.name,i=e.pure;this.type=n,this.name=r,this.pure=p(i)}return Object.defineProperty(t.prototype,"identifier",{get:function(){return this.type},enumerable:!0,configurable:!0}),t}(),Xo=function(){function t(t){var e=void 0===t?{}:t,n=e.type,r=e.providers,i=e.declaredDirectives,o=e.exportedDirectives,s=e.declaredPipes,a=e.exportedPipes,u=e.entryComponents,c=e.bootstrapComponents,l=e.importedModules,p=e.exportedModules,h=e.schemas,f=e.transitiveModule,d=e.id;this.type=n,this.declaredDirectives=B(i),this.exportedDirectives=B(o),this.declaredPipes=B(s),this.exportedPipes=B(a),this.providers=B(r),this.entryComponents=B(u),this.bootstrapComponents=B(c),this.importedModules=B(l),this.exportedModules=B(p),this.schemas=B(h),this.id=d,this.transitiveModule=f}return Object.defineProperty(t.prototype,"identifier",{get:function(){return this.type},enumerable:!0,configurable:!0}),t}(),Zo=function(){function t(t,e,n,r,i){var o=this;this.modules=t,this.providers=e,this.entryComponents=n,this.directives=r,this.pipes=i,this.directivesSet=new Set,this.pipesSet=new Set,r.forEach(function(t){return o.directivesSet.add(t.type.reference)}),i.forEach(function(t){return o.pipesSet.add(t.type.reference)})}return t}(),Yo=function(){function t(t,e){var n=e.useClass,r=e.useValue,i=e.useExisting,o=e.useFactory,s=e.deps,a=e.multi;this.token=t,this.useClass=n,this.useValue=r,this.useExisting=i,this.useFactory=o,this.dependencies=s,this.multi=!!a}return t}(),ts=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},es=function(){function t(t,e,n,r){this.input=e,this.errLocation=n,this.ctxLocation=r,this.message="Parser Error: "+t+" "+n+" ["+e+"] in "+r}return t}(),ns=function(){function t(t,e){this.start=t,this.end=e}return t}(),rs=function(){function t(t){this.span=t}return t.prototype.visit=function(t,e){return void 0===e&&(e=null),null},t.prototype.toString=function(){return"AST"},t}(),is=function(t){function e(e,n,r,i){t.call(this,e),this.prefix=n,this.uninterpretedExpression=r,this.location=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitQuote(this,e)},e.prototype.toString=function(){return"Quote"},e}(rs),os=function(t){function e(){t.apply(this,arguments)}return ts(e,t),e.prototype.visit=function(t,e){void 0===e&&(e=null)},e}(rs),ss=function(t){function e(){t.apply(this,arguments)}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitImplicitReceiver(this,e)},e}(rs),as=function(t){function e(e,n){t.call(this,e),this.expressions=n}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitChain(this,e)},e}(rs),us=function(t){function e(e,n,r,i){t.call(this,e),this.condition=n,this.trueExp=r,this.falseExp=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitConditional(this,e)},e}(rs),cs=function(t){function e(e,n,r){t.call(this,e),this.receiver=n,this.name=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitPropertyRead(this,e)},e}(rs),ls=function(t){function e(e,n,r,i){t.call(this,e),this.receiver=n,this.name=r,this.value=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitPropertyWrite(this,e)},e}(rs),ps=function(t){function e(e,n,r){t.call(this,e),this.receiver=n,this.name=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitSafePropertyRead(this,e)},e}(rs),hs=function(t){function e(e,n,r){t.call(this,e),this.obj=n,this.key=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitKeyedRead(this,e)},e}(rs),fs=function(t){function e(e,n,r,i){t.call(this,e),this.obj=n,this.key=r,this.value=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitKeyedWrite(this,e)},e}(rs),ds=function(t){function e(e,n,r,i){t.call(this,e),this.exp=n,this.name=r,this.args=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitPipe(this,e)},e}(rs),ys=function(t){function e(e,n){t.call(this,e),this.value=n}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitLiteralPrimitive(this,e)},e}(rs),ms=function(t){function e(e,n){t.call(this,e),this.expressions=n}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitLiteralArray(this,e)},e}(rs),vs=function(t){function e(e,n,r){t.call(this,e),this.keys=n,this.values=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitLiteralMap(this,e)},e}(rs),gs=function(t){function e(e,n,r){t.call(this,e),this.strings=n,this.expressions=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitInterpolation(this,e)},e}(rs),_s=function(t){function e(e,n,r,i){t.call(this,e),this.operation=n,this.left=r,this.right=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitBinary(this,e)},e}(rs),bs=function(t){function e(e,n){t.call(this,e),this.expression=n}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitPrefixNot(this,e)},e}(rs),ws=function(t){function e(e,n,r,i){t.call(this,e),this.receiver=n,this.name=r,this.args=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitMethodCall(this,e)},e}(rs),Es=function(t){function e(e,n,r,i){t.call(this,e),this.receiver=n,this.name=r,this.args=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitSafeMethodCall(this,e)},e}(rs),Os=function(t){function e(e,n,r){t.call(this,e),this.target=n,this.args=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitFunctionCall(this,e)},e}(rs),Cs=function(t){function e(e,n,r,o){t.call(this,new ns(0,i(n)?0:n.length)),this.ast=e,this.source=n,this.location=r,this.errors=o}return ts(e,t),e.prototype.visit=function(t,e){ -return void 0===e&&(e=null),this.ast.visit(t,e)},e.prototype.toString=function(){return this.source+" in "+this.location},e}(rs),Ss=function(){function t(t,e,n,r){this.key=t,this.keyIsVar=e,this.name=n,this.expression=r}return t}(),xs=function(){function t(){}return t.prototype.visitBinary=function(t,e){return t.left.visit(this),t.right.visit(this),null},t.prototype.visitChain=function(t,e){return this.visitAll(t.expressions,e)},t.prototype.visitConditional=function(t,e){return t.condition.visit(this),t.trueExp.visit(this),t.falseExp.visit(this),null},t.prototype.visitPipe=function(t,e){return t.exp.visit(this),this.visitAll(t.args,e),null},t.prototype.visitFunctionCall=function(t,e){return t.target.visit(this),this.visitAll(t.args,e),null},t.prototype.visitImplicitReceiver=function(t,e){return null},t.prototype.visitInterpolation=function(t,e){return this.visitAll(t.expressions,e)},t.prototype.visitKeyedRead=function(t,e){return t.obj.visit(this),t.key.visit(this),null},t.prototype.visitKeyedWrite=function(t,e){return t.obj.visit(this),t.key.visit(this),t.value.visit(this),null},t.prototype.visitLiteralArray=function(t,e){return this.visitAll(t.expressions,e)},t.prototype.visitLiteralMap=function(t,e){return this.visitAll(t.values,e)},t.prototype.visitLiteralPrimitive=function(t,e){return null},t.prototype.visitMethodCall=function(t,e){return t.receiver.visit(this),this.visitAll(t.args,e)},t.prototype.visitPrefixNot=function(t,e){return t.expression.visit(this),null},t.prototype.visitPropertyRead=function(t,e){return t.receiver.visit(this),null},t.prototype.visitPropertyWrite=function(t,e){return t.receiver.visit(this),t.value.visit(this),null},t.prototype.visitSafePropertyRead=function(t,e){return t.receiver.visit(this),null},t.prototype.visitSafeMethodCall=function(t,e){return t.receiver.visit(this),this.visitAll(t.args,e)},t.prototype.visitAll=function(t,e){var n=this;return t.forEach(function(t){return t.visit(n,e)}),null},t.prototype.visitQuote=function(t,e){return null},t}(),Ps=0,Ts=9,Ns=10,ks=11,As=12,Rs=13,Is=32,qs=33,Ms=34,js=35,Fs=36,Ds=37,Ls=38,Vs=39,Qs=40,Us=41,Bs=42,Hs=43,zs=44,Gs=45,Ws=46,Js=47,$s=58,Ks=59,Xs=60,Zs=61,Ys=62,ta=63,ea=48,na=57,ra=65,ia=69,oa=70,sa=88,aa=90,ua=91,ca=92,la=93,pa=94,ha=95,fa=97,da=101,ya=102,ma=110,va=114,ga=116,_a=117,ba=118,wa=120,Ea=122,Oa=123,Ca=124,Sa=125,xa=160,Pa=96,Ta=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//],Na=function(){function t(t,e){this.start=t,this.end=e}return t.fromArray=function(e){return e?(K("interpolation",e),new t(e[0],e[1])):ka},t}(),ka=new Na("{{","}}");!function(t){t[t.Character=0]="Character",t[t.Identifier=1]="Identifier",t[t.Keyword=2]="Keyword",t[t.String=3]="String",t[t.Operator=4]="Operator",t[t.Number=5]="Number",t[t.Error=6]="Error"}(ro||(ro={}));var Aa,Ra=["var","let","null","undefined","true","false","if","else","this"],Ia=function(){function t(){}return t.prototype.tokenize=function(t){for(var e=new ja(t),n=[],r=e.scanToken();null!=r;)n.push(r),r=e.scanToken();return n},t.decorators=[{type:e.Injectable}],t.ctorParameters=[],t}(),qa=function(){function t(t,e,n,r){this.index=t,this.type=e,this.numValue=n,this.strValue=r}return t.prototype.isCharacter=function(t){return this.type==ro.Character&&this.numValue==t},t.prototype.isNumber=function(){return this.type==ro.Number},t.prototype.isString=function(){return this.type==ro.String},t.prototype.isOperator=function(t){return this.type==ro.Operator&&this.strValue==t},t.prototype.isIdentifier=function(){return this.type==ro.Identifier},t.prototype.isKeyword=function(){return this.type==ro.Keyword},t.prototype.isKeywordLet=function(){return this.type==ro.Keyword&&"let"==this.strValue},t.prototype.isKeywordNull=function(){return this.type==ro.Keyword&&"null"==this.strValue},t.prototype.isKeywordUndefined=function(){return this.type==ro.Keyword&&"undefined"==this.strValue},t.prototype.isKeywordTrue=function(){return this.type==ro.Keyword&&"true"==this.strValue},t.prototype.isKeywordFalse=function(){return this.type==ro.Keyword&&"false"==this.strValue},t.prototype.isKeywordThis=function(){return this.type==ro.Keyword&&"this"==this.strValue},t.prototype.isError=function(){return this.type==ro.Error},t.prototype.toNumber=function(){return this.type==ro.Number?this.numValue:-1},t.prototype.toString=function(){switch(this.type){case ro.Character:case ro.Identifier:case ro.Keyword:case ro.Operator:case ro.String:case ro.Error:return this.strValue;case ro.Number:return this.numValue.toString();default:return null}},t}(),Ma=new qa((-1),ro.Character,0,""),ja=function(){function t(t){this.input=t,this.peek=0,this.index=-1,this.length=t.length,this.advance()}return t.prototype.advance=function(){this.peek=++this.index>=this.length?Ps:Vr.charCodeAt(this.input,this.index)},t.prototype.scanToken=function(){for(var t=this.input,e=this.length,n=this.peek,r=this.index;n<=Is;){if(++r>=e){n=Ps;break}n=Vr.charCodeAt(t,r)}if(this.peek=n,this.index=r,r>=e)return null;if(it(n))return this.scanIdentifier();if(G(n))return this.scanNumber(r);var i=r;switch(n){case Ws:return this.advance(),G(this.peek)?this.scanNumber(i):X(i,Ws);case Qs:case Us:case Oa:case Sa:case ua:case la:case zs:case $s:case Ks:return this.scanCharacter(i,n);case Vs:case Ms:return this.scanString();case js:case Hs:case Gs:case Bs:case Js:case Ds:case pa:return this.scanOperator(i,Vr.fromCharCode(n));case ta:return this.scanComplexOperator(i,"?",Ws,".");case Xs:case Ys:return this.scanComplexOperator(i,Vr.fromCharCode(n),Zs,"=");case qs:case Zs:return this.scanComplexOperator(i,Vr.fromCharCode(n),Zs,"=",Zs,"=");case Ls:return this.scanComplexOperator(i,"&",Ls,"&");case Ca:return this.scanComplexOperator(i,"|",Ca,"|");case xa:for(;z(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error("Unexpected character ["+Vr.fromCharCode(n)+"]",0)},t.prototype.scanCharacter=function(t,e){return this.advance(),X(t,e)},t.prototype.scanOperator=function(t,e){return this.advance(),tt(t,e)},t.prototype.scanComplexOperator=function(t,e,r,i,o,s){this.advance();var a=e;return this.peek==r&&(this.advance(),a+=i),n(o)&&this.peek==o&&(this.advance(),a+=s),tt(t,a)},t.prototype.scanIdentifier=function(){var t=this.index;for(this.advance();st(this.peek);)this.advance();var e=this.input.substring(t,this.index);return Ra.indexOf(e)>-1?Y(t,e):Z(t,e)},t.prototype.scanNumber=function(t){var e=this.index===t;for(this.advance();;){if(G(this.peek));else if(this.peek==Ws)e=!1;else{if(!at(this.peek))break;if(this.advance(),ut(this.peek)&&this.advance(),!G(this.peek))return this.error("Invalid exponent",-1);e=!1}this.advance()}var n=this.input.substring(t,this.index),r=e?Ur.parseIntAutoRadix(n):parseFloat(n);return nt(t,r)},t.prototype.scanString=function(){var t=this.index,e=this.peek;this.advance();for(var n,r=this.index,i=this.input;this.peek!=e;)if(this.peek==ca){null==n&&(n=new Qr),n.add(i.substring(r,this.index)),this.advance();var o;if(this.peek==_a){var s=i.substring(this.index+1,this.index+5);try{o=Ur.parseInt(s,16)}catch(a){return this.error("Invalid unicode escape [\\u"+s+"]",0)}for(var u=0;u<5;u++)this.advance()}else o=lt(this.peek),this.advance();n.add(Vr.fromCharCode(o)),r=this.index}else{if(this.peek==Ps)return this.error("Unterminated quote",0);this.advance()}var c=i.substring(r,this.index);this.advance();var l=c;return null!=n&&(n.add(c),l=n.toString()),et(t,l)},t.prototype.error=function(t,e){var n=this.index+e;return rt(n,"Lexer Error: "+t+" at column "+n+" in expression ["+this.input+"]")},t}(),Fa=function(){function t(t,e){this.strings=t,this.expressions=e}return t}(),Da=function(){function t(t,e,n){this.templateBindings=t,this.warnings=e,this.errors=n}return t}(),La=function(){function t(t){this._lexer=t,this.errors=[]}return t.prototype.parseAction=function(t,e,n){void 0===n&&(n=ka),this._checkNoInterpolation(t,e,n);var r=this._lexer.tokenize(this._stripComments(t)),i=new Va(t,e,r,(!0),this.errors).parseChain();return new Cs(i,t,e,this.errors)},t.prototype.parseBinding=function(t,e,n){void 0===n&&(n=ka);var r=this._parseBindingAst(t,e,n);return new Cs(r,t,e,this.errors)},t.prototype.parseSimpleBinding=function(t,e,n){void 0===n&&(n=ka);var r=this._parseBindingAst(t,e,n);return Qa.check(r)||this._reportError("Host binding expression can only contain field access and constants",t,e),new Cs(r,t,e,this.errors)},t.prototype._reportError=function(t,e,n,r){this.errors.push(new es(t,e,n,r))},t.prototype._parseBindingAst=function(t,e,r){var i=this._parseQuote(t,e);if(n(i))return i;this._checkNoInterpolation(t,e,r);var o=this._lexer.tokenize(this._stripComments(t));return new Va(t,e,o,(!1),this.errors).parseChain()},t.prototype._parseQuote=function(t,e){if(i(t))return null;var n=t.indexOf(":");if(n==-1)return null;var r=t.substring(0,n).trim();if(!ot(r))return null;var o=t.substring(n+1);return new is(new ns(0,t.length),r,o,e)},t.prototype.parseTemplateBindings=function(t,e){var n=this._lexer.tokenize(t);return new Va(t,e,n,(!1),this.errors).parseTemplateBindings()},t.prototype.parseInterpolation=function(t,e,n){void 0===n&&(n=ka);var r=this.splitInterpolation(t,e,n);if(null==r)return null;for(var o=[],s=0;s0?s.push(u):this._reportError("Blank expressions are not allowed in interpolated strings",t,"at column "+this._findInterpolationErrorColumn(i,a,n)+" in",e)}return new Fa(o,s)},t.prototype.wrapLiteralPrimitive=function(t,e){return new Cs(new ys(new ns(0,i(t)?0:t.length),t),t,e,this.errors)},t.prototype._stripComments=function(t){var e=this._commentStart(t);return n(e)?t.substring(0,e).trim():t},t.prototype._commentStart=function(t){for(var e=null,n=0;n1&&this._reportError("Got interpolation ("+n.start+n.end+") where expression was expected",t,"at column "+this._findInterpolationErrorColumn(i,1,n)+" in",e)},t.prototype._findInterpolationErrorColumn=function(t,e,n){for(var r="",i=0;i":case"<=":case">=":this.advance();var n=this.parseAdditive();t=new _s(this.span(t.span.start),e,t,n);continue}break}return t},t.prototype.parseAdditive=function(){for(var t=this.parseMultiplicative();this.next.type==ro.Operator;){var e=this.next.strValue;switch(e){case"+":case"-":this.advance();var n=this.parseMultiplicative();t=new _s(this.span(t.span.start),e,t,n);continue}break}return t},t.prototype.parseMultiplicative=function(){for(var t=this.parsePrefix();this.next.type==ro.Operator;){var e=this.next.strValue;switch(e){case"*":case"%":case"/":this.advance();var n=this.parsePrefix();t=new _s(this.span(t.span.start),e,t,n);continue}break}return t},t.prototype.parsePrefix=function(){if(this.next.type==ro.Operator){var t=this.inputIndex,e=this.next.strValue,n=void 0;switch(e){case"+":return this.advance(),this.parsePrefix();case"-":return this.advance(),n=this.parsePrefix(),new _s(this.span(t),e,new ys(new ns(t,t),0),n);case"!":return this.advance(),n=this.parsePrefix(),new bs(this.span(t),n)}}return this.parseCallChain()},t.prototype.parseCallChain=function(){for(var t=this.parsePrimary();;)if(this.optionalCharacter(Ws))t=this.parseAccessMemberOrMethodCall(t,!1);else if(this.optionalOperator("?."))t=this.parseAccessMemberOrMethodCall(t,!0);else if(this.optionalCharacter(ua)){this.rbracketsExpected++;var e=this.parsePipe();if(this.rbracketsExpected--,this.expectCharacter(la),this.optionalOperator("=")){var n=this.parseConditional();t=new fs(this.span(t.span.start),t,e,n)}else t=new hs(this.span(t.span.start),t,e)}else{if(!this.optionalCharacter(Qs))return t;this.rparensExpected++;var r=this.parseCallArguments();this.rparensExpected--,this.expectCharacter(Us),t=new Os(this.span(t.span.start),t,r)}},t.prototype.parsePrimary=function(){var t=this.inputIndex;if(this.optionalCharacter(Qs)){this.rparensExpected++;var e=this.parsePipe();return this.rparensExpected--,this.expectCharacter(Us),e}if(this.next.isKeywordNull())return this.advance(),new ys(this.span(t),null);if(this.next.isKeywordUndefined())return this.advance(),new ys(this.span(t),(void 0));if(this.next.isKeywordTrue())return this.advance(),new ys(this.span(t),(!0));if(this.next.isKeywordFalse())return this.advance(),new ys(this.span(t),(!1));if(this.next.isKeywordThis())return this.advance(),new ss(this.span(t));if(this.optionalCharacter(ua)){this.rbracketsExpected++;var n=this.parseExpressionList(la);return this.rbracketsExpected--,this.expectCharacter(la),new ms(this.span(t),n)}if(this.next.isCharacter(Oa))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(new ss(this.span(t)),!1);if(this.next.isNumber()){var r=this.next.toNumber();return this.advance(),new ys(this.span(t),r)}if(this.next.isString()){var i=this.next.toString();return this.advance(),new ys(this.span(t),i)}return this.index>=this.tokens.length?(this.error("Unexpected end of expression: "+this.input),new os(this.span(t))):(this.error("Unexpected token "+this.next),new os(this.span(t)))},t.prototype.parseExpressionList=function(t){var e=[];if(!this.next.isCharacter(t))do e.push(this.parsePipe());while(this.optionalCharacter(zs));return e},t.prototype.parseLiteralMap=function(){var t=[],e=[],n=this.inputIndex;if(this.expectCharacter(Oa),!this.optionalCharacter(Sa)){this.rbracesExpected++;do{var r=this.expectIdentifierOrKeywordOrString();t.push(r),this.expectCharacter($s),e.push(this.parsePipe())}while(this.optionalCharacter(zs));this.rbracesExpected--,this.expectCharacter(Sa)}return new vs(this.span(n),t,e)},t.prototype.parseAccessMemberOrMethodCall=function(t,e){void 0===e&&(e=!1);var n=t.span.start,r=this.expectIdentifierOrKeyword();if(this.optionalCharacter(Qs)){this.rparensExpected++;var i=this.parseCallArguments();this.expectCharacter(Us),this.rparensExpected--;var o=this.span(n);return e?new Es(o,t,r,i):new ws(o,t,r,i)}if(e)return this.optionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),new os(this.span(n))):new ps(this.span(n),t,r);if(this.optionalOperator("=")){if(!this.parseAction)return this.error("Bindings cannot contain assignments"),new os(this.span(n));var s=this.parseConditional();return new ls(this.span(n),t,r,s)}return new cs(this.span(n),t,r)},t.prototype.parseCallArguments=function(){if(this.next.isCharacter(Us))return[];var t=[];do t.push(this.parsePipe());while(this.optionalCharacter(zs));return t},t.prototype.expectTemplateBindingKey=function(){var t="",e=!1;do t+=this.expectIdentifierOrKeywordOrString(),e=this.optionalOperator("-"),e&&(t+="-");while(e);return t.toString()},t.prototype.parseTemplateBindings=function(){for(var t=[],e=null,n=[];this.indext.length-1&&(e=t.length-1);for(var o=e,s=0,a=0;s<100&&e>0&&(e--,s++,"\n"!=t[e]||3!=++a););for(s=0,a=0;s<100&&o]"+t.substring(this.span.start.offset,o+1);r=' ("'+u+'")'}return this.span.details&&(i=", "+this.span.details),""+this.msg+r+": "+this.span.start+i},t}(),Wa=function(){function t(t,e){this.value=t,this.sourceSpan=e}return t.prototype.visit=function(t,e){return t.visitText(this,e)},t}(),Ja=function(){function t(t,e,n,r,i){this.switchValue=t,this.type=e,this.cases=n,this.sourceSpan=r,this.switchValueSourceSpan=i}return t.prototype.visit=function(t,e){return t.visitExpansion(this,e)},t}(),$a=function(){function t(t,e,n,r,i){this.value=t,this.expression=e,this.sourceSpan=n,this.valueSourceSpan=r,this.expSourceSpan=i}return t.prototype.visit=function(t,e){return t.visitExpansionCase(this,e)},t}(),Ka=function(){function t(t,e,n){this.name=t,this.value=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitAttribute(this,e)},t}(),Xa=function(){function t(t,e,n,r,i,o){this.name=t,this.attrs=e,this.children=n,this.sourceSpan=r,this.startSourceSpan=i,this.endSourceSpan=o}return t.prototype.visit=function(t,e){return t.visitElement(this,e)},t}(),Za=function(){function t(t,e){this.value=t,this.sourceSpan=e}return t.prototype.visit=function(t,e){return t.visitComment(this,e)},t}(),Ya=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};!function(t){t[t.TAG_OPEN_START=0]="TAG_OPEN_START",t[t.TAG_OPEN_END=1]="TAG_OPEN_END",t[t.TAG_OPEN_END_VOID=2]="TAG_OPEN_END_VOID",t[t.TAG_CLOSE=3]="TAG_CLOSE",t[t.TEXT=4]="TEXT",t[t.ESCAPABLE_RAW_TEXT=5]="ESCAPABLE_RAW_TEXT",t[t.RAW_TEXT=6]="RAW_TEXT",t[t.COMMENT_START=7]="COMMENT_START",t[t.COMMENT_END=8]="COMMENT_END",t[t.CDATA_START=9]="CDATA_START",t[t.CDATA_END=10]="CDATA_END",t[t.ATTR_NAME=11]="ATTR_NAME",t[t.ATTR_VALUE=12]="ATTR_VALUE",t[t.DOC_TYPE=13]="DOC_TYPE",t[t.EXPANSION_FORM_START=14]="EXPANSION_FORM_START",t[t.EXPANSION_CASE_VALUE=15]="EXPANSION_CASE_VALUE",t[t.EXPANSION_CASE_EXP_START=16]="EXPANSION_CASE_EXP_START",t[t.EXPANSION_CASE_EXP_END=17]="EXPANSION_CASE_EXP_END",t[t.EXPANSION_FORM_END=18]="EXPANSION_FORM_END",t[t.EOF=19]="EOF"}(za||(za={}));var tu,eu=function(){function t(t,e,n){this.type=t,this.parts=e,this.sourceSpan=n}return t}(),nu=function(t){function e(e,n,r){t.call(this,r,e),this.tokenType=n}return Ya(e,t),e}(Ga),ru=function(){function t(t,e){this.tokens=t,this.errors=e}return t}(),iu=/\r\n?/g,ou=function(){function t(t){this.error=t}return t}(),su=function(){function t(t,e,n,r){void 0===r&&(r=ka),this._file=t,this._getTagDefinition=e,this._tokenizeIcu=n,this._interpolationConfig=r,this._peek=-1,this._nextPeek=-1,this._index=-1,this._line=0,this._column=-1,this._expansionCaseStack=[],this._inInterpolation=!1,this.tokens=[],this.errors=[],this._input=t.content,this._length=t.content.length,this._advance()}return t.prototype._processCarriageReturns=function(t){return t.replace(iu,"\n")},t.prototype.tokenize=function(){for(;this._peek!==Ps;){var t=this._getLocation();try{this._attemptCharCode(Xs)?this._attemptCharCode(qs)?this._attemptCharCode(ua)?this._consumeCdata(t):this._attemptCharCode(Gs)?this._consumeComment(t):this._consumeDocType(t):this._attemptCharCode(Js)?this._consumeTagClose(t):this._consumeTagOpen(t):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeText()}catch(e){if(!(e instanceof ou))throw e;this.errors.push(e.error)}}return this._beginToken(za.EOF),this._endToken([]),new ru(St(this.tokens),this.errors)},t.prototype._tokenizeExpansionForm=function(){if(wt(this._input,this._index,this._interpolationConfig))return this._consumeExpansionFormStart(),!0;if(Et(this._peek)&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._peek===Sa){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1},t.prototype._getLocation=function(){return new Ua(this._file,this._index,this._line,this._column)},t.prototype._getSpan=function(t,e){return void 0===t&&(t=this._getLocation()),void 0===e&&(e=this._getLocation()),new Ha(t,e)},t.prototype._beginToken=function(t,e){void 0===e&&(e=this._getLocation()),this._currentTokenStart=e,this._currentTokenType=t},t.prototype._endToken=function(t,e){void 0===e&&(e=this._getLocation());var n=new eu(this._currentTokenType,t,new Ha(this._currentTokenStart,e));return this.tokens.push(n),this._currentTokenStart=null,this._currentTokenType=null,n},t.prototype._createError=function(t,e){this._isInExpansionForm()&&(t+=' (Do you have an unescaped "{" in your template? Use "{{ \'{\' }}") to escape it.)');var n=new nu(t,this._currentTokenType,e);return this._currentTokenStart=null,this._currentTokenType=null,new ou(n)},t.prototype._advance=function(){if(this._index>=this._length)throw this._createError(dt(Ps),this._getSpan());this._peek===Ns?(this._line++,this._column=0):this._peek!==Ns&&this._peek!==Rs&&this._column++,this._index++,this._peek=this._index>=this._length?Ps:this._input.charCodeAt(this._index),this._nextPeek=this._index+1>=this._length?Ps:this._input.charCodeAt(this._index+1)},t.prototype._attemptCharCode=function(t){return this._peek===t&&(this._advance(),!0)},t.prototype._attemptCharCodeCaseInsensitive=function(t){return!!Ot(this._peek,t)&&(this._advance(),!0)},t.prototype._requireCharCode=function(t){var e=this._getLocation();if(!this._attemptCharCode(t))throw this._createError(dt(this._peek),this._getSpan(e,e))},t.prototype._attemptStr=function(t){var e=t.length;if(this._index+e>this._length)return!1;for(var n=this._savePosition(),r=0;rr.offset&&o.push(this._input.substring(r.offset,this._index));this._peek!==e;)o.push(this._readChar(t))}return this._endToken([this._processCarriageReturns(o.join(""))],r)},t.prototype._consumeComment=function(t){var e=this;this._beginToken(za.COMMENT_START,t),this._requireCharCode(Gs),this._endToken([]);var n=this._consumeRawText(!1,Gs,function(){return e._attemptStr("->")});this._beginToken(za.COMMENT_END,n.sourceSpan.end),this._endToken([])},t.prototype._consumeCdata=function(t){var e=this;this._beginToken(za.CDATA_START,t),this._requireStr("CDATA["),this._endToken([]);var n=this._consumeRawText(!1,la,function(){return e._attemptStr("]>")});this._beginToken(za.CDATA_END,n.sourceSpan.end),this._endToken([])},t.prototype._consumeDocType=function(t){this._beginToken(za.DOC_TYPE,t),this._attemptUntilChar(Ys),this._advance(),this._endToken([this._input.substring(t.offset+2,this._index-1)])},t.prototype._consumePrefixAndName=function(){for(var t=this._index,e=null;this._peek!==$s&&!gt(this._peek);)this._advance();var n;this._peek===$s?(this._advance(),e=this._input.substring(t,this._index-1),n=this._index):n=t,this._requireCharCodeUntilFn(vt,this._index===n?1:0);var r=this._input.substring(n,this._index);return[e,r]},t.prototype._consumeTagOpen=function(t){var e,n,r=this._savePosition();try{if(!W(this._peek))throw this._createError(dt(this._peek),this._getSpan());var i=this._index;for(this._consumeTagOpenStart(t),e=this._input.substring(i,this._index),n=e.toLowerCase(),this._attemptCharCodeUntilFn(mt);this._peek!==Js&&this._peek!==Ys;)this._consumeAttributeName(),this._attemptCharCodeUntilFn(mt),this._attemptCharCode(Zs)&&(this._attemptCharCodeUntilFn(mt),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(mt);this._consumeTagOpenEnd()}catch(o){if(o instanceof ou)return this._restorePosition(r),this._beginToken(za.TEXT,t),void this._endToken(["<"]);throw o}var s=this._getTagDefinition(e).contentType; -s===ni.RAW_TEXT?this._consumeRawTextWithTagClose(n,!1):s===ni.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(n,!0)},t.prototype._consumeRawTextWithTagClose=function(t,e){var n=this,r=this._consumeRawText(e,Xs,function(){return!!n._attemptCharCode(Js)&&(n._attemptCharCodeUntilFn(mt),!!n._attemptStrCaseInsensitive(t)&&(n._attemptCharCodeUntilFn(mt),n._attemptCharCode(Ys)))});this._beginToken(za.TAG_CLOSE,r.sourceSpan.end),this._endToken([null,t])},t.prototype._consumeTagOpenStart=function(t){this._beginToken(za.TAG_OPEN_START,t);var e=this._consumePrefixAndName();this._endToken(e)},t.prototype._consumeAttributeName=function(){this._beginToken(za.ATTR_NAME);var t=this._consumePrefixAndName();this._endToken(t)},t.prototype._consumeAttributeValue=function(){this._beginToken(za.ATTR_VALUE);var t;if(this._peek===Vs||this._peek===Ms){var e=this._peek;this._advance();for(var n=[];this._peek!==e;)n.push(this._readChar(!0));t=n.join(""),this._advance()}else{var r=this._index;this._requireCharCodeUntilFn(vt,1),t=this._input.substring(r,this._index)}this._endToken([this._processCarriageReturns(t)])},t.prototype._consumeTagOpenEnd=function(){var t=this._attemptCharCode(Js)?za.TAG_OPEN_END_VOID:za.TAG_OPEN_END;this._beginToken(t),this._requireCharCode(Ys),this._endToken([])},t.prototype._consumeTagClose=function(t){this._beginToken(za.TAG_CLOSE,t),this._attemptCharCodeUntilFn(mt);var e=this._consumePrefixAndName();this._attemptCharCodeUntilFn(mt),this._requireCharCode(Ys),this._endToken(e)},t.prototype._consumeExpansionFormStart=function(){this._beginToken(za.EXPANSION_FORM_START,this._getLocation()),this._requireCharCode(Oa),this._endToken([]),this._expansionCaseStack.push(za.EXPANSION_FORM_START),this._beginToken(za.RAW_TEXT,this._getLocation());var t=this._readUntil(zs);this._endToken([t],this._getLocation()),this._requireCharCode(zs),this._attemptCharCodeUntilFn(mt),this._beginToken(za.RAW_TEXT,this._getLocation());var e=this._readUntil(zs);this._endToken([e],this._getLocation()),this._requireCharCode(zs),this._attemptCharCodeUntilFn(mt)},t.prototype._consumeExpansionCaseStart=function(){this._beginToken(za.EXPANSION_CASE_VALUE,this._getLocation());var t=this._readUntil(Oa).trim();this._endToken([t],this._getLocation()),this._attemptCharCodeUntilFn(mt),this._beginToken(za.EXPANSION_CASE_EXP_START,this._getLocation()),this._requireCharCode(Oa),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(mt),this._expansionCaseStack.push(za.EXPANSION_CASE_EXP_START)},t.prototype._consumeExpansionCaseEnd=function(){this._beginToken(za.EXPANSION_CASE_EXP_END,this._getLocation()),this._requireCharCode(Sa),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(mt),this._expansionCaseStack.pop()},t.prototype._consumeExpansionFormEnd=function(){this._beginToken(za.EXPANSION_FORM_END,this._getLocation()),this._requireCharCode(Sa),this._endToken([]),this._expansionCaseStack.pop()},t.prototype._consumeText=function(){var t=this._getLocation();this._beginToken(za.TEXT,t);var e=[];do this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(e.push(this._interpolationConfig.start),this._inInterpolation=!0):this._interpolationConfig&&this._attemptStr(this._interpolationConfig.end)&&this._inInterpolation?(e.push(this._interpolationConfig.end),this._inInterpolation=!1):e.push(this._readChar(!0));while(!this._isTextEnd());this._endToken([this._processCarriageReturns(e.join(""))])},t.prototype._isTextEnd=function(){if(this._peek===Xs||this._peek===Ps)return!0;if(this._tokenizeIcu&&!this._inInterpolation){if(wt(this._input,this._index,this._interpolationConfig))return!0;if(this._peek===Sa&&this._isInExpansionCase())return!0}return!1},t.prototype._savePosition=function(){return[this._peek,this._index,this._column,this._line,this.tokens.length]},t.prototype._readUntil=function(t){var e=this._index;return this._attemptUntilChar(t),this._input.substring(e,this._index)},t.prototype._restorePosition=function(t){this._peek=t[0],this._index=t[1],this._column=t[2],this._line=t[3];var e=t[4];e0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===za.EXPANSION_CASE_EXP_START},t.prototype._isInExpansionForm=function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===za.EXPANSION_FORM_START},t}(),au=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},uu=function(t){function e(e,n,r){t.call(this,n,r),this.elementName=e}return au(e,t),e.create=function(t,n,r){return new e(t,n,r)},e}(Ga),cu=function(){function t(t,e){this.rootNodes=t,this.errors=e}return t}(),lu=function(){function t(t){this.getTagDefinition=t}return t.prototype.parse=function(t,e,n,r){void 0===n&&(n=!1),void 0===r&&(r=ka);var i=ft(t,e,this.getTagDefinition,n,r),o=new pu(i.tokens,this.getTagDefinition).build();return new cu(o.rootNodes,i.errors.concat(o.errors))},t}(),pu=function(){function t(t,e){this.tokens=t,this.getTagDefinition=e,this._index=-1,this._rootNodes=[],this._errors=[],this._elementStack=[],this._advance()}return t.prototype.build=function(){for(;this._peek.type!==za.EOF;)this._peek.type===za.TAG_OPEN_START?this._consumeStartTag(this._advance()):this._peek.type===za.TAG_CLOSE?this._consumeEndTag(this._advance()):this._peek.type===za.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===za.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===za.TEXT||this._peek.type===za.RAW_TEXT||this._peek.type===za.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===za.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._advance();return new cu(this._rootNodes,this._errors)},t.prototype._advance=function(){var t=this._peek;return this._index0)return this._errors=this._errors.concat(o.errors),null;var s=new Ha(e.sourceSpan.start,i.sourceSpan.end),a=new Ha(n.sourceSpan.start,i.sourceSpan.end);return new $a(e.parts[0],o.rootNodes,s,e.sourceSpan,a)},t.prototype._collectExpansionExpTokens=function(t){for(var e=[],n=[za.EXPANSION_CASE_EXP_START];;){if(this._peek.type!==za.EXPANSION_FORM_START&&this._peek.type!==za.EXPANSION_CASE_EXP_START||n.push(this._peek.type),this._peek.type===za.EXPANSION_CASE_EXP_END){if(!xt(n,za.EXPANSION_CASE_EXP_START))return this._errors.push(uu.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(n.pop(),0==n.length)return e}if(this._peek.type===za.EXPANSION_FORM_END){if(!xt(n,za.EXPANSION_FORM_START))return this._errors.push(uu.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;n.pop()}if(this._peek.type===za.EOF)return this._errors.push(uu.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;e.push(this._advance())}},t.prototype._consumeText=function(t){var e=t.parts[0];if(e.length>0&&"\n"==e[0]){var r=this._getParentElement();n(r)&&0==r.children.length&&this.getTagDefinition(r.name).ignoreFirstLf&&(e=e.substring(1))}e.length>0&&this._addToParent(new Wa(e,t.sourceSpan))},t.prototype._closeVoidElement=function(){if(this._elementStack.length>0){var t=ai.last(this._elementStack);this.getTagDefinition(t.name).isVoid&&this._elementStack.pop()}},t.prototype._consumeStartTag=function(t){for(var e=t.parts[0],n=t.parts[1],r=[];this._peek.type===za.ATTR_NAME;)r.push(this._consumeAttr(this._advance()));var i=this._getElementFullName(e,n,this._getParentElement()),o=!1;if(this._peek.type===za.TAG_OPEN_END_VOID){this._advance(),o=!0;var s=this.getTagDefinition(i);s.canSelfClose||null!==_(i)||s.isVoid||this._errors.push(uu.create(i,t.sourceSpan,'Only void and foreign elements can be self closed "'+t.parts[1]+'"'))}else this._peek.type===za.TAG_OPEN_END&&(this._advance(),o=!1);var a=this._peek.sourceSpan.start,u=new Ha(t.sourceSpan.start,a),c=new Xa(i,r,[],u,u,null);this._pushElement(c),o&&(this._popElement(i),c.endSourceSpan=u)},t.prototype._pushElement=function(t){if(this._elementStack.length>0){var e=ai.last(this._elementStack);this.getTagDefinition(e.name).isClosedByChild(t.name)&&this._elementStack.pop()}var r=this.getTagDefinition(t.name),i=this._getParentElementSkippingContainers(),o=i.parent,s=i.container;if(n(o)&&r.requireExtraParent(o.name)){var a=new Xa(r.parentToAdd,[],[],t.sourceSpan,t.startSourceSpan,t.endSourceSpan);this._insertBeforeContainer(o,s,a)}this._addToParent(t),this._elementStack.push(t)},t.prototype._consumeEndTag=function(t){var e=this._getElementFullName(t.parts[0],t.parts[1],this._getParentElement());this._getParentElement()&&(this._getParentElement().endSourceSpan=t.sourceSpan),this.getTagDefinition(e).isVoid?this._errors.push(uu.create(e,t.sourceSpan,'Void elements do not have end tags "'+t.parts[1]+'"')):this._popElement(e)||this._errors.push(uu.create(e,t.sourceSpan,'Unexpected closing tag "'+t.parts[1]+'"'))},t.prototype._popElement=function(t){for(var e=this._elementStack.length-1;e>=0;e--){var n=this._elementStack[e];if(n.name==t)return ai.splice(this._elementStack,e,this._elementStack.length-e),!0;if(!this.getTagDefinition(n.name).closedByParent)return!1}return!1},t.prototype._consumeAttr=function(t){var e=b(t.parts[0],t.parts[1]),n=t.sourceSpan.end,r="";if(this._peek.type===za.ATTR_VALUE){var i=this._advance();r=i.parts[0],n=i.sourceSpan.end}return new Ka(e,r,new Ha(t.sourceSpan.start,n))},t.prototype._getParentElement=function(){return this._elementStack.length>0?ai.last(this._elementStack):null},t.prototype._getParentElementSkippingContainers=function(){for(var t=null,e=this._elementStack.length-1;e>=0;e--){if("ng-container"!==this._elementStack[e].name)return{parent:this._elementStack[e],container:t};t=this._elementStack[e]}return{parent:ai.last(this._elementStack),container:t}},t.prototype._addToParent=function(t){var e=this._getParentElement();n(e)?e.children.push(t):this._rootNodes.push(t)},t.prototype._insertBeforeContainer=function(t,e,n){if(e){if(t){var r=t.children.indexOf(e);t.children[r]=n}else this._rootNodes.push(n);n.children.push(e),this._elementStack.splice(this._elementStack.indexOf(e),0,n)}else this._addToParent(n),this._elementStack.push(n)},t.prototype._getElementFullName=function(t,e,r){return i(t)&&(t=this.getTagDefinition(e).implicitNamespacePrefix,i(t)&&n(r)&&(t=_(r.name))),b(t,e)},t}(),hu=function(){function t(){}return t.prototype.visitText=function(t,e){return t.value},t.prototype.visitContainer=function(t,e){var n=this;return"["+t.children.map(function(t){return t.visit(n)}).join(", ")+"]"},t.prototype.visitIcu=function(t,e){var n=this,r=Object.keys(t.cases).map(function(e){return e+" {"+t.cases[e].visit(n)+"}"});return"{"+t.expression+", "+t.type+", "+r.join(", ")+"}"},t.prototype.visitTagPlaceholder=function(t,e){var n=this;return t.isVoid?'':''+t.children.map(function(t){return t.visit(n)}).join(", ")+''},t.prototype.visitPlaceholder=function(t,e){return''+t.value+""},t.prototype.visitIcuPlaceholder=function(t,e){return''+t.value.visit(this)+""},t}(),fu=new hu,du=function(){function t(t,e,n,r,i){this.nodes=t,this.placeholders=e,this.placeholderToMsgIds=n,this.meaning=r,this.description=i}return t}(),yu=function(){function t(t,e){this.value=t,this.sourceSpan=e}return t.prototype.visit=function(t,e){return t.visitText(this,e)},t}(),mu=function(){function t(t,e){this.children=t,this.sourceSpan=e}return t.prototype.visit=function(t,e){return t.visitContainer(this,e)},t}(),vu=function(){function t(t,e,n,r){this.expression=t,this.type=e,this.cases=n,this.sourceSpan=r}return t.prototype.visit=function(t,e){return t.visitIcu(this,e)},t}(),gu=function(){function t(t,e,n,r,i,o,s){this.tag=t,this.attrs=e,this.startName=n,this.closeName=r,this.children=i,this.isVoid=o,this.sourceSpan=s}return t.prototype.visit=function(t,e){return t.visitTagPlaceholder(this,e)},t}(),_u=function(){function t(t,e,n){void 0===e&&(e=""),this.value=t,this.name=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitPlaceholder(this,e)},t}(),bu=function(){function t(t,e,n){void 0===e&&(e=""),this.value=t,this.name=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitIcuPlaceholder(this,e)},t}(),wu={A:"LINK",B:"BOLD_TEXT",BR:"LINE_BREAK",EM:"EMPHASISED_TEXT",H1:"HEADING_LEVEL1",H2:"HEADING_LEVEL2",H3:"HEADING_LEVEL3",H4:"HEADING_LEVEL4",H5:"HEADING_LEVEL5",H6:"HEADING_LEVEL6",HR:"HORIZONTAL_RULE",I:"ITALIC_TEXT",LI:"LIST_ITEM",LINK:"MEDIA_LINK",OL:"ORDERED_LIST",P:"PARAGRAPH",Q:"QUOTATION",S:"STRIKETHROUGH_TEXT",SMALL:"SMALL_TEXT",SUB:"SUBSTRIPT",SUP:"SUPERSCRIPT",TBODY:"TABLE_BODY",TD:"TABLE_CELL",TFOOT:"TABLE_FOOTER",TH:"TABLE_HEADER_CELL",THEAD:"TABLE_HEADER",TR:"TABLE_ROW",TT:"MONOSPACED_TEXT",U:"UNDERLINED_TEXT",UL:"UNORDERED_LIST"},Eu=function(){function t(){this._placeHolderNameCounts={},this._signatureToName={}}return t.prototype.getStartTagPlaceholderName=function(t,e,n){var r=this._hashTag(t,e,n);if(this._signatureToName[r])return this._signatureToName[r];var i=t.toUpperCase(),o=wu[i]||"TAG_"+i,s=this._generateUniqueName(n?o:"START_"+o);return this._signatureToName[r]=s,s},t.prototype.getCloseTagPlaceholderName=function(t){var e=this._hashClosingTag(t);if(this._signatureToName[e])return this._signatureToName[e];var n=t.toUpperCase(),r=wu[n]||"TAG_"+n,i=this._generateUniqueName("CLOSE_"+r);return this._signatureToName[e]=i,i},t.prototype.getPlaceholderName=function(t,e){var n=t.toUpperCase(),r="PH: "+n+"="+e;if(this._signatureToName[r])return this._signatureToName[r];var i=this._generateUniqueName(n);return this._signatureToName[r]=i,i},t.prototype._hashTag=function(t,e,n){var r="<"+t,i=Object.keys(e).sort().map(function(t){return" "+t+"="+e[t]}).join(""),o=n?"/>":">";return r+i+o},t.prototype._hashClosingTag=function(t){return this._hashTag("/"+t,{},!1)},t.prototype._generateUniqueName=function(t){var e=t,n=this._placeHolderNameCounts[e];return n?(e+="_"+n,n++):n=1,this._placeHolderNameCounts[t]=n,e},t}(),Ou=new La(new Ia),Cu=function(){function t(t,e){this._expressionParser=t,this._interpolationConfig=e}return t.prototype.toI18nMessage=function(t,e,n){this._isIcu=1==t.length&&t[0]instanceof Ja,this._icuDepth=0,this._placeholderRegistry=new Eu,this._placeholderToContent={},this._placeholderToIds={};var r=ht(this,t,{});return new du(r,this._placeholderToContent,this._placeholderToIds,e,n)},t.prototype.visitElement=function(t,e){var n=ht(this,t.children),r={};t.attrs.forEach(function(t){r[t.name]=t.value});var i=w(t.name).isVoid,o=this._placeholderRegistry.getStartTagPlaceholderName(t.name,r,i);this._placeholderToContent[o]=t.sourceSpan.toString();var s="";return i||(s=this._placeholderRegistry.getCloseTagPlaceholderName(t.name),this._placeholderToContent[s]=""),new gu(t.name,r,o,s,n,i,t.sourceSpan)},t.prototype.visitAttribute=function(t,e){return this._visitTextWithInterpolation(t.value,t.sourceSpan)},t.prototype.visitText=function(t,e){return this._visitTextWithInterpolation(t.value,t.sourceSpan)},t.prototype.visitComment=function(t,e){return null},t.prototype.visitExpansion=function(e,n){var r=this;this._icuDepth++;var i={},o=new vu(e.switchValue,e.type,i,e.sourceSpan);if(e.cases.forEach(function(t){i[t.value]=new mu(t.expression.map(function(t){return t.visit(r,{})}),t.expSourceSpan)}),this._icuDepth--,this._isIcu||this._icuDepth>0)return o;var s=this._placeholderRegistry.getPlaceholderName("ICU",e.sourceSpan.toString()),a=new t(this._expressionParser,this._interpolationConfig);return this._placeholderToIds[s]=Pt(a.toI18nMessage([e],"","")),new bu(o,s,e.sourceSpan)},t.prototype.visitExpansionCase=function(t,e){throw new Error("Unreachable code")},t.prototype._visitTextWithInterpolation=function(t,e){var n=this._expressionParser.splitInterpolation(t,e.start.toString(),this._interpolationConfig);if(!n)return new yu(t,e);for(var r=[],i=new mu(r,e),o=this._interpolationConfig,s=o.start,a=o.end,u=0;u=n;i--){var o=this._messages[i].nodes;if(!(1==o.length&&o[0]instanceof yu)){this._messages.splice(i,1);break}}this._msgCountAtSectionStart=void 0},t.prototype._reportError=function(t,e){this._errors.push(new Pu(t.sourceSpan,e))},t}(),qu=function(){function t(t,e,n){this._htmlParser=t,this._implicitTags=e,this._implicitAttrs=n,this._messageMap={}}return t.prototype.updateFromTemplate=function(t,e,n){var r=this,i=this._htmlParser.parse(t,e,!0,n);if(i.errors.length)return i.errors;var o=Lt(i.rootNodes,n,this._implicitTags,this._implicitAttrs);return o.errors.length?o.errors:void o.messages.forEach(function(t){r._messageMap[Pt(t)]=t})},t.prototype.getMessageMap=function(){return this._messageMap},t.prototype.write=function(t){return t.write(this._messageMap)},t}(),Mu=function(){function t(){this.closedByParent=!1,this.contentType=ni.PARSABLE_DATA,this.isVoid=!1,this.ignoreFirstLf=!1,this.canSelfClose=!0}return t.prototype.requireExtraParent=function(t){return!1},t.prototype.isClosedByChild=function(t){return!1},t}(),ju=new Mu,Fu=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Du=function(t){function e(){t.call(this,zt)}return Fu(e,t),e.prototype.parse=function(e,n,r){return void 0===r&&(r=!1),t.prototype.parse.call(this,e,n,r,null)},e}(lu),Lu=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Vu=function(){function t(){}return t.prototype.visitTag=function(t){var e=this,n=this._serializeAttributes(t.attrs);if(0==t.children.length)return"<"+t.name+n+"/>";var r=t.children.map(function(t){return t.visit(e)});return"<"+t.name+n+">"+r.join("")+""},t.prototype.visitText=function(t){return t.value},t.prototype.visitDeclaration=function(t){return""},t.prototype._serializeAttributes=function(t){var e=Object.keys(t).map(function(e){return e+'="'+t[e]+'"'}).join(" ");return e.length>0?" "+e:""},t.prototype.visitDoctype=function(t){return""},t}(),Qu=new Vu,Uu=function(){function t(t){var e=this;this.attrs={},Object.keys(t).forEach(function(n){e.attrs[n]=$t(t[n])})}return t.prototype.visit=function(t){return t.visitDeclaration(this)},t}(),Bu=function(){function t(t,e){this.rootTag=t,this.dtd=e}return t.prototype.visit=function(t){return t.visitDoctype(this)},t}(),Hu=function(){function t(t,e,n){var r=this;void 0===e&&(e={}),void 0===n&&(n=[]),this.name=t,this.children=n,this.attrs={},Object.keys(e).forEach(function(t){r.attrs[t]=$t(e[t])})}return t.prototype.visit=function(t){return t.visitTag(this)},t}(),zu=function(){function t(t){this.value=$t(t)}return t.prototype.visit=function(t){return t.visitText(this)},t}(),Gu=function(t){function e(e){void 0===e&&(e=0),t.call(this,"\n"+new Array(e+1).join(" "))}return Lu(e,t),e}(zu),Wu=[[/&/g,"&"],[/"/g,"""],[/'/g,"'"],[//g,">"]],Ju="1.2",$u="urn:oasis:names:tc:xliff:document:1.2",Ku="en",Xu="x",Zu="source",Yu="target",tc="trans-unit",ec=function(){function t(t,e){this._htmlParser=t,this._interpolationConfig=e}return t.prototype.write=function(t){var e=new nc,n=[];Object.keys(t).forEach(function(r){var i=t[r],o=new Hu(tc,{id:r,datatype:"html"});o.children.push(new Gu(8),new Hu(Zu,{},e.serialize(i.nodes)),new Gu(8),new Hu(Yu)),i.description&&o.children.push(new Gu(8),new Hu("note",{priority:"1",from:"description"},[new zu(i.description)])),i.meaning&&o.children.push(new Gu(8),new Hu("note",{priority:"1",from:"meaning"},[new zu(i.meaning)])),o.children.push(new Gu(6)),n.push(new Gu(6),o)});var r=new Hu("body",{},n.concat([new Gu(4)])),i=new Hu("file",{"source-language":Ku,datatype:"plaintext",original:"ng2.template"},[new Gu(4),r,new Gu(2)]),o=new Hu("xliff",{version:Ju,xmlns:$u},[new Gu(2),i,new Gu]);return Jt([new Uu({version:"1.0",encoding:"UTF-8"}),new Gu,o,new Gu])},t.prototype.load=function(t,e,n){var r=this,i=(new Du).parse(t,e);if(i.errors.length)throw new Error("xtb parse errors:\n"+i.errors.join("\n"));var o=(new rc).parse(i.rootNodes,n),s=o.messages,a=o.errors;if(a.length)throw new Error("xtb parse errors:\n"+a.join("\n"));var u={},c=[];if(Object.keys(s).forEach(function(t){var n=r._htmlParser.parse(s[t],e,!0,r._interpolationConfig);c.push.apply(c,n.errors),u[t]=n.rootNodes}),c.length)throw new Error("xtb parse errors:\n"+c.join("\n"));return u},t}(),nc=function(){function t(){}return t.prototype.visitText=function(t,e){return[new zu(t.value)]},t.prototype.visitContainer=function(t,e){var n=this,r=[];return t.children.forEach(function(t){return r.push.apply(r,t.visit(n))}),r},t.prototype.visitIcu=function(t,e){if(this._isInIcu)throw new Error("xliff does not support nested ICU messages");this._isInIcu=!0;var n=[];return this._isInIcu=!1,n},t.prototype.visitTagPlaceholder=function(t,e){var n=Kt(t.tag),r=new Hu(Xu,{id:t.startName,ctype:n});if(t.isVoid)return[r];var i=new Hu(Xu,{id:t.closeName,ctype:n});return[r].concat(this.serialize(t.children),[i])},t.prototype.visitPlaceholder=function(t,e){return[new Hu(Xu,{id:t.name})]},t.prototype.visitIcuPlaceholder=function(t,e){return[new Hu(Xu,{id:t.name})]},t.prototype.serialize=function(t){var e=this;return this._isInIcu=!1,ai.flatten(t.map(function(t){return t.visit(e)}))},t}(),rc=function(){function t(){}return t.prototype.parse=function(t,e){var n=this;this._messageNodes=[],this._translatedMessages={},this._msgId="",this._target=[],this._errors=[],ht(this,t,null);var r=e.getMessageMap(),i=Gt(e),o=Wt(e);return this._messageNodes.filter(function(t){return r.hasOwnProperty(t[0])}).sort(function(t,e){return 0==Object.keys(r[t[0]].placeholderToMsgIds).length?-1:0==Object.keys(r[e[0]].placeholderToMsgIds).length?1:0}).forEach(function(t){var e=t[0];n._placeholders=i[e]||{},n._placeholderToIds=o[e]||{},n._translatedMessages[e]=ht(n,t[1]).join("")}),{messages:this._translatedMessages,errors:this._errors}},t.prototype.visitElement=function(t,e){switch(t.name){case tc:this._target=null;var n=t.attrs.find(function(t){return"id"===t.name});n?this._msgId=n.value:this._addError(t,"<"+tc+'> misses the "id" attribute'),ht(this,t.children,null),null!==this._msgId&&this._messageNodes.push([this._msgId,this._target]);break;case Zu:break;case Yu:this._target=t.children;break;case Xu:var r=t.attrs.find(function(t){return"id"===t.name});if(r){var i=r.value;if(this._placeholders.hasOwnProperty(i))return this._placeholders[i];if(this._placeholderToIds.hasOwnProperty(i)&&this._translatedMessages.hasOwnProperty(this._placeholderToIds[i]))return this._translatedMessages[this._placeholderToIds[i]];this._addError(t,'The placeholder "'+i+'" does not exists in the source message')}else this._addError(t,"<"+Xu+'> misses the "id" attribute');break;default:ht(this,t.children,null)}},t.prototype.visitAttribute=function(t,e){throw new Error("unreachable code")},t.prototype.visitText=function(t,e){return t.value},t.prototype.visitComment=function(t,e){return""},t.prototype.visitExpansion=function(t,e){throw new Error("unreachable code")},t.prototype.visitExpansionCase=function(t,e){throw new Error("unreachable code")},t.prototype._addError=function(t,e){this._errors.push(new Pu(t.sourceSpan,e))},t}(),ic="messagebundle",oc="msg",sc="ph",ac="ex",uc='\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n',cc=function(){ +function t(){this.queryList=this.queryList,this.removeArray=[],this.selector={field:"field-select",query:"query-select"},this.joiningQuery=[""],this.setDocSample=new o.EventEmitter,this.informationList={}}return t.prototype.ngOnInit=function(){this.querySelector=".query-"+this.queryIndex+"-"+this.internalIndex,this.allFields=this.result.resultQuery.availableFields.slice()},t.prototype.ngOnChanges=function(){var t=this;this.allFields=this.result.resultQuery.availableFields.slice(),this.querySelector=".query-"+this.queryIndex+"-"+this.internalIndex,setTimeout(function(){if(t.result.resultQuery.availableFields=t.checkAvailableFields(),t.query.selectedField){var e=t.getField(t.query.selectedField);e.length||t.removeQuery()}},300)},t.prototype.ngAfterViewInit=function(){this.informationList={match:this.matchQuery.information,match_phrase:this.match_phraseQuery.information,match_phrase_prefix:this.match_phase_prefixQuery.information,range:this.rangeQuery.information,gt:this.gtQuery.information,lt:this.ltQuery.information,term:this.termQuery.information,terms:this.termsQuery.information,exists:this.existsQuery.information,multi_match:this.multiMatchQuery.information,query_string:this.queryStringQuery.information,simple_query_string:this.simpleQueryStringQuery.information,missing:this.missingQuery.information,prefix:this.prefixQuery.information,wildcard:this.wildcardQuery.information,regexp:this.regexpQuery.information,fuzzy:this.fuzzyQuery.information,ids:this.idsQuery.information,common:this.commonQuery.information,geo_distance:this.geoDistanceQuery.information,geo_bounding_box:this.geoBoundingBoxQuery.information,geo_distance_range:this.geoDistanceRangeQuery.information,geo_polygon:this.geoPolygonQuery.information,geohash_cell:this.geoHashCellQuery.information,geo_shape:this.geoShapeQuery.information,span_term:this.spanTermQuery.information,span_first:this.spanFirstQuery.information}},t.prototype.checkAvailableFields=function(){var t=this.allFields,e=this.mapping[this.config.appname].mappings;if("nested"==this.joiningQuery[this.joiningQueryParam]){var n={};this.selectedTypes.forEach(function(t){Object.assign(n,e[t].properties)});var r=function(e){"nested"===n[e].type&&(t=t.filter(function(t){return t.name.indexOf(e+".")>-1}))};for(var i in n)r(i)}if("has_child"==this.joiningQuery[this.joiningQueryParam]){t=[];for(var o in e)if(e[o].hasOwnProperty("_parent")){var s=e[o].properties;for(var a in s){var u="undefined"!=typeof s[a].index?s[a].index:null,i={name:a,type:s[a].type,index:u};switch(i.type){case"long":case"integer":case"short":case"byte":case"double":case"float":case"date":i.type="numeric";break;case"text":case"keyword":i.type="string"}t.push(i)}}}return t},t.prototype.getQueryFormat=function(t){this.query.appliedQuery=t,this.buildQuery()},t.prototype.removeQuery=function(){this.internal.splice(this.internalIndex,1),this.buildQuery()},t.prototype.analyzeTest=function(t){$(t.selector).parents(".editable-pack").removeClass("on"),this.query.field=this.getField(t.val)[0],this.query.analyzeTest="not_analyzed"===this.query.field.index?"not_analyzed":"analyzed",this.query.type=this.query.field.type,this.query.selectedField=t.val},t.prototype.queryCallback=function(t){t.selector.parents(".editable-pack").removeClass("on"),this.query.query=t.val,this.query.selectedQuery=this.queryList[this.query.analyzeTest][this.query.type][this.query.query],this.buildQuery()},t.prototype.exeBuild=function(){var t=this;setTimeout(function(){return t.buildQuery()},300)},t.prototype.getField=function(t){return this.result.resultQuery.availableFields.filter(function(e){return e.name===t})},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"query",void 0),r([o.Input(),i("design:type",String)],t.prototype,"boolQueryName",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQueryParam",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),r([o.ViewChild(s.MatchQuery),i("design:type",s.MatchQuery)],t.prototype,"matchQuery",void 0),r([o.ViewChild(a.Match_phraseQuery),i("design:type",a.Match_phraseQuery)],t.prototype,"match_phraseQuery",void 0),r([o.ViewChild(u.Match_phase_prefixQuery),i("design:type",u.Match_phase_prefixQuery)],t.prototype,"match_phase_prefixQuery",void 0),r([o.ViewChild(c.RangeQuery),i("design:type",c.RangeQuery)],t.prototype,"rangeQuery",void 0),r([o.ViewChild(l.GtQuery),i("design:type",l.GtQuery)],t.prototype,"gtQuery",void 0),r([o.ViewChild(p.LtQuery),i("design:type",p.LtQuery)],t.prototype,"ltQuery",void 0),r([o.ViewChild(h.TermQuery),i("design:type",h.TermQuery)],t.prototype,"termQuery",void 0),r([o.ViewChild(d.TermsQuery),i("design:type",d.TermsQuery)],t.prototype,"termsQuery",void 0),r([o.ViewChild(y.PrefixQuery),i("design:type",y.PrefixQuery)],t.prototype,"prefixQuery",void 0),r([o.ViewChild(f.ExistsQuery),i("design:type",f.ExistsQuery)],t.prototype,"existsQuery",void 0),r([o.ViewChild(m.MultiMatchQuery),i("design:type",m.MultiMatchQuery)],t.prototype,"multiMatchQuery",void 0),r([o.ViewChild(v.QueryStringQuery),i("design:type",v.QueryStringQuery)],t.prototype,"queryStringQuery",void 0),r([o.ViewChild(g.SimpleQueryStringQuery),i("design:type",g.SimpleQueryStringQuery)],t.prototype,"simpleQueryStringQuery",void 0),r([o.ViewChild(_.MissingQuery),i("design:type",_.MissingQuery)],t.prototype,"missingQuery",void 0),r([o.ViewChild(b.WildcardQuery),i("design:type",b.WildcardQuery)],t.prototype,"wildcardQuery",void 0),r([o.ViewChild(w.RegexpQuery),i("design:type",w.RegexpQuery)],t.prototype,"regexpQuery",void 0),r([o.ViewChild(E.FuzzyQuery),i("design:type",E.FuzzyQuery)],t.prototype,"fuzzyQuery",void 0),r([o.ViewChild(O.IdsQuery),i("design:type",O.IdsQuery)],t.prototype,"idsQuery",void 0),r([o.ViewChild(C.CommonQuery),i("design:type",C.CommonQuery)],t.prototype,"commonQuery",void 0),r([o.ViewChild(S.GeoDistanceQuery),i("design:type",S.GeoDistanceQuery)],t.prototype,"geoDistanceQuery",void 0),r([o.ViewChild(x.GeoBoundingBoxQuery),i("design:type",x.GeoBoundingBoxQuery)],t.prototype,"geoBoundingBoxQuery",void 0),r([o.ViewChild(P.GeoDistanceRangeQuery),i("design:type",P.GeoDistanceRangeQuery)],t.prototype,"geoDistanceRangeQuery",void 0),r([o.ViewChild(T.GeoPolygonQuery),i("design:type",T.GeoPolygonQuery)],t.prototype,"geoPolygonQuery",void 0),r([o.ViewChild(N.GeoHashCellQuery),i("design:type",N.GeoHashCellQuery)],t.prototype,"geoHashCellQuery",void 0),r([o.ViewChild(k.GeoShapeQuery),i("design:type",k.GeoShapeQuery)],t.prototype,"geoShapeQuery",void 0),r([o.ViewChild(A.SpanTermQuery),i("design:type",A.SpanTermQuery)],t.prototype,"spanTermQuery",void 0),r([o.ViewChild(R.SpanFirstQuery),i("design:type",R.SpanFirstQuery)],t.prototype,"spanFirstQuery",void 0),t=r([o.Component({selector:"single-query",templateUrl:"./app/queryBlocks/singlequery/singlequery.component.html",inputs:["config","queryList","addQuery","internal","internalIndex","queryIndex","buildQuery","buildInsideQuery","buildSubQuery","createQuery","setQueryFormat","editorHookHelp","urlShare","setDocLink","setDocSample"]}),i("design:paramtypes",[])],t)}();n.SinglequeryComponent=I},{"./queries/common.query":20,"./queries/exists.query":21,"./queries/fuzzy.query":22,"./queries/geoboundingbox.query":23,"./queries/geodistance.query":24,"./queries/geodistancerange.query":25,"./queries/geohashcell.query":26,"./queries/geopolygon.query":27,"./queries/geoshape.query":28,"./queries/gt.query":29,"./queries/ids.query":30,"./queries/lt.query":31,"./queries/match.query":32,"./queries/match_phase_prefix.query":33,"./queries/match_phrase.query":34,"./queries/missing.query":35,"./queries/multi-match.query":36,"./queries/prefix.query":37,"./queries/query_string.query":38,"./queries/range.query":39,"./queries/regexp.query":40,"./queries/simple_query_string.query":41,"./queries/span_first.query":42,"./queries/span_term.query":43,"./queries/term.query":44,"./queries/terms.query":45,"./queries/wildcard.query":46,"@angular/core":62}],48:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.queryList=this.queryList,this.removeArray=[],this.query=this.query,this.allFields=[],this.distanceTypeList=["sloppy_arc","arc","plane"],this.informationList={min:{title:"min",content:'Pick the lowest value.'},max:{title:"max",content:'Pick the highest value.'},sum:{title:"sum",content:'Use the sum of all values as sort value. Only applicable for number based array fields.'},avg:{title:"avg",content:'Use the average of all values as sort value. Only applicable for number based array fields.'},median:{title:"median",content:'Use the median of all values as sort value. Only applicable for number based array fields.'}},this.optionalParamsInformation={mode:{title:"mode",content:'The mode option controls what array value is picked for sorting the document it belongs to.\n Read more'},missing:{title:"missing",content:'The missing parameter specifies how docs which are missing the field should be treated. The value can be set to _last, _first, or a custom value.\n Read more'},nested:{title:"nested",content:'Allows sorting withing nested objects\n Read more'},_geo_distance:{title:"_geo_distance",content:'Allow to sort by _geo_distance.\n Read more'}},this.distanceTypeInformation={sloppy_arc:{title:"sloppy_arc",content:'Default distance type'},arc:{title:"arc",content:'slightly more precise but significantly slower.'},plane:{title:"plane",content:'faster, but inaccurate on long distances and close to the poles.'}},this.joiningQuery=[""],this.setDocSample=new o.EventEmitter}return t.prototype.ngOnInit=function(){this.result.resultQuery.hasOwnProperty("availableFields")&&(this.allFields=this.result.resultQuery.availableFields.map(function(t){return t.name}))},t.prototype.ngOnChanges=function(){this.result.resultQuery.hasOwnProperty("availableFields")&&(this.allFields=this.result.resultQuery.availableFields.map(function(t){return t.name}))},t.prototype.exeBuild=function(){var t=this;setTimeout(function(){return t.buildQuery()},300)},t.prototype.initSort=function(){var t={selectedField:"",order:"asc",availableOptionalParams:[],modeList:[]};this.result.sort.push(t),this.exeBuild()},t.prototype.deleteSort=function(){this.result.sort=[],this.exeBuild()},t.prototype.sortFieldCallback=function(t){var e=this.result.sort[t.external],n=!1;e.selectedField=t.val,e.availableOptionalParams=[],e.mode||""==e.mode||e.availableOptionalParams.push("mode"),e.missing||""==e.missing||e.availableOptionalParams.push("missing"),this.result.resultQuery.availableFields.map(function(r){if(r.name===t.val)if("geo_point"===r.type){var i=e.availableOptionalParams.indexOf("missing");i>-1&&e.availableOptionalParams.splice(i,1),e.hasOwnProperty("missing")&&delete e.missing,n=!0,e.modeList=["min","max","avg","median"],e._geo_distance={distance_type:"sloppy_arc",lat:"",lon:"",unit:""}}else e.modeList=["min","max","sum","avg","median"]}),n||delete e._geo_distance,this.exeBuild()},t.prototype.sortModeCallback=function(t){this.result.sort[t.external].mode=t.val,this.exeBuild()},t.prototype.sortDistanceTypeCallback=function(t){this.result.sort[t.external]._geo_distance.distance_type=t.val,this.exeBuild()},t.prototype.sortOptionalCallback=function(t){var e=this.result.sort[t.external],n=e.availableOptionalParams.indexOf(t.val);n>-1&&e.availableOptionalParams.splice(n,1),e[t.val]=""},t.prototype.setSortOrder=function(t,e){this.result.sort[e].order=t,this.exeBuild()},t.prototype.removeSortQuery=function(t){this.result.sort.splice(t,1),this.exeBuild()},t.prototype.removeSortOptionalQuery=function(t,e){this.result.sort[t].availableOptionalParams.push(e),delete this.result.sort[t][e],this.exeBuild()},t.prototype.show_hidden_btns=function(t){$(".bool_query").removeClass("show_hidden"),$(t.currentTarget).addClass("show_hidden"),t.stopPropagation()},t.prototype.hide_hidden_btns=function(){$(".bool_query").removeClass("show_hidden")},t.prototype.setDocSampleEve=function(t){this.setDocSample.emit(t)},r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQuery",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"joiningQueryParam",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setDocSample",void 0),t=r([o.Component({selector:"sort-block",templateUrl:"./app/queryBlocks/sortBlock/sortBlock.component.html",inputs:["config","query","queryList","addQuery","removeQuery","addBoolQuery","queryFormat","buildQuery","buildInsideQuery","buildSubQuery","createQuery","setQueryFormat","editorHookHelp","urlShare","setDocSample"]}),i("design:paramtypes",[])],t)}();n.SortBlockComponent=s},{"@angular/core":62}],49:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.setProp=new o.EventEmitter,this.buildQuery=new o.EventEmitter}return t.prototype.ngOnChanges=function(t){if(t.detectChange&&this.types.length){var e=$("#setType");e.attr("class").indexOf("selec2")>-1&&e.select2("destroy").html(""),e.select2({placeholder:"Select types to apply query",tags:!1,data:this.createTokenData(this.types)}),e.on("change",function(t){this.changeType(e.val())}.bind(this))}},t.prototype.createTokenData=function(t){var e=[];return t.forEach(function(t){var n={id:t,text:t};e.push(n)}),e},t.prototype.changeType=function(t){function e(t,n){void 0===n&&(n=null);var i={};for(var o in t){if(i[o]=t[o],t[o].fields)for(var s in t[o].fields){var a=o+"."+s;a=n?n+"."+a:a,i[a]=t[o].fields[s]}if(t[o].properties){for(var s in t[o].properties){var a=o+"."+s;a=n?n+"."+a:a,i[a]=t[o].properties[s]}e.call(this,t[o].properties,o)}"nested"===t[o].type&&this.result.joiningQuery.indexOf("nested")<0&&this.result.joiningQuery.push("nested")}for(var u in i){var c="undefined"!=typeof i[u].index?i[u].index:null,l={name:u,type:i[u].type,index:c};switch(l.type){case"long":case"integer":case"short":case"byte":case"double":case"float":case"date":l.type="numeric";break;case"text":case"keyword":l.type="string"}r.push(l)}}var n,r=[],i=this.mapping[this.config.appname].mappings;this.result.joiningQuery=[""],t&&t.length?(t.forEach(function(t){var n=i[t].properties;e.call(this,n)}.bind(this)),this.setUrl(t),n={name:"selectedTypes",value:t},this.setProp.emit(n)):(n={name:"selectedTypes",value:[]},this.setProp.emit(n),this.setUrl([])),n={name:"availableFields",value:r},this.setProp.emit(n);for(var o in i)i[o].hasOwnProperty("_parent")&&t&&t.indexOf(i[o]._parent.type)>-1&&this.result.joiningQuery.indexOf("has_child")<0&&(this.result.joiningQuery.push("has_child"),this.result.joiningQuery.push("has_parent"),this.result.joiningQuery.push("parent_id"))},t.prototype.setUrl=function(t){var e=t;if(this.finalUrl){var n=this.finalUrl.split("/"),r="";if(n[3]=this.config.appname,n.length>4)n[4]=e.join(","),n[5]="_search",r=n.join("/");else{var i="/"+e.join(",");e.length||(i=""),r=this.finalUrl+i+"/_search"}var o={name:"finalUrl",value:r};this.setProp.emit(o)}else console.log("Finalurl is not present");setTimeout(function(){this.buildQuery.emit(null)}.bind(this),300)},r([o.Input(),i("design:type",Object)],t.prototype,"mapping",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"config",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"types",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"result",void 0),r([o.Input(),i("design:type",String)],t.prototype,"finalUrl",void 0),r([o.Input(),i("design:type",Object)],t.prototype,"urlShare",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"setProp",void 0),r([o.Output(),i("design:type",Object)],t.prototype,"buildQuery",void 0),t=r([o.Component({selector:"types",templateUrl:"./app/queryBlocks/types/types.component.html",inputs:["detectChange","setProp","buildQuery"]}),i("design:paramtypes",[])],t)}();n.TypesComponent=s},{"@angular/core":62}],50:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/platform-browser"),a=function(){function t(t){this.sanitizer=t,this.urlAvailable=!1,this.dejavuDomain="https://opensource.appbase.io/dejavu/live/"}return t.prototype.ngOnInit=function(){this.responseHookHelp.applyEditor({readOnly:!0})},t.prototype.ngOnChanges=function(t){if(t&&t.result_random_token){var e=t.result_random_token.previousValue,n=t.result_random_token.currentValue;if(n&&e!==n&&this.editorHookHelp){var r=this.editorHookHelp.getValue();if(r){console.log(this.selectedTypes),r=r.trim(),r=JSON.parse(r);var i={query:r,type:this.selectedTypes};this.url=this.sanitizeUrl(this.dejavuDomain),setTimeout(function(){var t=this.dejavuDomain+"#?input_state="+this.urlShare.url;t=t+"&hf=false&sidebar=false&subscribe=false&query="+JSON.stringify(i),this.url=this.sanitizeUrl(t),console.log(this.url)}.bind(this),300),this.urlAvailable=!0}}}},t.prototype.sanitizeUrl=function(t){return this.sanitizer.bypassSecurityTrustResourceUrl(t)},r([o.Input(),i("design:type",Object)],t.prototype,"selectedTypes",void 0),r([o.Input(),i("design:type",String)],t.prototype,"responseMode",void 0),t=r([o.Component({selector:"query-result",templateUrl:"./app/result/result.component.html",inputs:["mapping","config","editorHookHelp","urlShare","responseHookHelp","result_time_taken","result_random_token","types","result","config","responseHookHelp","result_time_taken"]}),i("design:paramtypes",[s.DomSanitizer])],t)}();n.ResultComponent=a},{"@angular/core":62,"@angular/platform-browser":66}],51:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("@angular/http");t("rxjs/add/operator/toPromise");var a=function(){function t(t){this.http=t,this.requestParam={url:null,auth:null},this.config={username:null,password:null},this.resultStream=null}return t.prototype.setAppbase=function(t){this.config.username=t.username,this.config.password=t.password,this.requestParam.pureurl=t.url,t.appname?this.requestParam.url=t.url+"/"+t.appname:this.requestParam.url=t.url;var e={url:"https://scalr.api.appbase.io",app:t.appname};t.username&&(e.credentials=t.username+":"+t.password,this.requestParam.auth="Basic "+btoa(t.username+":"+t.password)),this.appbaseRef=new Appbase(e)},t.prototype.get=function(t){var e={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(e.Authorization=this.requestParam.auth);var n=new s.Headers(e),r=this.requestParam.url.replace(this.config.username+":"+this.config.password+"@",""),i=r+t+"/";return this.http.get(i,{headers:n}).toPromise()},t.prototype.getMappings=function(){function t(t){var n={"Content-Type":"application/json;charset=UTF-8"};e.requestParam.auth&&(n.Authorization=e.requestParam.auth);var r=new s.Headers(n),i=e.requestParam.url.replace(e.config.username+":"+e.config.password+"@",""),o=i+t+"/";return console.log(o),e.http.get(o,{headers:r}).toPromise()}var e=this;return new Promise(function(e,n){t("/_mapping").then(function(n){var r=n.json();t("/_alias").then(function(t){var n=t.json();for(var i in n)for(var o in n[i].aliases)r[o]=r[i];e(r)})["catch"](function(t){e(r)})})["catch"](function(t){n(t)})})},t.prototype.getVersion=function(){var t={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(t.Authorization=this.requestParam.auth);var e=new s.Headers(t),n=this.requestParam.url.replace(this.config.username+":"+this.config.password+"@",""),r=n+"/_settings?human";return console.log(r),this.http.get(r,{headers:e}).toPromise()},t.prototype.post=function(t,e){var n=JSON.stringify(e),r={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(r.Authorization=this.requestParam.auth);var i=new s.Headers(r);return this.http.post(this.requestParam.url+t,n,{headers:i}).toPromise()},t.prototype.posturl=function(t,e){var n=JSON.stringify(e),r={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(r.Authorization=this.requestParam.auth);var i=new s.Headers(r);return this.http.post(t,n,{headers:i}).toPromise()},t.prototype.put=function(t,e){var n={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(n.Authorization=this.requestParam.auth);var r=new s.Headers(n);return this.http.put(this.requestParam.url+t,e,{headers:r}).toPromise()},t.prototype["delete"]=function(t){var e={"Content-Type":"application/json;charset=UTF-8"};this.requestParam.auth&&(e.Authorization=this.requestParam.auth);var n=new s.Headers(e);return this.http["delete"](this.requestParam.url+t,{headers:n}).toPromise()},t.prototype.handleError=function(t){console.error("An error occurred",t)},t.prototype.getIndices=function(t){var e=this.filterurl(t);return this.setAppbase(e),this.get("/_stats/indices")},t.prototype.filterurl=function(t){if(t){var e={username:null,password:null,url:t},n=t.split(":");try{e.username=n[1].replace("//","");var r=t.split("://");if(n[2]){var i=n[2].split("@");e.password=i[0],t.indexOf("@")!==-1&&(e.url=r[0]+"://"+i[1],n[3]&&(e.url+=":"+n[3]))}}catch(o){console.log(o)}return e}return null},t.prototype.searchStream=function(t,e){return this.resultStream&&this.resultStream.stop(),this.resultStream=this.appbaseRef.searchStream({type:t,body:e}),this.resultStream},t=r([o.Injectable(),i("design:paramtypes",[s.Http])],t)}();n.AppbaseService=a},{"@angular/core":62,"@angular/http":64,"rxjs/add/operator/toPromise":74}],52:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=t("rxjs/BehaviorSubject"),a=function(){function t(){this._navItemSource=new s.BehaviorSubject(""),this.navItem$=this._navItemSource.asObservable()}return t.prototype.emitNavChangeEvent=function(t){this._navItemSource.next(t)},t=r([o.Injectable(),i("design:paramtypes",[])],t)}();n.DocService=a},{"@angular/core":62,"rxjs/BehaviorSubject":67}],53:[function(t,e,n){"use strict";n.EditorHook=function(t){this.editorId=t.editorId,this.$editor="#"+t.editorId},n.EditorHook.prototype.applyEditor=function(t){var e=this;this.settings=t;var n={lineNumbers:!0,mode:"javascript",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,tabSize:2,extraKeys:{"Ctrl-Q":function(t){t.foldCode(t.getCursor())}},foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]},r=t?jQuery.extend(n,t):n;e.editor=CodeMirror.fromTextArea(document.getElementById(e.editorId),r)},n.EditorHook.prototype.setValue=function(t){this.editor&&this.editor.setValue&&this.editor.setValue(t)},n.EditorHook.prototype.focus=function(t){this.editor.toTextArea(),this.applyEditor(this.settings),this.setValue(t)},n.EditorHook.prototype.getValue=function(){return this.editor.getValue()},n.EditorHook.prototype.getInstance=function(){return this.editor},n.EditorHook.prototype.prepend=function(t){var e=t.split(/\r\n|\r|\n/).length;this.editor.replaceRange(t,{line:0,ch:0});for(var n=0;n=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){this.informationList={}}return t.prototype.setValue=function(t,e){this[t]=e,console.log(this.informationList)},t.prototype.getValue=function(t){return console.log(this),console.log(t,this[t]),this[t]},t=r([o.Injectable(),i("design:paramtypes",[])],t)}();n.GlobalShare=s},{"@angular/core":62}],55:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.transform=function(t){return JSON.stringify(t,null,4)},t=r([o.Pipe({name:"prettyJson"}),i("design:paramtypes",[])],t)}();n.prettyJson=s},{"@angular/core":62}],56:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.transform=function(t){return moment(t).fromNow(!0)},t=r([o.Pipe({name:"prettyTime"}),i("design:paramtypes",[])],t)}();n.prettyTime=s},{"@angular/core":62}],57:[function(t,e,n){"use strict";n.queryList={analyzed:{string:["match","match_phrase","term","terms","exists","missing","multi_match","query_string","prefix","wildcard","regexp","fuzzy","simple_query_string","match_phrase_prefix","ids","common","span_term","span_first"],numeric:["match","range","gt","lt","exists","missing","ids","common"],geo_point:["geo_distance","geo_distance_range","geo_bounding_box","geo_polygon","geohash_cell"],geo_shape:["geo_shape"]},not_analyzed:{string:["term","exists","terms","prefix"],numeric:["match","range","gt","lt"],geo_point:["geo_distance","geo_bounding_box","geo_distance_range","geo_polygon","geohash_cell"]},boolQuery:["must","must_not","should","filter"],allowedDataTypes:["string","text","keyword","date","numeric","geo_point","geo_shape"]}},{}],58:[function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=t("@angular/core"),s=function(){function t(){}return t.prototype.set=function(t,e){window.localStorage.setItem(t,e)},t.prototype.get=function(t){return window.localStorage.getItem(t)},t=r([o.Injectable(),i("design:paramtypes",[])],t)}();n.StorageService=s},{"@angular/core":62}],59:[function(t,e,n){"use strict";n.UrlShare=function(){this.secret="e",this.decryptedData={},this.inputs={},this.url=""},n.UrlShare.prototype.getInputs=function(){return this.inputs},n.UrlShare.prototype.setInputs=function(t){this.inputs=t,this.createUrl()},n.UrlShare.prototype.createUrl=function(){function t(t,e){if(!t){this.url=e,window.location.href.indexOf("#?default=true")>-1&&(window.location.href=window.location.href.split("?default=true")[0]);var n="#?input_state="+e;for(var r in this.queryParams)"input_state"!==r&&(console.log(r,this.queryParams[r]),n+="&"+r+"="+this.queryParams[r]);window.location.href=n}}this.inputs&&this.inputs.config&&(this.inputs.appname=this.inputs.config.appname,this.inputs.url=this.inputs.config.url),this.inputs.selectedTypes&&(this.inputs.selectedType=this.inputs.selectedTypes);var e=JSON.parse(JSON.stringify(this.inputs));try{delete e.result.resultQuery["final"],delete e.result.output}catch(n){}JSON.stringify(e);this.compress(e,t.bind(this))},n.UrlShare.prototype.decryptUrl=function(t){var e=this;return new Promise(function(t,n){if(e.queryParams=e.getQueryParameters(),e.queryParams.input_state)e.decompress(e.queryParams.input_state,function(e,n){n&&n.appname&&n.url&&(n.config={appname:n.appname,url:n.url}),n&&n.config&&(n.appname=n.config.appname,n.url=n.config.url),t({ +error:e,data:n})});else if(e.queryParams&&e.queryParams.app)try{var r=JSON.parse(e.queryParams.app),i={config:r};t({error:null,data:i})}catch(o){t({error:o})}else t({error:"Empty url"})})},n.UrlShare.prototype.convertToUrl=function(t){var e=this.url,n="";return n="gh-pages"==t?"appbaseio.github.io/mirage/#?input_state="+e:window.location.protocol+"//"+window.location.host+"#?input_state="+e},n.UrlShare.prototype.dejavuLink=function(){var t="http://appbaseio.github.io/dejavu/live/#?input_state="+this.url;return t},n.UrlShare.prototype.compress=function(t,e){if(!t)return e("Input should not be empty");var n=JSON.stringify(t);JSONURL.compress(n,9,function(t,n){try{var r=SafeEncode.buffer(t);e(null,SafeEncode.encode(r))}catch(i){e(i)}})},n.UrlShare.prototype.decompress=function(t,e){var n=this;if(!t)return e("Empty");var r=SafeEncode.buffer(t);JSONURL.decompress(SafeEncode.decode(r),function(t,r){var i=t;try{i?(i=JSON.parse(i),n.decryptedData=i,e(null,i)):e("Not found")}catch(o){e(o)}})},n.UrlShare.prototype.getQueryParameters=function(t){var e=decodeURIComponent(window.location.href),n=e.split("#");return n.length>1?(t||n[1]).replace(/(^\?)/,"").split("&").map(function(t){return t=t.split("="),this[t[0]]=t[1],this}.bind({}))[0]:null}},{}],60:[function(t,e,n){(function(r){!function(r,i){"object"==typeof n&&"undefined"!=typeof e?i(n,t("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],i):i((r.ng=r.ng||{},r.ng.common=r.ng.common||{}),r.ng.core)}(this,function(t,e){"use strict";function n(t){return t.name||typeof t}function i(t){return void 0!==t&&null!==t}function o(t){return void 0===t||null===t}function s(t){return"object"==typeof t&&null!==t}function a(t){return Array.isArray(t)}function u(t){return t instanceof Date&&!isNaN(t.valueOf())}function c(t){if("string"==typeof t)return t;if(void 0===t||null===t)return""+t;if(t.overriddenName)return t.overriddenName;if(t.name)return t.name;var e=t.toString(),n=e.indexOf("\n");return n===-1?e:e.substring(0,n)}function l(t){return null!==t&&("function"==typeof t||"object"==typeof t)}function p(){if(o(L))if(i(A.Symbol)&&i(Symbol.iterator))L=Symbol.iterator;else for(var t=Object.getOwnPropertyNames(Map.prototype),e=0;e0&&e.startsWith(t)?e.substring(t.length):e}function f(t){return/\/index.html$/g.test(t)?t.substring(0,t.length-11):t}function d(t,e,n){var r="="+t;return e.indexOf(r)>-1?r:n.getPluralCategory(t)}function y(t,e){"string"==typeof e&&(e=parseInt(e,10));var n=e,r=n.toString().replace(/^[^.]*\.?/,""),i=Math.floor(Math.abs(n)),o=r.length,s=parseInt(r,10),a=parseInt(n.toString().replace(/^[^.]*\.?|0+$/g,""),10)||0,u=t.split("-")[0].toLowerCase();switch(u){case"af":case"asa":case"az":case"bem":case"bez":case"bg":case"brx":case"ce":case"cgg":case"chr":case"ckb":case"ee":case"el":case"eo":case"es":case"eu":case"fo":case"fur":case"gsw":case"ha":case"haw":case"hu":case"jgo":case"jmc":case"ka":case"kk":case"kkj":case"kl":case"ks":case"ksb":case"ky":case"lb":case"lg":case"mas":case"mgo":case"ml":case"mn":case"nb":case"nd":case"ne":case"nn":case"nnh":case"nyn":case"om":case"or":case"os":case"ps":case"rm":case"rof":case"rwk":case"saq":case"seh":case"sn":case"so":case"sq":case"ta":case"te":case"teo":case"tk":case"tr":case"ug":case"uz":case"vo":case"vun":case"wae":case"xog":return 1===n?j.One:j.Other;case"agq":case"bas":case"cu":case"dav":case"dje":case"dua":case"dyo":case"ebu":case"ewo":case"guz":case"kam":case"khq":case"ki":case"kln":case"kok":case"ksf":case"lrc":case"lu":case"luo":case"luy":case"mer":case"mfe":case"mgh":case"mua":case"mzn":case"nmg":case"nus":case"qu":case"rn":case"rw":case"sbp":case"twq":case"vai":case"yav":case"yue":case"zgh":case"ak":case"ln":case"mg":case"pa":case"ti":return n===Math.floor(n)&&n>=0&&n<=1?j.One:j.Other;case"am":case"as":case"bn":case"fa":case"gu":case"hi":case"kn":case"mr":case"zu":return 0===i||1===n?j.One:j.Other;case"ar":return 0===n?j.Zero:1===n?j.One:2===n?j.Two:n%100===Math.floor(n%100)&&n%100>=3&&n%100<=10?j.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=99?j.Many:j.Other;case"ast":case"ca":case"de":case"en":case"et":case"fi":case"fy":case"gl":case"it":case"nl":case"sv":case"sw":case"ur":case"yi":return 1===i&&0===o?j.One:j.Other;case"be":return n%10===1&&n%100!==11?j.One:n%10===Math.floor(n%10)&&n%10>=2&&n%10<=4&&!(n%100>=12&&n%100<=14)?j.Few:n%10===0||n%10===Math.floor(n%10)&&n%10>=5&&n%10<=9||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=14?j.Many:j.Other;case"br":return n%10===1&&n%100!==11&&n%100!==71&&n%100!==91?j.One:n%10===2&&n%100!==12&&n%100!==72&&n%100!==92?j.Two:n%10===Math.floor(n%10)&&(n%10>=3&&n%10<=4||n%10===9)&&!(n%100>=10&&n%100<=19||n%100>=70&&n%100<=79||n%100>=90&&n%100<=99)?j.Few:0!==n&&n%1e6===0?j.Many:j.Other;case"bs":case"hr":case"sr":return 0===o&&i%10===1&&i%100!==11||s%10===1&&s%100!==11?j.One:0===o&&i%10===Math.floor(i%10)&&i%10>=2&&i%10<=4&&!(i%100>=12&&i%100<=14)||s%10===Math.floor(s%10)&&s%10>=2&&s%10<=4&&!(s%100>=12&&s%100<=14)?j.Few:j.Other;case"cs":case"sk":return 1===i&&0===o?j.One:i===Math.floor(i)&&i>=2&&i<=4&&0===o?j.Few:0!==o?j.Many:j.Other;case"cy":return 0===n?j.Zero:1===n?j.One:2===n?j.Two:3===n?j.Few:6===n?j.Many:j.Other;case"da":return 1===n||0!==a&&(0===i||1===i)?j.One:j.Other;case"dsb":case"hsb":return 0===o&&i%100===1||s%100===1?j.One:0===o&&i%100===2||s%100===2?j.Two:0===o&&i%100===Math.floor(i%100)&&i%100>=3&&i%100<=4||s%100===Math.floor(s%100)&&s%100>=3&&s%100<=4?j.Few:j.Other;case"ff":case"fr":case"hy":case"kab":return 0===i||1===i?j.One:j.Other;case"fil":return 0===o&&(1===i||2===i||3===i)||0===o&&i%10!==4&&i%10!==6&&i%10!==9||0!==o&&s%10!==4&&s%10!==6&&s%10!==9?j.One:j.Other;case"ga":return 1===n?j.One:2===n?j.Two:n===Math.floor(n)&&n>=3&&n<=6?j.Few:n===Math.floor(n)&&n>=7&&n<=10?j.Many:j.Other;case"gd":return 1===n||11===n?j.One:2===n||12===n?j.Two:n===Math.floor(n)&&(n>=3&&n<=10||n>=13&&n<=19)?j.Few:j.Other;case"gv":return 0===o&&i%10===1?j.One:0===o&&i%10===2?j.Two:0!==o||i%100!==0&&i%100!==20&&i%100!==40&&i%100!==60&&i%100!==80?0!==o?j.Many:j.Other:j.Few;case"he":return 1===i&&0===o?j.One:2===i&&0===o?j.Two:0!==o||n>=0&&n<=10||n%10!==0?j.Other:j.Many;case"is":return 0===a&&i%10===1&&i%100!==11||0!==a?j.One:j.Other;case"ksh":return 0===n?j.Zero:1===n?j.One:j.Other;case"kw":case"naq":case"se":case"smn":return 1===n?j.One:2===n?j.Two:j.Other;case"lag":return 0===n?j.Zero:0!==i&&1!==i||0===n?j.Other:j.One;case"lt":return n%10!==1||n%100>=11&&n%100<=19?n%10===Math.floor(n%10)&&n%10>=2&&n%10<=9&&!(n%100>=11&&n%100<=19)?j.Few:0!==s?j.Many:j.Other:j.One;case"lv":case"prg":return n%10===0||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19||2===o&&s%100===Math.floor(s%100)&&s%100>=11&&s%100<=19?j.Zero:n%10===1&&n%100!==11||2===o&&s%10===1&&s%100!==11||2!==o&&s%10===1?j.One:j.Other;case"mk":return 0===o&&i%10===1||s%10===1?j.One:j.Other;case"mt":return 1===n?j.One:0===n||n%100===Math.floor(n%100)&&n%100>=2&&n%100<=10?j.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19?j.Many:j.Other;case"pl":return 1===i&&0===o?j.One:0===o&&i%10===Math.floor(i%10)&&i%10>=2&&i%10<=4&&!(i%100>=12&&i%100<=14)?j.Few:0===o&&1!==i&&i%10===Math.floor(i%10)&&i%10>=0&&i%10<=1||0===o&&i%10===Math.floor(i%10)&&i%10>=5&&i%10<=9||0===o&&i%100===Math.floor(i%100)&&i%100>=12&&i%100<=14?j.Many:j.Other;case"pt":return n===Math.floor(n)&&n>=0&&n<=2&&2!==n?j.One:j.Other;case"ro":return 1===i&&0===o?j.One:0!==o||0===n||1!==n&&n%100===Math.floor(n%100)&&n%100>=1&&n%100<=19?j.Few:j.Other;case"ru":case"uk":return 0===o&&i%10===1&&i%100!==11?j.One:0===o&&i%10===Math.floor(i%10)&&i%10>=2&&i%10<=4&&!(i%100>=12&&i%100<=14)?j.Few:0===o&&i%10===0||0===o&&i%10===Math.floor(i%10)&&i%10>=5&&i%10<=9||0===o&&i%100===Math.floor(i%100)&&i%100>=11&&i%100<=14?j.Many:j.Other;case"shi":return 0===i||1===n?j.One:n===Math.floor(n)&&n>=2&&n<=10?j.Few:j.Other;case"si":return 0===n||1===n||0===i&&1===s?j.One:j.Other;case"sl":return 0===o&&i%100===1?j.One:0===o&&i%100===2?j.Two:0===o&&i%100===Math.floor(i%100)&&i%100>=3&&i%100<=4||0!==o?j.Few:j.Other;case"tzm":return n===Math.floor(n)&&n>=0&&n<=1||n===Math.floor(n)&&n>=11&&n<=99?j.One:j.Other;default:return j.Other}}function m(t,e){if(i(t))for(var n=0;n0&&!t.startsWith("/")&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)},t.prototype.go=function(t,e){void 0===e&&(e=""),this._platformStrategy.pushState(null,"",t,e)},t.prototype.replaceState=function(t,e){void 0===e&&(e=""),this._platformStrategy.replaceState(null,"",t,e)},t.prototype.forward=function(){this._platformStrategy.forward()},t.prototype.back=function(){this._platformStrategy.back()},t.prototype.subscribe=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),this._subject.subscribe({next:t,error:e,complete:n})},t.normalizeQueryParams=function(t){return t.length>0&&"?"!=t.substring(0,1)?"?"+t:t},t.joinWithSlash=function(t,e){if(0==t.length)return e;if(0==e.length)return t;var n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e},t.stripTrailingSlash=function(t){return/\/$/g.test(t)&&(t=t.substring(0,t.length-1)),t},t.decorators=[{type:e.Injectable}],t.ctorParameters=[{type:I}],t}(),Q=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},U=function(t){function n(e,n){t.call(this),this._platformLocation=e,this._baseHref="",i(n)&&(this._baseHref=n)}return Q(n,t),n.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},n.prototype.getBaseHref=function(){return this._baseHref},n.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.hash;return i(e)||(e="#"),e.length>0?e.substring(1):e},n.prototype.prepareExternalUrl=function(t){var e=V.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e},n.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+V.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(t,e,i)},n.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+V.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,i)},n.prototype.forward=function(){this._platformLocation.forward()},n.prototype.back=function(){this._platformLocation.back()},n.decorators=[{type:e.Injectable}],n.ctorParameters=[{type:R},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[q]}]}],n}(I),B=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},H=function(t){function n(e,n){if(t.call(this),this._platformLocation=e,o(n)&&(n=this._platformLocation.getBaseHrefFromDOM()),o(n))throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=n}return B(n,t),n.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},n.prototype.getBaseHref=function(){return this._baseHref},n.prototype.prepareExternalUrl=function(t){return V.joinWithSlash(this._baseHref,t)},n.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.pathname+V.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?""+e+n:e},n.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+V.normalizeQueryParams(r));this._platformLocation.pushState(t,e,i)},n.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+V.normalizeQueryParams(r));this._platformLocation.replaceState(t,e,i)},n.prototype.forward=function(){this._platformLocation.forward()},n.prototype.back=function(){this._platformLocation.back()},n.decorators=[{type:e.Injectable}],n.ctorParameters=[{type:R},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[q]}]}],n}(I),z=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},G=function(){function t(){}return t}(),W=function(t){function n(e){t.call(this),this._locale=e}return z(n,t),n.prototype.getPluralCategory=function(t){var e=y(this._locale,t);switch(e){case j.Zero:return"zero";case j.One:return"one";case j.Two:return"two";case j.Few:return"few";case j.Many:return"many";default:return"other"}},n.decorators=[{type:e.Injectable}],n.ctorParameters=[{type:void 0,decorators:[{type:e.Inject,args:[e.LOCALE_ID]}]}],n}(G);!function(t){t[t.Zero=0]="Zero",t[t.One=1]="One",t[t.Two=2]="Two",t[t.Few=3]="Few",t[t.Many=4]="Many",t[t.Other=5]="Other"}(j||(j={}));var J,$=(function(){return(new Map).keys().next?function(t){for(var e,n=t.keys();!(e=n.next()).done;)t.set(e.value,null)}:function(t){t.forEach(function(e,n){t.set(n,null)})}}(),function(){try{if((new Map).values().next)return function(t,e){return e?Array.from(t.values()):Array.from(t.keys())}}catch(t){}return function(t,e){var n=new Array(t.size),r=0;return t.forEach(function(t,i){n[r]=e?t:i,r++}),n}}(),function(){function t(){}return t.createFixedSize=function(t){return new Array(t)},t.createGrowableSize=function(t){return new Array(t)},t.clone=function(t){return t.slice(0)},t.forEachWithIndex=function(t,e){for(var n=0;n-1&&(t.splice(n,1),!0)},t.clear=function(t){t.length=0},t.isEmpty=function(t){return 0==t.length},t.fill=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=null),t.fill(e,n,null===r?t.length:r)},t.equals=function(t,e){if(t.length!=e.length)return!1;for(var n=0;nr&&(n=s,r=a)}}return n},t.flatten=function(t){var e=[];return m(t,e),e},t.addAll=function(t,e){for(var n=0;n=Ts&&t<=Is||t==xa}function G(t){return ea<=t&&t<=na}function W(t){return t>=fa&&t<=Ea||t>=ra&&t<=aa}function J(t){return t>=fa&&t<=ya||t>=ra&&t<=oa||G(t)}function $(t,n){if(e.isDevMode()&&!i(n)){if(!u(n))throw new Error("Expected '"+t+"' to be an array of strings.");for(var r=0;r;" or "&#x;" syntax'}function mt(t){return!z(t)||t===Ps}function vt(t){return z(t)||t===Ys||t===Js||t===Vs||t===Ms||t===Zs}function gt(t){return(tna)}function _t(t){return t==Ks||t==Ps||!J(t)}function bt(t){return t==Ks||t==Ps||!W(t)}function wt(t,e,n){var r=!!n&&t.indexOf(n.start,e)==e;return t.charCodeAt(e)==Oa&&!r}function Et(t){return t===Zs||W(t)}function Ot(t,e){return Ct(t)==Ct(e)}function Ct(t){return t>=fa&&t<=Ea?t-fa+ra:t}function St(t){for(var e,n=[],r=0;r0&&t[t.length-1]===e}function Pt(t){return Nt(Tt(t.nodes).join("")+("["+t.meaning+"]"))}function Tt(t){return t.map(function(t){return t.visit(fu,null)})}function Nt(t){var e=kt(t),n=Rt(e),r=8*e.length,i=new Array(80),o=[1732584193,4023233417,2562383102,271733878,3285377520],s=o[0],a=o[1],u=o[2],c=o[3],l=o[4];n[r>>5]|=128<<24-r%32,n[(r+64>>9<<4)+15]=r;for(var p=0;p>>4&15).toString(16)+(15&S).toString(16)}return C.toLowerCase();var x,P}function kt(t){for(var e="",n=0;n>>6,128|63&r):r<=65535?e+=String.fromCharCode(224|r>>>12,128|r>>>6&63,128|63&r):r<=2097151&&(e+=String.fromCharCode(240|r>>>18,128|r>>>12&63,128|r>>>6&63,128|63&r))}return e}function At(t,e){if(e<0||e>=t.length)throw new Error("index="+e+' is out of range in "'+t+'"');var n,r=t.charCodeAt(e);return r>=55296&&r<=57343&&t.length>e+1&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?1024*(r-55296)+n-56320+65536:r}function Rt(t){for(var e=Array(t.length>>>2),n=0;n>>2]|=(255&t.charCodeAt(n))<<8*(3-n&3);return e}function It(t){for(var e="",n=0;n<4*t.length;n++)e+=String.fromCharCode(t[n>>>2]>>>8*(3-n&3)&255);return e}function qt(t,e,n,r){return t<20?[e&n|~e&r,1518500249]:t<40?[e^n^r,1859775393]:t<60?[e&n|e&r|n&r,2400959708]:[e^n^r,3395469782]}function Mt(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n}function jt(t,e){return t<>>32-e}function Ft(t){var e=new Cu(Ou,t);return function(t,n,r){return e.toI18nMessage(t,n,r)}}function Dt(t){return t.split(Su)[1]}function Lt(t,e,n,r){var i=new Iu(n,r);return i.extract(t,e)}function Vt(t,e,n,r,i){var o=new Iu(r,i);return o.merge(t,e,n)}function Qt(t){return t instanceof Za&&t.value&&t.value.startsWith("i18n")}function Ut(t){return t instanceof Za&&t.value&&"/i18n"===t.value}function Bt(t){return t.attrs.find(function(t){return t.name===Tu})||null}function Ht(t){if(!t)return["",""];var e=t.indexOf("|");return e==-1?["",t]:[t.slice(0,e),t.slice(e+1)]}function zt(t){return ju}function Gt(t){var e=t.getMessageMap(),n={};return Object.keys(e).forEach(function(t){n[t]=e[t].placeholders}),n}function Wt(t){var e=t.getMessageMap(),n={};return Object.keys(e).forEach(function(t){n[t]=e[t].placeholderToMsgIds}),n}function Jt(t){return t.map(function(t){return t.visit(Qu)}).join("")}function $t(t){return Wu.reduce(function(t,e){return t.replace(e[0],e[1])},t)}function Kt(t){switch(t.toLowerCase()){case"br":return"lb";case"img":return"image";default:return"x-"+t}}function Xt(t){return new Vo({name:t.name,moduleUrl:t.moduleUrl,reference:el.resolveIdentifier(t.name,t.moduleUrl,t.runtime)})}function Zt(t){return new Ho({identifier:t})}function Yt(t){return Zt(Xt(t))}function te(t,e){var n=el.resolveEnum(t.reference,e);return new Vo({name:t.name+"."+e,moduleUrl:t.moduleUrl,reference:n})}function ee(t){var e=new kl;return new Tl(ht(e,t),e.isExpanded,e.errors)}function ne(t,e){var n=t.cases.map(function(t){Pl.indexOf(t.value)!=-1||t.value.match(/^=\d+$/)||e.push(new Nl(t.valueSourceSpan,'Plural cases should be "=" or one of '+Pl.join(", ")));var n=ee(t.expression);return e.push.apply(e,n.errors),new Xa("template",[new Ka("ngPluralCase",""+t.value,t.valueSourceSpan)],n.nodes,t.sourceSpan,t.sourceSpan,t.sourceSpan)}),r=new Ka("[ngPlural]",t.switchValue,t.switchValueSourceSpan);return new Xa("ng-container",[r],n,t.sourceSpan,t.sourceSpan,t.sourceSpan)}function re(t,e){var n=t.cases.map(function(t){var n=ee(t.expression);return e.push.apply(e,n.errors),new Xa("template",[new Ka("ngSwitchCase",""+t.value,t.valueSourceSpan)],n.nodes,t.sourceSpan,t.sourceSpan,t.sourceSpan)}),r=new Ka("[ngSwitch]",t.switchValue,t.switchValueSourceSpan);return new Xa("ng-container",[r],n,t.sourceSpan,t.sourceSpan,t.sourceSpan)}function ie(t,e){var n=e.useExisting,r=e.useValue,i=e.deps;return new Uo({token:t.token,useClass:t.useClass,useExisting:n,useFactory:t.useFactory,useValue:r,deps:i,multi:t.multi})}function oe(t,e){var n=e.eager,r=e.providers;return new ti(t.token,t.multiProvider,t.eager||n,r,t.providerType,t.lifecycleHooks,t.sourceSpan)}function se(t,e,r,i){return void 0===i&&(i=null),i||(i=[]),n(t)&&t.forEach(function(t){if(u(t))se(t,e,r,i);else{var o=void 0;t instanceof Uo?o=t:t instanceof zo?o=new Uo({token:new Ho({identifier:t}),useClass:t}):r.push(new Rl("Unknown provider type "+t,e)),n(o)&&i.push(o)}}),i}function ae(e,n,r){var i=new Map;e.forEach(function(e){var o=new Uo({token:new Ho({identifier:e.type}),useClass:e.type});ue([o],e.isComponent?t.ProviderAstType.Component:t.ProviderAstType.Directive,!0,n,r,i)});var o=e.filter(function(t){return t.isComponent}).concat(e.filter(function(t){return!t.isComponent}));return o.forEach(function(e){ue(se(e.providers,n,r),t.ProviderAstType.PublicService,!1,n,r,i),ue(se(e.viewProviders,n,r),t.ProviderAstType.PrivateService,!1,n,r,i)}),i}function ue(t,e,r,i,o,s){t.forEach(function(t){var a=s.get(t.token.reference);if(n(a)&&a.multiProvider!==t.multi&&o.push(new Rl("Mixing multi and non multi provider is not possible for token "+a.token.name,i)),a)t.multi||ai.clear(a.providers),a.providers.push(t);else{var u=t.token.identifier&&t.token.identifier instanceof zo?t.token.identifier.lifecycleHooks:[];a=new ti(t.token,t.multi,r||u.length>0,[t],e,u,i),s.set(t.token.reference,a)}})}function ce(t){var e=new Map;return n(t.viewQueries)&&t.viewQueries.forEach(function(t){return pe(e,t)}),t.type.diDeps.forEach(function(t){n(t.viewQuery)&&pe(e,t.viewQuery)}),e}function le(t){var e=new Map;return t.forEach(function(t){n(t.queries)&&t.queries.forEach(function(t){return pe(e,t)}),t.type.diDeps.forEach(function(t){n(t.query)&&pe(e,t.query)})}),e}function pe(t,e){e.selectors.forEach(function(n){var r=t.get(n.reference);r||(r=[],t.set(n.reference,r)),r.push(e)})}function he(t){if(i(t)||0===t.length||"/"==t[0])return!1;var e=t.match(Ll);return null===e||"package"==e[1]||"asset"==e[1]}function fe(t,e,r){var i=[],o=Vr.replaceAllMapped(r,Dl,function(r){var o=n(r[1])?r[1]:r[2];return he(o)?(i.push(t.resolve(e,o)),""):r[0]});return new Fl(o,i)}function de(t){var e=null,n=null,r=null,i=!1,o=null;t.attrs.forEach(function(t){var s=t.name.toLowerCase();s==Vl?e=t.value:s==Hl?n=t.value:s==Bl?r=t.value:t.name==Jl?i=!0:t.name==$l&&t.value.length>0&&(o=t.value)}),e=ye(e);var s=t.name.toLowerCase(),a=Ru.OTHER;return g(s)[1]==Ql?a=Ru.NG_CONTENT:s==Gl?a=Ru.STYLE:s==Wl?a=Ru.SCRIPT:s==Ul&&r==zl&&(a=Ru.STYLESHEET),new Xl(a,e,n,i,o)}function ye(t){return null===t||0===t.length?"*":t}function me(t){return t.trim().split(/\s+/g)}function ve(t,e){var n=new di,r=g(t)[1];n.setElement(r);for(var i=0;i0&&2==t.keyframes.length){var e=Ee(t.keyframes[0])[0],n=Ee(t.keyframes[1])[0];return 0===Object.keys(e).length&&0===Object.keys(n).length}return!1}function Ee(t){return t.styles.styles}function Oe(t,e){var n=[];t.styles.styles.forEach(function(t){s(t)?n.push(t):e.push(new gh("State based animations cannot contain references to other states"))});var r=new Bp(n),i=t.stateNameExpr.split(/\s*,\s*/);return i.map(function(t){return new Lp(t,r)})}function Ce(t,e,n){var r=new fh,i=[],o=t.stateChangeExpr.split(/\s*,\s*/);o.forEach(function(t){Se(t,n).forEach(function(t){i.push(t)})});var s=xe(t.steps),a=Te(s,e,n),u=Ie(a,0,r,e,n);0==n.length&&qe(u,r,n);var c=u instanceof zp?u:new Wp([u]);return new Qp(i,c)}function Se(t,e){var r=[],i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(!n(i)||i.length<4)return e.push(new gh("the provided "+t+" is not of a supported format")),r;var o=i[1],s=i[2],a=i[3];r.push(new Vp(o,a));var u=o==cl&&a==cl;return"<"!=s[0]||u||r.push(new Vp(a,o)),r}function xe(t){return u(t)?new Do(t):t}function Pe(t,e,n){var r=[];return t.styles.forEach(function(t){o(t)?ai.addAll(r,Ae(t,e,n)):r.push(t)}),r}function Te(t,e,n){var r=ke(t,e,n);return t instanceof Lo?new Lo(r):new Do(r)}function Ne(t,e){if(s(e)&&t.length>0){var n=t.length-1,r=t[n];if(s(r))return void(t[n]=si.merge(r,e))}t.push(e)}function ke(t,e,r){var i;if(!(t instanceof Fo))return[t];i=t.steps;var o,s=[];return i.forEach(function(t){if(t instanceof Mo)n(o)||(o=[]),Pe(t,e,r).forEach(function(t){Ne(o,t)});else{if(n(o)&&(s.push(new Mo(0,o)),o=null),t instanceof jo){var i=t.styles;i instanceof Mo?i.styles=Pe(i,e,r):i instanceof qo&&i.steps.forEach(function(t){t.styles=Pe(t,e,r)})}else if(t instanceof Fo){var a=ke(t,e,r);t=t instanceof Lo?new Lo(a):new Do(a)}s.push(t)}}),n(o)&&s.push(new Mo(0,o)),s}function Ae(t,e,r){var i=[];if(":"!=t[0])r.push(new gh('Animation states via styles must be prefixed with a ":"'));else{var o=t.substring(1),a=e[o];n(a)?a.styles.forEach(function(t){s(t)&&i.push(t)}):r.push(new gh('Unable to apply styles due to missing a state: "'+o+'"'))}return i}function Re(t,e,r,i,o){var s=t.steps.length,a=0;t.steps.forEach(function(t){return a+=n(t.offset)?1:0}),a>0&&a=0;d--)w();return l.map(function(t){return new Hp(t[0],new Bp([t[1]]))})}function Ie(t,e,r,i,o){var s,a=0,u=e;if(t instanceof Fo){var c,l=0,p=[],h=t instanceof Lo;if(t.steps.forEach(function(t){var s=h?u:e;if(t instanceof Mo)return t.styles.forEach(function(t){var e=t;Object.keys(e).forEach(function(t){r.insertAtTime(t,s,e[t])})}),void(c=t.styles);var f=Ie(t,s,r,i,o);if(n(c)){if(t instanceof Fo){var d=new Bp(c);p.push(new Up(d,[],0,0,""))}else{var y=f;ai.addAll(y.startingStyles.styles,c)}c=null}var m=f.playTime;e+=m,a+=m,l=ph.max(m,l),p.push(f)}),n(c)){var f=new Bp(c);p.push(new Up(f,[],0,0,""))}h?(s=new Gp(p),a=l,e=u+a):s=new Wp(p)}else if(t instanceof jo){var d,y=Me(t.timings,o),m=t.styles;if(m instanceof qo)d=Re(m,e,r,i,o);else{var v=m,g=mh,_=new Bp(v.styles),b=new Hp(g,_);d=[b]}s=new Up(new Bp([]),d,y.duration,y.delay,y.easing),a=y.duration+y.delay,e+=a,d.forEach(function(t){return t.styles.styles.forEach(function(t){return Object.keys(t).forEach(function(n){r.insertAtTime(n,e,t[n])})})})}else s=new Up(null,[],0,0,"");return s.playTime=a,s.startTime=u,s}function qe(t,e,n){if(t instanceof Up&&t.keyframes.length>0){var r=t.keyframes;if(1==r.length){var i=r[0],o=je(i,t.startTime,t.playTime,e,n);t.keyframes=[o,i]}}else t instanceof zp&&t.steps.forEach(function(t){return qe(t,e,n)})}function Me(t,e){var r,s=/^([\.\d]+)(m?s)(?:\s+([\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?/i,a=0,u=null;if(o(t)){var c=t.match(s);if(null===c)return e.push(new gh('The provided timing value "'+t+'" is invalid.')),new wh(0,0,null);var l=parseFloat(c[1]),p=c[2];"s"==p&&(l*=vh),r=ph.floor(l);var h=c[3],f=c[4];if(n(h)){var d=parseFloat(h);n(f)&&"s"==f&&(d*=vh),a=ph.floor(d)}var y=c[5];i(y)||(u=y)}else r=t;return new wh(r,a,u)}function je(t,e,r,i,o){var s={},a=e+r;return t.styles.styles.forEach(function(t){Object.keys(t).forEach(function(r){var u=t[r];if("offset"!=r){var c,l,p,h=i.indexOfAtOrBeforeTime(r,e);n(h)?(c=i.getByIndex(r,h),p=c.value,l=i.getByIndex(r,h+1)):p=hl,n(l)&&!l.matches(a,u)&&o.push(new gh('The animated CSS property "'+r+'" unexpectedly changes between steps "'+c.time+'ms" and "'+a+'ms" at "'+l.time+'ms"')),s[r]=p}})}),new Hp(yh,new Bp([s]))}function Fe(t,e){return void 0===e&&(e=null),F(t,new Eh,e)}function De(t,e,r){if(e===r)return t;for(var i=to,o=e;o!==r&&n(o.declarationElement.view);)o=o.declarationElement.view,i=i.prop("parent");if(o!==r)throw new Error("Internal error: Could not calculate a property in a parent view: "+t);if(t instanceof Ki){var s=t;(r.fields.some(function(t){return t.name==s.name})||r.getters.some(function(t){return t.name==s.name}))&&(i=i.cast(r.classType))}return E(to.name,i,t)}function Le(t,e){var n=[L(t)];return e&&n.push(no),to.prop("parentInjector").callMethod("get",n)}function Ve(t,e){return"viewFactory_"+t.type.name+e}function Qe(t){for(var e=[],n=P([]),r=0;r0&&(n=n.callMethod(Ii.ConcatArray,[P(e)]),e=[]),n=n.callMethod(Ii.ConcatArray,[i])):e.push(i)}return e.length>0&&(n=n.callMethod(Ii.ConcatArray,[P(e)])),n}function Ue(t,e,n,r){r.fields.push(new lo(n.name,null));var i=e0?A(t).lowerEquals(qh.requestNodeIndex).and(qh.requestNodeIndex.lowerEquals(A(t+e))):A(t).identical(qh.requestNodeIndex),new yo(qh.token.identical(L(n.token)).and(i),[new uo(r)])}function $e(t,e,n,r,i,o){var s,a,u=o.view;if(r?(s=P(n),a=new Ci(xi)):(s=n[0],a=n[0].type),a||(a=xi),i)u.fields.push(new lo(t,a)),u.createMethod.addStmt(to.prop(t).set(s).toStmt());else{var c="_"+t;u.fields.push(new lo(c,a));var l=new Sh(u);l.resetDebugInfo(o.nodeIndex,o.sourceAst),l.addStmt(new yo(to.prop(c).isBlank(),[to.prop(c).set(s).toStmt()])),l.addStmt(new uo(to.prop(c))),u.getters.push(new ho(t,l.finish(),a))}return to.prop(t)}function Ke(t,e){for(var n=null,r=t.pipeMetas.length-1;r>=0;r--){var i=t.pipeMetas[r];if(i.name==e){n=i;break}}if(!n)throw new Error("Illegal state: Could not find pipe "+e+" although the parser should have detected this error!");return n}function Xe(t,e){return e>0?Nc.EMBEDDED:t.type.isHost?Nc.HOST:Nc.COMPONENT}function Ze(t,e,n,r,i){var o=new zh(t,e,r,i),s=n.visit(o,Kl.Expression);return new Bh(s,o.needsValueUnwrapper,o.temporaryCount)}function Ye(t,e,n,r){var i=new zh(t,e,null,r),o=[];return an(n.visit(i,Kl.Statement),o),nn(i.temporaryCount,r,o),o}function tn(t,e){return"tmp_"+t+"_"+e}function en(t,e){return new oo(tn(t,e),no)}function nn(t,e,n){for(var r=t-1;r>=0;r--)n.unshift(en(e,r))}function rn(t,e){if(t!==Kl.Statement)throw new Error("Expected a statement, but saw "+e)}function on(t,e){if(t!==Kl.Expression)throw new Error("Expected an expression, but saw "+e)}function sn(t,e){return t===Kl.Statement?e.toStmt():e}function an(t,e){u(t)?t.forEach(function(t){return an(t,e)}):e.push(t)}function un(t,e,n){var r=[];return t.forEach(function(t){n.view.bindings.push(new Uh(n,t));var e=Gh.getOrCreate(n,t.target,t.name,t.phase,r);e.addAction(t,null,null)}),e.forEach(function(t){var e=n.instances.get(Zt(t.directive.type).reference);t.hostEvents.forEach(function(i){n.view.bindings.push(new Uh(n,i));var o=Gh.getOrCreate(n,i.target,i.name,i.phase,r);o.addAction(i,t.directive,e)})}),r.forEach(function(t){return t.finishMethod()}),r}function cn(t,e,n){Object.keys(t.directive.outputs).forEach(function(r){var i=t.directive.outputs[r];n.filter(function(t){return t.eventName==i}).forEach(function(t){t.listenToDirective(e,r)})})}function ln(t){t.forEach(function(t){t.eventPhase?t.listenToAnimation():t.listenToRenderer()})}function pn(t){return t instanceof ao?t.expr:t instanceof uo?t.value:null}function hn(t){return Vr.replaceAll(t,/[^a-zA-Z_]/g,"_")}function fn(t,e,n){var r=n.view,i=r.detectChangesInInputsMethod,o=t.directive.type.lifecycleHooks;o.indexOf(bc.OnChanges)!==-1&&t.inputs.length>0&&i.addStmt(new yo(Mh.changes.notIdentical(no),[e.callMethod("ngOnChanges",[Mh.changes]).toStmt()])),o.indexOf(bc.OnInit)!==-1&&i.addStmt(new yo(Wh.and(Jh),[e.callMethod("ngOnInit",[]).toStmt()])),o.indexOf(bc.DoCheck)!==-1&&i.addStmt(new yo(Jh,[e.callMethod("ngDoCheck",[]).toStmt()]))}function dn(t,e,n){var r=n.view,i=t.type.lifecycleHooks,o=r.afterContentLifecycleCallbacksMethod;o.resetDebugInfo(n.nodeIndex,n.sourceAst),i.indexOf(bc.AfterContentInit)!==-1&&o.addStmt(new yo(Wh,[e.callMethod("ngAfterContentInit",[]).toStmt()])),i.indexOf(bc.AfterContentChecked)!==-1&&o.addStmt(e.callMethod("ngAfterContentChecked",[]).toStmt())}function yn(t,e,n){var r=n.view,i=t.type.lifecycleHooks,o=r.afterViewLifecycleCallbacksMethod;o.resetDebugInfo(n.nodeIndex,n.sourceAst),i.indexOf(bc.AfterViewInit)!==-1&&o.addStmt(new yo(Wh,[e.callMethod("ngAfterViewInit",[]).toStmt()])),i.indexOf(bc.AfterViewChecked)!==-1&&o.addStmt(e.callMethod("ngAfterViewChecked",[]).toStmt())}function mn(t,e,n){var r=n.view.destroyMethod;r.resetDebugInfo(n.nodeIndex,n.sourceAst),t.lifecycleHooks.indexOf(bc.OnDestroy)!==-1&&r.addStmt(e.callMethod("ngOnDestroy",[]).toStmt())}function vn(t,e,n){var r=n.destroyMethod;t.type.lifecycleHooks.indexOf(bc.OnDestroy)!==-1&&r.addStmt(e.callMethod("ngOnDestroy",[]).toStmt())}function gn(t){return to.prop("_expr_"+t)}function _n(t){return C("currVal_"+t)}function bn(t,e,n,r,i,o,s,a){var u=Ze(t,i,r,Mh.valUnwrapper,a);if(u.expression){if(u.temporaryCount)for(var c=0;c0}));return u}function Qn(t,e,n){var r,i=[new Wi(Ah.viewUtils.name,x(Xt(Ol.ViewUtils))),new Wi(Ah.parentInjector.name,x(Xt(Ol.Injector))),new Wi(Ah.declarationEl.name,x(Xt(Ol.AppElement)))],o=[];if(r=t.component.template.templateUrl==t.component.type.moduleUrl?t.component.type.moduleUrl+" class "+t.component.type.name+" - inline template":t.component.template.templateUrl,0===t.viewIndex){var s=T(t.animations.map(function(t){return[t.name,t.fnExp]}));o=[new yo(n.identical(no),[n.set(Ah.viewUtils.callMethod("createRenderComponentType",[A(t.genConfig.genDebugInfo?r:""),A(t.component.template.ngContentSelectors.length),Nh.fromValue(t.component.template.encapsulation),t.styles,s])).toStmt()])]}return k(i,o.concat([new uo(C(e.name).instantiate(e.constructorMethod.params.map(function(t){return C(t.name)})))]),x(Xt(Ol.AppView),[zn(t)])).toDeclStmt(t.viewFactory.name,[Di.Final])}function Un(t){var e=no,n=[];t.viewType===Nc.COMPONENT&&(e=Rh.renderer.callMethod("createViewRoot",[to.prop("declarationAppElement").prop("nativeElement")]),n=[tf.set(e).toDeclStmt(x(t.genConfig.renderTypes.renderNode),[Di.Final])]);var r;return r=t.viewType===Nc.HOST?t.nodes[0].appElement:no,n.concat(t.createMethod.finish(),[to.callMethod("init",[Qe(t.rootNodesOrAppElements),P(t.nodes.map(function(t){return t.renderNode})),P(t.disposables),P(t.subscriptions)]).toStmt(),new uo(r)])}function Bn(t){var e=[];if(t.animationBindingsMethod.isEmpty()&&t.detectChangesInInputsMethod.isEmpty()&&t.updateContentQueriesMethod.isEmpty()&&t.afterContentLifecycleCallbacksMethod.isEmpty()&&t.detectChangesRenderPropertiesMethod.isEmpty()&&t.updateViewQueriesMethod.isEmpty()&&t.afterViewLifecycleCallbacksMethod.isEmpty())return e;ai.addAll(e,t.animationBindingsMethod.finish()),ai.addAll(e,t.detectChangesInInputsMethod.finish()),e.push(to.callMethod("detectContentChildrenChanges",[Mh.throwOnChange]).toStmt());var n=t.updateContentQueriesMethod.finish().concat(t.afterContentLifecycleCallbacksMethod.finish());n.length>0&&e.push(new yo(N(Mh.throwOnChange),n)),ai.addAll(e,t.detectChangesRenderPropertiesMethod.finish()),e.push(to.callMethod("detectViewChildrenChanges",[Mh.throwOnChange]).toStmt());var r=t.updateViewQueriesMethod.finish().concat(t.afterViewLifecycleCallbacksMethod.finish());r.length>0&&e.push(new yo(N(Mh.throwOnChange),r));var i=[],o=O(e);return o.has(Mh.changed.name)&&i.push(Mh.changed.set(A(!0)).toDeclStmt(Pi)),o.has(Mh.changes.name)&&i.push(Mh.changes.set(no).toDeclStmt(new Si(x(Xt(Ol.SimpleChange))))),o.has(Mh.valUnwrapper.name)&&i.push(Mh.valUnwrapper.set(S(Xt(Ol.ValueUnwrapper)).instantiate([])).toDeclStmt(null,[Di.Final])),i.concat(e)}function Hn(t,e){return t.length>0?t.concat([new uo(e)]):t}function zn(t){return t.viewType===Nc.COMPONENT?x(t.component.type):xi}function Gn(t){var e;return e=t.viewType===Nc.COMPONENT?gc(t.component.changeDetection)?_c.CheckAlways:_c.CheckOnce:_c.CheckAlways}function Wn(t){return t.dependencies.forEach(function(t){if(t instanceof nf){var e=t;e.placeholder.moduleUrl=$n(e.comp.moduleUrl)}else if(t instanceof rf){var n=t;n.placeholder.name=Kn(n.comp),n.placeholder.moduleUrl=$n(n.comp.moduleUrl)}}),t.statements}function Jn(t,e){return t.dependencies.forEach(function(t){t.valuePlaceholder.moduleUrl=Xn(t.moduleUrl,t.isShimmed,e)}),t.statements}function $n(t){var e=Yn(t);return e[0]+".ngfactory"+e[1]}function Kn(t){return t.name+"NgFactory"}function Xn(t,e,n){return e?t+".shim"+n:""+t+n}function Zn(t){if(!t.isComponent)throw new Error("Could not compile '"+t.type.name+"' because it is not a component.")}function Yn(t){if(t.endsWith(".d.ts"))return[t.slice(0,-5),".ts"];var e=t.lastIndexOf(".");return e!==-1?[t.substring(0,e),t.substring(e)]:[t,""]}function tr(){return new df(hf)}function er(t){var e=rr(t);return e&&e[Hh.Scheme]||""}function nr(t,e,r,i,o,s,a){var u=[];return n(t)&&u.push(t+":"),n(r)&&(u.push("//"),n(e)&&u.push(e+"@"),u.push(r),n(i)&&u.push(":"+i)),n(o)&&u.push(o),n(s)&&u.push("?"+s),n(a)&&u.push("#"+a),u.join("")}function rr(t){return t.match(yf)}function ir(t){if("/"==t)return"/";for(var e="/"==t[0]?"/":"",n="/"===t[t.length-1]?"/":"",r=t.split("/"),i=[],o=0,s=0;s0?i.pop():o++;break;default:i.push(a)}}if(""==e){for(;o-- >0;)i.unshift("..");0===i.length&&i.push(".")}return e+i.join("/")+n}function or(t){var e=t[Hh.Path];return e=i(e)?"":ir(e),t[Hh.Path]=e,nr(t[Hh.Scheme],t[Hh.UserInfo],t[Hh.Domain],t[Hh.Port],e,t[Hh.QueryData],t[Hh.Fragment])}function sr(t,e){var r=rr(encodeURI(e)),o=rr(t);if(n(r[Hh.Scheme]))return or(r);r[Hh.Scheme]=o[Hh.Scheme];for(var s=Hh.Scheme;s<=Hh.Port;s++)i(r[s])&&(r[s]=o[s]);if("/"==r[Hh.Path][0])return or(r);var a=o[Hh.Path];i(a)&&(a="/");var u=a.lastIndexOf("/");return a=a.substring(0,u+1)+r[Hh.Path],r[Hh.Path]=a,or(r)}function ar(t,e){return new $o({type:t.type,isComponent:t.isComponent,selector:t.selector,exportAs:t.exportAs,changeDetection:t.changeDetection,inputs:t.inputs,outputs:t.outputs,hostListeners:t.hostListeners,hostProperties:t.hostProperties,hostAttributes:t.hostAttributes,providers:t.providers,viewProviders:t.viewProviders,queries:t.queries,viewQueries:t.viewQueries,entryComponents:t.entryComponents,template:e})}function ur(t){return t instanceof e.Directive}function cr(t,e){var n=_f.get(t),r=bf.get(t);return el.hasLifecycleHook(e,n,r)}function lr(t){return t instanceof e.NgModule}function pr(t){return t instanceof e.Pipe}function hr(t,e,n,r){return void 0===n&&(n=[]),void 0===r&&(r=new Set),t.forEach(function(t){if(!r.has(t.type.reference)){r.add(t.type.reference);var i=e?t.importedModules.concat(t.exportedModules):t.exportedModules;hr(i,e,n,r),n.push(t)}}),n}function fr(t,n){if(void 0===n&&(n=[]),t)for(var r=0;r0?o.push(a):(o.length>0&&(r.push(o.join("")),n.push(wd),o=[]),n.push(a)),a==_d&&i++}return o.length>0&&(r.push(o.join("")),n.push(wd)),new Od(n.join(""),r)}function kr(t){var e="styles";return t&&(e+="_"+t.type.name),e}function Ar(t){if(!t.isComponent)throw new Error("Could not compile '"+t.type.name+"' because it is not a component.")}function Rr(t,e){for(var n=0,r=e;n=0;e--)if(void 0!==t[e])return t[e]}function jr(t){var e=[];return t.forEach(function(t){return t&&e.push.apply(e,t)}),e}var Fr;Fr="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:r:window;var Dr=Fr;Dr.assert=function(t){};var Lr=Object.getPrototypeOf({}),Vr=function(){function t(){}return t.fromCharCode=function(t){return String.fromCharCode(t)},t.charCodeAt=function(t,e){return t.charCodeAt(e)},t.split=function(t,e){return t.split(e)},t.equals=function(t,e){return t===e},t.stripLeft=function(t,e){if(t&&t.length){for(var n=0,r=0;r=0&&t[r]==e;r--)n--;t=t.substring(0,n)}return t},t.replace=function(t,e,n){return t.replace(e,n)},t.replaceAll=function(t,e,n){return t.replace(e,n)},t.slice=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=null),t.slice(e,null===n?void 0:n)},t.replaceAllMapped=function(t,e,n){return t.replace(e,function(){for(var t=[],e=0;ee?1:0},t}(),Qr=function(){function t(t){void 0===t&&(t=[]),this.parts=t}return t.prototype.add=function(t){this.parts.push(t)},t.prototype.toString=function(){return this.parts.join("")},t}(),Ur=function(){function t(){}return t.toFixed=function(t,e){return t.toFixed(e)},t.equal=function(t,e){return t===e},t.parseIntAutoRadix=function(t){var e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e},t.parseInt=function(t,e){if(10==e){if(/^(\-|\+)?[0-9]+$/.test(t))return parseInt(t,e)}else if(16==e){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(t))return parseInt(t,e)}else{var n=parseInt(t,e);if(!isNaN(n))return n}throw new Error("Invalid integer literal when parsing "+t+" in base "+e)},Object.defineProperty(t,"NaN",{get:function(){return NaN},enumerable:!0,configurable:!0}),t.isNumeric=function(t){return!isNaN(t-parseFloat(t))},t.isNaN=function(t){return isNaN(t)},t.isInteger=function(t){return Number.isInteger(t)},t}(),Br=function(){function t(t,e,n){this.value=t,this.ngContentIndex=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitText(this,e)},t}(),Hr=function(){function t(t,e,n){this.value=t,this.ngContentIndex=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitBoundText(this,e)},t}(),zr=function(){function t(t,e,n){this.name=t,this.value=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitAttr(this,e)},t}(),Gr=function(){function e(t,e,n,r,i,o){this.name=t,this.type=e,this.securityContext=n,this.value=r,this.unit=i,this.sourceSpan=o}return e.prototype.visit=function(t,e){return t.visitElementProperty(this,e)},Object.defineProperty(e.prototype,"isAnimation",{get:function(){return this.type===t.PropertyBindingType.Animation},enumerable:!0,configurable:!0}),e}(),Wr=function(){function t(t,e,n,r,i){this.name=t,this.target=e,this.phase=n,this.handler=r,this.sourceSpan=i}return t.prototype.visit=function(t,e){return t.visitEvent(this,e)},Object.defineProperty(t.prototype,"fullName",{get:function(){return n(this.target)?this.target+":"+this.name:this.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAnimation",{get:function(){return!!this.phase},enumerable:!0,configurable:!0}),t}(),Jr=function(){function t(t,e,n){this.name=t,this.value=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitReference(this,e)},t}(),$r=function(){function t(t,e,n){this.name=t,this.value=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitVariable(this,e)},t}(),Kr=function(){function t(t,e,n,r,i,o,s,a,u,c,l){this.name=t,this.attrs=e,this.inputs=n,this.outputs=r,this.references=i,this.directives=o,this.providers=s,this.hasViewContainer=a,this.children=u,this.ngContentIndex=c,this.sourceSpan=l}return t.prototype.visit=function(t,e){return t.visitElement(this,e)},t}(),Xr=function(){function t(t,e,n,r,i,o,s,a,u,c){this.attrs=t,this.outputs=e,this.references=n,this.variables=r,this.directives=i,this.providers=o,this.hasViewContainer=s,this.children=a,this.ngContentIndex=u,this.sourceSpan=c}return t.prototype.visit=function(t,e){return t.visitEmbeddedTemplate(this,e)},t}(),Zr=function(){function t(t,e,n,r){this.directiveName=t,this.templateName=e,this.value=n,this.sourceSpan=r}return t.prototype.visit=function(t,e){return t.visitDirectiveProperty(this,e)},t}(),Yr=function(){function t(t,e,n,r,i){this.directive=t,this.inputs=e,this.hostProperties=n,this.hostEvents=r,this.sourceSpan=i}return t.prototype.visit=function(t,e){return t.visitDirective(this,e)},t}(),ti=function(){function t(t,e,n,r,i,o,s){this.token=t,this.multiProvider=e,this.eager=n,this.providers=r,this.providerType=i,this.lifecycleHooks=o,this.sourceSpan=s}return t.prototype.visit=function(t,e){return null},t}();t.ProviderAstType,function(t){t[t.PublicService=0]="PublicService",t[t.PrivateService=1]="PrivateService",t[t.Component=2]="Component",t[t.Directive=3]="Directive",t[t.Builtin=4]="Builtin"}(t.ProviderAstType||(t.ProviderAstType={}));var ei=function(){function t(t,e,n){this.index=t,this.ngContentIndex=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitNgContent(this,e)},t}();t.PropertyBindingType,function(t){t[t.Property=0]="Property",t[t.Attribute=1]="Attribute",t[t.Class=2]="Class",t[t.Style=3]="Style",t[t.Animation=4]="Animation"}(t.PropertyBindingType||(t.PropertyBindingType={}));var ni,ri=function(){try{if(1===new Map([[1,2]]).size)return function(t){return new Map(t)}}catch(t){}return function(t){for(var e=new Map,n=0;n-1&&(t.splice(n,1),!0)},t.clear=function(t){t.length=0},t.isEmpty=function(t){return 0==t.length},t.fill=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=null),t.fill(e,n,null===r?t.length:r)},t.equals=function(t,e){if(t.length!=e.length)return!1;for(var n=0;nr&&(n=s,r=a)}}return n},t.flatten=function(t){var e=[];return v(t,e),e},t.addAll=function(t,e){for(var n=0;n",harr:"↔",hArr:"⇔",hearts:"♥",hellip:"…",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",image:"ℑ",infin:"∞","int":"∫",Iota:"Ι",iota:"ι",iquest:"¿",isin:"∈",Iuml:"Ï",iuml:"ï",Kappa:"Κ",kappa:"κ",Lambda:"Λ",lambda:"λ",lang:"⟨",laquo:"«",larr:"←",lArr:"⇐",lceil:"⌈",ldquo:"“",le:"≤",lfloor:"⌊",lowast:"∗",loz:"◊",lrm:"‎",lsaquo:"‹",lsquo:"‘",lt:"<",macr:"¯",mdash:"—",micro:"µ",middot:"·",minus:"−",Mu:"Μ",mu:"μ",nabla:"∇",nbsp:" ",ndash:"–",ne:"≠",ni:"∋",not:"¬",notin:"∉",nsub:"⊄",Ntilde:"Ñ",ntilde:"ñ",Nu:"Ν",nu:"ν",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",OElig:"Œ",oelig:"œ",Ograve:"Ò",ograve:"ò",oline:"‾",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",oplus:"⊕",or:"∨",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",otimes:"⊗",Ouml:"Ö",ouml:"ö",para:"¶",permil:"‰",perp:"⊥",Phi:"Φ",phi:"φ",Pi:"Π",pi:"π",piv:"ϖ",plusmn:"±",pound:"£",prime:"′",Prime:"″",prod:"∏",prop:"∝",Psi:"Ψ",psi:"ψ",quot:'"',radic:"√",rang:"⟩",raquo:"»",rarr:"→",rArr:"⇒",rceil:"⌉",rdquo:"”",real:"ℜ",reg:"®",rfloor:"⌋",Rho:"Ρ",rho:"ρ",rlm:"‏",rsaquo:"›",rsquo:"’",sbquo:"‚",Scaron:"Š",scaron:"š",sdot:"⋅",sect:"§",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sim:"∼",spades:"♠",sub:"⊂",sube:"⊆",sum:"∑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supe:"⊇",szlig:"ß",Tau:"Τ",tau:"τ",there4:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thinsp:" ",THORN:"Þ",thorn:"þ",tilde:"˜",times:"×",trade:"™",Uacute:"Ú",uacute:"ú",uarr:"↑",uArr:"⇑",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",Uuml:"Ü",uuml:"ü",weierp:"℘",Xi:"Ξ",xi:"ξ",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ",Yuml:"Ÿ",Zeta:"Ζ",zeta:"ζ",zwj:"‍",zwnj:"‌"},li=function(){function t(t){var e=this,n=void 0===t?{}:t,r=n.closedByChildren,i=n.requiredParents,o=n.implicitNamespacePrefix,s=n.contentType,a=void 0===s?ni.PARSABLE_DATA:s,u=n.closedByParent,c=void 0!==u&&u,l=n.isVoid,p=void 0!==l&&l,h=n.ignoreFirstLf,f=void 0!==h&&h;this.closedByChildren={},this.closedByParent=!1,this.canSelfClose=!1,r&&r.length>0&&r.forEach(function(t){return e.closedByChildren[t]=!0}),this.isVoid=p,this.closedByParent=c||p,i&&i.length>0&&(this.requiredParents={},this.parentToAdd=i[0],i.forEach(function(t){return e.requiredParents[t]=!0})),this.implicitNamespacePrefix=o,this.contentType=a,this.ignoreFirstLf=f}return t.prototype.requireExtraParent=function(t){if(!this.requiredParents)return!1;if(!t)return!0;var e=t.toLowerCase();return 1!=this.requiredParents[e]&&"template"!=e},t.prototype.isClosedByChild=function(t){return this.isVoid||t.toLowerCase()in this.closedByChildren},t}(),pi={base:new li({isVoid:!0}),meta:new li({isVoid:!0}),area:new li({isVoid:!0}),embed:new li({isVoid:!0}),link:new li({isVoid:!0}),img:new li({isVoid:!0}),input:new li({isVoid:!0}),param:new li({isVoid:!0}),hr:new li({isVoid:!0}),br:new li({isVoid:!0}),source:new li({isVoid:!0}),track:new li({isVoid:!0}),wbr:new li({isVoid:!0}),p:new li({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new li({closedByChildren:["tbody","tfoot"]}),tbody:new li({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new li({closedByChildren:["tbody"],closedByParent:!0}),tr:new li({closedByChildren:["tr"],requiredParents:["tbody","tfoot","thead"],closedByParent:!0}),td:new li({closedByChildren:["td","th"],closedByParent:!0}),th:new li({closedByChildren:["td","th"],closedByParent:!0}),col:new li({requiredParents:["colgroup"],isVoid:!0}),svg:new li({implicitNamespacePrefix:"svg"}),math:new li({implicitNamespacePrefix:"math"}),li:new li({closedByChildren:["li"],closedByParent:!0}),dt:new li({closedByChildren:["dt","dd"]}),dd:new li({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new li({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new li({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new li({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new li({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new li({closedByChildren:["optgroup"],closedByParent:!0}),option:new li({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new li({ignoreFirstLf:!0}),listing:new li({ignoreFirstLf:!0}),style:new li({contentType:ni.RAW_TEXT}),script:new li({contentType:ni.RAW_TEXT}),title:new li({contentType:ni.ESCAPABLE_RAW_TEXT}),textarea:new li({contentType:ni.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})},hi=new li,fi=new RegExp("(\\:not\\()|([-\\w]+)|(?:\\.([-\\w]+))|(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|(\\))|(\\s*,\\s*)","g"),di=function(){function t(){this.element=null,this.classNames=[],this.attrs=[],this.notSelectors=[]}return t.parse=function(e){var n,r=[],i=function(t,e){e.notSelectors.length>0&&!e.element&&0==e.classNames.length&&0==e.attrs.length&&(e.element="*"),t.push(e)},o=new t,s=o,a=!1;for(fi.lastIndex=0;n=fi.exec(e);){if(n[1]){if(a)throw new Error("Nesting :not is not allowed in a selector");a=!0,s=new t,o.notSelectors.push(s)}if(n[2]&&s.setElement(n[2]),n[3]&&s.addClassName(n[3]),n[4]&&s.addAttribute(n[4],n[5]),n[6]&&(a=!1,s=o),n[7]){if(a)throw new Error("Multiple selectors in :not are not supported");i(r,o),o=s=new t}}return i(r,o),r},t.prototype.isElementSelector=function(){return this.hasElementSelector()&&0==this.classNames.length&&0==this.attrs.length&&0===this.notSelectors.length},t.prototype.hasElementSelector=function(){return!!this.element},t.prototype.setElement=function(t){void 0===t&&(t=null),this.element=t},t.prototype.getMatchingElementTemplate=function(){for(var t=this.element||"div",e=this.classNames.length>0?' class="'+this.classNames.join(" ")+'"':"",n="",r=0;r":"<"+t+e+n+">"},t.prototype.addAttribute=function(t,e){void 0===e&&(e=""),this.attrs.push(t,e&&e.toLowerCase()||"")},t.prototype.addClassName=function(t){this.classNames.push(t.toLowerCase())},t.prototype.toString=function(){var t=this.element||"";if(this.classNames&&this.classNames.forEach(function(e){return t+="."+e}),this.attrs)for(var e=0;e1&&(n=new mi(t),this._listContexts.push(n));for(var r=0;r0&&(!this.listContext||!this.listContext.alreadyMatched)){var r=yi.createNotMatcher(this.notSelectors);n=!r.match(t,null)}return!n||!e||this.listContext&&this.listContext.alreadyMatched||(this.listContext&&(this.listContext.alreadyMatched=!0),e(this.selector,this.cbContext)),n},t}(),gi=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};!function(t){t[t.Const=0]="Const"}(ui||(ui={}));var _i,bi=function(){function t(t){void 0===t&&(t=null),this.modifiers=t,t||(this.modifiers=[])}return t.prototype.hasModifier=function(t){return this.modifiers.indexOf(t)!==-1},t}();!function(t){t[t.Dynamic=0]="Dynamic",t[t.Bool=1]="Bool",t[t.String=2]="String",t[t.Int=3]="Int",t[t.Number=4]="Number",t[t.Function=5]="Function"}(_i||(_i={}));var wi,Ei=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.name=e}return gi(e,t),e.prototype.visitType=function(t,e){return t.visitBuiltintType(this,e)},e}(bi),Oi=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,r),this.value=e,this.typeParams=n}return gi(e,t),e.prototype.visitType=function(t,e){return t.visitExternalType(this,e)},e}(bi),Ci=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.of=e}return gi(e,t),e.prototype.visitType=function(t,e){return t.visitArrayType(this,e)},e}(bi),Si=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.valueType=e}return gi(e,t),e.prototype.visitType=function(t,e){return t.visitMapType(this,e)},e}(bi),xi=new Ei(_i.Dynamic),Pi=new Ei(_i.Bool),Ti=(new Ei(_i.Int),new Ei(_i.Number)),Ni=new Ei(_i.String),ki=new Ei(_i.Function);!function(t){t[t.Equals=0]="Equals",t[t.NotEquals=1]="NotEquals",t[t.Identical=2]="Identical",t[t.NotIdentical=3]="NotIdentical",t[t.Minus=4]="Minus",t[t.Plus=5]="Plus",t[t.Divide=6]="Divide",t[t.Multiply=7]="Multiply",t[t.Modulo=8]="Modulo",t[t.And=9]="And",t[t.Or=10]="Or",t[t.Lower=11]="Lower",t[t.LowerEquals=12]="LowerEquals",t[t.Bigger=13]="Bigger",t[t.BiggerEquals=14]="BiggerEquals"}(wi||(wi={}));var Ai,Ri=function(){function t(t){this.type=t}return t.prototype.prop=function(t){return new Ki(this,t)},t.prototype.key=function(t,e){return void 0===e&&(e=null),new Xi(this,t,e)},t.prototype.callMethod=function(t,e){return new Li(this,t,e)},t.prototype.callFn=function(t){return new Vi(this,t)},t.prototype.instantiate=function(t,e){return void 0===e&&(e=null),new Qi(this,t,e)},t.prototype.conditional=function(t,e){return void 0===e&&(e=null),new Hi(this,t,e)},t.prototype.equals=function(t){return new $i(wi.Equals,this,t)},t.prototype.notEquals=function(t){return new $i(wi.NotEquals,this,t)},t.prototype.identical=function(t){return new $i(wi.Identical,this,t)},t.prototype.notIdentical=function(t){return new $i(wi.NotIdentical,this,t)},t.prototype.minus=function(t){return new $i(wi.Minus,this,t)},t.prototype.plus=function(t){return new $i(wi.Plus,this,t)},t.prototype.divide=function(t){return new $i(wi.Divide,this,t)},t.prototype.multiply=function(t){return new $i(wi.Multiply,this,t)},t.prototype.modulo=function(t){return new $i(wi.Modulo,this,t)},t.prototype.and=function(t){return new $i(wi.And,this,t)},t.prototype.or=function(t){return new $i(wi.Or,this,t)},t.prototype.lower=function(t){return new $i(wi.Lower,this,t)},t.prototype.lowerEquals=function(t){return new $i(wi.LowerEquals,this,t)},t.prototype.bigger=function(t){return new $i(wi.Bigger,this,t)},t.prototype.biggerEquals=function(t){return new $i(wi.BiggerEquals,this,t)},t.prototype.isBlank=function(){return this.equals(no)},t.prototype.cast=function(t){return new Gi(this,t)},t.prototype.toStmt=function(){return new ao(this)},t}();!function(t){t[t.This=0]="This",t[t.Super=1]="Super",t[t.CatchError=2]="CatchError",t[t.CatchStack=3]="CatchStack"}(Ai||(Ai={}));var Ii,qi=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),o(e)?(this.name=e,this.builtin=null):(this.name=null,this.builtin=e)}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitReadVarExpr(this,e)},e.prototype.set=function(t){return new Mi(this.name,t)},e}(Ri),Mi=function(t){function e(e,r,i){void 0===i&&(i=null),t.call(this,n(i)?i:r.type),this.name=e,this.value=r}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitWriteVarExpr(this,e)},e.prototype.toDeclStmt=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=null),new oo(this.name,this.value,t,e)},e}(Ri),ji=function(t){function e(e,r,i,o){void 0===o&&(o=null),t.call(this,n(o)?o:i.type),this.receiver=e,this.index=r,this.value=i}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitWriteKeyExpr(this,e)},e}(Ri),Fi=function(t){function e(e,r,i,o){void 0===o&&(o=null),t.call(this,n(o)?o:i.type),this.receiver=e,this.name=r,this.value=i}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitWritePropExpr(this,e)},e}(Ri);!function(t){t[t.ConcatArray=0]="ConcatArray",t[t.SubscribeObservable=1]="SubscribeObservable",t[t.Bind=2]="Bind"}(Ii||(Ii={}));var Di,Li=function(t){function e(e,n,r,i){void 0===i&&(i=null),t.call(this,i),this.receiver=e,this.args=r,o(n)?(this.name=n,this.builtin=null):(this.name=null,this.builtin=n)}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitInvokeMethodExpr(this,e)},e}(Ri),Vi=function(t){function e(e,n,r){void 0===r&&(r=null),t.call(this,r),this.fn=e,this.args=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitInvokeFunctionExpr(this,e)},e}(Ri),Qi=function(t){function e(e,n,r){t.call(this,r),this.classExpr=e,this.args=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitInstantiateExpr(this,e)},e}(Ri),Ui=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.value=e}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitLiteralExpr(this,e)},e}(Ri),Bi=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,n),this.value=e,this.typeParams=r}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitExternalExpr(this,e)},e}(Ri),Hi=function(t){function e(e,r,i,o){void 0===i&&(i=null),void 0===o&&(o=null),t.call(this,n(o)?o:r.type),this.condition=e,this.falseCase=i,this.trueCase=r}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitConditionalExpr(this,e)},e}(Ri),zi=function(t){function e(e){t.call(this,Pi),this.condition=e}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitNotExpr(this,e)},e}(Ri),Gi=function(t){function e(e,n){t.call(this,n),this.value=e}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitCastExpr(this,e)},e}(Ri),Wi=function(){function t(t,e){void 0===e&&(e=null),this.name=t,this.type=e}return t}(),Ji=function(t){function e(e,n,r){void 0===r&&(r=null),t.call(this,r),this.params=e,this.statements=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitFunctionExpr(this,e)},e.prototype.toDeclStmt=function(t,e){return void 0===e&&(e=null),new so(t,this.params,this.statements,this.type,e)},e}(Ri),$i=function(t){function e(e,r,i,o){void 0===o&&(o=null),t.call(this,n(o)?o:r.type),this.operator=e,this.rhs=i,this.lhs=r}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitBinaryOperatorExpr(this,e)},e}(Ri),Ki=function(t){function e(e,n,r){void 0===r&&(r=null),t.call(this,r),this.receiver=e,this.name=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitReadPropExpr(this,e)},e.prototype.set=function(t){return new Fi(this.receiver,this.name,t)},e}(Ri),Xi=function(t){function e(e,n,r){void 0===r&&(r=null),t.call(this,r),this.receiver=e,this.index=n}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitReadKeyExpr(this,e)},e.prototype.set=function(t){return new ji(this.receiver,this.index,t)},e}(Ri),Zi=function(t){function e(e,n){void 0===n&&(n=null),t.call(this,n),this.entries=e}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitLiteralArrayExpr(this,e)},e}(Ri),Yi=function(t){function e(e,r){void 0===r&&(r=null),t.call(this,r),this.entries=e,this.valueType=null,n(r)&&(this.valueType=r.valueType)}return gi(e,t),e.prototype.visitExpression=function(t,e){return t.visitLiteralMapExpr(this,e)},e}(Ri),to=new qi(Ai.This),eo=new qi(Ai.Super),no=(new qi(Ai.CatchError),new qi(Ai.CatchStack),new Ui(null,null));!function(t){t[t.Final=0]="Final",t[t.Private=1]="Private"}(Di||(Di={}));var ro,io=function(){function t(t){void 0===t&&(t=null),this.modifiers=t,t||(this.modifiers=[])}return t.prototype.hasModifier=function(t){return this.modifiers.indexOf(t)!==-1},t}(),oo=function(t){function e(e,r,i,o){void 0===i&&(i=null),void 0===o&&(o=null),t.call(this,o),this.name=e,this.value=r,this.type=n(i)?i:r.type}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitDeclareVarStmt(this,e)},e}(io),so=function(t){function e(e,n,r,i,o){void 0===i&&(i=null),void 0===o&&(o=null),t.call(this,o),this.name=e,this.params=n,this.statements=r,this.type=i}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitDeclareFunctionStmt(this,e)},e}(io),ao=function(t){function e(e){t.call(this),this.expr=e}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitExpressionStmt(this,e)},e}(io),uo=function(t){function e(e){t.call(this),this.value=e}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitReturnStmt(this,e)},e}(io),co=function(){function t(t,e){void 0===t&&(t=null),this.type=t,this.modifiers=e,e||(this.modifiers=[])}return t.prototype.hasModifier=function(t){return this.modifiers.indexOf(t)!==-1},t}(),lo=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,n,r),this.name=e}return gi(e,t),e}(co),po=function(t){function e(e,n,r,i,o){void 0===i&&(i=null),void 0===o&&(o=null),t.call(this,i,o),this.name=e,this.params=n,this.body=r}return gi(e,t),e}(co),ho=function(t){function e(e,n,r,i){void 0===r&&(r=null),void 0===i&&(i=null),t.call(this,r,i),this.name=e,this.body=n}return gi(e,t),e}(co),fo=function(t){function e(e,n,r,i,o,s,a){void 0===a&&(a=null),t.call(this,a),this.name=e,this.parent=n,this.fields=r,this.getters=i,this.constructorMethod=o,this.methods=s}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitDeclareClassStmt(this,e)},e}(io),yo=function(t){function e(e,n,r){void 0===r&&(r=[]),t.call(this),this.condition=e,this.trueCase=n,this.falseCase=r}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitIfStmt(this,e)},e}(io),mo=(function(t){function e(e){t.call(this),this.comment=e}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitCommentStmt(this,e)},e}(io),function(t){function e(e,n){t.call(this),this.bodyStmts=e,this.catchStmts=n}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitTryCatchStmt(this,e)},e}(io)),vo=function(t){function e(e){t.call(this),this.error=e}return gi(e,t),e.prototype.visitStatement=function(t,e){return t.visitThrowStmt(this,e)},e}(io),go=function(){function t(){}return t.prototype.visitReadVarExpr=function(t,e){return t},t.prototype.visitWriteVarExpr=function(t,e){return new Mi(t.name,t.value.visitExpression(this,e))},t.prototype.visitWriteKeyExpr=function(t,e){return new ji(t.receiver.visitExpression(this,e),t.index.visitExpression(this,e),t.value.visitExpression(this,e))},t.prototype.visitWritePropExpr=function(t,e){return new Fi(t.receiver.visitExpression(this,e),t.name,t.value.visitExpression(this,e))},t.prototype.visitInvokeMethodExpr=function(t,e){var r=n(t.builtin)?t.builtin:t.name;return new Li(t.receiver.visitExpression(this,e),r,this.visitAllExpressions(t.args,e),t.type)},t.prototype.visitInvokeFunctionExpr=function(t,e){return new Vi(t.fn.visitExpression(this,e),this.visitAllExpressions(t.args,e),t.type)},t.prototype.visitInstantiateExpr=function(t,e){return new Qi(t.classExpr.visitExpression(this,e),this.visitAllExpressions(t.args,e),t.type)},t.prototype.visitLiteralExpr=function(t,e){return t},t.prototype.visitExternalExpr=function(t,e){return t},t.prototype.visitConditionalExpr=function(t,e){return new Hi(t.condition.visitExpression(this,e),t.trueCase.visitExpression(this,e),t.falseCase.visitExpression(this,e))},t.prototype.visitNotExpr=function(t,e){return new zi(t.condition.visitExpression(this,e))},t.prototype.visitCastExpr=function(t,e){return new Gi(t.value.visitExpression(this,e),e)},t.prototype.visitFunctionExpr=function(t,e){return t},t.prototype.visitBinaryOperatorExpr=function(t,e){return new $i(t.operator,t.lhs.visitExpression(this,e),t.rhs.visitExpression(this,e),t.type)},t.prototype.visitReadPropExpr=function(t,e){return new Ki(t.receiver.visitExpression(this,e),t.name,t.type)},t.prototype.visitReadKeyExpr=function(t,e){return new Xi(t.receiver.visitExpression(this,e),t.index.visitExpression(this,e),t.type)},t.prototype.visitLiteralArrayExpr=function(t,e){return new Zi(this.visitAllExpressions(t.entries,e))},t.prototype.visitLiteralMapExpr=function(t,e){var n=this;return new Yi(t.entries.map(function(t){return[t[0],t[1].visitExpression(n,e)]}))},t.prototype.visitAllExpressions=function(t,e){var n=this;return t.map(function(t){return t.visitExpression(n,e)})},t.prototype.visitDeclareVarStmt=function(t,e){return new oo(t.name,t.value.visitExpression(this,e),t.type,t.modifiers)},t.prototype.visitDeclareFunctionStmt=function(t,e){return t},t.prototype.visitExpressionStmt=function(t,e){return new ao(t.expr.visitExpression(this,e))},t.prototype.visitReturnStmt=function(t,e){return new uo(t.value.visitExpression(this,e))},t.prototype.visitDeclareClassStmt=function(t,e){return t},t.prototype.visitIfStmt=function(t,e){return new yo(t.condition.visitExpression(this,e),this.visitAllStatements(t.trueCase,e),this.visitAllStatements(t.falseCase,e))},t.prototype.visitTryCatchStmt=function(t,e){return new mo(this.visitAllStatements(t.bodyStmts,e),this.visitAllStatements(t.catchStmts,e))},t.prototype.visitThrowStmt=function(t,e){return new vo(t.error.visitExpression(this,e))},t.prototype.visitCommentStmt=function(t,e){return t},t.prototype.visitAllStatements=function(t,e){var n=this;return t.map(function(t){return t.visitStatement(n,e)})},t}(),_o=function(){function t(){}return t.prototype.visitReadVarExpr=function(t,e){return t},t.prototype.visitWriteVarExpr=function(t,e){return t.value.visitExpression(this,e),t},t.prototype.visitWriteKeyExpr=function(t,e){return t.receiver.visitExpression(this,e),t.index.visitExpression(this,e),t.value.visitExpression(this,e),t},t.prototype.visitWritePropExpr=function(t,e){return t.receiver.visitExpression(this,e),t.value.visitExpression(this,e),t},t.prototype.visitInvokeMethodExpr=function(t,e){return t.receiver.visitExpression(this,e),this.visitAllExpressions(t.args,e),t},t.prototype.visitInvokeFunctionExpr=function(t,e){return t.fn.visitExpression(this,e),this.visitAllExpressions(t.args,e),t},t.prototype.visitInstantiateExpr=function(t,e){return t.classExpr.visitExpression(this,e),this.visitAllExpressions(t.args,e),t},t.prototype.visitLiteralExpr=function(t,e){return t},t.prototype.visitExternalExpr=function(t,e){return t},t.prototype.visitConditionalExpr=function(t,e){return t.condition.visitExpression(this,e),t.trueCase.visitExpression(this,e),t.falseCase.visitExpression(this,e),t},t.prototype.visitNotExpr=function(t,e){return t.condition.visitExpression(this,e),t},t.prototype.visitCastExpr=function(t,e){return t.value.visitExpression(this,e),t},t.prototype.visitFunctionExpr=function(t,e){return t},t.prototype.visitBinaryOperatorExpr=function(t,e){return t.lhs.visitExpression(this,e),t.rhs.visitExpression(this,e),t},t.prototype.visitReadPropExpr=function(t,e){return t.receiver.visitExpression(this,e),t},t.prototype.visitReadKeyExpr=function(t,e){return t.receiver.visitExpression(this,e),t.index.visitExpression(this,e),t},t.prototype.visitLiteralArrayExpr=function(t,e){return this.visitAllExpressions(t.entries,e),t},t.prototype.visitLiteralMapExpr=function(t,e){var n=this;return t.entries.forEach(function(t){return t[1].visitExpression(n,e)}),t},t.prototype.visitAllExpressions=function(t,e){var n=this;t.forEach(function(t){return t.visitExpression(n,e)})},t.prototype.visitDeclareVarStmt=function(t,e){return t.value.visitExpression(this,e),t},t.prototype.visitDeclareFunctionStmt=function(t,e){return t},t.prototype.visitExpressionStmt=function(t,e){return t.expr.visitExpression(this,e),t},t.prototype.visitReturnStmt=function(t,e){return t.value.visitExpression(this,e),t},t.prototype.visitDeclareClassStmt=function(t,e){return t},t.prototype.visitIfStmt=function(t,e){return t.condition.visitExpression(this,e),this.visitAllStatements(t.trueCase,e),this.visitAllStatements(t.falseCase,e),t},t.prototype.visitTryCatchStmt=function(t,e){return this.visitAllStatements(t.bodyStmts,e),this.visitAllStatements(t.catchStmts,e),t},t.prototype.visitThrowStmt=function(t,e){return t.error.visitExpression(this,e),t},t.prototype.visitCommentStmt=function(t,e){return t},t.prototype.visitAllStatements=function(t,e){var n=this;t.forEach(function(t){return t.visitStatement(n,e)})},t}(),bo=function(t){function e(e,n){t.call(this),this._varName=e,this._newValue=n}return gi(e,t),e.prototype.visitReadVarExpr=function(t,e){return t.name==this._varName?this._newValue:t},e}(go),wo=function(t){function e(){t.apply(this,arguments),this.varNames=new Set}return gi(e,t),e.prototype.visitReadVarExpr=function(t,e){return this.varNames.add(t.name),null},e}(_o),Eo="",Oo=/([A-Z])/g,Co=function(){function t(){}return t.prototype.visitArray=function(t,e){var n=this;return t.map(function(t){return F(t,n,e)})},t.prototype.visitStringMap=function(t,e){var n=this,r={};return Object.keys(t).forEach(function(i){r[i]=F(t[i],n,e)}),r},t.prototype.visitPrimitive=function(t,e){return t},t.prototype.visitOther=function(t,e){return t},t}(),So=function(){function t(t,e){void 0===e&&(e=null),this.syncResult=t,this.asyncResult=e,e||(this.asyncResult=Promise.resolve(t))}return t}(),xo=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Po=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/,To=function(){function t(){}return Object.defineProperty(t.prototype,"identifier",{get:function(){return V()},enumerable:!0,configurable:!0}),t}(),No=function(){function t(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.name=t,this.definitions=e}return t}(),ko=function(){function t(){}return t}(),Ao=function(t){function e(e,n){t.call(this),this.stateNameExpr=e,this.styles=n}return xo(e,t),e}(ko),Ro=function(t){function e(e,n){t.call(this),this.stateChangeExpr=e,this.steps=n}return xo(e,t),e}(ko),Io=function(){function t(){}return t}(),qo=function(t){function e(e){void 0===e&&(e=[]),t.call(this),this.steps=e}return xo(e,t),e}(Io),Mo=function(t){function e(e,n){void 0===n&&(n=null),t.call(this),this.offset=e,this.styles=n}return xo(e,t),e}(Io),jo=function(t){function e(e,n){void 0===e&&(e=0),void 0===n&&(n=null),t.call(this),this.timings=e,this.styles=n}return xo(e,t),e}(Io),Fo=function(t){function e(e){void 0===e&&(e=null),t.call(this),this.steps=e}return xo(e,t),e}(Io),Do=function(t){function e(e){void 0===e&&(e=null),t.call(this,e)}return xo(e,t),e}(Fo),Lo=function(t){function e(e){void 0===e&&(e=null),t.call(this,e)}return xo(e,t),e}(Fo),Vo=function(){function t(t){var e=void 0===t?{}:t,n=e.reference,r=e.name,i=e.moduleUrl,o=e.prefix,s=e.value;this.reference=n,this.name=r,this.prefix=o,this.moduleUrl=i,this.value=s}return Object.defineProperty(t.prototype,"identifier",{get:function(){return this},enumerable:!0,configurable:!0}),t}(),Qo=function(){function t(t){var e=void 0===t?{}:t,n=e.isAttribute,r=e.isSelf,i=e.isHost,o=e.isSkipSelf,s=e.isOptional,a=e.isValue,u=e.query,c=e.viewQuery,l=e.token,h=e.value;this.isAttribute=p(n),this.isSelf=p(r),this.isHost=p(i),this.isSkipSelf=p(o),this.isOptional=p(s),this.isValue=p(a),this.query=u,this.viewQuery=c,this.token=l,this.value=h}return t}(),Uo=function(){function t(t){var e=t.token,n=t.useClass,r=t.useValue,i=t.useExisting,o=t.useFactory,s=t.deps,a=t.multi;this.token=e,this.useClass=n,this.useValue=r,this.useExisting=i,this.useFactory=o,this.deps=l(s),this.multi=p(a)}return t}(),Bo=function(t){function e(e){var n=e.reference,r=e.name,i=e.moduleUrl,o=e.prefix,s=e.diDeps,a=e.value;t.call(this,{reference:n,name:r,prefix:o,moduleUrl:i,value:a}),this.diDeps=B(s)}return xo(e,t),e}(Vo),Ho=function(){function t(t){var e=t.value,n=t.identifier,r=t.identifierIsInstance;this.value=e,this.identifier=n,this.identifierIsInstance=p(r)}return Object.defineProperty(t.prototype,"reference",{get:function(){return n(this.identifier)?this.identifier.reference:this.value},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return n(this.value)?j(this.value):this.identifier.name},enumerable:!0,configurable:!0}),t}(),zo=function(t){function e(e){var n=void 0===e?{}:e,r=n.reference,i=n.name,o=n.moduleUrl,s=n.prefix,a=n.isHost,u=n.value,c=n.diDeps,l=n.lifecycleHooks;t.call(this,{reference:r,name:i,moduleUrl:o,prefix:s,value:u}),this.isHost=p(a),this.diDeps=B(c),this.lifecycleHooks=B(l)}return xo(e,t),e}(Vo),Go=function(){function t(t){var e=void 0===t?{}:t,n=e.selectors,r=e.descendants,i=e.first,o=e.propertyName,s=e.read;this.selectors=n,this.descendants=p(r),this.first=p(i),this.propertyName=o,this.read=s}return t}(),Wo=function(){function t(t){var e=void 0===t?{}:t,n=e.moduleUrl,r=e.styles,i=e.styleUrls;this.moduleUrl=n,this.styles=B(r),this.styleUrls=B(i)}return t}(),Jo=function(){function t(t){var e=void 0===t?{}:t,r=e.encapsulation,i=e.template,o=e.templateUrl,s=e.styles,a=e.styleUrls,u=e.externalStylesheets,c=e.animations,l=e.ngContentSelectors,p=e.interpolation;if(this.encapsulation=r,this.template=i,this.templateUrl=o,this.styles=B(s),this.styleUrls=B(a),this.externalStylesheets=B(u),this.animations=n(c)?ai.flatten(c):[],this.ngContentSelectors=n(l)?l:[],n(p)&&2!=p.length)throw new Error("'interpolation' should have a start and an end symbol.");this.interpolation=p}return t}(),$o=function(){function t(t){var e=void 0===t?{}:t,n=e.type,r=e.isComponent,i=e.selector,o=e.exportAs,s=e.changeDetection,a=e.inputs,u=e.outputs,c=e.hostListeners,l=e.hostProperties,p=e.hostAttributes,h=e.providers,f=e.viewProviders,d=e.queries,y=e.viewQueries,m=e.entryComponents,v=e.template;this.type=n,this.isComponent=r,this.selector=i,this.exportAs=o,this.changeDetection=s,this.inputs=a,this.outputs=u,this.hostListeners=c,this.hostProperties=l,this.hostAttributes=p,this.providers=B(h),this.viewProviders=B(f),this.queries=B(d),this.viewQueries=B(y),this.entryComponents=B(m),this.template=v}return t.create=function(e){var r=void 0===e?{}:e,i=r.type,o=r.isComponent,s=r.selector,a=r.exportAs,u=r.changeDetection,c=r.inputs,l=r.outputs,h=r.host,f=r.providers,d=r.viewProviders,y=r.queries,m=r.viewQueries,v=r.entryComponents,g=r.template,_={},b={},w={};n(h)&&Object.keys(h).forEach(function(t){var e=h[t],r=t.match(Po);null===r?w[t]=e:n(r[1])?b[r[1]]=e:n(r[2])&&(_[r[2]]=e)});var E={};n(c)&&c.forEach(function(t){var e=I(t,[t,t]);E[e[0]]=e[1]});var O={};return n(l)&&l.forEach(function(t){var e=I(t,[t,t]);O[e[0]]=e[1]}),new t({type:i,isComponent:p(o),selector:s,exportAs:a,changeDetection:u,inputs:E,outputs:O,hostListeners:_,hostProperties:b,hostAttributes:w,providers:f,viewProviders:d,queries:y,viewQueries:m,entryComponents:v,template:g})},Object.defineProperty(t.prototype,"identifier",{get:function(){return this.type},enumerable:!0,configurable:!0}),t}(),Ko=function(){function t(t){var e=void 0===t?{}:t,n=e.type,r=e.name,i=e.pure;this.type=n,this.name=r,this.pure=p(i)}return Object.defineProperty(t.prototype,"identifier",{get:function(){return this.type},enumerable:!0,configurable:!0}),t}(),Xo=function(){function t(t){var e=void 0===t?{}:t,n=e.type,r=e.providers,i=e.declaredDirectives,o=e.exportedDirectives,s=e.declaredPipes,a=e.exportedPipes,u=e.entryComponents,c=e.bootstrapComponents,l=e.importedModules,p=e.exportedModules,h=e.schemas,f=e.transitiveModule,d=e.id;this.type=n,this.declaredDirectives=B(i),this.exportedDirectives=B(o),this.declaredPipes=B(s),this.exportedPipes=B(a),this.providers=B(r),this.entryComponents=B(u),this.bootstrapComponents=B(c),this.importedModules=B(l),this.exportedModules=B(p),this.schemas=B(h),this.id=d,this.transitiveModule=f}return Object.defineProperty(t.prototype,"identifier",{get:function(){return this.type},enumerable:!0,configurable:!0}),t}(),Zo=function(){function t(t,e,n,r,i){var o=this;this.modules=t,this.providers=e,this.entryComponents=n,this.directives=r,this.pipes=i,this.directivesSet=new Set,this.pipesSet=new Set,r.forEach(function(t){return o.directivesSet.add(t.type.reference)}),i.forEach(function(t){return o.pipesSet.add(t.type.reference)})}return t}(),Yo=function(){function t(t,e){var n=e.useClass,r=e.useValue,i=e.useExisting,o=e.useFactory,s=e.deps,a=e.multi;this.token=t,this.useClass=n,this.useValue=r,this.useExisting=i,this.useFactory=o,this.dependencies=s,this.multi=!!a}return t}(),ts=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},es=function(){function t(t,e,n,r){this.input=e,this.errLocation=n,this.ctxLocation=r,this.message="Parser Error: "+t+" "+n+" ["+e+"] in "+r}return t}(),ns=function(){function t(t,e){this.start=t,this.end=e}return t}(),rs=function(){function t(t){this.span=t}return t.prototype.visit=function(t,e){return void 0===e&&(e=null),null},t.prototype.toString=function(){return"AST"},t}(),is=function(t){function e(e,n,r,i){t.call(this,e),this.prefix=n,this.uninterpretedExpression=r,this.location=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitQuote(this,e)},e.prototype.toString=function(){return"Quote"},e}(rs),os=function(t){function e(){t.apply(this,arguments)}return ts(e,t),e.prototype.visit=function(t,e){void 0===e&&(e=null)},e}(rs),ss=function(t){function e(){t.apply(this,arguments)}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitImplicitReceiver(this,e)},e}(rs),as=function(t){function e(e,n){t.call(this,e),this.expressions=n}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitChain(this,e)},e}(rs),us=function(t){function e(e,n,r,i){t.call(this,e),this.condition=n,this.trueExp=r,this.falseExp=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitConditional(this,e)},e}(rs),cs=function(t){function e(e,n,r){t.call(this,e),this.receiver=n,this.name=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitPropertyRead(this,e)},e}(rs),ls=function(t){function e(e,n,r,i){t.call(this,e),this.receiver=n,this.name=r,this.value=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitPropertyWrite(this,e)},e}(rs),ps=function(t){function e(e,n,r){t.call(this,e),this.receiver=n,this.name=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitSafePropertyRead(this,e)},e}(rs),hs=function(t){function e(e,n,r){t.call(this,e),this.obj=n,this.key=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitKeyedRead(this,e)},e}(rs),fs=function(t){function e(e,n,r,i){t.call(this,e),this.obj=n,this.key=r,this.value=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitKeyedWrite(this,e)},e}(rs),ds=function(t){function e(e,n,r,i){t.call(this,e),this.exp=n,this.name=r,this.args=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitPipe(this,e)},e}(rs),ys=function(t){function e(e,n){t.call(this,e),this.value=n}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitLiteralPrimitive(this,e)},e}(rs),ms=function(t){function e(e,n){t.call(this,e),this.expressions=n}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitLiteralArray(this,e)},e}(rs),vs=function(t){function e(e,n,r){t.call(this,e),this.keys=n,this.values=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitLiteralMap(this,e)},e}(rs),gs=function(t){function e(e,n,r){t.call(this,e),this.strings=n,this.expressions=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitInterpolation(this,e)},e}(rs),_s=function(t){function e(e,n,r,i){t.call(this,e),this.operation=n,this.left=r,this.right=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitBinary(this,e)},e}(rs),bs=function(t){function e(e,n){t.call(this,e),this.expression=n}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitPrefixNot(this,e)},e}(rs),ws=function(t){function e(e,n,r,i){t.call(this,e),this.receiver=n,this.name=r,this.args=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitMethodCall(this,e)},e}(rs),Es=function(t){function e(e,n,r,i){t.call(this,e),this.receiver=n,this.name=r,this.args=i}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitSafeMethodCall(this,e)},e}(rs),Os=function(t){function e(e,n,r){t.call(this,e),this.target=n,this.args=r}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),t.visitFunctionCall(this,e)},e}(rs),Cs=function(t){function e(e,n,r,o){ +t.call(this,new ns(0,i(n)?0:n.length)),this.ast=e,this.source=n,this.location=r,this.errors=o}return ts(e,t),e.prototype.visit=function(t,e){return void 0===e&&(e=null),this.ast.visit(t,e)},e.prototype.toString=function(){return this.source+" in "+this.location},e}(rs),Ss=function(){function t(t,e,n,r){this.key=t,this.keyIsVar=e,this.name=n,this.expression=r}return t}(),xs=function(){function t(){}return t.prototype.visitBinary=function(t,e){return t.left.visit(this),t.right.visit(this),null},t.prototype.visitChain=function(t,e){return this.visitAll(t.expressions,e)},t.prototype.visitConditional=function(t,e){return t.condition.visit(this),t.trueExp.visit(this),t.falseExp.visit(this),null},t.prototype.visitPipe=function(t,e){return t.exp.visit(this),this.visitAll(t.args,e),null},t.prototype.visitFunctionCall=function(t,e){return t.target.visit(this),this.visitAll(t.args,e),null},t.prototype.visitImplicitReceiver=function(t,e){return null},t.prototype.visitInterpolation=function(t,e){return this.visitAll(t.expressions,e)},t.prototype.visitKeyedRead=function(t,e){return t.obj.visit(this),t.key.visit(this),null},t.prototype.visitKeyedWrite=function(t,e){return t.obj.visit(this),t.key.visit(this),t.value.visit(this),null},t.prototype.visitLiteralArray=function(t,e){return this.visitAll(t.expressions,e)},t.prototype.visitLiteralMap=function(t,e){return this.visitAll(t.values,e)},t.prototype.visitLiteralPrimitive=function(t,e){return null},t.prototype.visitMethodCall=function(t,e){return t.receiver.visit(this),this.visitAll(t.args,e)},t.prototype.visitPrefixNot=function(t,e){return t.expression.visit(this),null},t.prototype.visitPropertyRead=function(t,e){return t.receiver.visit(this),null},t.prototype.visitPropertyWrite=function(t,e){return t.receiver.visit(this),t.value.visit(this),null},t.prototype.visitSafePropertyRead=function(t,e){return t.receiver.visit(this),null},t.prototype.visitSafeMethodCall=function(t,e){return t.receiver.visit(this),this.visitAll(t.args,e)},t.prototype.visitAll=function(t,e){var n=this;return t.forEach(function(t){return t.visit(n,e)}),null},t.prototype.visitQuote=function(t,e){return null},t}(),Ps=0,Ts=9,Ns=10,ks=11,As=12,Rs=13,Is=32,qs=33,Ms=34,js=35,Fs=36,Ds=37,Ls=38,Vs=39,Qs=40,Us=41,Bs=42,Hs=43,zs=44,Gs=45,Ws=46,Js=47,$s=58,Ks=59,Xs=60,Zs=61,Ys=62,ta=63,ea=48,na=57,ra=65,ia=69,oa=70,sa=88,aa=90,ua=91,ca=92,la=93,pa=94,ha=95,fa=97,da=101,ya=102,ma=110,va=114,ga=116,_a=117,ba=118,wa=120,Ea=122,Oa=123,Ca=124,Sa=125,xa=160,Pa=96,Ta=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//],Na=function(){function t(t,e){this.start=t,this.end=e}return t.fromArray=function(e){return e?(K("interpolation",e),new t(e[0],e[1])):ka},t}(),ka=new Na("{{","}}");!function(t){t[t.Character=0]="Character",t[t.Identifier=1]="Identifier",t[t.Keyword=2]="Keyword",t[t.String=3]="String",t[t.Operator=4]="Operator",t[t.Number=5]="Number",t[t.Error=6]="Error"}(ro||(ro={}));var Aa,Ra=["var","let","null","undefined","true","false","if","else","this"],Ia=function(){function t(){}return t.prototype.tokenize=function(t){for(var e=new ja(t),n=[],r=e.scanToken();null!=r;)n.push(r),r=e.scanToken();return n},t.decorators=[{type:e.Injectable}],t.ctorParameters=[],t}(),qa=function(){function t(t,e,n,r){this.index=t,this.type=e,this.numValue=n,this.strValue=r}return t.prototype.isCharacter=function(t){return this.type==ro.Character&&this.numValue==t},t.prototype.isNumber=function(){return this.type==ro.Number},t.prototype.isString=function(){return this.type==ro.String},t.prototype.isOperator=function(t){return this.type==ro.Operator&&this.strValue==t},t.prototype.isIdentifier=function(){return this.type==ro.Identifier},t.prototype.isKeyword=function(){return this.type==ro.Keyword},t.prototype.isKeywordLet=function(){return this.type==ro.Keyword&&"let"==this.strValue},t.prototype.isKeywordNull=function(){return this.type==ro.Keyword&&"null"==this.strValue},t.prototype.isKeywordUndefined=function(){return this.type==ro.Keyword&&"undefined"==this.strValue},t.prototype.isKeywordTrue=function(){return this.type==ro.Keyword&&"true"==this.strValue},t.prototype.isKeywordFalse=function(){return this.type==ro.Keyword&&"false"==this.strValue},t.prototype.isKeywordThis=function(){return this.type==ro.Keyword&&"this"==this.strValue},t.prototype.isError=function(){return this.type==ro.Error},t.prototype.toNumber=function(){return this.type==ro.Number?this.numValue:-1},t.prototype.toString=function(){switch(this.type){case ro.Character:case ro.Identifier:case ro.Keyword:case ro.Operator:case ro.String:case ro.Error:return this.strValue;case ro.Number:return this.numValue.toString();default:return null}},t}(),Ma=new qa((-1),ro.Character,0,""),ja=function(){function t(t){this.input=t,this.peek=0,this.index=-1,this.length=t.length,this.advance()}return t.prototype.advance=function(){this.peek=++this.index>=this.length?Ps:Vr.charCodeAt(this.input,this.index)},t.prototype.scanToken=function(){for(var t=this.input,e=this.length,n=this.peek,r=this.index;n<=Is;){if(++r>=e){n=Ps;break}n=Vr.charCodeAt(t,r)}if(this.peek=n,this.index=r,r>=e)return null;if(it(n))return this.scanIdentifier();if(G(n))return this.scanNumber(r);var i=r;switch(n){case Ws:return this.advance(),G(this.peek)?this.scanNumber(i):X(i,Ws);case Qs:case Us:case Oa:case Sa:case ua:case la:case zs:case $s:case Ks:return this.scanCharacter(i,n);case Vs:case Ms:return this.scanString();case js:case Hs:case Gs:case Bs:case Js:case Ds:case pa:return this.scanOperator(i,Vr.fromCharCode(n));case ta:return this.scanComplexOperator(i,"?",Ws,".");case Xs:case Ys:return this.scanComplexOperator(i,Vr.fromCharCode(n),Zs,"=");case qs:case Zs:return this.scanComplexOperator(i,Vr.fromCharCode(n),Zs,"=",Zs,"=");case Ls:return this.scanComplexOperator(i,"&",Ls,"&");case Ca:return this.scanComplexOperator(i,"|",Ca,"|");case xa:for(;z(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error("Unexpected character ["+Vr.fromCharCode(n)+"]",0)},t.prototype.scanCharacter=function(t,e){return this.advance(),X(t,e)},t.prototype.scanOperator=function(t,e){return this.advance(),tt(t,e)},t.prototype.scanComplexOperator=function(t,e,r,i,o,s){this.advance();var a=e;return this.peek==r&&(this.advance(),a+=i),n(o)&&this.peek==o&&(this.advance(),a+=s),tt(t,a)},t.prototype.scanIdentifier=function(){var t=this.index;for(this.advance();st(this.peek);)this.advance();var e=this.input.substring(t,this.index);return Ra.indexOf(e)>-1?Y(t,e):Z(t,e)},t.prototype.scanNumber=function(t){var e=this.index===t;for(this.advance();;){if(G(this.peek));else if(this.peek==Ws)e=!1;else{if(!at(this.peek))break;if(this.advance(),ut(this.peek)&&this.advance(),!G(this.peek))return this.error("Invalid exponent",-1);e=!1}this.advance()}var n=this.input.substring(t,this.index),r=e?Ur.parseIntAutoRadix(n):parseFloat(n);return nt(t,r)},t.prototype.scanString=function(){var t=this.index,e=this.peek;this.advance();for(var n,r=this.index,i=this.input;this.peek!=e;)if(this.peek==ca){null==n&&(n=new Qr),n.add(i.substring(r,this.index)),this.advance();var o;if(this.peek==_a){var s=i.substring(this.index+1,this.index+5);try{o=Ur.parseInt(s,16)}catch(a){return this.error("Invalid unicode escape [\\u"+s+"]",0)}for(var u=0;u<5;u++)this.advance()}else o=lt(this.peek),this.advance();n.add(Vr.fromCharCode(o)),r=this.index}else{if(this.peek==Ps)return this.error("Unterminated quote",0);this.advance()}var c=i.substring(r,this.index);this.advance();var l=c;return null!=n&&(n.add(c),l=n.toString()),et(t,l)},t.prototype.error=function(t,e){var n=this.index+e;return rt(n,"Lexer Error: "+t+" at column "+n+" in expression ["+this.input+"]")},t}(),Fa=function(){function t(t,e){this.strings=t,this.expressions=e}return t}(),Da=function(){function t(t,e,n){this.templateBindings=t,this.warnings=e,this.errors=n}return t}(),La=function(){function t(t){this._lexer=t,this.errors=[]}return t.prototype.parseAction=function(t,e,n){void 0===n&&(n=ka),this._checkNoInterpolation(t,e,n);var r=this._lexer.tokenize(this._stripComments(t)),i=new Va(t,e,r,(!0),this.errors).parseChain();return new Cs(i,t,e,this.errors)},t.prototype.parseBinding=function(t,e,n){void 0===n&&(n=ka);var r=this._parseBindingAst(t,e,n);return new Cs(r,t,e,this.errors)},t.prototype.parseSimpleBinding=function(t,e,n){void 0===n&&(n=ka);var r=this._parseBindingAst(t,e,n);return Qa.check(r)||this._reportError("Host binding expression can only contain field access and constants",t,e),new Cs(r,t,e,this.errors)},t.prototype._reportError=function(t,e,n,r){this.errors.push(new es(t,e,n,r))},t.prototype._parseBindingAst=function(t,e,r){var i=this._parseQuote(t,e);if(n(i))return i;this._checkNoInterpolation(t,e,r);var o=this._lexer.tokenize(this._stripComments(t));return new Va(t,e,o,(!1),this.errors).parseChain()},t.prototype._parseQuote=function(t,e){if(i(t))return null;var n=t.indexOf(":");if(n==-1)return null;var r=t.substring(0,n).trim();if(!ot(r))return null;var o=t.substring(n+1);return new is(new ns(0,t.length),r,o,e)},t.prototype.parseTemplateBindings=function(t,e){var n=this._lexer.tokenize(t);return new Va(t,e,n,(!1),this.errors).parseTemplateBindings()},t.prototype.parseInterpolation=function(t,e,n){void 0===n&&(n=ka);var r=this.splitInterpolation(t,e,n);if(null==r)return null;for(var o=[],s=0;s0?s.push(u):this._reportError("Blank expressions are not allowed in interpolated strings",t,"at column "+this._findInterpolationErrorColumn(i,a,n)+" in",e)}return new Fa(o,s)},t.prototype.wrapLiteralPrimitive=function(t,e){return new Cs(new ys(new ns(0,i(t)?0:t.length),t),t,e,this.errors)},t.prototype._stripComments=function(t){var e=this._commentStart(t);return n(e)?t.substring(0,e).trim():t},t.prototype._commentStart=function(t){for(var e=null,n=0;n1&&this._reportError("Got interpolation ("+n.start+n.end+") where expression was expected",t,"at column "+this._findInterpolationErrorColumn(i,1,n)+" in",e)},t.prototype._findInterpolationErrorColumn=function(t,e,n){for(var r="",i=0;i":case"<=":case">=":this.advance();var n=this.parseAdditive();t=new _s(this.span(t.span.start),e,t,n);continue}break}return t},t.prototype.parseAdditive=function(){for(var t=this.parseMultiplicative();this.next.type==ro.Operator;){var e=this.next.strValue;switch(e){case"+":case"-":this.advance();var n=this.parseMultiplicative();t=new _s(this.span(t.span.start),e,t,n);continue}break}return t},t.prototype.parseMultiplicative=function(){for(var t=this.parsePrefix();this.next.type==ro.Operator;){var e=this.next.strValue;switch(e){case"*":case"%":case"/":this.advance();var n=this.parsePrefix();t=new _s(this.span(t.span.start),e,t,n);continue}break}return t},t.prototype.parsePrefix=function(){if(this.next.type==ro.Operator){var t=this.inputIndex,e=this.next.strValue,n=void 0;switch(e){case"+":return this.advance(),this.parsePrefix();case"-":return this.advance(),n=this.parsePrefix(),new _s(this.span(t),e,new ys(new ns(t,t),0),n);case"!":return this.advance(),n=this.parsePrefix(),new bs(this.span(t),n)}}return this.parseCallChain()},t.prototype.parseCallChain=function(){for(var t=this.parsePrimary();;)if(this.optionalCharacter(Ws))t=this.parseAccessMemberOrMethodCall(t,!1);else if(this.optionalOperator("?."))t=this.parseAccessMemberOrMethodCall(t,!0);else if(this.optionalCharacter(ua)){this.rbracketsExpected++;var e=this.parsePipe();if(this.rbracketsExpected--,this.expectCharacter(la),this.optionalOperator("=")){var n=this.parseConditional();t=new fs(this.span(t.span.start),t,e,n)}else t=new hs(this.span(t.span.start),t,e)}else{if(!this.optionalCharacter(Qs))return t;this.rparensExpected++;var r=this.parseCallArguments();this.rparensExpected--,this.expectCharacter(Us),t=new Os(this.span(t.span.start),t,r)}},t.prototype.parsePrimary=function(){var t=this.inputIndex;if(this.optionalCharacter(Qs)){this.rparensExpected++;var e=this.parsePipe();return this.rparensExpected--,this.expectCharacter(Us),e}if(this.next.isKeywordNull())return this.advance(),new ys(this.span(t),null);if(this.next.isKeywordUndefined())return this.advance(),new ys(this.span(t),(void 0));if(this.next.isKeywordTrue())return this.advance(),new ys(this.span(t),(!0));if(this.next.isKeywordFalse())return this.advance(),new ys(this.span(t),(!1));if(this.next.isKeywordThis())return this.advance(),new ss(this.span(t));if(this.optionalCharacter(ua)){this.rbracketsExpected++;var n=this.parseExpressionList(la);return this.rbracketsExpected--,this.expectCharacter(la),new ms(this.span(t),n)}if(this.next.isCharacter(Oa))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(new ss(this.span(t)),!1);if(this.next.isNumber()){var r=this.next.toNumber();return this.advance(),new ys(this.span(t),r)}if(this.next.isString()){var i=this.next.toString();return this.advance(),new ys(this.span(t),i)}return this.index>=this.tokens.length?(this.error("Unexpected end of expression: "+this.input),new os(this.span(t))):(this.error("Unexpected token "+this.next),new os(this.span(t)))},t.prototype.parseExpressionList=function(t){var e=[];if(!this.next.isCharacter(t))do e.push(this.parsePipe());while(this.optionalCharacter(zs));return e},t.prototype.parseLiteralMap=function(){var t=[],e=[],n=this.inputIndex;if(this.expectCharacter(Oa),!this.optionalCharacter(Sa)){this.rbracesExpected++;do{var r=this.expectIdentifierOrKeywordOrString();t.push(r),this.expectCharacter($s),e.push(this.parsePipe())}while(this.optionalCharacter(zs));this.rbracesExpected--,this.expectCharacter(Sa)}return new vs(this.span(n),t,e)},t.prototype.parseAccessMemberOrMethodCall=function(t,e){void 0===e&&(e=!1);var n=t.span.start,r=this.expectIdentifierOrKeyword();if(this.optionalCharacter(Qs)){this.rparensExpected++;var i=this.parseCallArguments();this.expectCharacter(Us),this.rparensExpected--;var o=this.span(n);return e?new Es(o,t,r,i):new ws(o,t,r,i)}if(e)return this.optionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),new os(this.span(n))):new ps(this.span(n),t,r);if(this.optionalOperator("=")){if(!this.parseAction)return this.error("Bindings cannot contain assignments"),new os(this.span(n));var s=this.parseConditional();return new ls(this.span(n),t,r,s)}return new cs(this.span(n),t,r)},t.prototype.parseCallArguments=function(){if(this.next.isCharacter(Us))return[];var t=[];do t.push(this.parsePipe());while(this.optionalCharacter(zs));return t},t.prototype.expectTemplateBindingKey=function(){var t="",e=!1;do t+=this.expectIdentifierOrKeywordOrString(),e=this.optionalOperator("-"),e&&(t+="-");while(e);return t.toString()},t.prototype.parseTemplateBindings=function(){for(var t=[],e=null,n=[];this.indext.length-1&&(e=t.length-1);for(var o=e,s=0,a=0;s<100&&e>0&&(e--,s++,"\n"!=t[e]||3!=++a););for(s=0,a=0;s<100&&o]"+t.substring(this.span.start.offset,o+1);r=' ("'+u+'")'}return this.span.details&&(i=", "+this.span.details),""+this.msg+r+": "+this.span.start+i},t}(),Wa=function(){function t(t,e){this.value=t,this.sourceSpan=e}return t.prototype.visit=function(t,e){return t.visitText(this,e)},t}(),Ja=function(){function t(t,e,n,r,i){this.switchValue=t,this.type=e,this.cases=n,this.sourceSpan=r,this.switchValueSourceSpan=i}return t.prototype.visit=function(t,e){return t.visitExpansion(this,e)},t}(),$a=function(){function t(t,e,n,r,i){this.value=t,this.expression=e,this.sourceSpan=n,this.valueSourceSpan=r,this.expSourceSpan=i}return t.prototype.visit=function(t,e){return t.visitExpansionCase(this,e)},t}(),Ka=function(){function t(t,e,n){this.name=t,this.value=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitAttribute(this,e)},t}(),Xa=function(){function t(t,e,n,r,i,o){this.name=t,this.attrs=e,this.children=n,this.sourceSpan=r,this.startSourceSpan=i,this.endSourceSpan=o}return t.prototype.visit=function(t,e){return t.visitElement(this,e)},t}(),Za=function(){function t(t,e){this.value=t,this.sourceSpan=e}return t.prototype.visit=function(t,e){return t.visitComment(this,e)},t}(),Ya=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};!function(t){t[t.TAG_OPEN_START=0]="TAG_OPEN_START",t[t.TAG_OPEN_END=1]="TAG_OPEN_END",t[t.TAG_OPEN_END_VOID=2]="TAG_OPEN_END_VOID",t[t.TAG_CLOSE=3]="TAG_CLOSE",t[t.TEXT=4]="TEXT",t[t.ESCAPABLE_RAW_TEXT=5]="ESCAPABLE_RAW_TEXT",t[t.RAW_TEXT=6]="RAW_TEXT",t[t.COMMENT_START=7]="COMMENT_START",t[t.COMMENT_END=8]="COMMENT_END",t[t.CDATA_START=9]="CDATA_START",t[t.CDATA_END=10]="CDATA_END",t[t.ATTR_NAME=11]="ATTR_NAME",t[t.ATTR_VALUE=12]="ATTR_VALUE",t[t.DOC_TYPE=13]="DOC_TYPE",t[t.EXPANSION_FORM_START=14]="EXPANSION_FORM_START",t[t.EXPANSION_CASE_VALUE=15]="EXPANSION_CASE_VALUE",t[t.EXPANSION_CASE_EXP_START=16]="EXPANSION_CASE_EXP_START",t[t.EXPANSION_CASE_EXP_END=17]="EXPANSION_CASE_EXP_END",t[t.EXPANSION_FORM_END=18]="EXPANSION_FORM_END",t[t.EOF=19]="EOF"}(za||(za={}));var tu,eu=function(){function t(t,e,n){this.type=t,this.parts=e,this.sourceSpan=n}return t}(),nu=function(t){function e(e,n,r){t.call(this,r,e),this.tokenType=n}return Ya(e,t),e}(Ga),ru=function(){function t(t,e){this.tokens=t,this.errors=e}return t}(),iu=/\r\n?/g,ou=function(){function t(t){this.error=t}return t}(),su=function(){function t(t,e,n,r){void 0===r&&(r=ka),this._file=t,this._getTagDefinition=e,this._tokenizeIcu=n,this._interpolationConfig=r,this._peek=-1,this._nextPeek=-1,this._index=-1,this._line=0,this._column=-1,this._expansionCaseStack=[],this._inInterpolation=!1,this.tokens=[],this.errors=[],this._input=t.content,this._length=t.content.length,this._advance()}return t.prototype._processCarriageReturns=function(t){return t.replace(iu,"\n")},t.prototype.tokenize=function(){for(;this._peek!==Ps;){var t=this._getLocation();try{this._attemptCharCode(Xs)?this._attemptCharCode(qs)?this._attemptCharCode(ua)?this._consumeCdata(t):this._attemptCharCode(Gs)?this._consumeComment(t):this._consumeDocType(t):this._attemptCharCode(Js)?this._consumeTagClose(t):this._consumeTagOpen(t):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeText()}catch(e){if(!(e instanceof ou))throw e;this.errors.push(e.error)}}return this._beginToken(za.EOF),this._endToken([]),new ru(St(this.tokens),this.errors)},t.prototype._tokenizeExpansionForm=function(){if(wt(this._input,this._index,this._interpolationConfig))return this._consumeExpansionFormStart(),!0;if(Et(this._peek)&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._peek===Sa){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1},t.prototype._getLocation=function(){return new Ua(this._file,this._index,this._line,this._column)},t.prototype._getSpan=function(t,e){return void 0===t&&(t=this._getLocation()),void 0===e&&(e=this._getLocation()),new Ha(t,e)},t.prototype._beginToken=function(t,e){void 0===e&&(e=this._getLocation()),this._currentTokenStart=e,this._currentTokenType=t},t.prototype._endToken=function(t,e){void 0===e&&(e=this._getLocation());var n=new eu(this._currentTokenType,t,new Ha(this._currentTokenStart,e));return this.tokens.push(n),this._currentTokenStart=null,this._currentTokenType=null,n},t.prototype._createError=function(t,e){this._isInExpansionForm()&&(t+=' (Do you have an unescaped "{" in your template? Use "{{ \'{\' }}") to escape it.)');var n=new nu(t,this._currentTokenType,e);return this._currentTokenStart=null,this._currentTokenType=null,new ou(n)},t.prototype._advance=function(){if(this._index>=this._length)throw this._createError(dt(Ps),this._getSpan());this._peek===Ns?(this._line++,this._column=0):this._peek!==Ns&&this._peek!==Rs&&this._column++,this._index++,this._peek=this._index>=this._length?Ps:this._input.charCodeAt(this._index),this._nextPeek=this._index+1>=this._length?Ps:this._input.charCodeAt(this._index+1)},t.prototype._attemptCharCode=function(t){return this._peek===t&&(this._advance(),!0)},t.prototype._attemptCharCodeCaseInsensitive=function(t){return!!Ot(this._peek,t)&&(this._advance(),!0)},t.prototype._requireCharCode=function(t){var e=this._getLocation();if(!this._attemptCharCode(t))throw this._createError(dt(this._peek),this._getSpan(e,e))},t.prototype._attemptStr=function(t){var e=t.length;if(this._index+e>this._length)return!1;for(var n=this._savePosition(),r=0;rr.offset&&o.push(this._input.substring(r.offset,this._index));this._peek!==e;)o.push(this._readChar(t))}return this._endToken([this._processCarriageReturns(o.join(""))],r)},t.prototype._consumeComment=function(t){var e=this;this._beginToken(za.COMMENT_START,t),this._requireCharCode(Gs),this._endToken([]);var n=this._consumeRawText(!1,Gs,function(){return e._attemptStr("->")});this._beginToken(za.COMMENT_END,n.sourceSpan.end),this._endToken([])},t.prototype._consumeCdata=function(t){var e=this;this._beginToken(za.CDATA_START,t),this._requireStr("CDATA["),this._endToken([]);var n=this._consumeRawText(!1,la,function(){return e._attemptStr("]>")});this._beginToken(za.CDATA_END,n.sourceSpan.end),this._endToken([])},t.prototype._consumeDocType=function(t){this._beginToken(za.DOC_TYPE,t),this._attemptUntilChar(Ys),this._advance(),this._endToken([this._input.substring(t.offset+2,this._index-1)])},t.prototype._consumePrefixAndName=function(){for(var t=this._index,e=null;this._peek!==$s&&!gt(this._peek);)this._advance();var n;this._peek===$s?(this._advance(),e=this._input.substring(t,this._index-1),n=this._index):n=t,this._requireCharCodeUntilFn(vt,this._index===n?1:0);var r=this._input.substring(n,this._index);return[e,r]},t.prototype._consumeTagOpen=function(t){var e,n,r=this._savePosition();try{if(!W(this._peek))throw this._createError(dt(this._peek),this._getSpan());var i=this._index;for(this._consumeTagOpenStart(t),e=this._input.substring(i,this._index),n=e.toLowerCase(),this._attemptCharCodeUntilFn(mt);this._peek!==Js&&this._peek!==Ys;)this._consumeAttributeName(),this._attemptCharCodeUntilFn(mt),this._attemptCharCode(Zs)&&(this._attemptCharCodeUntilFn(mt),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(mt);this._consumeTagOpenEnd()}catch(o){if(o instanceof ou)return this._restorePosition(r), +this._beginToken(za.TEXT,t),void this._endToken(["<"]);throw o}var s=this._getTagDefinition(e).contentType;s===ni.RAW_TEXT?this._consumeRawTextWithTagClose(n,!1):s===ni.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(n,!0)},t.prototype._consumeRawTextWithTagClose=function(t,e){var n=this,r=this._consumeRawText(e,Xs,function(){return!!n._attemptCharCode(Js)&&(n._attemptCharCodeUntilFn(mt),!!n._attemptStrCaseInsensitive(t)&&(n._attemptCharCodeUntilFn(mt),n._attemptCharCode(Ys)))});this._beginToken(za.TAG_CLOSE,r.sourceSpan.end),this._endToken([null,t])},t.prototype._consumeTagOpenStart=function(t){this._beginToken(za.TAG_OPEN_START,t);var e=this._consumePrefixAndName();this._endToken(e)},t.prototype._consumeAttributeName=function(){this._beginToken(za.ATTR_NAME);var t=this._consumePrefixAndName();this._endToken(t)},t.prototype._consumeAttributeValue=function(){this._beginToken(za.ATTR_VALUE);var t;if(this._peek===Vs||this._peek===Ms){var e=this._peek;this._advance();for(var n=[];this._peek!==e;)n.push(this._readChar(!0));t=n.join(""),this._advance()}else{var r=this._index;this._requireCharCodeUntilFn(vt,1),t=this._input.substring(r,this._index)}this._endToken([this._processCarriageReturns(t)])},t.prototype._consumeTagOpenEnd=function(){var t=this._attemptCharCode(Js)?za.TAG_OPEN_END_VOID:za.TAG_OPEN_END;this._beginToken(t),this._requireCharCode(Ys),this._endToken([])},t.prototype._consumeTagClose=function(t){this._beginToken(za.TAG_CLOSE,t),this._attemptCharCodeUntilFn(mt);var e=this._consumePrefixAndName();this._attemptCharCodeUntilFn(mt),this._requireCharCode(Ys),this._endToken(e)},t.prototype._consumeExpansionFormStart=function(){this._beginToken(za.EXPANSION_FORM_START,this._getLocation()),this._requireCharCode(Oa),this._endToken([]),this._expansionCaseStack.push(za.EXPANSION_FORM_START),this._beginToken(za.RAW_TEXT,this._getLocation());var t=this._readUntil(zs);this._endToken([t],this._getLocation()),this._requireCharCode(zs),this._attemptCharCodeUntilFn(mt),this._beginToken(za.RAW_TEXT,this._getLocation());var e=this._readUntil(zs);this._endToken([e],this._getLocation()),this._requireCharCode(zs),this._attemptCharCodeUntilFn(mt)},t.prototype._consumeExpansionCaseStart=function(){this._beginToken(za.EXPANSION_CASE_VALUE,this._getLocation());var t=this._readUntil(Oa).trim();this._endToken([t],this._getLocation()),this._attemptCharCodeUntilFn(mt),this._beginToken(za.EXPANSION_CASE_EXP_START,this._getLocation()),this._requireCharCode(Oa),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(mt),this._expansionCaseStack.push(za.EXPANSION_CASE_EXP_START)},t.prototype._consumeExpansionCaseEnd=function(){this._beginToken(za.EXPANSION_CASE_EXP_END,this._getLocation()),this._requireCharCode(Sa),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(mt),this._expansionCaseStack.pop()},t.prototype._consumeExpansionFormEnd=function(){this._beginToken(za.EXPANSION_FORM_END,this._getLocation()),this._requireCharCode(Sa),this._endToken([]),this._expansionCaseStack.pop()},t.prototype._consumeText=function(){var t=this._getLocation();this._beginToken(za.TEXT,t);var e=[];do this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(e.push(this._interpolationConfig.start),this._inInterpolation=!0):this._interpolationConfig&&this._attemptStr(this._interpolationConfig.end)&&this._inInterpolation?(e.push(this._interpolationConfig.end),this._inInterpolation=!1):e.push(this._readChar(!0));while(!this._isTextEnd());this._endToken([this._processCarriageReturns(e.join(""))])},t.prototype._isTextEnd=function(){if(this._peek===Xs||this._peek===Ps)return!0;if(this._tokenizeIcu&&!this._inInterpolation){if(wt(this._input,this._index,this._interpolationConfig))return!0;if(this._peek===Sa&&this._isInExpansionCase())return!0}return!1},t.prototype._savePosition=function(){return[this._peek,this._index,this._column,this._line,this.tokens.length]},t.prototype._readUntil=function(t){var e=this._index;return this._attemptUntilChar(t),this._input.substring(e,this._index)},t.prototype._restorePosition=function(t){this._peek=t[0],this._index=t[1],this._column=t[2],this._line=t[3];var e=t[4];e0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===za.EXPANSION_CASE_EXP_START},t.prototype._isInExpansionForm=function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===za.EXPANSION_FORM_START},t}(),au=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},uu=function(t){function e(e,n,r){t.call(this,n,r),this.elementName=e}return au(e,t),e.create=function(t,n,r){return new e(t,n,r)},e}(Ga),cu=function(){function t(t,e){this.rootNodes=t,this.errors=e}return t}(),lu=function(){function t(t){this.getTagDefinition=t}return t.prototype.parse=function(t,e,n,r){void 0===n&&(n=!1),void 0===r&&(r=ka);var i=ft(t,e,this.getTagDefinition,n,r),o=new pu(i.tokens,this.getTagDefinition).build();return new cu(o.rootNodes,i.errors.concat(o.errors))},t}(),pu=function(){function t(t,e){this.tokens=t,this.getTagDefinition=e,this._index=-1,this._rootNodes=[],this._errors=[],this._elementStack=[],this._advance()}return t.prototype.build=function(){for(;this._peek.type!==za.EOF;)this._peek.type===za.TAG_OPEN_START?this._consumeStartTag(this._advance()):this._peek.type===za.TAG_CLOSE?this._consumeEndTag(this._advance()):this._peek.type===za.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===za.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===za.TEXT||this._peek.type===za.RAW_TEXT||this._peek.type===za.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===za.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._advance();return new cu(this._rootNodes,this._errors)},t.prototype._advance=function(){var t=this._peek;return this._index0)return this._errors=this._errors.concat(o.errors),null;var s=new Ha(e.sourceSpan.start,i.sourceSpan.end),a=new Ha(n.sourceSpan.start,i.sourceSpan.end);return new $a(e.parts[0],o.rootNodes,s,e.sourceSpan,a)},t.prototype._collectExpansionExpTokens=function(t){for(var e=[],n=[za.EXPANSION_CASE_EXP_START];;){if(this._peek.type!==za.EXPANSION_FORM_START&&this._peek.type!==za.EXPANSION_CASE_EXP_START||n.push(this._peek.type),this._peek.type===za.EXPANSION_CASE_EXP_END){if(!xt(n,za.EXPANSION_CASE_EXP_START))return this._errors.push(uu.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(n.pop(),0==n.length)return e}if(this._peek.type===za.EXPANSION_FORM_END){if(!xt(n,za.EXPANSION_FORM_START))return this._errors.push(uu.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;n.pop()}if(this._peek.type===za.EOF)return this._errors.push(uu.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;e.push(this._advance())}},t.prototype._consumeText=function(t){var e=t.parts[0];if(e.length>0&&"\n"==e[0]){var r=this._getParentElement();n(r)&&0==r.children.length&&this.getTagDefinition(r.name).ignoreFirstLf&&(e=e.substring(1))}e.length>0&&this._addToParent(new Wa(e,t.sourceSpan))},t.prototype._closeVoidElement=function(){if(this._elementStack.length>0){var t=ai.last(this._elementStack);this.getTagDefinition(t.name).isVoid&&this._elementStack.pop()}},t.prototype._consumeStartTag=function(t){for(var e=t.parts[0],n=t.parts[1],r=[];this._peek.type===za.ATTR_NAME;)r.push(this._consumeAttr(this._advance()));var i=this._getElementFullName(e,n,this._getParentElement()),o=!1;if(this._peek.type===za.TAG_OPEN_END_VOID){this._advance(),o=!0;var s=this.getTagDefinition(i);s.canSelfClose||null!==_(i)||s.isVoid||this._errors.push(uu.create(i,t.sourceSpan,'Only void and foreign elements can be self closed "'+t.parts[1]+'"'))}else this._peek.type===za.TAG_OPEN_END&&(this._advance(),o=!1);var a=this._peek.sourceSpan.start,u=new Ha(t.sourceSpan.start,a),c=new Xa(i,r,[],u,u,null);this._pushElement(c),o&&(this._popElement(i),c.endSourceSpan=u)},t.prototype._pushElement=function(t){if(this._elementStack.length>0){var e=ai.last(this._elementStack);this.getTagDefinition(e.name).isClosedByChild(t.name)&&this._elementStack.pop()}var r=this.getTagDefinition(t.name),i=this._getParentElementSkippingContainers(),o=i.parent,s=i.container;if(n(o)&&r.requireExtraParent(o.name)){var a=new Xa(r.parentToAdd,[],[],t.sourceSpan,t.startSourceSpan,t.endSourceSpan);this._insertBeforeContainer(o,s,a)}this._addToParent(t),this._elementStack.push(t)},t.prototype._consumeEndTag=function(t){var e=this._getElementFullName(t.parts[0],t.parts[1],this._getParentElement());this._getParentElement()&&(this._getParentElement().endSourceSpan=t.sourceSpan),this.getTagDefinition(e).isVoid?this._errors.push(uu.create(e,t.sourceSpan,'Void elements do not have end tags "'+t.parts[1]+'"')):this._popElement(e)||this._errors.push(uu.create(e,t.sourceSpan,'Unexpected closing tag "'+t.parts[1]+'"'))},t.prototype._popElement=function(t){for(var e=this._elementStack.length-1;e>=0;e--){var n=this._elementStack[e];if(n.name==t)return ai.splice(this._elementStack,e,this._elementStack.length-e),!0;if(!this.getTagDefinition(n.name).closedByParent)return!1}return!1},t.prototype._consumeAttr=function(t){var e=b(t.parts[0],t.parts[1]),n=t.sourceSpan.end,r="";if(this._peek.type===za.ATTR_VALUE){var i=this._advance();r=i.parts[0],n=i.sourceSpan.end}return new Ka(e,r,new Ha(t.sourceSpan.start,n))},t.prototype._getParentElement=function(){return this._elementStack.length>0?ai.last(this._elementStack):null},t.prototype._getParentElementSkippingContainers=function(){for(var t=null,e=this._elementStack.length-1;e>=0;e--){if("ng-container"!==this._elementStack[e].name)return{parent:this._elementStack[e],container:t};t=this._elementStack[e]}return{parent:ai.last(this._elementStack),container:t}},t.prototype._addToParent=function(t){var e=this._getParentElement();n(e)?e.children.push(t):this._rootNodes.push(t)},t.prototype._insertBeforeContainer=function(t,e,n){if(e){if(t){var r=t.children.indexOf(e);t.children[r]=n}else this._rootNodes.push(n);n.children.push(e),this._elementStack.splice(this._elementStack.indexOf(e),0,n)}else this._addToParent(n),this._elementStack.push(n)},t.prototype._getElementFullName=function(t,e,r){return i(t)&&(t=this.getTagDefinition(e).implicitNamespacePrefix,i(t)&&n(r)&&(t=_(r.name))),b(t,e)},t}(),hu=function(){function t(){}return t.prototype.visitText=function(t,e){return t.value},t.prototype.visitContainer=function(t,e){var n=this;return"["+t.children.map(function(t){return t.visit(n)}).join(", ")+"]"},t.prototype.visitIcu=function(t,e){var n=this,r=Object.keys(t.cases).map(function(e){return e+" {"+t.cases[e].visit(n)+"}"});return"{"+t.expression+", "+t.type+", "+r.join(", ")+"}"},t.prototype.visitTagPlaceholder=function(t,e){var n=this;return t.isVoid?'':''+t.children.map(function(t){return t.visit(n)}).join(", ")+''},t.prototype.visitPlaceholder=function(t,e){return''+t.value+""},t.prototype.visitIcuPlaceholder=function(t,e){return''+t.value.visit(this)+""},t}(),fu=new hu,du=function(){function t(t,e,n,r,i){this.nodes=t,this.placeholders=e,this.placeholderToMsgIds=n,this.meaning=r,this.description=i}return t}(),yu=function(){function t(t,e){this.value=t,this.sourceSpan=e}return t.prototype.visit=function(t,e){return t.visitText(this,e)},t}(),mu=function(){function t(t,e){this.children=t,this.sourceSpan=e}return t.prototype.visit=function(t,e){return t.visitContainer(this,e)},t}(),vu=function(){function t(t,e,n,r){this.expression=t,this.type=e,this.cases=n,this.sourceSpan=r}return t.prototype.visit=function(t,e){return t.visitIcu(this,e)},t}(),gu=function(){function t(t,e,n,r,i,o,s){this.tag=t,this.attrs=e,this.startName=n,this.closeName=r,this.children=i,this.isVoid=o,this.sourceSpan=s}return t.prototype.visit=function(t,e){return t.visitTagPlaceholder(this,e)},t}(),_u=function(){function t(t,e,n){void 0===e&&(e=""),this.value=t,this.name=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitPlaceholder(this,e)},t}(),bu=function(){function t(t,e,n){void 0===e&&(e=""),this.value=t,this.name=e,this.sourceSpan=n}return t.prototype.visit=function(t,e){return t.visitIcuPlaceholder(this,e)},t}(),wu={A:"LINK",B:"BOLD_TEXT",BR:"LINE_BREAK",EM:"EMPHASISED_TEXT",H1:"HEADING_LEVEL1",H2:"HEADING_LEVEL2",H3:"HEADING_LEVEL3",H4:"HEADING_LEVEL4",H5:"HEADING_LEVEL5",H6:"HEADING_LEVEL6",HR:"HORIZONTAL_RULE",I:"ITALIC_TEXT",LI:"LIST_ITEM",LINK:"MEDIA_LINK",OL:"ORDERED_LIST",P:"PARAGRAPH",Q:"QUOTATION",S:"STRIKETHROUGH_TEXT",SMALL:"SMALL_TEXT",SUB:"SUBSTRIPT",SUP:"SUPERSCRIPT",TBODY:"TABLE_BODY",TD:"TABLE_CELL",TFOOT:"TABLE_FOOTER",TH:"TABLE_HEADER_CELL",THEAD:"TABLE_HEADER",TR:"TABLE_ROW",TT:"MONOSPACED_TEXT",U:"UNDERLINED_TEXT",UL:"UNORDERED_LIST"},Eu=function(){function t(){this._placeHolderNameCounts={},this._signatureToName={}}return t.prototype.getStartTagPlaceholderName=function(t,e,n){var r=this._hashTag(t,e,n);if(this._signatureToName[r])return this._signatureToName[r];var i=t.toUpperCase(),o=wu[i]||"TAG_"+i,s=this._generateUniqueName(n?o:"START_"+o);return this._signatureToName[r]=s,s},t.prototype.getCloseTagPlaceholderName=function(t){var e=this._hashClosingTag(t);if(this._signatureToName[e])return this._signatureToName[e];var n=t.toUpperCase(),r=wu[n]||"TAG_"+n,i=this._generateUniqueName("CLOSE_"+r);return this._signatureToName[e]=i,i},t.prototype.getPlaceholderName=function(t,e){var n=t.toUpperCase(),r="PH: "+n+"="+e;if(this._signatureToName[r])return this._signatureToName[r];var i=this._generateUniqueName(n);return this._signatureToName[r]=i,i},t.prototype._hashTag=function(t,e,n){var r="<"+t,i=Object.keys(e).sort().map(function(t){return" "+t+"="+e[t]}).join(""),o=n?"/>":">";return r+i+o},t.prototype._hashClosingTag=function(t){return this._hashTag("/"+t,{},!1)},t.prototype._generateUniqueName=function(t){var e=t,n=this._placeHolderNameCounts[e];return n?(e+="_"+n,n++):n=1,this._placeHolderNameCounts[t]=n,e},t}(),Ou=new La(new Ia),Cu=function(){function t(t,e){this._expressionParser=t,this._interpolationConfig=e}return t.prototype.toI18nMessage=function(t,e,n){this._isIcu=1==t.length&&t[0]instanceof Ja,this._icuDepth=0,this._placeholderRegistry=new Eu,this._placeholderToContent={},this._placeholderToIds={};var r=ht(this,t,{});return new du(r,this._placeholderToContent,this._placeholderToIds,e,n)},t.prototype.visitElement=function(t,e){var n=ht(this,t.children),r={};t.attrs.forEach(function(t){r[t.name]=t.value});var i=w(t.name).isVoid,o=this._placeholderRegistry.getStartTagPlaceholderName(t.name,r,i);this._placeholderToContent[o]=t.sourceSpan.toString();var s="";return i||(s=this._placeholderRegistry.getCloseTagPlaceholderName(t.name),this._placeholderToContent[s]=""),new gu(t.name,r,o,s,n,i,t.sourceSpan)},t.prototype.visitAttribute=function(t,e){return this._visitTextWithInterpolation(t.value,t.sourceSpan)},t.prototype.visitText=function(t,e){return this._visitTextWithInterpolation(t.value,t.sourceSpan)},t.prototype.visitComment=function(t,e){return null},t.prototype.visitExpansion=function(e,n){var r=this;this._icuDepth++;var i={},o=new vu(e.switchValue,e.type,i,e.sourceSpan);if(e.cases.forEach(function(t){i[t.value]=new mu(t.expression.map(function(t){return t.visit(r,{})}),t.expSourceSpan)}),this._icuDepth--,this._isIcu||this._icuDepth>0)return o;var s=this._placeholderRegistry.getPlaceholderName("ICU",e.sourceSpan.toString()),a=new t(this._expressionParser,this._interpolationConfig);return this._placeholderToIds[s]=Pt(a.toI18nMessage([e],"","")),new bu(o,s,e.sourceSpan)},t.prototype.visitExpansionCase=function(t,e){throw new Error("Unreachable code")},t.prototype._visitTextWithInterpolation=function(t,e){var n=this._expressionParser.splitInterpolation(t,e.start.toString(),this._interpolationConfig);if(!n)return new yu(t,e);for(var r=[],i=new mu(r,e),o=this._interpolationConfig,s=o.start,a=o.end,u=0;u=n;i--){var o=this._messages[i].nodes;if(!(1==o.length&&o[0]instanceof yu)){this._messages.splice(i,1);break}}this._msgCountAtSectionStart=void 0},t.prototype._reportError=function(t,e){this._errors.push(new Pu(t.sourceSpan,e))},t}(),qu=function(){function t(t,e,n){this._htmlParser=t,this._implicitTags=e,this._implicitAttrs=n,this._messageMap={}}return t.prototype.updateFromTemplate=function(t,e,n){var r=this,i=this._htmlParser.parse(t,e,!0,n);if(i.errors.length)return i.errors;var o=Lt(i.rootNodes,n,this._implicitTags,this._implicitAttrs);return o.errors.length?o.errors:void o.messages.forEach(function(t){r._messageMap[Pt(t)]=t})},t.prototype.getMessageMap=function(){return this._messageMap},t.prototype.write=function(t){return t.write(this._messageMap)},t}(),Mu=function(){function t(){this.closedByParent=!1,this.contentType=ni.PARSABLE_DATA,this.isVoid=!1,this.ignoreFirstLf=!1,this.canSelfClose=!0}return t.prototype.requireExtraParent=function(t){return!1},t.prototype.isClosedByChild=function(t){return!1},t}(),ju=new Mu,Fu=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Du=function(t){function e(){t.call(this,zt)}return Fu(e,t),e.prototype.parse=function(e,n,r){return void 0===r&&(r=!1),t.prototype.parse.call(this,e,n,r,null)},e}(lu),Lu=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Vu=function(){function t(){}return t.prototype.visitTag=function(t){var e=this,n=this._serializeAttributes(t.attrs);if(0==t.children.length)return"<"+t.name+n+"/>";var r=t.children.map(function(t){return t.visit(e)});return"<"+t.name+n+">"+r.join("")+""},t.prototype.visitText=function(t){return t.value},t.prototype.visitDeclaration=function(t){return""},t.prototype._serializeAttributes=function(t){var e=Object.keys(t).map(function(e){return e+'="'+t[e]+'"'}).join(" ");return e.length>0?" "+e:""},t.prototype.visitDoctype=function(t){return""},t}(),Qu=new Vu,Uu=function(){function t(t){var e=this;this.attrs={},Object.keys(t).forEach(function(n){e.attrs[n]=$t(t[n])})}return t.prototype.visit=function(t){return t.visitDeclaration(this)},t}(),Bu=function(){function t(t,e){this.rootTag=t,this.dtd=e}return t.prototype.visit=function(t){return t.visitDoctype(this)},t}(),Hu=function(){function t(t,e,n){var r=this;void 0===e&&(e={}),void 0===n&&(n=[]),this.name=t,this.children=n,this.attrs={},Object.keys(e).forEach(function(t){r.attrs[t]=$t(e[t])})}return t.prototype.visit=function(t){return t.visitTag(this)},t}(),zu=function(){function t(t){this.value=$t(t)}return t.prototype.visit=function(t){return t.visitText(this)},t}(),Gu=function(t){function e(e){void 0===e&&(e=0),t.call(this,"\n"+new Array(e+1).join(" "))}return Lu(e,t),e}(zu),Wu=[[/&/g,"&"],[/"/g,"""],[/'/g,"'"],[//g,">"]],Ju="1.2",$u="urn:oasis:names:tc:xliff:document:1.2",Ku="en",Xu="x",Zu="source",Yu="target",tc="trans-unit",ec=function(){function t(t,e){this._htmlParser=t,this._interpolationConfig=e}return t.prototype.write=function(t){var e=new nc,n=[];Object.keys(t).forEach(function(r){var i=t[r],o=new Hu(tc,{id:r,datatype:"html"});o.children.push(new Gu(8),new Hu(Zu,{},e.serialize(i.nodes)),new Gu(8),new Hu(Yu)),i.description&&o.children.push(new Gu(8),new Hu("note",{priority:"1",from:"description"},[new zu(i.description)])),i.meaning&&o.children.push(new Gu(8),new Hu("note",{priority:"1",from:"meaning"},[new zu(i.meaning)])),o.children.push(new Gu(6)),n.push(new Gu(6),o)});var r=new Hu("body",{},n.concat([new Gu(4)])),i=new Hu("file",{"source-language":Ku,datatype:"plaintext",original:"ng2.template"},[new Gu(4),r,new Gu(2)]),o=new Hu("xliff",{version:Ju,xmlns:$u},[new Gu(2),i,new Gu]);return Jt([new Uu({version:"1.0",encoding:"UTF-8"}),new Gu,o,new Gu])},t.prototype.load=function(t,e,n){var r=this,i=(new Du).parse(t,e);if(i.errors.length)throw new Error("xtb parse errors:\n"+i.errors.join("\n"));var o=(new rc).parse(i.rootNodes,n),s=o.messages,a=o.errors;if(a.length)throw new Error("xtb parse errors:\n"+a.join("\n"));var u={},c=[];if(Object.keys(s).forEach(function(t){var n=r._htmlParser.parse(s[t],e,!0,r._interpolationConfig);c.push.apply(c,n.errors),u[t]=n.rootNodes}),c.length)throw new Error("xtb parse errors:\n"+c.join("\n"));return u},t}(),nc=function(){function t(){}return t.prototype.visitText=function(t,e){return[new zu(t.value)]},t.prototype.visitContainer=function(t,e){var n=this,r=[];return t.children.forEach(function(t){return r.push.apply(r,t.visit(n))}),r},t.prototype.visitIcu=function(t,e){if(this._isInIcu)throw new Error("xliff does not support nested ICU messages");this._isInIcu=!0;var n=[];return this._isInIcu=!1,n},t.prototype.visitTagPlaceholder=function(t,e){var n=Kt(t.tag),r=new Hu(Xu,{id:t.startName,ctype:n});if(t.isVoid)return[r];var i=new Hu(Xu,{id:t.closeName,ctype:n});return[r].concat(this.serialize(t.children),[i])},t.prototype.visitPlaceholder=function(t,e){return[new Hu(Xu,{id:t.name})]},t.prototype.visitIcuPlaceholder=function(t,e){return[new Hu(Xu,{id:t.name})]},t.prototype.serialize=function(t){var e=this;return this._isInIcu=!1,ai.flatten(t.map(function(t){return t.visit(e)}))},t}(),rc=function(){function t(){}return t.prototype.parse=function(t,e){var n=this;this._messageNodes=[],this._translatedMessages={},this._msgId="",this._target=[],this._errors=[],ht(this,t,null);var r=e.getMessageMap(),i=Gt(e),o=Wt(e);return this._messageNodes.filter(function(t){return r.hasOwnProperty(t[0])}).sort(function(t,e){return 0==Object.keys(r[t[0]].placeholderToMsgIds).length?-1:0==Object.keys(r[e[0]].placeholderToMsgIds).length?1:0}).forEach(function(t){var e=t[0];n._placeholders=i[e]||{},n._placeholderToIds=o[e]||{},n._translatedMessages[e]=ht(n,t[1]).join("")}),{messages:this._translatedMessages,errors:this._errors}},t.prototype.visitElement=function(t,e){switch(t.name){case tc:this._target=null;var n=t.attrs.find(function(t){return"id"===t.name});n?this._msgId=n.value:this._addError(t,"<"+tc+'> misses the "id" attribute'),ht(this,t.children,null),null!==this._msgId&&this._messageNodes.push([this._msgId,this._target]);break;case Zu:break;case Yu:this._target=t.children;break;case Xu:var r=t.attrs.find(function(t){return"id"===t.name});if(r){var i=r.value;if(this._placeholders.hasOwnProperty(i))return this._placeholders[i];if(this._placeholderToIds.hasOwnProperty(i)&&this._translatedMessages.hasOwnProperty(this._placeholderToIds[i]))return this._translatedMessages[this._placeholderToIds[i]];this._addError(t,'The placeholder "'+i+'" does not exists in the source message')}else this._addError(t,"<"+Xu+'> misses the "id" attribute');break;default:ht(this,t.children,null)}},t.prototype.visitAttribute=function(t,e){throw new Error("unreachable code")},t.prototype.visitText=function(t,e){return t.value},t.prototype.visitComment=function(t,e){return""},t.prototype.visitExpansion=function(t,e){throw new Error("unreachable code")},t.prototype.visitExpansionCase=function(t,e){throw new Error("unreachable code")},t.prototype._addError=function(t,e){this._errors.push(new Pu(t.sourceSpan,e))},t}(),ic="messagebundle",oc="msg",sc="ph",ac="ex",uc='\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n',cc=function(){ function t(){}return t.prototype.write=function(t){var e=new lc,n=new Hu(ic);return Object.keys(t).forEach(function(r){var i=t[r],o={id:r};i.description&&(o.desc=i.description),i.meaning&&(o.meaning=i.meaning),n.children.push(new Gu(2),new Hu(oc,o,e.serialize(i.nodes)))}),n.children.push(new Gu),Jt([new Uu({version:"1.0",encoding:"UTF-8"}),new Gu,new Bu(ic,uc),new Gu,n,new Gu])},t.prototype.load=function(t,e,n){throw new Error("Unsupported")},t}(),lc=function(){function t(){}return t.prototype.visitText=function(t,e){return[new zu(t.value)]},t.prototype.visitContainer=function(t,e){var n=this,r=[];return t.children.forEach(function(t){return r.push.apply(r,t.visit(n))}),r},t.prototype.visitIcu=function(t,e){var n=this,r=[new zu("{"+t.expression+", "+t.type+", ")];return Object.keys(t.cases).forEach(function(e){r.push.apply(r,[new zu(e+" {")].concat(t.cases[e].visit(n),[new zu("} ")]))}),r.push(new zu("}")),r},t.prototype.visitTagPlaceholder=function(t,e){var n=new Hu(ac,{},[new zu("<"+t.tag+">")]),r=new Hu(sc,{name:t.startName},[n]);if(t.isVoid)return[r];var i=new Hu(ac,{},[new zu("")]),o=new Hu(sc,{name:t.closeName},[i]);return[r].concat(this.serialize(t.children),[o])},t.prototype.visitPlaceholder=function(t,e){return[new Hu(sc,{name:t.name})]},t.prototype.visitIcuPlaceholder=function(t,e){return[new Hu(sc,{name:t.name})]},t.prototype.serialize=function(t){var e=this;return ai.flatten(t.map(function(t){return t.visit(e)}))},t}(),pc="translationbundle",hc="translation",fc="ph",dc=function(){function t(t,e){this._htmlParser=t,this._interpolationConfig=e}return t.prototype.write=function(t){throw new Error("Unsupported")},t.prototype.load=function(t,e,n){var r=this,i=(new Du).parse(t,e);if(i.errors.length)throw new Error("xtb parse errors:\n"+i.errors.join("\n"));var o=(new yc).parse(i.rootNodes,n),s=o.messages,a=o.errors;if(a.length)throw new Error("xtb parse errors:\n"+a.join("\n"));var u={},c=[];if(Object.keys(s).forEach(function(t){var n=r._htmlParser.parse(s[t],e,!0,r._interpolationConfig);c.push.apply(c,n.errors),u[t]=n.rootNodes}),c.length)throw new Error("xtb parse errors:\n"+c.join("\n"));return u},t}(),yc=function(){function t(){}return t.prototype.parse=function(t,e){var n=this;this._messageNodes=[],this._translatedMessages={},this._bundleDepth=0,this._translationDepth=0,this._errors=[],ht(this,t,null);var r=e.getMessageMap(),i=Gt(e),o=Wt(e);return this._messageNodes.filter(function(t){return r.hasOwnProperty(t[0])}).sort(function(t,e){return 0==Object.keys(r[t[0]].placeholderToMsgIds).length?-1:0==Object.keys(r[e[0]].placeholderToMsgIds).length?1:0}).forEach(function(t){var e=t[0];n._placeholders=i[e]||{},n._placeholderToIds=o[e]||{},n._translatedMessages[e]=ht(n,t[1]).join("")}),{messages:this._translatedMessages,errors:this._errors}},t.prototype.visitElement=function(t,e){switch(t.name){case pc:this._bundleDepth++,this._bundleDepth>1&&this._addError(t,"<"+pc+"> elements can not be nested"),ht(this,t.children,null),this._bundleDepth--;break;case hc:this._translationDepth++,this._translationDepth>1&&this._addError(t,"<"+hc+"> elements can not be nested");var n=t.attrs.find(function(t){return"id"===t.name});n?this._messageNodes.push([n.value,t.children]):this._addError(t,"<"+hc+'> misses the "id" attribute'),this._translationDepth--;break;case fc:var r=t.attrs.find(function(t){return"name"===t.name});if(r){var i=r.value;if(this._placeholders.hasOwnProperty(i))return this._placeholders[i];if(this._placeholderToIds.hasOwnProperty(i)&&this._translatedMessages.hasOwnProperty(this._placeholderToIds[i]))return this._translatedMessages[this._placeholderToIds[i]];this._addError(t,'The placeholder "'+i+'" does not exists in the source message')}else this._addError(t,"<"+fc+'> misses the "name" attribute');break;default:this._addError(t,"Unexpected tag")}},t.prototype.visitAttribute=function(t,e){throw new Error("unreachable code")},t.prototype.visitText=function(t,e){return t.value},t.prototype.visitComment=function(t,e){return""},t.prototype.visitExpansion=function(t,e){var n=this;t.cases.map(function(t){return t.visit(n,null)});return"{"+t.switchValue+", "+t.type+", strCases.join(' ')}"},t.prototype.visitExpansionCase=function(t,e){return t.value+" {"+ht(this,t.expression,null)+"}"},t.prototype._addError=function(t,e){this._errors.push(new Pu(t.sourceSpan,e))},t}(),mc=function(){function t(t){void 0===t&&(t={}),this._messageMap=t}return t.load=function(e,n,r,i){return new t(i.load(e,n,r))},t.prototype.get=function(t){return this._messageMap[t]},t.prototype.has=function(t){return t in this._messageMap},t}(),vc=function(){function t(t,e,n){this._htmlParser=t,this._translations=e,this._translationsFormat=n}return t.prototype.parse=function(t,e,n,r){void 0===n&&(n=!1),void 0===r&&(r=ka);var i=this._htmlParser.parse(t,e,n,r);if(!this._translations||""===this._translations)return i;var o=new qu(this._htmlParser,[],{}),s=o.updateFromTemplate(t,e,r);if(s&&s.length)return new cu(i.rootNodes,i.errors.concat(s));var a=this._createSerializer(r),u=mc.load(this._translations,e,o,a);return Vt(i.rootNodes,u,r,[],{})},t.prototype._createSerializer=function(t){var e=(this._translationsFormat||"xlf").toLowerCase();switch(e){case"xmb":return new cc;case"xtb":return new dc(this._htmlParser,t);case"xliff":case"xlf":default:return new ec(this._htmlParser,t)}},t}(),gc=e.__core_private__.isDefaultChangeDetectionStrategy,_c=e.__core_private__.ChangeDetectorStatus,bc=e.__core_private__.LifecycleHooks,wc=e.__core_private__.LIFECYCLE_HOOKS_VALUES,Ec=e.__core_private__.ReflectorReader,Oc=e.__core_private__.AppElement,Cc=e.__core_private__.CodegenComponentFactoryResolver,Sc=e.__core_private__.AppView,xc=e.__core_private__.DebugAppView,Pc=e.__core_private__.NgModuleInjector,Tc=e.__core_private__.registerModuleFactory,Nc=e.__core_private__.ViewType,kc=e.__core_private__.MAX_INTERPOLATION_VALUES,Ac=e.__core_private__.checkBinding,Rc=e.__core_private__.flattenNestedViewRenderNodes,Ic=e.__core_private__.interpolate,qc=e.__core_private__.ViewUtils,Mc=e.__core_private__.DebugContext,jc=e.__core_private__.StaticNodeDebugInfo,Fc=e.__core_private__.devModeEqual,Dc=e.__core_private__.UNINITIALIZED,Lc=e.__core_private__.ValueUnwrapper,Vc=e.__core_private__.TemplateRef_,Qc=e.__core_private__.EMPTY_ARRAY,Uc=e.__core_private__.EMPTY_MAP,Bc=e.__core_private__.pureProxy1,Hc=e.__core_private__.pureProxy2,zc=e.__core_private__.pureProxy3,Gc=e.__core_private__.pureProxy4,Wc=e.__core_private__.pureProxy5,Jc=e.__core_private__.pureProxy6,$c=e.__core_private__.pureProxy7,Kc=e.__core_private__.pureProxy8,Xc=e.__core_private__.pureProxy9,Zc=e.__core_private__.pureProxy10,Yc=e.__core_private__.castByValue,tl=e.__core_private__.Console,el=e.__core_private__.reflector,nl=e.__core_private__.Reflector,rl=e.__core_private__.ReflectionCapabilities,il=e.__core_private__.NoOpAnimationPlayer,ol=e.__core_private__.AnimationSequencePlayer,sl=e.__core_private__.AnimationGroupPlayer,al=e.__core_private__.AnimationKeyframe,ul=e.__core_private__.AnimationStyles,cl=e.__core_private__.ANY_STATE,ll=e.__core_private__.DEFAULT_STATE,pl=e.__core_private__.EMPTY_STATE,hl=e.__core_private__.FILL_STYLE_FLAG,fl=e.__core_private__.prepareFinalAnimationStyles,dl=e.__core_private__.balanceAnimationKeyframes,yl=e.__core_private__.clearStyles,ml=e.__core_private__.collectAndResolveStyles,vl=e.__core_private__.renderStyles,gl=e.__core_private__.ComponentStillLoadingError,_l=D("core","linker/view"),bl=D("core","linker/view_utils"),wl=D("core","change_detection/change_detection"),El=D("core","animation/animation_style_util"),Ol=function(){function t(){}return t.ANALYZE_FOR_ENTRY_COMPONENTS={name:"ANALYZE_FOR_ENTRY_COMPONENTS",moduleUrl:D("core","metadata/di"),runtime:e.ANALYZE_FOR_ENTRY_COMPONENTS},t.ViewUtils={name:"ViewUtils",moduleUrl:D("core","linker/view_utils"),runtime:qc},t.AppView={name:"AppView",moduleUrl:_l,runtime:Sc},t.DebugAppView={name:"DebugAppView",moduleUrl:_l,runtime:xc},t.AppElement={name:"AppElement",moduleUrl:D("core","linker/element"),runtime:Oc},t.ElementRef={name:"ElementRef",moduleUrl:D("core","linker/element_ref"),runtime:e.ElementRef},t.ViewContainerRef={name:"ViewContainerRef",moduleUrl:D("core","linker/view_container_ref"),runtime:e.ViewContainerRef},t.ChangeDetectorRef={name:"ChangeDetectorRef",moduleUrl:D("core","change_detection/change_detector_ref"),runtime:e.ChangeDetectorRef},t.RenderComponentType={name:"RenderComponentType",moduleUrl:D("core","render/api"),runtime:e.RenderComponentType},t.QueryList={name:"QueryList",moduleUrl:D("core","linker/query_list"),runtime:e.QueryList},t.TemplateRef={name:"TemplateRef",moduleUrl:D("core","linker/template_ref"),runtime:e.TemplateRef},t.TemplateRef_={name:"TemplateRef_",moduleUrl:D("core","linker/template_ref"),runtime:Vc},t.CodegenComponentFactoryResolver={name:"CodegenComponentFactoryResolver",moduleUrl:D("core","linker/component_factory_resolver"),runtime:Cc},t.ComponentFactoryResolver={name:"ComponentFactoryResolver",moduleUrl:D("core","linker/component_factory_resolver"),runtime:e.ComponentFactoryResolver},t.ComponentFactory={name:"ComponentFactory",runtime:e.ComponentFactory,moduleUrl:D("core","linker/component_factory")},t.NgModuleFactory={name:"NgModuleFactory",runtime:e.NgModuleFactory,moduleUrl:D("core","linker/ng_module_factory")},t.NgModuleInjector={name:"NgModuleInjector",runtime:Pc,moduleUrl:D("core","linker/ng_module_factory")},t.RegisterModuleFactoryFn={name:"registerModuleFactory",runtime:Tc,moduleUrl:D("core","linker/ng_module_factory_loader")},t.ValueUnwrapper={name:"ValueUnwrapper",moduleUrl:wl,runtime:Lc},t.Injector={name:"Injector",moduleUrl:D("core","di/injector"),runtime:e.Injector},t.ViewEncapsulation={name:"ViewEncapsulation",moduleUrl:D("core","metadata/view"),runtime:e.ViewEncapsulation},t.ViewType={name:"ViewType",moduleUrl:D("core","linker/view_type"),runtime:Nc},t.ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleUrl:wl,runtime:e.ChangeDetectionStrategy},t.StaticNodeDebugInfo={name:"StaticNodeDebugInfo",moduleUrl:D("core","linker/debug_context"),runtime:jc},t.DebugContext={name:"DebugContext",moduleUrl:D("core","linker/debug_context"),runtime:Mc},t.Renderer={name:"Renderer",moduleUrl:D("core","render/api"),runtime:e.Renderer},t.SimpleChange={name:"SimpleChange",moduleUrl:wl,runtime:e.SimpleChange},t.UNINITIALIZED={name:"UNINITIALIZED",moduleUrl:wl,runtime:Dc},t.ChangeDetectorStatus={name:"ChangeDetectorStatus",moduleUrl:wl,runtime:_c},t.checkBinding={name:"checkBinding",moduleUrl:bl,runtime:Ac},t.flattenNestedViewRenderNodes={name:"flattenNestedViewRenderNodes",moduleUrl:bl,runtime:Rc},t.devModeEqual={name:"devModeEqual",moduleUrl:wl,runtime:Fc},t.interpolate={name:"interpolate",moduleUrl:bl,runtime:Ic},t.castByValue={name:"castByValue",moduleUrl:bl,runtime:Yc},t.EMPTY_ARRAY={name:"EMPTY_ARRAY",moduleUrl:bl,runtime:Qc},t.EMPTY_MAP={name:"EMPTY_MAP",moduleUrl:bl,runtime:Uc},t.pureProxies=[null,{name:"pureProxy1",moduleUrl:bl,runtime:Bc},{name:"pureProxy2",moduleUrl:bl,runtime:Hc},{name:"pureProxy3",moduleUrl:bl,runtime:zc},{name:"pureProxy4",moduleUrl:bl,runtime:Gc},{name:"pureProxy5",moduleUrl:bl,runtime:Wc},{name:"pureProxy6",moduleUrl:bl,runtime:Jc},{name:"pureProxy7",moduleUrl:bl,runtime:$c},{name:"pureProxy8",moduleUrl:bl,runtime:Kc},{name:"pureProxy9",moduleUrl:bl,runtime:Xc},{name:"pureProxy10",moduleUrl:bl,runtime:Zc}],t.SecurityContext={name:"SecurityContext",moduleUrl:D("core","security"),runtime:e.SecurityContext},t.AnimationKeyframe={name:"AnimationKeyframe",moduleUrl:D("core","animation/animation_keyframe"),runtime:al},t.AnimationStyles={name:"AnimationStyles",moduleUrl:D("core","animation/animation_styles"),runtime:ul},t.NoOpAnimationPlayer={name:"NoOpAnimationPlayer",moduleUrl:D("core","animation/animation_player"),runtime:il},t.AnimationGroupPlayer={name:"AnimationGroupPlayer",moduleUrl:D("core","animation/animation_group_player"),runtime:sl},t.AnimationSequencePlayer={name:"AnimationSequencePlayer",moduleUrl:D("core","animation/animation_sequence_player"),runtime:ol},t.prepareFinalAnimationStyles={name:"prepareFinalAnimationStyles",moduleUrl:El,runtime:fl},t.balanceAnimationKeyframes={name:"balanceAnimationKeyframes",moduleUrl:El,runtime:dl},t.clearStyles={name:"clearStyles",moduleUrl:El,runtime:yl},t.renderStyles={name:"renderStyles",moduleUrl:El,runtime:vl},t.collectAndResolveStyles={name:"collectAndResolveStyles",moduleUrl:El,runtime:ml},t.LOCALE_ID={name:"LOCALE_ID",moduleUrl:D("core","i18n/tokens"),runtime:e.LOCALE_ID},t.TRANSLATIONS_FORMAT={name:"TRANSLATIONS_FORMAT",moduleUrl:D("core","i18n/tokens"),runtime:e.TRANSLATIONS_FORMAT},t}(),Cl=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Sl=function(t){function n(){t.call(this,w)}return Cl(n,t),n.prototype.parse=function(e,n,r,i){return void 0===r&&(r=!1),void 0===i&&(i=ka),t.prototype.parse.call(this,e,n,r,i)},n.decorators=[{type:e.Injectable}],n.ctorParameters=[],n}(lu),xl=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Pl=["zero","one","two","few","many","other"],Tl=function(){function t(t,e,n){this.nodes=t,this.expanded=e,this.errors=n}return t}(),Nl=function(t){function e(e,n){t.call(this,e,n)}return xl(e,t),e}(Ga),kl=function(){function t(){this.isExpanded=!1,this.errors=[]}return t.prototype.visitElement=function(t,e){return new Xa(t.name,t.attrs,ht(this,t.children),t.sourceSpan,t.startSourceSpan,t.endSourceSpan)},t.prototype.visitAttribute=function(t,e){return t},t.prototype.visitText=function(t,e){return t},t.prototype.visitComment=function(t,e){return t},t.prototype.visitExpansion=function(t,e){return this.isExpanded=!0,"plural"==t.type?ne(t,this.errors):re(t,this.errors)},t.prototype.visitExpansionCase=function(t,e){throw new Error("Should not be reached")},t}(),Al=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Rl=function(t){function e(e,n){t.call(this,n,e)}return Al(e,t),e}(Ga),Il=function(){function t(t,e){var n=this;this.component=t,this.sourceSpan=e,this.errors=[],this.viewQueries=ce(t),this.viewProviders=new Map,se(t.viewProviders,e,this.errors).forEach(function(t){i(n.viewProviders.get(t.token.reference))&&n.viewProviders.set(t.token.reference,!0)})}return t}(),ql=function(){function e(t,e,r,i,o,s,a){var u=this;this.viewContext=t,this._parent=e,this._isViewRoot=r,this._directiveAsts=i,this._sourceSpan=a,this._transformedProviders=new Map,this._seenProviders=new Map,this._hasViewContainer=!1,this._attrs={},o.forEach(function(t){return u._attrs[t.name]=t.value});var c=i.map(function(t){return t.directive});this._allProviders=ae(c,a,t.errors),this._contentQueries=le(c);var l=new Map;oi.values(this._allProviders).forEach(function(t){u._addQueryReadsTo(t.token,l)}),s.forEach(function(t){u._addQueryReadsTo(new Ho({value:t.name}),l)}),n(l.get(Yt(Ol.ViewContainerRef).reference))&&(this._hasViewContainer=!0),oi.values(this._allProviders).forEach(function(t){var e=t.eager||n(l.get(t.token.reference));e&&u._getOrCreateLocalProvider(t.providerType,t.token,!0)})}return e.prototype.afterElement=function(){var t=this;oi.values(this._allProviders).forEach(function(e){t._getOrCreateLocalProvider(e.providerType,e.token,!1)})},Object.defineProperty(e.prototype,"transformProviders",{get:function(){return oi.values(this._transformedProviders)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transformedDirectiveAsts",{get:function(){var t=this.transformProviders.map(function(t){return t.token.identifier}),e=ai.clone(this._directiveAsts);return ai.sort(e,function(e,n){return t.indexOf(e.directive.type)-t.indexOf(n.directive.type)}),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transformedHasViewContainer",{get:function(){return this._hasViewContainer},enumerable:!0,configurable:!0}),e.prototype._addQueryReadsTo=function(t,e){this._getQueriesFor(t).forEach(function(r){var o=n(r.read)?r.read:t;i(e.get(o.reference))&&e.set(o.reference,!0)})},e.prototype._getQueriesFor=function(t){for(var e,r=[],i=this,o=0;null!==i;)e=i._contentQueries.get(t.reference),n(e)&&ai.addAll(r,e.filter(function(t){return t.descendants||o<=1})),i._directiveAsts.length>0&&o++,i=i._parent;return e=this.viewContext.viewQueries.get(t.reference),n(e)&&ai.addAll(r,e),r},e.prototype._getOrCreateLocalProvider=function(e,r,i){var o=this,s=this._allProviders.get(r.reference);if(!s||(e===t.ProviderAstType.Directive||e===t.ProviderAstType.PublicService)&&s.providerType===t.ProviderAstType.PrivateService||(e===t.ProviderAstType.PrivateService||e===t.ProviderAstType.PublicService)&&s.providerType===t.ProviderAstType.Builtin)return null;var a=this._transformedProviders.get(r.reference);if(n(a))return a;if(n(this._seenProviders.get(r.reference)))return this.viewContext.errors.push(new Rl("Cannot instantiate cyclic dependency! "+r.name,this._sourceSpan)),null;this._seenProviders.set(r.reference,!0);var u=s.providers.map(function(t){var e,r=t.useValue,a=t.useExisting;if(n(t.useExisting)){var u=o._getDependency(s.providerType,new Qo({token:t.useExisting}),i);n(u.token)?a=u.token:(a=null,r=u.value)}else if(n(t.useFactory)){var c=n(t.deps)?t.deps:t.useFactory.diDeps;e=c.map(function(t){return o._getDependency(s.providerType,t,i)})}else if(n(t.useClass)){var c=n(t.deps)?t.deps:t.useClass.diDeps;e=c.map(function(t){return o._getDependency(s.providerType,t,i)})}return ie(t,{useExisting:a,useValue:r,deps:e})});return a=oe(s,{eager:i,providers:u}),this._transformedProviders.set(r.reference,a),a},e.prototype._getLocalDependency=function(e,r,i){if(void 0===i&&(i=null),r.isAttribute){var o=this._attrs[r.token.value];return new Qo({isValue:!0,value:l(o)})}if(n(r.query)||n(r.viewQuery))return r;if(n(r.token)){if(e===t.ProviderAstType.Directive||e===t.ProviderAstType.Component){if(r.token.reference===Yt(Ol.Renderer).reference||r.token.reference===Yt(Ol.ElementRef).reference||r.token.reference===Yt(Ol.ChangeDetectorRef).reference||r.token.reference===Yt(Ol.TemplateRef).reference)return r;r.token.reference===Yt(Ol.ViewContainerRef).reference&&(this._hasViewContainer=!0)}if(r.token.reference===Yt(Ol.Injector).reference)return r;if(n(this._getOrCreateLocalProvider(e,r.token,i)))return r}return null},e.prototype._getDependency=function(e,r,i){void 0===i&&(i=null);var o=this,s=i,a=null;if(r.isSkipSelf||(a=this._getLocalDependency(e,r,i)),r.isSelf)!a&&r.isOptional&&(a=new Qo({isValue:!0,value:null}));else{for(;!a&&n(o._parent);){var u=o;o=o._parent,u._isViewRoot&&(s=!1),a=o._getLocalDependency(t.ProviderAstType.PublicService,r,s)}a||(a=!r.isHost||this.viewContext.component.type.isHost||this.viewContext.component.type.reference===r.token.reference||n(this.viewContext.viewProviders.get(r.token.reference))?r:r.isOptional?a=new Qo({isValue:!0,value:null}):null)}return a||this.viewContext.errors.push(new Rl("No provider for "+r.token.name,this._sourceSpan)),a},e}(),Ml=function(){function e(e,n,r){var i=this;this._transformedProviders=new Map,this._seenProviders=new Map,this._errors=[],this._allProviders=new Map;var o=e.transitiveModule.modules.map(function(t){return t.type});o.forEach(function(e){var n=new Uo({token:new Ho({identifier:e}),useClass:e});ue([n],t.ProviderAstType.PublicService,!0,r,i._errors,i._allProviders)}),ue(se(e.transitiveModule.providers.concat(n),r,this._errors),t.ProviderAstType.PublicService,!1,r,this._errors,this._allProviders)}return e.prototype.parse=function(){var t=this;if(oi.values(this._allProviders).forEach(function(e){t._getOrCreateLocalProvider(e.token,e.eager)}),this._errors.length>0){var e=this._errors.join("\n");throw new Error("Provider parse errors:\n"+e)}return oi.values(this._transformedProviders)},e.prototype._getOrCreateLocalProvider=function(t,e){var r=this,i=this._allProviders.get(t.reference);if(!i)return null;var o=this._transformedProviders.get(t.reference);if(n(o))return o;if(n(this._seenProviders.get(t.reference)))return this._errors.push(new Rl("Cannot instantiate cyclic dependency! "+t.name,i.sourceSpan)),null;this._seenProviders.set(t.reference,!0);var s=i.providers.map(function(t){var o,s=t.useValue,a=t.useExisting;if(n(t.useExisting)){var u=r._getDependency(new Qo({token:t.useExisting}),e,i.sourceSpan);n(u.token)?a=u.token:(a=null,s=u.value)}else if(n(t.useFactory)){var c=n(t.deps)?t.deps:t.useFactory.diDeps;o=c.map(function(t){return r._getDependency(t,e,i.sourceSpan)})}else if(n(t.useClass)){var c=n(t.deps)?t.deps:t.useClass.diDeps;o=c.map(function(t){return r._getDependency(t,e,i.sourceSpan)})}return ie(t,{useExisting:a,useValue:s,deps:o})});return o=oe(i,{eager:e,providers:s}),this._transformedProviders.set(t.reference,o),o},e.prototype._getDependency=function(t,e,r){void 0===e&&(e=null);var i=!1;!t.isSkipSelf&&n(t.token)&&(t.token.reference===Yt(Ol.Injector).reference||t.token.reference===Yt(Ol.ComponentFactoryResolver).reference?i=!0:n(this._getOrCreateLocalProvider(t.token,e))&&(i=!0));var o=t;return t.isSelf&&!i&&(t.isOptional?o=new Qo({isValue:!0,value:null}):this._errors.push(new Rl("No provider for "+t.token.name,r))),o},e}(),jl=function(){function t(){}return t}(),Fl=function(){function t(t,e){this.style=t,this.styleUrls=e}return t}(),Dl=/@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g,Ll=/^([^:\/?#]+):/,Vl="select",Ql="ng-content",Ul="link",Bl="rel",Hl="href",zl="stylesheet",Gl="style",Wl="script",Jl="ngNonBindable",$l="ngProjectAs";!function(t){t[t.NG_CONTENT=0]="NG_CONTENT",t[t.STYLE=1]="STYLE",t[t.STYLESHEET=2]="STYLESHEET",t[t.SCRIPT=3]="SCRIPT",t[t.OTHER=4]="OTHER"}(Ru||(Ru={}));var Kl,Xl=function(){function t(t,e,n,r,i){this.type=t,this.selectAttr=e,this.hrefAttr=n,this.nonBindable=r,this.projectAs=i}return t}(),Zl=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Yl=/^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/,tp=1,ep=2,np=3,rp=4,ip=5,op=6,sp=7,ap=8,up=9,cp=10,lp="animate-",pp="template",hp="template",fp="*",dp="class",yp=".",mp="attr",vp="class",gp="style",_p=di.parse("*")[0],bp=new e.OpaqueToken("TemplateTransforms"),wp=function(t){function e(e,n,r){t.call(this,n,e,r)}return Zl(e,t),e}(Ga),Ep=function(){function t(t,e){this.templateAst=t,this.errors=e}return t}(),Op=function(){function t(t,e,n,r,i){this._exprParser=t,this._schemaRegistry=e,this._htmlParser=n,this._console=r,this.transforms=i}return t.prototype.parse=function(t,e,n,r,i,o){var s=this.tryParse(t,e,n,r,i,o),a=s.errors.filter(function(t){return t.level===Aa.WARNING}),u=s.errors.filter(function(t){return t.level===Aa.FATAL});if(a.length>0&&this._console.warn("Template parse warnings:\n"+a.join("\n")),u.length>0){var c=u.join("\n");throw new Error("Template parse errors:\n"+c)}return s.templateAst},t.prototype.tryParse=function(t,e,r,i,o,s){var a;t.template&&(a=Na.fromArray(t.template.interpolation));var u,c=this._htmlParser.parse(e,s,!0,a),l=c.errors;if(0==l.length){var p=ee(c.rootNodes);l.push.apply(l,p.errors),c=new cu(p.nodes,l)}if(c.rootNodes.length>0){var h=U(r),f=U(i),d=new Il(t,c.rootNodes[0].sourceSpan),y=new Cp(d,h,f,o,this._exprParser,this._schemaRegistry);u=ht(y,c.rootNodes,Np),l.push.apply(l,y.errors.concat(d.errors))}else u=[];return this._assertNoReferenceDuplicationOnTemplate(u,l),l.length>0?new Ep(u,l):(n(this.transforms)&&this.transforms.forEach(function(t){u=m(t,u)}),new Ep(u,l))},t.prototype._assertNoReferenceDuplicationOnTemplate=function(t,e){var n=[];t.filter(function(t){return!!t.references}).forEach(function(t){return t.references.forEach(function(t){var r=t.name;if(n.indexOf(r)<0)n.push(r);else{var i=new wp('Reference "#'+r+'" is defined several times',t.sourceSpan,Aa.FATAL);e.push(i)}})})},t.decorators=[{type:e.Injectable}],t.ctorParameters=[{type:La},{type:jl},{type:vc},{type:tl},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[bp]}]}],t}(),Cp=function(){function r(t,e,n,r,i,o){var s=this;this.providerViewContext=t,this._schemas=r,this._exprParser=i,this._schemaRegistry=o,this.selectorMatcher=new yi,this.errors=[],this.directivesIndex=new Map,this.ngContentCount=0,this.pipesByName=new Map;var a=t.component.template;a&&a.interpolation&&(this._interpolationConfig={start:a.interpolation[0],end:a.interpolation[1]}),e.forEach(function(t,e){var n=di.parse(t.selector);s.selectorMatcher.addSelectables(n,t),s.directivesIndex.set(t,e)}),n.forEach(function(t){return s.pipesByName.set(t.name,t)})}return r.prototype._reportError=function(t,e,n){void 0===n&&(n=Aa.FATAL),this.errors.push(new wp(t,e,n))},r.prototype._reportParserErrors=function(t,e){for(var n=0,r=t;nkc)throw new Error("Only support at most "+kc+" interpolation values!");return i}catch(o){return this._reportError(""+o,e),this._exprParser.wrapLiteralPrimitive("ERROR",r)}},r.prototype._parseAction=function(t,e){var n=e.start.toString();try{var r=this._exprParser.parseAction(t,n,this._interpolationConfig);return r&&this._reportParserErrors(r.errors,e),!r||r.ast instanceof os?(this._reportError("Empty expressions are not allowed",e),this._exprParser.wrapLiteralPrimitive("ERROR",n)):(this._checkPipes(r,e),r)}catch(i){return this._reportError(""+i,e),this._exprParser.wrapLiteralPrimitive("ERROR",n)}},r.prototype._parseBinding=function(t,e){var n=e.start.toString();try{var r=this._exprParser.parseBinding(t,n,this._interpolationConfig);return r&&this._reportParserErrors(r.errors,e),this._checkPipes(r,e),r}catch(i){return this._reportError(""+i,e),this._exprParser.wrapLiteralPrimitive("ERROR",n)}},r.prototype._parseTemplateBindings=function(t,e){var r=this,i=e.start.toString();try{var o=this._exprParser.parseTemplateBindings(t,i);return this._reportParserErrors(o.errors,e),o.templateBindings.forEach(function(t){n(t.expression)&&r._checkPipes(t.expression,e)}),o.warnings.forEach(function(t){r._reportError(t,e,Aa.WARNING)}),o.templateBindings}catch(s){return this._reportError(""+s,e),[]}},r.prototype._checkPipes=function(t,e){var r=this;if(n(t)){var i=new Ap;t.visit(i),i.pipes.forEach(function(t){r.pipesByName.has(t)||r._reportError("The pipe '"+t+"' could not be found",e)})}},r.prototype.visitExpansion=function(t,e){return null},r.prototype.visitExpansionCase=function(t,e){return null},r.prototype.visitText=function(t,e){var r=e.findNgContentIndex(_p),i=this._parseInterpolation(t.value,t.sourceSpan);return n(i)?new Hr(i,r,t.sourceSpan):new Br(t.value,r,t.sourceSpan)},r.prototype.visitAttribute=function(t,e){return new zr(t.name,t.value,t.sourceSpan)},r.prototype.visitComment=function(t,e){return null},r.prototype.visitElement=function(t,e){var r=this,i=t.name,o=de(t);if(o.type===Ru.SCRIPT||o.type===Ru.STYLE)return null;if(o.type===Ru.STYLESHEET&&he(o.hrefAttr))return null;var s=[],a=[],u=[],c=[],l=[],p=[],h=[],f=[],d=[],y=!1,m=[],v=g(i.toLowerCase())[1],_=v==pp;t.attrs.forEach(function(t){var e=r._parseAttr(_,t,s,a,l,p,u,c),n=r._parseInlineTemplateBinding(t,f,h,d);n&&y&&r._reportError("Can't have multiple template bindings on one element. Use only one attribute named 'template' or prefixed with *",t.sourceSpan),e||n||(m.push(r.visitAttribute(t,null)),s.push([t.name,t.value])),n&&(y=!0)});var b=ve(i,s),w=this._parseDirectives(this.selectorMatcher,b),E=w.directives,O=w.matchElement,C=[],S=this._createDirectiveAsts(_,t.name,E,a,u,t.sourceSpan,C),x=this._createElementPropertyAsts(t.name,a,S).concat(l),P=e.isTemplateElement||y,T=new ql(this.providerViewContext,e.providerContext,P,S,m,C,t.sourceSpan),N=ht(o.nonBindable?kp:this,t.children,Tp.create(_,S,_?e.providerContext:T));T.afterElement();var k,A=n(o.projectAs)?di.parse(o.projectAs)[0]:b,R=e.findNgContentIndex(A);if(o.type===Ru.NG_CONTENT)n(t.children)&&t.children.length>0&&this._reportError(" element cannot have content. must be immediately followed by ",t.sourceSpan),k=new ei((this.ngContentCount++),y?null:R,t.sourceSpan);else if(_)this._assertAllEventsPublishedByDirectives(S,p),this._assertNoComponentsNorElementBindingsOnTemplate(S,x,t.sourceSpan),k=new Xr(m,p,C,c,T.transformedDirectiveAsts,T.transformProviders,T.transformedHasViewContainer,N,y?null:R,t.sourceSpan);else{this._assertElementExists(O,t),this._assertOnlyOneComponent(S,t.sourceSpan);var I=y?null:e.findNgContentIndex(A);k=new Kr(i,m,x,p,C,T.transformedDirectiveAsts,T.transformProviders,T.transformedHasViewContainer,N,y?null:I,t.sourceSpan),this._findComponentDirectives(S).forEach(function(t){return r._validateElementAnimationInputOutputs(t.hostProperties,t.hostEvents,t.directive.template)});var q=T.viewContext.component.template;this._validateElementAnimationInputOutputs(x,p,q)}if(y){var M=ve(pp,f),j=this._parseDirectives(this.selectorMatcher,M).directives,F=this._createDirectiveAsts(!0,t.name,j,h,[],t.sourceSpan,[]),D=this._createElementPropertyAsts(t.name,h,F);this._assertNoComponentsNorElementBindingsOnTemplate(F,D,t.sourceSpan);var L=new ql(this.providerViewContext,e.providerContext,e.isTemplateElement,F,[],[],t.sourceSpan);L.afterElement(),k=new Xr([],[],[],d,L.transformedDirectiveAsts,L.transformProviders,L.transformedHasViewContainer,[k],R,t.sourceSpan)}return k},r.prototype._validateElementAnimationInputOutputs=function(t,e,n){var r=this,i=new Set;n.animations.forEach(function(t){i.add(t.name)});var o=t.filter(function(t){return t.isAnimation});o.forEach(function(t){var e=t.name;i.has(e)||r._reportError("Couldn't find an animation entry for \""+e+'"',t.sourceSpan)}),e.forEach(function(t){if(t.isAnimation){var e=o.find(function(e){return e.name==t.name});e||r._reportError("Unable to listen on (@"+t.name+"."+t.phase+") because the animation trigger [@"+t.name+"] isn't being used on the same element",t.sourceSpan)}})},r.prototype._parseInlineTemplateBinding=function(t,e,r,i){var o=null;if(this._normalizeAttributeName(t.name)==hp)o=t.value;else if(t.name.startsWith(fp)){var s=t.name.substring(fp.length);o=0==t.value.length?s:s+" "+t.value}if(n(o)){for(var a=this._parseTemplateBindings(o,t.sourceSpan),u=0;u0&&this._reportError('Assigning animation triggers via @prop="exp" attributes with an expression is invalid. Use property bindings (e.g. [@prop]="exp") or use an attribute without a value (e.g. @prop) instead.',p,Aa.FATAL),this._parseAnimation(h[sp],l,p,r,o)):h[ap]?(this._parsePropertyOrAnimation(h[ap],l,p,r,i,o),this._parseAssignmentEvent(h[ap],l,p,r,s)):h[up]?this._parsePropertyOrAnimation(h[up],l,p,r,i,o):h[cp]&&this._parseEventOrAnimationEvent(h[cp],l,p,r,s);else f=this._parsePropertyInterpolation(c,l,p,r,i); return f||this._parseLiteralAttr(c,l,p,i),f},r.prototype._normalizeAttributeName=function(t){return/^data-/i.test(t)?t.substring(5):t},r.prototype._parseVariable=function(t,e,n,r){t.indexOf("-")>-1&&this._reportError('"-" is not allowed in variable names',n),r.push(new $r(t,e,n))},r.prototype._parseReference=function(t,e,n,r){t.indexOf("-")>-1&&this._reportError('"-" is not allowed in reference names',n),r.push(new Pp(t,e,n))},r.prototype._parsePropertyOrAnimation=function(t,e,n,r,i,o){var s=lp.length,a=ge(t),u=1;t.substring(0,s)==lp&&(a=!0,u=s),a?this._parseAnimation(t.substr(u),e,n,r,o):this._parsePropertyAst(t,this._parseBinding(e,n),n,r,i)},r.prototype._parseAnimation=function(r,i,o,s,a){n(i)&&0!=i.length||(i="null");var u=this._parseBinding(i,o);s.push([r,u.source]),a.push(new Gr(r,t.PropertyBindingType.Animation,e.SecurityContext.NONE,u,null,o))},r.prototype._parsePropertyInterpolation=function(t,e,r,i,o){var s=this._parseInterpolation(e,r);return!!n(s)&&(this._parsePropertyAst(t,s,r,i,o),!0)},r.prototype._parsePropertyAst=function(t,e,n,r,i){r.push([t,e.source]),i.push(new xp(t,e,(!1),n))},r.prototype._parseAssignmentEvent=function(t,e,n,r,i){this._parseEventOrAnimationEvent(t+"Change",e+"=$event",n,r,i)},r.prototype._parseEventOrAnimationEvent=function(t,e,n,r,i){ge(t)?(t=t.substr(1),this._parseAnimationEvent(t,e,n,i)):this._parseEvent(t,e,n,r,i)},r.prototype._parseAnimationEvent=function(t,e,n,r){var i=q(t,[t,""]),o=i[0],s=i[1].toLowerCase();if(s)switch(s){case"start":case"done":var a=this._parseAction(e,n);r.push(new Wr(o,null,s,a,n));break;default:this._reportError('The provided animation output phase value "'+s+'" for "@'+o+'" is not supported (use start or done)',n)}else this._reportError("The animation trigger output event (@"+o+") is missing its phase value name (start or done are currently supported)",n)},r.prototype._parseEvent=function(t,e,n,r,i){var o=I(t,[null,t]),s=o[0],a=o[1],u=this._parseAction(e,n);r.push([t,u.source]),i.push(new Wr(a,s,null,u,n))},r.prototype._parseLiteralAttr=function(t,e,n,r){r.push(new xp(t,this._exprParser.wrapLiteralPrimitive(e,""),(!0),n))},r.prototype._parseDirectives=function(t,e){var n=this,r=new Array(this.directivesIndex.size),i=!1;return t.match(e,function(t,e){r[n.directivesIndex.get(e)]=e,i=i||t.hasElementSelector()}),{directives:r.filter(function(t){return!!t}),matchElement:i}},r.prototype._createDirectiveAsts=function(t,e,n,r,i,o,s){var a=this,u=new Set,c=null,l=n.map(function(t){var n=new Ha(o.start,o.end,"Directive "+t.type.name);t.isComponent&&(c=t);var l=[],p=[],h=[];return a._createDirectiveHostPropertyAsts(e,t.hostProperties,n,l),a._createDirectiveHostEventAsts(t.hostListeners,n,p),a._createDirectivePropertyAsts(t.inputs,r,h),i.forEach(function(e){(0===e.value.length&&t.isComponent||t.exportAs==e.value)&&(s.push(new Jr(e.name,Zt(t.type),e.sourceSpan)),u.add(e.name))}),new Yr(t,h,l,p,n)});return i.forEach(function(e){if(e.value.length>0)u.has(e.name)||a._reportError('There is no directive with "exportAs" set to "'+e.value+'"',e.sourceSpan);else if(!c){var n=null;t&&(n=Yt(Ol.TemplateRef)),s.push(new Jr(e.name,n,e.sourceSpan))}}),l},r.prototype._createDirectiveHostPropertyAsts=function(t,e,n,r){var i=this;e&&Object.keys(e).forEach(function(s){var a=e[s];if(o(a)){var u=i._parseBinding(a,n);r.push(i._createElementPropertyAst(t,s,u,n))}else i._reportError('Value of the host property binding "'+s+'" needs to be a string representing an expression but got "'+a+'" ('+typeof a+")",n)})},r.prototype._createDirectiveHostEventAsts=function(t,e,n){var r=this;t&&Object.keys(t).forEach(function(i){var s=t[i];o(s)?r._parseEventOrAnimationEvent(i,s,e,[],n):r._reportError('Value of the host listener "'+i+'" needs to be a string representing an expression but got "'+s+'" ('+typeof s+")",e)})},r.prototype._createDirectivePropertyAsts=function(t,e,n){if(t){var r=new Map;e.forEach(function(t){var e=r.get(t.name);e&&!e.isLiteral||r.set(t.name,t)}),Object.keys(t).forEach(function(e){var i=t[e],o=r.get(i);o&&n.push(new Zr(e,o.name,o.expression,o.sourceSpan))})}},r.prototype._createElementPropertyAsts=function(t,e,n){var r=this,i=[],o=new Map;return n.forEach(function(t){t.inputs.forEach(function(t){o.set(t.templateName,t)})}),e.forEach(function(e){e.isLiteral||o.get(e.name)||i.push(r._createElementPropertyAst(t,e.name,e.expression,e.sourceSpan))}),i},r.prototype._createElementPropertyAst=function(n,r,i,o){var s,a,u,c=null,l=r.split(yp);if(1===l.length){var p=l[0];if(ge(p))a=p.substr(1),s=t.PropertyBindingType.Animation,u=e.SecurityContext.NONE;else if(a=this._schemaRegistry.getMappedPropName(p),u=this._schemaRegistry.securityContext(n,a),s=t.PropertyBindingType.Property,this._validatePropertyOrAttributeName(a,o,!1),!this._schemaRegistry.hasProperty(n,a,this._schemas)){var h="Can't bind to '"+a+"' since it isn't a known property of '"+n+"'.";n.indexOf("-")>-1&&(h+="\n1. If '"+n+"' is an Angular component and it has '"+a+"' input, then verify that it is part of this module."+("\n2. If '"+n+"' is a Web Component then add \"CUSTOM_ELEMENTS_SCHEMA\" to the '@NgModule.schemas' of this component to suppress this message.\n")),this._reportError(h,o)}}else if(l[0]==mp){a=l[1],this._validatePropertyOrAttributeName(a,o,!0);var f=this._schemaRegistry.getMappedPropName(a);u=this._schemaRegistry.securityContext(n,f);var d=a.indexOf(":");if(d>-1){var y=a.substring(0,d),m=a.substring(d+1);a=b(y,m)}s=t.PropertyBindingType.Attribute}else l[0]==vp?(a=l[1],s=t.PropertyBindingType.Class,u=e.SecurityContext.NONE):l[0]==gp?(c=l.length>2?l[2]:null,a=l[1],s=t.PropertyBindingType.Style,u=e.SecurityContext.STYLE):(this._reportError("Invalid property name '"+r+"'",o),s=null,u=null);return new Gr(a,s,u,i,c,o)},r.prototype._validatePropertyOrAttributeName=function(t,e,n){var r=n?this._schemaRegistry.validateAttribute(t):this._schemaRegistry.validateProperty(t);r.error&&this._reportError(r.msg,e,Aa.FATAL)},r.prototype._findComponentDirectives=function(t){return t.filter(function(t){return t.directive.isComponent})},r.prototype._findComponentDirectiveNames=function(t){return this._findComponentDirectives(t).map(function(t){return t.directive.type.name})},r.prototype._assertOnlyOneComponent=function(t,e){var n=this._findComponentDirectiveNames(t);n.length>1&&this._reportError("More than one component: "+n.join(","),e)},r.prototype._assertElementExists=function(t,e){var n=e.name.replace(/^:xhtml:/,"");if(!t&&!this._schemaRegistry.hasElement(n,this._schemas)){var r="'"+n+"' is not a known element:\n"+("1. If '"+n+"' is an Angular component, then verify that it is part of this module.\n")+("2. If '"+n+"' is a Web Component then add \"CUSTOM_ELEMENTS_SCHEMA\" to the '@NgModule.schemas' of this component to suppress this message.");this._reportError(r,e.sourceSpan)}},r.prototype._assertNoComponentsNorElementBindingsOnTemplate=function(t,e,n){var r=this,i=this._findComponentDirectiveNames(t);i.length>0&&this._reportError("Components on an embedded template: "+i.join(","),n),e.forEach(function(t){r._reportError("Property binding "+t.name+' not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "directives" section.',n)})},r.prototype._assertAllEventsPublishedByDirectives=function(t,e){var r=this,i=new Set;t.forEach(function(t){Object.keys(t.directive.outputs).forEach(function(e){var n=t.directive.outputs[e];i.add(n)})}),e.forEach(function(t){!n(t.target)&&i.has(t.name)||r._reportError("Event binding "+t.fullName+' not emitted by any directive on an embedded template. Make sure that the event name is spelled correctly and all directives are listed in the "directives" section.',t.sourceSpan)})},r}(),Sp=function(){function t(){}return t.prototype.visitElement=function(t,e){var n=de(t);if(n.type===Ru.SCRIPT||n.type===Ru.STYLE||n.type===Ru.STYLESHEET)return null;var r=t.attrs.map(function(t){return[t.name,t.value]}),i=ve(t.name,r),o=e.findNgContentIndex(i),s=ht(this,t.children,Np);return new Kr(t.name,ht(this,t.attrs),[],[],[],[],[],(!1),s,o,t.sourceSpan)},t.prototype.visitComment=function(t,e){return null},t.prototype.visitAttribute=function(t,e){return new zr(t.name,t.value,t.sourceSpan)},t.prototype.visitText=function(t,e){var n=e.findNgContentIndex(_p);return new Br(t.value,n,t.sourceSpan)},t.prototype.visitExpansion=function(t,e){return t},t.prototype.visitExpansionCase=function(t,e){return t},t}(),xp=function(){function t(t,e,n,r){this.name=t,this.expression=e,this.isLiteral=n,this.sourceSpan=r}return t}(),Pp=function(){function t(t,e,n){this.name=t,this.value=e,this.sourceSpan=n}return t}(),Tp=function(){function t(t,e,n,r){this.isTemplateElement=t,this._ngContentIndexMatcher=e,this._wildcardNgContentIndex=n,this.providerContext=r}return t.create=function(e,n,r){var i=new yi,o=null,s=n.find(function(t){return t.directive.isComponent});if(s)for(var a=s.directive.template.ngContentSelectors,u=0;u0?e[0]:null},t}(),Np=new Tp((!0),new yi,null,null),kp=new Sp,Ap=function(t){function e(){t.apply(this,arguments),this.pipes=new Set}return Zl(e,t),e.prototype.visitPipe=function(t,e){return this.pipes.add(t.name),t.exp.visit(this),this.visitAll(t.args,e),null},e}(xs),Rp=function(){function t(t){var n=void 0===t?{}:t,r=n.renderTypes,i=void 0===r?new qp:r,o=n.defaultEncapsulation,s=void 0===o?e.ViewEncapsulation.Emulated:o,a=n.genDebugInfo,u=n.logBindingUpdate,c=n.useJit,l=void 0===c||c;this.renderTypes=i,this.defaultEncapsulation=s,this._genDebugInfo=a,this._logBindingUpdate=u,this.useJit=l}return Object.defineProperty(t.prototype,"genDebugInfo",{get:function(){return void 0===this._genDebugInfo?e.isDevMode():this._genDebugInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"logBindingUpdate",{get:function(){return void 0===this._logBindingUpdate?e.isDevMode():this._logBindingUpdate},enumerable:!0,configurable:!0}),t}(),Ip=function(){function t(){}return Object.defineProperty(t.prototype,"renderer",{get:function(){return _e()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderText",{get:function(){return _e()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderElement",{get:function(){return _e()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderComment",{get:function(){return _e()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderNode",{get:function(){return _e()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderEvent",{get:function(){return _e()},enumerable:!0,configurable:!0}),t}(),qp=function(){function t(){this.renderText=null,this.renderElement=null,this.renderComment=null,this.renderNode=null,this.renderEvent=null}return Object.defineProperty(t.prototype,"renderer",{get:function(){return Xt(Ol.Renderer)},enumerable:!0,configurable:!0}),t}(),Mp=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},jp=function(){function t(){this.startTime=0,this.playTime=0}return t}(),Fp=function(t){function e(){t.apply(this,arguments)}return Mp(e,t),e}(jp),Dp=function(t){function e(e,n,r){t.call(this),this.name=e,this.stateDeclarations=n,this.stateTransitions=r}return Mp(e,t),e.prototype.visit=function(t,e){return t.visitAnimationEntry(this,e)},e}(jp),Lp=function(t){function e(e,n){t.call(this),this.stateName=e,this.styles=n}return Mp(e,t),e.prototype.visit=function(t,e){return t.visitAnimationStateDeclaration(this,e)},e}(Fp),Vp=function(){function t(t,e){this.fromState=t,this.toState=e}return t}(),Qp=function(t){function e(e,n){t.call(this),this.stateChanges=e,this.animation=n}return Mp(e,t),e.prototype.visit=function(t,e){return t.visitAnimationStateTransition(this,e)},e}(Fp),Up=function(t){function e(e,n,r,i,o){t.call(this),this.startingStyles=e,this.keyframes=n,this.duration=r,this.delay=i,this.easing=o}return Mp(e,t),e.prototype.visit=function(t,e){return t.visitAnimationStep(this,e)},e}(jp),Bp=function(t){function e(e){t.call(this),this.styles=e}return Mp(e,t),e.prototype.visit=function(t,e){return t.visitAnimationStyles(this,e)},e}(jp),Hp=function(t){function e(e,n){t.call(this),this.offset=e,this.styles=n}return Mp(e,t),e.prototype.visit=function(t,e){return t.visitAnimationKeyframe(this,e)},e}(jp),zp=function(t){function e(e){t.call(this),this.steps=e}return Mp(e,t),e}(jp),Gp=function(t){function e(e){t.call(this,e)}return Mp(e,t),e.prototype.visit=function(t,e){return t.visitAnimationGroup(this,e)},e}(zp),Wp=function(t){function e(e){t.call(this,e)}return Mp(e,t),e.prototype.visit=function(t,e){return t.visitAnimationSequence(this,e)},e}(zp),Jp=function(){function t(t,e,n){this.name=t,this.statements=e,this.fnExp=n}return t}(),$p=function(){function t(){}return t.prototype.compile=function(t,e){return e.map(function(e){var n=t+"_"+e.name,r=new uh(e.name,n);return r.build(e)})},t}(),Kp=C("element"),Xp=C("defaultStateStyles"),Zp=C("view"),Yp=Zp.prop("renderer"),th=C("currentState"),eh=C("nextState"),nh=C("player"),rh=C("totalTime"),ih=C("startStateStyles"),oh=C("endStateStyles"),sh=C("collectedStyles"),ah=T([]),uh=function(){function t(t,e){this.animationName=t,this._fnVarName=e+"_factory",this._statesMapVarName=e+"_states",this._statesMapVar=C(this._statesMapVarName)}return t.prototype.visitAnimationStyles=function(t,e){var n=[];return e.isExpectingFirstStyleStep&&(n.push(ih),e.isExpectingFirstStyleStep=!1),t.styles.forEach(function(t){n.push(T(Object.keys(t).map(function(e){return[e,A(t[e])]})))}),S(Xt(Ol.AnimationStyles)).instantiate([S(Xt(Ol.collectAndResolveStyles)).callFn([sh,P(n)])])},t.prototype.visitAnimationKeyframe=function(t,e){return S(Xt(Ol.AnimationKeyframe)).instantiate([A(t.offset),t.styles.visit(this,e)])},t.prototype.visitAnimationStep=function(t,e){var n=this;if(e.endStateAnimateStep===t)return this._visitEndStateAnimation(t,e);var r=t.startingStyles.visit(this,e),i=t.keyframes.map(function(t){return t.visit(n,e)});return this._callAnimateMethod(t,r,P(i),e)},t.prototype._visitEndStateAnimation=function(t,e){var n=this,r=t.startingStyles.visit(this,e),i=t.keyframes.map(function(t){return t.visit(n,e)}),o=S(Xt(Ol.balanceAnimationKeyframes)).callFn([sh,oh,P(i)]);return this._callAnimateMethod(t,r,o,e)},t.prototype._callAnimateMethod=function(t,e,n,r){return r.totalTransitionTime+=t.duration+t.delay,Yp.callMethod("animate",[Kp,e,n,A(t.duration),A(t.delay),A(t.easing)])},t.prototype.visitAnimationSequence=function(t,e){var n=this,r=t.steps.map(function(t){return t.visit(n,e)});return S(Xt(Ol.AnimationSequencePlayer)).instantiate([P(r)])},t.prototype.visitAnimationGroup=function(t,e){var n=this,r=t.steps.map(function(t){return t.visit(n,e)});return S(Xt(Ol.AnimationGroupPlayer)).instantiate([P(r)])},t.prototype.visitAnimationStateDeclaration=function(t,e){var n={};Ee(t).forEach(function(t){Object.keys(t).forEach(function(e){n[e]=t[e]})}),e.stateMap.registerState(t.stateName,n)},t.prototype.visitAnimationStateTransition=function(t,e){var n=t.animation.steps,r=n[n.length-1];we(r)&&(e.endStateAnimateStep=r),e.totalTransitionTime=0,e.isExpectingFirstStyleStep=!0;var i=[];t.stateChanges.forEach(function(t){i.push(be(th,t.fromState).and(be(eh,t.toState))),t.fromState!=cl&&e.stateMap.registerState(t.fromState),t.toState!=cl&&e.stateMap.registerState(t.toState)});var o=t.animation.visit(this,e),s=i.reduce(function(t,e){return t.or(e)}),a=nh.equals(no).and(s),u=nh.set(o).toStmt(),c=rh.set(A(e.totalTransitionTime)).toStmt();return new yo(a,[u,c])},t.prototype.visitAnimationEntry=function(t,e){var n=this;t.stateDeclarations.forEach(function(t){return t.visit(n,e)}),e.stateMap.registerState(ll,{});var r=[];r.push(Zp.callMethod("cancelActiveAnimation",[Kp,A(this.animationName),eh.equals(A(pl))]).toStmt()),r.push(sh.set(ah).toDeclStmt()),r.push(nh.set(no).toDeclStmt()),r.push(rh.set(A(0)).toDeclStmt()),r.push(Xp.set(this._statesMapVar.key(A(ll))).toDeclStmt()),r.push(ih.set(this._statesMapVar.key(th)).toDeclStmt()),r.push(new yo(ih.equals(no),[ih.set(Xp).toStmt()])),r.push(oh.set(this._statesMapVar.key(eh)).toDeclStmt()),r.push(new yo(oh.equals(no),[oh.set(Xp).toStmt()]));var i=S(Xt(Ol.renderStyles));return r.push(i.callFn([Kp,Yp,S(Xt(Ol.clearStyles)).callFn([ih])]).toStmt()),t.stateTransitions.forEach(function(t){return r.push(t.visit(n,e))}),r.push(new yo(nh.equals(no),[nh.set(S(Xt(Ol.NoOpAnimationPlayer)).instantiate([])).toStmt()])),r.push(nh.callMethod("onDone",[k([],[i.callFn([Kp,Yp,S(Xt(Ol.prepareFinalAnimationStyles)).callFn([ih,oh])]).toStmt()])]).toStmt()),r.push(Zp.callMethod("queueAnimation",[Kp,A(this.animationName),nh,rh,th,eh]).toStmt()),k([new Wi(Zp.name,x(Xt(Ol.AppView),[xi])),new Wi(Kp.name,xi),new Wi(th.name,xi),new Wi(eh.name,xi)],r)},t.prototype.build=function(t){var e=new ch,r=t.visit(this,e).toDeclStmt(this._fnVarName),i=C(this._fnVarName),o=[];Object.keys(e.stateMap.states).forEach(function(t){var r=e.stateMap.states[t],i=ah;if(n(r)){var s=[];Object.keys(r).forEach(function(t){s.push([t,A(r[t])])}),i=T(s)}o.push([t,i])});var s=this._statesMapVar.set(T(o)).toDeclStmt(),a=[s,r];return new Jp(this.animationName,a,i)},t}(),ch=function(){function t(){this.stateMap=new lh,this.endStateAnimateStep=null,this.isExpectingFirstStyleStep=!1,this.totalTransitionTime=0}return t}(),lh=function(){function t(){this._states={}}return Object.defineProperty(t.prototype,"states",{get:function(){return this._states},enumerable:!0,configurable:!0}),t.prototype.registerState=function(t,e){void 0===e&&(e=null);var n=this._states[t];n||(this._states[t]=e)},t}(),ph=Dr.Math,hh=function(){function t(t,e){this.time=t,this.value=e}return t.prototype.matches=function(t,e){return t==this.time&&e==this.value},t}(),fh=function(){function t(){this.styles={}}return t.prototype.insertAtTime=function(t,e,r){var i=new hh(e,r),o=this.styles[t];n(o)||(o=this.styles[t]=[]);for(var s=0,a=o.length-1;a>=0;a--)if(o[a].time<=e){s=a+1;break}ai.insert(o,s,i)},t.prototype.getByIndex=function(t,e){var r=this.styles[t];return n(r)?e>=r.length?null:r[e]:null},t.prototype.indexOfAtOrBeforeTime=function(t,e){var r=this.styles[t];if(n(r))for(var i=r.length-1;i>=0;i--)if(r[i].time<=e)return i;return null},t}(),dh=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},yh=0,mh=1,vh=1e3,gh=function(t){function e(e){t.call(this,null,e)}return dh(e,t),e.prototype.toString=function(){return""+this.msg},e}(Ga),_h=function(){function t(t,e){this.ast=t,this.errors=e}return t}(),bh=function(){function t(){}return t.prototype.parseComponent=function(t){var e=this,n=[],r=t.type.name,i=new Set,o=t.template.animations.map(function(t){var o=e.parseEntry(t),s=o.ast,a=s.name;if(i.has(a)?o.errors.push(new gh('The animation trigger "'+a+'" has already been registered for the '+r+" component")):i.add(a),o.errors.length>0){var u='- Unable to parse the animation sequence for "'+a+'" on the '+r+" component due to the following errors:";o.errors.forEach(function(t){u+="\n-- "+t.msg}),n.push(u)}return s});if(n.length>0){var s=n.join("\n");throw new Error("Animation parse errors:\n"+s)}return o},t.prototype.parseEntry=function(t){var e=[],n={},r=[],i=[];t.definitions.forEach(function(t){t instanceof Ao?Oe(t,e).forEach(function(t){i.push(t),n[t.stateName]=t.styles}):r.push(t)});var o=r.map(function(t){return Ce(t,n,e)}),s=new Dp(t.name,i,o);return new _h(s,e)},t}(),wh=function(){function t(t,e,n){this.duration=t,this.delay=e,this.easing=n}return t}(),Eh=function(){function t(){}return t.prototype.visitArray=function(t,e){var n=this;return P(t.map(function(t){return F(t,n,null)}),e)},t.prototype.visitStringMap=function(t,e){var n=this,r=[];return Object.keys(t).forEach(function(e){r.push([e,F(t[e],n,null)])}),T(r,e)},t.prototype.visitPrimitive=function(t,e){return A(t,e)},t.prototype.visitOther=function(t,e){if(t instanceof Vo)return S(t);if(t instanceof Ri)return t;throw new Error("Illegal state: Don't now how to compile value "+t)},t}(),Oh=function(){function t(t,e){this.nodeIndex=t,this.sourceAst=e}return t}(),Ch=new Oh(null,null),Sh=function(){function t(t){this._view=t,this._newState=Ch,this._currState=Ch,this._bodyStatements=[],this._debugEnabled=this._view.genConfig.genDebugInfo}return t.prototype._updateDebugContextIfNeeded=function(){if(this._newState.nodeIndex!==this._currState.nodeIndex||this._newState.sourceAst!==this._currState.sourceAst){var t=this._updateDebugContext(this._newState);n(t)&&this._bodyStatements.push(t.toStmt())}},t.prototype._updateDebugContext=function(t){if(this._currState=this._newState=t,this._debugEnabled){var e=n(t.sourceAst)?t.sourceAst.sourceSpan.start:null;return to.callMethod("debug",[A(t.nodeIndex),n(e)?A(e.line):no,n(e)?A(e.col):no])}return null},t.prototype.resetDebugInfoExpr=function(t,e){var r=this._updateDebugContext(new Oh(t,e));return n(r)?r:no},t.prototype.resetDebugInfo=function(t,e){this._newState=new Oh(t,e)},t.prototype.addStmt=function(t){this._updateDebugContextIfNeeded(),this._bodyStatements.push(t)},t.prototype.addStmts=function(t){this._updateDebugContextIfNeeded(),ai.addAll(this._bodyStatements,t)},t.prototype.finish=function(){return this._bodyStatements},t.prototype.isEmpty=function(){return 0===this._bodyStatements.length},t}(),xh=function(){function t(t,e){this.view=t,this.values=e}return t}(),Ph=function(){function t(t,e,n,r){this.meta=t,this.queryList=e,this.ownerDirectiveExpression=n,this.view=r,this._values=new xh(r,[])}return t.prototype.addValue=function(t,e){for(var r=e,i=[];n(r)&&r!==this.view;){var o=r.declarationElement;i.unshift(o),r=o.view}var s=De(this.queryList,e,this.view),a=this._values;i.forEach(function(t){var e=a.values.length>0?a.values[a.values.length-1]:null;if(e instanceof xh&&e.view===t.embeddedView)a=e;else{var n=new xh(t.embeddedView,[]);a.values.push(n),a=n}}),a.values.push(t),i.length>0&&e.dirtyParentQueriesMethod.addStmt(s.callMethod("setDirty",[]).toStmt())},t.prototype._isStatic=function(){return!this._values.values.some(function(t){return t instanceof xh})},t.prototype.afterChildren=function(t,e){var r=Be(this._values),i=[this.queryList.callMethod("reset",[P(r)]).toStmt()];if(n(this.ownerDirectiveExpression)){var o=this.meta.first?this.queryList.prop("first"):this.queryList;i.push(this.ownerDirectiveExpression.prop(this.meta.propertyName).set(o).toStmt())}this.meta.first||i.push(this.queryList.callMethod("notifyOnChanges",[]).toStmt()),this.meta.first&&this._isStatic()?t.addStmts(i):e.addStmt(new yo(this.queryList.prop("dirty"),i))},t}(),Th=function(){function t(){}return t.fromValue=function(t){var e=Xt(Ol.ViewType);switch(t){case Nc.HOST:return We(e,"HOST");case Nc.COMPONENT:return We(e,"COMPONENT");case Nc.EMBEDDED:return We(e,"EMBEDDED");default:throw Error("Inavlid ViewType value: "+t)}},t}(),Nh=function(){function t(){}return t.fromValue=function(t){var n=Xt(Ol.ViewEncapsulation);switch(t){case e.ViewEncapsulation.Emulated:return We(n,"Emulated");case e.ViewEncapsulation.Native:return We(n,"Native");case e.ViewEncapsulation.None:return We(n,"None");default:throw Error("Inavlid ViewEncapsulation value: "+t)}},t}(),kh=function(){function t(){}return t.fromValue=function(t){var e=Xt(Ol.ChangeDetectorStatus);switch(t){case _c.CheckOnce:return We(e,"CheckOnce");case _c.Checked:return We(e,"Checked");case _c.CheckAlways:return We(e,"CheckAlways");case _c.Detached:return We(e,"Detached");case _c.Errored:return We(e,"Errored");case _c.Destroyed:return We(e,"Destroyed");default:throw Error("Inavlid ChangeDetectorStatus value: "+t)}},t}(),Ah=function(){function t(){}return t.viewUtils=C("viewUtils"),t.parentInjector=C("parentInjector"),t.declarationEl=C("declarationEl"),t}(),Rh=function(){function t(){}return t.renderer=to.prop("renderer"),t.projectableNodes=to.prop("projectableNodes"),t.viewUtils=to.prop("viewUtils"),t}(),Ih=function(){function t(){}return t.event=C("$event"),t}(),qh=function(){function t(){}return t.token=C("token"),t.requestNodeIndex=C("requestNodeIndex"),t.notFoundResult=C("notFoundResult"),t}(),Mh=function(){function t(){}return t.throwOnChange=C("throwOnChange"),t.changes=C("changes"),t.changed=C("changed"),t.valUnwrapper=C("valUnwrapper"),t}(),jh=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Fh=function(){function t(t,e,n,r,i){this.parent=t,this.view=e,this.nodeIndex=n,this.renderNode=r,this.sourceAst=i}return t.prototype.isNull=function(){return!this.renderNode},t.prototype.isRootElement=function(){return this.view!=this.parent.view},t}(),Dh=function(e){function r(t,r,i,o,s,a,u,c,l,p,h){var f=this;e.call(this,t,r,i,o,s),this.component=a,this._directives=u,this._resolvedProvidersArray=c,this.hasViewContainer=l,this.hasEmbeddedView=p,this._compViewExpr=null,this.instances=new Map,this._queryCount=0,this._queries=new Map,this._componentConstructorViewQueryLists=[],this.contentNodesByNgContentIndex=null,this.referenceTokens={},h.forEach(function(t){return f.referenceTokens[t.name]=t.value}),this.elementRef=S(Xt(Ol.ElementRef)).instantiate([this.renderNode]),this.instances.set(Yt(Ol.ElementRef).reference,this.elementRef),this.injector=to.callMethod("injector",[A(this.nodeIndex)]),this.instances.set(Yt(Ol.Injector).reference,this.injector),this.instances.set(Yt(Ol.Renderer).reference,to.prop("renderer")),(this.hasViewContainer||this.hasEmbeddedView||n(this.component))&&this._createAppElement()}return jh(r,e),r.createNull=function(){return new r(null,null,null,null,null,null,[],[],(!1),(!1),[])},r.prototype._createAppElement=function(){var t="_appEl_"+this.nodeIndex,e=this.isRootElement()?null:this.parent.nodeIndex;this.view.fields.push(new lo(t,x(Xt(Ol.AppElement)),[Di.Private]));var n=to.prop(t).set(S(Xt(Ol.AppElement)).instantiate([A(this.nodeIndex),A(e),to,this.renderNode])).toStmt();this.view.createMethod.addStmt(n),this.appElement=to.prop(t),this.instances.set(Yt(Ol.AppElement).reference,this.appElement)},r.prototype.createComponentFactoryResolver=function(e){if(e&&0!==e.length){var n=S(Xt(Ol.CodegenComponentFactoryResolver)).instantiate([P(e.map(function(t){return S(t)})),Le(Yt(Ol.ComponentFactoryResolver),!1)]),r=new Uo({token:Yt(Ol.ComponentFactoryResolver),useValue:n});this._resolvedProvidersArray.unshift(new ti(r.token,(!1),(!0),[r],t.ProviderAstType.PrivateService,[],this.sourceAst.sourceSpan))}},r.prototype.setComponentView=function(t){this._compViewExpr=t,this.contentNodesByNgContentIndex=new Array(this.component.template.ngContentSelectors.length);for(var e=0;e0&&o++,i=i.parent;return e=this.view.componentView.viewQueries.get(t.reference),n(e)&&ai.addAll(r,e),r},r.prototype._addQuery=function(t,e){var n="_query_"+t.selectors[0].name+"_"+this.nodeIndex+"_"+this._queryCount++,r=ze(t,e,n,this.view),i=new Ph(t,r,e,this.view);return Ge(this._queries,i),i},r.prototype._getLocalDependency=function(e,r){var i=null;if(!i&&n(r.query)&&(i=this._addQuery(r.query,null).queryList),!i&&n(r.viewQuery)&&(i=ze(r.viewQuery,null,"_viewQuery_"+r.viewQuery.selectors[0].name+"_"+this.nodeIndex+"_"+this._componentConstructorViewQueryLists.length,this.view),this._componentConstructorViewQueryLists.push(i)),n(r.token)){if(!i&&r.token.reference===Yt(Ol.ChangeDetectorRef).reference)return e===t.ProviderAstType.Component?this._compViewExpr.prop("ref"):De(to.prop("ref"),this.view,this.view.componentView);if(!i){var o=this._resolvedProviders.get(r.token.reference);if(o&&(e===t.ProviderAstType.Directive||e===t.ProviderAstType.PublicService)&&o.providerType===t.ProviderAstType.PrivateService)return null;i=this.instances.get(r.token.reference)}}return i},r.prototype._getDependency=function(e,n){var r=this,i=null;for(n.isValue&&(i=A(n.value)),i||n.isSkipSelf||(i=this._getLocalDependency(e,n));!i&&!r.parent.isNull();)r=r.parent,i=r._getLocalDependency(t.ProviderAstType.PublicService,new Qo({token:n.token}));return i||(i=Le(n.token,n.isOptional)),i||(i=no),De(i,this.view,r.view)},r}(Fh),Lh=function(){function t(t,e){this.query=t,this.read=n(t.meta.read)?t.meta.read:e}return t}(),Vh=function(){function t(t,e){var n=this;this.view=t,this.meta=e,this._purePipeProxyCount=0, this.instance=to.prop("_pipe_"+e.name+"_"+t.pipeCount++);var r=this.meta.type.diDeps.map(function(t){return t.token.reference===Yt(Ol.ChangeDetectorRef).reference?De(to.prop("ref"),n.view,n.view.componentView):Le(t.token,!1)});this.view.fields.push(new lo(this.instance.name,x(this.meta.type))),this.view.createMethod.resetDebugInfo(null,null),this.view.createMethod.addStmt(to.prop(this.instance.name).set(S(this.meta.type).instantiate(r)).toStmt())}return t.call=function(e,n,r){var i,o=e.componentView,s=Ke(o,n);return s.pure?(i=o.purePipes.get(n),i||(i=new t(o,s),o.purePipes.set(n,i),o.pipes.push(i))):(i=new t(e,s),e.pipes.push(i)),i._call(e,r)},Object.defineProperty(t.prototype,"pure",{get:function(){return this.meta.pure},enumerable:!0,configurable:!0}),t.prototype._call=function(t,e){if(this.meta.pure){var n=to.prop(this.instance.name+"_"+this._purePipeProxyCount++),r=De(this.instance,t,this.view);return Ue(r.prop("transform").callMethod(Ii.Bind,[r]),e.length,n,t),S(Xt(Ol.castByValue)).callFn([n,r.prop("transform")]).callFn(e)}return De(this.instance,t,this.view).callMethod("transform",e)},t}(),Qh=function(){function t(t,e,r,i,o,s,a,u){var c=this;this.component=t,this.genConfig=e,this.pipeMetas=r,this.styles=i,this.animations=o,this.viewIndex=s,this.declarationElement=a,this.templateVariableBindings=u,this.nodes=[],this.rootNodesOrAppElements=[],this.bindings=[],this.classStatements=[],this.eventHandlerMethods=[],this.fields=[],this.getters=[],this.disposables=[],this.subscriptions=[],this.purePipes=new Map,this.pipes=[],this.locals=new Map,this.literalArrayCount=0,this.literalMapCount=0,this.pipeCount=0,this.createMethod=new Sh(this),this.animationBindingsMethod=new Sh(this),this.injectorGetMethod=new Sh(this),this.updateContentQueriesMethod=new Sh(this),this.dirtyParentQueriesMethod=new Sh(this),this.updateViewQueriesMethod=new Sh(this),this.detectChangesInInputsMethod=new Sh(this),this.detectChangesRenderPropertiesMethod=new Sh(this),this.afterContentLifecycleCallbacksMethod=new Sh(this),this.afterViewLifecycleCallbacksMethod=new Sh(this),this.destroyMethod=new Sh(this),this.detachMethod=new Sh(this),this.viewType=Xe(t,s),this.className="_View_"+t.type.name+s,this.classType=x(new Vo({name:this.className})),this.viewFactory=C(Ve(t,s)),this.viewType===Nc.COMPONENT||this.viewType===Nc.HOST?this.componentView=this:this.componentView=this.declarationElement.view.componentView,this.componentContext=De(to.prop("context"),this,this.componentView);var l=new Map;if(this.viewType===Nc.COMPONENT){var p=to.prop("context");ai.forEachWithIndex(this.component.viewQueries,function(t,e){var n="_viewQuery_"+t.selectors[0].name+"_"+e,r=ze(t,p,n,c),i=new Ph(t,r,p,c);Ge(l,i)});var h=0;this.component.type.diDeps.forEach(function(t){if(n(t.viewQuery)){var e=to.prop("declarationAppElement").prop("componentConstructorViewQueries").key(A(h++)),r=new Ph(t.viewQuery,e,null,c);Ge(l,r)}})}this.viewQueries=l,u.forEach(function(t){c.locals.set(t[1],to.prop("context").prop(t[0]))}),this.declarationElement.isNull()||this.declarationElement.setEmbeddedView(this)}return t.prototype.callPipe=function(t,e,n){return Vh.call(this,t,[e].concat(n))},t.prototype.getLocal=function(t){if(t==Ih.event.name)return Ih.event;for(var e=this,r=e.locals.get(t);!r&&n(e.declarationElement.view);)e=e.declarationElement.view,r=e.locals.get(t);return n(r)?De(r,this,e):null},t.prototype.createLiteralArray=function(t){if(0===t.length)return S(Xt(Ol.EMPTY_ARRAY));for(var e=to.prop("_arr_"+this.literalArrayCount++),n=[],r=[],i=0;i":n=wi.Bigger;break;case"<=":n=wi.LowerEquals;break;case">=":n=wi.BiggerEquals;break;default:throw new Error("Unsupported operation "+t.operation)}return sn(e,new $i(n,this.visit(t.left,Kl.Expression),this.visit(t.right,Kl.Expression)))},t.prototype.visitChain=function(t,e){return rn(e,t),this.visitAll(t.expressions,e)},t.prototype.visitConditional=function(t,e){var n=this.visit(t.condition,Kl.Expression);return sn(e,n.conditional(this.visit(t.trueExp,Kl.Expression),this.visit(t.falseExp,Kl.Expression)))},t.prototype.visitPipe=function(t,e){var n=this.visit(t.exp,Kl.Expression),r=this.visitAll(t.args,Kl.Expression),i=this._nameResolver.callPipe(t.name,n,r);return this.needsValueUnwrapper=!0,sn(e,this._valueUnwrapper.callMethod("unwrap",[i]))},t.prototype.visitFunctionCall=function(t,e){return sn(e,this.visit(t.target,Kl.Expression).callFn(this.visitAll(t.args,Kl.Expression)))},t.prototype.visitImplicitReceiver=function(t,e){return on(e,t),this._implicitReceiver},t.prototype.visitInterpolation=function(t,e){on(e,t);for(var n=[A(t.expressions.length)],r=0;r=0){var a=o[s],u=pn(a),c=C("pd_"+this._actionResultExprs.length);this._actionResultExprs.push(c),n(u)&&(o[s]=c.set(u.cast(xi).notIdentical(A(!1))).toDeclStmt(null,[Di.Final]))}this._method.addStmts(o)},t.prototype.finishMethod=function(){var t=this._hasComponentHostListener?this.compileElement.appElement.prop("componentView"):to,e=A(!0);this._actionResultExprs.forEach(function(t){e=e.and(t)});var n=[t.callMethod("markPathToRootAsCheckOnce",[]).toStmt()].concat(this._method.finish()).concat([new uo(e)]);this.compileElement.view.eventHandlerMethods.push(new po(this._methodName,[this._eventParam],n,Pi,[Di.Private]))},t.prototype.listenToRenderer=function(){var t,e=to.callMethod("eventHandler",[to.prop(this._methodName).callMethod(Ii.Bind,[to])]);t=n(this.eventTarget)?Rh.renderer.callMethod("listenGlobal",[A(this.eventTarget),A(this.eventName),e]):Rh.renderer.callMethod("listen",[this.compileElement.renderNode,A(this.eventName),e]);var r=C("disposable_"+this.compileElement.view.disposables.length);this.compileElement.view.disposables.push(r),this.compileElement.view.createMethod.addStmt(r.set(t).toDeclStmt(ki,[Di.Private]))},t.prototype.listenToAnimation=function(){var t=to.callMethod("eventHandler",[to.prop(this._methodName).callMethod(Ii.Bind,[to])]),e=to.callMethod("registerAnimationOutput",[this.compileElement.renderNode,A(this.eventName),A(this.eventPhase),t]).toStmt();this.compileElement.view.createMethod.addStmt(e)},t.prototype.listenToDirective=function(t,e){var n=C("subscription_"+this.compileElement.view.subscriptions.length);this.compileElement.view.subscriptions.push(n);var r=to.callMethod("eventHandler",[to.prop(this._methodName).callMethod(Ii.Bind,[to])]);this.compileElement.view.createMethod.addStmt(n.set(t.prop(e).callMethod(Ii.SubscribeObservable,[r])).toDeclStmt(null,[Di.Final]))},t}(),Wh=to.prop("numberOfChecks").identical(new Ui(0)),Jh=N(Mh.throwOnChange),$h=function(){function t(t){this.view=t,this._nodeIndex=0}return t.prototype.visitBoundText=function(t,e){var n=this.view.nodes[this._nodeIndex++];return wn(t,n,this.view),null},t.prototype.visitText=function(t,e){return this._nodeIndex++,null},t.prototype.visitNgContent=function(t,e){return null},t.prototype.visitElement=function(t,e){var n=this.view.nodes[this._nodeIndex++],r=[];return un(t.outputs,t.directives,n).forEach(function(t){r.push(t)}),Cn(t.inputs,n),ln(r),t.directives.forEach(function(t){var e=n.instances.get(t.directive.type.reference);xn(t,e,n),fn(t,e,n),Sn(t,e,n),cn(t,e,r)}),m(this,t.children,n),t.directives.forEach(function(t){var e=n.instances.get(t.directive.type.reference);dn(t.directive,e,n),yn(t.directive,e,n)}),t.providers.forEach(function(t){var e=n.instances.get(t.token.reference);mn(t,e,n)}),null},t.prototype.visitEmbeddedTemplate=function(t,e){var n=this.view.nodes[this._nodeIndex++],r=un(t.outputs,t.directives,n);return t.directives.forEach(function(t){var e=n.instances.get(t.directive.type.reference);xn(t,e,n),fn(t,e,n),cn(t,e,r),dn(t.directive,e,n),yn(t.directive,e,n)}),t.providers.forEach(function(t){var e=n.instances.get(t.token.reference);mn(t,e,n)}),Tn(n.embeddedView,t.children),null},t.prototype.visitAttr=function(t,e){return null},t.prototype.visitDirective=function(t,e){return null},t.prototype.visitEvent=function(t,e){return null},t.prototype.visitReference=function(t,e){return null},t.prototype.visitVariable=function(t,e){return null},t.prototype.visitDirectiveProperty=function(t,e){return null},t.prototype.visitElementProperty=function(t,e){return null},t}(),Kh="$implicit",Xh="class",Zh="style",Yh="ng-container",tf=C("parentRenderNode"),ef=C("rootSelector"),nf=function(){function t(t,e){this.comp=t,this.placeholder=e}return t}(),rf=function(){function t(t,e){this.comp=t,this.placeholder=e}return t}(),of=function(){function t(t,e){this.view=t,this.targetDependencies=e,this.nestedViewCount=0}return t.prototype._isRootNode=function(t){return t.view!==this.view},t.prototype._addRootNodeAndProject=function(t){var e=An(t),r=e.parent,i=e.sourceAst.ngContentIndex,o=t instanceof Dh&&t.hasViewContainer?t.appElement:null;this._isRootNode(r)?this.view.viewType!==Nc.COMPONENT&&this.view.rootNodesOrAppElements.push(n(o)?o:t.renderNode):n(r.component)&&n(i)&&r.addContentNode(i,n(o)?o:t.renderNode)},t.prototype._getParentRenderNode=function(t){return t=Rn(t),this._isRootNode(t)?this.view.viewType===Nc.COMPONENT?tf:no:n(t.component)&&t.component.template.encapsulation!==e.ViewEncapsulation.Native?no:t.renderNode},t.prototype.visitBoundText=function(t,e){return this._visitText(t,"",e)},t.prototype.visitText=function(t,e){return this._visitText(t,t.value,e)},t.prototype._visitText=function(t,e,n){var r="_text_"+this.view.nodes.length;this.view.fields.push(new lo(r,x(this.view.genConfig.renderTypes.renderText)));var i=to.prop(r),o=new Fh(n,this.view,this.view.nodes.length,i,t),s=to.prop(r).set(Rh.renderer.callMethod("createText",[this._getParentRenderNode(n),A(e),this.view.createMethod.resetDebugInfoExpr(this.view.nodes.length,t)])).toStmt();return this.view.nodes.push(o),this.view.createMethod.addStmt(s),this._addRootNodeAndProject(o),i},t.prototype.visitNgContent=function(t,e){this.view.createMethod.resetDebugInfo(null,t);var r=this._getParentRenderNode(e),i=Rh.projectableNodes.key(A(t.index),new Ci(x(this.view.genConfig.renderTypes.renderNode)));return r!==no?this.view.createMethod.addStmt(Rh.renderer.callMethod("projectNodes",[r,S(Xt(Ol.flattenNestedViewRenderNodes)).callFn([i])]).toStmt()):this._isRootNode(e)?this.view.viewType!==Nc.COMPONENT&&this.view.rootNodesOrAppElements.push(i):n(e.component)&&n(t.ngContentIndex)&&e.addContentNode(t.ngContentIndex,i),null},t.prototype.visitElement=function(t,e){var r,i=this,o=this.view.nodes.length,s=this.view.createMethod.resetDebugInfoExpr(o,t);r=0===o&&this.view.viewType===Nc.HOST?to.callMethod("selectOrCreateHostElement",[A(t.name),ef,s]):t.name===Yh?Rh.renderer.callMethod("createTemplateAnchor",[this._getParentRenderNode(e),s]):Rh.renderer.callMethod("createElement",[this._getParentRenderNode(e),A(t.name),s]);var a="_el_"+o;this.view.fields.push(new lo(a,x(this.view.genConfig.renderTypes.renderElement))),this.view.createMethod.addStmt(to.prop(a).set(r).toStmt());for(var u=to.prop(a),c=t.directives.map(function(t){return t.directive}),l=c.find(function(t){return t.isComponent}),p=Mn(t.attrs),h=qn(p,c),f=0;f0?t.value:Kh,t.name]}),s=t.directives.map(function(t){return t.directive}),a=new Dh(e,this.view,n,i,t,null,s,t.providers,t.hasViewContainer,(!0),t.references);this.view.nodes.push(a),this.nestedViewCount++;var u=new Qh(this.view.component,this.view.genConfig,this.view.pipeMetas,no,this.view.animations,this.view.viewIndex+this.nestedViewCount,a,o);return this.nestedViewCount+=Nn(u,t.children,this.targetDependencies),a.beforeChildren(),this._addRootNodeAndProject(a),a.afterChildren(0),null},t.prototype.visitAttr=function(t,e){return null},t.prototype.visitDirective=function(t,e){return null},t.prototype.visitEvent=function(t,e){return null},t.prototype.visitReference=function(t,e){return null},t.prototype.visitVariable=function(t,e){return null},t.prototype.visitDirectiveProperty=function(t,e){return null},t.prototype.visitElementProperty=function(t,e){return null},t}(),sf=function(){function t(t,e,n){this.statements=t,this.viewFactoryVar=e,this.dependencies=n}return t}(),af=function(){function t(t){this._genConfig=t,this._animationCompiler=new $p}return t.prototype.compileComponent=function(t,e,n,r,i){var o=[],s=new Qh(t,this._genConfig,r,n,i,0,Dh.createNull(),[]),a=[];return Nn(s,e,o),Tn(s,e),kn(s,a),new sf(a,s.viewFactory.name,o)},t.decorators=[{type:e.Injectable}],t.ctorParameters=[{type:Rp}],t}(),uf=function(){function t(t,e){this.moduleUrl=t,this.source=e}return t}(),cf=function(){function t(t){this.ngModuleByComponent=t}return t}(),lf=function(){function t(t,e,n,r,i,o,s,a,u){this._metadataResolver=t,this._directiveNormalizer=e,this._templateParser=n,this._styleCompiler=r,this._viewCompiler=i,this._ngModuleCompiler=o,this._outputEmitter=s,this._localeId=a,this._translationFormat=u,this._animationParser=new bh,this._animationCompiler=new $p}return t.prototype.analyzeModules=function(t){var e=this,n=new Map;return t.forEach(function(t){var r=e._metadataResolver.getNgModuleMetadata(t);r.declaredDirectives.forEach(function(t){t.isComponent&&n.set(t.type.reference,r)})}),new cf(n)},t.prototype.clearCache=function(){this._directiveNormalizer.clearCache(),this._metadataResolver.clearCache()},t.prototype.compile=function(t,e,n,r){var i=this,o=Yn(t)[1],s=[],a=[],u=[];return a.push.apply(a,r.map(function(t){return i._compileModule(t,s)})),Promise.all(n.map(function(t){var n=i._metadataResolver.getDirectiveMetadata(t),r=e.ngModuleByComponent.get(t);if(!r)throw new Error("Cannot determine the module for component "+n.type.name+"!");return Promise.all([n].concat(r.transitiveModule.directives).map(function(t){return i._directiveNormalizer.normalizeDirective(t).asyncResult})).then(function(t){var e=t[0],n=t.slice(1);Zn(e);var c=i._styleCompiler.compileComponent(e);c.externalStylesheets.forEach(function(t){u.push(i._codgenStyles(t,o))}),a.push(i._compileComponentFactory(e,o,s),i._compileComponent(e,n,r.transitiveModule.pipes,r.schemas,c.componentStylesheet,o,s))})})).then(function(){return s.length>0&&u.unshift(i._codegenSourceModule($n(t),s,a)),u})},t.prototype._compileModule=function(t,e){var n=this._metadataResolver.getNgModuleMetadata(t),r=[];this._localeId&&r.push(new Uo({token:Yt(Ol.LOCALE_ID),useValue:this._localeId})),this._translationFormat&&r.push(new Uo({token:Yt(Ol.TRANSLATIONS_FORMAT),useValue:this._translationFormat}));var i=this._ngModuleCompiler.compile(n,r);return i.dependencies.forEach(function(t){t.placeholder.name=Kn(t.comp),t.placeholder.moduleUrl=$n(t.comp.moduleUrl)}),e.push.apply(e,i.statements),i.ngModuleFactoryVar},t.prototype._compileComponentFactory=function(t,e,n){var r=Q(t),i=this._compileComponent(r,[t],[],[],null,e,n),o=Kn(t.type);return n.push(C(o).set(S(Xt(Ol.ComponentFactory),[x(t.type)]).instantiate([A(t.selector),C(i),S(t.type)],x(Xt(Ol.ComponentFactory),[x(t.type)],[ui.Const]))).toDeclStmt(null,[Di.Final])),o},t.prototype._compileComponent=function(t,e,n,r,i,o,s){var a=this._animationParser.parseComponent(t),u=this._templateParser.parse(t,t.template.template,e,n,r,t.type.name),c=i?C(i.stylesVar):P([]),l=this._animationCompiler.compile(t.type.name,a),p=this._viewCompiler.compileComponent(t,u,c,n,l);return i&&s.push.apply(s,Jn(i,o)),l.forEach(function(t){t.statements.forEach(function(t){s.push(t)})}),s.push.apply(s,Wn(p)),p.viewFactoryVar},t.prototype._codgenStyles=function(t,e){return Jn(t,e),this._codegenSourceModule(Xn(t.meta.moduleUrl,t.isShimmed,e),t.statements,[t.stylesVar])},t.prototype._codegenSourceModule=function(t,e,n){return new uf(t,this._outputEmitter.emitStatements(t,e,n))},t}(),pf=function(){function t(){}return t.prototype.get=function(t){return null},t}(),hf="asset:",ff={provide:e.PACKAGE_ROOT_URL,useValue:"/"},df=function(){function t(t){void 0===t&&(t=null),this._packagePrefix=t}return t.prototype.resolve=function(t,e){var r=e;n(t)&&t.length>0&&(r=sr(t,r));var i=rr(r),o=this._packagePrefix;if(n(o)&&n(i)&&"package"==i[Hh.Scheme]){var s=i[Hh.Path];if(this._packagePrefix!==hf)return o=Vr.stripRight(o,"/"),s=Vr.stripLeft(s,"/"),o+"/"+s;var a=s.split(/\//);r="asset:"+a[0]+"/lib/"+a.slice(1).join("/")}return r},t.decorators=[{type:e.Injectable}],t.ctorParameters=[{type:void 0,decorators:[{type:e.Inject,args:[e.PACKAGE_ROOT_URL]}]}],t}(),yf=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");!function(t){t[t.Scheme=1]="Scheme",t[t.UserInfo=2]="UserInfo",t[t.Domain=3]="Domain",t[t.Port=4]="Port",t[t.Path=5]="Path",t[t.QueryData=6]="QueryData",t[t.Fragment=7]="Fragment"}(Hh||(Hh={}));var mf=function(){function t(t,e,n,r){this._resourceLoader=t,this._urlResolver=e,this._htmlParser=n,this._config=r,this._resourceLoaderCache=new Map}return t.prototype.clearCache=function(){this._resourceLoaderCache.clear()},t.prototype.clearCacheFor=function(t){var e=this;t.isComponent&&(this._resourceLoaderCache["delete"](t.template.templateUrl),t.template.externalStylesheets.forEach(function(t){e._resourceLoaderCache["delete"](t.moduleUrl)}))},t.prototype._fetch=function(t){var e=this._resourceLoaderCache.get(t);return e||(e=this._resourceLoader.get(t),this._resourceLoaderCache.set(t,e)),e},t.prototype.normalizeDirective=function(t){var e=this;if(!t.isComponent)return new So(t,Promise.resolve(t));var r,i=null;if(n(t.template.template))i=this.normalizeTemplateSync(t.type,t.template),r=Promise.resolve(i);else{if(!t.template.templateUrl)throw new Error("No template specified for component "+t.type.name);r=this.normalizeTemplateAsync(t.type,t.template)}if(i&&0===i.styleUrls.length){var o=ar(t,i);return new So(o,Promise.resolve(o))}return new So(null,r.then(function(t){return e.normalizeExternalStylesheets(t)}).then(function(e){return ar(t,e)}))},t.prototype.normalizeTemplateSync=function(t,e){return this.normalizeLoadedTemplate(t,e,e.template,t.moduleUrl)},t.prototype.normalizeTemplateAsync=function(t,e){var n=this,r=this._urlResolver.resolve(t.moduleUrl,e.templateUrl);return this._fetch(r).then(function(i){return n.normalizeLoadedTemplate(t,e,i,r)})},t.prototype.normalizeLoadedTemplate=function(t,n,r,o){var s=Na.fromArray(n.interpolation),a=this._htmlParser.parse(r,t.name,!1,s);if(a.errors.length>0){var u=a.errors.join("\n");throw new Error("Template parse errors:\n"+u)}var c=this.normalizeStylesheet(new Wo({styles:n.styles,styleUrls:n.styleUrls,moduleUrl:t.moduleUrl})),l=new vf;ht(l,a.rootNodes);var p=this.normalizeStylesheet(new Wo({styles:l.styles,styleUrls:l.styleUrls,moduleUrl:o})),h=n.encapsulation;i(h)&&(h=this._config.defaultEncapsulation);var f=c.styles.concat(p.styles),d=c.styleUrls.concat(p.styleUrls);return h===e.ViewEncapsulation.Emulated&&0===f.length&&0===d.length&&(h=e.ViewEncapsulation.None),new Jo({encapsulation:h,template:r,templateUrl:o,styles:f,styleUrls:d,externalStylesheets:n.externalStylesheets,ngContentSelectors:l.ngContentSelectors,animations:n.animations,interpolation:n.interpolation})},t.prototype.normalizeExternalStylesheets=function(t){return this._loadMissingExternalStylesheets(t.styleUrls).then(function(e){return new Jo({encapsulation:t.encapsulation,template:t.template,templateUrl:t.templateUrl,styles:t.styles,styleUrls:t.styleUrls,externalStylesheets:e,ngContentSelectors:t.ngContentSelectors,animations:t.animations,interpolation:t.interpolation})})},t.prototype._loadMissingExternalStylesheets=function(t,e){var n=this;return void 0===e&&(e=new Map),Promise.all(t.filter(function(t){return!e.has(t)}).map(function(t){return n._fetch(t).then(function(r){var i=n.normalizeStylesheet(new Wo({styles:[r],moduleUrl:t}));return e.set(t,i),n._loadMissingExternalStylesheets(i.styleUrls,e)})})).then(function(t){return oi.values(e)})},t.prototype.normalizeStylesheet=function(t){var e=this,n=t.styleUrls.filter(he).map(function(n){return e._urlResolver.resolve(t.moduleUrl,n)}),r=t.styles.map(function(r){var i=fe(e._urlResolver,t.moduleUrl,r);return n.push.apply(n,i.styleUrls),i.style});return new Wo({styles:r,styleUrls:n,moduleUrl:t.moduleUrl})},t.decorators=[{type:e.Injectable}],t.ctorParameters=[{type:pf},{type:df},{type:Sl},{type:Rp}],t}(),vf=function(){function t(){this.ngContentSelectors=[],this.styles=[],this.styleUrls=[],this.ngNonBindableStackCount=0}return t.prototype.visitElement=function(t,e){var n=de(t);switch(n.type){case Ru.NG_CONTENT:0===this.ngNonBindableStackCount&&this.ngContentSelectors.push(n.selectAttr);break;case Ru.STYLE:var r="";t.children.forEach(function(t){t instanceof Wa&&(r+=t.value)}),this.styles.push(r);break;case Ru.STYLESHEET:this.styleUrls.push(n.hrefAttr)}return n.nonBindable&&this.ngNonBindableStackCount++,ht(this,t.children),n.nonBindable&&this.ngNonBindableStackCount--,null},t.prototype.visitComment=function(t,e){return null},t.prototype.visitAttribute=function(t,e){return null},t.prototype.visitText=function(t,e){return null},t.prototype.visitExpansion=function(t,e){return null},t.prototype.visitExpansionCase=function(t,e){return null},t}(),gf=function(){function t(t){void 0===t&&(t=el),this._reflector=t}return t.prototype.resolve=function(t,n){void 0===n&&(n=!0);var r=this._reflector.annotations(e.resolveForwardRef(t));if(r){var i=r.find(ur);if(i){var o=this._reflector.propMetadata(t);return this._mergeWithPropertyMetadata(i,o,t)}}if(n)throw new Error("No Directive annotation found on "+c(t));return null},t.prototype._mergeWithPropertyMetadata=function(t,n,r){var i=[],o=[],s={},a={};return Object.keys(n).forEach(function(t){n[t].forEach(function(n){if(n instanceof e.Input)n.bindingPropertyName?i.push(t+": "+n.bindingPropertyName):i.push(t);else if(n instanceof e.Output){var r=n;r.bindingPropertyName?o.push(t+": "+r.bindingPropertyName):o.push(t)}else if(n instanceof e.HostBinding){var u=n;u.hostPropertyName?s["["+u.hostPropertyName+"]"]=t:s["["+t+"]"]=t}else if(n instanceof e.HostListener){var c=n,l=c.args||[];s["("+c.eventName+")"]=t+"("+l.join(",")+")"}else n instanceof e.Query&&(a[t]=n)})}),this._merge(t,i,o,s,a,r)},t.prototype._extractPublicName=function(t){return I(t,[null,t])[1].trim()},t.prototype._merge=function(t,n,r,i,o,s){var a=this,u=n;if(t.inputs){var l=t.inputs.map(function(t){return a._extractPublicName(t)});n.forEach(function(t){var e=a._extractPublicName(t);if(l.indexOf(e)>-1)throw new Error("Input '"+e+"' defined multiple times in '"+c(s)+"'")}),u.unshift.apply(u,t.inputs)}var p=r;if(t.outputs){var h=t.outputs.map(function(t){return a._extractPublicName(t)});r.forEach(function(t){var e=a._extractPublicName(t);if(h.indexOf(e)>-1)throw new Error("Output event '"+e+"' defined multiple times in '"+c(s)+"'")}),p.unshift.apply(p,t.outputs)}var f=t.host?si.merge(t.host,i):i,d=t.queries?si.merge(t.queries,o):o;return t instanceof e.Component?new e.Component({selector:t.selector,inputs:u,outputs:p,host:f,exportAs:t.exportAs,moduleId:t.moduleId,queries:d,changeDetection:t.changeDetection,providers:t.providers, diff --git a/dist/css/vendor.min.css b/dist/css/vendor.min.css index e1a43c990..08de12463 100644 --- a/dist/css/vendor.min.css +++ b/dist/css/vendor.min.css @@ -18,6 +18,7 @@ font-family: monospace; height: 300px; color: black; + direction: ltr; } /* PADDING */ @@ -71,7 +72,12 @@ .cm-fat-cursor div.CodeMirror-cursors { z-index: 1; } - +.cm-fat-cursor-mark { + background-color: rgba(20, 255, 20, 0.5); + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; +} .cm-animate-fat-cursor { width: auto; border: 0; @@ -132,7 +138,7 @@ .cm-s-default .cm-property, .cm-s-default .cm-operator {} .cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} .cm-s-default .cm-comment {color: #a50;} .cm-s-default .cm-string {color: #a11;} .cm-s-default .cm-string-2 {color: #f50;} @@ -152,8 +158,8 @@ /* Default styles for common addons */ -div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} +div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} .CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } .CodeMirror-activeline-background {background: #e8f2ff;} @@ -236,11 +242,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} cursor: default; z-index: 4; } -.CodeMirror-gutter-wrapper { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; -} +.CodeMirror-gutter-wrapper ::selection { background-color: transparent } +.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } .CodeMirror-lines { cursor: text; @@ -280,11 +283,13 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} .CodeMirror-linewidget { position: relative; z-index: 2; - overflow: auto; + padding: 0.1px; /* Force widget margins to stay inside of the container */ } .CodeMirror-widget {} +.CodeMirror-rtl pre { direction: rtl; } + .CodeMirror-code { outline: none; } @@ -333,8 +338,8 @@ div.CodeMirror-dragcursors { .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } .cm-searching { - background: #ffa; - background: rgba(255, 255, 0, .4); + background-color: #ffa; + background-color: rgba(255, 255, 0, .4); } /* Used to force a border model for a node */ diff --git a/dist/js/vendor.js b/dist/js/vendor.js index c8267996a..f32f6029f 100644 --- a/dist/js/vendor.js +++ b/dist/js/vendor.js @@ -7620,9 +7620,7 @@ void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!= */ if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
    ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
  • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
      '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('
    • ×
    • ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change"); -if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
    • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null; -},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}); +/*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
        ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
      • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[aria-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
          '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
        • ×
        • ')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(g)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
        • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}); // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE @@ -7633,57 +7631,59 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push // at http://marijnhaverbeke.nl/blog/#cm-internals . (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.CodeMirror = factory()); + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.CodeMirror = factory()); }(this, (function () { 'use strict'; // Kludges for bugs and behavior differences that can't be feature // detected are enabled based on userAgent etc sniffing. -var userAgent = navigator.userAgent -var platform = navigator.platform - -var gecko = /gecko\/\d/i.test(userAgent) -var ie_upto10 = /MSIE \d/.test(userAgent) -var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent) -var ie = ie_upto10 || ie_11up -var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]) -var webkit = /WebKit\//.test(userAgent) -var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent) -var chrome = /Chrome\//.test(userAgent) -var presto = /Opera\//.test(userAgent) -var safari = /Apple Computer/.test(navigator.vendor) -var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent) -var phantom = /PhantomJS/.test(userAgent) - -var ios = /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent) +var userAgent = navigator.userAgent; +var platform = navigator.platform; + +var gecko = /gecko\/\d/i.test(userAgent); +var ie_upto10 = /MSIE \d/.test(userAgent); +var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); +var edge = /Edge\/(\d+)/.exec(userAgent); +var ie = ie_upto10 || ie_11up || edge; +var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); +var webkit = !edge && /WebKit\//.test(userAgent); +var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); +var chrome = !edge && /Chrome\//.test(userAgent); +var presto = /Opera\//.test(userAgent); +var safari = /Apple Computer/.test(navigator.vendor); +var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); +var phantom = /PhantomJS/.test(userAgent); + +var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent); +var android = /Android/.test(userAgent); // This is woefully incomplete. Suggestions for alternative methods welcome. -var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent) -var mac = ios || /Mac/.test(platform) -var chromeOS = /\bCrOS\b/.test(userAgent) -var windows = /win/i.test(platform) - -var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/) -if (presto_version) { presto_version = Number(presto_version[1]) } -if (presto_version && presto_version >= 15) { presto = false; webkit = true } +var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); +var mac = ios || /Mac/.test(platform); +var chromeOS = /\bCrOS\b/.test(userAgent); +var windows = /win/i.test(platform); + +var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); +if (presto_version) { presto_version = Number(presto_version[1]); } +if (presto_version && presto_version >= 15) { presto = false; webkit = true; } // Some browsers use the wrong event properties to signal cmd/ctrl on OS X -var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)) -var captureRightClick = gecko || (ie && ie_version >= 9) +var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); +var captureRightClick = gecko || (ie && ie_version >= 9); function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } var rmClass = function(node, cls) { - var current = node.className - var match = classTest(cls).exec(current) + var current = node.className; + var match = classTest(cls).exec(current); if (match) { - var after = current.slice(match.index + match[0].length) - node.className = current.slice(0, match.index) + (after ? match[1] + after : "") + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); } -} +}; function removeChildren(e) { for (var count = e.childNodes.length; count > 0; --count) - { e.removeChild(e.firstChild) } + { e.removeChild(e.firstChild); } return e } @@ -7692,38 +7692,44 @@ function removeChildrenAndAdd(parent, e) { } function elt(tag, content, className, style) { - var e = document.createElement(tag) - if (className) { e.className = className } - if (style) { e.style.cssText = style } - if (typeof content == "string") { e.appendChild(document.createTextNode(content)) } - else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } } + var e = document.createElement(tag); + if (className) { e.className = className; } + if (style) { e.style.cssText = style; } + if (typeof content == "string") { e.appendChild(document.createTextNode(content)); } + else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } } + return e +} +// wrapper for elt, which removes the elt from the accessibility tree +function eltP(tag, content, className, style) { + var e = elt(tag, content, className, style); + e.setAttribute("role", "presentation"); return e } -var range +var range; if (document.createRange) { range = function(node, start, end, endNode) { - var r = document.createRange() - r.setEnd(endNode || node, end) - r.setStart(node, start) + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); return r -} } +}; } else { range = function(node, start, end) { - var r = document.body.createTextRange() - try { r.moveToElementText(node.parentNode) } + var r = document.body.createTextRange(); + try { r.moveToElementText(node.parentNode); } catch(e) { return r } - r.collapse(true) - r.moveEnd("character", end) - r.moveStart("character", start) + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); return r -} } +}; } function contains(parent, child) { if (child.nodeType == 3) // Android browser always returns false when child is a textnode - { child = child.parentNode } + { child = child.parentNode; } if (parent.contains) { return parent.contains(child) } do { - if (child.nodeType == 11) { child = child.host } + if (child.nodeType == 11) { child = child.host; } if (child == parent) { return true } } while (child = child.parentNode) } @@ -7732,44 +7738,44 @@ function activeElt() { // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. // IE < 10 will throw when accessed while the page is loading or in an iframe. // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. - var activeElement + var activeElement; try { - activeElement = document.activeElement + activeElement = document.activeElement; } catch(e) { - activeElement = document.body || null + activeElement = document.body || null; } - while (activeElement && activeElement.root && activeElement.root.activeElement) - { activeElement = activeElement.root.activeElement } + while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) + { activeElement = activeElement.shadowRoot.activeElement; } return activeElement } function addClass(node, cls) { - var current = node.className - if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls } + var current = node.className; + if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls; } } function joinClasses(a, b) { - var as = a.split(" ") + var as = a.split(" "); for (var i = 0; i < as.length; i++) - { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i] } } + { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i]; } } return b } -var selectInput = function(node) { node.select() } +var selectInput = function(node) { node.select(); }; if (ios) // Mobile Safari apparently has a bug where select() is broken. - { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } } + { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; } else if (ie) // Suppress mysterious IE10 errors - { selectInput = function(node) { try { node.select() } catch(_e) {} } } + { selectInput = function(node) { try { node.select(); } catch(_e) {} }; } function bind(f) { - var args = Array.prototype.slice.call(arguments, 1) + var args = Array.prototype.slice.call(arguments, 1); return function(){return f.apply(null, args)} } function copyObj(obj, target, overwrite) { - if (!target) { target = {} } + if (!target) { target = {}; } for (var prop in obj) { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) - { target[prop] = obj[prop] } } + { target[prop] = obj[prop]; } } return target } @@ -7777,24 +7783,24 @@ function copyObj(obj, target, overwrite) { // Used mostly to find indentation. function countColumn(string, end, tabSize, startIndex, startValue) { if (end == null) { - end = string.search(/[^\s\u00a0]/) - if (end == -1) { end = string.length } + end = string.search(/[^\s\u00a0]/); + if (end == -1) { end = string.length; } } for (var i = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf("\t", i) + var nextTab = string.indexOf("\t", i); if (nextTab < 0 || nextTab >= end) { return n + (end - i) } - n += nextTab - i - n += tabSize - (n % tabSize) - i = nextTab + 1 + n += nextTab - i; + n += tabSize - (n % tabSize); + i = nextTab + 1; } } -function Delayed() {this.id = null} -Delayed.prototype.set = function(ms, f) { - clearTimeout(this.id) - this.id = setTimeout(f, ms) -} +var Delayed = function() {this.id = null;}; +Delayed.prototype.set = function (ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); +}; function indexOf(array, elt) { for (var i = 0; i < array.length; ++i) @@ -7803,68 +7809,69 @@ function indexOf(array, elt) { } // Number of pixels added to scroller and sizer to hide scrollbar -var scrollerGap = 30 +var scrollerGap = 30; // Returned or thrown by various protocols to signal 'I'm not // handling this'. -var Pass = {toString: function(){return "CodeMirror.Pass"}} +var Pass = {toString: function(){return "CodeMirror.Pass"}}; // Reused option objects for setSelection & friends var sel_dontScroll = {scroll: false}; var sel_mouse = {origin: "*mouse"}; var sel_move = {origin: "+move"}; + // The inverse of countColumn -- find the offset that corresponds to // a particular column. function findColumn(string, goal, tabSize) { for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf("\t", pos) - if (nextTab == -1) { nextTab = string.length } - var skipped = nextTab - pos + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) { nextTab = string.length; } + var skipped = nextTab - pos; if (nextTab == string.length || col + skipped >= goal) { return pos + Math.min(skipped, goal - col) } - col += nextTab - pos - col += tabSize - (col % tabSize) - pos = nextTab + 1 + col += nextTab - pos; + col += tabSize - (col % tabSize); + pos = nextTab + 1; if (col >= goal) { return pos } } } -var spaceStrs = [""] +var spaceStrs = [""]; function spaceStr(n) { while (spaceStrs.length <= n) - { spaceStrs.push(lst(spaceStrs) + " ") } + { spaceStrs.push(lst(spaceStrs) + " "); } return spaceStrs[n] } function lst(arr) { return arr[arr.length-1] } function map(array, f) { - var out = [] - for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) } + var out = []; + for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); } return out } function insertSorted(array, value, score) { - var pos = 0, priority = score(value) - while (pos < array.length && score(array[pos]) <= priority) { pos++ } - array.splice(pos, 0, value) + var pos = 0, priority = score(value); + while (pos < array.length && score(array[pos]) <= priority) { pos++; } + array.splice(pos, 0, value); } function nothing() {} function createObj(base, props) { - var inst + var inst; if (Object.create) { - inst = Object.create(base) + inst = Object.create(base); } else { - nothing.prototype = base - inst = new nothing() + nothing.prototype = base; + inst = new nothing(); } - if (props) { copyObj(props, inst) } + if (props) { copyObj(props, inst); } return inst } -var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/ +var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; function isWordCharBasic(ch) { return /\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)) @@ -7885,121 +7892,144 @@ function isEmpty(obj) { // as editing and measuring is concerned. This is not fully correct, // since some scripts/fonts/browsers also treat other configurations // of code points as a group. -var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/ +var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) } +// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. +function skipExtendingChars(str, pos, dir) { + while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; } + return pos +} + +// Returns the value from the range [`from`; `to`] that satisfies +// `pred` and is closest to `from`. Assumes that at least `to` +// satisfies `pred`. Supports `from` being greater than `to`. +function findFirst(pred, from, to) { + // At any point we are certain `to` satisfies `pred`, don't know + // whether `from` does. + var dir = from > to ? -1 : 1; + for (;;) { + if (from == to) { return from } + var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); + if (mid == from) { return pred(mid) ? from : to } + if (pred(mid)) { to = mid; } + else { from = mid + dir; } + } +} + // The display handles the DOM integration, both for input reading // and content drawing. It holds references to DOM nodes and // display-related state. function Display(place, doc, input) { - var d = this - this.input = input + var d = this; + this.input = input; // Covers bottom-right square when both scrollbars are present. - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler") - d.scrollbarFiller.setAttribute("cm-not-content", "true") + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); // Covers bottom of gutter when coverGutterNextToScrollbar is on // and h scrollbar is present. - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler") - d.gutterFiller.setAttribute("cm-not-content", "true") + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); // Will contain the actual code, positioned to cover the viewport. - d.lineDiv = elt("div", null, "CodeMirror-code") + d.lineDiv = eltP("div", null, "CodeMirror-code"); // Elements are added to these to represent selection and cursors. - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1") - d.cursorDiv = elt("div", null, "CodeMirror-cursors") + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); // A visibility: hidden element used to find the size of things. - d.measure = elt("div", null, "CodeMirror-measure") + d.measure = elt("div", null, "CodeMirror-measure"); // When lines outside of the viewport are measured, they are drawn in this. - d.lineMeasure = elt("div", null, "CodeMirror-measure") + d.lineMeasure = elt("div", null, "CodeMirror-measure"); // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], - null, "position: relative; outline: none") + d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none"); + var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); // Moved around its parent to cover visible view. - d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative") + d.mover = elt("div", [lines], null, "position: relative"); // Set to the height of the document, allowing scrolling. - d.sizer = elt("div", [d.mover], "CodeMirror-sizer") - d.sizerWidth = null + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; // Behavior of elts with overflow: auto and padding is // inconsistent across browsers. This is used to ensure the // scrollable area is big enough. - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;") + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); // Will contain the gutters, if any. - d.gutters = elt("div", null, "CodeMirror-gutters") - d.lineGutter = null + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; // Actual scrollable element. - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll") - d.scroller.setAttribute("tabIndex", "-1") + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); // The element in which the editor lives. - d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror") + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) - if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 } - if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true } + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; } if (place) { - if (place.appendChild) { place.appendChild(d.wrapper) } - else { place(d.wrapper) } + if (place.appendChild) { place.appendChild(d.wrapper); } + else { place(d.wrapper); } } // Current rendered range (may be bigger than the view window). - d.viewFrom = d.viewTo = doc.first - d.reportedViewFrom = d.reportedViewTo = doc.first + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; // Information about the rendered lines. - d.view = [] - d.renderedView = null + d.view = []; + d.renderedView = null; // Holds info about a single rendered line when it was rendered // for measurement, while not in view. - d.externalMeasured = null + d.externalMeasured = null; // Empty space (in pixels) above the view - d.viewOffset = 0 - d.lastWrapHeight = d.lastWrapWidth = 0 - d.updateLineNumbers = null + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; - d.nativeBarWidth = d.barHeight = d.barWidth = 0 - d.scrollbarsClipped = false + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; // Used to only resize the line number gutter when necessary (when // the amount of lines crosses a boundary that makes its width change) - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; // Set to true when a non-horizontal-scrolling line widget is // added. As an optimization, line widget aligning is skipped when // this is false. - d.alignWidgets = false + d.alignWidgets = false; - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; // Tracks the maximum line length so that the horizontal scrollbar // can be kept static when scrolling. - d.maxLine = null - d.maxLineLength = 0 - d.maxLineChanged = false + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; // Used for measuring wheel scrolling granularity - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; // True when shift is held down. - d.shift = false + d.shift = false; // Used to track whether anything happened since the context menu // was opened. - d.selForContextMenu = null + d.selForContextMenu = null; - d.activeTouch = null + d.activeTouch = null; - input.init(d) + input.init(d); } // Find the line object corresponding to the given line number. function getLine(doc, n) { - n -= doc.first + n -= doc.first; if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } - var chunk = doc + var chunk = doc; while (!chunk.lines) { for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize() + var child = chunk.children[i], sz = child.chunkSize(); if (n < sz) { chunk = child; break } - n -= sz + n -= sz; } } return chunk.lines[n] @@ -8008,39 +8038,39 @@ function getLine(doc, n) { // Get the part of a document between two positions, as an array of // strings. function getBetween(doc, start, end) { - var out = [], n = start.line + var out = [], n = start.line; doc.iter(start.line, end.line + 1, function (line) { - var text = line.text - if (n == end.line) { text = text.slice(0, end.ch) } - if (n == start.line) { text = text.slice(start.ch) } - out.push(text) - ++n - }) + var text = line.text; + if (n == end.line) { text = text.slice(0, end.ch); } + if (n == start.line) { text = text.slice(start.ch); } + out.push(text); + ++n; + }); return out } // Get the lines between from and to, as array of strings. function getLines(doc, from, to) { - var out = [] - doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value + var out = []; + doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value return out } // Update the height of a line, propagating the height change // upwards to parent nodes. function updateLineHeight(line, height) { - var diff = height - line.height - if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } } + var diff = height - line.height; + if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } } } // Given a line object, find its line number by walking up through // its parent links. function lineNo(line) { if (line.parent == null) { return null } - var cur = line.parent, no = indexOf(cur.lines, line) + var cur = line.parent, no = indexOf(cur.lines, line); for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { for (var i = 0;; ++i) { if (chunk.children[i] == cur) { break } - no += chunk.children[i].chunkSize() + no += chunk.children[i].chunkSize(); } } return no + cur.first @@ -8049,21 +8079,21 @@ function lineNo(line) { // Find the line at the given vertical position, using the height // information in the document tree. function lineAtHeight(chunk, h) { - var n = chunk.first + var n = chunk.first; outer: do { for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { - var child = chunk.children[i$1], ch = child.height + var child = chunk.children[i$1], ch = child.height; if (h < ch) { chunk = child; continue outer } - h -= ch - n += child.chunkSize() + h -= ch; + n += child.chunkSize(); } return n } while (!chunk.lines) - var i = 0 + var i = 0; for (; i < chunk.lines.length; ++i) { - var line = chunk.lines[i], lh = line.height + var line = chunk.lines[i], lh = line.height; if (h < lh) { break } - h -= lh + h -= lh; } return n + i } @@ -8075,15 +8105,21 @@ function lineNumberFor(options, i) { } // A Pos instance represents a position within the text. -function Pos (line, ch) { - if (!(this instanceof Pos)) { return new Pos(line, ch) } - this.line = line; this.ch = ch +function Pos(line, ch, sticky) { + if ( sticky === void 0 ) sticky = null; + + if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } + this.line = line; + this.ch = ch; + this.sticky = sticky; } // Compare two positions, return 0 if they are the same, a negative // number when a is less, and a positive number otherwise. function cmp(a, b) { return a.line - b.line || a.ch - b.ch } +function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 } + function copyPos(x) {return Pos(x.line, x.ch)} function maxPos(a, b) { return cmp(a, b) < 0 ? b : a } function minPos(a, b) { return cmp(a, b) < 0 ? a : b } @@ -8093,59 +8129,60 @@ function minPos(a, b) { return cmp(a, b) < 0 ? a : b } function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))} function clipPos(doc, pos) { if (pos.line < doc.first) { return Pos(doc.first, 0) } - var last = doc.first + doc.size - 1 + var last = doc.first + doc.size - 1; if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) } return clipToLen(pos, getLine(doc, pos.line).text.length) } function clipToLen(pos, linelen) { - var ch = pos.ch + var ch = pos.ch; if (ch == null || ch > linelen) { return Pos(pos.line, linelen) } else if (ch < 0) { return Pos(pos.line, 0) } else { return pos } } function clipPosArray(doc, array) { - var out = [] - for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) } + var out = []; + for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); } return out } // Optimize some code when these features are not used. var sawReadOnlySpans = false; var sawCollapsedSpans = false; + function seeReadOnlySpans() { - sawReadOnlySpans = true + sawReadOnlySpans = true; } function seeCollapsedSpans() { - sawCollapsedSpans = true + sawCollapsedSpans = true; } // TEXTMARKER SPANS function MarkedSpan(marker, from, to) { - this.marker = marker - this.from = from; this.to = to + this.marker = marker; + this.from = from; this.to = to; } // Search an array of spans for a span matching the given marker. function getMarkedSpanFor(spans, marker) { if (spans) { for (var i = 0; i < spans.length; ++i) { - var span = spans[i] + var span = spans[i]; if (span.marker == marker) { return span } } } } // Remove a span from an array, returning undefined if no spans are // left (we don't store arrays for lines without spans). function removeMarkedSpan(spans, span) { - var r + var r; for (var i = 0; i < spans.length; ++i) - { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } } + { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } } return r } // Add a span to a line. function addMarkedSpan(line, span) { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span] - span.marker.attachLine(line) + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); } // Used for the algorithm that adjusts markers for a change in the @@ -8153,26 +8190,24 @@ function addMarkedSpan(line, span) { // character position, returning an array of remaining chunks (or // undefined if nothing remains). function markedSpansBefore(old, startCh, isInsert) { - var nw + var nw; if (old) { for (var i = 0; i < old.length; ++i) { - var span = old[i], marker = span.marker - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh) + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) - ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)) + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); } } } return nw } function markedSpansAfter(old, endCh, isInsert) { - var nw + var nw; if (old) { for (var i = 0; i < old.length; ++i) { - var span = old[i], marker = span.marker - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh) + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh) - ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, - span.to == null ? null : span.to - endCh)) + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)); } } } return nw @@ -8186,60 +8221,60 @@ function markedSpansAfter(old, endCh, isInsert) { // arrays with one element for each line in (after) the change. function stretchSpansOverChange(doc, change) { if (change.full) { return null } - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; if (!oldFirst && !oldLast) { return null } - var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0 + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; // Get the spans that 'stick out' on both sides - var first = markedSpansBefore(oldFirst, startCh, isInsert) - var last = markedSpansAfter(oldLast, endCh, isInsert) + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); // Next, merge those two ends - var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0) + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); if (first) { // Fix up .to properties of first for (var i = 0; i < first.length; ++i) { - var span = first[i] + var span = first[i]; if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker) - if (!found) { span.to = startCh } - else if (sameLine) { span.to = found.to == null ? null : found.to + offset } + var found = getMarkedSpanFor(last, span.marker); + if (!found) { span.to = startCh; } + else if (sameLine) { span.to = found.to == null ? null : found.to + offset; } } } } if (last) { // Fix up .from in last (or move them into first in case of sameLine) for (var i$1 = 0; i$1 < last.length; ++i$1) { - var span$1 = last[i$1] - if (span$1.to != null) { span$1.to += offset } + var span$1 = last[i$1]; + if (span$1.to != null) { span$1.to += offset; } if (span$1.from == null) { - var found$1 = getMarkedSpanFor(first, span$1.marker) + var found$1 = getMarkedSpanFor(first, span$1.marker); if (!found$1) { - span$1.from = offset - if (sameLine) { (first || (first = [])).push(span$1) } + span$1.from = offset; + if (sameLine) { (first || (first = [])).push(span$1); } } } else { - span$1.from += offset - if (sameLine) { (first || (first = [])).push(span$1) } + span$1.from += offset; + if (sameLine) { (first || (first = [])).push(span$1); } } } } // Make sure we didn't create any zero-length spans - if (first) { first = clearEmptySpans(first) } - if (last && last != first) { last = clearEmptySpans(last) } + if (first) { first = clearEmptySpans(first); } + if (last && last != first) { last = clearEmptySpans(last); } - var newMarkers = [first] + var newMarkers = [first]; if (!sameLine) { // Fill gap with whole-line-spans - var gap = change.text.length - 2, gapMarkers + var gap = change.text.length - 2, gapMarkers; if (gap > 0 && first) { for (var i$2 = 0; i$2 < first.length; ++i$2) { if (first[i$2].to == null) - { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } } + { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } } for (var i$3 = 0; i$3 < gap; ++i$3) - { newMarkers.push(gapMarkers) } - newMarkers.push(last) + { newMarkers.push(gapMarkers); } + newMarkers.push(last); } return newMarkers } @@ -8248,9 +8283,9 @@ function stretchSpansOverChange(doc, change) { // option of false. function clearEmptySpans(spans) { for (var i = 0; i < spans.length; ++i) { - var span = spans[i] + var span = spans[i]; if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) - { spans.splice(i--, 1) } + { spans.splice(i--, 1); } } if (!spans.length) { return null } return spans @@ -8258,28 +8293,28 @@ function clearEmptySpans(spans) { // Used to 'clip' out readOnly ranges when making a change. function removeReadOnlyRanges(doc, from, to) { - var markers = null + var markers = null; doc.iter(from.line, to.line + 1, function (line) { if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { - var mark = line.markedSpans[i].marker + var mark = line.markedSpans[i].marker; if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) - { (markers || (markers = [])).push(mark) } + { (markers || (markers = [])).push(mark); } } } - }) + }); if (!markers) { return null } - var parts = [{from: from, to: to}] + var parts = [{from: from, to: to}]; for (var i = 0; i < markers.length; ++i) { - var mk = markers[i], m = mk.find(0) + var mk = markers[i], m = mk.find(0); for (var j = 0; j < parts.length; ++j) { - var p = parts[j] + var p = parts[j]; if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } - var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to) + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) - { newParts.push({from: p.from, to: m.from}) } + { newParts.push({from: p.from, to: m.from}); } if (dto > 0 || !mk.inclusiveRight && !dto) - { newParts.push({from: m.to, to: p.to}) } - parts.splice.apply(parts, newParts) - j += newParts.length - 1 + { newParts.push({from: m.to, to: p.to}); } + parts.splice.apply(parts, newParts); + j += newParts.length - 3; } } return parts @@ -8287,17 +8322,17 @@ function removeReadOnlyRanges(doc, from, to) { // Connect or disconnect spans from a line. function detachMarkedSpans(line) { - var spans = line.markedSpans + var spans = line.markedSpans; if (!spans) { return } for (var i = 0; i < spans.length; ++i) - { spans[i].marker.detachLine(line) } - line.markedSpans = null + { spans[i].marker.detachLine(line); } + line.markedSpans = null; } function attachMarkedSpans(line, spans) { if (!spans) { return } for (var i = 0; i < spans.length; ++i) - { spans[i].marker.attachLine(line) } - line.markedSpans = spans + { spans[i].marker.attachLine(line); } + line.markedSpans = spans; } // Helpers used when computing which overlapping collapsed span @@ -8309,12 +8344,12 @@ function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 } // spans is larger (and thus includes the other). Falls back to // comparing ids when the spans cover exactly the same range. function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length + var lenDiff = a.lines.length - b.lines.length; if (lenDiff != 0) { return lenDiff } - var aPos = a.find(), bPos = b.find() - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b) + var aPos = a.find(), bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); if (fromCmp) { return -fromCmp } - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b) + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); if (toCmp) { return toCmp } return b.id - a.id } @@ -8322,30 +8357,40 @@ function compareCollapsedMarkers(a, b) { // Find out whether a line ends or starts in a collapsed span. If // so, return the marker for that span. function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, found + var sps = sawCollapsedSpans && line.markedSpans, found; if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { - sp = sps[i] + sp = sps[i]; if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) - { found = sp.marker } + { found = sp.marker; } } } return found } function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) } function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) } +function collapsedSpanAround(line, ch) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) { for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; } + } } + return found +} + // Test whether there exists a collapsed span that partially // overlaps (covers the start or end, but not both) of a new span. // Such overlap is not allowed. -function conflictingCollapsedRange(doc, lineNo, from, to, marker) { - var line = getLine(doc, lineNo) - var sps = sawCollapsedSpans && line.markedSpans +function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) { + var line = getLine(doc, lineNo$$1); + var sps = sawCollapsedSpans && line.markedSpans; if (sps) { for (var i = 0; i < sps.length; ++i) { - var sp = sps[i] + var sp = sps[i]; if (!sp.marker.collapsed) { continue } - var found = sp.marker.find(0) - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker) - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker) + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) @@ -8358,19 +8403,26 @@ function conflictingCollapsedRange(doc, lineNo, from, to, marker) { // visual line. This finds the start of the visual line that the // given line is part of (usually that is the line itself). function visualLine(line) { - var merged + var merged; while (merged = collapsedSpanAtStart(line)) - { line = merged.find(-1, true).line } + { line = merged.find(-1, true).line; } + return line +} + +function visualLineEnd(line) { + var merged; + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line; } return line } // Returns an array of logical lines that continue the visual line // started by the argument, or undefined if there are no such lines. function visualLineContinued(line) { - var merged, lines + var merged, lines; while (merged = collapsedSpanAtEnd(line)) { line = merged.find(1, true).line - ;(lines || (lines = [])).push(line) + ;(lines || (lines = [])).push(line); } return lines } @@ -8378,7 +8430,7 @@ function visualLineContinued(line) { // Get the line number of the start of the visual line that the // given line number is part of. function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), vis = visualLine(line) + var line = getLine(doc, lineN), vis = visualLine(line); if (line == vis) { return lineN } return lineNo(vis) } @@ -8387,10 +8439,10 @@ function visualLineNo(doc, lineN) { // the given line. function visualLineEndNo(doc, lineN) { if (lineN > doc.lastLine()) { return lineN } - var line = getLine(doc, lineN), merged + var line = getLine(doc, lineN), merged; if (!lineIsHidden(doc, line)) { return lineN } while (merged = collapsedSpanAtEnd(line)) - { line = merged.find(1, true).line } + { line = merged.find(1, true).line; } return lineNo(line) + 1 } @@ -8398,9 +8450,9 @@ function visualLineEndNo(doc, lineN) { // are part of a visual line that starts with another line, or when // they are entirely covered by collapsed, non-widget span. function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans + var sps = sawCollapsedSpans && line.markedSpans; if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { - sp = sps[i] + sp = sps[i]; if (!sp.marker.collapsed) { continue } if (sp.from == null) { return true } if (sp.marker.widgetNode) { continue } @@ -8410,13 +8462,13 @@ function lineIsHidden(doc, line) { } function lineIsHiddenInner(doc, line, span) { if (span.to == null) { - var end = span.marker.find(1, true) + var end = span.marker.find(1, true); return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)) } if (span.marker.inclusiveRight && span.to == line.text.length) { return true } for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) { - sp = line.markedSpans[i] + sp = line.markedSpans[i]; if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && (sp.to == null || sp.to != span.from) && (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && @@ -8426,19 +8478,19 @@ function lineIsHiddenInner(doc, line, span) { // Find the height above the given line. function heightAtLine(lineObj) { - lineObj = visualLine(lineObj) + lineObj = visualLine(lineObj); - var h = 0, chunk = lineObj.parent + var h = 0, chunk = lineObj.parent; for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i] + var line = chunk.lines[i]; if (line == lineObj) { break } - else { h += line.height } + else { h += line.height; } } for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { for (var i$1 = 0; i$1 < p.children.length; ++i$1) { - var cur = p.children[i$1] + var cur = p.children[i$1]; if (cur == chunk) { break } - else { h += cur.height } + else { h += cur.height; } } } return h @@ -8449,130 +8501,69 @@ function heightAtLine(lineObj) { // other lines onto it. function lineLength(line) { if (line.height == 0) { return 0 } - var len = line.text.length, merged, cur = line + var len = line.text.length, merged, cur = line; while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true) - cur = found.from.line - len += found.from.ch - found.to.ch + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; } - cur = line + cur = line; while (merged = collapsedSpanAtEnd(cur)) { - var found$1 = merged.find(0, true) - len -= cur.text.length - found$1.from.ch - cur = found$1.to.line - len += cur.text.length - found$1.to.ch + var found$1 = merged.find(0, true); + len -= cur.text.length - found$1.from.ch; + cur = found$1.to.line; + len += cur.text.length - found$1.to.ch; } return len } // Find the longest line in the document. function findMaxLine(cm) { - var d = cm.display, doc = cm.doc - d.maxLine = getLine(doc, doc.first) - d.maxLineLength = lineLength(d.maxLine) - d.maxLineChanged = true + var d = cm.display, doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; doc.iter(function (line) { - var len = lineLength(line) + var len = lineLength(line); if (len > d.maxLineLength) { - d.maxLineLength = len - d.maxLine = line + d.maxLineLength = len; + d.maxLine = line; } - }) + }); } // BIDI HELPERS function iterateBidiSections(order, from, to, f) { - if (!order) { return f(from, to, "ltr") } - var found = false + if (!order) { return f(from, to, "ltr", 0) } + var found = false; for (var i = 0; i < order.length; ++i) { - var part = order[i] + var part = order[i]; if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr") - found = true + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i); + found = true; } } - if (!found) { f(from, to, "ltr") } -} - -function bidiLeft(part) { return part.level % 2 ? part.to : part.from } -function bidiRight(part) { return part.level % 2 ? part.from : part.to } - -function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0 } -function lineRight(line) { - var order = getOrder(line) - if (!order) { return line.text.length } - return bidiRight(lst(order)) + if (!found) { f(from, to, "ltr"); } } -function compareBidiLevel(order, a, b) { - var linedir = order[0].level - if (a == linedir) { return true } - if (b == linedir) { return false } - return a < b -} - -var bidiOther = null -function getBidiPartAt(order, pos) { - var found - bidiOther = null +var bidiOther = null; +function getBidiPartAt(order, ch, sticky) { + var found; + bidiOther = null; for (var i = 0; i < order.length; ++i) { - var cur = order[i] - if (cur.from < pos && cur.to > pos) { return i } - if ((cur.from == pos || cur.to == pos)) { - if (found == null) { - found = i - } else if (compareBidiLevel(order, cur.level, order[found].level)) { - if (cur.from != cur.to) { bidiOther = found } - return i - } else { - if (cur.from != cur.to) { bidiOther = i } - return found - } + var cur = order[i]; + if (cur.from < ch && cur.to > ch) { return i } + if (cur.to == ch) { + if (cur.from != cur.to && sticky == "before") { found = i; } + else { bidiOther = i; } } - } - return found -} - -function moveInLine(line, pos, dir, byUnit) { - if (!byUnit) { return pos + dir } - do { pos += dir } - while (pos > 0 && isExtendingChar(line.text.charAt(pos))) - return pos -} - -// This is needed in order to move 'visually' through bi-directional -// text -- i.e., pressing left should make the cursor go left, even -// when in RTL text. The tricky part is the 'jumps', where RTL and -// LTR text touch each other. This often requires the cursor offset -// to move more than one unit, in order to visually move one unit. -function moveVisually(line, start, dir, byUnit) { - var bidi = getOrder(line) - if (!bidi) { return moveLogically(line, start, dir, byUnit) } - var pos = getBidiPartAt(bidi, start), part = bidi[pos] - var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit) - - for (;;) { - if (target > part.from && target < part.to) { return target } - if (target == part.from || target == part.to) { - if (getBidiPartAt(bidi, target) == pos) { return target } - part = bidi[pos += dir] - return (dir > 0) == part.level % 2 ? part.to : part.from - } else { - part = bidi[pos += dir] - if (!part) { return null } - if ((dir > 0) == part.level % 2) - { target = moveInLine(line, part.to, -1, byUnit) } - else - { target = moveInLine(line, part.from, 1, byUnit) } + if (cur.from == ch) { + if (cur.from != cur.to && sticky != "before") { found = i; } + else { bidiOther = i; } } } -} - -function moveLogically(line, start, dir, byUnit) { - var target = start + dir - if (byUnit) { while (target > 0 && isExtendingChar(line.text.charAt(target))) { target += dir } } - return target < 0 || target > line.text.length ? null : target + return found != null ? found : bidiOther } // Bidirectional ordering algorithm @@ -8600,9 +8591,9 @@ function moveLogically(line, start, dir, byUnit) { // objects) in the order in which they occur visually. var bidiOrdering = (function() { // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN" + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; // Character types for codepoints 0x600 to 0x6f9 - var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111" + var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; function charType(code) { if (code <= 0xf7) { return lowTypes.charAt(code) } else if (0x590 <= code && code <= 0x5f4) { return "R" } @@ -8613,30 +8604,30 @@ var bidiOrdering = (function() { else { return "L" } } - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/ - var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/ - // Browsers seem to always treat the boundaries of block elements as being L. - var outerType = "L" + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; function BidiSpan(level, from, to) { - this.level = level - this.from = from; this.to = to + this.level = level; + this.from = from; this.to = to; } - return function(str) { - if (!bidiRE.test(str)) { return false } - var len = str.length, types = [] + return function(str, direction) { + var outerType = direction == "ltr" ? "L" : "R"; + + if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false } + var len = str.length, types = []; for (var i = 0; i < len; ++i) - { types.push(charType(str.charCodeAt(i))) } + { types.push(charType(str.charCodeAt(i))); } // W1. Examine each non-spacing mark (NSM) in the level run, and // change the type of the NSM to the type of the previous // character. If the NSM is at the start of the level run, it will // get the type of sor. for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { - var type = types[i$1] - if (type == "m") { types[i$1] = prev } - else { prev = type } + var type = types[i$1]; + if (type == "m") { types[i$1] = prev; } + else { prev = type; } } // W2. Search backwards from each instance of a European number @@ -8645,20 +8636,20 @@ var bidiOrdering = (function() { // number. // W3. Change all ALs to R. for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { - var type$1 = types[i$2] - if (type$1 == "1" && cur == "r") { types[i$2] = "n" } - else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R" } } + var type$1 = types[i$2]; + if (type$1 == "1" && cur == "r") { types[i$2] = "n"; } + else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R"; } } } // W4. A single European separator between two European numbers // changes to a European number. A single common separator between // two numbers of the same type changes to that type. for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { - var type$2 = types[i$3] - if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1" } + var type$2 = types[i$3]; + if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1"; } else if (type$2 == "," && prev$1 == types[i$3+1] && - (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1 } - prev$1 = type$2 + (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1; } + prev$1 = type$2; } // W5. A sequence of European terminators adjacent to European @@ -8666,14 +8657,14 @@ var bidiOrdering = (function() { // W6. Otherwise, separators and terminators change to Other // Neutral. for (var i$4 = 0; i$4 < len; ++i$4) { - var type$3 = types[i$4] - if (type$3 == ",") { types[i$4] = "N" } + var type$3 = types[i$4]; + if (type$3 == ",") { types[i$4] = "N"; } else if (type$3 == "%") { - var end = (void 0) + var end = (void 0); for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} - var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N" - for (var j = i$4; j < end; ++j) { types[j] = replace } - i$4 = end - 1 + var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; + for (var j = i$4; j < end; ++j) { types[j] = replace; } + i$4 = end - 1; } } @@ -8681,9 +8672,9 @@ var bidiOrdering = (function() { // until the first strong type (R, L, or sor) is found. If an L is // found, then change the type of the European number to L. for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { - var type$4 = types[i$5] - if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L" } - else if (isStrong.test(type$4)) { cur$1 = type$4 } + var type$4 = types[i$5]; + if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L"; } + else if (isStrong.test(type$4)) { cur$1 = type$4; } } // N1. A sequence of neutrals takes the direction of the @@ -8694,13 +8685,13 @@ var bidiOrdering = (function() { // N2. Any remaining neutrals take the embedding direction. for (var i$6 = 0; i$6 < len; ++i$6) { if (isNeutral.test(types[i$6])) { - var end$1 = (void 0) + var end$1 = (void 0); for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} - var before = (i$6 ? types[i$6-1] : outerType) == "L" - var after = (end$1 < len ? types[end$1] : outerType) == "L" - var replace$1 = before || after ? "L" : "R" - for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 } - i$6 = end$1 - 1 + var before = (i$6 ? types[i$6-1] : outerType) == "L"; + var after = (end$1 < len ? types[end$1] : outerType) == "L"; + var replace$1 = before == after ? (before ? "L" : "R") : outerType; + for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; } + i$6 = end$1 - 1; } } @@ -8709,50 +8700,48 @@ var bidiOrdering = (function() { // levels (0, 1, 2) in an implementation that doesn't take // explicit embedding into account, we can build up the order on // the fly, without following the level-based algorithm. - var order = [], m + var order = [], m; for (var i$7 = 0; i$7 < len;) { if (countsAsLeft.test(types[i$7])) { - var start = i$7 + var start = i$7; for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} - order.push(new BidiSpan(0, start, i$7)) + order.push(new BidiSpan(0, start, i$7)); } else { - var pos = i$7, at = order.length + var pos = i$7, at = order.length; for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} for (var j$2 = pos; j$2 < i$7;) { if (countsAsNum.test(types[j$2])) { - if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) } - var nstart = j$2 + if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); } + var nstart = j$2; for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} - order.splice(at, 0, new BidiSpan(2, nstart, j$2)) - pos = j$2 - } else { ++j$2 } + order.splice(at, 0, new BidiSpan(2, nstart, j$2)); + pos = j$2; + } else { ++j$2; } } - if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) } + if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); } } } - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length - order.unshift(new BidiSpan(0, 0, m[0].length)) - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length - order.push(new BidiSpan(0, len - m[0].length, len)) + if (direction == "ltr") { + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } } - if (order[0].level == 2) - { order.unshift(new BidiSpan(1, order[0].to, order[0].to)) } - if (order[0].level != lst(order).level) - { order.push(new BidiSpan(order[0].level, len, len)) } - return order + return direction == "rtl" ? order.reverse() : order } -})() +})(); // Get the bidi ordering for the given line (and cache it). Returns // false for lines that are fully left-to-right, and an array of // BidiSpan objects otherwise. -function getOrder(line) { - var order = line.order - if (order == null) { order = line.order = bidiOrdering(line.text) } +function getOrder(line, direction) { + var order = line.order; + if (order == null) { order = line.order = bidiOrdering(line.text, direction); } return order } @@ -8761,18 +8750,18 @@ function getOrder(line) { // Lightweight event framework. on/off also work on DOM nodes, // registering native DOM handlers. -var noHandlers = [] +var noHandlers = []; var on = function(emitter, type, f) { if (emitter.addEventListener) { - emitter.addEventListener(type, f, false) + emitter.addEventListener(type, f, false); } else if (emitter.attachEvent) { - emitter.attachEvent("on" + type, f) + emitter.attachEvent("on" + type, f); } else { - var map = emitter._handlers || (emitter._handlers = {}) - map[type] = (map[type] || noHandlers).concat(f) + var map$$1 = emitter._handlers || (emitter._handlers = {}); + map$$1[type] = (map$$1[type] || noHandlers).concat(f); } -} +}; function getHandlers(emitter, type) { return emitter._handlers && emitter._handlers[type] || noHandlers @@ -8780,24 +8769,24 @@ function getHandlers(emitter, type) { function off(emitter, type, f) { if (emitter.removeEventListener) { - emitter.removeEventListener(type, f, false) + emitter.removeEventListener(type, f, false); } else if (emitter.detachEvent) { - emitter.detachEvent("on" + type, f) + emitter.detachEvent("on" + type, f); } else { - var map = emitter._handlers, arr = map && map[type] + var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type]; if (arr) { - var index = indexOf(arr, f) + var index = indexOf(arr, f); if (index > -1) - { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) } + { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); } } } } function signal(emitter, type /*, values...*/) { - var handlers = getHandlers(emitter, type) + var handlers = getHandlers(emitter, type); if (!handlers.length) { return } - var args = Array.prototype.slice.call(arguments, 2) - for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) } + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); } } // The DOM events that CodeMirror handles can be overridden by @@ -8805,17 +8794,17 @@ function signal(emitter, type /*, values...*/) { // and preventDefault-ing the event in that handler. function signalDOMEvent(cm, e, override) { if (typeof e == "string") - { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} } - signal(cm, override || e.type, cm, e) + { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; } + signal(cm, override || e.type, cm, e); return e_defaultPrevented(e) || e.codemirrorIgnore } function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity + var arr = cm._handlers && cm._handlers.cursorActivity; if (!arr) { return } - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []) + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1) - { set.push(arr[i]) } } + { set.push(arr[i]); } } } function hasHandler(emitter, type) { @@ -8825,35 +8814,35 @@ function hasHandler(emitter, type) { // Add on and off methods to a constructor's prototype, to make // registering events on such objects more convenient. function eventMixin(ctor) { - ctor.prototype.on = function(type, f) {on(this, type, f)} - ctor.prototype.off = function(type, f) {off(this, type, f)} + ctor.prototype.on = function(type, f) {on(this, type, f);}; + ctor.prototype.off = function(type, f) {off(this, type, f);}; } // Due to the fact that we still support jurassic IE versions, some // compatibility wrappers are needed. function e_preventDefault(e) { - if (e.preventDefault) { e.preventDefault() } - else { e.returnValue = false } + if (e.preventDefault) { e.preventDefault(); } + else { e.returnValue = false; } } function e_stopPropagation(e) { - if (e.stopPropagation) { e.stopPropagation() } - else { e.cancelBubble = true } + if (e.stopPropagation) { e.stopPropagation(); } + else { e.cancelBubble = true; } } function e_defaultPrevented(e) { return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false } -function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)} +function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} function e_target(e) {return e.target || e.srcElement} function e_button(e) { - var b = e.which + var b = e.which; if (b == null) { - if (e.button & 1) { b = 1 } - else if (e.button & 2) { b = 3 } - else if (e.button & 4) { b = 2 } + if (e.button & 1) { b = 1; } + else if (e.button & 2) { b = 3; } + else if (e.button & 4) { b = 2; } } - if (mac && e.ctrlKey && b == 1) { b = 3 } + if (mac && e.ctrlKey && b == 1) { b = 3; } return b } @@ -8862,32 +8851,32 @@ var dragAndDrop = function() { // There is *some* kind of drag-and-drop support in IE6-8, but I // couldn't get it to work yet. if (ie && ie_version < 9) { return false } - var div = elt('div') + var div = elt('div'); return "draggable" in div || "dragDrop" in div -}() +}(); -var zwspSupported +var zwspSupported; function zeroWidthElement(measure) { if (zwspSupported == null) { - var test = elt("span", "\u200b") - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])) + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); if (measure.firstChild.offsetHeight != 0) - { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) } + { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); } } var node = zwspSupported ? elt("span", "\u200b") : - elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px") - node.setAttribute("cm-text", "") + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); return node } // Feature-detect IE's crummy client rect reporting for bidi text -var badBidiRects +var badBidiRects; function hasBadBidiRects(measure) { if (badBidiRects != null) { return badBidiRects } - var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")) - var r0 = range(txt, 0, 1).getBoundingClientRect() - var r1 = range(txt, 1, 2).getBoundingClientRect() - removeChildren(measure) + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + var r1 = range(txt, 1, 2).getBoundingClientRect(); + removeChildren(measure); if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780) return badBidiRects = (r1.right - r0.right < 3) } @@ -8895,75 +8884,77 @@ function hasBadBidiRects(measure) { // See if "".split is the broken IE version, if so, provide an // alternative way to split lines. var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { - var pos = 0, result = [], l = string.length + var pos = 0, result = [], l = string.length; while (pos <= l) { - var nl = string.indexOf("\n", pos) - if (nl == -1) { nl = string.length } - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl) - var rt = line.indexOf("\r") + var nl = string.indexOf("\n", pos); + if (nl == -1) { nl = string.length; } + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); if (rt != -1) { - result.push(line.slice(0, rt)) - pos += rt + 1 + result.push(line.slice(0, rt)); + pos += rt + 1; } else { - result.push(line) - pos = nl + 1 + result.push(line); + pos = nl + 1; } } return result -} : function (string) { return string.split(/\r\n?|\n/); } +} : function (string) { return string.split(/\r\n?|\n/); }; var hasSelection = window.getSelection ? function (te) { try { return te.selectionStart != te.selectionEnd } catch(e) { return false } } : function (te) { - var range - try {range = te.ownerDocument.selection.createRange()} + var range$$1; + try {range$$1 = te.ownerDocument.selection.createRange();} catch(e) {} - if (!range || range.parentElement() != te) { return false } - return range.compareEndPoints("StartToEnd", range) != 0 -} + if (!range$$1 || range$$1.parentElement() != te) { return false } + return range$$1.compareEndPoints("StartToEnd", range$$1) != 0 +}; var hasCopyEvent = (function () { - var e = elt("div") + var e = elt("div"); if ("oncopy" in e) { return true } - e.setAttribute("oncopy", "return;") + e.setAttribute("oncopy", "return;"); return typeof e.oncopy == "function" -})() +})(); -var badZoomedRects = null +var badZoomedRects = null; function hasBadZoomedRects(measure) { if (badZoomedRects != null) { return badZoomedRects } - var node = removeChildrenAndAdd(measure, elt("span", "x")) - var normal = node.getBoundingClientRect() - var fromRange = range(node, 0, 1).getBoundingClientRect() + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1 } +// Known modes, by name and by MIME var modes = {}; var mimeModes = {}; + // Extra arguments are stored as the mode's dependencies, which is // used by (legacy) mechanisms like loadmode.js to automatically // load a mode. (Preferred mechanism is the require/define calls.) function defineMode(name, mode) { if (arguments.length > 2) - { mode.dependencies = Array.prototype.slice.call(arguments, 2) } - modes[name] = mode + { mode.dependencies = Array.prototype.slice.call(arguments, 2); } + modes[name] = mode; } function defineMIME(mime, spec) { - mimeModes[mime] = spec + mimeModes[mime] = spec; } // Given a MIME type, a {name, ...options} config object, or a name // string, return a mode config object. function resolveMode(spec) { if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec] + spec = mimeModes[spec]; } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name] - if (typeof found == "string") { found = {name: found} } - spec = createObj(found, spec) - spec.name = found.name + var found = mimeModes[spec.name]; + if (typeof found == "string") { found = {name: found}; } + spec = createObj(found, spec); + spec.name = found.name; } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { return resolveMode("application/xml") } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { @@ -8976,42 +8967,42 @@ function resolveMode(spec) { // Given a mode spec (anything that resolveMode accepts), find and // initialize an actual mode object. function getMode(options, spec) { - spec = resolveMode(spec) - var mfactory = modes[spec.name] + spec = resolveMode(spec); + var mfactory = modes[spec.name]; if (!mfactory) { return getMode(options, "text/plain") } - var modeObj = mfactory(options, spec) + var modeObj = mfactory(options, spec); if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name] + var exts = modeExtensions[spec.name]; for (var prop in exts) { if (!exts.hasOwnProperty(prop)) { continue } - if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop] } - modeObj[prop] = exts[prop] + if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; } + modeObj[prop] = exts[prop]; } } - modeObj.name = spec.name - if (spec.helperType) { modeObj.helperType = spec.helperType } + modeObj.name = spec.name; + if (spec.helperType) { modeObj.helperType = spec.helperType; } if (spec.modeProps) { for (var prop$1 in spec.modeProps) - { modeObj[prop$1] = spec.modeProps[prop$1] } } + { modeObj[prop$1] = spec.modeProps[prop$1]; } } return modeObj } // This can be used to attach properties to mode objects from // outside the actual mode definition. -var modeExtensions = {} +var modeExtensions = {}; function extendMode(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}) - copyObj(properties, exts) + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + copyObj(properties, exts); } function copyState(mode, state) { if (state === true) { return state } if (mode.copyState) { return mode.copyState(state) } - var nstate = {} + var nstate = {}; for (var n in state) { - var val = state[n] - if (val instanceof Array) { val = val.concat([]) } - nstate[n] = val + var val = state[n]; + if (val instanceof Array) { val = val.concat([]); } + nstate[n] = val; } return nstate } @@ -9019,12 +9010,12 @@ function copyState(mode, state) { // Given a mode and a state (for that mode), find the inner mode and // state at the position that the state refers to. function innerMode(mode, state) { - var info + var info; while (mode.innerMode) { - info = mode.innerMode(state) + info = mode.innerMode(state); if (!info || info.mode == mode) { break } - state = info.state - mode = info.mode + state = info.state; + mode = info.mode; } return info || {mode: mode, state: state} } @@ -9038,117 +9029,179 @@ function startState(mode, a1, a2) { // Fed to the mode parsers, provides helper functions to make // parsers more succinct. -var StringStream = function(string, tabSize) { - this.pos = this.start = 0 - this.string = string - this.tabSize = tabSize || 8 - this.lastColumnPos = this.lastColumnValue = 0 - this.lineStart = 0 -} - -StringStream.prototype = { - eol: function() {return this.pos >= this.string.length}, - sol: function() {return this.pos == this.lineStart}, - peek: function() {return this.string.charAt(this.pos) || undefined}, - next: function() { - if (this.pos < this.string.length) - { return this.string.charAt(this.pos++) } - }, - eat: function(match) { - var ch = this.string.charAt(this.pos) - var ok - if (typeof match == "string") { ok = ch == match } - else { ok = ch && (match.test ? match.test(ch) : match(ch)) } - if (ok) {++this.pos; return ch} - }, - eatWhile: function(match) { - var start = this.pos - while (this.eat(match)){} - return this.pos > start - }, - eatSpace: function() { +var StringStream = function(string, tabSize, lineOracle) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + this.lineOracle = lineOracle; +}; + +StringStream.prototype.eol = function () {return this.pos >= this.string.length}; +StringStream.prototype.sol = function () {return this.pos == this.lineStart}; +StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined}; +StringStream.prototype.next = function () { + if (this.pos < this.string.length) + { return this.string.charAt(this.pos++) } +}; +StringStream.prototype.eat = function (match) { + var ch = this.string.charAt(this.pos); + var ok; + if (typeof match == "string") { ok = ch == match; } + else { ok = ch && (match.test ? match.test(ch) : match(ch)); } + if (ok) {++this.pos; return ch} +}; +StringStream.prototype.eatWhile = function (match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start +}; +StringStream.prototype.eatSpace = function () { var this$1 = this; - var start = this.pos - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos } - return this.pos > start - }, - skipToEnd: function() {this.pos = this.string.length}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos) - if (found > -1) {this.pos = found; return true} - }, - backUp: function(n) {this.pos -= n}, - column: function() { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue) - this.lastColumnPos = this.start - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) - }, - indentation: function() { - return countColumn(this.string, null, this.tabSize) - - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) - }, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; } - var substr = this.string.substr(this.pos, pattern.length) - if (cased(substr) == cased(pattern)) { - if (consume !== false) { this.pos += pattern.length } - return true - } - } else { - var match = this.string.slice(this.pos).match(pattern) - if (match && match.index > 0) { return null } - if (match && consume !== false) { this.pos += match[0].length } - return match + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; } + return this.pos > start +}; +StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;}; +StringStream.prototype.skipTo = function (ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true} +}; +StringStream.prototype.backUp = function (n) {this.pos -= n;}; +StringStream.prototype.column = function () { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) +}; +StringStream.prototype.indentation = function () { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) +}; +StringStream.prototype.match = function (pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) { this.pos += pattern.length; } + return true } - }, - current: function(){return this.string.slice(this.start, this.pos)}, - hideFirstChars: function(n, inner) { - this.lineStart += n - try { return inner() } - finally { this.lineStart -= n } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) { return null } + if (match && consume !== false) { this.pos += match[0].length; } + return match } -} +}; +StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)}; +StringStream.prototype.hideFirstChars = function (n, inner) { + this.lineStart += n; + try { return inner() } + finally { this.lineStart -= n; } +}; +StringStream.prototype.lookAhead = function (n) { + var oracle = this.lineOracle; + return oracle && oracle.lookAhead(n) +}; +StringStream.prototype.baseToken = function () { + var oracle = this.lineOracle; + return oracle && oracle.baseToken(this.pos) +}; + +var SavedContext = function(state, lookAhead) { + this.state = state; + this.lookAhead = lookAhead; +}; + +var Context = function(doc, state, line, lookAhead) { + this.state = state; + this.doc = doc; + this.line = line; + this.maxLookAhead = lookAhead || 0; + this.baseTokens = null; + this.baseTokenPos = 1; +}; + +Context.prototype.lookAhead = function (n) { + var line = this.doc.getLine(this.line + n); + if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; } + return line +}; + +Context.prototype.baseToken = function (n) { + var this$1 = this; + + if (!this.baseTokens) { return null } + while (this.baseTokens[this.baseTokenPos] <= n) + { this$1.baseTokenPos += 2; } + var type = this.baseTokens[this.baseTokenPos + 1]; + return {type: type && type.replace(/( |^)overlay .*/, ""), + size: this.baseTokens[this.baseTokenPos] - n} +}; + +Context.prototype.nextLine = function () { + this.line++; + if (this.maxLookAhead > 0) { this.maxLookAhead--; } +}; + +Context.fromSaved = function (doc, saved, line) { + if (saved instanceof SavedContext) + { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) } + else + { return new Context(doc, copyState(doc.mode, saved), line) } +}; + +Context.prototype.save = function (copy) { + var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; + return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state +}; + // Compute a style array (an array starting with a mode generation // -- for invalidation -- followed by pairs of end positions and // style strings), which is used to highlight the tokens on the // line. -function highlightLine(cm, line, state, forceToEnd) { +function highlightLine(cm, line, context, forceToEnd) { // A styles array always starts with a number identifying the // mode/overlays that it is based on (for easy invalidation). - var st = [cm.state.modeGen], lineClasses = {} + var st = [cm.state.modeGen], lineClasses = {}; // Compute the base array of styles - runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); }, - lineClasses, forceToEnd) + runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, + lineClasses, forceToEnd); + var state = context.state; // Run overlays, adjust style array. var loop = function ( o ) { - var overlay = cm.state.overlays[o], i = 1, at = 0 - runMode(cm, line.text, overlay.mode, true, function (end, style) { - var start = i + context.baseTokens = st; + var overlay = cm.state.overlays[o], i = 1, at = 0; + context.state = true; + runMode(cm, line.text, overlay.mode, context, function (end, style) { + var start = i; // Ensure there's a token end at the current position, and that i points at it while (at < end) { - var i_end = st[i] + var i_end = st[i]; if (i_end > end) - { st.splice(i, 1, end, st[i+1], i_end) } - i += 2 - at = Math.min(end, i_end) + { st.splice(i, 1, end, st[i+1], i_end); } + i += 2; + at = Math.min(end, i_end); } if (!style) { return } if (overlay.opaque) { - st.splice(start, i - start, end, "overlay " + style) - i = start + 2 + st.splice(start, i - start, end, "overlay " + style); + i = start + 2; } else { for (; start < i; start += 2) { - var cur = st[start+1] - st[start+1] = (cur ? cur + " " : "") + "overlay " + style + var cur = st[start+1]; + st[start+1] = (cur ? cur + " " : "") + "overlay " + style; } } - }, lineClasses) + }, lineClasses); + context.state = state; + context.baseTokens = null; + context.baseTokenPos = 1; }; for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); @@ -9158,136 +9211,140 @@ function highlightLine(cm, line, state, forceToEnd) { function getLineStyles(cm, line, updateFrontier) { if (!line.styles || line.styles[0] != cm.state.modeGen) { - var state = getStateBefore(cm, lineNo(line)) - var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state) - line.stateAfter = state - line.styles = result.styles - if (result.classes) { line.styleClasses = result.classes } - else if (line.styleClasses) { line.styleClasses = null } - if (updateFrontier === cm.doc.frontier) { cm.doc.frontier++ } + var context = getContextBefore(cm, lineNo(line)); + var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); + var result = highlightLine(cm, line, context); + if (resetState) { context.state = resetState; } + line.stateAfter = context.save(!resetState); + line.styles = result.styles; + if (result.classes) { line.styleClasses = result.classes; } + else if (line.styleClasses) { line.styleClasses = null; } + if (updateFrontier === cm.doc.highlightFrontier) + { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); } } return line.styles } -function getStateBefore(cm, n, precise) { - var doc = cm.doc, display = cm.display - if (!doc.mode.startState) { return true } - var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter - if (!state) { state = startState(doc.mode) } - else { state = copyState(doc.mode, state) } - doc.iter(pos, n, function (line) { - processLine(cm, line.text, state) - var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo - line.stateAfter = save ? copyState(doc.mode, state) : null - ++pos - }) - if (precise) { doc.frontier = pos } - return state +function getContextBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display; + if (!doc.mode.startState) { return new Context(doc, true, n) } + var start = findStartLine(cm, n, precise); + var saved = start > doc.first && getLine(doc, start - 1).stateAfter; + var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); + + doc.iter(start, n, function (line) { + processLine(cm, line.text, context); + var pos = context.line; + line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; + context.nextLine(); + }); + if (precise) { doc.modeFrontier = context.line; } + return context } // Lightweight form of highlight -- proceed over this line and // update state, but don't save a style array. Used for lines that // aren't currently visible. -function processLine(cm, text, state, startAt) { - var mode = cm.doc.mode - var stream = new StringStream(text, cm.options.tabSize) - stream.start = stream.pos = startAt || 0 - if (text == "") { callBlankLine(mode, state) } +function processLine(cm, text, context, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize, context); + stream.start = stream.pos = startAt || 0; + if (text == "") { callBlankLine(mode, context.state); } while (!stream.eol()) { - readToken(mode, stream, state) - stream.start = stream.pos + readToken(mode, stream, context.state); + stream.start = stream.pos; } } function callBlankLine(mode, state) { if (mode.blankLine) { return mode.blankLine(state) } if (!mode.innerMode) { return } - var inner = innerMode(mode, state) + var inner = innerMode(mode, state); if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) } } function readToken(mode, stream, state, inner) { for (var i = 0; i < 10; i++) { - if (inner) { inner[0] = innerMode(mode, state).mode } - var style = mode.token(stream, state) + if (inner) { inner[0] = innerMode(mode, state).mode; } + var style = mode.token(stream, state); if (stream.pos > stream.start) { return style } } throw new Error("Mode " + mode.name + " failed to advance stream.") } +var Token = function(stream, type, state) { + this.start = stream.start; this.end = stream.pos; + this.string = stream.current(); + this.type = type || null; + this.state = state; +}; + // Utility for getTokenAt and getLineTokens function takeToken(cm, pos, precise, asArray) { - var getObj = function (copy) { return ({ - start: stream.start, end: stream.pos, - string: stream.current(), - type: style || null, - state: copy ? copyState(doc.mode, state) : state - }); } - - var doc = cm.doc, mode = doc.mode, style - pos = clipPos(doc, pos) - var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise) - var stream = new StringStream(line.text, cm.options.tabSize), tokens - if (asArray) { tokens = [] } + var doc = cm.doc, mode = doc.mode, style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize, context), tokens; + if (asArray) { tokens = []; } while ((asArray || stream.pos < pos.ch) && !stream.eol()) { - stream.start = stream.pos - style = readToken(mode, stream, state) - if (asArray) { tokens.push(getObj(true)) } + stream.start = stream.pos; + style = readToken(mode, stream, context.state); + if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); } } - return asArray ? tokens : getObj() + return asArray ? tokens : new Token(stream, style, context.state) } function extractLineClasses(type, output) { if (type) { for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/) + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); if (!lineClass) { break } - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length) - var prop = lineClass[1] ? "bgClass" : "textClass" + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; if (output[prop] == null) - { output[prop] = lineClass[2] } + { output[prop] = lineClass[2]; } else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) - { output[prop] += " " + lineClass[2] } + { output[prop] += " " + lineClass[2]; } } } return type } // Run the given mode's parser over a line, calling f for each token. -function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans - if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans } - var curStart = 0, curStyle = null - var stream = new StringStream(text, cm.options.tabSize), style - var inner = cm.options.addModeClass && [null] - if (text == "") { extractLineClasses(callBlankLine(mode, state), lineClasses) } +function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; } + var curStart = 0, curStyle = null; + var stream = new StringStream(text, cm.options.tabSize, context), style; + var inner = cm.options.addModeClass && [null]; + if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); } while (!stream.eol()) { if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false - if (forceToEnd) { processLine(cm, text, state, stream.pos) } - stream.pos = text.length - style = null + flattenSpans = false; + if (forceToEnd) { processLine(cm, text, context, stream.pos); } + stream.pos = text.length; + style = null; } else { - style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses) + style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); } if (inner) { - var mName = inner[0].name - if (mName) { style = "m-" + (style ? mName + " " + style : mName) } + var mName = inner[0].name; + if (mName) { style = "m-" + (style ? mName + " " + style : mName); } } if (!flattenSpans || curStyle != style) { while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 5000) - f(curStart, curStyle) + curStart = Math.min(stream.start, curStart + 5000); + f(curStart, curStyle); } - curStyle = style + curStyle = style; } - stream.start = stream.pos + stream.start = stream.pos; } while (curStart < stream.pos) { // Webkit seems to refuse to render text nodes longer than 57444 // characters, and returns inaccurate measurements in nodes // starting around 5000 chars. - var pos = Math.min(stream.pos, curStart + 5000) - f(pos, curStyle) - curStart = pos + var pos = Math.min(stream.pos, curStart + 5000); + f(pos, curStyle); + curStart = pos; } } @@ -9297,51 +9354,70 @@ function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { // smallest indentation, which tends to need the least context to // parse correctly. function findStartLine(cm, n, precise) { - var minindent, minline, doc = cm.doc - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100) + var minindent, minline, doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); for (var search = n; search > lim; --search) { if (search <= doc.first) { return doc.first } - var line = getLine(doc, search - 1) - if (line.stateAfter && (!precise || search <= doc.frontier)) { return search } - var indented = countColumn(line.text, null, cm.options.tabSize) + var line = getLine(doc, search - 1), after = line.stateAfter; + if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) + { return search } + var indented = countColumn(line.text, null, cm.options.tabSize); if (minline == null || minindent > indented) { - minline = search - 1 - minindent = indented + minline = search - 1; + minindent = indented; } } return minline } +function retreatFrontier(doc, n) { + doc.modeFrontier = Math.min(doc.modeFrontier, n); + if (doc.highlightFrontier < n - 10) { return } + var start = doc.first; + for (var line = n - 1; line > start; line--) { + var saved = getLine(doc, line).stateAfter; + // change is on 3 + // state on line 1 looked ahead 2 -- so saw 3 + // test 1 + 2 < 3 should cover this + if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { + start = line + 1; + break + } + } + doc.highlightFrontier = Math.min(doc.highlightFrontier, start); +} + // LINE DATA STRUCTURE // Line objects. These hold state related to a line, including // highlighting info (the styles array). -function Line(text, markedSpans, estimateHeight) { - this.text = text - attachMarkedSpans(this, markedSpans) - this.height = estimateHeight ? estimateHeight(this) : 1 -} -eventMixin(Line) -Line.prototype.lineNo = function() { return lineNo(this) } +var Line = function(text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; +}; + +Line.prototype.lineNo = function () { return lineNo(this) }; +eventMixin(Line); // Change the content (text, markers) of a line. Automatically // invalidates cached information and tries to re-estimate the // line's height. function updateLine(line, text, markedSpans, estimateHeight) { - line.text = text - if (line.stateAfter) { line.stateAfter = null } - if (line.styles) { line.styles = null } - if (line.order != null) { line.order = null } - detachMarkedSpans(line) - attachMarkedSpans(line, markedSpans) - var estHeight = estimateHeight ? estimateHeight(line) : 1 - if (estHeight != line.height) { updateLineHeight(line, estHeight) } + line.text = text; + if (line.stateAfter) { line.stateAfter = null; } + if (line.styles) { line.styles = null; } + if (line.order != null) { line.order = null; } + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) { updateLineHeight(line, estHeight); } } // Detach a line from the document tree and its markers. function cleanUpLine(line) { - line.parent = null - detachMarkedSpans(line) + line.parent = null; + detachMarkedSpans(line); } // Convert a style as returned by a mode (either null, or a string @@ -9351,7 +9427,7 @@ var styleToClassCache = {}; var styleToClassCacheWithMode = {}; function interpretTokenStyle(style, options) { if (!style || /^\s*$/.test(style)) { return null } - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&")) } @@ -9365,64 +9441,64 @@ function buildLineContent(cm, lineView) { // The padding-right forces the element to have a 'border', which // is needed on Webkit to be able to get line-level bounding // rectangles for it (in measureChar). - var content = elt("span", null, null, webkit ? "padding-right: .1px" : null) - var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content, + var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, col: 0, pos: 0, cm: cm, trailingSpace: false, - splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")} - lineView.measure = {} + splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; + lineView.measure = {}; // Iterate over the logical lines that make up this visual line. for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { - var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0) - builder.pos = 0 - builder.addToken = buildToken + var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0); + builder.pos = 0; + builder.addToken = buildToken; // Optionally wire in some hacks into the token-rendering // algorithm, to deal with browser quirks. - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) - { builder.addToken = buildTokenBadBidi(builder.addToken, order) } - builder.map = [] - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line) - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)) + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) + { builder.addToken = buildTokenBadBidi(builder.addToken, order); } + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); if (line.styleClasses) { if (line.styleClasses.bgClass) - { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "") } + { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); } if (line.styleClasses.textClass) - { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "") } + { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); } } // Ensure at least a single node is present, for measuring. if (builder.map.length == 0) - { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) } + { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); } // Store the map and a cache object for the current logical line if (i == 0) { - lineView.measure.map = builder.map - lineView.measure.cache = {} + lineView.measure.map = builder.map; + lineView.measure.cache = {}; } else { - ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) - ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}) + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) + ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}); } } // See issue #2901 if (webkit) { - var last = builder.content.lastChild + var last = builder.content.lastChild; if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) - { builder.content.className = "cm-tab-wrap-hack" } + { builder.content.className = "cm-tab-wrap-hack"; } } - signal(cm, "renderLine", cm, lineView.line, builder.pre) + signal(cm, "renderLine", cm, lineView.line, builder.pre); if (builder.pre.className) - { builder.textClass = joinClasses(builder.pre.className, builder.textClass || "") } + { builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); } return builder } function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "\u2022", "cm-invalidchar") - token.title = "\\u" + ch.charCodeAt(0).toString(16) - token.setAttribute("aria-label", token.title) + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); return token } @@ -9430,75 +9506,75 @@ function defaultSpecialCharPlaceholder(ch) { // the line map. Takes care to render special characters separately. function buildToken(builder, text, style, startStyle, endStyle, title, css) { if (!text) { return } - var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text - var special = builder.cm.state.specialChars, mustWrap = false - var content + var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; + var special = builder.cm.state.specialChars, mustWrap = false; + var content; if (!special.test(text)) { - builder.col += text.length - content = document.createTextNode(displayText) - builder.map.push(builder.pos, builder.pos + text.length, content) - if (ie && ie_version < 9) { mustWrap = true } - builder.pos += text.length + builder.col += text.length; + content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) { mustWrap = true; } + builder.pos += text.length; } else { - content = document.createDocumentFragment() - var pos = 0 + content = document.createDocumentFragment(); + var pos = 0; while (true) { - special.lastIndex = pos - var m = special.exec(text) - var skipped = m ? m.index - pos : text.length - pos + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; if (skipped) { - var txt = document.createTextNode(displayText.slice(pos, pos + skipped)) - if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])) } - else { content.appendChild(txt) } - builder.map.push(builder.pos, builder.pos + skipped, txt) - builder.col += skipped - builder.pos += skipped + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])); } + else { content.appendChild(txt); } + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; } if (!m) { break } - pos += skipped + 1 - var txt$1 = (void 0) + pos += skipped + 1; + var txt$1 = (void 0); if (m[0] == "\t") { - var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize - txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")) - txt$1.setAttribute("role", "presentation") - txt$1.setAttribute("cm-text", "\t") - builder.col += tabWidth + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt$1.setAttribute("role", "presentation"); + txt$1.setAttribute("cm-text", "\t"); + builder.col += tabWidth; } else if (m[0] == "\r" || m[0] == "\n") { - txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")) - txt$1.setAttribute("cm-text", m[0]) - builder.col += 1 + txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); + txt$1.setAttribute("cm-text", m[0]); + builder.col += 1; } else { - txt$1 = builder.cm.options.specialCharPlaceholder(m[0]) - txt$1.setAttribute("cm-text", m[0]) - if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])) } - else { content.appendChild(txt$1) } - builder.col += 1 + txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); + txt$1.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])); } + else { content.appendChild(txt$1); } + builder.col += 1; } - builder.map.push(builder.pos, builder.pos + 1, txt$1) - builder.pos++ + builder.map.push(builder.pos, builder.pos + 1, txt$1); + builder.pos++; } } - builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32 + builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; if (style || startStyle || endStyle || mustWrap || css) { - var fullStyle = style || "" - if (startStyle) { fullStyle += startStyle } - if (endStyle) { fullStyle += endStyle } - var token = elt("span", [content], fullStyle, css) - if (title) { token.title = title } + var fullStyle = style || ""; + if (startStyle) { fullStyle += startStyle; } + if (endStyle) { fullStyle += endStyle; } + var token = elt("span", [content], fullStyle, css); + if (title) { token.title = title; } return builder.content.appendChild(token) } - builder.content.appendChild(content) + builder.content.appendChild(content); } function splitSpaces(text, trailingBefore) { if (text.length > 1 && !/ /.test(text)) { return text } - var spaceBefore = trailingBefore, result = "" + var spaceBefore = trailingBefore, result = ""; for (var i = 0; i < text.length; i++) { - var ch = text.charAt(i) + var ch = text.charAt(i); if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) - { ch = "\u00a0" } - result += ch - spaceBefore = ch == " " + { ch = "\u00a0"; } + result += ch; + spaceBefore = ch == " "; } return result } @@ -9507,106 +9583,106 @@ function splitSpaces(text, trailingBefore) { // right-to-left text. function buildTokenBadBidi(inner, order) { return function (builder, text, style, startStyle, endStyle, title, css) { - style = style ? style + " cm-force-border" : "cm-force-border" - var start = builder.pos, end = start + text.length + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; for (;;) { // Find the part that overlaps with the start of this text - var part = (void 0) + var part = (void 0); for (var i = 0; i < order.length; i++) { - part = order[i] + part = order[i]; if (part.to > start && part.from <= start) { break } } if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) } - inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css) - startStyle = null - text = text.slice(part.to - start) - start = part.to + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; } } } function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode - if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) } + var widget = !ignoreWidget && marker.widgetNode; + if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); } if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { if (!widget) - { widget = builder.content.appendChild(document.createElement("span")) } - widget.setAttribute("cm-marker", marker.id) + { widget = builder.content.appendChild(document.createElement("span")); } + widget.setAttribute("cm-marker", marker.id); } if (widget) { - builder.cm.display.input.setUneditable(widget) - builder.content.appendChild(widget) + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); } - builder.pos += size - builder.trailingSpace = false + builder.pos += size; + builder.trailingSpace = false; } // Outputs a number of spans to make up a line, taking highlighting // and marked text into account. function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, allText = line.text, at = 0 + var spans = line.markedSpans, allText = line.text, at = 0; if (!spans) { for (var i$1 = 1; i$1 < styles.length; i$1+=2) - { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) } + { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); } return } - var len = allText.length, pos = 0, i = 1, text = "", style, css - var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed + var len = allText.length, pos = 0, i = 1, text = "", style, css; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; for (;;) { if (nextChange == pos) { // Update current marker set - spanStyle = spanEndStyle = spanStartStyle = title = css = "" - collapsed = null; nextChange = Infinity - var foundBookmarks = [], endStyles = (void 0) + spanStyle = spanEndStyle = spanStartStyle = title = css = ""; + collapsed = null; nextChange = Infinity; + var foundBookmarks = [], endStyles = (void 0); for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker + var sp = spans[j], m = sp.marker; if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { - foundBookmarks.push(m) + foundBookmarks.push(m); } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { if (sp.to != null && sp.to != pos && nextChange > sp.to) { - nextChange = sp.to - spanEndStyle = "" + nextChange = sp.to; + spanEndStyle = ""; } - if (m.className) { spanStyle += " " + m.className } - if (m.css) { css = (css ? css + ";" : "") + m.css } - if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle } - if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) } - if (m.title && !title) { title = m.title } + if (m.className) { spanStyle += " " + m.className; } + if (m.css) { css = (css ? css + ";" : "") + m.css; } + if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } + if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } + if (m.title && !title) { title = m.title; } if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) - { collapsed = sp } + { collapsed = sp; } } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from + nextChange = sp.from; } } if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) - { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1] } } } + { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1]; } } } if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) - { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } } + { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } } if (collapsed && (collapsed.from || 0) == pos) { buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, - collapsed.marker, collapsed.from == null) + collapsed.marker, collapsed.from == null); if (collapsed.to == null) { return } - if (collapsed.to == pos) { collapsed = false } + if (collapsed.to == pos) { collapsed = false; } } } if (pos >= len) { break } - var upto = Math.min(len, nextChange) + var upto = Math.min(len, nextChange); while (true) { if (text) { - var end = pos + text.length + var end = pos + text.length; if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text + var tokenText = end > upto ? text.slice(0, upto - pos) : text; builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, - spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css) + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); } if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} - pos = end - spanStartStyle = "" + pos = end; + spanStartStyle = ""; } - text = allText.slice(at, at = styles[i++]) - style = interpretTokenStyle(styles[i++], builder.cm.options) + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); } } } @@ -9617,67 +9693,67 @@ function insertLineContent(line, builder, styles) { // logical lines, if those are connected by collapsed ranges. function LineView(doc, line, lineN) { // The starting line - this.line = line + this.line = line; // Continuing lines, if any - this.rest = visualLineContinued(line) + this.rest = visualLineContinued(line); // Number of logical lines in this visual line - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1 - this.node = this.text = null - this.hidden = lineIsHidden(doc, line) + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); } // Create a range of LineView objects for the given lines. function buildViewArray(cm, from, to) { - var array = [], nextPos + var array = [], nextPos; for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos) - nextPos = pos + view.size - array.push(view) + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); } return array } -var operationGroup = null +var operationGroup = null; function pushOperation(op) { if (operationGroup) { - operationGroup.ops.push(op) + operationGroup.ops.push(op); } else { op.ownsGroup = operationGroup = { ops: [op], delayedCallbacks: [] - } + }; } } function fireCallbacksForOps(group) { // Calls delayed callbacks and cursorActivity handlers until no // new ones appear - var callbacks = group.delayedCallbacks, i = 0 + var callbacks = group.delayedCallbacks, i = 0; do { for (; i < callbacks.length; i++) - { callbacks[i].call(null) } + { callbacks[i].call(null); } for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j] + var op = group.ops[j]; if (op.cursorActivityHandlers) { while (op.cursorActivityCalled < op.cursorActivityHandlers.length) - { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } } + { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } } } } while (i < callbacks.length) } function finishOperation(op, endCb) { - var group = op.ownsGroup + var group = op.ownsGroup; if (!group) { return } - try { fireCallbacksForOps(group) } + try { fireCallbacksForOps(group); } finally { - operationGroup = null - endCb(group) + operationGroup = null; + endCb(group); } } -var orphanDelayedCallbacks = null +var orphanDelayedCallbacks = null; // Often, we want to signal events at a point where we are in the // middle of some work, but don't want the handler to start calling @@ -9687,19 +9763,19 @@ var orphanDelayedCallbacks = null // them to be executed when the last operation ends, or, if no // operation is active, when a timeout fires. function signalLater(emitter, type /*, values...*/) { - var arr = getHandlers(emitter, type) + var arr = getHandlers(emitter, type); if (!arr.length) { return } - var args = Array.prototype.slice.call(arguments, 2), list + var args = Array.prototype.slice.call(arguments, 2), list; if (operationGroup) { - list = operationGroup.delayedCallbacks + list = operationGroup.delayedCallbacks; } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks + list = orphanDelayedCallbacks; } else { - list = orphanDelayedCallbacks = [] - setTimeout(fireOrphanDelayed, 0) + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); } var loop = function ( i ) { - list.push(function () { return arr[i].apply(null, args); }) + list.push(function () { return arr[i].apply(null, args); }); }; for (var i = 0; i < arr.length; ++i) @@ -9707,9 +9783,9 @@ function signalLater(emitter, type /*, values...*/) { } function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks - orphanDelayedCallbacks = null - for (var i = 0; i < delayed.length; ++i) { delayed[i]() } + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) { delayed[i](); } } // When an aspect of a line changes, a string is added to @@ -9717,47 +9793,48 @@ function fireOrphanDelayed() { // DOM structure. function updateLineForChanges(cm, lineView, lineN, dims) { for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j] - if (type == "text") { updateLineText(cm, lineView) } - else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) } - else if (type == "class") { updateLineClasses(lineView) } - else if (type == "widget") { updateLineWidgets(cm, lineView, dims) } + var type = lineView.changes[j]; + if (type == "text") { updateLineText(cm, lineView); } + else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims); } + else if (type == "class") { updateLineClasses(cm, lineView); } + else if (type == "widget") { updateLineWidgets(cm, lineView, dims); } } - lineView.changes = null + lineView.changes = null; } // Lines with gutter elements, widgets or a background class need to // be wrapped, and have the extra elements added to the wrapper div function ensureLineWrapped(lineView) { if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative") + lineView.node = elt("div", null, null, "position: relative"); if (lineView.text.parentNode) - { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) } - lineView.node.appendChild(lineView.text) - if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 } + { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); } + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; } } return lineView.node } -function updateLineBackground(lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass - if (cls) { cls += " CodeMirror-linebackground" } +function updateLineBackground(cm, lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) { cls += " CodeMirror-linebackground"; } if (lineView.background) { - if (cls) { lineView.background.className = cls } - else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null } + if (cls) { lineView.background.className = cls; } + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } } else if (cls) { - var wrap = ensureLineWrapped(lineView) - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild) + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + cm.display.input.setUneditable(lineView.background); } } // Wrapper around buildLineContent which will reuse the structure // in display.externalMeasured when possible. function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured + var ext = cm.display.externalMeasured; if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null - lineView.measure = ext.measure + cm.display.externalMeasured = null; + lineView.measure = ext.measure; return ext.built } return buildLineContent(cm, lineView) @@ -9767,143 +9844,144 @@ function getLineContent(cm, lineView) { // classes because the mode may output tokens that influence these // classes. function updateLineText(cm, lineView) { - var cls = lineView.text.className - var built = getLineContent(cm, lineView) - if (lineView.text == lineView.node) { lineView.node = built.pre } - lineView.text.parentNode.replaceChild(built.pre, lineView.text) - lineView.text = built.pre + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) { lineView.node = built.pre; } + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass - lineView.textClass = built.textClass - updateLineClasses(lineView) + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(cm, lineView); } else if (cls) { - lineView.text.className = cls + lineView.text.className = cls; } } -function updateLineClasses(lineView) { - updateLineBackground(lineView) +function updateLineClasses(cm, lineView) { + updateLineBackground(cm, lineView); if (lineView.line.wrapClass) - { ensureLineWrapped(lineView).className = lineView.line.wrapClass } + { ensureLineWrapped(lineView).className = lineView.line.wrapClass; } else if (lineView.node != lineView.text) - { lineView.node.className = "" } - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass - lineView.text.className = textClass || "" + { lineView.node.className = ""; } + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; } function updateLineGutter(cm, lineView, lineN, dims) { if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter) - lineView.gutter = null + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; } if (lineView.gutterBackground) { - lineView.node.removeChild(lineView.gutterBackground) - lineView.gutterBackground = null + lineView.node.removeChild(lineView.gutterBackground); + lineView.gutterBackground = null; } if (lineView.line.gutterClass) { - var wrap = ensureLineWrapped(lineView) + var wrap = ensureLineWrapped(lineView); lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, - ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")) - wrap.insertBefore(lineView.gutterBackground, lineView.text) + ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")); + cm.display.input.setUneditable(lineView.gutterBackground); + wrap.insertBefore(lineView.gutterBackground, lineView.text); } - var markers = lineView.line.gutterMarkers + var markers = lineView.line.gutterMarkers; if (cm.options.lineNumbers || markers) { - var wrap$1 = ensureLineWrapped(lineView) - var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")) - cm.display.input.setUneditable(gutterWrap) - wrap$1.insertBefore(gutterWrap, lineView.text) + var wrap$1 = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")); + cm.display.input.setUneditable(gutterWrap); + wrap$1.insertBefore(gutterWrap, lineView.text); if (lineView.line.gutterClass) - { gutterWrap.className += " " + lineView.line.gutterClass } + { gutterWrap.className += " " + lineView.line.gutterClass; } if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) { lineView.lineNumber = gutterWrap.appendChild( elt("div", lineNumberFor(cm.options, lineN), "CodeMirror-linenumber CodeMirror-gutter-elt", - ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))) } + ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))); } if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) { - var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id] + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; if (found) { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", - ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))) } + ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))); } } } } } function updateLineWidgets(cm, lineView, dims) { - if (lineView.alignable) { lineView.alignable = null } + if (lineView.alignable) { lineView.alignable = null; } for (var node = lineView.node.firstChild, next = (void 0); node; node = next) { - next = node.nextSibling + next = node.nextSibling; if (node.className == "CodeMirror-linewidget") - { lineView.node.removeChild(node) } + { lineView.node.removeChild(node); } } - insertLineWidgets(cm, lineView, dims) + insertLineWidgets(cm, lineView, dims); } // Build a line's DOM representation from scratch function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView) - lineView.text = lineView.node = built.pre - if (built.bgClass) { lineView.bgClass = built.bgClass } - if (built.textClass) { lineView.textClass = built.textClass } - - updateLineClasses(lineView) - updateLineGutter(cm, lineView, lineN, dims) - insertLineWidgets(cm, lineView, dims) + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) { lineView.bgClass = built.bgClass; } + if (built.textClass) { lineView.textClass = built.textClass; } + + updateLineClasses(cm, lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); return lineView.node } // A lineView may contain multiple logical lines (when merged by // collapsed spans). The widgets for all of them need to be drawn. function insertLineWidgets(cm, lineView, dims) { - insertLineWidgetsFor(cm, lineView.line, lineView, dims, true) + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) - { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } } + { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } } } function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { if (!line.widgets) { return } - var wrap = ensureLineWrapped(lineView) + var wrap = ensureLineWrapped(lineView); for (var i = 0, ws = line.widgets; i < ws.length; ++i) { - var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget") - if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true") } - positionLineWidget(widget, node, lineView, dims) - cm.display.input.setUneditable(node) + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); + if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true"); } + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); if (allowAbove && widget.above) - { wrap.insertBefore(node, lineView.gutter || lineView.text) } + { wrap.insertBefore(node, lineView.gutter || lineView.text); } else - { wrap.appendChild(node) } - signalLater(widget, "redraw") + { wrap.appendChild(node); } + signalLater(widget, "redraw"); } } function positionLineWidget(widget, node, lineView, dims) { if (widget.noHScroll) { - ;(lineView.alignable || (lineView.alignable = [])).push(node) - var width = dims.wrapperWidth - node.style.left = dims.fixedPos + "px" + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; if (!widget.coverGutter) { - width -= dims.gutterTotalWidth - node.style.paddingLeft = dims.gutterTotalWidth + "px" + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; } - node.style.width = width + "px" + node.style.width = width + "px"; } if (widget.coverGutter) { - node.style.zIndex = 5 - node.style.position = "relative" - if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px" } + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px"; } } } function widgetHeight(widget) { if (widget.height != null) { return widget.height } - var cm = widget.doc.cm + var cm = widget.doc.cm; if (!cm) { return 0 } if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;" + var parentStyle = "position: relative;"; if (widget.coverGutter) - { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" } + { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; } if (widget.noHScroll) - { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" } - removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)) + { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; } + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); } return widget.height = widget.node.parentNode.offsetHeight } @@ -9923,10 +10001,10 @@ function paddingTop(display) {return display.lineSpace.offsetTop} function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight} function paddingH(display) { if (display.cachedPaddingH) { return display.cachedPaddingH } - var e = removeChildrenAndAdd(display.measure, elt("pre", "x")) - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle - var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)} - if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data } + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; + if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; } return data } @@ -9943,20 +10021,20 @@ function displayHeight(cm) { // line. When lineWrapping is on, there might be more than one // height. function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping - var curWidth = wrapping && displayWidth(cm) + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = [] + var heights = lineView.measure.heights = []; if (wrapping) { - lineView.measure.width = curWidth - var rects = lineView.text.firstChild.getClientRects() + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); for (var i = 0; i < rects.length - 1; i++) { - var cur = rects[i], next = rects[i + 1] + var cur = rects[i], next = rects[i + 1]; if (Math.abs(cur.bottom - next.bottom) > 2) - { heights.push((cur.bottom + next.top) / 2 - rect.top) } + { heights.push((cur.bottom + next.top) / 2 - rect.top); } } } - heights.push(rect.bottom - rect.top) + heights.push(rect.bottom - rect.top); } } @@ -9977,13 +10055,13 @@ function mapFromLineView(lineView, line, lineN) { // Render a line into the hidden node display.externalMeasured. Used // when measurement is needed for a line that's not in the viewport. function updateExternalMeasurement(cm, line) { - line = visualLine(line) - var lineN = lineNo(line) - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN) - view.lineN = lineN - var built = view.built = buildLineContent(cm, view) - view.text = built.pre - removeChildrenAndAdd(cm.display.lineMeasure, built.pre) + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); return view } @@ -9997,7 +10075,7 @@ function measureChar(cm, line, ch, bias) { function findViewForLine(cm, lineN) { if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) { return cm.display.view[findViewIndex(cm, lineN)] } - var ext = cm.display.externalMeasured + var ext = cm.display.externalMeasured; if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) { return ext } } @@ -10008,18 +10086,18 @@ function findViewForLine(cm, lineN) { // measurements in a row, can thus ensure that the set-up work is // only done once. function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line) - var view = findViewForLine(cm, lineN) + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); if (view && !view.text) { - view = null + view = null; } else if (view && view.changes) { - updateLineForChanges(cm, view, lineN, getDimensions(cm)) - cm.curOp.forceUpdate = true + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + cm.curOp.forceUpdate = true; } if (!view) - { view = updateExternalMeasurement(cm, line) } + { view = updateExternalMeasurement(cm, line); } - var info = mapFromLineView(view, line, lineN) + var info = mapFromLineView(view, line, lineN); return { line: line, view: view, rect: null, map: info.map, cache: info.cache, before: info.before, @@ -10030,58 +10108,58 @@ function prepareMeasureForLine(cm, line) { // Given a prepared measurement object, measures the position of an // actual character (or fetches it from the cache). function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) { ch = -1 } - var key = ch + (bias || ""), found + if (prepared.before) { ch = -1; } + var key = ch + (bias || ""), found; if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key] + found = prepared.cache[key]; } else { if (!prepared.rect) - { prepared.rect = prepared.view.text.getBoundingClientRect() } + { prepared.rect = prepared.view.text.getBoundingClientRect(); } if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect) - prepared.hasHeights = true + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; } - found = measureCharInner(cm, prepared, ch, bias) - if (!found.bogus) { prepared.cache[key] = found } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) { prepared.cache[key] = found; } } return {left: found.left, right: found.right, top: varHeight ? found.rtop : found.top, bottom: varHeight ? found.rbottom : found.bottom} } -var nullRect = {left: 0, right: 0, top: 0, bottom: 0} +var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; -function nodeAndOffsetInLineMap(map, ch, bias) { - var node, start, end, collapse, mStart, mEnd +function nodeAndOffsetInLineMap(map$$1, ch, bias) { + var node, start, end, collapse, mStart, mEnd; // First, search the line map for the text node corresponding to, // or closest to, the target character. - for (var i = 0; i < map.length; i += 3) { - mStart = map[i] - mEnd = map[i + 1] + for (var i = 0; i < map$$1.length; i += 3) { + mStart = map$$1[i]; + mEnd = map$$1[i + 1]; if (ch < mStart) { - start = 0; end = 1 - collapse = "left" + start = 0; end = 1; + collapse = "left"; } else if (ch < mEnd) { - start = ch - mStart - end = start + 1 - } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { - end = mEnd - mStart - start = end - 1 - if (ch >= mEnd) { collapse = "right" } + start = ch - mStart; + end = start + 1; + } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) { collapse = "right"; } } if (start != null) { - node = map[i + 2] + node = map$$1[i + 2]; if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) - { collapse = bias } + { collapse = bias; } if (bias == "left" && start == 0) - { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { - node = map[(i -= 3) + 2] - collapse = "left" + { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) { + node = map$$1[(i -= 3) + 2]; + collapse = "left"; } } if (bias == "right" && start == mEnd - mStart) - { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { - node = map[(i += 3) + 2] - collapse = "right" + { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) { + node = map$$1[(i += 3) + 2]; + collapse = "right"; } } break } @@ -10090,7 +10168,7 @@ function nodeAndOffsetInLineMap(map, ch, bias) { } function getUsefulRect(rects, bias) { - var rect = nullRect + var rect = nullRect; if (bias == "left") { for (var i = 0; i < rects.length; i++) { if ((rect = rects[i]).left != rect.right) { break } } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { @@ -10100,52 +10178,52 @@ function getUsefulRect(rects, bias) { } function measureCharInner(cm, prepared, ch, bias) { - var place = nodeAndOffsetInLineMap(prepared.map, ch, bias) - var node = place.node, start = place.start, end = place.end, collapse = place.collapse + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, start = place.start, end = place.end, collapse = place.collapse; - var rect + var rect; if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned - while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start } - while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end } + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; } + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; } if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) - { rect = node.parentNode.getBoundingClientRect() } + { rect = node.parentNode.getBoundingClientRect(); } else - { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) } + { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); } if (rect.left || rect.right || start == 0) { break } - end = start - start = start - 1 - collapse = "right" + end = start; + start = start - 1; + collapse = "right"; } - if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) } + if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); } } else { // If it is a widget, simply get the box for the whole widget. - if (start > 0) { collapse = bias = "right" } - var rects + if (start > 0) { collapse = bias = "right"; } + var rects; if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) - { rect = rects[bias == "right" ? rects.length - 1 : 0] } + { rect = rects[bias == "right" ? rects.length - 1 : 0]; } else - { rect = node.getBoundingClientRect() } + { rect = node.getBoundingClientRect(); } } if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0] + var rSpan = node.parentNode.getClientRects()[0]; if (rSpan) - { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} } + { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; } else - { rect = nullRect } + { rect = nullRect; } } - var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top - var mid = (rtop + rbot) / 2 - var heights = prepared.view.measure.heights - var i = 0 + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + var i = 0; for (; i < heights.length - 1; i++) { if (mid < heights[i]) { break } } - var top = i ? heights[i - 1] : 0, bot = heights[i] + var top = i ? heights[i - 1] : 0, bot = heights[i]; var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top: top, bottom: bot} - if (!rect.left && !rect.right) { result.bogus = true } - if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot } + top: top, bottom: bot}; + if (!rect.left && !rect.right) { result.bogus = true; } + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } return result } @@ -10156,59 +10234,75 @@ function maybeUpdateRectForZooming(measure, rect) { if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) { return rect } - var scaleX = screen.logicalXDPI / screen.deviceXDPI - var scaleY = screen.logicalYDPI / screen.deviceYDPI + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; return {left: rect.left * scaleX, right: rect.right * scaleX, top: rect.top * scaleY, bottom: rect.bottom * scaleY} } function clearLineMeasurementCacheFor(lineView) { if (lineView.measure) { - lineView.measure.cache = {} - lineView.measure.heights = null + lineView.measure.cache = {}; + lineView.measure.heights = null; if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) - { lineView.measure.caches[i] = {} } } + { lineView.measure.caches[i] = {}; } } } } function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null - removeChildren(cm.display.lineMeasure) + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); for (var i = 0; i < cm.display.view.length; i++) - { clearLineMeasurementCacheFor(cm.display.view[i]) } + { clearLineMeasurementCacheFor(cm.display.view[i]); } } function clearCaches(cm) { - clearLineMeasurementCache(cm) - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null - if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true } - cm.display.lineNumChars = null + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; } + cm.display.lineNumChars = null; +} + +function pageScrollX() { + // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 + // which causes page_Offset and bounding client rects to use + // different reference viewports and invalidate our calculations. + if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) } + return window.pageXOffset || (document.documentElement || document.body).scrollLeft +} +function pageScrollY() { + if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) } + return window.pageYOffset || (document.documentElement || document.body).scrollTop } -function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft } -function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop } +function widgetTopHeight(lineObj) { + var height = 0; + if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) + { height += widgetHeight(lineObj.widgets[i]); } } } + return height +} // Converts a {top, bottom, left, right} box from line-local // coordinates into another coordinate system. Context may be one of // "line", "div" (display.lineDiv), "local"./null (editor), "window", // or "page". function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { - if (!includeWidgets && lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) { - var size = widgetHeight(lineObj.widgets[i]) - rect.top += size; rect.bottom += size - } } } + if (!includeWidgets) { + var height = widgetTopHeight(lineObj); + rect.top += height; rect.bottom += height; + } if (context == "line") { return rect } - if (!context) { context = "local" } - var yOff = heightAtLine(lineObj) - if (context == "local") { yOff += paddingTop(cm.display) } - else { yOff -= cm.display.viewOffset } + if (!context) { context = "local"; } + var yOff = heightAtLine(lineObj); + if (context == "local") { yOff += paddingTop(cm.display); } + else { yOff -= cm.display.viewOffset; } if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect() - yOff += lOff.top + (context == "window" ? 0 : pageScrollY()) - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()) - rect.left += xOff; rect.right += xOff + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; rect.right += xOff; } - rect.top += yOff; rect.bottom += yOff + rect.top += yOff; rect.bottom += yOff; return rect } @@ -10216,67 +10310,79 @@ function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { // Context may be "window", "page", "div", or "local"./null. function fromCoordSystem(cm, coords, context) { if (context == "div") { return coords } - var left = coords.left, top = coords.top + var left = coords.left, top = coords.top; // First move into "page" coordinate system if (context == "page") { - left -= pageScrollX() - top -= pageScrollY() + left -= pageScrollX(); + top -= pageScrollY(); } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect() - left += localBox.left - top += localBox.top + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; } - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect() + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} } function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) { lineObj = getLine(cm.doc, pos.line) } + if (!lineObj) { lineObj = getLine(cm.doc, pos.line); } return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context) } // Returns a box for a given cursor position, which may have an // 'other' property containing the position of the secondary cursor // on a bidi boundary. +// A cursor Pos(line, char, "before") is on the same visual line as `char - 1` +// and after `char - 1` in writing order of `char - 1` +// A cursor Pos(line, char, "after") is on the same visual line as `char` +// and before `char` in writing order of `char` +// Examples (upper-case letters are RTL, lower-case are LTR): +// Pos(0, 1, ...) +// before after +// ab a|b a|b +// aB a|B aB| +// Ab |Ab A|b +// AB B|A B|A +// Every position after the last character on a line is considered to stick +// to the last character on the line. function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line) - if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) } + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } function get(ch, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight) - if (right) { m.left = m.right; } else { m.right = m.left } + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) { m.left = m.right; } else { m.right = m.left; } return intoCoordSystem(cm, lineObj, m, context) } - function getBidi(ch, partPos) { - var part = order[partPos], right = part.level % 2 - if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) { - part = order[--partPos] - ch = bidiRight(part) - (part.level % 2 ? 0 : 1) - right = true - } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) { - part = order[++partPos] - ch = bidiLeft(part) - part.level % 2 - right = false - } - if (right && ch == part.to && ch > part.from) { return get(ch - 1) } - return get(ch, right) - } - var order = getOrder(lineObj), ch = pos.ch - if (!order) { return get(ch) } - var partPos = getBidiPartAt(order, ch) - var val = getBidi(ch, partPos) - if (bidiOther != null) { val.other = getBidi(ch, bidiOther) } + var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky; + if (ch >= lineObj.text.length) { + ch = lineObj.text.length; + sticky = "before"; + } else if (ch <= 0) { + ch = 0; + sticky = "after"; + } + if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } + + function getBidi(ch, partPos, invert) { + var part = order[partPos], right = part.level == 1; + return get(invert ? ch - 1 : ch, right != invert) + } + var partPos = getBidiPartAt(order, ch, sticky); + var other = bidiOther; + var val = getBidi(ch, partPos, sticky == "before"); + if (other != null) { val.other = getBidi(ch, other, sticky != "before"); } return val } // Used to cheaply estimate the coordinates for a position. Used for // intermediate scroll updates. function estimateCoords(cm, pos) { - var left = 0 - pos = clipPos(cm.doc, pos) - if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch } - var lineObj = getLine(cm.doc, pos.line) - var top = heightAtLine(lineObj) + paddingTop(cm.display) + var left = 0; + pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; } + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); return {left: left, right: left, top: top, bottom: top + lineObj.height} } @@ -10286,129 +10392,219 @@ function estimateCoords(cm, pos) { // the right of the character position, for example). When outside // is true, that means the coordinates lie outside the line's // vertical range. -function PosWithInfo(line, ch, outside, xRel) { - var pos = Pos(line, ch) - pos.xRel = xRel - if (outside) { pos.outside = true } +function PosWithInfo(line, ch, sticky, outside, xRel) { + var pos = Pos(line, ch, sticky); + pos.xRel = xRel; + if (outside) { pos.outside = true; } return pos } // Compute the character position closest to the given coordinates. // Input must be lineSpace-local ("div" coordinate system). function coordsChar(cm, x, y) { - var doc = cm.doc - y += cm.display.viewOffset - if (y < 0) { return PosWithInfo(doc.first, 0, true, -1) } - var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1 + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) } + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; if (lineN > last) - { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1) } - if (x < 0) { x = 0 } + { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) } + if (x < 0) { x = 0; } - var lineObj = getLine(doc, lineN) + var lineObj = getLine(doc, lineN); for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y) - var merged = collapsedSpanAtEnd(lineObj) - var mergedPos = merged && merged.find(0, true) - if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) - { lineN = lineNo(lineObj = mergedPos.to.line) } - else - { return found } + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0)); + if (!collapsed) { return found } + var rangeEnd = collapsed.find(1); + if (rangeEnd.line == lineN) { return rangeEnd } + lineObj = getLine(doc, lineN = rangeEnd.line); } } -function coordsCharInner(cm, lineObj, lineNo, x, y) { - var innerOff = y - heightAtLine(lineObj) - var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth - var preparedMeasure = prepareMeasureForLine(cm, lineObj) - - function getX(ch) { - var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure) - wrongLine = true - if (innerOff > sp.bottom) { return sp.left - adjust } - else if (innerOff < sp.top) { return sp.left + adjust } - else { wrongLine = false } - return sp.left - } +function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { + y -= widgetTopHeight(lineObj); + var end = lineObj.text.length; + var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0); + end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end); + return {begin: begin, end: end} +} - var bidi = getOrder(lineObj), dist = lineObj.text.length - var from = lineLeft(lineObj), to = lineRight(lineObj) - var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine +function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } + var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; + return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop) +} - if (x > toX) { return PosWithInfo(lineNo, to, toOutside, 1) } - // Do a binary search between these bounds. - for (;;) { - if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { - var ch = x < fromX || x - fromX <= toX - x ? from : to - var outside = ch == from ? fromOutside : toOutside - var xDiff = x - (ch == from ? fromX : toX) - // This is a kludge to handle the case where the coordinates - // are after a line-wrapped line. We should replace it with a - // more general handling of cursor positions around line - // breaks. (Issue #4078) - if (toOutside && !bidi && !/\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 && - ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) { - var charSize = measureCharPrepared(cm, preparedMeasure, ch, "right") - if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) { - outside = false - ch++ - xDiff = x - charSize.right - } - } - while (isExtendingChar(lineObj.text.charAt(ch))) { ++ch } - var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0) - return pos - } - var step = Math.ceil(dist / 2), middle = from + step - if (bidi) { - middle = from - for (var i = 0; i < step; ++i) { middle = moveVisually(lineObj, middle, 1) } - } - var middleX = getX(middle) - if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) { toX += 1000; } dist = step} - else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step} - } +// Returns true if the given side of a box is after the given +// coordinates, in top-to-bottom, left-to-right order. +function boxIsAfter(box, x, y, left) { + return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x } -var measureText +function coordsCharInner(cm, lineObj, lineNo$$1, x, y) { + // Move y into line-local coordinate space + y -= heightAtLine(lineObj); + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + // When directly calling `measureCharPrepared`, we have to adjust + // for the widgets at this line. + var widgetHeight$$1 = widgetTopHeight(lineObj); + var begin = 0, end = lineObj.text.length, ltr = true; + + var order = getOrder(lineObj, cm.doc.direction); + // If the line isn't plain left-to-right text, first figure out + // which bidi section the coordinates fall into. + if (order) { + var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart) + (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y); + ltr = part.level != 1; + // The awkward -1 offsets are needed because findFirst (called + // on these below) will treat its first bound as inclusive, + // second as exclusive, but we want to actually address the + // characters in the part's range + begin = ltr ? part.from : part.to - 1; + end = ltr ? part.to : part.from - 1; + } + + // A binary search to find the first character whose bounding box + // starts after the coordinates. If we run across any whose box wrap + // the coordinates, store that. + var chAround = null, boxAround = null; + var ch = findFirst(function (ch) { + var box = measureCharPrepared(cm, preparedMeasure, ch); + box.top += widgetHeight$$1; box.bottom += widgetHeight$$1; + if (!boxIsAfter(box, x, y, false)) { return false } + if (box.top <= y && box.left <= x) { + chAround = ch; + boxAround = box; + } + return true + }, begin, end); + + var baseX, sticky, outside = false; + // If a box around the coordinates was found, use that + if (boxAround) { + // Distinguish coordinates nearer to the left or right side of the box + var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr; + ch = chAround + (atStart ? 0 : 1); + sticky = atStart ? "after" : "before"; + baseX = atLeft ? boxAround.left : boxAround.right; + } else { + // (Adjust for extended bound, if necessary.) + if (!ltr && (ch == end || ch == begin)) { ch++; } + // To determine which side to associate with, get the box to the + // left of the character and compare it's vertical position to the + // coordinates + sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : + (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ? + "after" : "before"; + // Now get accurate coordinates for this place, in order to get a + // base X position + var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), "line", lineObj, preparedMeasure); + baseX = coords.left; + outside = y < coords.top || y >= coords.bottom; + } + + ch = skipExtendingChars(lineObj.text, ch, 1); + return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX) +} + +function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) { + // Bidi parts are sorted left-to-right, and in a non-line-wrapping + // situation, we can take this ordering to correspond to the visual + // ordering. This finds the first part whose end is after the given + // coordinates. + var index = findFirst(function (i) { + var part = order[i], ltr = part.level != 1; + return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? "before" : "after"), + "line", lineObj, preparedMeasure), x, y, true) + }, 0, order.length - 1); + var part = order[index]; + // If this isn't the first part, the part's start is also after + // the coordinates, and the coordinates aren't on the same line as + // that start, move one part back. + if (index > 0) { + var ltr = part.level != 1; + var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? "after" : "before"), + "line", lineObj, preparedMeasure); + if (boxIsAfter(start, x, y, true) && start.top > y) + { part = order[index - 1]; } + } + return part +} + +function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { + // In a wrapped line, rtl text on wrapping boundaries can do things + // that don't correspond to the ordering in our `order` array at + // all, so a binary search doesn't work, and we want to return a + // part that only spans one line so that the binary search in + // coordsCharInner is safe. As such, we first find the extent of the + // wrapped line, and then do a flat search in which we discard any + // spans that aren't on the line. + var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); + var begin = ref.begin; + var end = ref.end; + if (/\s/.test(lineObj.text.charAt(end - 1))) { end--; } + var part = null, closestDist = null; + for (var i = 0; i < order.length; i++) { + var p = order[i]; + if (p.from >= end || p.to <= begin) { continue } + var ltr = p.level != 1; + var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right; + // Weigh against spans ending before this, so that they are only + // picked if nothing ends after + var dist = endX < x ? x - endX + 1e9 : endX - x; + if (!part || closestDist > dist) { + part = p; + closestDist = dist; + } + } + if (!part) { part = order[order.length - 1]; } + // Clip the part to the wrapped line. + if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; } + if (part.to > end) { part = {from: part.from, to: end, level: part.level}; } + return part +} + +var measureText; // Compute the default text height. function textHeight(display) { if (display.cachedTextHeight != null) { return display.cachedTextHeight } if (measureText == null) { - measureText = elt("pre") + measureText = elt("pre"); // Measure a bunch of lines, for browsers that compute // fractional heights. for (var i = 0; i < 49; ++i) { - measureText.appendChild(document.createTextNode("x")) - measureText.appendChild(elt("br")) + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); } - measureText.appendChild(document.createTextNode("x")) + measureText.appendChild(document.createTextNode("x")); } - removeChildrenAndAdd(display.measure, measureText) - var height = measureText.offsetHeight / 50 - if (height > 3) { display.cachedTextHeight = height } - removeChildren(display.measure) + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) { display.cachedTextHeight = height; } + removeChildren(display.measure); return height || 1 } // Compute the default character width. function charWidth(display) { if (display.cachedCharWidth != null) { return display.cachedCharWidth } - var anchor = elt("span", "xxxxxxxxxx") - var pre = elt("pre", [anchor]) - removeChildrenAndAdd(display.measure, pre) - var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10 - if (width > 2) { display.cachedCharWidth = width } + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor]); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; + if (width > 2) { display.cachedCharWidth = width; } return width || 10 } // Do a bulk-read of the DOM positions and sizes needed to draw the // view, so that we don't interleave reading and writing to the DOM. function getDimensions(cm) { - var d = cm.display, left = {}, width = {} - var gutterLeft = d.gutters.clientLeft + var d = cm.display, left = {}, width = {}; + var gutterLeft = d.gutters.clientLeft; for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft - width[cm.options.gutters[i]] = n.clientWidth + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; + width[cm.options.gutters[i]] = n.clientWidth; } return {fixedPos: compensateForHScroll(d), gutterTotalWidth: d.gutters.offsetWidth, @@ -10428,14 +10624,14 @@ function compensateForHScroll(display) { // first approximation until the line becomes visible (and is thus // properly measurable). function estimateHeight(cm) { - var th = textHeight(cm.display), wrapping = cm.options.lineWrapping - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3) + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); return function (line) { if (lineIsHidden(cm.doc, line)) { return 0 } - var widgetsHeight = 0 + var widgetsHeight = 0; if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { - if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height } + if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; } } } if (wrapping) @@ -10446,11 +10642,11 @@ function estimateHeight(cm) { } function estimateLineHeights(cm) { - var doc = cm.doc, est = estimateHeight(cm) + var doc = cm.doc, est = estimateHeight(cm); doc.iter(function (line) { - var estHeight = est(line) - if (estHeight != line.height) { updateLineHeight(line, estHeight) } - }) + var estHeight = est(line); + if (estHeight != line.height) { updateLineHeight(line, estHeight); } + }); } // Given a mouse event, find the corresponding position. If liberal @@ -10459,17 +10655,17 @@ function estimateLineHeights(cm) { // selections, and tries to estimate a character position even for // coordinates beyond the right of the text. function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display + var display = cm.display; if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } - var x, y, space = display.lineSpace.getBoundingClientRect() + var x, y, space = display.lineSpace.getBoundingClientRect(); // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX - space.left; y = e.clientY - space.top } + try { x = e.clientX - space.left; y = e.clientY - space.top; } catch (e) { return null } - var coords = coordsChar(cm, x, y), line + var coords = coordsChar(cm, x, y), line; if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)) + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); } return coords } @@ -10478,252 +10674,233 @@ function posFromMouse(cm, e, liberal, forRect) { // when the line isn't visible. function findViewIndex(cm, n) { if (n >= cm.display.viewTo) { return null } - n -= cm.display.viewFrom + n -= cm.display.viewFrom; if (n < 0) { return null } - var view = cm.display.view + var view = cm.display.view; for (var i = 0; i < view.length; i++) { - n -= view[i].size + n -= view[i].size; if (n < 0) { return i } } } function updateSelection(cm) { - cm.display.input.showSelection(cm.display.input.prepareSelection()) + cm.display.input.showSelection(cm.display.input.prepareSelection()); } function prepareSelection(cm, primary) { - var doc = cm.doc, result = {} - var curFragment = result.cursors = document.createDocumentFragment() - var selFragment = result.selection = document.createDocumentFragment() + if ( primary === void 0 ) primary = true; + + var doc = cm.doc, result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); for (var i = 0; i < doc.sel.ranges.length; i++) { - if (primary === false && i == doc.sel.primIndex) { continue } - var range = doc.sel.ranges[i] - if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue } - var collapsed = range.empty() + if (!primary && i == doc.sel.primIndex) { continue } + var range$$1 = doc.sel.ranges[i]; + if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue } + var collapsed = range$$1.empty(); if (collapsed || cm.options.showCursorWhenSelecting) - { drawSelectionCursor(cm, range.head, curFragment) } + { drawSelectionCursor(cm, range$$1.head, curFragment); } if (!collapsed) - { drawSelectionRange(cm, range, selFragment) } + { drawSelectionRange(cm, range$$1, selFragment); } } return result } // Draws a cursor for the given range function drawSelectionCursor(cm, head, output) { - var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine) + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); - var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")) - cursor.style.left = pos.left + "px" - cursor.style.top = pos.top + "px" - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px" + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; if (pos.other) { // Secondary cursor, shown when on a 'jump' in bi-directional text - var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")) - otherCursor.style.display = "" - otherCursor.style.left = pos.other.left + "px" - otherCursor.style.top = pos.other.top + "px" - otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px" + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; } } +function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } + // Draws the given range as a highlighted selection -function drawSelectionRange(cm, range, output) { - var display = cm.display, doc = cm.doc - var fragment = document.createDocumentFragment() - var padding = paddingH(cm.display), leftSide = padding.left - var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right +function drawSelectionRange(cm, range$$1, output) { + var display = cm.display, doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + var docLTR = doc.direction == "ltr"; function add(left, top, width, bottom) { - if (top < 0) { top = 0 } - top = Math.round(top) - bottom = Math.round(bottom) - fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))) + if (top < 0) { top = 0; } + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))); } function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line) - var lineLen = lineObj.text.length - var start, end + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; function coords(ch, bias) { return charCoords(cm, Pos(line, ch), "div", lineObj, bias) } - iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) { - var leftPos = coords(from, "left"), rightPos, left, right - if (from == to) { - rightPos = leftPos - left = right = leftPos.left - } else { - rightPos = coords(to - 1, "right") - if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp } - left = leftPos.left - right = rightPos.right - } - if (fromArg == null && from == 0) { left = leftSide } - if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part - add(left, leftPos.top, null, leftPos.bottom) - left = leftSide - if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) } + function wrapX(pos, dir, side) { + var extent = wrappedLineExtentChar(cm, lineObj, null, pos); + var prop = (dir == "ltr") == (side == "after") ? "left" : "right"; + var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); + return coords(ch, prop)[prop] + } + + var order = getOrder(lineObj, doc.direction); + iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { + var ltr = dir == "ltr"; + var fromPos = coords(from, ltr ? "left" : "right"); + var toPos = coords(to - 1, ltr ? "right" : "left"); + + var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen; + var first = i == 0, last = !order || i == order.length - 1; + if (toPos.top - fromPos.top <= 3) { // Single line + var openLeft = (docLTR ? openStart : openEnd) && first; + var openRight = (docLTR ? openEnd : openStart) && last; + var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; + var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; + add(left, fromPos.top, right - left, fromPos.bottom); + } else { // Multiple lines + var topLeft, topRight, botLeft, botRight; + if (ltr) { + topLeft = docLTR && openStart && first ? leftSide : fromPos.left; + topRight = docLTR ? rightSide : wrapX(from, dir, "before"); + botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); + botRight = docLTR && openEnd && last ? rightSide : toPos.right; + } else { + topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); + topRight = !docLTR && openStart && first ? rightSide : fromPos.right; + botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; + botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); + } + add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); + if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); } + add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); } - if (toArg == null && to == lineLen) { right = rightSide } - if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) - { start = leftPos } - if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) - { end = rightPos } - if (left < leftSide + 1) { left = leftSide } - add(left, rightPos.top, right - left, rightPos.bottom) - }) + + if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; } + if (cmpCoords(toPos, start) < 0) { start = toPos; } + if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; } + if (cmpCoords(toPos, end) < 0) { end = toPos; } + }); return {start: start, end: end} } - var sFrom = range.from(), sTo = range.to() + var sFrom = range$$1.from(), sTo = range$$1.to(); if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch) + drawForLine(sFrom.line, sFrom.ch, sTo.ch); } else { - var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line) - var singleVLine = visualLine(fromLine) == visualLine(toLine) - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; if (singleVLine) { if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom) - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom) + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom) + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); } } if (leftEnd.bottom < rightStart.top) - { add(leftSide, leftEnd.bottom, null, rightStart.top) } + { add(leftSide, leftEnd.bottom, null, rightStart.top); } } - output.appendChild(fragment) + output.appendChild(fragment); } // Cursor-blinking function restartBlink(cm) { if (!cm.state.focused) { return } - var display = cm.display - clearInterval(display.blinker) - var on = true - display.cursorDiv.style.visibility = "" + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; if (cm.options.cursorBlinkRate > 0) { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; }, - cm.options.cursorBlinkRate) } + cm.options.cursorBlinkRate); } else if (cm.options.cursorBlinkRate < 0) - { display.cursorDiv.style.visibility = "hidden" } + { display.cursorDiv.style.visibility = "hidden"; } } function ensureFocus(cm) { - if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) } + if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } } function delayBlurEvent(cm) { - cm.state.delayingBlurEvent = true + cm.state.delayingBlurEvent = true; setTimeout(function () { if (cm.state.delayingBlurEvent) { - cm.state.delayingBlurEvent = false - onBlur(cm) - } }, 100) + cm.state.delayingBlurEvent = false; + onBlur(cm); + } }, 100); } function onFocus(cm, e) { - if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false } + if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; } if (cm.options.readOnly == "nocursor") { return } if (!cm.state.focused) { - signal(cm, "focus", cm, e) - cm.state.focused = true - addClass(cm.display.wrapper, "CodeMirror-focused") + signal(cm, "focus", cm, e); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); // This test prevents this from firing when a context // menu is closed (since the input reset would kill the // select-all detection hack) if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - cm.display.input.reset() - if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730 + cm.display.input.reset(); + if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730 } - cm.display.input.receivedFocus() + cm.display.input.receivedFocus(); } - restartBlink(cm) + restartBlink(cm); } function onBlur(cm, e) { if (cm.state.delayingBlurEvent) { return } if (cm.state.focused) { - signal(cm, "blur", cm, e) - cm.state.focused = false - rmClass(cm.display.wrapper, "CodeMirror-focused") - } - clearInterval(cm.display.blinker) - setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150) -} - -// Re-align line numbers and gutter marks to compensate for -// horizontal scrolling. -function alignHorizontally(cm) { - var display = cm.display, view = display.view - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft - var gutterW = display.gutters.offsetWidth, left = comp + "px" - for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { - if (cm.options.fixedGutter) { - if (view[i].gutter) - { view[i].gutter.style.left = left } - if (view[i].gutterBackground) - { view[i].gutterBackground.style.left = left } - } - var align = view[i].alignable - if (align) { for (var j = 0; j < align.length; j++) - { align[j].style.left = left } } - } } - if (cm.options.fixedGutter) - { display.gutters.style.left = (comp + gutterW) + "px" } -} - -// Used to ensure that the line number gutter is still the right -// size for the current document size. Returns true when an update -// is needed. -function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) { return false } - var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], - "CodeMirror-linenumber CodeMirror-gutter-elt")) - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW - display.lineGutter.style.width = "" - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1 - display.lineNumWidth = display.lineNumInnerWidth + padding - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1 - display.lineGutter.style.width = display.lineNumWidth + "px" - updateGutterSpace(cm) - return true + signal(cm, "blur", cm, e); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); } - return false + clearInterval(cm.display.blinker); + setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150); } // Read the actual heights of the rendered lines, and update their // stored heights to match. function updateHeightsInViewport(cm) { - var display = cm.display - var prevBottom = display.lineDiv.offsetTop + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; for (var i = 0; i < display.view.length; i++) { - var cur = display.view[i], height = (void 0) + var cur = display.view[i], height = (void 0); if (cur.hidden) { continue } if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight - height = bot - prevBottom - prevBottom = bot + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; } else { - var box = cur.node.getBoundingClientRect() - height = box.bottom - box.top - } - var diff = cur.line.height - height - if (height < 2) { height = textHeight(display) } - if (diff > .001 || diff < -.001) { - updateLineHeight(cur.line, height) - updateWidgetHeight(cur.line) + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + } + var diff = cur.line.height - height; + if (height < 2) { height = textHeight(display); } + if (diff > .005 || diff < -.005) { + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) - { updateWidgetHeight(cur.rest[j]) } } + { updateWidgetHeight(cur.rest[j]); } } } } } @@ -10731,174 +10908,258 @@ function updateHeightsInViewport(cm) { // Read and store the height of line widgets associated with the // given line. function updateWidgetHeight(line) { - if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) - { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } } + if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { + var w = line.widgets[i], parent = w.node.parentNode; + if (parent) { w.height = parent.offsetHeight; } + } } } // Compute the lines that are visible in a given viewport (defaults // the the current scroll position). viewport may contain top, // height, and ensure (see op.scrollToPos) properties. function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop - top = Math.floor(top - paddingTop(display)) - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; - var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom) + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); // Ensure is a {from: {line, ch}, to: {line, ch}} object, and // forces those lines into the viewport (if possible). if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; if (ensureFrom < from) { - from = ensureFrom - to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight) + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); } else if (Math.min(ensureTo, doc.lastLine()) >= to) { - from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight) - to = ensureTo + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; } } return {from: from, to: Math.max(to, from + 1)} } -// Sync the scrollable area and scrollbars, ensure the viewport -// covers the visible area. -function setScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) { return } - cm.doc.scrollTop = val - if (!gecko) { updateDisplaySimple(cm, {top: val}) } - if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val } - cm.display.scrollbars.setScrollTop(val) - if (gecko) { updateDisplaySimple(cm) } - startWorker(cm, 100) +// Re-align line numbers and gutter marks to compensate for +// horizontal scrolling. +function alignHorizontally(cm) { + var display = cm.display, view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, left = comp + "px"; + for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { + if (cm.options.fixedGutter) { + if (view[i].gutter) + { view[i].gutter.style.left = left; } + if (view[i].gutterBackground) + { view[i].gutterBackground.style.left = left; } + } + var align = view[i].alignable; + if (align) { for (var j = 0; j < align.length; j++) + { align[j].style.left = left; } } + } } + if (cm.options.fixedGutter) + { display.gutters.style.left = (comp + gutterW) + "px"; } } -// Sync scroller and scrollbar, ensure the gutter elements are -// aligned. -function setScrollLeft(cm, val, isScroller) { - if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) { return } - val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth) - cm.doc.scrollLeft = val - alignHorizontally(cm) - if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val } - cm.display.scrollbars.setScrollLeft(val) + +// Used to ensure that the line number gutter is still the right +// size for the current document size. Returns true when an update +// is needed. +function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) { return false } + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm); + return true + } + return false } -// Since the delta values reported on mouse wheel events are -// unstandardized between browsers and even browser versions, and -// generally horribly unpredictable, this code starts by measuring -// the scroll effect that the first few mouse wheel events have, -// and, from that, detects the way it can convert deltas to pixel -// offsets afterwards. -// -// The reason we want to know the amount a wheel event will scroll -// is that it gives us a chance to update the display before the -// actual scrolling happens, reducing flickering. +// SCROLLING THINGS INTO VIEW -var wheelSamples = 0; -var wheelPixelsPerUnit = null; -// Fill in a browser-detected starting value on browsers where we -// know one. These don't have to be accurate -- the result of them -// being wrong would just be a slight flicker on the first wheel -// scroll (if it is large enough). -if (ie) { wheelPixelsPerUnit = -.53 } -else if (gecko) { wheelPixelsPerUnit = 15 } -else if (chrome) { wheelPixelsPerUnit = -.7 } -else if (safari) { wheelPixelsPerUnit = -1/3 } +// If an editor sits on the top or bottom of the window, partially +// scrolled out of view, this ensures that the cursor is visible. +function maybeScrollWindow(cm, rect) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } -function wheelEventDelta(e) { - var dx = e.wheelDeltaX, dy = e.wheelDeltaY - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail } - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail } - else if (dy == null) { dy = e.wheelDelta } - return {x: dx, y: dy} -} -function wheelEventPixels(e) { - var delta = wheelEventDelta(e) - delta.x *= wheelPixelsPerUnit - delta.y *= wheelPixelsPerUnit - return delta + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; + if (rect.top + box.top < 0) { doScroll = true; } + else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; } + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } } -function onScrollWheel(cm, e) { - var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y - - var display = cm.display, scroll = display.scroller - // Quit if there's nothing to scroll here - var canScrollX = scroll.scrollWidth > scroll.clientWidth - var canScrollY = scroll.scrollHeight > scroll.clientHeight - if (!(dx && canScrollX || dy && canScrollY)) { return } - - // Webkit browsers on OS X abort momentum scrolls when the target - // of the scroll event is removed from the scrollable element. - // This hack (see related code in patchDisplay) makes sure the - // element is kept around. - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i = 0; i < view.length; i++) { - if (view[i].node == cur) { - cm.display.currentWheelTarget = cur - break outer - } - } +// Scroll a given position into view (immediately), verifying that +// it actually became visible (as line heights are accurately +// measured, the position of something may 'drift' during drawing). +function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) { margin = 0; } + var rect; + if (!cm.options.lineWrapping && pos == end) { + // Set pos and end to the cursor positions around the character pos sticks to + // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch + // If pos == Pos(_, 0, "before"), pos and end are unchanged + pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; + end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; + } + for (var limit = 0; limit < 5; limit++) { + var changed = false; + var coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + rect = {left: Math.min(coords.left, endCoords.left), + top: Math.min(coords.top, endCoords.top) - margin, + right: Math.max(coords.left, endCoords.left), + bottom: Math.max(coords.bottom, endCoords.bottom) + margin}; + var scrollPos = calculateScrollPos(cm, rect); + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; } } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; } + } + if (!changed) { break } } + return rect +} - // On some browsers, horizontal scrolling will cause redraws to - // happen before the gutter has been realigned, causing it to - // wriggle around in a most unseemly way. When we have an - // estimated pixels/delta value, we just handle horizontal - // scrolling entirely here. It'll be slightly off from native, but - // better than glitching out. - if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { - if (dy && canScrollY) - { setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))) } - setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))) - // Only prevent default scrolling if vertical scrolling is - // actually possible. Otherwise, it causes vertical scroll - // jitter on OSX trackpads when deltaX is small and deltaY - // is large (issue #3579) - if (!dy || (dy && canScrollY)) - { e_preventDefault(e) } - display.wheelStartX = null // Abort measurement, if in progress - return - } +// Scroll a given set of coordinates into view (immediately). +function scrollIntoView(cm, rect) { + var scrollPos = calculateScrollPos(cm, rect); + if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); } + if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); } +} - // 'Project' the visible viewport to cover the area that is being - // scrolled into view (if we know enough to estimate it). - if (dy && wheelPixelsPerUnit != null) { - var pixels = dy * wheelPixelsPerUnit - var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight - if (pixels < 0) { top = Math.max(0, top + pixels - 50) } - else { bot = Math.min(cm.doc.height, bot + pixels + 50) } - updateDisplaySimple(cm, {top: top, bottom: bot}) - } +// Calculate a new scroll position needed to scroll the given +// rectangle into view. Returns an object with scrollTop and +// scrollLeft properties. When these are undefined, the +// vertical/horizontal position does not need to be adjusted. +function calculateScrollPos(cm, rect) { + var display = cm.display, snapMargin = textHeight(cm.display); + if (rect.top < 0) { rect.top = 0; } + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), result = {}; + if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; } + var docBottom = cm.doc.height + paddingVert(display); + var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin; + if (rect.top < screentop) { + result.scrollTop = atTop ? 0 : rect.top; + } else if (rect.bottom > screentop + screen) { + var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); + if (newTop != screentop) { result.scrollTop = newTop; } + } + + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); + var tooWide = rect.right - rect.left > screenw; + if (tooWide) { rect.right = rect.left + screenw; } + if (rect.left < 10) + { result.scrollLeft = 0; } + else if (rect.left < screenleft) + { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); } + else if (rect.right > screenw + screenleft - 3) + { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; } + return result +} - if (wheelSamples < 20) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop - display.wheelDX = dx; display.wheelDY = dy - setTimeout(function () { - if (display.wheelStartX == null) { return } - var movedX = scroll.scrollLeft - display.wheelStartX - var movedY = scroll.scrollTop - display.wheelStartY - var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || - (movedX && display.wheelDX && movedX / display.wheelDX) - display.wheelStartX = display.wheelStartY = null - if (!sample) { return } - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1) - ++wheelSamples - }, 200) - } else { - display.wheelDX += dx; display.wheelDY += dy - } +// Store a relative adjustment to the scroll position in the current +// operation (to be applied when the operation finishes). +function addToScrollTop(cm, top) { + if (top == null) { return } + resolveScrollToPos(cm); + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; +} + +// Make sure that at the end of the operation the current cursor is +// shown. +function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(); + cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}; +} + +function scrollToCoords(cm, x, y) { + if (x != null || y != null) { resolveScrollToPos(cm); } + if (x != null) { cm.curOp.scrollLeft = x; } + if (y != null) { cm.curOp.scrollTop = y; } +} + +function scrollToRange(cm, range$$1) { + resolveScrollToPos(cm); + cm.curOp.scrollToPos = range$$1; +} + +// When an operation has its scrollToPos property set, and another +// scroll action is applied before the end of the operation, this +// 'simulates' scrolling that position into view in a cheap way, so +// that the effect of intermediate scroll commands is not ignored. +function resolveScrollToPos(cm) { + var range$$1 = cm.curOp.scrollToPos; + if (range$$1) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to); + scrollToCoordsRange(cm, from, to, range$$1.margin); } } +function scrollToCoordsRange(cm, from, to, margin) { + var sPos = calculateScrollPos(cm, { + left: Math.min(from.left, to.left), + top: Math.min(from.top, to.top) - margin, + right: Math.max(from.right, to.right), + bottom: Math.max(from.bottom, to.bottom) + margin + }); + scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); +} + +// Sync the scrollable area and scrollbars, ensure the viewport +// covers the visible area. +function updateScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) { return } + if (!gecko) { updateDisplaySimple(cm, {top: val}); } + setScrollTop(cm, val, true); + if (gecko) { updateDisplaySimple(cm); } + startWorker(cm, 100); +} + +function setScrollTop(cm, val, forceScroll) { + val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val); + if (cm.display.scroller.scrollTop == val && !forceScroll) { return } + cm.doc.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; } +} + +// Sync scroller and scrollbar, ensure the gutter elements are +// aligned. +function setScrollLeft(cm, val, isScroller, forceScroll) { + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; } + cm.display.scrollbars.setScrollLeft(val); +} + // SCROLLBARS // Prepare DOM reads needed to update the scrollbars. Done in one // shot to minimize update/measure roundtrips. function measureForScrollbars(cm) { - var d = cm.display, gutterW = d.gutters.offsetWidth - var docH = Math.round(cm.doc.height + paddingVert(cm.display)) + var d = cm.display, gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); return { clientHeight: d.scroller.clientHeight, viewHeight: d.wrapper.clientHeight, @@ -10913,99 +11174,101 @@ function measureForScrollbars(cm) { } var NativeScrollbars = function(place, scroll, cm) { - this.cm = cm - var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar") - var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar") - place(vert); place(horiz) + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + vert.tabIndex = horiz.tabIndex = -1; + place(vert); place(horiz); on(vert, "scroll", function () { - if (vert.clientHeight) { scroll(vert.scrollTop, "vertical") } - }) + if (vert.clientHeight) { scroll(vert.scrollTop, "vertical"); } + }); on(horiz, "scroll", function () { - if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal") } - }) + if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal"); } + }); - this.checkedZeroWidth = false + this.checkedZeroWidth = false; // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" } + if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; } }; NativeScrollbars.prototype.update = function (measure) { - var needsH = measure.scrollWidth > measure.clientWidth + 1 - var needsV = measure.scrollHeight > measure.clientHeight + 1 - var sWidth = measure.nativeBarWidth + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; if (needsV) { - this.vert.style.display = "block" - this.vert.style.bottom = needsH ? sWidth + "px" : "0" - var totalHeight = measure.viewHeight - (needsH ? sWidth : 0) + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); // A bug in IE8 can cause this value to be negative, so guard it. this.vert.firstChild.style.height = - Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px" + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; } else { - this.vert.style.display = "" - this.vert.firstChild.style.height = "0" + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; } if (needsH) { - this.horiz.style.display = "block" - this.horiz.style.right = needsV ? sWidth + "px" : "0" - this.horiz.style.left = measure.barLeft + "px" - var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0) + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); this.horiz.firstChild.style.width = - (measure.scrollWidth - measure.clientWidth + totalWidth) + "px" + Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; } else { - this.horiz.style.display = "" - this.horiz.firstChild.style.width = "0" + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; } if (!this.checkedZeroWidth && measure.clientHeight > 0) { - if (sWidth == 0) { this.zeroWidthHack() } - this.checkedZeroWidth = true + if (sWidth == 0) { this.zeroWidthHack(); } + this.checkedZeroWidth = true; } return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0} }; NativeScrollbars.prototype.setScrollLeft = function (pos) { - if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos } - if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz) } + if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; } + if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); } }; NativeScrollbars.prototype.setScrollTop = function (pos) { - if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos } - if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert) } + if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; } + if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); } }; NativeScrollbars.prototype.zeroWidthHack = function () { - var w = mac && !mac_geMountainLion ? "12px" : "18px" - this.horiz.style.height = this.vert.style.width = w - this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none" - this.disableHoriz = new Delayed - this.disableVert = new Delayed + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.height = this.vert.style.width = w; + this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; + this.disableHoriz = new Delayed; + this.disableVert = new Delayed; }; -NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay) { - bar.style.pointerEvents = "auto" +NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { + bar.style.pointerEvents = "auto"; function maybeDisable() { // To find out whether the scrollbar is still visible, we // check whether the element under the pixel in the bottom - // left corner of the scrollbar box is the scrollbar box + // right corner of the scrollbar box is the scrollbar box // itself (when the bar is still visible) or its filler child // (when the bar is hidden). If it is still visible, we keep // it enabled, if it's hidden, we disable pointer events. - var box = bar.getBoundingClientRect() - var elt = document.elementFromPoint(box.left + 1, box.bottom - 1) - if (elt != bar) { bar.style.pointerEvents = "none" } - else { delay.set(1000, maybeDisable) } + var box = bar.getBoundingClientRect(); + var elt$$1 = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) + : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); + if (elt$$1 != bar) { bar.style.pointerEvents = "none"; } + else { delay.set(1000, maybeDisable); } } - delay.set(1000, maybeDisable) + delay.set(1000, maybeDisable); }; NativeScrollbars.prototype.clear = function () { - var parent = this.horiz.parentNode - parent.removeChild(this.horiz) - parent.removeChild(this.vert) + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); }; var NullScrollbars = function () {}; @@ -11016,185 +11279,61 @@ NullScrollbars.prototype.setScrollTop = function () {}; NullScrollbars.prototype.clear = function () {}; function updateScrollbars(cm, measure) { - if (!measure) { measure = measureForScrollbars(cm) } - var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight - updateScrollbarsInner(cm, measure) + if (!measure) { measure = measureForScrollbars(cm); } + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { if (startWidth != cm.display.barWidth && cm.options.lineWrapping) - { updateHeightsInViewport(cm) } - updateScrollbarsInner(cm, measureForScrollbars(cm)) - startWidth = cm.display.barWidth; startHeight = cm.display.barHeight + { updateHeightsInViewport(cm); } + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; } } // Re-synchronize the fake scrollbars with the actual size of the // content. function updateScrollbarsInner(cm, measure) { - var d = cm.display - var sizes = d.scrollbars.update(measure) + var d = cm.display; + var sizes = d.scrollbars.update(measure); - d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px" - d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px" - d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent" + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; if (sizes.right && sizes.bottom) { - d.scrollbarFiller.style.display = "block" - d.scrollbarFiller.style.height = sizes.bottom + "px" - d.scrollbarFiller.style.width = sizes.right + "px" - } else { d.scrollbarFiller.style.display = "" } + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else { d.scrollbarFiller.style.display = ""; } if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block" - d.gutterFiller.style.height = sizes.bottom + "px" - d.gutterFiller.style.width = measure.gutterWidth + "px" - } else { d.gutterFiller.style.display = "" } + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else { d.gutterFiller.style.display = ""; } } -var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars} +var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; function initScrollbars(cm) { if (cm.display.scrollbars) { - cm.display.scrollbars.clear() + cm.display.scrollbars.clear(); if (cm.display.scrollbars.addClass) - { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) } + { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); } } cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { - cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller) + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); // Prevent clicks in the scrollbars from killing focus on(node, "mousedown", function () { - if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) } - }) - node.setAttribute("cm-not-content", "true") + if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); } + }); + node.setAttribute("cm-not-content", "true"); }, function (pos, axis) { - if (axis == "horizontal") { setScrollLeft(cm, pos) } - else { setScrollTop(cm, pos) } - }, cm) + if (axis == "horizontal") { setScrollLeft(cm, pos); } + else { updateScrollTop(cm, pos); } + }, cm); if (cm.display.scrollbars.addClass) - { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) } -} - -// SCROLLING THINGS INTO VIEW - -// If an editor sits on the top or bottom of the window, partially -// scrolled out of view, this ensures that the cursor is visible. -function maybeScrollWindow(cm, coords) { - if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } - - var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null - if (coords.top + box.top < 0) { doScroll = true } - else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false } - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (coords.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (coords.left) + "px; width: 2px;")) - cm.display.lineSpace.appendChild(scrollNode) - scrollNode.scrollIntoView(doScroll) - cm.display.lineSpace.removeChild(scrollNode) - } -} - -// Scroll a given position into view (immediately), verifying that -// it actually became visible (as line heights are accurately -// measured, the position of something may 'drift' during drawing). -function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) { margin = 0 } - var coords - for (var limit = 0; limit < 5; limit++) { - var changed = false - coords = cursorCoords(cm, pos) - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end) - var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), - Math.min(coords.top, endCoords.top) - margin, - Math.max(coords.left, endCoords.left), - Math.max(coords.bottom, endCoords.bottom) + margin) - var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft - if (scrollPos.scrollTop != null) { - setScrollTop(cm, scrollPos.scrollTop) - if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true } - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft) - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true } - } - if (!changed) { break } - } - return coords -} - -// Scroll a given set of coordinates into view (immediately). -function scrollIntoView(cm, x1, y1, x2, y2) { - var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2) - if (scrollPos.scrollTop != null) { setScrollTop(cm, scrollPos.scrollTop) } - if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) } -} - -// Calculate a new scroll position needed to scroll the given -// rectangle into view. Returns an object with scrollTop and -// scrollLeft properties. When these are undefined, the -// vertical/horizontal position does not need to be adjusted. -function calculateScrollPos(cm, x1, y1, x2, y2) { - var display = cm.display, snapMargin = textHeight(cm.display) - if (y1 < 0) { y1 = 0 } - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop - var screen = displayHeight(cm), result = {} - if (y2 - y1 > screen) { y2 = y1 + screen } - var docBottom = cm.doc.height + paddingVert(display) - var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin - if (y1 < screentop) { - result.scrollTop = atTop ? 0 : y1 - } else if (y2 > screentop + screen) { - var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen) - if (newTop != screentop) { result.scrollTop = newTop } - } - - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0) - var tooWide = x2 - x1 > screenw - if (tooWide) { x2 = x1 + screenw } - if (x1 < 10) - { result.scrollLeft = 0 } - else if (x1 < screenleft) - { result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)) } - else if (x2 > screenw + screenleft - 3) - { result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw } - return result -} - -// Store a relative adjustment to the scroll position in the current -// operation (to be applied when the operation finishes). -function addToScrollPos(cm, left, top) { - if (left != null || top != null) { resolveScrollToPos(cm) } - if (left != null) - { cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left } - if (top != null) - { cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top } -} - -// Make sure that at the end of the operation the current cursor is -// shown. -function ensureCursorVisible(cm) { - resolveScrollToPos(cm) - var cur = cm.getCursor(), from = cur, to = cur - if (!cm.options.lineWrapping) { - from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur - to = Pos(cur.line, cur.ch + 1) - } - cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true} -} - -// When an operation has its scrollToPos property set, and another -// scroll action is applied before the end of the operation, this -// 'simulates' scrolling that position into view in a cheap way, so -// that the effect of intermediate scroll commands is not ignored. -function resolveScrollToPos(cm) { - var range = cm.curOp.scrollToPos - if (range) { - cm.curOp.scrollToPos = null - var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to) - var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), - Math.min(from.top, to.top) - range.margin, - Math.max(from.right, to.right), - Math.max(from.bottom, to.bottom) + range.margin) - cm.scrollTo(sPos.scrollLeft, sPos.scrollTop) - } + { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); } } // Operations are used to wrap a series of changes to the editor @@ -11203,7 +11342,7 @@ function resolveScrollToPos(cm) { // error-prone). Instead, display updates are batched and then all // combined and executed at once. -var nextOpId = 0 +var nextOpId = 0; // Start a new operation. function startOperation(cm) { cm.curOp = { @@ -11222,159 +11361,151 @@ function startOperation(cm) { scrollToPos: null, // Used to scroll to a specific position focus: false, id: ++nextOpId // Unique ID - } - pushOperation(cm.curOp) + }; + pushOperation(cm.curOp); } // Finish an operation, updating the display and signalling delayed events function endOperation(cm) { - var op = cm.curOp + var op = cm.curOp; finishOperation(op, function (group) { for (var i = 0; i < group.ops.length; i++) - { group.ops[i].cm.curOp = null } - endOperations(group) - }) + { group.ops[i].cm.curOp = null; } + endOperations(group); + }); } // The DOM updates done when an operation finishes are batched so // that the minimum number of relayouts are required. function endOperations(group) { - var ops = group.ops + var ops = group.ops; for (var i = 0; i < ops.length; i++) // Read DOM - { endOperation_R1(ops[i]) } + { endOperation_R1(ops[i]); } for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) - { endOperation_W1(ops[i$1]) } + { endOperation_W1(ops[i$1]); } for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM - { endOperation_R2(ops[i$2]) } + { endOperation_R2(ops[i$2]); } for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) - { endOperation_W2(ops[i$3]) } + { endOperation_W2(ops[i$3]); } for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM - { endOperation_finish(ops[i$4]) } + { endOperation_finish(ops[i$4]); } } function endOperation_R1(op) { - var cm = op.cm, display = cm.display - maybeClipScrollbars(cm) - if (op.updateMaxLine) { findMaxLine(cm) } + var cm = op.cm, display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) { findMaxLine(cm); } op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || op.scrollToPos.to.line >= display.viewTo) || - display.maxLineChanged && cm.options.lineWrapping + display.maxLineChanged && cm.options.lineWrapping; op.update = op.mustUpdate && - new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate) + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); } function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update) + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); } function endOperation_R2(op) { - var cm = op.cm, display = cm.display - if (op.updatedDisplay) { updateHeightsInViewport(cm) } + var cm = op.cm, display = cm.display; + if (op.updatedDisplay) { updateHeightsInViewport(cm); } - op.barMeasure = measureForScrollbars(cm) + op.barMeasure = measureForScrollbars(cm); // If the max line changed since it was last measured, measure it, // and ensure the document's width matches it. // updateDisplay_W2 will use these properties to do the actual resizing if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3 - cm.display.sizerWidth = op.adjustWidthTo + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; op.barMeasure.scrollWidth = - Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth) - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)) + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); } if (op.updatedDisplay || op.selectionChanged) - { op.preparedSelection = display.input.prepareSelection(op.focus) } + { op.preparedSelection = display.input.prepareSelection(); } } function endOperation_W2(op) { - var cm = op.cm + var cm = op.cm; if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px" + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; if (op.maxScrollLeft < cm.doc.scrollLeft) - { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) } - cm.display.maxLineChanged = false + { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); } + cm.display.maxLineChanged = false; } - var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus()) + var takeFocus = op.focus && op.focus == activeElt(); if (op.preparedSelection) - { cm.display.input.showSelection(op.preparedSelection, takeFocus) } + { cm.display.input.showSelection(op.preparedSelection, takeFocus); } if (op.updatedDisplay || op.startHeight != cm.doc.height) - { updateScrollbars(cm, op.barMeasure) } + { updateScrollbars(cm, op.barMeasure); } if (op.updatedDisplay) - { setDocumentHeight(cm, op.barMeasure) } + { setDocumentHeight(cm, op.barMeasure); } - if (op.selectionChanged) { restartBlink(cm) } + if (op.selectionChanged) { restartBlink(cm); } if (cm.state.focused && op.updateInput) - { cm.display.input.reset(op.typing) } - if (takeFocus) { ensureFocus(op.cm) } + { cm.display.input.reset(op.typing); } + if (takeFocus) { ensureFocus(op.cm); } } function endOperation_finish(op) { - var cm = op.cm, display = cm.display, doc = cm.doc + var cm = op.cm, display = cm.display, doc = cm.doc; - if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) } + if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); } // Abort mouse wheel delta measurement, when scrolling explicitly if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) - { display.wheelStartX = display.wheelStartY = null } + { display.wheelStartX = display.wheelStartY = null; } // Propagate the scroll position to the actual DOM scroller - if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { - doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)) - display.scrollbars.setScrollTop(doc.scrollTop) - display.scroller.scrollTop = doc.scrollTop - } - if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { - doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft)) - display.scrollbars.setScrollLeft(doc.scrollLeft) - display.scroller.scrollLeft = doc.scrollLeft - alignHorizontally(cm) - } + if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); } + + if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); } // If we need to scroll a specific position into view, do so. if (op.scrollToPos) { - var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), - clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin) - if (op.scrollToPos.isCursor && cm.state.focused) { maybeScrollWindow(cm, coords) } + var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + maybeScrollWindow(cm, rect); } // Fire events for markers that are hidden/unidden by editing or // undoing - var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; if (hidden) { for (var i = 0; i < hidden.length; ++i) - { if (!hidden[i].lines.length) { signal(hidden[i], "hide") } } } + { if (!hidden[i].lines.length) { signal(hidden[i], "hide"); } } } if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1) - { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide") } } } + { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide"); } } } if (display.wrapper.offsetHeight) - { doc.scrollTop = cm.display.scroller.scrollTop } + { doc.scrollTop = cm.display.scroller.scrollTop; } // Fire change events, and delayed event handlers if (op.changeObjs) - { signal(cm, "changes", cm, op.changeObjs) } + { signal(cm, "changes", cm, op.changeObjs); } if (op.update) - { op.update.finish() } + { op.update.finish(); } } // Run the given function in an operation function runInOp(cm, f) { if (cm.curOp) { return f() } - startOperation(cm) + startOperation(cm); try { return f() } - finally { endOperation(cm) } + finally { endOperation(cm); } } // Wraps a function in an operation. Returns the wrapped function. function operation(cm, f) { return function() { if (cm.curOp) { return f.apply(cm, arguments) } - startOperation(cm) + startOperation(cm); try { return f.apply(cm, arguments) } - finally { endOperation(cm) } + finally { endOperation(cm); } } } // Used to add methods to editor and doc instances, wrapping them in @@ -11382,18 +11513,18 @@ function operation(cm, f) { function methodOp(f) { return function() { if (this.curOp) { return f.apply(this, arguments) } - startOperation(this) + startOperation(this); try { return f.apply(this, arguments) } - finally { endOperation(this) } + finally { endOperation(this); } } } function docMethodOp(f) { return function() { - var cm = this.cm + var cm = this.cm; if (!cm || cm.curOp) { return f.apply(this, arguments) } - startOperation(cm) + startOperation(cm); try { return f.apply(this, arguments) } - finally { endOperation(cm) } + finally { endOperation(cm); } } } @@ -11404,111 +11535,111 @@ function docMethodOp(f) { // lines are divided into visual lines. regLineChange (below) // registers single-line changes. function regChange(cm, from, to, lendiff) { - if (from == null) { from = cm.doc.first } - if (to == null) { to = cm.doc.first + cm.doc.size } - if (!lendiff) { lendiff = 0 } + if (from == null) { from = cm.doc.first; } + if (to == null) { to = cm.doc.first + cm.doc.size; } + if (!lendiff) { lendiff = 0; } - var display = cm.display + var display = cm.display; if (lendiff && to < display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers > from)) - { display.updateLineNumbers = from } + { display.updateLineNumbers = from; } - cm.curOp.viewChanged = true + cm.curOp.viewChanged = true; if (from >= display.viewTo) { // Change after if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) - { resetView(cm) } + { resetView(cm); } } else if (to <= display.viewFrom) { // Change before if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm) + resetView(cm); } else { - display.viewFrom += lendiff - display.viewTo += lendiff + display.viewFrom += lendiff; + display.viewTo += lendiff; } } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap - resetView(cm) + resetView(cm); } else if (from <= display.viewFrom) { // Top overlap - var cut = viewCuttingPoint(cm, to, to + lendiff, 1) + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); if (cut) { - display.view = display.view.slice(cut.index) - display.viewFrom = cut.lineN - display.viewTo += lendiff + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; } else { - resetView(cm) + resetView(cm); } } else if (to >= display.viewTo) { // Bottom overlap - var cut$1 = viewCuttingPoint(cm, from, from, -1) + var cut$1 = viewCuttingPoint(cm, from, from, -1); if (cut$1) { - display.view = display.view.slice(0, cut$1.index) - display.viewTo = cut$1.lineN + display.view = display.view.slice(0, cut$1.index); + display.viewTo = cut$1.lineN; } else { - resetView(cm) + resetView(cm); } } else { // Gap in the middle - var cutTop = viewCuttingPoint(cm, from, from, -1) - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1) + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); if (cutTop && cutBot) { display.view = display.view.slice(0, cutTop.index) .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) - .concat(display.view.slice(cutBot.index)) - display.viewTo += lendiff + .concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; } else { - resetView(cm) + resetView(cm); } } - var ext = display.externalMeasured + var ext = display.externalMeasured; if (ext) { if (to < ext.lineN) - { ext.lineN += lendiff } + { ext.lineN += lendiff; } else if (from < ext.lineN + ext.size) - { display.externalMeasured = null } + { display.externalMeasured = null; } } } // Register a change to a single line. Type must be one of "text", // "gutter", "class", "widget" function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true - var display = cm.display, ext = cm.display.externalMeasured + cm.curOp.viewChanged = true; + var display = cm.display, ext = cm.display.externalMeasured; if (ext && line >= ext.lineN && line < ext.lineN + ext.size) - { display.externalMeasured = null } + { display.externalMeasured = null; } if (line < display.viewFrom || line >= display.viewTo) { return } - var lineView = display.view[findViewIndex(cm, line)] + var lineView = display.view[findViewIndex(cm, line)]; if (lineView.node == null) { return } - var arr = lineView.changes || (lineView.changes = []) - if (indexOf(arr, type) == -1) { arr.push(type) } + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) { arr.push(type); } } // Clear the view. function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first - cm.display.view = [] - cm.display.viewOffset = 0 + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; } function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), diff, view = cm.display.view + var index = findViewIndex(cm, oldN), diff, view = cm.display.view; if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) { return {index: index, lineN: newN} } - var n = cm.display.viewFrom + var n = cm.display.viewFrom; for (var i = 0; i < index; i++) - { n += view[i].size } + { n += view[i].size; } if (n != oldN) { if (dir > 0) { if (index == view.length - 1) { return null } - diff = (n + view[index].size) - oldN - index++ + diff = (n + view[index].size) - oldN; + index++; } else { - diff = n - oldN + diff = n - oldN; } - oldN += diff; newN += diff + oldN += diff; newN += diff; } while (visualLineNo(cm.doc, newN) != newN) { if (index == (dir < 0 ? 0 : view.length - 1)) { return null } - newN += dir * view[index - (dir < 0 ? 1 : 0)].size - index += dir + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; } return {index: index, lineN: newN} } @@ -11516,31 +11647,31 @@ function viewCuttingPoint(cm, oldN, newN, dir) { // Force the view to cover a given range, adding empty view element // or clipping off existing ones as needed. function adjustView(cm, from, to) { - var display = cm.display, view = display.view + var display = cm.display, view = display.view; if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to) - display.viewFrom = from + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; } else { if (display.viewFrom > from) - { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) } + { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); } else if (display.viewFrom < from) - { display.view = display.view.slice(findViewIndex(cm, from)) } - display.viewFrom = from + { display.view = display.view.slice(findViewIndex(cm, from)); } + display.viewFrom = from; if (display.viewTo < to) - { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) } + { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); } else if (display.viewTo > to) - { display.view = display.view.slice(0, findViewIndex(cm, to)) } + { display.view = display.view.slice(0, findViewIndex(cm, to)); } } - display.viewTo = to + display.viewTo = to; } // Count the number of lines in the view whose DOM representation is // out of date (or nonexistent). function countDirtyView(cm) { - var view = cm.display.view, dirty = 0 + var view = cm.display.view, dirty = 0; for (var i = 0; i < view.length; i++) { - var lineView = view[i] - if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty } + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; } } return dirty } @@ -11548,84 +11679,118 @@ function countDirtyView(cm) { // HIGHLIGHT WORKER function startWorker(cm, time) { - if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) - { cm.state.highlight.set(time, bind(highlightWorker, cm)) } + if (cm.doc.highlightFrontier < cm.display.viewTo) + { cm.state.highlight.set(time, bind(highlightWorker, cm)); } } function highlightWorker(cm) { - var doc = cm.doc - if (doc.frontier < doc.first) { doc.frontier = doc.first } - if (doc.frontier >= cm.display.viewTo) { return } - var end = +new Date + cm.options.workTime - var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)) - var changedLines = [] - - doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { - if (doc.frontier >= cm.display.viewFrom) { // Visible - var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength - var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true) - line.styles = highlighted.styles - var oldCls = line.styleClasses, newCls = highlighted.classes - if (newCls) { line.styleClasses = newCls } - else if (oldCls) { line.styleClasses = null } + var doc = cm.doc; + if (doc.highlightFrontier >= cm.display.viewTo) { return } + var end = +new Date + cm.options.workTime; + var context = getContextBefore(cm, doc.highlightFrontier); + var changedLines = []; + + doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { + if (context.line >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles; + var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; + var highlighted = highlightLine(cm, line, context, true); + if (resetState) { context.state = resetState; } + line.styles = highlighted.styles; + var oldCls = line.styleClasses, newCls = highlighted.classes; + if (newCls) { line.styleClasses = newCls; } + else if (oldCls) { line.styleClasses = null; } var ischange = !oldStyles || oldStyles.length != line.styles.length || - oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass) - for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] } - if (ischange) { changedLines.push(doc.frontier) } - line.stateAfter = tooLong ? state : copyState(doc.mode, state) + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; } + if (ischange) { changedLines.push(context.line); } + line.stateAfter = context.save(); + context.nextLine(); } else { if (line.text.length <= cm.options.maxHighlightLength) - { processLine(cm, line.text, state) } - line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null + { processLine(cm, line.text, context); } + line.stateAfter = context.line % 5 == 0 ? context.save() : null; + context.nextLine(); } - ++doc.frontier if (+new Date > end) { - startWorker(cm, cm.options.workDelay) + startWorker(cm, cm.options.workDelay); return true } - }) + }); + doc.highlightFrontier = context.line; + doc.modeFrontier = Math.max(doc.modeFrontier, context.line); if (changedLines.length) { runInOp(cm, function () { for (var i = 0; i < changedLines.length; i++) - { regLineChange(cm, changedLines[i], "text") } - }) } + { regLineChange(cm, changedLines[i], "text"); } + }); } } // DISPLAY DRAWING var DisplayUpdate = function(cm, viewport, force) { - var display = cm.display + var display = cm.display; - this.viewport = viewport + this.viewport = viewport; // Store some values that we'll need later (but don't want to force a relayout for) - this.visible = visibleLines(display, cm.doc, viewport) - this.editorIsHidden = !display.wrapper.offsetWidth - this.wrapperHeight = display.wrapper.clientHeight - this.wrapperWidth = display.wrapper.clientWidth - this.oldDisplayWidth = displayWidth(cm) - this.force = force - this.dims = getDimensions(cm) - this.events = [] + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; }; DisplayUpdate.prototype.signal = function (emitter, type) { if (hasHandler(emitter, type)) - { this.events.push(arguments) } + { this.events.push(arguments); } }; DisplayUpdate.prototype.finish = function () { var this$1 = this; for (var i = 0; i < this.events.length; i++) - { signal.apply(null, this$1.events[i]) } + { signal.apply(null, this$1.events[i]); } }; function maybeClipScrollbars(cm) { - var display = cm.display + var display = cm.display; if (!display.scrollbarsClipped && display.scroller.offsetWidth) { - display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth - display.heightForcer.style.height = scrollGap(cm) + "px" - display.sizer.style.marginBottom = -display.nativeBarWidth + "px" - display.sizer.style.borderRightWidth = scrollGap(cm) + "px" - display.scrollbarsClipped = true + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } +} + +function selectionSnapshot(cm) { + if (cm.hasFocus()) { return null } + var active = activeElt(); + if (!active || !contains(cm.display.lineDiv, active)) { return null } + var result = {activeElt: active}; + if (window.getSelection) { + var sel = window.getSelection(); + if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { + result.anchorNode = sel.anchorNode; + result.anchorOffset = sel.anchorOffset; + result.focusNode = sel.focusNode; + result.focusOffset = sel.focusOffset; + } + } + return result +} + +function restoreSelection(snapshot) { + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return } + snapshot.activeElt.focus(); + if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { + var sel = window.getSelection(), range$$1 = document.createRange(); + range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset); + range$$1.collapse(false); + sel.removeAllRanges(); + sel.addRange(range$$1); + sel.extend(snapshot.focusNode, snapshot.focusOffset); } } @@ -11633,10 +11798,10 @@ function maybeClipScrollbars(cm) { // (returning false) when there is nothing to be done and forced is // false. function updateDisplayIfNeeded(cm, update) { - var display = cm.display, doc = cm.doc + var display = cm.display, doc = cm.doc; if (update.editorIsHidden) { - resetView(cm) + resetView(cm); return false } @@ -11648,101 +11813,102 @@ function updateDisplayIfNeeded(cm, update) { { return false } if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm) - update.dims = getDimensions(cm) + resetView(cm); + update.dims = getDimensions(cm); } // Compute a suitable new viewport (from & to) - var end = doc.first + doc.size - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first) - var to = Math.min(end, update.visible.to + cm.options.viewportMargin) - if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) } - if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) } + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); } + if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); } if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from) - to = visualLineEndNo(cm.doc, to) + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); } var different = from != display.viewFrom || to != display.viewTo || - display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth - adjustView(cm, from, to) + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)) + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); // Position the mover div to align with the current scroll position - cm.display.mover.style.top = display.viewOffset + "px" + cm.display.mover.style.top = display.viewOffset + "px"; - var toUpdate = countDirtyView(cm) + var toUpdate = countDirtyView(cm); if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) { return false } // For big changes, we hide the enclosing element during the // update, since that speeds up the operations on most browsers. - var focused = activeElt() - if (toUpdate > 4) { display.lineDiv.style.display = "none" } - patchDisplay(cm, display.updateLineNumbers, update.dims) - if (toUpdate > 4) { display.lineDiv.style.display = "" } - display.renderedView = display.view + var selSnapshot = selectionSnapshot(cm); + if (toUpdate > 4) { display.lineDiv.style.display = "none"; } + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) { display.lineDiv.style.display = ""; } + display.renderedView = display.view; // There might have been a widget with a focused element that got // hidden or updated, if so re-focus it. - if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() } + restoreSelection(selSnapshot); // Prevent selection and cursors from interfering with the scroll // width and height. - removeChildren(display.cursorDiv) - removeChildren(display.selectionDiv) - display.gutters.style.height = display.sizer.style.minHeight = 0 + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = display.sizer.style.minHeight = 0; if (different) { - display.lastWrapHeight = update.wrapperHeight - display.lastWrapWidth = update.wrapperWidth - startWorker(cm, 400) + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); } - display.updateLineNumbers = null + display.updateLineNumbers = null; return true } function postUpdateDisplay(cm, update) { - var viewport = update.viewport + var viewport = update.viewport; for (var first = true;; first = false) { if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { // Clip forced viewport to actual scrollable area. if (viewport && viewport.top != null) - { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} } + { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; } // Updated line heights might result in the drawn area not // actually covering the viewport. Keep looping until it does. - update.visible = visibleLines(cm.display, cm.doc, viewport) + update.visible = visibleLines(cm.display, cm.doc, viewport); if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) { break } } if (!updateDisplayIfNeeded(cm, update)) { break } - updateHeightsInViewport(cm) - var barMeasure = measureForScrollbars(cm) - updateSelection(cm) - updateScrollbars(cm, barMeasure) - setDocumentHeight(cm, barMeasure) + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.force = false; } - update.signal(cm, "update", cm) + update.signal(cm, "update", cm); if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { - update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo) - cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; } } function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport) + var update = new DisplayUpdate(cm, viewport); if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm) - postUpdateDisplay(cm, update) - var barMeasure = measureForScrollbars(cm) - updateSelection(cm) - updateScrollbars(cm, barMeasure) - setDocumentHeight(cm, barMeasure) - update.finish() + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.finish(); } } @@ -11751,85 +11917,196 @@ function updateDisplaySimple(cm, viewport) { // that are not there yet, and updating the ones that are out of // date. function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, lineNumbers = cm.options.lineNumbers - var container = display.lineDiv, cur = container.firstChild + var display = cm.display, lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, cur = container.firstChild; function rm(node) { - var next = node.nextSibling + var next = node.nextSibling; // Works around a throw-scroll bug in OS X Webkit if (webkit && mac && cm.display.currentWheelTarget == node) - { node.style.display = "none" } + { node.style.display = "none"; } else - { node.parentNode.removeChild(node) } + { node.parentNode.removeChild(node); } return next } - var view = display.view, lineN = display.viewFrom + var view = display.view, lineN = display.viewFrom; // Loop over the elements in the view, syncing cur (the DOM nodes // in display.lineDiv) with the view as we go. for (var i = 0; i < view.length; i++) { - var lineView = view[i] + var lineView = view[i]; if (lineView.hidden) { } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet - var node = buildLineElement(cm, lineView, lineN, dims) - container.insertBefore(node, cur) + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); } else { // Already drawn - while (cur != lineView.node) { cur = rm(cur) } + while (cur != lineView.node) { cur = rm(cur); } var updateNumber = lineNumbers && updateNumbersFrom != null && - updateNumbersFrom <= lineN && lineView.lineNumber + updateNumbersFrom <= lineN && lineView.lineNumber; if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false } - updateLineForChanges(cm, lineView, lineN, dims) + if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false; } + updateLineForChanges(cm, lineView, lineN, dims); } if (updateNumber) { - removeChildren(lineView.lineNumber) - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))) + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); } - cur = lineView.node.nextSibling + cur = lineView.node.nextSibling; } - lineN += lineView.size + lineN += lineView.size; } - while (cur) { cur = rm(cur) } + while (cur) { cur = rm(cur); } } function updateGutterSpace(cm) { - var width = cm.display.gutters.offsetWidth - cm.display.sizer.style.marginLeft = width + "px" + var width = cm.display.gutters.offsetWidth; + cm.display.sizer.style.marginLeft = width + "px"; } function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = measure.docHeight + "px" - cm.display.heightForcer.style.top = measure.docHeight + "px" - cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px" + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + cm.display.heightForcer.style.top = measure.docHeight + "px"; + cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"; } // Rebuild the gutter elements, ensure the margin to the left of the // code matches their width. function updateGutters(cm) { - var gutters = cm.display.gutters, specs = cm.options.gutters - removeChildren(gutters) - var i = 0 + var gutters = cm.display.gutters, specs = cm.options.gutters; + removeChildren(gutters); + var i = 0; for (; i < specs.length; ++i) { - var gutterClass = specs[i] - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)) + var gutterClass = specs[i]; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); if (gutterClass == "CodeMirror-linenumbers") { - cm.display.lineGutter = gElt - gElt.style.width = (cm.display.lineNumWidth || 1) + "px" + cm.display.lineGutter = gElt; + gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; } } - gutters.style.display = i ? "" : "none" - updateGutterSpace(cm) + gutters.style.display = i ? "" : "none"; + updateGutterSpace(cm); } // Make sure the gutters options contains the element // "CodeMirror-linenumbers" when the lineNumbers option is true. function setGuttersForLineNumbers(options) { - var found = indexOf(options.gutters, "CodeMirror-linenumbers") + var found = indexOf(options.gutters, "CodeMirror-linenumbers"); if (found == -1 && options.lineNumbers) { - options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]) + options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); } else if (found > -1 && !options.lineNumbers) { - options.gutters = options.gutters.slice(0) - options.gutters.splice(found, 1) + options.gutters = options.gutters.slice(0); + options.gutters.splice(found, 1); + } +} + +// Since the delta values reported on mouse wheel events are +// unstandardized between browsers and even browser versions, and +// generally horribly unpredictable, this code starts by measuring +// the scroll effect that the first few mouse wheel events have, +// and, from that, detects the way it can convert deltas to pixel +// offsets afterwards. +// +// The reason we want to know the amount a wheel event will scroll +// is that it gives us a chance to update the display before the +// actual scrolling happens, reducing flickering. + +var wheelSamples = 0; +var wheelPixelsPerUnit = null; +// Fill in a browser-detected starting value on browsers where we +// know one. These don't have to be accurate -- the result of them +// being wrong would just be a slight flicker on the first wheel +// scroll (if it is large enough). +if (ie) { wheelPixelsPerUnit = -.53; } +else if (gecko) { wheelPixelsPerUnit = 15; } +else if (chrome) { wheelPixelsPerUnit = -.7; } +else if (safari) { wheelPixelsPerUnit = -1/3; } + +function wheelEventDelta(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; } + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; } + else if (dy == null) { dy = e.wheelDelta; } + return {x: dx, y: dy} +} +function wheelEventPixels(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta +} + +function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; + + var display = cm.display, scroll = display.scroller; + // Quit if there's nothing to scroll here + var canScrollX = scroll.scrollWidth > scroll.clientWidth; + var canScrollY = scroll.scrollHeight > scroll.clientHeight; + if (!(dx && canScrollX || dy && canScrollY)) { return } + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy && canScrollY) + { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); } + setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit)); + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || (dy && canScrollY)) + { e_preventDefault(e); } + display.wheelStartX = null; // Abort measurement, if in progress + return + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; + if (pixels < 0) { top = Math.max(0, top + pixels - 50); } + else { bot = Math.min(cm.doc.height, bot + pixels + 50); } + updateDisplaySimple(cm, {top: top, bottom: bot}); + } + + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; display.wheelDY = dy; + setTimeout(function () { + if (display.wheelStartX == null) { return } + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX); + display.wheelStartX = display.wheelStartY = null; + if (!sample) { return } + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; display.wheelDY += dy; + } } } @@ -11838,78 +12115,76 @@ function setGuttersForLineNumbers(options) { // (and non-touching) ranges, sorted, and an integer that indicates // which one is the primary selection (the one that's scrolled into // view, that getCursor returns, etc). -function Selection(ranges, primIndex) { - this.ranges = ranges - this.primIndex = primIndex -} +var Selection = function(ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; +}; + +Selection.prototype.primary = function () { return this.ranges[this.primIndex] }; -Selection.prototype = { - primary: function() { return this.ranges[this.primIndex] }, - equals: function(other) { +Selection.prototype.equals = function (other) { var this$1 = this; - if (other == this) { return true } - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } - for (var i = 0; i < this.ranges.length; i++) { - var here = this$1.ranges[i], there = other.ranges[i] - if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) { return false } - } - return true - }, - deepCopy: function() { + if (other == this) { return true } + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } + for (var i = 0; i < this.ranges.length; i++) { + var here = this$1.ranges[i], there = other.ranges[i]; + if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false } + } + return true +}; + +Selection.prototype.deepCopy = function () { var this$1 = this; - var out = [] - for (var i = 0; i < this.ranges.length; i++) - { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) } - return new Selection(out, this.primIndex) - }, - somethingSelected: function() { + var out = []; + for (var i = 0; i < this.ranges.length; i++) + { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); } + return new Selection(out, this.primIndex) +}; + +Selection.prototype.somethingSelected = function () { var this$1 = this; - for (var i = 0; i < this.ranges.length; i++) - { if (!this$1.ranges[i].empty()) { return true } } - return false - }, - contains: function(pos, end) { + for (var i = 0; i < this.ranges.length; i++) + { if (!this$1.ranges[i].empty()) { return true } } + return false +}; + +Selection.prototype.contains = function (pos, end) { var this$1 = this; - if (!end) { end = pos } - for (var i = 0; i < this.ranges.length; i++) { - var range = this$1.ranges[i] - if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) - { return i } - } - return -1 + if (!end) { end = pos; } + for (var i = 0; i < this.ranges.length; i++) { + var range = this$1.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + { return i } } -} + return -1 +}; -function Range(anchor, head) { - this.anchor = anchor; this.head = head -} +var Range = function(anchor, head) { + this.anchor = anchor; this.head = head; +}; -Range.prototype = { - from: function() { return minPos(this.anchor, this.head) }, - to: function() { return maxPos(this.anchor, this.head) }, - empty: function() { - return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch - } -} +Range.prototype.from = function () { return minPos(this.anchor, this.head) }; +Range.prototype.to = function () { return maxPos(this.anchor, this.head) }; +Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch }; // Take an unsorted, potentially overlapping set of ranges, and // build a selection out of it. 'Consumes' ranges array (modifying // it). function normalizeSelection(ranges, primIndex) { - var prim = ranges[primIndex] - ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }) - primIndex = indexOf(ranges, prim) + var prim = ranges[primIndex]; + ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }); + primIndex = indexOf(ranges, prim); for (var i = 1; i < ranges.length; i++) { - var cur = ranges[i], prev = ranges[i - 1] + var cur = ranges[i], prev = ranges[i - 1]; if (cmp(prev.to(), cur.from()) >= 0) { - var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()) - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head - if (i <= primIndex) { --primIndex } - ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)) + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) { --primIndex; } + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); } } return new Selection(ranges, primIndex) @@ -11933,17 +12208,17 @@ function adjustForChange(pos, change) { if (cmp(pos, change.from) < 0) { return pos } if (cmp(pos, change.to) <= 0) { return changeEnd(change) } - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch - if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch } + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; } return Pos(line, ch) } function computeSelAfterChange(doc, change) { - var out = [] + var out = []; for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i] + var range = doc.sel.ranges[i]; out.push(new Range(adjustForChange(range.anchor, change), - adjustForChange(range.head, change))) + adjustForChange(range.head, change))); } return normalizeSelection(out, doc.sel.primIndex) } @@ -11958,19 +12233,19 @@ function offsetPos(pos, old, nw) { // Used by replaceSelections to allow moving the selection to the // start or around the replaced test. Hint may be "start" or "around". function computeReplacedSel(doc, changes, hint) { - var out = [] - var oldPrev = Pos(doc.first, 0), newPrev = oldPrev + var out = []; + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; for (var i = 0; i < changes.length; i++) { - var change = changes[i] - var from = offsetPos(change.from, oldPrev, newPrev) - var to = offsetPos(changeEnd(change), oldPrev, newPrev) - oldPrev = change.to - newPrev = to + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; if (hint == "around") { - var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0 - out[i] = new Range(inv ? to : from, inv ? from : to) + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); } else { - out[i] = new Range(from, from) + out[i] = new Range(from, from); } } return new Selection(out, doc.sel.primIndex) @@ -11979,19 +12254,19 @@ function computeReplacedSel(doc, changes, hint) { // Used to get the editor into a consistent state again when options change. function loadMode(cm) { - cm.doc.mode = getMode(cm.options, cm.doc.modeOption) - resetModeState(cm) + cm.doc.mode = getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); } function resetModeState(cm) { cm.doc.iter(function (line) { - if (line.stateAfter) { line.stateAfter = null } - if (line.styles) { line.styles = null } - }) - cm.doc.frontier = cm.doc.first - startWorker(cm, 100) - cm.state.modeGen++ - if (cm.curOp) { regChange(cm) } + if (line.stateAfter) { line.stateAfter = null; } + if (line.styles) { line.styles = null; } + }); + cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) { regChange(cm); } } // DOCUMENT DATA STRUCTURE @@ -12005,105 +12280,117 @@ function isWholeLineUpdate(doc, change) { } // Perform a change on the document data structure. -function updateDoc(doc, change, markedSpans, estimateHeight) { +function updateDoc(doc, change, markedSpans, estimateHeight$$1) { function spansFor(n) {return markedSpans ? markedSpans[n] : null} function update(line, text, spans) { - updateLine(line, text, spans, estimateHeight) - signalLater(line, "change", line, change) + updateLine(line, text, spans, estimateHeight$$1); + signalLater(line, "change", line, change); } function linesFor(start, end) { - var result = [] + var result = []; for (var i = start; i < end; ++i) - { result.push(new Line(text[i], spansFor(i), estimateHeight)) } + { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); } return result } - var from = change.from, to = change.to, text = change.text - var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line) - var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line + var from = change.from, to = change.to, text = change.text; + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; // Adjust the line structure if (change.full) { - doc.insert(0, linesFor(0, text.length)) - doc.remove(text.length, doc.size - text.length) + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); } else if (isWholeLineUpdate(doc, change)) { // This is a whole-line replace. Treated specially to make // sure line objects move the way they are supposed to. - var added = linesFor(0, text.length - 1) - update(lastLine, lastLine.text, lastSpans) - if (nlines) { doc.remove(from.line, nlines) } - if (added.length) { doc.insert(from.line, added) } + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) { doc.remove(from.line, nlines); } + if (added.length) { doc.insert(from.line, added); } } else if (firstLine == lastLine) { if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans) + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); } else { - var added$1 = linesFor(1, text.length - 1) - added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)) - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)) - doc.insert(from.line + 1, added$1) + var added$1 = linesFor(1, text.length - 1); + added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added$1); } } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)) - doc.remove(from.line + 1, nlines) + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)) - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans) - var added$2 = linesFor(1, text.length - 1) - if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) } - doc.insert(from.line + 1, added$2) + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added$2 = linesFor(1, text.length - 1); + if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); } + doc.insert(from.line + 1, added$2); } - signalLater(doc, "change", doc, change) + signalLater(doc, "change", doc, change); } // Call f for all linked documents. function linkedDocs(doc, f, sharedHistOnly) { function propagate(doc, skip, sharedHist) { if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { - var rel = doc.linked[i] + var rel = doc.linked[i]; if (rel.doc == skip) { continue } - var shared = sharedHist && rel.sharedHist + var shared = sharedHist && rel.sharedHist; if (sharedHistOnly && !shared) { continue } - f(rel.doc, shared) - propagate(rel.doc, doc, shared) + f(rel.doc, shared); + propagate(rel.doc, doc, shared); } } } - propagate(doc, null, true) + propagate(doc, null, true); } // Attach a document to an editor. function attachDoc(cm, doc) { if (doc.cm) { throw new Error("This document is already in use.") } - cm.doc = doc - doc.cm = cm - estimateLineHeights(cm) - loadMode(cm) - if (!cm.options.lineWrapping) { findMaxLine(cm) } - cm.options.mode = doc.modeOption - regChange(cm) + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + setDirectionClass(cm); + if (!cm.options.lineWrapping) { findMaxLine(cm); } + cm.options.mode = doc.modeOption; + regChange(cm); +} + +function setDirectionClass(cm) { + (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); +} + +function directionChanged(cm) { + runInOp(cm, function () { + setDirectionClass(cm); + regChange(cm); + }); } function History(startGen) { // Arrays of change events and selections. Doing something adds an // event to done and clears undo. Undoing moves events from done // to undone, redoing moves them in the other direction. - this.done = []; this.undone = [] - this.undoDepth = Infinity + this.done = []; this.undone = []; + this.undoDepth = Infinity; // Used to track when changes can be merged into a single undo // event - this.lastModTime = this.lastSelTime = 0 - this.lastOp = this.lastSelOp = null - this.lastOrigin = this.lastSelOrigin = null + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; // Used by the isClean() method - this.generation = this.maxGeneration = startGen || 1 + this.generation = this.maxGeneration = startGen || 1; } // Create a history change event from an updateDoc-style change // object. function historyChangeFromChange(doc, change) { - var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)} - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1) - linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true) + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true); return histChange } @@ -12111,8 +12398,8 @@ function historyChangeFromChange(doc, change) { // a change event. function clearSelectionEvents(array) { while (array.length) { - var last = lst(array) - if (last.ranges) { array.pop() } + var last = lst(array); + if (last.ranges) { array.pop(); } else { break } } } @@ -12121,12 +12408,12 @@ function clearSelectionEvents(array) { // events that are in the way. function lastChangeEvent(hist, force) { if (force) { - clearSelectionEvents(hist.done) + clearSelectionEvents(hist.done); return lst(hist.done) } else if (hist.done.length && !lst(hist.done).ranges) { return lst(hist.done) } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop() + hist.done.pop(); return lst(hist.done) } } @@ -12135,50 +12422,50 @@ function lastChangeEvent(hist, force) { // a single operation, or are close together with an origin that // allows merging (starting with "+") into a single event. function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history - hist.undone.length = 0 - var time = +new Date, cur - var last + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date, cur; + var last; if ((hist.lastOp == opId || hist.lastOrigin == change.origin && change.origin && - ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || + ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) || change.origin.charAt(0) == "*")) && (cur = lastChangeEvent(hist, hist.lastOp == opId))) { // Merge this change into the last event - last = lst(cur.changes) + last = lst(cur.changes); if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { // Optimized case for simple insertion -- don't want to add // new changesets for every character typed - last.to = changeEnd(change) + last.to = changeEnd(change); } else { // Add new sub-event - cur.changes.push(historyChangeFromChange(doc, change)) + cur.changes.push(historyChangeFromChange(doc, change)); } } else { // Can not be merged, start a new event. - var before = lst(hist.done) + var before = lst(hist.done); if (!before || !before.ranges) - { pushSelectionToHistory(doc.sel, hist.done) } + { pushSelectionToHistory(doc.sel, hist.done); } cur = {changes: [historyChangeFromChange(doc, change)], - generation: hist.generation} - hist.done.push(cur) + generation: hist.generation}; + hist.done.push(cur); while (hist.done.length > hist.undoDepth) { - hist.done.shift() - if (!hist.done[0].ranges) { hist.done.shift() } + hist.done.shift(); + if (!hist.done[0].ranges) { hist.done.shift(); } } } - hist.done.push(selAfter) - hist.generation = ++hist.maxGeneration - hist.lastModTime = hist.lastSelTime = time - hist.lastOp = hist.lastSelOp = opId - hist.lastOrigin = hist.lastSelOrigin = change.origin + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; - if (!last) { signal(doc, "historyAdded") } + if (!last) { signal(doc, "historyAdded"); } } function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0) + var ch = origin.charAt(0); return ch == "*" || ch == "+" && prev.ranges.length == sel.ranges.length && @@ -12191,7 +12478,7 @@ function selectionEventCanBeMerged(doc, origin, prev, sel) { // selection into the 'done' array when it was significantly // different (in number of selected ranges, emptiness, or time). function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, origin = options && options.origin + var hist = doc.history, origin = options && options.origin; // A new event is started when the previous origin does not match // the current, or the origins don't allow matching. Origins @@ -12201,52 +12488,52 @@ function addSelectionToHistory(doc, sel, opId, options) { (origin && hist.lastSelOrigin == origin && (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) - { hist.done[hist.done.length - 1] = sel } + { hist.done[hist.done.length - 1] = sel; } else - { pushSelectionToHistory(sel, hist.done) } + { pushSelectionToHistory(sel, hist.done); } - hist.lastSelTime = +new Date - hist.lastSelOrigin = origin - hist.lastSelOp = opId + hist.lastSelTime = +new Date; + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; if (options && options.clearRedo !== false) - { clearSelectionEvents(hist.undone) } + { clearSelectionEvents(hist.undone); } } function pushSelectionToHistory(sel, dest) { - var top = lst(dest) + var top = lst(dest); if (!(top && top.ranges && top.equals(sel))) - { dest.push(sel) } + { dest.push(sel); } } // Used to store marked span information in the history. function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], n = 0 + var existing = change["spans_" + doc.id], n = 0; doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { if (line.markedSpans) - { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans } - ++n - }) + { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; } + ++n; + }); } // When un/re-doing restores text containing marked spans, those // that have been explicitly cleared should not be restored. function removeClearedSpans(spans) { if (!spans) { return null } - var out + var out; for (var i = 0; i < spans.length; ++i) { - if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } } - else if (out) { out.push(spans[i]) } + if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } } + else if (out) { out.push(spans[i]); } } return !out ? spans : out.length ? out : null } // Retrieve and filter the old marked spans stored in a change event. function getOldSpans(doc, change) { - var found = change["spans_" + doc.id] + var found = change["spans_" + doc.id]; if (!found) { return null } - var nw = [] + var nw = []; for (var i = 0; i < change.text.length; ++i) - { nw.push(removeClearedSpans(found[i])) } + { nw.push(removeClearedSpans(found[i])); } return nw } @@ -12255,22 +12542,22 @@ function getOldSpans(doc, change) { // existed in the history (so that deleting around a span and then // undoing brings back the span). function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change) - var stretched = stretchSpansOverChange(doc, change) + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); if (!old) { return stretched } if (!stretched) { return old } for (var i = 0; i < old.length; ++i) { - var oldCur = old[i], stretchCur = stretched[i] + var oldCur = old[i], stretchCur = stretched[i]; if (oldCur && stretchCur) { spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j] + var span = stretchCur[j]; for (var k = 0; k < oldCur.length; ++k) { if (oldCur[k].marker == span.marker) { continue spans } } - oldCur.push(span) + oldCur.push(span); } } else if (stretchCur) { - old[i] = stretchCur + old[i] = stretchCur; } } return old @@ -12279,22 +12566,22 @@ function mergeOldSpans(doc, change) { // Used both to provide a JSON-safe object in .getHistory, and, when // detaching a document, to split the history in two function copyHistoryArray(events, newGroup, instantiateSel) { - var copy = [] + var copy = []; for (var i = 0; i < events.length; ++i) { - var event = events[i] + var event = events[i]; if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event) + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); continue } - var changes = event.changes, newChanges = [] - copy.push({changes: newChanges}) + var changes = event.changes, newChanges = []; + copy.push({changes: newChanges}); for (var j = 0; j < changes.length; ++j) { - var change = changes[j], m = (void 0) - newChanges.push({from: change.from, to: change.to, text: change.text}) + var change = changes[j], m = (void 0); + newChanges.push({from: change.from, to: change.to, text: change.text}); if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) { if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop] = change[prop] - delete change[prop] + lst(newChanges)[prop] = change[prop]; + delete change[prop]; } } } } } @@ -12310,16 +12597,16 @@ function copyHistoryArray(events, newGroup, instantiateSel) { // include a given position (and optionally a second position). // Otherwise, simply returns the range between the given positions. // Used for cursor motion and such. -function extendRange(doc, range, head, other) { - if (doc.cm && doc.cm.display.shift || doc.extend) { - var anchor = range.anchor +function extendRange(range, head, other, extend) { + if (extend) { + var anchor = range.anchor; if (other) { - var posBefore = cmp(head, anchor) < 0 + var posBefore = cmp(head, anchor) < 0; if (posBefore != (cmp(other, anchor) < 0)) { - anchor = head - head = other + anchor = head; + head = other; } else if (posBefore != (cmp(head, other) < 0)) { - head = other + head = other; } } return new Range(anchor, head) @@ -12329,30 +12616,32 @@ function extendRange(doc, range, head, other) { } // Extend the primary selection range, discard the rest. -function extendSelection(doc, head, other, options) { - setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options) +function extendSelection(doc, head, other, options, extend) { + if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); } + setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); } // Extend all selections (pos is an array of selections with length // equal the number of selections) function extendSelections(doc, heads, options) { - var out = [] + var out = []; + var extend = doc.cm && (doc.cm.display.shift || doc.extend); for (var i = 0; i < doc.sel.ranges.length; i++) - { out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null) } - var newSel = normalizeSelection(out, doc.sel.primIndex) - setSelection(doc, newSel, options) + { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); } + var newSel = normalizeSelection(out, doc.sel.primIndex); + setSelection(doc, newSel, options); } // Updates a single range in the selection. function replaceOneSelection(doc, i, range, options) { - var ranges = doc.sel.ranges.slice(0) - ranges[i] = range - setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options) + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); } // Reset the selection to a single range. function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options) + setSelection(doc, simpleSelection(anchor, head), options); } // Give beforeSelectionChange handlers a change to influence a @@ -12363,90 +12652,90 @@ function filterSelectionChange(doc, sel, options) { update: function(ranges) { var this$1 = this; - this.ranges = [] + this.ranges = []; for (var i = 0; i < ranges.length; i++) { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), - clipPos(doc, ranges[i].head)) } + clipPos(doc, ranges[i].head)); } }, origin: options && options.origin - } - signal(doc, "beforeSelectionChange", doc, obj) - if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj) } + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj); } if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) } else { return sel } } function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, last = lst(done) + var done = doc.history.done, last = lst(done); if (last && last.ranges) { - done[done.length - 1] = sel - setSelectionNoUndo(doc, sel, options) + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); } else { - setSelection(doc, sel, options) + setSelection(doc, sel, options); } } // Set a new selection. function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options) - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options) + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); } function setSelectionNoUndo(doc, sel, options) { if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - { sel = filterSelectionChange(doc, sel, options) } + { sel = filterSelectionChange(doc, sel, options); } var bias = options && options.bias || - (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1) - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)) + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); if (!(options && options.scroll === false) && doc.cm) - { ensureCursorVisible(doc.cm) } + { ensureCursorVisible(doc.cm); } } function setSelectionInner(doc, sel) { if (sel.equals(doc.sel)) { return } - doc.sel = sel + doc.sel = sel; if (doc.cm) { - doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true - signalCursorActivity(doc.cm) + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); } - signalLater(doc, "cursorActivity", doc) + signalLater(doc, "cursorActivity", doc); } // Verify that the selection does not partially select any atomic // marked ranges. function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll) + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); } // Return a selection that does not partially select any atomic // ranges. function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out + var out; for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i] - var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i] - var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear) - var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear) + var range = sel.ranges[i]; + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear); if (out || newAnchor != range.anchor || newHead != range.head) { - if (!out) { out = sel.ranges.slice(0, i) } - out[i] = new Range(newAnchor, newHead) + if (!out) { out = sel.ranges.slice(0, i); } + out[i] = new Range(newAnchor, newHead); } } return out ? normalizeSelection(out, sel.primIndex) : sel } function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { - var line = getLine(doc, pos.line) + var line = getLine(doc, pos.line); if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker + var sp = line.markedSpans[i], m = sp.marker; if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) { if (mayClear) { - signal(m, "beforeCursorEnter") + signal(m, "beforeCursorEnter"); if (m.explicitlyCleared) { if (!line.markedSpans) { break } else {--i; continue} @@ -12455,16 +12744,16 @@ function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { if (!m.atomic) { continue } if (oldPos) { - var near = m.find(dir < 0 ? 1 : -1), diff = (void 0) + var near = m.find(dir < 0 ? 1 : -1), diff = (void 0); if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) - { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) } + { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); } if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) { return skipAtomicInner(doc, near, pos, dir, mayClear) } } - var far = m.find(dir < 0 ? -1 : 1) + var far = m.find(dir < 0 ? -1 : 1); if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) - { far = movePos(doc, far, dir, far.line == pos.line ? line : null) } + { far = movePos(doc, far, dir, far.line == pos.line ? line : null); } return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null } } } @@ -12473,13 +12762,13 @@ function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { // Ensure a given position is not inside an atomic range. function skipAtomic(doc, pos, oldPos, bias, mayClear) { - var dir = bias || 1 + var dir = bias || 1; var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || - (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)) + (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)); if (!found) { - doc.cantEdit = true + doc.cantEdit = true; return Pos(doc.first, 0) } return found @@ -12498,7 +12787,7 @@ function movePos(doc, pos, dir, line) { } function selectAll(cm) { - cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll) + cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); } // UPDATING @@ -12512,15 +12801,15 @@ function filterChange(doc, change, update) { text: change.text, origin: change.origin, cancel: function () { return obj.canceled = true; } - } + }; if (update) { obj.update = function (from, to, text, origin) { - if (from) { obj.from = clipPos(doc, from) } - if (to) { obj.to = clipPos(doc, to) } - if (text) { obj.text = text } - if (origin !== undefined) { obj.origin = origin } - } } - signal(doc, "beforeChange", doc, obj) - if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj) } + if (from) { obj.from = clipPos(doc, from); } + if (to) { obj.to = clipPos(doc, to); } + if (text) { obj.text = text; } + if (origin !== undefined) { obj.origin = origin; } + }; } + signal(doc, "beforeChange", doc, obj); + if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj); } if (obj.canceled) { return null } return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin} @@ -12535,101 +12824,104 @@ function makeChange(doc, change, ignoreReadOnly) { } if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true) + change = filterChange(doc, change, true); if (!change) { return } } // Possibly split or suppress the update based on the presence // of read-only spans in its range. - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to) + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); if (split) { for (var i = split.length - 1; i >= 0; --i) - { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}) } + { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}); } } else { - makeChangeInner(doc, change) + makeChangeInner(doc, change); } } function makeChangeInner(doc, change) { if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return } - var selAfter = computeSelAfterChange(doc, change) - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN) + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)) - var rebased = [] + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; linkedDocs(doc, function (doc, sharedHist) { if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change) - rebased.push(doc.history) + rebaseHist(doc.history, change); + rebased.push(doc.history); } - makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)) - }) + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); } // Revert a change stored in a document's history. function makeChangeFromHistory(doc, type, allowSelectionOnly) { - if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return } + var suppress = doc.cm && doc.cm.state.suppressEdits; + if (suppress && !allowSelectionOnly) { return } - var hist = doc.history, event, selAfter = doc.sel - var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done + var hist = doc.history, event, selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; // Verify that there is a useable event (so that ctrl-z won't // needlessly clear selection events) - var i = 0 + var i = 0; for (; i < source.length; i++) { - event = source[i] + event = source[i]; if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) { break } } if (i == source.length) { return } - hist.lastOrigin = hist.lastSelOrigin = null + hist.lastOrigin = hist.lastSelOrigin = null; for (;;) { - event = source.pop() + event = source.pop(); if (event.ranges) { - pushSelectionToHistory(event, dest) + pushSelectionToHistory(event, dest); if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, {clearRedo: false}) + setSelection(doc, event, {clearRedo: false}); return } - selAfter = event - } - else { break } + selAfter = event; + } else if (suppress) { + source.push(event); + return + } else { break } } // Build up a reverse change object to add to the opposite history // stack (redo when undoing, and vice versa). - var antiChanges = [] - pushSelectionToHistory(selAfter, dest) - dest.push({changes: antiChanges, generation: hist.generation}) - hist.generation = event.generation || ++hist.maxGeneration + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({changes: antiChanges, generation: hist.generation}); + hist.generation = event.generation || ++hist.maxGeneration; - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange") + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); var loop = function ( i ) { - var change = event.changes[i] - change.origin = type + var change = event.changes[i]; + change.origin = type; if (filter && !filterChange(doc, change, false)) { - source.length = 0 + source.length = 0; return {} } - antiChanges.push(historyChangeFromChange(doc, change)) + antiChanges.push(historyChangeFromChange(doc, change)); - var after = i ? computeSelAfterChange(doc, change) : lst(source) - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)) - if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) } - var rebased = [] + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); } + var rebased = []; // Propagate to the linked documents linkedDocs(doc, function (doc, sharedHist) { if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change) - rebased.push(doc.history) + rebaseHist(doc.history, change); + rebased.push(doc.history); } - makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)) - }) + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); }; for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { @@ -12643,15 +12935,15 @@ function makeChangeFromHistory(doc, type, allowSelectionOnly) { // above or below them in the parent document. function shiftDoc(doc, distance) { if (distance == 0) { return } - doc.first += distance + doc.first += distance; doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range( Pos(range.anchor.line + distance, range.anchor.ch), Pos(range.head.line + distance, range.head.ch) - ); }), doc.sel.primIndex) + ); }), doc.sel.primIndex); if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance) + regChange(doc.cm, doc.first, doc.first - distance, distance); for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) - { regLineChange(doc.cm, l, "gutter") } + { regLineChange(doc.cm, l, "gutter"); } } } @@ -12662,108 +12954,108 @@ function makeChangeSingleDoc(doc, change, selAfter, spans) { { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) } if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)) + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); return } if (change.from.line > doc.lastLine()) { return } // Clip the change to the size of this doc if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line) - shiftDoc(doc, shift) + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], origin: change.origin} + text: [lst(change.text)], origin: change.origin}; } - var last = doc.lastLine() + var last = doc.lastLine(); if (change.to.line > last) { change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], origin: change.origin} + text: [change.text[0]], origin: change.origin}; } - change.removed = getBetween(doc, change.from, change.to) + change.removed = getBetween(doc, change.from, change.to); - if (!selAfter) { selAfter = computeSelAfterChange(doc, change) } - if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) } - else { updateDoc(doc, change, spans) } - setSelectionNoUndo(doc, selAfter, sel_dontScroll) + if (!selAfter) { selAfter = computeSelAfterChange(doc, change); } + if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); } + else { updateDoc(doc, change, spans); } + setSelectionNoUndo(doc, selAfter, sel_dontScroll); } // Handle the interaction of a change to a document with the editor // that this document is part of. function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, display = cm.display, from = change.from, to = change.to + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; - var recomputeMaxLength = false, checkWidthStart = from.line + var recomputeMaxLength = false, checkWidthStart = from.line; if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))) + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); doc.iter(checkWidthStart, to.line + 1, function (line) { if (line == display.maxLine) { - recomputeMaxLength = true + recomputeMaxLength = true; return true } - }) + }); } if (doc.sel.contains(change.from, change.to) > -1) - { signalCursorActivity(cm) } + { signalCursorActivity(cm); } - updateDoc(doc, change, spans, estimateHeight(cm)) + updateDoc(doc, change, spans, estimateHeight(cm)); if (!cm.options.lineWrapping) { doc.iter(checkWidthStart, from.line + change.text.length, function (line) { - var len = lineLength(line) + var len = lineLength(line); if (len > display.maxLineLength) { - display.maxLine = line - display.maxLineLength = len - display.maxLineChanged = true - recomputeMaxLength = false + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; } - }) - if (recomputeMaxLength) { cm.curOp.updateMaxLine = true } + }); + if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; } } - // Adjust frontier, schedule worker - doc.frontier = Math.min(doc.frontier, from.line) - startWorker(cm, 400) + retreatFrontier(doc, from.line); + startWorker(cm, 400); - var lendiff = change.text.length - (to.line - from.line) - 1 + var lendiff = change.text.length - (to.line - from.line) - 1; // Remember that these lines changed, for updating the display if (change.full) - { regChange(cm) } + { regChange(cm); } else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) - { regLineChange(cm, from.line, "text") } + { regLineChange(cm, from.line, "text"); } else - { regChange(cm, from.line, to.line + 1, lendiff) } + { regChange(cm, from.line, to.line + 1, lendiff); } - var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change") + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); if (changeHandler || changesHandler) { var obj = { from: from, to: to, text: change.text, removed: change.removed, origin: change.origin - } - if (changeHandler) { signalLater(cm, "change", cm, obj) } - if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) } + }; + if (changeHandler) { signalLater(cm, "change", cm, obj); } + if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); } } - cm.display.selForContextMenu = null + cm.display.selForContextMenu = null; } function replaceRange(doc, code, from, to, origin) { - if (!to) { to = from } - if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp } - if (typeof code == "string") { code = doc.splitLines(code) } - makeChange(doc, {from: from, to: to, text: code, origin: origin}) + if (!to) { to = from; } + if (cmp(to, from) < 0) { var assign; + (assign = [to, from], from = assign[0], to = assign[1]); } + if (typeof code == "string") { code = doc.splitLines(code); } + makeChange(doc, {from: from, to: to, text: code, origin: origin}); } // Rebasing/resetting history to deal with externally-sourced changes function rebaseHistSelSingle(pos, from, to, diff) { if (to < pos.line) { - pos.line += diff + pos.line += diff; } else if (from < pos.line) { - pos.line = from - pos.ch = 0 + pos.line = from; + pos.ch = 0; } } @@ -12776,47 +13068,47 @@ function rebaseHistSelSingle(pos, from, to, diff) { // shared position objects being unsafely updated. function rebaseHistArray(array, from, to, diff) { for (var i = 0; i < array.length; ++i) { - var sub = array[i], ok = true + var sub = array[i], ok = true; if (sub.ranges) { - if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true } + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff) - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff) + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); } continue } for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { - var cur = sub.changes[j$1] + var cur = sub.changes[j$1]; if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch) - cur.to = Pos(cur.to.line + diff, cur.to.ch) + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); } else if (from <= cur.to.line) { - ok = false + ok = false; break } } if (!ok) { - array.splice(0, i + 1) - i = 0 + array.splice(0, i + 1); + i = 0; } } } function rebaseHist(hist, change) { - var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1 - rebaseHistArray(hist.done, from, to, diff) - rebaseHistArray(hist.undone, from, to, diff) + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); } // Utility for applying a change to a line by handle or number, // returning the number and optionally registering the line as // changed. function changeLine(doc, handle, changeType, op) { - var no = handle, line = handle - if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)) } - else { no = lineNo(handle) } + var no = handle, line = handle; + if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)); } + else { no = lineNo(handle); } if (no == null) { return null } - if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) } + if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); } return line } @@ -12836,43 +13128,47 @@ function changeLine(doc, handle, changeType, op) { function LeafChunk(lines) { var this$1 = this; - this.lines = lines - this.parent = null - var height = 0 + this.lines = lines; + this.parent = null; + var height = 0; for (var i = 0; i < lines.length; ++i) { - lines[i].parent = this$1 - height += lines[i].height + lines[i].parent = this$1; + height += lines[i].height; } - this.height = height + this.height = height; } LeafChunk.prototype = { chunkSize: function() { return this.lines.length }, + // Remove the n lines at offset 'at'. removeInner: function(at, n) { var this$1 = this; for (var i = at, e = at + n; i < e; ++i) { - var line = this$1.lines[i] - this$1.height -= line.height - cleanUpLine(line) - signalLater(line, "delete") + var line = this$1.lines[i]; + this$1.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); } - this.lines.splice(at, n) + this.lines.splice(at, n); }, + // Helper used to collapse a small branch into a single leaf. collapse: function(lines) { - lines.push.apply(lines, this.lines) + lines.push.apply(lines, this.lines); }, + // Insert the given array of lines at offset 'at', count them as // having the given height. insertInner: function(at, lines, height) { var this$1 = this; - this.height += height - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)) - for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 } + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; } }, + // Used to iterate over a part of the tree. iterN: function(at, n, op) { var this$1 = this; @@ -12880,179 +13176,194 @@ LeafChunk.prototype = { for (var e = at + n; at < e; ++at) { if (op(this$1.lines[at])) { return true } } } -} +}; function BranchChunk(children) { var this$1 = this; - this.children = children - var size = 0, height = 0 + this.children = children; + var size = 0, height = 0; for (var i = 0; i < children.length; ++i) { - var ch = children[i] - size += ch.chunkSize(); height += ch.height - ch.parent = this$1 + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this$1; } - this.size = size - this.height = height - this.parent = null + this.size = size; + this.height = height; + this.parent = null; } BranchChunk.prototype = { chunkSize: function() { return this.size }, + removeInner: function(at, n) { var this$1 = this; - this.size -= n + this.size -= n; for (var i = 0; i < this.children.length; ++i) { - var child = this$1.children[i], sz = child.chunkSize() + var child = this$1.children[i], sz = child.chunkSize(); if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height - child.removeInner(at, rm) - this$1.height -= oldHeight - child.height - if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null } + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.removeInner(at, rm); + this$1.height -= oldHeight - child.height; + if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; } if ((n -= rm) == 0) { break } - at = 0 - } else { at -= sz } + at = 0; + } else { at -= sz; } } // If the result is smaller than 25 lines, ensure that it is a // single leaf node. if (this.size - n < 25 && (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = [] - this.collapse(lines) - this.children = [new LeafChunk(lines)] - this.children[0].parent = this + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; } }, + collapse: function(lines) { var this$1 = this; - for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) } + for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); } }, + insertInner: function(at, lines, height) { var this$1 = this; - this.size += lines.length - this.height += height + this.size += lines.length; + this.height += height; for (var i = 0; i < this.children.length; ++i) { - var child = this$1.children[i], sz = child.chunkSize() + var child = this$1.children[i], sz = child.chunkSize(); if (at <= sz) { - child.insertInner(at, lines, height) + child.insertInner(at, lines, height); if (child.lines && child.lines.length > 50) { // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. - var remaining = child.lines.length % 25 + 25 + var remaining = child.lines.length % 25 + 25; for (var pos = remaining; pos < child.lines.length;) { - var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)) - child.height -= leaf.height - this$1.children.splice(++i, 0, leaf) - leaf.parent = this$1 + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); + child.height -= leaf.height; + this$1.children.splice(++i, 0, leaf); + leaf.parent = this$1; } - child.lines = child.lines.slice(0, remaining) - this$1.maybeSpill() + child.lines = child.lines.slice(0, remaining); + this$1.maybeSpill(); } break } - at -= sz + at -= sz; } }, + // When a node has grown, check whether it should be split. maybeSpill: function() { if (this.children.length <= 10) { return } - var me = this + var me = this; do { - var spilled = me.children.splice(me.children.length - 5, 5) - var sibling = new BranchChunk(spilled) + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children) - copy.parent = me - me.children = [copy, sibling] - me = copy + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; } else { - me.size -= sibling.size - me.height -= sibling.height - var myIndex = indexOf(me.parent.children, me) - me.parent.children.splice(myIndex + 1, 0, sibling) + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); } - sibling.parent = me.parent + sibling.parent = me.parent; } while (me.children.length > 10) - me.parent.maybeSpill() + me.parent.maybeSpill(); }, + iterN: function(at, n, op) { var this$1 = this; for (var i = 0; i < this.children.length; ++i) { - var child = this$1.children[i], sz = child.chunkSize() + var child = this$1.children[i], sz = child.chunkSize(); if (at < sz) { - var used = Math.min(n, sz - at) + var used = Math.min(n, sz - at); if (child.iterN(at, used, op)) { return true } if ((n -= used) == 0) { break } - at = 0 - } else { at -= sz } + at = 0; + } else { at -= sz; } } } -} +}; // Line widgets are block elements displayed above or below a line. -function LineWidget(doc, node, options) { +var LineWidget = function(doc, node, options) { var this$1 = this; if (options) { for (var opt in options) { if (options.hasOwnProperty(opt)) - { this$1[opt] = options[opt] } } } - this.doc = doc - this.node = node -} -eventMixin(LineWidget) - -function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) - { addToScrollPos(cm, null, diff) } -} + { this$1[opt] = options[opt]; } } } + this.doc = doc; + this.node = node; +}; -LineWidget.prototype.clear = function() { - var this$1 = this; +LineWidget.prototype.clear = function () { + var this$1 = this; - var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line) + var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); if (no == null || !ws) { return } - for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } } - if (!ws.length) { line.widgets = null } - var height = widgetHeight(this) - updateLineHeight(line, Math.max(0, line.height - height)) - if (cm) { runInOp(cm, function () { - adjustScrollWhenAboveVisible(cm, line, -height) - regLineChange(cm, no, "widget") - }) } -} -LineWidget.prototype.changed = function() { - var oldH = this.height, cm = this.doc.cm, line = this.line - this.height = null - var diff = widgetHeight(this) - oldH + for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } } + if (!ws.length) { line.widgets = null; } + var height = widgetHeight(this); + updateLineHeight(line, Math.max(0, line.height - height)); + if (cm) { + runInOp(cm, function () { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + }); + signalLater(cm, "lineWidgetCleared", cm, this, no); + } +}; + +LineWidget.prototype.changed = function () { + var this$1 = this; + + var oldH = this.height, cm = this.doc.cm, line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; if (!diff) { return } - updateLineHeight(line, line.height + diff) - if (cm) { runInOp(cm, function () { - cm.curOp.forceUpdate = true - adjustScrollWhenAboveVisible(cm, line, diff) - }) } + updateLineHeight(line, line.height + diff); + if (cm) { + runInOp(cm, function () { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)); + }); + } +}; +eventMixin(LineWidget); + +function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + { addToScrollTop(cm, diff); } } function addLineWidget(doc, handle, node, options) { - var widget = new LineWidget(doc, node, options) - var cm = doc.cm - if (cm && widget.noHScroll) { cm.display.alignWidgets = true } + var widget = new LineWidget(doc, node, options); + var cm = doc.cm; + if (cm && widget.noHScroll) { cm.display.alignWidgets = true; } changeLine(doc, handle, "widget", function (line) { - var widgets = line.widgets || (line.widgets = []) - if (widget.insertAt == null) { widgets.push(widget) } - else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) } - widget.line = line + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) { widgets.push(widget); } + else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); } + widget.line = line; if (cm && !lineIsHidden(doc, line)) { - var aboveVisible = heightAtLine(line) < doc.scrollTop - updateLineHeight(line, line.height + widgetHeight(widget)) - if (aboveVisible) { addToScrollPos(cm, null, widget.height) } - cm.curOp.forceUpdate = true + var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) { addToScrollTop(cm, widget.height); } + cm.curOp.forceUpdate = true; } return true - }) + }); + if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); } return widget } @@ -13071,124 +13382,127 @@ function addLineWidget(doc, handle, node, options) { // Collapsed markers have unique ids, in order to be able to order // them, which is needed for uniquely determining an outer marker // when they overlap (they may nest, but not partially overlap). -var nextMarkerId = 0 +var nextMarkerId = 0; -function TextMarker(doc, type) { - this.lines = [] - this.type = type - this.doc = doc - this.id = ++nextMarkerId -} -eventMixin(TextMarker) +var TextMarker = function(doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; +}; // Clear the marker. -TextMarker.prototype.clear = function() { - var this$1 = this; +TextMarker.prototype.clear = function () { + var this$1 = this; if (this.explicitlyCleared) { return } - var cm = this.doc.cm, withOp = cm && !cm.curOp - if (withOp) { startOperation(cm) } + var cm = this.doc.cm, withOp = cm && !cm.curOp; + if (withOp) { startOperation(cm); } if (hasHandler(this, "clear")) { - var found = this.find() - if (found) { signalLater(this, "clear", found.from, found.to) } + var found = this.find(); + if (found) { signalLater(this, "clear", found.from, found.to); } } - var min = null, max = null + var min = null, max = null; for (var i = 0; i < this.lines.length; ++i) { - var line = this$1.lines[i] - var span = getMarkedSpanFor(line.markedSpans, this$1) - if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text") } + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); + if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text"); } else if (cm) { - if (span.to != null) { max = lineNo(line) } - if (span.from != null) { min = lineNo(line) } + if (span.to != null) { max = lineNo(line); } + if (span.from != null) { min = lineNo(line); } } - line.markedSpans = removeMarkedSpan(line.markedSpans, span) + line.markedSpans = removeMarkedSpan(line.markedSpans, span); if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm) - { updateLineHeight(line, textHeight(cm.display)) } + { updateLineHeight(line, textHeight(cm.display)); } } if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { - var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual) + var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual); if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual - cm.display.maxLineLength = len - cm.display.maxLineChanged = true + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; } } } - if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) } - this.lines.length = 0 - this.explicitlyCleared = true + if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); } + this.lines.length = 0; + this.explicitlyCleared = true; if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false - if (cm) { reCheckSelection(cm.doc) } + this.doc.cantEdit = false; + if (cm) { reCheckSelection(cm.doc); } } - if (cm) { signalLater(cm, "markerCleared", cm, this) } - if (withOp) { endOperation(cm) } - if (this.parent) { this.parent.clear() } -} + if (cm) { signalLater(cm, "markerCleared", cm, this, min, max); } + if (withOp) { endOperation(cm); } + if (this.parent) { this.parent.clear(); } +}; // Find the position of the marker in the document. Returns a {from, // to} object by default. Side can be passed to get a specific side // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the // Pos objects returned contain a line object, rather than a line // number (used to prevent looking up the same line twice). -TextMarker.prototype.find = function(side, lineObj) { - var this$1 = this; +TextMarker.prototype.find = function (side, lineObj) { + var this$1 = this; - if (side == null && this.type == "bookmark") { side = 1 } - var from, to + if (side == null && this.type == "bookmark") { side = 1; } + var from, to; for (var i = 0; i < this.lines.length; ++i) { - var line = this$1.lines[i] - var span = getMarkedSpanFor(line.markedSpans, this$1) + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from) + from = Pos(lineObj ? line : lineNo(line), span.from); if (side == -1) { return from } } if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to) + to = Pos(lineObj ? line : lineNo(line), span.to); if (side == 1) { return to } } } return from && {from: from, to: to} -} +}; // Signals that the marker's widget changed, and surrounding layout // should be recomputed. -TextMarker.prototype.changed = function() { - var pos = this.find(-1, true), widget = this, cm = this.doc.cm +TextMarker.prototype.changed = function () { + var this$1 = this; + + var pos = this.find(-1, true), widget = this, cm = this.doc.cm; if (!pos || !cm) { return } runInOp(cm, function () { - var line = pos.line, lineN = lineNo(pos.line) - var view = findViewForLine(cm, lineN) + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); if (view) { - clearLineMeasurementCacheFor(view) - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; } - cm.curOp.updateMaxLine = true + cm.curOp.updateMaxLine = true; if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height - widget.height = null - var dHeight = widgetHeight(widget) - oldHeight + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; if (dHeight) - { updateLineHeight(line, line.height + dHeight) } + { updateLineHeight(line, line.height + dHeight); } } - }) -} + signalLater(cm, "markerChanged", cm, this$1); + }); +}; -TextMarker.prototype.attachLine = function(line) { +TextMarker.prototype.attachLine = function (line) { if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp + var op = this.doc.cm.curOp; if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) - { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) } + { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); } } - this.lines.push(line) -} -TextMarker.prototype.detachLine = function(line) { - this.lines.splice(indexOf(this.lines, line), 1) + this.lines.push(line); +}; + +TextMarker.prototype.detachLine = function (line) { + this.lines.splice(indexOf(this.lines, line), 1); if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp - ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this) + var op = this.doc.cm.curOp;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); } -} +}; +eventMixin(TextMarker); // Create a marker, wire it up to the right lines, and function markText(doc, from, to, options, type) { @@ -13199,63 +13513,63 @@ function markText(doc, from, to, options, type) { // Ensure we are in an operation. if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) } - var marker = new TextMarker(doc, type), diff = cmp(from, to) - if (options) { copyObj(options, marker, false) } + var marker = new TextMarker(doc, type), diff = cmp(from, to); + if (options) { copyObj(options, marker, false); } // Don't connect empty markers unless clearWhenEmpty is false if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) { return marker } if (marker.replacedWith) { // Showing up as a widget implies collapsed (widget replaces text) - marker.collapsed = true - marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget") - if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true") } - if (options.insertLeft) { marker.widgetNode.insertLeft = true } + marker.collapsed = true; + marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true"); } + if (options.insertLeft) { marker.widgetNode.insertLeft = true; } } if (marker.collapsed) { if (conflictingCollapsedRange(doc, from.line, from, to, marker) || from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) { throw new Error("Inserting collapsed marker partially overlapping an existing one") } - seeCollapsedSpans() + seeCollapsedSpans(); } if (marker.addToHistory) - { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN) } + { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); } - var curLine = from.line, cm = doc.cm, updateMaxLine + var curLine = from.line, cm = doc.cm, updateMaxLine; doc.iter(curLine, to.line + 1, function (line) { if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) - { updateMaxLine = true } - if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) } + { updateMaxLine = true; } + if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); } addMarkedSpan(line, new MarkedSpan(marker, curLine == from.line ? from.ch : null, - curLine == to.line ? to.ch : null)) - ++curLine - }) + curLine == to.line ? to.ch : null)); + ++curLine; + }); // lineIsHidden depends on the presence of the spans, so needs a second pass if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) { - if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) } - }) } + if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); } + }); } - if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }) } + if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }); } if (marker.readOnly) { - seeReadOnlySpans() + seeReadOnlySpans(); if (doc.history.done.length || doc.history.undone.length) - { doc.clearHistory() } + { doc.clearHistory(); } } if (marker.collapsed) { - marker.id = ++nextMarkerId - marker.atomic = true + marker.id = ++nextMarkerId; + marker.atomic = true; } if (cm) { // Sync editor state - if (updateMaxLine) { cm.curOp.updateMaxLine = true } + if (updateMaxLine) { cm.curOp.updateMaxLine = true; } if (marker.collapsed) - { regChange(cm, from.line, to.line + 1) } + { regChange(cm, from.line, to.line + 1); } else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) - { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text") } } - if (marker.atomic) { reCheckSelection(cm.doc) } - signalLater(cm, "markerAdded", cm, marker) + { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } } + if (marker.atomic) { reCheckSelection(cm.doc); } + signalLater(cm, "markerAdded", cm, marker); } return marker } @@ -13265,41 +13579,42 @@ function markText(doc, from, to, options, type) { // A shared marker spans multiple linked documents. It is // implemented as a meta-marker-object controlling multiple normal // markers. -function SharedTextMarker(markers, primary) { +var SharedTextMarker = function(markers, primary) { var this$1 = this; - this.markers = markers - this.primary = primary + this.markers = markers; + this.primary = primary; for (var i = 0; i < markers.length; ++i) - { markers[i].parent = this$1 } -} -eventMixin(SharedTextMarker) + { markers[i].parent = this$1; } +}; -SharedTextMarker.prototype.clear = function() { - var this$1 = this; +SharedTextMarker.prototype.clear = function () { + var this$1 = this; if (this.explicitlyCleared) { return } - this.explicitlyCleared = true + this.explicitlyCleared = true; for (var i = 0; i < this.markers.length; ++i) - { this$1.markers[i].clear() } - signalLater(this, "clear") -} -SharedTextMarker.prototype.find = function(side, lineObj) { + { this$1.markers[i].clear(); } + signalLater(this, "clear"); +}; + +SharedTextMarker.prototype.find = function (side, lineObj) { return this.primary.find(side, lineObj) -} +}; +eventMixin(SharedTextMarker); function markTextShared(doc, from, to, options, type) { - options = copyObj(options) - options.shared = false - var markers = [markText(doc, from, to, options, type)], primary = markers[0] - var widget = options.widgetNode + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], primary = markers[0]; + var widget = options.widgetNode; linkedDocs(doc, function (doc) { - if (widget) { options.widgetNode = widget.cloneNode(true) } - markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)) + if (widget) { options.widgetNode = widget.cloneNode(true); } + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); for (var i = 0; i < doc.linked.length; ++i) { if (doc.linked[i].isParent) { return } } - primary = lst(markers) - }) + primary = lst(markers); + }); return new SharedTextMarker(markers, primary) } @@ -13309,25 +13624,25 @@ function findSharedMarkers(doc) { function copySharedMarkers(doc, markers) { for (var i = 0; i < markers.length; i++) { - var marker = markers[i], pos = marker.find() - var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to) + var marker = markers[i], pos = marker.find(); + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type) - marker.markers.push(subMark) - subMark.parent = marker + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; } } } function detachSharedMarkers(markers) { var loop = function ( i ) { - var marker = markers[i], linked = [marker.primary.doc] - linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }) + var marker = markers[i], linked = [marker.primary.doc]; + linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }); for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j] + var subMarker = marker.markers[j]; if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null - marker.markers.splice(j--, 1) + subMarker.parent = null; + marker.markers.splice(j--, 1); } } }; @@ -13335,29 +13650,30 @@ function detachSharedMarkers(markers) { for (var i = 0; i < markers.length; i++) loop( i ); } -var nextDocId = 0 -var Doc = function(text, mode, firstLine, lineSep) { - if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep) } - if (firstLine == null) { firstLine = 0 } - - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]) - this.first = firstLine - this.scrollTop = this.scrollLeft = 0 - this.cantEdit = false - this.cleanGeneration = 1 - this.frontier = firstLine - var start = Pos(firstLine, 0) - this.sel = simpleSelection(start) - this.history = new History(null) - this.id = ++nextDocId - this.modeOption = mode - this.lineSep = lineSep - this.extend = false - - if (typeof text == "string") { text = this.splitLines(text) } - updateDoc(this, {from: start, to: start, text: text}) - setSelection(this, simpleSelection(start), sel_dontScroll) -} +var nextDocId = 0; +var Doc = function(text, mode, firstLine, lineSep, direction) { + if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) } + if (firstLine == null) { firstLine = 0; } + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.modeFrontier = this.highlightFrontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + this.lineSep = lineSep; + this.direction = (direction == "rtl") ? "rtl" : "ltr"; + this.extend = false; + + if (typeof text == "string") { text = this.splitLines(text); } + updateDoc(this, {from: start, to: start, text: text}); + setSelection(this, simpleSelection(start), sel_dontScroll); +}; Doc.prototype = createObj(BranchChunk.prototype, { constructor: Doc, @@ -13366,39 +13682,40 @@ Doc.prototype = createObj(BranchChunk.prototype, { // three, it iterates over the range given by the first two (with // the second being non-inclusive). iter: function(from, to, op) { - if (op) { this.iterN(from - this.first, to - from, op) } - else { this.iterN(this.first, this.first + this.size, from) } + if (op) { this.iterN(from - this.first, to - from, op); } + else { this.iterN(this.first, this.first + this.size, from); } }, // Non-public interface for adding and removing lines. insert: function(at, lines) { - var height = 0 - for (var i = 0; i < lines.length; ++i) { height += lines[i].height } - this.insertInner(at - this.first, lines, height) + var height = 0; + for (var i = 0; i < lines.length; ++i) { height += lines[i].height; } + this.insertInner(at - this.first, lines, height); }, - remove: function(at, n) { this.removeInner(at - this.first, n) }, + remove: function(at, n) { this.removeInner(at - this.first, n); }, // From here, the methods are part of the public interface. Most // are also available from CodeMirror (editor) instances. getValue: function(lineSep) { - var lines = getLines(this, this.first, this.first + this.size) + var lines = getLines(this, this.first, this.first + this.size); if (lineSep === false) { return lines } return lines.join(lineSep || this.lineSeparator()) }, setValue: docMethodOp(function(code) { - var top = Pos(this.first, 0), last = this.first + this.size - 1 + var top = Pos(this.first, 0), last = this.first + this.size - 1; makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), - text: this.splitLines(code), origin: "setValue", full: true}, true) - setSelection(this, simpleSelection(top)) + text: this.splitLines(code), origin: "setValue", full: true}, true); + if (this.cm) { scrollToCoords(this.cm, 0, 0); } + setSelection(this, simpleSelection(top), sel_dontScroll); }), replaceRange: function(code, from, to, origin) { - from = clipPos(this, from) - to = to ? clipPos(this, to) : from - replaceRange(this, code, from, to, origin) + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); }, getRange: function(from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)) + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); if (lineSep === false) { return lines } return lines.join(lineSep || this.lineSeparator()) }, @@ -13409,7 +13726,7 @@ Doc.prototype = createObj(BranchChunk.prototype, { getLineNumber: function(line) {return lineNo(line)}, getLineHandleVisualStart: function(line) { - if (typeof line == "number") { line = getLine(this, line) } + if (typeof line == "number") { line = getLine(this, line); } return visualLine(line) }, @@ -13420,56 +13737,56 @@ Doc.prototype = createObj(BranchChunk.prototype, { clipPos: function(pos) {return clipPos(this, pos)}, getCursor: function(start) { - var range = this.sel.primary(), pos - if (start == null || start == "head") { pos = range.head } - else if (start == "anchor") { pos = range.anchor } - else if (start == "end" || start == "to" || start === false) { pos = range.to() } - else { pos = range.from() } + var range$$1 = this.sel.primary(), pos; + if (start == null || start == "head") { pos = range$$1.head; } + else if (start == "anchor") { pos = range$$1.anchor; } + else if (start == "end" || start == "to" || start === false) { pos = range$$1.to(); } + else { pos = range$$1.from(); } return pos }, listSelections: function() { return this.sel.ranges }, somethingSelected: function() {return this.sel.somethingSelected()}, setCursor: docMethodOp(function(line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options) + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); }), setSelection: docMethodOp(function(anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options) + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); }), extendSelection: docMethodOp(function(head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options) + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); }), extendSelections: docMethodOp(function(heads, options) { - extendSelections(this, clipPosArray(this, heads), options) + extendSelections(this, clipPosArray(this, heads), options); }), extendSelectionsBy: docMethodOp(function(f, options) { - var heads = map(this.sel.ranges, f) - extendSelections(this, clipPosArray(this, heads), options) + var heads = map(this.sel.ranges, f); + extendSelections(this, clipPosArray(this, heads), options); }), setSelections: docMethodOp(function(ranges, primary, options) { var this$1 = this; if (!ranges.length) { return } - var out = [] + var out = []; for (var i = 0; i < ranges.length; i++) { out[i] = new Range(clipPos(this$1, ranges[i].anchor), - clipPos(this$1, ranges[i].head)) } - if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) } - setSelection(this, normalizeSelection(out, primary), options) + clipPos(this$1, ranges[i].head)); } + if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); } + setSelection(this, normalizeSelection(out, primary), options); }), addSelection: docMethodOp(function(anchor, head, options) { - var ranges = this.sel.ranges.slice(0) - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))) - setSelection(this, normalizeSelection(ranges, ranges.length - 1), options) + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); }), getSelection: function(lineSep) { var this$1 = this; - var ranges = this.sel.ranges, lines + var ranges = this.sel.ranges, lines; for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()) - lines = lines ? lines.concat(sel) : sel + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; } if (lineSep === false) { return lines } else { return lines.join(lineSep || this.lineSeparator()) } @@ -13477,56 +13794,56 @@ Doc.prototype = createObj(BranchChunk.prototype, { getSelections: function(lineSep) { var this$1 = this; - var parts = [], ranges = this.sel.ranges + var parts = [], ranges = this.sel.ranges; for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()) - if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) } - parts[i] = sel + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); } + parts[i] = sel; } return parts }, replaceSelection: function(code, collapse, origin) { - var dup = [] + var dup = []; for (var i = 0; i < this.sel.ranges.length; i++) - { dup[i] = code } - this.replaceSelections(dup, collapse, origin || "+input") + { dup[i] = code; } + this.replaceSelections(dup, collapse, origin || "+input"); }, replaceSelections: docMethodOp(function(code, collapse, origin) { var this$1 = this; - var changes = [], sel = this.sel + var changes = [], sel = this.sel; for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i] - changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin} + var range$$1 = sel.ranges[i]; + changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin}; } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse) + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) - { makeChange(this$1, changes[i$1]) } - if (newSel) { setSelectionReplaceHistory(this, newSel) } - else if (this.cm) { ensureCursorVisible(this.cm) } + { makeChange(this$1, changes[i$1]); } + if (newSel) { setSelectionReplaceHistory(this, newSel); } + else if (this.cm) { ensureCursorVisible(this.cm); } }), - undo: docMethodOp(function() {makeChangeFromHistory(this, "undo")}), - redo: docMethodOp(function() {makeChangeFromHistory(this, "redo")}), - undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true)}), - redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true)}), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), - setExtending: function(val) {this.extend = val}, + setExtending: function(val) {this.extend = val;}, getExtending: function() {return this.extend}, historySize: function() { - var hist = this.history, done = 0, undone = 0 - for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } } - for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } } + var hist = this.history, done = 0, undone = 0; + for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } } + for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } } return {undo: done, redo: undone} }, - clearHistory: function() {this.history = new History(this.history.maxGeneration)}, + clearHistory: function() {this.history = new History(this.history.maxGeneration);}, markClean: function() { - this.cleanGeneration = this.changeGeneration(true) + this.cleanGeneration = this.changeGeneration(true); }, changeGeneration: function(forceSplit) { if (forceSplit) - { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null } + { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; } return this.history.generation }, isClean: function (gen) { @@ -13538,16 +13855,16 @@ Doc.prototype = createObj(BranchChunk.prototype, { undone: copyHistoryArray(this.history.undone)} }, setHistory: function(histData) { - var hist = this.history = new History(this.history.maxGeneration) - hist.done = copyHistoryArray(histData.done.slice(0), null, true) - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true) + var hist = this.history = new History(this.history.maxGeneration); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); }, setGutterMarker: docMethodOp(function(line, gutterID, value) { return changeLine(this, line, "gutter", function (line) { - var markers = line.gutterMarkers || (line.gutterMarkers = {}) - markers[gutterID] = value - if (!value && isEmpty(markers)) { line.gutterMarkers = null } + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) { line.gutterMarkers = null; } return true }) }), @@ -13555,28 +13872,26 @@ Doc.prototype = createObj(BranchChunk.prototype, { clearGutter: docMethodOp(function(gutterID) { var this$1 = this; - var i = this.first this.iter(function (line) { if (line.gutterMarkers && line.gutterMarkers[gutterID]) { changeLine(this$1, line, "gutter", function () { - line.gutterMarkers[gutterID] = null - if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null } + line.gutterMarkers[gutterID] = null; + if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; } return true - }) + }); } - ++i - }) + }); }), lineInfo: function(line) { - var n + var n; if (typeof line == "number") { if (!isLine(this, line)) { return null } - n = line - line = getLine(this, line) + n = line; + line = getLine(this, line); if (!line) { return null } } else { - n = lineNo(line) + n = lineNo(line); if (n == null) { return null } } return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, @@ -13588,10 +13903,10 @@ Doc.prototype = createObj(BranchChunk.prototype, { return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass" - if (!line[prop]) { line[prop] = cls } + : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) { line[prop] = cls; } else if (classTest(cls).test(line[prop])) { return false } - else { line[prop] += " " + cls } + else { line[prop] += " " + cls; } return true }) }), @@ -13599,15 +13914,15 @@ Doc.prototype = createObj(BranchChunk.prototype, { return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass" - var cur = line[prop] + : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; if (!cur) { return false } - else if (cls == null) { line[prop] = null } + else if (cls == null) { line[prop] = null; } else { - var found = cur.match(classTest(cls)) + var found = cur.match(classTest(cls)); if (!found) { return false } - var end = found.index + found[0].length - line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; } return true }) @@ -13616,7 +13931,7 @@ Doc.prototype = createObj(BranchChunk.prototype, { addLineWidget: docMethodOp(function(handle, node, options) { return addLineWidget(this, handle, node, options) }), - removeLineWidget: function(widget) { widget.clear() }, + removeLineWidget: function(widget) { widget.clear(); }, markText: function(from, to, options) { return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range") @@ -13625,116 +13940,116 @@ Doc.prototype = createObj(BranchChunk.prototype, { var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), insertLeft: options && options.insertLeft, clearWhenEmpty: false, shared: options && options.shared, - handleMouseEvents: options && options.handleMouseEvents} - pos = clipPos(this, pos) + handleMouseEvents: options && options.handleMouseEvents}; + pos = clipPos(this, pos); return markText(this, pos, pos, realOpts, "bookmark") }, findMarksAt: function(pos) { - pos = clipPos(this, pos) - var markers = [], spans = getLine(this, pos.line).markedSpans + pos = clipPos(this, pos); + var markers = [], spans = getLine(this, pos.line).markedSpans; if (spans) { for (var i = 0; i < spans.length; ++i) { - var span = spans[i] + var span = spans[i]; if ((span.from == null || span.from <= pos.ch) && (span.to == null || span.to >= pos.ch)) - { markers.push(span.marker.parent || span.marker) } + { markers.push(span.marker.parent || span.marker); } } } return markers }, findMarks: function(from, to, filter) { - from = clipPos(this, from); to = clipPos(this, to) - var found = [], lineNo = from.line + from = clipPos(this, from); to = clipPos(this, to); + var found = [], lineNo$$1 = from.line; this.iter(from.line, to.line + 1, function (line) { - var spans = line.markedSpans + var spans = line.markedSpans; if (spans) { for (var i = 0; i < spans.length; i++) { - var span = spans[i] - if (!(span.to != null && lineNo == from.line && from.ch >= span.to || - span.from == null && lineNo != from.line || - span.from != null && lineNo == to.line && span.from >= to.ch) && + var span = spans[i]; + if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to || + span.from == null && lineNo$$1 != from.line || + span.from != null && lineNo$$1 == to.line && span.from >= to.ch) && (!filter || filter(span.marker))) - { found.push(span.marker.parent || span.marker) } + { found.push(span.marker.parent || span.marker); } } } - ++lineNo - }) + ++lineNo$$1; + }); return found }, getAllMarks: function() { - var markers = [] + var markers = []; this.iter(function (line) { - var sps = line.markedSpans + var sps = line.markedSpans; if (sps) { for (var i = 0; i < sps.length; ++i) - { if (sps[i].from != null) { markers.push(sps[i].marker) } } } - }) + { if (sps[i].from != null) { markers.push(sps[i].marker); } } } + }); return markers }, posFromIndex: function(off) { - var ch, lineNo = this.first, sepSize = this.lineSeparator().length + var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length; this.iter(function (line) { - var sz = line.text.length + sepSize + var sz = line.text.length + sepSize; if (sz > off) { ch = off; return true } - off -= sz - ++lineNo - }) - return clipPos(this, Pos(lineNo, ch)) + off -= sz; + ++lineNo$$1; + }); + return clipPos(this, Pos(lineNo$$1, ch)) }, indexFromPos: function (coords) { - coords = clipPos(this, coords) - var index = coords.ch + coords = clipPos(this, coords); + var index = coords.ch; if (coords.line < this.first || coords.ch < 0) { return 0 } - var sepSize = this.lineSeparator().length + var sepSize = this.lineSeparator().length; this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value - index += line.text.length + sepSize - }) + index += line.text.length + sepSize; + }); return index }, copy: function(copyHistory) { var doc = new Doc(getLines(this, this.first, this.first + this.size), - this.modeOption, this.first, this.lineSep) - doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft - doc.sel = this.sel - doc.extend = false + this.modeOption, this.first, this.lineSep, this.direction); + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth - doc.setHistory(this.getHistory()) + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); } return doc }, linkedDoc: function(options) { - if (!options) { options = {} } - var from = this.first, to = this.first + this.size - if (options.from != null && options.from > from) { from = options.from } - if (options.to != null && options.to < to) { to = options.to } - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep) + if (!options) { options = {}; } + var from = this.first, to = this.first + this.size; + if (options.from != null && options.from > from) { from = options.from; } + if (options.to != null && options.to < to) { to = options.to; } + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); if (options.sharedHist) { copy.history = this.history - ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}) - copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}] - copySharedMarkers(copy, findSharedMarkers(this)) + ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + copySharedMarkers(copy, findSharedMarkers(this)); return copy }, unlinkDoc: function(other) { var this$1 = this; - if (other instanceof CodeMirror) { other = other.doc } + if (other instanceof CodeMirror$1) { other = other.doc; } if (this.linked) { for (var i = 0; i < this.linked.length; ++i) { - var link = this$1.linked[i] + var link = this$1.linked[i]; if (link.doc != other) { continue } - this$1.linked.splice(i, 1) - other.unlinkDoc(this$1) - detachSharedMarkers(findSharedMarkers(this$1)) + this$1.linked.splice(i, 1); + other.unlinkDoc(this$1); + detachSharedMarkers(findSharedMarkers(this$1)); break } } // If the histories were shared, split them again if (other.history == this.history) { - var splitIds = [other.id] - linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true) - other.history = new History(null) - other.history.done = copyHistoryArray(this.history.done, splitIds) - other.history.undone = copyHistoryArray(this.history.undone, splitIds) + var splitIds = [other.id]; + linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); } }, - iterLinkedDocs: function(f) {linkedDocs(this, f)}, + iterLinkedDocs: function(f) {linkedDocs(this, f);}, getMode: function() {return this.mode}, getEditor: function() {return this.cm}, @@ -13743,70 +14058,78 @@ Doc.prototype = createObj(BranchChunk.prototype, { if (this.lineSep) { return str.split(this.lineSep) } return splitLinesAuto(str) }, - lineSeparator: function() { return this.lineSep || "\n" } -}) + lineSeparator: function() { return this.lineSep || "\n" }, + + setDirection: docMethodOp(function (dir) { + if (dir != "rtl") { dir = "ltr"; } + if (dir == this.direction) { return } + this.direction = dir; + this.iter(function (line) { return line.order = null; }); + if (this.cm) { directionChanged(this.cm); } + }) +}); // Public alias. -Doc.prototype.eachLine = Doc.prototype.iter +Doc.prototype.eachLine = Doc.prototype.iter; // Kludge to work around strange IE behavior where it'll sometimes // re-fire a series of drag-related events right after the drop (#1551) -var lastDrop = 0 +var lastDrop = 0; function onDrop(e) { - var cm = this - clearDragCursor(cm) + var cm = this; + clearDragCursor(cm); if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } - e_preventDefault(e) - if (ie) { lastDrop = +new Date } - var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files + e_preventDefault(e); + if (ie) { lastDrop = +new Date; } + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; if (!pos || cm.isReadOnly()) { return } // Might be a file drop, in which case we simply extract the text // and insert it. if (files && files.length && window.FileReader && window.File) { - var n = files.length, text = Array(n), read = 0 + var n = files.length, text = Array(n), read = 0; var loadFile = function (file, i) { if (cm.options.allowDropFileTypes && indexOf(cm.options.allowDropFileTypes, file.type) == -1) { return } - var reader = new FileReader + var reader = new FileReader; reader.onload = operation(cm, function () { - var content = reader.result - if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = "" } - text[i] = content + var content = reader.result; + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = ""; } + text[i] = content; if (++read == n) { - pos = clipPos(cm.doc, pos) + pos = clipPos(cm.doc, pos); var change = {from: pos, to: pos, text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), - origin: "paste"} - makeChange(cm.doc, change) - setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))) + origin: "paste"}; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); } - }) - reader.readAsText(file) - } - for (var i = 0; i < n; ++i) { loadFile(files[i], i) } + }); + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) { loadFile(files[i], i); } } else { // Normal drop // Don't do a replace if the drop happened inside of the selected text. if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e) + cm.state.draggingText(e); // Ensure the editor is re-focused - setTimeout(function () { return cm.display.input.focus(); }, 20) + setTimeout(function () { return cm.display.input.focus(); }, 20); return } try { - var text$1 = e.dataTransfer.getData("Text") + var text$1 = e.dataTransfer.getData("Text"); if (text$1) { - var selected + var selected; if (cm.state.draggingText && !cm.state.draggingText.copy) - { selected = cm.listSelections() } - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)) + { selected = cm.listSelections(); } + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1) - { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag") } } - cm.replaceSelection(text$1, "around", "paste") - cm.display.input.focus() + { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); } } + cm.replaceSelection(text$1, "around", "paste"); + cm.display.input.focus(); } } catch(e){} @@ -13817,41 +14140,41 @@ function onDragStart(cm, e) { if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return } if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } - e.dataTransfer.setData("Text", cm.getSelection()) - e.dataTransfer.effectAllowed = "copyMove" + e.dataTransfer.setData("Text", cm.getSelection()); + e.dataTransfer.effectAllowed = "copyMove"; // Use dummy image instead of default browsers image. // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;") - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; if (presto) { - img.width = img.height = 1 - cm.display.wrapper.appendChild(img) + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); // Force a relayout, or Opera won't use our image for some obscure reason - img._top = img.offsetTop + img._top = img.offsetTop; } - e.dataTransfer.setDragImage(img, 0, 0) - if (presto) { img.parentNode.removeChild(img) } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) { img.parentNode.removeChild(img); } } } function onDragOver(cm, e) { - var pos = posFromMouse(cm, e) + var pos = posFromMouse(cm, e); if (!pos) { return } - var frag = document.createDocumentFragment() - drawSelectionCursor(cm, pos, frag) + var frag = document.createDocumentFragment(); + drawSelectionCursor(cm, pos, frag); if (!cm.display.dragCursor) { - cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors") - cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv) + cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); + cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); } - removeChildrenAndAdd(cm.display.dragCursor, frag) + removeChildrenAndAdd(cm.display.dragCursor, frag); } function clearDragCursor(cm) { if (cm.display.dragCursor) { - cm.display.lineSpace.removeChild(cm.display.dragCursor) - cm.display.dragCursor = null + cm.display.lineSpace.removeChild(cm.display.dragCursor); + cm.display.dragCursor = null; } } @@ -13860,62 +14183,62 @@ function clearDragCursor(cm) { // garbage collected. function forEachCodeMirror(f) { - if (!document.body.getElementsByClassName) { return } - var byClass = document.body.getElementsByClassName("CodeMirror") + if (!document.getElementsByClassName) { return } + var byClass = document.getElementsByClassName("CodeMirror"); for (var i = 0; i < byClass.length; i++) { - var cm = byClass[i].CodeMirror - if (cm) { f(cm) } + var cm = byClass[i].CodeMirror; + if (cm) { f(cm); } } } -var globalsRegistered = false +var globalsRegistered = false; function ensureGlobalHandlers() { if (globalsRegistered) { return } - registerGlobalHandlers() - globalsRegistered = true + registerGlobalHandlers(); + globalsRegistered = true; } function registerGlobalHandlers() { // When the window resizes, we need to refresh active editors. - var resizeTimer + var resizeTimer; on(window, "resize", function () { if (resizeTimer == null) { resizeTimer = setTimeout(function () { - resizeTimer = null - forEachCodeMirror(onResize) - }, 100) } - }) + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); } + }); // When the window loses focus, we want to show the editor as blurred - on(window, "blur", function () { return forEachCodeMirror(onBlur); }) + on(window, "blur", function () { return forEachCodeMirror(onBlur); }); } // Called when the window resizes function onResize(cm) { - var d = cm.display + var d = cm.display; if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) { return } // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null - d.scrollbarsClipped = false - cm.setSize() + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); } var keyNames = { - 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", - 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", + 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", 145: "ScrollLock", 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" -} +}; // Number keys -for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) } +for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); } // Alphabetic keys -for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) } +for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); } // Function keys -for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2 } +for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; } -var keyMap = {} +var keyMap = {}; keyMap.basic = { "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", @@ -13924,7 +14247,7 @@ keyMap.basic = { "Tab": "defaultTab", "Shift-Tab": "indentAuto", "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", "Esc": "singleSelection" -} +}; // Note that the save and find-related commands aren't defined by // default. User code or addons can define them. Unknown commands // are simply ignored. @@ -13937,7 +14260,7 @@ keyMap.pcDefault = { "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", fallthrough: "basic" -} +}; // Very basic readline/emacs-style bindings, which are standard on Mac. keyMap.emacsy = { "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", @@ -13945,7 +14268,7 @@ keyMap.emacsy = { "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", "Ctrl-O": "openLine" -} +}; keyMap.macDefault = { "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", @@ -13955,27 +14278,27 @@ keyMap.macDefault = { "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", fallthrough: ["basic", "emacsy"] -} -keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault +}; +keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; // KEYMAP DISPATCH function normalizeKeyName(name) { - var parts = name.split(/-(?!$)/) - name = parts[parts.length - 1] - var alt, ctrl, shift, cmd + var parts = name.split(/-(?!$)/); + name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; for (var i = 0; i < parts.length - 1; i++) { - var mod = parts[i] - if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true } - else if (/^a(lt)?$/i.test(mod)) { alt = true } - else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true } - else if (/^s(hift)?$/i.test(mod)) { shift = true } + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; } + else if (/^a(lt)?$/i.test(mod)) { alt = true; } + else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; } + else if (/^s(hift)?$/i.test(mod)) { shift = true; } else { throw new Error("Unrecognized modifier name: " + mod) } } - if (alt) { name = "Alt-" + name } - if (ctrl) { name = "Ctrl-" + name } - if (cmd) { name = "Cmd-" + name } - if (shift) { name = "Shift-" + name } + if (alt) { name = "Alt-" + name; } + if (ctrl) { name = "Ctrl-" + name; } + if (cmd) { name = "Cmd-" + name; } + if (shift) { name = "Shift-" + name; } return name } @@ -13985,44 +14308,44 @@ function normalizeKeyName(name) { // new normalized keymap, and then updates the old object to reflect // this. function normalizeKeyMap(keymap) { - var copy = {} + var copy = {}; for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) { - var value = keymap[keyname] + var value = keymap[keyname]; if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue } if (value == "...") { delete keymap[keyname]; continue } - var keys = map(keyname.split(" "), normalizeKeyName) + var keys = map(keyname.split(" "), normalizeKeyName); for (var i = 0; i < keys.length; i++) { - var val = (void 0), name = (void 0) + var val = (void 0), name = (void 0); if (i == keys.length - 1) { - name = keys.join(" ") - val = value + name = keys.join(" "); + val = value; } else { - name = keys.slice(0, i + 1).join(" ") - val = "..." + name = keys.slice(0, i + 1).join(" "); + val = "..."; } - var prev = copy[name] - if (!prev) { copy[name] = val } + var prev = copy[name]; + if (!prev) { copy[name] = val; } else if (prev != val) { throw new Error("Inconsistent bindings for " + name) } } - delete keymap[keyname] + delete keymap[keyname]; } } - for (var prop in copy) { keymap[prop] = copy[prop] } + for (var prop in copy) { keymap[prop] = copy[prop]; } return keymap } -function lookupKey(key, map, handle, context) { - map = getKeyMap(map) - var found = map.call ? map.call(key, context) : map[key] +function lookupKey(key, map$$1, handle, context) { + map$$1 = getKeyMap(map$$1); + var found = map$$1.call ? map$$1.call(key, context) : map$$1[key]; if (found === false) { return "nothing" } if (found === "...") { return "multi" } if (found != null && handle(found)) { return "handled" } - if (map.fallthrough) { - if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") - { return lookupKey(key, map.fallthrough, handle, context) } - for (var i = 0; i < map.fallthrough.length; i++) { - var result = lookupKey(key, map.fallthrough[i], handle, context) + if (map$$1.fallthrough) { + if (Object.prototype.toString.call(map$$1.fallthrough) != "[object Array]") + { return lookupKey(key, map$$1.fallthrough, handle, context) } + for (var i = 0; i < map$$1.fallthrough.length; i++) { + var result = lookupKey(key, map$$1.fallthrough[i], handle, context); if (result) { return result } } } @@ -14031,20 +14354,28 @@ function lookupKey(key, map, handle, context) { // Modifier key presses don't count as 'real' key presses for the // purpose of keymap fallthrough. function isModifierKey(value) { - var name = typeof value == "string" ? value : keyNames[value.keyCode] + var name = typeof value == "string" ? value : keyNames[value.keyCode]; return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod" } +function addModifierNames(name, event, noShift) { + var base = name; + if (event.altKey && base != "Alt") { name = "Alt-" + name; } + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; } + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name; } + if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name; } + return name +} + // Look up the name of a key as indicated by an event object. function keyName(event, noShift) { if (presto && event.keyCode == 34 && event["char"]) { return false } - var base = keyNames[event.keyCode], name = base + var name = keyNames[event.keyCode]; if (name == null || event.altGraphKey) { return false } - if (event.altKey && base != "Alt") { name = "Alt-" + name } - if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name } - if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name } - if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name } - return name + // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause, + // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+) + if (event.keyCode == 3 && event.code) { name = event.code; } + return addModifierNames(name, event, noShift) } function getKeyMap(val) { @@ -14054,26 +14385,132 @@ function getKeyMap(val) { // Helper for deleting text near the selection(s), used to implement // backspace, delete, and similar functionality. function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, kill = [] + var ranges = cm.doc.sel.ranges, kill = []; // Build up a set of ranges to kill first, merging overlapping // ranges. for (var i = 0; i < ranges.length; i++) { - var toKill = compute(ranges[i]) + var toKill = compute(ranges[i]); while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop() + var replaced = kill.pop(); if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from + toKill.from = replaced.from; break } } - kill.push(toKill) + kill.push(toKill); } // Next, remove those actual ranges. runInOp(cm, function () { for (var i = kill.length - 1; i >= 0; i--) - { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete") } - ensureCursorVisible(cm) - }) + { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); } + ensureCursorVisible(cm); + }); +} + +function moveCharLogically(line, ch, dir) { + var target = skipExtendingChars(line.text, ch + dir, dir); + return target < 0 || target > line.text.length ? null : target +} + +function moveLogically(line, start, dir) { + var ch = moveCharLogically(line, start.ch, dir); + return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") +} + +function endOfLine(visually, cm, lineObj, lineNo, dir) { + if (visually) { + var order = getOrder(lineObj, cm.doc.direction); + if (order) { + var part = dir < 0 ? lst(order) : order[0]; + var moveInStorageOrder = (dir < 0) == (part.level == 1); + var sticky = moveInStorageOrder ? "after" : "before"; + var ch; + // With a wrapped rtl chunk (possibly spanning multiple bidi parts), + // it could be that the last bidi part is not on the last visual line, + // since visual lines contain content order-consecutive chunks. + // Thus, in rtl, we are looking for the first (content-order) character + // in the rtl chunk that is on the last line (that is, the same line + // as the last (content-order) character). + if (part.level > 0 || cm.doc.direction == "rtl") { + var prep = prepareMeasureForLine(cm, lineObj); + ch = dir < 0 ? lineObj.text.length - 1 : 0; + var targetTop = measureCharPrepared(cm, prep, ch).top; + ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch); + if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1); } + } else { ch = dir < 0 ? part.to : part.from; } + return new Pos(lineNo, ch, sticky) + } + } + return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") +} + +function moveVisually(cm, line, start, dir) { + var bidi = getOrder(line, cm.doc.direction); + if (!bidi) { return moveLogically(line, start, dir) } + if (start.ch >= line.text.length) { + start.ch = line.text.length; + start.sticky = "before"; + } else if (start.ch <= 0) { + start.ch = 0; + start.sticky = "after"; + } + var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]; + if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { + // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, + // nothing interesting happens. + return moveLogically(line, start, dir) + } + + var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }; + var prep; + var getWrappedLineExtent = function (ch) { + if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} } + prep = prep || prepareMeasureForLine(cm, line); + return wrappedLineExtentChar(cm, line, prep, ch) + }; + var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); + + if (cm.doc.direction == "rtl" || part.level == 1) { + var moveInStorageOrder = (part.level == 1) == (dir < 0); + var ch = mv(start, moveInStorageOrder ? 1 : -1); + if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { + // Case 2: We move within an rtl part or in an rtl editor on the same visual line + var sticky = moveInStorageOrder ? "before" : "after"; + return new Pos(start.line, ch, sticky) + } + } + + // Case 3: Could not move within this bidi part in this visual line, so leave + // the current bidi part + + var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { + var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder + ? new Pos(start.line, mv(ch, 1), "before") + : new Pos(start.line, ch, "after"); }; + + for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { + var part = bidi[partPos]; + var moveInStorageOrder = (dir > 0) == (part.level != 1); + var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1); + if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) } + ch = moveInStorageOrder ? part.from : mv(part.to, -1); + if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) } + } + }; + + // Case 3a: Look for other bidi parts on the same visual line + var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent); + if (res) { return res } + + // Case 3b: Look for other bidi parts on the next visual line + var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1); + if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { + res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); + if (res) { return res } + } + + // Case 4: Nowhere to move + return null } // Commands are parameter-less actions that can be performed on an @@ -14083,7 +14520,7 @@ var commands = { singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, killLine: function (cm) { return deleteNearSelection(cm, function (range) { if (range.empty()) { - var len = getLine(cm.doc, range.head.line).text.length + var len = getLine(cm.doc, range.head.line).text.length; if (range.head.ch == len && range.head.line < cm.lastLine()) { return {from: range.head, to: Pos(range.head.line + 1, 0)} } else @@ -14100,13 +14537,13 @@ var commands = { from: Pos(range.from().line, 0), to: range.from() }); }); }, delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { - var top = cm.charCoords(range.head, "div").top + 5 - var leftPos = cm.coordsChar({left: 0, top: top}, "div") + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({left: 0, top: top}, "div"); return {from: leftPos, to: range.from()} }); }, delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) { - var top = cm.charCoords(range.head, "div").top + 5 - var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); return {from: range.from(), to: rightPos } }); }, undo: function (cm) { return cm.undo(); }, @@ -14125,16 +14562,16 @@ var commands = { {origin: "+move", bias: -1} ); }, goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.charCoords(range.head, "div").top + 5 + var top = cm.cursorCoords(range.head, "div").top + 5; return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") }, sel_move); }, goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.charCoords(range.head, "div").top + 5 + var top = cm.cursorCoords(range.head, "div").top + 5; return cm.coordsChar({left: 0, top: top}, "div") }, sel_move); }, goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.charCoords(range.head, "div").top + 5 - var pos = cm.coordsChar({left: 0, top: top}, "div") + var top = cm.cursorCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({left: 0, top: top}, "div"); if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) } return pos }, sel_move); }, @@ -14161,17 +14598,17 @@ var commands = { indentLess: function (cm) { return cm.indentSelection("subtract"); }, insertTab: function (cm) { return cm.replaceSelection("\t"); }, insertSoftTab: function (cm) { - var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].from() - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize) - spaces.push(spaceStr(tabSize - col % tabSize)) + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(spaceStr(tabSize - col % tabSize)); } - cm.replaceSelections(spaces) + cm.replaceSelections(spaces); }, defaultTab: function (cm) { - if (cm.somethingSelected()) { cm.indentSelection("add") } - else { cm.execCommand("insertTab") } + if (cm.somethingSelected()) { cm.indentSelection("add"); } + else { cm.execCommand("insertTab"); } }, // Swap the two chars left and right of each selection's head. // Move cursor behind the two swapped characters afterwards. @@ -14181,70 +14618,64 @@ var commands = { // Doesn't do anything on an empty line. // Doesn't do anything with non-empty selections. transposeChars: function (cm) { return runInOp(cm, function () { - var ranges = cm.listSelections(), newSel = [] + var ranges = cm.listSelections(), newSel = []; for (var i = 0; i < ranges.length; i++) { if (!ranges[i].empty()) { continue } - var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; if (line) { - if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) } + if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); } if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1) + cur = new Pos(cur.line, cur.ch + 1); cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), - Pos(cur.line, cur.ch - 2), cur, "+transpose") + Pos(cur.line, cur.ch - 2), cur, "+transpose"); } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text + var prev = getLine(cm.doc, cur.line - 1).text; if (prev) { - cur = new Pos(cur.line, 1) + cur = new Pos(cur.line, 1); cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + prev.charAt(prev.length - 1), - Pos(cur.line - 1, prev.length - 1), cur, "+transpose") + Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); } } } - newSel.push(new Range(cur, cur)) + newSel.push(new Range(cur, cur)); } - cm.setSelections(newSel) + cm.setSelections(newSel); }); }, newlineAndIndent: function (cm) { return runInOp(cm, function () { - var sels = cm.listSelections() + var sels = cm.listSelections(); for (var i = sels.length - 1; i >= 0; i--) - { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input") } - sels = cm.listSelections() + { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); } + sels = cm.listSelections(); for (var i$1 = 0; i$1 < sels.length; i$1++) - { cm.indentLine(sels[i$1].from().line, null, true) } - ensureCursorVisible(cm) + { cm.indentLine(sels[i$1].from().line, null, true); } + ensureCursorVisible(cm); }); }, openLine: function (cm) { return cm.replaceSelection("\n", "start"); }, toggleOverwrite: function (cm) { return cm.toggleOverwrite(); } -} +}; function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN) - var visual = visualLine(line) - if (visual != line) { lineN = lineNo(visual) } - var order = getOrder(visual) - var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual) - return Pos(lineN, ch) + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) { lineN = lineNo(visual); } + return endOfLine(true, cm, visual, lineN, 1) } function lineEnd(cm, lineN) { - var merged, line = getLine(cm.doc, lineN) - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line - lineN = null - } - var order = getOrder(line) - var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line) - return Pos(lineN == null ? lineNo(line) : lineN, ch) + var line = getLine(cm.doc, lineN); + var visual = visualLineEnd(line); + if (visual != line) { lineN = lineNo(visual); } + return endOfLine(true, cm, line, lineN, -1) } function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line) - var line = getLine(cm.doc, start.line) - var order = getOrder(line) + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line, cm.doc.direction); if (!order || order[0].level == 0) { - var firstNonWS = Math.max(0, line.text.search(/\S/)) - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch - return Pos(start.line, inWS ? 0 : firstNonWS) + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) } return start } @@ -14252,68 +14683,75 @@ function lineStartSmart(cm, pos) { // Run a handler that was bound to a key. function doHandleBinding(cm, bound, dropShift) { if (typeof bound == "string") { - bound = commands[bound] + bound = commands[bound]; if (!bound) { return false } } // Ensure previous input has been read, so that the handler sees a // consistent view of the document - cm.display.input.ensurePolled() - var prevShift = cm.display.shift, done = false + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, done = false; try { - if (cm.isReadOnly()) { cm.state.suppressEdits = true } - if (dropShift) { cm.display.shift = false } - done = bound(cm) != Pass + if (cm.isReadOnly()) { cm.state.suppressEdits = true; } + if (dropShift) { cm.display.shift = false; } + done = bound(cm) != Pass; } finally { - cm.display.shift = prevShift - cm.state.suppressEdits = false + cm.display.shift = prevShift; + cm.state.suppressEdits = false; } return done } function lookupKeyForEditor(cm, name, handle) { for (var i = 0; i < cm.state.keyMaps.length; i++) { - var result = lookupKey(name, cm.state.keyMaps[i], handle, cm) + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); if (result) { return result } } return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) || lookupKey(name, cm.options.keyMap, handle, cm) } -var stopSeq = new Delayed +// Note that, despite the name, this function is also used to check +// for bound mouse clicks. + +var stopSeq = new Delayed; + function dispatchKey(cm, name, e, handle) { - var seq = cm.state.keySeq + var seq = cm.state.keySeq; if (seq) { if (isModifierKey(name)) { return "handled" } - stopSeq.set(50, function () { - if (cm.state.keySeq == seq) { - cm.state.keySeq = null - cm.display.input.reset() - } - }) - name = seq + " " + name + if (/\'$/.test(name)) + { cm.state.keySeq = null; } + else + { stopSeq.set(50, function () { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); + } + }); } + if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true } } - var result = lookupKeyForEditor(cm, name, handle) + return dispatchKeyInner(cm, name, e, handle) +} + +function dispatchKeyInner(cm, name, e, handle) { + var result = lookupKeyForEditor(cm, name, handle); if (result == "multi") - { cm.state.keySeq = name } + { cm.state.keySeq = name; } if (result == "handled") - { signalLater(cm, "keyHandled", cm, name, e) } + { signalLater(cm, "keyHandled", cm, name, e); } if (result == "handled" || result == "multi") { - e_preventDefault(e) - restartBlink(cm) + e_preventDefault(e); + restartBlink(cm); } - if (seq && !result && /\'$/.test(name)) { - e_preventDefault(e) - return true - } return !!result } // Handle a key from the keydown event. function handleKeyBinding(cm, e) { - var name = keyName(e, true) + var name = keyName(e, true); if (!name) { return false } if (e.shiftKey && !cm.state.keySeq) { @@ -14335,59 +14773,90 @@ function handleCharBinding(cm, e, ch) { return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) } -var lastStoppedKey = null +var lastStoppedKey = null; function onKeyDown(e) { - var cm = this - cm.curOp.focus = activeElt() + var cm = this; + cm.curOp.focus = activeElt(); if (signalDOMEvent(cm, e)) { return } // IE does strange things with escape. - if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false } - var code = e.keyCode - cm.display.shift = code == 16 || e.shiftKey - var handled = handleKeyBinding(cm, e) + if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; } + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); if (presto) { - lastStoppedKey = handled ? code : null + lastStoppedKey = handled ? code : null; // Opera has no cut event... we try to at least catch the key combo if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) - { cm.replaceSelection("", null, "cut") } + { cm.replaceSelection("", null, "cut"); } } // Turn mouse into crosshair when Alt is held on Mac. if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) - { showCrossHair(cm) } + { showCrossHair(cm); } } function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv - addClass(lineDiv, "CodeMirror-crosshair") + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); function up(e) { if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair") - off(document, "keyup", up) - off(document, "mouseover", up) + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); } } - on(document, "keyup", up) - on(document, "mouseover", up) + on(document, "keyup", up); + on(document, "mouseover", up); } function onKeyUp(e) { - if (e.keyCode == 16) { this.doc.sel.shift = false } - signalDOMEvent(this, e) + if (e.keyCode == 16) { this.doc.sel.shift = false; } + signalDOMEvent(this, e); } function onKeyPress(e) { - var cm = this + var cm = this; if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } - var keyCode = e.keyCode, charCode = e.charCode + var keyCode = e.keyCode, charCode = e.charCode; if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return } - var ch = String.fromCharCode(charCode == null ? keyCode : charCode) + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); // Some browsers fire keypress events for backspace if (ch == "\x08") { return } if (handleCharBinding(cm, e, ch)) { return } - cm.display.input.onKeyPress(e) + cm.display.input.onKeyPress(e); +} + +var DOUBLECLICK_DELAY = 400; + +var PastClick = function(time, pos, button) { + this.time = time; + this.pos = pos; + this.button = button; +}; + +PastClick.prototype.compare = function (time, pos, button) { + return this.time + DOUBLECLICK_DELAY > time && + cmp(pos, this.pos) == 0 && button == this.button +}; + +var lastClick; +var lastDoubleClick; +function clickRepeat(pos, button) { + var now = +new Date; + if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { + lastClick = lastDoubleClick = null; + return "triple" + } else if (lastClick && lastClick.compare(now, pos, button)) { + lastDoubleClick = new PastClick(now, pos, button); + lastClick = null; + return "double" + } else { + lastClick = new PastClick(now, pos, button); + lastDoubleClick = null; + return "single" + } } // A mouse down can be a single click, double click, triple click, @@ -14396,272 +14865,332 @@ function onKeyPress(e) { // middle-click-paste. Or it might be a click on something we should // not interfere with, such as a scrollbar or widget. function onMouseDown(e) { - var cm = this, display = cm.display + var cm = this, display = cm.display; if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return } - display.input.ensurePolled() - display.shift = e.shiftKey + display.input.ensurePolled(); + display.shift = e.shiftKey; if (eventInWidget(display, e)) { if (!webkit) { // Briefly turn off draggability, to allow widgets to do // normal dragging things. - display.scroller.draggable = false - setTimeout(function () { return display.scroller.draggable = true; }, 100) + display.scroller.draggable = false; + setTimeout(function () { return display.scroller.draggable = true; }, 100); } return } if (clickInGutter(cm, e)) { return } - var start = posFromMouse(cm, e) - window.focus() - - switch (e_button(e)) { - case 1: - // #3261: make sure, that we're not starting a second selection - if (cm.state.selectingText) - { cm.state.selectingText(e) } - else if (start) - { leftButtonDown(cm, e, start) } - else if (e_target(e) == display.scroller) - { e_preventDefault(e) } - break - case 2: - if (webkit) { cm.state.lastMiddleDown = +new Date } - if (start) { extendSelection(cm.doc, start) } - setTimeout(function () { return display.input.focus(); }, 20) - e_preventDefault(e) - break - case 3: - if (captureRightClick) { onContextMenu(cm, e) } - else { delayBlurEvent(cm) } - break + var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"; + window.focus(); + + // #3261: make sure, that we're not starting a second selection + if (button == 1 && cm.state.selectingText) + { cm.state.selectingText(e); } + + if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return } + + if (button == 1) { + if (pos) { leftButtonDown(cm, pos, repeat, e); } + else if (e_target(e) == display.scroller) { e_preventDefault(e); } + } else if (button == 2) { + if (pos) { extendSelection(cm.doc, pos); } + setTimeout(function () { return display.input.focus(); }, 20); + } else if (button == 3) { + if (captureRightClick) { onContextMenu(cm, e); } + else { delayBlurEvent(cm); } } } -var lastClick; -var lastDoubleClick; -function leftButtonDown(cm, e, start) { - if (ie) { setTimeout(bind(ensureFocus, cm), 0) } - else { cm.curOp.focus = activeElt() } - - var now = +new Date, type - if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { - type = "triple" - } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { - type = "double" - lastDoubleClick = {time: now, pos: start} - } else { - type = "single" - lastClick = {time: now, pos: start} +function handleMappedButton(cm, button, pos, repeat, event) { + var name = "Click"; + if (repeat == "double") { name = "Double" + name; } + else if (repeat == "triple") { name = "Triple" + name; } + name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; + + return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { + if (typeof bound == "string") { bound = commands[bound]; } + if (!bound) { return false } + var done = false; + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true; } + done = bound(cm, pos) != Pass; + } finally { + cm.state.suppressEdits = false; + } + return done + }) +} + +function configureMouse(cm, repeat, event) { + var option = cm.getOption("configureMouse"); + var value = option ? option(cm, repeat, event) : {}; + if (value.unit == null) { + var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; + value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; } + if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; } + if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; } + if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); } + return value +} - var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained +function leftButtonDown(cm, pos, repeat, event) { + if (ie) { setTimeout(bind(ensureFocus, cm), 0); } + else { cm.curOp.focus = activeElt(); } + + var behavior = configureMouse(cm, repeat, event); + + var sel = cm.doc.sel, contained; if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && - type == "single" && (contained = sel.contains(start)) > -1 && - (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) && - (cmp(contained.to(), start) > 0 || start.xRel < 0)) - { leftButtonStartDrag(cm, e, start, modifier) } + repeat == "single" && (contained = sel.contains(pos)) > -1 && + (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && + (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) + { leftButtonStartDrag(cm, event, pos, behavior); } else - { leftButtonSelect(cm, e, start, type, modifier) } + { leftButtonSelect(cm, event, pos, behavior); } } // Start a text drag. When it ends, see if any dragging actually // happen, and treat as a click if it didn't. -function leftButtonStartDrag(cm, e, start, modifier) { - var display = cm.display, startTime = +new Date - var dragEnd = operation(cm, function (e2) { - if (webkit) { display.scroller.draggable = false } - cm.state.draggingText = false - off(document, "mouseup", dragEnd) - off(display.scroller, "drop", dragEnd) - if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { - e_preventDefault(e2) - if (!modifier && +new Date - 200 < startTime) - { extendSelection(cm.doc, start) } +function leftButtonStartDrag(cm, event, pos, behavior) { + var display = cm.display, moved = false; + var dragEnd = operation(cm, function (e) { + if (webkit) { display.scroller.draggable = false; } + cm.state.draggingText = false; + off(display.wrapper.ownerDocument, "mouseup", dragEnd); + off(display.wrapper.ownerDocument, "mousemove", mouseMove); + off(display.scroller, "dragstart", dragStart); + off(display.scroller, "drop", dragEnd); + if (!moved) { + e_preventDefault(e); + if (!behavior.addNew) + { extendSelection(cm.doc, pos, null, null, behavior.extend); } // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) if (webkit || ie && ie_version == 9) - { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) } + { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); } else - { display.input.focus() } + { display.input.focus(); } } - }) + }); + var mouseMove = function(e2) { + moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; + }; + var dragStart = function () { return moved = true; }; // Let the drag handler handle this. - if (webkit) { display.scroller.draggable = true } - cm.state.draggingText = dragEnd - dragEnd.copy = mac ? e.altKey : e.ctrlKey + if (webkit) { display.scroller.draggable = true; } + cm.state.draggingText = dragEnd; + dragEnd.copy = !behavior.moveOnDrag; // IE's approach to draggable - if (display.scroller.dragDrop) { display.scroller.dragDrop() } - on(document, "mouseup", dragEnd) - on(display.scroller, "drop", dragEnd) + if (display.scroller.dragDrop) { display.scroller.dragDrop(); } + on(display.wrapper.ownerDocument, "mouseup", dragEnd); + on(display.wrapper.ownerDocument, "mousemove", mouseMove); + on(display.scroller, "dragstart", dragStart); + on(display.scroller, "drop", dragEnd); + + delayBlurEvent(cm); + setTimeout(function () { return display.input.focus(); }, 20); +} + +function rangeForUnit(cm, pos, unit) { + if (unit == "char") { return new Range(pos, pos) } + if (unit == "word") { return cm.findWordAt(pos) } + if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } + var result = unit(cm, pos); + return new Range(result.from, result.to) } // Normal selection, as opposed to text dragging. -function leftButtonSelect(cm, e, start, type, addNew) { - var display = cm.display, doc = cm.doc - e_preventDefault(e) +function leftButtonSelect(cm, event, start, behavior) { + var display = cm.display, doc = cm.doc; + e_preventDefault(event); - var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges - if (addNew && !e.shiftKey) { - ourIndex = doc.sel.contains(start) + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; + if (behavior.addNew && !behavior.extend) { + ourIndex = doc.sel.contains(start); if (ourIndex > -1) - { ourRange = ranges[ourIndex] } + { ourRange = ranges[ourIndex]; } else - { ourRange = new Range(start, start) } + { ourRange = new Range(start, start); } } else { - ourRange = doc.sel.primary() - ourIndex = doc.sel.primIndex - } - - if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) { - type = "rect" - if (!addNew) { ourRange = new Range(start, start) } - start = posFromMouse(cm, e, true, true) - ourIndex = -1 - } else if (type == "double") { - var word = cm.findWordAt(start) - if (cm.display.shift || doc.extend) - { ourRange = extendRange(doc, ourRange, word.anchor, word.head) } - else - { ourRange = word } - } else if (type == "triple") { - var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))) - if (cm.display.shift || doc.extend) - { ourRange = extendRange(doc, ourRange, line.anchor, line.head) } - else - { ourRange = line } + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; + } + + if (behavior.unit == "rectangle") { + if (!behavior.addNew) { ourRange = new Range(start, start); } + start = posFromMouse(cm, event, true, true); + ourIndex = -1; } else { - ourRange = extendRange(doc, ourRange, start) + var range$$1 = rangeForUnit(cm, start, behavior.unit); + if (behavior.extend) + { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); } + else + { ourRange = range$$1; } } - if (!addNew) { - ourIndex = 0 - setSelection(doc, new Selection([ourRange], 0), sel_mouse) - startSel = doc.sel + if (!behavior.addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; } else if (ourIndex == -1) { - ourIndex = ranges.length + ourIndex = ranges.length; setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), - {scroll: false, origin: "*mouse"}) - } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) { + {scroll: false, origin: "*mouse"}); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), - {scroll: false, origin: "*mouse"}) - startSel = doc.sel + {scroll: false, origin: "*mouse"}); + startSel = doc.sel; } else { - replaceOneSelection(doc, ourIndex, ourRange, sel_mouse) + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); } - var lastPos = start + var lastPos = start; function extendTo(pos) { if (cmp(lastPos, pos) == 0) { return } - lastPos = pos + lastPos = pos; - if (type == "rect") { - var ranges = [], tabSize = cm.options.tabSize - var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize) - var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize) - var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol) + if (behavior.unit == "rectangle") { + var ranges = [], tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); line <= end; line++) { - var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize) + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); if (left == right) - { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) } + { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); } else if (text.length > leftPos) - { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) } + { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } } - if (!ranges.length) { ranges.push(new Range(start, start)) } + if (!ranges.length) { ranges.push(new Range(start, start)); } setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), - {origin: "*mouse", scroll: false}) - cm.scrollIntoView(pos) + {origin: "*mouse", scroll: false}); + cm.scrollIntoView(pos); } else { - var oldRange = ourRange - var anchor = oldRange.anchor, head = pos - if (type != "single") { - var range - if (type == "double") - { range = cm.findWordAt(pos) } - else - { range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) } - if (cmp(range.anchor, anchor) > 0) { - head = range.head - anchor = minPos(oldRange.from(), range.anchor) - } else { - head = range.anchor - anchor = maxPos(oldRange.to(), range.head) - } + var oldRange = ourRange; + var range$$1 = rangeForUnit(cm, pos, behavior.unit); + var anchor = oldRange.anchor, head; + if (cmp(range$$1.anchor, anchor) > 0) { + head = range$$1.head; + anchor = minPos(oldRange.from(), range$$1.anchor); + } else { + head = range$$1.anchor; + anchor = maxPos(oldRange.to(), range$$1.head); } - var ranges$1 = startSel.ranges.slice(0) - ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head) - setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse) + var ranges$1 = startSel.ranges.slice(0); + ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); + setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse); } } - var editorSize = display.wrapper.getBoundingClientRect() + var editorSize = display.wrapper.getBoundingClientRect(); // Used to ensure timeout re-tries don't fire when another extend // happened in the meantime (clearTimeout isn't reliable -- at // least on Chrome, the timeouts still happen even when cleared, // if the clear happens after their scheduled firing time). - var counter = 0 + var counter = 0; function extend(e) { - var curCount = ++counter - var cur = posFromMouse(cm, e, true, type == "rect") + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); if (!cur) { return } if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt() - extendTo(cur) - var visible = visibleLines(display, doc) + cm.curOp.focus = activeElt(); + extendTo(cur); + var visible = visibleLines(display, doc); if (cur.line >= visible.to || cur.line < visible.from) - { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) } + { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0 + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; if (outside) { setTimeout(operation(cm, function () { if (counter != curCount) { return } - display.scroller.scrollTop += outside - extend(e) - }), 50) } + display.scroller.scrollTop += outside; + extend(e); + }), 50); } } } function done(e) { - cm.state.selectingText = false - counter = Infinity - e_preventDefault(e) - display.input.focus() - off(document, "mousemove", move) - off(document, "mouseup", up) - doc.history.lastSelOrigin = null + cm.state.selectingText = false; + counter = Infinity; + e_preventDefault(e); + display.input.focus(); + off(display.wrapper.ownerDocument, "mousemove", move); + off(display.wrapper.ownerDocument, "mouseup", up); + doc.history.lastSelOrigin = null; } var move = operation(cm, function (e) { - if (!e_button(e)) { done(e) } - else { extend(e) } - }) - var up = operation(cm, done) - cm.state.selectingText = up - on(document, "mousemove", move) - on(document, "mouseup", up) + if (e.buttons === 0 || !e_button(e)) { done(e); } + else { extend(e); } + }); + var up = operation(cm, done); + cm.state.selectingText = up; + on(display.wrapper.ownerDocument, "mousemove", move); + on(display.wrapper.ownerDocument, "mouseup", up); +} + +// Used when mouse-selecting to adjust the anchor to the proper side +// of a bidi jump depending on the visual position of the head. +function bidiSimplify(cm, range$$1) { + var anchor = range$$1.anchor; + var head = range$$1.head; + var anchorLine = getLine(cm.doc, anchor.line); + if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 } + var order = getOrder(anchorLine); + if (!order) { return range$$1 } + var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index]; + if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 } + var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1); + if (boundary == 0 || boundary == order.length) { return range$$1 } + + // Compute the relative visual position of the head compared to the + // anchor (<0 is to the left, >0 to the right) + var leftSide; + if (head.line != anchor.line) { + leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0; + } else { + var headIndex = getBidiPartAt(order, head.ch, head.sticky); + var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1); + if (headIndex == boundary - 1 || headIndex == boundary) + { leftSide = dir < 0; } + else + { leftSide = dir > 0; } + } + + var usePart = order[boundary + (leftSide ? -1 : 0)]; + var from = leftSide == (usePart.level == 1); + var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before"; + return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head) } // Determines whether an event happened in the gutter, and fires the // handlers for the corresponding event. function gutterEvent(cm, e, type, prevent) { - var mX, mY - try { mX = e.clientX; mY = e.clientY } - catch(e) { return false } + var mX, mY; + if (e.touches) { + mX = e.touches[0].clientX; + mY = e.touches[0].clientY; + } else { + try { mX = e.clientX; mY = e.clientY; } + catch(e) { return false } + } if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } - if (prevent) { e_preventDefault(e) } + if (prevent) { e_preventDefault(e); } - var display = cm.display - var lineBox = display.lineDiv.getBoundingClientRect() + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) } - mY -= lineBox.top - display.viewOffset + mY -= lineBox.top - display.viewOffset; for (var i = 0; i < cm.options.gutters.length; ++i) { - var g = display.gutters.childNodes[i] + var g = display.gutters.childNodes[i]; if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY) - var gutter = cm.options.gutters[i] - signal(cm, type, cm, line, gutter, e) + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.options.gutters[i]; + signal(cm, type, cm, line, gutter, e); return e_defaultPrevented(e) } } @@ -14679,7 +15208,7 @@ function clickInGutter(cm, e) { function onContextMenu(cm, e) { if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return } if (signalDOMEvent(cm, e, "contextmenu")) { return } - cm.display.input.onContextMenu(e) + cm.display.input.onContextMenu(e); } function contextMenuInGutter(cm, e) { @@ -14689,207 +15218,208 @@ function contextMenuInGutter(cm, e) { function themeChanged(cm) { cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + - cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-") - clearCaches(cm) + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); } -var Init = {toString: function(){return "CodeMirror.Init"}} +var Init = {toString: function(){return "CodeMirror.Init"}}; -var defaults = {} -var optionHandlers = {} +var defaults = {}; +var optionHandlers = {}; function defineOptions(CodeMirror) { - var optionHandlers = CodeMirror.optionHandlers + var optionHandlers = CodeMirror.optionHandlers; function option(name, deflt, handle, notOnInit) { - CodeMirror.defaults[name] = deflt + CodeMirror.defaults[name] = deflt; if (handle) { optionHandlers[name] = - notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle } + notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; } } - CodeMirror.defineOption = option + CodeMirror.defineOption = option; // Passed to option handlers when there is no old value. - CodeMirror.Init = Init + CodeMirror.Init = Init; // These two are, on init, called from the constructor because they // have to be initialized before the editor can start at all. - option("value", "", function (cm, val) { return cm.setValue(val); }, true) + option("value", "", function (cm, val) { return cm.setValue(val); }, true); option("mode", null, function (cm, val) { - cm.doc.modeOption = val - loadMode(cm) - }, true) + cm.doc.modeOption = val; + loadMode(cm); + }, true); - option("indentUnit", 2, loadMode, true) - option("indentWithTabs", false) - option("smartIndent", true) + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); option("tabSize", 4, function (cm) { - resetModeState(cm) - clearCaches(cm) - regChange(cm) - }, true) + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + option("lineSeparator", null, function (cm, val) { - cm.doc.lineSep = val + cm.doc.lineSep = val; if (!val) { return } - var newBreaks = [], lineNo = cm.doc.first + var newBreaks = [], lineNo = cm.doc.first; cm.doc.iter(function (line) { for (var pos = 0;;) { - var found = line.text.indexOf(val, pos) + var found = line.text.indexOf(val, pos); if (found == -1) { break } - pos = found + val.length - newBreaks.push(Pos(lineNo, found)) + pos = found + val.length; + newBreaks.push(Pos(lineNo, found)); } - lineNo++ - }) + lineNo++; + }); for (var i = newBreaks.length - 1; i >= 0; i--) - { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) } - }) - option("specialChars", /[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) { - cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g") - if (old != Init) { cm.refresh() } - }) - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true) - option("electricChars", true) + { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); } + }); + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + if (old != Init) { cm.refresh(); } + }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true); + option("electricChars", true); option("inputStyle", mobile ? "contenteditable" : "textarea", function () { throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME - }, true) - option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true) - option("rtlMoveVisually", !windows) - option("wholeLineUpdateBefore", true) + }, true); + option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); option("theme", "default", function (cm) { - themeChanged(cm) - guttersChanged(cm) - }, true) + themeChanged(cm); + guttersChanged(cm); + }, true); option("keyMap", "default", function (cm, val, old) { - var next = getKeyMap(val) - var prev = old != Init && getKeyMap(old) - if (prev && prev.detach) { prev.detach(cm, next) } - if (next.attach) { next.attach(cm, prev || null) } - }) - option("extraKeys", null) + var next = getKeyMap(val); + var prev = old != Init && getKeyMap(old); + if (prev && prev.detach) { prev.detach(cm, next); } + if (next.attach) { next.attach(cm, prev || null); } + }); + option("extraKeys", null); + option("configureMouse", null); - option("lineWrapping", false, wrappingChanged, true) + option("lineWrapping", false, wrappingChanged, true); option("gutters", [], function (cm) { - setGuttersForLineNumbers(cm.options) - guttersChanged(cm) - }, true) + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); option("fixedGutter", true, function (cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0" - cm.refresh() - }, true) - option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true) + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true); option("scrollbarStyle", "native", function (cm) { - initScrollbars(cm) - updateScrollbars(cm) - cm.display.scrollbars.setScrollTop(cm.doc.scrollTop) - cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft) - }, true) + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); option("lineNumbers", false, function (cm) { - setGuttersForLineNumbers(cm.options) - guttersChanged(cm) - }, true) - option("firstLineNumber", 1, guttersChanged, true) - option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true) - option("showCursorWhenSelecting", false, updateSelection, true) + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("firstLineNumber", 1, guttersChanged, true); + option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true); + option("showCursorWhenSelecting", false, updateSelection, true); - option("resetSelectionOnContextMenu", true) - option("lineWiseCopyCut", true) + option("resetSelectionOnContextMenu", true); + option("lineWiseCopyCut", true); + option("pasteLinesPerSelection", true); option("readOnly", false, function (cm, val) { if (val == "nocursor") { - onBlur(cm) - cm.display.input.blur() - cm.display.disabled = true - } else { - cm.display.disabled = false + onBlur(cm); + cm.display.input.blur(); } - cm.display.input.readOnlyChanged(val) - }) - option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true) - option("dragDrop", true, dragDropChanged) - option("allowDropFileTypes", null) - - option("cursorBlinkRate", 530) - option("cursorScrollMargin", 0) - option("cursorHeight", 1, updateSelection, true) - option("singleCursorHeightPerLine", true, updateSelection, true) - option("workTime", 100) - option("workDelay", 100) - option("flattenSpans", true, resetModeState, true) - option("addModeClass", false, resetModeState, true) - option("pollInterval", 100) - option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }) - option("historyEventDelay", 1250) - option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true) - option("maxHighlightLength", 10000, resetModeState, true) + cm.display.input.readOnlyChanged(val); + }); + option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true); + option("dragDrop", true, dragDropChanged); + option("allowDropFileTypes", null); + + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true); + option("maxHighlightLength", 10000, resetModeState, true); option("moveInputWithCursor", true, function (cm, val) { - if (!val) { cm.display.input.resetPosition() } - }) + if (!val) { cm.display.input.resetPosition(); } + }); - option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }) - option("autofocus", null) + option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }); + option("autofocus", null); + option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true); } function guttersChanged(cm) { - updateGutters(cm) - regChange(cm) - alignHorizontally(cm) + updateGutters(cm); + regChange(cm); + alignHorizontally(cm); } function dragDropChanged(cm, value, old) { - var wasOn = old && old != Init + var wasOn = old && old != Init; if (!value != !wasOn) { - var funcs = cm.display.dragFunctions - var toggle = value ? on : off - toggle(cm.display.scroller, "dragstart", funcs.start) - toggle(cm.display.scroller, "dragenter", funcs.enter) - toggle(cm.display.scroller, "dragover", funcs.over) - toggle(cm.display.scroller, "dragleave", funcs.leave) - toggle(cm.display.scroller, "drop", funcs.drop) + var funcs = cm.display.dragFunctions; + var toggle = value ? on : off; + toggle(cm.display.scroller, "dragstart", funcs.start); + toggle(cm.display.scroller, "dragenter", funcs.enter); + toggle(cm.display.scroller, "dragover", funcs.over); + toggle(cm.display.scroller, "dragleave", funcs.leave); + toggle(cm.display.scroller, "drop", funcs.drop); } } function wrappingChanged(cm) { if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap") - cm.display.sizer.style.minWidth = "" - cm.display.sizerWidth = null + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap") - findMaxLine(cm) + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); } - estimateLineHeights(cm) - regChange(cm) - clearCaches(cm) - setTimeout(function () { return updateScrollbars(cm); }, 100) + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function () { return updateScrollbars(cm); }, 100); } // A CodeMirror instance represents an editor. This is the object // that user code is usually dealing with. -function CodeMirror(place, options) { +function CodeMirror$1(place, options) { var this$1 = this; - if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) } + if (!(this instanceof CodeMirror$1)) { return new CodeMirror$1(place, options) } - this.options = options = options ? copyObj(options) : {} + this.options = options = options ? copyObj(options) : {}; // Determine effective options based on given values and defaults. - copyObj(defaults, options, false) - setGuttersForLineNumbers(options) - - var doc = options.value - if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator) } - this.doc = doc - - var input = new CodeMirror.inputStyles[options.inputStyle](this) - var display = this.display = new Display(place, doc, input) - display.wrapper.CodeMirror = this - updateGutters(this) - themeChanged(this) + copyObj(defaults, options, false); + setGuttersForLineNumbers(options); + + var doc = options.value; + if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); } + this.doc = doc; + + var input = new CodeMirror$1.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input); + display.wrapper.CodeMirror = this; + updateGutters(this); + themeChanged(this); if (options.lineWrapping) - { this.display.wrapper.className += " CodeMirror-wrap" } - initScrollbars(this) + { this.display.wrapper.className += " CodeMirror-wrap"; } + initScrollbars(this); this.state = { keyMaps: [], // stores maps added by addKeyMap @@ -14905,154 +15435,154 @@ function CodeMirror(place, options) { highlight: new Delayed(), // stores highlight worker timeout keySeq: null, // Unfinished key sequence specialChars: null - } + }; - if (options.autofocus && !mobile) { display.input.focus() } + if (options.autofocus && !mobile) { display.input.focus(); } // Override magic textarea content restore that IE sometimes does // on our hidden textarea on reload - if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) } + if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); } - registerEventHandlers(this) - ensureGlobalHandlers() + registerEventHandlers(this); + ensureGlobalHandlers(); - startOperation(this) - this.curOp.forceUpdate = true - attachDoc(this, doc) + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); if ((options.autofocus && !mobile) || this.hasFocus()) - { setTimeout(bind(onFocus, this), 20) } + { setTimeout(bind(onFocus, this), 20); } else - { onBlur(this) } + { onBlur(this); } for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt)) - { optionHandlers[opt](this$1, options[opt], Init) } } - maybeUpdateLineNumberWidth(this) - if (options.finishInit) { options.finishInit(this) } - for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) } - endOperation(this) + { optionHandlers[opt](this$1, options[opt], Init); } } + maybeUpdateLineNumberWidth(this); + if (options.finishInit) { options.finishInit(this); } + for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); } + endOperation(this); // Suppress optimizelegibility in Webkit, since it breaks text // measuring on line wrapping boundaries. if (webkit && options.lineWrapping && getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") - { display.lineDiv.style.textRendering = "auto" } + { display.lineDiv.style.textRendering = "auto"; } } // The default configuration options. -CodeMirror.defaults = defaults +CodeMirror$1.defaults = defaults; // Functions to run when options are changed. -CodeMirror.optionHandlers = optionHandlers +CodeMirror$1.optionHandlers = optionHandlers; // Attach the necessary event handlers when initializing the editor function registerEventHandlers(cm) { - var d = cm.display - on(d.scroller, "mousedown", operation(cm, onMouseDown)) + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); // Older IE's will not fire a second mousedown for a double click if (ie && ie_version < 11) { on(d.scroller, "dblclick", operation(cm, function (e) { if (signalDOMEvent(cm, e)) { return } - var pos = posFromMouse(cm, e) + var pos = posFromMouse(cm, e); if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return } - e_preventDefault(e) - var word = cm.findWordAt(pos) - extendSelection(cm.doc, word.anchor, word.head) - })) } + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); } else - { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) } + { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); } // Some browsers fire contextmenu *after* opening the menu, at // which point we can't mess with it anymore. Context menu is // handled in onMouseDown for these browsers. - if (!captureRightClick) { on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }) } + if (!captureRightClick) { on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }); } // Used to suppress mouse event handling when a touch happens - var touchFinished, prevTouch = {end: 0} + var touchFinished, prevTouch = {end: 0}; function finishTouch() { if (d.activeTouch) { - touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000) - prevTouch = d.activeTouch - prevTouch.end = +new Date + touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date; } } function isMouseLikeTouchEvent(e) { if (e.touches.length != 1) { return false } - var touch = e.touches[0] + var touch = e.touches[0]; return touch.radiusX <= 1 && touch.radiusY <= 1 } function farAway(touch, other) { if (other.left == null) { return true } - var dx = other.left - touch.left, dy = other.top - touch.top + var dx = other.left - touch.left, dy = other.top - touch.top; return dx * dx + dy * dy > 20 * 20 } on(d.scroller, "touchstart", function (e) { - if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) { - d.input.ensurePolled() - clearTimeout(touchFinished) - var now = +new Date + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { + d.input.ensurePolled(); + clearTimeout(touchFinished); + var now = +new Date; d.activeTouch = {start: now, moved: false, - prev: now - prevTouch.end <= 300 ? prevTouch : null} + prev: now - prevTouch.end <= 300 ? prevTouch : null}; if (e.touches.length == 1) { - d.activeTouch.left = e.touches[0].pageX - d.activeTouch.top = e.touches[0].pageY + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; } } - }) + }); on(d.scroller, "touchmove", function () { - if (d.activeTouch) { d.activeTouch.moved = true } - }) + if (d.activeTouch) { d.activeTouch.moved = true; } + }); on(d.scroller, "touchend", function (e) { - var touch = d.activeTouch + var touch = d.activeTouch; if (touch && !eventInWidget(d, e) && touch.left != null && !touch.moved && new Date - touch.start < 300) { - var pos = cm.coordsChar(d.activeTouch, "page"), range + var pos = cm.coordsChar(d.activeTouch, "page"), range; if (!touch.prev || farAway(touch, touch.prev)) // Single tap - { range = new Range(pos, pos) } + { range = new Range(pos, pos); } else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap - { range = cm.findWordAt(pos) } + { range = cm.findWordAt(pos); } else // Triple tap - { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } - cm.setSelection(range.anchor, range.head) - cm.focus() - e_preventDefault(e) + { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); } + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); } - finishTouch() - }) - on(d.scroller, "touchcancel", finishTouch) + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); // Sync scrolling between fake scrollbars and real scrollable // area, ensure viewport is updated when scrolling. on(d.scroller, "scroll", function () { if (d.scroller.clientHeight) { - setScrollTop(cm, d.scroller.scrollTop) - setScrollLeft(cm, d.scroller.scrollLeft, true) - signal(cm, "scroll", cm) + updateScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); } - }) + }); // Listen to wheel events in order to try and update the viewport on time. - on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }) - on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }) + on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }); + on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }); // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }) + on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); d.dragFunctions = { - enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }}, - over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }}, + enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }}, + over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }}, start: function (e) { return onDragStart(cm, e); }, drop: operation(cm, onDrop), - leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }} - } + leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }} + }; - var inp = d.input.getField() - on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }) - on(inp, "keydown", operation(cm, onKeyDown)) - on(inp, "keypress", operation(cm, onKeyPress)) - on(inp, "focus", function (e) { return onFocus(cm, e); }) - on(inp, "blur", function (e) { return onBlur(cm, e); }) + var inp = d.input.getField(); + on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", function (e) { return onFocus(cm, e); }); + on(inp, "blur", function (e) { return onBlur(cm, e); }); } -var initHooks = [] -CodeMirror.defineInitHook = function (f) { return initHooks.push(f); } +var initHooks = []; +CodeMirror$1.defineInitHook = function (f) { return initHooks.push(f); }; // Indent the given line. The how parameter can be "smart", // "add"/null, "subtract", or "prev". When aggressive is false @@ -15060,58 +15590,58 @@ CodeMirror.defineInitHook = function (f) { return initHooks.push(f); } // lines are not indented, and places where the mode returns Pass // are left alone. function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, state - if (how == null) { how = "add" } + var doc = cm.doc, state; + if (how == null) { how = "add"; } if (how == "smart") { // Fall back to "prev" when the mode doesn't have an indentation // method. - if (!doc.mode.indent) { how = "prev" } - else { state = getStateBefore(cm, n) } + if (!doc.mode.indent) { how = "prev"; } + else { state = getContextBefore(cm, n).state; } } - var tabSize = cm.options.tabSize - var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize) - if (line.stateAfter) { line.stateAfter = null } - var curSpaceString = line.text.match(/^\s*/)[0], indentation + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) { line.stateAfter = null; } + var curSpaceString = line.text.match(/^\s*/)[0], indentation; if (!aggressive && !/\S/.test(line.text)) { - indentation = 0 - how = "not" + indentation = 0; + how = "not"; } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text) + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); if (indentation == Pass || indentation > 150) { if (!aggressive) { return } - how = "prev" + how = "prev"; } } if (how == "prev") { - if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) } - else { indentation = 0 } + if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); } + else { indentation = 0; } } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit + indentation = curSpace + cm.options.indentUnit; } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit + indentation = curSpace - cm.options.indentUnit; } else if (typeof how == "number") { - indentation = curSpace + how + indentation = curSpace + how; } - indentation = Math.max(0, indentation) + indentation = Math.max(0, indentation); - var indentString = "", pos = 0 + var indentString = "", pos = 0; if (cm.options.indentWithTabs) - { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t"} } - if (pos < indentation) { indentString += spaceStr(indentation - pos) } + { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} } + if (pos < indentation) { indentString += spaceStr(indentation - pos); } if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input") - line.stateAfter = null + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; return true } else { // Ensure that, if the cursor was in the whitespace at the start // of the line, it is moved to the end of that space. for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { - var range = doc.sel.ranges[i$1] + var range = doc.sel.ranges[i$1]; if (range.head.line == n && range.head.ch < curSpaceString.length) { - var pos$1 = Pos(n, curSpaceString.length) - replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)) + var pos$1 = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)); break } } @@ -15121,66 +15651,66 @@ function indentLine(cm, n, how, aggressive) { // This will be set to a {lineWise: bool, text: [string]} object, so // that, when pasting, we know what kind of selections the copied // text was made out of. -var lastCopied = null +var lastCopied = null; function setLastCopied(newLastCopied) { - lastCopied = newLastCopied + lastCopied = newLastCopied; } function applyTextInput(cm, inserted, deleted, sel, origin) { - var doc = cm.doc - cm.display.shift = false - if (!sel) { sel = doc.sel } + var doc = cm.doc; + cm.display.shift = false; + if (!sel) { sel = doc.sel; } - var paste = cm.state.pasteIncoming || origin == "paste" - var textLines = splitLinesAuto(inserted), multiPaste = null - // When pasing N lines into N selections, insert one line per selection + var paste = cm.state.pasteIncoming || origin == "paste"; + var textLines = splitLinesAuto(inserted), multiPaste = null; + // When pasting N lines into N selections, insert one line per selection if (paste && sel.ranges.length > 1) { if (lastCopied && lastCopied.text.join("\n") == inserted) { if (sel.ranges.length % lastCopied.text.length == 0) { - multiPaste = [] + multiPaste = []; for (var i = 0; i < lastCopied.text.length; i++) - { multiPaste.push(doc.splitLines(lastCopied.text[i])) } + { multiPaste.push(doc.splitLines(lastCopied.text[i])); } } - } else if (textLines.length == sel.ranges.length) { - multiPaste = map(textLines, function (l) { return [l]; }) + } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { + multiPaste = map(textLines, function (l) { return [l]; }); } } - var updateInput + var updateInput; // Normal behavior is to insert the new text into every selection for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { - var range = sel.ranges[i$1] - var from = range.from(), to = range.to() - if (range.empty()) { + var range$$1 = sel.ranges[i$1]; + var from = range$$1.from(), to = range$$1.to(); + if (range$$1.empty()) { if (deleted && deleted > 0) // Handle deletion - { from = Pos(from.line, from.ch - deleted) } + { from = Pos(from.line, from.ch - deleted); } else if (cm.state.overwrite && !paste) // Handle overwrite - { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) } + { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); } else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) - { from = to = Pos(from.line, 0) } + { from = to = Pos(from.line, 0); } } - updateInput = cm.curOp.updateInput + updateInput = cm.curOp.updateInput; var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, - origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")} - makeChange(cm.doc, changeEvent) - signalLater(cm, "inputRead", cm, changeEvent) + origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); } if (inserted && !paste) - { triggerElectric(cm, inserted) } + { triggerElectric(cm, inserted); } - ensureCursorVisible(cm) - cm.curOp.updateInput = updateInput - cm.curOp.typing = true - cm.state.pasteIncoming = cm.state.cutIncoming = false + ensureCursorVisible(cm); + cm.curOp.updateInput = updateInput; + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = false; } function handlePaste(e, cm) { - var pasted = e.clipboardData && e.clipboardData.getData("Text") + var pasted = e.clipboardData && e.clipboardData.getData("Text"); if (pasted) { - e.preventDefault() + e.preventDefault(); if (!cm.isReadOnly() && !cm.options.disableInput) - { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }) } + { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); } return true } } @@ -15188,56 +15718,56 @@ function handlePaste(e, cm) { function triggerElectric(cm, inserted) { // When an 'electric' character is inserted, immediately trigger a reindent if (!cm.options.electricChars || !cm.options.smartIndent) { return } - var sel = cm.doc.sel + var sel = cm.doc.sel; for (var i = sel.ranges.length - 1; i >= 0; i--) { - var range = sel.ranges[i] - if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue } - var mode = cm.getModeAt(range.head) - var indented = false + var range$$1 = sel.ranges[i]; + if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue } + var mode = cm.getModeAt(range$$1.head); + var indented = false; if (mode.electricChars) { for (var j = 0; j < mode.electricChars.length; j++) { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indented = indentLine(cm, range.head.line, "smart") + indented = indentLine(cm, range$$1.head.line, "smart"); break } } } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) - { indented = indentLine(cm, range.head.line, "smart") } + if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch))) + { indented = indentLine(cm, range$$1.head.line, "smart"); } } - if (indented) { signalLater(cm, "electricInput", cm, range.head.line) } + if (indented) { signalLater(cm, "electricInput", cm, range$$1.head.line); } } } function copyableRanges(cm) { - var text = [], ranges = [] + var text = [], ranges = []; for (var i = 0; i < cm.doc.sel.ranges.length; i++) { - var line = cm.doc.sel.ranges[i].head.line - var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)} - ranges.push(lineRange) - text.push(cm.getRange(lineRange.anchor, lineRange.head)) + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); } return {text: text, ranges: ranges} } function disableBrowserMagic(field, spellcheck) { - field.setAttribute("autocorrect", "off") - field.setAttribute("autocapitalize", "off") - field.setAttribute("spellcheck", !!spellcheck) + field.setAttribute("autocorrect", "off"); + field.setAttribute("autocapitalize", "off"); + field.setAttribute("spellcheck", !!spellcheck); } function hiddenTextarea() { - var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none") - var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;") + var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); // The textarea is kept positioned near the cursor to prevent the // fact that it'll be scrolled into view on input from scrolling // our fake cursor out of view. On webkit, when wrap=off, paste is // very slow. So make the area wide instead. - if (webkit) { te.style.width = "1000px" } - else { te.setAttribute("wrap", "off") } + if (webkit) { te.style.width = "1000px"; } + else { te.setAttribute("wrap", "off"); } // If border: 0; -- iOS fails to open keyboard (issue #1287) - if (ios) { te.style.border = "1px solid black" } - disableBrowserMagic(te) + if (ios) { te.style.border = "1px solid black"; } + disableBrowserMagic(te); return div } @@ -15249,59 +15779,59 @@ function hiddenTextarea() { // CodeMirror.prototype, for backwards compatibility and // convenience. -function addEditorMethods(CodeMirror) { - var optionHandlers = CodeMirror.optionHandlers +var addEditorMethods = function(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; - var helpers = CodeMirror.helpers = {} + var helpers = CodeMirror.helpers = {}; CodeMirror.prototype = { constructor: CodeMirror, - focus: function(){window.focus(); this.display.input.focus()}, + focus: function(){window.focus(); this.display.input.focus();}, setOption: function(option, value) { - var options = this.options, old = options[option] + var options = this.options, old = options[option]; if (options[option] == value && option != "mode") { return } - options[option] = value + options[option] = value; if (optionHandlers.hasOwnProperty(option)) - { operation(this, optionHandlers[option])(this, value, old) } - signal(this, "optionChange", this, option) + { operation(this, optionHandlers[option])(this, value, old); } + signal(this, "optionChange", this, option); }, getOption: function(option) {return this.options[option]}, getDoc: function() {return this.doc}, - addKeyMap: function(map, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)) + addKeyMap: function(map$$1, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map$$1)); }, - removeKeyMap: function(map) { - var maps = this.state.keyMaps + removeKeyMap: function(map$$1) { + var maps = this.state.keyMaps; for (var i = 0; i < maps.length; ++i) - { if (maps[i] == map || maps[i].name == map) { - maps.splice(i, 1) + { if (maps[i] == map$$1 || maps[i].name == map$$1) { + maps.splice(i, 1); return true } } }, addOverlay: methodOp(function(spec, options) { - var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec) + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); if (mode.startState) { throw new Error("Overlays may not be stateful.") } insertSorted(this.state.overlays, {mode: mode, modeSpec: spec, opaque: options && options.opaque, priority: (options && options.priority) || 0}, - function (overlay) { return overlay.priority; }) - this.state.modeGen++ - regChange(this) + function (overlay) { return overlay.priority; }); + this.state.modeGen++; + regChange(this); }), removeOverlay: methodOp(function(spec) { var this$1 = this; - var overlays = this.state.overlays + var overlays = this.state.overlays; for (var i = 0; i < overlays.length; ++i) { - var cur = overlays[i].modeSpec + var cur = overlays[i].modeSpec; if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i, 1) - this$1.state.modeGen++ - regChange(this$1) + overlays.splice(i, 1); + this$1.state.modeGen++; + regChange(this$1); return } } @@ -15309,30 +15839,30 @@ function addEditorMethods(CodeMirror) { indentLine: methodOp(function(n, dir, aggressive) { if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev" } - else { dir = dir ? "add" : "subtract" } + if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev"; } + else { dir = dir ? "add" : "subtract"; } } - if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) } + if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); } }), indentSelection: methodOp(function(how) { var this$1 = this; - var ranges = this.doc.sel.ranges, end = -1 + var ranges = this.doc.sel.ranges, end = -1; for (var i = 0; i < ranges.length; i++) { - var range = ranges[i] - if (!range.empty()) { - var from = range.from(), to = range.to() - var start = Math.max(end, from.line) - end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1 + var range$$1 = ranges[i]; + if (!range$$1.empty()) { + var from = range$$1.from(), to = range$$1.to(); + var start = Math.max(end, from.line); + end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; for (var j = start; j < end; ++j) - { indentLine(this$1, j, how) } - var newRanges = this$1.doc.sel.ranges + { indentLine(this$1, j, how); } + var newRanges = this$1.doc.sel.ranges; if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) - { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) } - } else if (range.head.line > end) { - indentLine(this$1, range.head.line, how, true) - end = range.head.line - if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) } + { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); } + } else if (range$$1.head.line > end) { + indentLine(this$1, range$$1.head.line, how, true); + end = range$$1.head.line; + if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); } } } }), @@ -15348,23 +15878,23 @@ function addEditorMethods(CodeMirror) { }, getTokenTypeAt: function(pos) { - pos = clipPos(this.doc, pos) - var styles = getLineStyles(this, getLine(this.doc, pos.line)) - var before = 0, after = (styles.length - 1) / 2, ch = pos.ch - var type - if (ch == 0) { type = styles[2] } + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; + var type; + if (ch == 0) { type = styles[2]; } else { for (;;) { - var mid = (before + after) >> 1 - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid } - else if (styles[mid * 2 + 1] < ch) { before = mid + 1 } + var mid = (before + after) >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; } + else if (styles[mid * 2 + 1] < ch) { before = mid + 1; } else { type = styles[mid * 2 + 2]; break } } } - var cut = type ? type.indexOf("overlay ") : -1 + var cut = type ? type.indexOf("overlay ") : -1; return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1) }, getModeAt: function(pos) { - var mode = this.doc.mode + var mode = this.doc.mode; if (!mode.innerMode) { return mode } return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode }, @@ -15376,40 +15906,40 @@ function addEditorMethods(CodeMirror) { getHelpers: function(pos, type) { var this$1 = this; - var found = [] + var found = []; if (!helpers.hasOwnProperty(type)) { return found } - var help = helpers[type], mode = this.getModeAt(pos) + var help = helpers[type], mode = this.getModeAt(pos); if (typeof mode[type] == "string") { - if (help[mode[type]]) { found.push(help[mode[type]]) } + if (help[mode[type]]) { found.push(help[mode[type]]); } } else if (mode[type]) { for (var i = 0; i < mode[type].length; i++) { - var val = help[mode[type][i]] - if (val) { found.push(val) } + var val = help[mode[type][i]]; + if (val) { found.push(val); } } } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]) + found.push(help[mode.helperType]); } else if (help[mode.name]) { - found.push(help[mode.name]) + found.push(help[mode.name]); } for (var i$1 = 0; i$1 < help._global.length; i$1++) { - var cur = help._global[i$1] + var cur = help._global[i$1]; if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1) - { found.push(cur.val) } + { found.push(cur.val); } } return found }, getStateAfter: function(line, precise) { - var doc = this.doc - line = clipLine(doc, line == null ? doc.first + doc.size - 1: line) - return getStateBefore(this, line + 1, precise) + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); + return getContextBefore(this, line + 1, precise).state }, cursorCoords: function(start, mode) { - var pos, range = this.doc.sel.primary() - if (start == null) { pos = range.head } - else if (typeof start == "object") { pos = clipPos(this.doc, start) } - else { pos = start ? range.from() : range.to() } + var pos, range$$1 = this.doc.sel.primary(); + if (start == null) { pos = range$$1.head; } + else if (typeof start == "object") { pos = clipPos(this.doc, start); } + else { pos = start ? range$$1.from() : range$$1.to(); } return cursorCoords(this, pos, mode || "page") }, @@ -15418,25 +15948,25 @@ function addEditorMethods(CodeMirror) { }, coordsChar: function(coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page") + coords = fromCoordSystem(this, coords, mode || "page"); return coordsChar(this, coords.left, coords.top) }, lineAtHeight: function(height, mode) { - height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; return lineAtHeight(this.doc, height + this.display.viewOffset) }, heightAtLine: function(line, mode, includeWidgets) { - var end = false, lineObj + var end = false, lineObj; if (typeof line == "number") { - var last = this.doc.first + this.doc.size - 1 - if (line < this.doc.first) { line = this.doc.first } - else if (line > last) { line = last; end = true } - lineObj = getLine(this.doc, line) + var last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) { line = this.doc.first; } + else if (line > last) { line = last; end = true; } + lineObj = getLine(this.doc, line); } else { - lineObj = line + lineObj = line; } - return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets).top + + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top + (end ? this.doc.height - heightAtLine(lineObj) : 0) }, @@ -15446,59 +15976,60 @@ function addEditorMethods(CodeMirror) { getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}}, addWidget: function(pos, node, scroll, vert, horiz) { - var display = this.display - pos = cursorCoords(this, clipPos(this.doc, pos)) - var top = pos.bottom, left = pos.left - node.style.position = "absolute" - node.setAttribute("cm-ignore-events", "true") - this.display.input.setUneditable(node) - display.sizer.appendChild(node) + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); if (vert == "over") { - top = pos.top + top = pos.top; } else if (vert == "above" || vert == "near") { var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth) + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); // Default to positioning above (if specified and possible); otherwise default to positioning below if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) - { top = pos.top - node.offsetHeight } + { top = pos.top - node.offsetHeight; } else if (pos.bottom + node.offsetHeight <= vspace) - { top = pos.bottom } + { top = pos.bottom; } if (left + node.offsetWidth > hspace) - { left = hspace - node.offsetWidth } + { left = hspace - node.offsetWidth; } } - node.style.top = top + "px" - node.style.left = node.style.right = "" + node.style.top = top + "px"; + node.style.left = node.style.right = ""; if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth - node.style.right = "0px" + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; } else { - if (horiz == "left") { left = 0 } - else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 } - node.style.left = left + "px" + if (horiz == "left") { left = 0; } + else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; } + node.style.left = left + "px"; } if (scroll) - { scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight) } + { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); } }, triggerOnKeyDown: methodOp(onKeyDown), triggerOnKeyPress: methodOp(onKeyPress), triggerOnKeyUp: onKeyUp, + triggerOnMouseDown: methodOp(onMouseDown), execCommand: function(cmd) { if (commands.hasOwnProperty(cmd)) { return commands[cmd].call(null, this) } }, - triggerElectric: methodOp(function(text) { triggerElectric(this, text) }), + triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), findPosH: function(from, amount, unit, visually) { var this$1 = this; - var dir = 1 - if (amount < 0) { dir = -1; amount = -amount } - var cur = clipPos(this.doc, from) + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } + var cur = clipPos(this.doc, from); for (var i = 0; i < amount; ++i) { - cur = findPosH(this$1.doc, cur, dir, unit, visually) + cur = findPosH(this$1.doc, cur, dir, unit, visually); if (cur.hitSide) { break } } return cur @@ -15507,36 +16038,36 @@ function addEditorMethods(CodeMirror) { moveH: methodOp(function(dir, unit) { var this$1 = this; - this.extendSelectionsBy(function (range) { - if (this$1.display.shift || this$1.doc.extend || range.empty()) - { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) } + this.extendSelectionsBy(function (range$$1) { + if (this$1.display.shift || this$1.doc.extend || range$$1.empty()) + { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) } else - { return dir < 0 ? range.from() : range.to() } - }, sel_move) + { return dir < 0 ? range$$1.from() : range$$1.to() } + }, sel_move); }), deleteH: methodOp(function(dir, unit) { - var sel = this.doc.sel, doc = this.doc + var sel = this.doc.sel, doc = this.doc; if (sel.somethingSelected()) - { doc.replaceSelection("", null, "+delete") } + { doc.replaceSelection("", null, "+delete"); } else - { deleteNearSelection(this, function (range) { - var other = findPosH(doc, range.head, dir, unit, false) - return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other} - }) } + { deleteNearSelection(this, function (range$$1) { + var other = findPosH(doc, range$$1.head, dir, unit, false); + return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other} + }); } }), findPosV: function(from, amount, unit, goalColumn) { var this$1 = this; - var dir = 1, x = goalColumn - if (amount < 0) { dir = -1; amount = -amount } - var cur = clipPos(this.doc, from) + var dir = 1, x = goalColumn; + if (amount < 0) { dir = -1; amount = -amount; } + var cur = clipPos(this.doc, from); for (var i = 0; i < amount; ++i) { - var coords = cursorCoords(this$1, cur, "div") - if (x == null) { x = coords.left } - else { coords.left = x } - cur = findPosV(this$1, coords, dir, unit) + var coords = cursorCoords(this$1, cur, "div"); + if (x == null) { x = coords.left; } + else { coords.left = x; } + cur = findPosV(this$1, coords, dir, unit); if (cur.hitSide) { break } } return cur @@ -15545,37 +16076,37 @@ function addEditorMethods(CodeMirror) { moveV: methodOp(function(dir, unit) { var this$1 = this; - var doc = this.doc, goals = [] - var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected() - doc.extendSelectionsBy(function (range) { + var doc = this.doc, goals = []; + var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function (range$$1) { if (collapse) - { return dir < 0 ? range.from() : range.to() } - var headPos = cursorCoords(this$1, range.head, "div") - if (range.goalColumn != null) { headPos.left = range.goalColumn } - goals.push(headPos.left) - var pos = findPosV(this$1, headPos, dir, unit) - if (unit == "page" && range == doc.sel.primary()) - { addToScrollPos(this$1, null, charCoords(this$1, pos, "div").top - headPos.top) } + { return dir < 0 ? range$$1.from() : range$$1.to() } + var headPos = cursorCoords(this$1, range$$1.head, "div"); + if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; } + goals.push(headPos.left); + var pos = findPosV(this$1, headPos, dir, unit); + if (unit == "page" && range$$1 == doc.sel.primary()) + { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); } return pos - }, sel_move) + }, sel_move); if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++) - { doc.sel.ranges[i].goalColumn = goals[i] } } + { doc.sel.ranges[i].goalColumn = goals[i]; } } }), // Find the word at the given position (as returned by coordsChar). findWordAt: function(pos) { - var doc = this.doc, line = getLine(doc, pos.line).text - var start = pos.ch, end = pos.ch + var doc = this.doc, line = getLine(doc, pos.line).text; + var start = pos.ch, end = pos.ch; if (line) { - var helper = this.getHelper(pos, "wordChars") - if ((pos.xRel < 0 || end == line.length) && start) { --start; } else { ++end } - var startChar = line.charAt(start) + var helper = this.getHelper(pos, "wordChars"); + if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end; } + var startChar = line.charAt(start); var check = isWordChar(startChar, helper) ? function (ch) { return isWordChar(ch, helper); } : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); } - : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); } - while (start > 0 && check(line.charAt(start - 1))) { --start } - while (end < line.length && check(line.charAt(end))) { ++end } + : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }; + while (start > 0 && check(line.charAt(start - 1))) { --start; } + while (end < line.length && check(line.charAt(end))) { ++end; } } return new Range(Pos(pos.line, start), Pos(pos.line, end)) }, @@ -15583,92 +16114,85 @@ function addEditorMethods(CodeMirror) { toggleOverwrite: function(value) { if (value != null && value == this.state.overwrite) { return } if (this.state.overwrite = !this.state.overwrite) - { addClass(this.display.cursorDiv, "CodeMirror-overwrite") } + { addClass(this.display.cursorDiv, "CodeMirror-overwrite"); } else - { rmClass(this.display.cursorDiv, "CodeMirror-overwrite") } + { rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); } - signal(this, "overwriteToggle", this, this.state.overwrite) + signal(this, "overwriteToggle", this, this.state.overwrite); }, hasFocus: function() { return this.display.input.getField() == activeElt() }, isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, - scrollTo: methodOp(function(x, y) { - if (x != null || y != null) { resolveScrollToPos(this) } - if (x != null) { this.curOp.scrollLeft = x } - if (y != null) { this.curOp.scrollTop = y } - }), + scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }), getScrollInfo: function() { - var scroller = this.display.scroller + var scroller = this.display.scroller; return {left: scroller.scrollLeft, top: scroller.scrollTop, height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, clientHeight: displayHeight(this), clientWidth: displayWidth(this)} }, - scrollIntoView: methodOp(function(range, margin) { - if (range == null) { - range = {from: this.doc.sel.primary().head, to: null} - if (margin == null) { margin = this.options.cursorScrollMargin } - } else if (typeof range == "number") { - range = {from: Pos(range, 0), to: null} - } else if (range.from == null) { - range = {from: range, to: null} + scrollIntoView: methodOp(function(range$$1, margin) { + if (range$$1 == null) { + range$$1 = {from: this.doc.sel.primary().head, to: null}; + if (margin == null) { margin = this.options.cursorScrollMargin; } + } else if (typeof range$$1 == "number") { + range$$1 = {from: Pos(range$$1, 0), to: null}; + } else if (range$$1.from == null) { + range$$1 = {from: range$$1, to: null}; } - if (!range.to) { range.to = range.from } - range.margin = margin || 0 + if (!range$$1.to) { range$$1.to = range$$1.from; } + range$$1.margin = margin || 0; - if (range.from.line != null) { - resolveScrollToPos(this) - this.curOp.scrollToPos = range + if (range$$1.from.line != null) { + scrollToRange(this, range$$1); } else { - var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), - Math.min(range.from.top, range.to.top) - range.margin, - Math.max(range.from.right, range.to.right), - Math.max(range.from.bottom, range.to.bottom) + range.margin) - this.scrollTo(sPos.scrollLeft, sPos.scrollTop) + scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin); } }), setSize: methodOp(function(width, height) { var this$1 = this; - var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; } - if (width != null) { this.display.wrapper.style.width = interpret(width) } - if (height != null) { this.display.wrapper.style.height = interpret(height) } - if (this.options.lineWrapping) { clearLineMeasurementCache(this) } - var lineNo = this.display.viewFrom - this.doc.iter(lineNo, this.display.viewTo, function (line) { + var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }; + if (width != null) { this.display.wrapper.style.width = interpret(width); } + if (height != null) { this.display.wrapper.style.height = interpret(height); } + if (this.options.lineWrapping) { clearLineMeasurementCache(this); } + var lineNo$$1 = this.display.viewFrom; + this.doc.iter(lineNo$$1, this.display.viewTo, function (line) { if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) - { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } } - ++lineNo - }) - this.curOp.forceUpdate = true - signal(this, "refresh", this) + { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, "widget"); break } } } + ++lineNo$$1; + }); + this.curOp.forceUpdate = true; + signal(this, "refresh", this); }), operation: function(f){return runInOp(this, f)}, + startOperation: function(){return startOperation(this)}, + endOperation: function(){return endOperation(this)}, refresh: methodOp(function() { - var oldHeight = this.display.cachedTextHeight - regChange(this) - this.curOp.forceUpdate = true - clearCaches(this) - this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop) - updateGutterSpace(this) + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this); if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) - { estimateLineHeights(this) } - signal(this, "refresh", this) + { estimateLineHeights(this); } + signal(this, "refresh", this); }), swapDoc: methodOp(function(doc) { - var old = this.doc - old.cm = null - attachDoc(this, doc) - clearCaches(this) - this.display.input.reset() - this.scrollTo(doc.scrollLeft, doc.scrollTop) - this.curOp.forceScroll = true - signalLater(this, "swapDoc", this, old) + var old = this.doc; + old.cm = null; + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + scrollToCoords(this, doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); return old }), @@ -15676,18 +16200,18 @@ function addEditorMethods(CodeMirror) { getWrapperElement: function(){return this.display.wrapper}, getScrollerElement: function(){return this.display.scroller}, getGutterElement: function(){return this.display.gutters} - } - eventMixin(CodeMirror) + }; + eventMixin(CodeMirror); CodeMirror.registerHelper = function(type, name, value) { - if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} } - helpers[type][name] = value - } + if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; } + helpers[type][name] = value; + }; CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { - CodeMirror.registerHelper(type, name, value) - helpers[type]._global.push({pred: predicate, val: value}) - } -} + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({pred: predicate, val: value}); + }; +}; // Used for horizontal relative motion. Dir is -1 or 1 (left or // right), unit can be "char", "column" (like char, but doesn't @@ -15699,51 +16223,59 @@ function addEditorMethods(CodeMirror) { // position. The resulting position will have a hitSide=true // property if it reached the end of the document. function findPosH(doc, pos, dir, unit, visually) { - var line = pos.line, ch = pos.ch, origDir = dir - var lineObj = getLine(doc, line) + var oldPos = pos; + var origDir = dir; + var lineObj = getLine(doc, pos.line); function findNextLine() { - var l = line + dir + var l = pos.line + dir; if (l < doc.first || l >= doc.first + doc.size) { return false } - line = l + pos = new Pos(l, pos.ch, pos.sticky); return lineObj = getLine(doc, l) } function moveOnce(boundToLine) { - var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true) + var next; + if (visually) { + next = moveVisually(doc.cm, lineObj, pos, dir); + } else { + next = moveLogically(lineObj, pos, dir); + } if (next == null) { - if (!boundToLine && findNextLine()) { - if (visually) { ch = (dir < 0 ? lineRight : lineLeft)(lineObj) } - else { ch = dir < 0 ? lineObj.text.length : 0 } - } else { return false } - } else { ch = next } + if (!boundToLine && findNextLine()) + { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); } + else + { return false } + } else { + pos = next; + } return true } if (unit == "char") { - moveOnce() + moveOnce(); } else if (unit == "column") { - moveOnce(true) + moveOnce(true); } else if (unit == "word" || unit == "group") { - var sawType = null, group = unit == "group" - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars") + var sawType = null, group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); for (var first = true;; first = false) { if (dir < 0 && !moveOnce(!first)) { break } - var cur = lineObj.text.charAt(ch) || "\n" + var cur = lineObj.text.charAt(pos.ch) || "\n"; var type = isWordChar(cur, helper) ? "w" : group && cur == "\n" ? "n" : !group || /\s/.test(cur) ? null - : "p" - if (group && !first && !type) { type = "s" } + : "p"; + if (group && !first && !type) { type = "s"; } if (sawType && sawType != type) { - if (dir < 0) {dir = 1; moveOnce()} + if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after";} break } - if (type) { sawType = type } + if (type) { sawType = type; } if (dir > 0 && !moveOnce(!first)) { break } } } - var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true) - if (!cmp(pos, result)) { result.hitSide = true } + var result = skipAtomic(doc, pos, oldPos, origDir, true); + if (equalCursorPos(oldPos, result)) { result.hitSide = true; } return result } @@ -15751,21 +16283,21 @@ function findPosH(doc, pos, dir, unit, visually) { // "page" or "line". The resulting position will have a hitSide=true // property if it reached the end of the document. function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, x = pos.left, y + var doc = cm.doc, x = pos.left, y; if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight) - var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3) - y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3); + y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3 + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; } - var target + var target; for (;;) { - target = coordsChar(cm, x, y) + target = coordsChar(cm, x, y); if (!target.outside) { break } if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break } - y += dir * 5 + y += dir * 5; } return target } @@ -15773,398 +16305,453 @@ function findPosV(cm, pos, dir, unit) { // CONTENTEDITABLE INPUT STYLE var ContentEditableInput = function(cm) { - this.cm = cm - this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null - this.polling = new Delayed() - this.composing = null - this.gracePeriod = false - this.readDOMTimeout = null + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + this.composing = null; + this.gracePeriod = false; + this.readDOMTimeout = null; }; ContentEditableInput.prototype.init = function (display) { var this$1 = this; - var input = this, cm = input.cm - var div = input.div = display.lineDiv - disableBrowserMagic(div, cm.options.spellcheck) + var input = this, cm = input.cm; + var div = input.div = display.lineDiv; + disableBrowserMagic(div, cm.options.spellcheck); on(div, "paste", function (e) { if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } // IE doesn't fire input events, so we schedule a read for the pasted content in this way - if (ie_version <= 11) { setTimeout(operation(cm, function () { - if (!input.pollContent()) { regChange(cm) } - }), 20) } - }) + if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); } + }); on(div, "compositionstart", function (e) { - this$1.composing = {data: e.data, done: false} - }) + this$1.composing = {data: e.data, done: false}; + }); on(div, "compositionupdate", function (e) { - if (!this$1.composing) { this$1.composing = {data: e.data, done: false} } - }) + if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; } + }); on(div, "compositionend", function (e) { if (this$1.composing) { - if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() } - this$1.composing.done = true + if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); } + this$1.composing.done = true; } - }) + }); - on(div, "touchstart", function () { return input.forceCompositionEnd(); }) + on(div, "touchstart", function () { return input.forceCompositionEnd(); }); on(div, "input", function () { - if (!this$1.composing) { this$1.readFromDOMSoon() } - }) + if (!this$1.composing) { this$1.readFromDOMSoon(); } + }); function onCopyCut(e) { if (signalDOMEvent(cm, e)) { return } if (cm.somethingSelected()) { - setLastCopied({lineWise: false, text: cm.getSelections()}) - if (e.type == "cut") { cm.replaceSelection("", null, "cut") } + setLastCopied({lineWise: false, text: cm.getSelections()}); + if (e.type == "cut") { cm.replaceSelection("", null, "cut"); } } else if (!cm.options.lineWiseCopyCut) { return } else { - var ranges = copyableRanges(cm) - setLastCopied({lineWise: true, text: ranges.text}) + var ranges = copyableRanges(cm); + setLastCopied({lineWise: true, text: ranges.text}); if (e.type == "cut") { cm.operation(function () { - cm.setSelections(ranges.ranges, 0, sel_dontScroll) - cm.replaceSelection("", null, "cut") - }) + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); } } if (e.clipboardData) { - e.clipboardData.clearData() - var content = lastCopied.text.join("\n") + e.clipboardData.clearData(); + var content = lastCopied.text.join("\n"); // iOS exposes the clipboard API, but seems to discard content inserted into it - e.clipboardData.setData("Text", content) + e.clipboardData.setData("Text", content); if (e.clipboardData.getData("Text") == content) { - e.preventDefault() + e.preventDefault(); return } } // Old-fashioned briefly-focus-a-textarea hack - var kludge = hiddenTextarea(), te = kludge.firstChild - cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild) - te.value = lastCopied.text.join("\n") - var hadFocus = document.activeElement - selectInput(te) + var kludge = hiddenTextarea(), te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.text.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); setTimeout(function () { - cm.display.lineSpace.removeChild(kludge) - hadFocus.focus() - if (hadFocus == div) { input.showPrimarySelection() } - }, 50) + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + if (hadFocus == div) { input.showPrimarySelection(); } + }, 50); } - on(div, "copy", onCopyCut) - on(div, "cut", onCopyCut) + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); }; ContentEditableInput.prototype.prepareSelection = function () { - var result = prepareSelection(this.cm, false) - result.focus = this.cm.state.focused + var result = prepareSelection(this.cm, false); + result.focus = this.cm.state.focused; return result }; ContentEditableInput.prototype.showSelection = function (info, takeFocus) { if (!info || !this.cm.display.view.length) { return } - if (info.focus || takeFocus) { this.showPrimarySelection() } - this.showMultipleSelections(info) + if (info.focus || takeFocus) { this.showPrimarySelection(); } + this.showMultipleSelections(info); +}; + +ContentEditableInput.prototype.getSelection = function () { + return this.cm.display.wrapper.ownerDocument.getSelection() }; ContentEditableInput.prototype.showPrimarySelection = function () { - var sel = window.getSelection(), prim = this.cm.doc.sel.primary() - var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset) - var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset) + var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary(); + var from = prim.from(), to = prim.to(); + + if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { + sel.removeAllRanges(); + return + } + + var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && - cmp(minPos(curAnchor, curFocus), prim.from()) == 0 && - cmp(maxPos(curAnchor, curFocus), prim.to()) == 0) + cmp(minPos(curAnchor, curFocus), from) == 0 && + cmp(maxPos(curAnchor, curFocus), to) == 0) { return } - var start = posToDOM(this.cm, prim.from()) - var end = posToDOM(this.cm, prim.to()) - if (!start && !end) { return } + var view = cm.display.view; + var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) || + {node: view[0].measure.map[2], offset: 0}; + var end = to.line < cm.display.viewTo && posToDOM(cm, to); + if (!end) { + var measure = view[view.length - 1].measure; + var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]}; + } - var view = this.cm.display.view - var old = sel.rangeCount && sel.getRangeAt(0) - if (!start) { - start = {node: view[0].measure.map[2], offset: 0} - } else if (!end) { // FIXME dangerously hacky - var measure = view[view.length - 1].measure - var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map - end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]} + if (!start || !end) { + sel.removeAllRanges(); + return } - var rng - try { rng = range(start.node, start.offset, end.offset, end.node) } + var old = sel.rangeCount && sel.getRangeAt(0), rng; + try { rng = range(start.node, start.offset, end.offset, end.node); } catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible if (rng) { - if (!gecko && this.cm.state.focused) { - sel.collapse(start.node, start.offset) + if (!gecko && cm.state.focused) { + sel.collapse(start.node, start.offset); if (!rng.collapsed) { - sel.removeAllRanges() - sel.addRange(rng) + sel.removeAllRanges(); + sel.addRange(rng); } } else { - sel.removeAllRanges() - sel.addRange(rng) + sel.removeAllRanges(); + sel.addRange(rng); } - if (old && sel.anchorNode == null) { sel.addRange(old) } - else if (gecko) { this.startGracePeriod() } + if (old && sel.anchorNode == null) { sel.addRange(old); } + else if (gecko) { this.startGracePeriod(); } } - this.rememberSelection() + this.rememberSelection(); }; ContentEditableInput.prototype.startGracePeriod = function () { var this$1 = this; - clearTimeout(this.gracePeriod) + clearTimeout(this.gracePeriod); this.gracePeriod = setTimeout(function () { - this$1.gracePeriod = false + this$1.gracePeriod = false; if (this$1.selectionChanged()) - { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) } - }, 20) + { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); } + }, 20); }; ContentEditableInput.prototype.showMultipleSelections = function (info) { - removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors) - removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection) + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); }; ContentEditableInput.prototype.rememberSelection = function () { - var sel = window.getSelection() - this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset - this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset + var sel = this.getSelection(); + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; }; ContentEditableInput.prototype.selectionInEditor = function () { - var sel = window.getSelection() + var sel = this.getSelection(); if (!sel.rangeCount) { return false } - var node = sel.getRangeAt(0).commonAncestorContainer + var node = sel.getRangeAt(0).commonAncestorContainer; return contains(this.div, node) }; ContentEditableInput.prototype.focus = function () { if (this.cm.options.readOnly != "nocursor") { if (!this.selectionInEditor()) - { this.showSelection(this.prepareSelection(), true) } - this.div.focus() + { this.showSelection(this.prepareSelection(), true); } + this.div.focus(); } }; -ContentEditableInput.prototype.blur = function () { this.div.blur() }; +ContentEditableInput.prototype.blur = function () { this.div.blur(); }; ContentEditableInput.prototype.getField = function () { return this.div }; ContentEditableInput.prototype.supportsTouch = function () { return true }; ContentEditableInput.prototype.receivedFocus = function () { - var input = this + var input = this; if (this.selectionInEditor()) - { this.pollSelection() } + { this.pollSelection(); } else - { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) } + { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); } function poll() { if (input.cm.state.focused) { - input.pollSelection() - input.polling.set(input.cm.options.pollInterval, poll) + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); } } - this.polling.set(this.cm.options.pollInterval, poll) + this.polling.set(this.cm.options.pollInterval, poll); }; ContentEditableInput.prototype.selectionChanged = function () { - var sel = window.getSelection() + var sel = this.getSelection(); return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset }; ContentEditableInput.prototype.pollSelection = function () { - if (!this.composing && this.readDOMTimeout == null && !this.gracePeriod && this.selectionChanged()) { - var sel = window.getSelection(), cm = this.cm - this.rememberSelection() - var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset) - var head = domToPos(cm, sel.focusNode, sel.focusOffset) - if (anchor && head) { runInOp(cm, function () { - setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll) - if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true } - }) } + if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return } + var sel = this.getSelection(), cm = this.cm; + // On Android Chrome (version 56, at least), backspacing into an + // uneditable block element will put the cursor in that element, + // and then, because it's not editable, hide the virtual keyboard. + // Because Android doesn't allow us to actually detect backspace + // presses in a sane way, this code checks for when that happens + // and simulates a backspace press in this case. + if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) { + this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs}); + this.blur(); + this.focus(); + return } + if (this.composing) { return } + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) { runInOp(cm, function () { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; } + }); } }; ContentEditableInput.prototype.pollContent = function () { if (this.readDOMTimeout != null) { - clearTimeout(this.readDOMTimeout) - this.readDOMTimeout = null + clearTimeout(this.readDOMTimeout); + this.readDOMTimeout = null; } - var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary() - var from = sel.from(), to = sel.to() + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); + var from = sel.from(), to = sel.to(); if (from.ch == 0 && from.line > cm.firstLine()) - { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) } + { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); } if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) - { to = Pos(to.line + 1, 0) } + { to = Pos(to.line + 1, 0); } if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false } - var fromIndex, fromLine, fromNode + var fromIndex, fromLine, fromNode; if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { - fromLine = lineNo(display.view[0].line) - fromNode = display.view[0].node + fromLine = lineNo(display.view[0].line); + fromNode = display.view[0].node; } else { - fromLine = lineNo(display.view[fromIndex].line) - fromNode = display.view[fromIndex - 1].node.nextSibling + fromLine = lineNo(display.view[fromIndex].line); + fromNode = display.view[fromIndex - 1].node.nextSibling; } - var toIndex = findViewIndex(cm, to.line) - var toLine, toNode + var toIndex = findViewIndex(cm, to.line); + var toLine, toNode; if (toIndex == display.view.length - 1) { - toLine = display.viewTo - 1 - toNode = display.lineDiv.lastChild + toLine = display.viewTo - 1; + toNode = display.lineDiv.lastChild; } else { - toLine = lineNo(display.view[toIndex + 1].line) - 1 - toNode = display.view[toIndex + 1].node.previousSibling + toLine = lineNo(display.view[toIndex + 1].line) - 1; + toNode = display.view[toIndex + 1].node.previousSibling; } if (!fromNode) { return false } - var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)) - var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)) + var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); while (newText.length > 1 && oldText.length > 1) { - if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- } - else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ } + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } else { break } } - var cutFront = 0, cutEnd = 0 - var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length) + var cutFront = 0, cutEnd = 0; + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) - { ++cutFront } - var newBot = lst(newText), oldBot = lst(oldText) + { ++cutFront; } + var newBot = lst(newText), oldBot = lst(oldText); var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), - oldBot.length - (oldText.length == 1 ? cutFront : 0)) + oldBot.length - (oldText.length == 1 ? cutFront : 0)); while (cutEnd < maxCutEnd && newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) - { ++cutEnd } + { ++cutEnd; } + // Try to move start of change to start of selection if ambiguous + if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { + while (cutFront && cutFront > from.ch && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + cutFront--; + cutEnd++; + } + } - newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "") - newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "") + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); + newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); - var chFrom = Pos(fromLine, cutFront) - var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0) + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { - replaceRange(cm.doc, newText, chFrom, chTo, "+input") + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); return true } }; ContentEditableInput.prototype.ensurePolled = function () { - this.forceCompositionEnd() + this.forceCompositionEnd(); }; ContentEditableInput.prototype.reset = function () { - this.forceCompositionEnd() + this.forceCompositionEnd(); }; ContentEditableInput.prototype.forceCompositionEnd = function () { if (!this.composing) { return } - clearTimeout(this.readDOMTimeout) - this.composing = null - if (!this.pollContent()) { regChange(this.cm) } - this.div.blur() - this.div.focus() + clearTimeout(this.readDOMTimeout); + this.composing = null; + this.updateFromDOM(); + this.div.blur(); + this.div.focus(); }; ContentEditableInput.prototype.readFromDOMSoon = function () { var this$1 = this; if (this.readDOMTimeout != null) { return } this.readDOMTimeout = setTimeout(function () { - this$1.readDOMTimeout = null + this$1.readDOMTimeout = null; if (this$1.composing) { - if (this$1.composing.done) { this$1.composing = null } + if (this$1.composing.done) { this$1.composing = null; } else { return } } - if (this$1.cm.isReadOnly() || !this$1.pollContent()) - { runInOp(this$1.cm, function () { return regChange(this$1.cm); }) } - }, 80) + this$1.updateFromDOM(); + }, 80); +}; + +ContentEditableInput.prototype.updateFromDOM = function () { + var this$1 = this; + + if (this.cm.isReadOnly() || !this.pollContent()) + { runInOp(this.cm, function () { return regChange(this$1.cm); }); } }; ContentEditableInput.prototype.setUneditable = function (node) { - node.contentEditable = "false" + node.contentEditable = "false"; }; ContentEditableInput.prototype.onKeyPress = function (e) { - e.preventDefault() + if (e.charCode == 0 || this.composing) { return } + e.preventDefault(); if (!this.cm.isReadOnly()) - { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) } + { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); } }; ContentEditableInput.prototype.readOnlyChanged = function (val) { - this.div.contentEditable = String(val != "nocursor") + this.div.contentEditable = String(val != "nocursor"); }; ContentEditableInput.prototype.onContextMenu = function () {}; ContentEditableInput.prototype.resetPosition = function () {}; -ContentEditableInput.prototype.needsContentAttribute = true +ContentEditableInput.prototype.needsContentAttribute = true; function posToDOM(cm, pos) { - var view = findViewForLine(cm, pos.line) + var view = findViewForLine(cm, pos.line); if (!view || view.hidden) { return null } - var line = getLine(cm.doc, pos.line) - var info = mapFromLineView(view, line, pos.line) + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); - var order = getOrder(line), side = "left" + var order = getOrder(line, cm.doc.direction), side = "left"; if (order) { - var partPos = getBidiPartAt(order, pos.ch) - side = partPos % 2 ? "right" : "left" + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; } - var result = nodeAndOffsetInLineMap(info.map, pos.ch, side) - result.offset = result.collapse == "right" ? result.end : result.start + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; return result } +function isInGutter(node) { + for (var scan = node; scan; scan = scan.parentNode) + { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } } + return false +} + function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos } function domTextBetween(cm, from, to, fromLine, toLine) { - var text = "", closing = false, lineSep = cm.doc.lineSeparator() + var text = "", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false; function recognizeMarker(id) { return function (marker) { return marker.id == id; } } + function close() { + if (closing) { + text += lineSep; + if (extraLinebreak) { text += lineSep; } + closing = extraLinebreak = false; + } + } + function addText(str) { + if (str) { + close(); + text += str; + } + } function walk(node) { if (node.nodeType == 1) { - var cmText = node.getAttribute("cm-text") - if (cmText != null) { - if (cmText == "") { text += node.textContent.replace(/\u200b/g, "") } - else { text += cmText } + var cmText = node.getAttribute("cm-text"); + if (cmText) { + addText(cmText); return } - var markerID = node.getAttribute("cm-marker"), range + var markerID = node.getAttribute("cm-marker"), range$$1; if (markerID) { - var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)) - if (found.length && (range = found[0].find())) - { text += getBetween(cm.doc, range.from, range.to).join(lineSep) } + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range$$1 = found[0].find(0))) + { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); } return } if (node.getAttribute("contenteditable") == "false") { return } + var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName); + if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return } + + if (isBlock) { close(); } for (var i = 0; i < node.childNodes.length; i++) - { walk(node.childNodes[i]) } - if (/^(pre|div|p)$/i.test(node.nodeName)) - { closing = true } + { walk(node.childNodes[i]); } + + if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; } + if (isBlock) { closing = true; } } else if (node.nodeType == 3) { - var val = node.nodeValue - if (!val) { return } - if (closing) { - text += lineSep - closing = false - } - text += val + addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); } } for (;;) { - walk(from) + walk(from); if (from == to) { break } - from = from.nextSibling + from = from.nextSibling; + extraLinebreak = false; } return text } function domToPos(cm, node, offset) { - var lineNode + var lineNode; if (node == cm.display.lineDiv) { - lineNode = cm.display.lineDiv.childNodes[offset] + lineNode = cm.display.lineDiv.childNodes[offset]; if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) } - node = null; offset = 0 + node = null; offset = 0; } else { for (lineNode = node;; lineNode = lineNode.parentNode) { if (!lineNode || lineNode == cm.display.lineDiv) { return null } @@ -16172,218 +16759,210 @@ function domToPos(cm, node, offset) { } } for (var i = 0; i < cm.display.view.length; i++) { - var lineView = cm.display.view[i] + var lineView = cm.display.view[i]; if (lineView.node == lineNode) { return locateNodeInLineView(lineView, node, offset) } } } function locateNodeInLineView(lineView, node, offset) { - var wrapper = lineView.text.firstChild, bad = false + var wrapper = lineView.text.firstChild, bad = false; if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) } if (node == wrapper) { - bad = true - node = wrapper.childNodes[offset] - offset = 0 + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; if (!node) { - var line = lineView.rest ? lst(lineView.rest) : lineView.line + var line = lineView.rest ? lst(lineView.rest) : lineView.line; return badPos(Pos(lineNo(line), line.text.length), bad) } } - var textNode = node.nodeType == 3 ? node : null, topNode = node + var textNode = node.nodeType == 3 ? node : null, topNode = node; if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { - textNode = node.firstChild - if (offset) { offset = textNode.nodeValue.length } + textNode = node.firstChild; + if (offset) { offset = textNode.nodeValue.length; } } - while (topNode.parentNode != wrapper) { topNode = topNode.parentNode } - var measure = lineView.measure, maps = measure.maps + while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; } + var measure = lineView.measure, maps = measure.maps; function find(textNode, topNode, offset) { for (var i = -1; i < (maps ? maps.length : 0); i++) { - var map = i < 0 ? measure.map : maps[i] - for (var j = 0; j < map.length; j += 3) { - var curNode = map[j + 2] + var map$$1 = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map$$1.length; j += 3) { + var curNode = map$$1[j + 2]; if (curNode == textNode || curNode == topNode) { - var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]) - var ch = map[j] + offset - if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] } + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map$$1[j] + offset; + if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; } return Pos(line, ch) } } } } - var found = find(textNode, topNode, offset) + var found = find(textNode, topNode, offset); if (found) { return badPos(found, bad) } // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { - found = find(after, after.firstChild, 0) + found = find(after, after.firstChild, 0); if (found) { return badPos(Pos(found.line, found.ch - dist), bad) } else - { dist += after.textContent.length } + { dist += after.textContent.length; } } for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { - found = find(before, before.firstChild, -1) + found = find(before, before.firstChild, -1); if (found) { return badPos(Pos(found.line, found.ch + dist$1), bad) } else - { dist$1 += before.textContent.length } + { dist$1 += before.textContent.length; } } } // TEXTAREA INPUT STYLE var TextareaInput = function(cm) { - this.cm = cm + this.cm = cm; // See input.poll and input.reset - this.prevInput = "" + this.prevInput = ""; // Flag that indicates whether we expect input to appear real soon // now (after some event like 'keypress' or 'input') and are // polling intensively. - this.pollingFast = false + this.pollingFast = false; // Self-resetting timeout for the poller - this.polling = new Delayed() - // Tracks when input.reset has punted to just putting a short - // string into the textarea instead of the full selection. - this.inaccurateSelection = false + this.polling = new Delayed(); // Used to work around IE issue with selection being forgotten when focus moves away from textarea - this.hasSelection = false - this.composing = null + this.hasSelection = false; + this.composing = null; }; TextareaInput.prototype.init = function (display) { var this$1 = this; - var input = this, cm = this.cm + var input = this, cm = this.cm; + this.createField(display); + var te = this.textarea; - // Wraps and hides input textarea - var div = this.wrapper = hiddenTextarea() - // The semihidden textarea that is focused when the editor is - // focused, and receives input. - var te = this.textarea = div.firstChild - display.wrapper.insertBefore(div, display.wrapper.firstChild) + display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild); // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) - if (ios) { te.style.width = "0px" } + if (ios) { te.style.width = "0px"; } on(te, "input", function () { - if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null } - input.poll() - }) + if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; } + input.poll(); + }); on(te, "paste", function (e) { if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } - cm.state.pasteIncoming = true - input.fastPoll() - }) + cm.state.pasteIncoming = true; + input.fastPoll(); + }); function prepareCopyCut(e) { if (signalDOMEvent(cm, e)) { return } if (cm.somethingSelected()) { - setLastCopied({lineWise: false, text: cm.getSelections()}) - if (input.inaccurateSelection) { - input.prevInput = "" - input.inaccurateSelection = false - te.value = lastCopied.text.join("\n") - selectInput(te) - } + setLastCopied({lineWise: false, text: cm.getSelections()}); } else if (!cm.options.lineWiseCopyCut) { return } else { - var ranges = copyableRanges(cm) - setLastCopied({lineWise: true, text: ranges.text}) + var ranges = copyableRanges(cm); + setLastCopied({lineWise: true, text: ranges.text}); if (e.type == "cut") { - cm.setSelections(ranges.ranges, null, sel_dontScroll) + cm.setSelections(ranges.ranges, null, sel_dontScroll); } else { - input.prevInput = "" - te.value = ranges.text.join("\n") - selectInput(te) + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); } } - if (e.type == "cut") { cm.state.cutIncoming = true } + if (e.type == "cut") { cm.state.cutIncoming = true; } } - on(te, "cut", prepareCopyCut) - on(te, "copy", prepareCopyCut) + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); on(display.scroller, "paste", function (e) { if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return } - cm.state.pasteIncoming = true - input.focus() - }) + cm.state.pasteIncoming = true; + input.focus(); + }); // Prevent normal selection in the editor (we handle our own) on(display.lineSpace, "selectstart", function (e) { - if (!eventInWidget(display, e)) { e_preventDefault(e) } - }) + if (!eventInWidget(display, e)) { e_preventDefault(e); } + }); on(te, "compositionstart", function () { - var start = cm.getCursor("from") - if (input.composing) { input.composing.range.clear() } + var start = cm.getCursor("from"); + if (input.composing) { input.composing.range.clear(); } input.composing = { start: start, range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) - } - }) + }; + }); on(te, "compositionend", function () { if (input.composing) { - input.poll() - input.composing.range.clear() - input.composing = null + input.poll(); + input.composing.range.clear(); + input.composing = null; } - }) + }); +}; + +TextareaInput.prototype.createField = function (_display) { + // Wraps and hides input textarea + this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + this.textarea = this.wrapper.firstChild; }; TextareaInput.prototype.prepareSelection = function () { // Redraw the selection and/or cursor - var cm = this.cm, display = cm.display, doc = cm.doc - var result = prepareSelection(cm) + var cm = this.cm, display = cm.display, doc = cm.doc; + var result = prepareSelection(cm); // Move the hidden textarea near the cursor to prevent scrolling artifacts if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div") - var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect() + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)) + headPos.top + lineOff.top - wrapOff.top)); result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)) + headPos.left + lineOff.left - wrapOff.left)); } return result }; TextareaInput.prototype.showSelection = function (drawn) { - var cm = this.cm, display = cm.display - removeChildrenAndAdd(display.cursorDiv, drawn.cursors) - removeChildrenAndAdd(display.selectionDiv, drawn.selection) + var cm = this.cm, display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); if (drawn.teTop != null) { - this.wrapper.style.top = drawn.teTop + "px" - this.wrapper.style.left = drawn.teLeft + "px" + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; } }; // Reset the input to correspond to the selection (or to be empty, // when not typing and nothing is selected) TextareaInput.prototype.reset = function (typing) { - if (this.contextMenuPending) { return } - var minimal, selected, cm = this.cm, doc = cm.doc + if (this.contextMenuPending || this.composing) { return } + var cm = this.cm; if (cm.somethingSelected()) { - this.prevInput = "" - var range = doc.sel.primary() - minimal = hasCopyEvent && - (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000) - var content = minimal ? "-" : selected || cm.getSelection() - this.textarea.value = content - if (cm.state.focused) { selectInput(this.textarea) } - if (ie && ie_version >= 9) { this.hasSelection = content } + this.prevInput = ""; + var content = cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) { selectInput(this.textarea); } + if (ie && ie_version >= 9) { this.hasSelection = content; } } else if (!typing) { - this.prevInput = this.textarea.value = "" - if (ie && ie_version >= 9) { this.hasSelection = null } + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) { this.hasSelection = null; } } - this.inaccurateSelection = minimal }; TextareaInput.prototype.getField = function () { return this.textarea }; @@ -16392,18 +16971,18 @@ TextareaInput.prototype.supportsTouch = function () { return false }; TextareaInput.prototype.focus = function () { if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { - try { this.textarea.focus() } + try { this.textarea.focus(); } catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM } }; -TextareaInput.prototype.blur = function () { this.textarea.blur() }; +TextareaInput.prototype.blur = function () { this.textarea.blur(); }; TextareaInput.prototype.resetPosition = function () { - this.wrapper.style.top = this.wrapper.style.left = 0 + this.wrapper.style.top = this.wrapper.style.left = 0; }; -TextareaInput.prototype.receivedFocus = function () { this.slowPoll() }; +TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); }; // Poll for input changes, using the normal rate of polling. This // runs as long as the editor is focused. @@ -16412,23 +16991,23 @@ TextareaInput.prototype.slowPoll = function () { if (this.pollingFast) { return } this.polling.set(this.cm.options.pollInterval, function () { - this$1.poll() - if (this$1.cm.state.focused) { this$1.slowPoll() } - }) + this$1.poll(); + if (this$1.cm.state.focused) { this$1.slowPoll(); } + }); }; // When an event has just come in that is likely to add or change // something in the input textarea, we poll faster, to ensure that // the change appears on the screen quickly. TextareaInput.prototype.fastPoll = function () { - var missed = false, input = this - input.pollingFast = true + var missed = false, input = this; + input.pollingFast = true; function p() { - var changed = input.poll() - if (!changed && !missed) {missed = true; input.polling.set(60, p)} - else {input.pollingFast = false; input.slowPoll()} + var changed = input.poll(); + if (!changed && !missed) {missed = true; input.polling.set(60, p);} + else {input.pollingFast = false; input.slowPoll();} } - input.polling.set(20, p) + input.polling.set(20, p); }; // Read input from the textarea, and update the document to match. @@ -16440,7 +17019,7 @@ TextareaInput.prototype.fastPoll = function () { TextareaInput.prototype.poll = function () { var this$1 = this; - var cm = this.cm, input = this.textarea, prevInput = this.prevInput + var cm = this.cm, input = this.textarea, prevInput = this.prevInput; // Since this is called a *lot*, try to bail out as cheaply as // possible when it is clear that nothing happened. hasSelection // will be the case when there is a lot of text in the textarea, @@ -16450,7 +17029,7 @@ TextareaInput.prototype.poll = function () { cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) { return false } - var text = input.value + var text = input.value; // If nothing changed, bail. if (text == prevInput && !cm.somethingSelected()) { return false } // Work around nonsensical selection resetting in IE9/10, and @@ -16458,470 +17037,580 @@ TextareaInput.prototype.poll = function () { // some key combos in Mac (#2689). if (ie && ie_version >= 9 && this.hasSelection === text || mac && /[\uf700-\uf7ff]/.test(text)) { - cm.display.input.reset() + cm.display.input.reset(); return false } if (cm.doc.sel == cm.display.selForContextMenu) { - var first = text.charCodeAt(0) - if (first == 0x200b && !prevInput) { prevInput = "\u200b" } + var first = text.charCodeAt(0); + if (first == 0x200b && !prevInput) { prevInput = "\u200b"; } if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") } } // Find the part of the input that is actually new - var same = 0, l = Math.min(prevInput.length, text.length) - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same } + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; } runInOp(cm, function () { applyTextInput(cm, text.slice(same), prevInput.length - same, - null, this$1.composing ? "*compose" : null) + null, this$1.composing ? "*compose" : null); // Don't leave long text in the textarea, since it makes further polling slow - if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = "" } - else { this$1.prevInput = text } + if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = ""; } + else { this$1.prevInput = text; } if (this$1.composing) { - this$1.composing.range.clear() + this$1.composing.range.clear(); this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), - {className: "CodeMirror-composing"}) + {className: "CodeMirror-composing"}); } - }) + }); return true }; TextareaInput.prototype.ensurePolled = function () { - if (this.pollingFast && this.poll()) { this.pollingFast = false } + if (this.pollingFast && this.poll()) { this.pollingFast = false; } }; TextareaInput.prototype.onKeyPress = function () { - if (ie && ie_version >= 9) { this.hasSelection = null } - this.fastPoll() + if (ie && ie_version >= 9) { this.hasSelection = null; } + this.fastPoll(); }; TextareaInput.prototype.onContextMenu = function (e) { - var input = this, cm = input.cm, display = cm.display, te = input.textarea - var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop + var input = this, cm = input.cm, display = cm.display, te = input.textarea; + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; if (!pos || presto) { return } // Opera is difficult. // Reset the current text selection only if the click is done outside of the selection // and 'resetSelectionOnContextMenu' option is true. - var reset = cm.options.resetSelectionOnContextMenu + var reset = cm.options.resetSelectionOnContextMenu; if (reset && cm.doc.sel.contains(pos) == -1) - { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) } - - var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText - input.wrapper.style.cssText = "position: absolute" - var wrapperBox = input.wrapper.getBoundingClientRect() - te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);" - var oldScrollY - if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712) - display.input.focus() - if (webkit) { window.scrollTo(null, oldScrollY) } - display.input.reset() + { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); } + + var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText; + input.wrapper.style.cssText = "position: absolute"; + var wrapperBox = input.wrapper.getBoundingClientRect(); + te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + var oldScrollY; + if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) { window.scrollTo(null, oldScrollY); } + display.input.reset(); // Adds "Select all" to context menu in FF - if (!cm.somethingSelected()) { te.value = input.prevInput = " " } - input.contextMenuPending = true - display.selForContextMenu = cm.doc.sel - clearTimeout(display.detectingSelectAll) + if (!cm.somethingSelected()) { te.value = input.prevInput = " "; } + input.contextMenuPending = true; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); // Select-all will be greyed out if there's nothing to select, so // this adds a zero-width space so that we can later check whether // it got selected. function prepareSelectAllHack() { if (te.selectionStart != null) { - var selected = cm.somethingSelected() - var extval = "\u200b" + (selected ? te.value : "") - te.value = "\u21da" // Used to catch context-menu undo - te.value = extval - input.prevInput = selected ? "" : "\u200b" - te.selectionStart = 1; te.selectionEnd = extval.length + var selected = cm.somethingSelected(); + var extval = "\u200b" + (selected ? te.value : ""); + te.value = "\u21da"; // Used to catch context-menu undo + te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; te.selectionEnd = extval.length; // Re-set this, in case some other handler touched the // selection in the meantime. - display.selForContextMenu = cm.doc.sel + display.selForContextMenu = cm.doc.sel; } } function rehide() { - input.contextMenuPending = false - input.wrapper.style.cssText = oldWrapperCSS - te.style.cssText = oldCSS - if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) } + input.contextMenuPending = false; + input.wrapper.style.cssText = oldWrapperCSS; + te.style.cssText = oldCSS; + if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); } // Try to detect the user choosing select-all if (te.selectionStart != null) { - if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() } + if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); } var i = 0, poll = function () { if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && - te.selectionEnd > 0 && input.prevInput == "\u200b") - { operation(cm, selectAll)(cm) } - else if (i++ < 10) { display.detectingSelectAll = setTimeout(poll, 500) } - else { display.input.reset() } - } - display.detectingSelectAll = setTimeout(poll, 200) + te.selectionEnd > 0 && input.prevInput == "\u200b") { + operation(cm, selectAll)(cm); + } else if (i++ < 10) { + display.detectingSelectAll = setTimeout(poll, 500); + } else { + display.selForContextMenu = null; + display.input.reset(); + } + }; + display.detectingSelectAll = setTimeout(poll, 200); } } - if (ie && ie_version >= 9) { prepareSelectAllHack() } + if (ie && ie_version >= 9) { prepareSelectAllHack(); } if (captureRightClick) { - e_stop(e) + e_stop(e); var mouseup = function () { - off(window, "mouseup", mouseup) - setTimeout(rehide, 20) - } - on(window, "mouseup", mouseup) + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); } else { - setTimeout(rehide, 50) + setTimeout(rehide, 50); } }; TextareaInput.prototype.readOnlyChanged = function (val) { - if (!val) { this.reset() } + if (!val) { this.reset(); } + this.textarea.disabled = val == "nocursor"; }; TextareaInput.prototype.setUneditable = function () {}; -TextareaInput.prototype.needsContentAttribute = false +TextareaInput.prototype.needsContentAttribute = false; function fromTextArea(textarea, options) { - options = options ? copyObj(options) : {} - options.value = textarea.value + options = options ? copyObj(options) : {}; + options.value = textarea.value; if (!options.tabindex && textarea.tabIndex) - { options.tabindex = textarea.tabIndex } + { options.tabindex = textarea.tabIndex; } if (!options.placeholder && textarea.placeholder) - { options.placeholder = textarea.placeholder } + { options.placeholder = textarea.placeholder; } // Set autofocus to true if this textarea is focused, or if it has // autofocus and no other element is focused. if (options.autofocus == null) { - var hasFocus = activeElt() + var hasFocus = activeElt(); options.autofocus = hasFocus == textarea || - textarea.getAttribute("autofocus") != null && hasFocus == document.body + textarea.getAttribute("autofocus") != null && hasFocus == document.body; } - function save() {textarea.value = cm.getValue()} + function save() {textarea.value = cm.getValue();} - var realSubmit + var realSubmit; if (textarea.form) { - on(textarea.form, "submit", save) + on(textarea.form, "submit", save); // Deplorable hack to make the submit method do the right thing. if (!options.leaveSubmitMethodAlone) { - var form = textarea.form - realSubmit = form.submit + var form = textarea.form; + realSubmit = form.submit; try { var wrappedSubmit = form.submit = function () { - save() - form.submit = realSubmit - form.submit() - form.submit = wrappedSubmit - } + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; } catch(e) {} } } options.finishInit = function (cm) { - cm.save = save - cm.getTextArea = function () { return textarea; } + cm.save = save; + cm.getTextArea = function () { return textarea; }; cm.toTextArea = function () { - cm.toTextArea = isNaN // Prevent this from being ran twice - save() - textarea.parentNode.removeChild(cm.getWrapperElement()) - textarea.style.display = "" + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; if (textarea.form) { - off(textarea.form, "submit", save) + off(textarea.form, "submit", save); if (typeof textarea.form.submit == "function") - { textarea.form.submit = realSubmit } + { textarea.form.submit = realSubmit; } } - } - } + }; + }; - textarea.style.display = "none" - var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, - options) + textarea.style.display = "none"; + var cm = CodeMirror$1(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, + options); return cm } function addLegacyProps(CodeMirror) { - CodeMirror.off = off - CodeMirror.on = on - CodeMirror.wheelEventPixels = wheelEventPixels - CodeMirror.Doc = Doc - CodeMirror.splitLines = splitLinesAuto - CodeMirror.countColumn = countColumn - CodeMirror.findColumn = findColumn - CodeMirror.isWordChar = isWordCharBasic - CodeMirror.Pass = Pass - CodeMirror.signal = signal - CodeMirror.Line = Line - CodeMirror.changeEnd = changeEnd - CodeMirror.scrollbarModel = scrollbarModel - CodeMirror.Pos = Pos - CodeMirror.cmpPos = cmp - CodeMirror.modes = modes - CodeMirror.mimeModes = mimeModes - CodeMirror.resolveMode = resolveMode - CodeMirror.getMode = getMode - CodeMirror.modeExtensions = modeExtensions - CodeMirror.extendMode = extendMode - CodeMirror.copyState = copyState - CodeMirror.startState = startState - CodeMirror.innerMode = innerMode - CodeMirror.commands = commands - CodeMirror.keyMap = keyMap - CodeMirror.keyName = keyName - CodeMirror.isModifierKey = isModifierKey - CodeMirror.lookupKey = lookupKey - CodeMirror.normalizeKeyMap = normalizeKeyMap - CodeMirror.StringStream = StringStream - CodeMirror.SharedTextMarker = SharedTextMarker - CodeMirror.TextMarker = TextMarker - CodeMirror.LineWidget = LineWidget - CodeMirror.e_preventDefault = e_preventDefault - CodeMirror.e_stopPropagation = e_stopPropagation - CodeMirror.e_stop = e_stop - CodeMirror.addClass = addClass - CodeMirror.contains = contains - CodeMirror.rmClass = rmClass - CodeMirror.keyNames = keyNames + CodeMirror.off = off; + CodeMirror.on = on; + CodeMirror.wheelEventPixels = wheelEventPixels; + CodeMirror.Doc = Doc; + CodeMirror.splitLines = splitLinesAuto; + CodeMirror.countColumn = countColumn; + CodeMirror.findColumn = findColumn; + CodeMirror.isWordChar = isWordCharBasic; + CodeMirror.Pass = Pass; + CodeMirror.signal = signal; + CodeMirror.Line = Line; + CodeMirror.changeEnd = changeEnd; + CodeMirror.scrollbarModel = scrollbarModel; + CodeMirror.Pos = Pos; + CodeMirror.cmpPos = cmp; + CodeMirror.modes = modes; + CodeMirror.mimeModes = mimeModes; + CodeMirror.resolveMode = resolveMode; + CodeMirror.getMode = getMode; + CodeMirror.modeExtensions = modeExtensions; + CodeMirror.extendMode = extendMode; + CodeMirror.copyState = copyState; + CodeMirror.startState = startState; + CodeMirror.innerMode = innerMode; + CodeMirror.commands = commands; + CodeMirror.keyMap = keyMap; + CodeMirror.keyName = keyName; + CodeMirror.isModifierKey = isModifierKey; + CodeMirror.lookupKey = lookupKey; + CodeMirror.normalizeKeyMap = normalizeKeyMap; + CodeMirror.StringStream = StringStream; + CodeMirror.SharedTextMarker = SharedTextMarker; + CodeMirror.TextMarker = TextMarker; + CodeMirror.LineWidget = LineWidget; + CodeMirror.e_preventDefault = e_preventDefault; + CodeMirror.e_stopPropagation = e_stopPropagation; + CodeMirror.e_stop = e_stop; + CodeMirror.addClass = addClass; + CodeMirror.contains = contains; + CodeMirror.rmClass = rmClass; + CodeMirror.keyNames = keyNames; } // EDITOR CONSTRUCTOR -defineOptions(CodeMirror) +defineOptions(CodeMirror$1); -addEditorMethods(CodeMirror) +addEditorMethods(CodeMirror$1); // Set up methods on CodeMirror's prototype to redirect to the editor's document. -var dontDelegate = "iter insert remove copy getEditor constructor".split(" ") +var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) - { CodeMirror.prototype[prop] = (function(method) { + { CodeMirror$1.prototype[prop] = (function(method) { return function() {return method.apply(this.doc, arguments)} - })(Doc.prototype[prop]) } } + })(Doc.prototype[prop]); } } -eventMixin(Doc) +eventMixin(Doc); // INPUT HANDLING -CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput} +CodeMirror$1.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; // MODE DEFINITION AND QUERYING // Extra arguments are stored as the mode's dependencies, which is // used by (legacy) mechanisms like loadmode.js to automatically // load a mode. (Preferred mechanism is the require/define calls.) -CodeMirror.defineMode = function(name/*, mode, …*/) { - if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name } - defineMode.apply(this, arguments) -} +CodeMirror$1.defineMode = function(name/*, mode, …*/) { + if (!CodeMirror$1.defaults.mode && name != "null") { CodeMirror$1.defaults.mode = name; } + defineMode.apply(this, arguments); +}; -CodeMirror.defineMIME = defineMIME +CodeMirror$1.defineMIME = defineMIME; // Minimal default mode. -CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }) -CodeMirror.defineMIME("text/plain", "null") +CodeMirror$1.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }); +CodeMirror$1.defineMIME("text/plain", "null"); // EXTENSIONS -CodeMirror.defineExtension = function (name, func) { - CodeMirror.prototype[name] = func -} -CodeMirror.defineDocExtension = function (name, func) { - Doc.prototype[name] = func -} +CodeMirror$1.defineExtension = function (name, func) { + CodeMirror$1.prototype[name] = func; +}; +CodeMirror$1.defineDocExtension = function (name, func) { + Doc.prototype[name] = func; +}; -CodeMirror.fromTextArea = fromTextArea +CodeMirror$1.fromTextArea = fromTextArea; -addLegacyProps(CodeMirror) +addLegacyProps(CodeMirror$1); -CodeMirror.version = "5.22.2" +CodeMirror$1.version = "5.38.0"; -return CodeMirror; +return CodeMirror$1; }))); + // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); + mod(require("../../lib/codemirror")) else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); + define(["../../lib/codemirror"], mod) else // Plain browser env - mod(CodeMirror); + mod(CodeMirror) })(function(CodeMirror) { - "use strict"; - var Pos = CodeMirror.Pos; + "use strict" + var Pos = CodeMirror.Pos + + function regexpFlags(regexp) { + var flags = regexp.flags + return flags != null ? flags : (regexp.ignoreCase ? "i" : "") + + (regexp.global ? "g" : "") + + (regexp.multiline ? "m" : "") + } + + function ensureFlags(regexp, flags) { + var current = regexpFlags(regexp), target = current + for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1) + target += flags.charAt(i) + return current == target ? regexp : new RegExp(regexp.source, target) + } + + function maybeMultiline(regexp) { + return /\\s|\\n|\n|\\W|\\D|\[\^/.test(regexp.source) + } + + function searchRegexpForward(doc, regexp, start) { + regexp = ensureFlags(regexp, "g") + for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) { + regexp.lastIndex = ch + var string = doc.getLine(line), match = regexp.exec(string) + if (match) + return {from: Pos(line, match.index), + to: Pos(line, match.index + match[0].length), + match: match} + } + } + + function searchRegexpForwardMultiline(doc, regexp, start) { + if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start) + + regexp = ensureFlags(regexp, "gm") + var string, chunk = 1 + for (var line = start.line, last = doc.lastLine(); line <= last;) { + // This grows the search buffer in exponentially-sized chunks + // between matches, so that nearby matches are fast and don't + // require concatenating the whole document (in case we're + // searching for something that has tons of matches), but at the + // same time, the amount of retries is limited. + for (var i = 0; i < chunk; i++) { + if (line > last) break + var curLine = doc.getLine(line++) + string = string == null ? curLine : string + "\n" + curLine + } + chunk = chunk * 2 + regexp.lastIndex = start.ch + var match = regexp.exec(string) + if (match) { + var before = string.slice(0, match.index).split("\n"), inside = match[0].split("\n") + var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length + return {from: Pos(startLine, startCh), + to: Pos(startLine + inside.length - 1, + inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), + match: match} + } + } + } + + function lastMatchIn(string, regexp) { + var cutOff = 0, match + for (;;) { + regexp.lastIndex = cutOff + var newMatch = regexp.exec(string) + if (!newMatch) return match + match = newMatch + cutOff = match.index + (match[0].length || 1) + if (cutOff == string.length) return match + } + } + + function searchRegexpBackward(doc, regexp, start) { + regexp = ensureFlags(regexp, "g") + for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) { + var string = doc.getLine(line) + if (ch > -1) string = string.slice(0, ch) + var match = lastMatchIn(string, regexp) + if (match) + return {from: Pos(line, match.index), + to: Pos(line, match.index + match[0].length), + match: match} + } + } + + function searchRegexpBackwardMultiline(doc, regexp, start) { + regexp = ensureFlags(regexp, "gm") + var string, chunk = 1 + for (var line = start.line, first = doc.firstLine(); line >= first;) { + for (var i = 0; i < chunk; i++) { + var curLine = doc.getLine(line--) + string = string == null ? curLine.slice(0, start.ch) : curLine + "\n" + string + } + chunk *= 2 + + var match = lastMatchIn(string, regexp) + if (match) { + var before = string.slice(0, match.index).split("\n"), inside = match[0].split("\n") + var startLine = line + before.length, startCh = before[before.length - 1].length + return {from: Pos(startLine, startCh), + to: Pos(startLine + inside.length - 1, + inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), + match: match} + } + } + } + + var doFold, noFold + if (String.prototype.normalize) { + doFold = function(str) { return str.normalize("NFD").toLowerCase() } + noFold = function(str) { return str.normalize("NFD") } + } else { + doFold = function(str) { return str.toLowerCase() } + noFold = function(str) { return str } + } + + // Maps a position in a case-folded line back to a position in the original line + // (compensating for codepoints increasing in number during folding) + function adjustPos(orig, folded, pos, foldFunc) { + if (orig.length == folded.length) return pos + for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) { + if (min == max) return min + var mid = (min + max) >> 1 + var len = foldFunc(orig.slice(0, mid)).length + if (len == pos) return mid + else if (len > pos) max = mid + else min = mid + 1 + } + } + + function searchStringForward(doc, query, start, caseFold) { + // Empty string would match anything and never progress, so we + // define it to match nothing instead. + if (!query.length) return null + var fold = caseFold ? doFold : noFold + var lines = fold(query).split(/\r|\n\r?/) + + search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) { + var orig = doc.getLine(line).slice(ch), string = fold(orig) + if (lines.length == 1) { + var found = string.indexOf(lines[0]) + if (found == -1) continue search + var start = adjustPos(orig, string, found, fold) + ch + return {from: Pos(line, adjustPos(orig, string, found, fold) + ch), + to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)} + } else { + var cutFrom = string.length - lines[0].length + if (string.slice(cutFrom) != lines[0]) continue search + for (var i = 1; i < lines.length - 1; i++) + if (fold(doc.getLine(line + i)) != lines[i]) continue search + var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1] + if (endString.slice(0, lastLine.length) != lastLine) continue search + return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch), + to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))} + } + } + } + + function searchStringBackward(doc, query, start, caseFold) { + if (!query.length) return null + var fold = caseFold ? doFold : noFold + var lines = fold(query).split(/\r|\n\r?/) + + search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) { + var orig = doc.getLine(line) + if (ch > -1) orig = orig.slice(0, ch) + var string = fold(orig) + if (lines.length == 1) { + var found = string.lastIndexOf(lines[0]) + if (found == -1) continue search + return {from: Pos(line, adjustPos(orig, string, found, fold)), + to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))} + } else { + var lastLine = lines[lines.length - 1] + if (string.slice(0, lastLine.length) != lastLine) continue search + for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++) + if (fold(doc.getLine(start + i)) != lines[i]) continue search + var top = doc.getLine(line + 1 - lines.length), topString = fold(top) + if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search + return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)), + to: Pos(line, adjustPos(orig, string, lastLine.length, fold))} + } + } + } - function SearchCursor(doc, query, pos, caseFold) { - this.atOccurrence = false; this.doc = doc; - if (caseFold == null && typeof query == "string") caseFold = false; + function SearchCursor(doc, query, pos, options) { + this.atOccurrence = false + this.doc = doc + pos = pos ? doc.clipPos(pos) : Pos(0, 0) + this.pos = {from: pos, to: pos} - pos = pos ? doc.clipPos(pos) : Pos(0, 0); - this.pos = {from: pos, to: pos}; + var caseFold + if (typeof options == "object") { + caseFold = options.caseFold + } else { // Backwards compat for when caseFold was the 4th argument + caseFold = options + options = null + } - // The matches method is filled in based on the type of query. - // It takes a position and a direction, and returns an object - // describing the next occurrence of the query, or null if no - // more matches were found. - if (typeof query != "string") { // Regexp match - if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g"); + if (typeof query == "string") { + if (caseFold == null) caseFold = false this.matches = function(reverse, pos) { - if (reverse) { - query.lastIndex = 0; - var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start; - for (;;) { - query.lastIndex = cutOff; - var newMatch = query.exec(line); - if (!newMatch) break; - match = newMatch; - start = match.index; - cutOff = match.index + (match[0].length || 1); - if (cutOff == line.length) break; - } - var matchLen = (match && match[0].length) || 0; - if (!matchLen) { - if (start == 0 && line.length == 0) {match = undefined;} - else if (start != doc.getLine(pos.line).length) { - matchLen++; - } - } - } else { - query.lastIndex = pos.ch; - var line = doc.getLine(pos.line), match = query.exec(line); - var matchLen = (match && match[0].length) || 0; - var start = match && match.index; - if (start + matchLen != line.length && !matchLen) matchLen = 1; - } - if (match && matchLen) - return {from: Pos(pos.line, start), - to: Pos(pos.line, start + matchLen), - match: match}; - }; - } else { // String query - var origQuery = query; - if (caseFold) query = query.toLowerCase(); - var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;}; - var target = query.split("\n"); - // Different methods for single-line and multi-line queries - if (target.length == 1) { - if (!query.length) { - // Empty string would match anything and never progress, so - // we define it to match nothing instead. - this.matches = function() {}; - } else { - this.matches = function(reverse, pos) { - if (reverse) { - var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig); - var match = line.lastIndexOf(query); - if (match > -1) { - match = adjustPos(orig, line, match); - return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)}; - } - } else { - var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig); - var match = line.indexOf(query); - if (match > -1) { - match = adjustPos(orig, line, match) + pos.ch; - return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)}; - } - } - }; + return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold) + } + } else { + query = ensureFlags(query, "gm") + if (!options || options.multiline !== false) + this.matches = function(reverse, pos) { + return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos) } - } else { - var origTarget = origQuery.split("\n"); + else this.matches = function(reverse, pos) { - var last = target.length - 1; - if (reverse) { - if (pos.line - (target.length - 1) < doc.firstLine()) return; - if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return; - var to = Pos(pos.line, origTarget[last].length); - for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln) - if (target[i] != fold(doc.getLine(ln))) return; - var line = doc.getLine(ln), cut = line.length - origTarget[0].length; - if (fold(line.slice(cut)) != target[0]) return; - return {from: Pos(ln, cut), to: to}; - } else { - if (pos.line + (target.length - 1) > doc.lastLine()) return; - var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length; - if (fold(line.slice(cut)) != target[0]) return; - var from = Pos(pos.line, cut); - for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln) - if (target[i] != fold(doc.getLine(ln))) return; - if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return; - return {from: from, to: Pos(ln, origTarget[last].length)}; - } - }; - } + return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos) + } } } SearchCursor.prototype = { - findNext: function() {return this.find(false);}, - findPrevious: function() {return this.find(true);}, + findNext: function() {return this.find(false)}, + findPrevious: function() {return this.find(true)}, find: function(reverse) { - var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to); - function savePosAndFail(line) { - var pos = Pos(line, 0); - self.pos = {from: pos, to: pos}; - self.atOccurrence = false; - return false; - } + var result = this.matches(reverse, this.doc.clipPos(reverse ? this.pos.from : this.pos.to)) - for (;;) { - if (this.pos = this.matches(reverse, pos)) { - this.atOccurrence = true; - return this.pos.match || true; - } + // Implements weird auto-growing behavior on null-matches for + // backwards-compatiblity with the vim code (unfortunately) + while (result && CodeMirror.cmpPos(result.from, result.to) == 0) { if (reverse) { - if (!pos.line) return savePosAndFail(0); - pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length); - } - else { - var maxLine = this.doc.lineCount(); - if (pos.line == maxLine - 1) return savePosAndFail(maxLine); - pos = Pos(pos.line + 1, 0); + if (result.from.ch) result.from = Pos(result.from.line, result.from.ch - 1) + else if (result.from.line == this.doc.firstLine()) result = null + else result = this.matches(reverse, this.doc.clipPos(Pos(result.from.line - 1))) + } else { + if (result.to.ch < this.doc.getLine(result.to.line).length) result.to = Pos(result.to.line, result.to.ch + 1) + else if (result.to.line == this.doc.lastLine()) result = null + else result = this.matches(reverse, Pos(result.to.line + 1, 0)) } } + + if (result) { + this.pos = result + this.atOccurrence = true + return this.pos.match || true + } else { + var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0) + this.pos = {from: end, to: end} + return this.atOccurrence = false + } }, - from: function() {if (this.atOccurrence) return this.pos.from;}, - to: function() {if (this.atOccurrence) return this.pos.to;}, + from: function() {if (this.atOccurrence) return this.pos.from}, + to: function() {if (this.atOccurrence) return this.pos.to}, replace: function(newText, origin) { - if (!this.atOccurrence) return; - var lines = CodeMirror.splitLines(newText); - this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin); + if (!this.atOccurrence) return + var lines = CodeMirror.splitLines(newText) + this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin) this.pos.to = Pos(this.pos.from.line + lines.length - 1, - lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0)); - } - }; - - // Maps a position in a case-folded line back to a position in the original line - // (compensating for codepoints increasing in number during folding) - function adjustPos(orig, folded, pos) { - if (orig.length == folded.length) return pos; - for (var pos1 = Math.min(pos, orig.length);;) { - var len1 = orig.slice(0, pos1).toLowerCase().length; - if (len1 < pos) ++pos1; - else if (len1 > pos) --pos1; - else return pos1; + lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0)) } } CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) { - return new SearchCursor(this.doc, query, pos, caseFold); - }); + return new SearchCursor(this.doc, query, pos, caseFold) + }) CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) { - return new SearchCursor(this, query, pos, caseFold); - }); + return new SearchCursor(this, query, pos, caseFold) + }) CodeMirror.defineExtension("selectMatches", function(query, caseFold) { - var ranges = []; - var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold); + var ranges = [] + var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold) while (cur.findNext()) { - if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break; - ranges.push({anchor: cur.from(), head: cur.to()}); + if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break + ranges.push({anchor: cur.from(), head: cur.to()}) } if (ranges.length) - this.setSelections(ranges, 0); - }); + this.setSelections(ranges, 0) + }) }); // CodeMirror, copyright (c) by Marijn Haverbeke and others @@ -16980,7 +17669,7 @@ return CodeMirror; function getSearchCursor(cm, query, pos) { // Heuristic: if the query string is all lowercase, do a case insensitive search. - return cm.getSearchCursor(query, pos, queryCaseInsensitive(query)); + return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true}); } function persistentDialog(cm, text, deflt, onEnter, onKeyDown) { @@ -17025,7 +17714,7 @@ return CodeMirror; } var queryDialog = - 'Search: (Use /re/ syntax for regexp search)'; + 'Search: (Use /re/ syntax for regexp search)'; function startSearch(cm, state, query) { state.queryText = query; @@ -17043,6 +17732,7 @@ return CodeMirror; var state = getSearchState(cm); if (state.query) return findNext(cm, rev); var q = cm.getSelection() || state.lastQuery; + if (q instanceof RegExp && q.source == "x^") q = null if (persistent && cm.openDialog) { var hiding = null var searchNext = function(query, event) { @@ -17063,8 +17753,7 @@ return CodeMirror; }; persistentDialog(cm, queryDialog, q, searchNext, function(event, query) { var keyName = CodeMirror.keyName(event) - var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][keyName] - if (!cmd) cmd = cm.getOption('extraKeys')[keyName] + var extra = cm.getOption('extraKeys'), cmd = (extra && extra[keyName]) || CodeMirror.keyMap[cm.getOption("keyMap")][keyName] if (cmd == "findNext" || cmd == "findPrev" || cmd == "findPersistentNext" || cmd == "findPersistentPrev") { CodeMirror.e_stop(event); @@ -17114,8 +17803,8 @@ return CodeMirror; var replaceQueryDialog = ' (Use /re/ syntax for regexp search)'; - var replacementQueryDialog = 'With: '; - var doReplaceConfirm = "Replace? "; + var replacementQueryDialog = 'With: '; + var doReplaceConfirm = 'Replace? '; function replaceAll(cm, query, text) { cm.operation(function() { @@ -17131,7 +17820,7 @@ return CodeMirror; function replace(cm, all) { if (cm.getOption("readOnly")) return; var query = cm.getSelection() || getSearchState(cm).lastQuery; - var dialogText = all ? "Replace all:" : "Replace:" + var dialogText = '' + (all ? 'Replace all:' : 'Replace:') + ''; dialog(cm, dialogText + replaceQueryDialog, dialogText, query, function(query) { if (!query) return; query = parseQuery(query); @@ -17204,6 +17893,7 @@ return CodeMirror; } else { // Assuming it's a detached DOM element. dialog.appendChild(template); } + CodeMirror.addClass(wrap, 'dialog-opened'); return dialog; } @@ -17226,6 +17916,7 @@ return CodeMirror; } else { if (closed) return; closed = true; + CodeMirror.rmClass(dialog.parentNode, 'dialog-opened'); dialog.parentNode.removeChild(dialog); me.focus(); @@ -17281,6 +17972,7 @@ return CodeMirror; function close() { if (closed) return; closed = true; + CodeMirror.rmClass(dialog.parentNode, 'dialog-opened'); dialog.parentNode.removeChild(dialog); me.focus(); } @@ -17320,6 +18012,7 @@ return CodeMirror; if (closed) return; closed = true; clearTimeout(doneTimer); + CodeMirror.rmClass(dialog.parentNode, 'dialog-opened'); dialog.parentNode.removeChild(dialog); } @@ -17353,12 +18046,21 @@ return CodeMirror; var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; - function findMatchingBracket(cm, where, strict, config) { + function findMatchingBracket(cm, where, config) { var line = cm.getLineHandle(where.line), pos = where.ch - 1; - var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; + var afterCursor = config && config.afterCursor + if (afterCursor == null) + afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className) + + // A cursor is defined as between two characters, but in in vim command mode + // (i.e. not insert mode), the cursor is visually represented as a + // highlighted box on top of the 2nd character. Otherwise, we allow matches + // from before or after the cursor. + var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) || + matching[line.text.charAt(++pos)]; if (!match) return null; var dir = match.charAt(1) == ">" ? 1 : -1; - if (strict && (dir > 0) != (pos == where.ch)) return null; + if (config && config.strict && (dir > 0) != (pos == where.ch)) return null; var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config); @@ -17406,7 +18108,7 @@ return CodeMirror; var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000; var marks = [], ranges = cm.listSelections(); for (var i = 0; i < ranges.length; i++) { - var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config); + var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config); if (match && cm.getLine(match.from.line).length <= maxHighlightLen) { var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style})); @@ -17430,18 +18132,23 @@ return CodeMirror; } } - var currentlyHighlighted = null; function doMatchBrackets(cm) { cm.operation(function() { - if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} - currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); + if (cm.state.matchBrackets.currentlyHighlighted) { + cm.state.matchBrackets.currentlyHighlighted(); + cm.state.matchBrackets.currentlyHighlighted = null; + } + cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); }); } CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) { if (old && old != CodeMirror.Init) { cm.off("cursorActivity", doMatchBrackets); - if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} + if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) { + cm.state.matchBrackets.currentlyHighlighted(); + cm.state.matchBrackets.currentlyHighlighted = null; + } } if (val) { cm.state.matchBrackets = typeof val == "object" ? val : {}; @@ -17450,8 +18157,17 @@ return CodeMirror; }); CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);}); - CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){ - return findMatchingBracket(this, pos, strict, config); + CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){ + // Backwards-compatibility kludge + if (oldConfig || typeof config == "boolean") { + if (!oldConfig) { + config = config ? {strict: true} : null + } else { + oldConfig.strict = config + config = oldConfig + } + } + return findMatchingBracket(this, pos, config) }); CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){ return scanForBracket(this, pos, dir, style, config); @@ -17483,6 +18199,7 @@ return CodeMirror; cm.state.closeBrackets = null; } if (val) { + ensureBound(getOption(val, "pairs")) cm.state.closeBrackets = val; cm.addKeyMap(keyMap); } @@ -17494,10 +18211,14 @@ return CodeMirror; return defaults[name]; } - var bind = defaults.pairs + "`"; var keyMap = {Backspace: handleBackspace, Enter: handleEnter}; - for (var i = 0; i < bind.length; i++) - keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i)); + function ensureBound(chars) { + for (var i = 0; i < chars.length; i++) { + var ch = chars.charAt(i), key = "'" + ch + "'" + if (!keyMap[key]) keyMap[key] = handler(ch) + } + } + ensureBound(defaults.pairs + "`") function handler(ch) { return function(cm) { return handleChar(cm, ch); }; @@ -17505,7 +18226,7 @@ return CodeMirror; function getConfig(cm) { var deflt = cm.state.closeBrackets; - if (!deflt) return null; + if (!deflt || deflt.override) return deflt; var mode = cm.getModeAt(cm.getCursor()); return mode.closeBrackets || deflt; } @@ -17539,7 +18260,8 @@ return CodeMirror; if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass; } cm.operation(function() { - cm.replaceSelection("\n\n", null); + var linesep = cm.lineSeparator() || "\n"; + cm.replaceSelection(linesep + linesep, null); cm.execCommand("goCharLeft"); ranges = cm.listSelections(); for (var i = 0; i < ranges.length; i++) { @@ -17583,11 +18305,12 @@ return CodeMirror; else curType = "skip"; } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && - cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch && - (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) { + cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) { + if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass; curType = "addFour"; } else if (identical) { - if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both"; + var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur) + if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both"; else return CodeMirror.Pass; } else if (opening && (cm.getLine(cur.line).length == cur.ch || isClosingBracket(next, pairs) || @@ -17639,25 +18362,10 @@ return CodeMirror; return str.length == 2 ? str : null; } - // Project the token type that will exists after the given char is - // typed, and use it to determine whether it would cause the start - // of a string token. - function enteringString(cm, pos, ch) { - var line = cm.getLine(pos.line); - var token = cm.getTokenAt(pos); - if (/\bstring2?\b/.test(token.type)) return false; - var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4); - stream.pos = stream.start = token.start; - for (;;) { - var type1 = cm.getMode().token(stream, token.state); - if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1); - stream.start = stream.pos; - } - } - function stringStartsAfter(cm, pos) { var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1)) - return /\bstring/.test(token.type) && token.start == pos.ch + return /\bstring/.test(token.type) && token.start == pos.ch && + (pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos))) } }); @@ -17709,12 +18417,17 @@ return CodeMirror; // Rough heuristic to try and detect lines that are part of multi-line string function probablyInsideString(cm, pos, line) { - return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"`]/.test(line) + return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"\`]/.test(line) + } + + function getMode(cm, pos) { + var mode = cm.getMode() + return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos) } CodeMirror.defineExtension("lineComment", function(from, to, options) { if (!options) options = noOptions; - var self = this, mode = self.getModeAt(from); + var self = this, mode = getMode(self, from); var firstLine = self.getLine(from.line); if (firstLine == null || probablyInsideString(self, from, firstLine)) return; @@ -17758,7 +18471,7 @@ return CodeMirror; CodeMirror.defineExtension("blockComment", function(from, to, options) { if (!options) options = noOptions; - var self = this, mode = self.getModeAt(from); + var self = this, mode = getMode(self, from); var startString = options.blockCommentStart || mode.blockCommentStart; var endString = options.blockCommentEnd || mode.blockCommentEnd; if (!startString || !endString) { @@ -17792,7 +18505,7 @@ return CodeMirror; CodeMirror.defineExtension("uncomment", function(from, to, options) { if (!options) options = noOptions; - var self = this, mode = self.getModeAt(from); + var self = this, mode = getMode(self, from); var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end); // Try finding line comments @@ -17830,13 +18543,11 @@ return CodeMirror; if (open == -1) return false var endLine = end == start ? startLine : self.getLine(end) var close = endLine.indexOf(endString, end == start ? open + startString.length : 0); - if (close == -1 && start != end) { - endLine = self.getLine(--end); - close = endLine.indexOf(endString); - } + var insideStart = Pos(start, open + 1), insideEnd = Pos(end, close + 1) if (close == -1 || - !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) || - !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1)))) + !/comment/.test(self.getTokenTypeAt(insideStart)) || + !/comment/.test(self.getTokenTypeAt(insideEnd)) || + self.getRange(insideStart, insideEnd, "\n").indexOf(endString) > -1) return false; // Avoid killing block comments completely outside the selection. @@ -17935,6 +18646,8 @@ return CodeMirror; widget = document.createElement("span"); widget.appendChild(text); widget.className = "CodeMirror-foldmarker"; + } else if (widget) { + widget = widget.cloneNode(true) } return widget; } @@ -18411,12 +19124,14 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { CodeMirror.registerHelper("fold", "xml", function(cm, start) { var iter = new Iter(cm, start.line, 0); for (;;) { - var openTag = toNextTag(iter), end; - if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return; + var openTag = toNextTag(iter) + if (!openTag || iter.line != start.line) return + var end = toTagEnd(iter) + if (!end) return if (!openTag[1] && end != "selfClose") { var startPos = Pos(iter.line, iter.ch); var endPos = findMatchingClose(iter, openTag[2]); - return endPos && {from: startPos, to: endPos.from}; + return endPos && cmp(endPos.from, startPos) > 0 ? {from: startPos, to: endPos.from} : null } } }); @@ -18437,10 +19152,10 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { } }; - CodeMirror.findEnclosingTag = function(cm, pos, range) { + CodeMirror.findEnclosingTag = function(cm, pos, range, tag) { var iter = new Iter(cm, pos.line, pos.ch, range); for (;;) { - var open = findMatchingOpen(iter); + var open = findMatchingOpen(iter, tag); if (!open) break; var forward = new Iter(cm, pos.line, pos.ch, range); var close = findMatchingClose(forward, open.tag); @@ -18578,11 +19293,6 @@ CodeMirror.registerGlobalHelper("fold", "comment", function(mode) { })(function(CodeMirror) { "use strict"; -function expressionAllowed(stream, state, backUp) { - return /^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(state.lastType) || - (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) -} - CodeMirror.defineMode("javascript", function(config, parserConfig) { var indentUnit = config.indentUnit; var statementIndent = parserConfig.statementIndent; @@ -18595,56 +19305,24 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { var keywords = function(){ function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d"); var operator = kw("operator"), atom = {type: "atom", style: "atom"}; - var jsKeywords = { + return { "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C, - "var": kw("var"), "const": kw("var"), "let": kw("var"), + "return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C, + "debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"), "function": kw("function"), "catch": kw("catch"), "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), "in": operator, "typeof": operator, "instanceof": operator, "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, "this": kw("this"), "class": kw("class"), "super": kw("atom"), "yield": C, "export": kw("export"), "import": kw("import"), "extends": C, - "await": C, "async": kw("async") + "await": C }; - - // Extend the 'normal' keywords with the TypeScript language extensions - if (isTS) { - var type = {type: "variable", style: "variable-3"}; - var tsKeywords = { - // object-like things - "interface": kw("class"), - "implements": C, - "namespace": C, - "module": kw("module"), - "enum": kw("module"), - "type": kw("type"), - - // scope modifiers - "public": kw("modifier"), - "private": kw("modifier"), - "protected": kw("modifier"), - "abstract": kw("modifier"), - - // operators - "as": operator, - - // types - "string": type, "number": type, "boolean": type, "any": type - }; - - for (var attr in tsKeywords) { - jsKeywords[attr] = tsKeywords[attr]; - } - } - - return jsKeywords; }(); - var isOperatorChar = /[+\-*&%=<>!?|~^]/; + var isOperatorChar = /[+\-*&%=<>!?|~^@]/; var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; function readRegexp(stream) { @@ -18679,17 +19357,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { return ret(ch); } else if (ch == "=" && stream.eat(">")) { return ret("=>", "operator"); - } else if (ch == "0" && stream.eat(/x/i)) { - stream.eatWhile(/[\da-f]/i); - return ret("number", "number"); - } else if (ch == "0" && stream.eat(/o/i)) { - stream.eatWhile(/[0-7]/i); - return ret("number", "number"); - } else if (ch == "0" && stream.eat(/b/i)) { - stream.eatWhile(/[01]/i); + } else if (ch == "0" && stream.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i)) { return ret("number", "number"); } else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + stream.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/); return ret("number", "number"); } else if (ch == "/") { if (stream.eat("*")) { @@ -18700,10 +19371,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { return ret("comment", "comment"); } else if (expressionAllowed(stream, state, 1)) { readRegexp(stream); - stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/); + stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/); return ret("regexp", "string-2"); } else { - stream.eatWhile(isOperatorChar); + stream.eat("="); return ret("operator", "operator", stream.current()); } } else if (ch == "`") { @@ -18713,14 +19384,27 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { stream.skipToEnd(); return ret("error", "error"); } else if (isOperatorChar.test(ch)) { - if (ch != ">" || !state.lexical || state.lexical.type != ">") - stream.eatWhile(isOperatorChar); + if (ch != ">" || !state.lexical || state.lexical.type != ">") { + if (stream.eat("=")) { + if (ch == "!" || ch == "=") stream.eat("=") + } else if (/[<>*+\-]/.test(ch)) { + stream.eat(ch) + if (ch == ">") stream.eat(ch) + } + } return ret("operator", "operator", stream.current()); } else if (wordRE.test(ch)) { stream.eatWhile(wordRE); - var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; - return (known && state.lastType != ".") ? ret(known.type, known.style, word) : - ret("variable", "variable", word); + var word = stream.current() + if (state.lastType != ".") { + if (keywords.propertyIsEnumerable(word)) { + var kw = keywords[word] + return ret(kw.type, kw.style, word) + } + if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false)) + return ret("async", "keyword", word) + } + return ret("variable", "variable", word) } } @@ -18856,35 +19540,68 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { pass.apply(null, arguments); return true; } + function inList(name, list) { + for (var v = list; v; v = v.next) if (v.name == name) return true + return false; + } function register(varname) { - function inList(list) { - for (var v = list; v; v = v.next) - if (v.name == varname) return true; - return false; - } var state = cx.state; cx.marked = "def"; if (state.context) { - if (inList(state.localVars)) return; - state.localVars = {name: varname, next: state.localVars}; + if (state.lexical.info == "var" && state.context && state.context.block) { + // FIXME function decls are also not block scoped + var newContext = registerVarScoped(varname, state.context) + if (newContext != null) { + state.context = newContext + return + } + } else if (!inList(varname, state.localVars)) { + state.localVars = new Var(varname, state.localVars) + return + } + } + // Fall through means this is global + if (parserConfig.globalVars && !inList(varname, state.globalVars)) + state.globalVars = new Var(varname, state.globalVars) + } + function registerVarScoped(varname, context) { + if (!context) { + return null + } else if (context.block) { + var inner = registerVarScoped(varname, context.prev) + if (!inner) return null + if (inner == context.prev) return context + return new Context(inner, context.vars, true) + } else if (inList(varname, context.vars)) { + return context } else { - if (inList(state.globalVars)) return; - if (parserConfig.globalVars) - state.globalVars = {name: varname, next: state.globalVars}; + return new Context(context.prev, new Var(varname, context.vars), false) } } + function isModifier(name) { + return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly" + } + // Combinators - var defaultVars = {name: "this", next: {name: "arguments"}}; + function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block } + function Var(name, next) { this.name = name; this.next = next } + + var defaultVars = new Var("this", new Var("arguments", null)) function pushcontext() { - cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; - cx.state.localVars = defaultVars; + cx.state.context = new Context(cx.state.context, cx.state.localVars, false) + cx.state.localVars = defaultVars + } + function pushblockcontext() { + cx.state.context = new Context(cx.state.context, cx.state.localVars, true) + cx.state.localVars = null } function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; + cx.state.localVars = cx.state.context.vars + cx.state.context = cx.state.context.prev } + popcontext.lex = true function pushlex(type, info) { var result = function() { var state = cx.state, indent = state.indented; @@ -18916,10 +19633,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { } function statement(type, value) { - if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); + if (type == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex); if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex); if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "{") return cont(pushlex("}"), block, poplex); + if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex); + if (type == "debugger") return cont(expect(";")); + if (type == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext); if (type == ";") return cont(); if (type == "if") { if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) @@ -18928,59 +19647,75 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { } if (type == "function") return cont(functiondef); if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); - if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), parenExpr, pushlex("}", "switch"), expect("{"), - block, poplex, poplex); + if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), className, poplex); } + if (type == "variable") { + if (isTS && value == "declare") { + cx.marked = "keyword" + return cont(statement) + } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) { + cx.marked = "keyword" + if (value == "enum") return cont(enumdef); + else if (value == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";")); + else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex) + } else if (isTS && value == "namespace") { + cx.marked = "keyword" + return cont(pushlex("form"), expression, block, poplex) + } else if (isTS && value == "abstract") { + cx.marked = "keyword" + return cont(statement) + } else { + return cont(pushlex("stat"), maybelabel); + } + } + if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext, + block, poplex, poplex, popcontext); if (type == "case") return cont(expression, expect(":")); if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), - statement, poplex, popcontext); - if (type == "class") return cont(pushlex("form"), className, poplex); + if (type == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext); if (type == "export") return cont(pushlex("stat"), afterExport, poplex); if (type == "import") return cont(pushlex("stat"), afterImport, poplex); - if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex) - if (type == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";")); if (type == "async") return cont(statement) + if (value == "@") return cont(expression, statement) return pass(pushlex("stat"), expression, expect(";"), poplex); } - function expression(type) { - return expressionInner(type, false); + function maybeCatchBinding(type) { + if (type == "(") return cont(funarg, expect(")")) } - function expressionNoComma(type) { - return expressionInner(type, true); + function expression(type, value) { + return expressionInner(type, value, false); + } + function expressionNoComma(type, value) { + return expressionInner(type, value, true); } function parenExpr(type) { if (type != "(") return pass() return cont(pushlex(")"), expression, expect(")"), poplex) } - function expressionInner(type, noComma) { + function expressionInner(type, value, noComma) { if (cx.state.fatArrowAt == cx.stream.start) { var body = noComma ? arrowBodyNoComma : arrowBody; - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext); + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext); else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); } var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); if (type == "function") return cont(functiondef, maybeop); - if (type == "class") return cont(pushlex("form"), classExpression, poplex); - if (type == "keyword c" || type == "async") return cont(noComma ? maybeexpressionNoComma : maybeexpression); + if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); } + if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression); if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); if (type == "{") return contCommasep(objprop, "}", null, maybeop); if (type == "quasi") return pass(quasi, maybeop); if (type == "new") return cont(maybeTarget(noComma)); + if (type == "import") return cont(expression); return cont(); } function maybeexpression(type) { if (type.match(/[;\}\)\],]/)) return pass(); return pass(expression); } - function maybeexpressionNoComma(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expressionNoComma); - } function maybeoperatorComma(type, value) { if (type == ",") return cont(expression); @@ -18991,7 +19726,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { var expr = noComma == false ? expression : expressionNoComma; if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); if (type == "operator") { - if (/\+\+|--/.test(value)) return cont(me); + if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me); + if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false)) + return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me); if (value == "?") return cont(expression, expect(":"), expr); return cont(expr); } @@ -19000,6 +19737,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); if (type == ".") return cont(property, me); if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); + if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) } + if (type == "regexp") { + cx.state.lastType = cx.marked = "operator" + cx.stream.backUp(cx.stream.pos - cx.stream.start - 1) + return cont(expr) + } } function quasi(type, value) { if (type != "quasi") return pass(); @@ -19024,6 +19767,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { function maybeTarget(noComma) { return function(type) { if (type == ".") return cont(noComma ? targetNoComma : target); + else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma) else return pass(noComma ? expressionNoComma : expression); }; } @@ -19047,18 +19791,25 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { } else if (type == "variable" || cx.style == "keyword") { cx.marked = "property"; if (value == "get" || value == "set") return cont(getterSetter); + var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params + if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false))) + cx.state.fatArrowAt = cx.stream.pos + m[0].length return cont(afterprop); } else if (type == "number" || type == "string") { cx.marked = jsonldMode ? "property" : (cx.style + " property"); return cont(afterprop); } else if (type == "jsonld-keyword") { return cont(afterprop); - } else if (type == "modifier") { + } else if (isTS && isModifier(value)) { + cx.marked = "keyword" return cont(objprop) } else if (type == "[") { - return cont(expression, expect("]"), afterprop); + return cont(expression, maybetype, expect("]"), afterprop); } else if (type == "spread") { - return cont(expression); + return cont(expressionNoComma, afterprop); + } else if (value == "*") { + cx.marked = "keyword"; + return cont(objprop); } else if (type == ":") { return pass(afterprop) } @@ -19072,9 +19823,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == ":") return cont(expressionNoComma); if (type == "(") return pass(functiondef); } - function commasep(what, end) { + function commasep(what, end, sep) { function proceed(type, value) { - if (type == ",") { + if (sep ? sep.indexOf(type) > -1 : type == ",") { var lex = cx.state.lexical; if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; return cont(function(type, value) { @@ -19105,37 +19856,74 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (value == "?") return cont(maybetype); } } - function typeexpr(type) { - if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);} + function mayberettype(type) { + if (isTS && type == ":") { + if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr) + else return cont(typeexpr) + } + } + function isKW(_, value) { + if (value == "is") { + cx.marked = "keyword" + return cont() + } + } + function typeexpr(type, value) { + if (value == "keyof" || value == "typeof") { + cx.marked = "keyword" + return cont(value == "keyof" ? typeexpr : expressionNoComma) + } + if (type == "variable" || value == "void") { + cx.marked = "type" + return cont(afterType) + } if (type == "string" || type == "number" || type == "atom") return cont(afterType); - if (type == "{") return cont(commasep(typeprop, "}")) + if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType) + if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType) if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType) + if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr) } function maybeReturnType(type) { if (type == "=>") return cont(typeexpr) } - function typeprop(type) { + function typeprop(type, value) { if (type == "variable" || cx.style == "keyword") { cx.marked = "property" return cont(typeprop) + } else if (value == "?") { + return cont(typeprop) } else if (type == ":") { return cont(typeexpr) + } else if (type == "[") { + return cont(expression, maybetype, expect("]"), typeprop) } } - function typearg(type) { - if (type == "variable") return cont(typearg) - else if (type == ":") return cont(typeexpr) + function typearg(type, value) { + if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg) + if (type == ":") return cont(typeexpr) + return pass(typeexpr) } function afterType(type, value) { if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) - if (value == "|" || type == ".") return cont(typeexpr) + if (value == "|" || type == "." || value == "&") return cont(typeexpr) if (type == "[") return cont(expect("]"), afterType) + if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) } + } + function maybeTypeArgs(_, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) } - function vardef() { + function typeparam() { + return pass(typeexpr, maybeTypeDefault) + } + function maybeTypeDefault(_, value) { + if (value == "=") return cont(typeexpr) + } + function vardef(_, value) { + if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)} return pass(pattern, maybetype, maybeAssign, vardefCont); } function pattern(type, value) { - if (type == "modifier") return cont(pattern) + if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) } if (type == "variable") { register(value); return cont(); } if (type == "spread") return cont(pattern); if (type == "[") return contCommasep(pattern, "]"); @@ -19160,7 +19948,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { function maybeelse(type, value) { if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); } - function forspec(type) { + function forspec(type, value) { + if (value == "await") return cont(forspec); if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex); } function forspec1(type) { @@ -19184,10 +19973,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { function functiondef(type, value) { if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext); + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext); + if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef) } - function funarg(type) { + function funarg(type, value) { + if (value == "@") cont(expression, funarg) if (type == "spread") return cont(funarg); + if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); } return pass(pattern, maybetype, maybeAssign); } function classExpression(type, value) { @@ -19199,30 +19991,39 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "variable") {register(value); return cont(classNameAfter);} } function classNameAfter(type, value) { - if (value == "extends" || value == "implements") return cont(isTS ? typeexpr : expression, classNameAfter); + if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter) + if (value == "extends" || value == "implements" || (isTS && type == ",")) { + if (value == "implements") cx.marked = "keyword"; + return cont(isTS ? typeexpr : expression, classNameAfter); + } if (type == "{") return cont(pushlex("}"), classBody, poplex); } function classBody(type, value) { + if (type == "async" || + (type == "variable" && + (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) && + cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) { + cx.marked = "keyword"; + return cont(classBody); + } if (type == "variable" || cx.style == "keyword") { - if ((value == "static" || value == "get" || value == "set" || - (isTS && (value == "public" || value == "private" || value == "protected" || value == "readonly" || value == "abstract"))) && - cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false)) { - cx.marked = "keyword"; - return cont(classBody); - } cx.marked = "property"; return cont(isTS ? classfield : functiondef, classBody); } + if (type == "[") + return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody) if (value == "*") { cx.marked = "keyword"; return cont(classBody); } if (type == ";") return cont(classBody); if (type == "}") return cont(); + if (value == "@") return cont(expression, classBody) } function classfield(type, value) { if (value == "?") return cont(classfield) if (type == ":") return cont(typeexpr, maybeAssign) + if (value == "=") return cont(expressionNoComma) return pass(functiondef) } function afterExport(type, value) { @@ -19237,6 +20038,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { } function afterImport(type) { if (type == "string") return cont(); + if (type == "(") return pass(expression); return pass(importSpec, maybeMoreImports, maybeFrom); } function importSpec(type, value) { @@ -19258,6 +20060,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "]") return cont(); return pass(commasep(expressionNoComma, "]")); } + function enumdef() { + return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex) + } + function enummember() { + return pass(pattern, maybeAssign); + } function isContinuedStatement(state, textAfter) { return state.lastType == "operator" || state.lastType == "," || @@ -19265,6 +20073,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { /[,.]/.test(textAfter.charAt(0)); } + function expressionAllowed(stream, state, backUp) { + return state.tokenize == tokenBase && + /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || + (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) + } + // Interface return { @@ -19275,7 +20089,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { cc: [], lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), localVars: parserConfig.localVars, - context: parserConfig.localVars && {vars: parserConfig.localVars}, + context: parserConfig.localVars && new Context(null, null, false), indented: basecolumn || 0 }; if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") @@ -19316,7 +20130,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { lexical = lexical.prev; var type = lexical.type, closing = firstChar == type; - if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0); + if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0); else if (type == "form" && firstChar == "{") return lexical.indented; else if (type == "form") return lexical.indented + indentUnit; else if (type == "stat") @@ -19330,6 +20144,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, blockCommentStart: jsonMode ? null : "/*", blockCommentEnd: jsonMode ? null : "*/", + blockCommentContinue: jsonMode ? null : " * ", lineComment: jsonMode ? null : "//", fold: "brace", closeBrackets: "()[]{}''\"\"``", @@ -19339,6 +20154,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { jsonMode: jsonMode, expressionAllowed: expressionAllowed, + skipExpression: function(state) { var top = state.cc[state.cc.length - 1] if (top == expression || top == expressionNoComma) state.cc.pop() @@ -19377,11 +20193,8 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript })(function(CodeMirror) { "use strict"; - var map = CodeMirror.keyMap.sublime = {fallthrough: "default"}; var cmds = CodeMirror.commands; var Pos = CodeMirror.Pos; - var mac = CodeMirror.keyMap["default"] == CodeMirror.keyMap.macDefault; - var ctrl = mac ? "Cmd-" : "Ctrl-"; // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that. function findPosSubword(doc, start, dir) { @@ -19415,16 +20228,10 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); } - var goSubwordCombo = mac ? "Ctrl-" : "Alt-"; + cmds.goSubwordLeft = function(cm) { moveSubword(cm, -1); }; + cmds.goSubwordRight = function(cm) { moveSubword(cm, 1); }; - cmds[map[goSubwordCombo + "Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); }; - cmds[map[goSubwordCombo + "Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); }; - - if (mac) map["Cmd-Left"] = "goLineStartSmart"; - - var scrollLineCombo = mac ? "Ctrl-Alt-" : "Ctrl-"; - - cmds[map[scrollLineCombo + "Up"] = "scrollLineUp"] = function(cm) { + cmds.scrollLineUp = function(cm) { var info = cm.getScrollInfo(); if (!cm.somethingSelected()) { var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local"); @@ -19433,7 +20240,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript } cm.scrollTo(null, info.top - cm.defaultTextHeight()); }; - cmds[map[scrollLineCombo + "Down"] = "scrollLineDown"] = function(cm) { + cmds.scrollLineDown = function(cm) { var info = cm.getScrollInfo(); if (!cm.somethingSelected()) { var visibleTopLine = cm.lineAtHeight(info.top, "local")+1; @@ -19443,7 +20250,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript cm.scrollTo(null, info.top + cm.defaultTextHeight()); }; - cmds[map["Shift-" + ctrl + "L"] = "splitSelectionByLine"] = function(cm) { + cmds.splitSelectionByLine = function(cm) { var ranges = cm.listSelections(), lineRanges = []; for (var i = 0; i < ranges.length; i++) { var from = ranges[i].from(), to = ranges[i].to(); @@ -19455,14 +20262,12 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript cm.setSelections(lineRanges, 0); }; - map["Shift-Tab"] = "indentLess"; - - cmds[map["Esc"] = "singleSelectionTop"] = function(cm) { + cmds.singleSelectionTop = function(cm) { var range = cm.listSelections()[0]; cm.setSelection(range.anchor, range.head, {scroll: false}); }; - cmds[map[ctrl + "L"] = "selectLine"] = function(cm) { + cmds.selectLine = function(cm) { var ranges = cm.listSelections(), extended = []; for (var i = 0; i < ranges.length; i++) { var range = ranges[i]; @@ -19472,8 +20277,6 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript cm.setSelections(extended); }; - map["Shift-Ctrl-K"] = "deleteLine"; - function insertLine(cm, above) { if (cm.isReadOnly()) return CodeMirror.Pass cm.operation(function() { @@ -19492,9 +20295,9 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript cm.execCommand("indentAuto"); } - cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { return insertLine(cm, false); }; + cmds.insertLineAfter = function(cm) { return insertLine(cm, false); }; - cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { return insertLine(cm, true); }; + cmds.insertLineBefore = function(cm) { return insertLine(cm, true); }; function wordAt(cm, pos) { var start = pos.ch, end = start, line = cm.getLine(pos.line); @@ -19503,7 +20306,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)}; } - cmds[map[ctrl + "D"] = "selectNextOccurrence"] = function(cm) { + cmds.selectNextOccurrence = function(cm) { var from = cm.getCursor("from"), to = cm.getCursor("to"); var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel; if (CodeMirror.cmpPos(from, to) == 0) { @@ -19515,18 +20318,46 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript var text = cm.getRange(from, to); var query = fullWord ? new RegExp("\\b" + text + "\\b") : text; var cur = cm.getSearchCursor(query, to); - if (cur.findNext()) { - cm.addSelection(cur.from(), cur.to()); - } else { + var found = cur.findNext(); + if (!found) { cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0)); - if (cur.findNext()) - cm.addSelection(cur.from(), cur.to()); + found = cur.findNext(); } + if (!found || isSelectedRange(cm.listSelections(), cur.from(), cur.to())) + return CodeMirror.Pass + cm.addSelection(cur.from(), cur.to()); } if (fullWord) cm.state.sublimeFindFullWord = cm.doc.sel; }; + function addCursorToSelection(cm, dir) { + var ranges = cm.listSelections(), newRanges = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + var newAnchor = cm.findPosV( + range.anchor, dir, "line", range.anchor.goalColumn); + var newHead = cm.findPosV( + range.head, dir, "line", range.head.goalColumn); + newAnchor.goalColumn = range.anchor.goalColumn != null ? + range.anchor.goalColumn : cm.cursorCoords(range.anchor, "div").left; + newHead.goalColumn = range.head.goalColumn != null ? + range.head.goalColumn : cm.cursorCoords(range.head, "div").left; + var newRange = {anchor: newAnchor, head: newHead}; + newRanges.push(range); + newRanges.push(newRange); + } + cm.setSelections(newRanges); + } + cmds.addCursorToPrevLine = function(cm) { addCursorToSelection(cm, -1); }; + cmds.addCursorToNextLine = function(cm) { addCursorToSelection(cm, 1); }; + + function isSelectedRange(ranges, from, to) { + for (var i = 0; i < ranges.length; i++) + if (ranges[i].from() == from && ranges[i].to() == to) return true + return false + } + var mirror = "(){}[]"; function selectBetweenBrackets(cm) { var ranges = cm.listSelections(), newRanges = [] @@ -19537,9 +20368,15 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript var closing = cm.scanForBracket(pos, 1); if (!closing) return false; if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) { - newRanges.push({anchor: Pos(opening.pos.line, opening.pos.ch + 1), - head: closing.pos}); - break; + var startPos = Pos(opening.pos.line, opening.pos.ch + 1); + if (CodeMirror.cmpPos(startPos, range.from()) == 0 && + CodeMirror.cmpPos(closing.pos, range.to()) == 0) { + opening = cm.scanForBracket(opening.pos, -1); + if (!opening) return false; + } else { + newRanges.push({anchor: startPos, head: closing.pos}); + break; + } } pos = Pos(closing.pos.line, closing.pos.ch + 1); } @@ -19548,14 +20385,14 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript return true; } - cmds[map["Shift-" + ctrl + "Space"] = "selectScope"] = function(cm) { + cmds.selectScope = function(cm) { selectBetweenBrackets(cm) || cm.execCommand("selectAll"); }; - cmds[map["Shift-" + ctrl + "M"] = "selectBetweenBrackets"] = function(cm) { + cmds.selectBetweenBrackets = function(cm) { if (!selectBetweenBrackets(cm)) return CodeMirror.Pass; }; - cmds[map[ctrl + "M"] = "goToBracket"] = function(cm) { + cmds.goToBracket = function(cm) { cm.extendSelectionsBy(function(range) { var next = cm.scanForBracket(range.head, 1); if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos; @@ -19564,9 +20401,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); }; - var swapLineCombo = mac ? "Cmd-Ctrl-" : "Shift-Ctrl-"; - - cmds[map[swapLineCombo + "Up"] = "swapLineUp"] = function(cm) { + cmds.swapLineUp = function(cm) { if (cm.isReadOnly()) return CodeMirror.Pass var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = []; for (var i = 0; i < ranges.length; i++) { @@ -19593,7 +20428,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); }; - cmds[map[swapLineCombo + "Down"] = "swapLineDown"] = function(cm) { + cmds.swapLineDown = function(cm) { if (cm.isReadOnly()) return CodeMirror.Pass var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1; for (var i = ranges.length - 1; i >= 0; i--) { @@ -19617,11 +20452,11 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); }; - cmds[map[ctrl + "/"] = "toggleCommentIndented"] = function(cm) { + cmds.toggleCommentIndented = function(cm) { cm.toggleComment({ indent: true }); } - cmds[map[ctrl + "J"] = "joinLines"] = function(cm) { + cmds.joinLines = function(cm) { var ranges = cm.listSelections(), joined = []; for (var i = 0; i < ranges.length; i++) { var range = ranges[i], from = range.from(); @@ -19649,7 +20484,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); }; - cmds[map["Shift-" + ctrl + "D"] = "duplicateLine"] = function(cm) { + cmds.duplicateLine = function(cm) { cm.operation(function() { var rangeCount = cm.listSelections().length; for (var i = 0; i < rangeCount; i++) { @@ -19663,7 +20498,6 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); }; - if (!mac) map[ctrl + "T"] = "transposeChars"; function sortLines(cm, caseSensitive) { if (cm.isReadOnly()) return CodeMirror.Pass @@ -19673,7 +20507,8 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript if (range.empty()) continue; var from = range.from().line, to = range.to().line; while (i < ranges.length - 1 && ranges[i + 1].from().line == to) - to = range[++i].to().line; + to = ranges[++i].to().line; + if (!ranges[i].to().ch) to--; toSort.push(from, to); } if (toSort.length) selected = true; @@ -19694,16 +20529,16 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript return a < b ? -1 : a == b ? 0 : 1; }); cm.replaceRange(lines, start, end); - if (selected) ranges.push({anchor: start, head: end}); + if (selected) ranges.push({anchor: start, head: Pos(to + 1, 0)}); } if (selected) cm.setSelections(ranges, 0); }); } - cmds[map["F9"] = "sortLines"] = function(cm) { sortLines(cm, true); }; - cmds[map[ctrl + "F9"] = "sortLinesInsensitive"] = function(cm) { sortLines(cm, false); }; + cmds.sortLines = function(cm) { sortLines(cm, true); }; + cmds.sortLinesInsensitive = function(cm) { sortLines(cm, false); }; - cmds[map["F2"] = "nextBookmark"] = function(cm) { + cmds.nextBookmark = function(cm) { var marks = cm.state.sublimeBookmarks; if (marks) while (marks.length) { var current = marks.shift(); @@ -19715,7 +20550,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript } }; - cmds[map["Shift-F2"] = "prevBookmark"] = function(cm) { + cmds.prevBookmark = function(cm) { var marks = cm.state.sublimeBookmarks; if (marks) while (marks.length) { marks.unshift(marks.pop()); @@ -19727,12 +20562,12 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript } }; - cmds[map[ctrl + "F2"] = "toggleBookmark"] = function(cm) { + cmds.toggleBookmark = function(cm) { var ranges = cm.listSelections(); var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []); for (var i = 0; i < ranges.length; i++) { var from = ranges[i].from(), to = ranges[i].to(); - var found = cm.findMarks(from, to); + var found = ranges[i].empty() ? cm.findMarksAt(from) : cm.findMarks(from, to); for (var j = 0; j < found.length; j++) { if (found[j].sublimeBookmark) { found[j].clear(); @@ -19747,13 +20582,13 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript } }; - cmds[map["Shift-" + ctrl + "F2"] = "clearBookmarks"] = function(cm) { + cmds.clearBookmarks = function(cm) { var marks = cm.state.sublimeBookmarks; if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear(); marks.length = 0; }; - cmds[map["Alt-F2"] = "selectBookmarks"] = function(cm) { + cmds.selectBookmarks = function(cm) { var marks = cm.state.sublimeBookmarks, ranges = []; if (marks) for (var i = 0; i < marks.length; i++) { var found = marks[i].find(); @@ -19766,10 +20601,6 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript cm.setSelections(ranges, 0); }; - map["Alt-Q"] = "wrapLines"; - - var cK = ctrl + "K "; - function modifyWordOrSelection(cm, mod) { cm.operation(function() { var ranges = cm.listSelections(), indices = [], replacements = []; @@ -19789,9 +20620,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); } - map[cK + ctrl + "Backspace"] = "delLineLeft"; - - cmds[map["Backspace"] = "smartBackspace"] = function(cm) { + cmds.smartBackspace = function(cm) { if (cm.somethingSelected()) return CodeMirror.Pass; cm.operation(function() { @@ -19819,7 +20648,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); }; - cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) { + cmds.delLineRight = function(cm) { cm.operation(function() { var ranges = cm.listSelections(); for (var i = ranges.length - 1; i >= 0; i--) @@ -19828,22 +20657,22 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript }); }; - cmds[map[cK + ctrl + "U"] = "upcaseAtCursor"] = function(cm) { + cmds.upcaseAtCursor = function(cm) { modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); }); }; - cmds[map[cK + ctrl + "L"] = "downcaseAtCursor"] = function(cm) { + cmds.downcaseAtCursor = function(cm) { modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); }); }; - cmds[map[cK + ctrl + "Space"] = "setSublimeMark"] = function(cm) { + cmds.setSublimeMark = function(cm) { if (cm.state.sublimeMark) cm.state.sublimeMark.clear(); cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); }; - cmds[map[cK + ctrl + "A"] = "selectToSublimeMark"] = function(cm) { + cmds.selectToSublimeMark = function(cm) { var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); if (found) cm.setSelection(cm.getCursor(), found); }; - cmds[map[cK + ctrl + "W"] = "deleteToSublimeMark"] = function(cm) { + cmds.deleteToSublimeMark = function(cm) { var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); if (found) { var from = cm.getCursor(), to = found; @@ -19852,7 +20681,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript cm.replaceRange("", from, to); } }; - cmds[map[cK + ctrl + "X"] = "swapWithSublimeMark"] = function(cm) { + cmds.swapWithSublimeMark = function(cm) { var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); if (found) { cm.state.sublimeMark.clear(); @@ -19860,39 +20689,16 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript cm.setCursor(found); } }; - cmds[map[cK + ctrl + "Y"] = "sublimeYank"] = function(cm) { + cmds.sublimeYank = function(cm) { if (cm.state.sublimeKilled != null) cm.replaceSelection(cm.state.sublimeKilled, null, "paste"); }; - map[cK + ctrl + "G"] = "clearBookmarks"; - cmds[map[cK + ctrl + "C"] = "showInCenter"] = function(cm) { + cmds.showInCenter = function(cm) { var pos = cm.cursorCoords(null, "local"); cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2); }; - var selectLinesCombo = mac ? "Ctrl-Shift-" : "Ctrl-Alt-"; - cmds[map[selectLinesCombo + "Up"] = "selectLinesUpward"] = function(cm) { - cm.operation(function() { - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.head.line > cm.firstLine()) - cm.addSelection(Pos(range.head.line - 1, range.head.ch)); - } - }); - }; - cmds[map[selectLinesCombo + "Down"] = "selectLinesDownward"] = function(cm) { - cm.operation(function() { - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.head.line < cm.lastLine()) - cm.addSelection(Pos(range.head.line + 1, range.head.ch)); - } - }); - }; - function getTarget(cm) { var from = cm.getCursor("from"), to = cm.getCursor("to"); if (CodeMirror.cmpPos(from, to) == 0) { @@ -19921,9 +20727,9 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript cm.setSelection(target.from, target.to); } }; - cmds[map[ctrl + "F3"] = "findUnder"] = function(cm) { findAndGoTo(cm, true); }; - cmds[map["Shift-" + ctrl + "F3"] = "findUnderPrevious"] = function(cm) { findAndGoTo(cm,false); }; - cmds[map["Alt-F3"] = "findAllUnder"] = function(cm) { + cmds.findUnder = function(cm) { findAndGoTo(cm, true); }; + cmds.findUnderPrevious = function(cm) { findAndGoTo(cm,false); }; + cmds.findAllUnder = function(cm) { var target = getTarget(cm); if (!target) return; var cur = cm.getSearchCursor(target.query); @@ -19937,17 +20743,130 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript cm.setSelections(matches, primaryIndex); }; - map["Shift-" + ctrl + "["] = "fold"; - map["Shift-" + ctrl + "]"] = "unfold"; - map[cK + ctrl + "0"] = map[cK + ctrl + "J"] = "unfoldAll"; - map[ctrl + "I"] = "findIncremental"; - map["Shift-" + ctrl + "I"] = "findIncrementalReverse"; - map[ctrl + "H"] = "replace"; - map["F3"] = "findNext"; - map["Shift-F3"] = "findPrev"; + var keyMap = CodeMirror.keyMap; + keyMap.macSublime = { + "Cmd-Left": "goLineStartSmart", + "Shift-Tab": "indentLess", + "Shift-Ctrl-K": "deleteLine", + "Alt-Q": "wrapLines", + "Ctrl-Left": "goSubwordLeft", + "Ctrl-Right": "goSubwordRight", + "Ctrl-Alt-Up": "scrollLineUp", + "Ctrl-Alt-Down": "scrollLineDown", + "Cmd-L": "selectLine", + "Shift-Cmd-L": "splitSelectionByLine", + "Esc": "singleSelectionTop", + "Cmd-Enter": "insertLineAfter", + "Shift-Cmd-Enter": "insertLineBefore", + "Cmd-D": "selectNextOccurrence", + "Shift-Cmd-Space": "selectScope", + "Shift-Cmd-M": "selectBetweenBrackets", + "Cmd-M": "goToBracket", + "Cmd-Ctrl-Up": "swapLineUp", + "Cmd-Ctrl-Down": "swapLineDown", + "Cmd-/": "toggleCommentIndented", + "Cmd-J": "joinLines", + "Shift-Cmd-D": "duplicateLine", + "F9": "sortLines", + "Cmd-F9": "sortLinesInsensitive", + "F2": "nextBookmark", + "Shift-F2": "prevBookmark", + "Cmd-F2": "toggleBookmark", + "Shift-Cmd-F2": "clearBookmarks", + "Alt-F2": "selectBookmarks", + "Backspace": "smartBackspace", + "Cmd-K Cmd-K": "delLineRight", + "Cmd-K Cmd-U": "upcaseAtCursor", + "Cmd-K Cmd-L": "downcaseAtCursor", + "Cmd-K Cmd-Space": "setSublimeMark", + "Cmd-K Cmd-A": "selectToSublimeMark", + "Cmd-K Cmd-W": "deleteToSublimeMark", + "Cmd-K Cmd-X": "swapWithSublimeMark", + "Cmd-K Cmd-Y": "sublimeYank", + "Cmd-K Cmd-C": "showInCenter", + "Cmd-K Cmd-G": "clearBookmarks", + "Cmd-K Cmd-Backspace": "delLineLeft", + "Cmd-K Cmd-0": "unfoldAll", + "Cmd-K Cmd-J": "unfoldAll", + "Ctrl-Shift-Up": "addCursorToPrevLine", + "Ctrl-Shift-Down": "addCursorToNextLine", + "Cmd-F3": "findUnder", + "Shift-Cmd-F3": "findUnderPrevious", + "Alt-F3": "findAllUnder", + "Shift-Cmd-[": "fold", + "Shift-Cmd-]": "unfold", + "Cmd-I": "findIncremental", + "Shift-Cmd-I": "findIncrementalReverse", + "Cmd-H": "replace", + "F3": "findNext", + "Shift-F3": "findPrev", + "fallthrough": "macDefault" + }; + CodeMirror.normalizeKeyMap(keyMap.macSublime); + + keyMap.pcSublime = { + "Shift-Tab": "indentLess", + "Shift-Ctrl-K": "deleteLine", + "Alt-Q": "wrapLines", + "Ctrl-T": "transposeChars", + "Alt-Left": "goSubwordLeft", + "Alt-Right": "goSubwordRight", + "Ctrl-Up": "scrollLineUp", + "Ctrl-Down": "scrollLineDown", + "Ctrl-L": "selectLine", + "Shift-Ctrl-L": "splitSelectionByLine", + "Esc": "singleSelectionTop", + "Ctrl-Enter": "insertLineAfter", + "Shift-Ctrl-Enter": "insertLineBefore", + "Ctrl-D": "selectNextOccurrence", + "Shift-Ctrl-Space": "selectScope", + "Shift-Ctrl-M": "selectBetweenBrackets", + "Ctrl-M": "goToBracket", + "Shift-Ctrl-Up": "swapLineUp", + "Shift-Ctrl-Down": "swapLineDown", + "Ctrl-/": "toggleCommentIndented", + "Ctrl-J": "joinLines", + "Shift-Ctrl-D": "duplicateLine", + "F9": "sortLines", + "Ctrl-F9": "sortLinesInsensitive", + "F2": "nextBookmark", + "Shift-F2": "prevBookmark", + "Ctrl-F2": "toggleBookmark", + "Shift-Ctrl-F2": "clearBookmarks", + "Alt-F2": "selectBookmarks", + "Backspace": "smartBackspace", + "Ctrl-K Ctrl-K": "delLineRight", + "Ctrl-K Ctrl-U": "upcaseAtCursor", + "Ctrl-K Ctrl-L": "downcaseAtCursor", + "Ctrl-K Ctrl-Space": "setSublimeMark", + "Ctrl-K Ctrl-A": "selectToSublimeMark", + "Ctrl-K Ctrl-W": "deleteToSublimeMark", + "Ctrl-K Ctrl-X": "swapWithSublimeMark", + "Ctrl-K Ctrl-Y": "sublimeYank", + "Ctrl-K Ctrl-C": "showInCenter", + "Ctrl-K Ctrl-G": "clearBookmarks", + "Ctrl-K Ctrl-Backspace": "delLineLeft", + "Ctrl-K Ctrl-0": "unfoldAll", + "Ctrl-K Ctrl-J": "unfoldAll", + "Ctrl-Alt-Up": "addCursorToPrevLine", + "Ctrl-Alt-Down": "addCursorToNextLine", + "Ctrl-F3": "findUnder", + "Shift-Ctrl-F3": "findUnderPrevious", + "Alt-F3": "findAllUnder", + "Shift-Ctrl-[": "fold", + "Shift-Ctrl-]": "unfold", + "Ctrl-I": "findIncremental", + "Shift-Ctrl-I": "findIncrementalReverse", + "Ctrl-H": "replace", + "F3": "findNext", + "Shift-F3": "findPrev", + "fallthrough": "pcDefault" + }; + CodeMirror.normalizeKeyMap(keyMap.pcSublime); - CodeMirror.normalizeKeyMap(map); + var mac = keyMap.default == keyMap.macDefault; + keyMap.sublime = mac ? keyMap.macSublime : keyMap.pcSublime; }); //! moment.js diff --git a/dist/js/vendor.min.js b/dist/js/vendor.min.js index 5004ae392..816342d34 100644 --- a/dist/js/vendor.min.js +++ b/dist/js/vendor.min.js @@ -1,40 +1,40 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Appbase",[],e):"object"==typeof exports?exports.Appbase=e():t.Appbase=e()}(this,function(){var t=Math.PI,e=Math.sqrt,n=Math.LN2,i=Math.abs,r=Math.log,o=Math.exp,s=Math.expm1,a=Math.pow,l=String.fromCharCode,u=Math.max,c=Math.floor,h=Math.ceil,f=Math.min;return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=144)}([function(t,e,n){var i=n(2),r=n(22),o=n(12),s=n(13),a=n(19),l=function(t,e,n){var u,c,h,f,d=t&l.F,p=t&l.G,g=t&l.S,m=t&l.P,v=t&l.B,y=p?i:g?i[e]||(i[e]={}):(i[e]||{}).prototype,b=p?r:r[e]||(r[e]={}),w=b.prototype||(b.prototype={});for(u in p&&(n=e),n)c=!d&&y&&void 0!==y[u],h=(c?y:n)[u],f=v&&c?a(h,i):m&&"function"==typeof h?a(Function.call,h):h,y&&s(y,u,h,t&l.U),b[u]!=h&&o(b,u,f),m&&w[u]!=h&&(w[u]=h)};i.core=r,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e,n){var i=n(4);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var i=n(56)("wks"),r=n(35),o=n(2).Symbol,s="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=s&&o[t]||(s?o:r)("Symbol."+t))}).store=i},function(t,e,n){t.exports=!n(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(1),r=n(110),o=n(23),s=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return s(t,e,n)}catch(n){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(25);t.exports=function(t){return 0"+r+""};t.exports=function(t,e){var n={};n[t]=e(a),i(i.P+i.F*r(function(){var e=""[t]('"');return e!==e.toLowerCase()||3>8-o%1*8)){if(255<(t=n.charCodeAt(o+=.75)))throw new Error('"btoa" failed: The string to be encoded contains characters outside of the Latin1 range.');r=r<<8|t}return i},e.isAppbase=function(t){return n(t.url,"scalr.api.appbase.io")},e.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=0|16*Math.random();return("x"==t?e:8|3&e).toString(16)})}},function(t,e,n){var i=n(52),r=n(24);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(53),r=n(34),o=n(16),s=n(23),a=n(11),l=n(110),u=Object.getOwnPropertyDescriptor;e.f=n(6)?u:function(t,e){if(t=o(t),e=s(e,!0),l)try{return u(t,e)}catch(t){}return a(t,e)?r(!i.f.call(t,e),t[e]):void 0}},function(t,e,n){var i=n(11),r=n(9),o=n(78)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var i=n(10);t.exports=function(t,e,n){return i(t),void 0===e?t:1===n?function(n){return t.call(e,n)}:2===n?function(n,i){return t.call(e,n,i)}:3===n?function(n,i,r){return t.call(e,n,i,r)}:function(){return t.apply(e,arguments)}}},function(t){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,e,n){"use strict";var i=n(3);t.exports=function(t,e){return!!t&&i(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t){var e=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=e)},function(t,e,n){var i=n(4);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t){t.exports=function(t){return isNaN(t=+t)?0:(0y;y++)if((5==t||u||y in g)&&(f=g[y],d=m(f,y,p),t))if(n)b[y]=d;else if(d)switch(t){case 3:return!0;case 5:return f;case 6:return y;case 2:b.push(f)}else if(l)return!1;return u?-1:3==t||l?l:b}}},function(t,e,n){"use strict";if(n(6)){var i=n(36),r=n(2),o=n(3),s=n(0),a=n(66),l=n(101),u=n(19),h=n(42),f=n(34),d=n(12),p=n(44),g=n(25),m=n(8),v=n(136),y=n(38),b=n(23),w=n(11),_=n(54),x=n(4),S=n(9),k=n(92),C=n(39),T=n(18),E=n(40).f,P=n(94),O=n(35),M=n(5),A=n(27),D=n(57),L=n(64),I=n(97),R=n(48),N=n(61),z=n(41),j=n(96),$=n(126),H=n(7),F=n(17),W=H.f,B=F.f,U=r.RangeError,q=r.TypeError,Y=r.Uint8Array,V=Array.prototype,G=l.ArrayBuffer,K=l.DataView,X=A(0),J=A(2),Z=A(3),Q=A(4),tt=A(5),et=A(6),nt=D(!0),it=D(!1),rt=I.values,ot=I.keys,st=I.entries,at=V.lastIndexOf,lt=V.reduce,ut=V.reduceRight,ct=V.join,ht=V.sort,ft=V.slice,dt=V.toString,pt=V.toLocaleString,gt=M("iterator"),mt=M("toStringTag"),vt=O("typed_constructor"),yt=O("def_constructor"),bt=a.CONSTR,wt=a.TYPED,_t=a.VIEW,xt=A(1,function(t,e){return Et(L(t,t[yt]),e)}),St=o(function(){return 1===new Y(new Uint16Array([1]).buffer)[0]}),kt=!!Y&&!!Y.prototype.set&&o(function(){new Y(1).set({})}),Ct=function(t,e){var n=g(t);if(0>n||n%e)throw U("Wrong offset!");return n},Tt=function(t){if(x(t)&&wt in t)return t;throw q(t+" is not a typed array!")},Et=function(t,e){if(!(x(t)&&vt in t))throw q("It is not a typed array constructor!");return new t(e)},Pt=function(t,e){return Ot(L(t,t[yt]),e)},Ot=function(t,e){for(var n=0,i=e.length,r=Et(t,i);i>n;)r[n]=e[n++];return r},Mt=function(t,e,n){W(t,e,{get:function(){return this._d[n]}})},At=function(t){var e,n,i,r,o,s,a=S(t),l=arguments.length,c=1e;e++)r[e]=h?c(a[e],e):a[e];return r},Dt=function(){for(var t=0,e=arguments.length,n=Et(this,e);e>t;)n[t]=arguments[t++];return n},Lt=!!Y&&o(function(){pt.call(new Y(1))}),It=function(){return pt.apply(Lt?ft.call(Tt(this)):Tt(this),arguments)},Rt={copyWithin:function(t,e){return $.call(Tt(this),t,e,2n)throw U("Wrong length!");for(;o(i=Math.round(i))?0:255(s=g-f))throw U("Wrong length!")}else if((s=m(r)*e)+f>g)throw U("Wrong length!");a=s/e}else a=v(n),s=a*e,o=new G(s);for(d(t,"_d",{b:o,o:f,l:s,e:a,v:new K(o)});ct?u(t+e,0):f(t,e)}},function(t,e,n){var i=n(1),r=n(113),o=n(79),s=n(78)("IE_PROTO"),a=function(){},l=function(){var t,e=n(76)("iframe"),i=o.length;for(e.style.display="none",n(80).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(""),t.close(),l=t.F;i--;)delete l.prototype[o[i]];return l()};t.exports=Object.create||function(t,e){var n;return null===t?n=l():(a.prototype=i(t),n=new a,a.prototype=null,n[s]=t),void 0===e?n:r(n,e)}},function(t,e,n){var i=n(112),r=n(79).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},function(t,e,n){"use strict";var i=n(2),r=n(7),o=n(6),s=n(5)("species");t.exports=function(t){var e=i[t];o&&e&&!e[s]&&r.f(e,s,{configurable:!0,get:function(){return this}})}},function(t){t.exports=function(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var i=n(19),r=n(124),o=n(92),s=n(1),a=n(8),l=n(94),u={},c={},e=t.exports=function(t,e,n,h,f){var d,p,g,m,v=f?function(){return t}:l(t),y=i(n,h,e?2:1),b=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(d=a(t.length);d>b;b++)if((m=e?y(s(p=t[b])[0],p[1]):y(t[b]))===u||m===c)return m}else for(g=v.call(t);!(p=g.next()).done;)if((m=r(g,y,p.value,e))===u||m===c)return m};e.BREAK=u,e.RETURN=c},function(t,e,n){var i=n(13);t.exports=function(t,e,n){for(var r in e)i(t,r,e[r],n);return t}},function(t){t.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){var i=n(7).f,r=n(11),o=n(5)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i=n(0),r=n(24),o=n(3),s=n(82),a="["+s+"]",l="​…",u=RegExp("^"+a+a+"*"),c=RegExp(a+a+"*$"),h=function(t,e,n){var r={},a=o(function(){return!!s[t]()||l[t]()!=l}),u=r[t]=a?e(f):s[t];n&&(r[n]=u),i(i.P+i.F*a,"String",r)},f=h.trim=function(t,e){return t=r(t)+"",1&e&&(t=t.replace(u,"")),2&e&&(t=t.replace(c,"")),t};t.exports=h},function(t){t.exports={}},function(t,e,n){var i=n(4);t.exports=function(t,e){if(!i(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t){function e(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(u===setTimeout)return setTimeout(t,0);if((u===e||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function r(t){if(c===clearTimeout)return clearTimeout(t);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(t);try{return c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}function o(){p&&f&&(p=!1,f.length?d=f.concat(d):g=-1,d.length&&s())}function s(){if(!p){var t=i(o);p=!0;for(var e=d.length;e;){for(f=d,d=[];++gc;)if((a=l[c++])!=a)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var i=n(20);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){var i=n(4),r=n(20),o=n(5)("match");t.exports=function(t){var e;return i(t)&&(void 0===(e=t[o])?"RegExp"==r(t):!!e)}},function(t,e,n){var i=n(5)("iterator"),r=!1;try{var o=[7][i]();o["return"]=function(){r=!0},Array.from(o,function(){throw 2})}catch(n){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var o=[7],s=o[i]();s.next=function(){return{done:n=!0}},o[i]=function(){return s},t(o)}catch(t){}return n}},function(t,e,n){"use strict";var i=n(1);t.exports=function(){var t=i(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";var i=n(12),r=n(13),o=n(3),s=n(24),a=n(5);t.exports=function(t,e,n){var l=a(t),u=n(s,l,""[t]),c=u[0],h=u[1];o(function(){var e={};return e[l]=function(){return 7},7!=""[t](e)})&&(r(String.prototype,t,c),i(RegExp.prototype,l,2==e?function(t,e){return h.call(t,this,e)}:function(t){return h.call(t,this)}))}},function(t,e,n){var i=n(1),r=n(10),o=n(5)("species");t.exports=function(t,e){var n,s=i(t).constructor;return void 0===s||void 0==(n=i(s)[o])?e:r(n)}},function(t,e,n){"use strict";var i=n(2),r=n(0),o=n(13),s=n(44),a=n(31),l=n(43),u=n(42),c=n(4),h=n(3),f=n(61),d=n(46),p=n(83);t.exports=function(t,e,n,g,m,v){var y=i[t],b=y,w=m?"set":"add",_=b&&b.prototype,x={},S=function(t){var e=_[t];o(_,t,"delete"==t?function(t){return(!v||c(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return(!v||c(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return v&&!c(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(v||_.forEach&&!h(function(){(new b).entries().next()}))){var k=new b,C=k[w](v?{}:-0,1)!=k,T=h(function(){k.has(1)}),E=f(function(t){new b(t)}),P=!v&&h(function(){for(var t=new b,e=5;e--;)t[w](e,e);return!t.has(-0)});E||(b=e(function(e,n){u(e,b,t);var i=p(new y,e,b);return void 0!=n&&l(n,m,i[w],i),i}),b.prototype=_,_.constructor=b),(T||P)&&(S("delete"),S("has"),m&&S("get")),(P||C)&&S(w),v&&_.clear&&delete _.clear}else b=g.getConstructor(e,t,m,w),s(b.prototype,n),a.NEED=!0;return d(b,t),x[t]=b,r(r.G+r.W+r.F*(b!=y),x),v||g.setStrong(b,t,m),b}},function(t,e,n){for(var i,r=n(2),o=n(12),s=n(35),a=s("typed_array"),l=s("view"),u=r.ArrayBuffer&&r.DataView,c=u,h=0,f=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"];9>h;)(i=r[f[h++]])?(o(i.prototype,a,!0),o(i.prototype,l,!0)):c=!1;t.exports={ABV:u,CONSTR:c,TYPED:a,VIEW:l}},function(t,e,n){"use strict";t.exports=n(36)||!n(3)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete n(2)[t]})},function(t,e,n){"use strict";var i=n(0);t.exports=function(t){i(i.S,t,{of:function(){for(var t=arguments.length,e=Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,n){"use strict";var i=n(0),r=n(10),o=n(19),s=n(43);t.exports=function(t){i(i.S,t,{from:function(t){var e,n,i,a,l=arguments[1];return r(this),e=void 0!==l,e&&r(l),void 0==t?new this:(n=[],e?(i=0,a=o(l,arguments[2],2),s(t,!1,function(t){n.push(a(t,i++))})):s(t,!1,n.push,n),new this(n))}})}},function(t,e,n){function i(){r.call(this)}t.exports=i;var r=n(71).EventEmitter;n(45)(i,r),i.Readable=n(72),i.Writable=n(157),i.Duplex=n(158),i.Transform=n(159),i.PassThrough=n(160),i.Stream=i,i.prototype.pipe=function(t,e){function n(e){t.writable&&!1===t.write(e)&&u.pause&&u.pause()}function i(){u.readable&&u.resume&&u.resume()}function o(){c||(c=!0,t.end())}function s(){c||(c=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(l(),0===r.listenerCount(this,"error"))throw t}function l(){u.removeListener("data",n),t.removeListener("drain",i),u.removeListener("end",o),u.removeListener("close",s),u.removeListener("error",a),t.removeListener("error",a),u.removeListener("end",l),u.removeListener("close",l),t.removeListener("close",l)}var u=this;u.on("data",n),t.on("drain",i),t._isStdio||e&&!1===e.end||(u.on("end",o),u.on("close",s));var c=!1;return u.on("error",a),t.on("error",a),u.on("end",l),u.on("close",l),t.on("close",l),t.emit("pipe",u),t}},function(t){function e(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"number"==typeof t}function r(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=e,e.EventEmitter=e,e.prototype._events=void 0,e.prototype._maxListeners=void 0,e.defaultMaxListeners=10,e.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},e.prototype.emit=function(t){var e,i,s,a,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(i=this._events[t],o(i))return!1;if(n(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),i.apply(this,a)}else if(r(i))for(a=Array.prototype.slice.call(arguments,1),u=i.slice(),s=u.length,l=0;ls&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(t,e){function i(){this.removeListener(t,i),r||(r=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var r=!1;return i.listener=e,this.on(t,i),this},e.prototype.removeListener=function(t,e){var i,o,s,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(i=this._events[t],s=i.length,o=-1,i===e||n(i.listener)&&i.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(i)){for(a=s;0o)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},e.prototype.removeAllListeners=function(t){var e,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[t],n(i))this.removeListener(t,i);else if(i)for(;i.length;)this.removeListener(t,i[i.length-1]);return delete this._events[t],this},e.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},e.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},e.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){e=t.exports=n(103),e.Stream=e,e.Readable=e,e.Writable=n(75),e.Duplex=n(33),e.Transform=n(108),e.PassThrough=n(156)},function(t,e,n){function i(t,e){for(var n in t)e[n]=t[n]}function r(t,e,n){return s(t,e,n)}var o=n(74),s=o.Buffer;s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=o:(i(o,e),e.Buffer=r),i(s,r),r.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return s(t,e,n)},r.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=s(t);return void 0===e?i.fill(0):"string"==typeof n?i.fill(e,n):i.fill(e),i},r.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s(t)},r.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o.SlowBuffer(t)}},function(t,e,n){"use strict";(function(t){function i(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(t,e){if(i()t)throw new RangeError('"size" argument must not be negative')}function h(t,e,n,i){return u(e),0>=e?r(t,e):void 0===n?r(t,e):"string"==typeof i?r(t,e).fill(n,i):r(t,e).fill(n)}function d(t,e){if(u(e),t=r(t,0>e?0:0|y(e)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;ne.length?0:0|y(e.length);t=r(t,n);for(var i=0;in||e.byteLength=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function b(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return X(t).length;default:if(i)return V(t).length;e=(""+e).toLowerCase(),i=!0}}function w(t,e,n){var i=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return L(this,e,n);case"latin1":case"binary":return I(this,e,n);case"base64":return M(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function _(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function x(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):2147483647n&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),0>n&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(0>n){if(!r)return-1;n=0}if("string"==typeof e&&(e=o.from(e,i)),o.isBuffer(e))return 0===e.length?-1:S(t,e,n,i,r);if("number"==typeof e)return e&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):S(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function S(t,e,n,i,r){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=(i+"").toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(2>t.length||2>e.length)return-1;s=2,a/=2,l/=2,n/=2}var u;if(r){var c=-1;for(u=n;ua&&(n=a-l),u=n;0<=u;u--){for(var h=!0,f=0;fr&&(i=r):i=r;var o=e.length;if(0!=o%2)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s,a=0;ao&&(s=o):2==a?128==(192&(l=t[r+1]))&&127<(h=(31&o)<<6|63&l)&&(s=h):3==a?(l=t[r+1],u=t[r+2],128==(192&l)&&128==(192&u)&&2047<(h=(15&o)<<12|(63&l)<<6|63&u)&&(55296>h||57343h&&(s=h))}null===s?(s=65533,a=1):65535>>10),s=56320|1023&s),i.push(s),r+=a}return D(i)}function D(t){var e=t.length;if(e<=nt)return l.apply(String,t);for(var n="",i=0;ie)&&(e=0),(!n||0>n||n>i)&&(n=i);for(var r="",o=e;ot)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,i,r,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function $(t,e,n,i){0>e&&(e=65535+e+1);for(var r=0,o=f(t.length-n,2);r>>8*(i?r:1-r)}function H(t,e,n,i){0>e&&(e=4294967295+e+1);for(var r=0,o=f(t.length-n,4);r>>8*(i?r:3-r)}function F(t,e,n,i){if(n+i>t.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function W(t,e,n,i,r){return r||F(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),tt.write(t,e,n,i,23,4),n+4}function B(t,e,n,i,r){return r||F(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),tt.write(t,e,n,i,52,8),n+8}function U(t){if(t=q(t).replace(it,""),2>t.length)return"";for(;0!=t.length%4;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Y(t){return 16>t?"0"+t.toString(16):t.toString(16)}function V(t,e){e=e||1/0;for(var n,i=t.length,r=null,o=[],s=0;sn){if(!r){if(56319n){-1<(e-=3)&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&-1<(e-=3)&&o.push(239,191,189);if(r=null,128>n){if(0>(e-=1))break;o.push(n)}else if(2048>n){if(0>(e-=2))break;o.push(192|n>>6,128|63&n)}else if(65536>n){if(0>(e-=3))break;o.push(224|n>>12,128|63&n>>6,128|63&n)}else{if(!(1114112>n))throw new Error("Invalid code point");if(0>(e-=4))break;o.push(240|n>>18,128|63&n>>12,128|63&n>>6,128|63&n)}}return o}function G(t){for(var e=[],n=0;n(e-=2));++s)n=t.charCodeAt(s),i=n>>8,r=n%256,o.push(r),o.push(i);return o}function X(t){return Q.toByteArray(U(t))}function J(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function Z(t){return t!==t}var Q=n(149),tt=n(150),et=n(104);e.Buffer=o,e.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},e.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT?function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}():t.TYPED_ARRAY_SUPPORT,e.kMaxLength=i(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,n){return s(null,t,e,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,n){return h(null,t,e,n)},o.allocUnsafe=function(t){return d(null,t)},o.allocUnsafeSlow=function(t){return d(null,t)},o.isBuffer=function(t){return null!=t&&t._isBuffer},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,r=0,s=f(n,i);rn&&(t+=" ... ")),""},o.prototype.compare=function(t,e,n,i,r){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),0>e||n>t.length||0>i||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,r>>>=0,this===t)return 0;for(var s=r-i,a=n-e,l=f(s,a),u=this.slice(i,r),c=t.slice(e,n),h=0;hr)&&(n=r),0n||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return k(this,t,e,n);case"utf8":case"utf-8":return C(this,t,e,n);case"ascii":return T(this,t,e,n);case"latin1":case"binary":return E(this,t,e,n);case"base64":return P(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var nt=4096;o.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,0>t?0>(t+=n)&&(t=0):t>n&&(t=n),0>e?0>(e+=n)&&(e=0):e>n&&(e=n),e=r&&(i-=a(2,8*e)),i},o.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||z(t,e,this.length);for(var i=e,r=1,o=this[t+--i];0=r&&(o-=a(2,8*e)),o},o.prototype.readInt8=function(t,e){return e||z(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){e||z(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){e||z(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return e||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||z(t,4,this.length),tt.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||z(t,4,this.length),tt.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||z(t,8,this.length),tt.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||z(t,8,this.length),tt.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,i){t=+t,e|=0,n|=0,!i&&j(this,t,e,n,a(2,8*n)-1,0);var r=1,o=0;for(this[e]=255&t;++o>>8):$(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):$(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):H(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=a(2,8*n-1);j(this,t,e,n,r-1,-r)}var o=0,s=1,l=0;for(this[e]=255&t;++ot&&0==l&&0!==this[e+o-1]&&(l=1),this[e+o]=255&(t/s>>0)-l;return e+n},o.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=a(2,8*n-1);j(this,t,e,n,r-1,-r)}var o=n-1,s=1,l=0;for(this[e+o]=255&t;0<=--o&&(s*=256);)0>t&&0==l&&0!==this[e+o+1]&&(l=1),this[e+o]=255&(t/s>>0)-l;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=c(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):$(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):$(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):H(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,n){return W(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return W(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),0e)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>i)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-es||!o.TYPED_ARRAY_SUPPORT)for(r=0;rr&&(t=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t&=255);if(0>e||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var s;if("number"==typeof t)for(s=e;so||o==1/0)throw RangeError("Count can't be negative");for(;0>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:0>t?-1:1}},function(t){var e=s;t.exports=!e||22025.465794806718e(10)||-2e-17!=e(-2e-17)?function(t){return 0==(t=+t)?t:-1e-6t?t+t*t/2:o(t)-1}:e},function(t,e,n){var i=n(25),r=n(24);t.exports=function(t){return function(e,n){var o,s,a=r(e)+"",l=i(n),u=a.length;return 0>l||l>=u?t?"":void 0:(o=a.charCodeAt(l),55296>o||56319(s=a.charCodeAt(l+1))||57343a;)e[a++]=t;return e}},function(t,e,n){"use strict";var i=n(32),r=n(127),o=n(48),s=n(16);t.exports=n(88)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,r(1)):"keys"==e?r(0,n):"values"==e?r(0,t[n]):r(0,[n,t[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){var i,r,o,s=n(19),a=n(117),l=n(80),u=n(76),c=n(2),h=c.process,f=c.setImmediate,d=c.clearImmediate,p=c.MessageChannel,g=c.Dispatch,m=0,v={},y=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},b=function(t){y.call(t.data)};f&&d||(f=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return v[++m]=function(){a("function"==typeof t?t:Function(t),e)},i(m),m},d=function(t){delete v[t]},"process"==n(20)(h)?i=function(t){h.nextTick(s(y,t,1))}:g&&g.now?i=function(t){g.now(s(y,t,1))}:p?(r=new p,o=r.port2,r.port1.onmessage=b,i=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(i=function(t){c.postMessage(t+"","*")},c.addEventListener("message",b,!1)):i="onreadystatechange"in u("script")?function(t){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),y.call(t)}}:function(t){setTimeout(s(y,t,1),0)}),t.exports={set:f,clear:d}},function(t,e,n){var i=n(2),r=n(98).set,o=i.MutationObserver||i.WebKitMutationObserver,s=i.process,a=i.Promise,l="process"==n(20)(s);t.exports=function(){var t,e,n,u=function(){var i,r;for(l&&(i=s.domain)&&i.exit();t;){r=t.fn,t=t.next;try{r()}catch(i){throw t?n():e=void 0,i}}e=void 0,i&&i.enter()};if(l)n=function(){s.nextTick(u)};else if(o){var c=!0,h=document.createTextNode("");new o(u).observe(h,{characterData:!0}),n=function(){h.data=c=!c}}else if(a&&a.resolve){var f=a.resolve();n=function(){f.then(u)}}else n=function(){r.call(i,u)};return function(i){var r={fn:i,next:void 0};e&&(e.next=r),t||(t=r,n()),e=r}}},function(t,e,n){"use strict"; -function i(t){var e,n;this.promise=new t(function(t,i){if(void 0!=e||void 0!=n)throw TypeError("Bad Promise constructor");e=t,n=i}),this.resolve=r(e),this.reject=r(n)}var r=n(10);t.exports.f=function(t){return new i(t)}},function(t,e,n){"use strict";function i(t,e,n){var i,r,o,s=Array(n),a=8*n-e-1,l=(1<>1,c=23===e?j(2,-24)-j(2,-77):0,h=0,f=0>t||0===t&&0>1/t?1:0;for(t=z(t),t!=t||t===R?(r=t==t?0:1,i=l):(i=$(H(t)/F),1>t*(o=j(2,-i))&&(i--,o*=2),t+=1<=i+u?c/o:c*j(2,1-u),2<=t*o&&(i++,o/=2),i+u>=l?(r=0,i=l):1<=i+u?(r=(t*o-1)*j(2,e),i+=u):(r=t*j(2,u-1)*j(2,e),i=0));8<=e;s[h++]=255&r,r/=256,e-=8);for(i=i<>1,a=r-7,l=n-1,u=t[l--],c=127&u;for(u>>=7;0>=-a,a+=e;0>8]}function l(t){return[255&t,255&t>>8,255&t>>16,255&t>>24]}function u(t){return i(t,52,8)}function c(t){return i(t,23,4)}function h(t,e,n){T(t[O],e,{get:function(){return this[n]}})}function f(t,e,n,i){var r=k(+n);if(r+e>t[B])throw I(M);var o=t[W]._b,s=r+t[U],a=o.slice(s,s+e);return i?a:a.reverse()}function d(t,e,n,i,r,o){var s=k(+n);if(s+e>t[B])throw I(M);for(var a=t[W]._b,l=s+t[U],u=i(+r),c=0;cG;)(q=V[G++])in A||y(A,q,N[q]);m||(Y.constructor=A)}var K=new D(new A(2)),X=D[O].setInt8;K.setInt8(0,2147483648),K.setInt8(1,2147483649),!K.getInt8(0)&&K.getInt8(1)||b(D[O],{setInt8:function(t,e){X.call(this,t,e<<24>>24)},setUint8:function(t,e){X.call(this,t,e<<24>>24)}},!0)}else A=function(t){_(this,A,"ArrayBuffer");var e=k(t);this._b=E.call(Array(e),0),this[B]=e},D=function(t,e,n){_(this,D,"DataView"),_(t,A,"DataView");var i=t[B],r=x(e);if(0>r||r>i)throw I("Wrong offset!");if(n=void 0===n?i-r:S(n),r+n>i)throw I("Wrong length!");this[W]=t,this[U]=r,this[B]=n},g&&(h(A,"byteLength","_l"),h(D,"buffer","_b"),h(D,"byteLength","_l"),h(D,"byteOffset","_o")),b(D[O],{getInt8:function(t){return f(this,1,t)[0]<<24>>24},getUint8:function(t){return f(this,1,t)[0]},getInt16:function(t){var e=f(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=f(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return o(f(this,4,t,arguments[1]))},getUint32:function(t){return o(f(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return r(f(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return r(f(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){d(this,1,t,s,e)},setUint8:function(t,e){d(this,1,t,s,e)},setInt16:function(t,e){d(this,2,t,a,e,arguments[2])},setUint16:function(t,e){d(this,2,t,a,e,arguments[2])},setInt32:function(t,e){d(this,4,t,l,e,arguments[2])},setUint32:function(t,e){d(this,4,t,l,e,arguments[2])},setFloat32:function(t,e){d(this,4,t,c,e,arguments[2])},setFloat64:function(t,e){d(this,8,t,u,e,arguments[2])}});P(A,"ArrayBuffer"),P(D,"DataView"),y(D[O],v.VIEW,!0),e.ArrayBuffer=A,e.DataView=D},function(t,e,n){"use strict";e.decode=e.parse=n(147),e.encode=e.stringify=n(148)},function(t,e,n){"use strict";(function(e,i){function r(t){return j.from(t)}function o(t){return j.isBuffer(t)||t instanceof $}function s(t,e,n){return"function"==typeof t.prependListener?t.prependListener(e,n):void(t._events&&t._events[e]?R(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n))}function a(t,e){I=I||n(33),t=t||{},this.objectMode=!!t.objectMode,e instanceof I&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r,this.highWaterMark=c(this.highWaterMark),this.buffer=new U,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(B||(B=n(107).StringDecoder),this.decoder=new B(t.encoding),this.encoding=t.encoding)}function l(t){return I=I||n(33),this instanceof l?(this._readableState=new a(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),void z.call(this)):new l(t)}function u(t,e,n,i,o){var s=t._readableState;if(null===e)s.reading=!1,m(t,s);else{var a;o||(a=f(s,e)),a?t.emit("error",a):s.objectMode||e&&0=V?t=V:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function g(t,e){return 0>=t||0===e.length&&e.ended?0:e.objectMode?1:t===t?(t>e.highWaterMark&&(e.highWaterMark=p(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0)):e.flowing&&e.length?e.buffer.head.data.length:e.length}function m(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,v(t)}}function v(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(F("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?L(y,t):y(t))}function y(t){F("emit readable"),t.emit("readable"),C(t)}function b(t,e){e.readingMore||(e.readingMore=!0,L(w,t,e))}function w(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=E(t,e.buffer,e.decoder),n}function E(t,e,n){var i;return to.length?o.length:t;if(r+=s===o.length?o:o.slice(0,t),0==(t-=s)){s===o.length?(++i,e.head=n.next?n.next:e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}function O(t,e){var n=j.allocUnsafe(t),i=e.head,r=1;for(i.data.copy(n),t-=i.data.length;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0==(t-=s)){s===o.length?(++r,e.head=i.next?i.next:e.tail=null):(e.head=i,i.data=o.slice(s));break}++r}return e.length-=r,n}function M(t){var e=t._readableState;if(0=e.highWaterMark||e.ended))return F("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?M(this):v(this),null;if(0===(t=g(t,e))&&e.ended)return 0===e.length&&M(this),null;var i=e.needReadable;F("need readable",i),(0===e.length||e.length-t=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length,t.copy(this.charBuffer,this.charReceived,0,e),this.charReceived+=e,this.charReceived=i)){if(this.charReceived=this.charLength=0,0===t.length)return n;break}this.charLength+=this.surrogateSize,n=""}this.detectIncompleteChar(t);var r=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,r),r-=this.charReceived),n+=t.toString(this.encoding,0,r);var r=n.length-1,i=n.charCodeAt(r);if(55296<=i&&56319>=i){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),n.substring(0,r)}return n},u.prototype.detectIncompleteChar=function(t){for(var e,n=3<=t.length?3:t.length;0>5){this.charLength=2;break}if(2>=n&&14==e>>4){this.charLength=3;break}if(3>=n&&30==e>>3){this.charLength=4;break}}this.charReceived=n},u.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,i=this.charBuffer,r=this.encoding;e+=i.slice(0,n).toString(r)}return e}},function(t,e,n){"use strict";function i(t){this.afterTransform=function(e,n){return r(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function r(t,e,n){var i=t._transformState;i.transforming=!1;var r=i.writecb;if(!r)return t.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,null!==n&&void 0!==n&&t.push(n),r(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.lengththis._maxListeners&&(r._listeners.warned=!0,l.call(this,r._listeners.length,s))):r._listeners=e,!0;s=t.shift()}return!0}var f=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},d=10;u.EventEmitter2=u,u.prototype.delimiter=".",u.prototype.setMaxListeners=function(t){t!==o&&(this._maxListeners=t,this._conf||(this._conf={}),this._conf.maxListeners=t)},u.prototype.event="",u.prototype.once=function(t,e){return this._once(t,e,!1)},u.prototype.prependOnceListener=function(t,e){return this._once(t,e,!0)},u.prototype._once=function(t,e,n){return this._many(t,1,e,n),this},u.prototype.many=function(t,e,n){return this._many(t,e,n,!1)},u.prototype.prependMany=function(t,e,n){return this._many(t,e,n,!0)},u.prototype._many=function(t,e,n,i){function r(){return 0==--e&&o.off(t,r),n.apply(this,arguments)}var o=this;if("function"!=typeof n)throw new Error("many only accepts instances of Function");return r._origin=n,this._on(t,r,i),o},u.prototype.emit=function(){this._events||s.call(this);var t=arguments[0];if("newListener"===t&&!this.newListener&&!this._events.newListener)return!1;var e,n,i,r,o,a=arguments.length;if(this._all&&this._all.length){if(o=this._all.slice(),3this._maxListeners&&(this._events[t].warned=!0,l.call(this,this._events[t].length,t))):this._events[t]=e,this)},u.prototype.off=function(t,e){function n(t){if(t!==o){var e=Object.keys(t);for(var i in e){var r=e[i],s=t[r];s instanceof Function||"object"!=typeof s||null===s||(0u)continue;return this.wildcard?a._listeners.splice(u,1):this._events[t].splice(u,1),0===i.length&&(this.wildcard?delete a._listeners:delete this._events[t]),this.emit("removeListener",t,e),this}(i===e||i.listener&&i.listener===e||i._origin&&i._origin===e)&&(this.wildcard?delete a._listeners:delete this._events[t],this.emit("removeListener",t,e))}return n(this.listenerTree),this},u.prototype.offAny=function(t){var e,n=0,i=0;if(t&&this._all&&0l;)i(a,n=e[l++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var i=n(7),r=n(1),o=n(37);t.exports=n(6)?Object.defineProperties:function(t,e){r(t);for(var n,s=o(e),a=s.length,l=0;a>l;)i.f(t,n=s[l++],e[n]);return t}},function(t,e,n){var i=n(16),r=n(40).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return r(t)}catch(t){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?a(t):r(i(t))}},function(t,e,n){"use strict";var i=n(37),r=n(58),o=n(53),s=n(9),a=n(52),l=Object.assign;t.exports=!l||n(3)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=l({},t)[n]||Object.keys(l({},e)).join("")!=i})?function(t){for(var e=s(t),n=arguments.length,l=1,u=r.f,c=o.f;n>l;)for(var h,f=a(arguments[l++]),d=u?i(f).concat(u(f)):i(f),p=d.length,g=0;p>g;)c.call(f,h=d[g++])&&(e[h]=f[h]);return e}:l},function(t,e,n){"use strict";var i=n(10),r=n(4),o=n(117),s=[].slice,a={},l=function(t,e,n){if(!(e in a)){for(var i=[],r=0;r>>0||(s.test(n)?16:10))}:i},function(t,e,n){var i=n(2).parseFloat,r=n(47).trim;t.exports=1/i(n(82)+"-0")==-1/0?i:function(t){var e=r(t+"",3),n=i(e);return 0===n&&"-"==e.charAt(0)?-0:n}},function(t,e,n){var i=n(20);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=i(t))throw TypeError(e);return+t}},function(t,e,n){var i=n(4);t.exports=function(t){return!i(t)&&isFinite(t)&&c(t)===t}},function(t){t.exports=Math.log1p||function(t){return-1e-8<(t=+t)&&1e-8>t?t-t*t/2:r(1+t)}},function(t,e,n){var r=n(85),o=a,s=o(2,-52),l=o(2,-23),u=o(2,127)*(2-l),c=o(2,-126),h=function(t){return t+1/s-1/s};t.exports=Math.fround||function(t){var e,n,o=i(t),a=r(t);return ou||n!=n?a*(1/0):a*n)}},function(t,e,n){var i=n(1);t.exports=function(t,e,n,r){ -try{return r?e(i(n)[0],n[1]):e(n)}catch(e){var o=t["return"];throw void 0!==o&&i(o.call(t)),e}}},function(t,e,n){var i=n(10),r=n(9),o=n(52),s=n(8);t.exports=function(t,e,n,a,l){i(e);var u=r(t),c=o(u),h=s(u.length),f=l?h-1:0,d=l?-1:1;if(2>n)for(;;){if(f in c){a=c[f],f+=d;break}if(f+=d,l?0>f:h<=f)throw TypeError("Reduce of empty array with no initial value")}for(;l?0<=f:h>f;f+=d)f in c&&(a=e(a,c[f],f,u));return a}},function(t,e,n){"use strict";var i=n(9),r=n(38),o=n(8);t.exports=[].copyWithin||function(t,e){var n=i(this),s=o(n.length),a=r(t,s),l=r(e,s),u=2f&&(d=d.slice(0,f)),s?d+a:a+d}},function(t,e,n){var i=n(37),r=n(16),o=n(53).f;t.exports=function(t){return function(e){for(var n,s=r(e),a=i(s),l=a.length,u=0,c=[];l>u;)o.call(s,n=a[u++])&&c.push(t?[n,s[n]]:s[n]);return c}}},function(t,e,n){var i=n(54),r=n(142);t.exports=function(t){return function(){if(i(this)!=t)throw TypeError(t+"#toJSON isn't generic");return r(this)}}},function(t,e,n){var i=n(43);t.exports=function(t,e){var n=[];return i(t,!1,n.push,n,e),n}},function(t){t.exports=Math.scale||function(t,e,n,i,r){return 0===arguments.length||t!=t||e!=e||n!=n||i!=i||r!=r?NaN:t===1/0||t===-1/0?t:(t-e)*(r-i)/(n-e)+i}},function(t,e,n){"use strict";(function(i){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n,i=0;il&&(u=l);for(var c=0;c>18]+o[63&t>>12]+o[63&t>>6]+o[63&t]}function r(t,e,n){for(var r,o=[],s=e;s>16,l[c++]=255&r>>8,l[c++]=255&r;return 2===o?(r=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,l[c++]=255&r):1==o&&(r=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,l[c++]=255&r>>8,l[c++]=255&r),l},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,s="",a=[],l=0,u=n-i;lu?u:l+16383));return 1==i?(e=t[n-1],s+=o[e>>2],s+=o[63&e<<4],s+="=="):2==i&&(e=(t[n-2]<<8)+t[n-1],s+=o[e>>10],s+=o[63&e>>4],s+=o[63&e<<2],s+="="),a.push(s),a.join("")};for(var o=[],s=[],a="undefined"==typeof Uint8Array?Array:Uint8Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=l.length;u>1,h=-7,f=n?r-1:0,d=n?-1:1,p=t[e+f];for(f+=d,o=p&(1<<-h)-1,p>>=-h,h+=l;0>=-h,h+=i;0>1,v=23===l?5.960464477539062e-8:0,y=s?0:u-1,b=s?1:-1,w=0>e||0===e&&0>1/e?1:0;for(e=i(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,h=g):(h=c(r(e)/n),1>e*(d=a(2,-h))&&(h--,d*=2),e+=1<=h+m?v/d:v*a(2,1-m),2<=e*d&&(h++,d/=2),h+m>=g?(f=0,h=g):1<=h+m?(f=(e*d-1)*a(2,l),h+=m):(f=e*a(2,m-1)*a(2,l),h=0));8<=l;t[o+y]=255&f,y+=b,f/=256,l-=8);for(h=h<>>0),n=this.head,i=0;n;)r(n.data,e,i),i+=n.data.length,n=n.next;return e},t}()},function(t,e,n){function i(t,e){this._id=t,this._clearFn=e}var r=Function.prototype.apply;e.setTimeout=function(){return new i(r.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new i(r.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(154),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,n){(function(t,e){!function(t,n){"use strict";function i(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=Array(arguments.length-1),n=0;nthis.status,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new r(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var y={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(y.arrayBuffer)var b=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=function(t){return t&&DataView.prototype.isPrototypeOf(t)},_=ArrayBuffer.isView||function(t){return t&&-1=n;)e+=n,a();if("."===n)for(e+=".";a()&&"0"<=n&&"9">=n;)e+=n;if("e"===n||"E"===n)for(e+=n,a(),"-"!=n&&"+"!=n||(e+=n,a());"0"<=n&&"9">=n;)e+=n,a();return t=+e,isFinite(t)?t:void s("Bad number")},c=function(){var t,e,i,r="";if('"'===n)for(;a();){if('"'===n)return a(),r;if("\\"!==n)r+=n;else if(a(),"u"===n){for(i=0,e=0;4>e&&(t=parseInt(a(),16),isFinite(t));e+=1)i=16*i+t;r+=l(i)}else{if("string"!=typeof o[n])break;r+=o[n]}}s("Bad string")},h=function(){for(;n&&" ">=n;)a()},f=function(){switch(n){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}s("Unexpected '"+n+"'")},d=function(){var t=[];if("["===n){if(a("["),h(),"]"===n)return a("]"),t;for(;n;){if(t.push(r()),h(),"]"===n)return a("]"),t;a(","),h()}}s("Bad array")},p=function(){var t,e={};if("{"===n){if(a("{"),h(),"}"===n)return a("}"),e;for(;n;){if(t=c(),h(),a(":"),Object.hasOwnProperty.call(e,t)&&s('Duplicate key "'+t+'"'),e[t]=r(),h(),"}"===n)return a("}"),e;a(","),h()}}s("Bad object")};r=function(){switch(h(),n){case"{":return p();case"[":return d();case'"':return c();case"-":return u();default:return"0"<=n&&"9">=n?u():f()}},t.exports=function(t,o){var a;return i=t,e=0,n=" ",a=r(),h(),n&&s("Syntax error"),"function"==typeof o?function l(t,e){var n,i,r=t[e];if(r&&"object"==typeof r)for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i=l(r,n),void 0===i?delete r[n]:r[n]=i);return o.call(t,e,r)}({"":a},""):a}},function(t){function e(t){return s.lastIndex=0,s.test(t)?'"'+t.replace(s,function(t){var e=a[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function n(t,s){var a,l,u,c,h,f=i,d=s[t];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(t)),"function"==typeof o&&(d=o.call(s,t,d)),typeof d){case"string":return e(d);case"number":return isFinite(d)?d+"":"null";case"boolean":case"null":return d+"";case"object":if(!d)return"null";if(i+=r,h=[],"[object Array]"===Object.prototype.toString.apply(d)){for(c=d.length,a=0;ar;)Y(t,n=i[r++],e[n]);return t},G=function(t){var e=R.call(this,t=w(t,!0));return(this!==$||!r(z,t)||r(j,t))&&(!(e||!r(this,t)||!r(z,t)||r(this,L)&&this[L][t])||e)},K=function(t,e){if(t=b(t),e=w(e,!0),t!==$||!r(z,e)||r(j,e)){var n=E(t,e);return!n||!r(z,e)||r(t,L)&&t[L][e]||(n.enumerable=!0),n}},X=function(t){for(var e,n=O(b(t)),i=[],o=0;n.length>o;)r(z,e=n[o++])||e==L||e==l||i.push(e);return i},J=function(t){for(var e,n=t===$,i=O(n?j:b(t)),o=[],s=0;i.length>s;)r(z,e=i[s++])&&(!n||r($,e))&&o.push(z[e]);return o};H||(M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var t=f(0Q;)d(Z[Q++]);for(var tt=T(d.store),et=0;tt.length>et;)g(tt[et++]);s(s.S+s.F*!H,"Symbol",{"for":function(t){return r(N,t+="")?N[t]:N[t]=M(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var e in N)if(N[e]===t)return e},useSetter:function(){W=!0},useSimple:function(){W=!1}}),s(s.S+s.F*!H,"Object",{create:function(t,e){return void 0===e?x(t):V(x(t),e)},defineProperty:Y,defineProperties:V,getOwnPropertyDescriptor:K,getOwnPropertyNames:X,getOwnPropertySymbols:J}),A&&s(s.S+s.F*(!H||u(function(){var t=M();return"[null]"!=D([t])||"{}"!=D({a:t})||"{}"!=D(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!q(t)){for(var e,n,i=[t],r=1;arguments.length>r;)i.push(arguments[r++]);return e=i[1],"function"==typeof e&&(n=e),!n&&v(e)||(e=function(t,e){if(n&&(e=n.call(this,t,e)),!q(e))return e}),i[1]=e,D.apply(A,i)}}}),M.prototype[I]||n(12)(M.prototype,I,M.prototype.valueOf),h(M,"Symbol"),h(Math,"Math",!0),h(i.JSON,"JSON",!0)},function(t,e,n){var i=n(37),r=n(58),o=n(53);t.exports=function(t){var e=i(t),n=r.f;if(n)for(var s,a=n(t),l=o.f,u=0;a.length>u;)l.call(t,s=a[u++])&&e.push(s);return e}},function(t,e,n){var i=n(0);i(i.S,"Object",{create:n(39)})},function(t,e,n){var i=n(0);i(i.S+i.F*!n(6),"Object",{defineProperty:n(7).f})},function(t,e,n){var i=n(0);i(i.S+i.F*!n(6),"Object",{defineProperties:n(113)})},function(t,e,n){var i=n(16),r=n(17).f;n(26)("getOwnPropertyDescriptor",function(){return function(t,e){return r(i(t),e)}})},function(t,e,n){var i=n(9),r=n(18);n(26)("getPrototypeOf",function(){return function(t){return r(i(t))}})},function(t,e,n){var i=n(9),r=n(37);n(26)("keys",function(){return function(t){return r(i(t))}})},function(t,e,n){n(26)("getOwnPropertyNames",function(){return n(114).f})},function(t,e,n){var i=n(4),r=n(31).onFreeze;n(26)("freeze",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(t,e,n){var i=n(4),r=n(31).onFreeze;n(26)("seal",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(t,e,n){var i=n(4),r=n(31).onFreeze;n(26)("preventExtensions",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(t,e,n){var i=n(4);n(26)("isFrozen",function(t){return function(e){return!i(e)||!!t&&t(e)}})},function(t,e,n){var i=n(4);n(26)("isSealed",function(t){return function(e){return!i(e)||!!t&&t(e)}})},function(t,e,n){var i=n(4);n(26)("isExtensible",function(t){return function(e){return!!i(e)&&(!t||t(e))}})},function(t,e,n){var i=n(0);i(i.S+i.F,"Object",{assign:n(115)})},function(t,e,n){var i=n(0);i(i.S,"Object",{is:n(200)})},function(t){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){var i=n(0);i(i.S,"Object",{setPrototypeOf:n(81).set})},function(t,e,n){"use strict";var i=n(54);({})[n(5)("toStringTag")]="z",n(13)(Object.prototype,"toString",function(){return"[object "+i(this)+"]"},!0)},function(t,e,n){var i=n(0);i(i.P,"Function",{bind:n(116)})},function(t,e,n){var i=n(7).f,r=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in r||n(6)&&i(r,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,e,n){"use strict";var i=n(4),r=n(18),o=n(5)("hasInstance"),s=Function.prototype;o in s||n(7).f(s,o,{value:function(t){if("function"!=typeof this||!i(t))return!1;if(!i(this.prototype))return t instanceof this;for(;t=r(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,n){var i=n(0),r=n(118);i(i.G+i.F*(parseInt!=r),{parseInt:r})},function(t,e,n){var i=n(0),r=n(119);i(i.G+i.F*(parseFloat!=r),{parseFloat:r})},function(t,e,n){"use strict";var i=n(2),r=n(11),o=n(20),s=n(83),a=n(23),l=n(3),u=n(40).f,c=n(17).f,h=n(7).f,f=n(47).trim,d=i.Number,p=d,g=d.prototype,m="Number"==o(n(39)(g)),v="trim"in String.prototype,y=function(t){var e=a(t,!1);if("string"==typeof e&&2(s=l.charCodeAt(u))||s>r)return NaN;return parseInt(l,i)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=1>arguments.length?0:t,n=this;return n instanceof d&&(m?l(function(){g.valueOf.call(n)}):"Number"!=o(n))?s(new p(y(e)),n,d):y(e)};for(var b,w=n(6)?u(p):["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY","EPSILON","isFinite","isInteger","isNaN","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","parseFloat","parseInt","isInteger"],_=0;w.length>_;_++)r(p,b=w[_])&&!r(d,b)&&h(d,b,c(p,b));d.prototype=g,g.constructor=d,n(13)(i,"Number",d)}},function(t,e,n){"use strict";var i=n(0),r=n(25),o=n(120),s=n(84),a=1..toFixed,l=c,u=[0,0,0,0,0,0],h="Number.toFixed: incorrect invocation!",f=function(t,e){for(var n=-1,i=e;6>++n;)i+=t*u[n],u[n]=i%1e7,i=l(i/1e7)},d=function(t){for(var e=6,n=0;0<=--e;)n+=u[e],u[e]=l(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";0<=--t;)if(""!==e||0===t||0!==u[t]){var n=u[t]+"";e=""===e?n:e+s.call("0",7-n.length)+n}return e},g=function(t,e,n){return 0===e?n:1==e%2?g(t,e-1,n*t):g(t*t,e/2,n)},m=function(t){for(var e=0,n=t;4096<=n;)e+=12,n/=4096;for(;2<=n;)e+=1,n/=2;return e};i(i.P+i.F*("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0)||!n(3)(function(){a.call({})})),"Number",{toFixed:function(t){var e,n,i,a,l=o(this,h),u=r(t),c="",v="0";if(0>u||20=l||1e21<=l)return l+"";if(0>l&&(c="-",l=-l),1e-21e?l*g(2,-e,1):l/g(2,e,1),n*=4503599627370496,0<(e=52-e)){for(f(0,n),i=u;7<=i;)f(1e7,0),i-=7;for(f(g(10,i,1),0),i=e-1;23<=i;)d(8388608),i-=23;d(1<=i(t)}})},function(t,e,n){var i=n(0);i(i.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){var i=n(0);i(i.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,n){var i=n(0),r=n(119);i(i.S+i.F*(Number.parseFloat!=r),"Number",{parseFloat:r})},function(t,e,n){var i=n(0),r=n(118);i(i.S+i.F*(Number.parseInt!=r),"Number",{parseInt:r})},function(t,i,o){var s=o(0),a=o(122),l=e,u=Math.acosh;s(s.S+s.F*!(u&&710==c(u(Number.MAX_VALUE))&&u(1/0)==1/0),"Math",{acosh:function(t){return 1>(t=+t)?NaN:94906265.62425156t?-o(-t):r(t+e(t*t+1)):t}var s=i(0),a=Math.asinh;s(s.S+s.F*!(a&&0<1/a(0)),"Math",{asinh:o})},function(t,e,n){var i=n(0),o=Math.atanh;i(i.S+i.F*!(o&&0>1/o(-0)),"Math",{atanh:function(t){return 0==(t=+t)?t:r((1+t)/(1-t))/2}})},function(t,e,n){var r=n(0),o=n(85);r(r.S,"Math",{cbrt:function(t){return o(t=+t)*a(i(t),1/3)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{clz32:function(t){return(t>>>=0)?31-c(r(t+.5)*Math.LOG2E):32}})},function(t,e,n){var i=n(0),r=o;i(i.S,"Math",{cosh:function(t){return(r(t=+t)+r(-t))/2}})},function(t,e,n){var i=n(0),r=n(86);i(i.S+i.F*(r!=s),"Math",{expm1:r})},function(t,e,n){var i=n(0);i(i.S,"Math",{fround:n(123)})},function(t,n,r){var o=r(0);o(o.S,"Math",{hypot:function(){for(var t,n,r=0,o=0,s=arguments.length,a=0;o>>16)*o+r*(65535&i>>>16)<<16>>>0)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{log10:function(t){return r(t)*Math.LOG10E}})},function(t,e,n){var i=n(0);i(i.S,"Math",{log1p:n(122)})},function(t,e,i){var o=i(0);o(o.S,"Math",{log2:function(t){return r(t)/n}})},function(t,e,n){var i=n(0);i(i.S,"Math",{sign:n(85)})},function(t,e,n){var r=n(0),s=n(86),a=o;r(r.S+r.F*n(3)(function(){return!0}),"Math",{sinh:function(t){return 1>i(t=+t)?(s(t)-s(-t))/2:(a(t-1)-a(-t-1))*(Math.E/2)}})},function(t,e,n){var i=n(0),r=n(86),s=o;i(i.S,"Math",{tanh:function(t){var e=r(t=+t),n=r(-t);return e==1/0?1:n==1/0?-1:(e-n)/(s(t)+s(-t))}})},function(t,e,n){var i=n(0);i(i.S,"Math",{trunc:function(t){return(0i;){if(t=+arguments[i++],r(t,1114111)!==t)throw RangeError(t+" is not a valid code point");e.push(65536>t?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return e.join("")}})},function(t,e,n){var i=n(0),r=n(16),o=n(8);i(i.S,"String",{raw:function(t){for(var e=r(t.raw),n=o(e.length),i=arguments.length,s=[],a=0;n>a;)s.push(e[a++]+""),a=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var i=n(0),r=n(87)(!1);i(i.P,"String",{codePointAt:function(t){return r(this,t)}})},function(t,e,n){"use strict";var i=n(0),r=n(8),o=n(90),s="".endsWith;i(i.P+i.F*n(91)("endsWith"),"String",{endsWith:function(t){var e=o(this,t,"endsWith"),n=1e?"-":9999v;v++)u(n,v,m?g(f[v],v):f[v]);else for(h=y.call(f),n=new d;!(r=h.next()).done;v++)u(n,v,m?s(h,g,[r.value,v],!0):r.value);return n.length=v,n}})},function(t,e,n){"use strict";var i=n(0),r=n(93);i(i.S+i.F*n(3)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)r(n,t,arguments[t++]);return n.length=e,n}})},function(t,e,n){"use strict";var i=n(0),r=n(16),o=[].join;i(i.P+i.F*(n(52)!=Object||!n(21)(o)),"Array",{join:function(t){return o.call(r(this),void 0===t?",":t)}})},function(t,e,n){"use strict";var i=n(0),r=n(80),o=n(20),s=n(38),a=n(8),l=[].slice;i(i.P+i.F*n(3)(function(){r&&l.call(r)}),"Array",{slice:function(t,e){var n=a(this.length),i=o(this);if(e=void 0===e?n:e,"Array"==i)return l.call(this,t,e);for(var r=s(t,n),u=s(e,n),c=a(u-r),h=Array(c),f=0;f1/[1].indexOf(1,-0);i(i.P+i.F*(s||!n(21)(o)),"Array",{indexOf:function(t){return s?o.apply(this,arguments)||0:r(this,t,arguments[1])}})},function(t,e,n){"use strict";var i=n(0),r=n(16),o=n(25),s=n(8),a=[].lastIndexOf,l=!!a&&0>1/[1].lastIndexOf(1,-0);i(i.P+i.F*(l||!n(21)(a)),"Array",{lastIndexOf:function(t){if(l)return a.apply(this,arguments)||0;var e=r(this),n=s(e.length),i=n-1;for(1i&&(i=n+i);0<=i;i--)if(i in e&&e[i]===t)return i||0;return-1}})},function(t,e,n){var i=n(0);i(i.P,"Array",{copyWithin:n(126)}),n(32)("copyWithin")},function(t,e,n){var i=n(0);i(i.P,"Array",{fill:n(96)}),n(32)("fill")},function(t,e,n){"use strict";var i=n(0),r=n(27)(5),o=!0;"find"in[]&&[,].find(function(){o=!1}),i(i.P+i.F*o,"Array",{find:function(t){return r(this,t,1m;)!function(t){t in u||o(u,t,{configurable:!0,get:function(){return c[t]},set:function(e){c[t]=e}})}(g[m++]);h.constructor=u,u.prototype=h,n(13)(i,"RegExp",u)}n(41)("RegExp")},function(t,e,n){"use strict";n(128);var i=n(1),r=n(62),o=n(6),s=/./.toString,a=function(t){n(13)(RegExp.prototype,"toString",t,!0)};n(3)(function(){return"/a/b"!=s.call({source:"a",flags:"b"})})?a(function(){var t=i(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?r.call(t):void 0)}):"toString"!=s.name&&a(function(){return s.call(this)})},function(t,e,n){n(63)("match",1,function(t,e,n){return[function(n){"use strict";var i=t(this),r=void 0==n?void 0:n[e];return void 0===r?new RegExp(n)[e](i+""):r.call(n,i)},n]})},function(t,e,n){n(63)("replace",2,function(t,e,n){return[function(i,r){"use strict";var o=t(this),s=void 0==i?void 0:i[e];return void 0===s?n.call(o+"",i,r):s.call(i,o,r)},n]})},function(t,e,n){n(63)("search",1,function(t,e,n){return[function(n){"use strict";var i=t(this),r=void 0==n?void 0:n[e];return void 0===r?new RegExp(n)[e](i+""):r.call(n,i)},n]})},function(t,e,n){n(63)("split",2,function(t,e,i){"use strict";var r=n(60),o=i,s=[].push,a="length";if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[a]||2!="ab".split(/(?:ab)*/)[a]||4!=".".split(/(.?)(.?)/)[a]||1<".".split(/()()/)[a]||"".split(/.?/)[a]){var l=void 0===/()??/.exec("")[1];i=function(t,e){var n=this+"";if(void 0===t&&0===e)return[];if(!r(t))return o.call(n,t,e);var i,u,c,h,f,d=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,m=void 0===e?4294967295:e>>>0,v=new RegExp(t.source,p+"g");for(l||(i=new RegExp("^"+v.source+"$(?!\\s)",p));(u=v.exec(n))&&!((c=u.index+u[0][a])>g&&(d.push(n.slice(g,u.index)),!l&&1=m));)v.lastIndex===u.index&&v.lastIndex++;return g===n[a]?!h&&v.test("")||d.push(""):d.push(n.slice(g)),d[a]>m?d.slice(0,m):d}}else["0"][a]&&(i=function(t,e){return void 0===t&&0===e?[]:o.call(this,t,e)});return[function(n,r){var o=t(this),s=void 0==n?void 0:n[e];return void 0===s?i.call(o+"",n,r):s.call(n,o,r)},i]})},function(t,e,n){"use strict";var i,r,o,s,a=n(36),l=n(2),u=n(19),c=n(54),h=n(0),f=n(4),d=n(10),p=n(42),g=n(43),m=n(64),v=n(98).set,y=n(99)(),b=n(100),w=n(129),_=n(130),x=l.TypeError,S=l.process,k=l.Promise,C="process"==c(S),T=function(){},E=r=b.f,P=!!function(){try{var t=k.resolve(1),e=(t.constructor={})[n(5)("species")]=function(t){t(T,T)};return(C||"function"==typeof PromiseRejectionEvent)&&t.then(T)instanceof e}catch(t){}}(),O=function(t){var e;return f(t)&&"function"==typeof(e=t.then)&&e},M=function(t,e){if(!t._n){t._n=!0;var n=t._c;y(function(){for(var i=t._v,r=1==t._s,o=0;n.length>o;)!function(e){var n,o,s=r?e.ok:e.fail,a=e.resolve,l=e.reject,u=e.domain;try{s?(r||(2==t._h&&L(t),t._h=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&u.exit()),n===e.promise?l(x("Promise-chain cycle")):(o=O(n))?o.call(n,a,l):a(n)):l(i)}catch(n){l(n)}}(n[o++]);t._c=[],t._n=!1,e&&!t._h&&A(t)})}},A=function(t){v.call(l,function(){var e,n,i,r=t._v,o=D(t);if(o&&(e=w(function(){C?S.emit("unhandledRejection",r,t):(n=l.onunhandledrejection)?n({promise:t,reason:r}):(i=l.console)&&i.error&&i.error("Unhandled promise rejection",r)}),t._h=C||D(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},D=function(t){if(1==t._h)return!1;for(var e,n=t._a||t._c,i=0;n.length>i;)if(e=n[i++],e.fail||!D(e.promise))return!1;return!0},L=function(t){v.call(l,function(){var e;C?S.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})})},I=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0))},R=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw x("Promise can't be resolved itself");(e=O(t))?y(function(){var t={_w:n,_d:!1};try{e.call(i,u(R,t,1),u(I,t,1))}catch(i){I.call(t,i)}}):(n._v=t,n._s=1,M(n,!1))}catch(t){I.call({_w:n,_d:!1},t)}}};P||(k=function(t){p(this,k,"Promise","_h"),d(t),i.call(this);try{t(u(R,this,1),u(I,this,1))}catch(t){I.call(this,t)}},i=function(){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},i.prototype=n(44)(k.prototype,{then:function(t,e){var n=E(m(this,k));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=C?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},"catch":function(t){return this.then(void 0,t)}}),o=function(){var t=new i;this.promise=t,this.resolve=u(R,t,1),this.reject=u(I,t,1)},b.f=E=function(t){return t===k||t===s?new o(t):r(t)}),h(h.G+h.W+h.F*!P,{Promise:k}),n(46)(k,"Promise"),n(41)("Promise"),s=n(22).Promise,h(h.S+h.F*!P,"Promise",{reject:function(t){var e=E(this);return(0,e.reject)(t),e.promise}}),h(h.S+h.F*(a||!P),"Promise",{resolve:function(t){return _(a&&this===s?k:this,t)}}),h(h.S+h.F*!(P&&n(61)(function(t){k.all(t)["catch"](T)})),"Promise",{all:function(t){var e=this,n=E(e),i=n.resolve,r=n.reject,o=w(function(){var n=[],o=0,s=1;g(t,!1,function(t){var a=o++,l=!1;n.push(void 0),s++,e.resolve(t).then(function(t){l||(l=!0,n[a]=t,--s||i(n))},r)}),--s||i(n)});return o.e&&r(o.v),n.promise},race:function(t){var e=this,n=E(e),i=n.reject,r=w(function(){g(t,!1,function(t){e.resolve(t).then(n.resolve,i)})});return r.e&&i(r.v),n.promise}})},function(t,e,n){"use strict";var i=n(135),r=n(49);n(65)("WeakSet",function(t){return function(){return t(this,0arguments.length?t:o(arguments[2]);if(f&&!h)return c(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return i.push.apply(i,e),new(u.apply(t,i))}var l=n.prototype,d=r(a(l)?l:Object.prototype),p=Function.apply.call(t,d,e);return a(p)?p:d}})},function(t,e,n){var i=n(7),r=n(0),o=n(1),s=n(23);r(r.S+r.F*n(3)(function(){Reflect.defineProperty(i.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,n){o(t),e=s(e,!0),o(n);try{return i.f(t,e,n),!0}catch(n){return!1}}})},function(t,e,n){var i=n(0),r=n(17).f,o=n(1);i(i.S,"Reflect",{deleteProperty:function(t,e){var n=r(o(t),e);return(!n||n.configurable)&&delete t[e]}})},function(t,e,n){"use strict";var i=n(0),r=n(1),o=function(t){this._t=r(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(89)(o,"Object",function(){var t,e=this,n=e._k;do if(e._i>=n.length)return{value:void 0,done:!0};while(!((t=n[e._i++])in e._t));return{value:t,done:!1}}),i(i.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,e,n){function i(t,e){var n,a,c=3>arguments.length?t:arguments[2];return u(t)===c?t[e]:(n=r.f(t,e))?s(n,"value")?n.value:void 0===n.get?void 0:n.get.call(c):l(a=o(t))?i(a,e,c):void 0}var r=n(17),o=n(18),s=n(11),a=n(0),l=n(4),u=n(1);a(a.S,"Reflect",{get:i})},function(t,e,n){var i=n(17),r=n(0),o=n(1);r(r.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return i.f(o(t),e)}})},function(t,e,n){var i=n(0),r=n(18),o=n(1);i(i.S,"Reflect",{getPrototypeOf:function(t){return r(o(t))}})},function(t,e,n){var i=n(0);i(i.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,n){var i=n(0),r=n(1),o=Object.isExtensible;i(i.S,"Reflect",{isExtensible:function(t){return r(t),!o||o(t)}})},function(t,e,n){var i=n(0);i(i.S,"Reflect",{ownKeys:n(137)})},function(t,e,n){var i=n(0),r=n(1),o=Object.preventExtensions;i(i.S,"Reflect",{preventExtensions:function(t){r(t);try{return o&&o(t),!0}catch(t){return!1}}})},function(t,e,n){function i(t,e,n){var l,f,d=4>arguments.length?t:arguments[3],p=o.f(c(t),e);if(!p){if(h(f=s(t)))return i(f,e,n,d);p=u(0)}return a(p,"value")?!1!==p.writable&&h(d)&&(l=o.f(d,e)||u(0),l.value=n,r.f(d,e,l),!0):void 0!==p.set&&(p.set.call(d,n),!0)}var r=n(7),o=n(17),s=n(18),a=n(11),l=n(0),u=n(34),c=n(1),h=n(4);l(l.S,"Reflect",{set:i})},function(t,e,n){var i=n(0),r=n(81);r&&i(i.S,"Reflect",{setPrototypeOf:function(t,e){r.check(t,e);try{return r.set(t,e),!0}catch(t){return!1}}})},function(t,e,n){"use strict";var i=n(0),r=n(57)(!0);i(i.P,"Array",{includes:function(t){return r(this,t,1h;)void 0!==(n=l(i,e=u[h++]))&&a(c,e,n);return c}})},function(t,e,n){var i=n(0),r=n(140)(!1);i(i.S,"Object",{values:function(t){return r(t)}})},function(t,e,n){var i=n(0),r=n(140)(!0);i(i.S,"Object",{entries:function(t){return r(t)}})},function(t,e,n){"use strict";var i=n(0),r=n(9),o=n(10),s=n(7);n(6)&&i(i.P+n(67),"Object",{__defineGetter__:function(t,e){s.f(r(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";var i=n(0),r=n(9),o=n(10),s=n(7);n(6)&&i(i.P+n(67),"Object",{__defineSetter__:function(t,e){s.f(r(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";var i=n(0),r=n(9),o=n(23),s=n(18),a=n(17).f;n(6)&&i(i.P+n(67),"Object",{__lookupGetter__:function(t){var e,n=r(this),i=o(t,!0);do if(e=a(n,i))return e.get;while(n=s(n))}})},function(t,e,n){"use strict";var i=n(0),r=n(9),o=n(23),s=n(18),a=n(17).f;n(6)&&i(i.P+n(67),"Object",{__lookupSetter__:function(t){var e,n=r(this),i=o(t,!0);do if(e=a(n,i))return e.set;while(n=s(n))}})},function(t,e,n){var i=n(0);i(i.P+i.R,"Map",{toJSON:n(141)("Map")})},function(t,e,n){var i=n(0);i(i.P+i.R,"Set",{toJSON:n(141)("Set")})},function(t,e,n){n(68)("Map")},function(t,e,n){n(68)("Set")},function(t,e,n){n(68)("WeakMap")},function(t,e,n){n(68)("WeakSet")},function(t,e,n){n(69)("Map")},function(t,e,n){n(69)("Set")},function(t,e,n){n(69)("WeakMap")},function(t,e,n){n(69)("WeakSet")},function(t,e,n){var i=n(0);i(i.G,{global:n(2)})},function(t,e,n){var i=n(0);i(i.S,"System",{global:n(2)})},function(t,e,n){var i=n(0),r=n(20);i(i.S,"Error",{isError:function(t){return"Error"===r(t)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{clamp:function(t,e,n){return f(n,u(e,t))}})},function(e,n,i){var r=i(0);r(r.S,"Math",{DEG_PER_RAD:t/180})},function(e,n,i){var r=i(0);r(r.S,"Math",{degrees:function(e){return e*(180/t)}})},function(t,e,n){var i=n(0),r=n(143),o=n(123);i(i.S,"Math",{fscale:function(t,e,n,i,s){return o(r(t,e,n,i,s))}})},function(t,e,n){var i=n(0);i(i.S,"Math",{iaddh:function(t,e,n,i){var r=t>>>0,o=n>>>0;return 0|(e>>>0)+(i>>>0)+((r&o|(r|o)&~(r+o>>>0))>>>31)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{isubh:function(t,e,n,i){var r=t>>>0,o=n>>>0;return 0|(e>>>0)-(i>>>0)-((~r&o|~(r^o)&r-o>>>0)>>>31)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{imulh:function(t,e){var n=+t,i=+e,r=65535&n,o=65535&i,s=n>>16,a=i>>16,l=(s*o>>>0)+(r*o>>>16);return s*a+(l>>16)+((r*a>>>0)+(65535&l)>>16)}})},function(e,n,i){var r=i(0);r(r.S,"Math",{RAD_PER_DEG:180/t})},function(e,n,i){var r=i(0);r(r.S,"Math",{radians:function(e){return e*(t/180)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{scale:n(143)})},function(t,e,n){var i=n(0);i(i.S,"Math",{umulh:function(t,e){var n=+t,i=+e,r=65535&n,o=65535&i,s=n>>>16,a=i>>>16,l=(s*o>>>0)+(r*o>>>16);return s*a+(l>>>16)+((r*a>>>0)+(65535&l)>>>16)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{signbit:function(t){return(t=+t)==t?0==t?1/t==1/0:0arguments.length?void 0:o(arguments[2]),i=s(r(e),n,!1);if(void 0===i||!i["delete"](t))return!1;if(i.size)return!0;var l=a.get(e);return l["delete"](n),!!l.size||a["delete"](e)}})},function(t,e,n){var i=n(29),r=n(1),o=n(18),s=i.has,a=i.get,l=i.key,u=function(t,e,n){if(s(t,e,n))return a(t,e,n);var i=o(e);return null===i?void 0:u(t,i,n)};i.exp({getMetadata:function(t,e){return u(t,r(e),3>arguments.length?void 0:l(arguments[2]))}})},function(t,e,n){var i=n(133),r=n(142),o=n(29),s=n(1),a=n(18),l=o.keys,u=o.key,c=function(t,e){var n=l(t,e),o=a(t);if(null===o)return n;var s=c(o,e);return s.length?n.length?r(new i(n.concat(s))):s:n};o.exp({getMetadataKeys:function(t){return c(s(t),2>arguments.length?void 0:u(arguments[1]))}})},function(t,e,n){var i=n(29),r=n(1),o=i.get,s=i.key;i.exp({getOwnMetadata:function(t,e){return o(t,r(e),3>arguments.length?void 0:s(arguments[2]))}})},function(t,e,n){var i=n(29),r=n(1),o=i.keys,s=i.key;i.exp({getOwnMetadataKeys:function(t){return o(r(t),2>arguments.length?void 0:s(arguments[1]))}})},function(t,e,n){var i=n(29),r=n(1),o=n(18),s=i.has,a=i.key,l=function(t,e,n){if(s(t,e,n))return!0;var i=o(e);return null!==i&&l(t,i,n)};i.exp({hasMetadata:function(t,e){return l(t,r(e),3>arguments.length?void 0:a(arguments[2]))}})},function(t,e,n){var i=n(29),r=n(1),o=i.has,s=i.key;i.exp({hasOwnMetadata:function(t,e){return o(t,r(e),3>arguments.length?void 0:s(arguments[2]))}})},function(t,e,n){var i=n(29),r=n(1),o=n(10),s=i.key,a=i.set;i.exp({metadata:function(t,e){return function(n,i){a(t,e,(void 0===i?o:r)(n),s(i))}}})},function(t,e,n){var i=n(0),r=n(99)(),o=n(2).process,s="process"==n(20)(o);i(i.G,{asap:function(t){var e=s&&o.domain;r(e?e.bind(t):t)}})},function(t,e,n){"use strict";var i=n(0),r=n(2),o=n(22),s=n(99)(),a=n(5)("observable"),l=n(10),u=n(1),c=n(42),h=n(44),f=n(12),d=n(43),p=d.RETURN,g=function(t){return null==t?void 0:l(t)},m=function(t){var e=t._c;e&&(t._c=void 0,e())},v=function(t){return void 0===t._o},y=function(t){v(t)||(t._o=void 0,m(t))},b=function(t,e){u(t),this._c=void 0,this._o=t,t=new w(this);try{var n=e(t),i=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){i.unsubscribe()}:l(n),this._c=n)}catch(e){return void t.error(e)}v(this)&&m(this)};b.prototype=h({},{unsubscribe:function(){y(this)}});var w=function(t){this._s=t};w.prototype=h({},{next:function(t){var e=this._s;if(!v(e)){var n=e._o;try{var i=g(n.next);if(i)return i.call(n,t)}catch(n){try{y(e)}finally{throw n}}}},error:function(t){var e=this._s;if(v(e))throw t;var n=e._o;e._o=void 0;try{var i=g(n.error);if(!i)throw t;t=i.call(n,t)}catch(n){try{m(e)}finally{throw n}}return m(e),t},complete:function(t){var e=this._s;if(!v(e)){var n=e._o;e._o=void 0;try{var i=g(n.complete);t=i?i.call(n,t):void 0}catch(n){try{m(e)}finally{throw n}}return m(e),t}}});var _=function(t){c(this,_,"Observable","_f")._f=l(t)};h(_.prototype,{subscribe:function(t){return new b(t,this._f)},forEach:function(t){var e=this;return new(o.Promise||r.Promise)(function(n,i){l(t);var r=e.subscribe({next:function(t){try{return e(t)}catch(e){i(e),r.unsubscribe()}},error:i,complete:n})})}}),h(_,{from:function(t){var e="function"==typeof this?this:_,n=g(u(t)[a]);if(n){var i=u(n.call(t));return i.constructor===e?i:new e(function(t){return i.subscribe(t)})}return new e(function(t){var e=!1;return s(function(){if(!e){try{if(d(n,!1,function(n){if(t.next(n),e)return p})===p)return}catch(n){if(e)throw n;return void t.error(n)}t.complete()}}),function(){e=!0}})},of:function(){for(var t=0,e=arguments.length,n=Array(e);t0?r(i(t),9007199254740991):0}},function(t,e,n){var i=n(22);t.exports=function(t){return Object(i(t))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var i=n(7),r=n(31);t.exports=n(6)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(2),r=n(12),o=n(11),s=n(32)("src"),a=Function.toString,l=(""+a).split("toString");n(28).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var u="function"==typeof n;u&&(o(n,"name")||r(n,"name",e)),t[e]!==n&&(u&&(o(n,s)||r(n,s,t[e]?""+t[e]:l.join(String(e)))),t===i?t[e]=n:a?t[e]?t[e]=n:r(t,e,n):(delete t[e],r(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(t,e,n){var i=n(0),r=n(3),o=n(22),s=/"/g,a=function(t,e,n,i){var r=String(o(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(i).replace(s,""")+'"'),a+">"+r+""};t.exports=function(t,e){var n={};n[t]=e(a),i(i.P+i.F*r(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e,n){var i=n(46),r=n(22);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(47),r=n(31),o=n(15),s=n(21),a=n(11),l=n(90),u=Object.getOwnPropertyDescriptor;e.f=n(6)?u:function(t,e){if(t=o(t),e=s(e,!0),l)try{return u(t,e)}catch(n){}if(a(t,e))return r(!i.f.call(t,e),t[e])}},function(t,e,n){var i=n(11),r=n(9),o=n(65)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,i){var r=i(10);t.exports=function(t,e,i){if(r(t),e===n)return t;switch(i){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){ -var i=n(3);t.exports=function(t,e){return!!t&&i(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e,n){var i=n(4);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(t==n)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(0),r=n(28),o=n(3);t.exports=function(t,e){var n=(r.Object||{})[t]||Object[t],s={};s[t]=e(n),i(i.S+i.F*o(function(){n(1)}),"Object",s)}},function(t,e,i){var r=i(18),o=i(46),s=i(9),a=i(8),l=i(82);t.exports=function(t,e){var i=1==t,u=2==t,c=3==t,h=4==t,f=6==t,d=5==t||f,p=e||l;return function(e,l,g){for(var m,v,y=s(e),b=o(y),w=r(l,g,3),_=a(b.length),x=0,S=i?p(e,_):u?p(e,0):n;_>x;x++)if((d||x in b)&&(m=b[x],v=w(m,x,y),t))if(i)S[x]=v;else if(v)switch(t){case 3:return!0;case 5:return m;case 6:return x;case 2:S.push(m)}else if(h)return!1;return f?-1:c||h?h:S}}},function(t,e,i){if(i(6)){var r=i(33),o=i(2),s=i(3),a=i(0),l=i(59),u=i(88),c=i(18),h=i(39),f=i(31),d=i(12),p=i(41),g=i(23),m=i(8),v=i(117),y=i(35),b=i(21),w=i(11),_=i(48),x=i(4),S=i(9),k=i(79),C=i(36),T=i(17),E=i(37).f,P=i(81),O=i(32),M=i(5),A=i(25),D=i(50),L=i(57),I=i(84),R=i(44),N=i(54),z=i(38),j=i(83),$=i(106),H=i(7),F=i(16),W=H.f,B=F.f,U=o.RangeError,q=o.TypeError,Y=o.Uint8Array,V="prototype",G=Array[V],K=u.ArrayBuffer,X=u.DataView,J=A(0),Z=A(2),Q=A(3),tt=A(4),et=A(5),nt=A(6),it=D(!0),rt=D(!1),ot=I.values,st=I.keys,at=I.entries,lt=G.lastIndexOf,ut=G.reduce,ct=G.reduceRight,ht=G.join,ft=G.sort,dt=G.slice,pt=G.toString,gt=G.toLocaleString,mt=M("iterator"),vt=M("toStringTag"),yt=O("typed_constructor"),bt=O("def_constructor"),wt=l.CONSTR,_t=l.TYPED,xt=l.VIEW,St="Wrong length!",kt=A(1,function(t,e){return Ot(L(t,t[bt]),e)}),Ct=s(function(){return 1===new Y(new Uint16Array([1]).buffer)[0]}),Tt=!!Y&&!!Y[V].set&&s(function(){new Y(1).set({})}),Et=function(t,e){var n=g(t);if(n<0||n%e)throw U("Wrong offset!");return n},Pt=function(t){if(x(t)&&_t in t)return t;throw q(t+" is not a typed array!")},Ot=function(t,e){if(!(x(t)&&yt in t))throw q("It is not a typed array constructor!");return new t(e)},Mt=function(t,e){return At(L(t,t[bt]),e)},At=function(t,e){for(var n=0,i=e.length,r=Ot(t,i);i>n;)r[n]=e[n++];return r},Dt=function(t,e,n){W(t,e,{get:function(){return this._d[n]}})},Lt=function(t){var e,i,r,o,s,a,l=S(t),u=arguments.length,h=u>1?arguments[1]:n,f=h!==n,d=P(l);if(d!=n&&!k(d)){for(a=d.call(l),r=[],e=0;!(s=a.next()).done;e++)r.push(s.value);l=r}for(f&&u>2&&(h=c(h,arguments[2],2)),e=0,i=m(l.length),o=Ot(this,i);i>e;e++)o[e]=f?h(l[e],e):l[e];return o},It=function(){for(var t=0,e=arguments.length,n=Ot(this,e);e>t;)n[t]=arguments[t++];return n},Rt=!!Y&&s(function(){gt.call(new Y(1))}),Nt=function(){return gt.apply(Rt?dt.call(Pt(this)):Pt(this),arguments)},zt={copyWithin:function(t,e){return $.call(Pt(this),t,e,arguments.length>2?arguments[2]:n)},every:function(t){return tt(Pt(this),t,arguments.length>1?arguments[1]:n)},fill:function(t){return j.apply(Pt(this),arguments)},filter:function(t){return Mt(this,Z(Pt(this),t,arguments.length>1?arguments[1]:n))},find:function(t){return et(Pt(this),t,arguments.length>1?arguments[1]:n)},findIndex:function(t){return nt(Pt(this),t,arguments.length>1?arguments[1]:n)},forEach:function(t){J(Pt(this),t,arguments.length>1?arguments[1]:n)},indexOf:function(t){return rt(Pt(this),t,arguments.length>1?arguments[1]:n)},includes:function(t){return it(Pt(this),t,arguments.length>1?arguments[1]:n)},join:function(t){return ht.apply(Pt(this),arguments)},lastIndexOf:function(t){return lt.apply(Pt(this),arguments)},map:function(t){return kt(Pt(this),t,arguments.length>1?arguments[1]:n)},reduce:function(t){return ut.apply(Pt(this),arguments)},reduceRight:function(t){return ct.apply(Pt(this),arguments)},reverse:function(){for(var t,e=Pt(this).length,n=Math.floor(e/2),i=0;i1?arguments[1]:n)},sort:function(t){return ft.call(Pt(this),t)},subarray:function(t,e){var i=Pt(this),r=i.length,o=y(t,r);return new(L(i,i[bt]))(i.buffer,i.byteOffset+o*i.BYTES_PER_ELEMENT,m((e===n?r:y(e,r))-o))}},jt=function(t,e){return Mt(this,dt.call(Pt(this),t,e))},$t=function(t){Pt(this);var e=Et(arguments[1],1),n=this.length,i=S(t),r=m(i.length),o=0;if(r+e>n)throw U(St);for(;o255?255:255&i),r.v[p](n*e+r.o,i,Ct)}(this,n,t)},enumerable:!0})};g&&l.ABV?s(function(){g(1)})&&s(function(){new g((-1))})&&N(function(t){new g,new g(null),new g(1.5),new g(t)},!0)||(g=i(function(t,i,r,o){h(t,g,c);var s;return x(i)?i instanceof K||"ArrayBuffer"==(s=_(i))||"SharedArrayBuffer"==s?o!==n?new y(i,Et(r,e),o):r!==n?new y(i,Et(r,e)):new y(i):_t in i?At(g,i):Lt.call(g,i):new y(v(i))}),J(b!==Function.prototype?E(y).concat(E(b)):E(y),function(t){t in g||d(g,t,y[t])}),g[V]=S,r||(S.constructor=g)):(g=i(function(t,i,r,o){h(t,g,c,"_d");var s,a,l,u,f=0,p=0;if(x(i)){if(!(i instanceof K||"ArrayBuffer"==(u=_(i))||"SharedArrayBuffer"==u))return _t in i?At(g,i):Lt.call(g,i);s=i,p=Et(r,e);var y=i.byteLength;if(o===n){if(y%e)throw U(St);if((a=y-p)<0)throw U(St)}else if((a=m(o)*e)+p>y)throw U(St);l=a/e}else l=v(i),s=new K(a=l*e);for(d(t,"_d",{b:s,o:p,l:a,e:l,v:new X(s)});fdocument.F=Object"),t.close(),u=t.F;n--;)delete u.prototype[s[n]];return u()};t.exports=Object.create||function(t,e){var i;return null!==t?(l.prototype=r(t),i=new l,l.prototype=null,i[a]=t):i=u(),e===n?i:o(i,e)}},function(t,e,n){var i=n(92),r=n(66).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},function(t,e,n){var i=n(2),r=n(7),o=n(6),s=n(5)("species");t.exports=function(t){var e=i[t];o&&e&&!e[s]&&r.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,i,r){if(!(t instanceof e)||r!==n&&r in t)throw TypeError(i+": incorrect invocation!");return t}},function(t,e,n){var i=n(18),r=n(104),o=n(79),s=n(1),a=n(8),l=n(81),u={},c={};(e=t.exports=function(t,e,n,h,f){var d,p,g,m,v=f?function(){return t}:l(t),y=i(n,h,e?2:1),b=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(d=a(t.length);d>b;b++)if((m=e?y(s(p=t[b])[0],p[1]):y(t[b]))===u||m===c)return m}else for(g=v.call(t);!(p=g.next()).done;)if((m=r(g,y,p.value,e))===u||m===c)return m}).BREAK=u,e.RETURN=c},function(t,e,n){var i=n(13);t.exports=function(t,e,n){for(var r in e)i(t,r,e[r],n);return t}},function(t,e,n){var i=n(7).f,r=n(11),o=n(5)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i=n(0),r=n(22),o=n(3),s=n(70),a="["+s+"]",l=RegExp("^"+a+a+"*"),u=RegExp(a+a+"*$"),c=function(t,e,n){var r={},a=o(function(){return!!s[t]()||"​…"!="​…"[t]()}),l=r[t]=a?e(h):s[t];n&&(r[n]=l),i(i.P+i.F*a,"String",r)},h=c.trim=function(t,e){return t=String(r(t)),1&e&&(t=t.replace(l,"")),2&e&&(t=t.replace(u,"")),t};t.exports=c},function(t,e){t.exports={}},function(t,e,n){var i=n(4);t.exports=function(t,e){if(!i(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){var i=n(19);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var r=i(19),o=i(5)("toStringTag"),s="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,i,a;return t===n?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(n){}}(e=Object(t),o))?i:s?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var i=n(2),r=i["__core-js_shared__"]||(i["__core-js_shared__"]={});t.exports=function(t){return r[t]||(r[t]={})}},function(t,e,n){var i=n(15),r=n(8),o=n(35);t.exports=function(t){return function(e,n,s){var a,l=i(e),u=r(l.length),c=o(s,u);if(t&&n!=n){for(;u>c;)if((a=l[c++])!=a)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var i=n(19);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,i){var r=i(4),o=i(19),s=i(5)("match");t.exports=function(t){var e;return r(t)&&((e=t[s])!==n?!!e:"RegExp"==o(t))}},function(t,e,n){var i=n(5)("iterator"),r=!1;try{var o=[7][i]();o["return"]=function(){r=!0},Array.from(o,function(){throw 2})}catch(s){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var o=[7],s=o[i]();s.next=function(){return{done:n=!0}},o[i]=function(){return s},t(o)}catch(a){}return n}},function(t,e,n){var i=n(1);t.exports=function(){var t=i(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){var i=n(12),r=n(13),o=n(3),s=n(22),a=n(5);t.exports=function(t,e,n){var l=a(t),u=n(s,l,""[t]),c=u[0],h=u[1];o(function(){var e={};return e[l]=function(){return 7},7!=""[t](e)})&&(r(String.prototype,t,c),i(RegExp.prototype,l,2==e?function(t,e){return h.call(t,this,e)}:function(t){return h.call(t,this)}))}},function(t,e,i){var r=i(1),o=i(10),s=i(5)("species");t.exports=function(t,e){var i,a=r(t).constructor;return a===n||(i=r(a)[s])==n?e:o(i)}},function(t,e,i){var r=i(2),o=i(0),s=i(13),a=i(41),l=i(29),u=i(40),c=i(39),h=i(4),f=i(3),d=i(54),p=i(42),g=i(69);t.exports=function(t,e,i,m,v,y){var b=r[t],w=b,_=v?"set":"add",x=w&&w.prototype,S={},k=function(t){var e=x[t];s(x,t,"delete"==t?function(t){return!(y&&!h(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!h(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!h(t)?n:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof w&&(y||x.forEach&&!f(function(){(new w).entries().next()}))){var C=new w,T=C[_](y?{}:-0,1)!=C,E=f(function(){C.has(1)}),P=d(function(t){new w(t)}),O=!y&&f(function(){for(var t=new w,e=5;e--;)t[_](e,e);return!t.has(-0)});P||((w=e(function(e,i){c(e,w,t);var r=g(new b,e,w);return i!=n&&u(i,v,r[_],r),r})).prototype=x,x.constructor=w),(E||O)&&(k("delete"),k("has"),v&&k("get")),(O||T)&&k(_),y&&x.clear&&delete x.clear}else w=m.getConstructor(e,t,v,_),a(w.prototype,i),l.NEED=!0;return p(w,t),S[t]=w,o(o.G+o.W+o.F*(w!=b),S),y||m.setStrong(w,t,v),w}},function(t,e,n){for(var i,r=n(2),o=n(12),s=n(32),a=s("typed_array"),l=s("view"),u=!(!r.ArrayBuffer||!r.DataView),c=u,h=0,f="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");h<9;)(i=r[f[h++]])?(o(i.prototype,a,!0),o(i.prototype,l,!0)):c=!1;t.exports={ABV:u,CONSTR:c,TYPED:a,VIEW:l}},function(t,e,n){t.exports=n(33)||!n(3)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete n(2)[t]})},function(t,e,n){var i=n(0);t.exports=function(t){i(i.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,i){var r=i(0),o=i(10),s=i(18),a=i(40);t.exports=function(t){r(r.S,t,{from:function(t){var e,i,r,l,u=arguments[1];return o(this),(e=u!==n)&&o(u),t==n?new this:(i=[],e?(r=0,l=s(u,arguments[2],2),a(t,!1,function(t){i.push(l(t,r++))})):a(t,!1,i.push,i),new this(i))}})}},function(t,e,n){var i=n(4),r=n(2).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e,n){var i=n(2),r=n(28),o=n(33),s=n(91),a=n(7).f;t.exports=function(t){var e=r.Symbol||(r.Symbol=o?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){var i=n(49)("keys"),r=n(32);t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(2).document;t.exports=i&&i.documentElement},function(t,e,i){var r=i(4),o=i(1),s=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{(n=i(18)(Function.call,i(16).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(r){e=!0}return function(t,i){return s(t,i),e?t.__proto__=i:n(t,i),t}}({},!1):n),check:s}},function(t,e,n){var i=n(4),r=n(68).set;t.exports=function(t,e,n){var o,s=e.constructor;return s!==n&&"function"==typeof s&&(o=s.prototype)!==n.prototype&&i(o)&&r&&r(t,o),t}},function(t,e){t.exports="\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,n){var i=n(23),r=n(22);t.exports=function(t){var e=String(r(this)),n="",o=i(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},function(t,e,i){var r=i(23),o=i(22);t.exports=function(t){return function(e,i){var s,a,l=String(o(e)),u=r(i),c=l.length;return u<0||u>=c?t?"":n:(s=l.charCodeAt(u))<55296||s>56319||u+1===c||(a=l.charCodeAt(u+1))<56320||a>57343?t?l.charAt(u):s:t?l.slice(u,u+2):a-56320+(s-55296<<10)+65536}}},function(t,e,n){var i=n(53),r=n(22);t.exports=function(t,e,n){if(i(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(r(t))}},function(t,e,n){var i=n(5)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[i]=!1,!"/./"[t](e)}catch(r){}}return!0}},function(t,e,i){var r=i(33),o=i(0),s=i(13),a=i(12),l=i(11),u=i(44),c=i(78),h=i(42),f=i(17),d=i(5)("iterator"),p=!([].keys&&"next"in[].keys()),g=function(){return this};t.exports=function(t,e,i,m,v,y,b){c(i,e,m);var w,_,x,S=function(t){if(!p&&t in E)return E[t];switch(t){case"keys":return function(){return new i(this,t)};case"values":return function(){return new i(this,t)}}return function(){return new i(this,t)}},k=e+" Iterator",C="values"==v,T=!1,E=t.prototype,P=E[d]||E["@@iterator"]||v&&E[v],O=!p&&P||S(v),M=v?C?S("entries"):O:n,A="Array"==e?E.entries||P:P;if(A&&(x=f(A.call(new t)))!==Object.prototype&&x.next&&(h(x,k,!0),r||l(x,d)||a(x,d,g)),C&&P&&"values"!==P.name&&(T=!0,O=function(){return P.call(this)}),r&&!b||!p&&!T&&E[d]||a(E,d,O),u[e]=O,u[k]=g,v)if(w={values:C?O:S("values"),keys:y?O:S("keys"),entries:M},b)for(_ in w)_ in E||s(E,_,w[_]);else o(o.P+o.F*(p||T),e,w);return w}},function(t,e,n){var i=n(36),r=n(31),o=n(42),s={};n(12)(s,n(5)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(s,{next:r(1,n)}),o(t,e+" Iterator")}},function(t,e,i){var r=i(44),o=i(5)("iterator"),s=Array.prototype;t.exports=function(t){return t!==n&&(r.Array===t||s[o]===t)}},function(t,e,n){var i=n(7),r=n(31);t.exports=function(t,e,n){e in t?i.f(t,e,r(0,n)):t[e]=n}},function(t,e,i){var r=i(48),o=i(5)("iterator"),s=i(44);t.exports=i(28).getIteratorMethod=function(t){if(t!=n)return t[o]||t["@@iterator"]||s[r(t)]}},function(t,e,n){var i=n(208);t.exports=function(t,e){return new(i(t))(e)}},function(t,e,i){var r=i(9),o=i(35),s=i(8);t.exports=function(t){for(var e=r(this),i=s(e.length),a=arguments.length,l=o(a>1?arguments[1]:n,i),u=a>2?arguments[2]:n,c=u===n?i:o(u,i);c>l;)e[l++]=t;return e}},function(t,e,i){var r=i(30),o=i(107),s=i(44),a=i(15);t.exports=i(77)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,i=this._i++;return!t||i>=t.length?(this._t=n,o(1)):o(0,"keys"==e?i:"values"==e?t[i]:[i,t[i]])},"values"),s.Arguments=s.Array,r("keys"),r("values"),r("entries")},function(t,e,n){var i,r,o,s=n(18),a=n(97),l=n(67),u=n(63),c=n(2),h=c.process,f=c.setImmediate,d=c.clearImmediate,p=c.MessageChannel,g=c.Dispatch,m=0,v={},y=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},b=function(t){y.call(t.data)};f&&d||(f=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return v[++m]=function(){a("function"==typeof t?t:Function(t),e)},i(m),m},d=function(t){delete v[t]},"process"==n(19)(h)?i=function(t){h.nextTick(s(y,t,1))}:g&&g.now?i=function(t){g.now(s(y,t,1))}:p?(o=(r=new p).port2,r.port1.onmessage=b,i=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(i=function(t){c.postMessage(t+"","*")},c.addEventListener("message",b,!1)):i="onreadystatechange"in u("script")?function(t){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),y.call(t)}}:function(t){setTimeout(s(y,t,1),0)}),t.exports={set:f,clear:d}},function(t,e,i){var r=i(2),o=i(85).set,s=r.MutationObserver||r.WebKitMutationObserver,a=r.process,l=r.Promise,u="process"==i(19)(a);t.exports=function(){var t,e,i,c=function(){var r,o;for(u&&(r=a.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(s){throw t?i():e=n,s}}e=n,r&&r.enter()};if(u)i=function(){a.nextTick(c)};else if(!s||r.navigator&&r.navigator.standalone)if(l&&l.resolve){var h=l.resolve();i=function(){h.then(c)}}else i=function(){o.call(r,c)};else{var f=!0,d=document.createTextNode("");new s(c).observe(d,{characterData:!0}),i=function(){d.data=f=!f}}return function(r){var o={fn:r,next:n};e&&(e.next=o),t||(t=o,i()),e=o}}},function(t,e,i){var r=i(10);t.exports.f=function(t){return new function(t){var e,i;this.promise=new t(function(t,r){if(e!==n||i!==n)throw TypeError("Bad Promise constructor");e=t,i=r}),this.resolve=r(e),this.reject=r(i)}(t)}},function(t,e,i){function r(t,e,n){var i,r,o,s=new Array(n),a=8*n-e-1,l=(1<>1,c=23===e?F(2,-24)-F(2,-77):0,h=0,f=t<0||0===t&&1/t<0?1:0;for((t=H(t))!=t||t===j?(r=t!=t?1:0,i=l):(i=W(B(t)/U),t*(o=F(2,-i))<1&&(i--,o*=2),(t+=i+u>=1?c/o:c*F(2,1-u))*o>=2&&(i++,o/=2),i+u>=l?(r=0,i=l):i+u>=1?(r=(t*o-1)*F(2,e),i+=u):(r=t*F(2,u-1)*F(2,e),i=0));e>=8;s[h++]=255&r,r/=256,e-=8);for(i=i<0;s[h++]=255&i,i/=256,a-=8);return s[--h]|=128*f,s}function o(t,e,n){var i,r=8*n-e-1,o=(1<>1,a=r-7,l=n-1,u=t[l--],c=127&u;for(u>>=7;a>0;c=256*c+t[l],l--,a-=8);for(i=c&(1<<-a)-1,c>>=-a,a+=e;a>0;i=256*i+t[l],l--,a-=8);if(0===c)c=1-s;else{if(c===o)return i?NaN:u?-j:j;i+=F(2,e),c-=s}return(u?-1:1)*i*F(2,c-e)}function s(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function a(t){return[255&t]}function l(t){return[255&t,t>>8&255]}function u(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function c(t){return r(t,52,8)}function h(t){return r(t,23,4)}function f(t,e,n){E(t[D],e,{get:function(){return this[n]}})}function d(t,e,n,i){var r=C(+n);if(r+e>t[Y])throw z(L);var o=r+t[V],s=t[q]._b.slice(o,o+e);return i?s:s.reverse()}function p(t,e,n,i,r,o){var s=C(+n);if(s+e>t[Y])throw z(L);for(var a=t[q]._b,l=s+t[V],u=i(+r),c=0;cJ;)(G=X[J++])in I||b(I,G,$[G]);v||(K.constructor=I)}var Z=new R(new I(2)),Q=R[D].setInt8;Z.setInt8(0,2147483648),Z.setInt8(1,2147483649),!Z.getInt8(0)&&Z.getInt8(1)||w(R[D],{setInt8:function(t,e){Q.call(this,t,e<<24>>24)},setUint8:function(t,e){Q.call(this,t,e<<24>>24)}},!0)}else I=function(t){x(this,I,M);var e=C(t);this._b=P.call(new Array(e),0),this[Y]=e},R=function(t,e,i){x(this,R,A),x(t,I,A);var r=t[Y],o=S(e);if(o<0||o>r)throw z("Wrong offset!");if(i=i===n?r-o:k(i),o+i>r)throw z("Wrong length!");this[q]=t,this[V]=o,this[Y]=i},m&&(f(I,"byteLength","_l"),f(R,"buffer","_b"),f(R,"byteLength","_l"),f(R,"byteOffset","_o")),w(R[D],{getInt8:function(t){return d(this,1,t)[0]<<24>>24},getUint8:function(t){return d(this,1,t)[0]},getInt16:function(t){var e=d(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=d(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return s(d(this,4,t,arguments[1]))},getUint32:function(t){return s(d(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return o(d(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return o(d(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){p(this,1,t,a,e)},setUint8:function(t,e){p(this,1,t,a,e)},setInt16:function(t,e){p(this,2,t,l,e,arguments[2])},setUint16:function(t,e){p(this,2,t,l,e,arguments[2])},setInt32:function(t,e){p(this,4,t,u,e,arguments[2])},setUint32:function(t,e){p(this,4,t,u,e,arguments[2])},setFloat32:function(t,e){p(this,4,t,h,e,arguments[2])},setFloat64:function(t,e){p(this,8,t,c,e,arguments[2])}});O(I,M),O(R,A),b(R[D],y.VIEW,!0),e[M]=I,e[A]=R},function(t,e,n){var i=n(2).navigator;t.exports=i&&i.userAgent||""},function(t,e,n){t.exports=!n(6)&&!n(3)(function(){return 7!=Object.defineProperty(n(63)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){e.f=n(5)},function(t,e,n){var i=n(11),r=n(15),o=n(50)(!1),s=n(65)("IE_PROTO");t.exports=function(t,e){var n,a=r(t),l=0,u=[];for(n in a)n!=s&&i(a,n)&&u.push(n);for(;e.length>l;)i(a,n=e[l++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var i=n(7),r=n(1),o=n(34);t.exports=n(6)?Object.defineProperties:function(t,e){r(t);for(var n,s=o(e),a=s.length,l=0;a>l;)i.f(t,n=s[l++],e[n]);return t}},function(t,e,n){var i=n(15),r=n(37).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?function(t){try{return r(t)}catch(e){return s.slice()}}(t):r(i(t))}},function(t,e,n){var i=n(34),r=n(51),o=n(47),s=n(9),a=n(46),l=Object.assign;t.exports=!l||n(3)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=l({},t)[n]||Object.keys(l({},e)).join("")!=i})?function(t,e){for(var n=s(t),l=arguments.length,u=1,c=r.f,h=o.f;l>u;)for(var f,d=a(arguments[u++]),p=c?i(d).concat(c(d)):i(d),g=p.length,m=0;g>m;)h.call(d,f=p[m++])&&(n[f]=d[f]);return n}:l},function(t,e,n){var i=n(10),r=n(4),o=n(97),s=[].slice,a={};t.exports=Function.bind||function(t){var e=i(this),n=s.call(arguments,1),l=function(){var i=n.concat(s.call(arguments));return this instanceof l?function(t,e,n){if(!(e in a)){for(var i=[],r=0;r>>0||(s.test(n)?16:10))}:i},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,n){var i=n(72),r=Math.pow,o=r(2,-52),s=r(2,-23),a=r(2,127)*(2-s),l=r(2,-126);t.exports=Math.fround||function(t){var e,n,r=Math.abs(t),u=i(t);return ra||n!=n?u*(1/0):u*n)}},function(t,e,i){var r=i(1);t.exports=function(t,e,i,o){try{return o?e(r(i)[0],i[1]):e(i)}catch(s){var a=t["return"];throw a!==n&&r(a.call(t)),s}}},function(t,e,n){var i=n(10),r=n(9),o=n(46),s=n(8);t.exports=function(t,e,n,a,l){i(e);var u=r(t),c=o(u),h=s(u.length),f=l?h-1:0,d=l?-1:1;if(n<2)for(;;){if(f in c){a=c[f],f+=d;break}if(f+=d,l?f<0:h<=f)throw TypeError("Reduce of empty array with no initial value")}for(;l?f>=0:h>f;f+=d)f in c&&(a=e(a,c[f],f,u));return a}},function(t,e,i){var r=i(9),o=i(35),s=i(8);t.exports=[].copyWithin||function(t,e){var i=r(this),a=s(i.length),l=o(t,a),u=o(e,a),c=arguments.length>2?arguments[2]:n,h=Math.min((c===n?a:o(c,a))-u,a-l),f=1;for(u0;)u in i?i[l]=i[u]:delete i[l],l+=f,u+=f;return i}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){n(6)&&"g"!=/./g.flags&&n(7).f(RegExp.prototype,"flags",{configurable:!0,get:n(55)})},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(e){return{e:!0,v:e}}}},function(t,e,n){var i=n(1),r=n(4),o=n(87);t.exports=function(t,e){if(i(t),r(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,i){var r=i(112),o=i(45);t.exports=i(58)("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:n)}},{get:function(t){var e=r.getEntry(o(this,"Map"),t);return e&&e.v},set:function(t,e){return r.def(o(this,"Map"),0===t?0:t,e)}},r,!0)},function(t,e,i){var r=i(7).f,o=i(36),s=i(41),a=i(18),l=i(39),u=i(40),c=i(77),h=i(107),f=i(38),d=i(6),p=i(29).fastKey,g=i(45),m=d?"_s":"size",v=function(t,e){var n,i=p(e);if("F"!==i)return t._i[i];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,i,c){var h=t(function(t,r){l(t,h,e,"_i"),t._t=e,t._i=o(null),t._f=n,t._l=n,t[m]=0,r!=n&&u(r,i,t[c],t)});return s(h.prototype,{clear:function(){for(var t=g(this,e),i=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=n),delete i[r.i];t._f=t._l=n,t[m]=0},"delete":function(t){var n=g(this,e),i=v(n,t);if(i){var r=i.n,o=i.p;delete n._i[i.i],i.r=!0,o&&(o.n=r),r&&(r.p=o),n._f==i&&(n._f=r),n._l==i&&(n._l=o),n[m]--}return!!i},forEach:function(t){g(this,e);for(var i,r=a(t,arguments.length>1?arguments[1]:n,3);i=i?i.n:this._f;)for(r(i.v,i.k,this);i&&i.r;)i=i.p},has:function(t){return!!v(g(this,e),t)}}),d&&r(h.prototype,"size",{get:function(){return g(this,e)[m]}}),h},def:function(t,e,i){var r,o,s=v(t,e);return s?s.v=i:(t._l=s={i:o=p(e,!0),k:e,v:i,p:r=t._l,n:n,r:!1},t._f||(t._f=s),r&&(r.n=s),t[m]++,"F"!==o&&(t._i[o]=s)),t},getEntry:v,setStrong:function(t,e,i){c(t,e,function(t,i){this._t=g(t,e),this._k=i,this._l=n},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?h(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=n,h(1))},i?"entries":"values",!i,!0),f(e)}}},function(t,e,i){var r=i(112),o=i(45);t.exports=i(58)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:n)}},{add:function(t){return r.def(o(this,"Set"),t=0===t?0:t,t)}},r)},function(t,e,i){var r,o=i(25)(0),s=i(13),a=i(29),l=i(95),u=i(115),c=i(4),h=i(3),f=i(45),d=a.getWeak,p=Object.isExtensible,g=u.ufstore,m={},v=function(t){return function(){return t(this,arguments.length>0?arguments[0]:n)}},y={get:function(t){if(c(t)){var e=d(t);return!0===e?g(f(this,"WeakMap")).get(t):e?e[this._i]:n}},set:function(t,e){return u.def(f(this,"WeakMap"),t,e)}},b=t.exports=i(58)("WeakMap",v,y,u,!0,!0);h(function(){return 7!=(new b).set((Object.freeze||Object)(m),7).get(m)})&&(l((r=u.getConstructor(v,"WeakMap")).prototype,y),a.NEED=!0,o(["delete","has","get","set"],function(t){var e=b.prototype,n=e[t];s(e,t,function(e,i){if(c(e)&&!p(e)){this._f||(this._f=new r);var o=this._f[t](e,i);return"set"==t?this:o}return n.call(this,e,i)})}))},function(t,e,i){var r=i(41),o=i(29).getWeak,s=i(1),a=i(4),l=i(39),u=i(40),c=i(25),h=i(11),f=i(45),d=c(5),p=c(6),g=0,m=function(t){return t._l||(t._l=new v); -},v=function(){this.a=[]},y=function(t,e){return d(t.a,function(t){return t[0]===e})};v.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var n=y(this,t);n?n[1]=e:this.a.push([t,e])},"delete":function(t){var e=p(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,i,s){var c=t(function(t,r){l(t,c,e,"_i"),t._t=e,t._i=g++,t._l=n,r!=n&&u(r,i,t[s],t)});return r(c.prototype,{"delete":function(t){if(!a(t))return!1;var n=o(t);return!0===n?m(f(this,e))["delete"](t):n&&h(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=o(t);return!0===n?m(f(this,e)).has(t):n&&h(n,this._i)}}),c},def:function(t,e,n){var i=o(s(e),!0);return!0===i?m(t).set(e,n):i[t._i]=n,t},ufstore:m}},function(t,e,n){var i=n(37),r=n(51),o=n(1),s=n(2).Reflect;t.exports=s&&s.ownKeys||function(t){var e=i.f(o(t)),n=r.f;return n?e.concat(n(t)):e}},function(t,e,i){var r=i(23),o=i(8);t.exports=function(t){if(t===n)return 0;var e=r(t),i=o(e);if(e!==i)throw RangeError("Wrong length!");return i}},function(t,e,i){function r(t,e,i,c,h,f,d,p){for(var g,m,v=h,y=0,b=!!d&&l(d,p,3);y0)v=r(t,e,g,a(g.length),v,f-1)-1;else{if(v>=9007199254740991)throw TypeError();t[v]=g}v++}y++}return v}var o=i(52),s=i(4),a=i(8),l=i(18),u=i(5)("isConcatSpreadable");t.exports=r},function(t,e,i){var r=i(8),o=i(71),s=i(22);t.exports=function(t,e,i,a){var l=String(s(t)),u=l.length,c=i===n?" ":String(i),h=r(e);if(h<=u||""==c)return l;var f=h-u,d=o.call(c,Math.ceil(f/c.length));return d.length>f&&(d=d.slice(0,f)),a?d+l:l+d}},function(t,e,n){var i=n(34),r=n(15),o=n(47).f;t.exports=function(t){return function(e){for(var n,s=r(e),a=i(s),l=a.length,u=0,c=[];l>u;)o.call(s,n=a[u++])&&c.push(t?[n,s[n]]:s[n]);return c}}},function(t,e,n){var i=n(48),r=n(122);t.exports=function(t){return function(){if(i(this)!=t)throw TypeError(t+"#toJSON isn't generic");return r(this)}}},function(t,e,n){var i=n(40);t.exports=function(t,e){var n=[];return i(t,!1,n.push,n,e),n}},function(t,e){t.exports=Math.scale||function(t,e,n,i,r){return 0===arguments.length||t!=t||e!=e||n!=n||i!=i||r!=r?NaN:t===1/0||t===-(1/0)?t:(t-e)*(r-i)/(n-e)+i}},function(t,e,n){n(125),n(127),n(128),n(129),n(130),n(131),n(132),n(133),n(134),n(135),n(136),n(137),n(138),n(139),n(140),n(141),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167),n(168),n(169),n(170),n(171),n(172),n(173),n(174),n(175),n(176),n(177),n(178),n(179),n(180),n(181),n(182),n(183),n(184),n(185),n(186),n(187),n(188),n(189),n(190),n(191),n(192),n(193),n(194),n(195),n(196),n(197),n(198),n(199),n(200),n(201),n(202),n(203),n(204),n(205),n(206),n(207),n(209),n(210),n(211),n(212),n(213),n(214),n(215),n(216),n(217),n(218),n(219),n(220),n(84),n(221),n(222),n(223),n(108),n(224),n(225),n(226),n(227),n(228),n(111),n(113),n(114),n(229),n(230),n(231),n(232),n(233),n(234),n(235),n(236),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(248),n(249),n(251),n(252),n(253),n(254),n(255),n(256),n(257),n(258),n(259),n(260),n(261),n(262),n(263),n(264),n(265),n(266),n(267),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276),n(277),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),n(288),n(289),n(290),n(291),n(292),n(293),n(294),n(295),n(296),n(297),n(298),n(299),n(300),n(301),n(302),n(303),n(304),n(305),n(306),n(307),n(308),n(309),n(310),n(311),n(312),n(313),n(314),n(315),n(316),n(317),n(318),n(319),t.exports=n(320)},function(t,e,i){var r=i(2),o=i(11),s=i(6),a=i(0),l=i(13),u=i(29).KEY,c=i(3),h=i(49),f=i(42),d=i(32),p=i(5),g=i(91),m=i(64),v=i(126),y=i(52),b=i(1),w=i(4),_=i(15),x=i(21),S=i(31),k=i(36),C=i(94),T=i(16),E=i(7),P=i(34),O=T.f,M=E.f,A=C.f,D=r.Symbol,L=r.JSON,I=L&&L.stringify,R="prototype",N=p("_hidden"),z=p("toPrimitive"),j={}.propertyIsEnumerable,$=h("symbol-registry"),H=h("symbols"),F=h("op-symbols"),W=Object[R],B="function"==typeof D,U=r.QObject,q=!U||!U[R]||!U[R].findChild,Y=s&&c(function(){return 7!=k(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=O(W,e);i&&delete W[e],M(t,e,n),i&&t!==W&&M(W,e,i)}:M,V=function(t){var e=H[t]=k(D[R]);return e._k=t,e},G=B&&"symbol"==typeof D.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof D},K=function(t,e,n){return t===W&&K(F,e,n),b(t),e=x(e,!0),b(n),o(H,e)?(n.enumerable?(o(t,N)&&t[N][e]&&(t[N][e]=!1),n=k(n,{enumerable:S(0,!1)})):(o(t,N)||M(t,N,S(1,{})),t[N][e]=!0),Y(t,e,n)):M(t,e,n)},X=function(t,e){b(t);for(var n,i=v(e=_(e)),r=0,o=i.length;o>r;)K(t,n=i[r++],e[n]);return t},J=function(t){var e=j.call(this,t=x(t,!0));return!(this===W&&o(H,t)&&!o(F,t))&&(!(e||!o(this,t)||!o(H,t)||o(this,N)&&this[N][t])||e)},Z=function(t,e){if(t=_(t),e=x(e,!0),t!==W||!o(H,e)||o(F,e)){var n=O(t,e);return!n||!o(H,e)||o(t,N)&&t[N][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=A(_(t)),i=[],r=0;n.length>r;)o(H,e=n[r++])||e==N||e==u||i.push(e);return i},tt=function(t){for(var e,n=t===W,i=A(n?F:_(t)),r=[],s=0;i.length>s;)!o(H,e=i[s++])||n&&!o(W,e)||r.push(H[e]);return r};B||(l((D=function(){if(this instanceof D)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:n),e=function(n){this===W&&e.call(F,n),o(this,N)&&o(this[N],t)&&(this[N][t]=!1),Y(this,t,S(1,n))};return s&&q&&Y(W,t,{configurable:!0,set:e}),V(t)})[R],"toString",function(){return this._k}),T.f=Z,E.f=K,i(37).f=C.f=Q,i(47).f=J,i(51).f=tt,s&&!i(33)&&l(W,"propertyIsEnumerable",J,!0),g.f=function(t){return V(p(t))}),a(a.G+a.W+a.F*!B,{Symbol:D});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)p(et[nt++]);for(var it=P(p.store),rt=0;it.length>rt;)m(it[rt++]);a(a.S+a.F*!B,"Symbol",{"for":function(t){return o($,t+="")?$[t]:$[t]=D(t)},keyFor:function(t){if(!G(t))throw TypeError(t+" is not a symbol!");for(var e in $)if($[e]===t)return e},useSetter:function(){q=!0},useSimple:function(){q=!1}}),a(a.S+a.F*!B,"Object",{create:function(t,e){return e===n?k(t):X(k(t),e)},defineProperty:K,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:tt}),L&&a(a.S+a.F*(!B||c(function(){var t=D();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))})),"JSON",{stringify:function(t){for(var e,i,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(i=e=r[1],(w(e)||t!==n)&&!G(t))return y(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!G(e))return e}),r[1]=e,I.apply(L,r)}}),D[R][z]||i(12)(D[R],z,D[R].valueOf),f(D,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},function(t,e,n){var i=n(34),r=n(51),o=n(47);t.exports=function(t){var e=i(t),n=r.f;if(n)for(var s,a=n(t),l=o.f,u=0;a.length>u;)l.call(t,s=a[u++])&&e.push(s);return e}},function(t,e,n){var i=n(0);i(i.S+i.F*!n(6),"Object",{defineProperty:n(7).f})},function(t,e,n){var i=n(0);i(i.S+i.F*!n(6),"Object",{defineProperties:n(93)})},function(t,e,n){var i=n(15),r=n(16).f;n(24)("getOwnPropertyDescriptor",function(){return function(t,e){return r(i(t),e)}})},function(t,e,n){var i=n(0);i(i.S,"Object",{create:n(36)})},function(t,e,n){var i=n(9),r=n(17);n(24)("getPrototypeOf",function(){return function(t){return r(i(t))}})},function(t,e,n){var i=n(9),r=n(34);n(24)("keys",function(){return function(t){return r(i(t))}})},function(t,e,n){n(24)("getOwnPropertyNames",function(){return n(94).f})},function(t,e,n){var i=n(4),r=n(29).onFreeze;n(24)("freeze",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(t,e,n){var i=n(4),r=n(29).onFreeze;n(24)("seal",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(t,e,n){var i=n(4),r=n(29).onFreeze;n(24)("preventExtensions",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(t,e,n){var i=n(4);n(24)("isFrozen",function(t){return function(e){return!i(e)||!!t&&t(e)}})},function(t,e,n){var i=n(4);n(24)("isSealed",function(t){return function(e){return!i(e)||!!t&&t(e)}})},function(t,e,n){var i=n(4);n(24)("isExtensible",function(t){return function(e){return!!i(e)&&(!t||t(e))}})},function(t,e,n){var i=n(0);i(i.S+i.F,"Object",{assign:n(95)})},function(t,e,n){var i=n(0);i(i.S,"Object",{is:n(142)})},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){var i=n(0);i(i.S,"Object",{setPrototypeOf:n(68).set})},function(t,e,n){var i=n(48),r={};r[n(5)("toStringTag")]="z",r+""!="[object z]"&&n(13)(Object.prototype,"toString",function(){return"[object "+i(this)+"]"},!0)},function(t,e,n){var i=n(0);i(i.P,"Function",{bind:n(96)})},function(t,e,n){var i=n(7).f,r=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in r||n(6)&&i(r,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,e,n){var i=n(4),r=n(17),o=n(5)("hasInstance"),s=Function.prototype;o in s||n(7).f(s,o,{value:function(t){if("function"!=typeof this||!i(t))return!1;if(!i(this.prototype))return t instanceof this;for(;t=r(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,n){var i=n(2),r=n(11),o=n(19),s=n(69),a=n(21),l=n(3),u=n(37).f,c=n(16).f,h=n(7).f,f=n(43).trim,d=i.Number,p=d,g=d.prototype,m="Number"==o(n(36)(g)),v="trim"in String.prototype,y=function(t){var e=a(t,!1);if("string"==typeof e&&e.length>2){var n,i,r,o=(e=v?e.trim():f(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+e}for(var s,l=e.slice(2),u=0,c=l.length;ur)return NaN;return parseInt(l,i)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof d&&(m?l(function(){g.valueOf.call(n)}):"Number"!=o(n))?s(new p(y(e)),n,d):y(e)};for(var b,w=n(6)?u(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),_=0;w.length>_;_++)r(p,b=w[_])&&!r(d,b)&&h(d,b,c(p,b));d.prototype=g,g.constructor=d,n(13)(i,"Number",d)}},function(t,e,n){var i=n(0),r=n(23),o=n(98),s=n(71),a=1..toFixed,l=Math.floor,u=[0,0,0,0,0,0],c="Number.toFixed: incorrect invocation!",h=function(t,e){for(var n=-1,i=e;++n<6;)u[n]=(i+=t*u[n])%1e7,i=l(i/1e7)},f=function(t){for(var e=6,n=0;--e>=0;)u[e]=l((n+=u[e])/t),n=n%t*1e7},d=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==u[t]){var n=String(u[t]);e=""===e?n:e+s.call("0",7-n.length)+n}return e},p=function(t,e,n){return 0===e?n:e%2==1?p(t,e-1,n*t):p(t*t,e/2,n)};i(i.P+i.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(3)(function(){a.call({})})),"Number",{toFixed:function(t){var e,n,i,a,l=o(this,c),u=r(t),g="",m="0";if(u<0||u>20)throw RangeError(c);if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(g="-",l=-l),l>1e-21)if(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(l*p(2,69,1))-69,n=e<0?l*p(2,-e,1):l/p(2,e,1),n*=4503599627370496,(e=52-e)>0){for(h(0,n),i=u;i>=7;)h(1e7,0),i-=7;for(h(p(10,i,1),0),i=e-1;i>=23;)f(1<<23),i-=23;f(1<0?g+((a=m.length)<=u?"0."+s.call("0",u-a)+m:m.slice(0,a-u)+"."+m.slice(a-u)):g+m}})},function(t,e,i){var r=i(0),o=i(3),s=i(98),a=1..toPrecision;r(r.P+r.F*(o(function(){return"1"!==a.call(1,n)})||!o(function(){a.call({})})),"Number",{toPrecision:function(t){var e=s(this,"Number#toPrecision: incorrect invocation!");return t===n?a.call(e):a.call(e,t)}})},function(t,e,n){var i=n(0);i(i.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,n){var i=n(0),r=n(2).isFinite;i(i.S,"Number",{isFinite:function(t){return"number"==typeof t&&r(t)}})},function(t,e,n){var i=n(0);i(i.S,"Number",{isInteger:n(99)})},function(t,e,n){var i=n(0);i(i.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){var i=n(0),r=n(99),o=Math.abs;i(i.S,"Number",{isSafeInteger:function(t){return r(t)&&o(t)<=9007199254740991}})},function(t,e,n){var i=n(0);i(i.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){var i=n(0);i(i.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,n){var i=n(0),r=n(100);i(i.S+i.F*(Number.parseFloat!=r),"Number",{parseFloat:r})},function(t,e,n){var i=n(0),r=n(101);i(i.S+i.F*(Number.parseInt!=r),"Number",{parseInt:r})},function(t,e,n){var i=n(0),r=n(101);i(i.G+i.F*(parseInt!=r),{parseInt:r})},function(t,e,n){var i=n(0),r=n(100);i(i.G+i.F*(parseFloat!=r),{parseFloat:r})},function(t,e,n){var i=n(0),r=n(102),o=Math.sqrt,s=Math.acosh;i(i.S+i.F*!(s&&710==Math.floor(s(Number.MAX_VALUE))&&s(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:r(t-1+o(t-1)*o(t+1))}})},function(t,e,n){function i(t){return isFinite(t=+t)&&0!=t?t<0?-i(-t):Math.log(t+Math.sqrt(t*t+1)):t}var r=n(0),o=Math.asinh;r(r.S+r.F*!(o&&1/o(0)>0),"Math",{asinh:i})},function(t,e,n){var i=n(0),r=Math.atanh;i(i.S+i.F*!(r&&1/r(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,n){var i=n(0),r=n(72);i(i.S,"Math",{cbrt:function(t){return r(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,n){var i=n(0),r=Math.exp;i(i.S,"Math",{cosh:function(t){return(r(t=+t)+r(-t))/2}})},function(t,e,n){var i=n(0),r=n(73);i(i.S+i.F*(r!=Math.expm1),"Math",{expm1:r})},function(t,e,n){var i=n(0);i(i.S,"Math",{fround:n(103)})},function(t,e,n){var i=n(0),r=Math.abs;i(i.S,"Math",{hypot:function(t,e){for(var n,i,o=0,s=0,a=arguments.length,l=0;s0?(i=n/l)*i:n;return l===1/0?1/0:l*Math.sqrt(o)}})},function(t,e,n){var i=n(0),r=Math.imul;i(i.S+i.F*n(3)(function(){return-5!=r(4294967295,5)||2!=r.length}),"Math",{imul:function(t,e){var n=+t,i=+e,r=65535&n,o=65535&i;return 0|r*o+((65535&n>>>16)*o+r*(65535&i>>>16)<<16>>>0)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,e,n){var i=n(0);i(i.S,"Math",{log1p:n(102)})},function(t,e,n){var i=n(0);i(i.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,n){var i=n(0);i(i.S,"Math",{sign:n(72)})},function(t,e,n){var i=n(0),r=n(73),o=Math.exp;i(i.S+i.F*n(3)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(r(t)-r(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,e,n){var i=n(0),r=n(73),o=Math.exp;i(i.S,"Math",{tanh:function(t){var e=r(t=+t),n=r(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},function(t,e,n){var i=n(0);i(i.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,n){var i=n(0),r=n(35),o=String.fromCharCode,s=String.fromCodePoint;i(i.S+i.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,n=[],i=arguments.length,s=0;i>s;){if(e=+arguments[s++],r(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){var i=n(0),r=n(15),o=n(8);i(i.S,"String",{raw:function(t){for(var e=r(t.raw),n=o(e.length),i=arguments.length,s=[],a=0;n>a;)s.push(String(e[a++])),a1?arguments[1]:n,r=o(e.length),l=i===n?r:Math.min(o(i),r),u=String(t);return a?a.call(e,u,l):e.slice(l-u.length,l)===u}})},function(t,e,i){var r=i(0),o=i(75);r(r.P+r.F*i(76)("includes"),"String",{includes:function(t){return!!~o(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:n)}})},function(t,e,n){var i=n(0);i(i.P,"String",{repeat:n(71)})},function(t,e,i){var r=i(0),o=i(8),s=i(75),a="".startsWith;r(r.P+r.F*i(76)("startsWith"),"String",{startsWith:function(t){var e=s(this,t,"startsWith"),i=o(Math.min(arguments.length>1?arguments[1]:n,e.length)),r=String(t);return a?a.call(e,r,i):e.slice(i,i+r.length)===r}})},function(t,e,i){var r=i(74)(!0);i(77)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,i=this._i;return i>=e.length?{value:n,done:!0}:(t=r(e,i),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){n(14)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(t,e,n){n(14)("big",function(t){return function(){return t(this,"big","","")}})},function(t,e,n){n(14)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,e,n){n(14)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,e,n){n(14)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,e,n){n(14)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(t,e,n){n(14)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(t,e,n){n(14)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,e,n){n(14)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(t,e,n){n(14)("small",function(t){return function(){return t(this,"small","","")}})},function(t,e,n){n(14)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,e,n){n(14)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,e,n){n(14)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,e,n){var i=n(0);i(i.S,"Array",{isArray:n(52)})},function(t,e,i){var r=i(18),o=i(0),s=i(9),a=i(104),l=i(79),u=i(8),c=i(80),h=i(81);o(o.S+o.F*!i(54)(function(t){Array.from(t)}),"Array",{from:function(t){var e,i,o,f,d=s(t),p="function"==typeof this?this:Array,g=arguments.length,m=g>1?arguments[1]:n,v=m!==n,y=0,b=h(d);if(v&&(m=r(m,g>2?arguments[2]:n,2)),b==n||p==Array&&l(b))for(i=new p(e=u(d.length));e>y;y++)c(i,y,v?m(d[y],y):d[y]);else for(f=b.call(d),i=new p;!(o=f.next()).done;y++)c(i,y,v?a(f,m,[o.value,y],!0):o.value);return i.length=y,i}})},function(t,e,n){var i=n(0),r=n(80);i(i.S+i.F*n(3)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)r(n,t,arguments[t++]);return n.length=e,n}})},function(t,e,i){var r=i(0),o=i(15),s=[].join;r(r.P+r.F*(i(46)!=Object||!i(20)(s)),"Array",{join:function(t){return s.call(o(this),t===n?",":t)}})},function(t,e,i){var r=i(0),o=i(67),s=i(19),a=i(35),l=i(8),u=[].slice;r(r.P+r.F*i(3)(function(){o&&u.call(o)}),"Array",{slice:function(t,e){var i=l(this.length),r=s(this);if(e=e===n?i:e,"Array"==r)return u.call(this,t,e);for(var o=a(t,i),c=a(e,i),h=l(c-o),f=new Array(h),d=0;d1&&(i=Math.min(i,o(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in e&&e[i]===t)return i||0;return-1}})},function(t,e,n){var i=n(0);i(i.P,"Array",{copyWithin:n(106)}),n(30)("copyWithin")},function(t,e,n){var i=n(0);i(i.P,"Array",{fill:n(83)}),n(30)("fill")},function(t,e,i){var r=i(0),o=i(25)(5),s=!0;"find"in[]&&Array(1).find(function(){s=!1}),r(r.P+r.F*s,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:n)}}),i(30)("find")},function(t,e,i){var r=i(0),o=i(25)(6),s=!0;"findIndex"in[]&&Array(1).findIndex(function(){s=!1}),r(r.P+r.F*s,"Array",{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:n)}}),i(30)("findIndex")},function(t,e,n){n(38)("Array")},function(t,e,i){var r=i(2),o=i(69),s=i(7).f,a=i(37).f,l=i(53),u=i(55),c=r.RegExp,h=c,f=c.prototype,d=/a/g,p=/a/g,g=new c(d)!==d;if(i(6)&&(!g||i(3)(function(){return p[i(5)("match")]=!1,c(d)!=d||c(p)==p||"/a/i"!=c(d,"i")}))){c=function(t,e){var i=this instanceof c,r=l(t),s=e===n;return!i&&r&&t.constructor===c&&s?t:o(g?new h(r&&!s?t.source:t,e):h((r=t instanceof c)?t.source:t,r&&s?u.call(t):e),i?this:f,c)};for(var m=(function(t){t in c||s(c,t,{configurable:!0,get:function(){return h[t]},set:function(e){h[t]=e}})}),v=a(h),y=0;v.length>y;)m(v[y++]);f.constructor=c,c.prototype=f,i(13)(r,"RegExp",c)}i(38)("RegExp")},function(t,e,i){i(108);var r=i(1),o=i(55),s=i(6),a=/./.toString,l=function(t){i(13)(RegExp.prototype,"toString",t,!0)};i(3)(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?l(function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!s&&t instanceof RegExp?o.call(t):n)}):"toString"!=a.name&&l(function(){return a.call(this)})},function(t,e,i){i(56)("match",1,function(t,e,i){return[function(i){var r=t(this),o=i==n?n:i[e];return o!==n?o.call(i,r):new RegExp(i)[e](String(r))},i]})},function(t,e,i){i(56)("replace",2,function(t,e,i){return[function(r,o){var s=t(this),a=r==n?n:r[e];return a!==n?a.call(r,s,o):i.call(String(s),r,o)},i]})},function(t,e,i){i(56)("search",1,function(t,e,i){return[function(i){var r=t(this),o=i==n?n:i[e];return o!==n?o.call(i,r):new RegExp(i)[e](String(r))},i]})},function(t,e,i){i(56)("split",2,function(t,e,r){var o=i(53),s=r,a=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var l=/()??/.exec("")[1]===n;r=function(t,e){var i=String(this);if(t===n&&0===e)return[];if(!o(t))return s.call(i,t,e);var r,u,c,h,f,d=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,m=e===n?4294967295:e>>>0,v=new RegExp(t.source,p+"g");for(l||(r=new RegExp("^"+v.source+"$(?!\\s)",p));(u=v.exec(i))&&!((c=u.index+u[0].length)>g&&(d.push(i.slice(g,u.index)),!l&&u.length>1&&u[0].replace(r,function(){for(f=1;f1&&u.index=m));)v.lastIndex===u.index&&v.lastIndex++;return g===i.length?!h&&v.test("")||d.push(""):d.push(i.slice(g)),d.length>m?d.slice(0,m):d}}else"0".split(n,0).length&&(r=function(t,e){return t===n&&0===e?[]:s.call(this,t,e)});return[function(i,o){var s=t(this),a=i==n?n:i[e];return a!==n?a.call(i,s,o):r.call(String(s),i,o)},r]})},function(t,e,i){var r,o,s,a,l=i(33),u=i(2),c=i(18),h=i(48),f=i(0),d=i(4),p=i(10),g=i(39),m=i(40),v=i(57),y=i(85).set,b=i(86)(),w=i(87),_=i(109),x=i(110),S="Promise",k=u.TypeError,C=u.process,T=u.Promise,E="process"==h(C),P=function(){},O=o=w.f,M=!!function(){try{var t=T.resolve(1),e=(t.constructor={})[i(5)("species")]=function(t){t(P,P)};return(E||"function"==typeof PromiseRejectionEvent)&&t.then(P)instanceof e}catch(n){}}(),A=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},D=function(t,e){if(!t._n){t._n=!0;var n=t._c;b(function(){for(var i=t._v,r=1==t._s,o=0,s=function(e){var n,o,s=r?e.ok:e.fail,a=e.resolve,l=e.reject,u=e.domain;try{s?(r||(2==t._h&&R(t),t._h=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&u.exit()),n===e.promise?l(k("Promise-chain cycle")):(o=A(n))?o.call(n,a,l):a(n)):l(i)}catch(c){l(c)}};n.length>o;)s(n[o++]);t._c=[],t._n=!1,e&&!t._h&&L(t)})}},L=function(t){y.call(u,function(){var e,i,r,o=t._v,s=I(t);if(s&&(e=_(function(){E?C.emit("unhandledRejection",o,t):(i=u.onunhandledrejection)?i({promise:t,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=E||I(t)?2:1),t._a=n,s&&e.e)throw e.v})},I=function(t){return 1!==t._h&&0===(t._a||t._c).length},R=function(t){y.call(u,function(){var e;E?C.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})})},N=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),D(e,!0))},z=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw k("Promise can't be resolved itself");(e=A(t))?b(function(){var i={_w:n,_d:!1};try{e.call(t,c(z,i,1),c(N,i,1))}catch(r){N.call(i,r)}}):(n._v=t,n._s=1,D(n,!1))}catch(i){N.call({_w:n,_d:!1},i)}}};M||(T=function(t){g(this,T,S,"_h"),p(t),r.call(this);try{t(c(z,this,1),c(N,this,1))}catch(e){N.call(this,e)}},(r=function(t){this._c=[],this._a=n,this._s=0,this._d=!1,this._v=n,this._h=0,this._n=!1}).prototype=i(41)(T.prototype,{then:function(t,e){var i=O(v(this,T));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=E?C.domain:n,this._c.push(i),this._a&&this._a.push(i),this._s&&D(this,!1),i.promise},"catch":function(t){return this.then(n,t)}}),s=function(){var t=new r;this.promise=t,this.resolve=c(z,t,1),this.reject=c(N,t,1)},w.f=O=function(t){return t===T||t===a?new s(t):o(t)}),f(f.G+f.W+f.F*!M,{Promise:T}),i(42)(T,S),i(38)(S),a=i(28).Promise,f(f.S+f.F*!M,S,{reject:function(t){var e=O(this);return(0,e.reject)(t),e.promise}}),f(f.S+f.F*(l||!M),S,{resolve:function(t){return x(l&&this===a?T:this,t)}}),f(f.S+f.F*!(M&&i(54)(function(t){T.all(t)["catch"](P)})),S,{all:function(t){var e=this,i=O(e),r=i.resolve,o=i.reject,s=_(function(){var i=[],s=0,a=1;m(t,!1,function(t){var l=s++,u=!1;i.push(n),a++,e.resolve(t).then(function(t){u||(u=!0,i[l]=t,--a||r(i))},o)}),--a||r(i)});return s.e&&o(s.v),i.promise},race:function(t){var e=this,n=O(e),i=n.reject,r=_(function(){m(t,!1,function(t){e.resolve(t).then(n.resolve,i)})});return r.e&&i(r.v),n.promise}})},function(t,e,i){var r=i(115),o=i(45);i(58)("WeakSet",function(t){return function(){return t(this,arguments.length>0?arguments[0]:n)}},{add:function(t){return r.def(o(this,"WeakSet"),t,!0)}},r,!1,!0)},function(t,e,n){var i=n(0),r=n(10),o=n(1),s=(n(2).Reflect||{}).apply,a=Function.apply;i(i.S+i.F*!n(3)(function(){s(function(){})}),"Reflect",{apply:function(t,e,n){var i=r(t),l=o(n);return s?s(i,e,l):a.call(i,e,l)}})},function(t,e,n){var i=n(0),r=n(36),o=n(10),s=n(1),a=n(4),l=n(3),u=n(96),c=(n(2).Reflect||{}).construct,h=l(function(){function t(){}return!(c(function(){},[],t)instanceof t)}),f=!l(function(){c(function(){})});i(i.S+i.F*(h||f),"Reflect",{construct:function(t,e){o(t),s(e);var n=arguments.length<3?t:o(arguments[2]);if(f&&!h)return c(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return i.push.apply(i,e),new(u.apply(t,i))}var l=n.prototype,d=r(a(l)?l:Object.prototype),p=Function.apply.call(t,d,e);return a(p)?p:d}})},function(t,e,n){var i=n(7),r=n(0),o=n(1),s=n(21);r(r.S+r.F*n(3)(function(){Reflect.defineProperty(i.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,n){o(t),e=s(e,!0),o(n);try{return i.f(t,e,n),!0}catch(r){return!1}}})},function(t,e,n){var i=n(0),r=n(16).f,o=n(1);i(i.S,"Reflect",{deleteProperty:function(t,e){var n=r(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},function(t,e,i){var r=i(0),o=i(1),s=function(t){this._t=o(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};i(78)(s,"Object",function(){var t,e=this._k;do if(this._i>=e.length)return{value:n,done:!0};while(!((t=e[this._i++])in this._t));return{value:t,done:!1}}),r(r.S,"Reflect",{enumerate:function(t){return new s(t)}})},function(t,e,i){function r(t,e){var i,l,h=arguments.length<3?t:arguments[2];return c(t)===h?t[e]:(i=o.f(t,e))?a(i,"value")?i.value:i.get!==n?i.get.call(h):n:u(l=s(t))?r(l,e,h):void 0}var o=i(16),s=i(17),a=i(11),l=i(0),u=i(4),c=i(1);l(l.S,"Reflect",{get:r})},function(t,e,n){var i=n(16),r=n(0),o=n(1);r(r.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return i.f(o(t),e)}})},function(t,e,n){var i=n(0),r=n(17),o=n(1);i(i.S,"Reflect",{getPrototypeOf:function(t){return r(o(t))}})},function(t,e,n){var i=n(0);i(i.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,n){var i=n(0),r=n(1),o=Object.isExtensible;i(i.S,"Reflect",{isExtensible:function(t){return r(t),!o||o(t)}})},function(t,e,n){var i=n(0);i(i.S,"Reflect",{ownKeys:n(116)})},function(t,e,n){var i=n(0),r=n(1),o=Object.preventExtensions;i(i.S,"Reflect",{preventExtensions:function(t){r(t);try{return o&&o(t),!0}catch(e){return!1}}})},function(t,e,i){function r(t,e,i){var u,d,p=arguments.length<4?t:arguments[3],g=s.f(h(t),e);if(!g){if(f(d=a(t)))return r(d,e,i,p);g=c(0)}return l(g,"value")?!(!1===g.writable||!f(p)||(u=s.f(p,e)||c(0),u.value=i,o.f(p,e,u),0)):g.set!==n&&(g.set.call(p,i),!0)}var o=i(7),s=i(16),a=i(17),l=i(11),u=i(0),c=i(31),h=i(1),f=i(4);u(u.S,"Reflect",{set:r})},function(t,e,n){var i=n(0),r=n(68);r&&i(i.S,"Reflect",{setPrototypeOf:function(t,e){r.check(t,e);try{return r.set(t,e),!0}catch(n){return!1}}})},function(t,e,n){var i=n(0);i(i.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,e,n){var i=n(0),r=n(9),o=n(21);i(i.P+i.F*n(3)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(t){var e=r(this),n=o(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},function(t,e,n){var i=n(0),r=n(247);i(i.P+i.F*(Date.prototype.toISOString!==r),"Date",{toISOString:r})},function(t,e,n){var i=n(3),r=Date.prototype.getTime,o=Date.prototype.toISOString,s=function(t){return t>9?t:"0"+t};t.exports=i(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!i(function(){o.call(new Date(NaN))})?function(){if(!isFinite(r.call(this)))throw RangeError("Invalid time value");var t=this.getUTCFullYear(),e=this.getUTCMilliseconds(),n=t<0?"-":t>9999?"+":"";return n+("00000"+Math.abs(t)).slice(n?-6:-4)+"-"+s(this.getUTCMonth()+1)+"-"+s(this.getUTCDate())+"T"+s(this.getUTCHours())+":"+s(this.getUTCMinutes())+":"+s(this.getUTCSeconds())+"."+(e>99?e:"0"+s(e))+"Z"}:o},function(t,e,n){var i=Date.prototype,r=i.toString,o=i.getTime;new Date(NaN)+""!="Invalid Date"&&n(13)(i,"toString",function(){var t=o.call(this);return t==t?r.call(this):"Invalid Date"})},function(t,e,n){var i=n(5)("toPrimitive"),r=Date.prototype;i in r||n(12)(r,i,n(250)); -},function(t,e,n){var i=n(1),r=n(21);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return r(i(this),"number"!=t)}},function(t,e,i){var r=i(0),o=i(59),s=i(88),a=i(1),l=i(35),u=i(8),c=i(4),h=i(2).ArrayBuffer,f=i(57),d=s.ArrayBuffer,p=s.DataView,g=o.ABV&&h.isView,m=d.prototype.slice,v=o.VIEW;r(r.G+r.W+r.F*(h!==d),{ArrayBuffer:d}),r(r.S+r.F*!o.CONSTR,"ArrayBuffer",{isView:function(t){return g&&g(t)||c(t)&&v in t}}),r(r.P+r.U+r.F*i(3)(function(){return!new d(2).slice(1,n).byteLength}),"ArrayBuffer",{slice:function(t,e){if(m!==n&&e===n)return m.call(a(this),t);for(var i=a(this).byteLength,r=l(t,i),o=l(e===n?i:e,i),s=new(f(this,d))(u(o-r)),c=new p(this),h=new p(s),g=0;r1?arguments[1]:n)}}),i(30)("includes")},function(t,e,n){var i=n(0),r=n(118),o=n(9),s=n(8),a=n(10),l=n(82);i(i.P,"Array",{flatMap:function(t){var e,n,i=o(this);return a(t),e=s(i.length),n=l(i,0),r(n,i,i,e,0,1,t,arguments[1]),n}}),n(30)("flatMap")},function(t,e,i){var r=i(0),o=i(118),s=i(9),a=i(8),l=i(23),u=i(82);r(r.P,"Array",{flatten:function(){var t=arguments[0],e=s(this),i=a(e.length),r=u(e,0);return o(r,e,e,i,0,t===n?1:l(t)),r}}),i(30)("flatten")},function(t,e,n){var i=n(0),r=n(74)(!0);i(i.P,"String",{at:function(t){return r(this,t)}})},function(t,e,i){var r=i(0),o=i(119),s=i(89);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(s),"String",{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:n,!0)}})},function(t,e,i){var r=i(0),o=i(119),s=i(89);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(s),"String",{padEnd:function(t){return o(this,t,arguments.length>1?arguments[1]:n,!1)}})},function(t,e,n){n(43)("trimLeft",function(t){return function(){return t(this,1)}},"trimStart")},function(t,e,n){n(43)("trimRight",function(t){return function(){return t(this,2)}},"trimEnd")},function(t,e,n){var i=n(0),r=n(22),o=n(8),s=n(53),a=n(55),l=RegExp.prototype,u=function(t,e){this._r=t,this._s=e};n(78)(u,"RegExp String",function(){var t=this._r.exec(this._s);return{value:t,done:null===t}}),i(i.P,"String",{matchAll:function(t){if(r(this),!s(t))throw TypeError(t+" is not a regexp!");var e=String(this),n="flags"in l?String(t.flags):a.call(t),i=new RegExp(t.source,~n.indexOf("g")?n:"g"+n);return i.lastIndex=o(t.lastIndex),new u(i,e)}})},function(t,e,n){n(64)("asyncIterator")},function(t,e,n){n(64)("observable")},function(t,e,i){var r=i(0),o=i(116),s=i(15),a=i(16),l=i(80);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,i,r=s(t),u=a.f,c=o(r),h={},f=0;c.length>f;)(i=u(r,e=c[f++]))!==n&&l(h,e,i);return h}})},function(t,e,n){var i=n(0),r=n(120)(!1);i(i.S,"Object",{values:function(t){return r(t)}})},function(t,e,n){var i=n(0),r=n(120)(!0);i(i.S,"Object",{entries:function(t){return r(t)}})},function(t,e,n){var i=n(0),r=n(9),o=n(10),s=n(7);n(6)&&i(i.P+n(60),"Object",{__defineGetter__:function(t,e){s.f(r(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){var i=n(0),r=n(9),o=n(10),s=n(7);n(6)&&i(i.P+n(60),"Object",{__defineSetter__:function(t,e){s.f(r(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){var i=n(0),r=n(9),o=n(21),s=n(17),a=n(16).f;n(6)&&i(i.P+n(60),"Object",{__lookupGetter__:function(t){var e,n=r(this),i=o(t,!0);do if(e=a(n,i))return e.get;while(n=s(n))}})},function(t,e,n){var i=n(0),r=n(9),o=n(21),s=n(17),a=n(16).f;n(6)&&i(i.P+n(60),"Object",{__lookupSetter__:function(t){var e,n=r(this),i=o(t,!0);do if(e=a(n,i))return e.set;while(n=s(n))}})},function(t,e,n){var i=n(0);i(i.P+i.R,"Map",{toJSON:n(121)("Map")})},function(t,e,n){var i=n(0);i(i.P+i.R,"Set",{toJSON:n(121)("Set")})},function(t,e,n){n(61)("Map")},function(t,e,n){n(61)("Set")},function(t,e,n){n(61)("WeakMap")},function(t,e,n){n(61)("WeakSet")},function(t,e,n){n(62)("Map")},function(t,e,n){n(62)("Set")},function(t,e,n){n(62)("WeakMap")},function(t,e,n){n(62)("WeakSet")},function(t,e,n){var i=n(0);i(i.G,{global:n(2)})},function(t,e,n){var i=n(0);i(i.S,"System",{global:n(2)})},function(t,e,n){var i=n(0),r=n(19);i(i.S,"Error",{isError:function(t){return"Error"===r(t)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{clamp:function(t,e,n){return Math.min(n,Math.max(e,t))}})},function(t,e,n){var i=n(0);i(i.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(t,e,n){var i=n(0),r=180/Math.PI;i(i.S,"Math",{degrees:function(t){return t*r}})},function(t,e,n){var i=n(0),r=n(123),o=n(103);i(i.S,"Math",{fscale:function(t,e,n,i,s){return o(r(t,e,n,i,s))}})},function(t,e,n){var i=n(0);i(i.S,"Math",{iaddh:function(t,e,n,i){var r=t>>>0,o=n>>>0;return(e>>>0)+(i>>>0)+((r&o|(r|o)&~(r+o>>>0))>>>31)|0}})},function(t,e,n){var i=n(0);i(i.S,"Math",{isubh:function(t,e,n,i){var r=t>>>0,o=n>>>0;return(e>>>0)-(i>>>0)-((~r&o|~(r^o)&r-o>>>0)>>>31)|0}})},function(t,e,n){var i=n(0);i(i.S,"Math",{imulh:function(t,e){var n=+t,i=+e,r=65535&n,o=65535&i,s=n>>16,a=i>>16,l=(s*o>>>0)+(r*o>>>16);return s*a+(l>>16)+((r*a>>>0)+(65535&l)>>16)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,e,n){var i=n(0),r=Math.PI/180;i(i.S,"Math",{radians:function(t){return t*r}})},function(t,e,n){var i=n(0);i(i.S,"Math",{scale:n(123)})},function(t,e,n){var i=n(0);i(i.S,"Math",{umulh:function(t,e){var n=+t,i=+e,r=65535&n,o=65535&i,s=n>>>16,a=i>>>16,l=(s*o>>>0)+(r*o>>>16);return s*a+(l>>>16)+((r*a>>>0)+(65535&l)>>>16)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{signbit:function(t){return(t=+t)!=t?t:0==t?1/t==1/0:t>0}})},function(t,e,n){var i=n(0),r=n(28),o=n(2),s=n(57),a=n(110);i(i.P+i.R,"Promise",{"finally":function(t){var e=s(this,r.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then(function(){return n})}:t,n?function(n){return a(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){var i=n(0),r=n(87),o=n(109);i(i.S,"Promise",{"try":function(t){var e=r.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){var i=n(27),r=n(1),o=i.key,s=i.set;i.exp({defineMetadata:function(t,e,n,i){s(t,e,r(n),o(i))}})},function(t,e,i){var r=i(27),o=i(1),s=r.key,a=r.map,l=r.store;r.exp({deleteMetadata:function(t,e){var i=arguments.length<3?n:s(arguments[2]),r=a(o(e),i,!1);if(r===n||!r["delete"](t))return!1;if(r.size)return!0;var u=l.get(e);return u["delete"](i),!!u.size||l["delete"](e)}})},function(t,e,i){var r=i(27),o=i(1),s=i(17),a=r.has,l=r.get,u=r.key,c=function(t,e,i){if(a(t,e,i))return l(t,e,i);var r=s(e);return null!==r?c(t,r,i):n};r.exp({getMetadata:function(t,e){return c(t,o(e),arguments.length<3?n:u(arguments[2]))}})},function(t,e,i){var r=i(113),o=i(122),s=i(27),a=i(1),l=i(17),u=s.keys,c=s.key,h=function(t,e){var n=u(t,e),i=l(t);if(null===i)return n;var s=h(i,e);return s.length?n.length?o(new r(n.concat(s))):s:n};s.exp({getMetadataKeys:function(t){return h(a(t),arguments.length<2?n:c(arguments[1]))}})},function(t,e,i){var r=i(27),o=i(1),s=r.get,a=r.key;r.exp({getOwnMetadata:function(t,e){return s(t,o(e),arguments.length<3?n:a(arguments[2]))}})},function(t,e,i){var r=i(27),o=i(1),s=r.keys,a=r.key;r.exp({getOwnMetadataKeys:function(t){return s(o(t),arguments.length<2?n:a(arguments[1]))}})},function(t,e,i){var r=i(27),o=i(1),s=i(17),a=r.has,l=r.key,u=function(t,e,n){if(a(t,e,n))return!0;var i=s(e);return null!==i&&u(t,i,n)};r.exp({hasMetadata:function(t,e){return u(t,o(e),arguments.length<3?n:l(arguments[2]))}})},function(t,e,i){var r=i(27),o=i(1),s=r.has,a=r.key;r.exp({hasOwnMetadata:function(t,e){return s(t,o(e),arguments.length<3?n:a(arguments[2]))}})},function(t,e,i){var r=i(27),o=i(1),s=i(10),a=r.key,l=r.set;r.exp({metadata:function(t,e){return function(i,r){l(t,e,(r!==n?o:s)(i),a(r))}}})},function(t,e,n){var i=n(0),r=n(86)(),o=n(2).process,s="process"==n(19)(o);i(i.G,{asap:function(t){var e=s&&o.domain;r(e?e.bind(t):t)}})},function(t,e,i){var r=i(0),o=i(2),s=i(28),a=i(86)(),l=i(5)("observable"),u=i(10),c=i(1),h=i(39),f=i(41),d=i(12),p=i(40),g=p.RETURN,m=function(t){return null==t?n:u(t)},v=function(t){var e=t._c;e&&(t._c=n,e())},y=function(t){return t._o===n},b=function(t){y(t)||(t._o=n,v(t))},w=function(t,e){c(t),this._c=n,this._o=t,t=new _(this);try{var i=e(t),r=i;null!=i&&("function"==typeof i.unsubscribe?i=function(){r.unsubscribe()}:u(i),this._c=i)}catch(o){return void t.error(o)}y(this)&&v(this)};w.prototype=f({},{unsubscribe:function(){b(this)}});var _=function(t){this._s=t};_.prototype=f({},{next:function(t){var e=this._s;if(!y(e)){var n=e._o;try{var i=m(n.next);if(i)return i.call(n,t)}catch(r){try{b(e)}finally{throw r}}}},error:function(t){var e=this._s;if(y(e))throw t;var i=e._o;e._o=n;try{var r=m(i.error);if(!r)throw t;t=r.call(i,t)}catch(o){try{v(e)}finally{throw o}}return v(e),t},complete:function(t){var e=this._s;if(!y(e)){var i=e._o;e._o=n;try{var r=m(i.complete);t=r?r.call(i,t):n}catch(o){try{v(e)}finally{throw o}}return v(e),t}}});var x=function(t){h(this,x,"Observable","_f")._f=u(t)};f(x.prototype,{subscribe:function(t){return new w(t,this._f)},forEach:function(t){var e=this;return new(s.Promise||o.Promise)(function(n,i){u(t);var r=e.subscribe({next:function(e){try{return t(e)}catch(n){i(n),r.unsubscribe()}},error:i,complete:n})})}}),f(x,{from:function(t){var e="function"==typeof this?this:x,n=m(c(t)[l]);if(n){var i=c(n.call(t));return i.constructor===e?i:new e(function(t){return i.subscribe(t)})}return new e(function(e){var n=!1;return a(function(){if(!n){try{if(p(t,!1,function(t){if(e.next(t),n)return g})===g)return}catch(i){if(n)throw i;return void e.error(i)}e.complete()}}),function(){n=!0}})},of:function(){for(var t=0,e=arguments.length,n=new Array(e);t2,r=!!i&&s.call(arguments,2);return t(i?function(){("function"==typeof e?e:Function(e)).apply(this,r)}:e,n)}};r(r.G+r.B+r.F*a,{setTimeout:l(i.setTimeout),setInterval:l(i.setInterval)})}]),"undefined"!=typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd?define(function(){return t}):e.core=t}(1,1),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(this,function(){"use strict";function t(t,e){for(var n=t.length-1;n>=0;n--)"function"==typeof t[n]&&(t[n]=Zone.current.wrap(t[n],e+"_"+n));return t}function e(e,n){for(var i=e.constructor.name,r=function(r){var o=n[r],s=e[o];s&&(e[o]=function(e){return function(){return e.apply(this,t(arguments,i+"."+o))}}(s))},o=0;o1?new e(t,n):new e(t),s=Object.getOwnPropertyDescriptor(o,"onmessage");return s&&s.configurable===!1?(r=Object.create(o),["addEventListener","removeEventListener","send","close"].forEach(function(t){r[t]=function(){return o[t].apply(o,arguments)}})):r=o,i(r,["close","error","message","open"]),r};for(var n in e)t.WebSocket[n]=e[n]}function w(t){if(!P){var e="undefined"!=typeof WebSocket;_()?(O&&i(HTMLElement.prototype,B),i(XMLHttpRequest.prototype,null),"undefined"!=typeof IDBIndex&&(i(IDBIndex.prototype,null),i(IDBRequest.prototype,null),i(IDBOpenDBRequest.prototype,null),i(IDBDatabase.prototype,null),i(IDBTransaction.prototype,null),i(IDBCursor.prototype,null)),e&&i(WebSocket.prototype,null)):(x(),u("XMLHttpRequest"),e&&b(t))}}function _(){if(O&&!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var t=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(t&&!t.configurable)return!1}Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{get:function(){return!0}});var e=new XMLHttpRequest,n=!!e.onreadystatechange;return Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{}),n}function x(){for(var t=function(t){var e=B[t],n="on"+e;self.addEventListener(e,function(t){var e,i,r=t.target;for(i=r?r.constructor.name+"."+n:"unknown."+n;r;)r[n]&&!r[n][U]&&(e=Zone.current.wrap(r[n],i),e[U]=r[n],r[n]=e),r=r.parentElement},!0)},e=0;e",this._properties=e&&e.properties||{},this._zoneDelegate=new g(this,this._parent&&this._parent._zoneDelegate,e)}return n.assertZonePatched=function(){if(t.Promise!==L)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(n,"current",{get:function(){return w},enumerable:!0,configurable:!0}),Object.defineProperty(n,"currentTask",{get:function(){return _},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),n.prototype.get=function(t){var e=this.getZoneWith(t);if(e)return e._properties[t]},n.prototype.getZoneWith=function(t){for(var e=this;e;){if(e._properties.hasOwnProperty(t))return e;e=e._parent}return null},n.prototype.fork=function(t){if(!t)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,t)},n.prototype.wrap=function(t,e){if("function"!=typeof t)throw new Error("Expecting function got: "+t);var n=this._zoneDelegate.intercept(this,t,e),i=this;return function(){return i.runGuarded(n,this,arguments,e)}},n.prototype.run=function(t,e,n,i){void 0===e&&(e=null),void 0===n&&(n=null),void 0===i&&(i=null);var r=w;w=this;try{return this._zoneDelegate.invoke(this,t,e,n,i)}finally{w=r}},n.prototype.runGuarded=function(t,e,n,i){void 0===e&&(e=null),void 0===n&&(n=null),void 0===i&&(i=null);var r=w;w=this;try{try{return this._zoneDelegate.invoke(this,t,e,n,i)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{w=r}},n.prototype.runTask=function(t,e,n){if(t.runCount++,t.zone!=this)throw new Error("A task can only be run in the zone which created it! (Creation: "+t.zone.name+"; Execution: "+this.name+")");var i=_;_=t;var r=w;w=this;try{"macroTask"==t.type&&t.data&&!t.data.isPeriodic&&(t.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,t,e,n)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{w=r,_=i}},n.prototype.scheduleMicroTask=function(t,e,n,i){return this._zoneDelegate.scheduleTask(this,new m("microTask",this,t,e,n,i,null))},n.prototype.scheduleMacroTask=function(t,e,n,i,r){return this._zoneDelegate.scheduleTask(this,new m("macroTask",this,t,e,n,i,r))},n.prototype.scheduleEventTask=function(t,e,n,i,r){return this._zoneDelegate.scheduleTask(this,new m("eventTask",this,t,e,n,i,r))},n.prototype.cancelTask=function(t){var e=this._zoneDelegate.cancelTask(this,t);return t.runCount=-1,t.cancelFn=null,e},n.__symbol__=e,n}(),g=function(){function t(t,e,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=t,this._parentDelegate=e,this._forkZS=n&&(n&&n.onFork?n:e._forkZS),this._forkDlgt=n&&(n.onFork?e:e._forkDlgt),this._interceptZS=n&&(n.onIntercept?n:e._interceptZS),this._interceptDlgt=n&&(n.onIntercept?e:e._interceptDlgt),this._invokeZS=n&&(n.onInvoke?n:e._invokeZS),this._invokeDlgt=n&&(n.onInvoke?e:e._invokeDlgt),this._handleErrorZS=n&&(n.onHandleError?n:e._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?e:e._handleErrorDlgt),this._scheduleTaskZS=n&&(n.onScheduleTask?n:e._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?e:e._scheduleTaskDlgt),this._invokeTaskZS=n&&(n.onInvokeTask?n:e._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?e:e._invokeTaskDlgt),this._cancelTaskZS=n&&(n.onCancelTask?n:e._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?e:e._cancelTaskDlgt),this._hasTaskZS=n&&(n.onHasTask?n:e._hasTaskZS),this._hasTaskDlgt=n&&(n.onHasTask?e:e._hasTaskDlgt)}return t.prototype.fork=function(t,e){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,t,e):new p(t,e)},t.prototype.intercept=function(t,e,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this.zone,t,e,n):e},t.prototype.invoke=function(t,e,n,i,r){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this.zone,t,e,n,i,r):e.apply(n,i)},t.prototype.handleError=function(t,e){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this.zone,t,e)},t.prototype.scheduleTask=function(t,e){try{if(this._scheduleTaskZS)return this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this.zone,t,e);if(e.scheduleFn)e.scheduleFn(e);else{if("microTask"!=e.type)throw new Error("Task is missing scheduleFn.");i(e)}return e}finally{t==this.zone&&this._updateTaskCount(e.type,1)}},t.prototype.invokeTask=function(t,e,n,i){try{return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this.zone,t,e,n,i):e.callback.apply(n,i)}finally{t!=this.zone||"eventTask"==e.type||e.data&&e.data.isPeriodic||this._updateTaskCount(e.type,-1)}},t.prototype.cancelTask=function(t,e){var n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this.zone,t,e);else{if(!e.cancelFn)throw new Error("Task does not support cancellation, or is already canceled.");n=e.cancelFn(e)}return t==this.zone&&this._updateTaskCount(e.type,-1),n},t.prototype.hasTask=function(t,e){return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this.zone,t,e)},t.prototype._updateTaskCount=function(t,e){var n=this._taskCounts,i=n[t],r=n[t]=i+e;if(r<0)throw new Error("More tasks executed then were scheduled.");if(0==i||0==r){var o={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:t};try{this.hasTask(this.zone,o)}finally{this._parentDelegate&&this._parentDelegate._updateTaskCount(t,e)}}},t}(),m=function(){function t(t,e,n,i,r,s,a){this.runCount=0,this.type=t,this.zone=e,this.source=n,this.data=r,this.scheduleFn=s,this.cancelFn=a,this.callback=i;var l=this;this.invoke=function(){C++;try{return e.runTask(l,this,arguments)}finally{1==C&&o(),C--}}}return t.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},t}(),v=e("setTimeout"),y=e("Promise"),b=e("then"),w=new p(null,null),_=null,x=[],S=!1,k=[],C=0,T=e("state"),E=e("value"),P="Promise.then",O=null,M=!0,A=!1,D=0,L=function(){function t(e){var n=this;if(!(n instanceof t))throw new Error("Must be an instanceof Promise.");n[T]=O,n[E]=[];try{e&&e(u(n,M),u(n,A))}catch(i){c(n,!1,i)}}return t.resolve=function(t){return c(new this(null),M,t)},t.reject=function(t){return c(new this(null),A,t)},t.race=function(t){function e(t){o&&(o=i(t))}function n(t){o&&(o=r(t))}for(var i,r,o=new this(function(t,e){n=[t,e],i=n[0],r=n[1];var n}),a=0,l=t;a0)return!0;var r=rt.get(e);return r["delete"](n),r.size>0||(rt["delete"](e),!0)}function h(t,e){for(var n=t.length-1;n>=0;--n){var i=t[n],r=i(e);if(!x(r)&&!S(r)){if(!L(r))throw new TypeError;e=r}}return e}function f(t,e,n,i){for(var r=t.length-1;r>=0;--r){var o=t[r],s=o(e,n,i);if(!x(s)&&!S(s)){if(!C(s))throw new TypeError;i=s}}return i}function d(t,e,n){var i=rt.get(t);if(x(i)){if(!n)return;i=new et,rt.set(t,i)}var r=i.get(e);if(x(r)){if(!n)return;r=new et,i.set(e,r)}return r}function p(t,e,n){var i=g(t,e,n);if(i)return!0;var r=H(e);return!S(r)&&p(t,r,n)}function g(t,e,n){var i=d(e,n,!1);return!x(i)&&P(i.has(t))}function m(t,e,n){var i=g(t,e,n);if(i)return v(t,e,n);var r=H(e);return S(r)?void 0:m(t,r,n)}function v(t,e,n){var i=d(e,n,!1);if(!x(i))return i.get(t)}function y(t,e,n,i){var r=d(n,i,!0);r.set(t,e)}function b(t,e){var n=w(t,e),i=H(t);if(null===i)return n;var r=b(i,e);if(r.length<=0)return n;if(n.length<=0)return r;for(var o=new nt,s=[],a=0,l=n;a=0&&t=this._keys.length?(this._index=-1,this._keys=r,this._values=r):this._index++,{value:e,done:!1}}return{value:void 0,done:!0}},t.prototype["throw"]=function(t){throw this._index>=0&&(this._index=-1,this._keys=r,this._values=r),t},t.prototype["return"]=function(t){return this._index>=0&&(this._index=-1,this._keys=r,this._values=r),{value:t,done:!0}},t}();return function(){function r(){this._keys=[],this._values=[],this._cacheKey=i,this._cacheIndex=-2}return Object.defineProperty(r.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),r.prototype.has=function(t){return this._find(t,!1)>=0},r.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},r.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},r.prototype["delete"]=function(t){var e=this._find(t,!1);if(e>=0){for(var n=this._keys.length,r=e+1;r2)throw new TypeError("Only one wildcard in a path is permitted");if(1==s.length){if(e==o)return t[o];if(e.substr(0,o.length-1)==o.substr(0,o.length-1)&&(e.lengtho.length?"/"+e.substr(o.length):"")}else{var a=s[0].length;a>=r&&e.substr(0,s[0].length)==s[0]&&e.substr(e.length-s[1].length)==s[1]&&(r=a,i=o,n=e.substr(s[0].length,e.length-s[1].length-s[0].length))}}var l=t[i];return"string"==typeof n&&(l=l.replace("*",n)),l}function a(){}function l(){o.call(this),X.call(this)}function u(){}function c(t,e){l.prototype[t]=e(l.prototype[t]||function(){})}function h(t){X=t(X||function(){})}function f(t){for(var e=[],n=[],i=0,r=t.length;i",i.isDeclarative=!0,S.call(e.loaderObj,i).then(function(e){var r=t.System,o=r.register;r.register=function(t,e,n){"string"!=typeof t&&(n=e,e=t),i.declare=n,i.depsList=e},n(e,i.address,{}),r.register=o});if("object"!=typeof r)throw TypeError("Invalid instantiate return value");i.depsList=r.deps||[],i.execute=r.execute,i.isDeclarative=!1}).then(function(){i.dependencies=[];for(var t=i.depsList,n=[],r=0,o=t.length;r0)){var n=t.startingLoad;if(t.loader.loaderObj.execute===!1){for(var i=[].concat(t.loads),r=0,o=i.length;rr&&(n=o,r=i));return n}function e(t,e,n,i,r){if(!i||"/"==i[i.length-1]||r||e.defaultExtension===!1)return i;if(i.match(lt))return i;var o=!1;if(e.meta&&p(e.meta,i,function(t,e,n){if(0==n||t.lastIndexOf("*")!=t.length-1)return o=!0}),!o&&t.meta&&p(t.meta,n+"/"+i,function(t,e,n){if(0==n||t.lastIndexOf("*")!=t.length-1)return o=!0}),o)return i;var s="."+(e.defaultExtension||"js");return i.substr(i.length-s.length)!=s?i+s:i}function n(t,n,i,o,s){if(!o){if(!n.main)return i+(t.defaultJSExtensions?".js":"");o="./"==n.main.substr(0,2)?n.main.substr(2):n.main}if(n.map){var a="./"+o,l=_(n.map,a);if(l||(a="./"+e(t,n,i,o,s),a!="./"+o&&(l=_(n.map,a))),l)return r(t,n,i,l,a,s)}return i+"/"+e(t,n,i,o,s)}function i(t,e,n){if("."==t)throw new Error("Package "+n+' has a map entry for "." which is not permitted.');if(e.substr(0,t.length)==t&&"/"!=t[t.length-1]&&"/"==e[t.length])throw new Error("Package "+n+' has a recursive map for "'+t+'" which is not permitted.')}function r(t,n,r,o,s,a){var l=n.map[o];if("object"==typeof l)throw new Error("Synchronous conditional normalization not supported sync normalizing "+o+" in "+r);if(i(o,l,r),"string"!=typeof l&&(l=o=s),i(o,l,r),"."==l)l=r;else if("./"==l.substr(0,2))return r+"/"+e(t,n,r,l.substr(2)+s.substr(o.length),a);return t.normalizeSync(l+s.substr(o.length),r+"/")}function o(t,n,i,r,o){if(!r){if(!n.main)return Promise.resolve(i+(t.defaultJSExtensions?".js":""));r="./"==n.main.substr(0,2)?n.main.substr(2):n.main}var s,l;return n.map&&(s="./"+r,l=_(n.map,s),l||(s="./"+e(t,n,i,r,o),s!="./"+r&&(l=_(n.map,s)))),(l?a(t,n,i,l,s,o):Promise.resolve()).then(function(s){return s?Promise.resolve(s):Promise.resolve(i+"/"+e(t,n,i,r,o))})}function s(t,n,i,r,o,s,a){if("."==o)o=i;else if("./"==o.substr(0,2))return Promise.resolve(i+"/"+e(t,n,i,o.substr(2)+s.substr(r.length),a)).then(function(e){return L.call(t,e,i+"/")});return t.normalize(o+s.substr(r.length),i+"/")}function a(t,e,n,r,o,a){var l=e.map[r];return"string"==typeof l?(i(r,l,n),s(t,e,n,r,l,o,a)):t.builder?Promise.resolve(n+"/#:"+o):t["import"](e.map["@env"]||"@system-env",n).then(function(t){for(var e in l){var n="~"==e[0],i=b(n?e.substr(1):e,t);if(!n&&i||n&&!i)return l[e]}}).then(function(l){if(l){if("string"!=typeof l)throw new Error("Unable to map a package conditional to a package conditional.");return i(r,l,n),s(t,e,n,r,l,o,a)}})}function u(t){var e=t.lastIndexOf("*"),n=Math.max(e+1,t.lastIndexOf("/"));return{length:n,regEx:new RegExp("^("+t.substr(0,n).replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^\\/]+")+")(\\/|$)"),wildcard:e!=-1}}function f(t,e){for(var n,i,r=!1,o=0;ol&&(l=n),v(a,e,n&&l>n)}),v(n.metadata,a)}}return e})}})}(),function(){function e(){if(s&&"interactive"===s.script.readyState)return s.load;for(var t=0;t=0;a--){for(var l=r[a],c=0;c100&&!o.metadata.format&&(o.metadata.format="global","traceur"===s.transpiler&&(o.metadata.exports="traceur"),"typescript"===s.transpiler&&(o.metadata.exports="ts")),s._loader.loadedTranspiler=!0),s._loader.loadedTranspilerRuntime===!1&&(o.name!=s.normalizeSync("traceur-runtime")&&o.name!=s.normalizeSync("babel/external-helpers*")||(r.length>100&&(o.metadata.format=o.metadata.format||"global"),s._loader.loadedTranspilerRuntime=!0)),("register"==o.metadata.format||o.metadata.bundle)&&s._loader.loadedTranspilerRuntime!==!0){if(!t.$traceurRuntime&&o.source.match(n))return s._loader.loadedTranspilerRuntime=s._loader.loadedTranspilerRuntime||!1,s["import"]("traceur-runtime").then(function(){return r});if(!t.babelHelpers&&o.source.match(i))return s._loader.loadedTranspilerRuntime=s._loader.loadedTranspilerRuntime||!1,s["import"]("babel/external-helpers").then(function(){return r})}return r})}})}();var at="undefined"!=typeof self?"self":"global";c("fetch",function(t){return function(e){return e.metadata.exports&&!e.metadata.format&&(e.metadata.format="global"),t.call(this,e)}}),c("instantiate",function(t){return function(e){var n=this;if(e.metadata.format||(e.metadata.format="global"),"global"==e.metadata.format&&!e.metadata.registered){var i=P();e.metadata.entry=i,i.deps=[];for(var r in e.metadata.globals){var o=e.metadata.globals[r];o&&i.deps.push(o)}i.execute=function(t,i,r){var o;if(e.metadata.globals){o={};for(var s in e.metadata.globals)e.metadata.globals[s]&&(o[s]=t(e.metadata.globals[s]))}var a=e.metadata.exports;a&&(e.source+="\n"+at+'["'+a+'"] = '+a+";");var l=n.get("@@global-helpers").prepareGlobal(r.id,a,o);return Z.call(n,e),l()}}return t.call(this,e)}}),c("reduceRegister_",function(t){return function(e,n){if(n||!e.metadata.exports)return t.call(this,e,n);e.metadata.format="global";var i=e.metadata.entry=P();i.deps=e.metadata.deps;var r=O(e.metadata.exports);i.execute=function(){return r}}}),h(function(e){return function(){function n(e){if(Object.keys)Object.keys(t).forEach(e);else for(var n in t)s.call(t,n)&&e(n)}function i(e){n(function(n){if($.call(a,n)==-1){try{var i=t[n]}catch(r){a.push(n)}e(n,i)}})}var r=this;e.call(r);var o,s=Object.prototype.hasOwnProperty,a=["_g","sessionStorage","localStorage","clipboardData","frames","frameElement","external","mozAnimationStartTime","webkitStorageInfo","webkitIndexedDB","mozInnerScreenY","mozInnerScreenX"];r.set("@@global-helpers",r.newModule({prepareGlobal:function(e,n,r){var s=t.define;t.define=void 0;var a;if(r){a={};for(var l in r)a[l]=t[l],t[l]=r[l]}return n||(o={},i(function(t,e){o[t]=e})),function(){var e;if(n)e=O(n);else{e={};var r,l;i(function(t,n){o[t]!==n&&"undefined"!=typeof n&&(e[t]=n,"undefined"!=typeof r?l||r===n||(l=!0):r=n)}),e=l?e:r}if(a)for(var u in a)t[u]=a[u];return t.define=s,e}}}))}}),function(){function e(t){function e(t,e){for(var n=0;ne.index)return!0;return!1}i.lastIndex=r.lastIndex=o.lastIndex=0;var n,s=[],a=[],l=[];if(t.length/t.split("\n").length<200){for(;n=o.exec(t);)a.push([n.index,n.index+n[0].length]);for(;n=r.exec(t);)e(a,n)||l.push([n.index,n.index+n[0].length])}for(;n=i.exec(t);)if(!e(a,n)&&!e(l,n)){var u=n[1].substr(1,n[1].length-2);if(u.match(/"|'/))continue;"/"==u[u.length-1]&&(u=u.substr(0,u.length-1)),s.push(u)}return s}var n=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.]))/,i=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,r=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,o=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=/^\#\!.*/;c("instantiate",function(r){return function(o){var a=this;if(o.metadata.format||(n.lastIndex=0,i.lastIndex=0,(i.exec(o.source)||n.exec(o.source))&&(o.metadata.format="cjs")),"cjs"==o.metadata.format){var l=o.metadata.deps,u=o.metadata.cjsRequireDetection===!1?[]:e(o.source);for(var c in o.metadata.globals)o.metadata.globals[c]&&u.push(o.metadata.globals[c]);var h=P();o.metadata.entry=h,h.deps=u,h.executingRequire=!0,h.execute=function(e,n,i){function r(t){return"/"==t[t.length-1]&&(t=t.substr(0,t.length-1)),e.apply(this,arguments)}if(r.resolve=function(t){return a.get("@@cjs-helpers").requireResolve(t,i.id)},!o.metadata.cjsDeferDepsExecute)for(var u=0;u1;)i=r.shift(),t=t[i]=t[i]||{};i=r.shift(),i in t||(t[i]=n)}h(function(t){return function(){this.meta={},t.call(this)}}),c("locate",function(t){return function(e){var n,i=this.meta,r=e.name,o=0;for(var s in i)if(n=s.indexOf("*"),n!==-1&&s.substr(0,n)===r.substr(0,n)&&s.substr(n+1)===r.substr(r.length-s.length+n+1)){var a=s.split("/").length;a>o&&(o=a),v(e.metadata,i[s],o!=a)}return i[r]&&v(e.metadata,i[r]),t.call(this,e)}});var e=/^(\s*\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/,n=/\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;c("translate",function(i){return function(r){var o=r.source.match(e);if(o)for(var s=o[0].match(n),a=0;a')}else t()}else if("undefined"!=typeof importScripts){var r="";try{throw new Error("_")}catch(o){o.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/,function(t,e){$__curScript={src:e},r=e.replace(/\/[^\/]*$/,"/")})}e&&importScripts(r+"system-polyfills.js"),t()}else $__curScript="undefined"!=typeof __filename?{src:__filename}:null,t()}(),!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e=!!t&&"length"in t&&t.length,n=ot.type(t);return"function"!==n&&!ot.isWindow(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function i(t,e,n){if(ot.isFunction(e))return ot.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return ot.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(gt.test(e))return ot.filter(e,t,n);e=ot.filter(e,t)}return ot.grep(t,function(t){return Q.call(e,t)>-1!==n})}function r(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function o(t){var e={};return ot.each(t.match(_t)||[],function(t,n){e[n]=!0}),e}function s(){K.removeEventListener("DOMContentLoaded",s),t.removeEventListener("load",s),ot.ready()}function a(){this.expando=ot.expando+a.uid++}function l(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(Pt,"-$&").toLowerCase(),n=t.getAttribute(i),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Et.test(n)?ot.parseJSON(n):n)}catch(r){}Tt.set(t,e,n)}else n=void 0;return n}function u(t,e,n,i){var r,o=1,s=20,a=i?function(){return i.cur()}:function(){return ot.css(t,e,"")},l=a(),u=n&&n[3]||(ot.cssNumber[e]?"":"px"),c=(ot.cssNumber[e]||"px"!==u&&+l)&&Mt.exec(ot.css(t,e));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;do o=o||".5",c/=o,ot.style(t,e,c+u);while(o!==(o=a()/l)&&1!==o&&--s)}return n&&(c=+c||+l||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=u,i.start=c,i.end=r)),r}function c(t,e){var n="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&ot.nodeName(t,e)?ot.merge([t],n):n}function h(t,e){for(var n=0,i=t.length;i>n;n++)Ct.set(t[n],"globalEval",!e||Ct.get(e[n],"globalEval"))}function f(t,e,n,i,r){for(var o,s,a,l,u,f,d=e.createDocumentFragment(),p=[],g=0,m=t.length;m>g;g++)if(o=t[g],o||0===o)if("object"===ot.type(o))ot.merge(p,o.nodeType?[o]:o);else if(zt.test(o)){for(s=s||d.appendChild(e.createElement("div")),a=(It.exec(o)||["",""])[1].toLowerCase(),l=Nt[a]||Nt._default,s.innerHTML=l[1]+ot.htmlPrefilter(o)+l[2],f=l[0];f--;)s=s.lastChild;ot.merge(p,s.childNodes),s=d.firstChild,s.textContent=""}else p.push(e.createTextNode(o));for(d.textContent="",g=0;o=p[g++];)if(i&&ot.inArray(o,i)>-1)r&&r.push(o);else if(u=ot.contains(o.ownerDocument,o),s=c(d.appendChild(o),"script"),u&&h(s),n)for(f=0;o=s[f++];)Rt.test(o.type||"")&&n.push(o);return d}function d(){return!0}function p(){return!1}function g(){try{return K.activeElement}catch(t){}}function m(t,e,n,i,r,o){var s,a;if("object"==typeof e){"string"!=typeof n&&(i=i||n,n=void 0);for(a in e)m(t,a,n,i,e[a],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),r===!1)r=p;else if(!r)return t;return 1===o&&(s=r,r=function(t){return ot().off(t),s.apply(this,arguments)},r.guid=s.guid||(s.guid=ot.guid++)),t.each(function(){ot.event.add(this,e,r,i,n)})}function v(t,e){return ot.nodeName(t,"table")&&ot.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function y(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function b(t){var e=Ut.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function w(t,e){var n,i,r,o,s,a,l,u;if(1===e.nodeType){if(Ct.hasData(t)&&(o=Ct.access(t),s=Ct.set(e,o),u=o.events)){delete s.handle,s.events={};for(r in u)for(n=0,i=u[r].length;i>n;n++)ot.event.add(e,r,u[r][n])}Tt.hasData(t)&&(a=Tt.access(t),l=ot.extend({},a),Tt.set(e,l))}}function _(t,e){var n=e.nodeName.toLowerCase();"input"===n&&Lt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function x(t,e,n,i){e=J.apply([],e);var r,o,s,a,l,u,h=0,d=t.length,p=d-1,g=e[0],m=ot.isFunction(g);if(m||d>1&&"string"==typeof g&&!it.checkClone&&Bt.test(g))return t.each(function(r){var o=t.eq(r);m&&(e[0]=g.call(this,r,o.html())),x(o,e,n,i)});if(d&&(r=f(e,t[0].ownerDocument,!1,t,i),o=r.firstChild,1===r.childNodes.length&&(r=o),o||i)){for(s=ot.map(c(r,"script"),y),a=s.length;d>h;h++)l=r,h!==p&&(l=ot.clone(l,!0,!0),a&&ot.merge(s,c(l,"script"))),n.call(t[h],l,h);if(a)for(u=s[s.length-1].ownerDocument,ot.map(s,b),h=0;a>h;h++)l=s[h],Rt.test(l.type||"")&&!Ct.access(l,"globalEval")&&ot.contains(u,l)&&(l.src?ot._evalUrl&&ot._evalUrl(l.src):ot.globalEval(l.textContent.replace(qt,"")))}return t}function S(t,e,n){for(var i,r=e?ot.filter(e,t):t,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||ot.cleanData(c(i)),i.parentNode&&(n&&ot.contains(i.ownerDocument,i)&&h(c(i,"script")),i.parentNode.removeChild(i));return t}function k(t,e){var n=ot(e.createElement(t)).appendTo(e.body),i=ot.css(n[0],"display");return n.detach(),i}function C(t){var e=K,n=Vt[t];return n||(n=k(t,e),"none"!==n&&n||(Yt=(Yt||ot("':""),t._keyEvent=!1,I},_generateMonthYearHeader:function(t,e,n,i,r,o,s,a){var l=this._get(t,"changeMonth"),u=this._get(t,"changeYear"),c=this._get(t,"showMonthAfterYear"),h='
          ',f="";if(o||!l)f+=''+s[e]+"";else{var d=i&&i.getFullYear()==n,p=r&&r.getFullYear()==n;f+='"}if(c||(h+=f+(!o&&l&&u?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!u)h+=''+n+"";else{var m=this._get(t,"yearRange").split(":"),v=(new Date).getFullYear(),y=function(t){var e=t.match(/c[+-].*/)?n+parseInt(t.substring(1),10):t.match(/[+-].*/)?v+parseInt(t,10):parseInt(t,10);return isNaN(e)?v:e},b=y(m[0]),w=Math.max(b,y(m[1]||""));for(b=i?Math.max(b,i.getFullYear()):b,w=r?Math.min(w,r.getFullYear()):w,t.yearshtml+='",h+=t.yearshtml,t.yearshtml=null}return h+=this._get(t,"yearSuffix"),c&&(h+=(!o&&l&&u?"":" ")+f),h+="
          "},_adjustInstDate:function(t,e,n){var i=t.drawYear+("Y"==n?e:0),r=t.drawMonth+("M"==n?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(i,r))+("D"==n?e:0),s=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(i,r,o)));t.selectedDay=s.getDate(),t.drawMonth=t.selectedMonth=s.getMonth(),t.drawYear=t.selectedYear=s.getFullYear(),"M"!=n&&"Y"!=n||this._notifyChange(t)},_restrictMinMax:function(t,e){var n=this._getMinMaxDate(t,"min"),i=this._getMinMaxDate(t,"max"),r=n&&ei?i:r},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,n,i){var r=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(n,i+(e<0?e:r[0]*r[1]),1));return e<0&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var n=this._getMinMaxDate(t,"min"),i=this._getMinMaxDate(t,"max");return(!n||e.getTime()>=n.getTime())&&(!i||e.getTime()<=i.getTime())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,n,i){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var r=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(i,n,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),r,this._getFormatConfig(t))}}),$.fn.datepicker=function(t){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var e=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!=t&&"getDate"!=t&&"widget"!=t?"option"==t&&2==arguments.length&&"string"==typeof arguments[1]?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this].concat(e)):$.datepicker._attachDatepicker(this,t)}):$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(t,e){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",i={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},r={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var n=t(this).css(e).offset().top;n<0&&t(this).css("top",e.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),"string"!=typeof this.originalTitle&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var e,i,r,o,s,a=this,l=this.options,u=l.title||" ";e=(this.uiDialog=t("
          ")).addClass(n+l.dialogClass).css({display:"none",outline:0,zIndex:l.zIndex}).attr("tabIndex",-1).keydown(function(e){l.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE&&(a.close(e),e.preventDefault())}).mousedown(function(t){a.moveToTop(!1,t)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(e),i=(this.uiDialogTitlebar=t("
          ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){e.focus()}).prependTo(e),r=t("").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(t){t.preventDefault(),a.close(t)}).appendTo(i),(this.uiDialogTitlebarCloseText=t("")).addClass("ui-icon ui-icon-closethick").text(l.closeText).appendTo(r),o=t("").uniqueId().addClass("ui-dialog-title").html(u).prependTo(i),s=(this.uiDialogButtonPane=t("
          ")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=t("
          ")).addClass("ui-dialog-buttonset").appendTo(s),e.attr({role:"dialog","aria-labelledby":o.attr("id")}),i.find("*").add(i).disableSelection(),this._hoverable(r),this._focusable(r),l.draggable&&t.fn.draggable&&this._makeDraggable(),l.resizable&&t.fn.resizable&&this._makeResizable(),this._createButtons(l.buttons),this._isOpen=!1,t.fn.bgiframe&&e.bgiframe(),this._on(e,{keydown:function(n){if(l.modal&&n.keyCode===t.ui.keyCode.TAB){var i=t(":tabbable",e),r=i.filter(":first"),o=i.filter(":last");return n.target!==o[0]||n.shiftKey?n.target===r[0]&&n.shiftKey?(o.focus(1),!1):void 0:(r.focus(1),!1)}}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var t,e=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(e){var n,i,r=this;if(this._isOpen&&!1!==this._trigger("beforeClose",e))return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){r._trigger("close",e)}):(this.uiDialog.hide(),this._trigger("close",e)),t.ui.dialog.overlay.resize(),this.options.modal&&(n=0,t(".ui-dialog").each(function(){this!==r.uiDialog[0]&&(i=t(this).css("z-index"),isNaN(i)||(n=Math.max(n,i)))}),t.ui.dialog.maxZ=n),this},isOpen:function(){return this._isOpen},moveToTop:function(e,n){var i,r=this.options;return r.modal&&!e||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>t.ui.dialog.maxZ&&(t.ui.dialog.maxZ=r.zIndex),this.overlay&&(t.ui.dialog.maxZ+=1,t.ui.dialog.overlay.maxZ=t.ui.dialog.maxZ,this.overlay.$el.css("z-index",t.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},t.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",t.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(!this._isOpen){var e,n=this.options,i=this.uiDialog;return this._size(),this._position(n.position),i.show(n.show),this.overlay=n.modal?new t.ui.dialog.overlay(this):null,this.moveToTop(!0),e=this.element.find(":tabbable"),e.length||(e=this.uiDialogButtonPane.find(":tabbable"),e.length||(e=i)),e.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this}},_createButtons:function(e){var n=this,i=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),"object"==typeof e&&null!==e&&t.each(e,function(){return!(i=!0)}),i?(t.each(e,function(e,i){var r,o;i=t.isFunction(i)?{click:i,text:e}:i,i=t.extend({type:"button"},i),o=i.click,i.click=function(){o.apply(n.element[0],arguments)},r=t("",i).appendTo(n.uiButtonSet),t.fn.button&&r.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var n=this,i=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,r){t(this).addClass("ui-dialog-dragging"),n._trigger("dragStart",i,e(r))},drag:function(t,i){n._trigger("drag",t,e(i))},stop:function(r,o){i.position=[o.position.left-n.document.scrollLeft(),o.position.top-n.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),n._trigger("dragStop",r,e(o)),t.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function i(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}n=n===e?this.options.resizable:n;var r=this,o=this.options,s=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:a,start:function(e,n){t(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",e,i(n))},resize:function(t,e){r._trigger("resize",t,i(e))},stop:function(e,n){t(this).removeClass("ui-dialog-resizing"),o.height=t(this).height(),o.width=t(this).width(),r._trigger("resizeStop",e,i(n)),t.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(e){var n,i=[],r=[0,0];e?(("string"==typeof e||"object"==typeof e&&"0"in e)&&(i=e.split?e.split(" "):[e[0],e[1]],1===i.length&&(i[1]=i[0]),t.each(["left","top"],function(t,e){+i[t]===i[t]&&(r[t]=i[t],i[t]=e)}),e={my:i[0]+(r[0]<0?r[0]:"+"+r[0])+" "+i[1]+(r[1]<0?r[1]:"+"+r[1]),at:i.join(" ")}),e=t.extend({},t.ui.dialog.prototype.options.position,e)):e=t.ui.dialog.prototype.options.position,n=this.uiDialog.is(":visible"),n||this.uiDialog.show(),this.uiDialog.position(e),n||this.uiDialog.hide()},_setOptions:function(e){var n=this,o={},s=!1;t.each(e,function(t,e){n._setOption(t,e),t in i&&(s=!0),t in r&&(o[t]=e)}),s&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,i){var r,o,s=this.uiDialog;switch(e){case"buttons":this._createButtons(i);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+i);break;case"dialogClass":s.removeClass(this.options.dialogClass).addClass(n+i);break;case"disabled":i?s.addClass("ui-dialog-disabled"):s.removeClass("ui-dialog-disabled");break;case"draggable":r=s.is(":data(draggable)"),r&&!i&&s.draggable("destroy"),!r&&i&&this._makeDraggable();break;case"position":this._position(i);break;case"resizable":o=s.is(":data(resizable)"),o&&!i&&s.resizable("destroy"),o&&"string"==typeof i&&s.resizable("option","handles",i),o||i===!1||this._makeResizable(i);break;case"title":t(".ui-dialog-title",this.uiDialogTitlebar).html(""+(i||" "))}this._super(e,i)},_size:function(){var e,n,i,r=this.options,o=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),n=Math.max(0,r.minHeight-e),"auto"===r.height?t.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),i=this.element.css("height","auto").height(),o||this.uiDialog.hide(),this.element.height(Math.max(i,n))):this.element.height(Math.max(r.height-e,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),t.extend(t.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(t){var e=t.attr("id");return e||(this.uuid+=1,e=this.uuid),"ui-dialog-title-"+e},overlay:function(e){this.$el=t.ui.dialog.overlay.create(e)}}),t.extend(t.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:t.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(t){return t+".dialog-overlay"}).join(" "),create:function(e){0===this.instances.length&&(setTimeout(function(){t.ui.dialog.overlay.instances.length&&t(document).bind(t.ui.dialog.overlay.events,function(e){if(t(e.target).zIndex()").addClass("ui-widget-overlay");return t(document).bind("keydown.dialog-overlay",function(i){var r=t.ui.dialog.overlay.instances;0!==r.length&&r[r.length-1]===n&&e.options.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===t.ui.keyCode.ESCAPE&&(e.close(i),i.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),t.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(e){var n=t.inArray(e,this.instances),i=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),0===this.instances.length&&t([document,window]).unbind(".dialog-overlay"),e.height(0).width(0).remove(),t.each(this.instances,function(){i=Math.max(i,this.css("z-index"))}),this.maxZ=i},height:function(){var e,n;return t.ui.ie?(e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),e
          ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0))},_mouseStart:function(e){var n=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,n){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!n){var i=this._uiHash();if(this._trigger("drag",e,i)===!1)return this._mouseUp({}),!1;this.position=i.position}return this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var n=!1;t.ui.ddmanager&&!this.options.dropBehaviour&&(n=t.ui.ddmanager.drop(this,e)),this.dropped&&(n=this.dropped,this.dropped=!1);for(var i=this.element[0],r=!1;i&&(i=i.parentNode);)i==document&&(r=!0);if(!r&&"original"===this.options.helper)return!1;if("invalid"==this.options.revert&&!n||"valid"==this.options.revert&&n||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var o=this;t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){o._trigger("stop",e)!==!1&&o._clear()})}else this._trigger("stop",e)!==!1&&this._clear();return!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){var n=!this.options.handle||!t(this.options.handle,this.element).length;return t(this.options.handle,this.element).find("*").andSelf().each(function(){this==e.target&&(n=!0)}),n},_createHelper:function(e){var n=this.options,i=t.isFunction(n.helper)?t(n.helper.apply(this.element[0],[e])):"clone"==n.helper?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo("parent"==n.appendTo?this.element[0].parentNode:n.appendTo),i[0]==this.element[0]||/(fixed|absolute)/.test(i.css("position"))||i.css("position","absolute"),i},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),"document"!=e.containment&&"window"!=e.containment||(this.containment=["document"==e.containment?0:t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"==e.containment?0:t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"==e.containment?0:t(window).scrollLeft())+t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==e.containment?0:t(window).scrollTop())+(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(e.containment)||e.containment.constructor==Array)e.containment.constructor==Array&&(this.containment=e.containment);else{var n=t(e.containment),i=n[0];if(!i)return;var r=(n.offset(),"hidden"!=t(i).css("overflow"));this.containment=[(parseInt(t(i).css("borderLeftWidth"),10)||0)+(parseInt(t(i).css("paddingLeft"),10)||0),(parseInt(t(i).css("borderTopWidth"),10)||0)+(parseInt(t(i).css("paddingTop"),10)||0),(r?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t(i).css("borderLeftWidth"),10)||0)-(parseInt(t(i).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(r?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t(i).css("borderTopWidth"),10)||0)-(parseInt(t(i).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}},_convertPositionTo:function(e,n){n||(n=this.position);var i="absolute"==e?1:-1,r=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),o=/(html|body)/i.test(r[0].tagName);return{top:n.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():o?0:r.scrollTop())*i,left:n.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():o?0:r.scrollLeft())*i}},_generatePosition:function(e){var n=this.options,i="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(i[0].tagName),o=e.pageX,s=e.pageY;if(this.originalPosition){var a;if(this.containment){if(this.relative_container){var l=this.relative_container.offset();a=[this.containment[0]+l.left,this.containment[1]+l.top,this.containment[2]+l.left,this.containment[3]+l.top]}else a=this.containment;e.pageX-this.offset.click.lefta[2]&&(o=a[2]+this.offset.click.left),e.pageY-this.offset.click.top>a[3]&&(s=a[3]+this.offset.click.top)}if(n.grid){var u=n.grid[1]?this.originalPageY+Math.round((s-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;s=a&&(u-this.offset.click.topa[3])?u-this.offset.click.topa[2])?c-this.offset.click.left=0;c--){var h=i.snapElements[c].left,f=h+i.snapElements[c].width,d=i.snapElements[c].top,p=d+i.snapElements[c].height;if(h-o=c&&s<=h||a>=c&&a<=h||sh)&&(r>=l&&r<=u||o>=l&&o<=u||ru);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,n){var i=t.ui.ddmanager.droppables[e.options.scope]||[],r=n?n.type:null,o=(e.currentItem||e.element).find(":data(droppable)").andSelf();t:for(var s=0;st?0:i.max")[0],g=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,g(h,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),c.fn=e.extend(c.prototype,{parse:function(o,a,l,u){if(o===n)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=e(o).css(a),a=n);var f=this,d=e.type(o),p=this._rgba=[];return a!==n&&(o=[o,a,l,u],d="array"),"string"===d?this.parse(r(o)||s._default):"array"===d?(g(h.rgba.props,function(t,e){p[e.idx]=i(o[e.idx],e)}),this):"object"===d?(o instanceof c?g(h,function(t,e){o[e.cache]&&(f[e.cache]=o[e.cache].slice())}):g(h,function(e,n){var r=n.cache;g(n.props,function(t,e){if(!f[r]&&n.to){if("alpha"===t||null==o[t])return;f[r]=n.to(f._rgba)}f[r][e.idx]=i(o[t],e,!0)}),f[r]&&t.inArray(null,f[r].slice(0,3))<0&&(f[r][3]=1,n.from&&(f._rgba=n.from(f[r])))}),this):void 0},is:function(t){var e=c(t),n=!0,i=this;return g(h,function(t,r){var o,s=e[r.cache];return s&&(o=i[r.cache]||r.to&&r.to(i._rgba)||[],g(r.props,function(t,e){if(null!=s[e.idx])return n=s[e.idx]===o[e.idx]})),n}),n},_space:function(){var t=[],e=this;return g(h,function(n,i){e[i.cache]&&t.push(n)}),t.pop()},transition:function(t,e){var n=c(t),r=n._space(),o=h[r],s=0===this.alpha()?c("transparent"):this,a=s[o.cache]||o.to(s._rgba),l=a.slice();return n=n[o.cache],g(o.props,function(t,r){var o=r.idx,s=a[o],u=n[o],c=f[r.type]||{};null!==u&&(null===s?l[o]=u:(c.mod&&(u-s>c.mod/2?s+=c.mod:s-u>c.mod/2&&(s-=c.mod)),l[o]=i((u-s)*e+s,r)))}),this[r](l)},blend:function(t){if(1===this._rgba[3])return this;var n=this._rgba.slice(),i=n.pop(),r=c(t)._rgba;return c(e.map(n,function(t,e){return(1-i)*r[e]+i*t}))},toRgbaString:function(){var t="rgba(",n=e.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===n[3]&&(n.pop(),t="rgb("),t+n.join()+")"},toHslaString:function(){var t="hsla(",n=e.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&e<3&&(t=Math.round(100*t)+"%"),t});return 1===n[3]&&(n.pop(),t="hsl("),t+n.join()+")"},toHexString:function(t){var n=this._rgba.slice(),i=n.pop();return t&&n.push(~~(255*i)),"#"+e.map(n,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),c.fn.parse.prototype=c.fn,h.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,s=t[3],a=Math.max(i,r,o),l=Math.min(i,r,o),u=a-l,c=a+l,h=.5*c;return e=l===a?0:i===a?60*(r-o)/u+360:r===a?60*(o-i)/u+120:60*(i-r)/u+240,n=0===h||1===h?h:h<=.5?u/c:u/(2-c),[Math.round(e)%360,n,h,null==s?1:s]},h.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,n=t[1],i=t[2],r=t[3],s=i<=.5?i*(1+n):i+n-i*n,a=2*i-s;return[Math.round(255*o(a,s,e+1/3)),Math.round(255*o(a,s,e)),Math.round(255*o(a,s,e-1/3)),r]},g(h,function(t,r){var o=r.props,s=r.cache,a=r.to,u=r.from;c.fn[t]=function(t){if(a&&!this[s]&&(this[s]=a(this._rgba)),t===n)return this[s].slice();var r,l=e.type(t),h="array"===l||"object"===l?t:arguments,f=this[s].slice();return g(o,function(t,e){var n=h["object"===l?t:e.idx];null==n&&(n=f[e.idx]),f[e.idx]=i(n,e)}),u?(r=c(u(f)),r[s]=f,r):c(f)},g(o,function(n,i){c.fn[n]||(c.fn[n]=function(r){var o,s=e.type(r),a="alpha"===n?this._hsla?"hsla":"rgba":t,u=this[a](),c=u[i.idx];return"undefined"===s?c:("function"===s&&(r=r.call(this,c),s=e.type(r)),null==r&&i.empty?this:("string"===s&&(o=l.exec(r),o&&(r=c+parseFloat(o[2])*("+"===o[1]?1:-1))),u[i.idx]=r,this[a](u)))})})}),g(a,function(t,n){e.cssHooks[n]={set:function(t,i){var o,s,a="";if("string"!==e.type(i)||(o=r(i))){if(i=c(o||i),!d.rgba&&1!==i._rgba[3]){for(s="backgroundColor"===n?t.parentNode:t;(""===a||"transparent"===a)&&s&&s.style;)try{a=e.css(s,"backgroundColor"),s=s.parentNode}catch(l){}i=i.blend(a&&"transparent"!==a?a:"_default")}i=i.toRgbaString()}try{t.style[n]=i}catch(u){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=c(t.elem,n),t.end=c(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos))}}),e.cssHooks.borderColor={expand:function(t){var e={};return g(["Top","Right","Bottom","Left"],function(n,i){e["border"+i+"Color"]=t}),e}},s=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function n(){var e,n,i=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,r={};if(i&&i.length&&i[0]&&i[i[0]])for(n=i.length;n--;)e=i[n],"string"==typeof i[e]&&(r[t.camelCase(e)]=i[e]);else for(e in i)"string"==typeof i[e]&&(r[e]=i[e]);return r}function i(e,n){var i,r,s={};for(i in n)r=n[i],e[i]!==r&&(o[i]||!t.fx.step[i]&&isNaN(parseFloat(r))||(s[i]=r));return s}var r=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,n){t.fx.step[n]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,n,t.end),t.setAttr=!0)}}),t.effects.animateClass=function(e,o,s,a){var l=t.speed(o,s,a);return this.queue(function(){var o,s=t(this),a=s.attr("class")||"",u=l.children?s.find("*").andSelf():s;u=u.map(function(){var e=t(this);return{el:e,start:n.call(this)}}),o=function(){t.each(r,function(t,n){e[n]&&s[n+"Class"](e[n])})},o(),u=u.map(function(){return this.end=n.call(this.el[0]),this.diff=i(this.start,this.end),this}),s.attr("class",a),u=u.map(function(){var e=this,n=t.Deferred(),i=jQuery.extend({},l,{queue:!1,complete:function(){n.resolve(e)}});return this.el.animate(this.diff,i),n.promise()}),t.when.apply(t,u.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(s[0])})})},t.fn.extend({_addClass:t.fn.addClass,addClass:function(e,n,i,r){return n?t.effects.animateClass.call(this,{add:e},n,i,r):this._addClass(e)},_removeClass:t.fn.removeClass,removeClass:function(e,n,i,r){return n?t.effects.animateClass.call(this,{remove:e},n,i,r):this._removeClass(e)},_toggleClass:t.fn.toggleClass,toggleClass:function(n,i,r,o,s){return"boolean"==typeof i||i===e?r?t.effects.animateClass.call(this,i?{add:n}:{remove:n},r,o,s):this._toggleClass(n,i):t.effects.animateClass.call(this,{toggle:n},i,r,o)},switchClass:function(e,n,i,r,o){return t.effects.animateClass.call(this,{add:n,remove:e},i,r,o)}})}(),function(){function r(e,n,i,r){return t.isPlainObject(e)&&(n=e,e=e.effect),e={effect:e},null==n&&(n={}),t.isFunction(n)&&(r=n,i=null,n={}),("number"==typeof n||t.fx.speeds[n])&&(r=i,i=n,n={}),t.isFunction(i)&&(r=i,i=null),n&&t.extend(e,n),i=i||n.duration,e.duration=t.fx.off?0:"number"==typeof i?i:i in t.fx.speeds?t.fx.speeds[i]:t.fx.speeds._default,e.complete=r||n.complete,e}function o(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||"string"==typeof e&&!t.effects.effect[e]&&(!n||!t.effects[e])}t.extend(t.effects,{version:"1.9.2",save:function(t,e){for(var n=0;n
          ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),r={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(s){o=document.body}return e.wrap(i),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),i=e.parent(),"static"===e.css("position")?(i.css({position:"relative"}),e.css({position:"relative"})):(t.extend(n,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,i){n[i]=e.css(i),isNaN(parseInt(n[i],10))&&(n[i]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(r),i.css(n).show()},removeWrapper:function(e){var n=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===n||t.contains(e[0],n))&&t(n).focus()),e},setTransition:function(e,n,i,r){return r=r||{},t.each(n,function(t,n){var o=e.cssUnit(n);o[0]>0&&(r[n]=o[0]*i+o[1])}),r}}),t.fn.extend({effect:function(){function e(e){function n(){t.isFunction(o)&&o.call(r[0]),t.isFunction(e)&&e()}var r=t(this),o=i.complete,s=i.mode;(r.is(":hidden")?"hide"===s:"show"===s)?n():a.call(r[0],i,n)}var i=r.apply(this,arguments),o=i.mode,s=i.queue,a=t.effects.effect[i.effect],l=!a&&n&&t.effects[i.effect];return t.fx.off||!a&&!l?o?this[o](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a?s===!1?this.each(e):this.queue(s||"fx",e):l.call(this,{options:i,duration:i.duration,callback:i.complete,mode:i.mode})},_show:t.fn.show,show:function(t){if(o(t))return this._show.apply(this,arguments);var e=r.apply(this,arguments);return e.mode="show",this.effect.call(this,e)},_hide:t.fn.hide,hide:function(t){if(o(t))return this._hide.apply(this,arguments);var e=r.apply(this,arguments);return e.mode="hide",this.effect.call(this,e)},__toggle:t.fn.toggle,toggle:function(e){if(o(e)||"boolean"==typeof e||t.isFunction(e))return this.__toggle.apply(this,arguments);var n=r.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(e){var n=this.css(e),i=[];return t.each(["em","px","%","pt"],function(t,e){n.indexOf(e)>0&&(i=[parseFloat(n),e])}),i}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,n){e[n]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,n){t.easing["easeIn"+e]=n,t.easing["easeOut"+e]=function(t){return 1-n(1-t)},t.easing["easeInOut"+e]=function(t){return t<.5?n(2*t)/2:1-n(t*-2+2)/2}})}()}(jQuery),function(t,e){var n=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(e,r){var o,s,a,l=t(this),u=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,e.mode||"hide"),h=e.direction||"up",f=n.test(h),d=f?"height":"width",p=f?"top":"left",g=i.test(h),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),u):t.effects.save(l,u),l.show(),o=t.effects.createWrapper(l).css({overflow:"hidden"}),s=o[d](),a=parseFloat(o.css(p))||0,m[d]=v?s:0,g||(l.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),m[p]=v?a:s+a),v&&(o.css(d,0),g||o.css(p,a+s)),o.animate(m,{duration:e.duration,easing:e.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,u),t.effects.removeWrapper(l),r()}})}}(jQuery),function(t,e){t.effects.effect.bounce=function(e,n){var i,r,o,s=t(this),a=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(s,e.mode||"effect"),u="hide"===l,c="show"===l,h=e.direction||"up",f=e.distance,d=e.times||5,p=2*d+(c||u?1:0),g=e.duration/p,m=e.easing,v="up"===h||"down"===h?"top":"left",y="up"===h||"left"===h,b=s.queue(),w=b.length;for((c||u)&&a.push("opacity"),t.effects.save(s,a),s.show(),t.effects.createWrapper(s),f||(f=s["top"===v?"outerHeight":"outerWidth"]()/3),c&&(o={opacity:1},o[v]=0,s.css("opacity",0).css(v,y?2*-f:2*f).animate(o,g,m)),u&&(f/=Math.pow(2,d-1)),o={},o[v]=0,i=0;i1&&b.splice.apply(b,[1,0].concat(b.splice(w,p+1))),s.dequeue()}}(jQuery),function(t,e){t.effects.effect.clip=function(e,n){var i,r,o,s=t(this),a=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(s,e.mode||"hide"),u="show"===l,c=e.direction||"vertical",h="vertical"===c,f=h?"height":"width",d=h?"top":"left",p={};t.effects.save(s,a),s.show(),i=t.effects.createWrapper(s).css({overflow:"hidden"}),r="IMG"===s[0].tagName?i:s,o=r[f](),u&&(r.css(f,0),r.css(d,o/2)),p[f]=u?o:0,p[d]=u?0:o/2,r.animate(p,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){u||s.hide(),t.effects.restore(s,a),t.effects.removeWrapper(s),n()}})}}(jQuery),function(t,e){t.effects.effect.drop=function(e,n){var i,r=t(this),o=["position","top","bottom","left","right","opacity","height","width"],s=t.effects.setMode(r,e.mode||"hide"),a="show"===s,l=e.direction||"left",u="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",h={opacity:a?1:0};t.effects.save(r,o),r.show(),t.effects.createWrapper(r),i=e.distance||r["top"===u?"outerHeight":"outerWidth"](!0)/2,a&&r.css("opacity",0).css(u,"pos"===c?-i:i),h[u]=(a?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+i,r.animate(h,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===s&&r.hide(),t.effects.restore(r,o),t.effects.removeWrapper(r),n()}})}}(jQuery),function(t,e){t.effects.effect.explode=function(e,n){function i(){b.push(this),b.length===h*f&&r()}function r(){d.css({visibility:"visible"}),t(b).remove(),g||d.hide(),n()}var o,s,a,l,u,c,h=e.pieces?Math.round(Math.sqrt(e.pieces)):3,f=h,d=t(this),p=t.effects.setMode(d,e.mode||"hide"),g="show"===p,m=d.show().css("visibility","hidden").offset(),v=Math.ceil(d.outerWidth()/f),y=Math.ceil(d.outerHeight()/h),b=[];for(o=0;o
          ").css({position:"absolute",visibility:"visible",left:-s*v,top:-o*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:a+(g?u*v:0),top:l+(g?c*y:0),opacity:g?0:1}).animate({left:a+(g?0:u*v),top:l+(g?0:c*y),opacity:g?1:0},e.duration||500,e.easing,i)}}(jQuery),function(t,e){t.effects.effect.fade=function(e,n){var i=t(this),r=t.effects.setMode(i,e.mode||"toggle");i.animate({opacity:r},{queue:!1,duration:e.duration,easing:e.easing,complete:n})}}(jQuery),function(t,e){t.effects.effect.fold=function(e,n){var i,r,o=t(this),s=["position","top","bottom","left","right","height","width"],a=t.effects.setMode(o,e.mode||"hide"),l="show"===a,u="hide"===a,c=e.size||15,h=/([0-9]+)%/.exec(c),f=!!e.horizFirst,d=l!==f,p=d?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(o,s),o.show(),i=t.effects.createWrapper(o).css({overflow:"hidden"}),r=d?[i.width(),i.height()]:[i.height(),i.width()],h&&(c=parseInt(h[1],10)/100*r[u?0:1]),l&&i.css(f?{height:0,width:c}:{height:c,width:0}),m[p[0]]=l?r[0]:c,v[p[1]]=l?r[1]:0,i.animate(m,g,e.easing).animate(v,g,e.easing,function(){u&&o.hide(),t.effects.restore(o,s),t.effects.removeWrapper(o),n()})}}(jQuery),function(t,e){t.effects.effect.highlight=function(e,n){var i=t(this),r=["backgroundImage","backgroundColor","opacity"],o=t.effects.setMode(i,e.mode||"show"),s={ -backgroundColor:i.css("backgroundColor")};"hide"===o&&(s.opacity=0),t.effects.save(i,r),i.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(s,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&i.hide(),t.effects.restore(i,r),n()}})}}(jQuery),function(t,e){t.effects.effect.pulsate=function(e,n){var i,r=t(this),o=t.effects.setMode(r,e.mode||"show"),s="show"===o,a="hide"===o,l=s||"hide"===o,u=2*(e.times||5)+(l?1:0),c=e.duration/u,h=0,f=r.queue(),d=f.length;for(!s&&r.is(":visible")||(r.css("opacity",0).show(),h=1),i=1;i1&&f.splice.apply(f,[1,0].concat(f.splice(d,u+1))),r.dequeue()}}(jQuery),function(t,e){t.effects.effect.puff=function(e,n){var i=t(this),r=t.effects.setMode(i,e.mode||"hide"),o="hide"===r,s=parseInt(e.percent,10)||150,a=s/100,l={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:r,complete:n,percent:o?s:100,from:o?l:{height:l.height*a,width:l.width*a,outerHeight:l.outerHeight*a,outerWidth:l.outerWidth*a}}),i.effect(e)},t.effects.effect.scale=function(e,n){var i=t(this),r=t.extend(!0,{},e),o=t.effects.setMode(i,e.mode||"effect"),s=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===o?0:100),a=e.direction||"both",l=e.origin,u={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()},c={y:"horizontal"!==a?s/100:1,x:"vertical"!==a?s/100:1};r.effect="size",r.queue=!1,r.complete=n,"effect"!==o&&(r.origin=l||["middle","center"],r.restore=!0),r.from=e.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:u),r.to={height:u.height*c.y,width:u.width*c.x,outerHeight:u.outerHeight*c.y,outerWidth:u.outerWidth*c.x},r.fade&&("show"===o&&(r.from.opacity=0,r.to.opacity=1),"hide"===o&&(r.from.opacity=1,r.to.opacity=0)),i.effect(r)},t.effects.effect.size=function(e,n){var i,r,o,s=t(this),a=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],u=["width","height","overflow"],c=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],d=t.effects.setMode(s,e.mode||"effect"),p=e.restore||"effect"!==d,g=e.scale||"both",m=e.origin||["middle","center"],v=s.css("position"),y=p?a:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===d&&s.show(),i={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},"toggle"===e.mode&&"show"===d?(s.from=e.to||b,s.to=e.from||i):(s.from=e.from||("show"===d?b:i),s.to=e.to||("hide"===d?b:i)),o={from:{y:s.from.height/i.height,x:s.from.width/i.width},to:{y:s.to.height/i.height,x:s.to.width/i.width}},"box"!==g&&"both"!==g||(o.from.y!==o.to.y&&(y=y.concat(h),s.from=t.effects.setTransition(s,h,o.from.y,s.from),s.to=t.effects.setTransition(s,h,o.to.y,s.to)),o.from.x!==o.to.x&&(y=y.concat(f),s.from=t.effects.setTransition(s,f,o.from.x,s.from),s.to=t.effects.setTransition(s,f,o.to.x,s.to))),"content"!==g&&"both"!==g||o.from.y!==o.to.y&&(y=y.concat(c).concat(u),s.from=t.effects.setTransition(s,c,o.from.y,s.from),s.to=t.effects.setTransition(s,c,o.to.y,s.to)),t.effects.save(s,y),s.show(),t.effects.createWrapper(s),s.css("overflow","hidden").css(s.from),m&&(r=t.effects.getBaseline(m,i),s.from.top=(i.outerHeight-s.outerHeight())*r.y,s.from.left=(i.outerWidth-s.outerWidth())*r.x,s.to.top=(i.outerHeight-s.to.outerHeight)*r.y,s.to.left=(i.outerWidth-s.to.outerWidth)*r.x),s.css(s.from),"content"!==g&&"both"!==g||(h=h.concat(["marginTop","marginBottom"]).concat(c),f=f.concat(["marginLeft","marginRight"]),u=a.concat(h).concat(f),s.find("*[width]").each(function(){var n=t(this),i={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};p&&t.effects.save(n,u),n.from={height:i.height*o.from.y,width:i.width*o.from.x,outerHeight:i.outerHeight*o.from.y,outerWidth:i.outerWidth*o.from.x},n.to={height:i.height*o.to.y,width:i.width*o.to.x,outerHeight:i.height*o.to.y,outerWidth:i.width*o.to.x},o.from.y!==o.to.y&&(n.from=t.effects.setTransition(n,h,o.from.y,n.from),n.to=t.effects.setTransition(n,h,o.to.y,n.to)),o.from.x!==o.to.x&&(n.from=t.effects.setTransition(n,f,o.from.x,n.from),n.to=t.effects.setTransition(n,f,o.to.x,n.to)),n.css(n.from),n.animate(n.to,e.duration,e.easing,function(){p&&t.effects.restore(n,u)})})),s.animate(s.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===s.to.opacity&&s.css("opacity",s.from.opacity),"hide"===d&&s.hide(),t.effects.restore(s,y),p||("static"===v?s.css({position:"relative",top:s.to.top,left:s.to.left}):t.each(["top","left"],function(t,e){s.css(e,function(e,n){var i=parseInt(n,10),r=t?s.to.left:s.to.top;return"auto"===n?r+"px":i+r+"px"})})),t.effects.removeWrapper(s),n()}})}}(jQuery),function(t,e){t.effects.effect.shake=function(e,n){var i,r=t(this),o=["position","top","bottom","left","right","height","width"],s=t.effects.setMode(r,e.mode||"effect"),a=e.direction||"left",l=e.distance||20,u=e.times||3,c=2*u+1,h=Math.round(e.duration/c),f="up"===a||"down"===a?"top":"left",d="up"===a||"left"===a,p={},g={},m={},v=r.queue(),y=v.length;for(t.effects.save(r,o),r.show(),t.effects.createWrapper(r),p[f]=(d?"-=":"+=")+l,g[f]=(d?"+=":"-=")+2*l,m[f]=(d?"-=":"+=")+2*l,r.animate(p,h,e.easing),i=1;i1&&v.splice.apply(v,[1,0].concat(v.splice(y,c+1))),r.dequeue()}}(jQuery),function(t,e){t.effects.effect.slide=function(e,n){var i,r=t(this),o=["position","top","bottom","left","right","width","height"],s=t.effects.setMode(r,e.mode||"show"),a="show"===s,l=e.direction||"left",u="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,h={};t.effects.save(r,o),r.show(),i=e.distance||r["top"===u?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(r).css({overflow:"hidden"}),a&&r.css(u,c?isNaN(i)?"-"+i:-i:i),h[u]=(a?c?"+=":"-=":c?"-=":"+=")+i,r.animate(h,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===s&&r.hide(),t.effects.restore(r,o),t.effects.removeWrapper(r),n()}})}}(jQuery),function(t,e){t.effects.effect.transfer=function(e,n){var i=t(this),r=t(e.to),o="fixed"===r.css("position"),s=t("body"),a=o?s.scrollTop():0,l=o?s.scrollLeft():0,u=r.offset(),c={top:u.top-a,left:u.left-l,height:r.innerHeight(),width:r.innerWidth()},h=i.offset(),f=t('
          ').appendTo(document.body).addClass(e.className).css({top:h.top-a,left:h.left-l,height:i.innerHeight(),width:i.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){f.remove(),n()})}}(jQuery),function(t,e){var n=!1;t.widget("ui.menu",{version:"1.9.2",defaultElement:"
            ",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!n&&i.not(".ui-state-disabled").length&&(n=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var n=t(e.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var n=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,n)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function n(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var i,r,o,s,a,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,r=this.previousFilter||"",o=String.fromCharCode(e.keyCode),s=!1,clearTimeout(this.filterTimer),o===r?s=!0:o=r+o,a=new RegExp("^"+n(o),"i"),i=this.activeMenu.children(".ui-menu-item").filter(function(){return a.test(t(this).children("a").text())}),i=s&&i.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):i,i.length||(o=String.fromCharCode(e.keyCode),a=new RegExp("^"+n(o),"i"),i=this.activeMenu.children(".ui-menu-item").filter(function(){return a.test(t(this).children("a").text())})),i.length?(this.focus(e,i),i.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,n=this.options.icons.submenu,i=this.element.find(this.options.menus);i.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev("a"),r=t("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(r),e.attr("aria-labelledby",i.attr("id"))}),e=i.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-—–\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(t,e){var n,i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=e.children(".ui-menu"),n.length&&/^mouse/.test(t.type)&&this._startOpening(n),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,i,r,o,s,a;this._hasScroll()&&(n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,r=e.offset().top-this.activeMenu.offset().top-n-i,o=this.activeMenu.scrollTop(),s=this.activeMenu.height(),a=e.height(),r<0?this.activeMenu.scrollTop(o+r):r+a>s&&this.activeMenu.scrollTop(o+r-s+a))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var n=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(e,n){clearTimeout(this.timer),this.timer=this._delay(function(){var i=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));i.length||(i=this.element),this._close(i),this.blur(e),this.activeMenu=i},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var i;this.active&&(i="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),i&&i.length&&this.active||(i=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(n,i)},nextPage:function(e){var n,i,r;return this.active?void(this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,r=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i-r<0}),this.focus(e,n)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]()))):void this.next(e)},previousPage:function(e){var n,i,r;return this.active?void(this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,r=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i+r>0}),this.focus(e,n)):this.focus(e,this.activeMenu.children(".ui-menu-item").first()))):void this.next(e)},_hasScroll:function(){return this.element.outerHeight()
          ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this._value():(this._setOption("value",t),this)},_setOption:function(t,e){"value"===t&&(this.options.value=e,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(t,e)},_value:function(){var t=this.options.value;return"number"!=typeof t&&(t=0),Math.min(this.options.max,Math.max(this.min,t))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var t=this.value(),e=this._percentage();this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),this.valueDiv.toggle(t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(e.toFixed(0)+"%"),this.element.attr("aria-valuenow",t)}})}(jQuery),function(t,e){t.widget("ui.resizable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var e=this,n=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t('
          ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor==String){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var i=this.handles.split(",");this.handles={};for(var r=0;r');a.css({zIndex:n.zIndex}),"se"==o&&a.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[o]=".ui-resizable-"+o,this.element.append(a)}}this._renderAxis=function(e){e=e||this.element;for(var n in this.handles){if(this.handles[n].constructor==String&&(this.handles[n]=t(this.handles[n],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var i=t(this.handles[n],this.element),r=0;r=/sw|ne|nw|se|n|s/.test(n)?i.outerHeight():i.outerWidth();var o=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");e.css(o,r),this._proportionallyResize()}t(this.handles[n]).length}},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!e.resizing){if(this.className)var t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);e.axis=t&&t[1]?t[1]:"se"}}),n.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){n.disabled||(t(this).removeClass("ui-resizable-autohide"),e._handles.show())}).mouseleave(function(){n.disabled||e.resizing||(t(this).addClass("ui-resizable-autohide"),e._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),e(this.originalElement),this},_mouseCapture:function(e){var n=!1;for(var i in this.handles)t(this.handles[i])[0]==e.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i=this.options,r=this.element.position(),o=this.element;this.resizing=!0,this.documentScroll={top:t(document).scrollTop(),left:t(document).scrollLeft()},(o.is(".ui-draggable")||/absolute/.test(o.css("position")))&&o.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy();var s=n(this.helper.css("left")),a=n(this.helper.css("top"));i.containment&&(s+=t(i.containment).scrollLeft()||0,a+=t(i.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:a},this.size=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalPosition={left:s,top:a},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof i.aspectRatio?i.aspectRatio:this.originalSize.width/this.originalSize.height||1;var l=t(".ui-resizable-"+this.axis).css("cursor");return t("body").css("cursor","auto"==l?this.axis+"-resize":l),o.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(t){var e=this.helper,n=(this.options,this.originalMousePosition),i=this.axis,r=t.pageX-n.left||0,o=t.pageY-n.top||0,s=this._change[i];if(!s)return!1;var a=s.apply(this,[t,r,o]);return this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(a=this._updateRatio(a,t)),a=this._respectSize(a,t),this._propagate("resize",t),e.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(a),this._trigger("resize",t,this.ui()),!1},_mouseStop:function(e){this.resizing=!1;var n=this.options,i=this;if(this._helper){var r=this._proportionallyResizeElements,o=r.length&&/textarea/i.test(r[0].nodeName),s=o&&t.ui.hasScroll(r[0],"left")?0:i.sizeDiff.height,a=o?0:i.sizeDiff.width,l={width:i.helper.width()-a,height:i.helper.height()-s},u=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;n.animate||this.element.css(t.extend(l,{top:c,left:u})),i.helper.height(i.size.height),i.helper.width(i.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,n,r,o,s,a=this.options;s={minWidth:i(a.minWidth)?a.minWidth:0,maxWidth:i(a.maxWidth)?a.maxWidth:1/0,minHeight:i(a.minHeight)?a.minHeight:0,maxHeight:i(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=s.minHeight*this.aspectRatio,r=s.minWidth/this.aspectRatio,n=s.maxHeight*this.aspectRatio,o=s.maxWidth/this.aspectRatio,e>s.minWidth&&(s.minWidth=e),r>s.minHeight&&(s.minHeight=r),nt.width,l=i(t.height)&&n.minHeight&&n.minHeight>t.height;a&&(t.width=n.minWidth),l&&(t.height=n.minHeight),o&&(t.width=n.maxWidth),s&&(t.height=n.maxHeight);var u=this.originalPosition.left+this.originalSize.width,c=this.position.top+this.size.height,h=/sw|nw|w/.test(r),f=/nw|ne|n/.test(r);a&&h&&(t.left=u-n.minWidth),o&&h&&(t.left=u-n.maxWidth),l&&f&&(t.top=c-n.minHeight),s&&f&&(t.top=c-n.maxHeight);var d=!t.width&&!t.height;return d&&!t.left&&t.top?t.top=null:d&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){this.options;if(this._proportionallyResizeElements.length)for(var e=this.helper||this.element,n=0;n');var i=t.ui.ie6?1:0,r=t.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+r,height:this.element.outerHeight()+r,position:"absolute",left:this.elementOffset.left-i+"px",top:this.elementOffset.top-i+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(t,e,n){return{width:this.originalSize.width+e}},w:function(t,e,n){var i=(this.options,this.originalSize),r=this.originalPosition;return{left:r.left+e,width:i.width-e}},n:function(t,e,n){var i=(this.options,this.originalSize),r=this.originalPosition;return{top:r.top+n,height:i.height-n}},s:function(t,e,n){return{height:this.originalSize.height+n}},se:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},sw:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,n,i]))},ne:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},nw:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,n,i]))}},_propagate:function(e,n){t.ui.plugin.call(this,e,[n,this.ui()]),"resize"!=e&&this._trigger(e,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","alsoResize",{start:function(e,n){var i=t(this).data("resizable"),r=i.options,o=function(e){t(e).each(function(){var e=t(this);e.data("resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof r.alsoResize||r.alsoResize.parentNode?o(r.alsoResize):r.alsoResize.length?(r.alsoResize=r.alsoResize[0],o(r.alsoResize)):t.each(r.alsoResize,function(t){o(t)})},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.originalSize,s=i.originalPosition,a={height:i.size.height-o.height||0,width:i.size.width-o.width||0,top:i.position.top-s.top||0,left:i.position.left-s.left||0},l=function(e,i){t(e).each(function(){var e=t(this),r=t(this).data("resizable-alsoresize"),o={},s=i&&i.length?i:e.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(s,function(t,e){var n=(r[e]||0)+(a[e]||0);n&&n>=0&&(o[e]=n||null)}),e.css(o)})};"object"!=typeof r.alsoResize||r.alsoResize.nodeType?l(r.alsoResize):t.each(r.alsoResize,function(t,e){l(t,e)})},stop:function(e,n){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","animate",{stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i._proportionallyResizeElements,s=o.length&&/textarea/i.test(o[0].nodeName),a=s&&t.ui.hasScroll(o[0],"left")?0:i.sizeDiff.height,l=s?0:i.sizeDiff.width,u={width:i.size.width-l,height:i.size.height-a},c=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,h=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(u,h&&c?{top:h,left:c}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var n={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};o&&o.length&&t(o[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(e,i){var r=t(this).data("resizable"),o=r.options,s=r.element,a=o.containment,l=a instanceof t?a.get(0):/parent/.test(a)?s.parent().get(0):a;if(l)if(r.containerElement=t(l),/document/.test(a)||a==document)r.containerOffset={left:0,top:0},r.containerPosition={left:0,top:0},r.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight};else{var u=t(l),c=[];t(["Top","Right","Left","Bottom"]).each(function(t,e){c[t]=n(u.css("padding"+e))}),r.containerOffset=u.offset(),r.containerPosition=u.position(),r.containerSize={height:u.innerHeight()-c[3],width:u.innerWidth()-c[1]};var h=r.containerOffset,f=r.containerSize.height,d=r.containerSize.width,p=t.ui.hasScroll(l,"left")?l.scrollWidth:d,g=t.ui.hasScroll(l)?l.scrollHeight:f;r.parentData={element:l,left:h.left,top:h.top,width:p,height:g}}},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=(i.containerSize,i.containerOffset),s=(i.size,i.position),a=i._aspectRatio||e.shiftKey,l={top:0,left:0},u=i.containerElement;u[0]!=document&&/static/.test(u.css("position"))&&(l=o),s.left<(i._helper?o.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-o.left:i.position.left-l.left),a&&(i.size.height=i.size.width/i.aspectRatio),i.position.left=r.helper?o.left:0),s.top<(i._helper?o.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-o.top:i.position.top),a&&(i.size.width=i.size.height*i.aspectRatio),i.position.top=i._helper?o.top:0),i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top;var c=Math.abs((i._helper?i.offset.left-l.left:i.offset.left-l.left)+i.sizeDiff.width),h=Math.abs((i._helper?i.offset.top-l.top:i.offset.top-o.top)+i.sizeDiff.height),f=i.containerElement.get(0)==i.element.parent().get(0),d=/relative|absolute/.test(i.containerElement.css("position")); -f&&d&&(c-=i.parentData.left),c+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-c,a&&(i.size.height=i.size.width/i.aspectRatio)),h+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-h,a&&(i.size.width=i.size.height*i.aspectRatio))},stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=(i.position,i.containerOffset),s=i.containerPosition,a=i.containerElement,l=t(i.helper),u=l.offset(),c=l.outerWidth()-i.sizeDiff.width,h=l.outerHeight()-i.sizeDiff.height;i._helper&&!r.animate&&/relative/.test(a.css("position"))&&t(this).css({left:u.left-s.left-o.left,width:c,height:h}),i._helper&&!r.animate&&/static/.test(a.css("position"))&&t(this).css({left:u.left-s.left-o.left,width:c,height:h})}}),t.ui.plugin.add("resizable","ghost",{start:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size;i.ghost=i.originalElement.clone(),i.ghost.css({opacity:.25,display:"block",position:"relative",height:o.height,width:o.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof r.ghost?r.ghost:""),i.ghost.appendTo(i.helper)},resize:function(e,n){var i=t(this).data("resizable");i.options;i.ghost&&i.ghost.css({position:"relative",height:i.size.height,width:i.size.width})},stop:function(e,n){var i=t(this).data("resizable");i.options;i.ghost&&i.helper&&i.helper.get(0).removeChild(i.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size,s=i.originalSize,a=i.originalPosition,l=i.axis;r._aspectRatio||e.shiftKey;r.grid="number"==typeof r.grid?[r.grid,r.grid]:r.grid;var u=Math.round((o.width-s.width)/(r.grid[0]||1))*(r.grid[0]||1),c=Math.round((o.height-s.height)/(r.grid[1]||1))*(r.grid[1]||1);/^(se|s|e)$/.test(l)?(i.size.width=s.width+u,i.size.height=s.height+c):/^(ne)$/.test(l)?(i.size.width=s.width+u,i.size.height=s.height+c,i.position.top=a.top-c):/^(sw)$/.test(l)?(i.size.width=s.width+u,i.size.height=s.height+c,i.position.left=a.left-u):(i.size.width=s.width+u,i.size.height=s.height+c,i.position.top=a.top-c,i.position.left=a.left-u)}});var n=function(t){return parseInt(t,10)||0},i=function(t){return!isNaN(parseInt(t,10))}}(jQuery),function(t,e){t.widget("ui.selectable",t.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var e=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=t(e.options.filter,e.element[0]),n.addClass("ui-selectee"),n.each(function(){var e=t(this),n=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:n.left,top:n.top,right:n.left+e.outerWidth(),bottom:n.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=t("
          ")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var n=this;if(this.opos=[e.pageX,e.pageY],!this.options.disabled){var i=this.options;this.selectees=t(i.filter,this.element[0]),this._trigger("start",e),t(i.appendTo).append(this.helper),this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0}),i.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var i=t.data(this,"selectable-item");i.startselected=!0,e.metaKey||e.ctrlKey||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",e,{unselecting:i.element}))}),t(e.target).parents().andSelf().each(function(){var i=t.data(this,"selectable-item");if(i){var r=!e.metaKey&&!e.ctrlKey||!i.$element.hasClass("ui-selected");return i.$element.removeClass(r?"ui-unselecting":"ui-selected").addClass(r?"ui-selecting":"ui-unselecting"),i.unselecting=!r,i.selecting=r,i.selected=r,r?n._trigger("selecting",e,{selecting:i.element}):n._trigger("unselecting",e,{unselecting:i.element}),!1}})}},_mouseDrag:function(e){var n=this;if(this.dragged=!0,!this.options.disabled){var i=this.options,r=this.opos[0],o=this.opos[1],s=e.pageX,a=e.pageY;if(r>s){var l=s;s=r,r=l}if(o>a){var l=a;a=o,o=l}return this.helper.css({left:r,top:o,width:s-r,height:a-o}),this.selectees.each(function(){var l=t.data(this,"selectable-item");if(l&&l.element!=n.element[0]){var u=!1;"touch"==i.tolerance?u=!(l.left>s||l.righta||l.bottomr&&l.righto&&l.bottom").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===r.range||"max"===r.range?" ui-slider-range-"+r.range:""))),i=r.values&&r.values.length||1,e=o.length;en&&(r=n,o=t(this),s=e)}),h.range===!0&&this.values(1)===h.min&&(s+=1,o=t(this.handles[s])),a=this._start(e,s),a!==!1&&(this._mouseSliding=!0,this._handleIndex=s,o.addClass("ui-state-active").focus(),l=o.offset(),u=!t(e.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=u?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,s,i),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,n),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,n,i,r,o;return"horizontal"===this.orientation?(e=this.elementSize.width,n=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,n=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),i=n/e,i>1&&(i=1),i<0&&(i=0),"vertical"===this.orientation&&(i=1-i),r=this._valueMax()-this._valueMin(),o=this._valueMin()+i*r,this._trimAlignValue(o)},_start:function(t,e){var n={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(e),n.values=this.values()),this._trigger("start",t,n)},_slide:function(t,e,n){var i,r,o;this.options.values&&this.options.values.length?(i=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&n>i||1===e&&n1)return this.options.values[e]=this._trimAlignValue(n),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(i=this.options.values,r=arguments[0],o=0;o=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,n=(t-this._valueMin())%e,i=t-n;return 2*Math.abs(n)>=e&&(i+=n>0?e:-e),parseFloat(i.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,n,i,r,o,s=this.options.range,a=this.options,l=this,u=!this._animateOff&&a.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(i){n=(l.values(i)-l._valueMin())/(l._valueMax()-l._valueMin())*100,c["horizontal"===l.orientation?"left":"bottom"]=n+"%",t(this).stop(1,1)[u?"animate":"css"](c,a.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===i&&l.range.stop(1,1)[u?"animate":"css"]({left:n+"%"},a.animate),1===i&&l.range[u?"animate":"css"]({width:n-e+"%"},{queue:!1,duration:a.animate})):(0===i&&l.range.stop(1,1)[u?"animate":"css"]({bottom:n+"%"},a.animate),1===i&&l.range[u?"animate":"css"]({height:n-e+"%"},{queue:!1,duration:a.animate}))),e=n}):(i=this.value(),r=this._valueMin(),o=this._valueMax(),n=o!==r?(i-r)/(o-r)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=n+"%",this.handle.stop(1,1)[u?"animate":"css"](c,a.animate),"min"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:n+"%"},a.animate),"max"===s&&"horizontal"===this.orientation&&this.range[u?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:a.animate}),"min"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:n+"%"},a.animate),"max"===s&&"vertical"===this.orientation&&this.range[u?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:a.animate}))}})}(jQuery),function(t,e){t.widget("ui.sortable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===t.axis||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display"))),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,n){"disabled"===e?(this.options[e]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,n){var i=this;if(this.reverting)return!1;if(this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(e);var r=null;t(e.target).parents().each(function(){if(t.data(this,i.widgetName+"-item")==i)return r=t(this),!1});if(t.data(e.target,i.widgetName+"-item")==i&&(r=t(e.target)),!r)return!1;if(this.options.handle&&!n){var o=!1;if(t(this.options.handle,r).find("*").andSelf().each(function(){this==e.target&&(o=!0)}),!o)return!1}return this.currentItem=r,this._removeCurrentsFromItems(),!0},_mouseStart:function(e,n,i){var r=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&(t("body").css("cursor")&&(this._storedCursor=t("body").css("cursor")),t("body").css("cursor",r.cursor)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(var o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){var n=this.options,i=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;r--){var o=this.items[r],s=o.item[0],a=this._intersectsWithPointer(o);if(a&&o.instance===this.currentContainer&&!(s==this.currentItem[0]||this.placeholder[1==a?"next":"prev"]()[0]==s||t.contains(this.placeholder[0],s)||"semi-dynamic"==this.options.type&&t.contains(this.element[0],s))){if(this.direction=1==a?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(o))break;this._rearrange(e,o),this._trigger("change",e,this._uiHash());break}}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,n){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var i=this,r=this.placeholder.offset();this.reverting=!0,t(this.helper).animate({left:r.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:r.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){i._clear(e)})}else this._clear(e,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},t(n).each(function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[-=_](.+)/);n&&i.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},n.each(function(){i.push(t(e.item||this).attr(e.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,i=this.positionAbs.top,r=i+this.helperProportions.height,o=t.left,s=o+t.width,a=t.top,l=a+t.height,u=this.offset.click.top,c=this.offset.click.left,h=i+u>a&&i+uo&&e+ct[this.floating?"width":"height"]?h:o0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var n=[],i=[],r=this._connectWith();if(r&&e)for(var o=r.length-1;o>=0;o--)for(var s=t(r[o]),a=s.length-1;a>=0;a--){var l=t.data(s[a],this.widgetName);l&&l!=this&&!l.options.disabled&&i.push([t.isFunction(l.options.items)?l.options.items.call(l.element):t(l.options.items,l.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),l])}i.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var o=i.length-1;o>=0;o--)i[o][0].each(function(){n.push(this)});return t(n)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var n=0;n=0;o--)for(var s=t(r[o]),a=s.length-1;a>=0;a--){var l=t.data(s[a],this.widgetName);l&&l!=this&&!l.options.disabled&&(i.push([t.isFunction(l.options.items)?l.options.items.call(l.element[0],e,{item:this.currentItem}):t(l.options.items,l.element),l]),this.containers.push(l))}for(var o=i.length-1;o>=0;o--)for(var u=i[o][1],c=i[o][0],a=0,h=c.length;a=0;n--){var i=this.items[n];if(i.instance==this.currentContainer||!this.currentContainer||i.item[0]==this.currentItem[0]){var r=this.options.toleranceElement?t(this.options.toleranceElement,i.item):i.item;e||(i.width=r.outerWidth(),i.height=r.outerHeight());var o=r.offset();i.left=o.left,i.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var o=this.containers[n].element.offset();this.containers[n].containerCache.left=o.left,this.containers[n].containerCache.top=o.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(e){e=e||this;var n=e.options;if(!n.placeholder||n.placeholder.constructor==String){var i=n.placeholder;n.placeholder={element:function(){var n=t(document.createElement(e.currentItem[0].nodeName)).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return i||(n.style.visibility="hidden"),n},update:function(t,r){i&&!n.forcePlaceholderSize||(r.height()||r.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),r.width()||r.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}}e.placeholder=t(n.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),n.placeholder.update(e,e.placeholder)},_contactContainers:function(e){for(var n=null,i=null,r=this.containers.length-1;r>=0;r--)if(!t.contains(this.currentItem[0],this.containers[r].element[0]))if(this._intersectsWith(this.containers[r].containerCache)){if(n&&t.contains(this.containers[r].element[0],n.element[0]))continue;n=this.containers[r],i=r}else this.containers[r].containerCache.over&&(this.containers[r]._trigger("out",e,this._uiHash(this)),this.containers[r].containerCache.over=0);if(n)if(1===this.containers.length)this.containers[i]._trigger("over",e,this._uiHash(this)),this.containers[i].containerCache.over=1;else{for(var o=1e4,s=null,a=this.containers[i].floating?"left":"top",l=this.containers[i].floating?"width":"height",u=this.positionAbs[a]+this.offset.click[a],c=this.items.length-1;c>=0;c--)if(t.contains(this.containers[i].element[0],this.items[c].item[0])&&this.items[c].item[0]!=this.currentItem[0]){var h=this.items[c].item.offset()[a],f=!1;Math.abs(h-u)>Math.abs(h+this.items[c][l]-u)&&(f=!0,h+=this.items[c][l]),Math.abs(h-u)this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),n.grid)){var a=this.originalPageY+Math.round((s-this.originalPageY)/n.grid[1])*n.grid[1];s=this.containment&&(a-this.offset.click.topthis.containment[3])?a-this.offset.click.topthis.containment[2])?l-this.offset.click.left=0;r--)n||i.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over&&(i.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over=0);if(this._storedCursor&&t("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",e,this._uiHash());for(var r=0;r",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},n=this.element;return t.each(["min","max","step"],function(t,i){var r=n.attr(i);void 0!==r&&r.length&&(e[i]=r)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?void delete this.cancelBlur:(this._refresh(),void(this.previous!==this.element.val()&&this._trigger("change",t)))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function n(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=i,this._delay(function(){this.previous=i}))}var i;i=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),n.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,n.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active"))return this._start(e)!==!1&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var n=this.options,i=t.ui.keyCode;switch(e.keyCode){case i.UP:return this._repeat(null,1,e),!0;case i.DOWN:return this._repeat(null,-1,e),!0;case i.PAGE_UP:return this._repeat(null,n.page,e),!0;case i.PAGE_DOWN:return this._repeat(null,-n.page,e),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""},_start:function(t){return!(!this.spinning&&this._trigger("start",t)===!1)&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,n){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,n)},t),this._spin(e*this.options.step,n)},_spin:function(t,e){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:n})===!1||(this._value(n),this.counter++)},_increment:function(e){var n=this.options.incremental;return n?t.isFunction(n)?n(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),n=e.indexOf(".");return n===-1?0:e.length-n-1},_adjustValue:function(t){var e,n,i=this.options;return e=null!==i.min?i.min:0,n=t-e,n=Math.round(n/i.step)*i.step,t=e+n,t=parseFloat(t.toFixed(this._precision())),null!==i.max&&t>i.max?i.max:null!==i.min&&t1&&t.href.replace(o,"")===location.href.replace(o,"").replace(/\s/g,"%20")}var r=0,o=/#.*$/;t.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,n=this.options,i=n.active,r=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),null===i&&(r&&this.tabs.each(function(e,n){if(t(n).attr("aria-controls")===r)return i=e,!1}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==i&&i!==-1||(i=!!this.tabs.length&&0)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),i===-1&&(i=!n.collapsible&&0)),n.active=i,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),t.isArray(n.disabled)&&(n.disabled=t.unique(n.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=t(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var n=t(this.document[0].activeElement).closest("li"),i=this.tabs.index(n),r=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:i++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:r=!1,i--;break;case t.ui.keyCode.END:i=this.anchors.length-1;break;case t.ui.keyCode.HOME:i=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(i);case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}e.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,r),e.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,n){function i(){return e>r&&(e=0),e<0&&(e=r),e}for(var r=this.tabs.length-1;t.inArray(i(),this.options.disabled)!==-1;)e=n?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,e){return"active"===t?void this._activate(e):"disabled"===t?void this._setupDisabled(e):(this._super(t,e),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),void("heightStyle"===t&&this._setupHeightStyle(e)))},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+n()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,n=this.tablist.children(":has(a[href])");e.disabled=t.map(n.filter(".ui-state-disabled"),function(t){return n.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(n,r){var o,s,a,l=t(r).uniqueId().attr("id"),u=t(r).closest("li"),c=u.attr("aria-controls");i(r)?(o=r.hash,s=e.element.find(e._sanitizeSelector(o))):(a=e._tabId(u),o="#"+a,s=e.element.find(o),s.length||(s=e._createPanel(a),s.insertAfter(e.panels[n-1]||e.tablist)),s.attr("aria-live","polite")),s.length&&(e.panels=e.panels.add(s)),c&&u.data("ui-tabs-aria-controls",c),u.attr({"aria-controls":o.substring(1),"aria-labelledby":l}),s.attr("aria-labelledby",l)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("
          ").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var n,i=0;n=this.tabs[i];i++)e===!0||t.inArray(i,e)!==-1?t(n).addClass("ui-state-disabled").attr("aria-disabled","true"):t(n).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var n={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){n[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var n,i,r=this.element.parent();"fill"===e?(t.support.minHeight||(i=r.css("overflow"),r.css("overflow","hidden")),n=r.height(),this.element.siblings(":visible").each(function(){var e=t(this),i=e.css("position");"absolute"!==i&&"fixed"!==i&&(n-=e.outerHeight(!0))}),i&&r.css("overflow",i),this.element.children().not(this.panels).each(function(){n-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,n-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(n=0,this.panels.each(function(){n=Math.max(n,t(this).height("").height())}).height(n))},_eventHandler:function(e){var n=this.options,i=this.active,r=t(e.currentTarget),o=r.closest("li"),s=o[0]===i[0],a=s&&n.collapsible,l=a?t():this._getPanelForTab(o),u=i.length?this._getPanelForTab(i):t(),c={oldTab:i,oldPanel:u,newTab:a?t():o,newPanel:l};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||s&&!n.collapsible||this._trigger("beforeActivate",e,c)===!1||(n.active=!a&&this.tabs.index(o),this.active=s?t():o,this.xhr&&this.xhr.abort(),u.length||l.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,n){function i(){o.running=!1,o._trigger("activate",e,n)}function r(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),s.length&&o.options.show?o._show(s,o.options.show,i):(s.show(),i())}var o=this,s=n.newPanel,a=n.oldPanel;this.running=!0,a.length&&this.options.hide?this._hide(a,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),a.hide(),r()),a.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),s.length&&a.length?n.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var n,i=this._findActive(e);i[0]!==this.active[0]&&(i.length||(i=this.active),n=i.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),n=e.data("ui-tabs-aria-controls");n?e.attr("aria-controls",n):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(n){var i=this.options.disabled;i!==!1&&(n===e?i=!1:(n=this._getIndex(n),i=t.isArray(i)?t.map(i,function(t){return t!==n?t:null}):t.map(this.tabs,function(t,e){return e!==n?e:null})),this._setupDisabled(i))},disable:function(n){var i=this.options.disabled;if(i!==!0){if(n===e)i=!0;else{if(n=this._getIndex(n),t.inArray(n,i)!==-1)return;i=t.isArray(i)?t.merge([n],i).sort():[n]}this._setupDisabled(i)}},load:function(e,n){e=this._getIndex(e);var r=this,o=this.tabs.eq(e),s=o.find(".ui-tabs-anchor"),a=this._getPanelForTab(o),l={tab:o,panel:a};i(s[0])||(this.xhr=t.ajax(this._ajaxSettings(s,n,l)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){a.html(t),r._trigger("load",n,l)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&r.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),a.removeAttr("aria-busy"),t===r.xhr&&delete r.xhr},1)})))},_ajaxSettings:function(e,n,i){var r=this;return{url:e.attr("href"),beforeSend:function(e,o){return r._trigger("beforeLoad",n,t.extend({jqXHR:e,ajaxSettings:o},i))}}},_getPanelForTab:function(e){var n=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),t.uiBackCompat!==!1&&(t.ui.tabs.prototype._ui=function(t,e){return{tab:t,panel:e,index:this.anchors.index(t)}},t.widget("ui.tabs",t.ui.tabs,{url:function(t,e){this.anchors.eq(t).attr("href",e)}}),t.widget("ui.tabs",t.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var e=this;this._on({tabsbeforeload:function(n,i){return t.data(i.tab[0],"cache.tabs")?void n.preventDefault():void i.jqXHR.success(function(){e.options.cache&&t.data(i.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(e,n,i){var r=this.options.ajaxOptions;return t.extend({},r,{error:function(t,e){try{r.error(t,e,i.tab.closest("li").index(),i.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(t,e){"cache"===t&&e===!1&&this.anchors.removeData("cache.tabs"),this._super(t,e)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(t){this.anchors.eq(t).removeData("cache.tabs"),this._superApply(arguments)}}),t.widget("ui.tabs",t.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),t.widget("ui.tabs",t.ui.tabs,{options:{spinner:"Loading…"},_create:function(){this._super(),this._on({tabsbeforeload:function(t,e){if(t.target===this.element[0]&&this.options.spinner){var n=e.tab.find("span"),i=n.html();n.html(this.options.spinner),e.jqXHR.complete(function(){n.html(i)})}}})}}),t.widget("ui.tabs",t.ui.tabs,{options:{enable:null,disable:null},enable:function(e){var n,i=this.options;(e&&i.disabled===!0||t.isArray(i.disabled)&&t.inArray(e,i.disabled)!==-1)&&(n=!0),this._superApply(arguments),n&&this._trigger("enable",null,this._ui(this.anchors[e],this.panels[e]))},disable:function(e){var n,i=this.options;(e&&i.disabled===!1||t.isArray(i.disabled)&&t.inArray(e,i.disabled)===-1)&&(n=!0),this._superApply(arguments),n&&this._trigger("disable",null,this._ui(this.anchors[e],this.panels[e]))}}),t.widget("ui.tabs",t.ui.tabs,{options:{add:null,remove:null,tabTemplate:"
        • #{label}
        • "},add:function(n,i,r){r===e&&(r=this.anchors.length);var o,s,a=this.options,l=t(a.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,i)),u=n.indexOf("#")?this._tabId(l):n.replace("#","");return l.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),l.attr("aria-controls",u),o=r>=this.tabs.length,s=this.element.find("#"+u),s.length||(s=this._createPanel(u),o?r>0?s.insertAfter(this.panels.eq(-1)):s.appendTo(this.element):s.insertBefore(this.panels[r])),s.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),o?l.appendTo(this.tablist):l.insertBefore(this.tabs[r]),a.disabled=t.map(a.disabled,function(t){return t>=r?++t:t}),this.refresh(),1===this.tabs.length&&a.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[r],this.panels[r])),this},remove:function(e){e=this._getIndex(e);var n=this.options,i=this.tabs.eq(e).remove(),r=this._getPanelForTab(i).remove();return i.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(e+(e+1=e?--t:t}),this.refresh(),this._trigger("remove",null,this._ui(i.find("a")[0],r[0])),this}}),t.widget("ui.tabs",t.ui.tabs,{length:function(){return this.anchors.length}}),t.widget("ui.tabs",t.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(e){var i=e.is("li")?e.find("a[href]"):e;return i=i[0],t(i).closest("li").attr("aria-controls")||i.title&&i.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+n()}}),t.widget("ui.tabs",t.ui.tabs,{options:{panelTemplate:"
          "},_createPanel:function(e){return t(this.options.panelTemplate).attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),t.widget("ui.tabs",t.ui.tabs,{_create:function(){var t=this.options;null===t.active&&t.selected!==e&&(t.active=t.selected!==-1&&t.selected),this._super(),t.selected=t.active,t.selected===!1&&(t.selected=-1)},_setOption:function(t,e){if("selected"!==t)return this._super(t,e);var n=this.options;this._super("active",e!==-1&&e),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),t.widget("ui.tabs",t.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(t,e,n){var i,r,o=this._superApply(arguments);return!!o&&("beforeActivate"===t?(i=n.newTab.length?n.newTab:n.oldTab,r=n.newPanel.length?n.newPanel:n.oldPanel,o=this._super("select",e,{tab:i.find(".ui-tabs-anchor")[0],panel:r[0],index:i.closest("li").index()})):"activate"===t&&n.newTab.length&&(o=this._super("show",e,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),o)}}),t.widget("ui.tabs",t.ui.tabs,{select:function(t){if(t=this._getIndex(t),t===-1){if(!this.options.collapsible||this.options.selected===-1)return;t=this.options.selected}this.anchors.eq(t).trigger(this.options.event+this.eventNamespace)}}),function(){var e=0;t.widget("ui.tabs",t.ui.tabs,{options:{cookie:null},_create:function(){var t,e=this.options;null==e.active&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var i=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++e)];return arguments.length&&(i.push(n===!1?-1:n),i.push(this.options.cookie)),t.cookie.apply(null,i)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),t.widget("ui.tabs",t.ui.tabs,{_trigger:function(e,n,i){var r=t.extend({},i);return"load"===e&&(r.panel=r.panel[0],r.tab=r.tab.find(".ui-tabs-anchor")[0]),this._super(e,n,r)}}),t.widget("ui.tabs",t.ui.tabs,{options:{fx:null},_getFx:function(){var e,n,i=this.options.fx;return i&&(t.isArray(i)?(e=i[0],n=i[1]):e=n=i),i?{show:n,hide:e}:null},_toggle:function(t,e){function n(){r.running=!1,r._trigger("activate",t,e)}function i(){e.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.show?o.animate(a.show,a.show.duration,function(){n()}):(o.show(),n())}var r=this,o=e.newPanel,s=e.oldPanel,a=this._getFx();return a?(r.running=!0,void(s.length&&a.hide?s.animate(a.hide,a.hide.duration,function(){e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i()}):(e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),i()))):this._super(t,e)}}))}(jQuery),function(t){function e(e,n){var i=(e.attr("aria-describedby")||"").split(/\s+/);i.push(n),e.data("ui-tooltip-id",n).attr("aria-describedby",t.trim(i.join(" ")))}function n(e){ -var n=e.data("ui-tooltip-id"),i=(e.attr("aria-describedby")||"").split(/\s+/),r=t.inArray(n,i);r!==-1&&i.splice(r,1),e.removeData("ui-tooltip-id"),i=t.trim(i.join(" ")),i?e.attr("aria-describedby",i):e.removeAttr("aria-describedby")}var i=0;t.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return t(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,n){var i=this;return"disabled"===e?(this[n?"_disable":"_enable"](),void(this.options[e]=n)):(this._super(e,n),void("content"===e&&t.each(this.tooltips,function(t,e){i._updateContent(e)})))},_disable:function(){var e=this;t.each(this.tooltips,function(n,i){var r=t.Event("blur");r.target=r.currentTarget=i[0],e.close(r,!0)}),this.element.find(this.options.items).andSelf().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var n=this,i=t(e?e.target:this.element).closest(this.options.items);i.length&&!i.data("ui-tooltip-id")&&(i.attr("title")&&i.data("ui-tooltip-title",i.attr("title")),i.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&i.parents().each(function(){var e,i=t(this);i.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,n.close(e,!0)),i.attr("title")&&(i.uniqueId(),n.parents[this.id]={element:this,title:i.attr("title")},i.attr("title",""))}),this._updateContent(i,e))},_updateContent:function(t,e){var n,i=this.options.content,r=this,o=e?e.type:null;return"string"==typeof i?this._open(e,t,i):(n=i.call(t[0],function(n){t.data("ui-tooltip-open")&&r._delay(function(){e&&(e.type=o),this._open(e,t,n)})}),void(n&&this._open(e,t,n)))},_open:function(n,i,r){function o(t){u.of=t,s.is(":hidden")||s.position(u)}var s,a,l,u=t.extend({},this.options.position);if(r){if(s=this._find(i),s.length)return void s.find(".ui-tooltip-content").html(r);i.is("[title]")&&(n&&"mouseover"===n.type?i.attr("title",""):i.removeAttr("title")),s=this._tooltip(i),e(i,s.attr("id")),s.find(".ui-tooltip-content").html(r),this.options.track&&n&&/^mouse/.test(n.type)?(this._on(this.document,{mousemove:o}),o(n)):s.position(t.extend({of:i},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(l=setInterval(function(){s.is(":visible")&&(o(u.of),clearInterval(l))},t.fx.interval)),this._trigger("open",n,{tooltip:s}),a={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var n=t.Event(e);n.currentTarget=i[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}},n&&"mouseover"!==n.type||(a.mouseleave="close"),n&&"focusin"!==n.type||(a.focusout="close"),this._on(!0,i,a)}},close:function(e){var i=this,r=t(e?e.currentTarget:this.element),o=this._find(r);this.closing||(r.data("ui-tooltip-title")&&r.attr("title",r.data("ui-tooltip-title")),n(r),o.stop(!0),this._hide(o,this.options.hide,function(){i._removeTooltip(t(this))}),r.removeData("ui-tooltip-open"),this._off(r,"mouseleave focusout keyup"),r[0]!==this.element[0]&&this._off(r,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,n){t(n.element).attr("title",n.title),delete i.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var n="ui-tooltip-"+i++,r=t("
          ").attr({id:n,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("
          ").addClass("ui-tooltip-content").appendTo(r),r.appendTo(this.document[0].body),t.fn.bgiframe&&r.bgiframe(),this.tooltips[n]=e,r},_find:function(e){var n=e.data("ui-tooltip-id");return n?t("#"+n):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(n,i){var r=t.Event("blur");r.target=r.currentTarget=i[0],e.close(r,!0),t("#"+n).remove(),i.data("ui-tooltip-title")&&(i.attr("title",i.data("ui-tooltip-title")),i.removeData("ui-tooltip-title"))})}})}(jQuery),function($){var min=Math.min,max=Math.max,round=Math.floor,isStr=function(t){return"string"===$.type(t)},runPluginCallbacks=function(Instance,a_fn){function g(t){return t}if($.isArray(a_fn))for(var i=0,c=a_fn.length;i
          ').appendTo("body"),n={width:e.outerWidth-e[0].clientWidth,height:100-e[0].clientHeight};return e.remove(),window.scrollbarWidth=n.width,window.scrollbarHeight=n.height,t.match(/^(width|height)$/)?n[t]:n},disableTextSelection:function(){var t=$(document),e="textSelectionDisabled",n="textSelectionInitialized";$.fn.disableSelection&&(t.data(n)||t.on("mouseup",$.layout.enableTextSelection).data(n,!0),t.data(e)||t.disableSelection().data(e,!0))},enableTextSelection:function(){var t=$(document),e="textSelectionDisabled";$.fn.enableSelection&&t.data(e)&&t.enableSelection().data(e,!1)},showInvisibly:function(t,e){if(t&&t.length&&(e||"none"===t.css("display"))){var n=t[0].style,i={display:n.display||"",visibility:n.visibility||""};return t.css({display:"block",visibility:"hidden"}),i}return{}},getElementDimensions:function(t,e){var n,i,r,o={css:{},inset:{}},s=o.css,a={bottom:0},l=$.layout.cssNum,u=Math.round,c=t.offset();return o.offsetLeft=c.left,o.offsetTop=c.top,e||(e={}),$.each("Left,Right,Top,Bottom".split(","),function(l,u){n=s["border"+u]=$.layout.borderWidth(t,u),i=s["padding"+u]=$.layout.cssNum(t,"padding"+u),r=u.toLowerCase(),o.inset[r]=e[r]>=0?e[r]:i,a[r]=o.inset[r]+n}),s.width=u(t.width()),s.height=u(t.height()),s.top=l(t,"top",!0),s.bottom=l(t,"bottom",!0),s.left=l(t,"left",!0),s.right=l(t,"right",!0),o.outerWidth=u(t.outerWidth()),o.outerHeight=u(t.outerHeight()),o.innerWidth=max(0,o.outerWidth-a.left-a.right),o.innerHeight=max(0,o.outerHeight-a.top-a.bottom),o.layoutWidth=u(t.innerWidth()),o.layoutHeight=u(t.innerHeight()),o},getElementStyles:function(t,e){var n,i,r,o,s,a,l={},u=t[0].style,c=e.split(","),h="Top,Bottom,Left,Right".split(","),f="Color,Style,Width".split(",");for(o=0;o=o&&l<=s&&u>=r&&u<=a},msg:function(t,e,n,i){function r(){var t=$.support.fixedPosition?"fixed":"absolute",e=$('
          XLayout console.log
            ').appendTo("body");return e.css("left",$(window).width()-e.outerWidth()-5),$.ui.draggable&&e.draggable({handle:":first-child"}),e}if($.isPlainObject(t)&&window.debugData){"string"==typeof e?(i=n,n=e):"object"==typeof n&&(i=n,n=null);var o=n||"log( )",s=$.extend({sort:!1,returnHTML:!1,display:!1},i);e===!0||s.display?debugData(t,o,s):window.console&&console.log(debugData(t,o,s))}else if(e)alert(t);else if(window.console)console.log(t);else{var a="#layoutLogger",l=$(a);l.length||(l=r()),l.children("ul").append('
          • '+t.replace(/\/g,">")+"
          • ")}}},function(){var t=navigator.userAgent.toLowerCase(),e=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[],n=e[1]||"",i=e[2]||0,r="msie"===n,o=document.compatMode,s=$.support,a=void 0!==s.boxSizing?s.boxSizing:s.boxSizingReliable,l=!r||!o||"CSS1Compat"===o||s.boxModel||!1,u=$.layout.browser={version:i,safari:"webkit"===n,webkit:"chrome"===n,msie:r,isIE6:r&&6==i,boxModel:l,boxSizing:!!("function"==typeof a?a():a)};n&&(u[n]=!0),l||o||$(function(){u.boxModel=s.boxModel})}(),$.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1e3,resizer_drag:1e4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:$.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}},$.layout.optionsMap={layout:"name,instanceKey,stateManagement,effects,inset,zIndexes,errors,zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end".split(","),center:"paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,containerSelector,children,initChildren,resizeChildren,destroyChildren,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end".split(","),noDefault:"paneSelector,resizerCursor,customHotkey".split(",")},$.layout.transformData=function(t,e){var n,i,r,o,s,a,l,u=e?{panes:{},center:{}}:{};if("object"!=typeof t)return u;for(i in t)for(n=u,s=t[i],r=i.split("__"),l=r.length-1,a=0;a<=l;a++)o=r[a],a===l?$.isPlainObject(s)?n[o]=$.layout.transformData(s):n[o]=s:(n[o]||(n[o]={}),n=n[o]);return u},$.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(t){function e(e,n){for(var i,r=e.split("."),o=r.length-1,s={branch:t,key:r[o]},a=0;a=37&&e<=40;return u&&options[s[e]].enableCursorHotkey?o=s[e]:(l||a)&&$.each(_c.borderPanes,function(t,s){if(n=options[s],i=n.customHotkey,r=n.customHotkeyModifier,(a&&"SHIFT"==r||l&&"CTRL"==r||l&&a)&&i&&e===(isNaN(i)||i<=9?i.toUpperCase().charCodeAt(0):i))return o=s,!1}),!(o&&$Ps[o]&&options[o].closable&&!state[o].isHidden)||(toggle(o),t.stopPropagation(),t.returnValue=!1,!1)}function allowOverflow(t){if(isInitialized()){this&&this.tagName&&(t=this);var e;if(isStr(t)?e=$Ps[t]:$(t).data("layoutRole")?e=$(t):$(t).parents().each(function(){if($(this).data("layoutRole"))return e=$(this),!1}),e&&e.length){var n=e.data("layoutEdge"),i=state[n];if(i.cssSaved&&resetOverflow(n),i.isSliding||i.isResizing||i.isClosed)return void(i.cssSaved=!1);var r={zIndex:options.zIndexes.resizer_normal+1},o={},s=e.css("overflow"),a=e.css("overflowX"),l=e.css("overflowY");"visible"!=s&&(o.overflow=s,r.overflow="visible"),a&&!a.match(/(visible|auto)/)&&(o.overflowX=a,r.overflowX="visible"),l&&!l.match(/(visible|auto)/)&&(o.overflowY=a,r.overflowY="visible"),i.cssSaved=o,e.css(r),$.each(_c.allPanes,function(t,e){e!=n&&resetOverflow(e)})}}}function resetOverflow(t){if(isInitialized()){this&&this.tagName&&(t=this);var e;if(isStr(t)?e=$Ps[t]:$(t).data("layoutRole")?e=$(t):$(t).parents().each(function(){if($(this).data("layoutRole"))return e=$(this),!1}),e&&e.length){var n=e.data("layoutEdge"),i=state[n],r=i.cssSaved||{};i.isSliding||i.isResizing||e.css("zIndex",options.zIndexes.pane_normal),e.css(r),i.cssSaved=!1}}}var browser=$.layout.browser,_c=$.layout.config,cssW=$.layout.cssWidth,cssH=$.layout.cssHeight,elDims=$.layout.getElementDimensions,styles=$.layout.getElementStyles,evtObj=$.layout.getEventObject,evtPane=$.layout.parsePaneName,options=$.extend(!0,{},$.layout.defaults),effects=options.effects=$.extend(!0,{},$.layout.effects),state={id:"layout"+$.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},children={north:null,south:null,east:null,west:null,center:null},timer={data:{},set:function(t,e,n){timer.clear(t),timer.data[t]=setTimeout(e,n)},clear:function(t){var e=timer.data;e[t]&&(clearTimeout(e[t]),delete e[t])}},_log=function(t,e,n){var i=options;return(i.showErrorMessages&&!n||n&&i.showDebugMessages)&&$.layout.msg(i.name+" / "+t,e!==!1),!1},_runCallbacks=function(evtName,pane,skipBoundEvents){function g(t){return t}var hasPane=pane&&isStr(pane),s=hasPane?state[pane]:state,o=hasPane?options[pane]:options,lName=options.name,lng=evtName+(evtName.match(/_/)?"":"_end"),shrt=lng.match(/_end$/)?lng.substr(0,lng.length-4):"",fn=o[lng]||o[shrt],retVal="NC",args=[],$P=hasPane?$Ps[pane]:0;if(hasPane&&!$P)return retVal;if(hasPane||"boolean"!==$.type(pane)||(skipBoundEvents=pane,pane=""),fn)try{isStr(fn)&&(fn.match(/,/)?(args=fn.split(","),fn=eval(args[0])):fn=eval(fn)),$.isFunction(fn)&&(retVal=args.length?g(fn)(args[1]):hasPane?g(fn)(pane,$Ps[pane],s,o,lName):g(fn)(Instance,s,o,lName))}catch(ex){_log(options.errors.callbackError.replace(/EVENT/,$.trim((pane||"")+" "+lng)),!1),"string"===$.type(ex)&&string.length&&_log("Exception: "+ex,!1)}return skipBoundEvents||retVal===!1||(hasPane?(o=options[pane],s=state[pane],$P.triggerHandler("layoutpane"+lng,[pane,$P,s,o,lName]),shrt&&$P.triggerHandler("layoutpane"+shrt,[pane,$P,s,o,lName])):($N.triggerHandler("layout"+lng,[Instance,s,o,lName]),shrt&&$N.triggerHandler("layout"+shrt,[Instance,s,o,lName]))),hasPane&&"onresize_end"===evtName&&resizeChildren(pane+"",!0),retVal},_fixIframe=function(t){if(!browser.mozilla){var e=$Ps[t];"IFRAME"===state[t].tagName?e.css(_c.hidden).css(_c.visible):e.find("IFRAME").css(_c.hidden).css(_c.visible)}},cssSize=function(t,e){var n="horz"==_c[t].dir?cssH:cssW;return n($Ps[t],e)},cssMinDims=function(t){var e=$Ps[t],n=_c[t].dir,i={minWidth:1001-cssW(e,1e3),minHeight:1001-cssH(e,1e3)};return"horz"===n&&(i.minSize=i.minHeight),"vert"===n&&(i.minSize=i.minWidth),i},setOuterWidth=function(t,e,n){var i,r=t;isStr(t)?r=$Ps[t]:t.jquery||(r=$(t)),i=cssW(r,e),r.css({width:i}),i>0?n&&r.data("autoHidden")&&r.innerHeight()>0&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},setOuterHeight=function(t,e,n){var i,r=t;isStr(t)?r=$Ps[t]:t.jquery||(r=$(t)),i=cssH(r,e),r.css({height:i,visibility:"visible"}),i>0&&r.innerWidth()>0?n&&r.data("autoHidden")&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},_parseSize=function(t,e,n){if(n||(n=_c[t].dir),isStr(e)&&e.match(/%/)&&(e="100%"===e?-1:parseInt(e,10)/100),0===e)return 0;if(e>=1)return parseInt(e,10);var i=options,r=0;if("horz"==n?r=sC.innerHeight-($Ps.north?i.north.spacing_open:0)-($Ps.south?i.south.spacing_open:0):"vert"==n&&(r=sC.innerWidth-($Ps.west?i.west.spacing_open:0)-($Ps.east?i.east.spacing_open:0)),e===-1)return r;if(e>0)return round(r*e);if("center"==t)return 0;var o="horz"===n?"height":"width",s=$Ps[t],a="height"===o&&$Cs[t],l=$.layout.showInvisibly(s),u=s.css(o),c=a?a.css(o):0;return s.css(o,"auto"),a&&a.css(o,"auto"),e="height"===o?s.outerHeight():s.outerWidth(),s.css(o,u).css(l),a&&a.css(o,c),e},getPaneSize=function(t,e){var n=$Ps[t],i=options[t],r=state[t],o=e?i.spacing_open:0,s=e?i.spacing_closed:0;return!n||r.isHidden?0:r.isClosed||r.isSliding&&e?s:"horz"===_c[t].dir?n.outerHeight()+o:n.outerWidth()+o},setSizeLimits=function(t,e){if(isInitialized()){var n=options[t],i=state[t],r=_c[t],o=r.dir,s=(r.sizeType.toLowerCase(),void 0!=e?e:i.isSliding),a=($Ps[t],n.spacing_open),l=_c.oppositeEdge[t],u=state[l],c=$Ps[l],h=!c||u.isVisible===!1||u.isSliding?0:"horz"==o?c.outerHeight():c.outerWidth(),f=(!c||u.isHidden?0:options[l][u.isClosed!==!1?"spacing_closed":"spacing_open"])||0,d="horz"==o?sC.innerHeight:sC.innerWidth,p=cssMinDims("center"),g="horz"==o?max(options.center.minHeight,p.minHeight):max(options.center.minWidth,p.minWidth),m=d-a-(s?0:_parseSize("center",g,o)+h+f),v=i.minSize=max(_parseSize(t,n.minSize),cssMinDims(t).minSize),y=i.maxSize=min(n.maxSize?_parseSize(t,n.maxSize):1e5,m),b=i.resizerPosition={},w=sC.inset.top,_=sC.inset.left,x=sC.innerWidth,S=sC.innerHeight,k=n.spacing_open;switch(t){case"north":b.min=w+v,b.max=w+y;break;case"west":b.min=_+v,b.max=_+y;break;case"south":b.min=w+S-y-k,b.max=w+S-v-k;break;case"east":b.min=_+x-y-k,b.max=_+x-v-k}}},calcNewCenterPaneDims=function(){var t={top:getPaneSize("north",!0),bottom:getPaneSize("south",!0),left:getPaneSize("west",!0),right:getPaneSize("east",!0),width:0,height:0};return t.width=sC.innerWidth-t.left-t.right,t.height=sC.innerHeight-t.bottom-t.top,t.top+=sC.inset.top,t.bottom+=sC.inset.bottom,t.left+=sC.inset.left,t.right+=sC.inset.right,t},getHoverClasses=function(t,e){var n=$(t),i=n.data("layoutRole"),r=n.data("layoutEdge"),o=options[r],s=o[i+"Class"],a="-"+r,l="-open",u="-closed",c="-sliding",h="-hover ",f=n.hasClass(s+u)?u:l,d=f===u?l:u,p=s+h+(s+a+h)+(s+f+h)+(s+a+f+h);return e&&(p+=s+d+h+(s+a+d+h)),"resizer"==i&&n.hasClass(s+c)&&(p+=s+c+h+(s+a+c+h)),$.trim(p)},addHover=function(t,e){var n=$(e||this);t&&"toggler"===n.data("layoutRole")&&t.stopPropagation(),n.addClass(getHoverClasses(n))},removeHover=function(t,e){var n=$(e||this);n.removeClass(getHoverClasses(n,!0))},onResizerEnter=function(t){var e=$(this).data("layoutEdge"),n=state[e];$(document);n.isResizing||state.paneResizing||options.maskPanesEarly&&showMasks(e,{resizing:!0})},onResizerLeave=function(t,e){var n=e||this,i=$(n).data("layoutEdge"),r=i+"ResizerLeave";$(document);timer.clear(i+"_openSlider"),timer.clear(r),e?options.maskPanesEarly&&!state.paneResizing&&hideMasks():timer.set(r,function(){onResizerLeave(t,n)},200)},_create=function(){initOptions();var t=options,e=state;return e.creatingLayout=!0,runPluginCallbacks(Instance,$.layout.onCreate),!1===_runCallbacks("onload_start")?"cancel":(_initContainer(),initHotkeys(),$(window).bind("unload."+sID,unload),runPluginCallbacks(Instance,$.layout.onLoad),t.initPanes&&_initLayoutElements(),delete e.creatingLayout,state.initialized)},isInitialized=function(){return!(!state.initialized&&!state.creatingLayout)||_initLayoutElements()},_initLayoutElements=function(t){var e=options;if(!$N.is(":visible"))return!t&&browser.webkit&&"BODY"===$N[0].tagName&&setTimeout(function(){_initLayoutElements(!0)},50),!1;if(!getPane("center").length)return _log(e.errors.centerPaneMissing);if(state.creatingLayout=!0,$.extend(sC,elDims($N,e.inset)),initPanes(),e.scrollToBookmarkOnLoad){var n=self.location;n.hash&&n.replace(n.hash)}return Instance.hasParentLayout?e.resizeWithWindow=!1:e.resizeWithWindow&&$(window).bind("resize."+sID,windowResize),delete state.creatingLayout,state.initialized=!0,runPluginCallbacks(Instance,$.layout.onReady),_runCallbacks("onload_end"),!0},createChildren=function(t,e){var n=evtPane.call(this,t),i=$Ps[n];if(i){var r=$Cs[n],o=state[n],s=options[n],a=options.stateManagement||{},l=e?s.children=e:s.children;if($.isPlainObject(l))l=[l];else if(!l||!$.isArray(l))return;$.each(l,function(t,e){if($.isPlainObject(e)){var s=e.containerSelector?i.find(e.containerSelector):r||i;s.each(function(){var t=$(this),i=t.data("layout");if(!i){if(setInstanceKey({container:t,options:e},o),a.includeChildren&&state.stateData[n]){var r=state.stateData[n].children||{},s=r[e.instanceKey],l=e.stateManagement||(e.stateManagement={autoLoad:!0});l.autoLoad===!0&&s&&(l.autoSave=!1,l.includeChildren=!0,l.autoLoad=$.extend(!0,{},s))}i=t.layout(e),i&&refreshChildren(n,i)}})}})}},setInstanceKey=function(t,e){var n=t.container,i=t.options,r=i.stateManagement,o=i.instanceKey||n.data("layoutInstanceKey");return o||(o=(r&&r.cookie?r.cookie.name:"")||i.name),o=o?o.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):"layout"+ ++e.childIdx,i.instanceKey=o,n.data("layoutInstanceKey",o),o},refreshChildren=function(t,e){var n,i=$Ps[t],r=children[t],o=state[t];$.isPlainObject(r)&&($.each(r,function(t,e){e.destroyed&&delete r[t]}),$.isEmptyObject(r)&&(r=children[t]=null)),e||r||(e=i.data("layout")),e&&(e.hasParentLayout=!0,n=e.options,setInstanceKey(e,o),r||(r=children[t]={}),r[n.instanceKey]=e.container.data("layout")),Instance[t].children=children[t],e||createChildren(t)},windowResize=function(){var t=options,e=Number(t.resizeWithWindowDelay);e<10&&(e=100),timer.clear("winResize"),timer.set("winResize",function(){timer.clear("winResize"),timer.clear("winResizeRepeater");var e=elDims($N,t.inset);e.innerWidth===sC.innerWidth&&e.innerHeight===sC.innerHeight||resizeAll()},e),timer.data.winResizeRepeater||setWindowResizeRepeater()},setWindowResizeRepeater=function(){var t=Number(options.resizeWithWindowMaxDelay);t>0&&timer.set("winResizeRepeater",function(){setWindowResizeRepeater(),resizeAll()},t)},unload=function(){_runCallbacks("onunload_start"),runPluginCallbacks(Instance,$.layout.onUnload),_runCallbacks("onunload_end")},_initContainer=function(){var t,e,n=$N[0],i=$("html"),r=sC.tagName=n.tagName,o=sC.id=n.id,s=sC.className=n.className,a=options,l=a.name,u="position,margin,padding,border",c="layoutCSS",h={},f="hidden",d=$N.data("parentLayout"),p=$N.data("layoutEdge"),g=d&&p,m=$.layout.cssNum;sC.selector=$N.selector.split(".slice")[0],sC.ref=(a.name?a.name+" layout / ":"")+r+(o?"#"+o:s?".["+s+"]":""),sC.isBody="BODY"===r,g||sC.isBody||(t=$N.closest("."+$.layout.defaults.panes.paneClass),d=t.data("parentLayout"),p=t.data("layoutEdge"),g=d&&p),$N.data({layout:Instance,layoutContainer:sID}).addClass(a.containerClass);var v={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(l in v)$N.bind("layout"+l.toLowerCase()+"."+sID,Instance[v[l]||l]);g&&(Instance.hasParentLayout=!0,d.refreshChildren(p,Instance)),$N.data(c)||(sC.isBody?($N.data(c,$.extend(styles($N,u),{height:$N.css("height"),overflow:$N.css("overflow"),overflowX:$N.css("overflowX"),overflowY:$N.css("overflowY")})),i.data(c,$.extend(styles(i,"padding"),{height:"auto",overflow:i.css("overflow"),overflowX:i.css("overflowX"),overflowY:i.css("overflowY")}))):$N.data(c,styles($N,u+",top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{if(h={overflow:f,overflowX:f,overflowY:f},$N.css(h),a.inset&&!$.isPlainObject(a.inset)&&(e=parseInt(a.inset,10)||0,a.inset={top:e,bottom:e,left:e,right:e}),sC.isBody)a.outset?$.isPlainObject(a.outset)||(e=parseInt(a.outset,10)||0,a.outset={top:e,bottom:e,left:e,right:e}):a.outset={top:m(i,"paddingTop"),bottom:m(i,"paddingBottom"),left:m(i,"paddingLeft"),right:m(i,"paddingRight")},i.css(h).css({height:"100%",border:"none",padding:0,margin:0}),browser.isIE6?($N.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative" -}),a.inset||(a.inset=elDims($N).inset)):($N.css({width:"auto",height:"auto",margin:0,position:"absolute"}),$N.css(a.outset)),$.extend(sC,elDims($N,a.inset));else{var y=$N.css("position");y&&y.match(/(fixed|absolute|relative)/)||$N.css("position","relative"),$N.is(":visible")&&($.extend(sC,elDims($N,a.inset)),sC.innerHeight<1&&_log(a.errors.noContainerHeight.replace(/CONTAINER/,sC.ref)))}m($N,"minWidth")&&$N.parent().css("overflowX","auto"),m($N,"minHeight")&&$N.parent().css("overflowY","auto")}catch(b){}},initHotkeys=function(t){t=t?t.split(","):_c.borderPanes,$.each(t,function(t,e){var n=options[e];if(n.enableCursorHotkey||n.customHotkey)return $(document).bind("keydown."+sID,keyDown),!1})},initOptions=function(){function t(t){var e=options[t],n=options.panes;e.fxSettings||(e.fxSettings={}),n.fxSettings||(n.fxSettings={}),$.each(["_open","_close","_size"],function(i,r){var o="fxName"+r,s="fxSpeed"+r,a="fxSettings"+r,l=e[o]=e[o]||n[o]||e.fxName||n.fxName||"none",u=$.effects&&($.effects[l]||$.effects.effect&&$.effects.effect[l]);"none"!==l&&options.effects[l]&&u||(l=e[o]="none");var c=options.effects[l]||{},h=c.all||null,f=c[t]||null;e[s]=e[s]||n[s]||e.fxSpeed||n.fxSpeed||null,e[a]=$.extend(!0,{},h,f,n.fxSettings,e.fxSettings,n[a],e[a])}),delete e.fxName,delete e.fxSpeed,delete e.fxSettings}var e,n,i,r,o,s,a;if(opts=$.layout.transformData(opts,!0),opts=$.layout.backwardCompatibility.renameAllOptions(opts),!$.isEmptyObject(opts.panes)){for(e=$.layout.optionsMap.noDefault,o=0,s=e.length;o0&&(c.pane_normal=u,c.content_mask=max(u+1,c.content_mask),c.resizer_normal=max(u+2,c.resizer_normal)),delete options.panes},getPane=function(t){var e=options[t].paneSelector;if("#"===e.substr(0,1))return $N.find(e).eq(0);var n=$N.children(e).eq(0);return n.length?n:$N.children("form:first").children(e).eq(0)},initPanes=function(t){evtPane(t),$.each(_c.allPanes,function(t,e){addPane(e,!0)}),initHandles(),$.each(_c.borderPanes,function(t,e){$Ps[e]&&state[e].isVisible&&(setSizeLimits(e),makePaneFit(e))}),sizeMidPanes("center"),$.each(_c.allPanes,function(t,e){afterInitPane(e)})},addPane=function(t,e){if(e||isInitialized()){var n,i,r,o=options[t],s=state[t],a=_c[t],l=a.dir,u=(s.fx,o.spacing_open||0,"center"===t),c={},h=$Ps[t];if(h?removePane(t,!1,!0,!1):$Cs[t]=!1,h=$Ps[t]=getPane(t),!h.length)return void($Ps[t]=!1);if(!h.data("layoutCSS")){var f="position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";h.data("layoutCSS",styles(h,f))}Instance[t]={name:t,pane:$Ps[t],content:$Cs[t],options:options[t],state:state[t],children:children[t]},h.data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"pane"}).css(a.cssReq).css("zIndex",options.zIndexes.pane_normal).css(o.applyDemoStyles?a.cssDemo:{}).addClass(o.paneClass+" "+o.paneClass+"-"+t).bind("mouseenter."+sID,addHover).bind("mouseleave."+sID,removeHover);var d,p={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",resizeAll:"resizeAll",resizeLayout:"resizeAll"};for(d in p)h.bind("layoutpane"+d.toLowerCase()+"."+sID,Instance[p[d]||d]);initContent(t,!1),u||(n=s.size=_parseSize(t,o.size),i=_parseSize(t,o.minSize)||1,r=_parseSize(t,o.maxSize)||1e5,n>0&&(n=max(min(n,r),i)),s.autoResize=o.autoResize,s.isClosed=!1,s.isSliding=!1,s.isResizing=!1,s.isHidden=!1,s.pins||(s.pins=[])),s.tagName=h[0].tagName,s.edge=t,s.noRoom=!1,s.isVisible=!0,setPanePosition(t),"horz"===l?c.height=cssH(h,n):"vert"===l&&(c.width=cssW(h,n)),h.css(c),"horz"!=l&&sizeMidPanes(t,!0),state.initialized&&(initHandles(t),initHotkeys(t)),o.initClosed&&o.closable&&!o.initHidden?close(t,!0,!0):o.initHidden||o.initClosed?hide(t):s.noRoom||h.css("display","block"),h.css("visibility","visible"),o.showOverflowOnHover&&h.hover(allowOverflow,resetOverflow),state.initialized&&afterInitPane(t)}},afterInitPane=function(t){var e=$Ps[t],n=state[t],i=options[t];e&&(e.data("layout")&&refreshChildren(t,e.data("layout")),n.isVisible&&(state.initialized?resizeAll():sizeContent(t),i.triggerEventsOnLoad?_runCallbacks("onresize_end",t):resizeChildren(t,!0)),i.initChildren&&i.children&&createChildren(t))},setPanePosition=function(t){t=t?t.split(","):_c.borderPanes,$.each(t,function(t,e){var n=$Ps[e],i=$Rs[e],r=(options[e],state[e]),o=_c[e].side,s={};if(n){switch(e){case"north":s.top=sC.inset.top,s.left=sC.inset.left,s.right=sC.inset.right;break;case"south":s.bottom=sC.inset.bottom,s.left=sC.inset.left,s.right=sC.inset.right;break;case"west":s.left=sC.inset.left;break;case"east":s.right=sC.inset.right;break;case"center":}n.css(s),i&&r.isClosed?i.css(o,sC.inset[o]):i&&!r.isHidden&&i.css(o,sC.inset[o]+getPaneSize(e))}})},initHandles=function(t){t=t?t.split(","):_c.borderPanes,$.each(t,function(t,e){var n=$Ps[e];if($Rs[e]=!1,$Ts[e]=!1,n){var i=options[e],r=state[e],o=(_c[e],"#"===i.paneSelector.substr(0,1)?i.paneSelector.substr(1):""),s=i.resizerClass,a=i.togglerClass,l=(r.isVisible?i.spacing_open:i.spacing_closed,"-"+e),u=(r.isVisible?"-open":"-closed",Instance[e]),c=u.resizer=$Rs[e]=$("
            "),h=u.toggler=!!i.closable&&($Ts[e]=$("
            "));!r.isVisible&&i.slidable&&c.attr("title",i.tips.Slide).css("cursor",i.sliderCursor),c.attr("id",o?o+"-resizer":"").data({parentLayout:Instance,layoutPane:Instance[e],layoutEdge:e,layoutRole:"resizer"}).css(_c.resizers.cssReq).css("zIndex",options.zIndexes.resizer_normal).css(i.applyDemoStyles?_c.resizers.cssDemo:{}).addClass(s+" "+s+l).hover(addHover,removeHover).hover(onResizerEnter,onResizerLeave).mousedown($.layout.disableTextSelection).mouseup($.layout.enableTextSelection).appendTo($N),$.fn.disableSelection&&c.disableSelection(),i.resizerDblClickToggle&&c.bind("dblclick."+sID,toggle),h&&(h.attr("id",o?o+"-toggler":"").data({parentLayout:Instance,layoutPane:Instance[e],layoutEdge:e,layoutRole:"toggler"}).css(_c.togglers.cssReq).css(i.applyDemoStyles?_c.togglers.cssDemo:{}).addClass(a+" "+a+l).hover(addHover,removeHover).bind("mouseenter",onResizerEnter).appendTo(c),i.togglerContent_open&&$(""+i.togglerContent_open+"").data({layoutEdge:e,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",e).addClass("content content-open").css("display","none").appendTo(h),i.togglerContent_closed&&$(""+i.togglerContent_closed+"").data({layoutEdge:e,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(h),enableClosable(e)),initResizable(e),r.isVisible?setAsOpen(e):(setAsClosed(e),bindStartSlidingEvents(e,!0))}}),sizeHandles()},initContent=function(t,e){if(isInitialized()){var n,i=options[t],r=i.contentSelector,o=Instance[t],s=$Ps[t];r&&(n=o.content=$Cs[t]=i.findNestedContent?s.find(r).eq(0):s.children(r).eq(0)),n&&n.length?(n.data("layoutRole","content"),n.data("layoutCSS")||n.data("layoutCSS",styles(n,"height")),n.css(_c.content.cssReq),i.applyDemoStyles&&(n.css(_c.content.cssDemo),s.css(_c.content.cssDemoPane)),s.css("overflowX").match(/(scroll|auto)/)&&s.css("overflow","hidden"),state[t].content={},e!==!1&&sizeContent(t)):o.content=$Cs[t]=!1}},initResizable=function(t){var e=$.layout.plugins.draggable;t=t?t.split(","):_c.borderPanes,$.each(t,function(t,i){var r=options[i];if(!e||!$Ps[i]||!r.resizable)return r.resizable=!1,!0;var o,s,a=state[i],l=options.zIndexes,u=_c[i],c="horz"==u.dir?"top":"left",h=($Ps[i],$Rs[i]),f=r.resizerClass,d=0,p=f+"-drag",g=f+"-"+i+"-drag",m=f+"-dragging",v=f+"-"+i+"-dragging",y=f+"-dragging-limit",b=f+"-"+i+"-dragging-limit",w=!1;a.isClosed||h.attr("title",r.tips.Resize).css("cursor",r.resizerCursor),h.draggable({containment:$N[0],axis:"horz"==u.dir?"y":"x",delay:0,distance:1,grid:r.resizingGrid,helper:"clone",opacity:r.resizerDragOpacity,addClasses:!1,zIndex:l.resizer_drag,start:function(t,e){return r=options[i],a=state[i],s=r.livePaneResizing,!1!==_runCallbacks("ondrag_start",i)&&(a.isResizing=!0,state.paneResizing=i,timer.clear(i+"_closeSlider"),setSizeLimits(i),o=a.resizerPosition,d=e.position[c],h.addClass(p+" "+g),w=!1,void showMasks(i,{resizing:!0}))},drag:function(t,e){w||(e.helper.addClass(m+" "+v).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),w=!0,a.isSliding&&$Ps[i].css("zIndex",l.pane_sliding));var u=0;e.position[c]o.max&&(e.position[c]=o.max,u=1),u?(e.helper.addClass(y+" "+b),window.defaultStatus=u>0&&i.match(/(north|west)/)||u<0&&i.match(/(south|east)/)?r.tips.maxSizeWarning:r.tips.minSizeWarning):(e.helper.removeClass(y+" "+b),window.defaultStatus=""),s&&Math.abs(e.position[c]-d)>=r.liveResizingTolerance&&(d=e.position[c],n(t,e,i))},stop:function(t,e){$("body").enableSelection(),window.defaultStatus="",h.removeClass(p+" "+g),a.isResizing=!1,state.paneResizing=!1,n(t,e,i,!0)}})});var n=function(t,e,n,i){var r,o=e.position,s=_c[n],a=options[n],l=state[n];switch(n){case"north":r=o.top;break;case"west":r=o.left;break;case"south":r=sC.layoutHeight-o.top-a.spacing_open;break;case"east":r=sC.layoutWidth-o.left-a.spacing_open}var u=r-sC.inset[s.side];if(i)!1!==_runCallbacks("ondrag_end",n)&&manualSizePane(n,u,!1,!0),hideMasks(!0),l.isSliding&&showMasks(n,{resizing:!0});else{if(Math.abs(u-l.size)=0;i--)n=$Ms.eq(i),e=n.data("layoutMask"),options[e].maskObjects||n.hide()},getMasks=function(t){for(var e,n=$([]),i=0,r=$Ms.length;ic.maxSize?(syncPinBtns(a,!1),!i&&u.tips.noRoomToOpen&&alert(u.tips.noRoomToOpen),t()):(e?bindStopSlidingEvents(a,!0):c.isSliding?bindStopSlidingEvents(a,!1):u.slidable&&bindStartSlidingEvents(a,!1),c.noRoom=!1,makePaneFit(a),s=c.isShowing,delete c.isShowing,o=!n&&c.isClosed&&"none"!=u.fxName_open,c.isMoving=!0,c.isVisible=!0,c.isClosed=!1,s&&(c.isHidden=!1),void(o?(lockPaneForFX(a,!0),l.show(u.fxName_open,u.fxSettings_open,u.fxSpeed_open,function(){lockPaneForFX(a,!1),c.isVisible&&r(),t()})):(_showPane(a),r(),t()))))})}},setAsOpen=function(t,e){var n=$Ps[t],i=$Rs[t],r=$Ts[t],o=options[t],s=state[t],a=_c[t].side,l=o.resizerClass,u=o.togglerClass,c="-"+t,h="-open",f="-closed",d="-sliding";i.css(a,sC.inset[a]+getPaneSize(t)).removeClass(l+f+" "+l+c+f).addClass(l+h+" "+l+c+h),s.isSliding?i.addClass(l+d+" "+l+c+d):i.removeClass(l+d+" "+l+c+d),removeHover(0,i),o.resizable&&$.layout.plugins.draggable?i.draggable("enable").css("cursor",o.resizerCursor).attr("title",o.tips.Resize):s.isSliding||i.css("cursor","default"),r&&(r.removeClass(u+f+" "+u+c+f).addClass(u+h+" "+u+c+h).attr("title",o.tips.Close),removeHover(0,r),r.children(".content-closed").hide(),r.children(".content-open").css("display","block")),syncPinBtns(t,!s.isSliding),$.extend(s,elDims(n)),state.initialized&&(sizeHandles(),sizeContent(t,!0)),!e&&(state.initialized||o.triggerEventsOnLoad)&&n.is(":visible")&&(_runCallbacks("onopen_end",t),s.isShowing&&_runCallbacks("onshow_end",t),state.initialized&&_runCallbacks("onresize_end",t))},slideOpen=function(t){function e(){r.isClosed?r.isMoving||open(i,!0):bindStopSlidingEvents(i,!0)}if(isInitialized()){var n=evtObj(t),i=evtPane.call(this,t),r=state[i],o=options[i].slideDelay_open;"center"!==i&&(n&&n.stopImmediatePropagation(),r.isClosed&&n&&"mouseenter"===n.type&&o>0?timer.set(i+"_openSlider",e,o):e())}},slideClose=function(t){function e(){o.isClosed?bindStopSlidingEvents(i,!1):o.isMoving||close(i)}if(isInitialized()){var n=evtObj(t),i=evtPane.call(this,t),r=options[i],o=state[i],s=o.isMoving?1e3:300;if("center"!==i&&!o.isClosed&&!o.isResizing)if("click"===r.slideTrigger_close)e();else{if(r.preventQuickSlideClose&&o.isMoving)return;if(r.preventPrematureSlideClose&&n&&$.layout.isMouseOverElem(n,$Ps[i]))return;n?timer.set(i+"_closeSlider",e,max(r.slideDelay_close,s)):e()}}},slideToggle=function(t){var e=evtPane.call(this,t);toggle(e,!0)},lockPaneForFX=function(t,e){var n=$Ps[t],i=state[t],r=options[t],o=options.zIndexes;e?(showMasks(t,{animation:!0,objectsOnly:!0}),n.css({zIndex:o.pane_animate}),"south"==t?n.css({top:sC.inset.top+sC.innerHeight-n.outerHeight()}):"east"==t&&n.css({left:sC.inset.left+sC.innerWidth-n.outerWidth()})):(hideMasks(),n.css({zIndex:i.isSliding?o.pane_sliding:o.pane_normal}),"south"==t?n.css({top:"auto"}):"east"!=t||n.css("left").match(/\-99999/)||n.css({left:"auto"}),browser.msie&&r.fxOpacityFix&&"slide"!=r.fxName_open&&n.css("filter")&&1==n.css("opacity")&&n[0].style.removeAttribute("filter"))},bindStartSlidingEvents=function(t,e){var n=options[t],i=($Ps[t],$Rs[t]),r=n.slideTrigger_open.toLowerCase();!i||e&&!n.slidable||(r.match(/mouseover/)?r=n.slideTrigger_open="mouseenter":r.match(/(click|dblclick|mouseenter)/)||(r=n.slideTrigger_open="click"),n.resizerDblClickToggle&&r.match(/click/)&&i[e?"unbind":"bind"]("dblclick."+sID,toggle),i[e?"bind":"unbind"](r+"."+sID,slideOpen).css("cursor",e?n.sliderCursor:"default").attr("title",e?n.tips.Slide:""))},bindStopSlidingEvents=function(t,e){function n(e){timer.clear(t+"_closeSlider"),e.stopPropagation()}var i=options[t],r=state[t],o=(_c[t],options.zIndexes),s=i.slideTrigger_close.toLowerCase(),a=e?"bind":"unbind",l=$Ps[t],u=$Rs[t];timer.clear(t+"_closeSlider"),e?(r.isSliding=!0,state.panesSliding[t]=!0,bindStartSlidingEvents(t,!1)):(r.isSliding=!1,delete state.panesSliding[t]),l.css("zIndex",e?o.pane_sliding:o.pane_normal),u.css("zIndex",e?o.pane_sliding+2:o.resizer_normal),s.match(/(click|mouseleave)/)||(s=i.slideTrigger_close="mouseleave"),u[a](s,slideClose),"mouseleave"===s&&(l[a]("mouseleave."+sID,slideClose),u[a]("mouseenter."+sID,n),l[a]("mouseenter."+sID,n)),e?"click"!==s||i.resizable||(u.css("cursor",e?i.sliderCursor:"default"),u.attr("title",e?i.tips.Close:"")):timer.clear(t+"_closeSlider")},makePaneFit=function(t,e,n,i){var r=options[t],o=state[t],s=_c[t],a=$Ps[t],l=$Rs[t],u="vert"===s.dir,c=!1;if(("center"===t||u&&o.noVerticalRoom)&&(c=o.maxHeight>=0,c&&o.noRoom?(_showPane(t),l&&l.show(),o.isVisible=!0,o.noRoom=!1,u&&(o.noVerticalRoom=!1),_fixIframe(t)):c||o.noRoom||(_hidePane(t),l&&l.hide(),o.isVisible=!1,o.noRoom=!0)),"center"===t);else if(o.minSize<=o.maxSize){if(c=!0,o.size>o.maxSize)sizePane(t,o.maxSize,n,!0,i);else if(o.sizee?u.attempt=max(0,o.attempt-(o.actual-e)):u.attempt=max(0,o.attempt+(e-o.actual)),u.cssSize=cssSize(l,u.attempt),h.css(p,u.cssSize),u.actual="width"==p?h.outerWidth():h.outerHeight(),u.correct=e===u.actual,1===i.length&&(_log(m,!1,!0),_log(o,!1,!0)),_log(u,!1,!0),i.length>3));)i.push(u),o=i[i.length-1];c.size=e,$.extend(c,elDims(h)),c.isVisible&&h.is(":visible")&&(f&&f.css(d,e+sC.inset[d]),sizeContent(l)),!n&&!g&&state.initialized&&c.isVisible&&_runCallbacks("onresize_end",l),n||(c.isSliding||sizeMidPanes("horz"==_c[l].dir?"":"center",g,r),sizeHandles());var v=_c.oppositeEdge[l];e1&&_log(m+"\nSee the Error Console for details.",!0,!0)}if(isInitialized()){var s,a,l=evtPane.call(this,t),u=options[l],c=state[l],h=$Ps[l],f=$Rs[l],d=_c[l].side,p=_c[l].sizeType.toLowerCase(),g=c.isResizing&&!u.triggerEventsDuringLiveResize,m=i!==!0&&u.animatePaneSizing;"center"!==l&&$N.queue(function(t){if(setSizeLimits(l),s=c.size,e=_parseSize(l,e),e=max(e,_parseSize(l,u.minSize)),e=min(e,c.maxSize),e=0&&l.height>=0,!state.initialized&&r.minWidth>c.width){var h=r.minWidth-o.outerWidth,f=options.east.minSize||0,d=options.west.minSize||0,p=state.east.size,g=state.west.size,m=p,v=g;if(h>0&&state.east.isVisible&&p>f&&(m=max(p-f,p-h),h-=p-m),h>0&&state.west.isVisible&&g>d&&(v=max(g-d,g-h),h-=g-v),0===h)return p&&p!=f&&sizePane("east",m,!0,!0,n),g&&g!=d&&sizePane("west",v,!0,!0,n),sizeMidPanes("center",e,n),void s.css(u)}}else{if(o.isVisible&&!o.noVerticalRoom&&$.extend(o,elDims(s),cssMinDims(i)),!n&&!o.noVerticalRoom&&c.height===o.outerHeight)return s.css(u),!0;l.top=c.top,l.bottom=c.bottom,o.newSize=c.height,l.height=cssH(s,c.height),o.maxHeight=l.height,a=o.maxHeight>=0,a||(o.noVerticalRoom=!0)}if(a?(!e&&state.initialized&&_runCallbacks("onresize_start",i),s.css(l),"center"!==i&&sizeHandles(i),!o.noRoom||o.isClosed||o.isHidden||makePaneFit(i),o.isVisible&&($.extend(o,elDims(s)),state.initialized&&sizeContent(i))):!o.noRoom&&o.isVisible&&makePaneFit(i),s.css(u),delete o.newSize,delete o.newWidth,delete o.newHeight,!o.isVisible)return!0;if("center"===i){var y=browser.isIE6||!browser.boxModel;$Ps.north&&(y||"IFRAME"==state.north.tagName)&&$Ps.north.css("width",cssW($Ps.north,sC.innerWidth)),$Ps.south&&(y||"IFRAME"==state.south.tagName)&&$Ps.south.css("width",cssW($Ps.south,sC.innerWidth))}!e&&state.initialized&&_runCallbacks("onresize_end",i)}})},resizeAll=function(t){var e=sC.innerWidth,n=sC.innerHeight;if(evtPane(t),$N.is(":visible")){if(!state.initialized)return void _initLayoutElements();if(t===!0&&$.isPlainObject(options.outset)&&$N.css(options.outset),$.extend(sC,elDims($N,options.inset)),sC.outerHeight){if(t===!0&&setPanePosition(),!1===_runCallbacks("onresizeall_start"))return!1;var i,r,o;sC.innerHeight0&&"hidden"===o.css("overflow")&&(o.css("overflow","visible"),r(),o.css("overflow","hidden")));var c=l.innerHeight-(u.spaceAbove-l.css.paddingTop)-(u.spaceBelow-l.css.paddingBottom);s.is(":visible")&&u.height==c||(setOuterHeight(s,c,!0),u.height=c),state.initialized&&_runCallbacks("onsizecontent_end",n)}})}},sizeHandles=function(t){var e=evtPane.call(this,t);e=e?e.split(","):_c.borderPanes,$.each(e,function(t,e){var n,i=options[e],r=state[e],o=$Ps[e],s=$Rs[e],a=$Ts[e];if(o&&s){var l,u,c,h=_c[e].dir,f=r.isClosed?"_closed":"_open",d=i["spacing"+f],p=i["togglerAlign"+f],g=i["togglerLength"+f];if(0===d)return void s.hide();if(r.noRoom||r.isHidden||s.show(),"horz"===h?(l=sC.innerWidth,r.resizerLength=l,u=$.layout.cssNum(o,"left"),s.css({width:cssW(s,l),height:cssH(s,d),left:u>-9999?u:sC.inset.left})):(l=o.outerHeight(),r.resizerLength=l,s.css({height:cssH(s,l),width:cssW(s,d),top:sC.inset.top+getPaneSize("north",!0)})),removeHover(i,s),a){if(0===g||r.isSliding&&i.hideTogglerOnSlide)return void a.hide();if(a.show(),!(g>0)||"100%"===g||g>l)g=l,c=0;else if(isStr(p))switch(p){case"top":case"left":c=0;break;case"bottom":case"right":c=l-g;break;case"middle":case"center":default:c=round((l-g)/2)}else{var m=parseInt(p,10);c=p>=0?m:l-g+m}if("horz"===h){var v=cssW(a,g);a.css({width:v,height:cssH(a,d),left:c,top:0}),a.children(".content").each(function(){n=$(this),n.css("marginLeft",round((v-n.outerWidth())/2))})}else{var y=cssH(a,g);a.css({height:y,width:cssW(a,d),top:c,left:0}),a.children(".content").each(function(){n=$(this),n.css("marginTop",round((y-n.outerHeight())/2))})}removeHover(0,a)}state.initialized||!i.initHidden&&!r.isHidden||(s.hide(),a&&a.hide())}})},enableClosable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Ts[e],i=options[e];n&&(i.closable=!0,n.bind("click."+sID,function(t){t.stopPropagation(),toggle(e)}).css("visibility","visible").css("cursor","pointer").attr("title",state[e].isClosed?i.tips.Open:i.tips.Close).show())}},disableClosable=function(t,e){if(isInitialized()){var n=evtPane.call(this,t),i=$Ts[n];i&&(options[n].closable=!1,state[n].isClosed&&open(n,!1,!0),i.unbind("."+sID).css("visibility",e?"hidden":"visible").css("cursor","default").attr("title",""))}},enableSlidable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Rs[e];n&&n.data("draggable")&&(options[e].slidable=!0,state[e].isClosed&&bindStartSlidingEvents(e,!0))}},disableSlidable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Rs[e];n&&(options[e].slidable=!1,state[e].isSliding?close(e,!1,!0):(bindStartSlidingEvents(e,!1),n.css("cursor","default").attr("title",""),removeHover(null,n[0])))}},enableResizable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Rs[e],i=options[e];n&&n.data("draggable")&&(i.resizable=!0,n.draggable("enable"),state[e].isClosed||n.css("cursor",i.resizerCursor).attr("title",i.tips.Resize))}},disableResizable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Rs[e];n&&n.data("draggable")&&(options[e].resizable=!1,n.draggable("disable").css("cursor","default").attr("title",""),removeHover(null,n[0]))}},swapPanes=function(t,e){ -function n(t){var e=$Ps[t],n=$Cs[t];return!!e&&{pane:t,P:!!e&&e[0],C:!!n&&n[0],state:$.extend(!0,{},state[t]),options:$.extend(!0,{},options[t])}}function i(t,e){if(t){var n,i,r=t.P,o=t.C,s=t.pane,l=_c[e],u=$.extend(!0,{},state[e]),c=options[e],h={resizerCursor:c.resizerCursor};$.each("fxName,fxSpeed,fxSettings".split(","),function(t,e){h[e+"_open"]=c[e+"_open"],h[e+"_close"]=c[e+"_close"],h[e+"_size"]=c[e+"_size"]}),$Ps[e]=$(r).data({layoutPane:Instance[e],layoutEdge:e}).css(_c.hidden).css(l.cssReq),$Cs[e]=!!o&&$(o),options[e]=$.extend(!0,{},t.options,h),state[e]=$.extend(!0,{},t.state),n=new RegExp(c.paneClass+"-"+s,"g"),r.className=r.className.replace(n,c.paneClass+"-"+e),initHandles(e),l.dir!=_c[s].dir?(i=a[e]||0,setSizeLimits(e),i=max(i,state[e].minSize),manualSizePane(e,i,!0,!0)):$Rs[e].css(l.side,sC.inset[l.side]+(state[e].isVisible?getPaneSize(e):0)),t.state.isVisible&&!u.isVisible?setAsOpen(e,!0):(setAsClosed(e),bindStartSlidingEvents(e,!0)),t=null}}if(isInitialized()){var r=evtPane.call(this,t);if(state[r].edge=e,state[e].edge=r,!1===_runCallbacks("onswap_start",r)||!1===_runCallbacks("onswap_start",e))return state[r].edge=r,void(state[e].edge=e);var o=n(r),s=n(e),a={};a[r]=o?o.state.size:0,a[e]=s?s.state.size:0,$Ps[r]=!1,$Ps[e]=!1,state[r]={},state[e]={},$Ts[r]&&$Ts[r].remove(),$Ts[e]&&$Ts[e].remove(),$Rs[r]&&$Rs[r].remove(),$Rs[e]&&$Rs[e].remove(),$Rs[r]=$Rs[e]=$Ts[r]=$Ts[e]=!1,i(o,e),i(s,r),o=s=a=null,$Ps[r]&&$Ps[r].css(_c.visible),$Ps[e]&&$Ps[e].css(_c.visible),resizeAll(),_runCallbacks("onswap_end",r),_runCallbacks("onswap_end",e)}},syncPinBtns=function(t,e){$.layout.plugins.buttons&&$.each(state[t].pins,function(n,i){$.layout.buttons.setPinState(Instance,$(i),t,e)})},$N=$(this).eq(0);if(!$N.length)return _log(options.errors.containerMissing);if($N.data("layoutContainer")&&$N.data("layout"))return $N.data("layout");var $Ps={},$Cs={},$Rs={},$Ts={},$Ms=$([]),sC=state.container,sID=state.id,Instance={options:options,state:state,container:$N,panes:$Ps,contents:$Cs,resizers:$Rs,togglers:$Ts,hide:hide,show:show,toggle:toggle,open:open,close:close,slideOpen:slideOpen,slideClose:slideClose,slideToggle:slideToggle,setSizeLimits:setSizeLimits,_sizePane:sizePane,sizePane:manualSizePane,sizeContent:sizeContent,swapPanes:swapPanes,showMasks:showMasks,hideMasks:hideMasks,initContent:initContent,addPane:addPane,removePane:removePane,createChildren:createChildren,refreshChildren:refreshChildren,enableClosable:enableClosable,disableClosable:disableClosable,enableSlidable:enableSlidable,disableSlidable:disableSlidable,enableResizable:enableResizable,disableResizable:disableResizable,allowOverflow:allowOverflow,resetOverflow:resetOverflow,destroy:destroy,initPanes:isInitialized,resizeAll:resizeAll,runCallbacks:_runCallbacks,hasParentLayout:!1,children:children,north:!1,south:!1,west:!1,east:!1,center:!1};return"cancel"===_create()?null:Instance}}(jQuery),function(t){t.layout&&(t.ui||(t.ui={}),t.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(e){var n,i,r,o=document.cookie,s=o?o.split(";"):[];for(r=0;n=s[r];r++)if(i=t.trim(n).split("="),i[0]==e)return decodeURIComponent(i[1]);return null},write:function(e,n,i){var r="",o="",s=!1,a=i||{},l=a.expires||null,u=t.type(l);"date"===u?o=l:"string"===u&&l>0&&(l=parseInt(l,10),u="number"),"number"===u&&(o=new Date,l>0?o.setDate(o.getDate()+l):(o.setFullYear(1970),s=!0)),o&&(r+=";expires="+o.toUTCString()),a.path&&(r+=";path="+a.path),a.domain&&(r+=";domain="+a.domain),a.secure&&(r+=";secure"),document.cookie=e+"="+(s?"":encodeURIComponent(n))+r},clear:function(e){t.ui.cookie.write(e,"",{expires:-1})}},t.cookie||(t.cookie=function(e,n,i){var r=t.ui.cookie;if(null===n)r.clear(e);else{if(void 0===n)return r.read(e);r.write(e,n,i)}}),t.layout.plugins.stateManagement=!0,t.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}},t.layout.optionsMap.layout.push("stateManagement"),t.layout.config.optionRootKeys.push("stateManagement"),t.layout.state={saveCookie:function(e,n,i){var r=e.options,o=r.stateManagement,s=t.extend(!0,{},o.cookie,i||null),a=e.state.stateData=e.readState(n||o.stateKeys);return t.ui.cookie.write(s.name||r.name||"Layout",t.layout.state.encodeJSON(a),s),t.extend(!0,{},a)},deleteCookie:function(e){var n=e.options;t.ui.cookie.clear(n.stateManagement.cookie.name||n.name||"Layout")},readCookie:function(e){var n=e.options,i=t.ui.cookie.read(n.stateManagement.cookie.name||n.name||"Layout");return i?t.layout.state.decodeJSON(i):{}},loadCookie:function(e){var n=t.layout.state.readCookie(e);return n&&!t.isEmptyObject(n)&&(e.state.stateData=t.extend(!0,{},n),e.loadState(n)),n},loadState:function(e,n,i){if(t.isPlainObject(n)&&!t.isEmptyObject(n)){n=e.state.stateData=t.layout.transformData(n);var r=e.options.stateManagement;if(i=t.extend({animateLoad:!1,includeChildren:r.includeChildren},i),e.state.initialized){var o,a,l,u,c,h=!i.animateLoad;if(t.each(t.layout.config.borderPanes,function(i,r){o=n[r],t.isPlainObject(o)&&(s=o.size,a=o.initClosed,l=o.initHidden,ar=o.autoResize,u=e.state[r],c=u.isVisible,ar&&(u.autoResize=ar),c||e._sizePane(r,s,!1,!1,!1),l===!0?e.hide(r,h):a===!0?e.close(r,!1,h):a===!1?e.open(r,!1,h):l===!1&&e.show(r,!1,h),c&&e._sizePane(r,s,!1,!1,h))}),i.includeChildren){var f,d;t.each(e.children,function(e,i){f=n[e]?n[e].children:0,f&&i&&t.each(i,function(t,e){d=f[t],e&&d&&e.loadState(d)})})}}else{var o=t.extend(!0,{},n);t.each(t.layout.config.allPanes,function(t,e){o[e]&&delete o[e].children}),t.extend(!0,e.options,o)}}},readState:function(e,n){"string"===t.type(n)&&(n={keys:n}),n||(n={});var i,r,o,s,a,l,u,c=e.options.stateManagement,h=n.includeChildren,f=void 0!==h?h:c.includeChildren,d=n.stateKeys||c.stateKeys,p={isClosed:"initClosed",isHidden:"initHidden"},g=e.state,m=t.layout.config.allPanes,v={};t.isArray(d)&&(d=d.join(",")),d=d.replace(/__/g,".").split(",");for(var y=0,b=d.length;y=0){var a=s[i].buttonClass+"-"+r;o.addClass(a+" "+a+"-"+i).data("layoutName",s.name)}return o},bind:function(e,n,i,r){var o=t.layout.buttons;switch(i.toLowerCase()){case"toggle":o.addToggle(e,n,r);break;case"open":o.addOpen(e,n,r);break;case"close":o.addClose(e,n,r);break;case"pin":o.addPin(e,n,r);break;case"toggle-slide":o.addToggle(e,n,r,!0);break;case"open-slide":o.addOpen(e,n,r,!0)}return e},addToggle:function(e,n,i,r){return t.layout.buttons.get(e,n,i,"toggle").click(function(t){e.toggle(i,!!r),t.stopPropagation()}),e},addOpen:function(e,n,i,r){return t.layout.buttons.get(e,n,i,"open").attr("title",e.options[i].tips.Open).click(function(t){e.open(i,!!r),t.stopPropagation()}),e},addClose:function(e,n,i){return t.layout.buttons.get(e,n,i,"close").attr("title",e.options[i].tips.Close).click(function(t){e.close(i),t.stopPropagation()}),e},addPin:function(e,n,i){var r=t.layout.buttons.get(e,n,i,"pin");if(r.length){var o=e.state[i];r.click(function(n){t.layout.buttons.setPinState(e,t(this),i,o.isSliding||o.isClosed),o.isSliding||o.isClosed?e.open(i):e.close(i),n.stopPropagation()}),t.layout.buttons.setPinState(e,r,i,!o.isClosed&&!o.isSliding),o.pins.push(n)}return e},setPinState:function(t,e,n,i){var r=e.attr("pin");if(!r||i!==("down"==r)){var o=t.options[n],s=o.tips,a=o.buttonClass+"-pin",l=a+"-"+n,u=a+"-up "+l+"-up",c=a+"-down "+l+"-down";e.attr("pin",i?"down":"up").attr("title",i?s.Unpin:s.Pin).removeClass(i?u:c).addClass(i?c:u)}},syncPinBtns:function(e,n,i){t.each(state[n].pins,function(r,o){t.layout.buttons.setPinState(e,t(o),n,i)})},_load:function(e){t.extend(e,{bindButton:function(n,i,r){return t.layout.buttons.bind(e,n,i,r)},addToggleBtn:function(n,i,r){return t.layout.buttons.addToggle(e,n,i,r)},addOpenBtn:function(n,i,r){return t.layout.buttons.addOpen(e,n,i,r)},addCloseBtn:function(n,i){return t.layout.buttons.addClose(e,n,i)},addPinBtn:function(n,i){return t.layout.buttons.addPin(e,n,i)}});for(var n=0;n<4;n++){var i=t.layout.buttons.config.borderPanes[n];e.state[i].pins=[]}e.options.autoBindCustomButtons&&t.layout.buttons.init(e)},_unload:function(t){}},t.layout.onLoad.push(t.layout.buttons._load))}(jQuery),function(t){t.layout.plugins.browserZoom=!0,t.layout.defaults.browserZoomCheckInterval=1e3,t.layout.optionsMap.layout.push("browserZoomCheckInterval"),t.layout.browserZoom={_init:function(e){t.layout.browserZoom.ratio()!==!1&&t.layout.browserZoom._setTimer(e)},_setTimer:function(e){if(!e.destroyed){var n=e.options,i=e.state,r=e.hasParentLayout?5e3:Math.max(n.browserZoomCheckInterval,100);setTimeout(function(){if(!e.destroyed&&n.resizeWithWindow){var r=t.layout.browserZoom.ratio();r!==i.browserZoom&&(i.browserZoom=r,e.resizeAll()),t.layout.browserZoom._setTimer(e)}},r)}},ratio:function(){function e(t,e){return(parseInt(t,10)/parseInt(e,10)*100).toFixed()}var n,i,r,o=window,s=screen,a=document,l=a.documentElement||a.body,u=t.layout.browser,c=u.version;return!(!u.msie||c>8)&&(s.deviceXDPI&&s.systemXDPI?e(s.deviceXDPI,s.systemXDPI):u.webkit&&(n=a.body.getBoundingClientRect)?e(n.left-n.right,a.body.offsetWidth):u.webkit&&(i=o.outerWidth)?e(i,o.innerWidth):!(!(i=s.width)||!(r=l.clientWidth))&&e(i,r))}},t.layout.onReady.push(t.layout.browserZoom._init)}(jQuery),function(t){t.effects&&(t.layout.defaults.panes.useOffscreenClose=!1,t.layout.plugins&&(t.layout.plugins.effects.slideOffscreen=!0),t.layout.effects.slideOffscreen=t.extend(!0,{},t.layout.effects.slide),t.effects.slideOffscreen=function(e){return this.queue(function(){var n=t.effects,i=e.options,r=t(this),o=r.data("layoutEdge"),s=r.data("parentLayout").state,a=s[o].size,l=this.style,u=n.setMode(r,i.mode||"show"),c="show"==u,h=i.direction||"left",f="up"==h||"down"==h?"top":"left",d="up"==h||"left"==h,p=t.layout.config.offscreenCSS||{},g=t.layout.config.offscreenReset,m="offscreenResetTop",v={};v[f]=(c?d?"+=":"-=":d?"-=":"+=")+a,c?(r.data(m,{top:l.top,bottom:l.bottom}),d?r.css(f,isNaN(a)?"-"+a:-a):"right"===h?r.css({left:s.container.layoutWidth,right:"auto"}):r.css({top:s.container.layoutHeight,bottom:"auto"}),"top"===f&&r.css(r.data(g)||{})):(r.data(m,{top:l.top,bottom:l.bottom}),r.data(g,{left:l.left,right:l.right})),r.show().animate(v,{queue:!1,duration:e.duration,easing:i.easing,complete:function(){r.data(m)&&r.css(r.data(m)).removeData(m),c?r.css(r.data(g)||{}).removeData(g):r.css(p),e.callback&&e.callback.apply(this,arguments),r.dequeue()}})})})}(jQuery),function(t){t.fn.extend({simulate:function(e,n){return this.each(function(){var i=t.extend({},t.simulate.defaults,n||{});new t.simulate(this,e,i)})}}),t.simulate=function(t,e,n){this.target=t,this.options=n,/^drag$/.test(e)?this[e].apply(this,[this.target,n]):this.simulateEvent(t,e,n)},t.extend(t.simulate.prototype,{simulateEvent:function(t,e,n){var i=this.createEvent(e,n);return this.dispatchEvent(t,e,i,n),i},createEvent:function(t,e){return/^mouse(over|out|down|up|move)|(dbl)?click$/.test(t)?this.mouseEvent(t,e):/^key(up|down|press)$/.test(t)?this.keyboardEvent(t,e):void 0},mouseEvent:function(e,n){var i,r=t.extend({bubbles:!0,cancelable:"mousemove"!=e,view:window,detail:0,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0},n);t(r.relatedTarget)[0];return t.isFunction(document.createEvent)?(i=document.createEvent("MouseEvents"),i.initMouseEvent(e,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget||document.body.parentNode)):document.createEventObject&&(i=document.createEventObject(),t.extend(i,r),i.button={0:1,1:4,2:2}[i.button]||i.button),i},keyboardEvent:function(e,n){var i,r=t.extend({bubbles:!0,cancelable:!0,view:window,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:0,charCode:0},n);if(t.isFunction(document.createEvent))try{i=document.createEvent("KeyEvents"),i.initKeyEvent(e,r.bubbles,r.cancelable,r.view,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode)}catch(o){i=document.createEvent("Events"),i.initEvent(e,r.bubbles,r.cancelable),t.extend(i,{view:r.view,ctrlKey:r.ctrlKey,altKey:r.altKey,shiftKey:r.shiftKey,metaKey:r.metaKey,keyCode:r.keyCode,charCode:r.charCode})}else document.createEventObject&&(i=document.createEventObject(),t.extend(i,r));return void 0!==t.browser&&(t.browser.msie||t.browser.opera)&&(i.keyCode=r.charCode>0?r.charCode:r.keyCode,i.charCode=void 0),i},dispatchEvent:function(t,e,n){return t.dispatchEvent?t.dispatchEvent(n):t.fireEvent&&t.fireEvent("on"+e,n),n},drag:function(t){var e=this.findCenter(this.target),n=this.options,i=Math.floor(e.x),r=Math.floor(e.y),o=n.dx||0,s=n.dy||0,a=this.target,l={clientX:i,clientY:r};this.simulateEvent(a,"mousedown",l),l={clientX:i+1,clientY:r+1},this.simulateEvent(document,"mousemove",l),l={clientX:i+o,clientY:r+s},this.simulateEvent(document,"mousemove",l),this.simulateEvent(document,"mousemove",l),this.simulateEvent(a,"mouseup",l)},findCenter:function(e){var e=t(this.target),n=e.offset();return{x:n.left+e.outerWidth()/2,y:n.top+e.outerHeight()/2}}}),t.extend(t.simulate,{defaults:{speed:"sync"},VK_TAB:9,VK_ENTER:13,VK_ESC:27,VK_PGUP:33,VK_PGDN:34,VK_END:35,VK_HOME:36,VK_LEFT:37,VK_UP:38,VK_RIGHT:39,VK_DOWN:40})}(jQuery),"undefined"==typeof Worker||"undefined"!=typeof location&&"file:"===location.protocol?"undefined"!=typeof global&&"undefined"!=typeof require?this.LZMA=function(t){return require(t||"./lzma_worker.js").LZMA}:"undefined"!=typeof window&&window.document?!function(){function t(t){var n;return i(t),n={compress:function(t,i,r,o){e.LZMA_WORKER?e.LZMA_WORKER.compress(t,i,r,o):setTimeout(function(){n.compress(t,i,r,o)},50)},decompress:function(t,i,r){e.LZMA_WORKER?e.LZMA_WORKER.decompress(t,i,r):setTimeout(function(){n.decompress(t,i,r)},50)},worker:function(){return null}}}var e,n=this,i=function(e){var i=document.createElement("script");i.type="text/javascript",i.src=e,i.onload=function(){n.LZMA=t},document.getElementsByTagName("head")[0].appendChild(i)};"undefined"!=typeof window?e=window:global&&(e=global),n.LZMA=t}():console.error("Can't load the worker. Sorry."):this.LZMA=function(t){var e=1,n=2,i=3,r={},o=new Worker(t||"./lzma_worker-min.js");return o.onmessage=function(t){t.data.action===i?r[t.data.cbn]&&"function"==typeof r[t.data.cbn].on_progress&&r[t.data.cbn].on_progress(t.data.result):r[t.data.cbn]&&"function"==typeof r[t.data.cbn].on_finish&&(r[t.data.cbn].on_finish(t.data.result,t.data.error),delete r[t.data.cbn])},o.onerror=function(t){var e=new Error(t.message+" ("+t.filename+":"+t.lineno+")");for(var n in r)r[n].on_finish(null,e);console.error("Uncaught error in lzma_worker",e)},function(){function t(t,e,n,i,s){var a;do a=Math.floor(1e7*Math.random());while("undefined"!=typeof r[a]);r[a]={on_finish:i,on_progress:s},o.postMessage({action:t,cbn:a,data:e,mode:n})}return{compress:function(n,i,r,o){t(e,n,i,r,o)},decompress:function(e,i,r){t(n,e,!1,i,r)},worker:function(){return o}}}()},function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n?n:t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function r(t){return 3*t.length/4-i(t)}function o(t){var e,n,r,o,s,a,l=t.length;s=i(t),a=new h(3*l/4-s),r=s>0?l-4:l;var u=0;for(e=0,n=0;e>16&255,a[u++]=o>>8&255,a[u++]=255&o;return 2===s?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,a[u++]=255&o):1===s&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,a[u++]=o>>8&255,a[u++]=255&o),a}function s(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,n){for(var i,r=[],o=e;oc?c:l+s));return 1===i?(e=t[n-1],r+=u[e>>2],r+=u[e<<4&63],r+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],r+=u[e>>10],r+=u[e>>4&63],r+=u[e<<2&63],r+="="),o.push(r),o.join("")}n.byteLength=r,n.toByteArray=o,n.fromByteArray=l;for(var u=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=f.length;d=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function m(t){return+t!=t&&(t=0),s.alloc(+t)}function v(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(t).length;default:if(i)return q(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return P(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function b(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function w(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=s.from(e,i)),s.isBuffer(e))return 0===e.length?-1:_(t,e,n,i,r);if("number"==typeof e)return e=255&e,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):_(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,i,r){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,l=e.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,n/=2}var u;if(r){var c=-1;for(u=n;ua&&(n=a-l),u=n;u>=0;u--){for(var h=!0,f=0;fr&&(i=r)):i=r;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(r+a<=n){var l,u,c,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=t[r+1],128===(192&l)&&(h=(31&o)<<6|63&l,h>127&&(s=h));break;case 3:l=t[r+1],u=t[r+2],128===(192&l)&&128===(192&u)&&(h=(15&o)<<12|(63&l)<<6|63&u,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=t[r+1],u=t[r+2],c=t[r+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(h=(15&o)<<18|(63&l)<<12|(63&u)<<6|63&c,h>65535&&h<1114112&&(s=h))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),r+=a}return M(i)}function M(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",i=0;ii)&&(n=i);for(var r="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,n,i,r,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function z(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function j(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function $(t,e,n,i,r,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function H(t,e,n,i,r){return r||$(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,n,i,23,4),n+4}function F(t,e,n,i,r){return r||$(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,n,i,52,8),n+8}function W(t){if(t=B(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function B(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,e){e=e||1/0;for(var n,i=t.length,r=null,o=[],s=0;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Y(t){for(var e=[],n=0;n>8,r=n%256,o.push(r),o.push(i);return o}function G(t){return J.toByteArray(W(t))}function K(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function X(t){return t!==t}var J=t("base64-js"),Z=t("ieee754"),Q=t("isarray");n.Buffer=s,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:i(),n.kMaxLength=r(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,n){return a(null,t,e,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,n){return u(null,t,e,n)},s.allocUnsafe=function(t){return c(null,t)},s.allocUnsafeSlow=function(t){return c(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,r=0,o=Math.min(n,i);r0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,n,i,r){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,r>>>=0,this===t)return 0;for(var o=r-i,a=n-e,l=Math.min(o,a),u=this.slice(i,r),c=t.slice(e,n),h=0;hr)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return S(this,t,e,n);case"ascii":return k(this,t,e,n);case"latin1":case"binary":return C(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;s.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e0&&(r*=256);)i+=this[t+--e]*r;return i},s.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t=0|t,e=0|e,n||R(t,e,this.length);for(var i=this[t],r=1,o=0;++o=r&&(i-=Math.pow(2,8*e)),i},s.prototype.readIntBE=function(t,e,n){t=0|t,e=0|e,n||R(t,e,this.length);for(var i=e,r=1,o=this[t+--i];i>0&&(r*=256);)o+=this[t+--i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},s.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),Z.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),Z.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),Z.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),Z.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=0|e,n=0|n,!i){var r=Math.pow(2,8*n)-1;N(this,t,e,n,r,0)}var o=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+o]=t/s&255;return e+n},s.prototype.writeUInt8=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=0|e,!i){var r=Math.pow(2,8*n-1);N(this,t,e,n,r-1,-r)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},s.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=0|e,!i){var r=Math.pow(2,8*n-1);N(this,t,e,n,r-1,-r)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,n){return H(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return H(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return F(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return F(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--r)t[r+e]=this[r+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o>1,c=-7,h=n?r-1:0,f=n?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:(d?-1:1)*(1/0);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},n.write=function(t,e,n,i,r,o){var s,a,l,u=8*o-r-1,c=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),e+=s+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+d]=255&a,d+=p,a/=256,r-=8);for(s=s<0;t[n+d]=255&s,d+=p,s/=256,u-=8);t[n+d-p]|=128*g}},{}],4:[function(t,e,n){var i={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},{}],5:[function(t,e,n){(function(t){function e(t){return t.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function i(e){return e+=Array(5-e.length%4).join("="),e=e.replace(/\-/g,"+").replace(/\_/g,"/"),new t(e,"base64")}function r(t){return/^[A-Za-z0-9\-_]+$/.test(t)}function o(e){return new t(e)}n.version="1.0.0",SafeEncode={encode:e,decode:i,validate:r,buffer:o}}).call(this,t("buffer").Buffer)},{buffer:2}]},{},[5]),!function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n?n:e)},u,u.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s-1&&(t=new RegExp("rv:([0-9]{2,2}[.0-9]{0,})"),null!==t.exec(n)&&(e=parseFloat(RegExp.$1))),e}function r(t){var e="";for(var n in t)e+=n+"="+t[n]+",";return e.slice(0,-1)}function o(t,e){return!(!t||null==t[e])}function s(t,e){var n=t.status,r="string"==typeof t.responseText?t.responseText:t,o=10===i()||11===i(),s=!n||0===n,a=!!window.navigator.onLine;s&&!a?(n=0,r={code:"offline"}):s&&o?(n=401,r={code:"invalid_user_password"}):s&&(n=0,r={code:"connection_refused_timeout"});var l=new P(n,r);e(l)}function a(t,e,n){return t+"//"+e+n}function l(t){return this instanceof l?(g(t,"clientID"),g(t,"domain"),this._useJSONP=null!=t.forceJSONP?!!t.forceJSONP:O()&&!T("https:",t.domain),this._clientID=t.clientID,this._callbackURL=t.callbackURL||document.location.href,this._shouldRedirect=!!t.callbackURL,this._domain=t.domain,this._responseType=this._parseResponseType(t,!0)||"code",this._responseMode=this._parseResponseMode(t,!0),this._cordovaSocialPlugins={facebook:this._phonegapFacebookLogin},this._useCordovaSocialPlugins=t.useCordovaSocialPlugins,this._sendClientInfo=null==t.sendSDKClientInfo||t.sendSDKClientInfo,this._scope=t.scope||"openid",this._audience=t.audience||null,this._tenant=t.__tenant||this._domain.split(".")[0],void(this._token_issuer=t.__token_issuer||"https://"+this._domain+"/")):new l(t)}function u(t){return t?"token":"code"}function c(t){if("string"!=typeof t)return!1;for(var e=["code","id_token","token"],n=t.split(" "),i=0;i=1}function h(t){return"form_post"===t}function f(t){console&&console.warn&&console.warn(t)}var d="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},p=t("./lib/base64_url"),g=t("./lib/assert_required"),m=t("./lib/is-array"),v=t("./lib/index-of"),y=t("./lib/nonce-generator"),b=t("qs"),w=t("xtend"),_=t("trim"),x=t("reqwest"),S=t("winchan"),k=t("jsonp"),C={param:"cbx",timeout:8e3,prefix:"__auth0jp"},T=t("./lib/same-origin"),E=t("./lib/json-parse"),P=t("./lib/LoginError"),O=t("./lib/use_jsonp"),M=t("./lib/SilentAuthenticationHandler");l.version=t("./version").str,l.clientInfo={name:"auth0.js",version:l.version},l.prototype.openWindow=function(t,e,n){return window.open(t,e,r(n))},l.prototype._redirect=function(t){d.window.location=t},l.prototype._getResponseType=function(t){return this._parseResponseType(t)||this._responseType},l.prototype._getCallbackOnLocationHash=function(t){return"form_post"!==this._getResponseMode(t)&&"code"!==this._getResponseType(t)},l.prototype._getResponseMode=function(t){var e=this._parseResponseMode(t)||this._responseMode;return"form_post"===e?"form_post":null},l.prototype._getCallbackURL=function(t){return t&&"undefined"!=typeof t.callbackURL?t.callbackURL:this._callbackURL},l.prototype._getClientInfoString=function(){var t=JSON.stringify(l.clientInfo);return p.encode(t)},l.prototype._getClientInfoHeader=function(){return this._sendClientInfo?{"Auth0-Client":this._getClientInfoString()}:{}},l.prototype._renderAndSubmitWSFedForm=function(t,e){var n=document.createElement("div");n.innerHTML=e;var i=document.body.appendChild(n).children[0];t.popup&&!this._getCallbackOnLocationHash(t)&&(i.target="auth0_signup_popup"),i.submit()},l.prototype._getMode=function(t){var e={scope:this._scope,response_type:this._getResponseType(t)},n=this._getResponseMode(t);return n&&(e.response_mode=n),e},l.prototype._configureOfflineMode=function(t){t.scope&&t.scope.indexOf("offline_access")>=0&&(t.device=t.device||"Browser")},l.prototype._getUserInfo=function(t,e,n){if(f("DEPRECATION NOTICE: This method will be soon deprecated, use `getUserInfo` instead."),!t||t.user_id)return n(null,t);var i="https:",r=this._domain,o="/tokeninfo",s=a(i,r,o),l=function(t,e){var i=new Error(t+": "+(e||""));i.error=t,i.error_description=e,n(i)};return this._useJSONP?k(s+"?"+b.stringify({id_token:e}),C,function(t,e){return t?l(0,t.toString()):200===e.status?n(null,e.user):l(e.status,e.err||e.error)}):x({url:T(i,r)?o:s,method:"post",type:"json",crossOrigin:!T(i,r),data:{id_token:e}}).fail(function(t){l(t.status,t.responseText)}).then(function(t){n(null,t)})},l.prototype.getUserInfo=function(t,e){if("function"!=typeof e)throw new Error("A callback function is required");if(!t||"string"!=typeof t)return e(new Error("Invalid token"));var n="https:",i=this._domain,r="/userinfo",o=a(n,i,r),s=function(t,n){var i=new Error(t+": "+(n||""));i.error=t,i.error_description=n,e(i)};return x({url:T(n,i)?r:o,method:"post",type:"json",crossOrigin:!T(n,i),headers:{Authorization:"Bearer "+t}}).fail(function(t){s(t.status,t.responseText)}).then(function(t){e(null,t)})},l.prototype.getProfile=function(t,e){if("function"!=typeof e)throw new Error("A callback function is required");return t&&"string"==typeof t?void this._getUserInfo(this.decodeJwt(t),t,e):e(new Error("Invalid token"))},l.prototype.validateUser=function(t,e){var n="https:",i=this._domain,r="/public/api/users/validate_userpassword",o=a(n,i,r),s=w(t,{client_id:this._clientID,username:_(t.username||t.email||"")});return this._useJSONP?k(o+"?"+b.stringify(s),C,function(t,n){return t?e(t):"error"in n&&404!==n.status?e(new Error(n.error)):void e(null,200===n.status)}):void x({url:T(n,i)?r:o,method:"post",type:"text",data:s,crossOrigin:!T(n,i),error:function(t){return 404!==t.status?e(new Error(t.responseText)):void e(null,!1)},success:function(t){e(null,200===t.status)}})},l.prototype.decodeJwt=function(t){var e=t&&t.split(".")[1];return E(p.decode(e))},l.prototype.parseHash=function(t,e){e=e||{},t=t||window.location.hash,t=t.replace(/^#?\/?/,"");var n=b.parse(t);if(n.hasOwnProperty("error")){var i={error:n.error,error_description:n.error_description};return n.state&&(i.state=n.state),i}if(!n.hasOwnProperty("access_token")&&!n.hasOwnProperty("id_token")&&!n.hasOwnProperty("refresh_token"))return null;var r;if(n.id_token){var o=function(t){var e={error:"invalid_token",error_description:t};return e};r=this.decodeJwt(n.id_token);var s=m(r.aud)?r.aud:[r.aud];if(-1===v(s,this._clientID))return o("The clientID configured ("+this._clientID+") does not match with the clientID set in the token ("+s.join(", ")+").");if(r.iss&&r.iss!==this._token_issuer)return o("The domain configured ("+this._token_issuer+") does not match with the domain set in the token ("+r.iss+").");var a;if(e.nonce)a=e.nonce;else if(window.localStorage)try{a=window.localStorage.getItem("com.auth0.auth.nonce"),window.localStorage.removeItem("com.auth0.auth.nonce")}catch(l){}if((a||r.nonce)&&r.nonce!==a)return o("The nonce does not match.")}return{accessToken:n.access_token,idToken:n.id_token,idTokenPayload:r,refreshToken:n.refresh_token,state:n.state}},l.prototype.signup=function(t,e){function n(){return t.auto_login?r.login(t,e):"function"==typeof e?e():void 0}function i(t,n){var i=new P(t,n);if(u&&"function"==typeof u.kill&&u.kill(),"function"==typeof e)return e(i);throw i}var r=this,s={client_id:this._clientID,redirect_uri:this._getCallbackURL(t),email:_(t.email||t.username||"")};"string"==typeof t.username&&(s.username=_(t.username));var l=w(this._getMode(t),t,s);this._configureOfflineMode(l),o(t,"sso")||(t.sso=!0),o(t,"auto_login")||(t.auto_login=!0);var u,c=t.auto_login&&t.popup&&(!this._getCallbackOnLocationHash(t)||t.sso);c&&(u=this._buildPopupWindow(t));var h="https:",f=this._domain,d="/dbconnections/signup",p=a(h,f,d);return this._useJSONP?k(p+"?"+b.stringify(l),C,function(t,e){return t?i(0,t):200==e.status?n():i(e.status,e.err||e.error)}):void x({url:T(h,f)?d:p,method:"post",type:"html",data:l,success:n,crossOrigin:!T(h,f),error:function(t){i(t.status,t.responseText)}})},l.prototype.changePassword=function(t,e){function n(t,n){var i=new P(t,n);return e?e(i):void 0}var i={client_id:this._clientID,connection:t.connection,email:_(t.email||"")};"string"==typeof t.password&&(i.password=t.password);var r="https:",o=this._domain,s="/dbconnections/change_password",l=a(r,o,s);return this._useJSONP?k(l+"?"+b.stringify(i),C,function(t,i){return t?n(0,t):200==i.status?e(null,i.message):n(i.status,i.err||i.error)}):void x({url:T(r,o)?s:l,method:"post",type:"html",data:i,crossOrigin:!T(r,o),error:function(t){n(t.status,t.responseText)},success:function(t){e(null,t)}})},l.prototype._buildAuthorizeQueryString=function(t,e){var n=this._buildAuthorizationParameters(t,e);return b.stringify(n)},l.prototype._buildAuthorizationParameters=function(t,e){var n=w.apply(null,t);this._configureOfflineMode(n),this._sendClientInfo&&(n.auth0Client=this._getClientInfoString()),e=e||["popup","popupOptions"];var i,r;for(i=0;i-1&&!t.nonce&&"undefined"==typeof t.passcode&&(("undefined"!=typeof t.username||"undefined"!=typeof t.email)&&!e||"undefined"==typeof t.username&&"undefined"==typeof t.email)){if(!window.localStorage)throw new Error("Unable to generate and store nonce to request id_token. Please provide a nonce value via options");var n=y.randomString(16);if(n)try{t.nonce=n,window.localStorage.setItem("com.auth0.auth.nonce",n)}catch(i){t.nonce=void 0}}if("undefined"!=typeof t.passcode)return this.loginWithPasscode(t,e);if("undefined"!=typeof t.username||"undefined"!=typeof t.email)return this.loginWithUsernamePassword(t,e);if(window.cordova||window.electron)return this.loginPhonegap(t,e);if(t.popup&&this._getCallbackOnLocationHash(t))return this.loginWithPopup(t,e);if(!t.nonce&&this._responseType.indexOf("id_token")>-1)throw new Error("nonce is mandatory");this._authorize(t)},l.prototype._authorize=function(t){var e=this._buildAuthorizeUrl(t);t.popup?this._buildPopupWindow(t,e):this._redirect(e)},l.prototype._computePopupPosition=function(t){t=t||{};var e=t.width||500,n=t.height||600,i="undefined"!=typeof window.screenX?window.screenX:window.screenLeft,r="undefined"!=typeof window.screenY?window.screenY:window.screenTop,o="undefined"!=typeof window.outerWidth?window.outerWidth:document.body.clientWidth,s="undefined"!=typeof window.outerHeight?window.outerHeight:document.body.clientHeight-22,a=i+(o-e)/2,l=r+(s-n)/2;return{width:e,height:n,left:a,top:l}},l.prototype.loginPhonegap=function(t,e){function n(t){d||(d=!0,f.close(),e(new Error(t.message),null))}function i(t){if(!(d||t.url&&0!==t.url.indexOf(o+"#")&&0!==t.url.indexOf(o+"?"))){var n=s.parseHash(t.url.slice(o.length));if(!n)return d=!0,f.close(),void e(new Error("Error parsing hash"),null);if(n.idToken)return d=!0,f.close(),void e(null,n);d=!0,f.close(),e(new Error(n.err||n.error||"Something went wrong"),null)}}function r(){d||(f.removeEventListener("loaderror",n),f.removeEventListener("loadstart",i),f.removeEventListener("exit",r),e(new Error("Browser window closed"),null))}if(this._shouldAuthenticateWithCordovaPlugin(t.connection))return void this._socialPhonegapLogin(t,e);var o=a("https:",this._domain,"/mobile"),s=this,l=[this._getMode(t),t,{client_id:this._clientID,redirect_uri:o}];this._sendClientInfo&&l.push({auth0Client:this._getClientInfoString()});var u=this._buildAuthorizeQueryString(l),c=a("https:",this._domain,"/authorize?"+u),h=w({location:"yes"},t.popupOptions);delete h.width,delete h.height;var f=this.openWindow(c,"_blank",h),d=!1;f.addEventListener("loaderror",n),f.addEventListener("loadstart",i),f.addEventListener("exit",r)},l.prototype.loginWithPopup=function(t,e){var n=this;if(!e)throw new Error("popup mode should receive a mandatory callback");if(!t.nonce&&this._responseType.indexOf("id_token")>-1)throw new Error("nonce is mandatory");var i=[this._getMode(t),t,{client_id:this._clientID,owp:!0}];this._sendClientInfo&&i.push({auth0Client:this._getClientInfoString()});var o=this._buildAuthorizeQueryString(i),s=a("https:",this._domain,"/authorize?"+o),l=this._computePopupPosition(t.popupOptions),u=w(l,t.popupOptions),c=S.open({url:s,relay_url:"https://"+this._domain+"/relay.html",window_features:r(u)},function(t,i){return n._current_popup=null,t?e(new P(t),null,null,null,null,null):i?i.access_token||i.id_token?e(null,n._prepareResult(i)):i.err?e(new P(i.err.status,i.err.details||i.err),null,null,null,null,null):i.error?e(new P(i.status,i.details||i),null,null,null,null,null):e(new P("Something went wrong"),null,null,null,null,null):e(new P("Something went wrong"),null,null,null,null,null)});c.focus()},l.prototype._shouldAuthenticateWithCordovaPlugin=function(t){var e=this._cordovaSocialPlugins[t];return this._useCordovaSocialPlugins&&!!e},l.prototype._socialPhonegapLogin=function(t,e){var n=this._cordovaSocialPlugins[t.connection],i=this;n(t.connection_scope,function(n,r,o){if(n)return void e(n,null,null,null,null);var s=w({access_token:r},t,o);i.loginWithSocialAccessToken(s,e)})},l.prototype._phonegapFacebookLogin=function(t,e){if(!window.facebookConnectPlugin||!window.facebookConnectPlugin.login)return void e(new Error("missing plugin phonegap-facebook-plugin"),null,null);var n;n=t&&m(t)?t:t?[t]:["public_profile"],window.facebookConnectPlugin.login(n,function(t){e(null,t.authResponse.accessToken,{})},function(t){e(new Error(t),null,null)})},l.prototype.loginWithUsernamePasswordAndSSO=function(t,e){var n=this,i=this._computePopupPosition(t.popupOptions),o=w(i,t.popupOptions);if(!t.nonce&&this._responseType.indexOf("id_token")>-1)throw new Error("nonce is mandatory");var s={url:"https://"+this._domain+"/sso_dbconnection_popup/"+this._clientID,relay_url:"https://"+this._domain+"/relay.html",window_features:r(o),popup:this._current_popup,params:{domain:this._domain,clientID:this._clientID,options:{username:_(t.username||t.email||""),password:t.password,connection:t.connection,state:t.state,scope:t.scope}}};t._csrf&&(s.params.options._csrf=t._csrf),t.device&&(s.params.options.device=t.device);var a=S.open(s,function(t,i){return n._current_popup=null,t?e(new P(t),null,null,null,null,null):i?i.id_token?e(null,n._prepareResult(i)):i.err?e(new P(i.err.status,i.err.details||i.err),null,null,null,null,null):i.error?e(new P(i.status,i.details||i),null,null,null,null,null):e(new P("Something went wrong"),null,null,null,null,null):e(new P("Something went wrong"),null,null,null,null,null)});a.focus()},l.prototype.loginWithResourceOwner=function(t,e){var n=this,i=w(this._getMode(t),t,{client_id:this._clientID,username:_(t.username||t.email||""),grant_type:"password"});this._configureOfflineMode(i);var r="https:",o=this._domain,l="/oauth/ro",u=a(r,o,l);return this._sendClientInfo&&this._useJSONP&&(i.auth0Client=this._getClientInfoString()),this._useJSONP?k(u+"?"+b.stringify(i),C,function(t,i){if(t)return e(t);if("error"in i){var r=new P(i.status,i.error);return e(r)}e(null,n._prepareResult(i))}):void x({url:T(r,o)?l:u,method:"post",type:"json",data:i,headers:this._getClientInfoHeader(),crossOrigin:!T(r,o),success:function(t){e(null,n._prepareResult(t))},error:function(t){s(t,e)}})},l.prototype.loginWithSocialAccessToken=function(t,e){var n=this,i=this._buildAuthorizationParameters([{scope:this._scope},t,{client_id:this._clientID}]),r="https:",o=this._domain,l="/oauth/access_token",u=a(r,o,l);return this._useJSONP?k(u+"?"+b.stringify(i),C,function(t,i){if(t)return e(t);if("error"in i){var r=new P(i.status,i.error);return e(r)}e(null,n._prepareResult(i))}):void x({url:T(r,o)?l:u,method:"post",type:"json",data:i,headers:this._getClientInfoHeader(),crossOrigin:!T(r,o),success:function(t){e(null,n._prepareResult(t))},error:function(t){s(t,e)}})},l.prototype._buildPopupWindow=function(t,e){if(this._current_popup&&!this._current_popup.closed)return this._current_popup;e=e||"about:blank";var n=this,i={width:500,height:600},o=w(i,t.popupOptions||{}),s=r(o);if(this._current_popup=window.open(e,"auth0_signup_popup",s),!this._current_popup)throw new Error("Popup window cannot not been created. Disable popup blocker or make sure to call Auth0 login or singup on an UI event.");return this._current_popup.kill=function(){this.close(),n._current_popup=null},this._current_popup},l.prototype.loginWithUsernamePassword=function(t,e){function n(t){if(e)return e(t);throw t}if(e&&e.length>1&&(!t.sso||window.cordova))return this.loginWithResourceOwner(t,e);var i,r=this;if(t.popup&&!this._getCallbackOnLocationHash(t)&&(i=this._buildPopupWindow(t)),!t.nonce&&this._responseType.indexOf("id_token")>-1)throw new Error("nonce is mandatory");if(e&&e.length>1&&t.sso)return this.loginWithUsernamePasswordAndSSO(t,e);var o=w(this._getMode(t),t,{client_id:this._clientID,redirect_uri:this._getCallbackURL(t),username:_(t.username||t.email||""),tenant:this._tenant});this._configureOfflineMode(o);var l="https:",u=this._domain,c="/usernamepassword/login",h=a(l,u,c);return this._useJSONP?k(h+"?"+b.stringify(o),C,function(n,o){if(n)return i&&i.kill&&i.kill(),e(n);if("error"in o){i&&i.kill&&i.kill();var s=new P(o.status,o.error);return e(s)}r._renderAndSubmitWSFedForm(t,o.form)}):void x({url:T(l,u)?c:h,method:"post",type:"html",data:o,headers:this._getClientInfoHeader(),crossOrigin:!T(l,u),success:function(e){r._renderAndSubmitWSFedForm(t,e)},error:function(t){i&&i.kill&&i.kill(),s(t,n)}})},l.prototype.loginWithPasscode=function(t,e){if(null==t.email&&null==t.phoneNumber)throw new Error("email or phoneNumber is required for authentication");if(null==t.passcode)throw new Error("passcode is required for authentication");if(t.connection=null==t.email?"sms":"email",!this._shouldRedirect)return t=w(t,{username:null==t.email?t.phoneNumber:t.email,password:t.passcode,sso:!1}),delete t.email,delete t.phoneNumber,delete t.passcode,this.loginWithResourceOwner(t,e);var n={connection:t.connection};t.phoneNumber&&(t.phone_number=t.phoneNumber,delete t.phoneNumber,n.phone_number=t.phone_number),t.email&&(n.email=t.email),t.verification_code=t.passcode,delete t.passcode,n.verification_code=t.verification_code;var i=this;this._verify(n,function(n){return n?e(n):void i._verify_redirect(t)})},l.prototype._verify=function(t,e){var n="https:",i=this._domain,r="/passwordless/verify",o=a(n,i,r),s=t;return this._useJSONP?(this._sendClientInfo&&(s.auth0Client=this._getClientInfoString()),k(o+"?"+b.stringify(s),C,function(t,n){return t?e(new Error("0: "+t.toString())):200===n.status?e(null,!0):e({status:n.status})})):x({url:T(n,i)?r:o,method:"post",headers:this._getClientInfoHeader(),crossOrigin:!T(n,i),data:s}).fail(function(t){try{e(JSON.parse(t.responseText))}catch(n){var i=new Error(t.status+"("+t.statusText+"): "+t.responseText);i.statusCode=t.status,i.error=t.statusText,i.message=t.responseText,e(i)}}).then(function(t){e(null,t)})},l.prototype._verify_redirect=function(t){var e=[this._getMode(t),t,{client_id:this._clientID,redirect_uri:this._getCallbackURL(t)}],n=this._buildAuthorizeQueryString(e),i=a("https:",this._domain,"/passwordless/verify_redirect?"+n);this._redirect(i)},l.prototype.renewIdToken=function(t,e){this.getDelegationToken({id_token:t,scope:"passthrough",api:"auth0"},e)},l.prototype.refreshToken=function(t,e){this.getDelegationToken({refresh_token:t,scope:"passthrough",api:"auth0"},e)},l.prototype.getDelegationToken=function(t,e){if(t=t||{},!t.id_token&&!t.refresh_token)throw new Error("You must send either an id_token or a refresh_token to get a delegation token.");var n=w({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",client_id:this._clientID,target:t.targetClientId||this._clientID,api_type:t.api},t);delete n.hasOwnProperty,delete n.targetClientId,delete n.api;var r="https:",o=this._domain,s="/delegation",l=a(r,o,s);return this._useJSONP?k(l+"?"+b.stringify(n),C,function(t,n){if(t)return e(t);if("error"in n){var i=new P(n.status,n.error_description||n.error);return e(i)}e(null,n)}):void x({url:T(r,o)?s:l,method:"post",type:"json",data:n,crossOrigin:!T(r,o),success:function(t){e(null,t)},error:function(t){try{e(JSON.parse(t.responseText))}catch(n){var r=t,o=10===i()||11===i(),s=!r.status||0===r.status;s&&!window.navigator.onLine?(r={},r.status=0,r.responseText={code:"offline"}):s&&o?(r={},r.status=401,r.responseText={code:"invalid_operation"}):s?(r={},r.status=0,r.responseText={code:"connection_refused_timeout"}):r.responseText=t,e(new P(r.status,r.responseText))}}})},l.prototype.silentAuthentication=function(t,e){var n=t.usePostMessage||!1;delete t.usePostMessage,t=w(t,{prompt:"none"});var i=new M(this,this._buildAuthorizeUrl(t));i.login(e,n)},l.prototype.logout=function(t,e){var n="/logout";e=e||{},"v2"==e.version&&(n="/v2"+n);var i=a("https:",this._domain,n);t&&(i+="?"+b.stringify(t)),this._redirect(i)},l.prototype.getSSOData=function(t,e){"function"==typeof t&&(e=t,t=!1);var n={sso:!1};if(this._useJSONP){var i=new Error("The SSO data can't be obtained using JSONP");return void setTimeout(function(){e(i,n)},0)}var r="https:",o=this._domain,s="/user/ssodata",l=a(r,o,s),u=T(r,o),c={};return t&&(c={ldaps:1,client_id:this._clientID}),x({url:u?s:l,method:"get",type:"json",data:c,crossOrigin:!u,withCredentials:!u,timeout:3e3}).fail(function(t){var i=new Error("There was an error in the request that obtains the user's SSO data.");i.cause=t,e(i,n)}).then(function(t){e(null,t)})},l.prototype.getConnections=function(t){return f("getConnections is deprecated and will be removed shortly. Please use Management API endpoint /connections to list the connections"),k("https://"+this._domain+"/public/api/"+this._clientID+"/connections",C,t)},l.prototype.startPasswordless=function(t,e){if("object"!=typeof t)throw new Error("An options object is required");if("function"!=typeof e)throw new Error("A callback function is required");if(!t.email&&!t.phoneNumber)throw new Error("An `email` or a `phoneNumber` is required.");var n="https:",i=this._domain,r="/passwordless/start",o=a(n,i,r),s={client_id:this._clientID};return t.email?(s.email=t.email,s.connection="email",t.authParams&&(s.authParams=t.authParams),t.send&&"link"!==t.send||(s.authParams||(s.authParams={}),s.authParams.redirect_uri=t.callbackURL||this._callbackURL,s.authParams.response_type=this._getResponseType(t)),t.send&&(s.send=t.send)):(s.phone_number=t.phoneNumber,s.connection="sms"),this._useJSONP?(this._sendClientInfo&&(s.auth0Client=this._getClientInfoString()), -k(o+"?"+b.stringify(s),C,function(t,n){return t?e(new Error("0: "+t.toString())):200===n.status?e(null,!0):e(n.err||n.error)})):x({url:T(n,i)?r:o,method:"post",type:"json",headers:this._getClientInfoHeader(),crossOrigin:!T(n,i),data:s}).fail(function(t){try{e(JSON.parse(t.responseText))}catch(n){var i=new Error(t.status+"("+t.statusText+"): "+t.responseText);i.statusCode=t.status,i.error=t.statusText,i.message=t.responseText,e(i)}}).then(function(t){e(null,t)})},l.prototype.requestMagicLink=function(t,e){return this.startPasswordless(t,e)},l.prototype.requestEmailCode=function(t,e){return t.send="code",this.startPasswordless(t,e)},l.prototype.verifyEmailCode=function(t,e){return t.passcode=t.code,delete t.code,this.login(t,e)},l.prototype.requestSMSCode=function(t,e){return this.startPasswordless(t,e)},l.prototype.verifySMSCode=function(t,e){return t.passcode=t.code,delete t.code,this.login(t,e)},l.prototype.getUserCountry=function(t){var e="https:",n=this._domain,i="/user/geoloc/country",r=a(e,n,i);if(this._useJSONP){var o=new Error("The user's country can't be obtained using JSONP");return void setTimeout(function(){t(o)},0)}x({url:T(e,n)?i:r,method:"get",type:"json",headers:this._getClientInfoHeader(),crossOrigin:!T(e,n),success:function(e){t(null,e.country_code)},error:function(e){var n=new Error("There was an error in the request that obtains the user's country");n.cause=e,t(n)}})},l.prototype._prepareResult=function(t){if(t&&"object"==typeof t){var e=t.id_token?this.decodeJwt(t.id_token):void 0;return{accessToken:t.access_token,idToken:t.id_token,idTokenPayload:t.profile||e,refreshToken:t.refresh_token,state:t.state}}},l.prototype._parseResponseType=function(t,e){t||(t={}),e&&!this._providedResponseOptions&&t.hasOwnProperty("callbackOnLocationHash")&&(this._providedCallbackOnLocationHash=!0),e&&!this._providedCallbackOnLocationHash&&t.hasOwnProperty("responseType")&&(this._providedResponseOptions=!0),!this._providedCallbackOnLocationHash&&!this._providedResponseOptions&&t.hasOwnProperty("callbackOnLocationHash")&&t.hasOwnProperty("responseType")&&f("The responseType option will be ignored. Both callbackOnLocationHash and responseType options were provided and they can't be used together."),this._providedCallbackOnLocationHash&&t.hasOwnProperty("responseType")&&f("The responseType option will be ignored. The callbackOnLocationHash option was provided to the constructor and they can't be mixed."),this._providedResponseOptions&&t.hasOwnProperty("callbackOnLocationHash")&&f("The callbackOnLocationHash option will be ignored. The responseType option was provided to the constructor and they can't be mixed."),this._providedCallbackOnLocationHash||t.hasOwnProperty("callbackOnLocationHash")||!t.responseType||c(t.responseType)||f('The responseType option will be ignored. Its valid values are "code", "id_token", "token" or any combination of them.');var n=void 0;return this._providedResponseOptions||null==t.callbackOnLocationHash||(n=u(t.callbackOnLocationHash)),!this._providedCallbackOnLocationHash&&!t.hasOwnProperty("callbackOnLocationHash")&&t.responseType&&c(t.responseType)&&(n=t.responseType),n},l.prototype._parseResponseMode=function(t,e){t||(t={}),e&&!this._providedCallbackOnLocationHash&&t.hasOwnProperty("responseMode")&&(this._providedResponseOptions=!0),this._providedCallbackOnLocationHash&&t.hasOwnProperty("responseMode")&&f("The responseMode option will be ignored. The callbackOnLocationHash option was provided to the constructor and they can't be mixed."),!this._providedCallbackOnLocationHash&&!this._providedResponseOptions&&t.hasOwnProperty("callbackOnLocationHash")&&t.hasOwnProperty("responseMode")&&f("The responseMode option will be ignored. Both callbackOnLocationHash and responseMode options were provided and they can't be used together.");var n=void 0;return this._providedCallbackOnLocationHash||!t.responseMode||h(t.responseMode)||f('The responseMode option will be ignored. Its only valid value is "form_post".'),!this._providedCallbackOnLocationHash&&h(t.responseMode)&&(n=t.responseMode),n},e.exports=l},{"./lib/LoginError":3,"./lib/SilentAuthenticationHandler":4,"./lib/assert_required":5,"./lib/base64_url":6,"./lib/index-of":7,"./lib/is-array":8,"./lib/json-parse":9,"./lib/nonce-generator":10,"./lib/same-origin":11,"./lib/use_jsonp":12,"./version":36,jsonp:17,qs:22,reqwest:26,trim:27,winchan:28,xtend:30}],2:[function(t,e,n){var i=function(t){this.auth0=t.auth0,this.url=t.url,this.callback=t.callback,this.timeout=t.timeout||6e4,this.timeoutCallback=t.timeoutCallback||null,this.usePostMessage=t.usePostMessage||!1,this.iframe=null,this.timeoutHandle=null,this._destroyTimeout=null,this.transientMessageEventListener=null,this.transientEventListener=null};i.prototype.init=function(t){this.iframe=document.createElement("iframe"),this.iframe.style.display="none",this.iframe.src=this.url;var e=this;this.usePostMessage?(this.transientMessageEventListener=function(t){e.messageEventListener(t)},window.addEventListener("message",this.transientMessageEventListener,!1)):(this.transientEventListener=function(){e.loadEventListener()},this.iframe.addEventListener("load",this.transientEventListener,!1)),document.body.appendChild(this.iframe),this.timeoutHandle=setTimeout(function(){e.timeoutHandler()},this.timeout)},i.prototype.messageEventListener=function(t){this.callbackHandler(t.data),this.destroy()},i.prototype.loadEventListener=function(){var t=this.auth0.parseHash(this.iframe.contentWindow.location.hash);t&&(this.callbackHandler(t),this.destroy())},i.prototype.callbackHandler=function(t){var e=null;t.error&&(e=t,t=null),this.callback(e,t)},i.prototype.timeoutHandler=function(){this.timeoutCallback&&this.timeoutCallback(),this.destroy()},i.prototype.destroy=function(){var t=this;this.timeoutHandle&&clearTimeout(this.timeoutHandle),this._destroyTimeout=setTimeout(function(){t.usePostMessage?window.removeEventListener("message",t.transientMessageEventListener,!1):t.iframe.removeEventListener("load",t.transientEventListener,!1),document.body.removeChild(t.iframe)},0)},e.exports=i},{}],3:[function(t,e,n){function i(t,e){var n;if("string"==typeof e)try{n=r(e)}catch(i){n={message:e}}else n=e||{description:"server error"};n.code||(n.code=n.error),"unauthorized"===n.code&&(t=401);var o=n.description||n.message||n.error;"PasswordStrengthError"===n.name&&(o="Password is not strong enough.");var s=Error.call(this,o);return s.status=t,s.name=n.code,s.code=n.code,s.details=n,0===t&&(s.code&&"offline"===s.code||(s.code="Unknown",s.message="Unknown error.")),s}var r=t("./json-parse");e.exports=i,Object&&Object.create&&(i.prototype=Object.create(Error.prototype,{constructor:{value:i}}))},{"./json-parse":9}],4:[function(t,e,n){var i=t("./IframeHandler"),r=function(t,e,n){this.auth0=t,this.authenticationUrl=e,this.timeout=n||6e4,this.handler=null};r.prototype.timeoutCallback=function(){console.error("Timeout during silent authentication.")},r.prototype.login=function(t,e){this.handler=new i({auth0:this.auth0,url:this.authenticationUrl,callback:t,timeout:this.timeout,timeoutCallback:this.timeoutCallback,usePostMessage:e||!1}),this.handler.init()},e.exports=r},{"./IframeHandler":2}],5:[function(t,e,n){function i(t,e){if(!t[e])throw new Error(e+" is required.")}e.exports=i},{}],6:[function(t,e,n){function i(t){return o.btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function r(t){return t+=Array(5-t.length%4).join("="),t=t.replace(/\-/g,"+").replace(/\_/g,"/"),o.atob(t)}var o=t("Base64");e.exports={encode:i,decode:r}},{Base64:13}],7:[function(t,e,n){function i(t,e,n){return t.indexOf(e,n)}function r(t,e,n){var i;if(null==t)throw new TypeError('"array" is null or not defined');var r=Object(t),o=r.length>>>0;if(0===o)return-1;var s=+n||0;if(Math.abs(s)===1/0&&(s=0),s>=o)return-1;for(i=Math.max(s>=0?s:o-Math.abs(s),0);o>i;){if(i in r&&r[i]===e)return i;i++}return-1}e.exports=Array.prototype.indexOf?i:r},{}],8:[function(t,e,n){function i(t){return"[object Array]"===r.call(t)}var r=Object.prototype.toString;e.exports=null!=Array.isArray?Array.isArray:i},{}],9:[function(t,e,n){e.exports="undefined"==typeof JSON?t("json-fallback").parse:JSON.parse},{"json-fallback":16}],10:[function(t,e,n){function i(t){var e=new Uint8Array(t),n=window.crypto||window.msCrypto;if(!n)return null;var i=n.getRandomValues(e),r=[],o="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~";return i.forEach(function(t){r.push(o[t%o.length])}),r.join("")}e.exports={randomString:i}},{}],11:[function(t,e,n){function i(t,e,n){var i=window.location.protocol,r=window.location.hostname,o=window.location.port;return n=n||"",i===t&&r===e&&o===n}e.exports=i},{}],12:[function(t,e,n){function i(){var t=window.XMLHttpRequest?new XMLHttpRequest:null;return!(t&&"withCredentials"in t)}e.exports=i},{}],13:[function(t,e,n){!function(){var t="undefined"!=typeof n?n:this,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=function(){try{document.createElement("$")}catch(t){return t}}();t.btoa||(t.btoa=function(t){for(var n,r,o=0,s=e,a="";t.charAt(0|o)||(s="=",o%1);a+=s.charAt(63&n>>8-o%1*8)){if(r=t.charCodeAt(o+=.75),r>255)throw i;n=n<<8|r}return a}),t.atob||(t.atob=function(t){if(t=t.replace(/=+$/,""),t.length%4==1)throw i;for(var n,r,o=0,s=0,a="";r=t.charAt(s++);~r&&(n=o%4?64*n+r:r,o++%4)?a+=String.fromCharCode(255&n>>(-2*o&6)):0)r=e.indexOf(r);return a})}()},{}],14:[function(t,e,n){},{}],15:[function(t,e,n){var i=e.exports={};i.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var i=n.shift();i()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")}},{}],16:[function(require,module,exports){var JSON={};!function(){"use strict";function f(t){return 10>t?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var n,i,r,o,s,a=gap,l=e[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof rep&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,s=[],"[object Array]"===Object.prototype.toString.apply(l)){for(o=l.length,n=0;o>n;n+=1)s[n]=str(n,l)||"null";return r=0===s.length?"[]":gap?"[\n"+gap+s.join(",\n"+gap)+"\n"+a+"]":"["+s.join(",")+"]",gap=a,r}if(rep&&"object"==typeof rep)for(o=rep.length,n=0;o>n;n+=1)"string"==typeof rep[n]&&(i=rep[n],r=str(i,l),r&&s.push(quote(i)+(gap?": ":":")+r));else for(i in l)Object.prototype.hasOwnProperty.call(l,i)&&(r=str(i,l),r&&s.push(quote(i)+(gap?": ":":")+r));return r=0===s.length?"{}":gap?"{\n"+gap+s.join(",\n"+gap)+"\n"+a+"}":"{"+s.join(",")+"}",gap=a,r}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(t){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(t){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":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,e,n){var i;if(gap="",indent="","number"==typeof n)for(i=0;n>i;i+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var n,i,r=t[e];if(r&&"object"==typeof r)for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i=walk(r,n),void 0!==i?r[n]=i:delete r[n]);return reviver.call(t,e,r)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(t){return"\\u"+("0000"+t.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")})}(),module.exports=JSON},{}],17:[function(t,e,n){function i(){}function r(t,e,n){function r(){a.parentNode.removeChild(a),window[p]=i}"function"==typeof e&&(n=e,e={}),e||(e={});var a,l,u=e.prefix||"__jp",c=e.param||"callback",h=null!=e.timeout?e.timeout:6e4,f=encodeURIComponent,d=document.getElementsByTagName("script")[0]||document.head,p=u+s++;h&&(l=setTimeout(function(){r(),n&&n(new Error("Timeout"))},h)),window[p]=function(t){o("jsonp got",t),l&&clearTimeout(l),r(),n&&n(null,t)},t+=(~t.indexOf("?")?"&":"?")+c+"="+f(p),t=t.replace("?&","?"),o('jsonp req "%s"',t),a=document.createElement("script"),a.src=t,d.parentNode.insertBefore(a,d)}var o=t("debug")("jsonp");e.exports=r;var s=0},{debug:19}],18:[function(t,e,n){function i(t){if(t=String(t),!(t.length>1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return n*h;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*u;case"minutes":case"minute":case"mins":case"min":case"m":return n*l;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){return t>=c?Math.round(t/c)+"d":t>=u?Math.round(t/u)+"h":t>=l?Math.round(t/l)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function o(t){return s(t,c,"day")||s(t,u,"hour")||s(t,l,"minute")||s(t,a,"second")||t+" ms"}function s(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var a=1e3,l=60*a,u=60*l,c=24*u,h=365.25*c;e.exports=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return i(t);if("number"===n&&isNaN(t)===!1)return e["long"]?o(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],19:[function(t,e,n){function i(){return!("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function r(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),e){var i="color: "+this.color;t.splice(1,0,i,"color: inherit");var r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(r++,"%c"===t&&(o=r))}),t.splice(o,0,i)}}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(t){try{null==t?n.storage.removeItem("debug"):n.storage.debug=t}catch(e){}}function a(){try{return n.storage.debug}catch(t){}return"undefined"!=typeof u&&"env"in u?u.env.DEBUG:void 0}function l(){try{return window.localStorage}catch(t){}}var u=t("__browserify_process");n=e.exports=t("./debug"),n.log=o,n.formatArgs=r,n.save=s,n.load=a,n.useColors=i,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:l(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},n.enable(a())},{"./debug":20,__browserify_process:15}],20:[function(t,e,n){function i(t){var e,i=0;for(e in t)i=(i<<5)-i+t.charCodeAt(e),i|=0;return n.colors[Math.abs(i)%n.colors.length]}function r(t){function e(){if(e.enabled){var t=e,i=+new Date,r=i-(u||i);t.diff=r,t.prev=u,t.curr=i,u=i;for(var o=new Array(arguments.length),s=0;sr;r++)e[r]&&(t=e[r].replace(/\*/g,".*?"),"-"===t[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")))}function s(){n.enable("")}function a(t){var e,i;for(e=0,i=n.skips.length;i>e;e++)if(n.skips[e].test(t))return!1;for(e=0,i=n.names.length;i>e;e++)if(n.names[e].test(t))return!0;return!1}function l(t){return t instanceof Error?t.stack||t.message:t}n=e.exports=r.debug=r["default"]=r,n.coerce=l,n.disable=s,n.enable=o,n.enabled=a,n.humanize=t("ms"),n.names=[],n.skips=[],n.formatters={};var u},{ms:18}],21:[function(t,e,n){"use strict";var i=String.prototype.replace,r=/%20/g;e.exports={"default":"RFC3986",formatters:{RFC1738:function(t){return i.call(t,r,"+")},RFC3986:function(t){return t}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},{}],22:[function(t,e,n){"use strict";var i=t("./stringify"),r=t("./parse"),o=t("./formats");e.exports={formats:o,parse:r,stringify:i}},{"./formats":21,"./parse":23,"./stringify":24}],23:[function(t,e,n){"use strict";var i=t("./utils"),r=Object.prototype.hasOwnProperty,o={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:i.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},s=function(t,e){for(var n={},i=t.split(e.delimiter,e.parameterLimit===1/0?void 0:e.parameterLimit),o=0;o=0&&n.parseArrays&&s<=n.arrayLimit?(i=[],i[s]=u(t,e,n)):i[o]=u(t,e,n)}return i},l=function(t,e,n){if(t){var i=n.allowDots?t.replace(/\.([^\.\[]+)/g,"[$1]"):t,o=/^([^\[\]]*)/,s=/(\[[^\[\]]*\])/g,l=o.exec(i),u=[];if(l[1]){if(!n.plainObjects&&r.call(Object.prototype,l[1])&&!n.allowPrototypes)return;u.push(l[1])}for(var c=0;null!==(l=s.exec(i))&&ce;++e)t.push("%"+((16>e?"0":"")+e.toString(16)).toUpperCase());return t}();n.arrayToObject=function(t,e){for(var n=e&&e.plainObjects?Object.create(null):{},i=0;i=48&&57>=o||o>=65&&90>=o||o>=97&&122>=o?n+=e.charAt(i):128>o?n+=r[o]:2048>o?n+=r[192|o>>6]+r[128|63&o]:55296>o||o>=57344?n+=r[224|o>>12]+r[128|o>>6&63]+r[128|63&o]:(i+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(i)),n+=r[240|o>>18]+r[128|o>>12&63]+r[128|o>>6&63]+r[128|63&o])}return n},n.compact=function(t,e){if("object"!=typeof t||null===t)return t;var i=e||[],r=i.indexOf(t);if(-1!==r)return i[r];if(i.push(t),Array.isArray(t)){for(var o=[],s=0;s0;)self._completeHandlers.shift()(t)}function success(resp){var type=o.type||resp&&setType(resp.getResponseHeader("Content-Type"));resp="jsonp"!==type?self.request:resp;var filteredResponse=globalSetupOptions.dataFilter(resp.responseText,type),r=filteredResponse;try{resp.responseText=r}catch(e){}if(r)switch(type){case"json":try{resp=context.JSON?context.JSON.parse(r):eval("("+r+")")}catch(err){return error(resp,"Could not parse JSON in response",err)}break;case"js":resp=eval(r);break;case"html":resp=r;break;case"xml":resp=resp.responseXML&&resp.responseXML.parseError&&resp.responseXML.parseError.errorCode&&resp.responseXML.parseError.reason?null:resp.responseXML}for(self._responseArgs.resp=resp,self._fulfilled=!0,fn(resp),self._successHandler(resp);self._fulfillmentHandlers.length>0;)resp=self._fulfillmentHandlers.shift()(resp);complete(resp)}function timedOut(){self._timedOut=!0,self.request.abort()}function error(t,e,n){for(t=self.request,self._responseArgs.resp=t,self._responseArgs.msg=e,self._responseArgs.t=n,self._erred=!0;self._errorHandlers.length>0;)self._errorHandlers.shift()(t,e,n);complete(t)}this.url="string"==typeof o?o:o.url,this.timeout=null,this._fulfilled=!1,this._successHandler=function(){},this._fulfillmentHandlers=[],this._errorHandlers=[],this._completeHandlers=[],this._erred=!1,this._responseArgs={};var self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){timedOut()},o.timeout)),o.success&&(this._successHandler=function(){o.success.apply(o,arguments)}),o.error&&this._errorHandlers.push(function(){o.error.apply(o,arguments)}),o.complete&&this._completeHandlers.push(function(){o.complete.apply(o,arguments)}),this.request=getRequest.call(this,success,error)}function reqwest(t,e){return new Reqwest(t,e)}function normalize(t){return t?t.replace(/\r?\n/g,"\r\n"):""}function serial(t,e){var n,i,r,o,s=t.name,a=t.tagName.toLowerCase(),l=function(t){t&&!t.disabled&&e(s,normalize(t.attributes.value&&t.attributes.value.specified?t.value:t.text))};if(!t.disabled&&s)switch(a){case"input":/reset|button|image|file/i.test(t.type)||(n=/checkbox/i.test(t.type),i=/radio/i.test(t.type),r=t.value,(!(n||i)||t.checked)&&e(s,normalize(n&&""===r?"on":r)));break;case"textarea":e(s,normalize(t.value));break;case"select":if("select-one"===t.type.toLowerCase())l(t.selectedIndex>=0?t.options[t.selectedIndex]:null);else for(o=0;t.length&&o-1){var n=new RegExp("rv:([0-9]{2,2}[.0-9]{0,})");null!==n.exec(e)&&(t=parseFloat(RegExp.$1))}return t>=8}function i(){try{var t=navigator.userAgent;return-1!=t.indexOf("Fennec/")||-1!=t.indexOf("Firefox/")&&-1!=t.indexOf("Android")}catch(e){}return!1}function r(){return"undefined"!=typeof window&&window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage}function o(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}function s(){for(var t=(window.location,window.opener.frames),e=t.length-1;e>=0;e--)try{if(t[e].location.protocol===window.location.protocol&&t[e].location.host===window.location.host&&t[e].name===a)return t[e]}catch(n){}}var a="__winchan_relay_frame",l="die",u=n();return r()?{open:function(n,r){function s(){if(f&&document.body.removeChild(f),f=void 0,m&&(m=clearInterval(m)),e(window,"message",c),e(window,"unload",s),g)try{g.close()}catch(t){p.postMessage(l,d)}g=p=void 0}function c(t){if(t.origin===d)try{var e=JSON.parse(t.data);"ready"===e.a?p.postMessage(v,d):"error"===e.a?(s(),r&&(r(e.d),r=null)):"response"===e.a&&(s(),r&&(r(null,e.d),r=null))}catch(n){}}if(!r)throw"missing required callback argument";var h;n.url||(h="missing required 'url' parameter"),n.relay_url||(h="missing required 'relay_url' parameter"),h&&setTimeout(function(){r(h)},0),n.window_name||(n.window_name=null),(!n.window_features||i())&&(n.window_features=void 0);var f,d=o(n.url);if(d!==o(n.relay_url))return setTimeout(function(){r("invalid arguments: origin of url and relay_url must match")},0);var p;u&&(f=document.createElement("iframe"),f.setAttribute("src",n.relay_url),f.style.display="none",f.setAttribute("name",a),document.body.appendChild(f),p=f.contentWindow);var g=n.popup||window.open(n.url,n.window_name,n.window_features);n.popup&&(g.location.href=n.url),p||(p=g);var m=setInterval(function(){g&&g.closed&&(s(),r&&(r("User closed the popup window"),r=null))},500),v=JSON.stringify({a:"request",d:n.params});return t(window,"unload",s),t(window,"message",c),{close:s,focus:function(){if(g)try{g.focus()}catch(t){}}}},onOpen:function(n){function i(t){t=JSON.stringify(t),u?c.doPost(t,a):c.postMessage(t,a)}function r(t){var o;try{o=JSON.parse(t.data)}catch(s){}o&&"request"===o.a&&(e(window,"message",r),a=t.origin,n&&setTimeout(function(){n(a,o.d,function(t){n=void 0,i({a:"response",d:t})})},0))}function o(t){if(t.data===l)try{window.close()}catch(e){}}var a="*",c=u?s():window.opener;if(!c)throw"can't find relay frame";t(u?c:window,"message",r),t(u?c:window,"message",o);try{i({a:"ready"})}catch(h){t(c,"load",function(t){i({a:"ready"})})}var f=function(){try{e(u?c:window,"message",o)}catch(t){}n&&i({a:"error",d:"client closed window"}),n=void 0;try{window.close()}catch(r){}};return t(window,"unload",f),{detach:function(){e(window,"unload",f)}}}}:{open:function(t,e,n,i){setTimeout(function(){i("unsupported browser")},0)},onOpen:function(t){setTimeout(function(){t("unsupported browser")},0)}}}();"undefined"!=typeof e&&e.exports&&(e.exports=i)},{}],29:[function(t,e,n){function i(t){return null!==t&&("object"==typeof t||"function"==typeof t)}e.exports=i},{}],30:[function(t,e,n){function i(){for(var t={},e=0;e2?arguments[2]:null;if(a===+a)for(n=0;a>n;n++)null===l?e(s?t.charAt(n):t[n],n,t):e.call(l,s?t.charAt(n):t[n],n,t);else for(r in t)i.call(t,r)&&(null===l?e(t[r],r,t):e.call(l,t[r],r,t))}},{}],32:[function(t,e,n){e.exports=Object.keys||t("./shim")},{"./shim":34}],33:[function(t,e,n){var i=Object.prototype.toString;e.exports=function r(t){var e=i.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===i.call(t.callee)),r}},{}],34:[function(t,e,n){!function(){"use strict";var n,i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=t("./foreach"),s=t("./isArguments"),a=!{toString:null}.propertyIsEnumerable("toString"),l=function(){}.propertyIsEnumerable("prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];n=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===r.call(t),c=s(t),h=[];if(!e&&!n&&!c)throw new TypeError("Object.keys called on a non-object");if(c)o(t,function(t){h.push(t)});else{var f,d=l&&n;for(f in t)d&&"prototype"===f||!i.call(t,f)||h.push(f)}if(a){var p=t.constructor,g=p&&p.prototype===t;o(u,function(e){g&&"constructor"===e||!i.call(t,e)||h.push(e)})}return h},e.exports=n}()},{"./foreach":31,"./isArguments":33}],35:[function(t,e,n){var i="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r=t("./index");"function"==typeof i.window.define&&i.window.define.amd?i.window.define("auth0",function(){return r}):i.window&&(i.window.Auth0=r)},{"./index":1}],36:[function(t,e,n){e.exports={str:"7.6.1"}},{}]},{},[35]); \ No newline at end of file +var e=this.$element.height(),i=this.options.offset,r=i.top,o=i.bottom,s=Math.max(t(document).height(),t(document.body).height());"object"!=typeof i&&(o=r=i),"function"==typeof r&&(r=i.top(this.$element)),"function"==typeof o&&(o=i.bottom(this.$element));var a=this.getState(s,e,r,o);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var l="affix"+(a?"-"+a:""),u=t.Event(l+".bs.affix");if(this.$element.trigger(u),u.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(n.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:s-e-o})}};var i=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=n,t.fn.affix.noConflict=function(){return t.fn.affix=i,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var n=t(this),i=n.data();i.offset=i.offset||{},null!=i.offsetBottom&&(i.offset.bottom=i.offsetBottom),null!=i.offsetTop&&(i.offset.top=i.offsetTop),e.call(n,i)})})}(jQuery),!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,n){return void 0===n&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(n),n}:t(jQuery)}(function(t){var e=function(){if(t&&t.fn&&t.fn.select2&&t.fn.select2.amd)var e=t.fn.select2.amd;var e;return function(){if(!e||!e.requirejs){e?n=e:e={};var t,n,i;!function(e){function r(t,e){return _.call(t,e)}function o(t,e){var n,i,r,o,s,a,l,u,c,h,f,d,p=e&&e.split("/"),g=b.map,m=g&&g["*"]||{};if(t){for(t=t.split("/"),s=t.length-1,b.nodeIdCompat&&k.test(t[s])&&(t[s]=t[s].replace(k,"")),"."===t[0].charAt(0)&&p&&(d=p.slice(0,p.length-1),t=d.concat(t)),c=0;c0&&(t.splice(c-1,2),c-=2)}t=t.join("/")}if((p||m)&&g){for(n=t.split("/"),c=n.length;c>0;c-=1){if(i=n.slice(0,c).join("/"),p)for(h=p.length;h>0;h-=1)if((r=g[p.slice(0,h).join("/")])&&(r=r[i])){o=r,a=c;break}if(o)break;!l&&m&&m[i]&&(l=m[i],u=c)}!o&&l&&(o=l,a=u),o&&(n.splice(0,a,o),t=n.join("/"))}return t}function s(t,n){return function(){var i=x.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),p.apply(e,i.concat([t,n]))}}function a(t){return function(e){return o(e,t)}}function l(t){return function(e){v[t]=e}}function u(t){if(r(y,t)){var n=y[t];delete y[t],w[t]=!0,d.apply(e,n)}if(!r(v,t)&&!r(w,t))throw new Error("No "+t);return v[t]}function c(t){var e,n=t?t.indexOf("!"):-1;return n>-1&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),[e,t]}function h(t){return t?c(t):[]}function f(t){return function(){return b&&b.config&&b.config[t]||{}}}var d,p,g,m,v={},y={},b={},w={},_=Object.prototype.hasOwnProperty,x=[].slice,k=/\.js$/;g=function(t,e){var n,i=c(t),r=i[0],s=e[1];return t=i[1],r&&(r=o(r,s),n=u(r)),r?t=n&&n.normalize?n.normalize(t,a(s)):o(t,s):(t=o(t,s),i=c(t),r=i[0],t=i[1],r&&(n=u(r))),{f:r?r+"!"+t:t,n:t,pr:r,p:n}},m={require:function(t){return s(t)},exports:function(t){var e=v[t];return void 0!==e?e:v[t]={}},module:function(t){return{id:t,uri:"",exports:v[t],config:f(t)}}},d=function(t,n,i,o){var a,c,f,d,p,b,_,x=[],k=typeof i;if(o=o||t,b=h(o),"undefined"===k||"function"===k){for(n=!n.length&&i.length?["require","exports","module"]:n,p=0;p0&&(e.call(arguments,t.prototype.constructor),r=n.prototype.constructor),r.apply(this,arguments)}function r(){this.constructor=i}var o=e(n),s=e(t);n.displayName=t.displayName,i.prototype=new r;for(var a=0;a":">",'"':""","'":"'","/":"/"};return"string"!=typeof t?t:String(t).replace(/[&<>"'\/\\]/g,function(t){return e[t]})},n.appendMany=function(e,n){if("1.7"===t.fn.jquery.substr(0,3)){var i=t();t.map(n,function(t){i=i.add(t)}),n=i}e.append(n)},n}),e.define("select2/results",["jquery","./utils"],function(t,e){function n(t,e,i){this.$element=t,this.data=i,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('
              ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e,e},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(e){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=t('
            • '),r=this.options.get("translations").get(e.message);i.append(n(r(e.args))),i[0].className+=" select2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(t){this.hideLoading();var e=[];if(null==t.results||0===t.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));t.results=this.sort(t.results);for(var n=0;n0?e.first().trigger("mouseenter"):t.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var e=this;this.data.current(function(n){var i=t.map(n,function(t){return t.id.toString()});e.$results.find(".select2-results__option[aria-selected]").each(function(){var e=t(this),n=t.data(this,"data"),r=""+n.id;null!=n.element&&n.element.selected||null==n.element&&t.inArray(r,i)>-1?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},n.prototype.showLoading=function(t){this.hideLoading();var e=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:e(t)},i=this.option(n);i.className+=" loading-results",this.$results.prepend(i)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(e){var n=document.createElement("li");n.className="select2-results__option";var i={role:"treeitem","aria-selected":"false"};e.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==e.id&&delete i["aria-selected"],null!=e._resultId&&(n.id=e._resultId),e.title&&(n.title=e.title),e.children&&(i.role="group",i["aria-label"]=e.text,delete i["aria-selected"]);for(var r in i){var o=i[r];n.setAttribute(r,o)}if(e.children){var s=t(n),a=document.createElement("strong");a.className="select2-results__group",t(a),this.template(e,a);for(var l=[],u=0;u",{"class":"select2-results__options select2-results__options--nested"});f.append(l),s.append(a),s.append(f)}else this.template(e,n);return t.data(n,"data",e),n},n.prototype.bind=function(e,n){var i=this,r=e.id+"-results";this.$results.attr("id",r),e.on("results:all",function(t){i.clear(),i.append(t.data),e.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),e.on("results:append",function(t){i.append(t.data),e.isOpen()&&i.setClasses()}),e.on("query",function(t){i.hideMessages(),i.showLoading(t)}),e.on("select",function(){e.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),e.on("unselect",function(){e.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),e.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),e.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),e.on("results:toggle",function(){var t=i.getHighlightedResults();0!==t.length&&t.trigger("mouseup")}),e.on("results:select",function(){var t=i.getHighlightedResults();if(0!==t.length){var e=t.data("data");"true"==t.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:e})}}),e.on("results:previous",function(){var t=i.getHighlightedResults(),e=i.$results.find("[aria-selected]"),n=e.index(t);if(0!==n){var r=n-1;0===t.length&&(r=0);var o=e.eq(r);o.trigger("mouseenter");var s=i.$results.offset().top,a=o.offset().top,l=i.$results.scrollTop()+(a-s);0===r?i.$results.scrollTop(0):a-s<0&&i.$results.scrollTop(l)}}),e.on("results:next",function(){var t=i.getHighlightedResults(),e=i.$results.find("[aria-selected]"),n=e.index(t),r=n+1;if(!(r>=e.length)){var o=e.eq(r);o.trigger("mouseenter");var s=i.$results.offset().top+i.$results.outerHeight(!1),a=o.offset().top+o.outerHeight(!1),l=i.$results.scrollTop()+a-s;0===r?i.$results.scrollTop(0):a>s&&i.$results.scrollTop(l)}}),e.on("results:focus",function(t){t.element.addClass("select2-results__option--highlighted")}),e.on("results:message",function(t){i.displayMessage(t)}),t.fn.mousewheel&&this.$results.on("mousewheel",function(t){var e=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-e+t.deltaY,r=t.deltaY>0&&e-t.deltaY<=0,o=t.deltaY<0&&n<=i.$results.height();r?(i.$results.scrollTop(0),t.preventDefault(),t.stopPropagation()):o&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),t.preventDefault(),t.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var n=t(this),r=n.data("data");return"true"===n.attr("aria-selected")?void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:e,data:r}):i.trigger("close",{})):void i.trigger("select",{originalEvent:e,data:r})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var n=t(this).data("data");i.getHighlightedResults().removeClass("select2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:t(this)})})},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var t=this.getHighlightedResults();if(0!==t.length){var e=this.$results.find("[aria-selected]"),n=e.index(t),i=this.$results.offset().top,r=t.offset().top,o=this.$results.scrollTop()+(r-i),s=r-i;o-=2*t.outerHeight(!1),n<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(o)}},n.prototype.template=function(e,n){var i=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),o=i(e,n);null==o?n.style.display="none":"string"==typeof o?n.innerHTML=r(o):t(n).append(o)},n}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(t,e,n){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=t('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),this.$selection=e,e},i.prototype.bind=function(t,e){var i=this,r=(t.id,t.id+"-results");this.container=t,this.$selection.on("focus",function(t){i.trigger("focus",t)}),this.$selection.on("blur",function(t){i._handleBlur(t)}),this.$selection.on("keydown",function(t){i.trigger("keypress",t),t.which===n.SPACE&&t.preventDefault()}),t.on("results:focus",function(t){i.$selection.attr("aria-activedescendant",t.data._resultId)}),t.on("selection:update",function(t){i.update(t.data)}),t.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",r),i._attachCloseHandler(t)}),t.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(t)}),t.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),t.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(e){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||t.contains(n.$selection[0],document.activeElement)||n.trigger("blur",e)},1)},i.prototype._attachCloseHandler=function(e){t(document.body).on("mousedown.select2."+e.id,function(e){var n=t(e.target),i=n.closest(".select2");t(".select2.select2-container--open").each(function(){var e=t(this);this!=i[0]&&e.data("element").select2("close")})})},i.prototype._detachCloseHandler=function(e){t(document.body).off("mousedown.select2."+e.id)},i.prototype.position=function(t,e){e.find(".selection").append(t)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(t){throw new Error("The `update` method must be defined in child classes.")},i}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(t,e,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,e),r.prototype.render=function(){var t=r.__super__.render.call(this);return t.addClass("select2-selection--single"),t.html(''),t},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(t){1===t.which&&n.trigger("toggle",{originalEvent:t})}),this.$selection.on("focus",function(t){}),this.$selection.on("blur",function(t){}),t.on("focus",function(e){t.isOpen()||n.$selection.focus()}),t.on("selection:update",function(t){n.update(t.data)})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(t,e){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(t,e))},r.prototype.selectionContainer=function(){return t("")},r.prototype.update=function(t){if(0===t.length)return void this.clear();var e=t[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(e,n);n.empty().append(i),n.prop("title",e.title||e.text)},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(t,e,n){function i(t,e){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,e),i.prototype.render=function(){var t=i.__super__.render.call(this);return t.addClass("select2-selection--multiple"),t.html('
                '),t},i.prototype.bind=function(e,n){var r=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(t){r.trigger("toggle",{originalEvent:t})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.options.get("disabled")){var n=t(this),i=n.parent(),o=i.data("data");r.trigger("unselect",{originalEvent:e,data:o})}})},i.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},i.prototype.display=function(t,e){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(t,e))},i.prototype.selectionContainer=function(){return t('
              • ×
              • ')},i.prototype.update=function(t){if(this.clear(),0!==t.length){for(var e=[],i=0;i1||n)return t.call(this,e);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},e}),e.define("select2/selection/allowClear",["jquery","../keys"],function(t,e){function n(){}return n.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(t){i._handleClear(t)}),e.on("keypress",function(t){i._handleKeyboardClear(t,e)})},n.prototype._handleClear=function(t,e){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){e.stopPropagation();for(var i=n.data("data"),r=0;r0||0===n.length)){var i=t('×');i.data("data",n),this.$selection.find(".select2-selection__rendered").prepend(i)}},n}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(t,e,n){function i(t,e,n){t.call(this,e,n)}return i.prototype.render=function(e){var n=t('');this.$searchContainer=n,this.$search=n.find("input");var i=e.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(t,e,i){var r=this;t.call(this,e,i),e.on("open",function(){r.$search.trigger("focus")}),e.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),e.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),e.on("disable",function(){r.$search.prop("disabled",!0)}),e.on("focus",function(t){r.$search.trigger("focus")}),e.on("results:focus",function(t){r.$search.attr("aria-activedescendant",t.id)}),this.$selection.on("focusin",".select2-search--inline",function(t){r.trigger("focus",t)}),this.$selection.on("focusout",".select2-search--inline",function(t){r._handleBlur(t)}),this.$selection.on("keydown",".select2-search--inline",function(t){if(t.stopPropagation(),r.trigger("keypress",t),r._keyUpPrevented=t.isDefaultPrevented(),t.which===n.BACKSPACE&&""===r.$search.val()){var e=r.$searchContainer.prev(".select2-selection__choice");if(e.length>0){var i=e.data("data");r.searchRemoveChoice(i),t.preventDefault()}}});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(t){return s?void r.$selection.off("input.search input.searchcheck"):void r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(t){if(s&&"input"===t.type)return void r.$selection.off("input.search input.searchcheck");var e=t.which;e!=n.SHIFT&&e!=n.CTRL&&e!=n.ALT&&e!=n.TAB&&r.handleSearch(t)})},i.prototype._transferTabIndex=function(t){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(t,e){this.$search.attr("placeholder",e.text)},i.prototype.update=function(t,e){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),t.call(this,e),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(t,e){this.trigger("unselect",{data:e}),this.$search.val(e.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var t="";t=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").innerWidth():.75*(this.$search.val().length+1)+"em",this.$search.css("width",t)},i}),e.define("select2/selection/eventRelay",["jquery"],function(t){function e(){}return e.prototype.bind=function(e,n,i){var r=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting"],s=["opening","closing","selecting","unselecting"];e.call(this,n,i),n.on("*",function(e,n){if(-1!==t.inArray(e,o)){n=n||{};var i=t.Event("select2:"+e,{params:n});r.$element.trigger(i),-1!==t.inArray(e,s)&&(n.prevented=i.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,e){function n(t){this.dict=t||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(t){return this.dict[t]},n.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},n._cache={},n.loadPath=function(t){if(!(t in n._cache)){var i=e(t);n._cache[t]=i}return new n(n._cache[t])},n}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),e.define("select2/data/base",["../utils"],function(t){ +function e(t,n){e.__super__.constructor.call(this)}return t.Extend(e,t.Observable),e.prototype.current=function(t){throw new Error("The `current` method must be defined in child classes.")},e.prototype.query=function(t,e){throw new Error("The `query` method must be defined in child classes.")},e.prototype.bind=function(t,e){},e.prototype.destroy=function(){},e.prototype.generateResultId=function(e,n){var i=e.id+"-result-";return i+=t.generateChars(4),i+=null!=n.id?"-"+n.id.toString():"-"+t.generateChars(4)},e}),e.define("select2/data/select",["./base","../utils","jquery"],function(t,e,n){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,t),i.prototype.current=function(t){var e=[],i=this;this.$element.find(":selected").each(function(){var t=n(this),r=i.item(t);e.push(r)}),t(e)},i.prototype.select=function(t){var e=this;if(t.selected=!0,n(t.element).is("option"))return t.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var r=[];t=[t],t.push.apply(t,i);for(var o=0;o=0){var c=o.filter(i(u)),h=this.item(c),f=n.extend(!0,{},u,h),d=this.option(f);c.replaceWith(d)}else{var p=this.option(u);if(u.children){var g=this.convertToOptions(u.children);e.appendMany(p,g)}a.push(p)}}return a},i}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(t,e,n){function i(t,e){this.ajaxOptions=this._applyDefaults(e.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,t,e)}return e.Extend(i,t),i.prototype._applyDefaults=function(t){var e={data:function(t){return n.extend({},t,{q:t.term})},transport:function(t,e,i){var r=n.ajax(t);return r.then(e),r.fail(i),r}};return n.extend({},e,t,!0)},i.prototype.processResults=function(t){return t},i.prototype.query=function(t,e){function i(){var i=o.transport(o,function(i){var o=r.processResults(i,t);r.options.get("debug")&&window.console&&console.error&&(o&&o.results&&n.isArray(o.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),e(o)},function(){i.status&&"0"===i.status||r.trigger("results:message",{message:"errorLoading"})});r._request=i}var r=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var o=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof o.url&&(o.url=o.url.call(this.$element,t)),"function"==typeof o.data&&(o.data=o.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),e.define("select2/data/tags",["jquery"],function(t){function e(e,n,i){var r=i.get("tags"),o=i.get("createTag");void 0!==o&&(this.createTag=o);var s=i.get("insertTag");if(void 0!==s&&(this.insertTag=s),e.call(this,n,i),t.isArray(r))for(var a=0;a0&&e.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:e.term,params:e}}):void t.call(this,e,n)},t}),e.define("select2/data/maximumSelectionLength",[],function(){function t(t,e,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),t.call(this,e,n)}return t.prototype.query=function(t,e,n){var i=this;this.current(function(r){var o=null!=r?r.length:0;return i.maximumSelectionLength>0&&o>=i.maximumSelectionLength?void i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):void t.call(i,e,n)})},t}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(t,e){this.$element=t,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e,e},n.prototype.bind=function(){},n.prototype.position=function(t,e){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(t,e){function n(){}return n.prototype.render=function(e){var n=e.call(this),i=t('');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(e,n,i){var r=this;e.call(this,n,i),this.$search.on("keydown",function(t){r.trigger("keypress",t),r._keyUpPrevented=t.isDefaultPrevented()}),this.$search.on("input",function(e){t(this).off("keyup")}),this.$search.on("keyup input",function(t){r.handleSearch(t)}),n.on("open",function(){r.$search.attr("tabindex",0),r.$search.focus(),window.setTimeout(function(){r.$search.focus()},0)}),n.on("close",function(){r.$search.attr("tabindex",-1),r.$search.val("")}),n.on("focus",function(){n.isOpen()||r.$search.focus()}),n.on("results:all",function(t){null!=t.query.term&&""!==t.query.term||(r.showSearch(t)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))})},n.prototype.handleSearch=function(t){if(!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},n.prototype.showSearch=function(t,e){return!0},n}),e.define("select2/dropdown/hidePlaceholder",[],function(){function t(t,e,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),t.call(this,e,n,i)}return t.prototype.append=function(t,e){e.results=this.removePlaceholder(e.results),t.call(this,e)},t.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},t.prototype.removePlaceholder=function(t,e){for(var n=e.slice(0),i=e.length-1;i>=0;i--){var r=e[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},t}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(t){function e(t,e,n,i){this.lastParams={},t.call(this,e,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(t,e){this.$loadingMore.remove(),this.loading=!1,t.call(this,e),this.showLoadingMore(e)&&this.$results.append(this.$loadingMore)},e.prototype.bind=function(e,n,i){var r=this;e.call(this,n,i),n.on("query",function(t){r.lastParams=t,r.loading=!0}),n.on("query:append",function(t){r.lastParams=t,r.loading=!0}),this.$results.on("scroll",function(){var e=t.contains(document.documentElement,r.$loadingMore[0]);!r.loading&&e&&r.$results.offset().top+r.$results.outerHeight(!1)+50>=r.$loadingMore.offset().top+r.$loadingMore.outerHeight(!1)&&r.loadMore()})},e.prototype.loadMore=function(){this.loading=!0;var e=t.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(t,e){return e.pagination&&e.pagination.more},e.prototype.createLoadingMore=function(){var e=t('
              • '),n=this.options.get("translations").get("loadingMore");return e.html(n(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(t,e){function n(e,n,i){this.$dropdownParent=i.get("dropdownParent")||t(document.body),e.call(this,n,i)}return n.prototype.bind=function(t,e,n){var i=this,r=!1;t.call(this,e,n),e.on("open",function(){i._showDropdown(),i._attachPositioningHandler(e),r||(r=!0,e.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),e.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),e.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(e)}),this.$dropdownContainer.on("mousedown",function(t){t.stopPropagation()})},n.prototype.destroy=function(t){t.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(t,e,n){e.attr("class",n.attr("class")),e.removeClass("select2"),e.addClass("select2-container--open"),e.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(e){var n=t(""),i=e.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(t){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var r=this,o="scroll.select2."+i.id,s="resize.select2."+i.id,a="orientationchange.select2."+i.id,l=this.$container.parents().filter(e.hasScroll);l.each(function(){t(this).data("select2-scroll-position",{x:t(this).scrollLeft(),y:t(this).scrollTop()})}),l.on(o,function(e){var n=t(this).data("select2-scroll-position");t(this).scrollTop(n.y)}),t(window).on(o+" "+s+" "+a,function(t){r._positionDropdown(),r._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var r="scroll.select2."+i.id,o="resize.select2."+i.id,s="orientationchange.select2."+i.id;this.$container.parents().filter(e.hasScroll).off(r),t(window).off(r+" "+o+" "+s)},n.prototype._positionDropdown=function(){var e=t(window),n=this.$dropdown.hasClass("select2-dropdown--above"),i=this.$dropdown.hasClass("select2-dropdown--below"),r=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=o.top,s.bottom=o.top+s.height;var a={height:this.$dropdown.outerHeight(!1)},l={top:e.scrollTop(),bottom:e.scrollTop()+e.height()},u=l.topo.bottom+a.height,h={left:o.left,top:s.bottom},f=this.$dropdownParent;"static"===f.css("position")&&(f=f.offsetParent());var d=f.offset();h.top-=d.top,h.left-=d.left,n||i||(r="below"),c||!u||n?!u&&c&&n&&(r="below"):r="above",("above"==r||n&&"below"!==r)&&(h.top=s.top-d.top-a.height),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(h)},n.prototype._resizeDropdown=function(){var t={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(t.minWidth=t.width,t.position="relative",t.width="auto"),this.$dropdown.css(t)},n.prototype._showDropdown=function(t){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function t(e){for(var n=0,i=0;i0&&(t.dataAdapter=u.Decorate(t.dataAdapter,v)),t.maximumInputLength>0&&(t.dataAdapter=u.Decorate(t.dataAdapter,y)),t.maximumSelectionLength>0&&(t.dataAdapter=u.Decorate(t.dataAdapter,b)),t.tags&&(t.dataAdapter=u.Decorate(t.dataAdapter,g)),null==t.tokenSeparators&&null==t.tokenizer||(t.dataAdapter=u.Decorate(t.dataAdapter,m)),null!=t.query){var h=e(t.amdBase+"compat/query");t.dataAdapter=u.Decorate(t.dataAdapter,h)}if(null!=t.initSelection){var P=e(t.amdBase+"compat/initSelection");t.dataAdapter=u.Decorate(t.dataAdapter,P)}}if(null==t.resultsAdapter&&(t.resultsAdapter=n,null!=t.ajax&&(t.resultsAdapter=u.Decorate(t.resultsAdapter,k)),null!=t.placeholder&&(t.resultsAdapter=u.Decorate(t.resultsAdapter,x)),t.selectOnClose&&(t.resultsAdapter=u.Decorate(t.resultsAdapter,T))),null==t.dropdownAdapter){if(t.multiple)t.dropdownAdapter=w;else{var O=u.Decorate(w,_);t.dropdownAdapter=O}if(0!==t.minimumResultsForSearch&&(t.dropdownAdapter=u.Decorate(t.dropdownAdapter,C)),t.closeOnSelect&&(t.dropdownAdapter=u.Decorate(t.dropdownAdapter,E)),null!=t.dropdownCssClass||null!=t.dropdownCss||null!=t.adaptDropdownCssClass){var M=e(t.amdBase+"compat/dropdownCss");t.dropdownAdapter=u.Decorate(t.dropdownAdapter,M)}t.dropdownAdapter=u.Decorate(t.dropdownAdapter,S)}if(null==t.selectionAdapter){if(t.multiple?t.selectionAdapter=r:t.selectionAdapter=i,null!=t.placeholder&&(t.selectionAdapter=u.Decorate(t.selectionAdapter,o)),t.allowClear&&(t.selectionAdapter=u.Decorate(t.selectionAdapter,s)),t.multiple&&(t.selectionAdapter=u.Decorate(t.selectionAdapter,a)),null!=t.containerCssClass||null!=t.containerCss||null!=t.adaptContainerCssClass){var A=e(t.amdBase+"compat/containerCss");t.selectionAdapter=u.Decorate(t.selectionAdapter,A)}t.selectionAdapter=u.Decorate(t.selectionAdapter,l)}if("string"==typeof t.language)if(t.language.indexOf("-")>0){var D=t.language.split("-"),L=D[0];t.language=[t.language,L]}else t.language=[t.language];if($.isArray(t.language)){var I=new c;t.language.push("en");for(var R=t.language,N=0;N0){for(var o=t.extend(!0,{},r),s=r.children.length-1;s>=0;s--)null==n(i,r.children[s])&&o.children.splice(s,1);return o.children.length>0?o:n(i,o)}var a=e(r.text).toUpperCase(),l=e(i.term).toUpperCase();return a.indexOf(l)>-1?r:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:u.escapeMarkup,language:P,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(t){return t},templateResult:function(t){return t.text},templateSelection:function(t){return t.text},theme:"default",width:"resolve"}},O.prototype.set=function(e,n){var i=t.camelCase(e),r={};r[i]=n;var o=u._convertData(r);t.extend(this.defaults,o)},new O}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(t,e,n,i){function r(e,r){if(this.options=e,null!=r&&this.fromElement(r),this.options=n.apply(this.options),r&&r.is("input")){var o=t(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,o)}}return r.prototype.fromElement=function(t){var n=["select2"];null==this.options.multiple&&(this.options.multiple=t.prop("multiple")),null==this.options.disabled&&(this.options.disabled=t.prop("disabled")),null==this.options.language&&(t.prop("lang")?this.options.language=t.prop("lang").toLowerCase():t.closest("[lang]").prop("lang")&&(this.options.language=t.closest("[lang]").prop("lang"))),null==this.options.dir&&(t.prop("dir")?this.options.dir=t.prop("dir"):t.closest("[dir]").prop("dir")?this.options.dir=t.closest("[dir]").prop("dir"):this.options.dir="ltr"),t.prop("disabled",this.options.disabled),t.prop("multiple",this.options.multiple),t.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),t.data("data",t.data("select2Tags")),t.data("tags",!0)),t.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),t.attr("ajax--url",t.data("ajaxUrl")),t.data("ajax--url",t.data("ajaxUrl")));var r={};r=e.fn.jquery&&"1."==e.fn.jquery.substr(0,2)&&t[0].dataset?e.extend(!0,{},t[0].dataset,t.data()):t.data();var o=e.extend(!0,{},r);o=i._convertData(o);for(var s in o)e.inArray(s,n)>-1||(e.isPlainObject(this.options[s])?e.extend(this.options[s],o[s]):this.options[s]=o[s]);return this},r.prototype.get=function(t){return this.options[t]},r.prototype.set=function(t,e){this.options[t]=e},r}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(t,e,n,i){var r=function(t,n){null!=t.data("select2")&&t.data("select2").destroy(),this.$element=t,this.id=this._generateId(t),n=n||{},this.options=new e(n,t),r.__super__.constructor.call(this);var i=t.attr("tabindex")||0;t.data("old-tabindex",i),t.attr("tabindex","-1");var o=this.options.get("dataAdapter");this.dataAdapter=new o(t,this.options);var s=this.render();this._placeContainer(s);var a=this.options.get("selectionAdapter");this.selection=new a(t,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,s);var l=this.options.get("dropdownAdapter");this.dropdown=new l(t,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,s);var u=this.options.get("resultsAdapter");this.results=new u(t,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var c=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(t){c.trigger("selection:update",{data:t})}),t.addClass("select2-hidden-accessible"),t.attr("aria-hidden","true"),this._syncAttributes(),t.data("select2",this)};return n.Extend(r,n.Observable),r.prototype._generateId=function(t){var e="";return e=null!=t.attr("id")?t.attr("id"):null!=t.attr("name")?t.attr("name")+"-"+n.generateChars(2):n.generateChars(4),e=e.replace(/(:|\.|\[|\]|,)/g,""),e="select2-"+e},r.prototype._placeContainer=function(t){t.insertAfter(this.$element);var e=this._resolveWidth(this.$element,this.options.get("width"));null!=e&&t.css("width",e)},r.prototype._resolveWidth=function(t,e){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==e){var i=this._resolveWidth(t,"style");return null!=i?i:this._resolveWidth(t,"element")}if("element"==e){var r=t.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"==e){var o=t.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a=1)return c[1]}return null}return e},r.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},r.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2",function(){e.dataAdapter.current(function(t){e.trigger("selection:update",{data:t})})}),this.$element.on("focus.select2",function(t){e.trigger("focus",t)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){t.each(n,e._syncA),t.each(n,e._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",e._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",e._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",e._syncS,!1))},r.prototype._registerDataEvents=function(){var t=this;this.dataAdapter.on("*",function(e,n){t.trigger(e,n)})},r.prototype._registerSelectionEvents=function(){var e=this,n=["toggle","focus"];this.selection.on("toggle",function(){e.toggleDropdown()}),this.selection.on("focus",function(t){e.focus(t)}),this.selection.on("*",function(i,r){-1===t.inArray(i,n)&&e.trigger(i,r)})},r.prototype._registerDropdownEvents=function(){var t=this;this.dropdown.on("*",function(e,n){t.trigger(e,n)})},r.prototype._registerResultsEvents=function(){var t=this;this.results.on("*",function(e,n){t.trigger(e,n)})},r.prototype._registerEvents=function(){var t=this;this.on("open",function(){t.$container.addClass("select2-container--open")}),this.on("close",function(){t.$container.removeClass("select2-container--open")}),this.on("enable",function(){t.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){t.$container.addClass("select2-container--disabled")}),this.on("blur",function(){t.$container.removeClass("select2-container--focus")}),this.on("query",function(e){t.isOpen()||t.trigger("open",{}),this.dataAdapter.query(e,function(n){t.trigger("results:all",{data:n,query:e})})}),this.on("query:append",function(e){this.dataAdapter.query(e,function(n){t.trigger("results:append",{data:n,query:e})})}),this.on("keypress",function(e){var n=e.which;t.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&e.altKey?(t.close(),e.preventDefault()):n===i.ENTER?(t.trigger("results:select",{}),e.preventDefault()):n===i.SPACE&&e.ctrlKey?(t.trigger("results:toggle",{}),e.preventDefault()):n===i.UP?(t.trigger("results:previous",{}),e.preventDefault()):n===i.DOWN&&(t.trigger("results:next",{}),e.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&e.altKey)&&(t.open(),e.preventDefault())})},r.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},r.prototype._syncSubtree=function(t,e){var n=!1,i=this;if(!t||!t.target||"OPTION"===t.target.nodeName||"OPTGROUP"===t.target.nodeName){if(e)if(e.addedNodes&&e.addedNodes.length>0)for(var r=0;r0&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(t){i.trigger("selection:update",{data:t})})}},r.prototype.trigger=function(t,e){var n=r.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===e&&(e={}),t in i){var o=i[t],s={prevented:!1,name:t,args:e};if(n.call(this,o,s),s.prevented)return void(e.prevented=!0)}n.call(this,t,e)},r.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},r.prototype.open=function(){this.isOpen()||this.trigger("query",{})},r.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},r.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},r.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},r.prototype.focus=function(t){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(t){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=t&&0!==t.length||(t=[!0]);var e=!t[0];this.$element.prop("disabled",e)},r.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},r.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var n=e[0];t.isArray(n)&&(n=t.map(n,function(t){return t.toString()})),this.$element.val(n).trigger("change"); +},r.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},r.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),e.data("element",this.$element),e},r}),e.define("jquery-mousewheel",["jquery"],function(t){return t}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(t,e,n,i){if(null==t.fn.select2){var r=["open","close","destroy"];t.fn.select2=function(e){if("object"==typeof(e=e||{}))return this.each(function(){var i=t.extend(!0,{},e);new n(t(this),i)}),this;if("string"==typeof e){var i,o=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=t(this).data("select2");null==n&&window.console&&console.error&&console.error("The select2('"+e+"') method was called on an element that is not using Select2."),i=n[e].apply(n,o)}),t.inArray(e,r)>-1?this:i}throw new Error("Invalid arguments for Select2: "+e)}}return null==t.fn.select2.defaults&&(t.fn.select2.defaults=i),n}),{define:e.define,require:e.require}}(),n=e.require("jquery.select2");return t.fn.select2.amd=e,n}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.CodeMirror=e()}(this,function(){"use strict";function t(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}function e(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function n(t,n){return e(t).appendChild(n)}function i(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return s+(e-o);s+=a-o,s+=n-s%n,o=a+1}}function f(t,e){for(var n=0;n=e)return i+Math.min(s,e-r);if(r+=o-i,r+=n-r%n,i=o+1,r>=e)return i}}function p(t){for(;Xs.length<=t;)Xs.push(g(Xs)+" ");return Xs[t]}function g(t){return t[t.length-1]}function m(t,e){for(var n=[],i=0;i"€"&&(t.toUpperCase()!=t.toLowerCase()||Js.test(t))}function _(t,e){return e?!!(e.source.indexOf("\\w")>-1&&w(t))||e.test(t):w(t)}function x(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}function k(t){return t.charCodeAt(0)>=768&&Zs.test(t)}function S(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var r=(e+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+i}}function T(t,e,n){var o=this;this.input=n,o.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=i("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=r("div",null,"CodeMirror-code"),o.selectionDiv=i("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=i("div",null,"CodeMirror-cursors"),o.measure=i("div",null,"CodeMirror-measure"),o.lineMeasure=i("div",null,"CodeMirror-measure"),o.lineSpace=r("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var s=r("div",[o.lineSpace],"CodeMirror-lines");o.mover=i("div",[s],null,"position: relative"),o.sizer=i("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=i("div",null,null,"position: absolute; height: "+qs+"px; width: 1px;"),o.gutters=i("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=i("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=i("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),_s&&xs<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),ks||vs&&Ds||(o.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(o.wrapper):t(o.wrapper)),o.viewFrom=o.viewTo=e.first,o.reportedViewFrom=o.reportedViewTo=e.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,n.init(o)}function E(t,e){if(e-=t.first,e<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(e=t.first&&en?R(n,E(t,n).text.length):B(e,E(t,e.line).text.length)}function B(t,e){var n=t.ch;return null==n||n>e?R(t.line,e):n<0?R(t.line,0):t}function U(t,e){for(var n=[],i=0;i=e:o.to>e);(i||(i=[])).push(new V(s,o.from,l?null:o.to))}}return i}function Z(t,e,n){var i;if(t)for(var r=0;r=e:o.to>e);if(a||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=e:o.from0&&a)for(var _=0;_0)){var c=[l,1],h=N(u.from,a.from),d=N(u.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&c.push({from:u.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),r.splice.apply(r,c),l+=c.length-3}}return r}function nt(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||st(n,o.marker)<0)&&(n=o.marker)}return n}function ht(t,e,n,i,r){var o=E(t,e),s=ta&&o.markedSpans;if(s)for(var a=0;a=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?N(u.to,n)>=0:N(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?N(u.from,i)<=0:N(u.from,i)<0)))return!0}}}function ft(t){for(var e;e=lt(t);)t=e.find(-1,!0).line;return t}function dt(t){for(var e;e=ut(t);)t=e.find(1,!0).line;return t}function pt(t){for(var e,n;e=ut(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function gt(t,e){var n=E(t,e),i=ft(n);return n==i?e:A(i)}function mt(t,e){if(e>t.lastLine())return e;var n,i=E(t,e);if(!vt(t,i))return e;for(;n=ut(i);)i=n.find(1,!0).line;return A(i)+1}function vt(t,e){var n=ta&&e.markedSpans;if(n)for(var i=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)})}function xt(t,e,n,i){if(!t)return i(e,n,"ltr",0);for(var r=!1,o=0;oe||e==n&&s.to==e)&&(i(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),r=!0)}r||i(e,n,"ltr")}function kt(t,e,n){var i;ea=null;for(var r=0;re)return r;o.to==e&&(o.from!=o.to&&"before"==n?i=r:ea=r),o.from==e&&(o.from!=o.to&&"before"!=n?i=r:ea=r)}return null!=i?i:ea}function St(t,e){var n=t.order;return null==n&&(n=t.order=na(t.text,e)),n}function Ct(t,e){return t._handlers&&t._handlers[e]||ia}function Tt(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var i=t._handlers,r=i&&i[e];if(r){var o=f(r,n);o>-1&&(i[e]=r.slice(0,o).concat(r.slice(o+1)))}}}function Et(t,e){var n=Ct(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function At(t){t.prototype.on=function(t,e){ra(this,t,e)},t.prototype.off=function(t,e){Tt(this,t,e)}}function Dt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Lt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function It(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Rt(t){Dt(t),Lt(t)}function Nt(t){return t.target||t.srcElement}function zt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),Ls&&t.ctrlKey&&1==e&&(e=3),e}function jt(t){if(null==Bs){var e=i("span","​");n(t,i("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Bs=e.offsetWidth<=1&&e.offsetHeight>2&&!(_s&&xs<8))}var r=Bs?i("span","​"):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function $t(t){if(null!=Us)return Us;var i=n(t,document.createTextNode("AخA")),r=zs(i,0,1).getBoundingClientRect(),o=zs(i,1,2).getBoundingClientRect();return e(t),!(!r||r.left==r.right)&&(Us=o.right-r.right<3)}function Ht(t){if(null!=ua)return ua;var e=n(t,i("span","x")),r=e.getBoundingClientRect(),o=zs(e,0,1).getBoundingClientRect();return ua=Math.abs(r.left-o.left)>1}function Ft(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),ca[t]=e}function Wt(t,e){ha[t]=e}function Bt(t){if("string"==typeof t&&ha.hasOwnProperty(t))t=ha[t];else if(t&&"string"==typeof t.name&&ha.hasOwnProperty(t.name)){var e=ha[t.name];"string"==typeof e&&(e={name:e}),t=b(e,t),t.name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Bt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Bt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ut(t,e){e=Bt(e);var n=ca[e.name];if(!n)return Ut(t,"text/plain");var i=n(t,e);if(fa.hasOwnProperty(e.name)){var r=fa[e.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)i[s]=e.modeProps[s];return i}function qt(t,e){var n=fa.hasOwnProperty(t)?fa[t]:fa[t]={};c(e,n)}function Yt(t,e){if(e===!0)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Vt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e),n&&n.mode!=t);)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Kt(t,e,n){return!t.startState||t.startState(e,n)}function Gt(t,e,n,i){var r=[t.state.modeGen],o={};ie(t,e.text,t.doc.mode,n,function(t,e){return r.push(t,e)},o,i);for(var s=n.state,a=function(i){n.baseTokens=r;var a=t.state.overlays[i],l=1,u=0;n.state=!0,ie(t,e.text,a.mode,n,function(t,e){for(var n=l;ut&&r.splice(l,1,t,r[l+1],i),l+=2,u=Math.min(t,i)}if(e)if(a.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Yt(t.doc.mode,i.state),o=Gt(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function Jt(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new ga(i,(!0),e);var o=re(t,e,n),s=o>i.first&&E(i,o-1).stateAfter,a=s?ga.fromSaved(i,s,o):new ga(i,Kt(i.mode),o);return i.iter(o,e,function(n){Zt(t,n.text,a);var i=a.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&ie.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}function ee(t,e,n,i){var r,o=t.doc,s=o.mode;e=W(o,e);var a,l=E(o,e.line),u=Jt(t,e.line,n),c=new da(l.text,t.options.tabSize,u);for(i&&(a=[]);(i||c.post.options.maxHighlightLength?(a=!1,s&&Zt(t,e,i,h.pos),h.pos=e.length,l=null):l=ne(te(n,h,i.state,f),o),f){var d=f[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!a||c!=l){for(;us;--a){if(a<=o.first)return o.first;var l=E(o,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof pa?u.lookAhead:0)<=o.modeFrontier))return a;var c=h(l.text,null,t.options.tabSize);(null==r||i>c)&&(r=a-1,i=c)}return r}function oe(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;i--){var r=E(t,i).stateAfter;if(r&&(!(r instanceof pa)||i+r.lookAhead1&&!/ /.test(t))return t;for(var n=e,i="",r=0;ru&&h.from<=u));f++);if(h.to>=c)return t(n,i,r,o,s,a,l);t(n,i.slice(0,h.to-u),r,o,null,a,l),o=null,i=i.slice(h.to-u),u=h.to}}}function pe(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function ge(t,e,n){var i=t.markedSpans,r=t.text,o=0;if(i)for(var s,a,l,u,c,h,f,d=r.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=h=a="",f=null,v=1/0;for(var y=[],b=void 0,w=0;wp||x.collapsed&&_.to==p&&_.from==p)?(null!=_.to&&_.to!=p&&v>_.to&&(v=_.to,u=""),x.className&&(l+=" "+x.className),x.css&&(a=(a?a+";":"")+x.css),x.startStyle&&_.from==p&&(c+=" "+x.startStyle),x.endStyle&&_.to==v&&(b||(b=[])).push(x.endStyle,_.to),x.title&&!h&&(h=x.title),x.collapsed&&(!f||st(f.marker,x)<0)&&(f=_)):_.from>p&&v>_.from&&(v=_.from)}if(b)for(var k=0;k=d)break;for(var C=Math.min(d,v);;){if(m){var T=p+m.length;if(!f){var E=T>C?m.slice(0,C-p):m;e.addToken(e,E,s?s+l:l,c,p+E.length==v?u:"",h,a)}if(T>=C){m=m.slice(C-p),p=C;break}p=T,c=""}m=r.slice(o,o=n[g++]),s=le(n[g++],e.cm.options)}}else for(var P=1;P2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ue(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var i=0;in)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function qe(t,e){e=ft(e);var i=A(e),r=t.display.externalMeasured=new me(t.doc,e,i);r.lineN=i;var o=r.built=ue(t,r);return r.text=o.pre,n(t.display.lineMeasure,o.pre),r}function Ye(t,e,n,i){return Ge(t,Ke(t,e),n,i)}function Ve(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(o=l-a,r=o-1,e>=l&&(s="right")),null!=r){if(i=t[u+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)for(;u&&t[u-2]==t[u-3]&&t[u-1].insertLeft;)i=t[(u-=3)+2],s="left";if("right"==n&&r==l-a)for(;u=0&&(n=t[r]).left==n.right;r--);return n}function Ze(t,e,n,i){var r,o=Xe(e.map,n,i),s=o.node,a=o.start,l=o.end,u=o.collapse;if(3==s.nodeType){for(var c=0;c<4;c++){for(;a&&k(e.line.text.charAt(o.coverStart+a));)--a;for(;o.coverStart+l0&&(u=i="right");var h;r=t.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==i?h.length-1:0]:s.getBoundingClientRect()}if(_s&&xs<9&&!a&&(!r||!r.left&&!r.right)){var f=s.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+_n(t.display),top:f.top,bottom:f.bottom}:ka}for(var d=r.top-e.rect.top,p=r.bottom-e.rect.top,g=(d+p)/2,m=e.view.measure.heights,v=0;v=i.text.length?(u=i.text.length,c="before"):u<=0&&(u=0,c="after"),!l)return s("before"==c?u-1:u,"before"==c);var h=kt(l,u,c),f=ea,d=a(u,h,"before"==c);return null!=f&&(d.other=a(u,f,"before"!=c)),d}function hn(t,e){var n=0;e=W(t.doc,e),t.options.lineWrapping||(n=_n(t.display)*e.ch);var i=E(t.doc,e.line),r=bt(i)+ze(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function fn(t,e,n,i,r){var o=R(t,e,n);return o.xRel=r,i&&(o.outside=!0),o}function dn(t,e,n){var i=t.doc;if(n+=t.display.viewOffset,n<0)return fn(i.first,0,null,!0,-1);var r=D(i,n),o=i.first+i.size-1;if(r>o)return fn(i.first+i.size-1,E(i,o).text.length,null,!0,1);e<0&&(e=0);for(var s=E(i,r);;){var a=vn(t,s,r,e,n),l=ct(s,a.ch+(a.xRel>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==r)return u;s=E(i,r=u.line)}}function pn(t,e,n,i){i-=sn(e);var r=e.text.length,o=C(function(e){return Ge(t,n,e-1).bottom<=i},r,0);return r=C(function(e){return Ge(t,n,e).top>i},o,r),{begin:o,end:r}}function gn(t,e,n,i){n||(n=Ke(t,e));var r=an(t,e,Ge(t,n,i),"line").top;return pn(t,e,n,r)}function mn(t,e,n,i){return!(t.bottom<=n)&&(t.top>n||(i?t.left:t.right)>e)}function vn(t,e,n,i,r){r-=bt(e);var o=Ke(t,e),s=sn(e),a=0,l=e.text.length,u=!0,c=St(e,t.doc.direction);if(c){var h=(t.options.lineWrapping?bn:yn)(t,e,n,o,c,i,r);u=1!=h.level,a=u?h.from:h.to-1,l=u?h.to:h.from-1}var f,d,p=null,g=null,m=C(function(e){var n=Ge(t,o,e);return n.top+=s,n.bottom+=s,!!mn(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(p=e,g=n),!0)},a,l),v=!1;if(g){var y=i-g.left=w.bottom}return m=S(e.text,m,1),fn(n,m,d,v,i-f)}function yn(t,e,n,i,r,o,s){var a=C(function(a){var l=r[a],u=1!=l.level;return mn(cn(t,R(n,u?l.to:l.from,u?"before":"after"),"line",e,i),o,s,!0)},0,r.length-1),l=r[a];if(a>0){var u=1!=l.level,c=cn(t,R(n,u?l.from:l.to,u?"after":"before"),"line",e,i);mn(c,o,s,!0)&&c.top>s&&(l=r[a-1])}return l}function bn(t,e,n,i,r,o,s){var a=pn(t,e,i,s),l=a.begin,u=a.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var c=null,h=null,f=0;f=u||d.to<=l)){var p=1!=d.level,g=Ge(t,i,p?Math.min(u,d.to)-1:Math.max(l,d.from)).right,m=gm)&&(c=d,h=m)}}return c||(c=r[r.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function wn(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ya){ya=i("pre");for(var r=0;r<49;++r)ya.appendChild(document.createTextNode("x")),ya.appendChild(i("br"));ya.appendChild(document.createTextNode("x"))}n(t.measure,ya);var o=ya.offsetHeight/50;return o>3&&(t.cachedTextHeight=o),e(t.measure),o||1}function _n(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=i("span","xxxxxxxxxx"),r=i("pre",[e]);n(t.measure,r);var o=e.getBoundingClientRect(),s=(o.right-o.left)/10;return s>2&&(t.cachedCharWidth=s),s||10}function xn(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s)n[t.options.gutters[s]]=o.offsetLeft+o.clientLeft+r,i[t.options.gutters[s]]=o.clientWidth;return{fixedPos:kn(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function kn(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Sn(t){var e=wn(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/_n(t.display)-3);return function(r){if(vt(t.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s=t.display.viewTo)return null;if(e-=t.display.viewFrom,e<0)return null;for(var n=t.display.view,i=0;i=t.display.viewTo||a.to().line0?e.blinker=setInterval(function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function In(t){t.state.focused||(t.display.input.focus(),Nn(t))}function Rn(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,zn(t))},100)}function Nn(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(Et(t,"focus",t,e),t.state.focused=!0,a(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),ks&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),Ln(t))}function zn(t,e){t.state.delayingBlurEvent||(t.state.focused&&(Et(t,"blur",t,e),t.state.focused=!1,Hs(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function jn(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=0;i.005||l<-.005)&&(M(r.line,o),$n(r.line),r.rest))for(var u=0;u=s&&(o=D(e,bt(E(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function Fn(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=kn(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,o=i+"px",s=0;s(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!Os){var s=i("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-ze(t.display))+"px;\n height: "+(e.bottom-e.top+He(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(s),s.scrollIntoView(o),t.display.lineSpace.removeChild(s)}}}function Un(t,e,n,i){null==i&&(i=0);var r;t.options.lineWrapping||e!=n||(e=e.ch?R(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e,n="before"==e.sticky?R(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var s=!1,a=cn(t,e),l=n&&n!=e?cn(t,n):a;r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i};var u=Yn(t,r),c=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=u.scrollTop&&(Qn(t,u.scrollTop),Math.abs(t.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(ei(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return r}function qn(t,e){var n=Yn(t,e);null!=n.scrollTop&&Qn(t,n.scrollTop),null!=n.scrollLeft&&ei(t,n.scrollLeft)}function Yn(t,e){var n=t.display,i=wn(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=We(t),s={};e.bottom-e.top>o&&(e.bottom=e.top+o);var a=t.doc.height+je(n),l=e.topa-i;if(e.topr+o){var c=Math.min(e.top,(u?a:e.bottom)-o);c!=r&&(s.scrollTop=c)}var h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,f=Fe(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),d=e.right-e.left>f;return d&&(e.right=e.left+f),e.left<10?s.scrollLeft=0:e.leftf+h-3&&(s.scrollLeft=e.right+(d?0:10)-f),s}function Vn(t,e){null!=e&&(Jn(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Kn(t){Jn(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Gn(t,e,n){null==e&&null==n||Jn(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Xn(t,e){Jn(t),t.curOp.scrollToPos=e}function Jn(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=hn(t,e.from),i=hn(t,e.to);Zn(t,n,i,e.margin)}}function Zn(t,e,n,i){var r=Yn(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});Gn(t,r.scrollLeft,r.scrollTop)}function Qn(t,e){Math.abs(t.doc.scrollTop-e)<2||(vs||Ai(t,{top:e}),ti(t,e,!0),vs&&Ai(t),Si(t,100))}function ti(t,e,n){e=Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function ei(t,e,n,i){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,Fn(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function ni(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+je(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+He(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}function ii(t,e){e||(e=ni(t));var n=t.display.barWidth,i=t.display.barHeight;ri(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&jn(t),ri(t,ni(t)),n=t.display.barWidth,i=t.display.barHeight}function ri(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}function oi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Hs(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Ta[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ra(e,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?ei(t,e):Qn(t,e)},t),t.display.scrollbars.addClass&&a(t.display.wrapper,t.display.scrollbars.addClass)}function si(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ea},ye(t.curOp)}function ai(t){var e=t.curOp;we(e,function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Pa(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function ci(t){t.updatedDisplay=t.mustUpdate&&Oi(t.cm,t.update)}function hi(t){var e=t.cm,n=e.display;t.updatedDisplay&&jn(e),t.barMeasure=ni(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Ye(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+He(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Fe(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function fi(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLefte)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)ta&>(t.doc,e)r.viewFrom?wi(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)wi(t);else if(e<=r.viewFrom){var o=_i(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):wi(t)}else if(n>=r.viewTo){var s=_i(t,e,e,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):wi(t)}else{var a=_i(t,e,e,-1),l=_i(t,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(ve(t,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):wi(t)}var u=r.externalMeasured;u&&(n=r.lineN&&e=i.viewTo)){var o=i.view[En(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);f(s,n)==-1&&s.push(n)}}}function wi(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function _i(t,e,n,i){var r,o=En(t,e),s=t.display.view;if(!ta||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var a=t.display.viewFrom,l=0;l0){if(o==s.length-1)return null;r=a+s[o].size-e,o++}else r=a-e;e+=r,n+=r}for(;gt(t.doc,n)!=n;){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function xi(t,e,n){var i=t.display,r=i.view;0==r.length||e>=i.viewTo||n<=i.viewFrom?(i.view=ve(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=ve(t,e,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,En(t,n)))),i.viewTo=n}function ki(t){for(var e=t.display.view,n=0,i=0;i=t.display.viewTo)){var n=+new Date+t.options.workTime,i=Jt(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(i.line>=t.display.viewFrom){var s=o.styles,a=o.text.length>t.options.maxHighlightLength?Yt(e.mode,i.state):null,l=Gt(t,o,i,!0);a&&(i.state=a),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&fn)return Si(t,t.options.workDelay),!0}),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&pi(t,function(){for(var e=0;e=i.viewFrom&&n.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==ki(t))return!1;Wn(t)&&(wi(t),n.dims=xn(t));var o=r.first+r.size,s=Math.max(n.visible.from-t.options.viewportMargin,r.first),a=Math.min(o,n.visible.to+t.options.viewportMargin);i.viewFroma&&i.viewTo-a<20&&(a=Math.min(o,i.viewTo)),ta&&(s=gt(t.doc,s),a=mt(t.doc,a));var l=s!=i.viewFrom||a!=i.viewTo||i.lastWrapHeight!=n.wrapperHeight||i.lastWrapWidth!=n.wrapperWidth;xi(t,s,a),i.viewOffset=bt(E(t.doc,i.viewFrom)),t.display.mover.style.top=i.viewOffset+"px";var u=ki(t);if(!l&&0==u&&!n.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))return!1;var c=Ei(t);return u>4&&(i.lineDiv.style.display="none"),Di(t,i.updateLineNumbers,n.dims),u>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Pi(c),e(i.cursorDiv),e(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,l&&(i.lastWrapHeight=n.wrapperHeight,i.lastWrapWidth=n.wrapperWidth,Si(t,400)),i.updateLineNumbers=null,!0}function Mi(t,e){for(var n=e.viewport,i=!0;(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Fe(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+je(t.display)-We(t),n.top)}),e.visible=Hn(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&Oi(t,e);i=!1){jn(t);var r=ni(t);Pn(t),ii(t,r),Ii(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Ai(t,e){var n=new Pa(t,e);if(Oi(t,n)){jn(t),Mi(t,n);var i=ni(t);Pn(t),ii(t,i),Ii(t,i),n.finish()}}function Di(t,n,i){function r(e){var n=e.nextSibling;return ks&&Ls&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var o=t.display,s=t.options.lineNumbers,a=o.lineDiv,l=a.firstChild,u=o.view,c=o.viewFrom,h=0;h-1&&(p=!1),ke(t,d,c,i)),p&&(e(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(I(t.options,c)))),l=d.node.nextSibling}else{var g=Ae(t,d,c,i);a.insertBefore(g,l)}c+=d.size}for(;l;)l=r(l)}function Li(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function Ii(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+He(t)+"px"}function Ri(t){var n=t.display.gutters,r=t.options.gutters;e(n);for(var o=0;o-1&&!t.lineNumbers&&(t.gutters=t.gutters.slice(0),t.gutters.splice(e,1))}function zi(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function ji(t){var e=zi(t);return e.x*=Ma,e.y*=Ma,e}function $i(t,e){var n=zi(e),i=n.x,r=n.y,o=t.display,s=o.scroller,a=s.scrollWidth>s.clientWidth,l=s.scrollHeight>s.clientHeight; +if(i&&a||r&&l){if(r&&Ls&&ks)t:for(var u=e.target,c=o.view;u!=s;u=u.parentNode)for(var h=0;h=0){var s=H(o.from(),r.from()),a=$(o.to(),r.to()),l=o.empty()?r.from()==r.head:o.from()==o.head;i<=e&&--e,t.splice(--i,2,new Da(l?a:s,l?s:a))}}return new Aa(t,e)}function Fi(t,e){return new Aa([new Da(t,e||t)],0)}function Wi(t){return t.text?R(t.from.line+t.text.length-1,g(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Bi(t,e){if(N(t,e.from)<0)return t;if(N(t,e.to)<=0)return Wi(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=Wi(e).ch-e.to.ch),R(n,i)}function Ui(t,e){for(var n=[],i=0;i1&&t.remove(a.line+1,p-1),t.insert(a.line+1,y)}_e(t,"change",t,e)}function Ji(t,e,n){function i(t,r,o){if(t.linked)for(var s=0;s1&&!t.done[t.done.length-2].ranges?(t.done.pop(),g(t.done)):void 0}function or(t,e,n,i){var r=t.history;r.undone.length=0;var o,s,a=+new Date;if((r.lastOp==i||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=rr(r,r.lastOp==i)))s=g(o.changes),0==N(e.from,e.to)&&0==N(e.from,s.to)?s.to=Wi(e):o.changes.push(nr(t,e));else{var l=g(r.done);for(l&&l.ranges||lr(t.sel,r.done),o={changes:[nr(t,e)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,s||Et(t,"historyAdded")}function sr(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function ar(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||sr(t,o,g(r.done),e))?r.done[r.done.length-1]=e:lr(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&i.clearRedo!==!1&&ir(r.undone)}function lr(t,e){var n=g(e);n&&n.ranges&&n.equals(t)||e.push(t)}function ur(t,e,n,i){var r=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[o]=n.markedSpans),++o})}function cr(t){if(!t)return null;for(var e,n=0;n-1&&(g(a)[h]=u[h],delete u[h])}}}return i}function pr(t,e,n,i){if(i){var r=t.anchor;if(n){var o=N(e,r)<0;o!=N(n,r)<0?(r=e,e=n):o!=N(e,n)<0&&(e=n)}return new Da(r,e)}return new Da(n||e,e)}function gr(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),_r(t,new Aa([pr(t.sel.primary(),e,n,r)],0),i)}function mr(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:a.to>e.ch))){if(r&&(Et(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var u=l.find(i<0?1:-1),c=void 0;if((i<0?l.inclusiveRight:l.inclusiveLeft)&&(u=Pr(t,u,-i,u&&u.line==e.line?o:null)),u&&u.line==e.line&&(c=N(u,n))&&(i<0?c<0:c>0))return Tr(t,u,e,i,r)}var h=l.find(i<0?-1:1);return(i<0?l.inclusiveLeft:l.inclusiveRight)&&(h=Pr(t,h,i,h.line==e.line?o:null)),h?Tr(t,h,e,i,r):null}}return e}function Er(t,e,n,i,r){var o=i||1,s=Tr(t,e,n,o,r)||!r&&Tr(t,e,n,o,!0)||Tr(t,e,n,-o,r)||!r&&Tr(t,e,n,-o,!0);return s?s:(t.cantEdit=!0,R(t.first,0))}function Pr(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?W(t,R(e.line-1)):null:n>0&&e.ch==(i||E(t,e.line)).text.length?e.line=0;--r)Dr(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else Dr(t,e)}}function Dr(t,e){if(1!=e.text.length||""!=e.text[0]||0!=N(e.from,e.to)){var n=Ui(t,e);or(t,e,n,t.cm?t.cm.curOp.id:NaN),Rr(t,e,n,Q(t,e));var i=[];Ji(t,function(t,n){n||f(i,t.history)!=-1||(Hr(t.history,e),i.push(t.history)),Rr(t,e,null,Q(t,e))})}}function Lr(t,e,n){var i=t.cm&&t.cm.state.suppressEdits;if(!i||n){for(var r,o=t.history,s=t.sel,a="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,u=0;u=0;--p){var m=d(p);if(m)return m.v}}}}function Ir(t,e){if(0!=e&&(t.first+=e,t.sel=new Aa(m(t.sel.ranges,function(t){return new Da(R(t.anchor.line+e,t.anchor.ch),R(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){yi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;it.lastLine())){if(e.from.lineo&&(e={from:e.from,to:R(o,E(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=P(t,e.from,e.to),n||(n=Ui(t,e)),t.cm?Nr(t.cm,e,i):Xi(t,e,i),xr(t,n,Vs)}}function Nr(t,e,n){var i=t.doc,r=t.display,o=e.from,s=e.to,a=!1,l=o.line;t.options.lineWrapping||(l=A(ft(E(i,o.line))),i.iter(l,s.line+1,function(t){if(t==r.maxLine)return a=!0,!0})),i.sel.contains(e.from,e.to)>-1&&Ot(t),Xi(i,e,n,Sn(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,function(t){var e=wt(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,a=!1)}),a&&(t.curOp.updateMaxLine=!0)),oe(i,o.line),Si(t,400);var u=e.text.length-(s.line-o.line)-1;e.full?yi(t):o.line!=s.line||1!=e.text.length||Gi(t.doc,e)?yi(t,o.line,s.line+1,u):bi(t,o.line,"text");var c=Mt(t,"changes"),h=Mt(t,"change");if(h||c){var f={from:o,to:s,text:e.text,removed:e.removed,origin:e.origin};h&&_e(t,"change",t,f),c&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(f)}t.display.selForContextMenu=null}function zr(t,e,n,i,r){if(i||(i=n),N(i,n)<0){var o;o=[i,n],n=o[0],i=o[1]}"string"==typeof e&&(e=t.splitLines(e)),Ar(t,{from:n,to:i,text:e,origin:r})}function jr(t,e,n,i){n0||0==a&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=r("span",[s.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(ht(t,e.line,e,n,s)||e.line!=n.line&&ht(t,n.line,e,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Y()}s.addToHistory&&or(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var l,u=e.line,h=t.cm;if(t.iter(u,n.line+1,function(t){h&&s.collapsed&&!h.options.lineWrapping&&ft(t)==h.display.maxLine&&(l=!0),s.collapsed&&u!=e.line&&M(t,0),X(t,new V(s,u==e.line?e.ch:null,u==n.line?n.ch:null)),++u}),s.collapsed&&t.iter(e.line,n.line+1,function(e){vt(t,e)&&M(e,0)}),s.clearOnEnter&&ra(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(q(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),s.collapsed&&(s.id=++Ia,s.atomic=!0),h){if(l&&(h.curOp.updateMaxLine=!0),s.collapsed)yi(h,e.line,n.line+1);else if(s.className||s.title||s.startStyle||s.endStyle||s.css)for(var f=e.line;f<=n.line;f++)bi(h,f,"text");s.atomic&&Sr(h.doc),_e(h,"markerAdded",h,s)}return s}function Vr(t,e,n,i,r){i=c(i),i.shared=!1;var o=[Yr(t,e,n,i,r)],s=o[0],a=i.widgetNode;return Ji(t,function(t){a&&(i.widgetNode=a.cloneNode(!0)),o.push(Yr(t,W(t,e),W(t,n),i,r));for(var l=0;l-1)return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var u=t.dataTransfer.getData("Text");if(u){var c;if(e.state.draggingText&&!e.state.draggingText.copy&&(c=e.listSelections()),xr(e.doc,Fi(n,n)),c)for(var h=0;h=0;e--)zr(t.doc,"",i[e].from,i[e].to,"+delete");Kn(t)})}function po(t,e,n){var i=S(t.text,e+n,n);return i<0||i>t.text.length?null:i}function go(t,e,n){var i=po(t,e.ch,n);return null==i?null:new R(e.line,i,n<0?"after":"before")}function mo(t,e,n,i,r){if(t){var o=St(n,e.doc.direction);if(o){var s,a=r<0?g(o):o[0],l=r<0==(1==a.level),u=l?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var c=Ke(e,n);s=r<0?n.text.length-1:0;var h=Ge(e,c,s).top;s=C(function(t){return Ge(e,c,t).top==h},r<0==(1==a.level)?a.from:a.to-1,s),"before"==u&&(s=po(n,s,1))}else s=r<0?a.to:a.from;return new R(i,s,u)}}return new R(i,r<0?n.text.length:0,r<0?"before":"after")}function vo(t,e,n,i){var r=St(e,t.doc.direction);if(!r)return go(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=kt(r,n.ch,n.sticky),s=r[o];if("ltr"==t.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from=s.from&&f>=c.begin)){var d=h?"before":"after";return new R(n.line,f,d)}}var p=function(t,e,i){for(var o=function(t,e){return e?new R(n.line,l(t,1),"before"):new R(n.line,t,"after")};t>=0&&t0==(1!=s.level),u=a?i.begin:l(i.end,-1);if(s.from<=u&&u0?c.end:l(c.begin,-1);return null==m||i>0&&m==e.text.length||!(g=p(i>0?0:r.length-1,i,u(m)))?null:g}function yo(t,e){var n=E(t.doc,e),i=ft(n);return i!=n&&(e=A(i)),mo(!0,t,i,e,1)}function bo(t,e){var n=E(t.doc,e),i=dt(n);return i!=n&&(e=A(i)),mo(!0,t,n,e,-1)}function wo(t,e){var n=yo(t,e.line),i=E(t.doc,n.line),r=St(i,t.doc.direction);if(!r||0==r[0].level){var o=Math.max(0,i.text.search(/\S/)),s=e.line==n.line&&e.ch<=o&&e.ch;return R(n.line,s?0:o,n.sticky)}return n}function _o(t,e,n){if("string"==typeof e&&(e=Ya[e],!e))return!1;t.display.input.ensurePolled();var i=t.display.shift,r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),r=e(t)!=Ys}finally{t.display.shift=i,t.state.suppressEdits=!1}return r}function xo(t,e,n){for(var i=0;i-1&&(N((r=a.ranges[r]).from(),e)<0||e.xRel>0)&&(N(r.to(),e)>0||e.xRel<0)?No(t,i,e,o):jo(t,i,e,o)}function No(t,e,n,i){var r=t.display,o=!1,s=gi(t,function(e){ks&&(r.scroller.draggable=!1),t.state.draggingText=!1,Tt(r.wrapper.ownerDocument,"mouseup",s),Tt(r.wrapper.ownerDocument,"mousemove",a),Tt(r.scroller,"dragstart",l),Tt(r.scroller,"drop",s),o||(Dt(e),i.addNew||gr(t.doc,n,null,null,i.extend),ks||_s&&9==xs?setTimeout(function(){r.wrapper.ownerDocument.body.focus(),r.input.focus()},20):r.input.focus())}),a=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},l=function(){return o=!0};ks&&(r.scroller.draggable=!0),t.state.draggingText=s,s.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),ra(r.wrapper.ownerDocument,"mouseup",s),ra(r.wrapper.ownerDocument,"mousemove",a),ra(r.scroller,"dragstart",l),ra(r.scroller,"drop",s),Rn(t),setTimeout(function(){return r.input.focus()},20)}function zo(t,e,n){if("char"==n)return new Da(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Da(R(e.line,0),W(t.doc,R(e.line+1,0)));var i=n(t,e);return new Da(i.from,i.to)}function jo(t,e,n,i){function r(e){if(0!=N(v,e))if(v=e,"rectangle"==i.unit){for(var r=[],o=t.options.tabSize,s=h(E(u,n.line).text,n.ch,o),a=h(E(u,e.line).text,e.ch,o),l=Math.min(s,a),g=Math.max(s,a),m=Math.min(n.line,e.line),y=Math.min(t.lastLine(),Math.max(n.line,e.line));m<=y;m++){var b=E(u,m).text,w=d(b,l,o);l==g?r.push(new Da(R(m,w),R(m,w))):b.length>w&&r.push(new Da(R(m,w),R(m,d(b,g,o))))}r.length||r.push(new Da(n,n)),_r(u,Hi(p.ranges.slice(0,f).concat(r),f),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var _,x=c,k=zo(t,e,i.unit),S=x.anchor;N(k.anchor,S)>0?(_=k.head,S=H(x.from(),k.anchor)):(_=k.anchor,S=$(x.to(),k.head));var C=p.ranges.slice(0);C[f]=$o(t,new Da(W(u,S),_)),_r(u,Hi(C,f),Ks)}}function o(e){var n=++b,a=Tn(t,e,!0,"rectangle"==i.unit);if(a)if(0!=N(a,v)){t.curOp.focus=s(),r(a);var c=Hn(l,u);(a.line>=c.to||a.liney.bottom?20:0;h&&setTimeout(gi(t,function(){b==n&&(l.scroller.scrollTop+=h,o(e))}),50)}}function a(e){t.state.selectingText=!1,b=1/0,Dt(e),l.input.focus(),Tt(l.wrapper.ownerDocument,"mousemove",w),Tt(l.wrapper.ownerDocument,"mouseup",_),u.history.lastSelOrigin=null}var l=t.display,u=t.doc;Dt(e);var c,f,p=u.sel,g=p.ranges;if(i.addNew&&!i.extend?(f=u.sel.contains(n),c=f>-1?g[f]:new Da(n,n)):(c=u.sel.primary(),f=u.sel.primIndex),"rectangle"==i.unit)i.addNew||(c=new Da(n,n)),n=Tn(t,e,!0,!0),f=-1;else{var m=zo(t,n,i.unit);c=i.extend?pr(c,m.anchor,m.head,i.extend):m}i.addNew?f==-1?(f=g.length,_r(u,Hi(g.concat([c]),f),{scroll:!1,origin:"*mouse"})):g.length>1&&g[f].empty()&&"char"==i.unit&&!i.extend?(_r(u,Hi(g.slice(0,f).concat(g.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=u.sel):vr(u,f,c,Ks):(f=0,_r(u,new Aa([c],0),Ks),p=u.sel);var v=n,y=l.wrapper.getBoundingClientRect(),b=0,w=gi(t,function(t){0!==t.buttons&&zt(t)?o(t):a(t)}),_=gi(t,a);t.state.selectingText=_,ra(l.wrapper.ownerDocument,"mousemove",w),ra(l.wrapper.ownerDocument,"mouseup",_)}function $o(t,e){var n=e.anchor,i=e.head,r=E(t.doc,n.line);if(0==N(n,i)&&n.sticky==i.sticky)return e;var o=St(r);if(!o)return e;var s=kt(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return e;var l=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==l||l==o.length)return e;var u;if(i.line!=n.line)u=(i.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var c=kt(o,i.ch,i.sticky),h=c-s||(i.ch-n.ch)*(1==a.level?-1:1);u=c==l-1||c==l?h<0:h>0}var f=o[l+(u?-1:0)],d=u==(1==f.level),p=d?f.from:f.to,g=d?"after":"before";return n.ch==p&&n.sticky==g?e:new Da(new R(n.line,p,g),i)}function Ho(t,e,n,i){var r,o;if(e.touches)r=e.touches[0].clientX,o=e.touches[0].clientY;else try{r=e.clientX,o=e.clientY}catch(e){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&Dt(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!Mt(t,n))return It(e);o-=a.top-s.viewOffset;for(var l=0;l=r){var c=D(t.doc,o),h=t.options.gutters[l];return Et(t,n,t,c,h,e),It(e)}}}function Fo(t,e){return Ho(t,e,"gutterClick",!0)}function Wo(t,e){Ne(t.display,e)||Bo(t,e)||Pt(t,e,"contextmenu")||t.display.input.onContextMenu(e)}function Bo(t,e){return!!Mt(t,"gutterContextMenu")&&Ho(t,e,"gutterContextMenu",!1)}function Uo(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),nn(t)}function qo(t){function e(e,i,r,o){t.defaults[e]=i,r&&(n[e]=o?function(t,e,n){n!=Qa&&r(t,e,n)}:r)}var n=t.optionHandlers;t.defineOption=e,t.Init=Qa,e("value","",function(t,e){return t.setValue(e)},!0),e("mode",null,function(t,e){ +t.doc.modeOption=e,Vi(t)},!0),e("indentUnit",2,Vi,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,function(t){Ki(t),nn(t),yi(t)},!0),e("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter(function(t){for(var r=0;;){var o=t.text.indexOf(e,r);if(o==-1)break;r=o+e.length,n.push(R(i,o))}i++});for(var r=n.length-1;r>=0;r--)zr(t.doc,e,n[r],R(n[r].line,n[r].ch+e.length))}}),e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Qa&&t.refresh()}),e("specialCharPlaceholder",ce,function(t){return t.refresh()},!0),e("electricChars",!0),e("inputStyle",Ds?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),e("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),e("rtlMoveVisually",!Rs),e("wholeLineUpdateBefore",!0),e("theme","default",function(t){Uo(t),Yo(t)},!0),e("keyMap","default",function(t,e,n){var i=ho(e),r=n!=Qa&&ho(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)}),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,Ko,!0),e("gutters",[],function(t){Ni(t.options),Yo(t)},!0),e("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?kn(t.display)+"px":"0",t.refresh()},!0),e("coverGutterNextToScrollbar",!1,function(t){return ii(t)},!0),e("scrollbarStyle","native",function(t){oi(t),ii(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),e("lineNumbers",!1,function(t){Ni(t.options),Yo(t)},!0),e("firstLineNumber",1,Yo,!0),e("lineNumberFormatter",function(t){return t},Yo,!0),e("showCursorWhenSelecting",!1,Pn,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("readOnly",!1,function(t,e){"nocursor"==e&&(zn(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),e("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),e("dragDrop",!0,Vo),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,Pn,!0),e("singleCursorHeightPerLine",!0,Pn,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,Ki,!0),e("addModeClass",!1,Ki,!0),e("pollInterval",100),e("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),e("historyEventDelay",1250),e("viewportMargin",10,function(t){return t.refresh()},!0),e("maxHighlightLength",1e4,Ki,!0),e("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),e("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),e("autofocus",null),e("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0)}function Yo(t){Ri(t),yi(t),Fn(t)}function Vo(t,e,n){var i=n&&n!=Qa;if(!e!=!i){var r=t.display.dragFunctions,o=e?ra:Tt;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function Ko(t){t.options.lineWrapping?(a(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(Hs(t.display.wrapper,"CodeMirror-wrap"),_t(t)),Cn(t),yi(t),nn(t),setTimeout(function(){return ii(t)},100)}function Go(t,e){var n=this;if(!(this instanceof Go))return new Go(t,e);this.options=e=e?c(e):{},c(tl,e,!1),Ni(e);var i=e.value;"string"==typeof i&&(i=new ja(i,e.mode,null,e.lineSeparator,e.direction)),this.doc=i;var r=new Go.inputStyles[e.inputStyle](this),o=this.display=new T(t,i,r);o.wrapper.CodeMirror=this,Ri(this),Uo(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),oi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ws,keySeq:null,specialChars:null},e.autofocus&&!Ds&&o.input.focus(),_s&&xs<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Xo(this),no(),si(this),this.curOp.forceUpdate=!0,Zi(this,i),e.autofocus&&!Ds||this.hasFocus()?setTimeout(u(Nn,this),20):zn(this);for(var s in el)el.hasOwnProperty(s)&&el[s](n,e[s],Qa);Wn(this),e.finishInit&&e.finishInit(this);for(var a=0;a400}var r=t.display;ra(r.scroller,"mousedown",gi(t,Do)),_s&&xs<11?ra(r.scroller,"dblclick",gi(t,function(e){if(!Pt(t,e)){var n=Tn(t,e);if(n&&!Fo(t,e)&&!Ne(t.display,e)){Dt(e);var i=t.findWordAt(n);gr(t.doc,i.anchor,i.head)}}})):ra(r.scroller,"dblclick",function(e){return Pt(t,e)||Dt(e)}),$s||ra(r.scroller,"contextmenu",function(e){return Wo(t,e)});var o,s={end:0};ra(r.scroller,"touchstart",function(e){if(!Pt(t,e)&&!n(e)&&!Fo(t,e)){r.input.ensurePolled(),clearTimeout(o);var i=+new Date;r.activeTouch={start:i,moved:!1,prev:i-s.end<=300?s:null},1==e.touches.length&&(r.activeTouch.left=e.touches[0].pageX,r.activeTouch.top=e.touches[0].pageY)}}),ra(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),ra(r.scroller,"touchend",function(n){var o=r.activeTouch;if(o&&!Ne(r,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var s,a=t.coordsChar(r.activeTouch,"page");s=!o.prev||i(o,o.prev)?new Da(a,a):!o.prev.prev||i(o,o.prev.prev)?t.findWordAt(a):new Da(R(a.line,0),W(t.doc,R(a.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),Dt(n)}e()}),ra(r.scroller,"touchcancel",e),ra(r.scroller,"scroll",function(){r.scroller.clientHeight&&(Qn(t,r.scroller.scrollTop),ei(t,r.scroller.scrollLeft,!0),Et(t,"scroll",t))}),ra(r.scroller,"mousewheel",function(e){return $i(t,e)}),ra(r.scroller,"DOMMouseScroll",function(e){return $i(t,e)}),ra(r.wrapper,"scroll",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(e){Pt(t,e)||Rt(e)},over:function(e){Pt(t,e)||(Qr(t,e),Rt(e))},start:function(e){return Zr(t,e)},drop:gi(t,Jr),leave:function(e){Pt(t,e)||to(t)}};var a=r.input.getField();ra(a,"keyup",function(e){return Oo.call(t,e)}),ra(a,"keydown",gi(t,Eo)),ra(a,"keypress",gi(t,Mo)),ra(a,"focus",function(e){return Nn(t,e)}),ra(a,"blur",function(e){return zn(t,e)})}function Jo(t,e,n,i){var r,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=Jt(t,e).state:n="prev");var s=t.options.tabSize,a=E(o,e),l=h(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&(u=o.mode.indent(r,a.text.slice(c.length),a.text),u==Ys||u>150)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>o.first?h(E(o,e-1).text,null,s):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var f="",d=0;if(t.options.indentWithTabs)for(var g=Math.floor(u/s);g;--g)d+=s,f+="\t";if(d1)if(il&&il.text.join("\n")==e){if(i.ranges.length%il.text.length==0){l=[];for(var u=0;u=0;h--){var f=i.ranges[h],d=f.from(),p=f.to();f.empty()&&(n&&n>0?d=R(d.line,d.ch-n):t.state.overwrite&&!s?p=R(p.line,Math.min(E(o,p.line).text.length,p.ch+g(a).length)):il&&il.lineWise&&il.text.join("\n")==e&&(d=p=R(d.line,0))),c=t.curOp.updateInput;var v={from:d,to:p,text:l?l[h%l.length]:a,origin:r||(s?"paste":t.state.cutIncoming?"cut":"+input")};Ar(t.doc,v),_e(t,"inputRead",t,v)}e&&!s&&es(t,e),Kn(t),t.curOp.updateInput=c,t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=!1}function ts(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||pi(e,function(){return Qo(e,n,0,null,"paste")}),!0}function es(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=Jo(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(E(t.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Jo(t,r.head.line,"smart"));s&&_e(t,"electricInput",t,r.head.line)}}}function ns(t){for(var e=[],n=[],i=0;i=t.first+t.size)&&(e=new R(i,e.ch,e.sticky),u=E(t,i))}function s(i){var s;if(s=r?vo(t.cm,u,e,n):go(u,e,n),null==s){if(i||!o())return!1;e=mo(r,t.cm,u,e.line,n)}else e=s;return!0}var a=e,l=n,u=E(t,e.line);if("char"==i)s();else if("column"==i)s(!0);else if("word"==i||"group"==i)for(var c=null,h="group"==i,f=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(n<0)||s(!d);d=!1){var p=u.text.charAt(e.ch)||"\n",g=_(p,f)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||d||g||(g="s"),c&&c!=g){n<0&&(n=1,s(),e.sticky="after");break}if(g&&(c=g),n>0&&!s(!d))break}var m=Er(t,e,a,l,!0);return z(a,m)&&(m.hitSide=!0),m}function ss(t,e,n,i){var r,o=t.doc,s=e.left;if("page"==i){var a=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(a-.5*wn(t.display),3);r=(n>0?e.bottom:e.top)+n*l}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(var u;u=dn(t,s,r),u.outside;){if(n<0?r<=0:r>=o.height){u.hitSide=!0;break}r+=5*n}return u}function as(t,e){var n=Ve(t,e.line);if(!n||n.hidden)return null;var i=E(t.doc,e.line),r=Ue(n,i,e.line),o=St(i,t.doc.direction),s="left";if(o){var a=kt(o,e.ch);s=a%2?"right":"left"}var l=Xe(r.map,e.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function ls(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function us(t,e){return e&&(t.bad=!0),t}function cs(t,e,n,i,r){function o(t){return function(e){return e.id==t}}function s(){c&&(u+=h,f&&(u+=h),c=f=!1)}function a(t){t&&(s(),u+=t)}function l(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void a(n);var u,d=e.getAttribute("cm-marker");if(d){var p=t.findMarks(R(i,0),R(r+1,0),o(+d));return void(p.length&&(u=p[0].find(0))&&a(P(t.doc,u.from,u.to).join(h)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&s();for(var m=0;m=15&&(Ts=!1,ks=!0);var zs,js=Ls&&(Ss||Ts&&(null==Ns||Ns<12.11)),$s=vs||_s&&xs>=9,Hs=function(e,n){var i=e.className,r=t(n).exec(i);if(r){var o=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(o?r[1]+o:"")}};zs=document.createRange?function(t,e,n,i){var r=document.createRange();return r.setEnd(i||t,n),r.setStart(t,e),r}:function(t,e,n){var i=document.body.createTextRange();try{i.moveToElementText(t.parentNode)}catch(r){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",e),i};var Fs=function(t){t.select()};Ms?Fs=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:_s&&(Fs=function(t){try{t.select()}catch(e){}});var Ws=function(){this.id=null};Ws.prototype.set=function(t,e){clearTimeout(this.id),this.id=setTimeout(e,t)};var Bs,Us,qs=30,Ys={toString:function(){return"CodeMirror.Pass"}},Vs={scroll:!1},Ks={origin:"*mouse"},Gs={origin:"+move"},Xs=[""],Js=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Zs=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Qs=!1,ta=!1,ea=null,na=function(){function t(t){return t<=247?n.charAt(t):1424<=t&&t<=1524?"R":1536<=t&&t<=1785?i.charAt(t-1536):1774<=t&&t<=2220?"r":8192<=t&&t<=8203?"w":8204==t?"b":"L"}function e(t,e,n){this.level=t,this.from=e,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",i="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,s=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;return function(n,i){var u="ltr"==i?"L":"R";if(0==n.length||"ltr"==i&&!r.test(n))return!1;for(var c=n.length,h=[],f=0;f=this.string.length},da.prototype.sol=function(){return this.pos==this.lineStart},da.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},da.prototype.next=function(){if(this.pose},da.prototype.eatSpace=function(){for(var t=this,e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++t.pos;return this.pos>e},da.prototype.skipToEnd=function(){this.pos=this.string.length},da.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},da.prototype.backUp=function(t){this.pos-=t},da.prototype.column=function(){return this.lastColumnPos0?null:(i&&e!==!1&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(r(o)==r(t))return e!==!1&&(this.pos+=t.length),!0},da.prototype.current=function(){return this.string.slice(this.start,this.pos)},da.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},da.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},da.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var pa=function(t,e){this.state=t,this.lookAhead=e},ga=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};ga.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ga.prototype.baseToken=function(t){var e=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)e.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ga.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ga.fromSaved=function(t,e,n){return e instanceof pa?new ga(t,Yt(t.mode,e.state),n,e.lookAhead):new ga(t,Yt(t.mode,e),n)},ga.prototype.save=function(t){var e=t!==!1?Yt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pa(e,this.maxLookAhead):e};var ma=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n},va=function(t,e,n){this.text=t,it(this,e),this.height=n?n(this):1};va.prototype.lineNo=function(){return A(this)},At(va);var ya,ba={},wa={},_a=null,xa=null,ka={left:0,right:0,top:0,bottom:0},Sa=function(t,e,n){this.cm=n;var r=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,t(r),t(o),ra(r,"scroll",function(){r.clientHeight&&e(r.scrollTop,"vertical")}),ra(o,"scroll",function(){o.clientWidth&&e(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,_s&&xs<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Sa.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},Sa.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Sa.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Sa.prototype.zeroWidthHack=function(){var t=Ls&&!Ps?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ws,this.disableVert=new Ws},Sa.prototype.enableZeroWidthBar=function(t,e,n){function i(){var r=t.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);o!=t?t.style.pointerEvents="none":e.set(1e3,i)}t.style.pointerEvents="auto",e.set(1e3,i)},Sa.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Ca=function(){};Ca.prototype.update=function(){return{bottom:0,right:0}},Ca.prototype.setScrollLeft=function(){},Ca.prototype.setScrollTop=function(){},Ca.prototype.clear=function(){};var Ta={"native":Sa,"null":Ca},Ea=0,Pa=function(t,e,n){var i=t.display;this.viewport=e,this.visible=Hn(i,t.doc,e),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Fe(t),this.force=n,this.dims=xn(t),this.events=[]};Pa.prototype.signal=function(t,e){Mt(t,e)&&this.events.push(arguments)},Pa.prototype.finish=function(){for(var t=this,e=0;e=0&&N(t,r.to())<=0)return i}return-1};var Da=function(t,e){this.anchor=t,this.head=e};Da.prototype.from=function(){return H(this.anchor,this.head)},Da.prototype.to=function(){return $(this.anchor,this.head)},Da.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Wr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=this,i=t,r=t+e;i1||!(this.children[0]instanceof Wr))){var l=[];this.collapse(l),this.children=[new Wr(l)],this.children[0].parent=this}},collapse:function(t){for(var e=this,n=0;n50){for(var a=o.lines.length%25+25,l=a;l10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=this,r=0;re.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&yi(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Sr(e.doc)),e&&_e(e,"markerCleared",e,this,r,o),n&&ai(e),this.parent&&this.parent.clear()}},Ra.prototype.find=function(t,e){var n=this;null==t&&"bookmark"==this.type&&(t=1);for(var i,r,o=0;o=0;u--)Ar(i,r[u]);l?wr(this,l):this.cm&&Kn(this.cm)}),undo:vi(function(){Lr(this,"undo")}),redo:vi(function(){Lr(this,"redo")}),undoSelection:vi(function(){Lr(this,"undo",!0)}),redoSelection:vi(function(){Lr(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=W(this,t),e=W(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r}),i},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var i=0;it?(e=t,!0):(t-=o,void++n)}),W(this,R(n,e))},indexFromPos:function(t){t=W(this,t);var e=t.ch;if(t.linee&&(e=t.from),null!=t.to&&t.to0)r=new R(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),R(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var s=E(t.doc,r.line-1).text;s&&(r=new R(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),R(r.line-1,s.length-1),r,"+transpose"))}n.push(new Da(r,r))}t.setSelections(n)})},newlineAndIndent:function(t){return pi(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;it&&0==N(e,this.pos)&&n==this.button};var Ja,Za,Qa={toString:function(){return"CodeMirror.Init"}},tl={},el={};Go.defaults=tl,Go.optionHandlers=el;var nl=[];Go.defineInitHook=function(t){return nl.push(t)};var il=null,rl=function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var i=this.options,r=i[t];i[t]==n&&"mode"!=t||(i[t]=n,e.hasOwnProperty(t)&&gi(this,e[t])(this,n,r),Et(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](ho(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;ni&&(Jo(e,o.head.line,t,!0),i=o.head.line,r==e.doc.sel.primIndex&&Kn(e));else{var s=o.from(),a=o.to(),l=Math.max(i,s.line);i=Math.min(e.lastLine(),a.line-(a.ch?0:1))+1;for(var u=l;u0&&vr(e.doc,r,new Da(s,c[r].to()),Vs)}}}),getTokenAt:function(t,e){return ee(this,t,e)},getLineTokens:function(t,e){return ee(this,R(t),e,!0)},getTokenTypeAt:function(t){t=W(this.doc,t);var e,n=Xt(this,E(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]o&&(t=o,r=!0),i=E(this.doc,t)}else i=t;return an(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-bt(i):0)},defaultTextHeight:function(){return wn(this.display)},defaultCharWidth:function(){return _n(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o=this.display;t=cn(this,W(this.doc,t));var s=t.bottom,a=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==i)s=t.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?s=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(s=t.bottom),a+e.offsetWidth>u&&(a=u-e.offsetWidth)}e.style.top=s+"px",e.style.left=e.style.right="","right"==r?(a=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?a=0:"middle"==r&&(a=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=a+"px"),n&&qn(this,{left:a,top:s,right:a+e.offsetWidth,bottom:s+e.offsetHeight})},triggerOnKeyDown:mi(Eo),triggerOnKeyPress:mi(Mo),triggerOnKeyUp:Oo,triggerOnMouseDown:mi(Do),execCommand:function(t){if(Ya.hasOwnProperty(t))return Ya[t].call(null,this)},triggerElectric:mi(function(t){es(this,t)}),findPosH:function(t,e,n,i){var r=this,o=1;e<0&&(o=-1,e=-e);for(var s=W(this.doc,t),a=0;a0&&a(n.charAt(i-1));)--i;for(;r.5)&&Cn(this),Et(this,"refresh",this)}),swapDoc:mi(function(t){var e=this.doc;return e.cm=null,Zi(this,t),nn(this),this.display.input.reset(),Gn(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,_e(this,"swapDoc",this,e),e}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},At(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,o){t.registerHelper(e,i,o),n[e]._global.push({pred:r,val:o})}},ol=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ws,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ol.prototype.init=function(t){function e(t){if(!Pt(r,t)){if(r.somethingSelected())Zo({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=ns(r);Zo({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation(function(){r.setSelections(e.ranges,0,Vs),r.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var n=il.text.join("\n");if(t.clipboardData.setData("Text",n),t.clipboardData.getData("Text")==n)return void t.preventDefault()}var s=rs(),a=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),a.value=il.text.join("\n");var l=document.activeElement;Fs(a),setTimeout(function(){r.display.lineSpace.removeChild(s),l.focus(),l==o&&i.showPrimarySelection()},50)}}var n=this,i=this,r=i.cm,o=i.div=t.lineDiv;is(o,r.options.spellcheck),ra(o,"paste",function(t){Pt(r,t)||ts(t,r)||xs<=11&&setTimeout(gi(r,function(){return n.updateFromDOM()}),20)}),ra(o,"compositionstart",function(t){n.composing={data:t.data,done:!1}}),ra(o,"compositionupdate",function(t){n.composing||(n.composing={data:t.data,done:!1})}),ra(o,"compositionend",function(t){n.composing&&(t.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),ra(o,"touchstart",function(){return i.forceCompositionEnd()}),ra(o,"input",function(){n.composing||n.readFromDOMSoon()}),ra(o,"copy",e),ra(o,"cut",e)},ol.prototype.prepareSelection=function(){var t=On(this.cm,!1);return t.focus=this.cm.state.focused,t},ol.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},ol.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ol.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,n=e.doc.sel.primary(),i=n.from(),r=n.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||r.line=e.display.viewFrom&&as(e,i)||{node:a[0].measure.map[2],offset:0},u=r.linet.firstLine()&&(i=R(i.line-1,E(t.doc,i.line-1).length)),r.ch==E(t.doc,r.line).text.length&&r.linee.viewTo-1)return!1;var o,s,a;i.line==e.viewFrom||0==(o=En(t,i.line))?(s=A(e.view[0].line),a=e.view[0].node):(s=A(e.view[o].line),a=e.view[o-1].node.nextSibling);var l,u,c=En(t,r.line);if(c==e.view.length-1?(l=e.viewTo-1,u=e.lineDiv.lastChild):(l=A(e.view[c+1].line)-1,u=e.view[c+1].node.previousSibling),!a)return!1;for(var h=t.doc.splitLines(cs(t,a,u,s,l)),f=P(t.doc,R(s,0),R(l,E(t.doc,l).text.length));h.length>1&&f.length>1;)if(g(h)==g(f))h.pop(),f.pop(),l--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),s++}for(var d=0,p=0,m=h[0],v=f[0],y=Math.min(m.length,v.length);di.ch&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)d--,p++;h[h.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var x=R(s,d),k=R(l,f.length?g(f).length-p:0);return h.length>1||h[0]||N(x,k)?(zr(t.doc,h,x,k,"+input"),!0):void 0},ol.prototype.ensurePolled=function(){this.forceCompositionEnd()},ol.prototype.reset=function(){this.forceCompositionEnd()},ol.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ol.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},ol.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||pi(this.cm,function(){return yi(t.cm)})},ol.prototype.setUneditable=function(t){t.contentEditable="false"},ol.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||gi(this.cm,Qo)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},ol.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},ol.prototype.onContextMenu=function(){},ol.prototype.resetPosition=function(){},ol.prototype.needsContentAttribute=!0;var sl=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new Ws,this.hasSelection=!1,this.composing=null};sl.prototype.init=function(t){function e(t){if(!Pt(r,t)){if(r.somethingSelected())Zo({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=ns(r);Zo({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,Vs):(i.prevInput="",o.value=e.text.join("\n"),Fs(o))}"cut"==t.type&&(r.state.cutIncoming=!0)}}var n=this,i=this,r=this.cm;this.createField(t);var o=this.textarea;t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),Ms&&(o.style.width="0px"),ra(o,"input",function(){_s&&xs>=9&&n.hasSelection&&(n.hasSelection=null),i.poll()}),ra(o,"paste",function(t){Pt(r,t)||ts(t,r)||(r.state.pasteIncoming=!0,i.fastPoll())}),ra(o,"cut",e),ra(o,"copy",e),ra(t.scroller,"paste",function(e){Ne(t,e)||Pt(r,e)||(r.state.pasteIncoming=!0,i.focus())}),ra(t.lineSpace,"selectstart",function(e){Ne(t,e)||Dt(e)}),ra(o,"compositionstart",function(){var t=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ra(o,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},sl.prototype.createField=function(t){this.wrapper=rs(),this.textarea=this.wrapper.firstChild},sl.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=On(t);if(t.options.moveInputWithCursor){var r=cn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},sl.prototype.showSelection=function(t){var e=this.cm,i=e.display;n(i.cursorDiv,t.cursors),n(i.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},sl.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&Fs(this.textarea),_s&&xs>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",_s&&xs>=9&&(this.hasSelection=null))}},sl.prototype.getField=function(){return this.textarea},sl.prototype.supportsTouch=function(){return!1},sl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Ds||s()!=this.textarea))try{this.textarea.focus()}catch(t){}},sl.prototype.blur=function(){this.textarea.blur()},sl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},sl.prototype.receivedFocus=function(){this.slowPoll()},sl.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},sl.prototype.fastPoll=function(){function t(){var i=n.poll();i||e?(n.pollingFast=!1,n.slowPoll()):(e=!0,n.polling.set(60,t))}var e=!1,n=this;n.pollingFast=!0,n.polling.set(20,t)},sl.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||aa(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(_s&&xs>=9&&this.hasSelection===r||Ls&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,a=Math.min(i.length,r.length);s1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},sl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},sl.prototype.onKeyPress=function(){_s&&xs>=9&&(this.hasSelection=null),this.fastPoll()},sl.prototype.onContextMenu=function(t){function e(){if(null!=s.selectionStart){var t=r.somethingSelected(),e="​"+(t?s.value:"");s.value="⇚",s.value=e,i.prevInput=t?"":"​",s.selectionStart=1,s.selectionEnd=e.length,o.selForContextMenu=r.doc.sel}}function n(){if(i.contextMenuPending=!1,i.wrapper.style.cssText=h,s.style.cssText=c,_s&&xs<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=s.selectionStart){(!_s||_s&&xs<9)&&e();var t=0,n=function(){o.selForContextMenu==r.doc.sel&&0==s.selectionStart&&s.selectionEnd>0&&"​"==i.prevInput?gi(r,Or)(r):t++<10?o.detectingSelectAll=setTimeout(n,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(n,200)}}var i=this,r=i.cm,o=r.display,s=i.textarea,a=Tn(r,t),l=o.scroller.scrollTop;if(a&&!Ts){var u=r.options.resetSelectionOnContextMenu;u&&r.doc.sel.contains(a)==-1&&gi(r,_r)(r.doc,Fi(a),Vs);var c=s.style.cssText,h=i.wrapper.style.cssText;i.wrapper.style.cssText="position: absolute";var f=i.wrapper.getBoundingClientRect();s.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-f.top-5)+"px; left: "+(t.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(_s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var d;if(ks&&(d=window.scrollY),o.input.focus(),ks&&window.scrollTo(null,d),o.input.reset(),r.somethingSelected()||(s.value=i.prevInput=" "),i.contextMenuPending=!0,o.selForContextMenu=r.doc.sel,clearTimeout(o.detectingSelectAll),_s&&xs>=9&&e(),$s){Rt(t);var p=function(){Tt(window,"mouseup",p),setTimeout(n,20)};ra(window,"mouseup",p)}else setTimeout(n,50)}},sl.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},sl.prototype.setUneditable=function(){},sl.prototype.needsContentAttribute=!1,qo(Go),rl(Go);var al="iter insert remove copy getEditor constructor".split(" ");for(var ll in ja.prototype)ja.prototype.hasOwnProperty(ll)&&f(al,ll)<0&&(Go.prototype[ll]=function(t){return function(){return t.apply(this.doc,arguments)}}(ja.prototype[ll]));return At(ja),Go.inputStyles={textarea:sl,contenteditable:ol},Go.defineMode=function(t){Go.defaults.mode||"null"==t||(Go.defaults.mode=t),Ft.apply(this,arguments)},Go.defineMIME=Wt,Go.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Go.defineMIME("text/plain","null"),Go.defineExtension=function(t,e){Go.prototype[t]=e},Go.defineDocExtension=function(t,e){ja.prototype[t]=e},Go.fromTextArea=ds,ps(Go),Go.version="5.38.0",Go}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t){var e=t.flags;return null!=e?e:(t.ignoreCase?"i":"")+(t.global?"g":"")+(t.multiline?"m":"")}function n(t,n){for(var i=e(t),r=i,o=0;ou);c++){var h=t.getLine(l++);s=null==s?h:s+"\n"+h}a=2*a,e.lastIndex=o.ch;var f=e.exec(s);if(f){var d=s.slice(0,f.index).split("\n"),p=f[0].split("\n"),m=o.line+d.length-1,v=d[d.length-1].length;return{from:g(m,v),to:g(m+p.length-1,1==p.length?v+p[0].length:p[p.length-1].length),match:f}}}}function s(t,e){for(var n,i=0;;){e.lastIndex=i;var r=e.exec(t);if(!r)return n;if(n=r,i=n.index+(n[0].length||1),i==t.length)return n}}function a(t,e,i){e=n(e,"g");for(var r=i.line,o=i.ch,a=t.firstLine();r>=a;r--,o=-1){var l=t.getLine(r);o>-1&&(l=l.slice(0,o));var u=s(l,e);if(u)return{from:g(r,u.index),to:g(r,u.index+u[0].length),match:u}}}function l(t,e,i){e=n(e,"gm");for(var r,o=1,a=i.line,l=t.firstLine();a>=l;){for(var u=0;u>1,a=i(t.slice(0,s)).length;if(a==n)return s;a>n?o=s:r=s+1}}function c(t,e,n,i){if(!e.length)return null;var r=i?d:p,o=r(e).split(/\r|\n\r?/);t:for(var s=n.line,a=n.ch,l=t.lastLine()+1-o.length;s<=l;s++,a=0){var c=t.getLine(s).slice(a),h=r(c);if(1==o.length){var f=h.indexOf(o[0]);if(f==-1)continue t;var n=u(c,h,f,r)+a;return{from:g(s,u(c,h,f,r)+a),to:g(s,u(c,h,f+o[0].length,r)+a)}}var m=h.length-o[0].length;if(h.slice(m)==o[0]){for(var v=1;v=l;s--,a=-1){var c=t.getLine(s);a>-1&&(c=c.slice(0,a));var h=r(c);if(1==o.length){var f=h.lastIndexOf(o[0]);if(f==-1)continue t;return{from:g(s,u(c,h,f,r)),to:g(s,u(c,h,f+o[0].length,r))}}var m=o[o.length-1];if(h.slice(0,m.length)==m){for(var v=1,n=s-o.length+1;v0);)i.push({anchor:r.from(),head:r.to()});i.length&&this.setSelections(i,0)})}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){return"string"==typeof t?t=new RegExp(t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),e?"gi":"g"):t.global||(t=new RegExp(t.source,t.ignoreCase?"gi":"g")),{token:function(e){t.lastIndex=e.pos;var n=t.exec(e.string);return n&&n.index==e.pos?(e.pos+=n[0].length||1,"searching"):void(n?e.pos=n.index:e.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function i(t){return t.state.search||(t.state.search=new n)}function r(t){return"string"==typeof t&&t==t.toLowerCase()}function o(t,e,n){return t.getSearchCursor(e,n,{caseFold:r(e),multiline:!0})}function s(t,e,n,i,r){t.openDialog(e,i,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(t)},onKeyDown:r})}function a(t,e,n,i,r){t.openDialog?t.openDialog(e,r,{value:i,selectValueOnOpen:!0}):r(prompt(n,i))}function l(t,e,n,i){t.openConfirm?t.openConfirm(e,i):confirm(n)&&i[0]()}function u(t){return t.replace(/\\(.)/g,function(t,e){return"n"==e?"\n":"r"==e?"\r":e})}function c(t){var e=t.match(/^\/(.*)\/([a-z]*)$/);if(e)try{t=new RegExp(e[1],e[2].indexOf("i")==-1?"":"i")}catch(n){}else t=u(t);return("string"==typeof t?""==t:t.test(""))&&(t=/x^/),t}function h(t,n,i){n.queryText=i,n.query=c(i),t.removeOverlay(n.overlay,r(n.query)),n.overlay=e(n.query,r(n.query)),t.addOverlay(n.overlay),t.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=t.showMatchesOnScrollbar(n.query,r(n.query)))}function f(e,n,r,o){var l=i(e);if(l.query)return d(e,n);var u=e.getSelection()||l.lastQuery;if(u instanceof RegExp&&"x^"==u.source&&(u=null),r&&e.openDialog){var c=null,f=function(n,i){t.e_stop(i),n&&(n!=l.queryText&&(h(e,l,n),l.posFrom=l.posTo=e.getCursor()),c&&(c.style.opacity=1),d(e,i.shiftKey,function(t,n){var i;n.line<3&&document.querySelector&&(i=e.display.wrapper.querySelector(".CodeMirror-dialog"))&&i.getBoundingClientRect().bottom-4>e.cursorCoords(n,"window").top&&((c=i).style.opacity=.4)}))};s(e,v,u,f,function(n,r){var o=t.keyName(n),s=e.getOption("extraKeys"),a=s&&s[o]||t.keyMap[e.getOption("keyMap")][o];"findNext"==a||"findPrev"==a||"findPersistentNext"==a||"findPersistentPrev"==a?(t.e_stop(n),h(e,i(e),r),e.execCommand(a)):"find"!=a&&"findPersistent"!=a||(t.e_stop(n),f(r,n))}),o&&u&&(h(e,l,u),d(e,n))}else a(e,v,"Search for:",u,function(t){t&&!l.query&&e.operation(function(){h(e,l,t),l.posFrom=l.posTo=e.getCursor(),d(e,n)})})}function d(e,n,r){e.operation(function(){var s=i(e),a=o(e,s.query,n?s.posFrom:s.posTo);(a.find(n)||(a=o(e,s.query,n?t.Pos(e.lastLine()):t.Pos(e.firstLine(),0)),a.find(n)))&&(e.setSelection(a.from(),a.to()),e.scrollIntoView({from:a.from(),to:a.to()},20),s.posFrom=a.from(),s.posTo=a.to(),r&&r(a.from(),a.to()))})}function p(t){t.operation(function(){var e=i(t);e.lastQuery=e.query,e.query&&(e.query=e.queryText=null,t.removeOverlay(e.overlay),e.annotate&&(e.annotate.clear(),e.annotate=null))})}function g(t,e,n){t.operation(function(){for(var i=o(t,e);i.findNext();)if("string"!=typeof e){var r=t.getRange(i.from(),i.to()).match(e);i.replace(n.replace(/\$(\d)/g,function(t,e){return r[e]}))}else i.replace(n)})}function m(t,e){if(!t.getOption("readOnly")){var n=t.getSelection()||i(t).lastQuery,r=''+(e?"Replace all:":"Replace:")+"";a(t,r+y,r,n,function(n){n&&(n=c(n),a(t,b,"Replace with:","",function(i){if(i=u(i),e)g(t,n,i);else{p(t);var r=o(t,n,t.getCursor("from")),s=function(){var e,u=r.from();!(e=r.findNext())&&(r=o(t,n),!(e=r.findNext())||u&&r.from().line==u.line&&r.from().ch==u.ch)||(t.setSelection(r.from(),r.to()),t.scrollIntoView({from:r.from(),to:r.to()}),l(t,w,"Replace?",[function(){a(e)},s,function(){g(t,n,i)}]))},a=function(t){r.replace("string"==typeof n?i:i.replace(/\$(\d)/g,function(e,n){return t[n]})),s()};s()}}))})}}var v='Search: (Use /re/ syntax for regexp search)',y=' (Use /re/ syntax for regexp search)',b='With: ',w='Replace? ';t.commands.find=function(t){p(t),f(t)},t.commands.findPersistent=function(t){p(t),f(t,!1,!0)},t.commands.findPersistentNext=function(t){f(t,!1,!0,!0)},t.commands.findPersistentPrev=function(t){f(t,!0,!0,!0)},t.commands.findNext=f,t.commands.findPrev=function(t){f(t,!0)},t.commands.clearSearch=p,t.commands.replace=m,t.commands.replaceAll=function(t){m(t,!0)}}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){function e(e,n,i){var r,o=e.getWrapperElement();return r=o.appendChild(document.createElement("div")),i?r.className="CodeMirror-dialog CodeMirror-dialog-bottom":r.className="CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?r.innerHTML=n:r.appendChild(n),t.addClass(o,"dialog-opened"),r}function n(t,e){t.state.currentNotificationClose&&t.state.currentNotificationClose(),t.state.currentNotificationClose=e}t.defineExtension("openDialog",function(i,r,o){function s(e){if("string"==typeof e)h.value=e;else{if(u)return;u=!0,t.rmClass(l.parentNode,"dialog-opened"),l.parentNode.removeChild(l),c.focus(),o.onClose&&o.onClose(l)}}o||(o={}),n(this,null);var a,l=e(this,i,o.bottom),u=!1,c=this,h=l.getElementsByTagName("input")[0];return h?(h.focus(),o.value&&(h.value=o.value,o.selectValueOnOpen!==!1&&h.select()),o.onInput&&t.on(h,"input",function(t){o.onInput(t,h.value,s)}),o.onKeyUp&&t.on(h,"keyup",function(t){o.onKeyUp(t,h.value,s)}),t.on(h,"keydown",function(e){o&&o.onKeyDown&&o.onKeyDown(e,h.value,s)||((27==e.keyCode||o.closeOnEnter!==!1&&13==e.keyCode)&&(h.blur(),t.e_stop(e),s()),13==e.keyCode&&r(h.value,e))}),o.closeOnBlur!==!1&&t.on(h,"blur",s)):(a=l.getElementsByTagName("button")[0])&&(t.on(a,"click",function(){s(),c.focus()}),o.closeOnBlur!==!1&&t.on(a,"blur",s),a.focus()),s}),t.defineExtension("openConfirm",function(i,r,o){function s(){u||(u=!0,t.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),c.focus())}n(this,null);var a=e(this,i,o&&o.bottom),l=a.getElementsByTagName("button"),u=!1,c=this,h=1;l[0].focus();for(var f=0;f=0&&a[r.text.charAt(o)]||a[r.text.charAt(++o)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(i&&i.strict&&c>0!=(o==e.ch))return null;var h=t.getTokenTypeAt(s(e.line,o+1)),f=n(t,s(e.line,o+(c>0?1:0)),c,h||null,i);return null==f?null:{from:s(e.line,o),to:f&&f.pos,match:f&&f.ch==u.charAt(0),forward:c>0}}function n(t,e,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,l=r&&r.maxScanLines||1e3,u=[],c=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,h=n>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),f=e.line;f!=h;f+=n){var d=t.getLine(f);if(d){var p=n>0?0:d.length-1,g=n>0?d.length:-1;if(!(d.length>o))for(f==e.line&&(p=e.ch-(n<0?1:0));p!=g;p+=n){var m=d.charAt(p);if(c.test(m)&&(void 0===i||t.getTokenTypeAt(s(f,p+1))==i)){var v=a[m];if(">"==v.charAt(1)==n>0)u.push(m);else{if(!u.length)return{pos:s(f,p),ch:m};u.pop()}}}}}return f-n!=(n>0?t.lastLine():t.firstLine())&&null}function i(t,n,i){for(var r=t.state.matchBrackets.maxHighlightLineLength||1e3,a=[],l=t.listSelections(),u=0;u",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};t.defineOption("matchBrackets",!1,function(e,n,i){i&&i!=t.Init&&(e.off("cursorActivity",r),e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)),n&&(e.state.matchBrackets="object"==typeof n?n:{},e.on("cursorActivity",r))}),t.defineExtension("matchBrackets",function(){i(this,!0)}),t.defineExtension("findMatchingBracket",function(t,n,i){return(i||"boolean"==typeof n)&&(i?(i.strict=n,n=i):n=n?{strict:!0}:null),e(this,t,n)}),t.defineExtension("scanForBracket",function(t,e,i,r){return n(this,t,e,i,r)})}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){function e(t,e){return"pairs"==e&&"string"==typeof t?t:"object"==typeof t&&null!=t[e]?t[e]:f[e]}function n(t){for(var e=0;e=0;a--){var u=s[a].head;n.replaceRange("",d(u.line,u.ch-1),d(u.line,u.ch+1),"+delete")}}function s(n){var i=r(n),o=i&&e(i,"explode");if(!o||n.getOption("disableInput"))return t.Pass;for(var s=n.listSelections(),a=0;a0;return{anchor:new d(e.anchor.line,e.anchor.ch+(n?-1:1)),head:new d(e.head.line,e.head.ch+(n?1:-1))}}function l(n,i){var o=r(n);if(!o||n.getOption("disableInput"))return t.Pass;var s=e(o,"pairs"),l=s.indexOf(i);if(l==-1)return t.Pass;for(var c,f=e(o,"triples"),p=s.charAt(l+1)==i,g=n.listSelections(),m=l%2==0,v=0;v1&&f.indexOf(i)>=0&&n.getRange(d(w.line,w.ch-2),w)==i+i){if(w.ch>2&&/\bstring/.test(n.getTokenTypeAt(d(w.line,w.ch-2))))return t.Pass;y="addFour"}else if(p){var x=0==w.ch?" ":n.getRange(d(w.line,w.ch-1),w);if(t.isWordChar(_)||x==i||t.isWordChar(x))return t.Pass;y="both"}else{if(!m||n.getLine(w.line).length!=w.ch&&!u(_,s)&&!/\s/.test(_))return t.Pass;y="both"}else y=p&&h(n,w)?"both":f.indexOf(i)>=0&&n.getRange(w,d(w.line,w.ch+3))==i+i+i?"skipThree":"skip";if(c){if(c!=y)return t.Pass}else c=y}var k=l%2?s.charAt(l-1):i,S=l%2?i:s.charAt(l+1);n.operation(function(){if("skip"==c)n.execCommand("goCharRight");else if("skipThree"==c)for(var t=0;t<3;t++)n.execCommand("goCharRight");else if("surround"==c){for(var e=n.getSelections(),t=0;t-1&&n%2==1}function c(t,e){var n=t.getRange(d(e.line,e.ch-1),d(e.line,e.ch+1));return 2==n.length?n:null}function h(t,e){var n=t.getTokenAt(d(e.line,e.ch+1));return/\bstring/.test(n.type)&&n.start==e.ch&&(0==e.ch||!/\bstring/.test(t.getTokenTypeAt(e)))}var f={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},d=t.Pos;t.defineOption("autoCloseBrackets",!1,function(i,r,o){o&&o!=t.Init&&(i.removeKeyMap(p),i.state.closeBrackets=null),r&&(n(e(r,"pairs")),i.state.closeBrackets=r,i.addKeyMap(p))});var p={Backspace:o,Enter:s};n(f.pairs+"`")}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t){var e=t.search(o);return e==-1?0:e}function n(t,e,n){return/\bstring\b/.test(t.getTokenTypeAt(s(e.line,0)))&&!/^[\'\"\`]/.test(n)}function i(t,e){var n=t.getMode();return n.useInnerComments!==!1&&n.innerMode?t.getModeAt(e):n}var r={},o=/[^\s\u00a0]/,s=t.Pos;t.commands.toggleComment=function(t){t.toggleComment()},t.defineExtension("toggleComment",function(t){t||(t=r);for(var e=this,n=1/0,i=this.listSelections(),o=null,a=i.length-1;a>=0;a--){var l=i[a].from(),u=i[a].to();l.line>=n||(u.line>=n&&(u=s(n,0)),n=l.line,null==o?e.uncomment(l,u,t)?o="un":(e.lineComment(l,u,t),o="line"):"un"==o?e.uncomment(l,u,t):e.lineComment(l,u,t))}}),t.defineExtension("lineComment",function(t,a,l){l||(l=r);var u=this,c=i(u,t),h=u.getLine(t.line);if(null!=h&&!n(u,t,h)){var f=l.lineComment||c.lineComment;if(!f)return void((l.blockCommentStart||c.blockCommentStart)&&(l.fullLines=!0,u.blockComment(t,a,l)));var d=Math.min(0!=a.ch||a.line==t.line?a.line+1:a.line,u.lastLine()+1),p=null==l.padding?" ":l.padding,g=l.commentBlankLines||t.line==a.line;u.operation(function(){if(l.indent){for(var n=null,i=t.line;ia.length)&&(n=a)}for(var i=t.line;ih||a.operation(function(){if(0!=n.fullLines){var i=o.test(a.getLine(h));a.replaceRange(f+c,s(h)),a.replaceRange(u+f,s(t.line,0));var r=n.blockCommentLead||l.blockCommentLead;if(null!=r)for(var d=t.line+1;d<=h;++d)(d!=h||i)&&a.replaceRange(r+f,s(d,0))}else a.replaceRange(c,e),a.replaceRange(u,t)})}}),t.defineExtension("uncomment",function(t,e,n){n||(n=r);var a,l=this,u=i(l,t),c=Math.min(0!=e.ch||e.line==t.line?e.line:e.line-1,l.lastLine()),h=Math.min(t.line,c),f=n.lineComment||u.lineComment,d=[],p=null==n.padding?" ":n.padding;t:if(f){for(var g=h;g<=c;++g){var m=l.getLine(g),v=m.indexOf(f);if(v>-1&&!/comment/.test(l.getTokenTypeAt(s(g,v+1)))&&(v=-1),v==-1&&o.test(m))break t;if(v>-1&&o.test(m.slice(0,v)))break t;d.push(m)}if(l.operation(function(){for(var t=h;t<=c;++t){var e=d[t-h],n=e.indexOf(f),i=n+f.length; +n<0||(e.slice(i,i+p.length)==p&&(i+=p.length),a=!0,l.replaceRange("",s(t,n),s(t,i)))}}),a)return!0}var y=n.blockCommentStart||u.blockCommentStart,b=n.blockCommentEnd||u.blockCommentEnd;if(!y||!b)return!1;var w=n.blockCommentLead||u.blockCommentLead,_=l.getLine(h),x=_.indexOf(y);if(x==-1)return!1;var k=c==h?_:l.getLine(c),S=k.indexOf(b,c==h?x+y.length:0),C=s(h,x+1),T=s(c,S+1);if(S==-1||!/comment/.test(l.getTokenTypeAt(C))||!/comment/.test(l.getTokenTypeAt(T))||l.getRange(C,T,"\n").indexOf(b)>-1)return!1;var E=_.lastIndexOf(y,t.ch),P=E==-1?-1:_.slice(0,t.ch).indexOf(b,E+y.length);if(E!=-1&&P!=-1&&P+b.length!=t.ch)return!1;P=k.indexOf(b,e.ch);var O=k.slice(e.ch).lastIndexOf(y,P-e.ch);return E=P==-1||O==-1?-1:e.ch+O,(P==-1||E==-1||E==e.ch)&&(l.operation(function(){l.replaceRange("",s(c,S-(p&&k.slice(S-p.length,S)==p?p.length:0)),s(c,S+b.length));var t=x+y.length;if(p&&_.slice(t,t+p.length)==p&&(t+=p.length),l.replaceRange("",s(h,x),s(h,t)),w)for(var e=h+1;e<=c;++e){var n=l.getLine(e),i=n.indexOf(w);if(i!=-1&&!o.test(n.slice(0,i))){var r=i+w.length;p&&n.slice(r,r+p.length)==p&&(r+=p.length),l.replaceRange("",s(e,i),s(e,r))}}}),!0)})}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,r,o,s){function a(t){var n=l(e,r);if(!n||n.to.line-n.from.linee.firstLine();)r=t.Pos(r.line-1,0),c=a(!1);if(c&&!c.cleared&&"unfold"!==s){var h=n(e,o);t.on(h,"mousedown",function(e){f.clear(),t.e_preventDefault(e)});var f=e.markText(c.from,c.to,{replacedWith:h,clearOnEnter:i(e,o,"clearOnEnter"),__isFold:!0});f.on("clear",function(n,i){t.signal(e,"unfold",e,n,i)}),t.signal(e,"fold",e,c.from,c.to)}}function n(t,e){var n=i(t,e,"widget");if("string"==typeof n){var r=document.createTextNode(n);n=document.createElement("span"),n.appendChild(r),n.className="CodeMirror-foldmarker"}else n&&(n=n.cloneNode(!0));return n}function i(t,e,n){if(e&&void 0!==e[n])return e[n];var i=t.options.foldOptions;return i&&void 0!==i[n]?i[n]:r[n]}t.newFoldFunction=function(t,n){return function(i,r){e(i,r,{rangeFinder:t,widget:n})}},t.defineExtension("foldCode",function(t,n,i){e(this,t,n,i)}),t.defineExtension("isFolded",function(t){for(var e=this.findMarksAt(t),n=0;n=a&&(n=r(o.indicatorOpen))}t.setGutterMarker(e,o.gutter,n),++s})}function s(t){var e=t.getViewport(),n=t.state.foldGutter;n&&(t.operation(function(){o(t,e.from,e.to)}),n.from=e.from,n.to=e.to)}function a(t,e,n){var r=t.state.foldGutter;if(r){var o=r.options;if(n==o.gutter){var s=i(t,e);s?s.clear():t.foldCode(h(e,0),o.rangeFinder)}}}function l(t){var e=t.state.foldGutter;if(e){var n=e.options;e.from=e.to=0,clearTimeout(e.changeUpdate),e.changeUpdate=setTimeout(function(){s(t)},n.foldOnChangeTimeSpan||600)}}function u(t){var e=t.state.foldGutter;if(e){var n=e.options;clearTimeout(e.changeUpdate),e.changeUpdate=setTimeout(function(){var n=t.getViewport();e.from==e.to||n.from-e.to>20||e.from-n.to>20?s(t):t.operation(function(){n.frome.to&&(o(t,e.to,n.to),e.to=n.to)})},n.updateViewportTimeSpan||400)}}function c(t,e){var n=t.state.foldGutter;if(n){var i=e.line;i>=n.from&&ie.lastLine())return null;var i=e.getTokenAt(t.Pos(n,1));if(/\S/.test(i.string)||(i=e.getTokenAt(t.Pos(n,i.end+1))),"keyword"!=i.type||"import"!=i.string)return null;for(var r=n,o=Math.min(e.lastLine(),n+10);r<=o;++r){var s=e.getLine(r),a=s.indexOf(";");if(a!=-1)return{startCh:i.end,end:t.Pos(r,a)}}}var r,o=n.line,s=i(o);if(!s||i(o-1)||(r=i(o-2))&&r.end.line==o-1)return null;for(var a=s.end;;){var l=i(a.line+1);if(null==l)break;a=l.end}return{from:e.clipPos(t.Pos(o,s.startCh+1)),to:a}}),t.registerHelper("fold","include",function(e,n){function i(n){if(ne.lastLine())return null;var i=e.getTokenAt(t.Pos(n,1));return/\S/.test(i.string)||(i=e.getTokenAt(t.Pos(n,i.end+1))),"meta"==i.type&&"#include"==i.string.slice(0,8)?i.start+8:void 0}var r=n.line,o=i(r);if(null==o||null!=i(r-1))return null;for(var s=r;;){var a=i(s+1);if(null==a)break;++s}return{from:t.Pos(r,o+1),to:e.clipPos(t.Pos(s))}})}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){return t.line-e.line||t.ch-e.ch}function n(t,e,n,i){this.line=e,this.ch=n,this.cm=t,this.text=t.getLine(e),this.min=i?Math.max(i.from,t.firstLine()):t.firstLine(),this.max=i?Math.min(i.to-1,t.lastLine()):t.lastLine()}function i(t,e){var n=t.cm.getTokenTypeAt(f(t.line,e));return n&&/\btag\b/.test(n)}function r(t){if(!(t.line>=t.max))return t.ch=0,t.text=t.cm.getLine(++t.line),!0}function o(t){if(!(t.line<=t.min))return t.text=t.cm.getLine(--t.line),t.ch=t.text.length,!0}function s(t){for(;;){var e=t.text.indexOf(">",t.ch);if(e==-1){if(r(t))continue;return}{if(i(t,e+1)){var n=t.text.lastIndexOf("/",e),o=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,o?"selfClose":"regular"}t.ch=e+1}}}function a(t){for(;;){var e=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(e==-1){if(o(t))continue;return}if(i(t,e+1)){g.lastIndex=e,t.ch=e;var n=g.exec(t.text);if(n&&n.index==e)return n}else t.ch=e}}function l(t){for(;;){g.lastIndex=t.ch;var e=g.exec(t.text);if(!e){if(r(t))continue;return}{if(i(t,e.index+1))return t.ch=e.index+e[0].length,e;t.ch=e.index+1}}}function u(t){for(;;){var e=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(e==-1){if(o(t))continue;return}{if(i(t,e+1)){var n=t.text.lastIndexOf("/",e),r=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,r?"selfClose":"regular"}t.ch=e}}}function c(t,e){for(var n=[];;){var i,r=l(t),o=t.line,a=t.ch-(r?r[0].length:0);if(!r||!(i=s(t)))return;if("selfClose"!=i)if(r[1]){for(var u=n.length-1;u>=0;--u)if(n[u]==r[2]){n.length=u;break}if(u<0&&(!e||e==r[2]))return{tag:r[2],from:f(o,a),to:f(t.line,t.ch)}}else n.push(r[2])}}function h(t,e){for(var n=[];;){var i=u(t);if(!i)return;if("selfClose"!=i){var r=t.line,o=t.ch,s=a(t);if(!s)return;if(s[1])n.push(s[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==s[2]){n.length=l;break}if(l<0&&(!e||e==s[2]))return{tag:s[2],from:f(t.line,t.ch),to:f(r,o)}}}else a(t)}}var f=t.Pos,d="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+d+"]["+p+"]*)","g");t.registerHelper("fold","xml",function(t,i){for(var r=new n(t,i.line,0);;){var o=l(r);if(!o||r.line!=i.line)return;var a=s(r);if(!a)return;if(!o[1]&&"selfClose"!=a){var u=f(r.line,r.ch),h=c(r,o[2]);return h&&e(h.from,u)>0?{from:u,to:h.from}:null}}}),t.findMatchingTag=function(t,i,r){var o=new n(t,i.line,i.ch,r);if(o.text.indexOf(">")!=-1||o.text.indexOf("<")!=-1){var l=s(o),u=l&&f(o.line,o.ch),d=l&&a(o);if(l&&d&&!(e(o,i)>0)){var p={from:f(o.line,o.ch),to:u,tag:d[2]};return"selfClose"==l?{open:p,close:null,at:"open"}:d[1]?{open:h(o,d[2]),close:p,at:"close"}:(o=new n(t,u.line,u.ch,r),{open:p,close:c(o,d[2]),at:"open"})}}},t.findEnclosingTag=function(t,e,i,r){for(var o=new n(t,e.line,e.ch,i);;){var s=h(o,r);if(!s)break;var a=new n(t,e.line,e.ch,i),l=c(a,s.tag);if(l)return{open:s,close:l}}},t.scanForClosingTag=function(t,e,i,r){var o=new n(t,e.line,e.ch,r?{from:0,to:r}:null);return c(o,i)}}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.registerHelper("fold","markdown",function(e,n){function i(n){var i=e.getTokenTypeAt(t.Pos(n,0));return i&&/\bheader\b/.test(i)}function r(t,e,n){var r=e&&e.match(/^#+/);return r&&i(t)?r[0].length:(r=n&&n.match(/^[=\-]+\s*$/),r&&i(t+1)?"="==n[0]?1:2:o)}var o=100,s=e.getLine(n.line),a=e.getLine(n.line+1),l=r(n.line,s,a);if(l!==o){for(var u=e.lastLine(),c=n.line,h=e.getLine(c+2);c"))return r("=>","operator");if("0"==n&&t.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return r("number","number");if(/\d/.test(n))return t.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),r("number","number");if("/"==n)return t.eat("*")?(e.tokenize=a,a(t,e)):t.eat("/")?(t.skipToEnd(),r("comment","comment")):zt(t,e,1)?(i(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),r("regexp","string-2")):(t.eat("="),r("operator","operator",t.current()));if("`"==n)return e.tokenize=l,l(t,e);if("#"==n)return t.skipToEnd(),r("error","error");if(Vt.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),r("operator","operator",t.current());if(qt.test(n)){t.eatWhile(qt);var o=t.current();if("."!=e.lastType){if(Yt.propertyIsEnumerable(o)){var u=Yt[o];return r(u.type,u.style,o)}if("async"==o&&t.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return r("async","keyword",o)}return r("variable","variable",o)}}function s(t){return function(e,n){var i,s=!1;if(Wt&&"@"==e.peek()&&e.match(Kt))return n.tokenize=o,r("jsonld-keyword","meta");for(;null!=(i=e.next())&&(i!=t||s);)s=!s&&"\\"==i;return s||(n.tokenize=o),r("string","string")}}function a(t,e){for(var n,i=!1;n=t.next();){if("/"==n&&i){e.tokenize=o;break}i="*"==n}return r("comment","comment")}function l(t,e){for(var n,i=!1;null!=(n=t.next());){if(!i&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=o;break}i=!i&&"\\"==n}return r("quasi","string-2",t.current())}function u(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(Ut){var i=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));i&&(n=i.index)}for(var r=0,o=!1,s=n-1;s>=0;--s){var a=t.string.charAt(s),l=Gt.indexOf(a);if(l>=0&&l<3){if(!r){++s;break}if(0==--r){"("==a&&(o=!0);break}}else if(l>=3&&l<6)++r;else if(qt.test(a))o=!0;else{if(/["'\/]/.test(a))return;if(o&&!r){++s;break}}}o&&!r&&(e.fatArrowAt=s)}}function c(t,e,n,i,r,o){this.indented=t,this.column=e,this.type=n,this.prev=r,this.info=o,null!=i&&(this.align=i)}function h(t,e){for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var i=t.context;i;i=i.prev)for(var n=i.vars;n;n=n.next)if(n.name==e)return!0}function f(t,e,n,i,r){var o=t.cc;for(Jt.state=t,Jt.stream=r,Jt.marked=null,Jt.cc=o,Jt.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;){var s=o.length?o.pop():Bt?O:E;if(s(n,i)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Jt.marked?Jt.marked:"variable"==n&&h(t,i)?"variable-2":e}}}function d(){for(var t=arguments.length-1;t>=0;t--)Jt.cc.push(arguments[t])}function p(){return d.apply(null,arguments),!0}function g(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function m(t){var e=Jt.state;if(Jt.marked="def",e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var i=v(t,e.context);if(null!=i)return void(e.context=i)}else if(!g(t,e.localVars))return void(e.localVars=new w(t,e.localVars));n.globalVars&&!g(t,e.globalVars)&&(e.globalVars=new w(t,e.globalVars))}function v(t,e){if(e){if(e.block){var n=v(t,e.prev);return n?n==e.prev?e:new b(n,e.vars,(!0)):null}return g(t,e.vars)?e:new b(e.prev,new w(t,e.vars),(!1))}return null}function y(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function b(t,e,n){this.prev=t,this.vars=e,this.block=n}function w(t,e){this.name=t,this.next=e}function _(){Jt.state.context=new b(Jt.state.context,Jt.state.localVars,(!1)),Jt.state.localVars=Zt}function x(){Jt.state.context=new b(Jt.state.context,Jt.state.localVars,(!0)),Jt.state.localVars=null}function k(){Jt.state.localVars=Jt.state.context.vars,Jt.state.context=Jt.state.context.prev}function S(t,e){var n=function(){var n=Jt.state,i=n.indented;if("stat"==n.lexical.type)i=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)i=r.indented;n.lexical=new c(i,Jt.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function C(){var t=Jt.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function T(t){function e(n){return n==t?p():";"==t?d():p(e)}return e}function E(t,e){return"var"==t?p(S("vardef",e),lt,T(";"),C):"keyword a"==t?p(S("form"),A,E,C):"keyword b"==t?p(S("form"),E,C):"keyword d"==t?Jt.stream.match(/^\s*$/,!1)?p():p(S("stat"),L,T(";"),C):"debugger"==t?p(T(";")):"{"==t?p(S("}"),x,X,C,k):";"==t?p():"if"==t?("else"==Jt.state.lexical.info&&Jt.state.cc[Jt.state.cc.length-1]==C&&Jt.state.cc.pop()(),p(S("form"),A,E,C,dt)):"function"==t?p(bt):"for"==t?p(S("form"),pt,E,C):"class"==t||Ut&&"interface"==e?(Jt.marked="keyword",p(S("form"),xt,C)):"variable"==t?Ut&&"declare"==e?(Jt.marked="keyword",p(E)):Ut&&("module"==e||"enum"==e||"type"==e)&&Jt.stream.match(/^\s*\w/,!1)?(Jt.marked="keyword","enum"==e?p(It):"type"==e?p(tt,T("operator"),tt,T(";")):p(S("form"),ut,T("{"),S("}"),X,C,C)):Ut&&"namespace"==e?(Jt.marked="keyword",p(S("form"),O,X,C)):Ut&&"abstract"==e?(Jt.marked="keyword",p(E)):p(S("stat"),B):"switch"==t?p(S("form"),A,T("{"),S("}","switch"),x,X,C,C,k):"case"==t?p(O,T(":")):"default"==t?p(T(":")):"catch"==t?p(S("form"),_,P,E,C,k):"export"==t?p(S("stat"),Tt,C):"import"==t?p(S("stat"),Pt,C):"async"==t?p(E):"@"==e?p(O,E):d(S("stat"),O,T(";"),C)}function P(t){if("("==t)return p(wt,T(")"))}function O(t,e){return D(t,e,!1)}function M(t,e){return D(t,e,!0)}function A(t){return"("!=t?d():p(S(")"),O,T(")"),C)}function D(t,e,n){if(Jt.state.fatArrowAt==Jt.stream.start){var i=n?$:j;if("("==t)return p(_,S(")"),K(wt,")"),C,T("=>"),i,k);if("variable"==t)return d(_,ut,T("=>"),i,k)}var r=n?R:I;return Xt.hasOwnProperty(t)?p(r):"function"==t?p(bt,r):"class"==t||Ut&&"interface"==e?(Jt.marked="keyword",p(S("form"),_t,C)):"keyword c"==t||"async"==t?p(n?M:O):"("==t?p(S(")"),L,T(")"),C,r):"operator"==t||"spread"==t?p(n?M:O):"["==t?p(S("]"),Lt,C,r):"{"==t?G(q,"}",null,r):"quasi"==t?d(N,r):"new"==t?p(H(n)):"import"==t?p(O):p()}function L(t){return t.match(/[;\}\)\],]/)?d():d(O)}function I(t,e){return","==t?p(O):R(t,e,!1)}function R(t,e,n){var i=0==n?I:R,r=0==n?O:M;return"=>"==t?p(_,n?$:j,k):"operator"==t?/\+\+|--/.test(e)||Ut&&"!"==e?p(i):Ut&&"<"==e&&Jt.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?p(S(">"),K(tt,">"),C,i):"?"==e?p(O,T(":"),r):p(r):"quasi"==t?d(N,i):";"!=t?"("==t?G(M,")","call",i):"."==t?p(U,i):"["==t?p(S("]"),L,T("]"),C,i):Ut&&"as"==e?(Jt.marked="keyword",p(tt,i)):"regexp"==t?(Jt.state.lastType=Jt.marked="operator",Jt.stream.backUp(Jt.stream.pos-Jt.stream.start-1),p(r)):void 0:void 0}function N(t,e){return"quasi"!=t?d():"${"!=e.slice(e.length-2)?p(N):p(O,z)}function z(t){if("}"==t)return Jt.marked="string-2",Jt.state.tokenize=l,p(N)}function j(t){return u(Jt.stream,Jt.state),d("{"==t?E:O)}function $(t){return u(Jt.stream,Jt.state),d("{"==t?E:M)}function H(t){return function(e){return"."==e?p(t?W:F):"variable"==e&&Ut?p(ot,t?R:I):d(t?M:O)}}function F(t,e){if("target"==e)return Jt.marked="keyword",p(I)}function W(t,e){if("target"==e)return Jt.marked="keyword",p(R)}function B(t){return":"==t?p(C,E):d(I,T(";"),C)}function U(t){if("variable"==t)return Jt.marked="property",p()}function q(t,e){if("async"==t)return Jt.marked="property",p(q);if("variable"==t||"keyword"==Jt.style){if(Jt.marked="property","get"==e||"set"==e)return p(Y);var n;return Ut&&Jt.state.fatArrowAt==Jt.stream.start&&(n=Jt.stream.match(/^\s*:\s*/,!1))&&(Jt.state.fatArrowAt=Jt.stream.pos+n[0].length),p(V)}return"number"==t||"string"==t?(Jt.marked=Wt?"property":Jt.style+" property",p(V)):"jsonld-keyword"==t?p(V):Ut&&y(e)?(Jt.marked="keyword",p(q)):"["==t?p(O,J,T("]"),V):"spread"==t?p(M,V):"*"==e?(Jt.marked="keyword",p(q)):":"==t?d(V):void 0}function Y(t){return"variable"!=t?d(V):(Jt.marked="property",p(bt))}function V(t){return":"==t?p(M):"("==t?d(bt):void 0}function K(t,e,n){function i(r,o){if(n?n.indexOf(r)>-1:","==r){var s=Jt.state.lexical;return"call"==s.info&&(s.pos=(s.pos||0)+1),p(function(n,i){return n==e||i==e?d():d(t)},i)}return r==e||o==e?p():p(T(e))}return function(n,r){return n==e||r==e?p():d(t,i)}}function G(t,e,n){for(var i=3;i"),tt):void 0}function et(t){if("=>"==t)return p(tt)}function nt(t,e){return"variable"==t||"keyword"==Jt.style?(Jt.marked="property",p(nt)):"?"==e?p(nt):":"==t?p(tt):"["==t?p(O,J,T("]"),nt):void 0}function it(t,e){return"variable"==t&&Jt.stream.match(/^\s*[?:]/,!1)||"?"==e?p(it):":"==t?p(tt):d(tt)}function rt(t,e){return"<"==e?p(S(">"),K(tt,">"),C,rt):"|"==e||"."==t||"&"==e?p(tt):"["==t?p(T("]"),rt):"extends"==e||"implements"==e?(Jt.marked="keyword",p(tt)):void 0}function ot(t,e){if("<"==e)return p(S(">"),K(tt,">"),C,rt)}function st(){return d(tt,at)}function at(t,e){if("="==e)return p(tt)}function lt(t,e){return"enum"==e?(Jt.marked="keyword",p(It)):d(ut,J,ht,ft)}function ut(t,e){return Ut&&y(e)?(Jt.marked="keyword",p(ut)):"variable"==t?(m(e),p()):"spread"==t?p(ut):"["==t?G(ut,"]"):"{"==t?G(ct,"}"):void 0}function ct(t,e){return"variable"!=t||Jt.stream.match(/^\s*:/,!1)?("variable"==t&&(Jt.marked="property"),"spread"==t?p(ut):"}"==t?d():p(T(":"),ut,ht)):(m(e),p(ht))}function ht(t,e){if("="==e)return p(M)}function ft(t){if(","==t)return p(lt)}function dt(t,e){if("keyword b"==t&&"else"==e)return p(S("form","else"),E,C)}function pt(t,e){return"await"==e?p(pt):"("==t?p(S(")"),gt,T(")"),C):void 0}function gt(t){return"var"==t?p(lt,T(";"),vt):";"==t?p(vt):"variable"==t?p(mt):d(O,T(";"),vt)}function mt(t,e){return"in"==e||"of"==e?(Jt.marked="keyword",p(O)):p(I,vt)}function vt(t,e){return";"==t?p(yt):"in"==e||"of"==e?(Jt.marked="keyword",p(O)):d(O,T(";"),yt)}function yt(t){")"!=t&&p(O)}function bt(t,e){return"*"==e?(Jt.marked="keyword",p(bt)):"variable"==t?(m(e),p(bt)):"("==t?p(_,S(")"),K(wt,")"),C,Z,E,k):Ut&&"<"==e?p(S(">"),K(st,">"),C,bt):void 0}function wt(t,e){return"@"==e&&p(O,wt),"spread"==t?p(wt):Ut&&y(e)?(Jt.marked="keyword",p(wt)):d(ut,J,ht)}function _t(t,e){return"variable"==t?xt(t,e):kt(t,e)}function xt(t,e){if("variable"==t)return m(e),p(kt)}function kt(t,e){return"<"==e?p(S(">"),K(st,">"),C,kt):"extends"==e||"implements"==e||Ut&&","==t?("implements"==e&&(Jt.marked="keyword"),p(Ut?tt:O,kt)):"{"==t?p(S("}"),St,C):void 0}function St(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||Ut&&y(e))&&Jt.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Jt.marked="keyword",p(St)):"variable"==t||"keyword"==Jt.style?(Jt.marked="property",p(Ut?Ct:bt,St)):"["==t?p(O,J,T("]"),Ut?Ct:bt,St):"*"==e?(Jt.marked="keyword",p(St)):";"==t?p(St):"}"==t?p():"@"==e?p(O,St):void 0}function Ct(t,e){return"?"==e?p(Ct):":"==t?p(tt,ht):"="==e?p(M):d(bt)}function Tt(t,e){return"*"==e?(Jt.marked="keyword",p(Dt,T(";"))):"default"==e?(Jt.marked="keyword",p(O,T(";"))):"{"==t?p(K(Et,"}"),Dt,T(";")):d(E)}function Et(t,e){return"as"==e?(Jt.marked="keyword",p(T("variable"))):"variable"==t?d(M,Et):void 0}function Pt(t){return"string"==t?p():"("==t?d(O):d(Ot,Mt,Dt)}function Ot(t,e){return"{"==t?G(Ot,"}"):("variable"==t&&m(e),"*"==e&&(Jt.marked="keyword"),p(At))}function Mt(t){if(","==t)return p(Ot,Mt)}function At(t,e){if("as"==e)return Jt.marked="keyword",p(Ot)}function Dt(t,e){if("from"==e)return Jt.marked="keyword",p(O)}function Lt(t){return"]"==t?p():d(K(M,"]"))}function It(){return d(S("form"),ut,T("{"),S("}"),K(Rt,"}"),C,C)}function Rt(){return d(ut,ht)}function Nt(t,e){return"operator"==t.lastType||","==t.lastType||Vt.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function zt(t,e,n){return e.tokenize==o&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}var jt,$t,Ht=e.indentUnit,Ft=n.statementIndent,Wt=n.jsonld,Bt=n.json||Wt,Ut=n.typescript,qt=n.wordCharacters||/[\w$\xa1-\uffff]/,Yt=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),i=t("keyword c"),r=t("keyword d"),o=t("operator"),s={type:"atom",style:"atom"};return{"if":t("if"),"while":e,"with":e,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":t("new"),"delete":i,"void":i,"throw":i,"debugger":t("debugger"),"var":t("var"),"const":t("var"),"let":t("var"),"function":t("function"),"catch":t("catch"),"for":t("for"),"switch":t("switch"),"case":t("case"),"default":t("default"),"in":o,"typeof":o,"instanceof":o,"true":s,"false":s,"null":s,undefined:s,NaN:s,Infinity:s,"this":t("this"),"class":t("class"),"super":t("atom"),"yield":i,"export":t("export"),"import":t("import"),"extends":i,await:i}}(),Vt=/[+\-*&%=<>!?|~^@]/,Kt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Gt="([{}])",Xt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Jt={state:null,column:null,marked:null,cc:null},Zt=new w("this",new w("arguments",null));return k.lex=!0,C.lex=!0,{startState:function(t){var e={tokenize:o,lastType:"sof",cc:[],lexical:new c((t||0)-Ht,0,"block",(!1)),localVars:n.localVars,context:n.localVars&&new b(null,null,(!1)),indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),u(t,e)),e.tokenize!=a&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==jt?n:(e.lastType="operator"!=jt||"++"!=$t&&"--"!=$t?jt:"incdec",f(e,n,jt,$t,t))},indent:function(e,i){if(e.tokenize==a)return t.Pass;if(e.tokenize!=o)return 0;var r,s=i&&i.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(i))for(var u=e.cc.length-1;u>=0;--u){var c=e.cc[u];if(c==C)l=l.prev;else if(c!=dt)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(r=e.cc[e.cc.length-1])&&(r==I||r==R)&&!/^[,\.=+\-*:?[\(]/.test(i));)l=l.prev;Ft&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var h=l.type,f=s==h;return"vardef"==h?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==h&&"{"==s?l.indented:"form"==h?l.indented+Ht:"stat"==h?l.indented+(Nt(e,i)?Ft||Ht:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:Ht):l.indented+(/^(?:case|default)\b/.test(i)?Ht:2*Ht)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Bt?null:"/*",blockCommentEnd:Bt?null:"*/",blockCommentContinue:Bt?null:" * ",lineComment:Bt?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Bt?"json":"javascript",jsonldMode:Wt,jsonMode:Bt,expressionAllowed:zt,skipExpression:function(t){var e=t.cc[t.cc.length-1];e!=O&&e!=M||t.cc.pop()}}}),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],t):t(CodeMirror)}(function(t){"use strict";function e(e,n,i){if(i<0&&0==n.ch)return e.clipPos(d(n.line-1));var r=e.getLine(n.line);if(i>0&&n.ch>=r.length)return e.clipPos(d(n.line+1,0));for(var o,s="start",a=n.ch,l=i<0?0:r.length,u=0;a!=l;a+=i,u++){var c=r.charAt(i<0?a-1:a),h="_"!=c&&t.isWordChar(c)?"w":"o";if("w"==h&&c.toUpperCase()==c&&(h="W"),"start"==s)"o"!=h&&(s="in",o=h);else if("in"==s&&o!=h){if("w"==o&&"W"==h&&i<0&&a--,"W"==o&&"w"==h&&i>0){o="w";continue}break}}return d(n.line,a)}function n(t,n){t.extendSelectionsBy(function(i){return t.display.shift||t.doc.extend||i.empty()?e(t.doc,i.head,n):n<0?i.from():i.to()})}function i(e,n){return e.isReadOnly()?t.Pass:(e.operation(function(){for(var t=e.listSelections().length,i=[],r=-1,o=0;o=0;a--){var l=i[o[a]];if(!(u&&t.cmpPos(l.head,u)>0)){var c=r(e,l.head);u=c.from,e.replaceRange(n(c.word),c.from,c.to)}}})}function c(e){var n=e.getCursor("from"),i=e.getCursor("to");if(0==t.cmpPos(n,i)){var o=r(e,n);if(!o.word)return;n=o.from,i=o.to}return{from:n,to:i,query:e.getRange(n,i),word:o}}function h(t,e){var n=c(t);if(n){var i=n.query,r=t.getSearchCursor(i,e?n.to:n.from);(e?r.findNext():r.findPrevious())?t.setSelection(r.from(),r.to()):(r=t.getSearchCursor(i,e?d(t.firstLine(),0):t.clipPos(d(t.lastLine()))),(e?r.findNext():r.findPrevious())?t.setSelection(r.from(),r.to()):n.word&&t.setSelection(n.from,n.to))}}var f=t.commands,d=t.Pos;f.goSubwordLeft=function(t){n(t,-1)},f.goSubwordRight=function(t){n(t,1)},f.scrollLineUp=function(t){var e=t.getScrollInfo();if(!t.somethingSelected()){var n=t.lineAtHeight(e.top+e.clientHeight,"local");t.getCursor().line>=n&&t.execCommand("goLineUp")}t.scrollTo(null,e.top-t.defaultTextHeight())},f.scrollLineDown=function(t){var e=t.getScrollInfo();if(!t.somethingSelected()){var n=t.lineAtHeight(e.top,"local")+1;t.getCursor().line<=n&&t.execCommand("goLineDown")}t.scrollTo(null,e.top+t.defaultTextHeight())},f.splitSelectionByLine=function(t){for(var e=t.listSelections(),n=[],i=0;ir.line&&s==o.line&&0==o.ch||n.push({anchor:s==r.line?r:d(s,0),head:s==o.line?o:d(s)});t.setSelections(n,0)},f.singleSelectionTop=function(t){var e=t.listSelections()[0];t.setSelection(e.anchor,e.head,{scroll:!1})},f.selectLine=function(t){for(var e=t.listSelections(),n=[],i=0;ir?i.push(l,u):i.length&&(i[i.length-1]=u),r=u}e.operation(function(){for(var t=0;te.lastLine()?e.replaceRange("\n"+s,d(e.lastLine()),null,"+swapLine"):e.replaceRange(s+"\n",d(r,0),null,"+swapLine")}e.setSelections(o),e.scrollIntoView()})},f.swapLineDown=function(e){if(e.isReadOnly())return t.Pass;for(var n=e.listSelections(),i=[],r=e.lastLine()+1,o=n.length-1;o>=0;o--){var s=n[o],a=s.to().line+1,l=s.from().line;0!=s.to().ch||s.empty()||a--,a=0;t-=2){var n=i[t],r=i[t+1],o=e.getLine(n);n==e.lastLine()?e.replaceRange("",d(n-1),d(n),"+swapLine"):e.replaceRange("",d(n,0),d(n+1,0),"+swapLine"),e.replaceRange(o+"\n",d(r,0),null,"+swapLine")}e.scrollIntoView()})},f.toggleCommentIndented=function(t){t.toggleComment({indent:!0})},f.joinLines=function(t){for(var e=t.listSelections(),n=[],i=0;i=0;r--){var o=n[r].head,s=e.getRange({line:o.line,ch:0},o),a=t.countColumn(s,null,e.getOption("tabSize")),l=e.findPosH(o,-1,"char",!1);if(s&&!/\S/.test(s)&&a%i==0){var u=new d(o.line,t.findColumn(s,a-i,i));u.ch!=o.ch&&(l=u)}e.replaceRange("",l,o,"+delete")}})},f.delLineRight=function(t){t.operation(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange("",e[n].anchor,d(e[n].to().line),"+delete");t.scrollIntoView()})},f.upcaseAtCursor=function(t){u(t,function(t){return t.toUpperCase()})},f.downcaseAtCursor=function(t){u(t,function(t){return t.toLowerCase()})},f.setSublimeMark=function(t){t.state.sublimeMark&&t.state.sublimeMark.clear(),t.state.sublimeMark=t.setBookmark(t.getCursor())},f.selectToSublimeMark=function(t){var e=t.state.sublimeMark&&t.state.sublimeMark.find();e&&t.setSelection(t.getCursor(),e)},f.deleteToSublimeMark=function(e){var n=e.state.sublimeMark&&e.state.sublimeMark.find();if(n){var i=e.getCursor(),r=n;if(t.cmpPos(i,r)>0){var o=r;r=i,i=o}e.state.sublimeKilled=e.getRange(i,r),e.replaceRange("",i,r)}},f.swapWithSublimeMark=function(t){var e=t.state.sublimeMark&&t.state.sublimeMark.find();e&&(t.state.sublimeMark.clear(),t.state.sublimeMark=t.setBookmark(t.getCursor()),t.setCursor(e))},f.sublimeYank=function(t){null!=t.state.sublimeKilled&&t.replaceSelection(t.state.sublimeKilled,null,"paste")},f.showInCenter=function(t){var e=t.cursorCoords(null,"local");t.scrollTo(null,(e.top+e.bottom)/2-t.getScrollInfo().clientHeight/2)},f.findUnder=function(t){h(t,!0)},f.findUnderPrevious=function(t){h(t,!1)},f.findAllUnder=function(t){var e=c(t);if(e){for(var n=t.getSearchCursor(e.query),i=[],r=-1;n.findNext();)i.push({anchor:n.from(),head:n.to()}),n.from().line<=e.from.line&&n.from().ch<=e.from.ch&&r++;t.setSelections(i,r)}};var g=t.keyMap;g.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F9:"sortLines","Cmd-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},t.normalizeKeyMap(g.macSublime),g.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},t.normalizeKeyMap(g.pcSublime);var m=g["default"]==g.macDefault;g.sublime=m?g.macSublime:g.pcSublime}),!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.moment=e()}(this,function(){"use strict";function t(){return si.apply(null,arguments)}function e(t){si=t}function n(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function i(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function r(t,e){var n,i=[];for(n=0;n0)for(n in li)i=li[n],r=e[i],f(r)||(t[i]=r);return t}function p(e){d(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),ui===!1&&(ui=!0,t.updateOffset(this),ui=!1)}function g(t){return t instanceof p||null!=t&&null!=t._isAMomentObject}function m(t){return 0>t?Math.ceil(t):Math.floor(t)}function v(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=m(e)),n}function y(t,e,n){var i,r=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),s=0;for(i=0;r>i;i++)(n&&t[i]!==e[i]||!n&&v(t[i])!==v(e[i]))&&s++;return s+o}function b(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function w(e,n){var i=!0;return s(function(){return null!=t.deprecationHandler&&t.deprecationHandler(null,e),i&&(b(e+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),i=!1),n.apply(this,arguments)},n)}function _(e,n){null!=t.deprecationHandler&&t.deprecationHandler(e,n),ci[e]||(b(n),ci[e]=!0)}function x(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function k(t){return"[object Object]"===Object.prototype.toString.call(t)}function S(t){var e,n;for(n in t)e=t[n],x(e)?this[n]=e:this["_"+n]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function C(t,e){var n,i=s({},t);for(n in e)o(e,n)&&(k(t[n])&&k(e[n])?(i[n]={},s(i[n],t[n]),s(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);return i}function T(t){null!=t&&this.set(t)}function E(t){return t?t.toLowerCase().replace("_","-"):t}function P(t){for(var e,n,i,r,o=0;o0;){if(i=O(r.slice(0,e).join("-")))return i;if(n&&n.length>=e&&y(r,n,!0)>=e-1)break;e--}o++}return null}function O(t){var e=null;if(!pi[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=fi._abbr,require("./locale/"+t),M(e)}catch(n){}return pi[t]}function M(t,e){var n;return t&&(n=f(e)?L(t):A(t,e),n&&(fi=n)),fi._abbr}function A(t,e){return null!==e?(e.abbr=t,null!=pi[t]?(_("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=C(pi[t]._config,e)):null!=e.parentLocale&&(null!=pi[e.parentLocale]?e=C(pi[e.parentLocale]._config,e):_("parentLocaleUndefined","specified parentLocale is not defined yet")),pi[t]=new T(e),M(t),pi[t]):(delete pi[t],null)}function D(t,e){if(null!=e){var n;null!=pi[t]&&(e=C(pi[t]._config,e)),n=new T(e),n.parentLocale=pi[t],pi[t]=n,M(t)}else null!=pi[t]&&(null!=pi[t].parentLocale?pi[t]=pi[t].parentLocale:null!=pi[t]&&delete pi[t]);return pi[t]}function L(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return fi;if(!n(t)){if(e=O(t))return e;t=[t]}return P(t)}function I(){return hi(pi)}function R(t,e){var n=t.toLowerCase();gi[n]=gi[n+"s"]=gi[e]=t}function N(t){return"string"==typeof t?gi[t]||gi[t.toLowerCase()]:void 0}function z(t){var e,n,i={};for(n in t)o(t,n)&&(e=N(n),e&&(i[e]=t[n]));return i}function j(e,n){return function(i){return null!=i?(H(this,e,i),t.updateOffset(this,n),this):$(this,e)}}function $(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function H(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function F(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=N(t),x(this[t]))return this[t](e);return this}function W(t,e,n){var i=""+Math.abs(t),r=e-i.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}function B(t,e,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),t&&(bi[t]=r),e&&(bi[e[0]]=function(){return W(r.apply(this,arguments),e[1],e[2])}),n&&(bi[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function U(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function q(t){var e,n,i=t.match(mi);for(e=0,n=i.length;n>e;e++)bi[i[e]]?i[e]=bi[i[e]]:i[e]=U(i[e]);return function(e){var r,o="";for(r=0;n>r;r++)o+=i[r]instanceof Function?i[r].call(e,t):i[r];return o}}function Y(t,e){return t.isValid()?(e=V(e,t.localeData()),yi[e]=yi[e]||q(e),yi[e](t)):t.localeData().invalidDate()}function V(t,e){function n(t){return e.longDateFormat(t)||t}var i=5;for(vi.lastIndex=0;i>=0&&vi.test(t);)t=t.replace(vi,n),vi.lastIndex=0,i-=1;return t}function K(t,e,n){zi[t]=x(e)?e:function(t,i){return t&&n?n:e}}function G(t,e){return o(zi,t)?zi[t](e._strict,e._locale):new RegExp(X(t))}function X(t){return J(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,r){return e||n||i||r}))}function J(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(i=function(t,n){n[e]=v(t)}),n=0;ni;++i)o=a([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===e?(r=di.call(this._shortMonthsParse,s),-1!==r?r:null):(r=di.call(this._longMonthsParse,s),-1!==r?r:null):"MMM"===e?(r=di.call(this._shortMonthsParse,s),-1!==r?r:(r=di.call(this._longMonthsParse,s),-1!==r?r:null)):(r=di.call(this._longMonthsParse,s),-1!==r?r:(r=di.call(this._shortMonthsParse,s),-1!==r?r:null))}function ot(t,e,n){var i,r,o;if(this._monthsParseExact)return rt.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;12>i;i++){if(r=a([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}}function st(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=v(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return n=Math.min(t.date(),et(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function at(e){return null!=e?(st(this,e),t.updateOffset(this,!0),this):$(this,"Month")}function lt(){return et(this.year(),this.month())}function ut(t){return this._monthsParseExact?(o(this,"_monthsRegex")||ht.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function ct(t){return this._monthsParseExact?(o(this,"_monthsRegex")||ht.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function ht(){function t(t,e){return e.length-t.length}var e,n,i=[],r=[],o=[];for(e=0;12>e;e++)n=a([2e3,e]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(i.sort(t),r.sort(t),o.sort(t),e=0;12>e;e++)i[e]=J(i[e]),r[e]=J(r[e]),o[e]=J(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function ft(t){var e,n=t._a;return n&&-2===u(t).overflow&&(e=n[Hi]<0||n[Hi]>11?Hi:n[Fi]<1||n[Fi]>et(n[$i],n[Hi])?Fi:n[Wi]<0||n[Wi]>24||24===n[Wi]&&(0!==n[Bi]||0!==n[Ui]||0!==n[qi])?Wi:n[Bi]<0||n[Bi]>59?Bi:n[Ui]<0||n[Ui]>59?Ui:n[qi]<0||n[qi]>999?qi:-1,u(t)._overflowDayOfYear&&($i>e||e>Fi)&&(e=Fi),u(t)._overflowWeeks&&-1===e&&(e=Yi),u(t)._overflowWeekday&&-1===e&&(e=Vi),u(t).overflow=e),t}function dt(t){var e,n,i,r,o,s,a=t._i,l=Qi.exec(a)||tr.exec(a);if(l){for(u(t).iso=!0,e=0,n=nr.length;n>e;e++)if(nr[e][1].exec(l[1])){r=nr[e][0],i=nr[e][2]!==!1;break}if(null==r)return void(t._isValid=!1);if(l[3]){for(e=0,n=ir.length;n>e;e++)if(ir[e][1].exec(l[3])){o=(l[2]||" ")+ir[e][0];break}if(null==o)return void(t._isValid=!1)}if(!i&&null!=o)return void(t._isValid=!1);if(l[4]){if(!er.exec(l[4]))return void(t._isValid=!1);s="Z"}t._f=r+(o||"")+(s||""),Pt(t)}else t._isValid=!1}function pt(e){var n=rr.exec(e._i);return null!==n?void(e._d=new Date((+n[1]))):(dt(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function gt(t,e,n,i,r,o,s){var a=new Date(t,e,n,i,r,o,s);return 100>t&&t>=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function mt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function vt(t){return yt(t)?366:365}function yt(t){return t%4===0&&t%100!==0||t%400===0}function bt(){return yt(this.year())}function wt(t,e,n){var i=7+e-n,r=(7+mt(t,0,i).getUTCDay()-e)%7;return-r+i-1}function _t(t,e,n,i,r){var o,s,a=(7+n-i)%7,l=wt(t,i,r),u=1+7*(e-1)+a+l;return 0>=u?(o=t-1,s=vt(o)+u):u>vt(t)?(o=t+1,s=u-vt(t)):(o=t,s=u),{year:o,dayOfYear:s}}function xt(t,e,n){var i,r,o=wt(t.year(),e,n),s=Math.floor((t.dayOfYear()-o-1)/7)+1;return 1>s?(r=t.year()-1,i=s+kt(r,e,n)):s>kt(t.year(),e,n)?(i=s-kt(t.year(),e,n),r=t.year()+1):(r=t.year(),i=s),{week:i,year:r}}function kt(t,e,n){var i=wt(t,e,n),r=wt(t+1,e,n);return(vt(t)-i+r)/7}function St(t,e,n){return null!=t?t:null!=e?e:n}function Ct(e){var n=new Date(t.now());return e._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function Tt(t){var e,n,i,r,o=[];if(!t._d){for(i=Ct(t),t._w&&null==t._a[Fi]&&null==t._a[Hi]&&Et(t),t._dayOfYear&&(r=St(t._a[$i],i[$i]),t._dayOfYear>vt(r)&&(u(t)._overflowDayOfYear=!0),n=mt(r,0,t._dayOfYear),t._a[Hi]=n.getUTCMonth(),t._a[Fi]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=i[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Wi]&&0===t._a[Bi]&&0===t._a[Ui]&&0===t._a[qi]&&(t._nextDay=!0,t._a[Wi]=0),t._d=(t._useUTC?mt:gt).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Wi]=24)}}function Et(t){var e,n,i,r,o,s,a,l;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,s=4,n=St(e.GG,t._a[$i],xt(Nt(),1,4).year),i=St(e.W,1),r=St(e.E,1),(1>r||r>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,n=St(e.gg,t._a[$i],xt(Nt(),o,s).year),i=St(e.w,1),null!=e.d?(r=e.d,(0>r||r>6)&&(l=!0)):null!=e.e?(r=e.e+o,(e.e<0||e.e>6)&&(l=!0)):r=o),1>i||i>kt(n,o,s)?u(t)._overflowWeeks=!0:null!=l?u(t)._overflowWeekday=!0:(a=_t(n,i,r,o,s),t._a[$i]=a.year,t._dayOfYear=a.dayOfYear)}function Pt(e){if(e._f===t.ISO_8601)return void dt(e);e._a=[],u(e).empty=!0;var n,i,r,o,s,a=""+e._i,l=a.length,c=0;for(r=V(e._f,e._locale).match(mi)||[],n=0;n0&&u(e).unusedInput.push(s),a=a.slice(a.indexOf(i)+i.length),c+=i.length),bi[o]?(i?u(e).empty=!1:u(e).unusedTokens.push(o),tt(o,i,e)):e._strict&&!i&&u(e).unusedTokens.push(o);u(e).charsLeftOver=l-c,a.length>0&&u(e).unusedInput.push(a),u(e).bigHour===!0&&e._a[Wi]<=12&&e._a[Wi]>0&&(u(e).bigHour=void 0),u(e).parsedDateParts=e._a.slice(0),u(e).meridiem=e._meridiem,e._a[Wi]=Ot(e._locale,e._a[Wi],e._meridiem),Tt(e),ft(e)}function Ot(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(i=t.isPM(n),i&&12>e&&(e+=12),i||12!==e||(e=0),e):e}function Mt(t){var e,n,i,r,o;if(0===t._f.length)return u(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;ro)&&(i=o,n=e));s(t,n||e)}function At(t){if(!t._d){var e=z(t._i);t._a=r([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Tt(t)}}function Dt(t){var e=new p(ft(Lt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Lt(t){var e=t._i,r=t._f;return t._locale=t._locale||L(t._l),null===e||void 0===r&&""===e?h({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),g(e)?new p(ft(e)):(n(r)?Mt(t):r?Pt(t):i(e)?t._d=e:It(t),c(t)||(t._d=null),t))}function It(e){var o=e._i;void 0===o?e._d=new Date(t.now()):i(o)?e._d=new Date(o.valueOf()):"string"==typeof o?pt(e):n(o)?(e._a=r(o.slice(0),function(t){return parseInt(t,10)}),Tt(e)):"object"==typeof o?At(e):"number"==typeof o?e._d=new Date(o):t.createFromInputFallback(e)}function Rt(t,e,n,i,r){var o={};return"boolean"==typeof n&&(i=n,n=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=r,o._l=n,o._i=t,o._f=e,o._strict=i,Dt(o)}function Nt(t,e,n,i){return Rt(t,e,n,i,!1)}function zt(t,e){var i,r;if(1===e.length&&n(e[0])&&(e=e[0]),!e.length)return Nt();for(i=e[0],r=1;rt&&(t=-t,n="-"),n+W(~~(t/60),2)+e+W(~~t%60,2)})}function Bt(t,e){var n=(e||"").match(t)||[],i=n[n.length-1]||[],r=(i+"").match(ur)||["-",0,0],o=+(60*r[1])+v(r[2]);return"+"===r[0]?o:-o}function Ut(e,n){var r,o;return n._isUTC?(r=n.clone(),o=(g(e)||i(e)?e.valueOf():Nt(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+o),t.updateOffset(r,!1),r):Nt(e).local()}function qt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Yt(e,n){var i,r=this._offset||0;return this.isValid()?null!=e?("string"==typeof e?e=Bt(Ii,e):Math.abs(e)<16&&(e=60*e),!this._isUTC&&n&&(i=qt(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==e&&(!n||this._changeInProgress?ue(this,ie(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:qt(this):null!=e?this:NaN}function Vt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Kt(t){return this.utcOffset(0,t)}function Gt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(qt(this),"m")),this}function Xt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Bt(Li,this._i)),this}function Jt(t){return!!this.isValid()&&(t=t?Nt(t).utcOffset():0,(this.utcOffset()-t)%60===0)}function Zt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Qt(){if(!f(this._isDSTShifted))return this._isDSTShifted;var t={};if(d(t,this),t=Lt(t),t._a){var e=t._isUTC?a(t._a):Nt(t._a);this._isDSTShifted=this.isValid()&&y(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function te(){return!!this.isValid()&&!this._isUTC}function ee(){return!!this.isValid()&&this._isUTC}function ne(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function ie(t,e){var n,i,r,s=t,a=null;return Ft(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(a=cr.exec(t))?(n="-"===a[1]?-1:1,s={y:0,d:v(a[Fi])*n,h:v(a[Wi])*n,m:v(a[Bi])*n,s:v(a[Ui])*n,ms:v(a[qi])*n}):(a=hr.exec(t))?(n="-"===a[1]?-1:1,s={y:re(a[2],n),M:re(a[3],n),w:re(a[4],n),d:re(a[5],n),h:re(a[6],n),m:re(a[7],n),s:re(a[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(r=se(Nt(s.from),Nt(s.to)),s={},s.ms=r.milliseconds,s.M=r.months),i=new Ht(s),Ft(t)&&o(t,"_locale")&&(i._locale=t._locale),i}function re(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function oe(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function se(t,e){var n;return t.isValid()&&e.isValid()?(e=Ut(e,t),t.isBefore(e)?n=oe(t,e):(n=oe(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ae(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function le(t,e){return function(n,i){var r,o;return null===i||isNaN(+i)||(_(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),o=n,n=i,i=o),n="string"==typeof n?+n:n,r=ie(n,i),ue(this,r,t),this}}function ue(e,n,i,r){var o=n._milliseconds,s=ae(n._days),a=ae(n._months);e.isValid()&&(r=null==r||r,o&&e._d.setTime(e._d.valueOf()+o*i),s&&H(e,"Date",$(e,"Date")+s*i),a&&st(e,$(e,"Month")+a*i),r&&t.updateOffset(e,s||a))}function ce(t,e){var n=t||Nt(),i=Ut(n,this).startOf("day"),r=this.diff(i,"days",!0),o=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse",s=e&&(x(e[o])?e[o]():e[o]);return this.format(s||this.localeData().calendar(o,this,Nt(n)))}function he(){return new p(this)}function fe(t,e){var n=g(t)?t:Nt(t);return!(!this.isValid()||!n.isValid())&&(e=N(f(e)?"millisecond":e),"millisecond"===e?this.valueOf()>n.valueOf():n.valueOf()e-o?(n=t.clone().add(r-1,"months"),i=(e-o)/(o-n)):(n=t.clone().add(r+1,"months"),i=(e-o)/(n-o)),-(r+i)||0}function we(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function _e(){var t=this.clone().utc();return 0o&&(e=o),Ve.call(this,t,e,n,i,r))}function Ve(t,e,n,i,r){var o=_t(t,e,n,i,r),s=mt(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function Ke(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ge(t){return xt(t,this._week.dow,this._week.doy).week}function Xe(){return this._week.dow}function Je(){return this._week.doy}function Ze(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Qe(t){var e=xt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function tn(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function en(t,e){return n(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function nn(t){return this._weekdaysShort[t.day()]}function rn(t){return this._weekdaysMin[t.day()]}function on(t,e,n){var i,r,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;7>i;++i)o=a([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===e?(r=di.call(this._weekdaysParse,s),-1!==r?r:null):"ddd"===e?(r=di.call(this._shortWeekdaysParse,s),-1!==r?r:null):(r=di.call(this._minWeekdaysParse,s),-1!==r?r:null):"dddd"===e?(r=di.call(this._weekdaysParse,s),-1!==r?r:(r=di.call(this._shortWeekdaysParse,s),-1!==r?r:(r=di.call(this._minWeekdaysParse,s),-1!==r?r:null))):"ddd"===e?(r=di.call(this._shortWeekdaysParse,s),-1!==r?r:(r=di.call(this._weekdaysParse,s),-1!==r?r:(r=di.call(this._minWeekdaysParse,s),-1!==r?r:null))):(r=di.call(this._minWeekdaysParse,s),-1!==r?r:(r=di.call(this._weekdaysParse,s),-1!==r?r:(r=di.call(this._shortWeekdaysParse,s),-1!==r?r:null)))}function sn(t,e,n){var i,r,o;if(this._weekdaysParseExact)return on.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;7>i;i++){if(r=a([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function an(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=tn(t,this.localeData()),this.add(t-e,"d")):e}function ln(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function un(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function cn(t){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||dn.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex}function hn(t){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||dn.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function fn(t){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||dn.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function dn(){function t(t,e){return e.length-t.length}var e,n,i,r,o,s=[],l=[],u=[],c=[];for(e=0;7>e;e++)n=a([2e3,1]).day(e),i=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),o=this.weekdays(n,""),s.push(i),l.push(r),u.push(o),c.push(i),c.push(r),c.push(o);for(s.sort(t),l.sort(t),u.sort(t),c.sort(t),e=0;7>e;e++)l[e]=J(l[e]),u[e]=J(u[e]),c[e]=J(c[e]);this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function pn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function gn(){return this.hours()%12||12}function mn(){return this.hours()||24}function vn(t,e){B(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function yn(t,e){return e._meridiemParse}function bn(t){return"p"===(t+"").toLowerCase().charAt(0)}function wn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function _n(t,e){e[qi]=v(1e3*("0."+t))}function xn(){return this._isUTC?"UTC":""}function kn(){return this._isUTC?"Coordinated Universal Time":""}function Sn(t){return Nt(1e3*t)}function Cn(){return Nt.apply(null,arguments).parseZone()}function Tn(t,e,n){var i=this._calendar[t];return x(i)?i.call(e,n):i}function En(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function Pn(){return this._invalidDate}function On(t){return this._ordinal.replace("%d",t)}function Mn(t){return t}function An(t,e,n,i){var r=this._relativeTime[n];return x(r)?r(t,e,n,i):r.replace(/%d/i,t)}function Dn(t,e){var n=this._relativeTime[t>0?"future":"past"];return x(n)?n(e):n.replace(/%s/i,e)}function Ln(t,e,n,i){var r=L(),o=a().set(i,e);return r[n](o,t)}function In(t,e,n){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Ln(t,e,n,"month");var i,r=[];for(i=0;12>i;i++)r[i]=Ln(t,i,n,"month");return r}function Rn(t,e,n,i){"boolean"==typeof t?("number"==typeof e&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,"number"==typeof e&&(n=e,e=void 0),e=e||"");var r=L(),o=t?r._week.dow:0;if(null!=n)return Ln(e,(n+o)%7,i,"day");var s,a=[];for(s=0;7>s;s++)a[s]=Ln(e,(s+o)%7,i,"day");return a}function Nn(t,e){return In(t,e,"months")}function zn(t,e){return In(t,e,"monthsShort")}function jn(t,e,n){return Rn(t,e,n,"weekdays")}function $n(t,e,n){return Rn(t,e,n,"weekdaysShort")}function Hn(t,e,n){return Rn(t,e,n,"weekdaysMin")}function Fn(){var t=this._data;return this._milliseconds=jr(this._milliseconds),this._days=jr(this._days),this._months=jr(this._months),t.milliseconds=jr(t.milliseconds),t.seconds=jr(t.seconds),t.minutes=jr(t.minutes),t.hours=jr(t.hours),t.months=jr(t.months),t.years=jr(t.years),this}function Wn(t,e,n,i){var r=ie(e,n);return t._milliseconds+=i*r._milliseconds,t._days+=i*r._days,t._months+=i*r._months,t._bubble()}function Bn(t,e){return Wn(this,t,e,1)}function Un(t,e){return Wn(this,t,e,-1)}function qn(t){return 0>t?Math.floor(t):Math.ceil(t)}function Yn(){var t,e,n,i,r,o=this._milliseconds,s=this._days,a=this._months,l=this._data;return o>=0&&s>=0&&a>=0||0>=o&&0>=s&&0>=a||(o+=864e5*qn(Kn(a)+s),s=0,a=0),l.milliseconds=o%1e3,t=m(o/1e3),l.seconds=t%60,e=m(t/60),l.minutes=e%60,n=m(e/60),l.hours=n%24,s+=m(n/24),r=m(Vn(s)),a+=r,s-=qn(Kn(r)),i=m(a/12),a%=12,l.days=s,l.months=a,l.years=i,this}function Vn(t){return 4800*t/146097}function Kn(t){return 146097*t/4800}function Gn(t){var e,n,i=this._milliseconds;if(t=N(t),"month"===t||"year"===t)return e=this._days+i/864e5,n=this._months+Vn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Kn(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}function Xn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function Jn(t){return function(){return this.as(t)}}function Zn(t){return t=N(t),this[t+"s"]()}function Qn(t){return function(){return this._data[t]}}function ti(){return m(this.days()/7)}function ei(t,e,n,i,r){return r.relativeTime(e||1,!!n,t,i)}function ni(t,e,n){var i=ie(t).abs(),r=to(i.as("s")),o=to(i.as("m")),s=to(i.as("h")),a=to(i.as("d")),l=to(i.as("M")),u=to(i.as("y")),c=r=o&&["m"]||o=s&&["h"]||s=a&&["d"]||a=l&&["M"]||l=u&&["y"]||["yy",u];return c[2]=e,c[3]=+t>0,c[4]=n,ei.apply(null,c)}function ii(t,e){return void 0!==eo[t]&&(void 0===e?eo[t]:(eo[t]=e,!0))}function ri(t){var e=this.localeData(),n=ni(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function oi(){var t,e,n,i=no(this._milliseconds)/1e3,r=no(this._days),o=no(this._months);t=m(i/60),e=m(t/60),i%=60,t%=60,n=m(o/12),o%=12;var s=n,a=o,l=r,u=e,c=t,h=i,f=this.asSeconds();return f?(0>f?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(l?l+"D":"")+(u||c||h?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(h?h+"S":""):"P0D"}var si,ai;ai=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;n>i;i++)if(i in e&&t.call(this,e[i],i,e))return!0;return!1};var li=t.momentProperties=[],ui=!1,ci={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var hi;hi=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)o(t,e)&&n.push(e);return n};var fi,di,pi={},gi={},mi=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,vi=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,yi={},bi={},wi=/\d/,_i=/\d\d/,xi=/\d{3}/,ki=/\d{4}/,Si=/[+-]?\d{6}/,Ci=/\d\d?/,Ti=/\d\d\d\d?/,Ei=/\d\d\d\d\d\d?/,Pi=/\d{1,3}/,Oi=/\d{1,4}/,Mi=/[+-]?\d{1,6}/,Ai=/\d+/,Di=/[+-]?\d+/,Li=/Z|[+-]\d\d:?\d\d/gi,Ii=/Z|[+-]\d\d(?::?\d\d)?/gi,Ri=/[+-]?\d+(\.\d{1,3})?/,Ni=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,zi={},ji={},$i=0,Hi=1,Fi=2,Wi=3,Bi=4,Ui=5,qi=6,Yi=7,Vi=8;di=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=t?""+t:"+"+t}),B(0,["YY",2],0,function(){return this.year()%100}),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),R("year","y"),K("Y",Di),K("YY",Ci,_i),K("YYYY",Oi,ki),K("YYYYY",Mi,Si),K("YYYYYY",Mi,Si),Z(["YYYYY","YYYYYY"],$i),Z("YYYY",function(e,n){n[$i]=2===e.length?t.parseTwoDigitYear(e):v(e)}),Z("YY",function(e,n){n[$i]=t.parseTwoDigitYear(e)}),Z("Y",function(t,e){e[$i]=parseInt(t,10)}),t.parseTwoDigitYear=function(t){return v(t)+(v(t)>68?1900:2e3)};var or=j("FullYear",!0);t.ISO_8601=function(){};var sr=w("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:h()}),ar=w("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:h()}),lr=function(){return Date.now?Date.now():+new Date};Wt("Z",":"),Wt("ZZ",""),K("Z",Ii),K("ZZ",Ii),Z(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Bt(Ii,t)});var ur=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var cr=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,hr=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;ie.fn=Ht.prototype;var fr=le(1,"add"),dr=le(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var pr=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});B(0,["gg",2],0,function(){return this.weekYear()%100}),B(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Fe("gggg","weekYear"),Fe("ggggg","weekYear"),Fe("GGGG","isoWeekYear"),Fe("GGGGG","isoWeekYear"),R("weekYear","gg"),R("isoWeekYear","GG"),K("G",Di),K("g",Di),K("GG",Ci,_i),K("gg",Ci,_i),K("GGGG",Oi,ki),K("gggg",Oi,ki),K("GGGGG",Mi,Si),K("ggggg",Mi,Si),Q(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=v(t)}),Q(["gg","GG"],function(e,n,i,r){n[r]=t.parseTwoDigitYear(e)}),B("Q",0,"Qo","quarter"),R("quarter","Q"),K("Q",wi),Z("Q",function(t,e){e[Hi]=3*(v(t)-1)}),B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),R("week","w"),R("isoWeek","W"),K("w",Ci),K("ww",Ci,_i),K("W",Ci),K("WW",Ci,_i),Q(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=v(t)});var gr={dow:0,doy:6};B("D",["DD",2],"Do","date"),R("date","D"),K("D",Ci),K("DD",Ci,_i),K("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),Z(["D","DD"],Fi),Z("Do",function(t,e){e[Fi]=v(t.match(Ci)[0],10)});var mr=j("Date",!0);B("d",0,"do","day"),B("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),B("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),B("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),R("day","d"),R("weekday","e"),R("isoWeekday","E"),K("d",Ci),K("e",Ci),K("E",Ci),K("dd",function(t,e){return e.weekdaysMinRegex(t)}),K("ddd",function(t,e){return e.weekdaysShortRegex(t)}),K("dddd",function(t,e){return e.weekdaysRegex(t)}),Q(["dd","ddd","dddd"],function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);null!=r?e.d=r:u(n).invalidWeekday=t}),Q(["d","e","E"],function(t,e,n,i){e[i]=v(t)});var vr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),yr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),br="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),wr=Ni,_r=Ni,xr=Ni;B("DDD",["DDDD",3],"DDDo","dayOfYear"),R("dayOfYear","DDD"),K("DDD",Pi),K("DDDD",xi),Z(["DDD","DDDD"],function(t,e,n){n._dayOfYear=v(t)}),B("H",["HH",2],0,"hour"),B("h",["hh",2],0,gn),B("k",["kk",2],0,mn),B("hmm",0,0,function(){return""+gn.apply(this)+W(this.minutes(),2)}),B("hmmss",0,0,function(){return""+gn.apply(this)+W(this.minutes(),2)+W(this.seconds(),2)}),B("Hmm",0,0,function(){return""+this.hours()+W(this.minutes(),2)}),B("Hmmss",0,0,function(){return""+this.hours()+W(this.minutes(),2)+W(this.seconds(),2)}),vn("a",!0),vn("A",!1),R("hour","h"),K("a",yn),K("A",yn),K("H",Ci),K("h",Ci),K("HH",Ci,_i),K("hh",Ci,_i),K("hmm",Ti),K("hmmss",Ei),K("Hmm",Ti),K("Hmmss",Ei),Z(["H","HH"],Wi),Z(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Z(["h","hh"],function(t,e,n){e[Wi]=v(t),u(n).bigHour=!0}),Z("hmm",function(t,e,n){var i=t.length-2;e[Wi]=v(t.substr(0,i)),e[Bi]=v(t.substr(i)),u(n).bigHour=!0}),Z("hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[Wi]=v(t.substr(0,i)),e[Bi]=v(t.substr(i,2)),e[Ui]=v(t.substr(r)),u(n).bigHour=!0}),Z("Hmm",function(t,e,n){var i=t.length-2;e[Wi]=v(t.substr(0,i)),e[Bi]=v(t.substr(i))}),Z("Hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[Wi]=v(t.substr(0,i)),e[Bi]=v(t.substr(i,2)),e[Ui]=v(t.substr(r))});var kr=/[ap]\.?m?\.?/i,Sr=j("Hours",!0);B("m",["mm",2],0,"minute"),R("minute","m"),K("m",Ci),K("mm",Ci,_i),Z(["m","mm"],Bi);var Cr=j("Minutes",!1);B("s",["ss",2],0,"second"),R("second","s"),K("s",Ci),K("ss",Ci,_i),Z(["s","ss"],Ui);var Tr=j("Seconds",!1);B("S",0,0,function(){return~~(this.millisecond()/100)}),B(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,function(){return 10*this.millisecond()}),B(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),B(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),B(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),B(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),B(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),R("millisecond","ms"),K("S",Pi,wi),K("SS",Pi,_i),K("SSS",Pi,xi);var Er;for(Er="SSSS";Er.length<=9;Er+="S")K(Er,Ai);for(Er="S";Er.length<=9;Er+="S")Z(Er,_n);var Pr=j("Milliseconds",!1);B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var Or=p.prototype;Or.add=fr,Or.calendar=ce,Or.clone=he,Or.diff=ye,Or.endOf=Me,Or.format=xe,Or.from=ke,Or.fromNow=Se,Or.to=Ce,Or.toNow=Te,Or.get=F,Or.invalidAt=$e,Or.isAfter=fe,Or.isBefore=de,Or.isBetween=pe,Or.isSame=ge,Or.isSameOrAfter=me,Or.isSameOrBefore=ve,Or.isValid=ze,Or.lang=pr,Or.locale=Ee,Or.localeData=Pe,Or.max=ar,Or.min=sr,Or.parsingFlags=je,Or.set=F,Or.startOf=Oe,Or.subtract=dr,Or.toArray=Ie,Or.toObject=Re,Or.toDate=Le,Or.toISOString=_e,Or.toJSON=Ne,Or.toString=we,Or.unix=De,Or.valueOf=Ae,Or.creationData=He,Or.year=or,Or.isLeapYear=bt,Or.weekYear=We,Or.isoWeekYear=Be,Or.quarter=Or.quarters=Ke,Or.month=at,Or.daysInMonth=lt,Or.week=Or.weeks=Ze,Or.isoWeek=Or.isoWeeks=Qe,Or.weeksInYear=qe,Or.isoWeeksInYear=Ue,Or.date=mr,Or.day=Or.days=an,Or.weekday=ln,Or.isoWeekday=un,Or.dayOfYear=pn,Or.hour=Or.hours=Sr,Or.minute=Or.minutes=Cr,Or.second=Or.seconds=Tr,Or.millisecond=Or.milliseconds=Pr,Or.utcOffset=Yt,Or.utc=Kt,Or.local=Gt,Or.parseZone=Xt,Or.hasAlignedHourOffset=Jt,Or.isDST=Zt,Or.isDSTShifted=Qt,Or.isLocal=te,Or.isUtcOffset=ee,Or.isUtc=ne,Or.isUTC=ne,Or.zoneAbbr=xn,Or.zoneName=kn,Or.dates=w("dates accessor is deprecated. Use date instead.",mr),Or.months=w("months accessor is deprecated. Use month instead",at),Or.years=w("years accessor is deprecated. Use year instead",or),Or.zone=w("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Vt);var Mr=Or,Ar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Dr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Lr="Invalid date",Ir="%d",Rr=/\d{1,2}/,Nr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},zr=T.prototype;zr._calendar=Ar,zr.calendar=Tn,zr._longDateFormat=Dr,zr.longDateFormat=En,zr._invalidDate=Lr,zr.invalidDate=Pn,zr._ordinal=Ir,zr.ordinal=On,zr._ordinalParse=Rr,zr.preparse=Mn,zr.postformat=Mn,zr._relativeTime=Nr,zr.relativeTime=An,zr.pastFuture=Dn,zr.set=S,zr.months=nt,zr._months=Gi,zr.monthsShort=it,zr._monthsShort=Xi,zr.monthsParse=ot,zr._monthsRegex=Zi,zr.monthsRegex=ct,zr._monthsShortRegex=Ji,zr.monthsShortRegex=ut,zr.week=Ge,zr._week=gr,zr.firstDayOfYear=Je,zr.firstDayOfWeek=Xe,zr.weekdays=en,zr._weekdays=vr,zr.weekdaysMin=rn,zr._weekdaysMin=br,zr.weekdaysShort=nn,zr._weekdaysShort=yr,zr.weekdaysParse=sn,zr._weekdaysRegex=wr,zr.weekdaysRegex=cn,zr._weekdaysShortRegex=_r,zr.weekdaysShortRegex=hn,zr._weekdaysMinRegex=xr,zr.weekdaysMinRegex=fn,zr.isPM=bn,zr._meridiemParse=kr,zr.meridiem=wn,M("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===v(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),t.lang=w("moment.lang is deprecated. Use moment.locale instead.",M),t.langData=w("moment.langData is deprecated. Use moment.localeData instead.",L);var jr=Math.abs,$r=Jn("ms"),Hr=Jn("s"),Fr=Jn("m"),Wr=Jn("h"),Br=Jn("d"),Ur=Jn("w"),qr=Jn("M"),Yr=Jn("y"),Vr=Qn("milliseconds"),Kr=Qn("seconds"),Gr=Qn("minutes"),Xr=Qn("hours"),Jr=Qn("days"),Zr=Qn("months"),Qr=Qn("years"),to=Math.round,eo={s:45,m:45,h:22,d:26,M:11},no=Math.abs,io=Ht.prototype;io.abs=Fn,io.add=Bn,io.subtract=Un,io.as=Gn,io.asMilliseconds=$r,io.asSeconds=Hr,io.asMinutes=Fr,io.asHours=Wr,io.asDays=Br,io.asWeeks=Ur,io.asMonths=qr,io.asYears=Yr,io.valueOf=Xn,io._bubble=Yn,io.get=Zn,io.milliseconds=Vr,io.seconds=Kr,io.minutes=Gr,io.hours=Xr,io.days=Jr,io.weeks=ti,io.months=Zr,io.years=Qr,io.humanize=ri,io.toISOString=oi,io.toString=oi,io.toJSON=oi,io.locale=Ee,io.localeData=Pe,io.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",oi),io.lang=pr,B("X",0,0,"unix"),B("x",0,0,"valueOf"),K("x",Di),K("X",Ri),Z("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),Z("x",function(t,e,n){n._d=new Date(v(t))}),t.version="2.13.0",e(Nt),t.fn=Mr,t.min=jt,t.max=$t,t.now=lr,t.utc=a,t.unix=Sn,t.months=Nn,t.isDate=i,t.locale=M,t.invalid=h,t.duration=ie,t.isMoment=g,t.weekdays=jn,t.parseZone=Cn,t.localeData=L,t.isDuration=Ft,t.monthsShort=zn,t.weekdaysMin=Hn,t.defineLocale=A,t.updateLocale=D,t.locales=I,t.weekdaysShort=$n,t.normalizeUnits=N,t.relativeTimeThreshold=ii,t.prototype=Mr;var ro=t;return ro}),function(t,e){"object"==typeof exports?module.exports=exports=e():"function"==typeof define&&define.amd?define([],e):t.CryptoJS=e()}(this,function(){var t=t||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),i={},r=i.lib={},o=r.Base=function(){return{extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=r.WordArray=o.extend({init:function(t,n){t=this.words=t||[],n!=e?this.sigBytes=n:this.sigBytes=4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var e=this.words,n=t.words,i=this.sigBytes,r=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(var o=0;o>>2]=n[o>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,i=[],r=function(e){var e=e,n=987654321,i=4294967295;return function(){n=36969*(65535&n)+(n>>16)&i,e=18e3*(65535&e)+(e>>16)&i;var r=(n<<16)+e&i;return r/=4294967296,r+=.5,r*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;i>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new s.init(n,e/2)}},u=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;r>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new s.init(n,e)}},c=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},h=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=c.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,i=n.words,r=n.sigBytes,o=this.blockSize,a=4*o,l=r/a;l=e?t.ceil(l):t.max((0|l)-this._minBufferSize,0);var u=l*o,c=t.min(4*u,r);if(u){for(var h=0;h>>6-s%4*2;i[o>>>2]|=(a|l)<<24-o%4*8,o++}return r.create(i,o)}var n=t,i=n.lib,r=i.WordArray,o=n.enc;o.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,i=this._map;t.clamp();for(var r=[],o=0;o>>2]>>>24-o%4*8&255,a=e[o+1>>>2]>>>24-(o+1)%4*8&255,l=e[o+2>>>2]>>>24-(o+2)%4*8&255,u=s<<16|a<<8|l,c=0;c<4&&o+.75*c>>6*(3-c)&63));var h=i.charAt(64);if(h)for(;r.length%4;)r.push(h);return r.join("")},parse:function(t){var n=t.length,i=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o>>32-o)+e}function i(t,e,n,i,r,o,s){var a=t+(e&i|n&~i)+r+s;return(a<>>32-o)+e}function r(t,e,n,i,r,o,s){var a=t+(e^n^i)+r+s;return(a<>>32-o)+e}function o(t,e,n,i,r,o,s){var a=t+(n^(e|~i))+r+s;return(a<>>32-o)+e}var s=t,a=s.lib,l=a.WordArray,u=a.Hasher,c=s.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var f=c.MD5=u.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var s=0;s<16;s++){var a=e+s,l=t[a];t[a]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}var u=this._hash.words,c=t[e+0],f=t[e+1],d=t[e+2],p=t[e+3],g=t[e+4],m=t[e+5],v=t[e+6],y=t[e+7],b=t[e+8],w=t[e+9],_=t[e+10],x=t[e+11],k=t[e+12],S=t[e+13],C=t[e+14],T=t[e+15],E=u[0],P=u[1],O=u[2],M=u[3];E=n(E,P,O,M,c,7,h[0]),M=n(M,E,P,O,f,12,h[1]),O=n(O,M,E,P,d,17,h[2]),P=n(P,O,M,E,p,22,h[3]),E=n(E,P,O,M,g,7,h[4]),M=n(M,E,P,O,m,12,h[5]),O=n(O,M,E,P,v,17,h[6]),P=n(P,O,M,E,y,22,h[7]),E=n(E,P,O,M,b,7,h[8]), +M=n(M,E,P,O,w,12,h[9]),O=n(O,M,E,P,_,17,h[10]),P=n(P,O,M,E,x,22,h[11]),E=n(E,P,O,M,k,7,h[12]),M=n(M,E,P,O,S,12,h[13]),O=n(O,M,E,P,C,17,h[14]),P=n(P,O,M,E,T,22,h[15]),E=i(E,P,O,M,f,5,h[16]),M=i(M,E,P,O,v,9,h[17]),O=i(O,M,E,P,x,14,h[18]),P=i(P,O,M,E,c,20,h[19]),E=i(E,P,O,M,m,5,h[20]),M=i(M,E,P,O,_,9,h[21]),O=i(O,M,E,P,T,14,h[22]),P=i(P,O,M,E,g,20,h[23]),E=i(E,P,O,M,w,5,h[24]),M=i(M,E,P,O,C,9,h[25]),O=i(O,M,E,P,p,14,h[26]),P=i(P,O,M,E,b,20,h[27]),E=i(E,P,O,M,S,5,h[28]),M=i(M,E,P,O,d,9,h[29]),O=i(O,M,E,P,y,14,h[30]),P=i(P,O,M,E,k,20,h[31]),E=r(E,P,O,M,m,4,h[32]),M=r(M,E,P,O,b,11,h[33]),O=r(O,M,E,P,x,16,h[34]),P=r(P,O,M,E,C,23,h[35]),E=r(E,P,O,M,f,4,h[36]),M=r(M,E,P,O,g,11,h[37]),O=r(O,M,E,P,y,16,h[38]),P=r(P,O,M,E,_,23,h[39]),E=r(E,P,O,M,S,4,h[40]),M=r(M,E,P,O,c,11,h[41]),O=r(O,M,E,P,p,16,h[42]),P=r(P,O,M,E,v,23,h[43]),E=r(E,P,O,M,w,4,h[44]),M=r(M,E,P,O,k,11,h[45]),O=r(O,M,E,P,T,16,h[46]),P=r(P,O,M,E,d,23,h[47]),E=o(E,P,O,M,c,6,h[48]),M=o(M,E,P,O,y,10,h[49]),O=o(O,M,E,P,C,15,h[50]),P=o(P,O,M,E,m,21,h[51]),E=o(E,P,O,M,k,6,h[52]),M=o(M,E,P,O,p,10,h[53]),O=o(O,M,E,P,_,15,h[54]),P=o(P,O,M,E,f,21,h[55]),E=o(E,P,O,M,b,6,h[56]),M=o(M,E,P,O,T,10,h[57]),O=o(O,M,E,P,v,15,h[58]),P=o(P,O,M,E,S,21,h[59]),E=o(E,P,O,M,g,6,h[60]),M=o(M,E,P,O,x,10,h[61]),O=o(O,M,E,P,d,15,h[62]),P=o(P,O,M,E,w,21,h[63]),u[0]=u[0]+E|0,u[1]=u[1]+P|0,u[2]=u[2]+O|0,u[3]=u[3]+M|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;n[r>>>5]|=128<<24-r%32;var o=e.floor(i/4294967296),s=i;n[(r+64>>>9<<4)+15]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[(r+64>>>9<<4)+14]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,l=a.words,u=0;u<4;u++){var c=l[u];l[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return a},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});s.MD5=u._createHelper(f),s.HmacMD5=u._createHmacHelper(f)}(Math),function(){var e=t,n=e.lib,i=n.WordArray,r=n.Hasher,o=e.algo,s=[],a=o.SHA1=r.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],a=n[3],l=n[4],u=0;u<80;u++){if(u<16)s[u]=0|t[e+u];else{var c=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=c<<1|c>>>31}var h=(i<<5|i>>>27)+l+s[u];h+=u<20?(r&o|~r&a)+1518500249:u<40?(r^o^a)+1859775393:u<60?(r&o|r&a|o&a)-1894007588:(r^o^a)-899497514,l=a,a=o,o=r<<30|r>>>2,r=i,i=h}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+l|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[(i+64>>>9<<4)+14]=Math.floor(n/4294967296),e[(i+64>>>9<<4)+15]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA1=r._createHelper(a),e.HmacSHA1=r._createHmacHelper(a)}(),function(e){var n=t,i=n.lib,r=i.WordArray,o=i.Hasher,s=n.algo,a=[],l=[];!function(){function t(t){for(var n=e.sqrt(t),i=2;i<=n;i++)if(!(t%i))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var i=2,r=0;r<64;)t(i)&&(r<8&&(a[r]=n(e.pow(i,.5))),l[r]=n(e.pow(i,1/3)),r++),i++}();var u=[],c=s.SHA256=o.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],c=n[5],h=n[6],f=n[7],d=0;d<64;d++){if(d<16)u[d]=0|t[e+d];else{var p=u[d-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,m=u[d-2],v=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[d]=g+u[d-7]+v+u[d-16]}var y=a&c^~a&h,b=i&r^i&o^r&o,w=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),_=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),x=f+_+y+l[d]+u[d],k=w+b;f=h,h=c,c=a,a=s+x|0,s=o,o=r,r=i,i=x+k|0}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+c|0,n[6]=n[6]+h|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return n[r>>>5]|=128<<24-r%32,n[(r+64>>>9<<4)+14]=e.floor(i/4294967296),n[(r+64>>>9<<4)+15]=i,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});n.SHA256=o._createHelper(c),n.HmacSHA256=o._createHmacHelper(c)}(Math),function(){function e(t){return t<<8&4278255360|t>>>8&16711935}var n=t,i=n.lib,r=i.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;r>>2]>>>16-r%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;i>>1]|=t.charCodeAt(i)<<16-i%2*16;return r.create(n,2*e)}};o.Utf16LE={stringify:function(t){for(var n=t.words,i=t.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var n=t.length,i=[],o=0;o>>1]|=e(t.charCodeAt(o)<<16-o%2*16);return r.create(i,2*n)}}}(),function(){if("function"==typeof ArrayBuffer){var e=t,n=e.lib,i=n.WordArray,r=i.init,o=i.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,n=[],i=0;i>>2]|=t[i]<<24-i%4*8;r.call(this,n,e)}else r.apply(this,arguments)};o.prototype=i}}(),function(e){function n(t,e,n){return t^e^n}function i(t,e,n){return t&e|~t&n}function r(t,e,n){return(t|~e)^n}function o(t,e,n){return t&n|e&~n}function s(t,e,n){return t^(e|~n)}function a(t,e){return t<>>32-e}var l=t,u=l.lib,c=u.WordArray,h=u.Hasher,f=l.algo,d=c.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),p=c.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),g=c.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),m=c.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),v=c.create([0,1518500249,1859775393,2400959708,2840853838]),y=c.create([1352829926,1548603684,1836072691,2053994217,0]),b=f.RIPEMD160=h.extend({_doReset:function(){this._hash=c.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var l=0;l<16;l++){var u=e+l,c=t[u];t[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var h,f,b,w,_,x,k,S,C,T,E=this._hash.words,P=v.words,O=y.words,M=d.words,A=p.words,D=g.words,L=m.words;x=h=E[0],k=f=E[1],S=b=E[2],C=w=E[3],T=_=E[4];for(var I,l=0;l<80;l+=1)I=h+t[e+M[l]]|0,I+=l<16?n(f,b,w)+P[0]:l<32?i(f,b,w)+P[1]:l<48?r(f,b,w)+P[2]:l<64?o(f,b,w)+P[3]:s(f,b,w)+P[4],I=0|I,I=a(I,D[l]),I=I+_|0,h=_,_=w,w=a(b,10),b=f,f=I,I=x+t[e+A[l]]|0,I+=l<16?s(k,S,C)+O[0]:l<32?o(k,S,C)+O[1]:l<48?r(k,S,C)+O[2]:l<64?i(k,S,C)+O[3]:n(k,S,C)+O[4],I=0|I,I=a(I,L[l]),I=I+T|0,x=T,T=C,C=a(S,10),S=k,k=I;I=E[1]+b+C|0,E[1]=E[2]+w+T|0,E[2]=E[3]+_+x|0,E[3]=E[4]+h+k|0,E[4]=E[0]+f+S|0,E[0]=I},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[(i+64>>>9<<4)+14]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process();for(var r=this._hash,o=r.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return r},clone:function(){var t=h.clone.call(this);return t._hash=this._hash.clone(),t}});l.RIPEMD160=h._createHelper(b),l.HmacRIPEMD160=h._createHmacHelper(b)}(Math),function(){var e=t,n=e.lib,i=n.Base,r=e.enc,o=r.Utf8,s=e.algo;s.HMAC=i.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=o.parse(e));var n=t.blockSize,i=4*n;e.sigBytes>i&&(e=t.finalize(e)),e.clamp();for(var r=this._oKey=e.clone(),s=this._iKey=e.clone(),a=r.words,l=s.words,u=0;u>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);var a=n[r];a.high^=s,a.low^=o}for(var l=0;l<24;l++){for(var d=0;d<5;d++){for(var p=0,g=0,m=0;m<5;m++){var a=n[d+5*m];p^=a.high,g^=a.low}var v=f[d];v.high=p,v.low=g}for(var d=0;d<5;d++)for(var y=f[(d+4)%5],b=f[(d+1)%5],w=b.high,_=b.low,p=y.high^(w<<1|_>>>31),g=y.low^(_<<1|w>>>31),m=0;m<5;m++){var a=n[d+5*m];a.high^=p,a.low^=g}for(var x=1;x<25;x++){var a=n[x],k=a.high,S=a.low,C=u[x];if(C<32)var p=k<>>32-C,g=S<>>32-C;else var p=S<>>64-C,g=k<>>64-C;var T=f[c[x]];T.high=p,T.low=g}var E=f[0],P=n[0];E.high=P.high,E.low=P.low;for(var d=0;d<5;d++)for(var m=0;m<5;m++){var x=d+5*m,a=n[x],O=f[x],M=f[(d+1)%5+5*m],A=f[(d+2)%5+5*m];a.high=O.high^~M.high&A.high,a.low=O.low^~M.low&A.low}var a=n[0],D=h[l];a.high^=D.high,a.low^=D.low}},_doFinalize:function(){var t=this._data,n=t.words,i=(8*this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;n[i>>>5]|=1<<24-i%32,n[(e.ceil((i+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,l=a/8,u=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(f)}return new r.init(u,a)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),n=0;n<25;n++)e[n]=e[n].clone();return t}});n.SHA3=o._createHelper(d),n.HmacSHA3=o._createHmacHelper(d)}(Math),function(){function e(){return s.create.apply(s,arguments)}var n=t,i=n.lib,r=i.Hasher,o=n.x64,s=o.Word,a=o.WordArray,l=n.algo,u=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=e()}();var h=l.SHA512=r.extend({_doReset:function(){this._hash=new a.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],l=n[5],h=n[6],f=n[7],d=i.high,p=i.low,g=r.high,m=r.low,v=o.high,y=o.low,b=s.high,w=s.low,_=a.high,x=a.low,k=l.high,S=l.low,C=h.high,T=h.low,E=f.high,P=f.low,O=d,M=p,A=g,D=m,L=v,I=y,R=b,N=w,z=_,j=x,$=k,H=S,F=C,W=T,B=E,U=P,q=0;q<80;q++){var Y=c[q];if(q<16)var V=Y.high=0|t[e+2*q],K=Y.low=0|t[e+2*q+1];else{var G=c[q-15],X=G.high,J=G.low,Z=(X>>>1|J<<31)^(X>>>8|J<<24)^X>>>7,Q=(J>>>1|X<<31)^(J>>>8|X<<24)^(J>>>7|X<<25),tt=c[q-2],et=tt.high,nt=tt.low,it=(et>>>19|nt<<13)^(et<<3|nt>>>29)^et>>>6,rt=(nt>>>19|et<<13)^(nt<<3|et>>>29)^(nt>>>6|et<<26),ot=c[q-7],st=ot.high,at=ot.low,lt=c[q-16],ut=lt.high,ct=lt.low,K=Q+at,V=Z+st+(K>>>0>>0?1:0),K=K+rt,V=V+it+(K>>>0>>0?1:0),K=K+ct,V=V+ut+(K>>>0>>0?1:0);Y.high=V,Y.low=K}var ht=z&$^~z&F,ft=j&H^~j&W,dt=O&A^O&L^A&L,pt=M&D^M&I^D&I,gt=(O>>>28|M<<4)^(O<<30|M>>>2)^(O<<25|M>>>7),mt=(M>>>28|O<<4)^(M<<30|O>>>2)^(M<<25|O>>>7),vt=(z>>>14|j<<18)^(z>>>18|j<<14)^(z<<23|j>>>9),yt=(j>>>14|z<<18)^(j>>>18|z<<14)^(j<<23|z>>>9),bt=u[q],wt=bt.high,_t=bt.low,xt=U+yt,kt=B+vt+(xt>>>0>>0?1:0),xt=xt+ft,kt=kt+ht+(xt>>>0>>0?1:0),xt=xt+_t,kt=kt+wt+(xt>>>0<_t>>>0?1:0),xt=xt+K,kt=kt+V+(xt>>>0>>0?1:0),St=mt+pt,Ct=gt+dt+(St>>>0>>0?1:0);B=F,U=W,F=$,W=H,$=z,H=j,j=N+xt|0,z=R+kt+(j>>>0>>0?1:0)|0,R=L,N=I,L=A,I=D,A=O,D=M,M=xt+St|0,O=kt+Ct+(M>>>0>>0?1:0)|0}p=i.low=p+M,i.high=d+O+(p>>>0>>0?1:0),m=r.low=m+D,r.high=g+A+(m>>>0>>0?1:0),y=o.low=y+I,o.high=v+L+(y>>>0>>0?1:0),w=s.low=w+N,s.high=b+R+(w>>>0>>0?1:0),x=a.low=x+j,a.high=_+z+(x>>>0>>0?1:0),S=l.low=S+H,l.high=k+$+(S>>>0>>0?1:0),T=h.low=T+W,h.high=C+F+(T>>>0>>0?1:0),P=f.low=P+U,f.high=E+B+(P>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[(i+128>>>10<<5)+30]=Math.floor(n/4294967296),e[(i+128>>>10<<5)+31]=n,t.sigBytes=4*e.length,this._process();var r=this._hash.toX32();return r},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});n.SHA512=r._createHelper(h),n.HmacSHA512=r._createHmacHelper(h)}(),function(){var e=t,n=e.x64,i=n.Word,r=n.WordArray,o=e.algo,s=o.SHA512,a=o.SHA384=s.extend({_doReset:function(){this._hash=new r.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var t=s._doFinalize.call(this);return t.sigBytes-=16,t}});e.SHA384=s._createHelper(a),e.HmacSHA384=s._createHmacHelper(a)}(),t.lib.Cipher||function(e){var n=t,i=n.lib,r=i.Base,o=i.WordArray,s=i.BufferedBlockAlgorithm,a=n.enc,l=(a.Utf8,a.Base64),u=n.algo,c=u.EvpKDF,h=i.Cipher=s.extend({cfg:r.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?k:w}return function(e){return{encrypt:function(n,i,r){return t(i).encrypt(e,n,i,r)},decrypt:function(n,i,r){return t(i).decrypt(e,n,i,r)}}}}()}),f=(i.StreamCipher=h.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),n.mode={}),d=i.BlockCipherMode=r.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),p=f.CBC=function(){function t(t,n,i){var r=this._iv;if(r){var o=r;this._iv=e}else var o=this._prevBlock;for(var s=0;s>>2];t.sigBytes-=e}},v=(i.BlockCipher=h.extend({cfg:h.cfg.extend({mode:p,padding:m}),reset:function(){h.reset.call(this);var t=this.cfg,e=t.iv,n=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=n.createEncryptor;else{var i=n.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==i?this._mode.init(this,e&&e.words):(this._mode=i.call(n,this,e&&e.words),this._mode.__creator=i)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else{var e=this._process(!0);t.unpad(e)}return e},blockSize:4}),i.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=n.format={},b=y.OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;if(n)var i=o.create([1398893684,1701076831]).concat(n).concat(e);else var i=e;return i.toString(l)},parse:function(t){var e=l.parse(t),n=e.words;if(1398893684==n[0]&&1701076831==n[1]){var i=o.create(n.slice(2,4));n.splice(0,4),e.sigBytes-=16}return v.create({ciphertext:e,salt:i})}},w=i.SerializableCipher=r.extend({cfg:r.extend({format:b}),encrypt:function(t,e,n,i){i=this.cfg.extend(i);var r=t.createEncryptor(n,i),o=r.finalize(e),s=r.cfg;return v.create({ciphertext:o,key:n,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,n,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var r=t.createDecryptor(n,i).finalize(e.ciphertext);return r},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),_=n.kdf={},x=_.OpenSSL={execute:function(t,e,n,i){i||(i=o.random(8));var r=c.create({keySize:e+n}).compute(t,i),s=o.create(r.words.slice(e),4*n);return r.sigBytes=4*e,v.create({key:r,iv:s,salt:i})}},k=i.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:x}),encrypt:function(t,e,n,i){i=this.cfg.extend(i);var r=i.kdf.execute(n,t.keySize,t.ivSize);i.iv=r.iv;var o=w.encrypt.call(this,t,e,r.key,i);return o.mixIn(r),o},decrypt:function(t,e,n,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var r=i.kdf.execute(n,t.keySize,t.ivSize,e.salt);i.iv=r.iv;var o=w.decrypt.call(this,t,e,r.key,i);return o}})}(),t.mode.CFB=function(){function e(t,e,n,i){var r=this._iv;if(r){var o=r.slice(0);this._iv=void 0}else var o=this._prevBlock;i.encryptBlock(o,0);for(var s=0;s>>2]|=r<<24-o%4*8,t.sigBytes+=r},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Iso10126={pad:function(e,n){var i=4*n,r=i-e.sigBytes%i;e.concat(t.lib.WordArray.random(r-1)).concat(t.lib.WordArray.create([r<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Iso97971={pad:function(e,n){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,n)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.mode.OFB=function(){var e=t.lib.BlockCipherMode.extend(),n=e.Encryptor=e.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize,r=this._iv,o=this._keystream;r&&(o=this._keystream=r.slice(0),this._iv=void 0),n.encryptBlock(o,0);for(var s=0;s>>8^255&r^99,o[n]=r,s[r]=n;var g=t[n],m=t[g],v=t[m],y=257*t[r]^16843008*r;a[n]=y<<24|y>>>8,l[n]=y<<16|y>>>16,u[n]=y<<8|y>>>24,c[n]=y;var y=16843009*v^65537*m^257*g^16843008*n;h[r]=y<<24|y>>>8,f[r]=y<<16|y>>>16,d[r]=y<<8|y>>>24,p[r]=y,n?(n=g^t[t[t[v^g]]],i^=t[t[i]]):n=i=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=i.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,i=this._nRounds=n+6,r=4*(i+1),s=this._keySchedule=[],a=0;a6&&a%n==4&&(l=o[l>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l]):(l=l<<8|l>>>24,l=o[l>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l],l^=g[a/n|0]<<24),s[a]=s[a-n]^l}for(var u=this._invKeySchedule=[],c=0;c>>24]]^f[o[l>>>16&255]]^d[o[l>>>8&255]]^p[o[255&l]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,l,u,c,o)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,h,f,d,p,s);var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,i,r,o,s,a){for(var l=this._nRounds,u=t[e]^n[0],c=t[e+1]^n[1],h=t[e+2]^n[2],f=t[e+3]^n[3],d=4,p=1;p>>24]^r[c>>>16&255]^o[h>>>8&255]^s[255&f]^n[d++],m=i[c>>>24]^r[h>>>16&255]^o[f>>>8&255]^s[255&u]^n[d++],v=i[h>>>24]^r[f>>>16&255]^o[u>>>8&255]^s[255&c]^n[d++],y=i[f>>>24]^r[u>>>16&255]^o[c>>>8&255]^s[255&h]^n[d++];u=g,c=m,h=v,f=y}var g=(a[u>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^n[d++],m=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^n[d++],v=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&c])^n[d++],y=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^n[d++];t[e]=g,t[e+1]=m,t[e+2]=v,t[e+3]=y},keySize:8});e.AES=i._createHelper(m)}(),function(){function e(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<>>5]>>>31-r%32&1}for(var o=this._subKeys=[],s=0;s<16;s++){for(var a=o[s]=[],h=c[s],i=0;i<24;i++)a[i/6|0]|=n[(u[i]-1+h)%28]<<31-i%6,a[4+(i/6|0)]|=n[28+(u[i+24]-1+h)%28]<<31-i%6;a[0]=a[0]<<1|a[0]>>>31;for(var i=1;i<7;i++)a[i]=a[i]>>>4*(i-1)+3;a[7]=a[7]<<5|a[7]>>>27}for(var f=this._invSubKeys=[],i=0;i<16;i++)f[i]=o[15-i]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,i,r){this._lBlock=t[i],this._rBlock=t[i+1],e.call(this,4,252645135),e.call(this,16,65535),n.call(this,2,858993459),n.call(this,8,16711935),e.call(this,1,1431655765);for(var o=0;o<16;o++){for(var s=r[o],a=this._lBlock,l=this._rBlock,u=0,c=0;c<8;c++)u|=h[c][((l^s[c])&f[c])>>>0];this._lBlock=l,this._rBlock=a^u}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,e.call(this,1,1431655765),n.call(this,8,16711935),n.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),t[i]=this._lBlock,t[i+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});i.DES=s._createHelper(d);var p=a.TripleDES=s.extend({_doReset:function(){var t=this._key,e=t.words;this._des1=d.createEncryptor(o.create(e.slice(0,2))),this._des2=d.createEncryptor(o.create(e.slice(2,4))),this._des3=d.createEncryptor(o.create(e.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});i.TripleDES=s._createHelper(p)}(),function(){function e(){for(var t=this._S,e=this._i,n=this._j,i=0,r=0;r<4;r++){e=(e+1)%256,n=(n+t[e])%256;var o=t[e];t[e]=t[n],t[n]=o,i|=t[(t[e]+t[n])%256]<<24-8*r}return this._i=e,this._j=n,i}var n=t,i=n.lib,r=i.StreamCipher,o=n.algo,s=o.RC4=r.extend({_doReset:function(){for(var t=this._key,e=t.words,n=t.sigBytes,i=this._S=[],r=0;r<256;r++)i[r]=r;for(var r=0,o=0;r<256;r++){var s=r%n,a=e[s>>>2]>>>24-s%4*8&255;o=(o+i[r]+a)%256;var l=i[r];i[r]=i[o],i[o]=l}this._i=this._j=0},_doProcessBlock:function(t,n){t[n]^=e.call(this)},keySize:8,ivSize:0});n.RC4=r._createHelper(s);var a=o.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)e.call(this)}});n.RC4Drop=r._createHelper(a)}(),t.mode.CTRGladman=function(){function e(t){if(255===(t>>24&255)){var e=t>>16&255,n=t>>8&255,i=255&t;255===e?(e=0,255===n?(n=0,255===i?i=0:++i):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=i}else t+=1<<24;return t}function n(t){return 0===(t[0]=e(t[0]))&&(t[1]=e(t[1])),t}var i=t.lib.BlockCipherMode.extend(),r=i.Encryptor=i.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),n(s);var a=s.slice(0);i.encryptBlock(a,0);for(var l=0;l>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(var n=0;n<8;n++){var i=t[n]+e[n],r=65535&i,o=i>>>16,s=((r*r>>>17)+r*o>>>15)+o*o,u=((4294901760&i)*i|0)+((65535&i)*i|0);l[n]=s^u}t[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,t[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,t[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,t[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,t[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,t[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,t[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,t[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}var n=t,i=n.lib,r=i.StreamCipher,o=n.algo,s=[],a=[],l=[],u=o.Rabbit=r.extend({_doReset:function(){for(var t=this._key.words,n=this.cfg.iv,i=0;i<4;i++)t[i]=16711935&(t[i]<<8|t[i]>>>24)|4278255360&(t[i]<<24|t[i]>>>8);var r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],o=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)e.call(this);for(var i=0;i<8;i++)o[i]^=r[i+4&7];if(n){var s=n.words,a=s[0],l=s[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),c=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),h=u>>>16|4294901760&c,f=c<<16|65535&u;o[0]^=u,o[1]^=h,o[2]^=c,o[3]^=f,o[4]^=u,o[5]^=h,o[6]^=c,o[7]^=f;for(var i=0;i<4;i++)e.call(this)}},_doProcessBlock:function(t,n){var i=this._X;e.call(this),s[0]=i[0]^i[5]>>>16^i[3]<<16,s[1]=i[2]^i[7]>>>16^i[5]<<16,s[2]=i[4]^i[1]>>>16^i[7]<<16,s[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)s[r]=16711935&(s[r]<<8|s[r]>>>24)|4278255360&(s[r]<<24|s[r]>>>8),t[n+r]^=s[r]},blockSize:4,ivSize:2});n.Rabbit=r._createHelper(u)}(),t.mode.CTR=function(){var e=t.lib.BlockCipherMode.extend(),n=e.Encryptor=e.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize,r=this._iv,o=this._counter;r&&(o=this._counter=r.slice(0),this._iv=void 0);var s=o.slice(0);n.encryptBlock(s,0),o[i-1]=o[i-1]+1|0;for(var a=0;a>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(var n=0;n<8;n++){var i=t[n]+e[n],r=65535&i,o=i>>>16,s=((r*r>>>17)+r*o>>>15)+o*o,u=((4294901760&i)*i|0)+((65535&i)*i|0);l[n]=s^u}t[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,t[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,t[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,t[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,t[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,t[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,t[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,t[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}var n=t,i=n.lib,r=i.StreamCipher,o=n.algo,s=[],a=[],l=[],u=o.RabbitLegacy=r.extend({_doReset:function(){var t=this._key.words,n=this.cfg.iv,i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var o=0;o<4;o++)e.call(this);for(var o=0;o<8;o++)r[o]^=i[o+4&7];if(n){var s=n.words,a=s[0],l=s[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),c=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),h=u>>>16|4294901760&c,f=c<<16|65535&u;r[0]^=u,r[1]^=h,r[2]^=c,r[3]^=f,r[4]^=u,r[5]^=h,r[6]^=c,r[7]^=f;for(var o=0;o<4;o++)e.call(this)}},_doProcessBlock:function(t,n){var i=this._X;e.call(this),s[0]=i[0]^i[5]>>>16^i[3]<<16,s[1]=i[2]^i[7]>>>16^i[5]<<16,s[2]=i[4]^i[1]>>>16^i[7]<<16,s[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)s[r]=16711935&(s[r]<<8|s[r]>>>24)|4278255360&(s[r]<<24|s[r]>>>8),t[n+r]^=s[r]},blockSize:4,ivSize:2});n.RabbitLegacy=r._createHelper(u)}(),t.pad.ZeroPadding={pad:function(t,e){var n=4*e;t.clamp(),t.sigBytes+=n-(t.sigBytes%n||n)},unpad:function(t){for(var e=t.words,n=t.sigBytes-1;!(e[n>>>2]>>>24-n%4*8&255);)n--;t.sigBytes=n+1}},t}),function(t,e){function n(e,n){var r,o,s,a=e.nodeName.toLowerCase();return"area"===a?(r=e.parentNode,o=r.name,!(!e.href||!o||"map"!==r.nodeName.toLowerCase())&&(s=t("img[usemap=#"+o+"]")[0],!!s&&i(s))):(/input|select|textarea|button|object/.test(a)?!e.disabled:"a"===a?e.href||n:n)&&i(e)}function i(e){return t.expr.filters.visible(e)&&!t(e).parents().andSelf().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var r=0,o=/^ui-id-\d+$/;t.ui=t.ui||{},t.ui.version||(t.extend(t.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({_focus:t.fn.focus,focus:function(e,n){return"number"==typeof e?this.each(function(){var i=this;setTimeout(function(){t(i).focus(),n&&n.call(i)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length)for(var i,r,o=t(this[0]);o.length&&o[0]!==document;){if(i=o.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(r=parseInt(o.css("zIndex"),10),!isNaN(r)&&0!==r))return r;o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++r)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(n){return!!t.data(n,e)}}):function(e,n,i){return!!t.data(e,i[3])},focusable:function(e){return n(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var i=t.attr(e,"tabindex"),r=isNaN(i);return(r||i>=0)&&n(e,!r)}}),t(function(){var e=document.body,n=e.appendChild(n=document.createElement("div"));n.offsetHeight,t.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),t.support.minHeight=100===n.offsetHeight,t.support.selectstart="onselectstart"in n,e.removeChild(n).style.display="none"}),t("").outerWidth(1).jquery||t.each(["Width","Height"],function(n,i){function r(e,n,i,r){return t.each(o,function(){n-=parseFloat(t.css(e,"padding"+this))||0,i&&(n-=parseFloat(t.css(e,"border"+this+"Width"))||0),r&&(n-=parseFloat(t.css(e,"margin"+this))||0)}),n}var o="Width"===i?["Left","Right"]:["Top","Bottom"],s=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(n){return n===e?a["inner"+i].call(this):this.each(function(){t(this).css(s,r(this,n)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(s,r(this,e,!0,n)+"px")})}}),t("").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(n){return arguments.length?e.call(this,t.camelCase(n)):e.call(this)}}(t.fn.removeData)),function(){var e=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];t.ui.ie=!!e.length,t.ui.ie6=6===parseFloat(e[1],10)}(),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,n,i){var r,o=t.ui[e].prototype;for(r in i)o.plugins[r]=o.plugins[r]||[],o.plugins[r].push([n,i[r]])},call:function(t,e,n){var i,r=t.plugins[e];if(r&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(i=0;i0||(e[i]=1,r=e[i]>0,e[i]=0,r)},isOverAxis:function(t,e,n){return t>e&&t",options:{disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),i!==this&&(t.data(i,this.widgetName,this),t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(n,i){var r,o,s,a=n;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof n)if(a={},r=n.split("."),n=r.shift(),r.length){for(o=a[n]=t.widget.extend({},this.options[n]),s=0;s=9||e.button?this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted):this._mouseUp(e)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(t){return this.mouseDelayMet},_mouseStart:function(t){},_mouseDrag:function(t){},_mouseStop:function(t){},_mouseCapture:function(t){return!0}})}(jQuery),function(t,e){function n(t,e,n){return[parseInt(t[0],10)*(f.test(t[0])?e/100:1),parseInt(t[1],10)*(f.test(t[1])?n/100:1)]}function i(e,n){return parseInt(t.css(e,n),10)||0}t.ui=t.ui||{};var r,o=Math.max,s=Math.abs,a=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\+\-]\d+%?/,h=/^\w+/,f=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(r!==e)return r;var n,i,o=t("
                "),s=o.children()[0];return t("body").append(o),n=s.offsetWidth,o.css("overflow","scroll"),i=s.offsetWidth,n===i&&(i=o[0].clientWidth),o.remove(),r=n-i},getScrollInfo:function(e){var n=e.isWindow?"":e.element.css("overflow-x"),i=e.isWindow?"":e.element.css("overflow-y"),r="scroll"===n||"auto"===n&&e.width0?"right":"center",vertical:a<0?"top":r>0?"bottom":"middle"};fo(s(r),s(a))?l.important="horizontal":l.important="vertical",e.using.call(this,t,l)}),c.offset(t.extend(T,{using:u}))})},t.ui.position={fit:{left:function(t,e){var n,i=e.within,r=i.isWindow?i.scrollLeft:i.offset.left,s=i.width,a=t.left-e.collisionPosition.marginLeft,l=r-a,u=a+e.collisionWidth-s-r;e.collisionWidth>s?l>0&&u<=0?(n=t.left+l+e.collisionWidth-s-r,t.left+=l-n):u>0&&l<=0?t.left=r:l>u?t.left=r+s-e.collisionWidth:t.left=r:l>0?t.left+=l:u>0?t.left-=u:t.left=o(t.left-a,t.left)},top:function(t,e){var n,i=e.within,r=i.isWindow?i.scrollTop:i.offset.top,s=e.within.height,a=t.top-e.collisionPosition.marginTop,l=r-a,u=a+e.collisionHeight-s-r;e.collisionHeight>s?l>0&&u<=0?(n=t.top+l+e.collisionHeight-s-r,t.top+=l-n):u>0&&l<=0?t.top=r:l>u?t.top=r+s-e.collisionHeight:t.top=r:l>0?t.top+=l:u>0?t.top-=u:t.top=o(t.top-a,t.top)}},flip:{left:function(t,e){var n,i,r=e.within,o=r.offset.left+r.scrollLeft,a=r.width,l=r.isWindow?r.scrollLeft:r.offset.left,u=t.left-e.collisionPosition.marginLeft,c=u-l,h=u+e.collisionWidth-a-l,f="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];c<0?(n=t.left+f+d+p+e.collisionWidth-a-o,(n<0||n0&&(i=t.left-e.collisionPosition.marginLeft+f+d+p-l,(i>0||s(i)c&&(i<0||i0&&(n=t.top-e.collisionPosition.marginTop+d+p+g-l,t.top+d+p+g>h&&(n>0||s(n)10&&r<11,e.innerHTML="",n.removeChild(e)}(),t.uiBackCompat!==!1&&!function(t){var n=t.fn.position;t.fn.position=function(i){if(!i||!i.offset)return n.call(this,i);var r=i.offset.split(" "),o=i.at.split(" ");return 1===r.length&&(r[1]=r[0]),/^\d/.test(r[0])&&(r[0]="+"+r[0]),/^\d/.test(r[1])&&(r[1]="+"+r[1]),1===o.length&&(/left|center|right/.test(o[0])?o[1]="center":(o[1]=o[0],o[0]="center")),n.call(this,t.extend(i,{at:o[0]+r[0]+" "+o[1]+r[1],offset:e}))}}(jQuery)}(jQuery),function(t,e){var n=0,i={},r={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.9.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n),i=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(i.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),i.collapsible||i.active!==!1&&null!=i.active||(i.active=0),i.active<0&&(i.active+=this.headers.length),this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var i=t(this),r=i.attr("id"),o=i.next(),s=o.attr("id");r||(r=e+"-header-"+n,i.attr("id",r)), +s||(s=e+"-panel-"+n,o.attr("id",s)),i.attr("aria-controls",s),o.attr("aria-labelledby",r)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(i.event)},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?void this._activate(e):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void("disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e)))},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var n=t.ui.keyCode,i=this.headers.length,r=this.headers.index(e.target),o=!1;switch(e.keyCode){case n.RIGHT:case n.DOWN:o=this.headers[(r+1)%i];break;case n.LEFT:case n.UP:o=this.headers[(r-1+i)%i];break;case n.SPACE:case n.ENTER:this._eventHandler(e);break;case n.HOME:o=this.headers[0];break;case n.END:o=this.headers[i-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),o.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e,n,i=this.options.heightStyle,r=this.element.parent();"fill"===i?(t.support.minHeight||(n=r.css("overflow"),r.css("overflow","hidden")),e=r.height(),this.element.siblings(":visible").each(function(){var n=t(this),i=n.css("position");"absolute"!==i&&"fixed"!==i&&(e-=n.outerHeight(!0))}),n&&r.css("overflow",n),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===i&&(e=0,this.headers.next().each(function(){e=Math.max(e,t(this).css("height","").height())}).height(e))},_activate:function(e){var n=this._findActive(e)[0];n!==this.active[0]&&(n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var n={};e&&(t.each(e.split(" "),function(t,e){n[e]="_eventHandler"}),this._on(this.headers,n))},_eventHandler:function(e){var n=this.options,i=this.active,r=t(e.currentTarget),o=r[0]===i[0],s=o&&n.collapsible,a=s?t():r.next(),l=i.next(),u={oldHeader:i,oldPanel:l,newHeader:s?t():r,newPanel:a};e.preventDefault(),o&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=!s&&this.headers.index(r),this.active=o?t():r,this._toggle(u),i.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),o||(r.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),r.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var n=e.newPanel,i=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=i,this.options.animate?this._animate(n,i,e):(i.hide(),n.show(),this._toggleComplete(e)),i.attr({"aria-expanded":"false","aria-hidden":"true"}),i.prev().attr("aria-selected","false"),n.length&&i.length?i.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,n){var o,s,a,l=this,u=0,c=t.length&&(!e.length||t.index()",options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var e,n,i;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(r){if(this.element.prop("readOnly"))return e=!0,i=!0,void(n=!0);e=!1,i=!1,n=!1;var o=t.ui.keyCode;switch(r.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",r);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",r);break;case o.UP:e=!0,this._keyEvent("previous",r);break;case o.DOWN:e=!0,this._keyEvent("next",r);break;case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(e=!0,r.preventDefault(),this.menu.select(r));break;case o.TAB:this.menu.active&&this.menu.select(r);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(r),r.preventDefault());break;default:n=!0,this._searchTimeout(r)}},keypress:function(i){if(e)return e=!1,void i.preventDefault();if(!n){var r=t.ui.keyCode;switch(i.keyCode){case r.PAGE_UP:this._move("previousPage",i);break;case r.PAGE_DOWN:this._move("nextPage",i);break;case r.UP:this._keyEvent("previous",i);break;case r.DOWN:this._keyEvent("next",i)}}},input:function(t){return i?(i=!1,void t.preventDefault()):void this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),void this._change(t))}}),this._initSource(),this.menu=t("
                  ").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:t(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(i){i.target===e.element[0]||i.target===n||t.contains(n,i.target)||e.close()})})},menufocus:function(e,n){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)});var i=n.item.data("ui-autocomplete-item")||n.item.data("item.autocomplete");!1!==this._trigger("focus",e,{item:i})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(i.value):this.liveRegion.text(i.value)},menuselect:function(t,e){var n=e.item.data("ui-autocomplete-item")||e.item.data("item.autocomplete"),i=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=i,this._delay(function(){this.previous=i,this.selectedItem=n})),!1!==this._trigger("select",t,{item:n})&&this._value(n.value),this.term=this._value(),this.close(t),this.selectedItem=n}}),this.liveRegion=t("",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),t.fn.bgiframe&&this.menu.element.bgiframe(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this.document.find(e||"body")[0]),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isMultiLine:function(){return!!this.element.is("textarea")||!this.element.is("input")&&this.element.prop("isContentEditable")},_initSource:function(){var e,n,i=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(n,i){i(t.ui.autocomplete.filter(e,n.term))}):"string"==typeof this.options.source?(n=this.options.source,this.source=function(e,r){i.xhr&&i.xhr.abort(),i.xhr=t.ajax({url:n,data:e,dataType:"json",success:function(t){r(t)},error:function(){r([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length").append(t("").text(n.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),void this.menu.blur()):void this.menu[t](e):void this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,n){var i=new RegExp(t.ui.autocomplete.escapeRegex(n),"i");return t.grep(e,function(t){return i.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})}(jQuery),function(t,e){var n,i,r,o,s="ui-button ui-widget ui-state-default ui-corner-all",a="ui-state-hover ui-state-active ",l="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",u=function(){var e=t(this).find(":ui-button");setTimeout(function(){e.button("refresh")},1)},c=function(e){var n=e.name,i=e.form,r=t([]);return n&&(r=i?t(i).find("[name='"+n+"']"):t("[name='"+n+"']",e.ownerDocument).filter(function(){return!this.form})),r};t.widget("ui.button",{version:"1.9.2",defaultElement:"').addClass(this._triggerClass).html(""==s?o:$("").attr({src:s,alt:o,title:o}))),t[i?"before":"after"](e.trigger),e.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==t[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=t[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(t[0])):$.datepicker._showDatepicker(t[0]),!1})}},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e=new Date(2009,11,20),n=this._get(t,"dateFormat");if(n.match(/[DM]/)){var i=function(t){for(var e=0,n=0,i=0;ie&&(e=t[i].length,n=i);return n};e.setMonth(i(this._get(t,n.match(/MM/)?"monthNames":"monthNamesShort"))),e.setDate(i(this._get(t,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-e.getDay())}t.input.attr("size",this._formatDate(t,e).length)}},_inlineDatepicker:function(t,e){var n=$(t);n.hasClass(this.markerClassName)||(n.addClass(this.markerClassName).append(e.dpDiv).bind("setData.datepicker",function(t,n,i){e.settings[n]=i}).bind("getData.datepicker",function(t,n){return this._get(e,n)}),$.data(t,PROP_NAME,e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,n,i,r){var o=this._dialogInst;if(!o){this.uuid+=1;var s="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),o=this._dialogInst=this._newInst(this._dialogInput,!1),o.settings={},$.data(this._dialogInput[0],PROP_NAME,o)}if(extendRemove(o.settings,i||{}),e=e&&e.constructor==Date?this._formatDate(o,e):e,this._dialogInput.val(e),this._pos=r?r.length?r:[r.pageX,r.pageY]:null,!this._pos){var a=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[a/2-100+u,l/2-150+c]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),o.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,o),this},_destroyDatepicker:function(t){var e=$(t),n=$.data(t,PROP_NAME);if(e.hasClass(this.markerClassName)){var i=t.nodeName.toLowerCase();$.removeData(t,PROP_NAME),"input"==i?(n.append.remove(),n.trigger.remove(),e.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!=i&&"span"!=i||e.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(t){var e=$(t),n=$.data(t,PROP_NAME);if(e.hasClass(this.markerClassName)){var i=t.nodeName.toLowerCase();if("input"==i)t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if("div"==i||"span"==i){var r=e.children("."+this._inlineClass);r.children().removeClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)}this._disabledInputs=$.map(this._disabledInputs,function(e){ +return e==t?null:e})}},_disableDatepicker:function(t){var e=$(t),n=$.data(t,PROP_NAME);if(e.hasClass(this.markerClassName)){var i=t.nodeName.toLowerCase();if("input"==i)t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if("div"==i||"span"==i){var r=e.children("."+this._inlineClass);r.children().addClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)}this._disabledInputs=$.map(this._disabledInputs,function(e){return e==t?null:e}),this._disabledInputs[this._disabledInputs.length]=t}},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e-1}},_doKeyUp:function(t){var e=$.datepicker._getInst(t.target);if(e.input.val()!=e.lastVal)try{var n=$.datepicker.parseDate($.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,$.datepicker._getFormatConfig(e));n&&($.datepicker._setDateFromField(e),$.datepicker._updateAlternate(e),$.datepicker._updateDatepicker(e))}catch(i){$.datepicker.log(i)}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!=t.nodeName.toLowerCase()&&(t=$("input",t.parentNode)[0]),!$.datepicker._isDisabledDatepicker(t)&&$.datepicker._lastInput!=t){var e=$.datepicker._getInst(t);$.datepicker._curInst&&$.datepicker._curInst!=e&&($.datepicker._curInst.dpDiv.stop(!0,!0),e&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var n=$.datepicker._get(e,"beforeShow"),i=n?n.apply(t,[t,e]):{};if(i!==!1){extendRemove(e.settings,i),e.lastVal=null,$.datepicker._lastInput=t,$.datepicker._setDateFromField(e),$.datepicker._inDialog&&(t.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(t),$.datepicker._pos[1]+=t.offsetHeight);var r=!1;$(t).parents().each(function(){return r|="fixed"==$(this).css("position"),!r});var o={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};if($.datepicker._pos=null,e.dpDiv.empty(),e.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(e),o=$.datepicker._checkOffset(e,o,r),e.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),!e.inline){var s=$.datepicker._get(e,"showAnim"),a=$.datepicker._get(e,"duration"),l=function(){var t=e.dpDiv.find("iframe.ui-datepicker-cover");if(t.length){var n=$.datepicker._getBorders(e.dpDiv);t.css({left:-n[0],top:-n[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()})}};e.dpDiv.zIndex($(t).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&($.effects.effect[s]||$.effects[s])?e.dpDiv.show(s,$.datepicker._get(e,"showOptions"),a,l):e.dpDiv[s||"show"](s?a:null,l),s&&a||l(),e.input.is(":visible")&&!e.input.is(":disabled")&&e.input.focus(),$.datepicker._curInst=e}}}},_updateDatepicker:function(t){this.maxRows=4;var e=$.datepicker._getBorders(t.dpDiv);instActive=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var n=t.dpDiv.find("iframe.ui-datepicker-cover");n.length&&n.css({left:-e[0],top:-e[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()}),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i=this._getNumberOfMonths(t),r=i[1],o=17;if(t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),r>1&&t.dpDiv.addClass("ui-datepicker-multi-"+r).css("width",o*r+"em"),t.dpDiv[(1!=i[0]||1!=i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t==$.datepicker._curInst&&$.datepicker._datepickerShowing&&t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&t.input[0]!=document.activeElement&&t.input.focus(),t.yearshtml){var s=t.yearshtml;setTimeout(function(){s===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),s=t.yearshtml=null},0)}},_getBorders:function(t){var e=function(t){return{thin:1,medium:2,thick:3}[t]||t};return[parseFloat(e(t.css("border-left-width"))),parseFloat(e(t.css("border-top-width")))]},_checkOffset:function(t,e,n){var i=t.dpDiv.outerWidth(),r=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,s=t.input?t.input.outerHeight():0,a=document.documentElement.clientWidth+(n?0:$(document).scrollLeft()),l=document.documentElement.clientHeight+(n?0:$(document).scrollTop());return e.left-=this._get(t,"isRTL")?i-o:0,e.left-=n&&e.left==t.input.offset().left?$(document).scrollLeft():0,e.top-=n&&e.top==t.input.offset().top+s?$(document).scrollTop():0,e.left-=Math.min(e.left,e.left+i>a&&a>i?Math.abs(e.left+i-a):0),e.top-=Math.min(e.top,e.top+r>l&&l>r?Math.abs(r+s):0),e},_findPos:function(t){for(var e=this._getInst(t),n=this._get(e,"isRTL");t&&("hidden"==t.type||1!=t.nodeType||$.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];var i=$(t).offset();return[i.left,i.top]},_hideDatepicker:function(t){var e=this._curInst;if(e&&(!t||e==$.data(t,PROP_NAME))&&this._datepickerShowing){var n=this._get(e,"showAnim"),i=this._get(e,"duration"),r=function(){$.datepicker._tidyDialog(e)};$.effects&&($.effects.effect[n]||$.effects[n])?e.dpDiv.hide(n,$.datepicker._get(e,"showOptions"),i,r):e.dpDiv["slideDown"==n?"slideUp":"fadeIn"==n?"fadeOut":"hide"](n?i:null,r),n||r(),this._datepickerShowing=!1;var o=this._get(e,"onClose");o&&o.apply(e.input?e.input[0]:null,[e.input?e.input.val():"",e]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if($.datepicker._curInst){var e=$(t.target),n=$.datepicker._getInst(e[0]);(e[0].id==$.datepicker._mainDivId||0!=e.parents("#"+$.datepicker._mainDivId).length||e.hasClass($.datepicker.markerClassName)||e.closest("."+$.datepicker._triggerClass).length||!$.datepicker._datepickerShowing||$.datepicker._inDialog&&$.blockUI)&&(!e.hasClass($.datepicker.markerClassName)||$.datepicker._curInst==n)||$.datepicker._hideDatepicker()}},_adjustDate:function(t,e,n){var i=$(t),r=this._getInst(i[0]);this._isDisabledDatepicker(i[0])||(this._adjustInstDate(r,e+("M"==n?this._get(r,"showCurrentAtPos"):0),n),this._updateDatepicker(r))},_gotoToday:function(t){var e=$(t),n=this._getInst(e[0]);if(this._get(n,"gotoCurrent")&&n.currentDay)n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear;else{var i=new Date;n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()}this._notifyChange(n),this._adjustDate(e)},_selectMonthYear:function(t,e,n){var i=$(t),r=this._getInst(i[0]);r["selected"+("M"==n?"Month":"Year")]=r["draw"+("M"==n?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(r),this._adjustDate(i)},_selectDay:function(t,e,n,i){var r=$(t);if(!$(i).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(r[0])){var o=this._getInst(r[0]);o.selectedDay=o.currentDay=$("a",i).html(),o.selectedMonth=o.currentMonth=e,o.selectedYear=o.currentYear=n,this._selectDate(t,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear))}},_clearDate:function(t){var e=$(t);this._getInst(e[0]);this._selectDate(e,"")},_selectDate:function(t,e){var n=$(t),i=this._getInst(n[0]);e=null!=e?e:this._formatDate(i),i.input&&i.input.val(e),this._updateAlternate(i);var r=this._get(i,"onSelect");r?r.apply(i.input?i.input[0]:null,[e,i]):i.input&&i.input.trigger("change"),i.inline?this._updateDatepicker(i):(this._hideDatepicker(),this._lastInput=i.input[0],"object"!=typeof i.input[0]&&i.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var e=this._get(t,"altField");if(e){var n=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),r=this.formatDate(n,i,this._getFormatConfig(t));$(e).each(function(){$(this).val(r)})}},noWeekends:function(t){var e=t.getDay();return[e>0&&e<6,""]},iso8601Week:function(t){var e=new Date(t.getTime());e.setDate(e.getDate()+4-(e.getDay()||7));var n=e.getTime();return e.setMonth(0),e.setDate(1),Math.floor(Math.round((n-e)/864e5)/7)+1},parseDate:function(t,e,n){if(null==t||null==e)throw"Invalid arguments";if(e="object"==typeof e?e.toString():e+"",""==e)return null;var i=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff;i="string"!=typeof i?i:(new Date).getFullYear()%100+parseInt(i,10);for(var r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,o=(n?n.dayNames:null)||this._defaults.dayNames,s=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,a=(n?n.monthNames:null)||this._defaults.monthNames,l=-1,u=-1,c=-1,h=-1,f=!1,d=function(e){var n=y+1-1)for(u=1,c=h;;){var _=this._getDaysInMonth(l,u-1);if(c<=_)break;u++,c-=_}var b=this._daylightSavingAdjust(new Date(l,u-1,c));if(b.getFullYear()!=l||b.getMonth()+1!=u||b.getDate()!=c)throw"Invalid date";return b},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,n){if(!e)return"";var i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,r=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,s=(n?n.monthNames:null)||this._defaults.monthNames,a=function(e){var n=f+112?t.getHours()+2:0),t):null},_setDate:function(t,e,n){var i=!e,r=t.selectedMonth,o=t.selectedYear,s=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=s.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=s.getMonth(),t.drawYear=t.selectedYear=t.currentYear=s.getFullYear(),r==t.selectedMonth&&o==t.selectedYear||n||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(i?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""==t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),n="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,-e,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,+e,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(n)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e=new Date;e=this._daylightSavingAdjust(new Date(e.getFullYear(),e.getMonth(),e.getDate()));var n=this._get(t,"isRTL"),i=this._get(t,"showButtonPanel"),r=this._get(t,"hideIfNoPrevNext"),o=this._get(t,"navigationAsDateFormat"),s=this._getNumberOfMonths(t),a=this._get(t,"showCurrentAtPos"),l=this._get(t,"stepMonths"),u=1!=s[0]||1!=s[1],c=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),h=this._getMinMaxDate(t,"min"),f=this._getMinMaxDate(t,"max"),d=t.drawMonth-a,p=t.drawYear;if(d<0&&(d+=12,p--),f){var g=this._daylightSavingAdjust(new Date(f.getFullYear(),f.getMonth()-s[0]*s[1]+1,f.getDate()));for(g=h&&gg;)d--,d<0&&(d=11,p--)}t.drawMonth=d,t.drawYear=p;var m=this._get(t,"prevText");m=o?this.formatDate(m,this._daylightSavingAdjust(new Date(p,d-l,1)),this._getFormatConfig(t)):m;var v=this._canAdjustMonth(t,-1,p,d)?''+m+"":r?"":''+m+"",y=this._get(t,"nextText");y=o?this.formatDate(y,this._daylightSavingAdjust(new Date(p,d+l,1)),this._getFormatConfig(t)):y;var b=this._canAdjustMonth(t,1,p,d)?''+y+"":r?"":''+y+"",w=this._get(t,"currentText"),_=this._get(t,"gotoCurrent")&&t.currentDay?c:e;w=o?this.formatDate(w,_,this._getFormatConfig(t)):w;var x=t.inline?"":'",k=i?'
                  '+(n?x:"")+(this._isInRange(t,_)?'":"")+(n?"":x)+"
                  ":"",S=parseInt(this._get(t,"firstDay"),10);S=isNaN(S)?0:S;for(var C=this._get(t,"showWeek"),T=this._get(t,"dayNames"),E=(this._get(t,"dayNamesShort"),this._get(t,"dayNamesMin")),P=this._get(t,"monthNames"),O=this._get(t,"monthNamesShort"),M=this._get(t,"beforeShowDay"),A=this._get(t,"showOtherMonths"),D=this._get(t,"selectOtherMonths"),L=(this._get(t,"calculateWeek")||this.iso8601Week,this._getDefaultDate(t)),I="",R=0;R1)switch(z){case 0:F+=" ui-datepicker-group-first",H=" ui-corner-"+(n?"right":"left");break;case s[1]-1:F+=" ui-datepicker-group-last",H=" ui-corner-"+(n?"left":"right");break;default:F+=" ui-datepicker-group-middle",H=""}F+='">'}F+='
                  '+(/all|left/.test(H)&&0==R?n?b:v:"")+(/all|right/.test(H)&&0==R?n?v:b:"")+this._generateMonthYearHeader(t,d,p,h,f,R>0||z>0,P,O)+'
                  ';for(var W=C?'":"",B=0;B<7;B++){var U=(B+S)%7;W+="=5?' class="ui-datepicker-week-end"':"")+'>'+E[U]+""}F+=W+"";var q=this._getDaysInMonth(p,d);p==t.selectedYear&&d==t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,q));var Y=(this._getFirstDayOfMonth(p,d)-S+7)%7,V=Math.ceil((Y+q)/7),K=u&&this.maxRows>V?this.maxRows:V;this.maxRows=K;for(var G=this._daylightSavingAdjust(new Date(p,d,1-Y)),X=0;X";for(var J=C?'":"",B=0;B<7;B++){var Z=M?M.apply(t.input?t.input[0]:null,[G]):[!0,""],Q=G.getMonth()!=d,tt=Q&&!D||!Z[0]||h&&Gf;J+='",G.setDate(G.getDate()+1),G=this._daylightSavingAdjust(G)}F+=J+""}d++,d>11&&(d=0,p++),F+="
                  '+this._get(t,"weekHeader")+"
                  '+this._get(t,"calculateWeek")(G)+""+(Q&&!A?" ":tt?''+G.getDate()+"":''+G.getDate()+"")+"
                  "+(u?""+(s[0]>0&&z==s[1]-1?'
                  ':""):""),N+=F}I+=N}return I+=k+($.ui.ie6&&!t.inline?'':""),t._keyEvent=!1,I},_generateMonthYearHeader:function(t,e,n,i,r,o,s,a){var l=this._get(t,"changeMonth"),u=this._get(t,"changeYear"),c=this._get(t,"showMonthAfterYear"),h='
                  ',f="";if(o||!l)f+=''+s[e]+"";else{var d=i&&i.getFullYear()==n,p=r&&r.getFullYear()==n;f+='"}if(c||(h+=f+(!o&&l&&u?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!u)h+=''+n+"";else{var m=this._get(t,"yearRange").split(":"),v=(new Date).getFullYear(),y=function(t){var e=t.match(/c[+-].*/)?n+parseInt(t.substring(1),10):t.match(/[+-].*/)?v+parseInt(t,10):parseInt(t,10);return isNaN(e)?v:e},b=y(m[0]),w=Math.max(b,y(m[1]||""));for(b=i?Math.max(b,i.getFullYear()):b,w=r?Math.min(w,r.getFullYear()):w,t.yearshtml+='",h+=t.yearshtml,t.yearshtml=null}return h+=this._get(t,"yearSuffix"),c&&(h+=(!o&&l&&u?"":" ")+f),h+="
                  "},_adjustInstDate:function(t,e,n){var i=t.drawYear+("Y"==n?e:0),r=t.drawMonth+("M"==n?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(i,r))+("D"==n?e:0),s=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(i,r,o)));t.selectedDay=s.getDate(),t.drawMonth=t.selectedMonth=s.getMonth(),t.drawYear=t.selectedYear=s.getFullYear(),"M"!=n&&"Y"!=n||this._notifyChange(t)},_restrictMinMax:function(t,e){var n=this._getMinMaxDate(t,"min"),i=this._getMinMaxDate(t,"max"),r=n&&ei?i:r},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,n,i){var r=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(n,i+(e<0?e:r[0]*r[1]),1));return e<0&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var n=this._getMinMaxDate(t,"min"),i=this._getMinMaxDate(t,"max");return(!n||e.getTime()>=n.getTime())&&(!i||e.getTime()<=i.getTime())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,n,i){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var r=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(i,n,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),r,this._getFormatConfig(t))}}),$.fn.datepicker=function(t){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var e=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!=t&&"getDate"!=t&&"widget"!=t?"option"==t&&2==arguments.length&&"string"==typeof arguments[1]?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this].concat(e)):$.datepicker._attachDatepicker(this,t)}):$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(t,e){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",i={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},r={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var n=t(this).css(e).offset().top;n<0&&t(this).css("top",e.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),"string"!=typeof this.originalTitle&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var e,i,r,o,s,a=this,l=this.options,u=l.title||" ";e=(this.uiDialog=t("
                  ")).addClass(n+l.dialogClass).css({display:"none",outline:0,zIndex:l.zIndex}).attr("tabIndex",-1).keydown(function(e){l.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE&&(a.close(e),e.preventDefault())}).mousedown(function(t){a.moveToTop(!1,t)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(e),i=(this.uiDialogTitlebar=t("
                  ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){e.focus()}).prependTo(e),r=t("").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(t){t.preventDefault(),a.close(t)}).appendTo(i),(this.uiDialogTitlebarCloseText=t("")).addClass("ui-icon ui-icon-closethick").text(l.closeText).appendTo(r),o=t("").uniqueId().addClass("ui-dialog-title").html(u).prependTo(i),s=(this.uiDialogButtonPane=t("
                  ")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=t("
                  ")).addClass("ui-dialog-buttonset").appendTo(s),e.attr({role:"dialog","aria-labelledby":o.attr("id")}),i.find("*").add(i).disableSelection(),this._hoverable(r),this._focusable(r),l.draggable&&t.fn.draggable&&this._makeDraggable(),l.resizable&&t.fn.resizable&&this._makeResizable(),this._createButtons(l.buttons),this._isOpen=!1,t.fn.bgiframe&&e.bgiframe(),this._on(e,{keydown:function(n){if(l.modal&&n.keyCode===t.ui.keyCode.TAB){var i=t(":tabbable",e),r=i.filter(":first"),o=i.filter(":last");return n.target!==o[0]||n.shiftKey?n.target===r[0]&&n.shiftKey?(o.focus(1),!1):void 0:(r.focus(1),!1)}}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var t,e=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(e){var n,i,r=this;if(this._isOpen&&!1!==this._trigger("beforeClose",e))return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){r._trigger("close",e); +}):(this.uiDialog.hide(),this._trigger("close",e)),t.ui.dialog.overlay.resize(),this.options.modal&&(n=0,t(".ui-dialog").each(function(){this!==r.uiDialog[0]&&(i=t(this).css("z-index"),isNaN(i)||(n=Math.max(n,i)))}),t.ui.dialog.maxZ=n),this},isOpen:function(){return this._isOpen},moveToTop:function(e,n){var i,r=this.options;return r.modal&&!e||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>t.ui.dialog.maxZ&&(t.ui.dialog.maxZ=r.zIndex),this.overlay&&(t.ui.dialog.maxZ+=1,t.ui.dialog.overlay.maxZ=t.ui.dialog.maxZ,this.overlay.$el.css("z-index",t.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},t.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",t.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(!this._isOpen){var e,n=this.options,i=this.uiDialog;return this._size(),this._position(n.position),i.show(n.show),this.overlay=n.modal?new t.ui.dialog.overlay(this):null,this.moveToTop(!0),e=this.element.find(":tabbable"),e.length||(e=this.uiDialogButtonPane.find(":tabbable"),e.length||(e=i)),e.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this}},_createButtons:function(e){var n=this,i=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),"object"==typeof e&&null!==e&&t.each(e,function(){return!(i=!0)}),i?(t.each(e,function(e,i){var r,o;i=t.isFunction(i)?{click:i,text:e}:i,i=t.extend({type:"button"},i),o=i.click,i.click=function(){o.apply(n.element[0],arguments)},r=t("",i).appendTo(n.uiButtonSet),t.fn.button&&r.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var n=this,i=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,r){t(this).addClass("ui-dialog-dragging"),n._trigger("dragStart",i,e(r))},drag:function(t,i){n._trigger("drag",t,e(i))},stop:function(r,o){i.position=[o.position.left-n.document.scrollLeft(),o.position.top-n.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),n._trigger("dragStop",r,e(o)),t.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function i(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}n=n===e?this.options.resizable:n;var r=this,o=this.options,s=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:a,start:function(e,n){t(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",e,i(n))},resize:function(t,e){r._trigger("resize",t,i(e))},stop:function(e,n){t(this).removeClass("ui-dialog-resizing"),o.height=t(this).height(),o.width=t(this).width(),r._trigger("resizeStop",e,i(n)),t.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(e){var n,i=[],r=[0,0];e?(("string"==typeof e||"object"==typeof e&&"0"in e)&&(i=e.split?e.split(" "):[e[0],e[1]],1===i.length&&(i[1]=i[0]),t.each(["left","top"],function(t,e){+i[t]===i[t]&&(r[t]=i[t],i[t]=e)}),e={my:i[0]+(r[0]<0?r[0]:"+"+r[0])+" "+i[1]+(r[1]<0?r[1]:"+"+r[1]),at:i.join(" ")}),e=t.extend({},t.ui.dialog.prototype.options.position,e)):e=t.ui.dialog.prototype.options.position,n=this.uiDialog.is(":visible"),n||this.uiDialog.show(),this.uiDialog.position(e),n||this.uiDialog.hide()},_setOptions:function(e){var n=this,o={},s=!1;t.each(e,function(t,e){n._setOption(t,e),t in i&&(s=!0),t in r&&(o[t]=e)}),s&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,i){var r,o,s=this.uiDialog;switch(e){case"buttons":this._createButtons(i);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+i);break;case"dialogClass":s.removeClass(this.options.dialogClass).addClass(n+i);break;case"disabled":i?s.addClass("ui-dialog-disabled"):s.removeClass("ui-dialog-disabled");break;case"draggable":r=s.is(":data(draggable)"),r&&!i&&s.draggable("destroy"),!r&&i&&this._makeDraggable();break;case"position":this._position(i);break;case"resizable":o=s.is(":data(resizable)"),o&&!i&&s.resizable("destroy"),o&&"string"==typeof i&&s.resizable("option","handles",i),o||i===!1||this._makeResizable(i);break;case"title":t(".ui-dialog-title",this.uiDialogTitlebar).html(""+(i||" "))}this._super(e,i)},_size:function(){var e,n,i,r=this.options,o=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),n=Math.max(0,r.minHeight-e),"auto"===r.height?t.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),i=this.element.css("height","auto").height(),o||this.uiDialog.hide(),this.element.height(Math.max(i,n))):this.element.height(Math.max(r.height-e,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),t.extend(t.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(t){var e=t.attr("id");return e||(this.uuid+=1,e=this.uuid),"ui-dialog-title-"+e},overlay:function(e){this.$el=t.ui.dialog.overlay.create(e)}}),t.extend(t.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:t.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(t){return t+".dialog-overlay"}).join(" "),create:function(e){0===this.instances.length&&(setTimeout(function(){t.ui.dialog.overlay.instances.length&&t(document).bind(t.ui.dialog.overlay.events,function(e){if(t(e.target).zIndex()").addClass("ui-widget-overlay");return t(document).bind("keydown.dialog-overlay",function(i){var r=t.ui.dialog.overlay.instances;0!==r.length&&r[r.length-1]===n&&e.options.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===t.ui.keyCode.ESCAPE&&(e.close(i),i.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),t.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(e){var n=t.inArray(e,this.instances),i=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),0===this.instances.length&&t([document,window]).unbind(".dialog-overlay"),e.height(0).width(0).remove(),t.each(this.instances,function(){i=Math.max(i,this.css("z-index"))}),this.maxZ=i},height:function(){var e,n;return t.ui.ie?(e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),e
                  ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0))},_mouseStart:function(e){var n=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,n){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!n){var i=this._uiHash();if(this._trigger("drag",e,i)===!1)return this._mouseUp({}),!1;this.position=i.position}return this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var n=!1;t.ui.ddmanager&&!this.options.dropBehaviour&&(n=t.ui.ddmanager.drop(this,e)),this.dropped&&(n=this.dropped,this.dropped=!1);for(var i=this.element[0],r=!1;i&&(i=i.parentNode);)i==document&&(r=!0);if(!r&&"original"===this.options.helper)return!1;if("invalid"==this.options.revert&&!n||"valid"==this.options.revert&&n||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var o=this;t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){o._trigger("stop",e)!==!1&&o._clear()})}else this._trigger("stop",e)!==!1&&this._clear();return!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){var n=!this.options.handle||!t(this.options.handle,this.element).length;return t(this.options.handle,this.element).find("*").andSelf().each(function(){this==e.target&&(n=!0)}),n},_createHelper:function(e){var n=this.options,i=t.isFunction(n.helper)?t(n.helper.apply(this.element[0],[e])):"clone"==n.helper?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo("parent"==n.appendTo?this.element[0].parentNode:n.appendTo),i[0]==this.element[0]||/(fixed|absolute)/.test(i.css("position"))||i.css("position","absolute"),i},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),"document"!=e.containment&&"window"!=e.containment||(this.containment=["document"==e.containment?0:t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"==e.containment?0:t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"==e.containment?0:t(window).scrollLeft())+t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==e.containment?0:t(window).scrollTop())+(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(e.containment)||e.containment.constructor==Array)e.containment.constructor==Array&&(this.containment=e.containment);else{var n=t(e.containment),i=n[0];if(!i)return;var r=(n.offset(),"hidden"!=t(i).css("overflow"));this.containment=[(parseInt(t(i).css("borderLeftWidth"),10)||0)+(parseInt(t(i).css("paddingLeft"),10)||0),(parseInt(t(i).css("borderTopWidth"),10)||0)+(parseInt(t(i).css("paddingTop"),10)||0),(r?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t(i).css("borderLeftWidth"),10)||0)-(parseInt(t(i).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(r?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t(i).css("borderTopWidth"),10)||0)-(parseInt(t(i).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}},_convertPositionTo:function(e,n){n||(n=this.position);var i="absolute"==e?1:-1,r=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),o=/(html|body)/i.test(r[0].tagName);return{top:n.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():o?0:r.scrollTop())*i,left:n.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():o?0:r.scrollLeft())*i}},_generatePosition:function(e){var n=this.options,i="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(i[0].tagName),o=e.pageX,s=e.pageY;if(this.originalPosition){var a;if(this.containment){if(this.relative_container){var l=this.relative_container.offset();a=[this.containment[0]+l.left,this.containment[1]+l.top,this.containment[2]+l.left,this.containment[3]+l.top]}else a=this.containment;e.pageX-this.offset.click.lefta[2]&&(o=a[2]+this.offset.click.left),e.pageY-this.offset.click.top>a[3]&&(s=a[3]+this.offset.click.top)}if(n.grid){var u=n.grid[1]?this.originalPageY+Math.round((s-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;s=a&&(u-this.offset.click.topa[3])?u-this.offset.click.topa[2])?c-this.offset.click.left=0;c--){var h=i.snapElements[c].left,f=h+i.snapElements[c].width,d=i.snapElements[c].top,p=d+i.snapElements[c].height;if(h-o=c&&s<=h||a>=c&&a<=h||sh)&&(r>=l&&r<=u||o>=l&&o<=u||ru);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,n){var i=t.ui.ddmanager.droppables[e.options.scope]||[],r=n?n.type:null,o=(e.currentItem||e.element).find(":data(droppable)").andSelf();t:for(var s=0;st?0:i.max")[0],g=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,g(h,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),c.fn=e.extend(c.prototype,{parse:function(o,a,l,u){if(o===n)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=e(o).css(a),a=n);var f=this,d=e.type(o),p=this._rgba=[];return a!==n&&(o=[o,a,l,u],d="array"),"string"===d?this.parse(r(o)||s._default):"array"===d?(g(h.rgba.props,function(t,e){p[e.idx]=i(o[e.idx],e)}),this):"object"===d?(o instanceof c?g(h,function(t,e){o[e.cache]&&(f[e.cache]=o[e.cache].slice())}):g(h,function(e,n){var r=n.cache;g(n.props,function(t,e){if(!f[r]&&n.to){if("alpha"===t||null==o[t])return;f[r]=n.to(f._rgba)}f[r][e.idx]=i(o[t],e,!0)}),f[r]&&t.inArray(null,f[r].slice(0,3))<0&&(f[r][3]=1,n.from&&(f._rgba=n.from(f[r])))}),this):void 0},is:function(t){var e=c(t),n=!0,i=this;return g(h,function(t,r){var o,s=e[r.cache];return s&&(o=i[r.cache]||r.to&&r.to(i._rgba)||[],g(r.props,function(t,e){if(null!=s[e.idx])return n=s[e.idx]===o[e.idx]})),n}),n},_space:function(){var t=[],e=this;return g(h,function(n,i){e[i.cache]&&t.push(n)}),t.pop()},transition:function(t,e){var n=c(t),r=n._space(),o=h[r],s=0===this.alpha()?c("transparent"):this,a=s[o.cache]||o.to(s._rgba),l=a.slice();return n=n[o.cache],g(o.props,function(t,r){var o=r.idx,s=a[o],u=n[o],c=f[r.type]||{};null!==u&&(null===s?l[o]=u:(c.mod&&(u-s>c.mod/2?s+=c.mod:s-u>c.mod/2&&(s-=c.mod)),l[o]=i((u-s)*e+s,r)))}),this[r](l)},blend:function(t){if(1===this._rgba[3])return this;var n=this._rgba.slice(),i=n.pop(),r=c(t)._rgba;return c(e.map(n,function(t,e){return(1-i)*r[e]+i*t}))},toRgbaString:function(){var t="rgba(",n=e.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===n[3]&&(n.pop(),t="rgb("),t+n.join()+")"},toHslaString:function(){var t="hsla(",n=e.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&e<3&&(t=Math.round(100*t)+"%"),t});return 1===n[3]&&(n.pop(),t="hsl("),t+n.join()+")"},toHexString:function(t){var n=this._rgba.slice(),i=n.pop();return t&&n.push(~~(255*i)),"#"+e.map(n,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),c.fn.parse.prototype=c.fn,h.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,s=t[3],a=Math.max(i,r,o),l=Math.min(i,r,o),u=a-l,c=a+l,h=.5*c;return e=l===a?0:i===a?60*(r-o)/u+360:r===a?60*(o-i)/u+120:60*(i-r)/u+240,n=0===h||1===h?h:h<=.5?u/c:u/(2-c),[Math.round(e)%360,n,h,null==s?1:s]},h.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,n=t[1],i=t[2],r=t[3],s=i<=.5?i*(1+n):i+n-i*n,a=2*i-s;return[Math.round(255*o(a,s,e+1/3)),Math.round(255*o(a,s,e)),Math.round(255*o(a,s,e-1/3)),r]},g(h,function(t,r){var o=r.props,s=r.cache,a=r.to,u=r.from;c.fn[t]=function(t){if(a&&!this[s]&&(this[s]=a(this._rgba)),t===n)return this[s].slice();var r,l=e.type(t),h="array"===l||"object"===l?t:arguments,f=this[s].slice();return g(o,function(t,e){var n=h["object"===l?t:e.idx];null==n&&(n=f[e.idx]),f[e.idx]=i(n,e)}),u?(r=c(u(f)),r[s]=f,r):c(f)},g(o,function(n,i){c.fn[n]||(c.fn[n]=function(r){var o,s=e.type(r),a="alpha"===n?this._hsla?"hsla":"rgba":t,u=this[a](),c=u[i.idx];return"undefined"===s?c:("function"===s&&(r=r.call(this,c),s=e.type(r)),null==r&&i.empty?this:("string"===s&&(o=l.exec(r),o&&(r=c+parseFloat(o[2])*("+"===o[1]?1:-1))),u[i.idx]=r,this[a](u)))})})}),g(a,function(t,n){e.cssHooks[n]={set:function(t,i){var o,s,a="";if("string"!==e.type(i)||(o=r(i))){if(i=c(o||i),!d.rgba&&1!==i._rgba[3]){for(s="backgroundColor"===n?t.parentNode:t;(""===a||"transparent"===a)&&s&&s.style;)try{a=e.css(s,"backgroundColor"),s=s.parentNode}catch(l){}i=i.blend(a&&"transparent"!==a?a:"_default")}i=i.toRgbaString()}try{t.style[n]=i}catch(u){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=c(t.elem,n),t.end=c(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos))}}),e.cssHooks.borderColor={expand:function(t){var e={};return g(["Top","Right","Bottom","Left"],function(n,i){e["border"+i+"Color"]=t}),e}},s=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function n(){var e,n,i=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,r={};if(i&&i.length&&i[0]&&i[i[0]])for(n=i.length;n--;)e=i[n],"string"==typeof i[e]&&(r[t.camelCase(e)]=i[e]);else for(e in i)"string"==typeof i[e]&&(r[e]=i[e]);return r}function i(e,n){var i,r,s={};for(i in n)r=n[i],e[i]!==r&&(o[i]||!t.fx.step[i]&&isNaN(parseFloat(r))||(s[i]=r));return s}var r=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,n){t.fx.step[n]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,n,t.end),t.setAttr=!0)}}),t.effects.animateClass=function(e,o,s,a){var l=t.speed(o,s,a);return this.queue(function(){var o,s=t(this),a=s.attr("class")||"",u=l.children?s.find("*").andSelf():s;u=u.map(function(){var e=t(this);return{el:e,start:n.call(this)}}),o=function(){t.each(r,function(t,n){e[n]&&s[n+"Class"](e[n])})},o(),u=u.map(function(){return this.end=n.call(this.el[0]),this.diff=i(this.start,this.end),this}),s.attr("class",a),u=u.map(function(){var e=this,n=t.Deferred(),i=jQuery.extend({},l,{queue:!1,complete:function(){n.resolve(e)}});return this.el.animate(this.diff,i),n.promise()}),t.when.apply(t,u.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(s[0])})})},t.fn.extend({_addClass:t.fn.addClass,addClass:function(e,n,i,r){return n?t.effects.animateClass.call(this,{add:e},n,i,r):this._addClass(e)},_removeClass:t.fn.removeClass,removeClass:function(e,n,i,r){return n?t.effects.animateClass.call(this,{remove:e},n,i,r):this._removeClass(e)},_toggleClass:t.fn.toggleClass,toggleClass:function(n,i,r,o,s){return"boolean"==typeof i||i===e?r?t.effects.animateClass.call(this,i?{add:n}:{remove:n},r,o,s):this._toggleClass(n,i):t.effects.animateClass.call(this,{toggle:n},i,r,o)},switchClass:function(e,n,i,r,o){return t.effects.animateClass.call(this,{add:n,remove:e},i,r,o)}})}(),function(){function r(e,n,i,r){return t.isPlainObject(e)&&(n=e,e=e.effect),e={effect:e},null==n&&(n={}),t.isFunction(n)&&(r=n,i=null,n={}),("number"==typeof n||t.fx.speeds[n])&&(r=i,i=n,n={}),t.isFunction(i)&&(r=i,i=null),n&&t.extend(e,n),i=i||n.duration,e.duration=t.fx.off?0:"number"==typeof i?i:i in t.fx.speeds?t.fx.speeds[i]:t.fx.speeds._default,e.complete=r||n.complete,e}function o(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||"string"==typeof e&&!t.effects.effect[e]&&(!n||!t.effects[e])}t.extend(t.effects,{version:"1.9.2",save:function(t,e){for(var n=0;n
                  ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),r={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(s){o=document.body}return e.wrap(i),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),i=e.parent(),"static"===e.css("position")?(i.css({position:"relative"}),e.css({position:"relative"})):(t.extend(n,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,i){n[i]=e.css(i),isNaN(parseInt(n[i],10))&&(n[i]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(r),i.css(n).show()},removeWrapper:function(e){var n=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===n||t.contains(e[0],n))&&t(n).focus()),e},setTransition:function(e,n,i,r){return r=r||{},t.each(n,function(t,n){var o=e.cssUnit(n);o[0]>0&&(r[n]=o[0]*i+o[1])}),r}}),t.fn.extend({effect:function(){function e(e){function n(){t.isFunction(o)&&o.call(r[0]),t.isFunction(e)&&e()}var r=t(this),o=i.complete,s=i.mode;(r.is(":hidden")?"hide"===s:"show"===s)?n():a.call(r[0],i,n)}var i=r.apply(this,arguments),o=i.mode,s=i.queue,a=t.effects.effect[i.effect],l=!a&&n&&t.effects[i.effect];return t.fx.off||!a&&!l?o?this[o](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a?s===!1?this.each(e):this.queue(s||"fx",e):l.call(this,{options:i,duration:i.duration,callback:i.complete,mode:i.mode})},_show:t.fn.show,show:function(t){if(o(t))return this._show.apply(this,arguments);var e=r.apply(this,arguments);return e.mode="show",this.effect.call(this,e)},_hide:t.fn.hide,hide:function(t){if(o(t))return this._hide.apply(this,arguments);var e=r.apply(this,arguments);return e.mode="hide",this.effect.call(this,e)},__toggle:t.fn.toggle,toggle:function(e){if(o(e)||"boolean"==typeof e||t.isFunction(e))return this.__toggle.apply(this,arguments);var n=r.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(e){var n=this.css(e),i=[];return t.each(["em","px","%","pt"],function(t,e){n.indexOf(e)>0&&(i=[parseFloat(n),e])}),i}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,n){e[n]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,n){t.easing["easeIn"+e]=n,t.easing["easeOut"+e]=function(t){return 1-n(1-t)},t.easing["easeInOut"+e]=function(t){return t<.5?n(2*t)/2:1-n(t*-2+2)/2}})}()}(jQuery),function(t,e){var n=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(e,r){var o,s,a,l=t(this),u=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,e.mode||"hide"),h=e.direction||"up",f=n.test(h),d=f?"height":"width",p=f?"top":"left",g=i.test(h),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),u):t.effects.save(l,u),l.show(),o=t.effects.createWrapper(l).css({overflow:"hidden"}),s=o[d](),a=parseFloat(o.css(p))||0,m[d]=v?s:0,g||(l.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),m[p]=v?a:s+a),v&&(o.css(d,0),g||o.css(p,a+s)),o.animate(m,{duration:e.duration,easing:e.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,u),t.effects.removeWrapper(l),r()}})}}(jQuery),function(t,e){t.effects.effect.bounce=function(e,n){var i,r,o,s=t(this),a=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(s,e.mode||"effect"),u="hide"===l,c="show"===l,h=e.direction||"up",f=e.distance,d=e.times||5,p=2*d+(c||u?1:0),g=e.duration/p,m=e.easing,v="up"===h||"down"===h?"top":"left",y="up"===h||"left"===h,b=s.queue(),w=b.length;for((c||u)&&a.push("opacity"),t.effects.save(s,a),s.show(),t.effects.createWrapper(s),f||(f=s["top"===v?"outerHeight":"outerWidth"]()/3),c&&(o={opacity:1},o[v]=0,s.css("opacity",0).css(v,y?2*-f:2*f).animate(o,g,m)),u&&(f/=Math.pow(2,d-1)),o={},o[v]=0,i=0;i1&&b.splice.apply(b,[1,0].concat(b.splice(w,p+1))),s.dequeue()}}(jQuery),function(t,e){t.effects.effect.clip=function(e,n){var i,r,o,s=t(this),a=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(s,e.mode||"hide"),u="show"===l,c=e.direction||"vertical",h="vertical"===c,f=h?"height":"width",d=h?"top":"left",p={};t.effects.save(s,a),s.show(),i=t.effects.createWrapper(s).css({overflow:"hidden"}),r="IMG"===s[0].tagName?i:s,o=r[f](),u&&(r.css(f,0),r.css(d,o/2)),p[f]=u?o:0,p[d]=u?0:o/2,r.animate(p,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){u||s.hide(),t.effects.restore(s,a),t.effects.removeWrapper(s),n()}})}}(jQuery),function(t,e){t.effects.effect.drop=function(e,n){var i,r=t(this),o=["position","top","bottom","left","right","opacity","height","width"],s=t.effects.setMode(r,e.mode||"hide"),a="show"===s,l=e.direction||"left",u="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",h={opacity:a?1:0};t.effects.save(r,o),r.show(),t.effects.createWrapper(r),i=e.distance||r["top"===u?"outerHeight":"outerWidth"](!0)/2,a&&r.css("opacity",0).css(u,"pos"===c?-i:i),h[u]=(a?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+i,r.animate(h,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===s&&r.hide(),t.effects.restore(r,o),t.effects.removeWrapper(r),n()}})}}(jQuery),function(t,e){t.effects.effect.explode=function(e,n){function i(){b.push(this),b.length===h*f&&r()}function r(){d.css({visibility:"visible"}),t(b).remove(),g||d.hide(),n()}var o,s,a,l,u,c,h=e.pieces?Math.round(Math.sqrt(e.pieces)):3,f=h,d=t(this),p=t.effects.setMode(d,e.mode||"hide"),g="show"===p,m=d.show().css("visibility","hidden").offset(),v=Math.ceil(d.outerWidth()/f),y=Math.ceil(d.outerHeight()/h),b=[];for(o=0;o
                  ").css({position:"absolute",visibility:"visible",left:-s*v,top:-o*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:a+(g?u*v:0),top:l+(g?c*y:0),opacity:g?0:1}).animate({left:a+(g?0:u*v),top:l+(g?0:c*y),opacity:g?1:0},e.duration||500,e.easing,i)}}(jQuery),function(t,e){t.effects.effect.fade=function(e,n){var i=t(this),r=t.effects.setMode(i,e.mode||"toggle");i.animate({opacity:r},{queue:!1,duration:e.duration,easing:e.easing,complete:n})}}(jQuery),function(t,e){t.effects.effect.fold=function(e,n){var i,r,o=t(this),s=["position","top","bottom","left","right","height","width"],a=t.effects.setMode(o,e.mode||"hide"),l="show"===a,u="hide"===a,c=e.size||15,h=/([0-9]+)%/.exec(c),f=!!e.horizFirst,d=l!==f,p=d?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(o,s),o.show(),i=t.effects.createWrapper(o).css({overflow:"hidden"}),r=d?[i.width(),i.height()]:[i.height(),i.width()],h&&(c=parseInt(h[1],10)/100*r[u?0:1]),l&&i.css(f?{height:0,width:c}:{height:c,width:0}),m[p[0]]=l?r[0]:c,v[p[1]]=l?r[1]:0,i.animate(m,g,e.easing).animate(v,g,e.easing,function(){u&&o.hide(),t.effects.restore(o,s),t.effects.removeWrapper(o),n()})}}(jQuery),function(t,e){t.effects.effect.highlight=function(e,n){var i=t(this),r=["backgroundImage","backgroundColor","opacity"],o=t.effects.setMode(i,e.mode||"show"),s={backgroundColor:i.css("backgroundColor")};"hide"===o&&(s.opacity=0),t.effects.save(i,r),i.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(s,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&i.hide(),t.effects.restore(i,r),n()}})}}(jQuery),function(t,e){t.effects.effect.pulsate=function(e,n){var i,r=t(this),o=t.effects.setMode(r,e.mode||"show"),s="show"===o,a="hide"===o,l=s||"hide"===o,u=2*(e.times||5)+(l?1:0),c=e.duration/u,h=0,f=r.queue(),d=f.length;for(!s&&r.is(":visible")||(r.css("opacity",0).show(),h=1),i=1;i1&&f.splice.apply(f,[1,0].concat(f.splice(d,u+1))),r.dequeue()}}(jQuery),function(t,e){t.effects.effect.puff=function(e,n){var i=t(this),r=t.effects.setMode(i,e.mode||"hide"),o="hide"===r,s=parseInt(e.percent,10)||150,a=s/100,l={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:r,complete:n,percent:o?s:100,from:o?l:{height:l.height*a,width:l.width*a,outerHeight:l.outerHeight*a,outerWidth:l.outerWidth*a}}),i.effect(e)},t.effects.effect.scale=function(e,n){var i=t(this),r=t.extend(!0,{},e),o=t.effects.setMode(i,e.mode||"effect"),s=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===o?0:100),a=e.direction||"both",l=e.origin,u={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()},c={y:"horizontal"!==a?s/100:1,x:"vertical"!==a?s/100:1};r.effect="size",r.queue=!1,r.complete=n,"effect"!==o&&(r.origin=l||["middle","center"],r.restore=!0),r.from=e.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:u),r.to={height:u.height*c.y,width:u.width*c.x,outerHeight:u.outerHeight*c.y,outerWidth:u.outerWidth*c.x},r.fade&&("show"===o&&(r.from.opacity=0,r.to.opacity=1),"hide"===o&&(r.from.opacity=1,r.to.opacity=0)),i.effect(r)},t.effects.effect.size=function(e,n){var i,r,o,s=t(this),a=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],u=["width","height","overflow"],c=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],d=t.effects.setMode(s,e.mode||"effect"),p=e.restore||"effect"!==d,g=e.scale||"both",m=e.origin||["middle","center"],v=s.css("position"),y=p?a:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===d&&s.show(),i={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},"toggle"===e.mode&&"show"===d?(s.from=e.to||b,s.to=e.from||i):(s.from=e.from||("show"===d?b:i),s.to=e.to||("hide"===d?b:i)),o={from:{y:s.from.height/i.height,x:s.from.width/i.width},to:{y:s.to.height/i.height,x:s.to.width/i.width}},"box"!==g&&"both"!==g||(o.from.y!==o.to.y&&(y=y.concat(h),s.from=t.effects.setTransition(s,h,o.from.y,s.from),s.to=t.effects.setTransition(s,h,o.to.y,s.to)),o.from.x!==o.to.x&&(y=y.concat(f),s.from=t.effects.setTransition(s,f,o.from.x,s.from),s.to=t.effects.setTransition(s,f,o.to.x,s.to))),"content"!==g&&"both"!==g||o.from.y!==o.to.y&&(y=y.concat(c).concat(u),s.from=t.effects.setTransition(s,c,o.from.y,s.from),s.to=t.effects.setTransition(s,c,o.to.y,s.to)),t.effects.save(s,y),s.show(),t.effects.createWrapper(s),s.css("overflow","hidden").css(s.from),m&&(r=t.effects.getBaseline(m,i),s.from.top=(i.outerHeight-s.outerHeight())*r.y,s.from.left=(i.outerWidth-s.outerWidth())*r.x,s.to.top=(i.outerHeight-s.to.outerHeight)*r.y,s.to.left=(i.outerWidth-s.to.outerWidth)*r.x),s.css(s.from),"content"!==g&&"both"!==g||(h=h.concat(["marginTop","marginBottom"]).concat(c),f=f.concat(["marginLeft","marginRight"]),u=a.concat(h).concat(f),s.find("*[width]").each(function(){var n=t(this),i={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};p&&t.effects.save(n,u),n.from={height:i.height*o.from.y,width:i.width*o.from.x,outerHeight:i.outerHeight*o.from.y,outerWidth:i.outerWidth*o.from.x},n.to={height:i.height*o.to.y,width:i.width*o.to.x,outerHeight:i.height*o.to.y,outerWidth:i.width*o.to.x},o.from.y!==o.to.y&&(n.from=t.effects.setTransition(n,h,o.from.y,n.from),n.to=t.effects.setTransition(n,h,o.to.y,n.to)),o.from.x!==o.to.x&&(n.from=t.effects.setTransition(n,f,o.from.x,n.from),n.to=t.effects.setTransition(n,f,o.to.x,n.to)),n.css(n.from),n.animate(n.to,e.duration,e.easing,function(){p&&t.effects.restore(n,u)})})),s.animate(s.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===s.to.opacity&&s.css("opacity",s.from.opacity),"hide"===d&&s.hide(),t.effects.restore(s,y),p||("static"===v?s.css({position:"relative",top:s.to.top,left:s.to.left}):t.each(["top","left"],function(t,e){s.css(e,function(e,n){var i=parseInt(n,10),r=t?s.to.left:s.to.top;return"auto"===n?r+"px":i+r+"px"})})),t.effects.removeWrapper(s),n()}})}}(jQuery),function(t,e){t.effects.effect.shake=function(e,n){var i,r=t(this),o=["position","top","bottom","left","right","height","width"],s=t.effects.setMode(r,e.mode||"effect"),a=e.direction||"left",l=e.distance||20,u=e.times||3,c=2*u+1,h=Math.round(e.duration/c),f="up"===a||"down"===a?"top":"left",d="up"===a||"left"===a,p={},g={},m={},v=r.queue(),y=v.length;for(t.effects.save(r,o),r.show(),t.effects.createWrapper(r),p[f]=(d?"-=":"+=")+l,g[f]=(d?"+=":"-=")+2*l,m[f]=(d?"-=":"+=")+2*l,r.animate(p,h,e.easing),i=1;i1&&v.splice.apply(v,[1,0].concat(v.splice(y,c+1))),r.dequeue()}}(jQuery),function(t,e){t.effects.effect.slide=function(e,n){var i,r=t(this),o=["position","top","bottom","left","right","width","height"],s=t.effects.setMode(r,e.mode||"show"),a="show"===s,l=e.direction||"left",u="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,h={};t.effects.save(r,o),r.show(),i=e.distance||r["top"===u?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(r).css({overflow:"hidden"}),a&&r.css(u,c?isNaN(i)?"-"+i:-i:i),h[u]=(a?c?"+=":"-=":c?"-=":"+=")+i,r.animate(h,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===s&&r.hide(),t.effects.restore(r,o),t.effects.removeWrapper(r),n()}})}}(jQuery),function(t,e){t.effects.effect.transfer=function(e,n){var i=t(this),r=t(e.to),o="fixed"===r.css("position"),s=t("body"),a=o?s.scrollTop():0,l=o?s.scrollLeft():0,u=r.offset(),c={top:u.top-a,left:u.left-l,height:r.innerHeight(),width:r.innerWidth()},h=i.offset(),f=t('
                  ').appendTo(document.body).addClass(e.className).css({top:h.top-a,left:h.left-l,height:i.innerHeight(),width:i.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){f.remove(),n()})}}(jQuery),function(t,e){var n=!1;t.widget("ui.menu",{version:"1.9.2",defaultElement:"
                    ",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!n&&i.not(".ui-state-disabled").length&&(n=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var n=t(e.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var n=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,n)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function n(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var i,r,o,s,a,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,r=this.previousFilter||"",o=String.fromCharCode(e.keyCode),s=!1,clearTimeout(this.filterTimer),o===r?s=!0:o=r+o,a=new RegExp("^"+n(o),"i"),i=this.activeMenu.children(".ui-menu-item").filter(function(){return a.test(t(this).children("a").text())}),i=s&&i.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):i,i.length||(o=String.fromCharCode(e.keyCode),a=new RegExp("^"+n(o),"i"),i=this.activeMenu.children(".ui-menu-item").filter(function(){return a.test(t(this).children("a").text())})),i.length?(this.focus(e,i),i.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,n=this.options.icons.submenu,i=this.element.find(this.options.menus);i.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev("a"),r=t("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(r),e.attr("aria-labelledby",i.attr("id"))}),e=i.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-—–\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(t,e){var n,i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=e.children(".ui-menu"),n.length&&/^mouse/.test(t.type)&&this._startOpening(n),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,i,r,o,s,a;this._hasScroll()&&(n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,r=e.offset().top-this.activeMenu.offset().top-n-i,o=this.activeMenu.scrollTop(),s=this.activeMenu.height(),a=e.height(),r<0?this.activeMenu.scrollTop(o+r):r+a>s&&this.activeMenu.scrollTop(o+r-s+a))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var n=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(e,n){clearTimeout(this.timer),this.timer=this._delay(function(){var i=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));i.length||(i=this.element),this._close(i),this.blur(e),this.activeMenu=i},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var i;this.active&&(i="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)), +i&&i.length&&this.active||(i=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(n,i)},nextPage:function(e){var n,i,r;return this.active?void(this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,r=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i-r<0}),this.focus(e,n)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]()))):void this.next(e)},previousPage:function(e){var n,i,r;return this.active?void(this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,r=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i+r>0}),this.focus(e,n)):this.focus(e,this.activeMenu.children(".ui-menu-item").first()))):void this.next(e)},_hasScroll:function(){return this.element.outerHeight()
                  ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this._value():(this._setOption("value",t),this)},_setOption:function(t,e){"value"===t&&(this.options.value=e,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(t,e)},_value:function(){var t=this.options.value;return"number"!=typeof t&&(t=0),Math.min(this.options.max,Math.max(this.min,t))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var t=this.value(),e=this._percentage();this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),this.valueDiv.toggle(t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(e.toFixed(0)+"%"),this.element.attr("aria-valuenow",t)}})}(jQuery),function(t,e){t.widget("ui.resizable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var e=this,n=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t('
                  ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor==String){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var i=this.handles.split(",");this.handles={};for(var r=0;r');a.css({zIndex:n.zIndex}),"se"==o&&a.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[o]=".ui-resizable-"+o,this.element.append(a)}}this._renderAxis=function(e){e=e||this.element;for(var n in this.handles){if(this.handles[n].constructor==String&&(this.handles[n]=t(this.handles[n],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var i=t(this.handles[n],this.element),r=0;r=/sw|ne|nw|se|n|s/.test(n)?i.outerHeight():i.outerWidth();var o=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");e.css(o,r),this._proportionallyResize()}t(this.handles[n]).length}},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!e.resizing){if(this.className)var t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);e.axis=t&&t[1]?t[1]:"se"}}),n.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){n.disabled||(t(this).removeClass("ui-resizable-autohide"),e._handles.show())}).mouseleave(function(){n.disabled||e.resizing||(t(this).addClass("ui-resizable-autohide"),e._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),e(this.originalElement),this},_mouseCapture:function(e){var n=!1;for(var i in this.handles)t(this.handles[i])[0]==e.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i=this.options,r=this.element.position(),o=this.element;this.resizing=!0,this.documentScroll={top:t(document).scrollTop(),left:t(document).scrollLeft()},(o.is(".ui-draggable")||/absolute/.test(o.css("position")))&&o.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy();var s=n(this.helper.css("left")),a=n(this.helper.css("top"));i.containment&&(s+=t(i.containment).scrollLeft()||0,a+=t(i.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:a},this.size=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalPosition={left:s,top:a},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof i.aspectRatio?i.aspectRatio:this.originalSize.width/this.originalSize.height||1;var l=t(".ui-resizable-"+this.axis).css("cursor");return t("body").css("cursor","auto"==l?this.axis+"-resize":l),o.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(t){var e=this.helper,n=(this.options,this.originalMousePosition),i=this.axis,r=t.pageX-n.left||0,o=t.pageY-n.top||0,s=this._change[i];if(!s)return!1;var a=s.apply(this,[t,r,o]);return this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(a=this._updateRatio(a,t)),a=this._respectSize(a,t),this._propagate("resize",t),e.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(a),this._trigger("resize",t,this.ui()),!1},_mouseStop:function(e){this.resizing=!1;var n=this.options,i=this;if(this._helper){var r=this._proportionallyResizeElements,o=r.length&&/textarea/i.test(r[0].nodeName),s=o&&t.ui.hasScroll(r[0],"left")?0:i.sizeDiff.height,a=o?0:i.sizeDiff.width,l={width:i.helper.width()-a,height:i.helper.height()-s},u=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;n.animate||this.element.css(t.extend(l,{top:c,left:u})),i.helper.height(i.size.height),i.helper.width(i.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,n,r,o,s,a=this.options;s={minWidth:i(a.minWidth)?a.minWidth:0,maxWidth:i(a.maxWidth)?a.maxWidth:1/0,minHeight:i(a.minHeight)?a.minHeight:0,maxHeight:i(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=s.minHeight*this.aspectRatio,r=s.minWidth/this.aspectRatio,n=s.maxHeight*this.aspectRatio,o=s.maxWidth/this.aspectRatio,e>s.minWidth&&(s.minWidth=e),r>s.minHeight&&(s.minHeight=r),nt.width,l=i(t.height)&&n.minHeight&&n.minHeight>t.height;a&&(t.width=n.minWidth),l&&(t.height=n.minHeight),o&&(t.width=n.maxWidth),s&&(t.height=n.maxHeight);var u=this.originalPosition.left+this.originalSize.width,c=this.position.top+this.size.height,h=/sw|nw|w/.test(r),f=/nw|ne|n/.test(r);a&&h&&(t.left=u-n.minWidth),o&&h&&(t.left=u-n.maxWidth),l&&f&&(t.top=c-n.minHeight),s&&f&&(t.top=c-n.maxHeight);var d=!t.width&&!t.height;return d&&!t.left&&t.top?t.top=null:d&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){this.options;if(this._proportionallyResizeElements.length)for(var e=this.helper||this.element,n=0;n');var i=t.ui.ie6?1:0,r=t.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+r,height:this.element.outerHeight()+r,position:"absolute",left:this.elementOffset.left-i+"px",top:this.elementOffset.top-i+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(t,e,n){return{width:this.originalSize.width+e}},w:function(t,e,n){var i=(this.options,this.originalSize),r=this.originalPosition;return{left:r.left+e,width:i.width-e}},n:function(t,e,n){var i=(this.options,this.originalSize),r=this.originalPosition;return{top:r.top+n,height:i.height-n}},s:function(t,e,n){return{height:this.originalSize.height+n}},se:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},sw:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,n,i]))},ne:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},nw:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,n,i]))}},_propagate:function(e,n){t.ui.plugin.call(this,e,[n,this.ui()]),"resize"!=e&&this._trigger(e,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","alsoResize",{start:function(e,n){var i=t(this).data("resizable"),r=i.options,o=function(e){t(e).each(function(){var e=t(this);e.data("resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof r.alsoResize||r.alsoResize.parentNode?o(r.alsoResize):r.alsoResize.length?(r.alsoResize=r.alsoResize[0],o(r.alsoResize)):t.each(r.alsoResize,function(t){o(t)})},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.originalSize,s=i.originalPosition,a={height:i.size.height-o.height||0,width:i.size.width-o.width||0,top:i.position.top-s.top||0,left:i.position.left-s.left||0},l=function(e,i){t(e).each(function(){var e=t(this),r=t(this).data("resizable-alsoresize"),o={},s=i&&i.length?i:e.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(s,function(t,e){var n=(r[e]||0)+(a[e]||0);n&&n>=0&&(o[e]=n||null)}),e.css(o)})};"object"!=typeof r.alsoResize||r.alsoResize.nodeType?l(r.alsoResize):t.each(r.alsoResize,function(t,e){l(t,e)})},stop:function(e,n){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","animate",{stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i._proportionallyResizeElements,s=o.length&&/textarea/i.test(o[0].nodeName),a=s&&t.ui.hasScroll(o[0],"left")?0:i.sizeDiff.height,l=s?0:i.sizeDiff.width,u={width:i.size.width-l,height:i.size.height-a},c=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,h=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(u,h&&c?{top:h,left:c}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var n={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};o&&o.length&&t(o[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(e,i){var r=t(this).data("resizable"),o=r.options,s=r.element,a=o.containment,l=a instanceof t?a.get(0):/parent/.test(a)?s.parent().get(0):a;if(l)if(r.containerElement=t(l),/document/.test(a)||a==document)r.containerOffset={left:0,top:0},r.containerPosition={left:0,top:0},r.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight};else{var u=t(l),c=[];t(["Top","Right","Left","Bottom"]).each(function(t,e){c[t]=n(u.css("padding"+e))}),r.containerOffset=u.offset(),r.containerPosition=u.position(),r.containerSize={height:u.innerHeight()-c[3],width:u.innerWidth()-c[1]};var h=r.containerOffset,f=r.containerSize.height,d=r.containerSize.width,p=t.ui.hasScroll(l,"left")?l.scrollWidth:d,g=t.ui.hasScroll(l)?l.scrollHeight:f;r.parentData={element:l,left:h.left,top:h.top,width:p,height:g}}},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=(i.containerSize,i.containerOffset),s=(i.size,i.position),a=i._aspectRatio||e.shiftKey,l={top:0,left:0},u=i.containerElement;u[0]!=document&&/static/.test(u.css("position"))&&(l=o),s.left<(i._helper?o.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-o.left:i.position.left-l.left),a&&(i.size.height=i.size.width/i.aspectRatio),i.position.left=r.helper?o.left:0),s.top<(i._helper?o.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-o.top:i.position.top),a&&(i.size.width=i.size.height*i.aspectRatio),i.position.top=i._helper?o.top:0),i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top;var c=Math.abs((i._helper?i.offset.left-l.left:i.offset.left-l.left)+i.sizeDiff.width),h=Math.abs((i._helper?i.offset.top-l.top:i.offset.top-o.top)+i.sizeDiff.height),f=i.containerElement.get(0)==i.element.parent().get(0),d=/relative|absolute/.test(i.containerElement.css("position"));f&&d&&(c-=i.parentData.left),c+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-c,a&&(i.size.height=i.size.width/i.aspectRatio)),h+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-h,a&&(i.size.width=i.size.height*i.aspectRatio))},stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=(i.position,i.containerOffset),s=i.containerPosition,a=i.containerElement,l=t(i.helper),u=l.offset(),c=l.outerWidth()-i.sizeDiff.width,h=l.outerHeight()-i.sizeDiff.height;i._helper&&!r.animate&&/relative/.test(a.css("position"))&&t(this).css({left:u.left-s.left-o.left,width:c,height:h}),i._helper&&!r.animate&&/static/.test(a.css("position"))&&t(this).css({left:u.left-s.left-o.left,width:c,height:h})}}),t.ui.plugin.add("resizable","ghost",{start:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size;i.ghost=i.originalElement.clone(),i.ghost.css({opacity:.25,display:"block",position:"relative",height:o.height,width:o.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof r.ghost?r.ghost:""),i.ghost.appendTo(i.helper)},resize:function(e,n){var i=t(this).data("resizable");i.options;i.ghost&&i.ghost.css({position:"relative",height:i.size.height,width:i.size.width})},stop:function(e,n){var i=t(this).data("resizable");i.options;i.ghost&&i.helper&&i.helper.get(0).removeChild(i.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size,s=i.originalSize,a=i.originalPosition,l=i.axis;r._aspectRatio||e.shiftKey;r.grid="number"==typeof r.grid?[r.grid,r.grid]:r.grid;var u=Math.round((o.width-s.width)/(r.grid[0]||1))*(r.grid[0]||1),c=Math.round((o.height-s.height)/(r.grid[1]||1))*(r.grid[1]||1);/^(se|s|e)$/.test(l)?(i.size.width=s.width+u,i.size.height=s.height+c):/^(ne)$/.test(l)?(i.size.width=s.width+u,i.size.height=s.height+c,i.position.top=a.top-c):/^(sw)$/.test(l)?(i.size.width=s.width+u,i.size.height=s.height+c,i.position.left=a.left-u):(i.size.width=s.width+u,i.size.height=s.height+c,i.position.top=a.top-c,i.position.left=a.left-u)}});var n=function(t){return parseInt(t,10)||0},i=function(t){return!isNaN(parseInt(t,10))}}(jQuery),function(t,e){t.widget("ui.selectable",t.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var e=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=t(e.options.filter,e.element[0]),n.addClass("ui-selectee"),n.each(function(){var e=t(this),n=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:n.left,top:n.top,right:n.left+e.outerWidth(),bottom:n.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=t("
                  ")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var n=this;if(this.opos=[e.pageX,e.pageY],!this.options.disabled){var i=this.options;this.selectees=t(i.filter,this.element[0]),this._trigger("start",e),t(i.appendTo).append(this.helper),this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0}),i.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var i=t.data(this,"selectable-item");i.startselected=!0,e.metaKey||e.ctrlKey||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",e,{unselecting:i.element}))}),t(e.target).parents().andSelf().each(function(){var i=t.data(this,"selectable-item");if(i){var r=!e.metaKey&&!e.ctrlKey||!i.$element.hasClass("ui-selected");return i.$element.removeClass(r?"ui-unselecting":"ui-selected").addClass(r?"ui-selecting":"ui-unselecting"),i.unselecting=!r,i.selecting=r,i.selected=r,r?n._trigger("selecting",e,{selecting:i.element}):n._trigger("unselecting",e,{unselecting:i.element}),!1}})}},_mouseDrag:function(e){var n=this;if(this.dragged=!0,!this.options.disabled){var i=this.options,r=this.opos[0],o=this.opos[1],s=e.pageX,a=e.pageY;if(r>s){var l=s;s=r,r=l}if(o>a){var l=a;a=o,o=l}return this.helper.css({left:r,top:o,width:s-r,height:a-o}),this.selectees.each(function(){var l=t.data(this,"selectable-item");if(l&&l.element!=n.element[0]){var u=!1;"touch"==i.tolerance?u=!(l.left>s||l.righta||l.bottomr&&l.righto&&l.bottom").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===r.range||"max"===r.range?" ui-slider-range-"+r.range:""))),i=r.values&&r.values.length||1,e=o.length;en&&(r=n,o=t(this),s=e)}),h.range===!0&&this.values(1)===h.min&&(s+=1,o=t(this.handles[s])),a=this._start(e,s),a!==!1&&(this._mouseSliding=!0,this._handleIndex=s,o.addClass("ui-state-active").focus(),l=o.offset(),u=!t(e.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=u?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,s,i),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,n),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,n,i,r,o;return"horizontal"===this.orientation?(e=this.elementSize.width,n=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,n=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),i=n/e,i>1&&(i=1),i<0&&(i=0),"vertical"===this.orientation&&(i=1-i),r=this._valueMax()-this._valueMin(),o=this._valueMin()+i*r,this._trimAlignValue(o)},_start:function(t,e){var n={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(e),n.values=this.values()),this._trigger("start",t,n)},_slide:function(t,e,n){var i,r,o;this.options.values&&this.options.values.length?(i=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&n>i||1===e&&n1)return this.options.values[e]=this._trimAlignValue(n),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(i=this.options.values,r=arguments[0],o=0;o=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,n=(t-this._valueMin())%e,i=t-n;return 2*Math.abs(n)>=e&&(i+=n>0?e:-e),parseFloat(i.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,n,i,r,o,s=this.options.range,a=this.options,l=this,u=!this._animateOff&&a.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(i){n=(l.values(i)-l._valueMin())/(l._valueMax()-l._valueMin())*100, +c["horizontal"===l.orientation?"left":"bottom"]=n+"%",t(this).stop(1,1)[u?"animate":"css"](c,a.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===i&&l.range.stop(1,1)[u?"animate":"css"]({left:n+"%"},a.animate),1===i&&l.range[u?"animate":"css"]({width:n-e+"%"},{queue:!1,duration:a.animate})):(0===i&&l.range.stop(1,1)[u?"animate":"css"]({bottom:n+"%"},a.animate),1===i&&l.range[u?"animate":"css"]({height:n-e+"%"},{queue:!1,duration:a.animate}))),e=n}):(i=this.value(),r=this._valueMin(),o=this._valueMax(),n=o!==r?(i-r)/(o-r)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=n+"%",this.handle.stop(1,1)[u?"animate":"css"](c,a.animate),"min"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:n+"%"},a.animate),"max"===s&&"horizontal"===this.orientation&&this.range[u?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:a.animate}),"min"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:n+"%"},a.animate),"max"===s&&"vertical"===this.orientation&&this.range[u?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:a.animate}))}})}(jQuery),function(t,e){t.widget("ui.sortable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===t.axis||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display"))),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,n){"disabled"===e?(this.options[e]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,n){var i=this;if(this.reverting)return!1;if(this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(e);var r=null;t(e.target).parents().each(function(){if(t.data(this,i.widgetName+"-item")==i)return r=t(this),!1});if(t.data(e.target,i.widgetName+"-item")==i&&(r=t(e.target)),!r)return!1;if(this.options.handle&&!n){var o=!1;if(t(this.options.handle,r).find("*").andSelf().each(function(){this==e.target&&(o=!0)}),!o)return!1}return this.currentItem=r,this._removeCurrentsFromItems(),!0},_mouseStart:function(e,n,i){var r=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&(t("body").css("cursor")&&(this._storedCursor=t("body").css("cursor")),t("body").css("cursor",r.cursor)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(var o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){var n=this.options,i=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;r--){var o=this.items[r],s=o.item[0],a=this._intersectsWithPointer(o);if(a&&o.instance===this.currentContainer&&!(s==this.currentItem[0]||this.placeholder[1==a?"next":"prev"]()[0]==s||t.contains(this.placeholder[0],s)||"semi-dynamic"==this.options.type&&t.contains(this.element[0],s))){if(this.direction=1==a?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(o))break;this._rearrange(e,o),this._trigger("change",e,this._uiHash());break}}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,n){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var i=this,r=this.placeholder.offset();this.reverting=!0,t(this.helper).animate({left:r.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:r.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){i._clear(e)})}else this._clear(e,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},t(n).each(function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[-=_](.+)/);n&&i.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},n.each(function(){i.push(t(e.item||this).attr(e.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,i=this.positionAbs.top,r=i+this.helperProportions.height,o=t.left,s=o+t.width,a=t.top,l=a+t.height,u=this.offset.click.top,c=this.offset.click.left,h=i+u>a&&i+uo&&e+ct[this.floating?"width":"height"]?h:o0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var n=[],i=[],r=this._connectWith();if(r&&e)for(var o=r.length-1;o>=0;o--)for(var s=t(r[o]),a=s.length-1;a>=0;a--){var l=t.data(s[a],this.widgetName);l&&l!=this&&!l.options.disabled&&i.push([t.isFunction(l.options.items)?l.options.items.call(l.element):t(l.options.items,l.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),l])}i.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var o=i.length-1;o>=0;o--)i[o][0].each(function(){n.push(this)});return t(n)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var n=0;n=0;o--)for(var s=t(r[o]),a=s.length-1;a>=0;a--){var l=t.data(s[a],this.widgetName);l&&l!=this&&!l.options.disabled&&(i.push([t.isFunction(l.options.items)?l.options.items.call(l.element[0],e,{item:this.currentItem}):t(l.options.items,l.element),l]),this.containers.push(l))}for(var o=i.length-1;o>=0;o--)for(var u=i[o][1],c=i[o][0],a=0,h=c.length;a=0;n--){var i=this.items[n];if(i.instance==this.currentContainer||!this.currentContainer||i.item[0]==this.currentItem[0]){var r=this.options.toleranceElement?t(this.options.toleranceElement,i.item):i.item;e||(i.width=r.outerWidth(),i.height=r.outerHeight());var o=r.offset();i.left=o.left,i.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var o=this.containers[n].element.offset();this.containers[n].containerCache.left=o.left,this.containers[n].containerCache.top=o.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(e){e=e||this;var n=e.options;if(!n.placeholder||n.placeholder.constructor==String){var i=n.placeholder;n.placeholder={element:function(){var n=t(document.createElement(e.currentItem[0].nodeName)).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return i||(n.style.visibility="hidden"),n},update:function(t,r){i&&!n.forcePlaceholderSize||(r.height()||r.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),r.width()||r.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}}e.placeholder=t(n.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),n.placeholder.update(e,e.placeholder)},_contactContainers:function(e){for(var n=null,i=null,r=this.containers.length-1;r>=0;r--)if(!t.contains(this.currentItem[0],this.containers[r].element[0]))if(this._intersectsWith(this.containers[r].containerCache)){if(n&&t.contains(this.containers[r].element[0],n.element[0]))continue;n=this.containers[r],i=r}else this.containers[r].containerCache.over&&(this.containers[r]._trigger("out",e,this._uiHash(this)),this.containers[r].containerCache.over=0);if(n)if(1===this.containers.length)this.containers[i]._trigger("over",e,this._uiHash(this)),this.containers[i].containerCache.over=1;else{for(var o=1e4,s=null,a=this.containers[i].floating?"left":"top",l=this.containers[i].floating?"width":"height",u=this.positionAbs[a]+this.offset.click[a],c=this.items.length-1;c>=0;c--)if(t.contains(this.containers[i].element[0],this.items[c].item[0])&&this.items[c].item[0]!=this.currentItem[0]){var h=this.items[c].item.offset()[a],f=!1;Math.abs(h-u)>Math.abs(h+this.items[c][l]-u)&&(f=!0,h+=this.items[c][l]),Math.abs(h-u)this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),n.grid)){var a=this.originalPageY+Math.round((s-this.originalPageY)/n.grid[1])*n.grid[1];s=this.containment&&(a-this.offset.click.topthis.containment[3])?a-this.offset.click.topthis.containment[2])?l-this.offset.click.left=0;r--)n||i.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over&&(i.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over=0);if(this._storedCursor&&t("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",e,this._uiHash());for(var r=0;r",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},n=this.element;return t.each(["min","max","step"],function(t,i){var r=n.attr(i);void 0!==r&&r.length&&(e[i]=r)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?void delete this.cancelBlur:(this._refresh(),void(this.previous!==this.element.val()&&this._trigger("change",t)))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function n(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=i,this._delay(function(){this.previous=i}))}var i;i=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),n.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,n.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active"))return this._start(e)!==!1&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var n=this.options,i=t.ui.keyCode;switch(e.keyCode){case i.UP:return this._repeat(null,1,e),!0;case i.DOWN:return this._repeat(null,-1,e),!0;case i.PAGE_UP:return this._repeat(null,n.page,e),!0;case i.PAGE_DOWN:return this._repeat(null,-n.page,e),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""},_start:function(t){return!(!this.spinning&&this._trigger("start",t)===!1)&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,n){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,n)},t),this._spin(e*this.options.step,n)},_spin:function(t,e){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:n})===!1||(this._value(n),this.counter++)},_increment:function(e){var n=this.options.incremental;return n?t.isFunction(n)?n(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),n=e.indexOf(".");return n===-1?0:e.length-n-1},_adjustValue:function(t){var e,n,i=this.options;return e=null!==i.min?i.min:0,n=t-e,n=Math.round(n/i.step)*i.step,t=e+n,t=parseFloat(t.toFixed(this._precision())),null!==i.max&&t>i.max?i.max:null!==i.min&&t1&&t.href.replace(o,"")===location.href.replace(o,"").replace(/\s/g,"%20")}var r=0,o=/#.*$/;t.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,n=this.options,i=n.active,r=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),null===i&&(r&&this.tabs.each(function(e,n){if(t(n).attr("aria-controls")===r)return i=e,!1}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==i&&i!==-1||(i=!!this.tabs.length&&0)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),i===-1&&(i=!n.collapsible&&0)), +n.active=i,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),t.isArray(n.disabled)&&(n.disabled=t.unique(n.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=t(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var n=t(this.document[0].activeElement).closest("li"),i=this.tabs.index(n),r=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:i++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:r=!1,i--;break;case t.ui.keyCode.END:i=this.anchors.length-1;break;case t.ui.keyCode.HOME:i=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(i);case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}e.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,r),e.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,n){function i(){return e>r&&(e=0),e<0&&(e=r),e}for(var r=this.tabs.length-1;t.inArray(i(),this.options.disabled)!==-1;)e=n?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,e){return"active"===t?void this._activate(e):"disabled"===t?void this._setupDisabled(e):(this._super(t,e),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),void("heightStyle"===t&&this._setupHeightStyle(e)))},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+n()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,n=this.tablist.children(":has(a[href])");e.disabled=t.map(n.filter(".ui-state-disabled"),function(t){return n.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(n,r){var o,s,a,l=t(r).uniqueId().attr("id"),u=t(r).closest("li"),c=u.attr("aria-controls");i(r)?(o=r.hash,s=e.element.find(e._sanitizeSelector(o))):(a=e._tabId(u),o="#"+a,s=e.element.find(o),s.length||(s=e._createPanel(a),s.insertAfter(e.panels[n-1]||e.tablist)),s.attr("aria-live","polite")),s.length&&(e.panels=e.panels.add(s)),c&&u.data("ui-tabs-aria-controls",c),u.attr({"aria-controls":o.substring(1),"aria-labelledby":l}),s.attr("aria-labelledby",l)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("
                  ").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var n,i=0;n=this.tabs[i];i++)e===!0||t.inArray(i,e)!==-1?t(n).addClass("ui-state-disabled").attr("aria-disabled","true"):t(n).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var n={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){n[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var n,i,r=this.element.parent();"fill"===e?(t.support.minHeight||(i=r.css("overflow"),r.css("overflow","hidden")),n=r.height(),this.element.siblings(":visible").each(function(){var e=t(this),i=e.css("position");"absolute"!==i&&"fixed"!==i&&(n-=e.outerHeight(!0))}),i&&r.css("overflow",i),this.element.children().not(this.panels).each(function(){n-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,n-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(n=0,this.panels.each(function(){n=Math.max(n,t(this).height("").height())}).height(n))},_eventHandler:function(e){var n=this.options,i=this.active,r=t(e.currentTarget),o=r.closest("li"),s=o[0]===i[0],a=s&&n.collapsible,l=a?t():this._getPanelForTab(o),u=i.length?this._getPanelForTab(i):t(),c={oldTab:i,oldPanel:u,newTab:a?t():o,newPanel:l};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||s&&!n.collapsible||this._trigger("beforeActivate",e,c)===!1||(n.active=!a&&this.tabs.index(o),this.active=s?t():o,this.xhr&&this.xhr.abort(),u.length||l.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,n){function i(){o.running=!1,o._trigger("activate",e,n)}function r(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),s.length&&o.options.show?o._show(s,o.options.show,i):(s.show(),i())}var o=this,s=n.newPanel,a=n.oldPanel;this.running=!0,a.length&&this.options.hide?this._hide(a,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),a.hide(),r()),a.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),s.length&&a.length?n.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var n,i=this._findActive(e);i[0]!==this.active[0]&&(i.length||(i=this.active),n=i.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),n=e.data("ui-tabs-aria-controls");n?e.attr("aria-controls",n):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(n){var i=this.options.disabled;i!==!1&&(n===e?i=!1:(n=this._getIndex(n),i=t.isArray(i)?t.map(i,function(t){return t!==n?t:null}):t.map(this.tabs,function(t,e){return e!==n?e:null})),this._setupDisabled(i))},disable:function(n){var i=this.options.disabled;if(i!==!0){if(n===e)i=!0;else{if(n=this._getIndex(n),t.inArray(n,i)!==-1)return;i=t.isArray(i)?t.merge([n],i).sort():[n]}this._setupDisabled(i)}},load:function(e,n){e=this._getIndex(e);var r=this,o=this.tabs.eq(e),s=o.find(".ui-tabs-anchor"),a=this._getPanelForTab(o),l={tab:o,panel:a};i(s[0])||(this.xhr=t.ajax(this._ajaxSettings(s,n,l)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){a.html(t),r._trigger("load",n,l)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&r.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),a.removeAttr("aria-busy"),t===r.xhr&&delete r.xhr},1)})))},_ajaxSettings:function(e,n,i){var r=this;return{url:e.attr("href"),beforeSend:function(e,o){return r._trigger("beforeLoad",n,t.extend({jqXHR:e,ajaxSettings:o},i))}}},_getPanelForTab:function(e){var n=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),t.uiBackCompat!==!1&&(t.ui.tabs.prototype._ui=function(t,e){return{tab:t,panel:e,index:this.anchors.index(t)}},t.widget("ui.tabs",t.ui.tabs,{url:function(t,e){this.anchors.eq(t).attr("href",e)}}),t.widget("ui.tabs",t.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var e=this;this._on({tabsbeforeload:function(n,i){return t.data(i.tab[0],"cache.tabs")?void n.preventDefault():void i.jqXHR.success(function(){e.options.cache&&t.data(i.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(e,n,i){var r=this.options.ajaxOptions;return t.extend({},r,{error:function(t,e){try{r.error(t,e,i.tab.closest("li").index(),i.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(t,e){"cache"===t&&e===!1&&this.anchors.removeData("cache.tabs"),this._super(t,e)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(t){this.anchors.eq(t).removeData("cache.tabs"),this._superApply(arguments)}}),t.widget("ui.tabs",t.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),t.widget("ui.tabs",t.ui.tabs,{options:{spinner:"Loading…"},_create:function(){this._super(),this._on({tabsbeforeload:function(t,e){if(t.target===this.element[0]&&this.options.spinner){var n=e.tab.find("span"),i=n.html();n.html(this.options.spinner),e.jqXHR.complete(function(){n.html(i)})}}})}}),t.widget("ui.tabs",t.ui.tabs,{options:{enable:null,disable:null},enable:function(e){var n,i=this.options;(e&&i.disabled===!0||t.isArray(i.disabled)&&t.inArray(e,i.disabled)!==-1)&&(n=!0),this._superApply(arguments),n&&this._trigger("enable",null,this._ui(this.anchors[e],this.panels[e]))},disable:function(e){var n,i=this.options;(e&&i.disabled===!1||t.isArray(i.disabled)&&t.inArray(e,i.disabled)===-1)&&(n=!0),this._superApply(arguments),n&&this._trigger("disable",null,this._ui(this.anchors[e],this.panels[e]))}}),t.widget("ui.tabs",t.ui.tabs,{options:{add:null,remove:null,tabTemplate:"
                • #{label}
                • "},add:function(n,i,r){r===e&&(r=this.anchors.length);var o,s,a=this.options,l=t(a.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,i)),u=n.indexOf("#")?this._tabId(l):n.replace("#","");return l.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),l.attr("aria-controls",u),o=r>=this.tabs.length,s=this.element.find("#"+u),s.length||(s=this._createPanel(u),o?r>0?s.insertAfter(this.panels.eq(-1)):s.appendTo(this.element):s.insertBefore(this.panels[r])),s.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),o?l.appendTo(this.tablist):l.insertBefore(this.tabs[r]),a.disabled=t.map(a.disabled,function(t){return t>=r?++t:t}),this.refresh(),1===this.tabs.length&&a.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[r],this.panels[r])),this},remove:function(e){e=this._getIndex(e);var n=this.options,i=this.tabs.eq(e).remove(),r=this._getPanelForTab(i).remove();return i.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(e+(e+1=e?--t:t}),this.refresh(),this._trigger("remove",null,this._ui(i.find("a")[0],r[0])),this}}),t.widget("ui.tabs",t.ui.tabs,{length:function(){return this.anchors.length}}),t.widget("ui.tabs",t.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(e){var i=e.is("li")?e.find("a[href]"):e;return i=i[0],t(i).closest("li").attr("aria-controls")||i.title&&i.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+n()}}),t.widget("ui.tabs",t.ui.tabs,{options:{panelTemplate:"
                  "},_createPanel:function(e){return t(this.options.panelTemplate).attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),t.widget("ui.tabs",t.ui.tabs,{_create:function(){var t=this.options;null===t.active&&t.selected!==e&&(t.active=t.selected!==-1&&t.selected),this._super(),t.selected=t.active,t.selected===!1&&(t.selected=-1)},_setOption:function(t,e){if("selected"!==t)return this._super(t,e);var n=this.options;this._super("active",e!==-1&&e),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),t.widget("ui.tabs",t.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(t,e,n){var i,r,o=this._superApply(arguments);return!!o&&("beforeActivate"===t?(i=n.newTab.length?n.newTab:n.oldTab,r=n.newPanel.length?n.newPanel:n.oldPanel,o=this._super("select",e,{tab:i.find(".ui-tabs-anchor")[0],panel:r[0],index:i.closest("li").index()})):"activate"===t&&n.newTab.length&&(o=this._super("show",e,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),o)}}),t.widget("ui.tabs",t.ui.tabs,{select:function(t){if(t=this._getIndex(t),t===-1){if(!this.options.collapsible||this.options.selected===-1)return;t=this.options.selected}this.anchors.eq(t).trigger(this.options.event+this.eventNamespace)}}),function(){var e=0;t.widget("ui.tabs",t.ui.tabs,{options:{cookie:null},_create:function(){var t,e=this.options;null==e.active&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var i=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++e)];return arguments.length&&(i.push(n===!1?-1:n),i.push(this.options.cookie)),t.cookie.apply(null,i)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),t.widget("ui.tabs",t.ui.tabs,{_trigger:function(e,n,i){var r=t.extend({},i);return"load"===e&&(r.panel=r.panel[0],r.tab=r.tab.find(".ui-tabs-anchor")[0]),this._super(e,n,r)}}),t.widget("ui.tabs",t.ui.tabs,{options:{fx:null},_getFx:function(){var e,n,i=this.options.fx;return i&&(t.isArray(i)?(e=i[0],n=i[1]):e=n=i),i?{show:n,hide:e}:null},_toggle:function(t,e){function n(){r.running=!1,r._trigger("activate",t,e)}function i(){e.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.show?o.animate(a.show,a.show.duration,function(){n()}):(o.show(),n())}var r=this,o=e.newPanel,s=e.oldPanel,a=this._getFx();return a?(r.running=!0,void(s.length&&a.hide?s.animate(a.hide,a.hide.duration,function(){e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i()}):(e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),i()))):this._super(t,e)}}))}(jQuery),function(t){function e(e,n){var i=(e.attr("aria-describedby")||"").split(/\s+/);i.push(n),e.data("ui-tooltip-id",n).attr("aria-describedby",t.trim(i.join(" ")))}function n(e){var n=e.data("ui-tooltip-id"),i=(e.attr("aria-describedby")||"").split(/\s+/),r=t.inArray(n,i);r!==-1&&i.splice(r,1),e.removeData("ui-tooltip-id"),i=t.trim(i.join(" ")),i?e.attr("aria-describedby",i):e.removeAttr("aria-describedby")}var i=0;t.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return t(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,n){var i=this;return"disabled"===e?(this[n?"_disable":"_enable"](),void(this.options[e]=n)):(this._super(e,n),void("content"===e&&t.each(this.tooltips,function(t,e){i._updateContent(e)})))},_disable:function(){var e=this;t.each(this.tooltips,function(n,i){var r=t.Event("blur");r.target=r.currentTarget=i[0],e.close(r,!0)}),this.element.find(this.options.items).andSelf().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var n=this,i=t(e?e.target:this.element).closest(this.options.items);i.length&&!i.data("ui-tooltip-id")&&(i.attr("title")&&i.data("ui-tooltip-title",i.attr("title")),i.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&i.parents().each(function(){var e,i=t(this);i.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,n.close(e,!0)),i.attr("title")&&(i.uniqueId(),n.parents[this.id]={element:this,title:i.attr("title")},i.attr("title",""))}),this._updateContent(i,e))},_updateContent:function(t,e){var n,i=this.options.content,r=this,o=e?e.type:null;return"string"==typeof i?this._open(e,t,i):(n=i.call(t[0],function(n){t.data("ui-tooltip-open")&&r._delay(function(){e&&(e.type=o),this._open(e,t,n)})}),void(n&&this._open(e,t,n)))},_open:function(n,i,r){function o(t){u.of=t,s.is(":hidden")||s.position(u)}var s,a,l,u=t.extend({},this.options.position);if(r){if(s=this._find(i),s.length)return void s.find(".ui-tooltip-content").html(r);i.is("[title]")&&(n&&"mouseover"===n.type?i.attr("title",""):i.removeAttr("title")),s=this._tooltip(i),e(i,s.attr("id")),s.find(".ui-tooltip-content").html(r),this.options.track&&n&&/^mouse/.test(n.type)?(this._on(this.document,{mousemove:o}),o(n)):s.position(t.extend({of:i},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(l=setInterval(function(){s.is(":visible")&&(o(u.of),clearInterval(l))},t.fx.interval)),this._trigger("open",n,{tooltip:s}),a={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var n=t.Event(e);n.currentTarget=i[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}},n&&"mouseover"!==n.type||(a.mouseleave="close"),n&&"focusin"!==n.type||(a.focusout="close"),this._on(!0,i,a)}},close:function(e){var i=this,r=t(e?e.currentTarget:this.element),o=this._find(r);this.closing||(r.data("ui-tooltip-title")&&r.attr("title",r.data("ui-tooltip-title")),n(r),o.stop(!0),this._hide(o,this.options.hide,function(){i._removeTooltip(t(this))}),r.removeData("ui-tooltip-open"),this._off(r,"mouseleave focusout keyup"),r[0]!==this.element[0]&&this._off(r,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,n){t(n.element).attr("title",n.title),delete i.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var n="ui-tooltip-"+i++,r=t("
                  ").attr({id:n,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("
                  ").addClass("ui-tooltip-content").appendTo(r),r.appendTo(this.document[0].body),t.fn.bgiframe&&r.bgiframe(),this.tooltips[n]=e,r},_find:function(e){var n=e.data("ui-tooltip-id");return n?t("#"+n):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(n,i){var r=t.Event("blur");r.target=r.currentTarget=i[0],e.close(r,!0),t("#"+n).remove(),i.data("ui-tooltip-title")&&(i.attr("title",i.data("ui-tooltip-title")),i.removeData("ui-tooltip-title"))})}})}(jQuery),function($){var min=Math.min,max=Math.max,round=Math.floor,isStr=function(t){return"string"===$.type(t)},runPluginCallbacks=function(Instance,a_fn){function g(t){return t}if($.isArray(a_fn))for(var i=0,c=a_fn.length;i
                  ').appendTo("body"),n={width:e.outerWidth-e[0].clientWidth,height:100-e[0].clientHeight};return e.remove(),window.scrollbarWidth=n.width,window.scrollbarHeight=n.height,t.match(/^(width|height)$/)?n[t]:n},disableTextSelection:function(){var t=$(document),e="textSelectionDisabled",n="textSelectionInitialized";$.fn.disableSelection&&(t.data(n)||t.on("mouseup",$.layout.enableTextSelection).data(n,!0),t.data(e)||t.disableSelection().data(e,!0))},enableTextSelection:function(){var t=$(document),e="textSelectionDisabled";$.fn.enableSelection&&t.data(e)&&t.enableSelection().data(e,!1)},showInvisibly:function(t,e){if(t&&t.length&&(e||"none"===t.css("display"))){var n=t[0].style,i={display:n.display||"",visibility:n.visibility||""};return t.css({display:"block",visibility:"hidden"}),i}return{}},getElementDimensions:function(t,e){var n,i,r,o={css:{},inset:{}},s=o.css,a={bottom:0},l=$.layout.cssNum,u=Math.round,c=t.offset();return o.offsetLeft=c.left,o.offsetTop=c.top,e||(e={}),$.each("Left,Right,Top,Bottom".split(","),function(l,u){n=s["border"+u]=$.layout.borderWidth(t,u),i=s["padding"+u]=$.layout.cssNum(t,"padding"+u),r=u.toLowerCase(),o.inset[r]=e[r]>=0?e[r]:i,a[r]=o.inset[r]+n}),s.width=u(t.width()),s.height=u(t.height()),s.top=l(t,"top",!0),s.bottom=l(t,"bottom",!0),s.left=l(t,"left",!0),s.right=l(t,"right",!0),o.outerWidth=u(t.outerWidth()),o.outerHeight=u(t.outerHeight()),o.innerWidth=max(0,o.outerWidth-a.left-a.right),o.innerHeight=max(0,o.outerHeight-a.top-a.bottom),o.layoutWidth=u(t.innerWidth()),o.layoutHeight=u(t.innerHeight()),o},getElementStyles:function(t,e){var n,i,r,o,s,a,l={},u=t[0].style,c=e.split(","),h="Top,Bottom,Left,Right".split(","),f="Color,Style,Width".split(",");for(o=0;o=o&&l<=s&&u>=r&&u<=a},msg:function(t,e,n,i){function r(){var t=$.support.fixedPosition?"fixed":"absolute",e=$('
                  XLayout console.log
                    ').appendTo("body");return e.css("left",$(window).width()-e.outerWidth()-5),$.ui.draggable&&e.draggable({handle:":first-child"}),e}if($.isPlainObject(t)&&window.debugData){"string"==typeof e?(i=n,n=e):"object"==typeof n&&(i=n,n=null);var o=n||"log( )",s=$.extend({sort:!1,returnHTML:!1,display:!1},i);e===!0||s.display?debugData(t,o,s):window.console&&console.log(debugData(t,o,s))}else if(e)alert(t);else if(window.console)console.log(t);else{var a="#layoutLogger",l=$(a);l.length||(l=r()),l.children("ul").append('
                  • '+t.replace(/\/g,">")+"
                  • ")}}},function(){var t=navigator.userAgent.toLowerCase(),e=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[],n=e[1]||"",i=e[2]||0,r="msie"===n,o=document.compatMode,s=$.support,a=void 0!==s.boxSizing?s.boxSizing:s.boxSizingReliable,l=!r||!o||"CSS1Compat"===o||s.boxModel||!1,u=$.layout.browser={version:i,safari:"webkit"===n,webkit:"chrome"===n,msie:r,isIE6:r&&6==i,boxModel:l,boxSizing:!!("function"==typeof a?a():a)};n&&(u[n]=!0),l||o||$(function(){u.boxModel=s.boxModel})}(),$.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1e3,resizer_drag:1e4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center", +togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:$.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}},$.layout.optionsMap={layout:"name,instanceKey,stateManagement,effects,inset,zIndexes,errors,zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end".split(","),center:"paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,containerSelector,children,initChildren,resizeChildren,destroyChildren,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end".split(","),noDefault:"paneSelector,resizerCursor,customHotkey".split(",")},$.layout.transformData=function(t,e){var n,i,r,o,s,a,l,u=e?{panes:{},center:{}}:{};if("object"!=typeof t)return u;for(i in t)for(n=u,s=t[i],r=i.split("__"),l=r.length-1,a=0;a<=l;a++)o=r[a],a===l?$.isPlainObject(s)?n[o]=$.layout.transformData(s):n[o]=s:(n[o]||(n[o]={}),n=n[o]);return u},$.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(t){function e(e,n){for(var i,r=e.split("."),o=r.length-1,s={branch:t,key:r[o]},a=0;a=37&&e<=40;return u&&options[s[e]].enableCursorHotkey?o=s[e]:(l||a)&&$.each(_c.borderPanes,function(t,s){if(n=options[s],i=n.customHotkey,r=n.customHotkeyModifier,(a&&"SHIFT"==r||l&&"CTRL"==r||l&&a)&&i&&e===(isNaN(i)||i<=9?i.toUpperCase().charCodeAt(0):i))return o=s,!1}),!(o&&$Ps[o]&&options[o].closable&&!state[o].isHidden)||(toggle(o),t.stopPropagation(),t.returnValue=!1,!1)}function allowOverflow(t){if(isInitialized()){this&&this.tagName&&(t=this);var e;if(isStr(t)?e=$Ps[t]:$(t).data("layoutRole")?e=$(t):$(t).parents().each(function(){if($(this).data("layoutRole"))return e=$(this),!1}),e&&e.length){var n=e.data("layoutEdge"),i=state[n];if(i.cssSaved&&resetOverflow(n),i.isSliding||i.isResizing||i.isClosed)return void(i.cssSaved=!1);var r={zIndex:options.zIndexes.resizer_normal+1},o={},s=e.css("overflow"),a=e.css("overflowX"),l=e.css("overflowY");"visible"!=s&&(o.overflow=s,r.overflow="visible"),a&&!a.match(/(visible|auto)/)&&(o.overflowX=a,r.overflowX="visible"),l&&!l.match(/(visible|auto)/)&&(o.overflowY=a,r.overflowY="visible"),i.cssSaved=o,e.css(r),$.each(_c.allPanes,function(t,e){e!=n&&resetOverflow(e)})}}}function resetOverflow(t){if(isInitialized()){this&&this.tagName&&(t=this);var e;if(isStr(t)?e=$Ps[t]:$(t).data("layoutRole")?e=$(t):$(t).parents().each(function(){if($(this).data("layoutRole"))return e=$(this),!1}),e&&e.length){var n=e.data("layoutEdge"),i=state[n],r=i.cssSaved||{};i.isSliding||i.isResizing||e.css("zIndex",options.zIndexes.pane_normal),e.css(r),i.cssSaved=!1}}}var browser=$.layout.browser,_c=$.layout.config,cssW=$.layout.cssWidth,cssH=$.layout.cssHeight,elDims=$.layout.getElementDimensions,styles=$.layout.getElementStyles,evtObj=$.layout.getEventObject,evtPane=$.layout.parsePaneName,options=$.extend(!0,{},$.layout.defaults),effects=options.effects=$.extend(!0,{},$.layout.effects),state={id:"layout"+$.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},children={north:null,south:null,east:null,west:null,center:null},timer={data:{},set:function(t,e,n){timer.clear(t),timer.data[t]=setTimeout(e,n)},clear:function(t){var e=timer.data;e[t]&&(clearTimeout(e[t]),delete e[t])}},_log=function(t,e,n){var i=options;return(i.showErrorMessages&&!n||n&&i.showDebugMessages)&&$.layout.msg(i.name+" / "+t,e!==!1),!1},_runCallbacks=function(evtName,pane,skipBoundEvents){function g(t){return t}var hasPane=pane&&isStr(pane),s=hasPane?state[pane]:state,o=hasPane?options[pane]:options,lName=options.name,lng=evtName+(evtName.match(/_/)?"":"_end"),shrt=lng.match(/_end$/)?lng.substr(0,lng.length-4):"",fn=o[lng]||o[shrt],retVal="NC",args=[],$P=hasPane?$Ps[pane]:0;if(hasPane&&!$P)return retVal;if(hasPane||"boolean"!==$.type(pane)||(skipBoundEvents=pane,pane=""),fn)try{isStr(fn)&&(fn.match(/,/)?(args=fn.split(","),fn=eval(args[0])):fn=eval(fn)),$.isFunction(fn)&&(retVal=args.length?g(fn)(args[1]):hasPane?g(fn)(pane,$Ps[pane],s,o,lName):g(fn)(Instance,s,o,lName))}catch(ex){_log(options.errors.callbackError.replace(/EVENT/,$.trim((pane||"")+" "+lng)),!1),"string"===$.type(ex)&&string.length&&_log("Exception: "+ex,!1)}return skipBoundEvents||retVal===!1||(hasPane?(o=options[pane],s=state[pane],$P.triggerHandler("layoutpane"+lng,[pane,$P,s,o,lName]),shrt&&$P.triggerHandler("layoutpane"+shrt,[pane,$P,s,o,lName])):($N.triggerHandler("layout"+lng,[Instance,s,o,lName]),shrt&&$N.triggerHandler("layout"+shrt,[Instance,s,o,lName]))),hasPane&&"onresize_end"===evtName&&resizeChildren(pane+"",!0),retVal},_fixIframe=function(t){if(!browser.mozilla){var e=$Ps[t];"IFRAME"===state[t].tagName?e.css(_c.hidden).css(_c.visible):e.find("IFRAME").css(_c.hidden).css(_c.visible)}},cssSize=function(t,e){var n="horz"==_c[t].dir?cssH:cssW;return n($Ps[t],e)},cssMinDims=function(t){var e=$Ps[t],n=_c[t].dir,i={minWidth:1001-cssW(e,1e3),minHeight:1001-cssH(e,1e3)};return"horz"===n&&(i.minSize=i.minHeight),"vert"===n&&(i.minSize=i.minWidth),i},setOuterWidth=function(t,e,n){var i,r=t;isStr(t)?r=$Ps[t]:t.jquery||(r=$(t)),i=cssW(r,e),r.css({width:i}),i>0?n&&r.data("autoHidden")&&r.innerHeight()>0&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},setOuterHeight=function(t,e,n){var i,r=t;isStr(t)?r=$Ps[t]:t.jquery||(r=$(t)),i=cssH(r,e),r.css({height:i,visibility:"visible"}),i>0&&r.innerWidth()>0?n&&r.data("autoHidden")&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},_parseSize=function(t,e,n){if(n||(n=_c[t].dir),isStr(e)&&e.match(/%/)&&(e="100%"===e?-1:parseInt(e,10)/100),0===e)return 0;if(e>=1)return parseInt(e,10);var i=options,r=0;if("horz"==n?r=sC.innerHeight-($Ps.north?i.north.spacing_open:0)-($Ps.south?i.south.spacing_open:0):"vert"==n&&(r=sC.innerWidth-($Ps.west?i.west.spacing_open:0)-($Ps.east?i.east.spacing_open:0)),e===-1)return r;if(e>0)return round(r*e);if("center"==t)return 0;var o="horz"===n?"height":"width",s=$Ps[t],a="height"===o&&$Cs[t],l=$.layout.showInvisibly(s),u=s.css(o),c=a?a.css(o):0;return s.css(o,"auto"),a&&a.css(o,"auto"),e="height"===o?s.outerHeight():s.outerWidth(),s.css(o,u).css(l),a&&a.css(o,c),e},getPaneSize=function(t,e){var n=$Ps[t],i=options[t],r=state[t],o=e?i.spacing_open:0,s=e?i.spacing_closed:0;return!n||r.isHidden?0:r.isClosed||r.isSliding&&e?s:"horz"===_c[t].dir?n.outerHeight()+o:n.outerWidth()+o},setSizeLimits=function(t,e){if(isInitialized()){var n=options[t],i=state[t],r=_c[t],o=r.dir,s=(r.sizeType.toLowerCase(),void 0!=e?e:i.isSliding),a=($Ps[t],n.spacing_open),l=_c.oppositeEdge[t],u=state[l],c=$Ps[l],h=!c||u.isVisible===!1||u.isSliding?0:"horz"==o?c.outerHeight():c.outerWidth(),f=(!c||u.isHidden?0:options[l][u.isClosed!==!1?"spacing_closed":"spacing_open"])||0,d="horz"==o?sC.innerHeight:sC.innerWidth,p=cssMinDims("center"),g="horz"==o?max(options.center.minHeight,p.minHeight):max(options.center.minWidth,p.minWidth),m=d-a-(s?0:_parseSize("center",g,o)+h+f),v=i.minSize=max(_parseSize(t,n.minSize),cssMinDims(t).minSize),y=i.maxSize=min(n.maxSize?_parseSize(t,n.maxSize):1e5,m),b=i.resizerPosition={},w=sC.inset.top,_=sC.inset.left,x=sC.innerWidth,k=sC.innerHeight,S=n.spacing_open;switch(t){case"north":b.min=w+v,b.max=w+y;break;case"west":b.min=_+v,b.max=_+y;break;case"south":b.min=w+k-y-S,b.max=w+k-v-S;break;case"east":b.min=_+x-y-S,b.max=_+x-v-S}}},calcNewCenterPaneDims=function(){var t={top:getPaneSize("north",!0),bottom:getPaneSize("south",!0),left:getPaneSize("west",!0),right:getPaneSize("east",!0),width:0,height:0};return t.width=sC.innerWidth-t.left-t.right,t.height=sC.innerHeight-t.bottom-t.top,t.top+=sC.inset.top,t.bottom+=sC.inset.bottom,t.left+=sC.inset.left,t.right+=sC.inset.right,t},getHoverClasses=function(t,e){var n=$(t),i=n.data("layoutRole"),r=n.data("layoutEdge"),o=options[r],s=o[i+"Class"],a="-"+r,l="-open",u="-closed",c="-sliding",h="-hover ",f=n.hasClass(s+u)?u:l,d=f===u?l:u,p=s+h+(s+a+h)+(s+f+h)+(s+a+f+h);return e&&(p+=s+d+h+(s+a+d+h)),"resizer"==i&&n.hasClass(s+c)&&(p+=s+c+h+(s+a+c+h)),$.trim(p)},addHover=function(t,e){var n=$(e||this);t&&"toggler"===n.data("layoutRole")&&t.stopPropagation(),n.addClass(getHoverClasses(n))},removeHover=function(t,e){var n=$(e||this);n.removeClass(getHoverClasses(n,!0))},onResizerEnter=function(t){var e=$(this).data("layoutEdge"),n=state[e];$(document);n.isResizing||state.paneResizing||options.maskPanesEarly&&showMasks(e,{resizing:!0})},onResizerLeave=function(t,e){var n=e||this,i=$(n).data("layoutEdge"),r=i+"ResizerLeave";$(document);timer.clear(i+"_openSlider"),timer.clear(r),e?options.maskPanesEarly&&!state.paneResizing&&hideMasks():timer.set(r,function(){onResizerLeave(t,n)},200)},_create=function(){initOptions();var t=options,e=state;return e.creatingLayout=!0,runPluginCallbacks(Instance,$.layout.onCreate),!1===_runCallbacks("onload_start")?"cancel":(_initContainer(),initHotkeys(),$(window).bind("unload."+sID,unload),runPluginCallbacks(Instance,$.layout.onLoad),t.initPanes&&_initLayoutElements(),delete e.creatingLayout,state.initialized)},isInitialized=function(){return!(!state.initialized&&!state.creatingLayout)||_initLayoutElements()},_initLayoutElements=function(t){var e=options;if(!$N.is(":visible"))return!t&&browser.webkit&&"BODY"===$N[0].tagName&&setTimeout(function(){_initLayoutElements(!0)},50),!1;if(!getPane("center").length)return _log(e.errors.centerPaneMissing);if(state.creatingLayout=!0,$.extend(sC,elDims($N,e.inset)),initPanes(),e.scrollToBookmarkOnLoad){var n=self.location;n.hash&&n.replace(n.hash)}return Instance.hasParentLayout?e.resizeWithWindow=!1:e.resizeWithWindow&&$(window).bind("resize."+sID,windowResize),delete state.creatingLayout,state.initialized=!0,runPluginCallbacks(Instance,$.layout.onReady),_runCallbacks("onload_end"),!0},createChildren=function(t,e){var n=evtPane.call(this,t),i=$Ps[n];if(i){var r=$Cs[n],o=state[n],s=options[n],a=options.stateManagement||{},l=e?s.children=e:s.children;if($.isPlainObject(l))l=[l];else if(!l||!$.isArray(l))return;$.each(l,function(t,e){if($.isPlainObject(e)){var s=e.containerSelector?i.find(e.containerSelector):r||i;s.each(function(){var t=$(this),i=t.data("layout");if(!i){if(setInstanceKey({container:t,options:e},o),a.includeChildren&&state.stateData[n]){var r=state.stateData[n].children||{},s=r[e.instanceKey],l=e.stateManagement||(e.stateManagement={autoLoad:!0});l.autoLoad===!0&&s&&(l.autoSave=!1,l.includeChildren=!0,l.autoLoad=$.extend(!0,{},s))}i=t.layout(e),i&&refreshChildren(n,i)}})}})}},setInstanceKey=function(t,e){var n=t.container,i=t.options,r=i.stateManagement,o=i.instanceKey||n.data("layoutInstanceKey");return o||(o=(r&&r.cookie?r.cookie.name:"")||i.name),o=o?o.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):"layout"+ ++e.childIdx,i.instanceKey=o,n.data("layoutInstanceKey",o),o},refreshChildren=function(t,e){var n,i=$Ps[t],r=children[t],o=state[t];$.isPlainObject(r)&&($.each(r,function(t,e){e.destroyed&&delete r[t]}),$.isEmptyObject(r)&&(r=children[t]=null)),e||r||(e=i.data("layout")),e&&(e.hasParentLayout=!0,n=e.options,setInstanceKey(e,o),r||(r=children[t]={}),r[n.instanceKey]=e.container.data("layout")),Instance[t].children=children[t],e||createChildren(t)},windowResize=function(){var t=options,e=Number(t.resizeWithWindowDelay);e<10&&(e=100),timer.clear("winResize"),timer.set("winResize",function(){timer.clear("winResize"),timer.clear("winResizeRepeater");var e=elDims($N,t.inset);e.innerWidth===sC.innerWidth&&e.innerHeight===sC.innerHeight||resizeAll()},e),timer.data.winResizeRepeater||setWindowResizeRepeater()},setWindowResizeRepeater=function(){var t=Number(options.resizeWithWindowMaxDelay);t>0&&timer.set("winResizeRepeater",function(){setWindowResizeRepeater(),resizeAll()},t)},unload=function(){_runCallbacks("onunload_start"),runPluginCallbacks(Instance,$.layout.onUnload),_runCallbacks("onunload_end")},_initContainer=function(){var t,e,n=$N[0],i=$("html"),r=sC.tagName=n.tagName,o=sC.id=n.id,s=sC.className=n.className,a=options,l=a.name,u="position,margin,padding,border",c="layoutCSS",h={},f="hidden",d=$N.data("parentLayout"),p=$N.data("layoutEdge"),g=d&&p,m=$.layout.cssNum;sC.selector=$N.selector.split(".slice")[0],sC.ref=(a.name?a.name+" layout / ":"")+r+(o?"#"+o:s?".["+s+"]":""),sC.isBody="BODY"===r,g||sC.isBody||(t=$N.closest("."+$.layout.defaults.panes.paneClass),d=t.data("parentLayout"),p=t.data("layoutEdge"),g=d&&p),$N.data({layout:Instance,layoutContainer:sID}).addClass(a.containerClass);var v={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(l in v)$N.bind("layout"+l.toLowerCase()+"."+sID,Instance[v[l]||l]);g&&(Instance.hasParentLayout=!0,d.refreshChildren(p,Instance)),$N.data(c)||(sC.isBody?($N.data(c,$.extend(styles($N,u),{height:$N.css("height"),overflow:$N.css("overflow"),overflowX:$N.css("overflowX"),overflowY:$N.css("overflowY")})),i.data(c,$.extend(styles(i,"padding"),{height:"auto",overflow:i.css("overflow"),overflowX:i.css("overflowX"),overflowY:i.css("overflowY")}))):$N.data(c,styles($N,u+",top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{if(h={overflow:f,overflowX:f,overflowY:f},$N.css(h),a.inset&&!$.isPlainObject(a.inset)&&(e=parseInt(a.inset,10)||0,a.inset={top:e,bottom:e,left:e,right:e}),sC.isBody)a.outset?$.isPlainObject(a.outset)||(e=parseInt(a.outset,10)||0,a.outset={top:e,bottom:e,left:e,right:e}):a.outset={top:m(i,"paddingTop"),bottom:m(i,"paddingBottom"),left:m(i,"paddingLeft"),right:m(i,"paddingRight")},i.css(h).css({height:"100%",border:"none",padding:0,margin:0}),browser.isIE6?($N.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"}),a.inset||(a.inset=elDims($N).inset)):($N.css({width:"auto",height:"auto",margin:0,position:"absolute"}),$N.css(a.outset)),$.extend(sC,elDims($N,a.inset));else{var y=$N.css("position");y&&y.match(/(fixed|absolute|relative)/)||$N.css("position","relative"),$N.is(":visible")&&($.extend(sC,elDims($N,a.inset)),sC.innerHeight<1&&_log(a.errors.noContainerHeight.replace(/CONTAINER/,sC.ref)))}m($N,"minWidth")&&$N.parent().css("overflowX","auto"),m($N,"minHeight")&&$N.parent().css("overflowY","auto")}catch(b){}},initHotkeys=function(t){t=t?t.split(","):_c.borderPanes,$.each(t,function(t,e){var n=options[e];if(n.enableCursorHotkey||n.customHotkey)return $(document).bind("keydown."+sID,keyDown),!1})},initOptions=function(){function t(t){var e=options[t],n=options.panes;e.fxSettings||(e.fxSettings={}),n.fxSettings||(n.fxSettings={}),$.each(["_open","_close","_size"],function(i,r){var o="fxName"+r,s="fxSpeed"+r,a="fxSettings"+r,l=e[o]=e[o]||n[o]||e.fxName||n.fxName||"none",u=$.effects&&($.effects[l]||$.effects.effect&&$.effects.effect[l]);"none"!==l&&options.effects[l]&&u||(l=e[o]="none");var c=options.effects[l]||{},h=c.all||null,f=c[t]||null;e[s]=e[s]||n[s]||e.fxSpeed||n.fxSpeed||null,e[a]=$.extend(!0,{},h,f,n.fxSettings,e.fxSettings,n[a],e[a])}),delete e.fxName,delete e.fxSpeed,delete e.fxSettings}var e,n,i,r,o,s,a;if(opts=$.layout.transformData(opts,!0),opts=$.layout.backwardCompatibility.renameAllOptions(opts),!$.isEmptyObject(opts.panes)){for(e=$.layout.optionsMap.noDefault,o=0,s=e.length;o0&&(c.pane_normal=u,c.content_mask=max(u+1,c.content_mask),c.resizer_normal=max(u+2,c.resizer_normal)),delete options.panes},getPane=function(t){var e=options[t].paneSelector;if("#"===e.substr(0,1))return $N.find(e).eq(0);var n=$N.children(e).eq(0);return n.length?n:$N.children("form:first").children(e).eq(0)},initPanes=function(t){evtPane(t),$.each(_c.allPanes,function(t,e){addPane(e,!0)}),initHandles(),$.each(_c.borderPanes,function(t,e){$Ps[e]&&state[e].isVisible&&(setSizeLimits(e),makePaneFit(e))}),sizeMidPanes("center"),$.each(_c.allPanes,function(t,e){afterInitPane(e)})},addPane=function(t,e){if(e||isInitialized()){var n,i,r,o=options[t],s=state[t],a=_c[t],l=a.dir,u=(s.fx,o.spacing_open||0,"center"===t),c={},h=$Ps[t];if(h?removePane(t,!1,!0,!1):$Cs[t]=!1,h=$Ps[t]=getPane(t),!h.length)return void($Ps[t]=!1);if(!h.data("layoutCSS")){var f="position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";h.data("layoutCSS",styles(h,f))}Instance[t]={name:t,pane:$Ps[t],content:$Cs[t],options:options[t],state:state[t],children:children[t]},h.data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"pane"}).css(a.cssReq).css("zIndex",options.zIndexes.pane_normal).css(o.applyDemoStyles?a.cssDemo:{}).addClass(o.paneClass+" "+o.paneClass+"-"+t).bind("mouseenter."+sID,addHover).bind("mouseleave."+sID,removeHover);var d,p={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",resizeAll:"resizeAll",resizeLayout:"resizeAll"};for(d in p)h.bind("layoutpane"+d.toLowerCase()+"."+sID,Instance[p[d]||d]);initContent(t,!1),u||(n=s.size=_parseSize(t,o.size),i=_parseSize(t,o.minSize)||1,r=_parseSize(t,o.maxSize)||1e5,n>0&&(n=max(min(n,r),i)),s.autoResize=o.autoResize,s.isClosed=!1,s.isSliding=!1,s.isResizing=!1,s.isHidden=!1,s.pins||(s.pins=[])),s.tagName=h[0].tagName,s.edge=t,s.noRoom=!1,s.isVisible=!0,setPanePosition(t),"horz"===l?c.height=cssH(h,n):"vert"===l&&(c.width=cssW(h,n)),h.css(c),"horz"!=l&&sizeMidPanes(t,!0),state.initialized&&(initHandles(t),initHotkeys(t)),o.initClosed&&o.closable&&!o.initHidden?close(t,!0,!0):o.initHidden||o.initClosed?hide(t):s.noRoom||h.css("display","block"),h.css("visibility","visible"),o.showOverflowOnHover&&h.hover(allowOverflow,resetOverflow),state.initialized&&afterInitPane(t)}},afterInitPane=function(t){var e=$Ps[t],n=state[t],i=options[t];e&&(e.data("layout")&&refreshChildren(t,e.data("layout")),n.isVisible&&(state.initialized?resizeAll():sizeContent(t),i.triggerEventsOnLoad?_runCallbacks("onresize_end",t):resizeChildren(t,!0)),i.initChildren&&i.children&&createChildren(t))},setPanePosition=function(t){t=t?t.split(","):_c.borderPanes,$.each(t,function(t,e){var n=$Ps[e],i=$Rs[e],r=(options[e],state[e]),o=_c[e].side,s={};if(n){switch(e){case"north":s.top=sC.inset.top,s.left=sC.inset.left,s.right=sC.inset.right;break;case"south":s.bottom=sC.inset.bottom,s.left=sC.inset.left,s.right=sC.inset.right;break;case"west":s.left=sC.inset.left;break;case"east":s.right=sC.inset.right;break;case"center":}n.css(s),i&&r.isClosed?i.css(o,sC.inset[o]):i&&!r.isHidden&&i.css(o,sC.inset[o]+getPaneSize(e))}})},initHandles=function(t){t=t?t.split(","):_c.borderPanes,$.each(t,function(t,e){var n=$Ps[e];if($Rs[e]=!1,$Ts[e]=!1,n){var i=options[e],r=state[e],o=(_c[e],"#"===i.paneSelector.substr(0,1)?i.paneSelector.substr(1):""),s=i.resizerClass,a=i.togglerClass,l=(r.isVisible?i.spacing_open:i.spacing_closed,"-"+e),u=(r.isVisible?"-open":"-closed",Instance[e]),c=u.resizer=$Rs[e]=$("
                    "),h=u.toggler=!!i.closable&&($Ts[e]=$("
                    "));!r.isVisible&&i.slidable&&c.attr("title",i.tips.Slide).css("cursor",i.sliderCursor),c.attr("id",o?o+"-resizer":"").data({parentLayout:Instance,layoutPane:Instance[e],layoutEdge:e,layoutRole:"resizer"}).css(_c.resizers.cssReq).css("zIndex",options.zIndexes.resizer_normal).css(i.applyDemoStyles?_c.resizers.cssDemo:{}).addClass(s+" "+s+l).hover(addHover,removeHover).hover(onResizerEnter,onResizerLeave).mousedown($.layout.disableTextSelection).mouseup($.layout.enableTextSelection).appendTo($N),$.fn.disableSelection&&c.disableSelection(),i.resizerDblClickToggle&&c.bind("dblclick."+sID,toggle),h&&(h.attr("id",o?o+"-toggler":"").data({parentLayout:Instance,layoutPane:Instance[e],layoutEdge:e,layoutRole:"toggler"}).css(_c.togglers.cssReq).css(i.applyDemoStyles?_c.togglers.cssDemo:{}).addClass(a+" "+a+l).hover(addHover,removeHover).bind("mouseenter",onResizerEnter).appendTo(c),i.togglerContent_open&&$(""+i.togglerContent_open+"").data({layoutEdge:e,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",e).addClass("content content-open").css("display","none").appendTo(h),i.togglerContent_closed&&$(""+i.togglerContent_closed+"").data({layoutEdge:e,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(h),enableClosable(e)),initResizable(e),r.isVisible?setAsOpen(e):(setAsClosed(e),bindStartSlidingEvents(e,!0))}}),sizeHandles()},initContent=function(t,e){if(isInitialized()){var n,i=options[t],r=i.contentSelector,o=Instance[t],s=$Ps[t];r&&(n=o.content=$Cs[t]=i.findNestedContent?s.find(r).eq(0):s.children(r).eq(0)),n&&n.length?(n.data("layoutRole","content"),n.data("layoutCSS")||n.data("layoutCSS",styles(n,"height")),n.css(_c.content.cssReq),i.applyDemoStyles&&(n.css(_c.content.cssDemo),s.css(_c.content.cssDemoPane)),s.css("overflowX").match(/(scroll|auto)/)&&s.css("overflow","hidden"),state[t].content={},e!==!1&&sizeContent(t)):o.content=$Cs[t]=!1}},initResizable=function(t){var e=$.layout.plugins.draggable;t=t?t.split(","):_c.borderPanes,$.each(t,function(t,i){var r=options[i];if(!e||!$Ps[i]||!r.resizable)return r.resizable=!1,!0;var o,s,a=state[i],l=options.zIndexes,u=_c[i],c="horz"==u.dir?"top":"left",h=($Ps[i],$Rs[i]),f=r.resizerClass,d=0,p=f+"-drag",g=f+"-"+i+"-drag",m=f+"-dragging",v=f+"-"+i+"-dragging",y=f+"-dragging-limit",b=f+"-"+i+"-dragging-limit",w=!1;a.isClosed||h.attr("title",r.tips.Resize).css("cursor",r.resizerCursor),h.draggable({containment:$N[0],axis:"horz"==u.dir?"y":"x",delay:0,distance:1,grid:r.resizingGrid,helper:"clone",opacity:r.resizerDragOpacity,addClasses:!1,zIndex:l.resizer_drag,start:function(t,e){return r=options[i],a=state[i],s=r.livePaneResizing,!1!==_runCallbacks("ondrag_start",i)&&(a.isResizing=!0,state.paneResizing=i,timer.clear(i+"_closeSlider"),setSizeLimits(i),o=a.resizerPosition,d=e.position[c],h.addClass(p+" "+g),w=!1,void showMasks(i,{resizing:!0}))},drag:function(t,e){w||(e.helper.addClass(m+" "+v).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),w=!0,a.isSliding&&$Ps[i].css("zIndex",l.pane_sliding));var u=0;e.position[c]o.max&&(e.position[c]=o.max,u=1),u?(e.helper.addClass(y+" "+b),window.defaultStatus=u>0&&i.match(/(north|west)/)||u<0&&i.match(/(south|east)/)?r.tips.maxSizeWarning:r.tips.minSizeWarning):(e.helper.removeClass(y+" "+b),window.defaultStatus=""),s&&Math.abs(e.position[c]-d)>=r.liveResizingTolerance&&(d=e.position[c],n(t,e,i))},stop:function(t,e){$("body").enableSelection(),window.defaultStatus="",h.removeClass(p+" "+g),a.isResizing=!1,state.paneResizing=!1,n(t,e,i,!0)}})});var n=function(t,e,n,i){var r,o=e.position,s=_c[n],a=options[n],l=state[n];switch(n){case"north":r=o.top;break;case"west":r=o.left;break;case"south":r=sC.layoutHeight-o.top-a.spacing_open;break;case"east":r=sC.layoutWidth-o.left-a.spacing_open}var u=r-sC.inset[s.side];if(i)!1!==_runCallbacks("ondrag_end",n)&&manualSizePane(n,u,!1,!0),hideMasks(!0),l.isSliding&&showMasks(n,{resizing:!0});else{if(Math.abs(u-l.size)=0;i--)n=$Ms.eq(i),e=n.data("layoutMask"),options[e].maskObjects||n.hide()},getMasks=function(t){for(var e,n=$([]),i=0,r=$Ms.length;ic.maxSize?(syncPinBtns(a,!1),!i&&u.tips.noRoomToOpen&&alert(u.tips.noRoomToOpen),t()):(e?bindStopSlidingEvents(a,!0):c.isSliding?bindStopSlidingEvents(a,!1):u.slidable&&bindStartSlidingEvents(a,!1),c.noRoom=!1,makePaneFit(a),s=c.isShowing,delete c.isShowing,o=!n&&c.isClosed&&"none"!=u.fxName_open,c.isMoving=!0,c.isVisible=!0,c.isClosed=!1,s&&(c.isHidden=!1),void(o?(lockPaneForFX(a,!0),l.show(u.fxName_open,u.fxSettings_open,u.fxSpeed_open,function(){lockPaneForFX(a,!1),c.isVisible&&r(),t()})):(_showPane(a),r(),t()))))})}},setAsOpen=function(t,e){var n=$Ps[t],i=$Rs[t],r=$Ts[t],o=options[t],s=state[t],a=_c[t].side,l=o.resizerClass,u=o.togglerClass,c="-"+t,h="-open",f="-closed",d="-sliding";i.css(a,sC.inset[a]+getPaneSize(t)).removeClass(l+f+" "+l+c+f).addClass(l+h+" "+l+c+h),s.isSliding?i.addClass(l+d+" "+l+c+d):i.removeClass(l+d+" "+l+c+d),removeHover(0,i),o.resizable&&$.layout.plugins.draggable?i.draggable("enable").css("cursor",o.resizerCursor).attr("title",o.tips.Resize):s.isSliding||i.css("cursor","default"),r&&(r.removeClass(u+f+" "+u+c+f).addClass(u+h+" "+u+c+h).attr("title",o.tips.Close),removeHover(0,r),r.children(".content-closed").hide(),r.children(".content-open").css("display","block")),syncPinBtns(t,!s.isSliding),$.extend(s,elDims(n)),state.initialized&&(sizeHandles(),sizeContent(t,!0)),!e&&(state.initialized||o.triggerEventsOnLoad)&&n.is(":visible")&&(_runCallbacks("onopen_end",t),s.isShowing&&_runCallbacks("onshow_end",t),state.initialized&&_runCallbacks("onresize_end",t))},slideOpen=function(t){function e(){r.isClosed?r.isMoving||open(i,!0):bindStopSlidingEvents(i,!0)}if(isInitialized()){var n=evtObj(t),i=evtPane.call(this,t),r=state[i],o=options[i].slideDelay_open;"center"!==i&&(n&&n.stopImmediatePropagation(),r.isClosed&&n&&"mouseenter"===n.type&&o>0?timer.set(i+"_openSlider",e,o):e())}},slideClose=function(t){function e(){o.isClosed?bindStopSlidingEvents(i,!1):o.isMoving||close(i)}if(isInitialized()){var n=evtObj(t),i=evtPane.call(this,t),r=options[i],o=state[i],s=o.isMoving?1e3:300;if("center"!==i&&!o.isClosed&&!o.isResizing)if("click"===r.slideTrigger_close)e();else{if(r.preventQuickSlideClose&&o.isMoving)return;if(r.preventPrematureSlideClose&&n&&$.layout.isMouseOverElem(n,$Ps[i]))return;n?timer.set(i+"_closeSlider",e,max(r.slideDelay_close,s)):e()}}},slideToggle=function(t){var e=evtPane.call(this,t);toggle(e,!0)},lockPaneForFX=function(t,e){var n=$Ps[t],i=state[t],r=options[t],o=options.zIndexes;e?(showMasks(t,{animation:!0,objectsOnly:!0}),n.css({zIndex:o.pane_animate}),"south"==t?n.css({top:sC.inset.top+sC.innerHeight-n.outerHeight()}):"east"==t&&n.css({left:sC.inset.left+sC.innerWidth-n.outerWidth()})):(hideMasks(),n.css({zIndex:i.isSliding?o.pane_sliding:o.pane_normal}),"south"==t?n.css({top:"auto"}):"east"!=t||n.css("left").match(/\-99999/)||n.css({left:"auto"}),browser.msie&&r.fxOpacityFix&&"slide"!=r.fxName_open&&n.css("filter")&&1==n.css("opacity")&&n[0].style.removeAttribute("filter"))},bindStartSlidingEvents=function(t,e){var n=options[t],i=($Ps[t],$Rs[t]),r=n.slideTrigger_open.toLowerCase();!i||e&&!n.slidable||(r.match(/mouseover/)?r=n.slideTrigger_open="mouseenter":r.match(/(click|dblclick|mouseenter)/)||(r=n.slideTrigger_open="click"),n.resizerDblClickToggle&&r.match(/click/)&&i[e?"unbind":"bind"]("dblclick."+sID,toggle),i[e?"bind":"unbind"](r+"."+sID,slideOpen).css("cursor",e?n.sliderCursor:"default").attr("title",e?n.tips.Slide:""))},bindStopSlidingEvents=function(t,e){function n(e){timer.clear(t+"_closeSlider"),e.stopPropagation()}var i=options[t],r=state[t],o=(_c[t],options.zIndexes),s=i.slideTrigger_close.toLowerCase(),a=e?"bind":"unbind",l=$Ps[t],u=$Rs[t];timer.clear(t+"_closeSlider"),e?(r.isSliding=!0,state.panesSliding[t]=!0,bindStartSlidingEvents(t,!1)):(r.isSliding=!1,delete state.panesSliding[t]),l.css("zIndex",e?o.pane_sliding:o.pane_normal),u.css("zIndex",e?o.pane_sliding+2:o.resizer_normal),s.match(/(click|mouseleave)/)||(s=i.slideTrigger_close="mouseleave"),u[a](s,slideClose),"mouseleave"===s&&(l[a]("mouseleave."+sID,slideClose),u[a]("mouseenter."+sID,n),l[a]("mouseenter."+sID,n)),e?"click"!==s||i.resizable||(u.css("cursor",e?i.sliderCursor:"default"),u.attr("title",e?i.tips.Close:"")):timer.clear(t+"_closeSlider")},makePaneFit=function(t,e,n,i){var r=options[t],o=state[t],s=_c[t],a=$Ps[t],l=$Rs[t],u="vert"===s.dir,c=!1;if(("center"===t||u&&o.noVerticalRoom)&&(c=o.maxHeight>=0,c&&o.noRoom?(_showPane(t),l&&l.show(),o.isVisible=!0,o.noRoom=!1,u&&(o.noVerticalRoom=!1),_fixIframe(t)):c||o.noRoom||(_hidePane(t),l&&l.hide(),o.isVisible=!1,o.noRoom=!0)),"center"===t);else if(o.minSize<=o.maxSize){if(c=!0,o.size>o.maxSize)sizePane(t,o.maxSize,n,!0,i);else if(o.sizee?u.attempt=max(0,o.attempt-(o.actual-e)):u.attempt=max(0,o.attempt+(e-o.actual)),u.cssSize=cssSize(l,u.attempt),h.css(p,u.cssSize),u.actual="width"==p?h.outerWidth():h.outerHeight(),u.correct=e===u.actual,1===i.length&&(_log(m,!1,!0),_log(o,!1,!0)),_log(u,!1,!0),i.length>3));)i.push(u),o=i[i.length-1];c.size=e,$.extend(c,elDims(h)),c.isVisible&&h.is(":visible")&&(f&&f.css(d,e+sC.inset[d]),sizeContent(l)),!n&&!g&&state.initialized&&c.isVisible&&_runCallbacks("onresize_end",l),n||(c.isSliding||sizeMidPanes("horz"==_c[l].dir?"":"center",g,r),sizeHandles());var v=_c.oppositeEdge[l];e1&&_log(m+"\nSee the Error Console for details.",!0,!0)}if(isInitialized()){var s,a,l=evtPane.call(this,t),u=options[l],c=state[l],h=$Ps[l],f=$Rs[l],d=_c[l].side,p=_c[l].sizeType.toLowerCase(),g=c.isResizing&&!u.triggerEventsDuringLiveResize,m=i!==!0&&u.animatePaneSizing;"center"!==l&&$N.queue(function(t){if(setSizeLimits(l),s=c.size,e=_parseSize(l,e),e=max(e,_parseSize(l,u.minSize)),e=min(e,c.maxSize),e=0&&l.height>=0,!state.initialized&&r.minWidth>c.width){var h=r.minWidth-o.outerWidth,f=options.east.minSize||0,d=options.west.minSize||0,p=state.east.size,g=state.west.size,m=p,v=g;if(h>0&&state.east.isVisible&&p>f&&(m=max(p-f,p-h),h-=p-m),h>0&&state.west.isVisible&&g>d&&(v=max(g-d,g-h),h-=g-v),0===h)return p&&p!=f&&sizePane("east",m,!0,!0,n),g&&g!=d&&sizePane("west",v,!0,!0,n),sizeMidPanes("center",e,n),void s.css(u)}}else{if(o.isVisible&&!o.noVerticalRoom&&$.extend(o,elDims(s),cssMinDims(i)),!n&&!o.noVerticalRoom&&c.height===o.outerHeight)return s.css(u),!0;l.top=c.top,l.bottom=c.bottom,o.newSize=c.height,l.height=cssH(s,c.height),o.maxHeight=l.height,a=o.maxHeight>=0,a||(o.noVerticalRoom=!0)}if(a?(!e&&state.initialized&&_runCallbacks("onresize_start",i),s.css(l),"center"!==i&&sizeHandles(i),!o.noRoom||o.isClosed||o.isHidden||makePaneFit(i),o.isVisible&&($.extend(o,elDims(s)),state.initialized&&sizeContent(i))):!o.noRoom&&o.isVisible&&makePaneFit(i),s.css(u),delete o.newSize,delete o.newWidth,delete o.newHeight,!o.isVisible)return!0;if("center"===i){var y=browser.isIE6||!browser.boxModel;$Ps.north&&(y||"IFRAME"==state.north.tagName)&&$Ps.north.css("width",cssW($Ps.north,sC.innerWidth)),$Ps.south&&(y||"IFRAME"==state.south.tagName)&&$Ps.south.css("width",cssW($Ps.south,sC.innerWidth))}!e&&state.initialized&&_runCallbacks("onresize_end",i)}})},resizeAll=function(t){var e=sC.innerWidth,n=sC.innerHeight;if(evtPane(t),$N.is(":visible")){if(!state.initialized)return void _initLayoutElements();if(t===!0&&$.isPlainObject(options.outset)&&$N.css(options.outset),$.extend(sC,elDims($N,options.inset)),sC.outerHeight){if(t===!0&&setPanePosition(),!1===_runCallbacks("onresizeall_start"))return!1;var i,r,o;sC.innerHeight0&&"hidden"===o.css("overflow")&&(o.css("overflow","visible"),r(),o.css("overflow","hidden")));var c=l.innerHeight-(u.spaceAbove-l.css.paddingTop)-(u.spaceBelow-l.css.paddingBottom);s.is(":visible")&&u.height==c||(setOuterHeight(s,c,!0),u.height=c),state.initialized&&_runCallbacks("onsizecontent_end",n)}})}},sizeHandles=function(t){var e=evtPane.call(this,t);e=e?e.split(","):_c.borderPanes,$.each(e,function(t,e){var n,i=options[e],r=state[e],o=$Ps[e],s=$Rs[e],a=$Ts[e];if(o&&s){var l,u,c,h=_c[e].dir,f=r.isClosed?"_closed":"_open",d=i["spacing"+f],p=i["togglerAlign"+f],g=i["togglerLength"+f];if(0===d)return void s.hide();if(r.noRoom||r.isHidden||s.show(),"horz"===h?(l=sC.innerWidth,r.resizerLength=l,u=$.layout.cssNum(o,"left"),s.css({width:cssW(s,l),height:cssH(s,d),left:u>-9999?u:sC.inset.left})):(l=o.outerHeight(),r.resizerLength=l,s.css({height:cssH(s,l),width:cssW(s,d),top:sC.inset.top+getPaneSize("north",!0)})),removeHover(i,s),a){if(0===g||r.isSliding&&i.hideTogglerOnSlide)return void a.hide();if(a.show(),!(g>0)||"100%"===g||g>l)g=l,c=0;else if(isStr(p))switch(p){case"top":case"left":c=0;break;case"bottom":case"right":c=l-g;break;case"middle":case"center":default:c=round((l-g)/2)}else{var m=parseInt(p,10);c=p>=0?m:l-g+m}if("horz"===h){var v=cssW(a,g);a.css({width:v,height:cssH(a,d),left:c,top:0}),a.children(".content").each(function(){n=$(this),n.css("marginLeft",round((v-n.outerWidth())/2))})}else{var y=cssH(a,g);a.css({height:y,width:cssW(a,d),top:c,left:0}),a.children(".content").each(function(){n=$(this),n.css("marginTop",round((y-n.outerHeight())/2))})}removeHover(0,a)}state.initialized||!i.initHidden&&!r.isHidden||(s.hide(),a&&a.hide())}})},enableClosable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Ts[e],i=options[e];n&&(i.closable=!0,n.bind("click."+sID,function(t){t.stopPropagation(),toggle(e)}).css("visibility","visible").css("cursor","pointer").attr("title",state[e].isClosed?i.tips.Open:i.tips.Close).show())}},disableClosable=function(t,e){if(isInitialized()){var n=evtPane.call(this,t),i=$Ts[n];i&&(options[n].closable=!1,state[n].isClosed&&open(n,!1,!0),i.unbind("."+sID).css("visibility",e?"hidden":"visible").css("cursor","default").attr("title",""))}},enableSlidable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Rs[e];n&&n.data("draggable")&&(options[e].slidable=!0,state[e].isClosed&&bindStartSlidingEvents(e,!0))}},disableSlidable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Rs[e];n&&(options[e].slidable=!1,state[e].isSliding?close(e,!1,!0):(bindStartSlidingEvents(e,!1),n.css("cursor","default").attr("title",""),removeHover(null,n[0])))}},enableResizable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Rs[e],i=options[e];n&&n.data("draggable")&&(i.resizable=!0,n.draggable("enable"),state[e].isClosed||n.css("cursor",i.resizerCursor).attr("title",i.tips.Resize))}},disableResizable=function(t){if(isInitialized()){var e=evtPane.call(this,t),n=$Rs[e];n&&n.data("draggable")&&(options[e].resizable=!1,n.draggable("disable").css("cursor","default").attr("title",""),removeHover(null,n[0]))}},swapPanes=function(t,e){function n(t){var e=$Ps[t],n=$Cs[t];return!!e&&{pane:t,P:!!e&&e[0],C:!!n&&n[0],state:$.extend(!0,{},state[t]),options:$.extend(!0,{},options[t])}}function i(t,e){if(t){var n,i,r=t.P,o=t.C,s=t.pane,l=_c[e],u=$.extend(!0,{},state[e]),c=options[e],h={resizerCursor:c.resizerCursor};$.each("fxName,fxSpeed,fxSettings".split(","),function(t,e){h[e+"_open"]=c[e+"_open"],h[e+"_close"]=c[e+"_close"],h[e+"_size"]=c[e+"_size"]}),$Ps[e]=$(r).data({layoutPane:Instance[e],layoutEdge:e}).css(_c.hidden).css(l.cssReq),$Cs[e]=!!o&&$(o),options[e]=$.extend(!0,{},t.options,h),state[e]=$.extend(!0,{},t.state),n=new RegExp(c.paneClass+"-"+s,"g"),r.className=r.className.replace(n,c.paneClass+"-"+e),initHandles(e),l.dir!=_c[s].dir?(i=a[e]||0,setSizeLimits(e),i=max(i,state[e].minSize),manualSizePane(e,i,!0,!0)):$Rs[e].css(l.side,sC.inset[l.side]+(state[e].isVisible?getPaneSize(e):0)),t.state.isVisible&&!u.isVisible?setAsOpen(e,!0):(setAsClosed(e),bindStartSlidingEvents(e,!0)),t=null}}if(isInitialized()){var r=evtPane.call(this,t);if(state[r].edge=e,state[e].edge=r,!1===_runCallbacks("onswap_start",r)||!1===_runCallbacks("onswap_start",e))return state[r].edge=r,void(state[e].edge=e);var o=n(r),s=n(e),a={};a[r]=o?o.state.size:0,a[e]=s?s.state.size:0,$Ps[r]=!1,$Ps[e]=!1,state[r]={},state[e]={},$Ts[r]&&$Ts[r].remove(),$Ts[e]&&$Ts[e].remove(),$Rs[r]&&$Rs[r].remove(),$Rs[e]&&$Rs[e].remove(),$Rs[r]=$Rs[e]=$Ts[r]=$Ts[e]=!1,i(o,e),i(s,r),o=s=a=null,$Ps[r]&&$Ps[r].css(_c.visible),$Ps[e]&&$Ps[e].css(_c.visible),resizeAll(),_runCallbacks("onswap_end",r),_runCallbacks("onswap_end",e)}},syncPinBtns=function(t,e){$.layout.plugins.buttons&&$.each(state[t].pins,function(n,i){$.layout.buttons.setPinState(Instance,$(i),t,e)})},$N=$(this).eq(0);if(!$N.length)return _log(options.errors.containerMissing);if($N.data("layoutContainer")&&$N.data("layout"))return $N.data("layout");var $Ps={},$Cs={},$Rs={},$Ts={},$Ms=$([]),sC=state.container,sID=state.id,Instance={options:options,state:state,container:$N,panes:$Ps,contents:$Cs,resizers:$Rs,togglers:$Ts,hide:hide,show:show,toggle:toggle,open:open,close:close,slideOpen:slideOpen,slideClose:slideClose,slideToggle:slideToggle,setSizeLimits:setSizeLimits,_sizePane:sizePane,sizePane:manualSizePane,sizeContent:sizeContent,swapPanes:swapPanes,showMasks:showMasks,hideMasks:hideMasks,initContent:initContent,addPane:addPane,removePane:removePane,createChildren:createChildren,refreshChildren:refreshChildren,enableClosable:enableClosable,disableClosable:disableClosable,enableSlidable:enableSlidable,disableSlidable:disableSlidable,enableResizable:enableResizable,disableResizable:disableResizable,allowOverflow:allowOverflow,resetOverflow:resetOverflow,destroy:destroy,initPanes:isInitialized,resizeAll:resizeAll,runCallbacks:_runCallbacks,hasParentLayout:!1,children:children,north:!1,south:!1,west:!1,east:!1,center:!1};return"cancel"===_create()?null:Instance}}(jQuery),function(t){t.layout&&(t.ui||(t.ui={}),t.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(e){var n,i,r,o=document.cookie,s=o?o.split(";"):[];for(r=0;n=s[r];r++)if(i=t.trim(n).split("="),i[0]==e)return decodeURIComponent(i[1]);return null},write:function(e,n,i){var r="",o="",s=!1,a=i||{},l=a.expires||null,u=t.type(l);"date"===u?o=l:"string"===u&&l>0&&(l=parseInt(l,10),u="number"),"number"===u&&(o=new Date,l>0?o.setDate(o.getDate()+l):(o.setFullYear(1970),s=!0)),o&&(r+=";expires="+o.toUTCString()),a.path&&(r+=";path="+a.path),a.domain&&(r+=";domain="+a.domain),a.secure&&(r+=";secure"),document.cookie=e+"="+(s?"":encodeURIComponent(n))+r},clear:function(e){t.ui.cookie.write(e,"",{expires:-1})}},t.cookie||(t.cookie=function(e,n,i){var r=t.ui.cookie;if(null===n)r.clear(e);else{if(void 0===n)return r.read(e);r.write(e,n,i)}}),t.layout.plugins.stateManagement=!0,t.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}},t.layout.optionsMap.layout.push("stateManagement"),t.layout.config.optionRootKeys.push("stateManagement"),t.layout.state={saveCookie:function(e,n,i){var r=e.options,o=r.stateManagement,s=t.extend(!0,{},o.cookie,i||null),a=e.state.stateData=e.readState(n||o.stateKeys);return t.ui.cookie.write(s.name||r.name||"Layout",t.layout.state.encodeJSON(a),s),t.extend(!0,{},a)},deleteCookie:function(e){var n=e.options;t.ui.cookie.clear(n.stateManagement.cookie.name||n.name||"Layout")},readCookie:function(e){var n=e.options,i=t.ui.cookie.read(n.stateManagement.cookie.name||n.name||"Layout");return i?t.layout.state.decodeJSON(i):{}},loadCookie:function(e){var n=t.layout.state.readCookie(e);return n&&!t.isEmptyObject(n)&&(e.state.stateData=t.extend(!0,{},n),e.loadState(n)),n},loadState:function(e,n,i){if(t.isPlainObject(n)&&!t.isEmptyObject(n)){n=e.state.stateData=t.layout.transformData(n);var r=e.options.stateManagement;if(i=t.extend({animateLoad:!1,includeChildren:r.includeChildren},i),e.state.initialized){var o,a,l,u,c,h=!i.animateLoad;if(t.each(t.layout.config.borderPanes,function(i,r){o=n[r],t.isPlainObject(o)&&(s=o.size,a=o.initClosed,l=o.initHidden,ar=o.autoResize,u=e.state[r],c=u.isVisible,ar&&(u.autoResize=ar),c||e._sizePane(r,s,!1,!1,!1),l===!0?e.hide(r,h):a===!0?e.close(r,!1,h):a===!1?e.open(r,!1,h):l===!1&&e.show(r,!1,h),c&&e._sizePane(r,s,!1,!1,h))}),i.includeChildren){var f,d;t.each(e.children,function(e,i){f=n[e]?n[e].children:0,f&&i&&t.each(i,function(t,e){d=f[t],e&&d&&e.loadState(d)})})}}else{var o=t.extend(!0,{},n);t.each(t.layout.config.allPanes,function(t,e){o[e]&&delete o[e].children}),t.extend(!0,e.options,o)}}},readState:function(e,n){"string"===t.type(n)&&(n={keys:n}),n||(n={});var i,r,o,s,a,l,u,c=e.options.stateManagement,h=n.includeChildren,f=void 0!==h?h:c.includeChildren,d=n.stateKeys||c.stateKeys,p={isClosed:"initClosed",isHidden:"initHidden"},g=e.state,m=t.layout.config.allPanes,v={};t.isArray(d)&&(d=d.join(",")),d=d.replace(/__/g,".").split(",");for(var y=0,b=d.length;y=0){var a=s[i].buttonClass+"-"+r;o.addClass(a+" "+a+"-"+i).data("layoutName",s.name)}return o},bind:function(e,n,i,r){var o=t.layout.buttons;switch(i.toLowerCase()){case"toggle":o.addToggle(e,n,r);break;case"open":o.addOpen(e,n,r);break;case"close":o.addClose(e,n,r);break;case"pin":o.addPin(e,n,r);break;case"toggle-slide":o.addToggle(e,n,r,!0);break;case"open-slide":o.addOpen(e,n,r,!0)}return e},addToggle:function(e,n,i,r){return t.layout.buttons.get(e,n,i,"toggle").click(function(t){e.toggle(i,!!r),t.stopPropagation()}),e},addOpen:function(e,n,i,r){return t.layout.buttons.get(e,n,i,"open").attr("title",e.options[i].tips.Open).click(function(t){e.open(i,!!r),t.stopPropagation()}),e},addClose:function(e,n,i){return t.layout.buttons.get(e,n,i,"close").attr("title",e.options[i].tips.Close).click(function(t){e.close(i),t.stopPropagation()}),e},addPin:function(e,n,i){var r=t.layout.buttons.get(e,n,i,"pin");if(r.length){var o=e.state[i];r.click(function(n){t.layout.buttons.setPinState(e,t(this),i,o.isSliding||o.isClosed),o.isSliding||o.isClosed?e.open(i):e.close(i),n.stopPropagation()}),t.layout.buttons.setPinState(e,r,i,!o.isClosed&&!o.isSliding),o.pins.push(n)}return e},setPinState:function(t,e,n,i){var r=e.attr("pin");if(!r||i!==("down"==r)){var o=t.options[n],s=o.tips,a=o.buttonClass+"-pin",l=a+"-"+n,u=a+"-up "+l+"-up",c=a+"-down "+l+"-down";e.attr("pin",i?"down":"up").attr("title",i?s.Unpin:s.Pin).removeClass(i?u:c).addClass(i?c:u)}},syncPinBtns:function(e,n,i){t.each(state[n].pins,function(r,o){t.layout.buttons.setPinState(e,t(o),n,i)})},_load:function(e){t.extend(e,{bindButton:function(n,i,r){return t.layout.buttons.bind(e,n,i,r)},addToggleBtn:function(n,i,r){return t.layout.buttons.addToggle(e,n,i,r)},addOpenBtn:function(n,i,r){return t.layout.buttons.addOpen(e,n,i,r)},addCloseBtn:function(n,i){return t.layout.buttons.addClose(e,n,i)},addPinBtn:function(n,i){return t.layout.buttons.addPin(e,n,i)}});for(var n=0;n<4;n++){var i=t.layout.buttons.config.borderPanes[n];e.state[i].pins=[]}e.options.autoBindCustomButtons&&t.layout.buttons.init(e)},_unload:function(t){}},t.layout.onLoad.push(t.layout.buttons._load))}(jQuery),function(t){t.layout.plugins.browserZoom=!0,t.layout.defaults.browserZoomCheckInterval=1e3,t.layout.optionsMap.layout.push("browserZoomCheckInterval"),t.layout.browserZoom={_init:function(e){t.layout.browserZoom.ratio()!==!1&&t.layout.browserZoom._setTimer(e)},_setTimer:function(e){if(!e.destroyed){var n=e.options,i=e.state,r=e.hasParentLayout?5e3:Math.max(n.browserZoomCheckInterval,100);setTimeout(function(){if(!e.destroyed&&n.resizeWithWindow){var r=t.layout.browserZoom.ratio();r!==i.browserZoom&&(i.browserZoom=r,e.resizeAll()),t.layout.browserZoom._setTimer(e)}},r)}},ratio:function(){function e(t,e){return(parseInt(t,10)/parseInt(e,10)*100).toFixed()}var n,i,r,o=window,s=screen,a=document,l=a.documentElement||a.body,u=t.layout.browser,c=u.version;return!(!u.msie||c>8)&&(s.deviceXDPI&&s.systemXDPI?e(s.deviceXDPI,s.systemXDPI):u.webkit&&(n=a.body.getBoundingClientRect)?e(n.left-n.right,a.body.offsetWidth):u.webkit&&(i=o.outerWidth)?e(i,o.innerWidth):!(!(i=s.width)||!(r=l.clientWidth))&&e(i,r))}},t.layout.onReady.push(t.layout.browserZoom._init)}(jQuery),function(t){t.effects&&(t.layout.defaults.panes.useOffscreenClose=!1,t.layout.plugins&&(t.layout.plugins.effects.slideOffscreen=!0),t.layout.effects.slideOffscreen=t.extend(!0,{},t.layout.effects.slide),t.effects.slideOffscreen=function(e){return this.queue(function(){var n=t.effects,i=e.options,r=t(this),o=r.data("layoutEdge"),s=r.data("parentLayout").state,a=s[o].size,l=this.style,u=n.setMode(r,i.mode||"show"),c="show"==u,h=i.direction||"left",f="up"==h||"down"==h?"top":"left",d="up"==h||"left"==h,p=t.layout.config.offscreenCSS||{},g=t.layout.config.offscreenReset,m="offscreenResetTop",v={};v[f]=(c?d?"+=":"-=":d?"-=":"+=")+a,c?(r.data(m,{top:l.top,bottom:l.bottom}),d?r.css(f,isNaN(a)?"-"+a:-a):"right"===h?r.css({left:s.container.layoutWidth,right:"auto"}):r.css({top:s.container.layoutHeight,bottom:"auto"}),"top"===f&&r.css(r.data(g)||{})):(r.data(m,{top:l.top,bottom:l.bottom}),r.data(g,{left:l.left,right:l.right})),r.show().animate(v,{queue:!1,duration:e.duration,easing:i.easing,complete:function(){r.data(m)&&r.css(r.data(m)).removeData(m),c?r.css(r.data(g)||{}).removeData(g):r.css(p),e.callback&&e.callback.apply(this,arguments),r.dequeue()}})})})}(jQuery),function(t){t.fn.extend({simulate:function(e,n){return this.each(function(){var i=t.extend({},t.simulate.defaults,n||{});new t.simulate(this,e,i)})}}),t.simulate=function(t,e,n){this.target=t,this.options=n,/^drag$/.test(e)?this[e].apply(this,[this.target,n]):this.simulateEvent(t,e,n)},t.extend(t.simulate.prototype,{simulateEvent:function(t,e,n){var i=this.createEvent(e,n);return this.dispatchEvent(t,e,i,n),i},createEvent:function(t,e){return/^mouse(over|out|down|up|move)|(dbl)?click$/.test(t)?this.mouseEvent(t,e):/^key(up|down|press)$/.test(t)?this.keyboardEvent(t,e):void 0},mouseEvent:function(e,n){var i,r=t.extend({bubbles:!0,cancelable:"mousemove"!=e,view:window,detail:0,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0},n);t(r.relatedTarget)[0];return t.isFunction(document.createEvent)?(i=document.createEvent("MouseEvents"),i.initMouseEvent(e,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget||document.body.parentNode)):document.createEventObject&&(i=document.createEventObject(),t.extend(i,r),i.button={0:1,1:4,2:2}[i.button]||i.button),i},keyboardEvent:function(e,n){var i,r=t.extend({bubbles:!0,cancelable:!0,view:window,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:0,charCode:0},n);if(t.isFunction(document.createEvent))try{i=document.createEvent("KeyEvents"),i.initKeyEvent(e,r.bubbles,r.cancelable,r.view,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode)}catch(o){i=document.createEvent("Events"),i.initEvent(e,r.bubbles,r.cancelable), +t.extend(i,{view:r.view,ctrlKey:r.ctrlKey,altKey:r.altKey,shiftKey:r.shiftKey,metaKey:r.metaKey,keyCode:r.keyCode,charCode:r.charCode})}else document.createEventObject&&(i=document.createEventObject(),t.extend(i,r));return void 0!==t.browser&&(t.browser.msie||t.browser.opera)&&(i.keyCode=r.charCode>0?r.charCode:r.keyCode,i.charCode=void 0),i},dispatchEvent:function(t,e,n){return t.dispatchEvent?t.dispatchEvent(n):t.fireEvent&&t.fireEvent("on"+e,n),n},drag:function(t){var e=this.findCenter(this.target),n=this.options,i=Math.floor(e.x),r=Math.floor(e.y),o=n.dx||0,s=n.dy||0,a=this.target,l={clientX:i,clientY:r};this.simulateEvent(a,"mousedown",l),l={clientX:i+1,clientY:r+1},this.simulateEvent(document,"mousemove",l),l={clientX:i+o,clientY:r+s},this.simulateEvent(document,"mousemove",l),this.simulateEvent(document,"mousemove",l),this.simulateEvent(a,"mouseup",l)},findCenter:function(e){var e=t(this.target),n=e.offset();return{x:n.left+e.outerWidth()/2,y:n.top+e.outerHeight()/2}}}),t.extend(t.simulate,{defaults:{speed:"sync"},VK_TAB:9,VK_ENTER:13,VK_ESC:27,VK_PGUP:33,VK_PGDN:34,VK_END:35,VK_HOME:36,VK_LEFT:37,VK_UP:38,VK_RIGHT:39,VK_DOWN:40})}(jQuery),"undefined"==typeof Worker||"undefined"!=typeof location&&"file:"===location.protocol?"undefined"!=typeof global&&"undefined"!=typeof require?this.LZMA=function(t){return require(t||"./lzma_worker.js").LZMA}:"undefined"!=typeof window&&window.document?!function(){function t(t){var n;return i(t),n={compress:function(t,i,r,o){e.LZMA_WORKER?e.LZMA_WORKER.compress(t,i,r,o):setTimeout(function(){n.compress(t,i,r,o)},50)},decompress:function(t,i,r){e.LZMA_WORKER?e.LZMA_WORKER.decompress(t,i,r):setTimeout(function(){n.decompress(t,i,r)},50)},worker:function(){return null}}}var e,n=this,i=function(e){var i=document.createElement("script");i.type="text/javascript",i.src=e,i.onload=function(){n.LZMA=t},document.getElementsByTagName("head")[0].appendChild(i)};"undefined"!=typeof window?e=window:global&&(e=global),n.LZMA=t}():console.error("Can't load the worker. Sorry."):this.LZMA=function(t){var e=1,n=2,i=3,r={},o=new Worker(t||"./lzma_worker-min.js");return o.onmessage=function(t){t.data.action===i?r[t.data.cbn]&&"function"==typeof r[t.data.cbn].on_progress&&r[t.data.cbn].on_progress(t.data.result):r[t.data.cbn]&&"function"==typeof r[t.data.cbn].on_finish&&(r[t.data.cbn].on_finish(t.data.result,t.data.error),delete r[t.data.cbn])},o.onerror=function(t){var e=new Error(t.message+" ("+t.filename+":"+t.lineno+")");for(var n in r)r[n].on_finish(null,e);console.error("Uncaught error in lzma_worker",e)},function(){function t(t,e,n,i,s){var a;do a=Math.floor(1e7*Math.random());while("undefined"!=typeof r[a]);r[a]={on_finish:i,on_progress:s},o.postMessage({action:t,cbn:a,data:e,mode:n})}return{compress:function(n,i,r,o){t(e,n,i,r,o)},decompress:function(e,i,r){t(n,e,!1,i,r)},worker:function(){return o}}}()},function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n?n:t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function r(t){return 3*t.length/4-i(t)}function o(t){var e,n,r,o,s,a,l=t.length;s=i(t),a=new h(3*l/4-s),r=s>0?l-4:l;var u=0;for(e=0,n=0;e>16&255,a[u++]=o>>8&255,a[u++]=255&o;return 2===s?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,a[u++]=255&o):1===s&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,a[u++]=o>>8&255,a[u++]=255&o),a}function s(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,n){for(var i,r=[],o=e;oc?c:l+s));return 1===i?(e=t[n-1],r+=u[e>>2],r+=u[e<<4&63],r+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],r+=u[e>>10],r+=u[e>>4&63],r+=u[e<<2&63],r+="="),o.push(r),o.join("")}n.byteLength=r,n.toByteArray=o,n.fromByteArray=l;for(var u=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=f.length;d=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function m(t){return+t!=t&&(t=0),s.alloc(+t)}function v(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(t).length;default:if(i)return q(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return P(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function b(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function w(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=s.from(e,i)),s.isBuffer(e))return 0===e.length?-1:_(t,e,n,i,r);if("number"==typeof e)return e=255&e,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):_(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,i,r){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,l=e.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,n/=2}var u;if(r){var c=-1;for(u=n;ua&&(n=a-l),u=n;u>=0;u--){for(var h=!0,f=0;fr&&(i=r)):i=r;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(r+a<=n){var l,u,c,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=t[r+1],128===(192&l)&&(h=(31&o)<<6|63&l,h>127&&(s=h));break;case 3:l=t[r+1],u=t[r+2],128===(192&l)&&128===(192&u)&&(h=(15&o)<<12|(63&l)<<6|63&u,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=t[r+1],u=t[r+2],c=t[r+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(h=(15&o)<<18|(63&l)<<12|(63&u)<<6|63&c,h>65535&&h<1114112&&(s=h))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),r+=a}return M(i)}function M(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",i=0;ii)&&(n=i);for(var r="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,n,i,r,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function z(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function j(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function $(t,e,n,i,r,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function H(t,e,n,i,r){return r||$(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,n,i,23,4),n+4}function F(t,e,n,i,r){return r||$(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,n,i,52,8),n+8}function W(t){if(t=B(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function B(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,e){e=e||1/0;for(var n,i=t.length,r=null,o=[],s=0;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Y(t){for(var e=[],n=0;n>8,r=n%256,o.push(r),o.push(i);return o}function K(t){return J.toByteArray(W(t))}function G(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function X(t){return t!==t}var J=t("base64-js"),Z=t("ieee754"),Q=t("isarray");n.Buffer=s,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:i(),n.kMaxLength=r(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,n){return a(null,t,e,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,n){return u(null,t,e,n)},s.allocUnsafe=function(t){return c(null,t)},s.allocUnsafeSlow=function(t){return c(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,r=0,o=Math.min(n,i);r0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,n,i,r){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,r>>>=0,this===t)return 0;for(var o=r-i,a=n-e,l=Math.min(o,a),u=this.slice(i,r),c=t.slice(e,n),h=0;hr)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return k(this,t,e,n);case"ascii":return S(this,t,e,n);case"latin1":case"binary":return C(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;s.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e0&&(r*=256);)i+=this[t+--e]*r;return i},s.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t=0|t,e=0|e,n||R(t,e,this.length);for(var i=this[t],r=1,o=0;++o=r&&(i-=Math.pow(2,8*e)),i},s.prototype.readIntBE=function(t,e,n){t=0|t,e=0|e,n||R(t,e,this.length);for(var i=e,r=1,o=this[t+--i];i>0&&(r*=256);)o+=this[t+--i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},s.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),Z.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),Z.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),Z.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),Z.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=0|e,n=0|n,!i){var r=Math.pow(2,8*n)-1;N(this,t,e,n,r,0)}var o=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+o]=t/s&255;return e+n},s.prototype.writeUInt8=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=0|e,!i){var r=Math.pow(2,8*n-1);N(this,t,e,n,r-1,-r)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},s.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=0|e,!i){var r=Math.pow(2,8*n-1);N(this,t,e,n,r-1,-r)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e=0|e,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,n){return H(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return H(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return F(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return F(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--r)t[r+e]=this[r+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o>1,c=-7,h=n?r-1:0,f=n?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:(d?-1:1)*(1/0);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},n.write=function(t,e,n,i,r,o){var s,a,l,u=8*o-r-1,c=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),e+=s+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+d]=255&a,d+=p,a/=256,r-=8);for(s=s<0;t[n+d]=255&s,d+=p,s/=256,u-=8);t[n+d-p]|=128*g}},{}],4:[function(t,e,n){var i={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},{}],5:[function(t,e,n){(function(t){function e(t){return t.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function i(e){return e+=Array(5-e.length%4).join("="),e=e.replace(/\-/g,"+").replace(/\_/g,"/"),new t(e,"base64")}function r(t){return/^[A-Za-z0-9\-_]+$/.test(t)}function o(e){return new t(e)}n.version="1.0.0",SafeEncode={encode:e,decode:i,validate:r,buffer:o}}).call(this,t("buffer").Buffer)},{buffer:2}]},{},[5]),!function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n?n:e)},u,u.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s-1&&(t=new RegExp("rv:([0-9]{2,2}[.0-9]{0,})"),null!==t.exec(n)&&(e=parseFloat(RegExp.$1))),e}function r(t){var e="";for(var n in t)e+=n+"="+t[n]+",";return e.slice(0,-1)}function o(t,e){return!(!t||null==t[e])}function s(t,e){var n=t.status,r="string"==typeof t.responseText?t.responseText:t,o=10===i()||11===i(),s=!n||0===n,a=!!window.navigator.onLine;s&&!a?(n=0,r={code:"offline"}):s&&o?(n=401,r={code:"invalid_user_password"}):s&&(n=0,r={code:"connection_refused_timeout"});var l=new P(n,r);e(l)}function a(t,e,n){return t+"//"+e+n}function l(t){return this instanceof l?(g(t,"clientID"),g(t,"domain"),this._useJSONP=null!=t.forceJSONP?!!t.forceJSONP:O()&&!T("https:",t.domain),this._clientID=t.clientID,this._callbackURL=t.callbackURL||document.location.href,this._shouldRedirect=!!t.callbackURL,this._domain=t.domain,this._responseType=this._parseResponseType(t,!0)||"code",this._responseMode=this._parseResponseMode(t,!0),this._cordovaSocialPlugins={facebook:this._phonegapFacebookLogin},this._useCordovaSocialPlugins=t.useCordovaSocialPlugins,this._sendClientInfo=null==t.sendSDKClientInfo||t.sendSDKClientInfo,this._scope=t.scope||"openid",this._audience=t.audience||null,this._tenant=t.__tenant||this._domain.split(".")[0],void(this._token_issuer=t.__token_issuer||"https://"+this._domain+"/")):new l(t)}function u(t){return t?"token":"code"}function c(t){if("string"!=typeof t)return!1;for(var e=["code","id_token","token"],n=t.split(" "),i=0;i=1}function h(t){return"form_post"===t}function f(t){console&&console.warn&&console.warn(t)}var d="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},p=t("./lib/base64_url"),g=t("./lib/assert_required"),m=t("./lib/is-array"),v=t("./lib/index-of"),y=t("./lib/nonce-generator"),b=t("qs"),w=t("xtend"),_=t("trim"),x=t("reqwest"),k=t("winchan"),S=t("jsonp"),C={param:"cbx",timeout:8e3,prefix:"__auth0jp"},T=t("./lib/same-origin"),E=t("./lib/json-parse"),P=t("./lib/LoginError"),O=t("./lib/use_jsonp"),M=t("./lib/SilentAuthenticationHandler");l.version=t("./version").str,l.clientInfo={name:"auth0.js",version:l.version},l.prototype.openWindow=function(t,e,n){return window.open(t,e,r(n))},l.prototype._redirect=function(t){d.window.location=t},l.prototype._getResponseType=function(t){return this._parseResponseType(t)||this._responseType},l.prototype._getCallbackOnLocationHash=function(t){return"form_post"!==this._getResponseMode(t)&&"code"!==this._getResponseType(t)},l.prototype._getResponseMode=function(t){var e=this._parseResponseMode(t)||this._responseMode;return"form_post"===e?"form_post":null},l.prototype._getCallbackURL=function(t){return t&&"undefined"!=typeof t.callbackURL?t.callbackURL:this._callbackURL},l.prototype._getClientInfoString=function(){var t=JSON.stringify(l.clientInfo);return p.encode(t)},l.prototype._getClientInfoHeader=function(){return this._sendClientInfo?{"Auth0-Client":this._getClientInfoString()}:{}},l.prototype._renderAndSubmitWSFedForm=function(t,e){var n=document.createElement("div");n.innerHTML=e;var i=document.body.appendChild(n).children[0];t.popup&&!this._getCallbackOnLocationHash(t)&&(i.target="auth0_signup_popup"),i.submit()},l.prototype._getMode=function(t){var e={scope:this._scope,response_type:this._getResponseType(t)},n=this._getResponseMode(t);return n&&(e.response_mode=n),e},l.prototype._configureOfflineMode=function(t){t.scope&&t.scope.indexOf("offline_access")>=0&&(t.device=t.device||"Browser")},l.prototype._getUserInfo=function(t,e,n){if(f("DEPRECATION NOTICE: This method will be soon deprecated, use `getUserInfo` instead."),!t||t.user_id)return n(null,t);var i="https:",r=this._domain,o="/tokeninfo",s=a(i,r,o),l=function(t,e){var i=new Error(t+": "+(e||""));i.error=t,i.error_description=e,n(i)};return this._useJSONP?S(s+"?"+b.stringify({id_token:e}),C,function(t,e){return t?l(0,t.toString()):200===e.status?n(null,e.user):l(e.status,e.err||e.error)}):x({url:T(i,r)?o:s,method:"post",type:"json",crossOrigin:!T(i,r),data:{id_token:e}}).fail(function(t){l(t.status,t.responseText)}).then(function(t){n(null,t)})},l.prototype.getUserInfo=function(t,e){if("function"!=typeof e)throw new Error("A callback function is required");if(!t||"string"!=typeof t)return e(new Error("Invalid token"));var n="https:",i=this._domain,r="/userinfo",o=a(n,i,r),s=function(t,n){var i=new Error(t+": "+(n||""));i.error=t,i.error_description=n,e(i)};return x({url:T(n,i)?r:o,method:"post",type:"json",crossOrigin:!T(n,i),headers:{Authorization:"Bearer "+t}}).fail(function(t){s(t.status,t.responseText)}).then(function(t){e(null,t)})},l.prototype.getProfile=function(t,e){if("function"!=typeof e)throw new Error("A callback function is required");return t&&"string"==typeof t?void this._getUserInfo(this.decodeJwt(t),t,e):e(new Error("Invalid token"))},l.prototype.validateUser=function(t,e){var n="https:",i=this._domain,r="/public/api/users/validate_userpassword",o=a(n,i,r),s=w(t,{client_id:this._clientID,username:_(t.username||t.email||"")});return this._useJSONP?S(o+"?"+b.stringify(s),C,function(t,n){return t?e(t):"error"in n&&404!==n.status?e(new Error(n.error)):void e(null,200===n.status); +}):void x({url:T(n,i)?r:o,method:"post",type:"text",data:s,crossOrigin:!T(n,i),error:function(t){return 404!==t.status?e(new Error(t.responseText)):void e(null,!1)},success:function(t){e(null,200===t.status)}})},l.prototype.decodeJwt=function(t){var e=t&&t.split(".")[1];return E(p.decode(e))},l.prototype.parseHash=function(t,e){e=e||{},t=t||window.location.hash,t=t.replace(/^#?\/?/,"");var n=b.parse(t);if(n.hasOwnProperty("error")){var i={error:n.error,error_description:n.error_description};return n.state&&(i.state=n.state),i}if(!n.hasOwnProperty("access_token")&&!n.hasOwnProperty("id_token")&&!n.hasOwnProperty("refresh_token"))return null;var r;if(n.id_token){var o=function(t){var e={error:"invalid_token",error_description:t};return e};r=this.decodeJwt(n.id_token);var s=m(r.aud)?r.aud:[r.aud];if(-1===v(s,this._clientID))return o("The clientID configured ("+this._clientID+") does not match with the clientID set in the token ("+s.join(", ")+").");if(r.iss&&r.iss!==this._token_issuer)return o("The domain configured ("+this._token_issuer+") does not match with the domain set in the token ("+r.iss+").");var a;if(e.nonce)a=e.nonce;else if(window.localStorage)try{a=window.localStorage.getItem("com.auth0.auth.nonce"),window.localStorage.removeItem("com.auth0.auth.nonce")}catch(l){}if((a||r.nonce)&&r.nonce!==a)return o("The nonce does not match.")}return{accessToken:n.access_token,idToken:n.id_token,idTokenPayload:r,refreshToken:n.refresh_token,state:n.state}},l.prototype.signup=function(t,e){function n(){return t.auto_login?r.login(t,e):"function"==typeof e?e():void 0}function i(t,n){var i=new P(t,n);if(u&&"function"==typeof u.kill&&u.kill(),"function"==typeof e)return e(i);throw i}var r=this,s={client_id:this._clientID,redirect_uri:this._getCallbackURL(t),email:_(t.email||t.username||"")};"string"==typeof t.username&&(s.username=_(t.username));var l=w(this._getMode(t),t,s);this._configureOfflineMode(l),o(t,"sso")||(t.sso=!0),o(t,"auto_login")||(t.auto_login=!0);var u,c=t.auto_login&&t.popup&&(!this._getCallbackOnLocationHash(t)||t.sso);c&&(u=this._buildPopupWindow(t));var h="https:",f=this._domain,d="/dbconnections/signup",p=a(h,f,d);return this._useJSONP?S(p+"?"+b.stringify(l),C,function(t,e){return t?i(0,t):200==e.status?n():i(e.status,e.err||e.error)}):void x({url:T(h,f)?d:p,method:"post",type:"html",data:l,success:n,crossOrigin:!T(h,f),error:function(t){i(t.status,t.responseText)}})},l.prototype.changePassword=function(t,e){function n(t,n){var i=new P(t,n);return e?e(i):void 0}var i={client_id:this._clientID,connection:t.connection,email:_(t.email||"")};"string"==typeof t.password&&(i.password=t.password);var r="https:",o=this._domain,s="/dbconnections/change_password",l=a(r,o,s);return this._useJSONP?S(l+"?"+b.stringify(i),C,function(t,i){return t?n(0,t):200==i.status?e(null,i.message):n(i.status,i.err||i.error)}):void x({url:T(r,o)?s:l,method:"post",type:"html",data:i,crossOrigin:!T(r,o),error:function(t){n(t.status,t.responseText)},success:function(t){e(null,t)}})},l.prototype._buildAuthorizeQueryString=function(t,e){var n=this._buildAuthorizationParameters(t,e);return b.stringify(n)},l.prototype._buildAuthorizationParameters=function(t,e){var n=w.apply(null,t);this._configureOfflineMode(n),this._sendClientInfo&&(n.auth0Client=this._getClientInfoString()),e=e||["popup","popupOptions"];var i,r;for(i=0;i-1&&!t.nonce&&"undefined"==typeof t.passcode&&(("undefined"!=typeof t.username||"undefined"!=typeof t.email)&&!e||"undefined"==typeof t.username&&"undefined"==typeof t.email)){if(!window.localStorage)throw new Error("Unable to generate and store nonce to request id_token. Please provide a nonce value via options");var n=y.randomString(16);if(n)try{t.nonce=n,window.localStorage.setItem("com.auth0.auth.nonce",n)}catch(i){t.nonce=void 0}}if("undefined"!=typeof t.passcode)return this.loginWithPasscode(t,e);if("undefined"!=typeof t.username||"undefined"!=typeof t.email)return this.loginWithUsernamePassword(t,e);if(window.cordova||window.electron)return this.loginPhonegap(t,e);if(t.popup&&this._getCallbackOnLocationHash(t))return this.loginWithPopup(t,e);if(!t.nonce&&this._responseType.indexOf("id_token")>-1)throw new Error("nonce is mandatory");this._authorize(t)},l.prototype._authorize=function(t){var e=this._buildAuthorizeUrl(t);t.popup?this._buildPopupWindow(t,e):this._redirect(e)},l.prototype._computePopupPosition=function(t){t=t||{};var e=t.width||500,n=t.height||600,i="undefined"!=typeof window.screenX?window.screenX:window.screenLeft,r="undefined"!=typeof window.screenY?window.screenY:window.screenTop,o="undefined"!=typeof window.outerWidth?window.outerWidth:document.body.clientWidth,s="undefined"!=typeof window.outerHeight?window.outerHeight:document.body.clientHeight-22,a=i+(o-e)/2,l=r+(s-n)/2;return{width:e,height:n,left:a,top:l}},l.prototype.loginPhonegap=function(t,e){function n(t){d||(d=!0,f.close(),e(new Error(t.message),null))}function i(t){if(!(d||t.url&&0!==t.url.indexOf(o+"#")&&0!==t.url.indexOf(o+"?"))){var n=s.parseHash(t.url.slice(o.length));if(!n)return d=!0,f.close(),void e(new Error("Error parsing hash"),null);if(n.idToken)return d=!0,f.close(),void e(null,n);d=!0,f.close(),e(new Error(n.err||n.error||"Something went wrong"),null)}}function r(){d||(f.removeEventListener("loaderror",n),f.removeEventListener("loadstart",i),f.removeEventListener("exit",r),e(new Error("Browser window closed"),null))}if(this._shouldAuthenticateWithCordovaPlugin(t.connection))return void this._socialPhonegapLogin(t,e);var o=a("https:",this._domain,"/mobile"),s=this,l=[this._getMode(t),t,{client_id:this._clientID,redirect_uri:o}];this._sendClientInfo&&l.push({auth0Client:this._getClientInfoString()});var u=this._buildAuthorizeQueryString(l),c=a("https:",this._domain,"/authorize?"+u),h=w({location:"yes"},t.popupOptions);delete h.width,delete h.height;var f=this.openWindow(c,"_blank",h),d=!1;f.addEventListener("loaderror",n),f.addEventListener("loadstart",i),f.addEventListener("exit",r)},l.prototype.loginWithPopup=function(t,e){var n=this;if(!e)throw new Error("popup mode should receive a mandatory callback");if(!t.nonce&&this._responseType.indexOf("id_token")>-1)throw new Error("nonce is mandatory");var i=[this._getMode(t),t,{client_id:this._clientID,owp:!0}];this._sendClientInfo&&i.push({auth0Client:this._getClientInfoString()});var o=this._buildAuthorizeQueryString(i),s=a("https:",this._domain,"/authorize?"+o),l=this._computePopupPosition(t.popupOptions),u=w(l,t.popupOptions),c=k.open({url:s,relay_url:"https://"+this._domain+"/relay.html",window_features:r(u)},function(t,i){return n._current_popup=null,t?e(new P(t),null,null,null,null,null):i?i.access_token||i.id_token?e(null,n._prepareResult(i)):i.err?e(new P(i.err.status,i.err.details||i.err),null,null,null,null,null):i.error?e(new P(i.status,i.details||i),null,null,null,null,null):e(new P("Something went wrong"),null,null,null,null,null):e(new P("Something went wrong"),null,null,null,null,null)});c.focus()},l.prototype._shouldAuthenticateWithCordovaPlugin=function(t){var e=this._cordovaSocialPlugins[t];return this._useCordovaSocialPlugins&&!!e},l.prototype._socialPhonegapLogin=function(t,e){var n=this._cordovaSocialPlugins[t.connection],i=this;n(t.connection_scope,function(n,r,o){if(n)return void e(n,null,null,null,null);var s=w({access_token:r},t,o);i.loginWithSocialAccessToken(s,e)})},l.prototype._phonegapFacebookLogin=function(t,e){if(!window.facebookConnectPlugin||!window.facebookConnectPlugin.login)return void e(new Error("missing plugin phonegap-facebook-plugin"),null,null);var n;n=t&&m(t)?t:t?[t]:["public_profile"],window.facebookConnectPlugin.login(n,function(t){e(null,t.authResponse.accessToken,{})},function(t){e(new Error(t),null,null)})},l.prototype.loginWithUsernamePasswordAndSSO=function(t,e){var n=this,i=this._computePopupPosition(t.popupOptions),o=w(i,t.popupOptions);if(!t.nonce&&this._responseType.indexOf("id_token")>-1)throw new Error("nonce is mandatory");var s={url:"https://"+this._domain+"/sso_dbconnection_popup/"+this._clientID,relay_url:"https://"+this._domain+"/relay.html",window_features:r(o),popup:this._current_popup,params:{domain:this._domain,clientID:this._clientID,options:{username:_(t.username||t.email||""),password:t.password,connection:t.connection,state:t.state,scope:t.scope}}};t._csrf&&(s.params.options._csrf=t._csrf),t.device&&(s.params.options.device=t.device);var a=k.open(s,function(t,i){return n._current_popup=null,t?e(new P(t),null,null,null,null,null):i?i.id_token?e(null,n._prepareResult(i)):i.err?e(new P(i.err.status,i.err.details||i.err),null,null,null,null,null):i.error?e(new P(i.status,i.details||i),null,null,null,null,null):e(new P("Something went wrong"),null,null,null,null,null):e(new P("Something went wrong"),null,null,null,null,null)});a.focus()},l.prototype.loginWithResourceOwner=function(t,e){var n=this,i=w(this._getMode(t),t,{client_id:this._clientID,username:_(t.username||t.email||""),grant_type:"password"});this._configureOfflineMode(i);var r="https:",o=this._domain,l="/oauth/ro",u=a(r,o,l);return this._sendClientInfo&&this._useJSONP&&(i.auth0Client=this._getClientInfoString()),this._useJSONP?S(u+"?"+b.stringify(i),C,function(t,i){if(t)return e(t);if("error"in i){var r=new P(i.status,i.error);return e(r)}e(null,n._prepareResult(i))}):void x({url:T(r,o)?l:u,method:"post",type:"json",data:i,headers:this._getClientInfoHeader(),crossOrigin:!T(r,o),success:function(t){e(null,n._prepareResult(t))},error:function(t){s(t,e)}})},l.prototype.loginWithSocialAccessToken=function(t,e){var n=this,i=this._buildAuthorizationParameters([{scope:this._scope},t,{client_id:this._clientID}]),r="https:",o=this._domain,l="/oauth/access_token",u=a(r,o,l);return this._useJSONP?S(u+"?"+b.stringify(i),C,function(t,i){if(t)return e(t);if("error"in i){var r=new P(i.status,i.error);return e(r)}e(null,n._prepareResult(i))}):void x({url:T(r,o)?l:u,method:"post",type:"json",data:i,headers:this._getClientInfoHeader(),crossOrigin:!T(r,o),success:function(t){e(null,n._prepareResult(t))},error:function(t){s(t,e)}})},l.prototype._buildPopupWindow=function(t,e){if(this._current_popup&&!this._current_popup.closed)return this._current_popup;e=e||"about:blank";var n=this,i={width:500,height:600},o=w(i,t.popupOptions||{}),s=r(o);if(this._current_popup=window.open(e,"auth0_signup_popup",s),!this._current_popup)throw new Error("Popup window cannot not been created. Disable popup blocker or make sure to call Auth0 login or singup on an UI event.");return this._current_popup.kill=function(){this.close(),n._current_popup=null},this._current_popup},l.prototype.loginWithUsernamePassword=function(t,e){function n(t){if(e)return e(t);throw t}if(e&&e.length>1&&(!t.sso||window.cordova))return this.loginWithResourceOwner(t,e);var i,r=this;if(t.popup&&!this._getCallbackOnLocationHash(t)&&(i=this._buildPopupWindow(t)),!t.nonce&&this._responseType.indexOf("id_token")>-1)throw new Error("nonce is mandatory");if(e&&e.length>1&&t.sso)return this.loginWithUsernamePasswordAndSSO(t,e);var o=w(this._getMode(t),t,{client_id:this._clientID,redirect_uri:this._getCallbackURL(t),username:_(t.username||t.email||""),tenant:this._tenant});this._configureOfflineMode(o);var l="https:",u=this._domain,c="/usernamepassword/login",h=a(l,u,c);return this._useJSONP?S(h+"?"+b.stringify(o),C,function(n,o){if(n)return i&&i.kill&&i.kill(),e(n);if("error"in o){i&&i.kill&&i.kill();var s=new P(o.status,o.error);return e(s)}r._renderAndSubmitWSFedForm(t,o.form)}):void x({url:T(l,u)?c:h,method:"post",type:"html",data:o,headers:this._getClientInfoHeader(),crossOrigin:!T(l,u),success:function(e){r._renderAndSubmitWSFedForm(t,e)},error:function(t){i&&i.kill&&i.kill(),s(t,n)}})},l.prototype.loginWithPasscode=function(t,e){if(null==t.email&&null==t.phoneNumber)throw new Error("email or phoneNumber is required for authentication");if(null==t.passcode)throw new Error("passcode is required for authentication");if(t.connection=null==t.email?"sms":"email",!this._shouldRedirect)return t=w(t,{username:null==t.email?t.phoneNumber:t.email,password:t.passcode,sso:!1}),delete t.email,delete t.phoneNumber,delete t.passcode,this.loginWithResourceOwner(t,e);var n={connection:t.connection};t.phoneNumber&&(t.phone_number=t.phoneNumber,delete t.phoneNumber,n.phone_number=t.phone_number),t.email&&(n.email=t.email),t.verification_code=t.passcode,delete t.passcode,n.verification_code=t.verification_code;var i=this;this._verify(n,function(n){return n?e(n):void i._verify_redirect(t)})},l.prototype._verify=function(t,e){var n="https:",i=this._domain,r="/passwordless/verify",o=a(n,i,r),s=t;return this._useJSONP?(this._sendClientInfo&&(s.auth0Client=this._getClientInfoString()),S(o+"?"+b.stringify(s),C,function(t,n){return t?e(new Error("0: "+t.toString())):200===n.status?e(null,!0):e({status:n.status})})):x({url:T(n,i)?r:o,method:"post",headers:this._getClientInfoHeader(),crossOrigin:!T(n,i),data:s}).fail(function(t){try{e(JSON.parse(t.responseText))}catch(n){var i=new Error(t.status+"("+t.statusText+"): "+t.responseText);i.statusCode=t.status,i.error=t.statusText,i.message=t.responseText,e(i)}}).then(function(t){e(null,t)})},l.prototype._verify_redirect=function(t){var e=[this._getMode(t),t,{client_id:this._clientID,redirect_uri:this._getCallbackURL(t)}],n=this._buildAuthorizeQueryString(e),i=a("https:",this._domain,"/passwordless/verify_redirect?"+n);this._redirect(i)},l.prototype.renewIdToken=function(t,e){this.getDelegationToken({id_token:t,scope:"passthrough",api:"auth0"},e)},l.prototype.refreshToken=function(t,e){this.getDelegationToken({refresh_token:t,scope:"passthrough",api:"auth0"},e)},l.prototype.getDelegationToken=function(t,e){if(t=t||{},!t.id_token&&!t.refresh_token)throw new Error("You must send either an id_token or a refresh_token to get a delegation token.");var n=w({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",client_id:this._clientID,target:t.targetClientId||this._clientID,api_type:t.api},t);delete n.hasOwnProperty,delete n.targetClientId,delete n.api;var r="https:",o=this._domain,s="/delegation",l=a(r,o,s);return this._useJSONP?S(l+"?"+b.stringify(n),C,function(t,n){if(t)return e(t);if("error"in n){var i=new P(n.status,n.error_description||n.error);return e(i)}e(null,n)}):void x({url:T(r,o)?s:l,method:"post",type:"json",data:n,crossOrigin:!T(r,o),success:function(t){e(null,t)},error:function(t){try{e(JSON.parse(t.responseText))}catch(n){var r=t,o=10===i()||11===i(),s=!r.status||0===r.status;s&&!window.navigator.onLine?(r={},r.status=0,r.responseText={code:"offline"}):s&&o?(r={},r.status=401,r.responseText={code:"invalid_operation"}):s?(r={},r.status=0,r.responseText={code:"connection_refused_timeout"}):r.responseText=t,e(new P(r.status,r.responseText))}}})},l.prototype.silentAuthentication=function(t,e){var n=t.usePostMessage||!1;delete t.usePostMessage,t=w(t,{prompt:"none"});var i=new M(this,this._buildAuthorizeUrl(t));i.login(e,n)},l.prototype.logout=function(t,e){var n="/logout";e=e||{},"v2"==e.version&&(n="/v2"+n);var i=a("https:",this._domain,n);t&&(i+="?"+b.stringify(t)),this._redirect(i)},l.prototype.getSSOData=function(t,e){"function"==typeof t&&(e=t,t=!1);var n={sso:!1};if(this._useJSONP){var i=new Error("The SSO data can't be obtained using JSONP");return void setTimeout(function(){e(i,n)},0)}var r="https:",o=this._domain,s="/user/ssodata",l=a(r,o,s),u=T(r,o),c={};return t&&(c={ldaps:1,client_id:this._clientID}),x({url:u?s:l,method:"get",type:"json",data:c,crossOrigin:!u,withCredentials:!u,timeout:3e3}).fail(function(t){var i=new Error("There was an error in the request that obtains the user's SSO data.");i.cause=t,e(i,n)}).then(function(t){e(null,t)})},l.prototype.getConnections=function(t){return f("getConnections is deprecated and will be removed shortly. Please use Management API endpoint /connections to list the connections"),S("https://"+this._domain+"/public/api/"+this._clientID+"/connections",C,t)},l.prototype.startPasswordless=function(t,e){if("object"!=typeof t)throw new Error("An options object is required");if("function"!=typeof e)throw new Error("A callback function is required");if(!t.email&&!t.phoneNumber)throw new Error("An `email` or a `phoneNumber` is required.");var n="https:",i=this._domain,r="/passwordless/start",o=a(n,i,r),s={client_id:this._clientID};return t.email?(s.email=t.email,s.connection="email",t.authParams&&(s.authParams=t.authParams),t.send&&"link"!==t.send||(s.authParams||(s.authParams={}),s.authParams.redirect_uri=t.callbackURL||this._callbackURL,s.authParams.response_type=this._getResponseType(t)),t.send&&(s.send=t.send)):(s.phone_number=t.phoneNumber,s.connection="sms"),this._useJSONP?(this._sendClientInfo&&(s.auth0Client=this._getClientInfoString()),S(o+"?"+b.stringify(s),C,function(t,n){return t?e(new Error("0: "+t.toString())):200===n.status?e(null,!0):e(n.err||n.error)})):x({url:T(n,i)?r:o,method:"post",type:"json",headers:this._getClientInfoHeader(),crossOrigin:!T(n,i),data:s}).fail(function(t){try{e(JSON.parse(t.responseText))}catch(n){var i=new Error(t.status+"("+t.statusText+"): "+t.responseText);i.statusCode=t.status,i.error=t.statusText,i.message=t.responseText,e(i)}}).then(function(t){e(null,t)})},l.prototype.requestMagicLink=function(t,e){return this.startPasswordless(t,e)},l.prototype.requestEmailCode=function(t,e){return t.send="code",this.startPasswordless(t,e)},l.prototype.verifyEmailCode=function(t,e){return t.passcode=t.code,delete t.code,this.login(t,e)},l.prototype.requestSMSCode=function(t,e){return this.startPasswordless(t,e)},l.prototype.verifySMSCode=function(t,e){return t.passcode=t.code,delete t.code,this.login(t,e)},l.prototype.getUserCountry=function(t){var e="https:",n=this._domain,i="/user/geoloc/country",r=a(e,n,i);if(this._useJSONP){var o=new Error("The user's country can't be obtained using JSONP");return void setTimeout(function(){t(o)},0)}x({url:T(e,n)?i:r,method:"get",type:"json",headers:this._getClientInfoHeader(),crossOrigin:!T(e,n),success:function(e){t(null,e.country_code)},error:function(e){var n=new Error("There was an error in the request that obtains the user's country");n.cause=e,t(n)}})},l.prototype._prepareResult=function(t){if(t&&"object"==typeof t){var e=t.id_token?this.decodeJwt(t.id_token):void 0;return{accessToken:t.access_token,idToken:t.id_token,idTokenPayload:t.profile||e,refreshToken:t.refresh_token,state:t.state}}},l.prototype._parseResponseType=function(t,e){t||(t={}),e&&!this._providedResponseOptions&&t.hasOwnProperty("callbackOnLocationHash")&&(this._providedCallbackOnLocationHash=!0),e&&!this._providedCallbackOnLocationHash&&t.hasOwnProperty("responseType")&&(this._providedResponseOptions=!0),!this._providedCallbackOnLocationHash&&!this._providedResponseOptions&&t.hasOwnProperty("callbackOnLocationHash")&&t.hasOwnProperty("responseType")&&f("The responseType option will be ignored. Both callbackOnLocationHash and responseType options were provided and they can't be used together."),this._providedCallbackOnLocationHash&&t.hasOwnProperty("responseType")&&f("The responseType option will be ignored. The callbackOnLocationHash option was provided to the constructor and they can't be mixed."),this._providedResponseOptions&&t.hasOwnProperty("callbackOnLocationHash")&&f("The callbackOnLocationHash option will be ignored. The responseType option was provided to the constructor and they can't be mixed."),this._providedCallbackOnLocationHash||t.hasOwnProperty("callbackOnLocationHash")||!t.responseType||c(t.responseType)||f('The responseType option will be ignored. Its valid values are "code", "id_token", "token" or any combination of them.');var n=void 0;return this._providedResponseOptions||null==t.callbackOnLocationHash||(n=u(t.callbackOnLocationHash)),!this._providedCallbackOnLocationHash&&!t.hasOwnProperty("callbackOnLocationHash")&&t.responseType&&c(t.responseType)&&(n=t.responseType),n},l.prototype._parseResponseMode=function(t,e){t||(t={}),e&&!this._providedCallbackOnLocationHash&&t.hasOwnProperty("responseMode")&&(this._providedResponseOptions=!0),this._providedCallbackOnLocationHash&&t.hasOwnProperty("responseMode")&&f("The responseMode option will be ignored. The callbackOnLocationHash option was provided to the constructor and they can't be mixed."),!this._providedCallbackOnLocationHash&&!this._providedResponseOptions&&t.hasOwnProperty("callbackOnLocationHash")&&t.hasOwnProperty("responseMode")&&f("The responseMode option will be ignored. Both callbackOnLocationHash and responseMode options were provided and they can't be used together.");var n=void 0;return this._providedCallbackOnLocationHash||!t.responseMode||h(t.responseMode)||f('The responseMode option will be ignored. Its only valid value is "form_post".'),!this._providedCallbackOnLocationHash&&h(t.responseMode)&&(n=t.responseMode),n},e.exports=l},{"./lib/LoginError":3,"./lib/SilentAuthenticationHandler":4,"./lib/assert_required":5,"./lib/base64_url":6,"./lib/index-of":7,"./lib/is-array":8,"./lib/json-parse":9,"./lib/nonce-generator":10,"./lib/same-origin":11,"./lib/use_jsonp":12,"./version":36,jsonp:17,qs:22,reqwest:26,trim:27,winchan:28,xtend:30}],2:[function(t,e,n){var i=function(t){this.auth0=t.auth0,this.url=t.url,this.callback=t.callback,this.timeout=t.timeout||6e4,this.timeoutCallback=t.timeoutCallback||null,this.usePostMessage=t.usePostMessage||!1,this.iframe=null,this.timeoutHandle=null,this._destroyTimeout=null,this.transientMessageEventListener=null,this.transientEventListener=null};i.prototype.init=function(t){this.iframe=document.createElement("iframe"),this.iframe.style.display="none",this.iframe.src=this.url;var e=this;this.usePostMessage?(this.transientMessageEventListener=function(t){e.messageEventListener(t)},window.addEventListener("message",this.transientMessageEventListener,!1)):(this.transientEventListener=function(){e.loadEventListener()},this.iframe.addEventListener("load",this.transientEventListener,!1)),document.body.appendChild(this.iframe),this.timeoutHandle=setTimeout(function(){e.timeoutHandler()},this.timeout)},i.prototype.messageEventListener=function(t){this.callbackHandler(t.data),this.destroy()},i.prototype.loadEventListener=function(){var t=this.auth0.parseHash(this.iframe.contentWindow.location.hash);t&&(this.callbackHandler(t),this.destroy())},i.prototype.callbackHandler=function(t){var e=null;t.error&&(e=t,t=null),this.callback(e,t)},i.prototype.timeoutHandler=function(){this.timeoutCallback&&this.timeoutCallback(),this.destroy()},i.prototype.destroy=function(){var t=this;this.timeoutHandle&&clearTimeout(this.timeoutHandle),this._destroyTimeout=setTimeout(function(){t.usePostMessage?window.removeEventListener("message",t.transientMessageEventListener,!1):t.iframe.removeEventListener("load",t.transientEventListener,!1),document.body.removeChild(t.iframe)},0)},e.exports=i},{}],3:[function(t,e,n){function i(t,e){var n;if("string"==typeof e)try{n=r(e)}catch(i){n={message:e}}else n=e||{description:"server error"};n.code||(n.code=n.error),"unauthorized"===n.code&&(t=401);var o=n.description||n.message||n.error;"PasswordStrengthError"===n.name&&(o="Password is not strong enough.");var s=Error.call(this,o);return s.status=t,s.name=n.code,s.code=n.code,s.details=n,0===t&&(s.code&&"offline"===s.code||(s.code="Unknown",s.message="Unknown error.")),s}var r=t("./json-parse");e.exports=i,Object&&Object.create&&(i.prototype=Object.create(Error.prototype,{constructor:{value:i}}))},{"./json-parse":9}],4:[function(t,e,n){var i=t("./IframeHandler"),r=function(t,e,n){this.auth0=t,this.authenticationUrl=e,this.timeout=n||6e4,this.handler=null};r.prototype.timeoutCallback=function(){console.error("Timeout during silent authentication.")},r.prototype.login=function(t,e){this.handler=new i({auth0:this.auth0,url:this.authenticationUrl,callback:t,timeout:this.timeout,timeoutCallback:this.timeoutCallback,usePostMessage:e||!1}),this.handler.init()},e.exports=r},{"./IframeHandler":2}],5:[function(t,e,n){function i(t,e){if(!t[e])throw new Error(e+" is required.")}e.exports=i},{}],6:[function(t,e,n){function i(t){return o.btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function r(t){return t+=Array(5-t.length%4).join("="),t=t.replace(/\-/g,"+").replace(/\_/g,"/"),o.atob(t)}var o=t("Base64");e.exports={encode:i,decode:r}},{Base64:13}],7:[function(t,e,n){function i(t,e,n){return t.indexOf(e,n)}function r(t,e,n){var i;if(null==t)throw new TypeError('"array" is null or not defined');var r=Object(t),o=r.length>>>0;if(0===o)return-1;var s=+n||0;if(Math.abs(s)===1/0&&(s=0),s>=o)return-1;for(i=Math.max(s>=0?s:o-Math.abs(s),0);o>i;){if(i in r&&r[i]===e)return i;i++}return-1}e.exports=Array.prototype.indexOf?i:r},{}],8:[function(t,e,n){function i(t){return"[object Array]"===r.call(t)}var r=Object.prototype.toString;e.exports=null!=Array.isArray?Array.isArray:i},{}],9:[function(t,e,n){e.exports="undefined"==typeof JSON?t("json-fallback").parse:JSON.parse},{"json-fallback":16}],10:[function(t,e,n){function i(t){var e=new Uint8Array(t),n=window.crypto||window.msCrypto;if(!n)return null;var i=n.getRandomValues(e),r=[],o="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~";return i.forEach(function(t){r.push(o[t%o.length])}),r.join("")}e.exports={randomString:i}},{}],11:[function(t,e,n){function i(t,e,n){var i=window.location.protocol,r=window.location.hostname,o=window.location.port;return n=n||"",i===t&&r===e&&o===n}e.exports=i},{}],12:[function(t,e,n){function i(){var t=window.XMLHttpRequest?new XMLHttpRequest:null;return!(t&&"withCredentials"in t)}e.exports=i},{}],13:[function(t,e,n){!function(){var t="undefined"!=typeof n?n:this,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=function(){try{document.createElement("$")}catch(t){return t}}();t.btoa||(t.btoa=function(t){for(var n,r,o=0,s=e,a="";t.charAt(0|o)||(s="=",o%1);a+=s.charAt(63&n>>8-o%1*8)){if(r=t.charCodeAt(o+=.75),r>255)throw i;n=n<<8|r}return a}),t.atob||(t.atob=function(t){if(t=t.replace(/=+$/,""),t.length%4==1)throw i;for(var n,r,o=0,s=0,a="";r=t.charAt(s++);~r&&(n=o%4?64*n+r:r,o++%4)?a+=String.fromCharCode(255&n>>(-2*o&6)):0)r=e.indexOf(r);return a})}()},{}],14:[function(t,e,n){},{}],15:[function(t,e,n){var i=e.exports={};i.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var i=n.shift();i()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")}},{}],16:[function(require,module,exports){var JSON={};!function(){"use strict";function f(t){return 10>t?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var n,i,r,o,s,a=gap,l=e[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof rep&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,s=[],"[object Array]"===Object.prototype.toString.apply(l)){for(o=l.length,n=0;o>n;n+=1)s[n]=str(n,l)||"null";return r=0===s.length?"[]":gap?"[\n"+gap+s.join(",\n"+gap)+"\n"+a+"]":"["+s.join(",")+"]",gap=a,r}if(rep&&"object"==typeof rep)for(o=rep.length,n=0;o>n;n+=1)"string"==typeof rep[n]&&(i=rep[n],r=str(i,l),r&&s.push(quote(i)+(gap?": ":":")+r));else for(i in l)Object.prototype.hasOwnProperty.call(l,i)&&(r=str(i,l),r&&s.push(quote(i)+(gap?": ":":")+r));return r=0===s.length?"{}":gap?"{\n"+gap+s.join(",\n"+gap)+"\n"+a+"}":"{"+s.join(",")+"}",gap=a,r}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(t){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(t){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":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,e,n){var i;if(gap="",indent="","number"==typeof n)for(i=0;n>i;i+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var n,i,r=t[e];if(r&&"object"==typeof r)for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i=walk(r,n),void 0!==i?r[n]=i:delete r[n]);return reviver.call(t,e,r)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(t){return"\\u"+("0000"+t.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")})}(),module.exports=JSON},{}],17:[function(t,e,n){function i(){}function r(t,e,n){function r(){a.parentNode.removeChild(a),window[p]=i}"function"==typeof e&&(n=e,e={}),e||(e={});var a,l,u=e.prefix||"__jp",c=e.param||"callback",h=null!=e.timeout?e.timeout:6e4,f=encodeURIComponent,d=document.getElementsByTagName("script")[0]||document.head,p=u+s++;h&&(l=setTimeout(function(){r(),n&&n(new Error("Timeout"))},h)),window[p]=function(t){o("jsonp got",t),l&&clearTimeout(l),r(),n&&n(null,t)},t+=(~t.indexOf("?")?"&":"?")+c+"="+f(p),t=t.replace("?&","?"),o('jsonp req "%s"',t),a=document.createElement("script"),a.src=t,d.parentNode.insertBefore(a,d)}var o=t("debug")("jsonp");e.exports=r;var s=0},{debug:19}],18:[function(t,e,n){function i(t){if(t=String(t),!(t.length>1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return n*h;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*u;case"minutes":case"minute":case"mins":case"min":case"m":return n*l;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){return t>=c?Math.round(t/c)+"d":t>=u?Math.round(t/u)+"h":t>=l?Math.round(t/l)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function o(t){return s(t,c,"day")||s(t,u,"hour")||s(t,l,"minute")||s(t,a,"second")||t+" ms"; +}function s(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var a=1e3,l=60*a,u=60*l,c=24*u,h=365.25*c;e.exports=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return i(t);if("number"===n&&isNaN(t)===!1)return e["long"]?o(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],19:[function(t,e,n){function i(){return!("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function r(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),e){var i="color: "+this.color;t.splice(1,0,i,"color: inherit");var r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(r++,"%c"===t&&(o=r))}),t.splice(o,0,i)}}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(t){try{null==t?n.storage.removeItem("debug"):n.storage.debug=t}catch(e){}}function a(){try{return n.storage.debug}catch(t){}return"undefined"!=typeof u&&"env"in u?u.env.DEBUG:void 0}function l(){try{return window.localStorage}catch(t){}}var u=t("__browserify_process");n=e.exports=t("./debug"),n.log=o,n.formatArgs=r,n.save=s,n.load=a,n.useColors=i,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:l(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},n.enable(a())},{"./debug":20,__browserify_process:15}],20:[function(t,e,n){function i(t){var e,i=0;for(e in t)i=(i<<5)-i+t.charCodeAt(e),i|=0;return n.colors[Math.abs(i)%n.colors.length]}function r(t){function e(){if(e.enabled){var t=e,i=+new Date,r=i-(u||i);t.diff=r,t.prev=u,t.curr=i,u=i;for(var o=new Array(arguments.length),s=0;sr;r++)e[r]&&(t=e[r].replace(/\*/g,".*?"),"-"===t[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")))}function s(){n.enable("")}function a(t){var e,i;for(e=0,i=n.skips.length;i>e;e++)if(n.skips[e].test(t))return!1;for(e=0,i=n.names.length;i>e;e++)if(n.names[e].test(t))return!0;return!1}function l(t){return t instanceof Error?t.stack||t.message:t}n=e.exports=r.debug=r["default"]=r,n.coerce=l,n.disable=s,n.enable=o,n.enabled=a,n.humanize=t("ms"),n.names=[],n.skips=[],n.formatters={};var u},{ms:18}],21:[function(t,e,n){"use strict";var i=String.prototype.replace,r=/%20/g;e.exports={"default":"RFC3986",formatters:{RFC1738:function(t){return i.call(t,r,"+")},RFC3986:function(t){return t}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},{}],22:[function(t,e,n){"use strict";var i=t("./stringify"),r=t("./parse"),o=t("./formats");e.exports={formats:o,parse:r,stringify:i}},{"./formats":21,"./parse":23,"./stringify":24}],23:[function(t,e,n){"use strict";var i=t("./utils"),r=Object.prototype.hasOwnProperty,o={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:i.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},s=function(t,e){for(var n={},i=t.split(e.delimiter,e.parameterLimit===1/0?void 0:e.parameterLimit),o=0;o=0&&n.parseArrays&&s<=n.arrayLimit?(i=[],i[s]=u(t,e,n)):i[o]=u(t,e,n)}return i},l=function(t,e,n){if(t){var i=n.allowDots?t.replace(/\.([^\.\[]+)/g,"[$1]"):t,o=/^([^\[\]]*)/,s=/(\[[^\[\]]*\])/g,l=o.exec(i),u=[];if(l[1]){if(!n.plainObjects&&r.call(Object.prototype,l[1])&&!n.allowPrototypes)return;u.push(l[1])}for(var c=0;null!==(l=s.exec(i))&&ce;++e)t.push("%"+((16>e?"0":"")+e.toString(16)).toUpperCase());return t}();n.arrayToObject=function(t,e){for(var n=e&&e.plainObjects?Object.create(null):{},i=0;i=48&&57>=o||o>=65&&90>=o||o>=97&&122>=o?n+=e.charAt(i):128>o?n+=r[o]:2048>o?n+=r[192|o>>6]+r[128|63&o]:55296>o||o>=57344?n+=r[224|o>>12]+r[128|o>>6&63]+r[128|63&o]:(i+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(i)),n+=r[240|o>>18]+r[128|o>>12&63]+r[128|o>>6&63]+r[128|63&o])}return n},n.compact=function(t,e){if("object"!=typeof t||null===t)return t;var i=e||[],r=i.indexOf(t);if(-1!==r)return i[r];if(i.push(t),Array.isArray(t)){for(var o=[],s=0;s0;)self._completeHandlers.shift()(t)}function success(resp){var type=o.type||resp&&setType(resp.getResponseHeader("Content-Type"));resp="jsonp"!==type?self.request:resp;var filteredResponse=globalSetupOptions.dataFilter(resp.responseText,type),r=filteredResponse;try{resp.responseText=r}catch(e){}if(r)switch(type){case"json":try{resp=context.JSON?context.JSON.parse(r):eval("("+r+")")}catch(err){return error(resp,"Could not parse JSON in response",err)}break;case"js":resp=eval(r);break;case"html":resp=r;break;case"xml":resp=resp.responseXML&&resp.responseXML.parseError&&resp.responseXML.parseError.errorCode&&resp.responseXML.parseError.reason?null:resp.responseXML}for(self._responseArgs.resp=resp,self._fulfilled=!0,fn(resp),self._successHandler(resp);self._fulfillmentHandlers.length>0;)resp=self._fulfillmentHandlers.shift()(resp);complete(resp)}function timedOut(){self._timedOut=!0,self.request.abort()}function error(t,e,n){for(t=self.request,self._responseArgs.resp=t,self._responseArgs.msg=e,self._responseArgs.t=n,self._erred=!0;self._errorHandlers.length>0;)self._errorHandlers.shift()(t,e,n);complete(t)}this.url="string"==typeof o?o:o.url,this.timeout=null,this._fulfilled=!1,this._successHandler=function(){},this._fulfillmentHandlers=[],this._errorHandlers=[],this._completeHandlers=[],this._erred=!1,this._responseArgs={};var self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){timedOut()},o.timeout)),o.success&&(this._successHandler=function(){o.success.apply(o,arguments)}),o.error&&this._errorHandlers.push(function(){o.error.apply(o,arguments)}),o.complete&&this._completeHandlers.push(function(){o.complete.apply(o,arguments)}),this.request=getRequest.call(this,success,error)}function reqwest(t,e){return new Reqwest(t,e)}function normalize(t){return t?t.replace(/\r?\n/g,"\r\n"):""}function serial(t,e){var n,i,r,o,s=t.name,a=t.tagName.toLowerCase(),l=function(t){t&&!t.disabled&&e(s,normalize(t.attributes.value&&t.attributes.value.specified?t.value:t.text))};if(!t.disabled&&s)switch(a){case"input":/reset|button|image|file/i.test(t.type)||(n=/checkbox/i.test(t.type),i=/radio/i.test(t.type),r=t.value,(!(n||i)||t.checked)&&e(s,normalize(n&&""===r?"on":r)));break;case"textarea":e(s,normalize(t.value));break;case"select":if("select-one"===t.type.toLowerCase())l(t.selectedIndex>=0?t.options[t.selectedIndex]:null);else for(o=0;t.length&&o-1){var n=new RegExp("rv:([0-9]{2,2}[.0-9]{0,})");null!==n.exec(e)&&(t=parseFloat(RegExp.$1))}return t>=8}function i(){try{var t=navigator.userAgent;return-1!=t.indexOf("Fennec/")||-1!=t.indexOf("Firefox/")&&-1!=t.indexOf("Android")}catch(e){}return!1}function r(){return"undefined"!=typeof window&&window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage}function o(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}function s(){for(var t=(window.location,window.opener.frames),e=t.length-1;e>=0;e--)try{if(t[e].location.protocol===window.location.protocol&&t[e].location.host===window.location.host&&t[e].name===a)return t[e]}catch(n){}}var a="__winchan_relay_frame",l="die",u=n();return r()?{open:function(n,r){function s(){if(f&&document.body.removeChild(f),f=void 0,m&&(m=clearInterval(m)),e(window,"message",c),e(window,"unload",s),g)try{g.close()}catch(t){p.postMessage(l,d)}g=p=void 0}function c(t){if(t.origin===d)try{var e=JSON.parse(t.data);"ready"===e.a?p.postMessage(v,d):"error"===e.a?(s(),r&&(r(e.d),r=null)):"response"===e.a&&(s(),r&&(r(null,e.d),r=null))}catch(n){}}if(!r)throw"missing required callback argument";var h;n.url||(h="missing required 'url' parameter"),n.relay_url||(h="missing required 'relay_url' parameter"),h&&setTimeout(function(){r(h)},0),n.window_name||(n.window_name=null),(!n.window_features||i())&&(n.window_features=void 0);var f,d=o(n.url);if(d!==o(n.relay_url))return setTimeout(function(){r("invalid arguments: origin of url and relay_url must match")},0);var p;u&&(f=document.createElement("iframe"),f.setAttribute("src",n.relay_url),f.style.display="none",f.setAttribute("name",a),document.body.appendChild(f),p=f.contentWindow);var g=n.popup||window.open(n.url,n.window_name,n.window_features);n.popup&&(g.location.href=n.url),p||(p=g);var m=setInterval(function(){g&&g.closed&&(s(),r&&(r("User closed the popup window"),r=null))},500),v=JSON.stringify({a:"request",d:n.params});return t(window,"unload",s),t(window,"message",c),{close:s,focus:function(){if(g)try{g.focus()}catch(t){}}}},onOpen:function(n){function i(t){t=JSON.stringify(t),u?c.doPost(t,a):c.postMessage(t,a)}function r(t){var o;try{o=JSON.parse(t.data)}catch(s){}o&&"request"===o.a&&(e(window,"message",r),a=t.origin,n&&setTimeout(function(){n(a,o.d,function(t){n=void 0,i({a:"response",d:t})})},0))}function o(t){if(t.data===l)try{window.close()}catch(e){}}var a="*",c=u?s():window.opener;if(!c)throw"can't find relay frame";t(u?c:window,"message",r),t(u?c:window,"message",o);try{i({a:"ready"})}catch(h){t(c,"load",function(t){i({a:"ready"})})}var f=function(){try{e(u?c:window,"message",o)}catch(t){}n&&i({a:"error",d:"client closed window"}),n=void 0;try{window.close()}catch(r){}};return t(window,"unload",f),{detach:function(){e(window,"unload",f)}}}}:{open:function(t,e,n,i){setTimeout(function(){i("unsupported browser")},0)},onOpen:function(t){setTimeout(function(){t("unsupported browser")},0)}}}();"undefined"!=typeof e&&e.exports&&(e.exports=i)},{}],29:[function(t,e,n){function i(t){return null!==t&&("object"==typeof t||"function"==typeof t)}e.exports=i},{}],30:[function(t,e,n){function i(){for(var t={},e=0;e2?arguments[2]:null;if(a===+a)for(n=0;a>n;n++)null===l?e(s?t.charAt(n):t[n],n,t):e.call(l,s?t.charAt(n):t[n],n,t);else for(r in t)i.call(t,r)&&(null===l?e(t[r],r,t):e.call(l,t[r],r,t))}},{}],32:[function(t,e,n){e.exports=Object.keys||t("./shim")},{"./shim":34}],33:[function(t,e,n){var i=Object.prototype.toString;e.exports=function r(t){var e=i.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===i.call(t.callee)),r}},{}],34:[function(t,e,n){!function(){"use strict";var n,i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=t("./foreach"),s=t("./isArguments"),a=!{toString:null}.propertyIsEnumerable("toString"),l=function(){}.propertyIsEnumerable("prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];n=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===r.call(t),c=s(t),h=[];if(!e&&!n&&!c)throw new TypeError("Object.keys called on a non-object");if(c)o(t,function(t){h.push(t)});else{var f,d=l&&n;for(f in t)d&&"prototype"===f||!i.call(t,f)||h.push(f)}if(a){var p=t.constructor,g=p&&p.prototype===t;o(u,function(e){g&&"constructor"===e||!i.call(t,e)||h.push(e)})}return h},e.exports=n}()},{"./foreach":31,"./isArguments":33}],35:[function(t,e,n){var i="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r=t("./index");"function"==typeof i.window.define&&i.window.define.amd?i.window.define("auth0",function(){return r}):i.window&&(i.window.Auth0=r)},{"./index":1}],36:[function(t,e,n){e.exports={str:"7.6.1"}},{}]},{},[35]); \ No newline at end of file diff --git a/mirage.appcache b/mirage.appcache index f310ca824..ea98b4f13 100644 --- a/mirage.appcache +++ b/mirage.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# 1518196613899 +# 1528100218587 ./assets/images/favicon.ico ./dist/css/vendor.min.css ./dist/css/style.min.css