From b849b2aef34a735a90126017213ae9719e69eb3d Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 21 Nov 2020 18:32:34 +0100 Subject: [PATCH] static: add code-mirror widget --- passbook/admin/fields.py | 6 +-- .../admin/templates/administration/shell.html | 5 --- .../admin/templates/fields/codemirror.html | 1 + passbook/static/static/package-lock.json | 19 ++++++++- passbook/static/static/package.json | 3 +- passbook/static/static/passbook/main.js | 32 +++++++------- passbook/static/static/passbook/main.js.map | 2 +- passbook/static/static/src/AdminSidebar.ts | 1 - passbook/static/static/src/CodeMirror.ts | 42 +++++++++++++++++++ passbook/static/static/src/legacy.js | 30 ++++++------- passbook/static/static/src/main.ts | 1 + 11 files changed, 98 insertions(+), 44 deletions(-) create mode 100644 passbook/admin/templates/fields/codemirror.html create mode 100644 passbook/static/static/src/CodeMirror.ts diff --git a/passbook/admin/fields.py b/passbook/admin/fields.py index b6749172a..7337c90c2 100644 --- a/passbook/admin/fields.py +++ b/passbook/admin/fields.py @@ -36,15 +36,15 @@ class CodeMirrorWidget(forms.Textarea): # CodeMirror mode to enable mode: str + template_name = "fields/codemirror.html" + def __init__(self, *args, mode="yaml", **kwargs): super().__init__(*args, **kwargs) self.mode = mode def render(self, *args, **kwargs): attrs = kwargs.setdefault("attrs", {}) - attrs.setdefault("class", "") - attrs["class"] += " codemirror" - attrs["data-cm-mode"] = self.mode + attrs["mode"] = self.mode return super().render(*args, **kwargs) diff --git a/passbook/admin/templates/administration/shell.html b/passbook/admin/templates/administration/shell.html index e2e343a9b..3dbc25d3e 100644 --- a/passbook/admin/templates/administration/shell.html +++ b/passbook/admin/templates/administration/shell.html @@ -8,13 +8,8 @@ {% block head %} {{ block.super }} - - - - - {% endblock %} {% block page_content %} diff --git a/passbook/admin/templates/fields/codemirror.html b/passbook/admin/templates/fields/codemirror.html new file mode 100644 index 000000000..9df833a1f --- /dev/null +++ b/passbook/admin/templates/fields/codemirror.html @@ -0,0 +1 @@ + diff --git a/passbook/static/static/package-lock.json b/passbook/static/static/package-lock.json index e74a4fb8d..54fd0be92 100644 --- a/passbook/static/static/package-lock.json +++ b/passbook/static/static/package-lock.json @@ -90,11 +90,18 @@ "@types/node": "*" } }, + "@types/codemirror": { + "version": "0.0.98", + "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-0.0.98.tgz", + "integrity": "sha512-cbty5LPayy2vNSeuUdjNA9tggG+go5vAxmnLDRWpiZI5a+RDBi9dlozy4/jW/7P/gletbBWbQREEa7A81YxstA==", + "requires": { + "@types/tern": "*" + } + }, "@types/estree": { "version": "0.0.45", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", - "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", - "dev": true + "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==" }, "@types/html-minifier": { "version": "3.5.3", @@ -128,6 +135,14 @@ "@types/node": "*" } }, + "@types/tern": { + "version": "0.23.3", + "resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.3.tgz", + "integrity": "sha512-imDtS4TAoTcXk0g7u4kkWqedB3E4qpjXzCpD2LU5M5NAXHzCDsypyvXSaG7mM8DKYkCRa7tFp4tS/lp/Wo7Q3w==", + "requires": { + "@types/estree": "*" + } + }, "@types/uglify-js": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.11.0.tgz", diff --git a/passbook/static/static/package.json b/passbook/static/static/package.json index 39f9d1751..06a0962ed 100644 --- a/passbook/static/static/package.json +++ b/passbook/static/static/package.json @@ -6,8 +6,9 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^5.15.1", - "@types/chart.js": "^2.9.28", "@patternfly/patternfly": "^4.65.6", + "@types/chart.js": "^2.9.28", + "@types/codemirror": "0.0.98", "chart.js": "^2.9.4", "codemirror": "^5.58.3", "lit-element": "^2.4.0", diff --git a/passbook/static/static/passbook/main.js b/passbook/static/static/passbook/main.js index e7e310b92..39e8a9961 100644 --- a/passbook/static/static/passbook/main.js +++ b/passbook/static/static/passbook/main.js @@ -1,4 +1,4 @@ -document.querySelectorAll("input[type=search]").forEach((e=>{e.addEventListener("search",(t=>{""===e.value&&e.parentElement.submit()}))})),document.querySelectorAll("[data-pb-fetch-fill]").forEach((e=>{const t=e.dataset.pbFetchFill,n=e.dataset.pbFetchKey;fetch(t).then((e=>e.json())).then((t=>{e.textContent=t[n],e.value=t[n]}))})),document.querySelectorAll("[data-target='modal']").forEach((e=>{e.addEventListener("click",(e=>{const t=e.target.closest('[data-target="modal"]').attributes["data-modal"].value;document.querySelector("#"+t).removeAttribute("hidden")}))})),document.querySelectorAll(".pf-c-modal-box [data-modal-close]").forEach((e=>{e.addEventListener("click",(e=>{e.target.closest(".pf-c-backdrop").setAttribute("hidden",!0)}))})),document.querySelectorAll(".pf-c-check__label").forEach((e=>{e.addEventListener("click",(e=>{const t=e.target.parentElement.querySelector("input[type=checkbox]");t.checked=!t.checked}))})); +document.querySelectorAll("input[type=search]").forEach((t=>{t.addEventListener("search",(e=>{""===t.value&&t.parentElement.submit()}))})),document.querySelectorAll("[data-pb-fetch-fill]").forEach((t=>{const e=t.dataset.pbFetchFill,n=t.dataset.pbFetchKey;fetch(e).then((t=>t.json())).then((e=>{t.textContent=e[n],t.value=e[n]}))})),document.querySelectorAll("[data-target='modal']").forEach((t=>{t.addEventListener("click",(t=>{const e=t.target.closest('[data-target="modal"]').attributes["data-modal"].value;document.querySelector("#"+e).removeAttribute("hidden")}))})),document.querySelectorAll(".pf-c-modal-box [data-modal-close]").forEach((t=>{t.addEventListener("click",(t=>{t.target.closest(".pf-c-backdrop").setAttribute("hidden",!0)}))})),document.querySelectorAll(".pf-c-check__label").forEach((t=>{t.addEventListener("click",(t=>{const e=t.target.parentElement.querySelector("input[type=checkbox]");e.checked=!e.checked}))})); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -13,7 +13,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -function e(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}document.querySelectorAll("input[name=name]").forEach((e=>{e.addEventListener("input",(e=>{const t=e.target.closest("form");if(null===t)return;t.querySelector("input[name=slug]").value=e.target.value.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"")}))})),document.querySelectorAll(".pf-c-page__header-brand-toggle>button").forEach((e=>{e.addEventListener("click",(e=>{const t=document.querySelector(".pf-c-page__sidebar");t.classList.contains("pf-m-expanded")?(t.classList.remove("pf-m-expanded"),t.style.zIndex=0):(t.classList.add("pf-m-expanded"),t.style.zIndex=200)}))})),document.querySelectorAll(".pf-m-expandable>.pf-c-nav__link").forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault(),e.parentElement.classList.toggle("pf-m-expanded")}))})); +function t(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}document.querySelectorAll("input[name=name]").forEach((t=>{t.addEventListener("input",(t=>{const e=t.target.closest("form");if(null===e)return;e.querySelector("input[name=slug]").value=t.target.value.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"")}))})),document.querySelectorAll(".pf-c-page__header-brand-toggle>button").forEach((t=>{t.addEventListener("click",(t=>{const e=document.querySelector(".pf-c-page__sidebar");e.classList.contains("pf-m-expanded")?(e.classList.remove("pf-m-expanded"),e.style.zIndex=0):(e.classList.add("pf-m-expanded"),e.style.zIndex=200)}))})),document.querySelectorAll(".pf-m-expandable>.pf-c-nav__link").forEach((t=>{t.addEventListener("click",(e=>{e.preventDefault(),t.parentElement.classList.toggle("pf-m-expanded")}))})); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -27,7 +27,7 @@ function e(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPro * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,n=(e,t,n=null)=>{for(;t!==n;){const n=t.nextSibling;e.removeChild(t),t=n}},r=`{{lit-${String(Math.random()).slice(2)}}}`,i=`\x3c!--${r}--\x3e`,o=new RegExp(`${r}|${i}`);class a{constructor(e,t){this.parts=[],this.element=t;const n=[],i=[],a=document.createTreeWalker(t.content,133,null,!1);let l=0,d=-1,h=0;const{strings:f,values:{length:p}}=e;for(;h0;){const t=f[h],n=u.exec(t)[2],r=n.toLowerCase()+"$lit$",i=e.getAttribute(r);e.removeAttribute(r);const a=i.split(o);this.parts.push({type:"attribute",index:d,name:n,strings:a}),h+=a.length-1}}"TEMPLATE"===e.tagName&&(i.push(e),a.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(r)>=0){const r=e.parentNode,i=t.split(o),a=i.length-1;for(let t=0;t{const n=e.length-t.length;return n>=0&&e.slice(n)===t},l=e=>-1!==e.index,c=()=>document.createComment(""),u=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function d(e,t){const{element:{content:n},parts:r}=e,i=document.createTreeWalker(n,133,null,!1);let o=f(r),a=r[o],s=-1,l=0;const c=[];let u=null;for(;i.nextNode();){s++;const e=i.currentNode;for(e.previousSibling===u&&(u=null),t.has(e)&&(c.push(e),null===u&&(u=e)),null!==u&&l++;void 0!==a&&a.index===s;)a.index=null!==u?-1:a.index-l,o=f(r,o),a=r[o]}c.forEach((e=>e.parentNode.removeChild(e)))}const h=e=>{let t=11===e.nodeType?0:1;const n=document.createTreeWalker(e,133,null,!1);for(;n.nextNode();)t++;return t},f=(e,t=-1)=>{for(let n=t+1;n{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},r=`{{lit-${String(Math.random()).slice(2)}}}`,i=`\x3c!--${r}--\x3e`,o=new RegExp(`${r}|${i}`);class a{constructor(t,e){this.parts=[],this.element=e;const n=[],i=[],a=document.createTreeWalker(e.content,133,null,!1);let l=0,d=-1,h=0;const{strings:f,values:{length:p}}=t;for(;h0;){const e=f[h],n=c.exec(e)[2],r=n.toLowerCase()+"$lit$",i=t.getAttribute(r);t.removeAttribute(r);const a=i.split(o);this.parts.push({type:"attribute",index:d,name:n,strings:a}),h+=a.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),a.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(r)>=0){const r=t.parentNode,i=e.split(o),a=i.length-1;for(let e=0;e{const n=t.length-e.length;return n>=0&&t.slice(n)===e},l=t=>-1!==t.index,u=()=>document.createComment(""),c=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function d(t,e){const{element:{content:n},parts:r}=t,i=document.createTreeWalker(n,133,null,!1);let o=f(r),a=r[o],s=-1,l=0;const u=[];let c=null;for(;i.nextNode();){s++;const t=i.currentNode;for(t.previousSibling===c&&(c=null),e.has(t)&&(u.push(t),null===c&&(c=t)),null!==c&&l++;void 0!==a&&a.index===s;)a.index=null!==c?-1:a.index-l,o=f(r,o),a=r[o]}u.forEach((t=>t.parentNode.removeChild(t)))}const h=t=>{let e=11===t.nodeType?0:1;const n=document.createTreeWalker(t,133,null,!1);for(;n.nextNode();)e++;return e},f=(t,e=-1)=>{for(let n=e+1;n"function"==typeof e&&p.has(e),m={},v={}; +const p=new WeakMap,g=t=>"function"==typeof t&&p.has(t),m={},v={}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -55,7 +55,7 @@ const p=new WeakMap,g=e=>"function"==typeof e&&p.has(e),m={},v={}; * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class y{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this.options=n}update(e){let t=0;for(const n of this.__parts)void 0!==n&&n.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=t?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=[],r=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let o,a=0,s=0,c=i.nextNode();for(;ae}),x=` ${r} `;class w{constructor(e,t,n,r){this.strings=e,this.values=t,this.type=n,this.processor=r}getHTML(){const e=this.strings.length-1;let t="",n=!1;for(let o=0;o-1||n)&&-1===e.indexOf("--\x3e",a+1);const s=u.exec(e);t+=null===s?e+(n?x:i):e.substr(0,s.index)+s[1]+s[2]+"$lit$"+s[3]+r}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==b&&(t=b.createHTML(t)),e.innerHTML=t,e}} + */const b=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),x=` ${r} `;class w{constructor(t,e,n,r){this.strings=t,this.values=e,this.type=n,this.processor=r}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let o=0;o-1||n)&&-1===t.indexOf("--\x3e",a+1);const s=c.exec(t);e+=null===s?t+(n?x:i):t.substr(0,s.index)+s[1]+s[2]+"$lit$"+s[3]+r}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==b&&(e=b.createHTML(e)),t.innerHTML=e,t}} /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -81,7 +81,7 @@ class y{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const _=e=>null===e||!("object"==typeof e||"function"==typeof e),k=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class S{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e{try{const e={get capture(){return P=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class A{constructor(e,t,n){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;g(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=m,e(this)}if(this.__pendingValue===m)return;const e=this.__pendingValue,t=this.value,n=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),r=null!=e&&(null==t||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=O(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=m}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const O=e=>e&&(P?{capture:e.capture,passive:e.passive,once:e.once}:e.capture) + */const _=t=>null===t||!("object"==typeof t||"function"==typeof t),k=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class S{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t{try{const t={get capture(){return P=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class A{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;g(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=m,t(this)}if(this.__pendingValue===m)return;const t=this.__pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=O(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=m}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const O=t=>t&&(P?{capture:t.capture,passive:t.passive,once:t.once}:t.capture) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -94,7 +94,7 @@ class y{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */;function N(e){let t=F.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},F.set(e.type,t));let n=t.stringsArray.get(e.strings);if(void 0!==n)return n;const i=e.strings.join(r);return n=t.keyString.get(i),void 0===n&&(n=new a(e,e.getTemplateElement()),t.keyString.set(i,n)),t.stringsArray.set(e.strings,n),n}const F=new Map,I=new WeakMap; + */;function N(t){let e=F.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},F.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const i=t.strings.join(r);return n=e.keyString.get(i),void 0===n&&(n=new a(t,t.getTemplateElement()),e.keyString.set(i,n)),e.stringsArray.set(t.strings,n),n}const F=new Map,I=new WeakMap; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -121,7 +121,7 @@ class y{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class{handleAttributeExpressions(e,t,n,r){const i=t[0];if("."===i){return new D(e,t.slice(1),n).parts}if("@"===i)return[new A(e,t.slice(1),r.eventContext)];if("?"===i)return[new T(e,t.slice(1),n)];return new S(e,t,n).parts}handleTextExpression(e){return new C(e)}}; +class{handleAttributeExpressions(t,e,n,r){const i=e[0];if("."===i){return new D(t,e.slice(1),n).parts}if("@"===i)return[new A(t,e.slice(1),r.eventContext)];if("?"===i)return[new T(t,e.slice(1),n)];return new S(t,e,n).parts}handleTextExpression(t){return new C(t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -134,7 +134,7 @@ class{handleAttributeExpressions(e,t,n,r){const i=t[0];if("."===i){return new D( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const W=(e,...t)=>new w(e,t,"html",R) + */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const W=(t,...e)=>new w(t,e,"html",R) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -147,7 +147,7 @@ class{handleAttributeExpressions(e,t,n,r){const i=t[0];if("."===i){return new D( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */,E=(e,t)=>`${e}--${t}`;let z=!0;void 0===window.ShadyCSS?z=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),z=!1);const H=e=>t=>{const n=E(t.type,e);let i=F.get(n);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},F.set(n,i));let o=i.stringsArray.get(t.strings);if(void 0!==o)return o;const s=t.strings.join(r);if(o=i.keyString.get(s),void 0===o){const n=t.getTemplateElement();z&&window.ShadyCSS.prepareTemplateDom(n,e),o=new a(t,n),i.keyString.set(s,o)}return i.stringsArray.set(t.strings,o),o},B=["html","svg"],V=new Set,Y=(e,t,n)=>{V.add(e);const r=n?n.element:document.createElement("template"),i=t.querySelectorAll("style"),{length:o}=i;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(r,e);const a=document.createElement("style");for(let e=0;e{B.forEach((t=>{const n=F.get(E(t,e));void 0!==n&&n.keyString.forEach((e=>{const{element:{content:t}}=e,n=new Set;Array.from(t.querySelectorAll("style")).forEach((e=>{n.add(e)})),d(e,n)}))}))})(e);const s=r.content;n?function(e,t,n=null){const{element:{content:r},parts:i}=e;if(null==n)return void r.appendChild(t);const o=document.createTreeWalker(r,133,null,!1);let a=f(i),s=0,l=-1;for(;o.nextNode();)for(l++,o.currentNode===n&&(s=h(t),n.parentNode.insertBefore(t,n));-1!==a&&i[a].index===l;){if(s>0){for(;-1!==a;)i[a].index+=s,a=f(i,a);return}a=f(i,a)}}(n,a,s.firstChild):s.insertBefore(a,s.firstChild),window.ShadyCSS.prepareTemplateStyles(r,e);const l=s.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(n){s.insertBefore(a,s.firstChild);const e=new Set;e.add(a),d(n,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const U={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},j=(e,t)=>t!==e&&(t==t||e==e),G={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:j};class q extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach(((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))})),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach(((e,t)=>this._classProperties.set(t,e)))}}static createProperty(e,t=G){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n="symbol"==typeof e?Symbol():"__"+e,r=this.getPropertyDescriptor(e,n,t);void 0!==r&&Object.defineProperty(this.prototype,e,r)}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(r){const i=this[e];this[t]=r,this.requestUpdateInternal(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||G}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const n of t)this.createProperty(n,e[n])}}static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,n=j){return n(e,t)}static _propertyValueFromAttribute(e,t){const n=t.type,r=t.converter||U,i="function"==typeof r?r:r.fromAttribute;return i?i(e,n):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const n=t.type,r=t.converter;return(r&&r.toAttribute||U.toAttribute)(e,n)}initialize(){this._updateState=0,this._updatePromise=new Promise((e=>this._enableUpdatingResolver=e)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((e,t)=>this[t]=e)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,n){t!==n&&this._attributeToProperty(e,n)}_propertyToAttribute(e,t,n=G){const r=this.constructor,i=r._attributeNameForProperty(e,n);if(void 0!==i){const e=r._propertyValueToAttribute(t,n);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(i):this.setAttribute(i,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const n=this.constructor,r=n._attributeToPropertyMap.get(e);if(void 0!==r){const e=n.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,n){let r=!0;if(void 0!==e){const i=this.constructor;n=n||i.getPropertyOptions(e),i._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):r=!1}!this._hasRequestedUpdate&&r&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((e,t)=>this._propertyToAttribute(t,this[t],e))),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}q.finalized=!0; + */,E=(t,e)=>`${t}--${e}`;let z=!0;void 0===window.ShadyCSS?z=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),z=!1);const H=t=>e=>{const n=E(e.type,t);let i=F.get(n);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},F.set(n,i));let o=i.stringsArray.get(e.strings);if(void 0!==o)return o;const s=e.strings.join(r);if(o=i.keyString.get(s),void 0===o){const n=e.getTemplateElement();z&&window.ShadyCSS.prepareTemplateDom(n,t),o=new a(e,n),i.keyString.set(s,o)}return i.stringsArray.set(e.strings,o),o},B=["html","svg"],V=new Set,Y=(t,e,n)=>{V.add(t);const r=n?n.element:document.createElement("template"),i=e.querySelectorAll("style"),{length:o}=i;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(r,t);const a=document.createElement("style");for(let t=0;t{B.forEach((e=>{const n=F.get(E(e,t));void 0!==n&&n.keyString.forEach((t=>{const{element:{content:e}}=t,n=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{n.add(t)})),d(t,n)}))}))})(t);const s=r.content;n?function(t,e,n=null){const{element:{content:r},parts:i}=t;if(null==n)return void r.appendChild(e);const o=document.createTreeWalker(r,133,null,!1);let a=f(i),s=0,l=-1;for(;o.nextNode();)for(l++,o.currentNode===n&&(s=h(e),n.parentNode.insertBefore(e,n));-1!==a&&i[a].index===l;){if(s>0){for(;-1!==a;)i[a].index+=s,a=f(i,a);return}a=f(i,a)}}(n,a,s.firstChild):s.insertBefore(a,s.firstChild),window.ShadyCSS.prepareTemplateStyles(r,t);const l=s.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(n){s.insertBefore(a,s.firstChild);const t=new Set;t.add(a),d(n,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const U={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},j=(t,e)=>e!==t&&(e==e||t==t),G={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:j};class q extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,n)=>{const r=this._attributeNameForProperty(n,e);void 0!==r&&(this._attributeToPropertyMap.set(r,n),t.push(r))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach(((t,e)=>this._classProperties.set(e,t)))}}static createProperty(t,e=G){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const n="symbol"==typeof t?Symbol():"__"+t,r=this.getPropertyDescriptor(t,n,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(r){const i=this[t];this[e]=r,this.requestUpdateInternal(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||G}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const n of e)this.createProperty(n,t[n])}}static _attributeNameForProperty(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,n=j){return n(t,e)}static _propertyValueFromAttribute(t,e){const n=e.type,r=e.converter||U,i="function"==typeof r?r:r.fromAttribute;return i?i(t,n):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const n=e.type,r=e.converter;return(r&&r.toAttribute||U.toAttribute)(t,n)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,e)=>this[e]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,n){e!==n&&this._attributeToProperty(t,n)}_propertyToAttribute(t,e,n=G){const r=this.constructor,i=r._attributeNameForProperty(t,n);if(void 0!==i){const t=r._propertyValueToAttribute(e,n);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(i):this.setAttribute(i,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const n=this.constructor,r=n._attributeToPropertyMap.get(t);if(void 0!==r){const t=n.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,n){let r=!0;if(void 0!==t){const i=this.constructor;n=n||i.getPropertyOptions(t),i._valueHasChanged(this[t],e,n.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,n))):r=!1}!this._hasRequestedUpdate&&r&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((t,e)=>this._propertyToAttribute(e,this[e],t))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}q.finalized=!0; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -161,7 +161,7 @@ class{handleAttributeExpressions(e,t,n,r){const i=t[0];if("."===i){return new D( * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const $=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:n,elements:r}=t;return{kind:n,elements:r,finisher(t){window.customElements.define(e,t)}}})(e,t),K=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function Z(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):K(e,t)} +const $=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:r}=e;return{kind:n,elements:r,finisher(e){window.customElements.define(t,e)}}})(t,e),K=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(n){n.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}};function Z(t){return(e,n)=>void 0!==n?((t,e,n)=>{e.constructor.createProperty(n,t)})(t,e,n):K(t,e)} /** @license Copyright (c) 2019 The Polymer Project Authors. All rights reserved. @@ -171,7 +171,7 @@ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/const X=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol();class Q{constructor(e,t){if(t!==J)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(X?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const ee=(e,...t)=>{const n=t.reduce(((t,n,r)=>t+(e=>{if(e instanceof Q)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+e[r+1]),e[0]);return new Q(n,J)}; +*/const X=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol();class Q{constructor(t,e){if(e!==J)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(X?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const tt=(t,...e)=>{const n=e.reduce(((e,n,r)=>e+(t=>{if(t instanceof Q)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+t[r+1]),t[0]);return new Q(n,J)}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -185,14 +185,14 @@ found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const te={};class ne extends q{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,n)=>e.reduceRight(((e,n)=>Array.isArray(n)?t(n,e):(e.add(n),e)),n),n=t(e,new Set),r=[];n.forEach((e=>r.unshift(e))),this._styles=r}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map((e=>{if(e instanceof CSSStyleSheet&&!X){const t=Array.prototype.slice.call(e.cssRules).reduce(((e,t)=>e+t.cssText),"");return new Q(String(t),J)}return e}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?X?this.renderRoot.adoptedStyleSheets=e.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((e=>e.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==te&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)})))}render(){return te}}ne.finalized=!0,ne.render=(e,t,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const i=r.scopeName,o=I.has(t),a=z&&11===t.nodeType&&!!t.host,s=a&&!V.has(i),l=s?document.createDocumentFragment():t;if(((e,t,r)=>{let i=I.get(t);void 0===i&&(n(t,t.firstChild),I.set(t,i=new C(Object.assign({templateFactory:N},r))),i.appendInto(t)),i.setValue(e),i.commit()})(e,l,Object.assign({templateFactory:H(i)},r)),s){const e=I.get(l);I.delete(l);const r=e.value instanceof y?e.value.template:void 0;Y(i,l,r),n(t,t.firstChild),t.appendChild(l),I.set(t,e)}!o&&a&&window.ShadyCSS.styleElement(t.host)};const re={error:"fas fa-exclamation-circle",warning:"fas fa-exclamation-triangle",success:"fas fa-check-circle",info:"fas fa-info"};function ie(){(null===document||void 0===document?void 0:document.querySelector("pb-messages")).fetchMessages()}let oe=class extends ne{constructor(){super(...arguments),this.url="",this.messages=[]}createRenderRoot(){return this}firstUpdated(){this.fetchMessages()}fetchMessages(){return fetch(this.url).then((e=>e.json())).then((e=>this.messages=e)).then((e=>{const t=this.querySelector(".pf-c-alert-group");e.forEach((e=>{const n=this.renderMessage(e);t.appendChild(n)}))}))}renderMessage(e){const t="pb-message"+Math.random().toString(36).substr(2,9);const n=document.createElement("template");return n.innerHTML=`
  • \n
    \n
    \n \n
    \n

    \n ${e.message}\n

    \n
    \n
  • `,setTimeout((()=>{var e;null===(e=this.querySelector("#"+t))||void 0===e||e.remove()}),1500),n.content.firstChild}render(){return W`
      `}};e([Z()],oe.prototype,"url",void 0),e([Z()],oe.prototype,"messages",void 0),oe=e([$("pb-messages")],oe);const ae=["pf-m-progress","pf-m-in-progress"];let se=class extends ne{constructor(){var e;super(),this.url="",this.isRunning=!1,null===(e=this.querySelector("button"))||void 0===e||e.addEventListener("click",(e=>this.callAction()))}setLoading(){this.isRunning=!0,this.classList.add(...ae)}setDone(e){this.isRunning=!1,this.classList.remove(...ae),this.classList.replace("pf-m-primary",e),ie(),setTimeout((()=>{this.classList.replace(e,"pf-m-primary")}),1e3)}callAction(){if(!0===this.isRunning)return;this.setLoading();const e=function(e){let t=null;if(document.cookie&&""!==document.cookie){const n=document.cookie.split(";");for(let r=0;re.json())).then((e=>{this.setDone("pf-m-success")})).catch((()=>{this.setDone("pf-m-danger")}))}render(){return W``}};e([Z()],se.prototype,"url",void 0),se=e([$("pb-action-button")],se);let le=class extends ne{constructor(){super(),this.paths=[],this.activePath=window.location.hash.slice(1,1/0),window.addEventListener("hashchange",(e=>{this.activePath=window.location.hash.slice(1,1/0)})),this.querySelectorAll(".pf-c-nav__link").forEach((e=>{var t;let n=null===(t=e.attributes.getNamedItem("pb-url-prefix"))||void 0===t?void 0:t.value;if(!n){const t=new URL(e.href);if(""===t.hash)return void console.log("Ignoring "+e);n=`^${t.hash.slice(1,1/0)}$`}const r=RegExp(n);this.paths.push({anchor:e,match:r})}))}render(){return console.log(this.activePath),this.paths.forEach((e=>{e.match.exec(this.activePath)?e.anchor.classList.add("pf-m-current"):e.anchor.classList.remove("pf-m-current")})),W``}};e([Z()],le.prototype,"activePath",void 0),le=e([$("pb-admin-sidebar")],le);const ce=new CSSStyleSheet;ce.replaceSync(".pf-l-bullseye {\n --pf-l-bullseye--Padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: var(--pf-l-bullseye--Padding);\n margin: 0; }\n");const ue=new CSSStyleSheet;ue.replaceSync('.pf-c-spinner {\n --pf-c-spinner--AnimationDuration: 1.5s;\n --pf-c-spinner--AnimationTimingFunction: cubic-bezier(.77, .005, .315, 1);\n --pf-c-spinner--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner--stroke-width-multiplier: .1;\n --pf-c-spinner--stroke-width: calc(var(--pf-c-spinner--diameter) * var(--pf-c-spinner--stroke-width-multiplier));\n --pf-c-spinner--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Color: var(--pf-global--primary-color--100);\n --pf-c-spinner--m-sm--diameter: var(--pf-global--icon--FontSize--sm);\n --pf-c-spinner--m-md--diameter: var(--pf-global--icon--FontSize--md);\n --pf-c-spinner--m-lg--diameter: var(--pf-global--icon--FontSize--lg);\n --pf-c-spinner--m-xl--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner__clipper--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__clipper--after--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowSpreadRadius: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__lead-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__ball--after--Width: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__ball--after--Height: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__tail-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n position: relative;\n display: inline-block;\n width: var(--pf-c-spinner--Width);\n height: var(--pf-c-spinner--Height);\n text-align: left;\n animation: pf-animation-spinner-parent calc(var(--pf-c-spinner--AnimationDuration) * 2) var(--pf-c-spinner--AnimationTimingFunction) infinite; }\n .pf-c-spinner.pf-m-sm {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-sm--diameter); }\n .pf-c-spinner.pf-m-md {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-md--diameter); }\n .pf-c-spinner.pf-m-lg {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-lg--diameter); }\n .pf-c-spinner.pf-m-xl {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-xl--diameter); }\n\n@keyframes pf-animation-spinner-parent {\n 0% {\n transform: rotate(0deg); }\n 50% {\n transform: rotate(-540deg); }\n 100% {\n transform: rotate(-1080deg); } }\n\n.pf-c-spinner__clipper {\n position: absolute;\n width: var(--pf-c-spinner__clipper--Width);\n height: var(--pf-c-spinner__clipper--Height);\n clip-path: inset(0 0 50% 50%);\n animation: pf-animation-spinner__clipper var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(-270deg); } }\n\n.pf-c-spinner__clipper::after {\n position: absolute;\n width: var(--pf-c-spinner__clipper--after--Width);\n height: var(--pf-c-spinner__clipper--after--Height);\n clip-path: inset(0 0 0 50%);\n content: "";\n border-radius: 50%;\n box-shadow: inset 0 0 0 var(--pf-c-spinner__clipper--after--BoxShadowSpreadRadius) var(--pf-c-spinner__clipper--after--BoxShadowColor);\n animation: pf-animation-spinner__clipper-after var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper-after {\n 0% {\n transform: rotate(90deg); }\n 100% {\n transform: rotate(-180deg); } }\n\n.pf-c-spinner__lead-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__lead-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__lead-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__lead-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__lead-ball {\n 0% {\n transform: rotate(0deg); }\n 34% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n\n.pf-c-spinner__tail-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__tail-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__tail-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__tail-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__tail-ball {\n 0% {\n transform: rotate(0deg); }\n 67.5% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n');let de=class extends ne{constructor(){super(),this.loading=!1,this.loadContent(),window.addEventListener("hashchange",(e=>this.loadContent()))}set defaultUrl(e){""===window.location.hash&&void 0!==e&&(window.location.hash="#"+e)}static get styles(){return[ee`:host{position:relative}:host .pf-l-bullseye{position:absolute;height:100%;width:100%;top:0;left:0}`,ce,ue]}loadContent(){let e=window.location.hash.slice(1,1/0);""!==e&&(this.loading=!0,fetch(e).then((e=>e.text())).then((e=>{this.querySelector("[slot=body]").innerHTML=e})).then((()=>{this.querySelectorAll("a").forEach((e=>{if(""!==e.href)try{const t=new URL(e.href),n=t.search||"";e.href=`#${t.pathname}${n}`}catch(t){e.href="#"+e.href}})),this.querySelectorAll("[role=pb-refresh]").forEach((e=>{e.addEventListener("click",(e=>{this.loadContent()}))})),this.loading=!1})))}render(){return W`${this.loading?W`
      `:""}`}};e([Z()],de.prototype,"defaultUrl",null),e([Z()],de.prototype,"loading",void 0),de=e([$("pb-admin-shell")],de);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function he(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function fe(e,t){return e(t={exports:{}},t.exports),t.exports}var pe=fe((function(e,t){e.exports=function(){var t,n;function r(){return t.apply(null,arguments)}function i(e){t=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function c(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function h(e,t){var n,r=[];for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,W=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},z={};function H(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(z[e]=i),t&&(z[t[0]]=function(){return I(i.apply(this,arguments),t[1],t[2])}),n&&(z[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function B(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function V(e){var t,n,r=e.match(R);for(t=0,n=r.length;t=0&&W.test(e);)e=e.replace(W,r),W.lastIndex=0,n-=1;return e}var j={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"};function G(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(R).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var q="Invalid date";function $(){return this._invalidDate}var K="%d",Z=/\d{1,2}/;function X(e){return this._ordinal.replace("%d",e)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(e,t,n,r){var i=this._relativeTime[n];return L(i)?i(e,t,n,r):i.replace(/%d/i,e)}function ee(e,t){var n=this._relativeTime[e>0?"future":"past"];return L(n)?n(t):n.replace(/%s/i,t)}var te={};function ne(e,t){var n=e.toLowerCase();te[n]=te[n+"s"]=te[t]=e}function re(e){return"string"==typeof e?te[e]||te[e.toLowerCase()]:void 0}function ie(e){var t,n,r={};for(n in e)s(e,n)&&(t=re(n))&&(r[t]=e[n]);return r}var oe={};function ae(e,t){oe[e]=t}function se(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:oe[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}function le(e){return e%4==0&&e%100!=0||e%400==0}function ce(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ue(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=ce(t)),n}function de(e,t){return function(n){return null!=n?(pe(this,e,n),r.updateOffset(this,t),this):fe(this,e)}}function fe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function pe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&le(e.year())&&1===e.month()&&29===e.date()?(n=ue(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),et(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function ge(e){return L(this[e=re(e)])?this[e]():this}function me(e,t){if("object"==typeof e){var n,r=se(e=ie(e));for(n=0;n68?1900:2e3)};var vt=de("FullYear",!0);function yt(){return le(this.year())}function bt(e,t,n,r,i,o,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,o,a),s}function xt(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function wt(e,t,n){var r=7+t-n;return-(7+xt(e,0,r).getUTCDay()-t)%7+r-1}function _t(e,t,n,r,i){var o,a,s=1+7*(t-1)+(7+n-r)%7+wt(e,r,i);return s<=0?a=mt(o=e-1)+s:s>mt(e)?(o=e+1,a=s-mt(e)):(o=e,a=s),{year:o,dayOfYear:a}}function kt(e,t,n){var r,i,o=wt(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?r=a+St(i=e.year()-1,t,n):a>St(e.year(),t,n)?(r=a-St(e.year(),t,n),i=e.year()+1):(i=e.year(),r=a),{week:r,year:i}}function St(e,t,n){var r=wt(e,t,n),i=wt(e+1,t,n);return(mt(e)-r+i)/7}function Mt(e){return kt(e,this._week.dow,this._week.doy).week}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),ae("week",5),ae("isoWeek",5),Ie("w",ke),Ie("ww",ke,be),Ie("W",ke),Ie("WW",ke,be),Be(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=ue(e)}));var Ct={dow:0,doy:6};function Tt(){return this._week.dow}function Dt(){return this._week.doy}function Lt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Pt(e){var t=kt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function At(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Ot(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Nt(e,t){return e.slice(t,7).concat(e.slice(0,t))}H("d",0,"do","day"),H("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),H("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),H("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),ae("day",11),ae("weekday",11),ae("isoWeekday",11),Ie("d",ke),Ie("e",ke),Ie("E",ke),Ie("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Ie("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Ie("dddd",(function(e,t){return t.weekdaysRegex(e)})),Be(["dd","ddd","dddd"],(function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:m(n).invalidWeekday=e})),Be(["d","e","E"],(function(e,t,n,r){t[r]=ue(e)}));var Ft="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),It="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Wt=Fe,Et=Fe,zt=Fe;function Ht(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Nt(n,this._week.dow):e?n[e.day()]:n}function Bt(e){return!0===e?Nt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Vt(e){return!0===e?Nt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Yt(e,t,n){var r,i,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))||-1!==(i=Ye.call(this._shortWeekdaysParse,a))||-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))||-1!==(i=Ye.call(this._weekdaysParse,a))||-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))||-1!==(i=Ye.call(this._weekdaysParse,a))||-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}function Ut(e,t,n){var r,i,o;if(this._weekdaysParseExact)return Yt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function jt(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=At(e,this.localeData()),this.add(e-t,"d")):t}function Gt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function qt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Ot(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function $t(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Wt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Kt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Zt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=zt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xt(){function e(e,t){return t.length-e.length}var t,n,r,i,o,a=[],s=[],l=[],c=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=Ee(this.weekdaysMin(n,"")),i=Ee(this.weekdaysShort(n,"")),o=Ee(this.weekdays(n,"")),a.push(r),s.push(i),l.push(o),c.push(r),c.push(i),c.push(o);a.sort(e),s.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Jt(){return this.hours()%12||12}function Qt(){return this.hours()||24}function en(e,t){H(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function tn(e,t){return t._meridiemParse}function nn(e){return"p"===(e+"").toLowerCase().charAt(0)}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Jt),H("k",["kk",2],0,Qt),H("hmm",0,0,(function(){return""+Jt.apply(this)+I(this.minutes(),2)})),H("hmmss",0,0,(function(){return""+Jt.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)})),H("Hmm",0,0,(function(){return""+this.hours()+I(this.minutes(),2)})),H("Hmmss",0,0,(function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)})),en("a",!0),en("A",!1),ne("hour","h"),ae("hour",13),Ie("a",tn),Ie("A",tn),Ie("H",ke),Ie("h",ke),Ie("k",ke),Ie("HH",ke,be),Ie("hh",ke,be),Ie("kk",ke,be),Ie("hmm",Se),Ie("hmmss",Me),Ie("Hmm",Se),Ie("Hmmss",Me),He(["H","HH"],qe),He(["k","kk"],(function(e,t,n){var r=ue(e);t[qe]=24===r?0:r})),He(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),He(["h","hh"],(function(e,t,n){t[qe]=ue(e),m(n).bigHour=!0})),He("hmm",(function(e,t,n){var r=e.length-2;t[qe]=ue(e.substr(0,r)),t[$e]=ue(e.substr(r)),m(n).bigHour=!0})),He("hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[qe]=ue(e.substr(0,r)),t[$e]=ue(e.substr(r,2)),t[Ke]=ue(e.substr(i)),m(n).bigHour=!0})),He("Hmm",(function(e,t,n){var r=e.length-2;t[qe]=ue(e.substr(0,r)),t[$e]=ue(e.substr(r))})),He("Hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[qe]=ue(e.substr(0,r)),t[$e]=ue(e.substr(r,2)),t[Ke]=ue(e.substr(i))}));var rn=/[ap]\.?m?\.?/i,on=de("Hours",!0);function an(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var sn,ln={calendar:N,longDateFormat:j,invalidDate:q,ordinal:K,dayOfMonthOrdinalParse:Z,relativeTime:J,months:tt,monthsShort:nt,week:Ct,weekdays:Ft,weekdaysMin:Rt,weekdaysShort:It,meridiemParse:rn},cn={},un={};function dn(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=pn(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&dn(i,n)>=t-1)break;t--}o++}return sn}function pn(t){var n=null;if(void 0===cn[t]&&e&&e.exports)try{n=sn._abbr,he(),gn(n)}catch(e){cn[t]=null}return cn[t]}function gn(e,t){var n;return e&&((n=c(t)?yn(e):mn(e,t))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sn._abbr}function mn(e,t){if(null!==t){var n,r=ln;if(t.abbr=e,null!=cn[e])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=cn[e]._config;else if(null!=t.parentLocale)if(null!=cn[t.parentLocale])r=cn[t.parentLocale]._config;else{if(null==(n=pn(t.parentLocale)))return un[t.parentLocale]||(un[t.parentLocale]=[]),un[t.parentLocale].push({name:e,config:t}),null;r=n._config}return cn[e]=new O(A(r,t)),un[e]&&un[e].forEach((function(e){mn(e.name,e.config)})),gn(e),cn[e]}return delete cn[e],null}function vn(e,t){if(null!=t){var n,r,i=ln;null!=cn[e]&&null!=cn[e].parentLocale?cn[e].set(A(cn[e]._config,t)):(null!=(r=pn(e))&&(i=r._config),t=A(i,t),null==r&&(t.abbr=e),(n=new O(t)).parentLocale=cn[e],cn[e]=n),gn(e)}else null!=cn[e]&&(null!=cn[e].parentLocale?(cn[e]=cn[e].parentLocale,e===gn()&&gn(e)):null!=cn[e]&&delete cn[e]);return cn[e]}function yn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sn;if(!o(e)){if(t=pn(e))return t;e=[e]}return fn(e)}function bn(){return C(cn)}function xn(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[je]<0||n[je]>11?je:n[Ge]<1||n[Ge]>et(n[Ue],n[je])?Ge:n[qe]<0||n[qe]>24||24===n[qe]&&(0!==n[$e]||0!==n[Ke]||0!==n[Ze])?qe:n[$e]<0||n[$e]>59?$e:n[Ke]<0||n[Ke]>59?Ke:n[Ze]<0||n[Ze]>999?Ze:-1,m(e)._overflowDayOfYear&&(tGe)&&(t=Ge),m(e)._overflowWeeks&&-1===t&&(t=Xe),m(e)._overflowWeekday&&-1===t&&(t=Je),m(e).overflow=t),e}var wn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_n=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Mn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cn=/^\/?Date\((-?\d+)/i,Tn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ln(e){var t,n,r,i,o,a,s=e._i,l=wn.exec(s)||_n.exec(s);if(l){for(m(e).iso=!0,t=0,n=Sn.length;tmt(o)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=xt(o,0,e._dayOfYear),e._a[je]=n.getUTCMonth(),e._a[Ge]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=r[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[qe]&&0===e._a[$e]&&0===e._a[Ke]&&0===e._a[Ze]&&(e._nextDay=!0,e._a[qe]=0),e._d=(e._useUTC?xt:bt).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[qe]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(m(e).weekdayMismatch=!0)}}function Hn(e){var t,n,r,i,o,a,s,l,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(o=1,a=4,n=Wn(t.GG,e._a[Ue],kt(Kn(),1,4).year),r=Wn(t.W,1),((i=Wn(t.E,1))<1||i>7)&&(l=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,c=kt(Kn(),o,a),n=Wn(t.gg,e._a[Ue],c.year),r=Wn(t.w,c.week),null!=t.d?((i=t.d)<0||i>6)&&(l=!0):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(l=!0)):i=o),r<1||r>St(n,o,a)?m(e)._overflowWeeks=!0:null!=l?m(e)._overflowWeekday=!0:(s=_t(n,r,i,o,a),e._a[Ue]=s.year,e._dayOfYear=s.dayOfYear)}function Bn(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],m(e).empty=!0;var t,n,i,o,a,s,l=""+e._i,c=l.length,u=0;for(i=U(e._f,e._locale).match(R)||[],t=0;t0&&m(e).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),u+=n.length),z[o]?(n?m(e).empty=!1:m(e).unusedTokens.push(o),Ve(o,n,e)):e._strict&&!n&&m(e).unusedTokens.push(o);m(e).charsLeftOver=c-u,l.length>0&&m(e).unusedInput.push(l),e._a[qe]<=12&&!0===m(e).bigHour&&e._a[qe]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[qe]=Vn(e._locale,e._a[qe],e._meridiem),null!==(s=m(e).era)&&(e._a[Ue]=e._locale.erasConvertYear(s,e._a[Ue])),zn(e),xn(e)}else In(e);else Ln(e)}function Vn(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function Yn(e){var t,n,r,i,o,a,s=!1;if(0===e._f.length)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ithis?this:e:y()}));function Jn(e,t){var n,r;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Kn();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _r(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e,t={};return w(t,this),(t=Gn(t))._a?(e=t._isUTC?p(t._a):Kn(t._a),this._isDSTShifted=this.isValid()&&cr(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function kr(){return!!this.isValid()&&!this._isUTC}function Sr(){return!!this.isValid()&&this._isUTC}function Mr(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Cr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Tr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Dr(e,t){var n,r,i,o=e,a=null;return sr(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(o={},t?o[t]=+e:o.milliseconds=+e):(a=Cr.exec(e))?(n="-"===a[1]?-1:1,o={y:0,d:ue(a[Ge])*n,h:ue(a[qe])*n,m:ue(a[$e])*n,s:ue(a[Ke])*n,ms:ue(lr(1e3*a[Ze]))*n}):(a=Tr.exec(e))?(n="-"===a[1]?-1:1,o={y:Lr(a[2],n),M:Lr(a[3],n),w:Lr(a[4],n),d:Lr(a[5],n),h:Lr(a[6],n),m:Lr(a[7],n),s:Lr(a[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=Ar(Kn(o.from),Kn(o.to)),(o={}).ms=i.milliseconds,o.M=i.months),r=new ar(o),sr(e)&&s(e,"_locale")&&(r._locale=e._locale),sr(e)&&s(e,"_isValid")&&(r._isValid=e._isValid),r}function Lr(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Pr(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Ar(e,t){var n;return e.isValid()&&t.isValid()?(t=fr(t,e),e.isBefore(t)?n=Pr(e,t):((n=Pr(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Or(e,t){return function(n,r){var i;return null===r||isNaN(+r)||(D(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),Nr(this,Dr(n,r),e),this}}function Nr(e,t,n,i){var o=t._milliseconds,a=lr(t._days),s=lr(t._months);e.isValid()&&(i=null==i||i,s&&ut(e,fe(e,"Month")+s*n),a&&pe(e,"Date",fe(e,"Date")+a*n),o&&e._d.setTime(e._d.valueOf()+o*n),i&&r.updateOffset(e,a||s))}Dr.fn=ar.prototype,Dr.invalid=or;var Fr=Or(1,"add"),Ir=Or(-1,"subtract");function Rr(e){return"string"==typeof e||e instanceof String}function Wr(e){return k(e)||d(e)||Rr(e)||u(e)||zr(e)||Er(e)||null==e}function Er(e){var t,n,r=a(e)&&!l(e),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;tn.valueOf():n.valueOf()9999?Y(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):L(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",Y(n,"Z")):Y(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ei(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r,i="moment",o="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=o+'[")]',this.format(e+t+n+r)}function ti(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=Y(this,e);return this.localeData().postformat(t)}function ni(e,t){return this.isValid()&&(k(e)&&e.isValid()||Kn(e).isValid())?Dr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ri(e){return this.from(Kn(),e)}function ii(e,t){return this.isValid()&&(k(e)&&e.isValid()||Kn(e).isValid())?Dr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oi(e){return this.to(Kn(),e)}function ai(e){var t;return void 0===e?this._locale._abbr:(null!=(t=yn(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var si=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function li(){return this._locale}var ci=1e3,ui=60*ci,di=60*ui,hi=3506328*di;function fi(e,t){return(e%t+t)%t}function pi(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-hi:new Date(e,t,n).valueOf()}function gi(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hi:Date.UTC(e,t,n)}function mi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gi:pi,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fi(t+(this._isUTC?0:this.utcOffset()*ui),di);break;case"minute":t=this._d.valueOf(),t-=fi(t,ui);break;case"second":t=this._d.valueOf(),t-=fi(t,ci)}return this._d.setTime(t),r.updateOffset(this,!0),this}function vi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gi:pi,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=di-fi(t+(this._isUTC?0:this.utcOffset()*ui),di)-1;break;case"minute":t=this._d.valueOf(),t+=ui-fi(t,ui)-1;break;case"second":t=this._d.valueOf(),t+=ci-fi(t,ci)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function yi(){return this._d.valueOf()-6e4*(this._offset||0)}function bi(){return Math.floor(this.valueOf()/1e3)}function xi(){return new Date(this.valueOf())}function wi(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function _i(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function ki(){return this.isValid()?this.toISOString():null}function Si(){return v(this)}function Mi(){return f({},m(this))}function Ci(){return m(this).overflow}function Ti(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Di(e,t){var n,i,o,a=this._eras||yn("en")._eras;for(n=0,i=a.length;n=0)return l[r]}function Pi(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Ai(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e(o=St(e,r,i))&&(t=o),Xi.call(this,e,t,n,r,i))}function Xi(e,t,n,r,i){var o=_t(e,t,n,r,i),a=xt(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ji(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),Ie("N",Ei),Ie("NN",Ei),Ie("NNN",Ei),Ie("NNNN",zi),Ie("NNNNN",Hi),He(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?m(n).era=i:m(n).invalidEra=e})),Ie("y",Le),Ie("yy",Le),Ie("yyy",Le),Ie("yyyy",Le),Ie("yo",Bi),He(["y","yy","yyy","yyyy"],Ue),He(["yo"],(function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ue]=n._locale.eraYearOrdinalParse(e,i):t[Ue]=parseInt(e,10)})),H(0,["gg",2],0,(function(){return this.weekYear()%100})),H(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Yi("gggg","weekYear"),Yi("ggggg","weekYear"),Yi("GGGG","isoWeekYear"),Yi("GGGGG","isoWeekYear"),ne("weekYear","gg"),ne("isoWeekYear","GG"),ae("weekYear",1),ae("isoWeekYear",1),Ie("G",Pe),Ie("g",Pe),Ie("GG",ke,be),Ie("gg",ke,be),Ie("GGGG",Te,we),Ie("gggg",Te,we),Ie("GGGGG",De,_e),Ie("ggggg",De,_e),Be(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=ue(e)})),Be(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),H("Q",0,"Qo","quarter"),ne("quarter","Q"),ae("quarter",7),Ie("Q",ye),He("Q",(function(e,t){t[je]=3*(ue(e)-1)})),H("D",["DD",2],"Do","date"),ne("date","D"),ae("date",9),Ie("D",ke),Ie("DD",ke,be),Ie("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),He(["D","DD"],Ge),He("Do",(function(e,t){t[Ge]=ue(e.match(ke)[0])}));var Qi=de("Date",!0);function eo(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}H("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),ae("dayOfYear",4),Ie("DDD",Ce),Ie("DDDD",xe),He(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=ue(e)})),H("m",["mm",2],0,"minute"),ne("minute","m"),ae("minute",14),Ie("m",ke),Ie("mm",ke,be),He(["m","mm"],$e);var to=de("Minutes",!1);H("s",["ss",2],0,"second"),ne("second","s"),ae("second",15),Ie("s",ke),Ie("ss",ke,be),He(["s","ss"],Ke);var no,ro,io=de("Seconds",!1);for(H("S",0,0,(function(){return~~(this.millisecond()/100)})),H(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),H(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),H(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),H(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),H(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),H(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),ne("millisecond","ms"),ae("millisecond",16),Ie("S",Ce,ye),Ie("SS",Ce,be),Ie("SSS",Ce,xe),no="SSSS";no.length<=9;no+="S")Ie(no,Le);function oo(e,t){t[Ze]=ue(1e3*("0."+e))}for(no="S";no.length<=9;no+="S")He(no,oo);function ao(){return this._isUTC?"UTC":""}function so(){return this._isUTC?"Coordinated Universal Time":""}ro=de("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var lo=_.prototype;function co(e){return Kn(1e3*e)}function uo(){return Kn.apply(null,arguments).parseZone()}function ho(e){return e}lo.add=Fr,lo.calendar=Vr,lo.clone=Yr,lo.diff=Zr,lo.endOf=vi,lo.format=ti,lo.from=ni,lo.fromNow=ri,lo.to=ii,lo.toNow=oi,lo.get=ge,lo.invalidAt=Ci,lo.isAfter=Ur,lo.isBefore=jr,lo.isBetween=Gr,lo.isSame=qr,lo.isSameOrAfter=$r,lo.isSameOrBefore=Kr,lo.isValid=Si,lo.lang=si,lo.locale=ai,lo.localeData=li,lo.max=Xn,lo.min=Zn,lo.parsingFlags=Mi,lo.set=me,lo.startOf=mi,lo.subtract=Ir,lo.toArray=wi,lo.toObject=_i,lo.toDate=xi,lo.toISOString=Qr,lo.inspect=ei,"undefined"!=typeof Symbol&&null!=Symbol.for&&(lo[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),lo.toJSON=ki,lo.toString=Jr,lo.unix=bi,lo.valueOf=yi,lo.creationData=Ti,lo.eraName=Ai,lo.eraNarrow=Oi,lo.eraAbbr=Ni,lo.eraYear=Fi,lo.year=vt,lo.isLeapYear=yt,lo.weekYear=Ui,lo.isoWeekYear=ji,lo.quarter=lo.quarters=Ji,lo.month=dt,lo.daysInMonth=ht,lo.week=lo.weeks=Lt,lo.isoWeek=lo.isoWeeks=Pt,lo.weeksInYear=$i,lo.weeksInWeekYear=Ki,lo.isoWeeksInYear=Gi,lo.isoWeeksInISOWeekYear=qi,lo.date=Qi,lo.day=lo.days=jt,lo.weekday=Gt,lo.isoWeekday=qt,lo.dayOfYear=eo,lo.hour=lo.hours=on,lo.minute=lo.minutes=to,lo.second=lo.seconds=io,lo.millisecond=lo.milliseconds=ro,lo.utcOffset=gr,lo.utc=vr,lo.local=yr,lo.parseZone=br,lo.hasAlignedHourOffset=xr,lo.isDST=wr,lo.isLocal=kr,lo.isUtcOffset=Sr,lo.isUtc=Mr,lo.isUTC=Mr,lo.zoneAbbr=ao,lo.zoneName=so,lo.dates=M("dates accessor is deprecated. Use date instead.",Qi),lo.months=M("months accessor is deprecated. Use month instead",dt),lo.years=M("years accessor is deprecated. Use year instead",vt),lo.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mr),lo.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_r);var fo=O.prototype;function po(e,t,n,r){var i=yn(),o=p().set(r,t);return i[n](o,e)}function go(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return po(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=po(e,r,n,"month");return i}function mo(e,t,n,r){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var i,o=yn(),a=e?o._week.dow:0,s=[];if(null!=n)return po(t,(n+a)%7,r,"day");for(i=0;i<7;i++)s[i]=po(t,(i+a)%7,r,"day");return s}function vo(e,t){return go(e,t,"months")}function yo(e,t){return go(e,t,"monthsShort")}function bo(e,t,n){return mo(e,t,n,"weekdays")}function xo(e,t,n){return mo(e,t,n,"weekdaysShort")}function wo(e,t,n){return mo(e,t,n,"weekdaysMin")}fo.calendar=F,fo.longDateFormat=G,fo.invalidDate=$,fo.ordinal=X,fo.preparse=ho,fo.postformat=ho,fo.relativeTime=Q,fo.pastFuture=ee,fo.set=P,fo.eras=Di,fo.erasParse=Li,fo.erasConvertYear=Pi,fo.erasAbbrRegex=Ri,fo.erasNameRegex=Ii,fo.erasNarrowRegex=Wi,fo.months=at,fo.monthsShort=st,fo.monthsParse=ct,fo.monthsRegex=pt,fo.monthsShortRegex=ft,fo.week=Mt,fo.firstDayOfYear=Dt,fo.firstDayOfWeek=Tt,fo.weekdays=Ht,fo.weekdaysMin=Vt,fo.weekdaysShort=Bt,fo.weekdaysParse=Ut,fo.weekdaysRegex=$t,fo.weekdaysShortRegex=Kt,fo.weekdaysMinRegex=Zt,fo.isPM=nn,fo.meridiem=an,gn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===ue(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=M("moment.lang is deprecated. Use moment.locale instead.",gn),r.langData=M("moment.langData is deprecated. Use moment.localeData instead.",yn);var _o=Math.abs;function ko(){var e=this._data;return this._milliseconds=_o(this._milliseconds),this._days=_o(this._days),this._months=_o(this._months),e.milliseconds=_o(e.milliseconds),e.seconds=_o(e.seconds),e.minutes=_o(e.minutes),e.hours=_o(e.hours),e.months=_o(e.months),e.years=_o(e.years),this}function So(e,t,n,r){var i=Dr(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Mo(e,t){return So(this,e,t,1)}function Co(e,t){return So(this,e,t,-1)}function To(e){return e<0?Math.floor(e):Math.ceil(e)}function Do(){var e,t,n,r,i,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*To(Po(s)+a),a=0,s=0),l.milliseconds=o%1e3,e=ce(o/1e3),l.seconds=e%60,t=ce(e/60),l.minutes=t%60,n=ce(t/60),l.hours=n%24,a+=ce(n/24),s+=i=ce(Lo(a)),a-=To(Po(i)),r=ce(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function Lo(e){return 4800*e/146097}function Po(e){return 146097*e/4800}function Ao(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=re(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Lo(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Po(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function Oo(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ue(this._months/12):NaN}function No(e){return function(){return this.as(e)}}var Fo=No("ms"),Io=No("s"),Ro=No("m"),Wo=No("h"),Eo=No("d"),zo=No("w"),Ho=No("M"),Bo=No("Q"),Vo=No("y");function Yo(){return Dr(this)}function Uo(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function jo(e){return function(){return this.isValid()?this._data[e]:NaN}}var Go=jo("milliseconds"),qo=jo("seconds"),$o=jo("minutes"),Ko=jo("hours"),Zo=jo("days"),Xo=jo("months"),Jo=jo("years");function Qo(){return ce(this.days()/7)}var ea=Math.round,ta={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function ra(e,t,n,r){var i=Dr(e).abs(),o=ea(i.as("s")),a=ea(i.as("m")),s=ea(i.as("h")),l=ea(i.as("d")),c=ea(i.as("M")),u=ea(i.as("w")),d=ea(i.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=r,na.apply(null,h)}function ia(e){return void 0===e?ea:"function"==typeof e&&(ea=e,!0)}function oa(e,t){return void 0!==ta[e]&&(void 0===t?ta[e]:(ta[e]=t,"s"===e&&(ta.ss=t-1),!0))}function aa(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,o=ta;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(o=Object.assign({},ta,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),r=ra(this,!i,o,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)}var sa=Math.abs;function la(e){return(e>0)-(e<0)||+e}function ca(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,o,a,s,l=sa(this._milliseconds)/1e3,c=sa(this._days),u=sa(this._months),d=this.asSeconds();return d?(e=ce(l/60),t=ce(e/60),l%=60,e%=60,n=ce(u/12),u%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",o=la(this._months)!==la(d)?"-":"",a=la(this._days)!==la(d)?"-":"",s=la(this._milliseconds)!==la(d)?"-":"",i+"P"+(n?o+n+"Y":"")+(u?o+u+"M":"")+(c?a+c+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var ua=ar.prototype;return ua.isValid=ir,ua.abs=ko,ua.add=Mo,ua.subtract=Co,ua.as=Ao,ua.asMilliseconds=Fo,ua.asSeconds=Io,ua.asMinutes=Ro,ua.asHours=Wo,ua.asDays=Eo,ua.asWeeks=zo,ua.asMonths=Ho,ua.asQuarters=Bo,ua.asYears=Vo,ua.valueOf=Oo,ua._bubble=Do,ua.clone=Yo,ua.get=Uo,ua.milliseconds=Go,ua.seconds=qo,ua.minutes=$o,ua.hours=Ko,ua.days=Zo,ua.weeks=Qo,ua.months=Xo,ua.years=Jo,ua.humanize=aa,ua.toISOString=ca,ua.toString=ca,ua.toJSON=ca,ua.locale=ai,ua.localeData=li,ua.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ca),ua.lang=si,H("X",0,0,"unix"),H("x",0,0,"valueOf"),Ie("x",Pe),Ie("X",Ne),He("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),He("x",(function(e,t,n){n._d=new Date(ue(e))})), +(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const et={};class nt extends q{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,n)=>t.reduceRight(((t,n)=>Array.isArray(n)?e(n,t):(t.add(n),t)),n),n=e(t,new Set),r=[];n.forEach((t=>r.unshift(t))),this._styles=r}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!X){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return new Q(String(e),J)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?X?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==et&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return et}}nt.finalized=!0,nt.render=(t,e,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const i=r.scopeName,o=I.has(e),a=z&&11===e.nodeType&&!!e.host,s=a&&!V.has(i),l=s?document.createDocumentFragment():e;if(((t,e,r)=>{let i=I.get(e);void 0===i&&(n(e,e.firstChild),I.set(e,i=new C(Object.assign({templateFactory:N},r))),i.appendInto(e)),i.setValue(t),i.commit()})(t,l,Object.assign({templateFactory:H(i)},r)),s){const t=I.get(l);I.delete(l);const r=t.value instanceof y?t.value.template:void 0;Y(i,l,r),n(e,e.firstChild),e.appendChild(l),I.set(e,t)}!o&&a&&window.ShadyCSS.styleElement(e.host)};const rt={error:"fas fa-exclamation-circle",warning:"fas fa-exclamation-triangle",success:"fas fa-check-circle",info:"fas fa-info"};function it(){(null===document||void 0===document?void 0:document.querySelector("pb-messages")).fetchMessages()}let ot=class extends nt{constructor(){super(...arguments),this.url="",this.messages=[]}createRenderRoot(){return this}firstUpdated(){this.fetchMessages()}fetchMessages(){return fetch(this.url).then((t=>t.json())).then((t=>this.messages=t)).then((t=>{const e=this.querySelector(".pf-c-alert-group");t.forEach((t=>{const n=this.renderMessage(t);e.appendChild(n)}))}))}renderMessage(t){const e="pb-message"+Math.random().toString(36).substr(2,9);const n=document.createElement("template");return n.innerHTML=`
    • \n
      \n
      \n \n
      \n

      \n ${t.message}\n

      \n
      \n
    • `,setTimeout((()=>{var t;null===(t=this.querySelector("#"+e))||void 0===t||t.remove()}),1500),n.content.firstChild}render(){return W`
        `}};t([Z()],ot.prototype,"url",void 0),t([Z()],ot.prototype,"messages",void 0),ot=t([$("pb-messages")],ot);const at=["pf-m-progress","pf-m-in-progress"];let st=class extends nt{constructor(){var t;super(),this.url="",this.isRunning=!1,null===(t=this.querySelector("button"))||void 0===t||t.addEventListener("click",(t=>this.callAction()))}setLoading(){this.isRunning=!0,this.classList.add(...at)}setDone(t){this.isRunning=!1,this.classList.remove(...at),this.classList.replace("pf-m-primary",t),it(),setTimeout((()=>{this.classList.replace(t,"pf-m-primary")}),1e3)}callAction(){if(!0===this.isRunning)return;this.setLoading();const t=function(t){let e=null;if(document.cookie&&""!==document.cookie){const n=document.cookie.split(";");for(let r=0;rt.json())).then((t=>{this.setDone("pf-m-success")})).catch((()=>{this.setDone("pf-m-danger")}))}render(){return W``}};t([Z()],st.prototype,"url",void 0),st=t([$("pb-action-button")],st);let lt=class extends nt{constructor(){super(),this.paths=[],this.activePath=window.location.hash.slice(1,1/0),window.addEventListener("hashchange",(t=>{this.activePath=window.location.hash.slice(1,1/0)})),this.querySelectorAll(".pf-c-nav__link").forEach((t=>{var e;let n=null===(e=t.attributes.getNamedItem("pb-url-prefix"))||void 0===e?void 0:e.value;if(!n){const e=new URL(t.href);if(""===e.hash)return void console.log("Ignoring "+t);n=`^${e.hash.slice(1,1/0)}$`}const r=RegExp(n);this.paths.push({anchor:t,match:r})}))}render(){return this.paths.forEach((t=>{t.match.exec(this.activePath)?t.anchor.classList.add("pf-m-current"):t.anchor.classList.remove("pf-m-current")})),W``}};t([Z()],lt.prototype,"activePath",void 0),lt=t([$("pb-admin-sidebar")],lt);const ut=new CSSStyleSheet;ut.replaceSync(".pf-l-bullseye {\n --pf-l-bullseye--Padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: var(--pf-l-bullseye--Padding);\n margin: 0; }\n");const ct=new CSSStyleSheet;ct.replaceSync('.pf-c-spinner {\n --pf-c-spinner--AnimationDuration: 1.5s;\n --pf-c-spinner--AnimationTimingFunction: cubic-bezier(.77, .005, .315, 1);\n --pf-c-spinner--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner--stroke-width-multiplier: .1;\n --pf-c-spinner--stroke-width: calc(var(--pf-c-spinner--diameter) * var(--pf-c-spinner--stroke-width-multiplier));\n --pf-c-spinner--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Color: var(--pf-global--primary-color--100);\n --pf-c-spinner--m-sm--diameter: var(--pf-global--icon--FontSize--sm);\n --pf-c-spinner--m-md--diameter: var(--pf-global--icon--FontSize--md);\n --pf-c-spinner--m-lg--diameter: var(--pf-global--icon--FontSize--lg);\n --pf-c-spinner--m-xl--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner__clipper--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__clipper--after--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowSpreadRadius: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__lead-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__ball--after--Width: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__ball--after--Height: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__tail-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n position: relative;\n display: inline-block;\n width: var(--pf-c-spinner--Width);\n height: var(--pf-c-spinner--Height);\n text-align: left;\n animation: pf-animation-spinner-parent calc(var(--pf-c-spinner--AnimationDuration) * 2) var(--pf-c-spinner--AnimationTimingFunction) infinite; }\n .pf-c-spinner.pf-m-sm {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-sm--diameter); }\n .pf-c-spinner.pf-m-md {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-md--diameter); }\n .pf-c-spinner.pf-m-lg {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-lg--diameter); }\n .pf-c-spinner.pf-m-xl {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-xl--diameter); }\n\n@keyframes pf-animation-spinner-parent {\n 0% {\n transform: rotate(0deg); }\n 50% {\n transform: rotate(-540deg); }\n 100% {\n transform: rotate(-1080deg); } }\n\n.pf-c-spinner__clipper {\n position: absolute;\n width: var(--pf-c-spinner__clipper--Width);\n height: var(--pf-c-spinner__clipper--Height);\n clip-path: inset(0 0 50% 50%);\n animation: pf-animation-spinner__clipper var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(-270deg); } }\n\n.pf-c-spinner__clipper::after {\n position: absolute;\n width: var(--pf-c-spinner__clipper--after--Width);\n height: var(--pf-c-spinner__clipper--after--Height);\n clip-path: inset(0 0 0 50%);\n content: "";\n border-radius: 50%;\n box-shadow: inset 0 0 0 var(--pf-c-spinner__clipper--after--BoxShadowSpreadRadius) var(--pf-c-spinner__clipper--after--BoxShadowColor);\n animation: pf-animation-spinner__clipper-after var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper-after {\n 0% {\n transform: rotate(90deg); }\n 100% {\n transform: rotate(-180deg); } }\n\n.pf-c-spinner__lead-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__lead-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__lead-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__lead-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__lead-ball {\n 0% {\n transform: rotate(0deg); }\n 34% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n\n.pf-c-spinner__tail-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__tail-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__tail-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__tail-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__tail-ball {\n 0% {\n transform: rotate(0deg); }\n 67.5% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n');let dt=class extends nt{constructor(){super(),this.loading=!1,this.loadContent(),window.addEventListener("hashchange",(t=>this.loadContent()))}set defaultUrl(t){""===window.location.hash&&void 0!==t&&(window.location.hash="#"+t)}static get styles(){return[tt`:host{position:relative}:host .pf-l-bullseye{position:absolute;height:100%;width:100%;top:0;left:0}`,ut,ct]}loadContent(){let t=window.location.hash.slice(1,1/0);""!==t&&(this.loading=!0,fetch(t).then((t=>t.text())).then((t=>{this.querySelector("[slot=body]").innerHTML=t})).then((()=>{this.querySelectorAll("a:not(.pb-root-link)").forEach((t=>{if(""!==t.href)try{const e=new URL(t.href),n=e.search||"";t.href=`#${e.pathname}${n}`}catch(e){t.href="#"+t.href}})),this.querySelectorAll("[role=pb-refresh]").forEach((t=>{t.addEventListener("click",(t=>{this.loadContent()}))})),this.loading=!1})))}render(){return W`${this.loading?W`
        `:""}`}};t([Z()],dt.prototype,"defaultUrl",null),t([Z()],dt.prototype,"loading",void 0),dt=t([$("pb-admin-shell")],dt);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function ht(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function ft(t,e){return t(e={exports:{}},e.exports),e.exports}var pt=ft((function(t,e){t.exports=function(){var e,n;function r(){return e.apply(null,arguments)}function i(t){e=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function l(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(s(t,e))return!1;return!0}function u(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function d(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var n,r=[];for(n=0;n>>0;for(e=0;e0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,W=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},z={};function H(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(z[t]=i),e&&(z[e[0]]=function(){return I(i.apply(this,arguments),e[1],e[2])}),n&&(z[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function B(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function V(t){var e,n,r=t.match(R);for(e=0,n=r.length;e=0&&W.test(t);)t=t.replace(W,r),W.lastIndex=0,n-=1;return t}var j={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"};function G(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(R).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])}var q="Invalid date";function $(){return this._invalidDate}var K="%d",Z=/\d{1,2}/;function X(t){return this._ordinal.replace("%d",t)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(t,e,n,r){var i=this._relativeTime[n];return L(i)?i(t,e,n,r):i.replace(/%d/i,t)}function tt(t,e){var n=this._relativeTime[t>0?"future":"past"];return L(n)?n(e):n.replace(/%s/i,e)}var et={};function nt(t,e){var n=t.toLowerCase();et[n]=et[n+"s"]=et[e]=t}function rt(t){return"string"==typeof t?et[t]||et[t.toLowerCase()]:void 0}function it(t){var e,n,r={};for(n in t)s(t,n)&&(e=rt(n))&&(r[e]=t[n]);return r}var ot={};function at(t,e){ot[t]=e}function st(t){var e,n=[];for(e in t)s(t,e)&&n.push({unit:e,priority:ot[e]});return n.sort((function(t,e){return t.priority-e.priority})),n}function lt(t){return t%4==0&&t%100!=0||t%400==0}function ut(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function ct(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=ut(e)),n}function dt(t,e){return function(n){return null!=n?(pt(this,t,n),r.updateOffset(this,e),this):ft(this,t)}}function ft(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function pt(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&<(t.year())&&1===t.month()&&29===t.date()?(n=ct(n),t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),te(n,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function gt(t){return L(this[t=rt(t)])?this[t]():this}function mt(t,e){if("object"==typeof t){var n,r=st(t=it(t));for(n=0;n68?1900:2e3)};var ve=dt("FullYear",!0);function ye(){return lt(this.year())}function be(t,e,n,r,i,o,a){var s;return t<100&&t>=0?(s=new Date(t+400,e,n,r,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,r,i,o,a),s}function xe(t){var e,n;return t<100&&t>=0?((n=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function we(t,e,n){var r=7+e-n;return-(7+xe(t,0,r).getUTCDay()-e)%7+r-1}function _e(t,e,n,r,i){var o,a,s=1+7*(e-1)+(7+n-r)%7+we(t,r,i);return s<=0?a=me(o=t-1)+s:s>me(t)?(o=t+1,a=s-me(t)):(o=t,a=s),{year:o,dayOfYear:a}}function ke(t,e,n){var r,i,o=we(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return a<1?r=a+Se(i=t.year()-1,e,n):a>Se(t.year(),e,n)?(r=a-Se(t.year(),e,n),i=t.year()+1):(i=t.year(),r=a),{week:r,year:i}}function Se(t,e,n){var r=we(t,e,n),i=we(t+1,e,n);return(me(t)-r+i)/7}function Me(t){return ke(t,this._week.dow,this._week.doy).week}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),nt("week","w"),nt("isoWeek","W"),at("week",5),at("isoWeek",5),It("w",kt),It("ww",kt,bt),It("W",kt),It("WW",kt,bt),Bt(["w","ww","W","WW"],(function(t,e,n,r){e[r.substr(0,1)]=ct(t)}));var Ce={dow:0,doy:6};function Te(){return this._week.dow}function De(){return this._week.doy}function Le(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Pe(t){var e=ke(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Ae(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function Oe(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ne(t,e){return t.slice(e,7).concat(t.slice(0,e))}H("d",0,"do","day"),H("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),H("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),H("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),nt("day","d"),nt("weekday","e"),nt("isoWeekday","E"),at("day",11),at("weekday",11),at("isoWeekday",11),It("d",kt),It("e",kt),It("E",kt),It("dd",(function(t,e){return e.weekdaysMinRegex(t)})),It("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),It("dddd",(function(t,e){return e.weekdaysRegex(t)})),Bt(["dd","ddd","dddd"],(function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:m(n).invalidWeekday=t})),Bt(["d","e","E"],(function(t,e,n,r){e[r]=ct(t)}));var Fe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ie="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Re="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),We=Ft,Ee=Ft,ze=Ft;function He(t,e){var n=o(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ne(n,this._week.dow):t?n[t.day()]:n}function Be(t){return!0===t?Ne(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Ve(t){return!0===t?Ne(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Ye(t,e,n){var r,i,o,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(i=Yt.call(this._weekdaysParse,a))?i:null:"ddd"===e?-1!==(i=Yt.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Yt.call(this._minWeekdaysParse,a))?i:null:"dddd"===e?-1!==(i=Yt.call(this._weekdaysParse,a))||-1!==(i=Yt.call(this._shortWeekdaysParse,a))||-1!==(i=Yt.call(this._minWeekdaysParse,a))?i:null:"ddd"===e?-1!==(i=Yt.call(this._shortWeekdaysParse,a))||-1!==(i=Yt.call(this._weekdaysParse,a))||-1!==(i=Yt.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Yt.call(this._minWeekdaysParse,a))||-1!==(i=Yt.call(this._weekdaysParse,a))||-1!==(i=Yt.call(this._shortWeekdaysParse,a))?i:null}function Ue(t,e,n){var r,i,o;if(this._weekdaysParseExact)return Ye.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function je(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ae(t,this.localeData()),this.add(t-e,"d")):e}function Ge(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 qe(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Oe(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function $e(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=We),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ke(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ze(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ze),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xe(){function t(t,e){return e.length-t.length}var e,n,r,i,o,a=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=p([2e3,1]).day(e),r=Et(this.weekdaysMin(n,"")),i=Et(this.weekdaysShort(n,"")),o=Et(this.weekdays(n,"")),a.push(r),s.push(i),l.push(o),u.push(r),u.push(i),u.push(o);a.sort(t),s.sort(t),l.sort(t),u.sort(t),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Je(){return this.hours()%12||12}function Qe(){return this.hours()||24}function tn(t,e){H(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function en(t,e){return e._meridiemParse}function nn(t){return"p"===(t+"").toLowerCase().charAt(0)}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Je),H("k",["kk",2],0,Qe),H("hmm",0,0,(function(){return""+Je.apply(this)+I(this.minutes(),2)})),H("hmmss",0,0,(function(){return""+Je.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)})),H("Hmm",0,0,(function(){return""+this.hours()+I(this.minutes(),2)})),H("Hmmss",0,0,(function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)})),tn("a",!0),tn("A",!1),nt("hour","h"),at("hour",13),It("a",en),It("A",en),It("H",kt),It("h",kt),It("k",kt),It("HH",kt,bt),It("hh",kt,bt),It("kk",kt,bt),It("hmm",St),It("hmmss",Mt),It("Hmm",St),It("Hmmss",Mt),Ht(["H","HH"],qt),Ht(["k","kk"],(function(t,e,n){var r=ct(t);e[qt]=24===r?0:r})),Ht(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),Ht(["h","hh"],(function(t,e,n){e[qt]=ct(t),m(n).bigHour=!0})),Ht("hmm",(function(t,e,n){var r=t.length-2;e[qt]=ct(t.substr(0,r)),e[$t]=ct(t.substr(r)),m(n).bigHour=!0})),Ht("hmmss",(function(t,e,n){var r=t.length-4,i=t.length-2;e[qt]=ct(t.substr(0,r)),e[$t]=ct(t.substr(r,2)),e[Kt]=ct(t.substr(i)),m(n).bigHour=!0})),Ht("Hmm",(function(t,e,n){var r=t.length-2;e[qt]=ct(t.substr(0,r)),e[$t]=ct(t.substr(r))})),Ht("Hmmss",(function(t,e,n){var r=t.length-4,i=t.length-2;e[qt]=ct(t.substr(0,r)),e[$t]=ct(t.substr(r,2)),e[Kt]=ct(t.substr(i))}));var rn=/[ap]\.?m?\.?/i,on=dt("Hours",!0);function an(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var sn,ln={calendar:N,longDateFormat:j,invalidDate:q,ordinal:K,dayOfMonthOrdinalParse:Z,relativeTime:J,months:ee,monthsShort:ne,week:Ce,weekdays:Fe,weekdaysMin:Re,weekdaysShort:Ie,meridiemParse:rn},un={},cn={};function dn(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n0;){if(r=pn(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&dn(i,n)>=e-1)break;e--}o++}return sn}function pn(e){var n=null;if(void 0===un[e]&&t&&t.exports)try{n=sn._abbr,ht(),gn(n)}catch(t){un[e]=null}return un[e]}function gn(t,e){var n;return t&&((n=u(e)?yn(t):mn(t,e))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),sn._abbr}function mn(t,e){if(null!==e){var n,r=ln;if(e.abbr=t,null!=un[t])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=un[t]._config;else if(null!=e.parentLocale)if(null!=un[e.parentLocale])r=un[e.parentLocale]._config;else{if(null==(n=pn(e.parentLocale)))return cn[e.parentLocale]||(cn[e.parentLocale]=[]),cn[e.parentLocale].push({name:t,config:e}),null;r=n._config}return un[t]=new O(A(r,e)),cn[t]&&cn[t].forEach((function(t){mn(t.name,t.config)})),gn(t),un[t]}return delete un[t],null}function vn(t,e){if(null!=e){var n,r,i=ln;null!=un[t]&&null!=un[t].parentLocale?un[t].set(A(un[t]._config,e)):(null!=(r=pn(t))&&(i=r._config),e=A(i,e),null==r&&(e.abbr=t),(n=new O(e)).parentLocale=un[t],un[t]=n),gn(t)}else null!=un[t]&&(null!=un[t].parentLocale?(un[t]=un[t].parentLocale,t===gn()&&gn(t)):null!=un[t]&&delete un[t]);return un[t]}function yn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return sn;if(!o(t)){if(e=pn(t))return e;t=[t]}return fn(t)}function bn(){return C(un)}function xn(t){var e,n=t._a;return n&&-2===m(t).overflow&&(e=n[jt]<0||n[jt]>11?jt:n[Gt]<1||n[Gt]>te(n[Ut],n[jt])?Gt:n[qt]<0||n[qt]>24||24===n[qt]&&(0!==n[$t]||0!==n[Kt]||0!==n[Zt])?qt:n[$t]<0||n[$t]>59?$t:n[Kt]<0||n[Kt]>59?Kt:n[Zt]<0||n[Zt]>999?Zt:-1,m(t)._overflowDayOfYear&&(eGt)&&(e=Gt),m(t)._overflowWeeks&&-1===e&&(e=Xt),m(t)._overflowWeekday&&-1===e&&(e=Jt),m(t).overflow=e),t}var wn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_n=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Mn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cn=/^\/?Date\((-?\d+)/i,Tn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ln(t){var e,n,r,i,o,a,s=t._i,l=wn.exec(s)||_n.exec(s);if(l){for(m(t).iso=!0,e=0,n=Sn.length;eme(o)||0===t._dayOfYear)&&(m(t)._overflowDayOfYear=!0),n=xe(o,0,t._dayOfYear),t._a[jt]=n.getUTCMonth(),t._a[Gt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[qt]&&0===t._a[$t]&&0===t._a[Kt]&&0===t._a[Zt]&&(t._nextDay=!0,t._a[qt]=0),t._d=(t._useUTC?xe:be).apply(null,a),i=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[qt]=24),t._w&&void 0!==t._w.d&&t._w.d!==i&&(m(t).weekdayMismatch=!0)}}function Hn(t){var e,n,r,i,o,a,s,l,u;null!=(e=t._w).GG||null!=e.W||null!=e.E?(o=1,a=4,n=Wn(e.GG,t._a[Ut],ke(Kn(),1,4).year),r=Wn(e.W,1),((i=Wn(e.E,1))<1||i>7)&&(l=!0)):(o=t._locale._week.dow,a=t._locale._week.doy,u=ke(Kn(),o,a),n=Wn(e.gg,t._a[Ut],u.year),r=Wn(e.w,u.week),null!=e.d?((i=e.d)<0||i>6)&&(l=!0):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),r<1||r>Se(n,o,a)?m(t)._overflowWeeks=!0:null!=l?m(t)._overflowWeekday=!0:(s=_e(n,r,i,o,a),t._a[Ut]=s.year,t._dayOfYear=s.dayOfYear)}function Bn(t){if(t._f!==r.ISO_8601)if(t._f!==r.RFC_2822){t._a=[],m(t).empty=!0;var e,n,i,o,a,s,l=""+t._i,u=l.length,c=0;for(i=U(t._f,t._locale).match(R)||[],e=0;e0&&m(t).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),c+=n.length),z[o]?(n?m(t).empty=!1:m(t).unusedTokens.push(o),Vt(o,n,t)):t._strict&&!n&&m(t).unusedTokens.push(o);m(t).charsLeftOver=u-c,l.length>0&&m(t).unusedInput.push(l),t._a[qt]<=12&&!0===m(t).bigHour&&t._a[qt]>0&&(m(t).bigHour=void 0),m(t).parsedDateParts=t._a.slice(0),m(t).meridiem=t._meridiem,t._a[qt]=Vn(t._locale,t._a[qt],t._meridiem),null!==(s=m(t).era)&&(t._a[Ut]=t._locale.erasConvertYear(s,t._a[Ut])),zn(t),xn(t)}else In(t);else Ln(t)}function Vn(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((r=t.isPM(n))&&e<12&&(e+=12),r||12!==e||(e=0),e):e}function Yn(t){var e,n,r,i,o,a,s=!1;if(0===t._f.length)return m(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;ithis?this:t:y()}));function Jn(t,e){var n,r;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return Kn();for(n=e[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _r(){if(!u(this._isDSTShifted))return this._isDSTShifted;var t,e={};return w(e,this),(e=Gn(e))._a?(t=e._isUTC?p(e._a):Kn(e._a),this._isDSTShifted=this.isValid()&&ur(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function kr(){return!!this.isValid()&&!this._isUTC}function Sr(){return!!this.isValid()&&this._isUTC}function Mr(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Cr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Tr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Dr(t,e){var n,r,i,o=t,a=null;return sr(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:c(t)||!isNaN(+t)?(o={},e?o[e]=+t:o.milliseconds=+t):(a=Cr.exec(t))?(n="-"===a[1]?-1:1,o={y:0,d:ct(a[Gt])*n,h:ct(a[qt])*n,m:ct(a[$t])*n,s:ct(a[Kt])*n,ms:ct(lr(1e3*a[Zt]))*n}):(a=Tr.exec(t))?(n="-"===a[1]?-1:1,o={y:Lr(a[2],n),M:Lr(a[3],n),w:Lr(a[4],n),d:Lr(a[5],n),h:Lr(a[6],n),m:Lr(a[7],n),s:Lr(a[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=Ar(Kn(o.from),Kn(o.to)),(o={}).ms=i.milliseconds,o.M=i.months),r=new ar(o),sr(t)&&s(t,"_locale")&&(r._locale=t._locale),sr(t)&&s(t,"_isValid")&&(r._isValid=t._isValid),r}function Lr(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Pr(t,e){var n={};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 Ar(t,e){var n;return t.isValid()&&e.isValid()?(e=fr(e,t),t.isBefore(e)?n=Pr(t,e):((n=Pr(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Or(t,e){return function(n,r){var i;return null===r||isNaN(+r)||(D(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),Nr(this,Dr(n,r),t),this}}function Nr(t,e,n,i){var o=e._milliseconds,a=lr(e._days),s=lr(e._months);t.isValid()&&(i=null==i||i,s&&ce(t,ft(t,"Month")+s*n),a&&pt(t,"Date",ft(t,"Date")+a*n),o&&t._d.setTime(t._d.valueOf()+o*n),i&&r.updateOffset(t,a||s))}Dr.fn=ar.prototype,Dr.invalid=or;var Fr=Or(1,"add"),Ir=Or(-1,"subtract");function Rr(t){return"string"==typeof t||t instanceof String}function Wr(t){return k(t)||d(t)||Rr(t)||c(t)||zr(t)||Er(t)||null==t}function Er(t){var e,n,r=a(t)&&!l(t),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(e=0;en.valueOf():n.valueOf()9999?Y(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):L(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",Y(n,"Z")):Y(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ti(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,n,r,i="moment",o="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),t="["+i+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=o+'[")]',this.format(t+e+n+r)}function ei(t){t||(t=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var e=Y(this,t);return this.localeData().postformat(e)}function ni(t,e){return this.isValid()&&(k(t)&&t.isValid()||Kn(t).isValid())?Dr({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ri(t){return this.from(Kn(),t)}function ii(t,e){return this.isValid()&&(k(t)&&t.isValid()||Kn(t).isValid())?Dr({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function oi(t){return this.to(Kn(),t)}function ai(t){var e;return void 0===t?this._locale._abbr:(null!=(e=yn(t))&&(this._locale=e),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var si=M("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)}));function li(){return this._locale}var ui=1e3,ci=60*ui,di=60*ci,hi=3506328*di;function fi(t,e){return(t%e+e)%e}function pi(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-hi:new Date(t,e,n).valueOf()}function gi(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-hi:Date.UTC(t,e,n)}function mi(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gi:pi,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=fi(e+(this._isUTC?0:this.utcOffset()*ci),di);break;case"minute":e=this._d.valueOf(),e-=fi(e,ci);break;case"second":e=this._d.valueOf(),e-=fi(e,ui)}return this._d.setTime(e),r.updateOffset(this,!0),this}function vi(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gi:pi,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=di-fi(e+(this._isUTC?0:this.utcOffset()*ci),di)-1;break;case"minute":e=this._d.valueOf(),e+=ci-fi(e,ci)-1;break;case"second":e=this._d.valueOf(),e+=ui-fi(e,ui)-1}return this._d.setTime(e),r.updateOffset(this,!0),this}function yi(){return this._d.valueOf()-6e4*(this._offset||0)}function bi(){return Math.floor(this.valueOf()/1e3)}function xi(){return new Date(this.valueOf())}function wi(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function _i(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function ki(){return this.isValid()?this.toISOString():null}function Si(){return v(this)}function Mi(){return f({},m(this))}function Ci(){return m(this).overflow}function Ti(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Di(t,e){var n,i,o,a=this._eras||yn("en")._eras;for(n=0,i=a.length;n=0)return l[r]}function Pi(t,e){var n=t.since<=t.until?1:-1;return void 0===e?r(t.since).year():r(t.since).year()+(e-t.offset)*n}function Ai(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t(o=Se(t,r,i))&&(e=o),Xi.call(this,t,e,n,r,i))}function Xi(t,e,n,r,i){var o=_e(t,e,n,r,i),a=xe(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ji(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),It("N",Ei),It("NN",Ei),It("NNN",Ei),It("NNNN",zi),It("NNNNN",Hi),Ht(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?m(n).era=i:m(n).invalidEra=t})),It("y",Lt),It("yy",Lt),It("yyy",Lt),It("yyyy",Lt),It("yo",Bi),Ht(["y","yy","yyy","yyyy"],Ut),Ht(["yo"],(function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Ut]=n._locale.eraYearOrdinalParse(t,i):e[Ut]=parseInt(t,10)})),H(0,["gg",2],0,(function(){return this.weekYear()%100})),H(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Yi("gggg","weekYear"),Yi("ggggg","weekYear"),Yi("GGGG","isoWeekYear"),Yi("GGGGG","isoWeekYear"),nt("weekYear","gg"),nt("isoWeekYear","GG"),at("weekYear",1),at("isoWeekYear",1),It("G",Pt),It("g",Pt),It("GG",kt,bt),It("gg",kt,bt),It("GGGG",Tt,wt),It("gggg",Tt,wt),It("GGGGG",Dt,_t),It("ggggg",Dt,_t),Bt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,r){e[r.substr(0,2)]=ct(t)})),Bt(["gg","GG"],(function(t,e,n,i){e[i]=r.parseTwoDigitYear(t)})),H("Q",0,"Qo","quarter"),nt("quarter","Q"),at("quarter",7),It("Q",yt),Ht("Q",(function(t,e){e[jt]=3*(ct(t)-1)})),H("D",["DD",2],"Do","date"),nt("date","D"),at("date",9),It("D",kt),It("DD",kt,bt),It("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),Ht(["D","DD"],Gt),Ht("Do",(function(t,e){e[Gt]=ct(t.match(kt)[0])}));var Qi=dt("Date",!0);function to(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}H("DDD",["DDDD",3],"DDDo","dayOfYear"),nt("dayOfYear","DDD"),at("dayOfYear",4),It("DDD",Ct),It("DDDD",xt),Ht(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=ct(t)})),H("m",["mm",2],0,"minute"),nt("minute","m"),at("minute",14),It("m",kt),It("mm",kt,bt),Ht(["m","mm"],$t);var eo=dt("Minutes",!1);H("s",["ss",2],0,"second"),nt("second","s"),at("second",15),It("s",kt),It("ss",kt,bt),Ht(["s","ss"],Kt);var no,ro,io=dt("Seconds",!1);for(H("S",0,0,(function(){return~~(this.millisecond()/100)})),H(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),H(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),H(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),H(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),H(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),H(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),nt("millisecond","ms"),at("millisecond",16),It("S",Ct,yt),It("SS",Ct,bt),It("SSS",Ct,xt),no="SSSS";no.length<=9;no+="S")It(no,Lt);function oo(t,e){e[Zt]=ct(1e3*("0."+t))}for(no="S";no.length<=9;no+="S")Ht(no,oo);function ao(){return this._isUTC?"UTC":""}function so(){return this._isUTC?"Coordinated Universal Time":""}ro=dt("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var lo=_.prototype;function uo(t){return Kn(1e3*t)}function co(){return Kn.apply(null,arguments).parseZone()}function ho(t){return t}lo.add=Fr,lo.calendar=Vr,lo.clone=Yr,lo.diff=Zr,lo.endOf=vi,lo.format=ei,lo.from=ni,lo.fromNow=ri,lo.to=ii,lo.toNow=oi,lo.get=gt,lo.invalidAt=Ci,lo.isAfter=Ur,lo.isBefore=jr,lo.isBetween=Gr,lo.isSame=qr,lo.isSameOrAfter=$r,lo.isSameOrBefore=Kr,lo.isValid=Si,lo.lang=si,lo.locale=ai,lo.localeData=li,lo.max=Xn,lo.min=Zn,lo.parsingFlags=Mi,lo.set=mt,lo.startOf=mi,lo.subtract=Ir,lo.toArray=wi,lo.toObject=_i,lo.toDate=xi,lo.toISOString=Qr,lo.inspect=ti,"undefined"!=typeof Symbol&&null!=Symbol.for&&(lo[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),lo.toJSON=ki,lo.toString=Jr,lo.unix=bi,lo.valueOf=yi,lo.creationData=Ti,lo.eraName=Ai,lo.eraNarrow=Oi,lo.eraAbbr=Ni,lo.eraYear=Fi,lo.year=ve,lo.isLeapYear=ye,lo.weekYear=Ui,lo.isoWeekYear=ji,lo.quarter=lo.quarters=Ji,lo.month=de,lo.daysInMonth=he,lo.week=lo.weeks=Le,lo.isoWeek=lo.isoWeeks=Pe,lo.weeksInYear=$i,lo.weeksInWeekYear=Ki,lo.isoWeeksInYear=Gi,lo.isoWeeksInISOWeekYear=qi,lo.date=Qi,lo.day=lo.days=je,lo.weekday=Ge,lo.isoWeekday=qe,lo.dayOfYear=to,lo.hour=lo.hours=on,lo.minute=lo.minutes=eo,lo.second=lo.seconds=io,lo.millisecond=lo.milliseconds=ro,lo.utcOffset=gr,lo.utc=vr,lo.local=yr,lo.parseZone=br,lo.hasAlignedHourOffset=xr,lo.isDST=wr,lo.isLocal=kr,lo.isUtcOffset=Sr,lo.isUtc=Mr,lo.isUTC=Mr,lo.zoneAbbr=ao,lo.zoneName=so,lo.dates=M("dates accessor is deprecated. Use date instead.",Qi),lo.months=M("months accessor is deprecated. Use month instead",de),lo.years=M("years accessor is deprecated. Use year instead",ve),lo.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mr),lo.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_r);var fo=O.prototype;function po(t,e,n,r){var i=yn(),o=p().set(r,e);return i[n](o,t)}function go(t,e,n){if(c(t)&&(e=t,t=void 0),t=t||"",null!=e)return po(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=po(t,r,n,"month");return i}function mo(t,e,n,r){"boolean"==typeof t?(c(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,c(e)&&(n=e,e=void 0),e=e||"");var i,o=yn(),a=t?o._week.dow:0,s=[];if(null!=n)return po(e,(n+a)%7,r,"day");for(i=0;i<7;i++)s[i]=po(e,(i+a)%7,r,"day");return s}function vo(t,e){return go(t,e,"months")}function yo(t,e){return go(t,e,"monthsShort")}function bo(t,e,n){return mo(t,e,n,"weekdays")}function xo(t,e,n){return mo(t,e,n,"weekdaysShort")}function wo(t,e,n){return mo(t,e,n,"weekdaysMin")}fo.calendar=F,fo.longDateFormat=G,fo.invalidDate=$,fo.ordinal=X,fo.preparse=ho,fo.postformat=ho,fo.relativeTime=Q,fo.pastFuture=tt,fo.set=P,fo.eras=Di,fo.erasParse=Li,fo.erasConvertYear=Pi,fo.erasAbbrRegex=Ri,fo.erasNameRegex=Ii,fo.erasNarrowRegex=Wi,fo.months=ae,fo.monthsShort=se,fo.monthsParse=ue,fo.monthsRegex=pe,fo.monthsShortRegex=fe,fo.week=Me,fo.firstDayOfYear=De,fo.firstDayOfWeek=Te,fo.weekdays=He,fo.weekdaysMin=Ve,fo.weekdaysShort=Be,fo.weekdaysParse=Ue,fo.weekdaysRegex=$e,fo.weekdaysShortRegex=Ke,fo.weekdaysMinRegex=Ze,fo.isPM=nn,fo.meridiem=an,gn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===ct(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),r.lang=M("moment.lang is deprecated. Use moment.locale instead.",gn),r.langData=M("moment.langData is deprecated. Use moment.localeData instead.",yn);var _o=Math.abs;function ko(){var t=this._data;return this._milliseconds=_o(this._milliseconds),this._days=_o(this._days),this._months=_o(this._months),t.milliseconds=_o(t.milliseconds),t.seconds=_o(t.seconds),t.minutes=_o(t.minutes),t.hours=_o(t.hours),t.months=_o(t.months),t.years=_o(t.years),this}function So(t,e,n,r){var i=Dr(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Mo(t,e){return So(this,t,e,1)}function Co(t,e){return So(this,t,e,-1)}function To(t){return t<0?Math.floor(t):Math.ceil(t)}function Do(){var t,e,n,r,i,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*To(Po(s)+a),a=0,s=0),l.milliseconds=o%1e3,t=ut(o/1e3),l.seconds=t%60,e=ut(t/60),l.minutes=e%60,n=ut(e/60),l.hours=n%24,a+=ut(n/24),s+=i=ut(Lo(a)),a-=To(Po(i)),r=ut(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function Lo(t){return 4800*t/146097}function Po(t){return 146097*t/4800}function Ao(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if("month"===(t=rt(t))||"quarter"===t||"year"===t)switch(e=this._days+r/864e5,n=this._months+Lo(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Po(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Oo(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ct(this._months/12):NaN}function No(t){return function(){return this.as(t)}}var Fo=No("ms"),Io=No("s"),Ro=No("m"),Wo=No("h"),Eo=No("d"),zo=No("w"),Ho=No("M"),Bo=No("Q"),Vo=No("y");function Yo(){return Dr(this)}function Uo(t){return t=rt(t),this.isValid()?this[t+"s"]():NaN}function jo(t){return function(){return this.isValid()?this._data[t]:NaN}}var Go=jo("milliseconds"),qo=jo("seconds"),$o=jo("minutes"),Ko=jo("hours"),Zo=jo("days"),Xo=jo("months"),Jo=jo("years");function Qo(){return ut(this.days()/7)}var ta=Math.round,ea={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function ra(t,e,n,r){var i=Dr(t).abs(),o=ta(i.as("s")),a=ta(i.as("m")),s=ta(i.as("h")),l=ta(i.as("d")),u=ta(i.as("M")),c=ta(i.as("w")),d=ta(i.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=r,na.apply(null,h)}function ia(t){return void 0===t?ta:"function"==typeof t&&(ta=t,!0)}function oa(t,e){return void 0!==ea[t]&&(void 0===e?ea[t]:(ea[t]=e,"s"===t&&(ea.ss=e-1),!0))}function aa(t,e){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,o=ea;return"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(i=t),"object"==typeof e&&(o=Object.assign({},ea,e),null!=e.s&&null==e.ss&&(o.ss=e.s-1)),r=ra(this,!i,o,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)}var sa=Math.abs;function la(t){return(t>0)-(t<0)||+t}function ua(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,r,i,o,a,s,l=sa(this._milliseconds)/1e3,u=sa(this._days),c=sa(this._months),d=this.asSeconds();return d?(t=ut(l/60),e=ut(t/60),l%=60,t%=60,n=ut(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",o=la(this._months)!==la(d)?"-":"",a=la(this._days)!==la(d)?"-":"",s=la(this._milliseconds)!==la(d)?"-":"",i+"P"+(n?o+n+"Y":"")+(c?o+c+"M":"")+(u?a+u+"D":"")+(e||t||l?"T":"")+(e?s+e+"H":"")+(t?s+t+"M":"")+(l?s+r+"S":"")):"P0D"}var ca=ar.prototype;return ca.isValid=ir,ca.abs=ko,ca.add=Mo,ca.subtract=Co,ca.as=Ao,ca.asMilliseconds=Fo,ca.asSeconds=Io,ca.asMinutes=Ro,ca.asHours=Wo,ca.asDays=Eo,ca.asWeeks=zo,ca.asMonths=Ho,ca.asQuarters=Bo,ca.asYears=Vo,ca.valueOf=Oo,ca._bubble=Do,ca.clone=Yo,ca.get=Uo,ca.milliseconds=Go,ca.seconds=qo,ca.minutes=$o,ca.hours=Ko,ca.days=Zo,ca.weeks=Qo,ca.months=Xo,ca.years=Jo,ca.humanize=aa,ca.toISOString=ua,ca.toString=ua,ca.toJSON=ua,ca.locale=ai,ca.localeData=li,ca.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ua),ca.lang=si,H("X",0,0,"unix"),H("x",0,0,"valueOf"),It("x",Pt),It("X",Nt),Ht("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t))})),Ht("x",(function(t,e,n){n._d=new Date(ct(t))})), //! moment.js -r.version="2.29.1",i(Kn),r.fn=lo,r.min=Qn,r.max=er,r.now=tr,r.utc=p,r.unix=co,r.months=vo,r.isDate=d,r.locale=gn,r.invalid=y,r.duration=Dr,r.isMoment=k,r.weekdays=bo,r.parseZone=uo,r.localeData=yn,r.isDuration=sr,r.monthsShort=yo,r.weekdaysMin=wo,r.defineLocale=mn,r.updateLocale=vn,r.locales=bn,r.weekdaysShort=xo,r.normalizeUnits=re,r.relativeTimeRounding=ia,r.relativeTimeThreshold=oa,r.calendarFormat=Br,r.prototype=lo,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()})),ge=fe((function(e,t){ +r.version="2.29.1",i(Kn),r.fn=lo,r.min=Qn,r.max=tr,r.now=er,r.utc=p,r.unix=uo,r.months=vo,r.isDate=d,r.locale=gn,r.invalid=y,r.duration=Dr,r.isMoment=k,r.weekdays=bo,r.parseZone=co,r.localeData=yn,r.isDuration=sr,r.monthsShort=yo,r.weekdaysMin=wo,r.defineLocale=mn,r.updateLocale=vn,r.locales=bn,r.weekdaysShort=xo,r.normalizeUnits=rt,r.relativeTimeRounding=ia,r.relativeTimeThreshold=oa,r.calendarFormat=Br,r.prototype=lo,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()})),gt=ft((function(t,e){ /*! * Chart.js v2.9.4 * https://www.chartjs.org * (c) 2020 Chart.js Contributors * Released under the MIT License */ -e.exports=function(e){function t(e,t){return e(t={exports:{}},t.exports),t.exports}function n(e){return e&&e.default||e}e=e&&e.hasOwnProperty("default")?e.default:e;var r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},i=t((function(e){var t={};for(var n in r)r.hasOwnProperty(n)&&(t[r[n]]=n);var i=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var o in i)if(i.hasOwnProperty(o)){if(!("channels"in i[o]))throw new Error("missing channels property: "+o);if(!("labels"in i[o]))throw new Error("missing channel labels property: "+o);if(i[o].labels.length!==i[o].channels)throw new Error("channel and label counts mismatch: "+o);var a=i[o].channels,s=i[o].labels;delete i[o].channels,delete i[o].labels,Object.defineProperty(i[o],"channels",{value:a}),Object.defineProperty(i[o],"labels",{value:s})}function l(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}i.rgb.hsl=function(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a;return s===a?t=0:r===s?t=(i-o)/l:i===s?t=2+(o-r)/l:o===s&&(t=4+(r-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),n=(a+s)/2,[t,100*(s===a?0:n<=.5?l/(s+a):l/(2-s-a)),100*n]},i.rgb.hsv=function(e){var t,n,r,i,o,a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),d=function(e){return(c-e)/6/u+.5};return 0===u?i=o=0:(o=u/c,t=d(a),n=d(s),r=d(l),a===c?i=r-n:s===c?i=1/3+t-r:l===c&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},i.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[i.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(n,r))*100,100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},i.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-i)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-i-t)/(1-t)||0),100*t]},i.rgb.keyword=function(e){var n=t[e];if(n)return n;var i,o=1/0;for(var a in r)if(r.hasOwnProperty(a)){var s=l(e,r[a]);s.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},i.rgb.lab=function(e){var t=i.rgb.xyz(e),n=t[0],r=t[1],o=t[2];return r/=100,o/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},i.hsl.rgb=function(e){var t,n,r,i,o,a=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[o=255*l,o,o];t=2*l-(n=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[c]=255*o;return i},i.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[t,100*(0===r?2*i/(o+i):2*n/(r+n)),(r+n)/2*100]},i.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}},i.hsv.hsl=function(e){var t,n,r,i=e[0],o=e[1]/100,a=e[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(t=(2-o)*s)<=1?t:2-t)||0),100*(r/=2)]},i.hwb.rgb=function(e){var t,n,r,i,o,a,s,l=e[0]/360,c=e[1]/100,u=e[2]/100,d=c+u;switch(d>1&&(c/=d,u/=d),r=6*l-(t=Math.floor(6*l)),0!=(1&t)&&(r=1-r),i=c+r*((n=1-u)-c),t){default:case 6:case 0:o=n,a=i,s=c;break;case 1:o=i,a=n,s=c;break;case 2:o=c,a=n,s=i;break;case 3:o=c,a=i,s=n;break;case 4:o=i,a=c,s=n;break;case 5:o=n,a=c,s=i}return[255*o,255*a,255*s]},i.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},i.xyz.rgb=function(e){var t,n,r,i=e[0]/100,o=e[1]/100,a=e[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,t=(t=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},i.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},i.lab.xyz=function(e){var t,n,r,i=e[0];t=e[1]/500+(n=(i+16)/116),r=n-e[2]/200;var o=Math.pow(n,3),a=Math.pow(t,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},i.lab.lch=function(e){var t,n=e[0],r=e[1],i=e[2];return(t=360*Math.atan2(i,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+i*i),t]},i.lch.lab=function(e){var t,n=e[0],r=e[1];return t=e[2]/360*2*Math.PI,[n,r*Math.cos(t),r*Math.sin(t)]},i.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],o=1 in arguments?arguments[1]:i.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===o&&(a+=60),a},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},i.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},i.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},i.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},i.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return t=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?a/(1-s):0)]},i.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,i=0;return(r=n<.5?2*t*n:2*t*(1-n))<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},i.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},i.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var i=[0,0,0],o=t%1*6,a=o%1,s=1-a,l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},i.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},i.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},i.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},i.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=i.gray.hsv=function(e){return[0,0,e[0]]},i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}));function o(){for(var e={},t=Object.keys(i),n=t.length,r=0;r1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function h(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var r=n.length,i=0;i=0&&t<1?O(Math.round(255*t)):"")}function k(e,t){return t<1||e[3]&&e[3]<1?S(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"}function S(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function M(e,t){return t<1||e[3]&&e[3]<1?C(e,t):"rgb("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%)"}function C(e,t){return"rgba("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%, "+(t||e[3]||1)+")"}function T(e,t){return t<1||e[3]&&e[3]<1?D(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"}function D(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function L(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"}function P(e){return N[e.slice(0,3)]}function A(e,t,n){return Math.min(Math.max(t,e),n)}function O(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var N={};for(var F in p)N[p[F]]=F;var I=function(e){return e instanceof I?e:this instanceof I?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof e?(t=g.getRgba(e))?this.setValues("rgb",t):(t=g.getHsla(e))?this.setValues("hsl",t):(t=g.getHwb(e))&&this.setValues("hwb",t):"object"==typeof e&&(void 0!==(t=e).r||void 0!==t.red?this.setValues("rgb",t):void 0!==t.l||void 0!==t.lightness?this.setValues("hsl",t):void 0!==t.v||void 0!==t.value?this.setValues("hsv",t):void 0!==t.w||void 0!==t.whiteness?this.setValues("hwb",t):void 0===t.c&&void 0===t.cyan||this.setValues("cmyk",t)))):new I(e);var t};I.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var e=this.values;return 1!==e.alpha?e.hwb.concat([e.alpha]):e.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values;return e.rgb.concat([e.alpha])},hslaArray:function(){var e=this.values;return e.hsl.concat([e.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return e&&(e=(e%=360)<0?360+e:e),this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return g.hexString(this.values.rgb)},rgbString:function(){return g.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return g.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return g.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return g.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return g.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return g.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return g.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],n=0;nn?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=this,r=e,i=void 0===t?.5:t,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a==-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new I,r=this.values,i=n.values;for(var o in r)r.hasOwnProperty(o)&&(e=r[o],"[object Array]"===(t={}.toString.call(e))?i[o]=e.slice(0):"[object Number]"===t?i[o]=e:console.error("unexpected color value:",e));return n}},I.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},I.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},I.prototype.getValues=function(e){for(var t=this.values,n={},r=0;r=0;i--)t.call(n,e[i],i);else for(i=0;i=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0,r=1;return 0===e?0:1===e?1:(n||(n=.3),t=n/(2*Math.PI)*Math.asin(1/r),-r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n))},easeOutElastic:function(e){var t=1.70158,n=0,r=1;return 0===e?0:1===e?1:(n||(n=.3),t=n/(2*Math.PI)*Math.asin(1/r),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0,r=1;return 0===e?0:2==(e/=.5)?1:(n||(n=.45),t=n/(2*Math.PI)*Math.asin(1/r),e<1?r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-B.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*B.easeInBounce(2*e):.5*B.easeOutBounce(2*e-1)+.5}},V={effects:B};H.easingEffects=B;var Y=Math.PI,U=Y/180,j=2*Y,G=Y/2,q=Y/4,$=2*Y/3,K={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,r,i,o){if(o){var a=Math.min(o,i/2,r/2),s=t+a,l=n+a,c=t+r-a,u=n+i-a;e.moveTo(t,l),st.left-n&&e.xt.top-n&&e.y0&&e.requestAnimationFrame()},advance:function(){for(var e,t,n,r,i=this.animations,o=0;o=n?(ae.callback(e.onAnimationComplete,[e],t),t.animating=!1,i.splice(o,1)):++o}},ye=ae.options.resolve,be=["push","pop","shift","splice","unshift"];function xe(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),be.forEach((function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),i=r.apply(this,t);return ae.each(e._chartjs.listeners,(function(e){"function"==typeof e[n]&&e[n].apply(e,t)})),i}})})))}function we(e,t){var n=e._chartjs;if(n){var r=n.listeners,i=r.indexOf(t);-1!==i&&r.splice(i,1),r.length>0||(be.forEach((function(t){delete e[t]})),delete e._chartjs)}}var _e=function(e,t){this.initialize(e,t)};ae.extend(_e.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),n=e.chart,r=n.scales,i=e.getDataset(),o=n.options.scales;null!==t.xAxisID&&t.xAxisID in r&&!i.xAxisID||(t.xAxisID=i.xAxisID||o.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in r&&!i.yAxisID||(t.yAxisID=i.yAxisID||o.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&we(this._data,this)},createMetaDataset:function(){var e=this,t=e.datasetElementType;return t&&new t({_chart:e.chart,_datasetIndex:e.index})},createMetaData:function(e){var t=this,n=t.dataElementType;return n&&new n({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,n=this,r=n.getMeta(),i=n.getDataset().data||[],o=r.data;for(e=0,t=i.length;er&&e.insertElements(r,i-r)},insertElements:function(e,t){for(var n=0;ni?(o=i/t.innerRadius,e.arc(a,s,t.innerRadius-i,r+o,n-o,!0)):e.arc(a,s,i,r+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}function Ce(e,t,n,r){var i,o=n.endAngle;for(r&&(n.endAngle=n.startAngle+Se,Me(e,n),n.endAngle=o,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=Se,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+Se,n.startAngle,!0),i=0;is;)i-=Se;for(;i=a&&i<=s,c=o>=n.innerRadius&&o<=n.outerRadius;return l&&c}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,r="inner"===n.borderAlign?.33:0,i={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-r,0),pixelMargin:r,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/Se)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,i.fullCircles){for(i.endAngle=i.startAngle+Se,t.beginPath(),t.arc(i.x,i.y,i.outerRadius,i.startAngle,i.endAngle),t.arc(i.x,i.y,i.innerRadius,i.endAngle,i.startAngle,!0),t.closePath(),e=0;ee.x&&(t=He(t,"left","right")):e.basen?n:r,r:l.right||i<0?0:i>t?t:i,b:l.bottom||o<0?0:o>n?n:o,l:l.left||a<0?0:a>t?t:a}}function Ye(e){var t=ze(e),n=t.right-t.left,r=t.bottom-t.top,i=Ve(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b}}}function Ue(e,t,n){var r=null===t,i=null===n,o=!(!e||r&&i)&&ze(e);return o&&(r||t>=o.left&&t<=o.right)&&(i||n>=o.top&&n<=o.bottom)}J._set("global",{elements:{rectangle:{backgroundColor:We,borderColor:We,borderSkipped:"bottom",borderWidth:0}}});var je=pe.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=Ye(t),r=n.outer,i=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(r.x,r.y,r.w,r.h),r.w===i.w&&r.h===i.h||(e.save(),e.beginPath(),e.rect(r.x,r.y,r.w,r.h),e.clip(),e.fillStyle=t.borderColor,e.rect(i.x,i.y,i.w,i.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return Ue(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return Ee(n)?Ue(n,e,null):Ue(n,null,t)},inXRange:function(e){return Ue(this._view,e,null)},inYRange:function(e){return Ue(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return Ee(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return Ee(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),Ge={},qe=De,$e=Ae,Ke=Re,Ze=je;Ge.Arc=qe,Ge.Line=$e,Ge.Point=Ke,Ge.Rectangle=Ze;var Xe=ae._deprecated,Je=ae.valueOrDefault;function Qe(e,t){var n,r,i,o,a=e._length;for(i=1,o=t.length;i0?Math.min(a,Math.abs(r-n)):a,n=r;return a}function et(e,t,n){var r,i,o=n.barThickness,a=t.stackCount,s=t.pixels[e],l=ae.isNullOrUndef(o)?Qe(t.scale,t.pixels):-1;return ae.isNullOrUndef(o)?(r=l*n.categoryPercentage,i=n.barPercentage):(r=o*a,i=1),{chunk:r/a,ratio:i,start:s-r/2}}function tt(e,t,n){var r,i=t.pixels,o=i[e],a=e>0?i[e-1]:null,s=e=0&&m.min>=0?m.min:m.max,w=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,_=g.length;if(y||void 0===y&&void 0!==b)for(r=0;r<_&&(i=g[r]).index!==e;++r)i.stack===b&&(o=void 0===(c=h._parseValue(p[i.index].data[t])).start?c.end:c.min>=0&&c.max>=0?c.max:c.min,(m.min<0&&o<0||m.max>=0&&o>0)&&(x+=o));return a=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+w))-a,void 0!==v&&Math.abs(l)=0&&!f||w<0&&f?a-v:a+v),{size:l,base:a,head:s,center:s+l/2}},calculateBarIndexPixels:function(e,t,n,r){var i=this,o="flex"===r.barThickness?tt(t,n,r):et(t,n,r),a=i.getStackIndex(e,i.getMeta().stack),s=o.start+o.chunk*a+o.chunk/2,l=Math.min(Je(r.maxBarThickness,1/0),o.chunk*o.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}},draw:function(){var e=this,t=e.chart,n=e._getValueScale(),r=e.getMeta().data,i=e.getDataset(),o=r.length,a=0;for(ae.canvas.clipArea(t.ctx,t.chartArea);a=st?-lt:y<-st?lt:0)+m,x=Math.cos(y),w=Math.sin(y),_=Math.cos(b),k=Math.sin(b),S=y<=0&&b>=0||b>=lt,M=y<=ct&&b>=ct||b>=lt+ct,C=y<=-ct&&b>=-ct||b>=st+ct,T=y===-st||b>=st?-1:Math.min(x,x*g,_,_*g),D=C?-1:Math.min(w,w*g,k,k*g),L=S?1:Math.max(x,x*g,_,_*g),P=M?1:Math.max(w,w*g,k,k*g);c=(L-T)/2,u=(P-D)/2,d=-(L+T)/2,h=-(P+D)/2}for(r=0,i=p.length;r0&&!isNaN(e)?lt*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,r,i,o,a,s,l,c=this,u=0,d=c.chart;if(!e)for(t=0,n=d.data.datasets.length;t(u=s>u?s:u)?l:u);return u},setHoverStyle:function(e){var t=e._model,n=e._options,r=ae.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=at(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=at(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=at(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n0&&pt(c[e-1]._model,l)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,l.left,l.right),n.controlPointPreviousY=u(n.controlPointPreviousY,l.top,l.bottom)),e0&&(o=e.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(e,t){return Pt(e,t,{intersect:!1})},point:function(e,t){return Tt(e,Mt(t,e))},nearest:function(e,t,n){var r=Mt(t,e);n.axis=n.axis||"xy";var i=Lt(n.axis);return Dt(e,r,n.intersect,i)},x:function(e,t,n){var r=Mt(t,e),i=[],o=!1;return Ct(e,(function(e){e.inXRange(r.x)&&i.push(e),e.inRange(r.x,r.y)&&(o=!0)})),n.intersect&&!o&&(i=[]),i},y:function(e,t,n){var r=Mt(t,e),i=[],o=!1;return Ct(e,(function(e){e.inYRange(r.y)&&i.push(e),e.inRange(r.x,r.y)&&(o=!0)})),n.intersect&&!o&&(i=[]),i}}},Ot=ae.extend;function Nt(e,t){return ae.where(e,(function(e){return e.pos===t}))}function Ft(e,t){return e.sort((function(e,n){var r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight}))}function It(e){var t,n,r,i=[];for(t=0,n=(e||[]).length;t div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n",qt=n(Object.freeze({__proto__:null,default:Gt})),$t="$chartjs",Kt="chartjs-",Zt=Kt+"size-monitor",Xt=Kt+"render-monitor",Jt=Kt+"render-animation",Qt=["animationstart","webkitAnimationStart"],en={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function tn(e,t){var n=ae.getStyle(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?Number(r[1]):void 0}function nn(e,t){var n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[$t]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===i||""===i){var o=tn(e,"width");void 0!==o&&(e.width=o)}if(null===r||""===r)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var a=tn(e,"height");void 0!==o&&(e.height=a)}return e}var rn=!!function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch(e){}return e}()&&{passive:!0};function on(e,t,n){e.addEventListener(t,n,rn)}function an(e,t,n){e.removeEventListener(t,n,rn)}function sn(e,t,n,r,i){return{type:e,chart:t,native:i||null,x:void 0!==n?n:null,y:void 0!==r?r:null}}function ln(e,t){var n=en[e.type]||e.type,r=ae.getRelativePosition(e,t);return sn(n,t,r.x,r.y,e)}function cn(e,t){var n=!1,r=[];return function(){r=Array.prototype.slice.call(arguments),t=t||this,n||(n=!0,ae.requestAnimFrame.call(window,(function(){n=!1,e.apply(t,r)})))}}function un(e){var t=document.createElement("div");return t.className=e||"",t}function dn(e){var t=1e6,n=un(Zt),r=un(Zt+"-expand"),i=un(Zt+"-shrink");r.appendChild(un()),i.appendChild(un()),n.appendChild(r),n.appendChild(i),n._reset=function(){r.scrollLeft=t,r.scrollTop=t,i.scrollLeft=t,i.scrollTop=t};var o=function(){n._reset(),e()};return on(r,"scroll",o.bind(r,"expand")),on(i,"scroll",o.bind(i,"shrink")),n}function hn(e,t){var n=e[$t]||(e[$t]={}),r=n.renderProxy=function(e){e.animationName===Jt&&t()};ae.each(Qt,(function(t){on(e,t,r)})),n.reflow=!!e.offsetParent,e.classList.add(Xt)}function fn(e){var t=e[$t]||{},n=t.renderProxy;n&&(ae.each(Qt,(function(t){an(e,t,n)})),delete t.renderProxy),e.classList.remove(Xt)}function pn(e,t,n){var r=e[$t]||(e[$t]={}),i=r.resizer=dn(cn((function(){if(r.resizer){var i=n.options.maintainAspectRatio&&e.parentNode,o=i?i.clientWidth:0;t(sn("resize",n)),i&&i.clientWidth0){var o=e[0];o.label?n=o.label:o.xLabel?n=o.xLabel:i>0&&o.index-1?e.split("\n"):e}function Tn(e){var t=e._xScale,n=e._yScale||e._scale,r=e._index,i=e._datasetIndex,o=e._chart.getDatasetMeta(i).controller,a=o._getIndexScale(),s=o._getValueScale();return{xLabel:t?t.getLabelForIndex(r,i):"",yLabel:n?n.getLabelForIndex(r,i):"",label:a?""+a.getLabelForIndex(r,i):"",value:s?""+s.getLabelForIndex(r,i):"",index:r,datasetIndex:i,x:e._model.x,y:e._model.y}}function Dn(e){var t=J.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:_n(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:_n(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:_n(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:_n(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:_n(e.titleFontStyle,t.defaultFontStyle),titleFontSize:_n(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:_n(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:_n(e.footerFontStyle,t.defaultFontStyle),footerFontSize:_n(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function Ln(e,t){var n=e._chart.ctx,r=2*t.yPadding,i=0,o=t.body,a=o.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0);a+=t.beforeBody.length+t.afterBody.length;var s=t.title.length,l=t.footer.length,c=t.titleFontSize,u=t.bodyFontSize,d=t.footerFontSize;r+=s*c,r+=s?(s-1)*t.titleSpacing:0,r+=s?t.titleMarginBottom:0,r+=a*u,r+=a?(a-1)*t.bodySpacing:0,r+=l?t.footerMarginTop:0,r+=l*d,r+=l?(l-1)*t.footerSpacing:0;var h=0,f=function(e){i=Math.max(i,n.measureText(e).width+h)};return n.font=ae.fontString(c,t._titleFontStyle,t._titleFontFamily),ae.each(t.title,f),n.font=ae.fontString(u,t._bodyFontStyle,t._bodyFontFamily),ae.each(t.beforeBody.concat(t.afterBody),f),h=t.displayColors?u+2:0,ae.each(o,(function(e){ae.each(e.before,f),ae.each(e.lines,f),ae.each(e.after,f)})),h=0,n.font=ae.fontString(d,t._footerFontStyle,t._footerFontFamily),ae.each(t.footer,f),{width:i+=2*t.xPadding,height:r}}function Pn(e,t){var n,r,i,o,a,s=e._model,l=e._chart,c=e._chart.chartArea,u="center",d="center";s.yl.height-t.height&&(d="bottom");var h=(c.left+c.right)/2,f=(c.top+c.bottom)/2;"center"===d?(n=function(e){return e<=h},r=function(e){return e>h}):(n=function(e){return e<=t.width/2},r=function(e){return e>=l.width-t.width/2}),i=function(e){return e+t.width+s.caretSize+s.caretPadding>l.width},o=function(e){return e-t.width-s.caretSize-s.caretPadding<0},a=function(e){return e<=f?"top":"bottom"},n(s.x)?(u="left",i(s.x)&&(u="center",d=a(s.y))):r(s.x)&&(u="right",o(s.x)&&(u="center",d=a(s.y)));var p=e._options;return{xAlign:p.xAlign?p.xAlign:u,yAlign:p.yAlign?p.yAlign:d}}function An(e,t,n,r){var i=e.x,o=e.y,a=e.caretSize,s=e.caretPadding,l=e.cornerRadius,c=n.xAlign,u=n.yAlign,d=a+s,h=l+s;return"right"===c?i-=t.width:"center"===c&&((i-=t.width/2)+t.width>r.width&&(i=r.width-t.width),i<0&&(i=0)),"top"===u?o+=d:o-="bottom"===u?t.height+d:t.height/2,"center"===u?"left"===c?i+=d:"right"===c&&(i-=d):"left"===c?i-=h:"right"===c&&(i+=h),{x:i,y:o}}function On(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function Nn(e){return Mn([],Cn(e))}var Fn=pe.extend({initialize:function(){this._model=Dn(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options.callbacks,n=t.beforeTitle.apply(e,arguments),r=t.title.apply(e,arguments),i=t.afterTitle.apply(e,arguments),o=[];return o=Mn(o,Cn(n)),o=Mn(o,Cn(r)),o=Mn(o,Cn(i))},getBeforeBody:function(){return Nn(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,r=n._options.callbacks,i=[];return ae.each(e,(function(e){var o={before:[],lines:[],after:[]};Mn(o.before,Cn(r.beforeLabel.call(n,e,t))),Mn(o.lines,r.label.call(n,e,t)),Mn(o.after,Cn(r.afterLabel.call(n,e,t))),i.push(o)})),i},getAfterBody:function(){return Nn(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),r=t.footer.apply(e,arguments),i=t.afterFooter.apply(e,arguments),o=[];return o=Mn(o,Cn(n)),o=Mn(o,Cn(r)),o=Mn(o,Cn(i))},update:function(e){var t,n,r=this,i=r._options,o=r._model,a=r._model=Dn(i),s=r._active,l=r._data,c={xAlign:o.xAlign,yAlign:o.yAlign},u={x:o.x,y:o.y},d={width:o.width,height:o.height},h={x:o.caretX,y:o.caretY};if(s.length){a.opacity=1;var f=[],p=[];h=Sn[i.position].call(r,s,r._eventPosition);var g=[];for(t=0,n=s.length;t0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var n={width:t.width,height:t.height},r={x:t.x,y:t.y},i=Math.abs(t.opacity<.001)?0:t.opacity,o=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length;this._options.enabled&&o&&(e.save(),e.globalAlpha=i,this.drawBackground(r,t,e,n),r.y+=t.yPadding,ae.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ae.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t=this,n=t._options,r=!1;return t._lastActive=t._lastActive||[],"mouseout"===e.type?t._active=[]:(t._active=t._chart.getElementsAtEventForMode(e,n.mode,n),n.reverse&&t._active.reverse()),(r=!ae.arrayEquals(t._active,t._lastActive))&&(t._lastActive=t._active,(n.enabled||n.custom)&&(t._eventPosition={x:e.x,y:e.y},t.update(!0),t.pivot())),r}}),In=Sn,Rn=Fn;Rn.positioners=In;var Wn=ae.valueOrDefault;function En(){return ae.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){if("xAxes"===e||"yAxes"===e){var i,o,a,s=n[e].length;for(t[e]||(t[e]=[]),i=0;i=t[e].length&&t[e].push({}),!t[e][i].type||a.type&&a.type!==t[e][i].type?ae.merge(t[e][i],[wn.getScaleDefaults(o),a]):ae.merge(t[e][i],a)}else ae._merger(e,t,n,r)}})}function zn(){return ae.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){var i=t[e]||Object.create(null),o=n[e];"scales"===e?t[e]=En(i,o):"scale"===e?t[e]=ae.merge(i,[wn.getScaleDefaults(o.type),o]):ae._merger(e,t,n,r)}})}function Hn(e){var t=(e=e||Object.create(null)).data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=zn(J.global,J[e.type],e.options||{}),e}function Bn(e){var t=e.options;ae.each(e.scales,(function(t){Ut.removeBox(e,t)})),t=zn(J.global,J[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function Vn(e,t,n){var r,i=function(e){return e.id===r};do{r=t+n++}while(ae.findIndex(e,i)>=0);return r}function Yn(e){return"top"===e||"bottom"===e}function Un(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}J._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var jn=function(e,t){return this.construct(e,t),this};ae.extend(jn.prototype,{construct:function(e,t){var n=this;t=Hn(t);var r=bn.acquireContext(e,t),i=r&&r.canvas,o=i&&i.height,a=i&&i.width;n.id=ae.uid(),n.ctx=r,n.canvas=i,n.config=t,n.width=a,n.height=o,n.aspectRatio=o?a/o:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,jn.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),r&&i?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return xn.notify(e,"beforeInit"),ae.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),xn.notify(e,"afterInit"),e},clear:function(){return ae.canvas.clear(this),this},stop:function(){return ve.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,r=t.canvas,i=n.maintainAspectRatio&&t.aspectRatio||null,o=Math.max(0,Math.floor(ae.getMaximumWidth(r))),a=Math.max(0,Math.floor(i?o/i:ae.getMaximumHeight(r)));if((t.width!==o||t.height!==a)&&(r.width=t.width=o,r.height=t.height=a,r.style.width=o+"px",r.style.height=a+"px",ae.retinaScale(t,n.devicePixelRatio),!e)){var s={width:o,height:a};xn.notify(t,"resize",[s]),n.onResize&&n.onResize(t,s),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;ae.each(t.xAxes,(function(e,n){e.id||(e.id=Vn(t.xAxes,"x-axis-",n))})),ae.each(t.yAxes,(function(e,n){e.id||(e.id=Vn(t.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},r=[],i=Object.keys(n).reduce((function(e,t){return e[t]=!1,e}),{});t.scales&&(r=r.concat((t.scales.xAxes||[]).map((function(e){return{options:e,dtype:"category",dposition:"bottom"}})),(t.scales.yAxes||[]).map((function(e){return{options:e,dtype:"linear",dposition:"left"}})))),t.scale&&r.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),ae.each(r,(function(t){var r=t.options,o=r.id,a=Wn(r.type,t.dtype);Yn(r.position)!==Yn(t.dposition)&&(r.position=t.dposition),i[o]=!0;var s=null;if(o in n&&n[o].type===a)(s=n[o]).options=r,s.ctx=e.ctx,s.chart=e;else{var l=wn.getScaleConstructor(a);if(!l)return;s=new l({id:o,type:a,options:r,ctx:e.ctx,chart:e}),n[s.id]=s}s.mergeTicksOptions(),t.isDefault&&(e.scale=s)})),ae.each(i,(function(e,t){e||delete n[t]})),e.scales=n,wn.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,r=[],i=n.data.datasets;for(e=0,t=i.length;e=0;--n)r.drawDataset(t[n],e);xn.notify(r,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n=this,r={meta:e,index:e.index,easingValue:t};!1!==xn.notify(n,"beforeDatasetDraw",[r])&&(e.controller.draw(t),xn.notify(n,"afterDatasetDraw",[r]))},_drawTooltip:function(e){var t=this,n=t.tooltip,r={tooltip:n,easingValue:e};!1!==xn.notify(t,"beforeTooltipDraw",[r])&&(n.draw(),xn.notify(t,"afterTooltipDraw",[r]))},getElementAtEvent:function(e){return At.modes.single(this,e)},getElementsAtEvent:function(e){return At.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return At.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var r=At.modes[t];return"function"==typeof r?r(this,e,n):[]},getDatasetAtEvent:function(e){return At.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,n=t.data.datasets[e];n._meta||(n._meta={});var r=n._meta[t.id];return r||(r=n._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:e}),r},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t=0;r--){var i=e[r];if(t(i))return i}},ae.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ae.almostEquals=function(e,t,n){return Math.abs(e-t)=e},ae.max=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.max(e,t)}),Number.NEGATIVE_INFINITY)},ae.min=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.min(e,t)}),Number.POSITIVE_INFINITY)},ae.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0==(e=+e)||isNaN(e)?e:e>0?1:-1},ae.toRadians=function(e){return e*(Math.PI/180)},ae.toDegrees=function(e){return e*(180/Math.PI)},ae._decimalPlaces=function(e){if(ae.isFinite(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}},ae.getAngleFromPoint=function(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),o=Math.atan2(r,n);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:i}},ae.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},ae.aliasPixel=function(e){return e%2==0?0:.5},ae._alignPixel=function(e,t,n){var r=e.currentDevicePixelRatio,i=n/2;return Math.round((t-i)*r)/r+i},ae.splineCurve=function(e,t,n,r){var i=e.skip?t:e,o=t,a=n.skip?t:n,s=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),l=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),c=s/(s+l),u=l/(s+l),d=r*(c=isNaN(c)?0:c),h=r*(u=isNaN(u)?0:u);return{previous:{x:o.x-d*(a.x-i.x),y:o.y-d*(a.y-i.y)},next:{x:o.x+h*(a.x-i.x),y:o.y+h*(a.y-i.y)}}},ae.EPSILON=Number.EPSILON||1e-14,ae.splineCurveMonotone=function(e){var t,n,r,i,o,a,s,l,c,u=(e||[]).map((function(e){return{model:e._model,deltaK:0,mK:0}})),d=u.length;for(t=0;t0?u[t-1]:null,(i=t0?u[t-1]:null,i=t=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},ae.previousItem=function(e,t,n){return n?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},ae.niceNum=function(e,t){var n=Math.floor(ae.log10(e)),r=e/Math.pow(10,n);return(t?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10)*Math.pow(10,n)},ae.requestAnimFrame="undefined"==typeof window?function(e){e()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)},ae.getRelativePosition=function(e,t){var n,r,i=e.originalEvent||e,o=e.target||e.srcElement,a=o.getBoundingClientRect(),s=i.touches;s&&s.length>0?(n=s[0].clientX,r=s[0].clientY):(n=i.clientX,r=i.clientY);var l=parseFloat(ae.getStyle(o,"padding-left")),c=parseFloat(ae.getStyle(o,"padding-top")),u=parseFloat(ae.getStyle(o,"padding-right")),d=parseFloat(ae.getStyle(o,"padding-bottom")),h=a.right-a.left-l-u,f=a.bottom-a.top-c-d;return{x:n=Math.round((n-a.left-l)/h*o.width/t.currentDevicePixelRatio),y:r=Math.round((r-a.top-c)/f*o.height/t.currentDevicePixelRatio)}},ae.getConstraintWidth=function(e){return n(e,"max-width","clientWidth")},ae.getConstraintHeight=function(e){return n(e,"max-height","clientHeight")},ae._calculatePadding=function(e,t,n){return(t=ae.getStyle(e,t)).indexOf("%")>-1?n*parseInt(t,10)/100:parseInt(t,10)},ae._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},ae.getMaximumWidth=function(e){var t=ae._getParentNode(e);if(!t)return e.clientWidth;var n=t.clientWidth,r=n-ae._calculatePadding(t,"padding-left",n)-ae._calculatePadding(t,"padding-right",n),i=ae.getConstraintWidth(e);return isNaN(i)?r:Math.min(r,i)},ae.getMaximumHeight=function(e){var t=ae._getParentNode(e);if(!t)return e.clientHeight;var n=t.clientHeight,r=n-ae._calculatePadding(t,"padding-top",n)-ae._calculatePadding(t,"padding-bottom",n),i=ae.getConstraintHeight(e);return isNaN(i)?r:Math.min(r,i)},ae.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},ae.retinaScale=function(e,t){var n=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var r=e.canvas,i=e.height,o=e.width;r.height=i*n,r.width=o*n,e.ctx.scale(n,n),r.style.height||r.style.width||(r.style.height=i+"px",r.style.width=o+"px")}},ae.fontString=function(e,t,n){return t+" "+e+"px "+n},ae.longestText=function(e,t,n,r){var i=(r=r||{}).data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.font=t;var a,s,l,c,u,d=0,h=n.length;for(a=0;an.length){for(a=0;ar&&(r=o),r},ae.numberOfLabelLines=function(e){var t=1;return ae.each(e,(function(e){ae.isArray(e)&&e.length>t&&(t=e.length)})),t},ae.color=R?function(e){return e instanceof CanvasGradient&&(e=J.global.defaultColor),R(e)}:function(e){return console.error("Color.js not found!"),e},ae.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:ae.color(e).saturate(.5).darken(.1).rgbString()}};function $n(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Kn(e){this.options=e||{}}ae.extend(Kn.prototype,{formats:$n,parse:$n,format:$n,add:$n,diff:$n,startOf:$n,endOf:$n,_create:function(e){return e}}),Kn.override=function(e){ae.extend(Kn.prototype,e)};var Zn={_date:Kn},Xn={formatters:{values:function(e){return ae.isArray(e)?e:""+e},linear:function(e,t,n){var r=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(r)>1&&e!==Math.floor(e)&&(r=e-Math.floor(e));var i=ae.log10(Math.abs(r)),o="";if(0!==e)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var a=ae.log10(Math.abs(e)),s=Math.floor(a)-Math.floor(i);s=Math.max(Math.min(s,20),0),o=e.toExponential(s)}else{var l=-1*Math.floor(i);l=Math.max(Math.min(l,20),0),o=e.toFixed(l)}else o="0";return o},logarithmic:function(e,t,n){var r=e/Math.pow(10,Math.floor(ae.log10(e)));return 0===e?"0":1===r||2===r||5===r||0===t||t===n.length-1?e.toExponential():""}}},Jn=ae.isArray,Qn=ae.isNullOrUndef,er=ae.valueOrDefault,tr=ae.valueAtIndexOrDefault;function nr(e,t){for(var n=[],r=e.length/t,i=0,o=e.length;il+c)))return a}function ir(e,t){ae.each(e,(function(e){var n,r=e.gc,i=r.length/2;if(i>t){for(n=0;nc)return o;return Math.max(c,1)}function fr(e){var t,n,r=[];for(t=0,n=e.length;t=h||u<=1||!s.isHorizontal()?s.labelRotation=d:(t=(e=s._getLabelSizes()).widest.width,n=e.highest.height-e.highest.offset,r=Math.min(s.maxWidth,s.chart.width-t),t+6>(i=l.offset?s.maxWidth/u:r/(u-1))&&(i=r/(u-(l.offset?.5:1)),o=s.maxHeight-ar(l.gridLines)-c.padding-sr(l.scaleLabel),a=Math.sqrt(t*t+n*n),f=ae.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/i,1)),Math.asin(Math.min(o/a,1))-Math.asin(n/a))),f=Math.max(d,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){ae.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){ae.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,r=e.options,i=r.ticks,o=r.scaleLabel,a=r.gridLines,s=e._isVisible(),l="bottom"===r.position,c=e.isHorizontal();if(c?t.width=e.maxWidth:s&&(t.width=ar(a)+sr(o)),c?s&&(t.height=ar(a)+sr(o)):t.height=e.maxHeight,i.display&&s){var u=cr(i),d=e._getLabelSizes(),h=d.first,f=d.last,p=d.widest,g=d.highest,m=.4*u.minor.lineHeight,v=i.padding;if(c){var y=0!==e.labelRotation,b=ae.toRadians(e.labelRotation),x=Math.cos(b),w=Math.sin(b),_=w*p.width+x*(g.height-(y?g.offset:0))+(y?0:m);t.height=Math.min(e.maxHeight,t.height+_+v);var k,S,M=e.getPixelForTick(0)-e.left,C=e.right-e.getPixelForTick(e.getTicks().length-1);y?(k=l?x*h.width+w*h.offset:w*(h.height-h.offset),S=l?w*(f.height-f.offset):x*f.width+w*f.offset):(k=h.width/2,S=f.width/2),e.paddingLeft=Math.max((k-M)*e.width/(e.width-M),0)+3,e.paddingRight=Math.max((S-C)*e.width/(e.width-C),0)+3}else{var T=i.mirror?0:p.width+v+m;t.width=Math.min(e.maxWidth,t.width+T),e.paddingTop=h.height/2,e.paddingBottom=f.height/2}}e.handleMargins(),c?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){ae.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(Qn(e))return NaN;if(("number"==typeof e||e instanceof Number)&&!isFinite(e))return NaN;if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y);return e},_convertTicksToLabels:function(e){var t,n,r,i=this;for(i.ticks=e.map((function(e){return e.value})),i.beforeTickToLabelConversion(),t=i.convertTicksToLabels(e)||i.ticks,i.afterTickToLabelConversion(),n=0,r=e.length;nr-1?null:t.getPixelForDecimal(e*i+(n?i/2:0))},getPixelForDecimal:function(e){var t=this;return t._reversePixels&&(e=1-e),t._startPixel+e*t._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this,t=e.min,n=e.max;return e.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0},_autoSkip:function(e){var t,n,r,i,o=this,a=o.options.ticks,s=o._length,l=a.maxTicksLimit||s/o._tickSize()+1,c=a.major.enabled?fr(e):[],u=c.length,d=c[0],h=c[u-1];if(u>l)return pr(e,c,u/l),ur(e);if(r=hr(c,e,s,l),u>0){for(t=0,n=u-1;t1?(h-d)/(u-1):null,gr(e,r,ae.isNullOrUndef(i)?0:d-i,d),gr(e,r,h,ae.isNullOrUndef(i)?e.length:h+i),ur(e)}return gr(e,r),ur(e)},_tickSize:function(){var e=this,t=e.options.ticks,n=ae.toRadians(e.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=e._getLabelSizes(),a=t.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return e.isHorizontal()?l*r>s*i?s/r:l/i:l*i=0&&(a=e),void 0!==o&&(e=n.indexOf(o))>=0&&(s=e),t.minIndex=a,t.maxIndex=s,t.min=n[a],t.max=n[s]},buildTicks:function(){var e=this,t=e._getLabels(),n=e.minIndex,r=e.maxIndex;e.ticks=0===n&&r===t.length-1?t:t.slice(n,r+1)},getLabelForIndex:function(e,t){var n=this,r=n.chart;return r.getDatasetMeta(t).controller._getValueScaleId()===n.id?n.getRightValue(r.data.datasets[t].data[e]):n._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;vr.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var r,i,o,a=this;return yr(t)||yr(n)||(e=a.chart.data.datasets[n].data[t]),yr(e)||(r=a.isHorizontal()?e.x:e.y),(void 0!==r||void 0!==e&&isNaN(t))&&(i=a._getLabels(),e=ae.valueOrDefault(r,e),t=-1!==(o=i.indexOf(e))?o:t,isNaN(t)&&(t=e)),a.getPixelForDecimal((t-a._startValue)/a._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=this,n=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(n,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}}),wr=br;xr._defaults=wr;var _r=ae.noop,kr=ae.isNullOrUndef;function Sr(e,t){var n,r,i,o,a=[],s=1e-14,l=e.stepSize,c=l||1,u=e.maxTicks-1,d=e.min,h=e.max,f=e.precision,p=t.min,g=t.max,m=ae.niceNum((g-p)/u/c)*c;if(mu&&(m=ae.niceNum(o*m/u/c)*c),l||kr(f)?n=Math.pow(10,ae._decimalPlaces(m)):(n=Math.pow(10,f),m=Math.ceil(m*n)/n),r=Math.floor(p/m)*m,i=Math.ceil(g/m)*m,l&&(!kr(d)&&ae.almostWhole(d/m,m/1e3)&&(r=d),!kr(h)&&ae.almostWhole(h/m,m/1e3)&&(i=h)),o=(i-r)/m,o=ae.almostEquals(o,Math.round(o),m/1e3)?Math.round(o):Math.ceil(o),r=Math.round(r*n)/n,i=Math.round(i*n)/n,a.push(kr(d)?r:d);for(var v=1;v0&&r>0&&(e.min=0)}var i=void 0!==t.min||void 0!==t.suggestedMin,o=void 0!==t.max||void 0!==t.suggestedMax;void 0!==t.min?e.min=t.min:void 0!==t.suggestedMin&&(null===e.min?e.min=t.suggestedMin:e.min=Math.min(e.min,t.suggestedMin)),void 0!==t.max?e.max=t.max:void 0!==t.suggestedMax&&(null===e.max?e.max=t.suggestedMax:e.max=Math.max(e.max,t.suggestedMax)),i!==o&&e.min>=e.max&&(i?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,t.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this,n=t.options.ticks,r=n.stepSize,i=n.maxTicksLimit;return r?e=Math.ceil(t.max/r)-Math.floor(t.min/r)+1:(e=t._computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:_r,buildTicks:function(){var e=this,t=e.options.ticks,n=e.getTickLimit(),r={maxTicks:n=Math.max(2,n),min:t.min,max:t.max,precision:t.precision,stepSize:ae.valueOrDefault(t.fixedStepSize,t.stepSize)},i=e.ticks=Sr(r,e);e.handleDirectionalChanges(),e.max=ae.max(i),e.min=ae.min(i),t.reverse?(i.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),vr.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),r=t.min,i=t.max;vr.prototype._configure.call(t),t.options.offset&&n.length&&(r-=e=(i-r)/Math.max(n.length-1,1)/2,i+=e),t._startValue=r,t._endValue=i,t._valueRange=i-r}}),Cr={position:"left",ticks:{callback:Xn.formatters.linear}},Tr=0,Dr=1;function Lr(e,t,n){var r=[n.type,void 0===t&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===e[r]&&(e[r]={pos:[],neg:[]}),e[r]}function Pr(e,t,n,r){var i,o,a=e.options,s=Lr(t,a.stacked,n),l=s.pos,c=s.neg,u=r.length;for(i=0;it.length-1?null:this.getPixelForValue(t[e])}}),Nr=Cr;Or._defaults=Nr;var Fr=ae.valueOrDefault,Ir=ae.math.log10;function Rr(e,t){var n,r,i=[],o=Fr(e.min,Math.pow(10,Math.floor(Ir(t.min)))),a=Math.floor(Ir(t.max)),s=Math.ceil(t.max/Math.pow(10,a));0===o?(n=Math.floor(Ir(t.minNotZero)),r=Math.floor(t.minNotZero/Math.pow(10,n)),i.push(o),o=r*Math.pow(10,n)):(n=Math.floor(Ir(o)),r=Math.floor(o/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{i.push(o),10==++r&&(r=1,l=++n>=0?1:l),o=Math.round(r*Math.pow(10,n)*l)/l}while(n=0?e:t}var zr=vr.extend({determineDataLimits:function(){var e,t,n,r,i,o,a=this,s=a.options,l=a.chart,c=l.data.datasets,u=a.isHorizontal();function d(e){return u?e.xAxisID===a.id:e.yAxisID===a.id}a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,a.minNotZero=Number.POSITIVE_INFINITY;var h=s.stacked;if(void 0===h)for(e=0;e0){var t=ae.min(e),n=ae.max(e);a.min=Math.min(a.min,t),a.max=Math.max(a.max,n)}}))}else for(e=0;e0?e.minNotZero=e.min:e.max<1?e.minNotZero=Math.pow(10,Math.floor(Ir(e.max))):e.minNotZero=n)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),r={min:Er(t.min),max:Er(t.max)},i=e.ticks=Rr(r,e);e.max=ae.max(i),e.min=ae.min(i),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&i.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),vr.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForTick:function(e){var t=this.tickValues;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(Ir(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;vr.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=Fr(e.options.ticks.fontSize,J.global.defaultFontSize)/e._length),e._startValue=Ir(t),e._valueOffset=n,e._valueRange=(Ir(e.max)-Ir(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(n=(Ir(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return 0===n&&0===t.min?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}}),Hr=Wr;zr._defaults=Hr;var Br=ae.valueOrDefault,Vr=ae.valueAtIndexOrDefault,Yr=ae.options.resolve,Ur={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Xn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function jr(e){var t=e.ticks;return t.display&&e.display?Br(t.fontSize,J.global.defaultFontSize)+2*t.backdropPaddingY:0}function Gr(e,t,n){return ae.isArray(n)?{w:ae.longestText(e,e.font,n),h:n.length*t}:{w:e.measureText(n).width,h:t}}function qr(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function $r(e){var t,n,r,i=ae.options._parseFont(e.options.pointLabels),o={l:0,r:e.width,t:0,b:e.height-e.paddingTop},a={};e.ctx.font=i.string,e._pointLabelSizes=[];var s=e.chart.data.labels.length;for(t=0;to.r&&(o.r=u.end,a.r=l),d.starto.b&&(o.b=d.end,a.b=l)}e.setReductions(e.drawingArea,o,a)}function Kr(e){return 0===e||180===e?"center":e<180?"left":"right"}function Zr(e,t,n,r){var i,o,a=n.y+r/2;if(ae.isArray(t))for(i=0,o=t.length;i270||e<90)&&(n.y-=t.h)}function Jr(e){var t=e.ctx,n=e.options,r=n.pointLabels,i=jr(n),o=e.getDistanceFromCenterForValue(n.ticks.reverse?e.min:e.max),a=ae.options._parseFont(r);t.save(),t.font=a.string,t.textBaseline="middle";for(var s=e.chart.data.labels.length-1;s>=0;s--){var l=0===s?i/2:0,c=e.getPointPosition(s,o+l+5),u=Vr(r.fontColor,s,J.global.defaultFontColor);t.fillStyle=u;var d=e.getIndexAngle(s),h=ae.toDegrees(d);t.textAlign=Kr(h),Xr(h,e._pointLabelSizes[s],c),Zr(t,e.pointLabels[s],c,a.lineHeight)}t.restore()}function Qr(e,t,n,r){var i,o=e.ctx,a=t.circular,s=e.chart.data.labels.length,l=Vr(t.color,r-1),c=Vr(t.lineWidth,r-1);if((a||s)&&l&&c){if(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash&&(o.setLineDash(t.borderDash||[]),o.lineDashOffset=t.borderDashOffset||0),o.beginPath(),a)o.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{i=e.getPointPosition(0,n),o.moveTo(i.x,i.y);for(var u=1;u0&&r>0?n:0)},_drawGrid:function(){var e,t,n,r=this,i=r.ctx,o=r.options,a=o.gridLines,s=o.angleLines,l=Br(s.lineWidth,a.lineWidth),c=Br(s.color,a.color);if(o.pointLabels.display&&Jr(r),a.display&&ae.each(r.ticks,(function(e,n){0!==n&&(t=r.getDistanceFromCenterForValue(r.ticksAsNumbers[n]),Qr(r,a,t,n))})),s.display&&l&&c){for(i.save(),i.lineWidth=l,i.strokeStyle=c,i.setLineDash&&(i.setLineDash(Yr([s.borderDash,a.borderDash,[]])),i.lineDashOffset=Yr([s.borderDashOffset,a.borderDashOffset,0])),e=r.chart.data.labels.length-1;e>=0;e--)t=r.getDistanceFromCenterForValue(o.ticks.reverse?r.min:r.max),n=r.getPointPosition(e,t),i.beginPath(),i.moveTo(r.xCenter,r.yCenter),i.lineTo(n.x,n.y),i.stroke();i.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options.ticks;if(n.display){var r,i,o=e.getIndexAngle(0),a=ae.options._parseFont(n),s=Br(n.fontColor,J.global.defaultFontColor);t.save(),t.font=a.string,t.translate(e.xCenter,e.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",ae.each(e.ticks,(function(o,l){(0!==l||n.reverse)&&(r=e.getDistanceFromCenterForValue(e.ticksAsNumbers[l]),n.showLabelBackdrop&&(i=t.measureText(o).width,t.fillStyle=n.backdropColor,t.fillRect(-i/2-n.backdropPaddingX,-r-a.size/2-n.backdropPaddingY,i+2*n.backdropPaddingX,a.size+2*n.backdropPaddingY)),t.fillStyle=s,t.fillText(o,0,-r))})),t.restore()}},_drawTitle:ae.noop}),ni=Ur;ti._defaults=ni;var ri=ae._deprecated,ii=ae.options.resolve,oi=ae.valueOrDefault,ai=Number.MIN_SAFE_INTEGER||-9007199254740991,si=Number.MAX_SAFE_INTEGER||9007199254740991,li={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ci=Object.keys(li);function ui(e,t){return e-t}function di(e){var t,n,r,i={},o=[];for(t=0,n=e.length;tt&&s=0&&a<=s;){if(i=e[(r=a+s>>1)-1]||null,o=e[r],!i)return{lo:null,hi:o};if(o[t]n))return{lo:i,hi:o};s=r-1}}return{lo:o,hi:null}}function mi(e,t,n,r){var i=gi(e,t,n),o=i.lo?i.hi?i.lo:e[e.length-2]:e[0],a=i.lo?i.hi?i.hi:e[e.length-1]:e[1],s=a[t]-o[t],l=s?(n-o[t])/s:0,c=(a[r]-o[r])*l;return o[r]+c}function vi(e,t){var n=e._adapter,r=e.options.time,i=r.parser,o=i||r.format,a=t;return"function"==typeof i&&(a=i(a)),ae.isFinite(a)||(a="string"==typeof o?n.parse(a,o):n.parse(a)),null!==a?+a:(i||"function"!=typeof o||(a=o(t),ae.isFinite(a)||(a=n.parse(a))),a)}function yi(e,t){if(ae.isNullOrUndef(t))return null;var n=e.options.time,r=vi(e,e.getRightValue(t));return null===r||n.round&&(r=+e._adapter.startOf(r,n.round)),r}function bi(e,t,n,r){var i,o,a,s=ci.length;for(i=ci.indexOf(e);i=ci.indexOf(n);o--)if(a=ci[o],li[a].common&&e._adapter.diff(i,r,a)>=t-1)return a;return ci[n?ci.indexOf(n):0]}function wi(e){for(var t=ci.indexOf(e)+1,n=ci.length;t1e5*c)throw t+" and "+n+" are too far apart with stepSize of "+c+" "+l;for(i=d;i=0&&(t[o].major=!0);return t}function Mi(e,t,n){var r,i,o=[],a={},s=t.length;for(r=0;r1?di(p).sort(ui):p.sort(ui),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=yi(s,hi(u))||h,f=yi(s,fi(u))||f,h=h===si?+c.startOf(Date.now(),d):h,f=f===ai?+c.endOf(Date.now(),d)+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._table=[],s._timestamps={data:p,datasets:g,labels:m}},buildTicks:function(){var e,t,n,r=this,i=r.min,o=r.max,a=r.options,s=a.ticks,l=a.time,c=r._timestamps,u=[],d=r.getLabelCapacity(i),h=s.source,f=a.distribution;for(c="data"===h||"auto"===h&&"series"===f?c.data:"labels"===h?c.labels:_i(r,i,o,d),"ticks"===a.bounds&&c.length&&(i=c[0],o=c[c.length-1]),i=yi(r,hi(a))||i,o=yi(r,fi(a))||o,e=0,t=c.length;e=i&&n<=o&&u.push(n);return r.min=i,r.max=o,r._unit=l.unit||(s.autoSkip?bi(l.minUnit,r.min,r.max,d):xi(r,u.length,l.minUnit,r.min,r.max)),r._majorUnit=s.major.enabled&&"year"!==r._unit?wi(r._unit):void 0,r._table=pi(r._timestamps.data,i,o,f),r._offsets=ki(r._table,u,i,o,a),s.reverse&&u.reverse(),Mi(r,u,r._majorUnit)},getLabelForIndex:function(e,t){var n=this,r=n._adapter,i=n.chart.data,o=n.options.time,a=i.labels&&e=0&&e0?s:1}}),Di=Ci;Ti._defaults=Di;var Li={category:xr,linear:Or,logarithmic:zr,radialLinear:ti,time:Ti},Pi={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Zn._date.override("function"==typeof e?{_id:"moment",formats:function(){return Pi},parse:function(t,n){return"string"==typeof t&&"string"==typeof n?t=e(t,n):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,n){return e(t).format(n)},add:function(t,n,r){return e(t).add(n,r).valueOf()},diff:function(t,n,r){return e(t).diff(e(n),r)},startOf:function(t,n,r){return t=e(t),"isoWeek"===n?t.isoWeekday(r).valueOf():t.startOf(n).valueOf()},endOf:function(t,n){return e(t).endOf(n).valueOf()},_create:function(t){return e(t)}}:{}),J._set("global",{plugins:{filler:{propagate:!0}}});var Ai={dataset:function(e){var t=e.fill,n=e.chart,r=n.getDatasetMeta(t),i=r&&n.isDatasetVisible(t)&&r.dataset._children||[],o=i.length||0;return o?function(e,t){return t=n)&&r;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function Ni(e){var t,n=e.el._model||{},r=e.el._scale||{},i=e.fill,o=null;if(isFinite(i))return null;if("start"===i?o=void 0===n.scaleBottom?r.bottom:n.scaleBottom:"end"===i?o=void 0===n.scaleTop?r.top:n.scaleTop:void 0!==n.scaleZero?o=n.scaleZero:r.getBasePixel&&(o=r.getBasePixel()),null!=o){if(void 0!==o.x&&void 0!==o.y)return o;if(ae.isFinite(o))return{x:(t=r.isHorizontal())?o:null,y:t?null:o}}return null}function Fi(e){var t,n,r,i,o,a=e.el._scale,s=a.options,l=a.chart.data.labels.length,c=e.fill,u=[];if(!l)return null;for(t=s.ticks.reverse?a.max:a.min,n=s.ticks.reverse?a.min:a.max,r=a.getPointPositionForValue(0,t),i=0;i0;--o)ae.canvas.lineTo(e,n[o],n[o-1],!0);else for(a=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-a,2)+Math.pow(n[0].y-s,2)),o=i-1;o>0;--o)e.arc(a,s,l,n[o].angle,n[o-1].angle,!0)}}function Hi(e,t,n,r,i,o){var a,s,l,c,u,d,h,f,p=t.length,g=r.spanGaps,m=[],v=[],y=0,b=0;for(e.beginPath(),a=0,s=p;a=0;--n)(t=l[n].$filler)&&t.visible&&(i=(r=t.el)._view,o=r._children||[],a=t.mapper,s=i.backgroundColor||J.global.defaultColor,a&&s&&o.length&&(ae.canvas.clipArea(c,e.chartArea),Hi(c,o,a,i,s,r._loop),ae.canvas.unclipArea(c)))}},Vi=ae.rtl.getRtlAdapter,Yi=ae.noop,Ui=ae.valueOrDefault;function ji(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}J._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,r=this.chart,i=r.getDatasetMeta(n);i.hidden=null===i.hidden?!r.data.datasets[n].hidden:null,r.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},r=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map((function(n){var i=n.controller.getStyle(r?0:void 0);return{text:t[n.index].label,fillStyle:i.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:i.borderWidth,strokeStyle:i.borderColor,pointStyle:i.pointStyle,rotation:i.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(e){var t,n,r,i=document.createElement("ul"),o=e.data.datasets;for(i.setAttribute("class",e.id+"-legend"),t=0,n=o.length;tl.width)&&(d+=a+n.padding,u[u.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:r,height:a},u[u.length-1]+=r+n.padding})),l.height+=d}else{var h=n.padding,f=e.columnWidths=[],p=e.columnHeights=[],g=n.padding,m=0,v=0;ae.each(e.legendItems,(function(e,t){var r=ji(n,a)+a/2+i.measureText(e.text).width;t>0&&v+a+2*h>l.height&&(g+=m+n.padding,f.push(m),p.push(v),m=0,v=0),m=Math.max(m,r),v+=a+h,s[t]={left:0,top:0,width:r,height:a}})),g+=m,f.push(m),p.push(v),l.width+=g}e.width=l.width,e.height=l.height}else e.width=l.width=e.height=l.height=0},afterFit:Yi,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,r=J.global,i=r.defaultColor,o=r.elements.line,a=e.height,s=e.columnHeights,l=e.width,c=e.lineWidths;if(t.display){var u,d=Vi(t.rtl,e.left,e.minSize.width),h=e.ctx,f=Ui(n.fontColor,r.defaultFontColor),p=ae.options._parseFont(n),g=p.size;h.textAlign=d.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=p.string;var m=ji(n,g),v=e.legendHitBoxes,y=function(e,t,r){if(!(isNaN(m)||m<=0)){h.save();var a=Ui(r.lineWidth,o.borderWidth);if(h.fillStyle=Ui(r.fillStyle,i),h.lineCap=Ui(r.lineCap,o.borderCapStyle),h.lineDashOffset=Ui(r.lineDashOffset,o.borderDashOffset),h.lineJoin=Ui(r.lineJoin,o.borderJoinStyle),h.lineWidth=a,h.strokeStyle=Ui(r.strokeStyle,i),h.setLineDash&&h.setLineDash(Ui(r.lineDash,o.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=d.xPlus(e,m/2),c=t+g/2;ae.canvas.drawPoint(h,r.pointStyle,s,l,c,r.rotation)}else h.fillRect(d.leftForLtr(e,m),t,m,g),0!==a&&h.strokeRect(d.leftForLtr(e,m),t,m,g);h.restore()}},b=function(e,t,n,r){var i=g/2,o=d.xPlus(e,m+i),a=t+i;h.fillText(n.text,o,a),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(o,a),h.lineTo(d.xPlus(o,r),a),h.stroke())},x=function(e,r){switch(t.align){case"start":return n.padding;case"end":return e-r;default:return(e-r+n.padding)/2}},w=e.isHorizontal();u=w?{x:e.left+x(l,c[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+x(a,s[0]),line:0},ae.rtl.overrideTextDirection(e.ctx,t.textDirection);var _=g+n.padding;ae.each(e.legendItems,(function(t,r){var i=h.measureText(t.text).width,o=m+g/2+i,f=u.x,p=u.y;d.setWidth(e.minSize.width),w?r>0&&f+o+n.padding>e.left+e.minSize.width&&(p=u.y+=_,u.line++,f=u.x=e.left+x(l,c[u.line])):r>0&&p+_>e.top+e.minSize.height&&(f=u.x=f+e.columnWidths[u.line]+n.padding,u.line++,p=u.y=e.top+x(a,s[u.line]));var k=d.x(f);y(k,p,t),v[r].left=d.leftForLtr(k,v[r].width),v[r].top=p,b(k,p,t,i),w?u.x+=o+n.padding:u.y+=_})),ae.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,r,i,o=this;if(e>=o.left&&e<=o.right&&t>=o.top&&t<=o.bottom)for(i=o.legendHitBoxes,n=0;n=(r=i[n]).left&&e<=r.left+r.width&&t>=r.top&&t<=r.top+r.height)return o.legendItems[n];return null},handleEvent:function(e){var t,n=this,r=n.options,i="mouseup"===e.type?"click":e.type;if("mousemove"===i){if(!r.onHover&&!r.onLeave)return}else{if("click"!==i)return;if(!r.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===i?t&&r.onClick&&r.onClick.call(n,e.native,t):(r.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&r.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),r.onHover&&t&&r.onHover.call(n,e.native,t))}});function qi(e,t){var n=new Gi({ctx:e.ctx,options:t,chart:e});Ut.configure(e,n,t),Ut.addBox(e,n),e.legend=n}var $i={id:"legend",_element:Gi,beforeInit:function(e){var t=e.options.legend;t&&qi(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(ae.mergeIf(t,J.global.legend),n?(Ut.configure(e,n,t),n.options=t):qi(e,t)):n&&(Ut.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},Ki=ae.noop;J._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Zi=pe.extend({initialize:function(e){var t=this;ae.extend(t,e),t.legendHitBoxes=[]},beforeUpdate:Ki,update:function(e,t,n){var r=this;return r.beforeUpdate(),r.maxWidth=e,r.maxHeight=t,r.margins=n,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:Ki,beforeSetDimensions:Ki,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:Ki,beforeBuildLabels:Ki,buildLabels:Ki,afterBuildLabels:Ki,beforeFit:Ki,fit:function(){var e,t=this,n=t.options,r=t.minSize={},i=t.isHorizontal();n.display?(e=(ae.isArray(n.text)?n.text.length:1)*ae.options._parseFont(n).lineHeight+2*n.padding,t.width=r.width=i?t.maxWidth:e,t.height=r.height=i?e:t.maxHeight):t.width=r.width=t.height=r.height=0},afterFit:Ki,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var r,i,o,a=ae.options._parseFont(n),s=a.lineHeight,l=s/2+n.padding,c=0,u=e.top,d=e.left,h=e.bottom,f=e.right;t.fillStyle=ae.valueOrDefault(n.fontColor,J.global.defaultFontColor),t.font=a.string,e.isHorizontal()?(i=d+(f-d)/2,o=u+l,r=f-d):(i="left"===n.position?d+l:f-l,o=u+(h-u)/2,r=h-u,c=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(i,o),t.rotate(c),t.textAlign="center",t.textBaseline="middle";var p=n.text;if(ae.isArray(p))for(var g=0,m=0;m{this.chart&&this.chart.resize()}))}static get styles(){return ee`:host{position:relative;height:100%;width:100%;display:block;min-height:25rem}canvas{width:100px;height:100px}`}firstUpdated(){fetch(this.url).then((e=>e.json())).catch((e=>console.error(e))).then((e=>{var t;let n=(null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("canvas")).getContext("2d");this.chart=new ge(n,{type:"bar",data:{datasets:[{label:"Failed Logins",backgroundColor:"rgba(201, 25, 11, .5)",spanGaps:!0,data:e.logins_failed_per_1h},{label:"Successful Logins",backgroundColor:"rgba(189, 229, 184, .5)",spanGaps:!0,data:e.logins_per_1h}]},options:{maintainAspectRatio:!1,spanGaps:!0,scales:{xAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"},type:"time",offset:!0,ticks:{callback:function(e,t,n){const r=n[t],i=Date.now()-r.value;return Math.round(i/1e3/3600)+" Hours ago"},autoSkip:!0,maxTicksLimit:8}}],yAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"}}]}}})}))}render(){return W``}};e([Z()],me.prototype,"url",void 0),me=e([$("pb-admin-logins-chart")],me);var ve=fe((function(e,t){e.exports=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var _=y&&(c||d&&(null==w||w<12.11)),k=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var M,C=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function D(e,t){return T(e).appendChild(t)}function L(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}g?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(I=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function H(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var q=[""];function $(e){for(;q.length<=e;)q.push(K(q)+" ");return q[e]}function K(e){return e[e.length-1]}function Z(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\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 oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var ce=null;function ue(e,t,n){var r;ce=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ce=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ce=i)}return null!=r?r:ce}var de=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var u=e.length,d=[],h=0;h-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ve(e,t){var n=ge(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function we(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){me(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Me(e){_e(e),ke(e)}function Ce(e){return e.target||e.srcElement}function Te(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var De,Le,Pe=function(){if(a&&s<9)return!1;var e=L("div");return"draggable"in e||"dragDrop"in e}();function Ae(e){if(null==De){var t=L("span","​");D(e,L("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(De=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=De?L("span","​"):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Oe(e){if(null!=Le)return Le;var t=D(e,document.createTextNode("AخA")),n=M(t,0,1).getBoundingClientRect(),r=M(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(Le=r.right-n.right<3)}var Ne,Fe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ie=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Re="oncopy"in(Ne=L("div"))||(Ne.setAttribute("oncopy","return;"),"function"==typeof Ne.oncopy),We=null;function Ee(e){if(null!=We)return We;var t=D(e,L("span","x")),n=t.getBoundingClientRect(),r=M(t,0,1).getBoundingClientRect();return We=Math.abs(n.left-r.left)>1}var ze={},He={};function Be(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ze[e]=t}function Ve(e,t){He[e]=t}function Ye(e){if("string"==typeof e&&He.hasOwnProperty(e))e=He[e];else if(e&&"string"==typeof e.name&&He.hasOwnProperty(e.name)){var t=He[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ye("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ye("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ue(e,t){t=Ye(t);var n=ze[t.name];if(!n)return Ue(e,"text/plain");var r=n(e,t);if(je.hasOwnProperty(t.name)){var i=je[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var je={};function Ge(e,t){W(t,je.hasOwnProperty(e)?je[e]:je[e]={})}function qe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function $e(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ke(e,t,n){return!e.startState||e.startState(t,n)}var Ze=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?ot(n,Xe(e,n).text.length):ft(t,Xe(e,t.line).text.length)}function ft(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function pt(e,t){for(var n=[],r=0;r=this.string.length},Ze.prototype.sol=function(){return this.pos==this.lineStart},Ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ze.prototype.next=function(){if(this.post},Ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ze.prototype.skipToEnd=function(){this.pos=this.string.length},Ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ze.prototype.backUp=function(e){this.pos-=e},Ze.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var gt=function(e,t){this.state=e,this.lookAhead=t},mt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function vt(e,t,n,r){var i=[e.state.modeGen],o={};Ct(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,Ct(e,t.text,s.mode,n,(function(e,t){for(var n=l;ce&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&qe(e.doc.mode,r.state),o=vt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new mt(r,!0,t);var o=Tt(e,t,n),a=o>r.first&&Xe(r,o-1).stateAfter,s=a?mt.fromSaved(r,a,o):new mt(r,Ke(r.mode),o);return r.iter(o,t,(function(n){xt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}mt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mt.fromSaved=function(e,t,n){return t instanceof gt?new mt(e,qe(e.mode,t.state),n,t.lookAhead):new mt(e,qe(e.mode,t),n)},mt.prototype.save=function(e){var t=!1!==e?qe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t};var kt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function St(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Xe(a,(t=ht(a,t)).line),c=bt(e,t.line,n),u=new Ze(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pose.options.maxHighlightLength?(s=!1,a&&xt(e,t,r,d.pos),d.pos=t.length,l=null):l=Mt(_t(n,d,r.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;ca;--s){if(s<=o.first)return o.first;var l=Xe(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof gt?c.lookAhead:0)<=o.modeFrontier))return s;var u=E(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}function Dt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Xe(e,r).stateAfter;if(i&&(!(i instanceof gt)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Nt(a,o.from,s?null:o.to))}}return r}function Et(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;b0)){var u=[l,1],d=at(c.from,s.from),h=at(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function Vt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||Gt(n,o.marker)<0)&&(n=o.marker)}return n}function Xt(e,t,n,r,i){var o=Xe(e,t),a=Pt&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(c.to,n)>=0:at(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(c.from,r)<=0:at(c.from,r)<0)))return!0}}}function Jt(e){for(var t;t=$t(e);)e=t.find(-1,!0).line;return e}function Qt(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function en(e){for(var t,n;t=Kt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=Xe(e,t),r=Jt(n);return n==r?t:tt(r)}function nn(e,t){if(t>e.lastLine())return t;var n,r=Xe(e,t);if(!rn(e,r))return t;for(;n=Kt(r);)r=n.find(1,!0).line;return tt(r)+1}function rn(e,t){var n=Pt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var cn=function(e,t,n){this.text=e,Yt(this,t),this.height=n?n(this):1};function un(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Vt(e),Yt(e,n);var i=r?r(e):1;i!=e.height&&et(e,i)}function dn(e){e.parent=null,Vt(e)}cn.prototype.lineNo=function(){return tt(this)},we(cn);var hn={},fn={};function pn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?fn:hn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function gn(e,t){var n=P("span",null,null,l?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=vn,Oe(e.display.measure)&&(a=he(o,e.doc.direction))&&(r.addToken=bn(r.addToken,a)),r.map=[],wn(o,r,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=F(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=F(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ae(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=F(r.pre.className,r.textClass||"")),r}function mn(e){var t=L("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vn(e,t,n,r,i,o,l){if(t){var c,u=e.splitSpaces?yn(t,e.trailingSpace):t,d=e.cm.state.specialChars,h=!1;if(d.test(t)){c=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var p=d.exec(t),g=p?p.index-f:t.length-f;if(g){var m=document.createTextNode(u.slice(f,f+g));a&&s<9?c.appendChild(L("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!p)break;f+=g+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(L("span",$(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=c.appendChild(L("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?c.appendChild(L("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||h||o||l){var x=n||"";r&&(x+=r),i&&(x+=i);var w=L("span",[c],x,o);if(l)for(var _ in l)l.hasOwnProperty(_)&&"style"!=_&&"class"!=_&&w.setAttribute(_,l[_]);return e.content.appendChild(w)}e.content.appendChild(c)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&d.from<=c);h++);if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function xn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function wn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,d,h,f=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=c=u=s="",h=null,d=null,v=1/0;for(var y=[],b=void 0,x=0;xp||_.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&w.from==p&&(u+=" "+_.startStyle),_.endStyle&&w.to==v&&(b||(b=[])).push(_.endStyle,w.to),_.title&&((h||(h={})).title=_.title),_.attributes)for(var k in _.attributes)(h||(h={}))[k]=_.attributes[k];_.collapsed&&(!d||Gt(d.marker,_)<0)&&(d=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var S=0;S=f)break;for(var C=Math.min(f,v);;){if(m){var T=p+m.length;if(!d){var D=T>C?m.slice(0,C-p):m;t.addToken(t,D,a?a+l:l,u,p+D.length==v?c:"",s,h)}if(T>=C){m=m.slice(C-p),p=C;break}p=T,u=""}m=i.slice(o,o=n[g++]),a=pn(n[g++],t.cm.options)}}else for(var L=1;L2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Qn(e,t){var n=tt(t=Jt(t)),r=e.display.externalMeasured=new _n(e.doc,t,n);r.lineN=n;var i=r.built=gn(e,r);return r.text=i.pre,D(e.display.lineMeasure,i.pre),r}function er(e,t,n,r){return rr(e,nr(e,t),n,r)}function tr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c=0&&(n=e[i]).left==n.right;i--);return n}function lr(e,t,n,r){var i,o=ar(t.map,n,r),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;c&&oe(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u0&&(d=r="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Pr(e.display),top:p.top,bottom:p.bottom}:or}for(var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var d=ue(s,l,c),h=ce,f=u(l,d,"before"==c);return null!=h&&(f.other=u(l,h,"before"!=c)),f}function xr(e,t){var n=0;t=ht(e.doc,t),e.options.lineWrapping||(n=Pr(e.display)*t.ch);var r=Xe(e.doc,t.line),i=an(r)+jn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function wr(e,t,n,r,i){var o=ot(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function _r(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return wr(r.first,0,null,-1,-1);var i=nt(r,n),o=r.first+r.size-1;if(i>o)return wr(r.first+r.size-1,Xe(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Xe(r,i);;){var s=Cr(e,a,i,t,n),l=Zt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=Xe(r,i=c.line)}}function kr(e,t,n,r){r-=gr(t);var i=t.text.length,o=se((function(t){return rr(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=se((function(t){return rr(e,n,t).top>r}),o,i)}}function Sr(e,t,n,r){return n||(n=nr(e,t)),kr(e,t,n,mr(e,t,rr(e,n,r),"line").top)}function Mr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Cr(e,t,n,r,i){i-=an(t);var o=nr(e,t),a=gr(t),s=0,l=t.text.length,c=!0,u=he(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Dr:Tr)(e,t,n,o,u,r,i);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var h,f,p=null,g=null,m=se((function(t){var n=rr(e,o,t);return n.top+=a,n.bottom+=a,!!Mr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,g=n),!0)}),s,l),v=!1;if(g){var y=r-g.left=x.bottom?1:0}return wr(n,m=ae(t.text,m,1),f,v,r-h)}function Tr(e,t,n,r,i,o,a){var s=se((function(s){var l=i[s],c=1!=l.level;return Mr(br(e,ot(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=br(e,ot(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Mr(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function Dr(e,t,n,r,i,o,a){var s=kr(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h=c||f.to<=l)){var p=rr(e,r,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=pg)&&(u=f,d=g)}}return u||(u=i[i.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Lr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ir){ir=L("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(L("br"));ir.appendChild(document.createTextNode("x"))}D(e.measure,ir);var n=ir.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Pr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=L("span","xxxxxxxxxx"),n=L("pre",[t],"CodeMirror-line-like");D(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ar(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Or(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Or(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Nr(e){var t=Lr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Pr(e.display)-3);return function(i){if(rn(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Xe(e.doc,c.line).text).length==c.ch){var u=E(l,l.length,e.options.tabSize)-l.length;c=ot(c.line,Math.max(0,Math.round((o-qn(e.display).left)/Pr(e.display))-u))}return c}function Rr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Pt&&tn(e.doc,t)i.viewFrom?zr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)zr(e);else if(t<=i.viewFrom){var o=Hr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):zr(e)}else if(n>=i.viewTo){var a=Hr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):zr(e)}else{var s=Hr(e,t,t,-1),l=Hr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(kn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):zr(e)}var c=i.externalMeasured;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Rr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function zr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Hr(e,t,n,r){var i,o=Rr(e,t),a=e.display.view;if(!Pt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;tn(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Br(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=kn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=kn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Rr(e,n)))),r.viewTo=n}function Vr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Kr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Xr(e))}function Zr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))}),100)}function Xr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),$r(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(e,"blur",e,t),e.state.focused=!1,C(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Qr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||h<-.005)&&(et(i.line,l),ei(i.line),i.rest))for(var f=0;fe.display.sizerWidth){var p=Math.ceil(c/Pr(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function ei(e){if(e.widgets)for(var t=0;t=a&&(o=nt(t,an(Xe(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ni(e,t){if(!ye(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=L("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-jn(e.display))+"px;\n height: "+(t.bottom-t.top+$n(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ri(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=br(e,t),l=n&&n!=t?br(e,n):s,c=oi(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(hi(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(pi(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ii(e,t){var n=oi(e,t);null!=n.scrollTop&&hi(e,n.scrollTop),null!=n.scrollLeft&&pi(e,n.scrollLeft)}function oi(e,t){var n=e.display,r=Lr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Zn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Gn(n),l=t.tops-r;if(t.topi+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,f=Kn(e)-n.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+h-3&&(a.scrollLeft=t.right+(p?0:10)-f),a}function ai(e,t){null!=t&&(ui(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function si(e){ui(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function li(e,t,n){null==t&&null==n||ui(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ci(e,t){ui(e),e.curOp.scrollToPos=t}function ui(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,di(e,xr(e,t.from),xr(e,t.to),t.margin))}function di(e,t,n,r){var i=oi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});li(e,i.scrollLeft,i.scrollTop)}function hi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Yi(e,{top:t}),fi(e,t,!0),n&&Yi(e),Ii(e,100))}function fi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function pi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,qi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Gn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+$n(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var mi=function(e,t,n){this.cm=n;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),pe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),pe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},mi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},mi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},mi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var vi=function(){};function yi(e,t){t||(t=gi(e));var n=e.display.barWidth,r=e.display.barHeight;bi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Qr(e),bi(e,gi(e)),n=e.display.barWidth,r=e.display.barHeight}function bi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}vi.prototype.update=function(){return{bottom:0,right:0}},vi.prototype.setScrollLeft=function(){},vi.prototype.setScrollTop=function(){},vi.prototype.clear=function(){};var xi={native:mi,null:vi};function wi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?pi(e,t):hi(e,t)}),e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var _i=0;function ki(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++_i},Mn(e.curOp)}function Si(e){var t=e.curOp;t&&Tn(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ti(e){e.updatedDisplay=e.mustUpdate&&Bi(e.cm,e.update)}function Di(e){var t=e.cm,n=t.display;e.updatedDisplay&&Qr(t),e.barMeasure=gi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=er(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+$n(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Kn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Li(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=bt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?qe(t.mode,r.state):null,l=vt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&hn)return Ii(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Ai(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Vr(e))return!1;$i(e)&&(zr(e),t.dims=Ar(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Pt&&(o=tn(e.doc,o),a=nn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Br(e,o,a),n.viewOffset=an(Xe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Vr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=zi(e);return l>4&&(n.lineDiv.style.display="none"),Ui(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Hi(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Ii(e,400)),n.updateLineNumbers=null,!0}function Vi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Kn(e))r&&(t.visible=ti(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Gn(e.display)-Zn(e),n.top)}),t.visible=ti(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Bi(e,t))break;Qr(e);var i=gi(e);Yr(e),yi(e,i),Gi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Yi(e,t){var n=new Wi(e,t);if(Bi(e,n)){Qr(e),Vi(e,n);var r=gi(e);Yr(e),yi(e,r),Gi(e,r),n.finish()}}function Ui(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d-1&&(f=!1),An(e,h,u,n)),f&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(it(e.options,u)))),a=h.node.nextSibling}else{var p=zn(e,h,u,n);o.insertBefore(p,a)}u+=h.size}for(;a;)a=s(a)}function ji(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Gi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+$n(e)+"px"}function qi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Or(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;as.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||o&&u){if(o&&y&&l)e:for(var h=t.target,f=a.view;h!=s;h=h.parentNode)for(var p=0;p=0&&at(e,r.to())<=0)return n}return-1};var oo=function(e,t){this.anchor=e,this.head=t};function ao(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return at(e.from(),t.from())})),n=H(t,i);for(var o=1;o0:l>=0){var c=ut(s.from(),a.from()),u=ct(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new oo(d?u:c,d?c:u))}}return new io(t,n)}function so(e,t){return new io([new oo(e,t||e)],0)}function lo(e){return e.text?ot(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function co(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return lo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=lo(t).ch-t.to.ch),ot(n,r)}function uo(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}Ln(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}function Co(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Mo(i,i.lastOp==r)))a=K(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=lo(t):o.changes.push(ko(e,t));else{var l=K(i.done);for(l&&l.ranges||Lo(e.sel,i.done),o={changes:[ko(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ve(e,"historyAdded")}function To(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Do(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(e,o,K(i.done),t))?i.done[i.done.length-1]=t:Lo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function Lo(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Po(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Ao(e){if(!e)return null;for(var t,n=0;n-1&&(K(s)[d]=c[d],delete c[d])}}}return r}function Io(e,t,n,r){if(r){var i=e.anchor;if(n){var o=at(t,i)<0;o!=at(n,i)<0?(i=t,t=n):o!=at(t,n)<0&&(t=n)}return new oo(i,t)}return new oo(n||t,t)}function Ro(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Vo(e,new io([Io(e.sel.primary(),t,n,i)],0),r)}function Wo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(ve(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(d=Ko(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(h=at(d,n))&&(r<0?h<0:h>0))return qo(e,d,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=Ko(e,f,r,f.line==t.line?o:null)),f?qo(e,f,t,r,i):null}}return t}function $o(e,t,n,r,i){var o=r||1,a=qo(e,t,n,o,i)||!i&&qo(e,t,n,o,!0)||qo(e,t,n,-o,i)||!i&&qo(e,t,n,-o,!0);return a||(e.cantEdit=!0,ot(e.first,0))}function Ko(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ht(e,ot(t.line-1)):null:n>0&&t.ch==(r||Xe(e,t.line)).text.length?t.line=0;--i)Qo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Qo(e,t)}}function Qo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var n=uo(e,t);Co(e,t,n,e.cm?e.cm.curOp.id:NaN),na(e,t,n,zt(e,t));var r=[];yo(e,(function(e,n){n||-1!=H(r,e.history)||(sa(e.history,t),r.push(e.history)),na(e,t,null,zt(e,t))}))}}function ea(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--f){var p=h(f);if(p)return p.v}}}}function ta(e,t){if(0!=t&&(e.first+=t,e.sel=new io(Z(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Wr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:ot(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=uo(e,t)),e.cm?ra(e.cm,t,r):vo(e,t,r),Yo(e,n,Y),e.cantEdit&&$o(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function ra(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=tt(Jt(Xe(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),vo(r,t,n,Nr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=sn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Dt(r,o.line),Ii(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Wr(e):o.line!=a.line||1!=t.text.length||mo(e.doc,t)?Wr(e,o.line,a.line+1,c):Er(e,o.line,"text");var u=xe(e,"changes"),d=xe(e,"change");if(d||u){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Ln(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function ia(e,t,n,r,i){var o;r||(r=n),at(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function oa(e,t,n,r){n1||!(this.children[0]instanceof ca))){var s=[];this.collapse(s),this.children=[new ca(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xt(e,t.line,t,n,o)||t.line!=n.line&&Xt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ot()}o.addToHistory&&Co(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Jt(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(e,0),Rt(e,new Nt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){rn(e,t)&&et(t,0)})),o.clearOnEnter&&pe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(At(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++pa,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Wr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)Er(c,u,"text");o.atomic&&jo(c.doc),Ln(c,"markerAdded",c,o)}return o}ga.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&ki(e),xe(this,"clear")){var n=this.find();n&&Ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Wr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&jo(e.doc)),e&&Ln(e,"markerCleared",e,this,r,i),t&&Si(e),this.parent&&this.parent.clear()}},ga.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)Jo(this,r[l]);s?Bo(this,s):this.cm&&si(this.cm)})),undo:Fi((function(){ea(this,"undo")})),redo:Fi((function(){ea(this,"redo")})),undoSelection:Fi((function(){ea(this,"undo",!0)})),redoSelection:Fi((function(){ea(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ht(this,e),t=ht(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),ht(this,ot(n,t))},indexFromPos:function(e){var t=(e=ht(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Yo(t.doc,so(n,n)),h)for(var f=0;f=0;t--)ia(e.doc,"",r[t].from,r[t].to,"+delete");si(e)}))}function qa(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function $a(e,t,n){var r=qa(e,t.ch,n);return null==r?null:new ot(t.line,r,n<0?"after":"before")}function Ka(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=he(n,t.doc.direction);if(o){var a,s=i<0?K(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=nr(t,n);a=i<0?n.text.length-1:0;var u=rr(t,c,a).top;a=se((function(e){return rr(t,c,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=qa(n,a,1))}else a=i<0?s.to:s.from;return new ot(r,a,l)}}return new ot(r,i<0?n.text.length:0,i<0?"before":"after")}function Za(e,t,n,r){var i=he(t,e.doc.direction);if(!i)return $a(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ue(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&h>=u.begin)){var f=d?"before":"after";return new ot(n.line,h,f)}}var p=function(e,t,r){for(var o=function(e,t){return t?new ot(n.line,l(e,1),"before"):new ot(n.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==m||r>0&&m==t.text.length||!(g=p(r>0?0:i.length-1,r,c(m)))?null:g}Ea.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ea.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ea.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","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"},Ea.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","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","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"]},Ea.default=y?Ea.macDefault:Ea.pcDefault;var Xa={selectAll:Zo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Y)},killLine:function(e){return Ga(e,(function(t){if(t.empty()){var n=Xe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new ot(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ot(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Xe(e.doc,i.line-1).text;a&&(i=new ot(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ot(i.line-1,a.length-1),i,"+transpose"))}n.push(new oo(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Ai(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(at((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(at(i.to(),t)>0||t.xRel<0)?_s(e,r,t,o):Ss(e,r,t,o)}function _s(e,t,n,r){var i=e.display,o=!1,c=Oi(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Zr(e)),me(i.wrapper.ownerDocument,"mouseup",c),me(i.wrapper.ownerDocument,"mousemove",u),me(i.scroller,"dragstart",d),me(i.scroller,"drop",c),o||(_e(t),r.addNew||Ro(e.doc,n,null,null,r.extend),l&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,pe(i.wrapper.ownerDocument,"mouseup",c),pe(i.wrapper.ownerDocument,"mousemove",u),pe(i.scroller,"dragstart",d),pe(i.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ks(e,t,n){if("char"==n)return new oo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new oo(ot(t.line,0),ht(e.doc,ot(t.line+1,0)));var r=n(e,t);return new oo(r.from,r.to)}function Ss(e,t,n,r){a&&Zr(e);var i=e.display,o=e.doc;_e(t);var s,l,c=o.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?u[l]:new oo(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new oo(n,n)),n=Ir(e,t,!0,!0),l=-1;else{var d=ks(e,n,r.unit);s=r.extend?Io(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=u.length,Vo(o,ao(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(Vo(o,ao(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Eo(o,l,s,U):(l=0,Vo(o,new io([s],0),U),c=o.sel);var h=n;function f(t){if(0!=at(h,t))if(h=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,u=E(Xe(o,n.line).text,n.ch,a),d=E(Xe(o,t.line).text,t.ch,a),f=Math.min(u,d),p=Math.max(u,d),g=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=m;g++){var v=Xe(o,g).text,y=G(v,f,a);f==p?i.push(new oo(ot(g,y),ot(g,y))):v.length>y&&i.push(new oo(ot(g,y),ot(g,G(v,p,a))))}i.length||i.push(new oo(n,n)),Vo(o,ao(e,c.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=s,w=ks(e,t,r.unit),_=x.anchor;at(w.anchor,_)>0?(b=w.head,_=ut(x.from(),w.anchor)):(b=w.anchor,_=ct(x.to(),w.head));var k=c.ranges.slice(0);k[l]=Ms(e,new oo(ht(o,_),b)),Vo(o,ao(e,k,l),U)}}var p=i.wrapper.getBoundingClientRect(),g=0;function m(t){var n=++g,a=Ir(e,t,!0,"rectangle"==r.unit);if(a)if(0!=at(a,h)){e.curOp.focus=O(),f(a);var s=ti(i,o);(a.line>=s.to||a.linep.bottom?20:0;l&&setTimeout(Oi(e,(function(){g==n&&(i.scroller.scrollTop+=l,m(t))})),50)}}function v(t){e.state.selectingText=!1,g=1/0,t&&(_e(t),i.input.focus()),me(i.wrapper.ownerDocument,"mousemove",y),me(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Oi(e,(function(e){0!==e.buttons&&Te(e)?m(e):v(e)})),b=Oi(e,v);e.state.selectingText=b,pe(i.wrapper.ownerDocument,"mousemove",y),pe(i.wrapper.ownerDocument,"mouseup",b)}function Ms(e,t){var n=t.anchor,r=t.head,i=Xe(e.doc,n.line);if(0==at(n,r)&&n.sticky==r.sticky)return t;var o=he(i);if(!o)return t;var a=ue(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ue(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var h=o[c+(l?-1:0)],f=l==(1==h.level),p=f?h.from:h.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?t:new oo(new ot(n.line,p,g),r)}function Cs(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&_e(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!xe(e,n))return Se(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return ve(e,n,e,nt(e.doc,o),e.display.gutterSpecs[l].className,t),Se(t)}}function Ts(e,t){return Cs(e,t,"gutterClick",!0)}function Ds(e,t){Un(e.display,t)||Ls(e,t)||ye(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Ls(e,t){return!!xe(e,"gutterContextMenu")&&Cs(e,t,"gutterContextMenu",!1)}function Ps(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hr(e)}ms.prototype.compare=function(e,t,n){return this.time+gs>e&&0==at(t,this.pos)&&n==this.button};var As={toString:function(){return"CodeMirror.Init"}},Os={},Ns={};function Fs(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=As&&i(e,t,n)}:i)}e.defineOption=n,e.Init=As,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,po(e)}),!0),n("indentUnit",2,po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){go(e),hr(e),Wr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ot(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ia(e.doc,t,n[i],ot(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=As&&e.refresh()})),n("specialCharPlaceholder",mn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ps(e),Xi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=ja(t),i=n!=As&&ja(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Ki(t,e.options.lineNumbers),Xi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Or(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){wi(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Ki(e.options.gutters,t),Xi(e)}),!0),n("firstLineNumber",1,Xi,!0),n("lineNumberFormatter",(function(e){return e}),Xi,!0),n("showCursorWhenSelecting",!1,Yr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Is),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Yr,!0),n("singleCursorHeightPerLine",!0,Yr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,go,!0),n("addModeClass",!1,go,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,go,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Is(e,t,n){if(!t!=!(n&&n!=As)){var r=e.display.dragFunctions,i=t?pe:me;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Rs(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(C(e.display.wrapper,"CodeMirror-wrap"),ln(e)),Fr(e),Wr(e),hr(e),setTimeout((function(){return yi(e)}),100)}function Ws(e,t){var n=this;if(!(this instanceof Ws))return new Ws(e,t);this.options=t=t?W(t):{},W(Os,t,!1);var r=t.value;"string"==typeof r?r=new ka(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ws.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,Ps(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wi(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 z,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Es(this),Aa(),ki(this),this.curOp.forceUpdate=!0,bo(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xr(n)}),20):Jr(this),Ns)Ns.hasOwnProperty(c)&&Ns[c](this,t[c],As);$i(this),t.finishInit&&t.finishInit(this);for(var u=0;u400}pe(t.scroller,"touchstart",(function(i){if(!ye(e,i)&&!o(i)&&!Ts(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Un(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new oo(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new oo(ot(a.line,0),ht(e.doc,ot(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),_e(n)}i()})),pe(t.scroller,"touchcancel",i),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(hi(e,t.scroller.scrollTop),pi(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return ro(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return ro(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Me(t)},over:function(t){ye(e,t)||(Ta(e,t),Me(t))},start:function(t){return Ca(e,t)},drop:Oi(e,Ma),leave:function(t){ye(e,t)||Da(e)}};var c=t.input.getField();pe(c,"keyup",(function(t){return ds.call(e,t)})),pe(c,"keydown",Oi(e,cs)),pe(c,"keypress",Oi(e,hs)),pe(c,"focus",(function(t){return Xr(e,t)})),pe(c,"blur",(function(t){return Jr(e,t)}))}Ws.defaults=Os,Ws.optionHandlers=Ns;var zs=[];function Hs(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=bt(e,t).state:n="prev");var a=e.options.tabSize,s=Xe(o,t),l=E(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==V||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?E(Xe(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)h+=a,d+="\t";if(ha,l=Fe(t),c=null;if(s&&r.ranges.length>1)if(Bs&&Bs.text.join("\n")==t){if(r.ranges.length%Bs.text.length==0){c=[];for(var u=0;u=0;h--){var f=r.ranges[h],p=f.from(),g=f.to();f.empty()&&(n&&n>0?p=ot(p.line,p.ch-n):e.state.overwrite&&!s?g=ot(g.line,Math.min(Xe(o,g.line).text.length,g.ch+K(l).length)):s&&Bs&&Bs.lineWise&&Bs.text.join("\n")==l.join("\n")&&(p=g=ot(p.line,0)));var m={from:p,to:g,text:c?c[h%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Jo(e.doc,m),Ln(e,"inputRead",e,m)}t&&!s&&js(e,t),si(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Us(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Ai(t,(function(){return Ys(t,n,0,null,"paste")})),!0}function js(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Hs(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Hs(e,i.head.line,"smart"));a&&Ln(e,"electricInput",e,i.head.line)}}}function Gs(e){for(var t=[],n=[],r=0;rn&&(Hs(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&si(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Eo(this.doc,r,new oo(o,c[r].to()),Y)}}})),getTokenAt:function(e,t){return St(this,e,t)},getLineTokens:function(e,t){return St(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=ht(this.doc,e);var t,n=yt(this,Xe(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Xe(this.doc,e)}else r=e;return mr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-an(r):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=br(this,ht(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ii(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Ni(cs),triggerOnKeyPress:Ni(hs),triggerOnKeyUp:ds,triggerOnMouseDown:Ni(ys),execCommand:function(e){if(Xa.hasOwnProperty(e))return Xa[e].call(null,this)},triggerElectric:Ni((function(e){js(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ht(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Fr(this),ve(this,"refresh",this)})),swapDoc:Ni((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),hr(this),this.display.input.reset(),li(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[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}},we(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Zs(e,t,n,r,i){var o=t,a=n,s=Xe(e,t.line),l=i&&"rtl"==e.direction?-n:n;function c(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new ot(n,t.ch,t.sticky),s=Xe(e,n))}function u(o){var a;if("codepoint"==r){var u=s.text.charCodeAt(t.ch+(r>0?0:-1));a=isNaN(u)?null:new ot(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=i?Za(e.cm,s,t,n):$a(s,t,n);if(null==a){if(o||!c())return!1;t=Ka(i,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var d=null,h="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||u(!p);p=!1){var g=s.text.charAt(t.ch)||"\n",m=ne(g,f)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||p||m||(m="s"),d&&d!=m){n<0&&(n=1,u(),t.sticky="after");break}if(m&&(d=m),n>0&&!u(!p))break}var v=$o(e,t,o,a,!0);return st(o,v)&&(v.hitSide=!0),v}function Xs(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Lr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=_r(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Js=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qs(e,t){var n=tr(e,t.line);if(!n||n.hidden)return null;var r=Xe(e.doc,t.line),i=Jn(n,r,t.line),o=he(r,e.doc.direction),a="left";o&&(a=ue(o,t.ch)%2?"right":"left");var s=ar(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function el(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function tl(e,t){return t&&(e.bad=!0),e}function nl(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(ot(r,0),ot(i+1,0),c(+f));return void(p.length&&(o=p[0].find(0))&&d(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&u();for(var m=0;m=t.display.viewTo||o.line=t.display.viewFrom&&Qs(t,i)||{node:l[0].measure.map[2],offset:0},u=o.liner.firstLine()&&(a=ot(a.line-1,Xe(r.doc,a.line-1).length)),s.ch==Xe(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Rr(r,a.line))?(t=tt(i.view[0].line),n=i.view[0].node):(t=tt(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=Rr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=tt(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(nl(r,n,c,t,l)),h=Je(r.doc,ot(t,0),ot(l,Xe(r.doc,l).text.length));d.length>1&&h.length>1;)if(K(d)==K(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),t++}for(var f=0,p=0,g=d[0],m=h[0],v=Math.min(g.length,m.length);fa.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=ot(t,f),_=ot(l,h.length?K(h).length-p:0);return d.length>1||d[0]||at(w,_)?(ia(r.doc,d,w,_,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ai(this.cm,(function(){return Wr(e.cm)}))},Js.prototype.setUneditable=function(e){e.contentEditable="false"},Js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Oi(this.cm,Ys)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var ol=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};function al(e,t){if((t=t?W(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=O();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(me(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Ws((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function sl(e){e.off=me,e.on=pe,e.wheelEventPixels=no,e.Doc=ka,e.splitLines=Fe,e.countColumn=E,e.findColumn=G,e.isWordChar=te,e.Pass=V,e.signal=ve,e.Line=cn,e.changeEnd=lo,e.scrollbarModel=xi,e.Pos=ot,e.cmpPos=at,e.modes=ze,e.mimeModes=He,e.resolveMode=Ye,e.getMode=Ue,e.modeExtensions=je,e.extendMode=Ge,e.copyState=qe,e.startState=Ke,e.innerMode=$e,e.commands=Xa,e.keyMap=Ea,e.keyName=Ua,e.isModifierKey=Va,e.lookupKey=Ba,e.normalizeKeyMap=Ha,e.StringStream=Ze,e.SharedTextMarker=va,e.TextMarker=ga,e.LineWidget=da,e.e_preventDefault=_e,e.e_stopPropagation=ke,e.e_stop=Me,e.addClass=N,e.contains=A,e.rmClass=C,e.keyNames=Fa}ol.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ye(r,e)){if(r.somethingSelected())Vs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Gs(r);Vs({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,Y):(n.prevInput="",i.value=t.text.join("\n"),I(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),pe(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),pe(i,"paste",(function(e){ye(r,e)||Us(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pe(i,"cut",o),pe(i,"copy",o),pe(e.scroller,"paste",(function(t){if(!Un(e,t)&&!ye(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),pe(e.lineSpace,"selectstart",(function(t){Un(e,t)||_e(t)})),pe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(e){this.wrapper=$s(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ur(e);if(e.options.moveInputWithCursor){var i=br(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},ol.prototype.showSelection=function(e){var t=this.cm.display;D(t.cursorDiv,e.cursors),D(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ol.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||O()!=this.textarea))try{this.textarea.focus()}catch(e){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ol.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},ol.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Ir(n,e),c=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Oi(n,Vo)(n.doc,so(o),Y);var u,h=i.style.cssText,f=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&m(),k){Me(e);var g=function(){me(window,"mouseup",g),setTimeout(v,20)};pe(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&m();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Oi(n,Zo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,Fs(Ws),Ks(Ws);var ll="iter insert remove copy getEditor constructor".split(" ");for(var cl in ka.prototype)ka.prototype.hasOwnProperty(cl)&&H(ll,cl)<0&&(Ws.prototype[cl]=function(e){return function(){return e.apply(this.doc,arguments)}}(ka.prototype[cl]));return we(ka),Ws.inputStyles={textarea:ol,contenteditable:Js},Ws.defineMode=function(e){Ws.defaults.mode||"null"==e||(Ws.defaults.mode=e),Be.apply(this,arguments)},Ws.defineMIME=Ve,Ws.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ws.defineMIME("text/plain","null"),Ws.defineExtension=function(e,t){Ws.prototype[e]=t},Ws.defineDocExtension=function(e,t){ka.prototype[e]=t},Ws.fromTextArea=al,sl(Ws),Ws.version="5.58.3",Ws}()}));fe((function(e,t){!function(e){function t(t,r){function i(){t.display.wrapper.offsetHeight?(n(t,r),t.display.lastWrapHeight!=t.display.wrapper.clientHeight&&t.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},e.on(window,"mouseup",r.hurry),e.on(window,"keyup",r.hurry)}function n(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,(function(e,r){e.state.autoRefresh&&(n(e,e.state.autoRefresh),e.state.autoRefresh=null),r&&0==e.display.wrapper.offsetHeight&&t(e,e.state.autoRefresh={delay:r.delay||250})}))}(ve)})),fe((function(e,t){var n,r,i;r={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1},(n=ve).defineMode("xml",(function(e,t){var o,a,s=e.indentUnit,l={},c=t.htmlMode?r:i;for(var u in c)l[u]=c[u];for(var u in t)l[u]=t[u];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(p("atom","]]>")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(g(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=h,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function h(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=f(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=h;break}return"string"};return t.isInAttribute=!0,t}function p(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function g(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=g(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=d;break}return n.tokenize=g(e-1),n.tokenize(t,n)}}return"meta"}}function m(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function v(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;v(e)}}function b(e,t,n){return"openTag"==e?(n.tagStart=t.column(),x):"closeTag"==e?w:b}function x(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",S):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",S(e,t,n)):(a="error",x)}function w(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&v(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",_):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",_(e,t,n)):(a="error",k)}function _(e,t,n){return"endTag"!=e?(a="error",_):(v(n),b)}function k(e,t,n){return a="error",_(e,t,n)}function S(e,t,n){if("word"==e)return a="attribute",M;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new m(n,r,i==n.indented)),b}return a="error",S}function M(e,t,n){return"equals"==e?C:(l.allowMissing||(a="error"),S(e,t,n))}function C(e,t,n){return"string"==e?T:"word"==e&&l.allowUnquoted?(a="string",S):(a="error",S(e,t,n))}function T(e,t,n){return"string"==e?T:S(e,t,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(e,t,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(i&&i.noIndent)return n.Pass;if(e.tokenize!=h&&e.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==C&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),n.defineMIME("text/xml","xml"),n.defineMIME("application/xml","xml"),n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})})),fe((function(e,t){var n;(n=ve).defineMode("yaml",(function(){var e=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i");return{token:function(t,n){var r=t.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==t.pos||/\s/.test(t.string.charAt(t.pos-1))))return t.skipToEnd(),"comment";if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&t.indentation()>n.keyCol)return t.skipToEnd(),"string";if(n.literal&&(n.literal=!1),t.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,t.match(/---/))return"def";if(t.match(/\.\.\./))return"def";if(t.match(/\s*-\s+/))return"meta"}if(t.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return t.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,t.next(),"meta";if(n.pairStart){if(t.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&t.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(t.match(e))return"keyword"}return!n.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=t.indentation(),"atom"):n.pair&&t.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,t.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}})),n.defineMIME("text/x-yaml","yaml"),n.defineMIME("text/yaml","yaml")})),fe((function(e,t){!function(e){function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var n=t(["and","or","not","is"]),r=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],i=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function o(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",r.concat(i)),e.defineMode("python",(function(a,s){for(var l="error",c=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,u=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],d=0;dr?S(t):i0&&C(e,t)&&(a+=" "+l),a}return w(e,t)}function w(e,t,r){if(e.eatSpace())return null;if(!r&&e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^[\d_]+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(o=!0),e.match(/^0b[01_]+/i)&&(o=!0),e.match(/^0o[0-7_]+/i)&&(o=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}if(e.match(v))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=_(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=k(e.current(),t.tokenize),t.tokenize(e,t));for(var a=0;a=0;)e=e.substr(1);var n=1==e.length,r="string";function i(e){return function(t,n){var r=w(t,n,!0);return"punctuation"==r&&("{"==t.current()?n.tokenize=i(e+1):"}"==t.current()&&(n.tokenize=e>1?i(e-1):o)),r}}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(e))return a.tokenize=t,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i(0),o.current()?r:a.tokenize(o,a);if(o.match("}}"))return r;if(o.match("}"))return l;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;a.tokenize=t}return r}return o.isString=!0,o}function k(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return r}else{if(i.match(e))return o.tokenize=t,r;i.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;o.tokenize=t}return r}return i.isString=!0,i}function S(e){for(;"py"!=o(e).type;)e.scopes.pop();e.scopes.push({offset:o(e).offset+a.indentUnit,type:"py",align:null})}function M(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+h,type:n,align:r})}function C(e,t){for(var n=e.indentation();t.scopes.length>1&&o(t).offset>n;){if("py"!=o(t).type)return!0;t.scopes.pop()}return o(t).offset!=n}function T(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(m,!1)?"meta":g?"operator":l;if(/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=o(t).type||S(t),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&M(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(t).type!=r)return l;t.indent=t.scopes.pop().offset-h}}return t.dedent>0&&e.eol()&&"py"==o(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}return{startState:function(e){return{tokenize:x,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=T(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+l:r},indent:function(t,n){if(t.tokenize!=x)return t.tokenize.isString?e.Pass:0;var r=o(t),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?h:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}})),e.defineMIME("text/x-python","python");var a=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:a("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})}(ve)}));const ye=new CSSStyleSheet;ye.replaceSync("/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\n direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n.cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: 0;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n background: white;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px; margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n outline: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -50px;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre.CodeMirror-line,\n.CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background-color: #ffa;\n background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n");const be=new CSSStyleSheet;be.replaceSync("/* Based on Sublime Text's Monokai theme */\n\n.cm-s-monokai.CodeMirror { background: #272822; color: #f8f8f2; }\n.cm-s-monokai div.CodeMirror-selected { background: #49483E; }\n.cm-s-monokai .CodeMirror-line::selection, .cm-s-monokai .CodeMirror-line > span::selection, .cm-s-monokai .CodeMirror-line > span > span::selection { background: rgba(73, 72, 62, .99); }\n.cm-s-monokai .CodeMirror-line::-moz-selection, .cm-s-monokai .CodeMirror-line > span::-moz-selection, .cm-s-monokai .CodeMirror-line > span > span::-moz-selection { background: rgba(73, 72, 62, .99); }\n.cm-s-monokai .CodeMirror-gutters { background: #272822; border-right: 0px; }\n.cm-s-monokai .CodeMirror-guttermarker { color: white; }\n.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; }\n.cm-s-monokai .CodeMirror-linenumber { color: #d0d0d0; }\n.cm-s-monokai .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }\n\n.cm-s-monokai span.cm-comment { color: #75715e; }\n.cm-s-monokai span.cm-atom { color: #ae81ff; }\n.cm-s-monokai span.cm-number { color: #ae81ff; }\n\n.cm-s-monokai span.cm-comment.cm-attribute { color: #97b757; }\n.cm-s-monokai span.cm-comment.cm-def { color: #bc9262; }\n.cm-s-monokai span.cm-comment.cm-tag { color: #bc6283; }\n.cm-s-monokai span.cm-comment.cm-type { color: #5998a6; }\n\n.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { color: #a6e22e; }\n.cm-s-monokai span.cm-keyword { color: #f92672; }\n.cm-s-monokai span.cm-builtin { color: #66d9ef; }\n.cm-s-monokai span.cm-string { color: #e6db74; }\n\n.cm-s-monokai span.cm-variable { color: #f8f8f2; }\n.cm-s-monokai span.cm-variable-2 { color: #9effff; }\n.cm-s-monokai span.cm-variable-3, .cm-s-monokai span.cm-type { color: #66d9ef; }\n.cm-s-monokai span.cm-def { color: #fd971f; }\n.cm-s-monokai span.cm-bracket { color: #f8f8f2; }\n.cm-s-monokai span.cm-tag { color: #f92672; }\n.cm-s-monokai span.cm-header { color: #ae81ff; }\n.cm-s-monokai span.cm-link { color: #ae81ff; }\n.cm-s-monokai span.cm-error { background: #f92672; color: #f8f8f0; }\n\n.cm-s-monokai .CodeMirror-activeline-background { background: #373831; }\n.cm-s-monokai .CodeMirror-matchingbracket {\n text-decoration: underline;\n color: white !important;\n}\n");let xe=class extends ne{constructor(){super(...arguments),this.readOnly=!1,this.mode="yaml"}static get styles(){return[ye,be]}updated(){if(!this.editor){const e=this.querySelector("textarea");if(!e)return;this.editor=ve.fromTextArea(e,{mode:this.mode,theme:"monokai",lineNumbers:!1,readOnly:this.readOnly,autoRefresh:!0})}}render(){return W``}};e([Z()],xe.prototype,"readOnly",void 0),e([Z()],xe.prototype,"mode",void 0),e([Z()],xe.prototype,"name",void 0),xe=e([$("pb-codemirror")],xe);let we=class extends ne{constructor(){super();const e=this.querySelector(".pf-c-dropdown__menu");this.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(t=>{e.hidden=!e.hidden}))}))}render(){return W``}};we=e([$("pb-dropdown")],we);let _e=class extends ne{constructor(){super(...arguments),this.url="",this.key="",this.value=""}comparison(e){let t={"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"<=":function(e,t){return e<=t},"==":function(e,t){return e==t},"!=":function(e,t){return e!=t},"===":function(e,t){return e===t},"!==":function(e,t){return e!==t}};const n=e.split(" ");if(n.length<3)throw new Error("nah");let r=n[0];r="value"===r?this.value:parseInt(r,10);let i=n[2];i="value"===i?this.value:parseInt(i,10);const o=n[1];if(!(o in t))throw new Error("Invalid comparison");return t[o](r,i)}firstUpdated(){fetch(this.url).then((e=>e.json())).then((e=>e[this.key])).then((e=>this.value=e))}render(){if(void 0===this.value)return W``;let e="";return this.querySelectorAll("[slot]").forEach((t=>{const n=t.getAttribute("slot");this.comparison(n)&&(e=n)})),this.querySelectorAll("[data-value]").forEach((e=>{e.textContent=this.value})),W``}};var ke;e([Z()],_e.prototype,"url",void 0),e([Z()],_e.prototype,"key",void 0),e([Z()],_e.prototype,"value",void 0),_e=e([$("fetch-fill-slot")],_e),function(e){e[e.redirect=0]="redirect",e[e.template=1]="template"}(ke||(ke={}));let Se=class extends ne{constructor(){super(...arguments),this.flowBodyUrl=""}createRenderRoot(){return this}firstUpdated(){fetch(this.flowBodyUrl).then((e=>{if(!e.ok)throw Error(e.statusText);return e})).then((e=>e.json())).then((e=>{this.updateCard(e)})).catch((e=>{this.errorMessage(e)}))}async updateCard(e){switch(e.type){case ke.redirect:window.location.assign(e.to);break;case ke.template:this.flowBody=e.body,await this.requestUpdate(),this.checkAutofocus(),ie(),this.loadFormCode(),this.setFormSubmitHandlers()}}loadFormCode(){this.querySelectorAll("script").forEach((e=>{let t=document.createElement("script");t.src=e.src,document.head.appendChild(t)}))}checkAutofocus(){const e=this.querySelector("[autofocus]");null!==e&&e.focus()}updateFormAction(e){for(let t=0;t{console.log("passbook/flows: Checking for autosubmit attribute "+e),this.checkAutosubmit(e),console.log("passbook/flows: Setting action for form "+e),this.updateFormAction(e),console.log("passbook/flows: Adding handler for form "+e),e.addEventListener("submit",(t=>{t.preventDefault();let n=new FormData(e);this.flowBody=void 0,fetch(this.flowBodyUrl,{method:"post",body:n}).then((e=>e.json())).then((e=>{this.updateCard(e)})).catch((e=>{this.errorMessage(e)}))})),e.classList.add("pb-flow-wrapped")}))}errorMessage(e){this.flowBody=`\n \n \n `}loading(){return W``}render(){return void 0!==this.flowBody?W`${this.flowBody}`:this.loading()}};e([Z()],Se.prototype,"flowBodyUrl",void 0),e([Z()],Se.prototype,"flowBody",void 0),Se=e([$("flow-shell-card")],Se);const Me=new CSSStyleSheet;Me.replaceSync(".pf-c-modal-box {\n --pf-c-modal-box--BackgroundColor: var(--pf-global--BackgroundColor--100);\n --pf-c-modal-box--BoxShadow: var(--pf-global--BoxShadow--xl);\n --pf-c-modal-box--ZIndex: var(--pf-global--ZIndex--xl);\n --pf-c-modal-box--Width: 100%;\n --pf-c-modal-box--MaxWidth: calc(100% - var(--pf-global--spacer--xl));\n --pf-c-modal-box--m-sm--sm--MaxWidth: 35rem;\n --pf-c-modal-box--m-md--Width: 52.5rem;\n --pf-c-modal-box--m-lg--lg--MaxWidth: 70rem;\n --pf-c-modal-box--MaxHeight: calc(100% - var(--pf-global--spacer--2xl));\n --pf-c-modal-box--m-align-top--spacer: var(--pf-global--spacer--sm);\n --pf-c-modal-box--m-align-top--xl--spacer: var(--pf-global--spacer--xl);\n --pf-c-modal-box--m-align-top--MarginTop: var(--pf-c-modal-box--m-align-top--spacer);\n --pf-c-modal-box--m-align-top--MaxHeight: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer), var(--pf-global--spacer--2xl)) - var(--pf-c-modal-box--m-align-top--spacer));\n --pf-c-modal-box--m-align-top--MaxWidth: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer) * 2, var(--pf-global--spacer--xl)));\n --pf-c-modal-box--m-danger__title-icon--Color: var(--pf-global--danger-color--100);\n --pf-c-modal-box--m-warning__title-icon--Color: var(--pf-global--warning-color--100);\n --pf-c-modal-box--m-success__title-icon--Color: var(--pf-global--success-color--100);\n --pf-c-modal-box--m-info__title-icon--Color: var(--pf-global--info-color--100);\n --pf-c-modal-box--m-default__title-icon--Color: var(--pf-global--default-color--200);\n --pf-c-modal-box__header--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__title--LineHeight: var(--pf-global--LineHeight--sm);\n --pf-c-modal-box__title--FontFamily: var(--pf-global--FontFamily--heading--sans-serif);\n --pf-c-modal-box__title--FontSize: var(--pf-global--FontSize--2xl);\n --pf-c-modal-box__title-icon--MarginRight: var(--pf-global--spacer--sm);\n --pf-c-modal-box__title-icon--Color: var(--pf-global--Color--100);\n --pf-c-modal-box__description--PaddingTop: var(--pf-global--spacer--xs);\n --pf-c-modal-box__body--MinHeight: calc(var(--pf-global--FontSize--md) * var(--pf-global--LineHeight--md));\n --pf-c-modal-box__body--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--body--PaddingTop: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--Top: calc(var(--pf-global--spacer--lg));\n --pf-c-modal-box--c-button--Right: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--sibling--MarginRight: calc(var(--pf-global--spacer--xl) + var(--pf-global--spacer--sm));\n --pf-c-modal-box__footer--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-global--spacer--md);\n --pf-c-modal-box__footer--c-button--sm--MarginRight: calc(var(--pf-c-modal-box__footer--c-button--MarginRight) / 2);\n position: relative;\n z-index: var(--pf-c-modal-box--ZIndex);\n display: flex;\n flex-direction: column;\n width: var(--pf-c-modal-box--Width);\n max-width: var(--pf-c-modal-box--MaxWidth);\n max-height: var(--pf-c-modal-box--MaxHeight);\n background-color: var(--pf-c-modal-box--BackgroundColor);\n box-shadow: var(--pf-c-modal-box--BoxShadow); }\n @media (min-width: 1200px) {\n .pf-c-modal-box {\n --pf-c-modal-box--m-align-top--spacer: var(--pf-c-modal-box--m-align-top--xl--spacer); } }\n .pf-c-modal-box.pf-m-sm {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-sm--sm--MaxWidth); }\n .pf-c-modal-box.pf-m-md {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-md--Width); }\n .pf-c-modal-box.pf-m-lg {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-lg--lg--MaxWidth); }\n .pf-c-modal-box.pf-m-align-top {\n top: var(--pf-c-modal-box--m-align-top--MarginTop);\n align-self: flex-start;\n max-width: var(--pf-c-modal-box--m-align-top--MaxWidth);\n max-height: var(--pf-c-modal-box--m-align-top--MaxHeight); }\n .pf-c-modal-box.pf-m-danger {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-danger__title-icon--Color); }\n .pf-c-modal-box.pf-m-warning {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-warning__title-icon--Color); }\n .pf-c-modal-box.pf-m-success {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-success__title-icon--Color); }\n .pf-c-modal-box.pf-m-default {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-default__title-icon--Color); }\n .pf-c-modal-box.pf-m-info {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-info__title-icon--Color); }\n .pf-c-modal-box > .pf-c-button {\n position: absolute;\n top: var(--pf-c-modal-box--c-button--Top);\n right: var(--pf-c-modal-box--c-button--Right); }\n .pf-c-modal-box > .pf-c-button + * {\n margin-right: var(--pf-c-modal-box--c-button--sibling--MarginRight); }\n\n.pf-c-modal-box__header {\n display: flex;\n flex-direction: column;\n padding-top: var(--pf-c-modal-box__header--PaddingTop);\n padding-right: var(--pf-c-modal-box__header--PaddingRight);\n padding-left: var(--pf-c-modal-box__header--PaddingLeft); }\n .pf-c-modal-box__header.pf-m-help {\n display: flex;\n flex-direction: row; }\n .pf-c-modal-box__header:last-child {\n padding-bottom: var(--pf-c-modal-box__header--last-child--PaddingBottom); }\n .pf-c-modal-box__header + .pf-c-modal-box__body {\n --pf-c-modal-box__body--PaddingTop: var(--pf-c-modal-box__header--body--PaddingTop); }\n\n.pf-c-modal-box__header-main {\n flex-grow: 1;\n min-width: 0; }\n\n.pf-c-modal-box__title,\n.pf-c-modal-box__title-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap; }\n\n.pf-c-modal-box__title {\n flex: 0 0 auto;\n font-family: var(--pf-c-modal-box__title--FontFamily);\n font-size: var(--pf-c-modal-box__title--FontSize);\n line-height: var(--pf-c-modal-box__title--LineHeight); }\n .pf-c-modal-box__title.pf-m-icon {\n display: flex; }\n\n.pf-c-modal-box__title-icon {\n margin-right: var(--pf-c-modal-box__title-icon--MarginRight);\n color: var(--pf-c-modal-box__title-icon--Color); }\n\n.pf-c-modal-box__description {\n padding-top: var(--pf-c-modal-box__description--PaddingTop); }\n\n.pf-c-modal-box__body {\n flex: 1 1 auto;\n min-height: var(--pf-c-modal-box__body--MinHeight);\n padding-top: var(--pf-c-modal-box__body--PaddingTop);\n padding-right: var(--pf-c-modal-box__body--PaddingRight);\n padding-left: var(--pf-c-modal-box__body--PaddingLeft);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n word-break: break-word;\n -webkit-overflow-scrolling: touch; }\n .pf-c-modal-box__body:last-child {\n padding-bottom: var(--pf-c-modal-box__body--last-child--PaddingBottom); }\n\n.pf-c-modal-box__footer {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n padding-top: var(--pf-c-modal-box__footer--PaddingTop);\n padding-right: var(--pf-c-modal-box__footer--PaddingRight);\n padding-bottom: var(--pf-c-modal-box__footer--PaddingBottom);\n padding-left: var(--pf-c-modal-box__footer--PaddingLeft); }\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n margin-right: var(--pf-c-modal-box__footer--c-button--MarginRight); }\n @media screen and (min-width: 576px) {\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-c-modal-box__footer--c-button--sm--MarginRight); } }\n");const Ce=new CSSStyleSheet;Ce.replaceSync(".pf-c-backdrop {\n --pf-c-backdrop--ZIndex: var(--pf-global--ZIndex--lg);\n --pf-c-backdrop--BackgroundColor: var(--pf-global--BackgroundColor--dark-transparent-100);\n position: fixed;\n top: 0;\n left: 0;\n z-index: var(--pf-c-backdrop--ZIndex);\n width: 100%;\n height: 100%;\n background-color: var(--pf-c-backdrop--BackgroundColor); }\n\n.pf-c-backdrop__open {\n overflow: hidden; }\n");let Te=class extends ne{constructor(){super(),this.href="",this.open=!1,window.addEventListener("keyup",(e=>{"Escape"===e.code&&(this.open=!1)}))}static get styles(){return[Me,ce,Ce]}setContent(e){this.querySelector("[slot=modal]").innerHTML=e,this.querySelectorAll("[slot=modal] a").forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),this.open=!1}))})),this.querySelectorAll("[slot=modal] form").forEach((e=>{e.addEventListener("submit",(t=>{t.preventDefault();let n=new FormData(e);fetch(e.action===window.location.toString()?this.href:e.action,{method:e.method,body:n}).then((e=>e.text())).then((e=>{-1!==e.indexOf("csrfmiddlewaretoken")?this.setContent(e):(this.open=!1,this.dispatchEvent(new CustomEvent("hashchange",{bubbles:!0})),ie())})).catch((e=>{console.error(e)}))}))}))}onClick(e){const t=new Request(this.href);fetch(t,{mode:"same-origin"}).then((e=>e.text())).then((e=>{this.setContent(e),this.open=!0})).catch((e=>{console.error(e)}))}renderModal(){return W`
        `}render(){return W`${this.open?this.renderModal():""}`}};e([Z()],Te.prototype,"href",void 0),e([Z()],Te.prototype,"open",void 0),Te=e([$("pb-modal-button")],Te);let De=class extends ne{constructor(){super(...arguments),this._currentPage="",this._firstPage=""}get currentPage(){return this._currentPage}set currentPage(e){var t,n;try{null===(t=this.querySelector(`.pf-c-tab-content[tab-name='${e}']`))||void 0===t||t.removeAttribute("hidden"),null===(n=this.querySelector(`.pf-c-tabs__item[tab-name='${e}']`))||void 0===n||n.classList.add("pf-m-current"),this.querySelectorAll(`.pf-c-tab-content:not([tab-name='${e}'])`).forEach((e=>{e.setAttribute("hidden","")})),this.querySelectorAll(`.pf-c-tabs__item:not([tab-name='${e}'])`).forEach((e=>{e.classList.remove("pf-m-current")})),window.location.hash="#"+e,this._currentPage=e}catch(e){this.currentPage=this._firstPage}}createRenderRoot(){return this}firstUpdated(){var e;this._firstPage=null===(e=this.querySelector(".pf-c-tab-content"))||void 0===e?void 0:e.getAttribute("tab-name"),window.location.hash?this.currentPage=window.location.hash:this.currentPage=this._firstPage,this.querySelectorAll(".pf-c-tabs__item > button").forEach((e=>{e.addEventListener("click",(t=>{var n;let r=null===(n=e.parentElement)||void 0===n?void 0:n.getAttribute("tab-name");this.currentPage=r}))}))}};De=e([$("pb-tabs")],De); +t.exports=function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}function n(t){return t&&t.default||t}t=t&&t.hasOwnProperty("default")?t.default:t;var r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},i=e((function(t){var e={};for(var n in r)r.hasOwnProperty(n)&&(e[r[n]]=n);var i=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var o in i)if(i.hasOwnProperty(o)){if(!("channels"in i[o]))throw new Error("missing channels property: "+o);if(!("labels"in i[o]))throw new Error("missing channel labels property: "+o);if(i[o].labels.length!==i[o].channels)throw new Error("channel and label counts mismatch: "+o);var a=i[o].channels,s=i[o].labels;delete i[o].channels,delete i[o].labels,Object.defineProperty(i[o],"channels",{value:a}),Object.defineProperty(i[o],"labels",{value:s})}function l(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}i.rgb.hsl=function(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a;return s===a?e=0:r===s?e=(i-o)/l:i===s?e=2+(o-r)/l:o===s&&(e=4+(r-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s===a?0:n<=.5?l/(s+a):l/(2-s-a)),100*n]},i.rgb.hsv=function(t){var e,n,r,i,o,a=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(a,s,l),c=u-Math.min(a,s,l),d=function(t){return(u-t)/6/c+.5};return 0===c?i=o=0:(o=c/u,e=d(a),n=d(s),r=d(l),a===u?i=r-n:s===u?i=1/3+e-r:l===u&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*u]},i.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[i.rgb.hsl(t)[0],1/255*Math.min(e,Math.min(n,r))*100,100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},i.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-i)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},i.rgb.keyword=function(t){var n=e[t];if(n)return n;var i,o=1/0;for(var a in r)if(r.hasOwnProperty(a)){var s=l(t,r[a]);s.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},i.rgb.lab=function(t){var e=i.rgb.xyz(t),n=e[0],r=e[1],o=e[2];return r/=100,o/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},i.hsl.rgb=function(t){var e,n,r,i,o,a=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[o=255*l,o,o];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var u=0;u<3;u++)(r=a+1/3*-(u-1))<0&&r++,r>1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[u]=255*o;return i},i.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),(r+n)/2*100]},i.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}},i.hsv.hsl=function(t){var e,n,r,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(e=(2-o)*s)<=1?e:2-e)||0),100*(r/=2)]},i.hwb.rgb=function(t){var e,n,r,i,o,a,s,l=t[0]/360,u=t[1]/100,c=t[2]/100,d=u+c;switch(d>1&&(u/=d,c/=d),r=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(r=1-r),i=u+r*((n=1-c)-u),e){default:case 6:case 0:o=n,a=i,s=u;break;case 1:o=i,a=n,s=u;break;case 2:o=u,a=n,s=i;break;case 3:o=u,a=i,s=n;break;case 4:o=i,a=u,s=n;break;case 5:o=n,a=u,s=i}return[255*o,255*a,255*s]},i.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},i.xyz.rgb=function(t){var e,n,r,i=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},i.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},i.lab.xyz=function(t){var e,n,r,i=t[0];e=t[1]/500+(n=(i+16)/116),r=n-t[2]/200;var o=Math.pow(n,3),a=Math.pow(e,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},i.lab.lch=function(t){var e,n=t[0],r=t[1],i=t[2];return(e=360*Math.atan2(i,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+i*i),e]},i.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},i.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],o=1 in arguments?arguments[1]:i.rgb.hsv(t)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===o&&(a+=60),a},i.hsv.ansi16=function(t){return i.rgb.ansi16(i.hsv.rgb(t),t[2])},i.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},i.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},i.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},i.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},i.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},i.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return e=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},i.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},i.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},i.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var i=[0,0,0],o=e%1*6,a=o%1,s=1-a,l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},i.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},i.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},i.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},i.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},i.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},i.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},i.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},i.gray.hsl=i.gray.hsv=function(t){return[0,0,t[0]]},i.gray.hwb=function(t){return[0,100,t[0]]},i.gray.cmyk=function(t){return[0,0,0,t[0]]},i.gray.lab=function(t){return[t[0],0,0]},i.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},i.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));function o(){for(var t={},e=Object.keys(i),n=e.length,r=0;r1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}function h(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var r=n.length,i=0;i=0&&e<1?O(Math.round(255*e)):"")}function k(t,e){return e<1||t[3]&&t[3]<1?S(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function S(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function M(t,e){return e<1||t[3]&&t[3]<1?C(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"}function C(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function T(t,e){return e<1||t[3]&&t[3]<1?D(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function D(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function L(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function P(t){return N[t.slice(0,3)]}function A(t,e,n){return Math.min(Math.max(e,t),n)}function O(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var N={};for(var F in p)N[p[F]]=F;var I=function(t){return t instanceof I?t:this instanceof I?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof t?(e=g.getRgba(t))?this.setValues("rgb",e):(e=g.getHsla(t))?this.setValues("hsl",e):(e=g.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new I(t);var e};I.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return g.hexString(this.values.rgb)},rgbString:function(){return g.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return g.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return g.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return g.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return g.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return g.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return g.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;nn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,r=t,i=void 0===e?.5:e,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a==-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new I,r=this.values,i=n.values;for(var o in r)r.hasOwnProperty(o)&&(t=r[o],"[object Array]"===(e={}.toString.call(t))?i[o]=t.slice(0):"[object Number]"===e?i[o]=t:console.error("unexpected color value:",t));return n}},I.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},I.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},I.prototype.getValues=function(t){for(var e=this.values,n={},r=0;r=0;i--)e.call(n,t[i],i);else for(i=0;i=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,r=1;return 0===t?0:1===t?1:(n||(n=.3),e=n/(2*Math.PI)*Math.asin(1/r),-r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,r=1;return 0===t?0:1===t?1:(n||(n=.3),e=n/(2*Math.PI)*Math.asin(1/r),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,r=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),e=n/(2*Math.PI)*Math.asin(1/r),t<1?r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-B.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*B.easeInBounce(2*t):.5*B.easeOutBounce(2*t-1)+.5}},V={effects:B};H.easingEffects=B;var Y=Math.PI,U=Y/180,j=2*Y,G=Y/2,q=Y/4,$=2*Y/3,K={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,r,i,o){if(o){var a=Math.min(o,i/2,r/2),s=e+a,l=n+a,u=e+r-a,c=n+i-a;t.moveTo(e,l),se.left-n&&t.xe.top-n&&t.y0&&t.requestAnimationFrame()},advance:function(){for(var t,e,n,r,i=this.animations,o=0;o=n?(at.callback(t.onAnimationComplete,[t],e),e.animating=!1,i.splice(o,1)):++o}},yt=at.options.resolve,bt=["push","pop","shift","splice","unshift"];function xt(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),bt.forEach((function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),i=r.apply(this,e);return at.each(t._chartjs.listeners,(function(t){"function"==typeof t[n]&&t[n].apply(t,e)})),i}})})))}function wt(t,e){var n=t._chartjs;if(n){var r=n.listeners,i=r.indexOf(e);-1!==i&&r.splice(i,1),r.length>0||(bt.forEach((function(e){delete t[e]})),delete t._chartjs)}}var _t=function(t,e){this.initialize(t,e)};at.extend(_t.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.chart,r=n.scales,i=t.getDataset(),o=n.options.scales;null!==e.xAxisID&&e.xAxisID in r&&!i.xAxisID||(e.xAxisID=i.xAxisID||o.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in r&&!i.yAxisID||(e.yAxisID=i.yAxisID||o.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&wt(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,r=n.getMeta(),i=n.getDataset().data||[],o=r.data;for(t=0,e=i.length;tr&&t.insertElements(r,i-r)},insertElements:function(t,e){for(var n=0;ni?(o=i/e.innerRadius,t.arc(a,s,e.innerRadius-i,r+o,n-o,!0)):t.arc(a,s,i,r+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function Ct(t,e,n,r){var i,o=n.endAngle;for(r&&(n.endAngle=n.startAngle+St,Mt(t,n),n.endAngle=o,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=St,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+St,n.startAngle,!0),i=0;is;)i-=St;for(;i=a&&i<=s,u=o>=n.innerRadius&&o<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,r="inner"===n.borderAlign?.33:0,i={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-r,0),pixelMargin:r,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/St)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,i.fullCircles){for(i.endAngle=i.startAngle+St,e.beginPath(),e.arc(i.x,i.y,i.outerRadius,i.startAngle,i.endAngle),e.arc(i.x,i.y,i.innerRadius,i.endAngle,i.startAngle,!0),e.closePath(),t=0;tt.x&&(e=Ht(e,"left","right")):t.basen?n:r,r:l.right||i<0?0:i>e?e:i,b:l.bottom||o<0?0:o>n?n:o,l:l.left||a<0?0:a>e?e:a}}function Yt(t){var e=zt(t),n=e.right-e.left,r=e.bottom-e.top,i=Vt(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b}}}function Ut(t,e,n){var r=null===e,i=null===n,o=!(!t||r&&i)&&zt(t);return o&&(r||e>=o.left&&e<=o.right)&&(i||n>=o.top&&n<=o.bottom)}J._set("global",{elements:{rectangle:{backgroundColor:Wt,borderColor:Wt,borderSkipped:"bottom",borderWidth:0}}});var jt=pt.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=Yt(e),r=n.outer,i=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(r.x,r.y,r.w,r.h),r.w===i.w&&r.h===i.h||(t.save(),t.beginPath(),t.rect(r.x,r.y,r.w,r.h),t.clip(),t.fillStyle=e.borderColor,t.rect(i.x,i.y,i.w,i.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return Ut(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return Et(n)?Ut(n,t,null):Ut(n,null,e)},inXRange:function(t){return Ut(this._view,t,null)},inYRange:function(t){return Ut(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return Et(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return Et(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),Gt={},qt=Dt,$t=At,Kt=Rt,Zt=jt;Gt.Arc=qt,Gt.Line=$t,Gt.Point=Kt,Gt.Rectangle=Zt;var Xt=at._deprecated,Jt=at.valueOrDefault;function Qt(t,e){var n,r,i,o,a=t._length;for(i=1,o=e.length;i0?Math.min(a,Math.abs(r-n)):a,n=r;return a}function te(t,e,n){var r,i,o=n.barThickness,a=e.stackCount,s=e.pixels[t],l=at.isNullOrUndef(o)?Qt(e.scale,e.pixels):-1;return at.isNullOrUndef(o)?(r=l*n.categoryPercentage,i=n.barPercentage):(r=o*a,i=1),{chunk:r/a,ratio:i,start:s-r/2}}function ee(t,e,n){var r,i=e.pixels,o=i[t],a=t>0?i[t-1]:null,s=t=0&&m.min>=0?m.min:m.max,w=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,_=g.length;if(y||void 0===y&&void 0!==b)for(r=0;r<_&&(i=g[r]).index!==t;++r)i.stack===b&&(o=void 0===(u=h._parseValue(p[i.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(m.min<0&&o<0||m.max>=0&&o>0)&&(x+=o));return a=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+w))-a,void 0!==v&&Math.abs(l)=0&&!f||w<0&&f?a-v:a+v),{size:l,base:a,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,r){var i=this,o="flex"===r.barThickness?ee(e,n,r):te(e,n,r),a=i.getStackIndex(t,i.getMeta().stack),s=o.start+o.chunk*a+o.chunk/2,l=Math.min(Jt(r.maxBarThickness,1/0),o.chunk*o.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}},draw:function(){var t=this,e=t.chart,n=t._getValueScale(),r=t.getMeta().data,i=t.getDataset(),o=r.length,a=0;for(at.canvas.clipArea(e.ctx,e.chartArea);a=se?-le:y<-se?le:0)+m,x=Math.cos(y),w=Math.sin(y),_=Math.cos(b),k=Math.sin(b),S=y<=0&&b>=0||b>=le,M=y<=ue&&b>=ue||b>=le+ue,C=y<=-ue&&b>=-ue||b>=se+ue,T=y===-se||b>=se?-1:Math.min(x,x*g,_,_*g),D=C?-1:Math.min(w,w*g,k,k*g),L=S?1:Math.max(x,x*g,_,_*g),P=M?1:Math.max(w,w*g,k,k*g);u=(L-T)/2,c=(P-D)/2,d=-(L+T)/2,h=-(P+D)/2}for(r=0,i=p.length;r0&&!isNaN(t)?le*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,r,i,o,a,s,l,u=this,c=0,d=u.chart;if(!t)for(e=0,n=d.data.datasets.length;e(c=s>c?s:c)?l:c);return c},setHoverStyle:function(t){var e=t._model,n=t._options,r=at.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=ae(n.hoverBackgroundColor,r(n.backgroundColor)),e.borderColor=ae(n.hoverBorderColor,r(n.borderColor)),e.borderWidth=ae(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n0&&pe(u[t-1]._model,l)&&(n.controlPointPreviousX=c(n.controlPointPreviousX,l.left,l.right),n.controlPointPreviousY=c(n.controlPointPreviousY,l.top,l.bottom)),t0&&(o=t.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(t,e){return Pe(t,e,{intersect:!1})},point:function(t,e){return Te(t,Me(e,t))},nearest:function(t,e,n){var r=Me(e,t);n.axis=n.axis||"xy";var i=Le(n.axis);return De(t,r,n.intersect,i)},x:function(t,e,n){var r=Me(e,t),i=[],o=!1;return Ce(t,(function(t){t.inXRange(r.x)&&i.push(t),t.inRange(r.x,r.y)&&(o=!0)})),n.intersect&&!o&&(i=[]),i},y:function(t,e,n){var r=Me(e,t),i=[],o=!1;return Ce(t,(function(t){t.inYRange(r.y)&&i.push(t),t.inRange(r.x,r.y)&&(o=!0)})),n.intersect&&!o&&(i=[]),i}}},Oe=at.extend;function Ne(t,e){return at.where(t,(function(t){return t.pos===e}))}function Fe(t,e){return t.sort((function(t,n){var r=e?n:t,i=e?t:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight}))}function Ie(t){var e,n,r,i=[];for(e=0,n=(t||[]).length;e div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n",qe=n(Object.freeze({__proto__:null,default:Ge})),$e="$chartjs",Ke="chartjs-",Ze=Ke+"size-monitor",Xe=Ke+"render-monitor",Je=Ke+"render-animation",Qe=["animationstart","webkitAnimationStart"],tn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function en(t,e){var n=at.getStyle(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?Number(r[1]):void 0}function nn(t,e){var n=t.style,r=t.getAttribute("height"),i=t.getAttribute("width");if(t[$e]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===i||""===i){var o=en(t,"width");void 0!==o&&(t.width=o)}if(null===r||""===r)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var a=en(t,"height");void 0!==o&&(t.height=a)}return t}var rn=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function on(t,e,n){t.addEventListener(e,n,rn)}function an(t,e,n){t.removeEventListener(e,n,rn)}function sn(t,e,n,r,i){return{type:t,chart:e,native:i||null,x:void 0!==n?n:null,y:void 0!==r?r:null}}function ln(t,e){var n=tn[t.type]||t.type,r=at.getRelativePosition(t,e);return sn(n,e,r.x,r.y,t)}function un(t,e){var n=!1,r=[];return function(){r=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,at.requestAnimFrame.call(window,(function(){n=!1,t.apply(e,r)})))}}function cn(t){var e=document.createElement("div");return e.className=t||"",e}function dn(t){var e=1e6,n=cn(Ze),r=cn(Ze+"-expand"),i=cn(Ze+"-shrink");r.appendChild(cn()),i.appendChild(cn()),n.appendChild(r),n.appendChild(i),n._reset=function(){r.scrollLeft=e,r.scrollTop=e,i.scrollLeft=e,i.scrollTop=e};var o=function(){n._reset(),t()};return on(r,"scroll",o.bind(r,"expand")),on(i,"scroll",o.bind(i,"shrink")),n}function hn(t,e){var n=t[$e]||(t[$e]={}),r=n.renderProxy=function(t){t.animationName===Je&&e()};at.each(Qe,(function(e){on(t,e,r)})),n.reflow=!!t.offsetParent,t.classList.add(Xe)}function fn(t){var e=t[$e]||{},n=e.renderProxy;n&&(at.each(Qe,(function(e){an(t,e,n)})),delete e.renderProxy),t.classList.remove(Xe)}function pn(t,e,n){var r=t[$e]||(t[$e]={}),i=r.resizer=dn(un((function(){if(r.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,o=i?i.clientWidth:0;e(sn("resize",n)),i&&i.clientWidth0){var o=t[0];o.label?n=o.label:o.xLabel?n=o.xLabel:i>0&&o.index-1?t.split("\n"):t}function Tn(t){var e=t._xScale,n=t._yScale||t._scale,r=t._index,i=t._datasetIndex,o=t._chart.getDatasetMeta(i).controller,a=o._getIndexScale(),s=o._getValueScale();return{xLabel:e?e.getLabelForIndex(r,i):"",yLabel:n?n.getLabelForIndex(r,i):"",label:a?""+a.getLabelForIndex(r,i):"",value:s?""+s.getLabelForIndex(r,i):"",index:r,datasetIndex:i,x:t._model.x,y:t._model.y}}function Dn(t){var e=J.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:_n(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:_n(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:_n(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:_n(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:_n(t.titleFontStyle,e.defaultFontStyle),titleFontSize:_n(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:_n(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:_n(t.footerFontStyle,e.defaultFontStyle),footerFontSize:_n(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Ln(t,e){var n=t._chart.ctx,r=2*e.yPadding,i=0,o=e.body,a=o.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);a+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,u=e.titleFontSize,c=e.bodyFontSize,d=e.footerFontSize;r+=s*u,r+=s?(s-1)*e.titleSpacing:0,r+=s?e.titleMarginBottom:0,r+=a*c,r+=a?(a-1)*e.bodySpacing:0,r+=l?e.footerMarginTop:0,r+=l*d,r+=l?(l-1)*e.footerSpacing:0;var h=0,f=function(t){i=Math.max(i,n.measureText(t).width+h)};return n.font=at.fontString(u,e._titleFontStyle,e._titleFontFamily),at.each(e.title,f),n.font=at.fontString(c,e._bodyFontStyle,e._bodyFontFamily),at.each(e.beforeBody.concat(e.afterBody),f),h=e.displayColors?c+2:0,at.each(o,(function(t){at.each(t.before,f),at.each(t.lines,f),at.each(t.after,f)})),h=0,n.font=at.fontString(d,e._footerFontStyle,e._footerFontFamily),at.each(e.footer,f),{width:i+=2*e.xPadding,height:r}}function Pn(t,e){var n,r,i,o,a,s=t._model,l=t._chart,u=t._chart.chartArea,c="center",d="center";s.yl.height-e.height&&(d="bottom");var h=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===d?(n=function(t){return t<=h},r=function(t){return t>h}):(n=function(t){return t<=e.width/2},r=function(t){return t>=l.width-e.width/2}),i=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},o=function(t){return t-e.width-s.caretSize-s.caretPadding<0},a=function(t){return t<=f?"top":"bottom"},n(s.x)?(c="left",i(s.x)&&(c="center",d=a(s.y))):r(s.x)&&(c="right",o(s.x)&&(c="center",d=a(s.y)));var p=t._options;return{xAlign:p.xAlign?p.xAlign:c,yAlign:p.yAlign?p.yAlign:d}}function An(t,e,n,r){var i=t.x,o=t.y,a=t.caretSize,s=t.caretPadding,l=t.cornerRadius,u=n.xAlign,c=n.yAlign,d=a+s,h=l+s;return"right"===u?i-=e.width:"center"===u&&((i-=e.width/2)+e.width>r.width&&(i=r.width-e.width),i<0&&(i=0)),"top"===c?o+=d:o-="bottom"===c?e.height+d:e.height/2,"center"===c?"left"===u?i+=d:"right"===u&&(i-=d):"left"===u?i-=h:"right"===u&&(i+=h),{x:i,y:o}}function On(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Nn(t){return Mn([],Cn(t))}var Fn=pt.extend({initialize:function(){this._model=Dn(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options.callbacks,n=e.beforeTitle.apply(t,arguments),r=e.title.apply(t,arguments),i=e.afterTitle.apply(t,arguments),o=[];return o=Mn(o,Cn(n)),o=Mn(o,Cn(r)),o=Mn(o,Cn(i))},getBeforeBody:function(){return Nn(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,r=n._options.callbacks,i=[];return at.each(t,(function(t){var o={before:[],lines:[],after:[]};Mn(o.before,Cn(r.beforeLabel.call(n,t,e))),Mn(o.lines,r.label.call(n,t,e)),Mn(o.after,Cn(r.afterLabel.call(n,t,e))),i.push(o)})),i},getAfterBody:function(){return Nn(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),r=e.footer.apply(t,arguments),i=e.afterFooter.apply(t,arguments),o=[];return o=Mn(o,Cn(n)),o=Mn(o,Cn(r)),o=Mn(o,Cn(i))},update:function(t){var e,n,r=this,i=r._options,o=r._model,a=r._model=Dn(i),s=r._active,l=r._data,u={xAlign:o.xAlign,yAlign:o.yAlign},c={x:o.x,y:o.y},d={width:o.width,height:o.height},h={x:o.caretX,y:o.caretY};if(s.length){a.opacity=1;var f=[],p=[];h=Sn[i.position].call(r,s,r._eventPosition);var g=[];for(e=0,n=s.length;e0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},r={x:e.x,y:e.y},i=Math.abs(e.opacity<.001)?0:e.opacity,o=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,e,t,n),r.y+=e.yPadding,at.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(r,e,t),this.drawBody(r,e,t),this.drawFooter(r,e,t),at.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e=this,n=e._options,r=!1;return e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:(e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),n.reverse&&e._active.reverse()),(r=!at.arrayEquals(e._active,e._lastActive))&&(e._lastActive=e._active,(n.enabled||n.custom)&&(e._eventPosition={x:t.x,y:t.y},e.update(!0),e.pivot())),r}}),In=Sn,Rn=Fn;Rn.positioners=In;var Wn=at.valueOrDefault;function En(){return at.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,r){if("xAxes"===t||"yAxes"===t){var i,o,a,s=n[t].length;for(e[t]||(e[t]=[]),i=0;i=e[t].length&&e[t].push({}),!e[t][i].type||a.type&&a.type!==e[t][i].type?at.merge(e[t][i],[wn.getScaleDefaults(o),a]):at.merge(e[t][i],a)}else at._merger(t,e,n,r)}})}function zn(){return at.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,r){var i=e[t]||Object.create(null),o=n[t];"scales"===t?e[t]=En(i,o):"scale"===t?e[t]=at.merge(i,[wn.getScaleDefaults(o.type),o]):at._merger(t,e,n,r)}})}function Hn(t){var e=(t=t||Object.create(null)).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=zn(J.global,J[t.type],t.options||{}),t}function Bn(t){var e=t.options;at.each(t.scales,(function(e){Ue.removeBox(t,e)})),e=zn(J.global,J[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Vn(t,e,n){var r,i=function(t){return t.id===r};do{r=e+n++}while(at.findIndex(t,i)>=0);return r}function Yn(t){return"top"===t||"bottom"===t}function Un(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}J._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var jn=function(t,e){return this.construct(t,e),this};at.extend(jn.prototype,{construct:function(t,e){var n=this;e=Hn(e);var r=bn.acquireContext(t,e),i=r&&r.canvas,o=i&&i.height,a=i&&i.width;n.id=at.uid(),n.ctx=r,n.canvas=i,n.config=e,n.width=a,n.height=o,n.aspectRatio=o?a/o:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,jn.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),r&&i?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return xn.notify(t,"beforeInit"),at.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),xn.notify(t,"afterInit"),t},clear:function(){return at.canvas.clear(this),this},stop:function(){return vt.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,r=e.canvas,i=n.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(at.getMaximumWidth(r))),a=Math.max(0,Math.floor(i?o/i:at.getMaximumHeight(r)));if((e.width!==o||e.height!==a)&&(r.width=e.width=o,r.height=e.height=a,r.style.width=o+"px",r.style.height=a+"px",at.retinaScale(e,n.devicePixelRatio),!t)){var s={width:o,height:a};xn.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;at.each(e.xAxes,(function(t,n){t.id||(t.id=Vn(e.xAxes,"x-axis-",n))})),at.each(e.yAxes,(function(t,n){t.id||(t.id=Vn(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},r=[],i=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(r=r.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&r.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),at.each(r,(function(e){var r=e.options,o=r.id,a=Wn(r.type,e.dtype);Yn(r.position)!==Yn(e.dposition)&&(r.position=e.dposition),i[o]=!0;var s=null;if(o in n&&n[o].type===a)(s=n[o]).options=r,s.ctx=t.ctx,s.chart=t;else{var l=wn.getScaleConstructor(a);if(!l)return;s=new l({id:o,type:a,options:r,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),at.each(i,(function(t,e){t||delete n[e]})),t.scales=n,wn.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,r=[],i=n.data.datasets;for(t=0,e=i.length;t=0;--n)r.drawDataset(e[n],t);xn.notify(r,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,r={meta:t,index:t.index,easingValue:e};!1!==xn.notify(n,"beforeDatasetDraw",[r])&&(t.controller.draw(e),xn.notify(n,"afterDatasetDraw",[r]))},_drawTooltip:function(t){var e=this,n=e.tooltip,r={tooltip:n,easingValue:t};!1!==xn.notify(e,"beforeTooltipDraw",[r])&&(n.draw(),xn.notify(e,"afterTooltipDraw",[r]))},getElementAtEvent:function(t){return Ae.modes.single(this,t)},getElementsAtEvent:function(t){return Ae.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return Ae.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var r=Ae.modes[e];return"function"==typeof r?r(this,t,n):[]},getDatasetAtEvent:function(t){return Ae.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var r=n._meta[e.id];return r||(r=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:t}),r},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e=0;r--){var i=t[r];if(e(i))return i}},at.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},at.almostEquals=function(t,e,n){return Math.abs(t-e)=t},at.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},at.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},at.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},at.toRadians=function(t){return t*(Math.PI/180)},at.toDegrees=function(t){return t*(180/Math.PI)},at._decimalPlaces=function(t){if(at.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},at.getAngleFromPoint=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=Math.sqrt(n*n+r*r),o=Math.atan2(r,n);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:i}},at.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},at.aliasPixel=function(t){return t%2==0?0:.5},at._alignPixel=function(t,e,n){var r=t.currentDevicePixelRatio,i=n/2;return Math.round((e-i)*r)/r+i},at.splineCurve=function(t,e,n,r){var i=t.skip?e:t,o=e,a=n.skip?e:n,s=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),l=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),u=s/(s+l),c=l/(s+l),d=r*(u=isNaN(u)?0:u),h=r*(c=isNaN(c)?0:c);return{previous:{x:o.x-d*(a.x-i.x),y:o.y-d*(a.y-i.y)},next:{x:o.x+h*(a.x-i.x),y:o.y+h*(a.y-i.y)}}},at.EPSILON=Number.EPSILON||1e-14,at.splineCurveMonotone=function(t){var e,n,r,i,o,a,s,l,u,c=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),d=c.length;for(e=0;e0?c[e-1]:null,(i=e0?c[e-1]:null,i=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},at.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},at.niceNum=function(t,e){var n=Math.floor(at.log10(t)),r=t/Math.pow(10,n);return(e?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10)*Math.pow(10,n)},at.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},at.getRelativePosition=function(t,e){var n,r,i=t.originalEvent||t,o=t.target||t.srcElement,a=o.getBoundingClientRect(),s=i.touches;s&&s.length>0?(n=s[0].clientX,r=s[0].clientY):(n=i.clientX,r=i.clientY);var l=parseFloat(at.getStyle(o,"padding-left")),u=parseFloat(at.getStyle(o,"padding-top")),c=parseFloat(at.getStyle(o,"padding-right")),d=parseFloat(at.getStyle(o,"padding-bottom")),h=a.right-a.left-l-c,f=a.bottom-a.top-u-d;return{x:n=Math.round((n-a.left-l)/h*o.width/e.currentDevicePixelRatio),y:r=Math.round((r-a.top-u)/f*o.height/e.currentDevicePixelRatio)}},at.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},at.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},at._calculatePadding=function(t,e,n){return(e=at.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},at._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},at.getMaximumWidth=function(t){var e=at._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,r=n-at._calculatePadding(e,"padding-left",n)-at._calculatePadding(e,"padding-right",n),i=at.getConstraintWidth(t);return isNaN(i)?r:Math.min(r,i)},at.getMaximumHeight=function(t){var e=at._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,r=n-at._calculatePadding(e,"padding-top",n)-at._calculatePadding(e,"padding-bottom",n),i=at.getConstraintHeight(t);return isNaN(i)?r:Math.min(r,i)},at.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},at.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var r=t.canvas,i=t.height,o=t.width;r.height=i*n,r.width=o*n,t.ctx.scale(n,n),r.style.height||r.style.width||(r.style.height=i+"px",r.style.width=o+"px")}},at.fontString=function(t,e,n){return e+" "+t+"px "+n},at.longestText=function(t,e,n,r){var i=(r=r||{}).data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(i=r.data={},o=r.garbageCollect=[],r.font=e),t.font=e;var a,s,l,u,c,d=0,h=n.length;for(a=0;an.length){for(a=0;ar&&(r=o),r},at.numberOfLabelLines=function(t){var e=1;return at.each(t,(function(t){at.isArray(t)&&t.length>e&&(e=t.length)})),e},at.color=R?function(t){return t instanceof CanvasGradient&&(t=J.global.defaultColor),R(t)}:function(t){return console.error("Color.js not found!"),t},at.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:at.color(t).saturate(.5).darken(.1).rgbString()}};function $n(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Kn(t){this.options=t||{}}at.extend(Kn.prototype,{formats:$n,parse:$n,format:$n,add:$n,diff:$n,startOf:$n,endOf:$n,_create:function(t){return t}}),Kn.override=function(t){at.extend(Kn.prototype,t)};var Zn={_date:Kn},Xn={formatters:{values:function(t){return at.isArray(t)?t:""+t},linear:function(t,e,n){var r=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(r)>1&&t!==Math.floor(t)&&(r=t-Math.floor(t));var i=at.log10(Math.abs(r)),o="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var a=at.log10(Math.abs(t)),s=Math.floor(a)-Math.floor(i);s=Math.max(Math.min(s,20),0),o=t.toExponential(s)}else{var l=-1*Math.floor(i);l=Math.max(Math.min(l,20),0),o=t.toFixed(l)}else o="0";return o},logarithmic:function(t,e,n){var r=t/Math.pow(10,Math.floor(at.log10(t)));return 0===t?"0":1===r||2===r||5===r||0===e||e===n.length-1?t.toExponential():""}}},Jn=at.isArray,Qn=at.isNullOrUndef,tr=at.valueOrDefault,er=at.valueAtIndexOrDefault;function nr(t,e){for(var n=[],r=t.length/e,i=0,o=t.length;il+u)))return a}function ir(t,e){at.each(t,(function(t){var n,r=t.gc,i=r.length/2;if(i>e){for(n=0;nu)return o;return Math.max(u,1)}function fr(t){var e,n,r=[];for(e=0,n=t.length;e=h||c<=1||!s.isHorizontal()?s.labelRotation=d:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,r=Math.min(s.maxWidth,s.chart.width-e),e+6>(i=l.offset?s.maxWidth/c:r/(c-1))&&(i=r/(c-(l.offset?.5:1)),o=s.maxHeight-ar(l.gridLines)-u.padding-sr(l.scaleLabel),a=Math.sqrt(e*e+n*n),f=at.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/i,1)),Math.asin(Math.min(o/a,1))-Math.asin(n/a))),f=Math.max(d,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){at.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){at.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,r=t.options,i=r.ticks,o=r.scaleLabel,a=r.gridLines,s=t._isVisible(),l="bottom"===r.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=ar(a)+sr(o)),u?s&&(e.height=ar(a)+sr(o)):e.height=t.maxHeight,i.display&&s){var c=ur(i),d=t._getLabelSizes(),h=d.first,f=d.last,p=d.widest,g=d.highest,m=.4*c.minor.lineHeight,v=i.padding;if(u){var y=0!==t.labelRotation,b=at.toRadians(t.labelRotation),x=Math.cos(b),w=Math.sin(b),_=w*p.width+x*(g.height-(y?g.offset:0))+(y?0:m);e.height=Math.min(t.maxHeight,e.height+_+v);var k,S,M=t.getPixelForTick(0)-t.left,C=t.right-t.getPixelForTick(t.getTicks().length-1);y?(k=l?x*h.width+w*h.offset:w*(h.height-h.offset),S=l?w*(f.height-f.offset):x*f.width+w*f.offset):(k=h.width/2,S=f.width/2),t.paddingLeft=Math.max((k-M)*t.width/(t.width-M),0)+3,t.paddingRight=Math.max((S-C)*t.width/(t.width-C),0)+3}else{var T=i.mirror?0:p.width+v+m;e.width=Math.min(t.maxWidth,e.width+T),t.paddingTop=h.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){at.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(Qn(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,r,i=this;for(i.ticks=t.map((function(t){return t.value})),i.beforeTickToLabelConversion(),e=i.convertTicksToLabels(t)||i.ticks,i.afterTickToLabelConversion(),n=0,r=t.length;nr-1?null:e.getPixelForDecimal(t*i+(n?i/2:0))},getPixelForDecimal:function(t){var e=this;return e._reversePixels&&(t=1-t),e._startPixel+t*e._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,r,i,o=this,a=o.options.ticks,s=o._length,l=a.maxTicksLimit||s/o._tickSize()+1,u=a.major.enabled?fr(t):[],c=u.length,d=u[0],h=u[c-1];if(c>l)return pr(t,u,c/l),cr(t);if(r=hr(u,t,s,l),c>0){for(e=0,n=c-1;e1?(h-d)/(c-1):null,gr(t,r,at.isNullOrUndef(i)?0:d-i,d),gr(t,r,h,at.isNullOrUndef(i)?t.length:h+i),cr(t)}return gr(t,r),cr(t)},_tickSize:function(){var t=this,e=t.options.ticks,n=at.toRadians(t.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=t._getLabelSizes(),a=e.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return t.isHorizontal()?l*r>s*i?s/r:l/i:l*i=0&&(a=t),void 0!==o&&(t=n.indexOf(o))>=0&&(s=t),e.minIndex=a,e.maxIndex=s,e.min=n[a],e.max=n[s]},buildTicks:function(){var t=this,e=t._getLabels(),n=t.minIndex,r=t.maxIndex;t.ticks=0===n&&r===e.length-1?e:e.slice(n,r+1)},getLabelForIndex:function(t,e){var n=this,r=n.chart;return r.getDatasetMeta(e).controller._getValueScaleId()===n.id?n.getRightValue(r.data.datasets[e].data[t]):n._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;vr.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var r,i,o,a=this;return yr(e)||yr(n)||(t=a.chart.data.datasets[n].data[e]),yr(t)||(r=a.isHorizontal()?t.x:t.y),(void 0!==r||void 0!==t&&isNaN(e))&&(i=a._getLabels(),t=at.valueOrDefault(r,t),e=-1!==(o=i.indexOf(t))?o:e,isNaN(e)&&(e=t)),a.getPixelForDecimal((e-a._startValue)/a._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=this,n=Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange);return Math.min(Math.max(n,0),e.ticks.length-1)},getBasePixel:function(){return this.bottom}}),wr=br;xr._defaults=wr;var _r=at.noop,kr=at.isNullOrUndef;function Sr(t,e){var n,r,i,o,a=[],s=1e-14,l=t.stepSize,u=l||1,c=t.maxTicks-1,d=t.min,h=t.max,f=t.precision,p=e.min,g=e.max,m=at.niceNum((g-p)/c/u)*u;if(mc&&(m=at.niceNum(o*m/c/u)*u),l||kr(f)?n=Math.pow(10,at._decimalPlaces(m)):(n=Math.pow(10,f),m=Math.ceil(m*n)/n),r=Math.floor(p/m)*m,i=Math.ceil(g/m)*m,l&&(!kr(d)&&at.almostWhole(d/m,m/1e3)&&(r=d),!kr(h)&&at.almostWhole(h/m,m/1e3)&&(i=h)),o=(i-r)/m,o=at.almostEquals(o,Math.round(o),m/1e3)?Math.round(o):Math.ceil(o),r=Math.round(r*n)/n,i=Math.round(i*n)/n,a.push(kr(d)?r:d);for(var v=1;v0&&r>0&&(t.min=0)}var i=void 0!==e.min||void 0!==e.suggestedMin,o=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),i!==o&&t.min>=t.max&&(i?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this,n=e.options.ticks,r=n.stepSize,i=n.maxTicksLimit;return r?t=Math.ceil(e.max/r)-Math.floor(e.min/r)+1:(t=e._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:_r,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),r={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:at.valueOrDefault(e.fixedStepSize,e.stepSize)},i=t.ticks=Sr(r,t);t.handleDirectionalChanges(),t.max=at.max(i),t.min=at.min(i),e.reverse?(i.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),vr.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,n=e.getTicks(),r=e.min,i=e.max;vr.prototype._configure.call(e),e.options.offset&&n.length&&(r-=t=(i-r)/Math.max(n.length-1,1)/2,i+=t),e._startValue=r,e._endValue=i,e._valueRange=i-r}}),Cr={position:"left",ticks:{callback:Xn.formatters.linear}},Tr=0,Dr=1;function Lr(t,e,n){var r=[n.type,void 0===e&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===t[r]&&(t[r]={pos:[],neg:[]}),t[r]}function Pr(t,e,n,r){var i,o,a=t.options,s=Lr(e,a.stacked,n),l=s.pos,u=s.neg,c=r.length;for(i=0;ie.length-1?null:this.getPixelForValue(e[t])}}),Nr=Cr;Or._defaults=Nr;var Fr=at.valueOrDefault,Ir=at.math.log10;function Rr(t,e){var n,r,i=[],o=Fr(t.min,Math.pow(10,Math.floor(Ir(e.min)))),a=Math.floor(Ir(e.max)),s=Math.ceil(e.max/Math.pow(10,a));0===o?(n=Math.floor(Ir(e.minNotZero)),r=Math.floor(e.minNotZero/Math.pow(10,n)),i.push(o),o=r*Math.pow(10,n)):(n=Math.floor(Ir(o)),r=Math.floor(o/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{i.push(o),10==++r&&(r=1,l=++n>=0?1:l),o=Math.round(r*Math.pow(10,n)*l)/l}while(n=0?t:e}var zr=vr.extend({determineDataLimits:function(){var t,e,n,r,i,o,a=this,s=a.options,l=a.chart,u=l.data.datasets,c=a.isHorizontal();function d(t){return c?t.xAxisID===a.id:t.yAxisID===a.id}a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,a.minNotZero=Number.POSITIVE_INFINITY;var h=s.stacked;if(void 0===h)for(t=0;t0){var e=at.min(t),n=at.max(t);a.min=Math.min(a.min,e),a.max=Math.max(a.max,n)}}))}else for(t=0;t0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Ir(t.max))):t.minNotZero=n)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),r={min:Er(e.min),max:Er(e.max)},i=t.ticks=Rr(r,t);t.max=at.max(i),t.min=at.min(i),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&i.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),vr.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Ir(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;vr.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=Fr(t.options.ticks.fontSize,J.global.defaultFontSize)/t._length),t._startValue=Ir(e),t._valueOffset=n,t._valueRange=(Ir(t.max)-Ir(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(Ir(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Hr=Wr;zr._defaults=Hr;var Br=at.valueOrDefault,Vr=at.valueAtIndexOrDefault,Yr=at.options.resolve,Ur={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Xn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function jr(t){var e=t.ticks;return e.display&&t.display?Br(e.fontSize,J.global.defaultFontSize)+2*e.backdropPaddingY:0}function Gr(t,e,n){return at.isArray(n)?{w:at.longestText(t,t.font,n),h:n.length*e}:{w:t.measureText(n).width,h:e}}function qr(t,e,n,r,i){return t===r||t===i?{start:e-n/2,end:e+n/2}:ti?{start:e-n,end:e}:{start:e,end:e+n}}function $r(t){var e,n,r,i=at.options._parseFont(t.options.pointLabels),o={l:0,r:t.width,t:0,b:t.height-t.paddingTop},a={};t.ctx.font=i.string,t._pointLabelSizes=[];var s=t.chart.data.labels.length;for(e=0;eo.r&&(o.r=c.end,a.r=l),d.starto.b&&(o.b=d.end,a.b=l)}t.setReductions(t.drawingArea,o,a)}function Kr(t){return 0===t||180===t?"center":t<180?"left":"right"}function Zr(t,e,n,r){var i,o,a=n.y+r/2;if(at.isArray(e))for(i=0,o=e.length;i270||t<90)&&(n.y-=e.h)}function Jr(t){var e=t.ctx,n=t.options,r=n.pointLabels,i=jr(n),o=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),a=at.options._parseFont(r);e.save(),e.font=a.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?i/2:0,u=t.getPointPosition(s,o+l+5),c=Vr(r.fontColor,s,J.global.defaultFontColor);e.fillStyle=c;var d=t.getIndexAngle(s),h=at.toDegrees(d);e.textAlign=Kr(h),Xr(h,t._pointLabelSizes[s],u),Zr(e,t.pointLabels[s],u,a.lineHeight)}e.restore()}function Qr(t,e,n,r){var i,o=t.ctx,a=e.circular,s=t.chart.data.labels.length,l=Vr(e.color,r-1),u=Vr(e.lineWidth,r-1);if((a||s)&&l&&u){if(o.save(),o.strokeStyle=l,o.lineWidth=u,o.setLineDash&&(o.setLineDash(e.borderDash||[]),o.lineDashOffset=e.borderDashOffset||0),o.beginPath(),a)o.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{i=t.getPointPosition(0,n),o.moveTo(i.x,i.y);for(var c=1;c0&&r>0?n:0)},_drawGrid:function(){var t,e,n,r=this,i=r.ctx,o=r.options,a=o.gridLines,s=o.angleLines,l=Br(s.lineWidth,a.lineWidth),u=Br(s.color,a.color);if(o.pointLabels.display&&Jr(r),a.display&&at.each(r.ticks,(function(t,n){0!==n&&(e=r.getDistanceFromCenterForValue(r.ticksAsNumbers[n]),Qr(r,a,e,n))})),s.display&&l&&u){for(i.save(),i.lineWidth=l,i.strokeStyle=u,i.setLineDash&&(i.setLineDash(Yr([s.borderDash,a.borderDash,[]])),i.lineDashOffset=Yr([s.borderDashOffset,a.borderDashOffset,0])),t=r.chart.data.labels.length-1;t>=0;t--)e=r.getDistanceFromCenterForValue(o.ticks.reverse?r.min:r.max),n=r.getPointPosition(t,e),i.beginPath(),i.moveTo(r.xCenter,r.yCenter),i.lineTo(n.x,n.y),i.stroke();i.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var r,i,o=t.getIndexAngle(0),a=at.options._parseFont(n),s=Br(n.fontColor,J.global.defaultFontColor);e.save(),e.font=a.string,e.translate(t.xCenter,t.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",at.each(t.ticks,(function(o,l){(0!==l||n.reverse)&&(r=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(i=e.measureText(o).width,e.fillStyle=n.backdropColor,e.fillRect(-i/2-n.backdropPaddingX,-r-a.size/2-n.backdropPaddingY,i+2*n.backdropPaddingX,a.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(o,0,-r))})),e.restore()}},_drawTitle:at.noop}),ni=Ur;ei._defaults=ni;var ri=at._deprecated,ii=at.options.resolve,oi=at.valueOrDefault,ai=Number.MIN_SAFE_INTEGER||-9007199254740991,si=Number.MAX_SAFE_INTEGER||9007199254740991,li={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ui=Object.keys(li);function ci(t,e){return t-e}function di(t){var e,n,r,i={},o=[];for(e=0,n=t.length;ee&&s=0&&a<=s;){if(i=t[(r=a+s>>1)-1]||null,o=t[r],!i)return{lo:null,hi:o};if(o[e]n))return{lo:i,hi:o};s=r-1}}return{lo:o,hi:null}}function mi(t,e,n,r){var i=gi(t,e,n),o=i.lo?i.hi?i.lo:t[t.length-2]:t[0],a=i.lo?i.hi?i.hi:t[t.length-1]:t[1],s=a[e]-o[e],l=s?(n-o[e])/s:0,u=(a[r]-o[r])*l;return o[r]+u}function vi(t,e){var n=t._adapter,r=t.options.time,i=r.parser,o=i||r.format,a=e;return"function"==typeof i&&(a=i(a)),at.isFinite(a)||(a="string"==typeof o?n.parse(a,o):n.parse(a)),null!==a?+a:(i||"function"!=typeof o||(a=o(e),at.isFinite(a)||(a=n.parse(a))),a)}function yi(t,e){if(at.isNullOrUndef(e))return null;var n=t.options.time,r=vi(t,t.getRightValue(e));return null===r||n.round&&(r=+t._adapter.startOf(r,n.round)),r}function bi(t,e,n,r){var i,o,a,s=ui.length;for(i=ui.indexOf(t);i=ui.indexOf(n);o--)if(a=ui[o],li[a].common&&t._adapter.diff(i,r,a)>=e-1)return a;return ui[n?ui.indexOf(n):0]}function wi(t){for(var e=ui.indexOf(t)+1,n=ui.length;e1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(i=d;i=0&&(e[o].major=!0);return e}function Mi(t,e,n){var r,i,o=[],a={},s=e.length;for(r=0;r1?di(p).sort(ci):p.sort(ci),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=yi(s,hi(c))||h,f=yi(s,fi(c))||f,h=h===si?+u.startOf(Date.now(),d):h,f=f===ai?+u.endOf(Date.now(),d)+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._table=[],s._timestamps={data:p,datasets:g,labels:m}},buildTicks:function(){var t,e,n,r=this,i=r.min,o=r.max,a=r.options,s=a.ticks,l=a.time,u=r._timestamps,c=[],d=r.getLabelCapacity(i),h=s.source,f=a.distribution;for(u="data"===h||"auto"===h&&"series"===f?u.data:"labels"===h?u.labels:_i(r,i,o,d),"ticks"===a.bounds&&u.length&&(i=u[0],o=u[u.length-1]),i=yi(r,hi(a))||i,o=yi(r,fi(a))||o,t=0,e=u.length;t=i&&n<=o&&c.push(n);return r.min=i,r.max=o,r._unit=l.unit||(s.autoSkip?bi(l.minUnit,r.min,r.max,d):xi(r,c.length,l.minUnit,r.min,r.max)),r._majorUnit=s.major.enabled&&"year"!==r._unit?wi(r._unit):void 0,r._table=pi(r._timestamps.data,i,o,f),r._offsets=ki(r._table,c,i,o,a),s.reverse&&c.reverse(),Mi(r,c,r._majorUnit)},getLabelForIndex:function(t,e){var n=this,r=n._adapter,i=n.chart.data,o=n.options.time,a=i.labels&&t=0&&t0?s:1}}),Di=Ci;Ti._defaults=Di;var Li={category:xr,linear:Or,logarithmic:zr,radialLinear:ei,time:Ti},Pi={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Zn._date.override("function"==typeof t?{_id:"moment",formats:function(){return Pi},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,r){return t(e).add(n,r).valueOf()},diff:function(e,n,r){return t(e).diff(t(n),r)},startOf:function(e,n,r){return e=t(e),"isoWeek"===n?e.isoWeekday(r).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),J._set("global",{plugins:{filler:{propagate:!0}}});var Ai={dataset:function(t){var e=t.fill,n=t.chart,r=n.getDatasetMeta(e),i=r&&n.isDatasetVisible(e)&&r.dataset._children||[],o=i.length||0;return o?function(t,e){return e=n)&&r;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function Ni(t){var e,n=t.el._model||{},r=t.el._scale||{},i=t.fill,o=null;if(isFinite(i))return null;if("start"===i?o=void 0===n.scaleBottom?r.bottom:n.scaleBottom:"end"===i?o=void 0===n.scaleTop?r.top:n.scaleTop:void 0!==n.scaleZero?o=n.scaleZero:r.getBasePixel&&(o=r.getBasePixel()),null!=o){if(void 0!==o.x&&void 0!==o.y)return o;if(at.isFinite(o))return{x:(e=r.isHorizontal())?o:null,y:e?null:o}}return null}function Fi(t){var e,n,r,i,o,a=t.el._scale,s=a.options,l=a.chart.data.labels.length,u=t.fill,c=[];if(!l)return null;for(e=s.ticks.reverse?a.max:a.min,n=s.ticks.reverse?a.min:a.max,r=a.getPointPositionForValue(0,e),i=0;i0;--o)at.canvas.lineTo(t,n[o],n[o-1],!0);else for(a=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-a,2)+Math.pow(n[0].y-s,2)),o=i-1;o>0;--o)t.arc(a,s,l,n[o].angle,n[o-1].angle,!0)}}function Hi(t,e,n,r,i,o){var a,s,l,u,c,d,h,f,p=e.length,g=r.spanGaps,m=[],v=[],y=0,b=0;for(t.beginPath(),a=0,s=p;a=0;--n)(e=l[n].$filler)&&e.visible&&(i=(r=e.el)._view,o=r._children||[],a=e.mapper,s=i.backgroundColor||J.global.defaultColor,a&&s&&o.length&&(at.canvas.clipArea(u,t.chartArea),Hi(u,o,a,i,s,r._loop),at.canvas.unclipArea(u)))}},Vi=at.rtl.getRtlAdapter,Yi=at.noop,Ui=at.valueOrDefault;function ji(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}J._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,r=this.chart,i=r.getDatasetMeta(n);i.hidden=null===i.hidden?!r.data.datasets[n].hidden:null,r.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},r=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var i=n.controller.getStyle(r?0:void 0);return{text:e[n.index].label,fillStyle:i.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:i.borderWidth,strokeStyle:i.borderColor,pointStyle:i.pointStyle,rotation:i.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,r,i=document.createElement("ul"),o=t.data.datasets;for(i.setAttribute("class",t.id+"-legend"),e=0,n=o.length;el.width)&&(d+=a+n.padding,c[c.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:r,height:a},c[c.length-1]+=r+n.padding})),l.height+=d}else{var h=n.padding,f=t.columnWidths=[],p=t.columnHeights=[],g=n.padding,m=0,v=0;at.each(t.legendItems,(function(t,e){var r=ji(n,a)+a/2+i.measureText(t.text).width;e>0&&v+a+2*h>l.height&&(g+=m+n.padding,f.push(m),p.push(v),m=0,v=0),m=Math.max(m,r),v+=a+h,s[e]={left:0,top:0,width:r,height:a}})),g+=m,f.push(m),p.push(v),l.width+=g}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Yi,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,r=J.global,i=r.defaultColor,o=r.elements.line,a=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var c,d=Vi(e.rtl,t.left,t.minSize.width),h=t.ctx,f=Ui(n.fontColor,r.defaultFontColor),p=at.options._parseFont(n),g=p.size;h.textAlign=d.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=p.string;var m=ji(n,g),v=t.legendHitBoxes,y=function(t,e,r){if(!(isNaN(m)||m<=0)){h.save();var a=Ui(r.lineWidth,o.borderWidth);if(h.fillStyle=Ui(r.fillStyle,i),h.lineCap=Ui(r.lineCap,o.borderCapStyle),h.lineDashOffset=Ui(r.lineDashOffset,o.borderDashOffset),h.lineJoin=Ui(r.lineJoin,o.borderJoinStyle),h.lineWidth=a,h.strokeStyle=Ui(r.strokeStyle,i),h.setLineDash&&h.setLineDash(Ui(r.lineDash,o.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=d.xPlus(t,m/2),u=e+g/2;at.canvas.drawPoint(h,r.pointStyle,s,l,u,r.rotation)}else h.fillRect(d.leftForLtr(t,m),e,m,g),0!==a&&h.strokeRect(d.leftForLtr(t,m),e,m,g);h.restore()}},b=function(t,e,n,r){var i=g/2,o=d.xPlus(t,m+i),a=e+i;h.fillText(n.text,o,a),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(o,a),h.lineTo(d.xPlus(o,r),a),h.stroke())},x=function(t,r){switch(e.align){case"start":return n.padding;case"end":return t-r;default:return(t-r+n.padding)/2}},w=t.isHorizontal();c=w?{x:t.left+x(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+x(a,s[0]),line:0},at.rtl.overrideTextDirection(t.ctx,e.textDirection);var _=g+n.padding;at.each(t.legendItems,(function(e,r){var i=h.measureText(e.text).width,o=m+g/2+i,f=c.x,p=c.y;d.setWidth(t.minSize.width),w?r>0&&f+o+n.padding>t.left+t.minSize.width&&(p=c.y+=_,c.line++,f=c.x=t.left+x(l,u[c.line])):r>0&&p+_>t.top+t.minSize.height&&(f=c.x=f+t.columnWidths[c.line]+n.padding,c.line++,p=c.y=t.top+x(a,s[c.line]));var k=d.x(f);y(k,p,e),v[r].left=d.leftForLtr(k,v[r].width),v[r].top=p,b(k,p,e,i),w?c.x+=o+n.padding:c.y+=_})),at.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,r,i,o=this;if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)for(i=o.legendHitBoxes,n=0;n=(r=i[n]).left&&t<=r.left+r.width&&e>=r.top&&e<=r.top+r.height)return o.legendItems[n];return null},handleEvent:function(t){var e,n=this,r=n.options,i="mouseup"===t.type?"click":t.type;if("mousemove"===i){if(!r.onHover&&!r.onLeave)return}else{if("click"!==i)return;if(!r.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===i?e&&r.onClick&&r.onClick.call(n,t.native,e):(r.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&r.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),r.onHover&&e&&r.onHover.call(n,t.native,e))}});function qi(t,e){var n=new Gi({ctx:t.ctx,options:e,chart:t});Ue.configure(t,n,e),Ue.addBox(t,n),t.legend=n}var $i={id:"legend",_element:Gi,beforeInit:function(t){var e=t.options.legend;e&&qi(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(at.mergeIf(e,J.global.legend),n?(Ue.configure(t,n,e),n.options=e):qi(t,e)):n&&(Ue.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Ki=at.noop;J._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Zi=pt.extend({initialize:function(t){var e=this;at.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:Ki,update:function(t,e,n){var r=this;return r.beforeUpdate(),r.maxWidth=t,r.maxHeight=e,r.margins=n,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:Ki,beforeSetDimensions:Ki,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Ki,beforeBuildLabels:Ki,buildLabels:Ki,afterBuildLabels:Ki,beforeFit:Ki,fit:function(){var t,e=this,n=e.options,r=e.minSize={},i=e.isHorizontal();n.display?(t=(at.isArray(n.text)?n.text.length:1)*at.options._parseFont(n).lineHeight+2*n.padding,e.width=r.width=i?e.maxWidth:t,e.height=r.height=i?t:e.maxHeight):e.width=r.width=e.height=r.height=0},afterFit:Ki,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var r,i,o,a=at.options._parseFont(n),s=a.lineHeight,l=s/2+n.padding,u=0,c=t.top,d=t.left,h=t.bottom,f=t.right;e.fillStyle=at.valueOrDefault(n.fontColor,J.global.defaultFontColor),e.font=a.string,t.isHorizontal()?(i=d+(f-d)/2,o=c+l,r=f-d):(i="left"===n.position?d+l:f-l,o=c+(h-c)/2,r=h-c,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(i,o),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var p=n.text;if(at.isArray(p))for(var g=0,m=0;m{this.chart&&this.chart.resize()}))}static get styles(){return tt`:host{position:relative;height:100%;width:100%;display:block;min-height:25rem}canvas{width:100px;height:100px}`}firstUpdated(){fetch(this.url).then((t=>t.json())).catch((t=>console.error(t))).then((t=>{var e;let n=(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("canvas")).getContext("2d");this.chart=new gt(n,{type:"bar",data:{datasets:[{label:"Failed Logins",backgroundColor:"rgba(201, 25, 11, .5)",spanGaps:!0,data:t.logins_failed_per_1h},{label:"Successful Logins",backgroundColor:"rgba(189, 229, 184, .5)",spanGaps:!0,data:t.logins_per_1h}]},options:{maintainAspectRatio:!1,spanGaps:!0,scales:{xAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"},type:"time",offset:!0,ticks:{callback:function(t,e,n){const r=n[e],i=Date.now()-r.value;return Math.round(i/1e3/3600)+" Hours ago"},autoSkip:!0,maxTicksLimit:8}}],yAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"}}]}}})}))}render(){return W``}};t([Z()],mt.prototype,"url",void 0),mt=t([$("pb-admin-logins-chart")],mt);var vt=ft((function(t,e){t.exports=function(){var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(t),u=l&&/Qt\/\d+\.\d+/.test(t),c=!o&&/Chrome\//.test(t),d=/Opera\//.test(t),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),g=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),m=/Android/.test(t),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),x=/win/i.test(e),w=d&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var _=y&&(u||d&&(null==w||w<12.11)),k=n||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var M,C=function(t,e){var n=t.className,r=S(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function D(t,e){return T(t).appendChild(e)}function L(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}g?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(t){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function H(t,e){for(var n=0;n=e)return r+Math.min(a,e-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=e)return r}}var q=[""];function $(t){for(;q.length<=t;)q.push(K(q)+" ");return q[t]}function K(t){return t[t.length-1]}function Z(t,e){for(var n=[],r=0;r"€"&&(t.toUpperCase()!=t.toLowerCase()||tt.test(t))}function nt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&et(t))||e.test(t):et(t)}function rt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var it=/[\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 ot(t){return t.charCodeAt(0)>=768&&it.test(t)}function at(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}function lt(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;oe||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}var ut=null;function ct(t,e,n){var r;ut=null;for(var i=0;ie)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:ut=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:ut=i)}return null!=r?r:ut}var dt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var u="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!r.test(t))return!1;for(var c=t.length,d=[],h=0;h-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function vt(t,e){var n=gt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function wt(t){t.prototype.on=function(t,e){pt(this,t,e)},t.prototype.off=function(t,e){mt(this,t,e)}}function _t(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function kt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function St(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Mt(t){_t(t),kt(t)}function Ct(t){return t.target||t.srcElement}function Tt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Dt,Lt,Pt=function(){if(a&&s<9)return!1;var t=L("div");return"draggable"in t||"dragDrop"in t}();function At(t){if(null==Dt){var e=L("span","​");D(t,L("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Dt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Dt?L("span","​"):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ot(t){if(null!=Lt)return Lt;var e=D(t,document.createTextNode("AخA")),n=M(e,0,1).getBoundingClientRect(),r=M(e,1,2).getBoundingClientRect();return T(t),!(!n||n.left==n.right)&&(Lt=r.right-n.right<3)}var Nt,Ft=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},It=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Rt="oncopy"in(Nt=L("div"))||(Nt.setAttribute("oncopy","return;"),"function"==typeof Nt.oncopy),Wt=null;function Et(t){if(null!=Wt)return Wt;var e=D(t,L("span","x")),n=e.getBoundingClientRect(),r=M(e,0,1).getBoundingClientRect();return Wt=Math.abs(n.left-r.left)>1}var zt={},Ht={};function Bt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),zt[t]=e}function Vt(t,e){Ht[t]=e}function Yt(t){if("string"==typeof t&&Ht.hasOwnProperty(t))t=Ht[t];else if(t&&"string"==typeof t.name&&Ht.hasOwnProperty(t.name)){var e=Ht[t.name];"string"==typeof e&&(e={name:e}),(t=Q(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Yt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Yt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ut(t,e){e=Yt(e);var n=zt[e.name];if(!n)return Ut(t,"text/plain");var r=n(t,e);if(jt.hasOwnProperty(e.name)){var i=jt[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}var jt={};function Gt(t,e){W(e,jt.hasOwnProperty(t)?jt[t]:jt[t]={})}function qt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function $t(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&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)}var Zt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xt(t,e){if((e-=t.first)<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 r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e=t.first&&en?oe(n,Xt(t,n).text.length):fe(e,Xt(t,e.line).text.length)}function fe(t,e){var n=t.ch;return null==n||n>e?oe(t.line,e):n<0?oe(t.line,0):t}function pe(t,e){for(var n=[],r=0;r=this.string.length},Zt.prototype.sol=function(){return this.pos==this.lineStart},Zt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Zt.prototype.next=function(){if(this.pose},Zt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Zt.prototype.skipToEnd=function(){this.pos=this.string.length},Zt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Zt.prototype.backUp=function(t){this.pos-=t},Zt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},Zt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Zt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Zt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Zt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ge=function(t,e){this.state=t,this.lookAhead=e},me=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ve(t,e,n,r){var i=[t.state.modeGen],o={};Ce(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=t.state.overlays[r],l=1,u=0;n.state=!0,Ce(t,e.text,s.mode,n,(function(t,e){for(var n=l;ut&&i.splice(l,1,t,i[l+1],r),l+=2,u=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&qt(t.doc.mode,r.state),o=ve(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),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 be(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new me(r,!0,e);var o=Te(t,e,n),a=o>r.first&&Xt(r,o-1).stateAfter,s=a?me.fromSaved(r,a,o):new me(r,Kt(r.mode),o);return r.iter(o,e,(function(n){xe(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&re.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}me.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},me.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},me.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},me.fromSaved=function(t,e,n){return e instanceof ge?new me(t,qt(t.mode,e.state),n,e.lookAhead):new me(t,qt(t.mode,e),n)},me.prototype.save=function(t){var e=!1!==t?qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ge(e,this.maxLookAhead):e};var ke=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Se(t,e,n,r){var i,o,a=t.doc,s=a.mode,l=Xt(a,(e=he(a,e)).line),u=be(t,e.line,n),c=new Zt(l.text,t.options.tabSize,u);for(r&&(o=[]);(r||c.post.options.maxHighlightLength?(s=!1,a&&xe(t,e,r,d.pos),d.pos=e.length,l=null):l=Me(_e(n,d,r.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=Xt(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof ge?u.lookAhead:0)<=o.modeFrontier))return s;var c=E(l.text,null,t.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function De(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;r--){var i=Xt(t,r).stateAfter;if(i&&(!(i instanceof ge)||r+i.lookAhead=e:o.to>e);(r||(r=[])).push(new Ne(a,o.from,s?null:o.to))}}return r}function Ee(t,e,n){var r;if(t)for(var i=0;i=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from0&&s)for(var b=0;b0)){var c=[l,1],d=ae(u.from,s.from),h=ae(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function Ve(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||Ge(n,o.marker)<0)&&(n=o.marker)}return n}function Xe(t,e,n,r,i){var o=Xt(t,e),a=Pe&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ae(u.to,n)>=0:ae(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ae(u.from,r)<=0:ae(u.from,r)<0)))return!0}}}function Je(t){for(var e;e=$e(t);)t=e.find(-1,!0).line;return t}function Qe(t){for(var e;e=Ke(t);)t=e.find(1,!0).line;return t}function tn(t){for(var e,n;e=Ke(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function en(t,e){var n=Xt(t,e),r=Je(n);return n==r?e:ee(r)}function nn(t,e){if(e>t.lastLine())return e;var n,r=Xt(t,e);if(!rn(t,r))return e;for(;n=Ke(r);)r=n.find(1,!0).line;return ee(r)+1}function rn(t,e){var n=Pe&&e.markedSpans;if(n)for(var r=void 0,i=0;ie.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var un=function(t,e,n){this.text=t,Ye(this,e),this.height=n?n(this):1};function cn(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ve(t),Ye(t,n);var i=r?r(t):1;i!=t.height&&te(t,i)}function dn(t){t.parent=null,Ve(t)}un.prototype.lineNo=function(){return ee(this)},wt(un);var hn={},fn={};function pn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?fn:hn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function gn(t,e){var n=P("span",null,null,l?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,a=void 0;r.pos=0,r.addToken=vn,Ot(t.display.measure)&&(a=ht(o,t.doc.direction))&&(r.addToken=bn(r.addToken,a)),r.map=[],wn(o,r,ye(t,o,e!=t.display.externalMeasured&&ee(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=F(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=F(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(At(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return vt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=F(r.pre.className,r.textClass||"")),r}function mn(t){var e=L("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function vn(t,e,n,r,i,o,l){if(e){var u,c=t.splitSpaces?yn(e,t.trailingSpace):e,d=t.cm.state.specialChars,h=!1;if(d.test(e)){u=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var p=d.exec(e),g=p?p.index-f:e.length-f;if(g){var m=document.createTextNode(c.slice(f,f+g));a&&s<9?u.appendChild(L("span",[m])):u.appendChild(m),t.map.push(t.pos,t.pos+g,m),t.col+=g,t.pos+=g}if(!p)break;f+=g+1;var v=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(v=u.appendChild(L("span",$(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),t.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=u.appendChild(L("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),t.col+=1):((v=t.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?u.appendChild(L("span",[v])):u.appendChild(v),t.col+=1);t.map.push(t.pos,t.pos+1,v),t.pos++}}else t.col+=e.length,u=document.createTextNode(c),t.map.push(t.pos,t.pos+e.length,u),a&&s<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==c.charCodeAt(e.length-1),n||r||i||h||o||l){var x=n||"";r&&(x+=r),i&&(x+=i);var w=L("span",[u],x,o);if(l)for(var _ in l)l.hasOwnProperty(_)&&"style"!=_&&"class"!=_&&w.setAttribute(_,l[_]);return t.content.appendChild(w)}t.content.appendChild(u)}}function yn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;iu&&d.from<=u);h++);if(d.to>=c)return t(n,r,i,o,a,s,l);t(n,r.slice(0,d.to-u),i,o,null,s,l),o=null,r=r.slice(d.to-u),u=d.to}}}function xn(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function wn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,u,c,d,h,f=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=s="",h=null,d=null,v=1/0;for(var y=[],b=void 0,x=0;xp||_.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,u=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&w.from==p&&(c+=" "+_.startStyle),_.endStyle&&w.to==v&&(b||(b=[])).push(_.endStyle,w.to),_.title&&((h||(h={})).title=_.title),_.attributes)for(var k in _.attributes)(h||(h={}))[k]=_.attributes[k];_.collapsed&&(!d||Ge(d.marker,_)<0)&&(d=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var S=0;S=f)break;for(var C=Math.min(f,v);;){if(m){var T=p+m.length;if(!d){var D=T>C?m.slice(0,C-p):m;e.addToken(e,D,a?a+l:l,c,p+D.length==v?u:"",s,h)}if(T>=C){m=m.slice(C-p),p=C;break}p=T,c=""}m=i.slice(o,o=n[g++]),a=pn(n[g++],e.cm.options)}}else for(var L=1;L2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;rn)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function Qn(t,e){var n=ee(e=Je(e)),r=t.display.externalMeasured=new _n(t.doc,e,n);r.lineN=n;var i=r.built=gn(t,r);return r.text=i.pre,D(t.display.lineMeasure,i.pre),r}function tr(t,e,n,r){return rr(t,nr(t,e),n,r)}function er(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(i=(o=l-s)-1,e>=l&&(a="right")),null!=i){if(r=t[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&t[u-2]==t[u-3]&&t[u-1].insertLeft;)r=t[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=t[i]).left==n.right;i--);return n}function lr(t,e,n,r){var i,o=ar(e.map,n,r),l=o.node,u=o.start,c=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;u&&ot(e.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c0&&(d=r="right"),i=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Pr(t.display),top:p.top,bottom:p.bottom}:or}for(var g=i.top-e.rect.top,m=i.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var d=ct(s,l,u),h=ut,f=c(l,d,"before"==u);return null!=h&&(f.other=c(l,h,"before"!=u)),f}function xr(t,e){var n=0;e=he(t.doc,e),t.options.lineWrapping||(n=Pr(t.display)*e.ch);var r=Xt(t.doc,e.line),i=an(r)+jn(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function wr(t,e,n,r,i){var o=oe(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function _r(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return wr(r.first,0,null,-1,-1);var i=ne(r,n),o=r.first+r.size-1;if(i>o)return wr(r.first+r.size-1,Xt(r,o).text.length,null,1,1);e<0&&(e=0);for(var a=Xt(r,i);;){var s=Cr(t,a,i,e,n),l=Ze(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Xt(r,i=u.line)}}function kr(t,e,n,r){r-=gr(e);var i=e.text.length,o=st((function(e){return rr(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=st((function(e){return rr(t,n,e).top>r}),o,i)}}function Sr(t,e,n,r){return n||(n=nr(t,e)),kr(t,e,n,mr(t,e,rr(t,n,r),"line").top)}function Mr(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function Cr(t,e,n,r,i){i-=an(e);var o=nr(t,e),a=gr(e),s=0,l=e.text.length,u=!0,c=ht(e,t.doc.direction);if(c){var d=(t.options.lineWrapping?Dr:Tr)(t,e,n,o,c,r,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var h,f,p=null,g=null,m=st((function(e){var n=rr(t,o,e);return n.top+=a,n.bottom+=a,!!Mr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=e,g=n),!0)}),s,l),v=!1;if(g){var y=r-g.left=x.bottom?1:0}return wr(n,m=at(e.text,m,1),f,v,r-h)}function Tr(t,e,n,r,i,o,a){var s=st((function(s){var l=i[s],u=1!=l.level;return Mr(br(t,oe(n,u?l.to:l.from,u?"before":"after"),"line",e,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=br(t,oe(n,u?l.from:l.to,u?"after":"before"),"line",e,r);Mr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function Dr(t,e,n,r,i,o,a){var s=kr(t,e,r,a),l=s.begin,u=s.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var c=null,d=null,h=0;h=u||f.to<=l)){var p=rr(t,r,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,g=pg)&&(c=f,d=g)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function Lr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ir){ir=L("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ir.appendChild(document.createTextNode("x")),ir.appendChild(L("br"));ir.appendChild(document.createTextNode("x"))}D(t.measure,ir);var n=ir.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),T(t.measure),n||1}function Pr(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=L("span","xxxxxxxxxx"),n=L("pre",[e],"CodeMirror-line-like");D(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function Ar(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Or(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function Or(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Nr(t){var e=Lr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/Pr(t.display)-3);return function(i){if(rn(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Xt(t.doc,u.line).text).length==u.ch){var c=E(l,l.length,t.options.tabSize)-l.length;u=oe(u.line,Math.max(0,Math.round((o-qn(t.display).left)/Pr(t.display))-c))}return u}function Rr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;re)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Pe&&en(t.doc,e)i.viewFrom?zr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)zr(t);else if(e<=i.viewFrom){var o=Hr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):zr(t)}else if(n>=i.viewTo){var a=Hr(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):zr(t)}else{var s=Hr(t,e,e,-1),l=Hr(t,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(kn(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):zr(t)}var u=i.externalMeasured;u&&(n=i.lineN&&e=r.viewTo)){var o=r.view[Rr(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function zr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Hr(t,e,n,r){var i,o=Rr(t,e),a=t.display.view;if(!Pe||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,n+=i}for(;en(t.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Br(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=kn(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=kn(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Rr(t,n)))),r.viewTo=n}function Vr(t){for(var e=t.display.view,n=0,r=0;r=t.display.viewTo||s.to().line0?e.blinker=setInterval((function(){t.hasFocus()||Jr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Kr(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Xr(t))}function Zr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Jr(t))}),100)}function Xr(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(vt(t,"focus",t,e),t.state.focused=!0,N(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),$r(t))}function Jr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(vt(t,"blur",t,e),t.state.focused=!1,C(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Qr(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r.005||h<-.005)&&(te(i.line,l),ti(i.line),i.rest))for(var f=0;ft.display.sizerWidth){var p=Math.ceil(u/Pr(t.display));p>t.display.maxLineLength&&(t.display.maxLineLength=p,t.display.maxLine=i.line,t.display.maxLineChanged=!0)}}}}function ti(t){if(t.widgets)for(var e=0;e=a&&(o=ne(e,an(Xt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ni(t,e){if(!yt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;if(e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=L("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-jn(t.display))+"px;\n height: "+(e.bottom-e.top+$n(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(i),t.display.lineSpace.removeChild(o)}}}function ri(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?oe(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?oe(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var a=!1,s=br(t,e),l=n&&n!=e?br(t,n):s,u=oi(t,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=t.doc.scrollTop,d=t.doc.scrollLeft;if(null!=u.scrollTop&&(hi(t,u.scrollTop),Math.abs(t.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(pi(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ii(t,e){var n=oi(t,e);null!=n.scrollTop&&hi(t,n.scrollTop),null!=n.scrollLeft&&pi(t,n.scrollLeft)}function oi(t,e){var n=t.display,r=Lr(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Zn(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Gn(n),l=e.tops-r;if(e.topi+o){var c=Math.min(e.top,(u?s:e.bottom)-o);c!=i&&(a.scrollTop=c)}var d=t.options.fixedGutter?0:n.gutters.offsetWidth,h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-d,f=Kn(t)-n.gutters.offsetWidth,p=e.right-e.left>f;return p&&(e.right=e.left+f),e.left<10?a.scrollLeft=0:e.leftf+h-3&&(a.scrollLeft=e.right+(p?0:10)-f),a}function ai(t,e){null!=e&&(ci(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function si(t){ci(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function li(t,e,n){null==e&&null==n||ci(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function ui(t,e){ci(t),t.curOp.scrollToPos=e}function ci(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,di(t,xr(t,e.from),xr(t,e.to),e.margin))}function di(t,e,n,r){var i=oi(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});li(t,i.scrollLeft,i.scrollTop)}function hi(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Yi(t,{top:e}),fi(t,e,!0),n&&Yi(t),Ii(t,100))}function fi(t,e,n){e=Math.max(0,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 pi(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,qi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function gi(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Gn(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:r,scrollHeight:r+$n(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var mi=function(t,e,n){this.cm=n;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),pt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),pt(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r: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==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},mi.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},mi.prototype.enableZeroWidthBar=function(t,e,n){function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}t.style.pointerEvents="auto",e.set(1e3,r)},mi.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var vi=function(){};function yi(t,e){e||(e=gi(t));var n=t.display.barWidth,r=t.display.barHeight;bi(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Qr(t),bi(t,gi(t)),n=t.display.barWidth,r=t.display.barHeight}function bi(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}vi.prototype.update=function(){return{bottom:0,right:0}},vi.prototype.setScrollLeft=function(){},vi.prototype.setScrollTop=function(){},vi.prototype.clear=function(){};var xi={native:mi,null:vi};function wi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&C(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new xi[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),pt(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?pi(t,e):hi(t,e)}),t),t.display.scrollbars.addClass&&N(t.display.wrapper,t.display.scrollbars.addClass)}var _i=0;function ki(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++_i},Mn(t.curOp)}function Si(t){var e=t.curOp;e&&Tn(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Wi(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Ti(t){t.updatedDisplay=t.mustUpdate&&Bi(t.cm,t.update)}function Di(t){var e=t.cm,n=e.display;t.updatedDisplay&&Qr(e),t.barMeasure=gi(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=tr(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+$n(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Kn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Li(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft=t.display.viewTo)){var n=+new Date+t.options.workTime,r=be(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?qt(e.mode,r.state):null,l=ve(t,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!d&&hn)return Ii(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Ai(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Vr(t))return!1;$i(t)&&(zr(t),e.dims=Ar(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Pe&&(o=en(t.doc,o),a=nn(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Br(t,o,a),n.viewOffset=an(Xt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=Vr(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=zi(t);return l>4&&(n.lineDiv.style.display="none"),Ui(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Hi(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Ii(t,400)),n.updateLineNumbers=null,!0}function Vi(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Kn(t))r&&(e.visible=ei(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Gn(t.display)-Zn(t),n.top)}),e.visible=ei(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!Bi(t,e))break;Qr(t);var i=gi(t);Yr(t),yi(t,i),Gi(t,i),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 Yi(t,e){var n=new Wi(t,e);if(Bi(t,n)){Qr(t),Vi(t,n);var r=gi(t);Yr(t),yi(t,r),Gi(t,r),n.finish()}}function Ui(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var u=r.view,c=r.viewFrom,d=0;d-1&&(f=!1),An(t,h,c,n)),f&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(ie(t.options,c)))),a=h.node.nextSibling}else{var p=zn(t,h,c,n);o.insertBefore(p,a)}c+=h.size}for(;a;)a=s(a)}function ji(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function Gi(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+$n(t)+"px"}function qi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=Or(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;as.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&l)t:for(var h=e.target,f=a.view;h!=s;h=h.parentNode)for(var p=0;p=0&&ae(t,r.to())<=0)return n}return-1};var oo=function(t,e){this.anchor=t,this.head=e};function ao(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return ae(t.from(),e.from())})),n=H(e,i);for(var o=1;o0:l>=0){var u=ce(s.from(),a.from()),c=ue(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new oo(d?c:u,d?u:c))}}return new io(e,n)}function so(t,e){return new io([new oo(t,e||t)],0)}function lo(t){return t.text?oe(t.from.line+t.text.length-1,K(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function uo(t,e){if(ae(t,e.from)<0)return t;if(ae(t,e.to)<=0)return lo(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=lo(e).ch-e.to.ch),oe(n,r)}function co(t,e){for(var n=[],r=0;r1&&t.remove(s.line+1,p-1),t.insert(s.line+1,v)}Ln(t,"change",t,e)}function yo(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a1&&!t.done[t.done.length-2].ranges?(t.done.pop(),K(t.done)):void 0}function Co(t,e,n,r){var i=t.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=Mo(i,i.lastOp==r)))a=K(o.changes),0==ae(e.from,e.to)&&0==ae(e.from,a.to)?a.to=lo(e):o.changes.push(ko(t,e));else{var l=K(i.done);for(l&&l.ranges||Lo(t.sel,i.done),o={changes:[ko(t,e)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,a||vt(t,"historyAdded")}function To(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Do(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(t,o,K(i.done),e))?i.done[i.done.length-1]=e:Lo(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function Lo(t,e){var n=K(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Po(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Ao(t){if(!t)return null;for(var e,n=0;n-1&&(K(s)[d]=u[d],delete u[d])}}}return r}function Io(t,e,n,r){if(r){var i=t.anchor;if(n){var o=ae(e,i)<0;o!=ae(n,i)<0?(i=e,e=n):o!=ae(e,n)<0&&(e=n)}return new oo(i,e)}return new oo(n||e,e)}function Ro(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Vo(t,new io([Io(t.sel.primary(),e,n,i)],0),r)}function Wo(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:s.to>e.ch))){if(i&&(vt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),h=void 0;if((r<0?c:u)&&(d=Ko(t,d,-r,d&&d.line==e.line?o:null)),d&&d.line==e.line&&(h=ae(d,n))&&(r<0?h<0:h>0))return qo(t,d,e,r,i)}var f=l.find(r<0?-1:1);return(r<0?u:c)&&(f=Ko(t,f,r,f.line==e.line?o:null)),f?qo(t,f,e,r,i):null}}return e}function $o(t,e,n,r,i){var o=r||1,a=qo(t,e,n,o,i)||!i&&qo(t,e,n,o,!0)||qo(t,e,n,-o,i)||!i&&qo(t,e,n,-o,!0);return a||(t.cantEdit=!0,oe(t.first,0))}function Ko(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?he(t,oe(e.line-1)):null:n>0&&e.ch==(r||Xt(t,e.line)).text.length?e.line=0;--i)Qo(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else Qo(t,e)}}function Qo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ae(e.from,e.to)){var n=co(t,e);Co(t,e,n,t.cm?t.cm.curOp.id:NaN),na(t,e,n,ze(t,e));var r=[];yo(t,(function(t,n){n||-1!=H(r,t.history)||(sa(t.history,e),r.push(t.history)),na(t,e,null,ze(t,e))}))}}function ta(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,u=0;u=0;--f){var p=h(f);if(p)return p.v}}}}function ea(t,e){if(0!=e&&(t.first+=e,t.sel=new io(Z(t.sel.ranges,(function(t){return new oo(oe(t.anchor.line+e,t.anchor.ch),oe(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Wr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.lineo&&(e={from:e.from,to:oe(o,Xt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Jt(t,e.from,e.to),n||(n=co(t,e)),t.cm?ra(t.cm,e,r):vo(t,e,r),Yo(t,n,Y),t.cantEdit&&$o(t,oe(t.firstLine(),0))&&(t.cantEdit=!1)}}function ra(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=ee(Je(Xt(r,o.line))),r.iter(l,a.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&bt(t),vo(r,e,n,Nr(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=sn(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),De(r,o.line),Ii(t,400);var u=e.text.length-(a.line-o.line)-1;e.full?Wr(t):o.line!=a.line||1!=e.text.length||mo(t.doc,e)?Wr(t,o.line,a.line+1,u):Er(t,o.line,"text");var c=xt(t,"changes"),d=xt(t,"change");if(d||c){var h={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};d&&Ln(t,"change",t,h),c&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}function ia(t,e,n,r,i){var o;r||(r=n),ae(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Jo(t,{from:n,to:r,text:e,origin:i})}function oa(t,e,n,r){n1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var a=i.lines.length%25+25,s=a;s10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xe(t,e.line,e,n,o)||e.line!=n.line&&Xe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Oe()}o.addToHistory&&Co(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,u=t.cm;if(t.iter(l,n.line+1,(function(t){u&&o.collapsed&&!u.options.lineWrapping&&Je(t)==u.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&te(t,0),Re(t,new Ne(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){rn(t,e)&&te(e,0)})),o.clearOnEnter&&pt(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ae(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++pa,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Wr(u,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=e.line;c<=n.line;c++)Er(u,c,"text");o.atomic&&jo(u.doc),Ln(u,"markerAdded",u,o)}return o}ga.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&ki(t),xt(this,"clear")){var n=this.find();n&&Ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&Wr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&jo(t.doc)),t&&Ln(t,"markerCleared",t,this,r,i),e&&Si(t),this.parent&&this.parent.clear()}},ga.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i=0;l--)Jo(this,r[l]);s?Bo(this,s):this.cm&&si(this.cm)})),undo:Fi((function(){ta(this,"undo")})),redo:Fi((function(){ta(this,"redo")})),undoSelection:Fi((function(){ta(this,"undo",!0)})),redoSelection:Fi((function(){ta(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,r=0;r=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=he(this,t),e=he(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;rt)return e=t,!0;t-=o,++n})),he(this,oe(n,e))},indexFromPos:function(t){var e=(t=he(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var d=t.dataTransfer.getData("Text");if(d){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),Yo(e.doc,so(n,n)),h)for(var f=0;f=0;e--)ia(t.doc,"",r[e].from,r[e].to,"+delete");si(t)}))}function qa(t,e,n){var r=at(t.text,e+n,n);return r<0||r>t.text.length?null:r}function $a(t,e,n){var r=qa(t,e.ch,n);return null==r?null:new oe(e.line,r,n<0?"after":"before")}function Ka(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=ht(n,e.doc.direction);if(o){var a,s=i<0?K(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var u=nr(e,n);a=i<0?n.text.length-1:0;var c=rr(e,u,a).top;a=st((function(t){return rr(e,u,t).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=qa(n,a,1))}else a=i<0?s.to:s.from;return new oe(r,a,l)}}return new oe(r,i<0?n.text.length:0,i<0?"before":"after")}function Za(t,e,n,r){var i=ht(e,t.doc.direction);if(!i)return $a(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ct(i,n.ch,n.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&h>=c.begin)){var f=d?"before":"after";return new oe(n.line,h,f)}}var p=function(t,e,r){for(var o=function(t,e){return e?new oe(n.line,l(t,1),"before"):new oe(n.line,t,"after")};t>=0&&t0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==m||r>0&&m==e.text.length||!(g=p(r>0?0:i.length-1,r,u(m)))?null:g}Ea.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ea.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ea.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","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"},Ea.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","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","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"]},Ea.default=y?Ea.macDefault:Ea.pcDefault;var Xa={selectAll:Zo,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),Y)},killLine:function(t){return Ga(t,(function(e){if(e.empty()){var n=Xt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)i=new oe(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),oe(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=Xt(t.doc,i.line-1).text;a&&(i=new oe(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),oe(i.line-1,a.length-1),i,"+transpose"))}n.push(new oo(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Ai(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 r=0;r-1&&(ae((i=s.ranges[i]).from(),e)<0||e.xRel>0)&&(ae(i.to(),e)>0||e.xRel<0)?_s(t,r,e,o):Ss(t,r,e,o)}function _s(t,e,n,r){var i=t.display,o=!1,u=Oi(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Zr(t)),mt(i.wrapper.ownerDocument,"mouseup",u),mt(i.wrapper.ownerDocument,"mousemove",c),mt(i.scroller,"dragstart",d),mt(i.scroller,"drop",u),o||(_t(e),r.addNew||Ro(t.doc,n,null,null,r.extend),l&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=u,u.copy=!r.moveOnDrag,pt(i.wrapper.ownerDocument,"mouseup",u),pt(i.wrapper.ownerDocument,"mousemove",c),pt(i.scroller,"dragstart",d),pt(i.scroller,"drop",u),t.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ks(t,e,n){if("char"==n)return new oo(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new oo(oe(e.line,0),he(t.doc,oe(e.line+1,0)));var r=n(t,e);return new oo(r.from,r.to)}function Ss(t,e,n,r){a&&Zr(t);var i=t.display,o=t.doc;_t(e);var s,l,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?c[l]:new oo(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new oo(n,n)),n=Ir(t,e,!0,!0),l=-1;else{var d=ks(t,n,r.unit);s=r.extend?Io(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=c.length,Vo(o,ao(t,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Vo(o,ao(t,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Eo(o,l,s,U):(l=0,Vo(o,new io([s],0),U),u=o.sel);var h=n;function f(e){if(0!=ae(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],a=t.options.tabSize,c=E(Xt(o,n.line).text,n.ch,a),d=E(Xt(o,e.line).text,e.ch,a),f=Math.min(c,d),p=Math.max(c,d),g=Math.min(n.line,e.line),m=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=m;g++){var v=Xt(o,g).text,y=G(v,f,a);f==p?i.push(new oo(oe(g,y),oe(g,y))):v.length>y&&i.push(new oo(oe(g,y),oe(g,G(v,p,a))))}i.length||i.push(new oo(n,n)),Vo(o,ao(t,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,x=s,w=ks(t,e,r.unit),_=x.anchor;ae(w.anchor,_)>0?(b=w.head,_=ce(x.from(),w.anchor)):(b=w.anchor,_=ue(x.to(),w.head));var k=u.ranges.slice(0);k[l]=Ms(t,new oo(he(o,_),b)),Vo(o,ao(t,k,l),U)}}var p=i.wrapper.getBoundingClientRect(),g=0;function m(e){var n=++g,a=Ir(t,e,!0,"rectangle"==r.unit);if(a)if(0!=ae(a,h)){t.curOp.focus=O(),f(a);var s=ei(i,o);(a.line>=s.to||a.linep.bottom?20:0;l&&setTimeout(Oi(t,(function(){g==n&&(i.scroller.scrollTop+=l,m(e))})),50)}}function v(e){t.state.selectingText=!1,g=1/0,e&&(_t(e),i.input.focus()),mt(i.wrapper.ownerDocument,"mousemove",y),mt(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Oi(t,(function(t){0!==t.buttons&&Tt(t)?m(t):v(t)})),b=Oi(t,v);t.state.selectingText=b,pt(i.wrapper.ownerDocument,"mousemove",y),pt(i.wrapper.ownerDocument,"mouseup",b)}function Ms(t,e){var n=e.anchor,r=e.head,i=Xt(t.doc,n.line);if(0==ae(n,r)&&n.sticky==r.sticky)return e;var o=ht(i);if(!o)return e;var a=ct(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var c=ct(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var h=o[u+(l?-1:0)],f=l==(1==h.level),p=f?h.from:h.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?e:new oo(new oe(n.line,p,g),r)}function Cs(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(t){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&_t(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!xt(t,n))return St(e);o-=s.top-a.viewOffset;for(var l=0;l=i)return vt(t,n,t,ne(t.doc,o),t.display.gutterSpecs[l].className,e),St(e)}}function Ts(t,e){return Cs(t,e,"gutterClick",!0)}function Ds(t,e){Un(t.display,e)||Ls(t,e)||yt(t,e,"contextmenu")||k||t.display.input.onContextMenu(e)}function Ls(t,e){return!!xt(t,"gutterContextMenu")&&Cs(t,e,"gutterContextMenu",!1)}function Ps(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hr(t)}ms.prototype.compare=function(t,e,n){return this.time+gs>t&&0==ae(e,this.pos)&&n==this.button};var As={toString:function(){return"CodeMirror.Init"}},Os={},Ns={};function Fs(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=As&&i(t,e,n)}:i)}t.defineOption=n,t.Init=As,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,po(t)}),!0),n("indentUnit",2,po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){go(t),hr(t),Wr(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(oe(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ia(t.doc,e,n[i],oe(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=As&&t.refresh()})),n("specialCharPlaceholder",mn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ps(t),Xi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=ja(e),i=n!=As&&ja(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Ki(e,t.options.lineNumbers),Xi(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Or(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return yi(t)}),!0),n("scrollbarStyle","native",(function(t){wi(t),yi(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Ki(t.options.gutters,e),Xi(t)}),!0),n("firstLineNumber",1,Xi,!0),n("lineNumberFormatter",(function(t){return t}),Xi,!0),n("showCursorWhenSelecting",!1,Yr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Jr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Is),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Yr,!0),n("singleCursorHeightPerLine",!0,Yr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,go,!0),n("addModeClass",!1,go,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,go,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Is(t,e,n){if(!e!=!(n&&n!=As)){var r=t.display.dragFunctions,i=e?pt:mt;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function Rs(t){t.options.lineWrapping?(N(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(C(t.display.wrapper,"CodeMirror-wrap"),ln(t)),Fr(t),Wr(t),hr(t),setTimeout((function(){return yi(t)}),100)}function Ws(t,e){var n=this;if(!(this instanceof Ws))return new Ws(t,e);this.options=e=e?W(e):{},W(Os,e,!1);var r=e.value;"string"==typeof r?r=new ka(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Ws.inputStyles[e.inputStyle](this),o=this.display=new Ji(t,r,i,e);for(var u in o.wrapper.CodeMirror=this,Ps(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wi(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 z,keySeq:null,specialChars:null},e.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Es(this),Aa(),ki(this),this.curOp.forceUpdate=!0,bo(this,r),e.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xr(n)}),20):Jr(this),Ns)Ns.hasOwnProperty(u)&&Ns[u](this,e[u],As);$i(this),e.finishInit&&e.finishInit(this);for(var c=0;c400}pt(e.scroller,"touchstart",(function(i){if(!yt(t,i)&&!o(i)&&!Ts(t,i)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),pt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),pt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Un(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=t.coordsChar(e.activeTouch,"page");o=!r.prev||l(r,r.prev)?new oo(a,a):!r.prev.prev||l(r,r.prev.prev)?t.findWordAt(a):new oo(oe(a.line,0),he(t.doc,oe(a.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),_t(n)}i()})),pt(e.scroller,"touchcancel",i),pt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(hi(t,e.scroller.scrollTop),pi(t,e.scroller.scrollLeft,!0),vt(t,"scroll",t))})),pt(e.scroller,"mousewheel",(function(e){return ro(t,e)})),pt(e.scroller,"DOMMouseScroll",(function(e){return ro(t,e)})),pt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){yt(t,e)||Mt(e)},over:function(e){yt(t,e)||(Ta(t,e),Mt(e))},start:function(e){return Ca(t,e)},drop:Oi(t,Ma),leave:function(e){yt(t,e)||Da(t)}};var u=e.input.getField();pt(u,"keyup",(function(e){return ds.call(t,e)})),pt(u,"keydown",Oi(t,us)),pt(u,"keypress",Oi(t,hs)),pt(u,"focus",(function(e){return Xr(t,e)})),pt(u,"blur",(function(e){return Jr(t,e)}))}Ws.defaults=Os,Ws.optionHandlers=Ns;var zs=[];function Hs(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=be(t,e).state:n="prev");var a=t.options.tabSize,s=Xt(o,e),l=E(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==V||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>o.first?E(Xt(o,e-1).text,null,a):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 d="",h=0;if(t.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)h+=a,d+="\t";if(ha,l=Ft(e),u=null;if(s&&r.ranges.length>1)if(Bs&&Bs.text.join("\n")==e){if(r.ranges.length%Bs.text.length==0){u=[];for(var c=0;c=0;h--){var f=r.ranges[h],p=f.from(),g=f.to();f.empty()&&(n&&n>0?p=oe(p.line,p.ch-n):t.state.overwrite&&!s?g=oe(g.line,Math.min(Xt(o,g.line).text.length,g.ch+K(l).length)):s&&Bs&&Bs.lineWise&&Bs.text.join("\n")==l.join("\n")&&(p=g=oe(p.line,0)));var m={from:p,to:g,text:u?u[h%u.length]:l,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};Jo(t.doc,m),Ln(t,"inputRead",t,m)}e&&!s&&js(t,e),si(t),t.curOp.updateInput<2&&(t.curOp.updateInput=d),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Us(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Ai(e,(function(){return Ys(e,n,0,null,"paste")})),!0}function js(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Hs(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Hs(t,i.head.line,"smart"));a&&Ln(t,"electricInput",t,i.head.line)}}}function Gs(t){for(var e=[],n=[],r=0;rn&&(Hs(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&si(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Eo(this.doc,r,new oo(o,u[r].to()),Y)}}})),getTokenAt:function(t,e){return Se(this,t,e)},getLineTokens:function(t,e){return Se(this,oe(t),e,!0)},getTokenTypeAt:function(t){t=he(this.doc,t);var e,n=ye(this,Xt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(t=o,i=!0),r=Xt(this.doc,t)}else r=t;return mr(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-an(r):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display,a=(t=br(this,he(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==i?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&ii(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:Ni(us),triggerOnKeyPress:Ni(hs),triggerOnKeyUp:ds,triggerOnMouseDown:Ni(ys),execCommand:function(t){if(Xa.hasOwnProperty(t))return Xa[t].call(null,this)},triggerElectric:Ni((function(t){js(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=he(this.doc,t),a=0;a0&&a(e.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Fr(this),vt(this,"refresh",this)})),swapDoc:Ni((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,t),hr(this),this.display.input.reset(),li(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Ln(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},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}},wt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}function Zs(t,e,n,r,i){var o=e,a=n,s=Xt(t,e.line),l=i&&"rtl"==t.direction?-n:n;function u(){var n=e.line+l;return!(n=t.first+t.size)&&(e=new oe(n,e.ch,e.sticky),s=Xt(t,n))}function c(o){var a;if("codepoint"==r){var c=s.text.charCodeAt(e.ch+(r>0?0:-1));a=isNaN(c)?null:new oe(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(c>=55296&&c<56320?2:1))),-n)}else a=i?Za(t.cm,s,e,n):$a(s,e,n);if(null==a){if(o||!u())return!1;e=Ka(i,t.cm,s,e.line,l)}else e=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var d=null,h="group"==r,f=t.cm&&t.cm.getHelper(e,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var g=s.text.charAt(e.ch)||"\n",m=nt(g,f)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||p||m||(m="s"),d&&d!=m){n<0&&(n=1,c(),e.sticky="after");break}if(m&&(d=m),n>0&&!c(!p))break}var v=$o(t,e,o,a,!0);return se(o,v)&&(v.hitSide=!0),v}function Xs(t,e,n,r){var i,o,a=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Lr(t.display),3);i=(n>0?e.bottom:e.top)+n*u}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(o=_r(t,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Js=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qs(t,e){var n=er(t,e.line);if(!n||n.hidden)return null;var r=Xt(t.doc,e.line),i=Jn(n,r,e.line),o=ht(r,t.doc.direction),a="left";o&&(a=ct(o,e.ch)%2?"right":"left");var s=ar(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function tl(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function el(t,e){return e&&(t.bad=!0),t}function nl(t,e,n,r,i){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function u(t){return function(e){return e.id==t}}function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(t){t&&(c(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void d(n);var o,f=e.getAttribute("cm-marker");if(f){var p=t.findMarks(oe(r,0),oe(i+1,0),u(+f));return void(p.length&&(o=p[0].find(0))&&d(Jt(t.doc,o.from,o.to).join(s)))}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&&c();for(var m=0;m=e.display.viewTo||o.line=e.display.viewFrom&&Qs(e,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=oe(a.line-1,Xt(r.doc,a.line-1).length)),s.ch==Xt(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(t=Rr(r,a.line))?(e=ee(i.view[0].line),n=i.view[0].node):(e=ee(i.view[t].line),n=i.view[t-1].node.nextSibling);var l,u,c=Rr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=ee(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(nl(r,n,u,e,l)),h=Jt(r.doc,oe(e,0),oe(l,Xt(r.doc,l).text.length));d.length>1&&h.length>1;)if(K(d)==K(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),e++}for(var f=0,p=0,g=d[0],m=h[0],v=Math.min(g.length,m.length);fa.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=oe(e,f),_=oe(l,h.length?K(h).length-p:0);return d.length>1||d[0]||ae(w,_)?(ia(r.doc,d,w,_,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.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))},Js.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Ai(this.cm,(function(){return Wr(t.cm)}))},Js.prototype.setUneditable=function(t){t.contentEditable="false"},Js.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Oi(this.cm,Ys)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Js.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var ol=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};function al(t,e){if((e=e?W(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=O();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(pt(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(mt(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Ws((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function sl(t){t.off=mt,t.on=pt,t.wheelEventPixels=no,t.Doc=ka,t.splitLines=Ft,t.countColumn=E,t.findColumn=G,t.isWordChar=et,t.Pass=V,t.signal=vt,t.Line=un,t.changeEnd=lo,t.scrollbarModel=xi,t.Pos=oe,t.cmpPos=ae,t.modes=zt,t.mimeModes=Ht,t.resolveMode=Yt,t.getMode=Ut,t.modeExtensions=jt,t.extendMode=Gt,t.copyState=qt,t.startState=Kt,t.innerMode=$t,t.commands=Xa,t.keyMap=Ea,t.keyName=Ua,t.isModifierKey=Va,t.lookupKey=Ba,t.normalizeKeyMap=Ha,t.StringStream=Zt,t.SharedTextMarker=va,t.TextMarker=ga,t.LineWidget=da,t.e_preventDefault=_t,t.e_stopPropagation=kt,t.e_stop=Mt,t.addClass=N,t.contains=A,t.rmClass=C,t.keyNames=Fa}ol.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!yt(r,t)){if(r.somethingSelected())Vs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Gs(r);Vs({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,Y):(n.prevInput="",i.value=e.text.join("\n"),I(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(i.style.width="0px"),pt(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),pt(i,"paste",(function(t){yt(r,t)||Us(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pt(i,"cut",o),pt(i,"copy",o),pt(t.scroller,"paste",(function(e){if(!Un(t,e)&&!yt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),pt(t.lineSpace,"selectstart",(function(e){Un(t,e)||_t(e)})),pt(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pt(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(t){this.wrapper=$s(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=Ur(t);if(t.options.moveInputWithCursor){var i=br(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},ol.prototype.showSelection=function(t){var e=this.cm.display;D(e.cursorDiv,t.cursors),D(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},ol.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&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||O()!=this.textarea))try{this.textarea.focus()}catch(t){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},ol.prototype.fastPoll=function(){var t=!1,e=this;function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},ol.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||It(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=Ir(n,t),u=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Oi(n,Vo)(n.doc,so(o),Y);var c,h=i.style.cssText,f=e.wrapper.style.cssText,p=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-p.top-5)+"px; left: "+(t.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&m(),k){Mt(t);var g=function(){mt(window,"mouseup",g),setTimeout(v,20)};pt(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var t=n.somethingSelected(),o="​"+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(e.contextMenuPending==v&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&m();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==e.prevInput?Oi(n,Zo)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,Fs(Ws),Ks(Ws);var ll="iter insert remove copy getEditor constructor".split(" ");for(var ul in ka.prototype)ka.prototype.hasOwnProperty(ul)&&H(ll,ul)<0&&(Ws.prototype[ul]=function(t){return function(){return t.apply(this.doc,arguments)}}(ka.prototype[ul]));return wt(ka),Ws.inputStyles={textarea:ol,contenteditable:Js},Ws.defineMode=function(t){Ws.defaults.mode||"null"==t||(Ws.defaults.mode=t),Bt.apply(this,arguments)},Ws.defineMIME=Vt,Ws.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ws.defineMIME("text/plain","null"),Ws.defineExtension=function(t,e){Ws.prototype[t]=e},Ws.defineDocExtension=function(t,e){ka.prototype[t]=e},Ws.fromTextArea=al,sl(Ws),Ws.version="5.58.3",Ws}()}));ft((function(t,e){!function(t){function e(e,r){function i(){e.display.wrapper.offsetHeight?(n(e,r),e.display.lastWrapHeight!=e.display.wrapper.clientHeight&&e.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},t.on(window,"mouseup",r.hurry),t.on(window,"keyup",r.hurry)}function n(e,n){clearTimeout(n.timeout),t.off(window,"mouseup",n.hurry),t.off(window,"keyup",n.hurry)}t.defineOption("autoRefresh",!1,(function(t,r){t.state.autoRefresh&&(n(t,t.state.autoRefresh),t.state.autoRefresh=null),r&&0==t.display.wrapper.offsetHeight&&e(t,t.state.autoRefresh={delay:r.delay||250})}))}(vt)})),ft((function(t,e){var n,r,i;r={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1},(n=vt).defineMode("xml",(function(t,e){var o,a,s=t.indentUnit,l={},u=e.htmlMode?r:i;for(var c in u)l[c]=u[c];for(var c in e)l[c]=e[c];function d(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(p("atom","]]>")):null:t.match("--")?n(p("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(g(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=p("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=h,"tag bracket"):"&"==r?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function h(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){e.tokenize=d,e.state=b,e.tagName=e.tagStart=null;var r=e.tokenize(t,e);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=f(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=h;break}return"string"};return e.isInAttribute=!0,e}function p(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=d;break}n.next()}return t}}function g(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=g(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=d;break}return n.tokenize=g(t-1),n.tokenize(e,n)}}return"meta"}}function m(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function v(t){t.context&&(t.context=t.context.prev)}function y(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(e))return;v(t)}}function b(t,e,n){return"openTag"==t?(n.tagStart=e.column(),x):"closeTag"==t?w:b}function x(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",S):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",S(t,e,n)):(a="error",x)}function w(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&v(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",_):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",_(t,e,n)):(a="error",k)}function _(t,e,n){return"endTag"!=t?(a="error",_):(v(n),b)}function k(t,e,n){return a="error",_(t,e,n)}function S(t,e,n){if("word"==t)return a="attribute",M;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new m(n,r,i==n.indented)),b}return a="error",S}function M(t,e,n){return"equals"==t?C:(l.allowMissing||(a="error"),S(t,e,n))}function C(t,e,n){return"string"==t?T:"word"==t&&l.allowUnquoted?(a="string",S):(a="error",S(t,e,n))}function T(t,e,n){return"string"==t?T:S(t,e,n)}return d.isInText=!0,{startState:function(t){var e={tokenize:d,state:b,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(t,e,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return n.Pass;if(t.tokenize!=h&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==C&&(t.state=S)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}})),n.defineMIME("text/xml","xml"),n.defineMIME("application/xml","xml"),n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})})),ft((function(t,e){var n;(n=vt).defineMode("yaml",(function(){var t=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}})),n.defineMIME("text/x-yaml","yaml"),n.defineMIME("text/yaml","yaml")})),ft((function(t,e){!function(t){function e(t){return new RegExp("^(("+t.join(")|(")+"))\\b")}var n=e(["and","or","not","is"]),r=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],i=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function o(t){return t.scopes[t.scopes.length-1]}t.registerHelper("hintWords","python",r.concat(i)),t.defineMode("python",(function(a,s){for(var l="error",u=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,c=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],d=0;dr?S(e):i0&&C(t,e)&&(a+=" "+l),a}return w(t,e)}function w(t,e,r){if(t.eatSpace())return null;if(!r&&t.match(/^#.*/))return"comment";if(t.match(/^[0-9\.]/,!1)){var i=!1;if(t.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),t.match(/^[\d_]+\.\d*/)&&(i=!0),t.match(/^\.\d+/)&&(i=!0),i)return t.eat(/J/i),"number";var o=!1;if(t.match(/^0x[0-9a-f_]+/i)&&(o=!0),t.match(/^0b[01_]+/i)&&(o=!0),t.match(/^0o[0-7_]+/i)&&(o=!0),t.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(t.eat(/J/i),o=!0),t.match(/^0(?![\dx])/i)&&(o=!0),o)return t.eat(/L/i),"number"}if(t.match(v))return-1!==t.current().toLowerCase().indexOf("f")?(e.tokenize=_(t.current(),e.tokenize),e.tokenize(t,e)):(e.tokenize=k(t.current(),e.tokenize),e.tokenize(t,e));for(var a=0;a=0;)t=t.substr(1);var n=1==t.length,r="string";function i(t){return function(e,n){var r=w(e,n,!0);return"punctuation"==r&&("{"==e.current()?n.tokenize=i(t+1):"}"==e.current()&&(n.tokenize=t>1?i(t-1):o)),r}}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(t))return a.tokenize=e,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i(0),o.current()?r:a.tokenize(o,a);if(o.match("}}"))return r;if(o.match("}"))return l;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;a.tokenize=e}return r}return o.isString=!0,o}function k(t,e){for(;"rubf".indexOf(t.charAt(0).toLowerCase())>=0;)t=t.substr(1);var n=1==t.length,r="string";function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return r}else{if(i.match(t))return o.tokenize=e,r;i.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;o.tokenize=e}return r}return i.isString=!0,i}function S(t){for(;"py"!=o(t).type;)t.scopes.pop();t.scopes.push({offset:o(t).offset+a.indentUnit,type:"py",align:null})}function M(t,e,n){var r=t.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:t.column()+1;e.scopes.push({offset:e.indent+h,type:n,align:r})}function C(t,e){for(var n=t.indentation();e.scopes.length>1&&o(e).offset>n;){if("py"!=o(e).type)return!0;e.scopes.pop()}return o(e).offset!=n}function T(t,e){t.sol()&&(e.beginningOfLine=!0);var n=e.tokenize(t,e),r=t.current();if(e.beginningOfLine&&"@"==r)return t.match(m,!1)?"meta":g?"operator":l;if(/\S/.test(r)&&(e.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=e.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(e.dedent+=1),"lambda"==r&&(e.lambda=!0),":"!=r||e.lambda||"py"!=o(e).type||S(e),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&M(t,e,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(e).type!=r)return l;e.indent=e.scopes.pop().offset-h}}return e.dedent>0&&t.eol()&&"py"==o(e).type&&(e.scopes.length>1&&e.scopes.pop(),e.dedent-=1),n}return{startState:function(t){return{tokenize:x,scopes:[{offset:t||0,type:"py",align:null}],indent:t||0,lastToken:null,lambda:!1,dedent:0}},token:function(t,e){var n=e.errorToken;n&&(e.errorToken=!1);var r=T(t,e);return r&&"comment"!=r&&(e.lastToken="keyword"==r||"punctuation"==r?t.current():r),"punctuation"==r&&(r=null),t.eol()&&e.lambda&&(e.lambda=!1),n?r+" "+l:r},indent:function(e,n){if(e.tokenize!=x)return e.tokenize.isString?t.Pass:0;var r=o(e),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?h:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}})),t.defineMIME("text/x-python","python");var a=function(t){return t.split(" ")};t.defineMIME("text/x-cython",{name:"python",extra_keywords:a("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})}(vt)}));let yt=class extends nt{constructor(){super(...arguments),this.readOnly=!1,this.mode="yaml"}createRenderRoot(){return this}firstUpdated(){const t=this.querySelector("textarea");t&&(this.editor=vt.fromTextArea(t,{mode:this.mode,theme:"monokai",lineNumbers:!1,readOnly:this.readOnly,autoRefresh:!0}),this.editor.on("blur",(t=>{var e;null===(e=this.editor)||void 0===e||e.save()})))}};t([Z()],yt.prototype,"readOnly",void 0),t([Z()],yt.prototype,"mode",void 0),yt=t([$("pb-codemirror")],yt);let bt=class extends nt{constructor(){super();const t=this.querySelector(".pf-c-dropdown__menu");this.querySelectorAll("button").forEach((e=>{e.addEventListener("click",(e=>{t.hidden=!t.hidden}))}))}render(){return W``}};bt=t([$("pb-dropdown")],bt);let xt=class extends nt{constructor(){super(...arguments),this.url="",this.key="",this.value=""}comparison(t){let e={"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"<=":function(t,e){return t<=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e}};const n=t.split(" ");if(n.length<3)throw new Error("nah");let r=n[0];r="value"===r?this.value:parseInt(r,10);let i=n[2];i="value"===i?this.value:parseInt(i,10);const o=n[1];if(!(o in e))throw new Error("Invalid comparison");return e[o](r,i)}firstUpdated(){fetch(this.url).then((t=>t.json())).then((t=>t[this.key])).then((t=>this.value=t))}render(){if(void 0===this.value)return W``;let t="";return this.querySelectorAll("[slot]").forEach((e=>{const n=e.getAttribute("slot");this.comparison(n)&&(t=n)})),this.querySelectorAll("[data-value]").forEach((t=>{t.textContent=this.value})),W``}};var wt;t([Z()],xt.prototype,"url",void 0),t([Z()],xt.prototype,"key",void 0),t([Z()],xt.prototype,"value",void 0),xt=t([$("fetch-fill-slot")],xt),function(t){t[t.redirect=0]="redirect",t[t.template=1]="template"}(wt||(wt={}));let _t=class extends nt{constructor(){super(...arguments),this.flowBodyUrl=""}createRenderRoot(){return this}firstUpdated(){fetch(this.flowBodyUrl).then((t=>{if(!t.ok)throw Error(t.statusText);return t})).then((t=>t.json())).then((t=>{this.updateCard(t)})).catch((t=>{this.errorMessage(t)}))}async updateCard(t){switch(t.type){case wt.redirect:window.location.assign(t.to);break;case wt.template:this.flowBody=t.body,await this.requestUpdate(),this.checkAutofocus(),it(),this.loadFormCode(),this.setFormSubmitHandlers()}}loadFormCode(){this.querySelectorAll("script").forEach((t=>{let e=document.createElement("script");e.src=t.src,document.head.appendChild(e)}))}checkAutofocus(){const t=this.querySelector("[autofocus]");null!==t&&t.focus()}updateFormAction(t){for(let e=0;e{console.log("passbook/flows: Checking for autosubmit attribute "+t),this.checkAutosubmit(t),console.log("passbook/flows: Setting action for form "+t),this.updateFormAction(t),console.log("passbook/flows: Adding handler for form "+t),t.addEventListener("submit",(e=>{e.preventDefault();let n=new FormData(t);this.flowBody=void 0,fetch(this.flowBodyUrl,{method:"post",body:n}).then((t=>t.json())).then((t=>{this.updateCard(t)})).catch((t=>{this.errorMessage(t)}))})),t.classList.add("pb-flow-wrapped")}))}errorMessage(t){this.flowBody=`\n \n \n `}loading(){return W``}render(){return void 0!==this.flowBody?W`${this.flowBody}`:this.loading()}};t([Z()],_t.prototype,"flowBodyUrl",void 0),t([Z()],_t.prototype,"flowBody",void 0),_t=t([$("flow-shell-card")],_t);const kt=new CSSStyleSheet;kt.replaceSync(".pf-c-modal-box {\n --pf-c-modal-box--BackgroundColor: var(--pf-global--BackgroundColor--100);\n --pf-c-modal-box--BoxShadow: var(--pf-global--BoxShadow--xl);\n --pf-c-modal-box--ZIndex: var(--pf-global--ZIndex--xl);\n --pf-c-modal-box--Width: 100%;\n --pf-c-modal-box--MaxWidth: calc(100% - var(--pf-global--spacer--xl));\n --pf-c-modal-box--m-sm--sm--MaxWidth: 35rem;\n --pf-c-modal-box--m-md--Width: 52.5rem;\n --pf-c-modal-box--m-lg--lg--MaxWidth: 70rem;\n --pf-c-modal-box--MaxHeight: calc(100% - var(--pf-global--spacer--2xl));\n --pf-c-modal-box--m-align-top--spacer: var(--pf-global--spacer--sm);\n --pf-c-modal-box--m-align-top--xl--spacer: var(--pf-global--spacer--xl);\n --pf-c-modal-box--m-align-top--MarginTop: var(--pf-c-modal-box--m-align-top--spacer);\n --pf-c-modal-box--m-align-top--MaxHeight: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer), var(--pf-global--spacer--2xl)) - var(--pf-c-modal-box--m-align-top--spacer));\n --pf-c-modal-box--m-align-top--MaxWidth: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer) * 2, var(--pf-global--spacer--xl)));\n --pf-c-modal-box--m-danger__title-icon--Color: var(--pf-global--danger-color--100);\n --pf-c-modal-box--m-warning__title-icon--Color: var(--pf-global--warning-color--100);\n --pf-c-modal-box--m-success__title-icon--Color: var(--pf-global--success-color--100);\n --pf-c-modal-box--m-info__title-icon--Color: var(--pf-global--info-color--100);\n --pf-c-modal-box--m-default__title-icon--Color: var(--pf-global--default-color--200);\n --pf-c-modal-box__header--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__title--LineHeight: var(--pf-global--LineHeight--sm);\n --pf-c-modal-box__title--FontFamily: var(--pf-global--FontFamily--heading--sans-serif);\n --pf-c-modal-box__title--FontSize: var(--pf-global--FontSize--2xl);\n --pf-c-modal-box__title-icon--MarginRight: var(--pf-global--spacer--sm);\n --pf-c-modal-box__title-icon--Color: var(--pf-global--Color--100);\n --pf-c-modal-box__description--PaddingTop: var(--pf-global--spacer--xs);\n --pf-c-modal-box__body--MinHeight: calc(var(--pf-global--FontSize--md) * var(--pf-global--LineHeight--md));\n --pf-c-modal-box__body--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--body--PaddingTop: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--Top: calc(var(--pf-global--spacer--lg));\n --pf-c-modal-box--c-button--Right: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--sibling--MarginRight: calc(var(--pf-global--spacer--xl) + var(--pf-global--spacer--sm));\n --pf-c-modal-box__footer--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-global--spacer--md);\n --pf-c-modal-box__footer--c-button--sm--MarginRight: calc(var(--pf-c-modal-box__footer--c-button--MarginRight) / 2);\n position: relative;\n z-index: var(--pf-c-modal-box--ZIndex);\n display: flex;\n flex-direction: column;\n width: var(--pf-c-modal-box--Width);\n max-width: var(--pf-c-modal-box--MaxWidth);\n max-height: var(--pf-c-modal-box--MaxHeight);\n background-color: var(--pf-c-modal-box--BackgroundColor);\n box-shadow: var(--pf-c-modal-box--BoxShadow); }\n @media (min-width: 1200px) {\n .pf-c-modal-box {\n --pf-c-modal-box--m-align-top--spacer: var(--pf-c-modal-box--m-align-top--xl--spacer); } }\n .pf-c-modal-box.pf-m-sm {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-sm--sm--MaxWidth); }\n .pf-c-modal-box.pf-m-md {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-md--Width); }\n .pf-c-modal-box.pf-m-lg {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-lg--lg--MaxWidth); }\n .pf-c-modal-box.pf-m-align-top {\n top: var(--pf-c-modal-box--m-align-top--MarginTop);\n align-self: flex-start;\n max-width: var(--pf-c-modal-box--m-align-top--MaxWidth);\n max-height: var(--pf-c-modal-box--m-align-top--MaxHeight); }\n .pf-c-modal-box.pf-m-danger {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-danger__title-icon--Color); }\n .pf-c-modal-box.pf-m-warning {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-warning__title-icon--Color); }\n .pf-c-modal-box.pf-m-success {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-success__title-icon--Color); }\n .pf-c-modal-box.pf-m-default {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-default__title-icon--Color); }\n .pf-c-modal-box.pf-m-info {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-info__title-icon--Color); }\n .pf-c-modal-box > .pf-c-button {\n position: absolute;\n top: var(--pf-c-modal-box--c-button--Top);\n right: var(--pf-c-modal-box--c-button--Right); }\n .pf-c-modal-box > .pf-c-button + * {\n margin-right: var(--pf-c-modal-box--c-button--sibling--MarginRight); }\n\n.pf-c-modal-box__header {\n display: flex;\n flex-direction: column;\n padding-top: var(--pf-c-modal-box__header--PaddingTop);\n padding-right: var(--pf-c-modal-box__header--PaddingRight);\n padding-left: var(--pf-c-modal-box__header--PaddingLeft); }\n .pf-c-modal-box__header.pf-m-help {\n display: flex;\n flex-direction: row; }\n .pf-c-modal-box__header:last-child {\n padding-bottom: var(--pf-c-modal-box__header--last-child--PaddingBottom); }\n .pf-c-modal-box__header + .pf-c-modal-box__body {\n --pf-c-modal-box__body--PaddingTop: var(--pf-c-modal-box__header--body--PaddingTop); }\n\n.pf-c-modal-box__header-main {\n flex-grow: 1;\n min-width: 0; }\n\n.pf-c-modal-box__title,\n.pf-c-modal-box__title-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap; }\n\n.pf-c-modal-box__title {\n flex: 0 0 auto;\n font-family: var(--pf-c-modal-box__title--FontFamily);\n font-size: var(--pf-c-modal-box__title--FontSize);\n line-height: var(--pf-c-modal-box__title--LineHeight); }\n .pf-c-modal-box__title.pf-m-icon {\n display: flex; }\n\n.pf-c-modal-box__title-icon {\n margin-right: var(--pf-c-modal-box__title-icon--MarginRight);\n color: var(--pf-c-modal-box__title-icon--Color); }\n\n.pf-c-modal-box__description {\n padding-top: var(--pf-c-modal-box__description--PaddingTop); }\n\n.pf-c-modal-box__body {\n flex: 1 1 auto;\n min-height: var(--pf-c-modal-box__body--MinHeight);\n padding-top: var(--pf-c-modal-box__body--PaddingTop);\n padding-right: var(--pf-c-modal-box__body--PaddingRight);\n padding-left: var(--pf-c-modal-box__body--PaddingLeft);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n word-break: break-word;\n -webkit-overflow-scrolling: touch; }\n .pf-c-modal-box__body:last-child {\n padding-bottom: var(--pf-c-modal-box__body--last-child--PaddingBottom); }\n\n.pf-c-modal-box__footer {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n padding-top: var(--pf-c-modal-box__footer--PaddingTop);\n padding-right: var(--pf-c-modal-box__footer--PaddingRight);\n padding-bottom: var(--pf-c-modal-box__footer--PaddingBottom);\n padding-left: var(--pf-c-modal-box__footer--PaddingLeft); }\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n margin-right: var(--pf-c-modal-box__footer--c-button--MarginRight); }\n @media screen and (min-width: 576px) {\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-c-modal-box__footer--c-button--sm--MarginRight); } }\n");const St=new CSSStyleSheet;St.replaceSync(".pf-c-backdrop {\n --pf-c-backdrop--ZIndex: var(--pf-global--ZIndex--lg);\n --pf-c-backdrop--BackgroundColor: var(--pf-global--BackgroundColor--dark-transparent-100);\n position: fixed;\n top: 0;\n left: 0;\n z-index: var(--pf-c-backdrop--ZIndex);\n width: 100%;\n height: 100%;\n background-color: var(--pf-c-backdrop--BackgroundColor); }\n\n.pf-c-backdrop__open {\n overflow: hidden; }\n");let Mt=class extends nt{constructor(){super(),this.href="",this.open=!1,window.addEventListener("keyup",(t=>{"Escape"===t.code&&(this.open=!1)}))}static get styles(){return[kt,ut,St]}setContent(t){this.querySelector("[slot=modal]").innerHTML=t,this.querySelectorAll("[slot=modal] a").forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),this.open=!1}))})),this.querySelectorAll("[slot=modal] form").forEach((t=>{t.addEventListener("submit",(e=>{e.preventDefault();let n=new FormData(t);fetch(t.action===window.location.toString()?this.href:t.action,{method:t.method,body:n}).then((t=>t.text())).then((t=>{-1!==t.indexOf("csrfmiddlewaretoken")?this.setContent(t):(this.open=!1,this.dispatchEvent(new CustomEvent("hashchange",{bubbles:!0})),it())})).catch((t=>{console.error(t)}))}))}))}onClick(t){const e=new Request(this.href);fetch(e,{mode:"same-origin"}).then((t=>t.text())).then((t=>{this.setContent(t),this.open=!0})).catch((t=>{console.error(t)}))}renderModal(){return W`
        `}render(){return W`${this.open?this.renderModal():""}`}};t([Z()],Mt.prototype,"href",void 0),t([Z()],Mt.prototype,"open",void 0),Mt=t([$("pb-modal-button")],Mt);let Ct=class extends nt{constructor(){super(...arguments),this._currentPage="",this._firstPage=""}get currentPage(){return this._currentPage}set currentPage(t){var e,n;try{null===(e=this.querySelector(`.pf-c-tab-content[tab-name='${t}']`))||void 0===e||e.removeAttribute("hidden"),null===(n=this.querySelector(`.pf-c-tabs__item[tab-name='${t}']`))||void 0===n||n.classList.add("pf-m-current"),this.querySelectorAll(`.pf-c-tab-content:not([tab-name='${t}'])`).forEach((t=>{t.setAttribute("hidden","")})),this.querySelectorAll(`.pf-c-tabs__item:not([tab-name='${t}'])`).forEach((t=>{t.classList.remove("pf-m-current")})),window.location.hash="#"+t,this._currentPage=t}catch(t){this.currentPage=this._firstPage}}createRenderRoot(){return this}firstUpdated(){var t;this._firstPage=null===(t=this.querySelector(".pf-c-tab-content"))||void 0===t?void 0:t.getAttribute("tab-name"),window.location.hash?this.currentPage=window.location.hash:this.currentPage=this._firstPage,this.querySelectorAll(".pf-c-tabs__item > button").forEach((t=>{t.addEventListener("click",(e=>{var n;let r=null===(n=t.parentElement)||void 0===n?void 0:n.getAttribute("tab-name");this.currentPage=r}))}))}};Ct=t([$("pb-tabs")],Ct); //# sourceMappingURL=main.js.map diff --git a/passbook/static/static/passbook/main.js.map b/passbook/static/static/passbook/main.js.map index 8ce32a2b3..28d1f1102 100644 --- a/passbook/static/static/passbook/main.js.map +++ b/passbook/static/static/passbook/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sources":["../src/legacy.js","../node_modules/tslib/tslib.es6.js","../node_modules/lit-html/src/lib/dom.ts","../node_modules/lit-html/src/lib/template.ts","../node_modules/lit-html/src/lib/modify-template.ts","../node_modules/lit-html/src/lib/directive.ts","../node_modules/lit-html/src/lib/part.ts","../node_modules/lit-html/src/lib/template-instance.ts","../node_modules/lit-html/src/lib/template-result.ts","../node_modules/lit-html/src/lib/parts.ts","../node_modules/lit-html/src/lib/template-factory.ts","../node_modules/lit-html/src/lib/render.ts","../node_modules/lit-html/src/lib/default-template-processor.ts","../node_modules/lit-html/src/lit-html.ts","../node_modules/lit-html/src/lib/shady-render.ts","../node_modules/lit-element/src/lib/updating-element.ts","../node_modules/lit-element/src/lib/decorators.ts","../node_modules/lit-element/src/lib/css-tag.ts","../node_modules/lit-element/src/lit-element.ts","../src/Messages.ts","../src/ActionButton.ts","../src/utils.ts","../src/AdminSidebar.ts","../src/AdminSiteShell.ts","../node_modules/moment/moment.js","../node_modules/chart.js/dist/Chart.js","../src/AdminLoginsChart.ts","../node_modules/codemirror/lib/codemirror.js","../node_modules/codemirror/addon/display/autorefresh.js","../node_modules/codemirror/mode/xml/xml.js","../node_modules/codemirror/mode/yaml/yaml.js","../node_modules/codemirror/mode/python/python.js","../src/CodeMirror.ts","../src/Dropdown.ts","../src/FetchFillSlot.ts","../src/FlowShellCard.ts","../src/ModalButton.ts","../src/Tabs.ts"],"sourcesContent":["// Search clearing\ndocument.querySelectorAll(\"input[type=search]\").forEach((si) => {\n si.addEventListener(\"search\", (e) => {\n if (si.value === \"\") {\n si.parentElement.submit();\n }\n });\n});\n\n// Fetch from data-attributes\ndocument.querySelectorAll(\"[data-pb-fetch-fill]\").forEach((el) => {\n const url = el.dataset.pbFetchFill;\n const key = el.dataset.pbFetchKey;\n fetch(url).then(r => r.json()).then(r => {\n el.textContent = r[key];\n el.value = r[key];\n });\n});\n\n// Modal\ndocument.querySelectorAll(\"[data-target='modal']\").forEach((m) => {\n m.addEventListener(\"click\", (e) => {\n const parentContainer = e.target.closest('[data-target=\"modal\"]');\n const modalId = parentContainer.attributes['data-modal'].value;\n document.querySelector(`#${modalId}`).removeAttribute(\"hidden\");\n });\n});\ndocument.querySelectorAll(\".pf-c-modal-box [data-modal-close]\").forEach((b) => {\n b.addEventListener(\"click\", (e) => {\n const parentContainer = e.target.closest('.pf-c-backdrop');\n parentContainer.setAttribute(\"hidden\", true);\n });\n});\n\n// Make Checkbox label click trigger checkbox toggle\ndocument.querySelectorAll(\".pf-c-check__label\").forEach((checkLabel) => {\n checkLabel.addEventListener(\"click\", (e) => {\n const checkbox = e.target.parentElement.querySelector(\"input[type=checkbox]\");\n checkbox.checked = !checkbox.checked;\n });\n});\n\n// CodeMirror\n// document.querySelectorAll(\".codemirror\").forEach((cm) => {\n// let cmMode = 'xml';\n// if ('data-cm-mode' in cm.attributes) {\n// cmMode = cm.attributes['data-cm-mode'].value;\n// }\n// // https://github.com/codemirror/CodeMirror/issues/5092\n// cm.removeAttribute(\"required\");\n// CodeMirror.fromTextArea(cm, {\n// mode: cmMode,\n// theme: 'monokai',\n// lineNumbers: false,\n// readOnly: cm.readOnly,\n// autoRefresh: true,\n// });\n// });\n\n// Automatic slug fields\nconst convertToSlug = (text) => {\n return text\n .toLowerCase()\n .replace(/ /g, '-')\n .replace(/[^\\w-]+/g, '');\n};\n\ndocument.querySelectorAll(\"input[name=name]\").forEach((input) => {\n input.addEventListener(\"input\", (e) => {\n const form = e.target.closest(\"form\");\n if (form === null) {\n return;\n }\n const slugField = form.querySelector(\"input[name=slug]\");\n slugField.value = convertToSlug(e.target.value);\n });\n});\n\n// Hamburger Menu\ndocument.querySelectorAll(\".pf-c-page__header-brand-toggle>button\").forEach((toggle) => {\n toggle.addEventListener(\"click\", (e) => {\n const sidebar = document.querySelector(\".pf-c-page__sidebar\");\n if (sidebar.classList.contains(\"pf-m-expanded\")) {\n // Sidebar already expanded\n sidebar.classList.remove(\"pf-m-expanded\");\n sidebar.style.zIndex = 0;\n } else {\n // Sidebar not expanded yet\n sidebar.classList.add(\"pf-m-expanded\");\n sidebar.style.zIndex = 200;\n }\n });\n});\n\n// Collapsable Menus in Sidebar\ndocument.querySelectorAll(\".pf-m-expandable>.pf-c-nav__link\").forEach((menu) => {\n menu.addEventListener(\"click\", (e) => {\n e.preventDefault();\n menu.parentElement.classList.toggle(\"pf-m-expanded\");\n });\n});\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\ninterface MaybePolyfilledCe extends CustomElementRegistry {\n readonly polyfillWrapFlushCallback?: object;\n}\n\n/**\n * True if the custom elements polyfill is in use.\n */\nexport const isCEPolyfill = typeof window !== 'undefined' &&\n window.customElements != null &&\n (window.customElements as MaybePolyfilledCe).polyfillWrapFlushCallback !==\n undefined;\n\n/**\n * Reparents nodes, starting from `start` (inclusive) to `end` (exclusive),\n * into another container (could be the same container), before `before`. If\n * `before` is null, it appends the nodes to the container.\n */\nexport const reparentNodes =\n (container: Node,\n start: Node|null,\n end: Node|null = null,\n before: Node|null = null): void => {\n while (start !== end) {\n const n = start!.nextSibling;\n container.insertBefore(start!, before);\n start = n;\n }\n };\n\n/**\n * Removes nodes, starting from `start` (inclusive) to `end` (exclusive), from\n * `container`.\n */\nexport const removeNodes =\n (container: Node, start: Node|null, end: Node|null = null): void => {\n while (start !== end) {\n const n = start!.nextSibling;\n container.removeChild(start!);\n start = n;\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {TemplateResult} from './template-result.js';\n\n/**\n * An expression marker with embedded unique key to avoid collision with\n * possible text in templates.\n */\nexport const marker = `{{lit-${String(Math.random()).slice(2)}}}`;\n\n/**\n * An expression marker used text-positions, multi-binding attributes, and\n * attributes with markup-like text values.\n */\nexport const nodeMarker = ``;\n\nexport const markerRegex = new RegExp(`${marker}|${nodeMarker}`);\n\n/**\n * Suffix appended to all bound attribute names.\n */\nexport const boundAttributeSuffix = '$lit$';\n\n/**\n * An updatable Template that tracks the location of dynamic parts.\n */\nexport class Template {\n readonly parts: TemplatePart[] = [];\n readonly element: HTMLTemplateElement;\n\n constructor(result: TemplateResult, element: HTMLTemplateElement) {\n this.element = element;\n\n const nodesToRemove: Node[] = [];\n const stack: Node[] = [];\n // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n const walker = document.createTreeWalker(\n element.content,\n 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n null,\n false);\n // Keeps track of the last index associated with a part. We try to delete\n // unnecessary nodes, but we never want to associate two different parts\n // to the same index. They must have a constant node between.\n let lastPartIndex = 0;\n let index = -1;\n let partIndex = 0;\n const {strings, values: {length}} = result;\n while (partIndex < length) {\n const node = walker.nextNode() as Element | Comment | Text | null;\n if (node === null) {\n // We've exhausted the content inside a nested template element.\n // Because we still have parts (the outer for-loop), we know:\n // - There is a template in the stack\n // - The walker will find a nextNode outside the template\n walker.currentNode = stack.pop()!;\n continue;\n }\n index++;\n\n if (node.nodeType === 1 /* Node.ELEMENT_NODE */) {\n if ((node as Element).hasAttributes()) {\n const attributes = (node as Element).attributes;\n const {length} = attributes;\n // Per\n // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap,\n // attributes are not guaranteed to be returned in document order.\n // In particular, Edge/IE can return them out of order, so we cannot\n // assume a correspondence between part index and attribute index.\n let count = 0;\n for (let i = 0; i < length; i++) {\n if (endsWith(attributes[i].name, boundAttributeSuffix)) {\n count++;\n }\n }\n while (count-- > 0) {\n // Get the template literal section leading up to the first\n // expression in this attribute\n const stringForPart = strings[partIndex];\n // Find the attribute name\n const name = lastAttributeNameRegex.exec(stringForPart)![2];\n // Find the corresponding attribute\n // All bound attributes have had a suffix added in\n // TemplateResult#getHTML to opt out of special attribute\n // handling. To look up the attribute value we also need to add\n // the suffix.\n const attributeLookupName =\n name.toLowerCase() + boundAttributeSuffix;\n const attributeValue =\n (node as Element).getAttribute(attributeLookupName)!;\n (node as Element).removeAttribute(attributeLookupName);\n const statics = attributeValue.split(markerRegex);\n this.parts.push({type: 'attribute', index, name, strings: statics});\n partIndex += statics.length - 1;\n }\n }\n if ((node as Element).tagName === 'TEMPLATE') {\n stack.push(node);\n walker.currentNode = (node as HTMLTemplateElement).content;\n }\n } else if (node.nodeType === 3 /* Node.TEXT_NODE */) {\n const data = (node as Text).data;\n if (data.indexOf(marker) >= 0) {\n const parent = node.parentNode!;\n const strings = data.split(markerRegex);\n const lastIndex = strings.length - 1;\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for node parts\n for (let i = 0; i < lastIndex; i++) {\n let insert: Node;\n let s = strings[i];\n if (s === '') {\n insert = createMarker();\n } else {\n const match = lastAttributeNameRegex.exec(s);\n if (match !== null && endsWith(match[2], boundAttributeSuffix)) {\n s = s.slice(0, match.index) + match[1] +\n match[2].slice(0, -boundAttributeSuffix.length) + match[3];\n }\n insert = document.createTextNode(s);\n }\n parent.insertBefore(insert, node);\n this.parts.push({type: 'node', index: ++index});\n }\n // If there's no text, we must insert a comment to mark our place.\n // Else, we can trust it will stick around after cloning.\n if (strings[lastIndex] === '') {\n parent.insertBefore(createMarker(), node);\n nodesToRemove.push(node);\n } else {\n (node as Text).data = strings[lastIndex];\n }\n // We have a part for each match found\n partIndex += lastIndex;\n }\n } else if (node.nodeType === 8 /* Node.COMMENT_NODE */) {\n if ((node as Comment).data === marker) {\n const parent = node.parentNode!;\n // Add a new marker node to be the startNode of the Part if any of\n // the following are true:\n // * We don't have a previousSibling\n // * The previousSibling is already the start of a previous part\n if (node.previousSibling === null || index === lastPartIndex) {\n index++;\n parent.insertBefore(createMarker(), node);\n }\n lastPartIndex = index;\n this.parts.push({type: 'node', index});\n // If we don't have a nextSibling, keep this node so we have an end.\n // Else, we can remove it to save future costs.\n if (node.nextSibling === null) {\n (node as Comment).data = '';\n } else {\n nodesToRemove.push(node);\n index--;\n }\n partIndex++;\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n // TODO (justinfagnani): consider whether it's even worth it to\n // make bindings in comments work\n this.parts.push({type: 'node', index: -1});\n partIndex++;\n }\n }\n }\n }\n\n // Remove text binding nodes after the walk to not disturb the TreeWalker\n for (const n of nodesToRemove) {\n n.parentNode!.removeChild(n);\n }\n }\n}\n\nconst endsWith = (str: string, suffix: string): boolean => {\n const index = str.length - suffix.length;\n return index >= 0 && str.slice(index) === suffix;\n};\n\n/**\n * A placeholder for a dynamic expression in an HTML template.\n *\n * There are two built-in part types: AttributePart and NodePart. NodeParts\n * always represent a single dynamic expression, while AttributeParts may\n * represent as many expressions are contained in the attribute.\n *\n * A Template's parts are mutable, so parts can be replaced or modified\n * (possibly to implement different template semantics). The contract is that\n * parts can only be replaced, not removed, added or reordered, and parts must\n * always consume the correct number of values in their `update()` method.\n *\n * TODO(justinfagnani): That requirement is a little fragile. A\n * TemplateInstance could instead be more careful about which values it gives\n * to Part.update().\n */\nexport type TemplatePart = {\n readonly type: 'node'; index: number;\n}|{\n readonly type: 'attribute';\n index: number;\n readonly name: string;\n readonly strings: ReadonlyArray;\n};\n\nexport const isTemplatePartActive = (part: TemplatePart) => part.index !== -1;\n\n// Allows `document.createComment('')` to be renamed for a\n// small manual size-savings.\nexport const createMarker = () => document.createComment('');\n\n/**\n * This regex extracts the attribute name preceding an attribute-position\n * expression. It does this by matching the syntax allowed for attributes\n * against the string literal directly preceding the expression, assuming that\n * the expression is in an attribute-value position.\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\x09\\x0a\\x0c\\x0d\" are HTML space characters:\n * https://www.w3.org/TR/html5/infrastructure.html#space-characters\n *\n * \"\\0-\\x1F\\x7F-\\x9F\" are Unicode control characters, which includes every\n * space character except \" \".\n *\n * So an attribute is:\n * * The name: any character except a control character, space character, ('),\n * (\"), \">\", \"=\", or \"/\"\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nexport const lastAttributeNameRegex =\n // eslint-disable-next-line no-control-regex\n /([ \\x09\\x0a\\x0c\\x0d])([^\\0-\\x1F\\x7F-\\x9F \"'>=/]+)([ \\x09\\x0a\\x0c\\x0d]*=[ \\x09\\x0a\\x0c\\x0d]*(?:[^ \\x09\\x0a\\x0c\\x0d\"'`<>=]*|\"[^\"]*|'[^']*))$/;\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isTemplatePartActive, Template, TemplatePart} from './template.js';\n\nconst walkerNodeFilter = 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */;\n\n/**\n * Removes the list of nodes from a Template safely. In addition to removing\n * nodes from the Template, the Template part indices are updated to match\n * the mutated Template DOM.\n *\n * As the template is walked the removal state is tracked and\n * part indices are adjusted as needed.\n *\n * div\n * div#1 (remove) <-- start removing (removing node is div#1)\n * div\n * div#2 (remove) <-- continue removing (removing node is still div#1)\n * div\n * div <-- stop removing since previous sibling is the removing node (div#1,\n * removed 4 nodes)\n */\nexport function removeNodesFromTemplate(\n template: Template, nodesToRemove: Set) {\n const {element: {content}, parts} = template;\n const walker =\n document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let part = parts[partIndex];\n let nodeIndex = -1;\n let removeCount = 0;\n const nodesToRemoveInTemplate = [];\n let currentRemovingNode: Node|null = null;\n while (walker.nextNode()) {\n nodeIndex++;\n const node = walker.currentNode as Element;\n // End removal if stepped past the removing node\n if (node.previousSibling === currentRemovingNode) {\n currentRemovingNode = null;\n }\n // A node to remove was found in the template\n if (nodesToRemove.has(node)) {\n nodesToRemoveInTemplate.push(node);\n // Track node we're removing\n if (currentRemovingNode === null) {\n currentRemovingNode = node;\n }\n }\n // When removing, increment count by which to adjust subsequent part indices\n if (currentRemovingNode !== null) {\n removeCount++;\n }\n while (part !== undefined && part.index === nodeIndex) {\n // If part is in a removed node deactivate it by setting index to -1 or\n // adjust the index as needed.\n part.index = currentRemovingNode !== null ? -1 : part.index - removeCount;\n // go to the next active part.\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n part = parts[partIndex];\n }\n }\n nodesToRemoveInTemplate.forEach((n) => n.parentNode!.removeChild(n));\n}\n\nconst countNodes = (node: Node) => {\n let count = (node.nodeType === 11 /* Node.DOCUMENT_FRAGMENT_NODE */) ? 0 : 1;\n const walker = document.createTreeWalker(node, walkerNodeFilter, null, false);\n while (walker.nextNode()) {\n count++;\n }\n return count;\n};\n\nconst nextActiveIndexInTemplateParts =\n (parts: TemplatePart[], startIndex = -1) => {\n for (let i = startIndex + 1; i < parts.length; i++) {\n const part = parts[i];\n if (isTemplatePartActive(part)) {\n return i;\n }\n }\n return -1;\n };\n\n/**\n * Inserts the given node into the Template, optionally before the given\n * refNode. In addition to inserting the node into the Template, the Template\n * part indices are updated to match the mutated Template DOM.\n */\nexport function insertNodeIntoTemplate(\n template: Template, node: Node, refNode: Node|null = null) {\n const {element: {content}, parts} = template;\n // If there's no refNode, then put node at end of template.\n // No part indices need to be shifted in this case.\n if (refNode === null || refNode === undefined) {\n content.appendChild(node);\n return;\n }\n const walker =\n document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let insertCount = 0;\n let walkerIndex = -1;\n while (walker.nextNode()) {\n walkerIndex++;\n const walkerNode = walker.currentNode as Element;\n if (walkerNode === refNode) {\n insertCount = countNodes(node);\n refNode.parentNode!.insertBefore(node, refNode);\n }\n while (partIndex !== -1 && parts[partIndex].index === walkerIndex) {\n // If we've inserted the node, simply adjust all subsequent parts\n if (insertCount > 0) {\n while (partIndex !== -1) {\n parts[partIndex].index += insertCount;\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n return;\n }\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {Part} from './part.js';\n\nconst directives = new WeakMap();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DirectiveFactory = (...args: any[]) => object;\n\nexport type DirectiveFn = (part: Part) => void;\n\n/**\n * Brands a function as a directive factory function so that lit-html will call\n * the function during template rendering, rather than passing as a value.\n *\n * A _directive_ is a function that takes a Part as an argument. It has the\n * signature: `(part: Part) => void`.\n *\n * A directive _factory_ is a function that takes arguments for data and\n * configuration and returns a directive. Users of directive usually refer to\n * the directive factory as the directive. For example, \"The repeat directive\".\n *\n * Usually a template author will invoke a directive factory in their template\n * with relevant arguments, which will then return a directive function.\n *\n * Here's an example of using the `repeat()` directive factory that takes an\n * array and a function to render an item:\n *\n * ```js\n * html`
          <${repeat(items, (item) => html`
        • ${item}
        • `)}
        `\n * ```\n *\n * When `repeat` is invoked, it returns a directive function that closes over\n * `items` and the template function. When the outer template is rendered, the\n * return directive function is called with the Part for the expression.\n * `repeat` then performs it's custom logic to render multiple items.\n *\n * @param f The directive factory function. Must be a function that returns a\n * function of the signature `(part: Part) => void`. The returned function will\n * be called with the part object.\n *\n * @example\n *\n * import {directive, html} from 'lit-html';\n *\n * const immutable = directive((v) => (part) => {\n * if (part.value !== v) {\n * part.setValue(v)\n * }\n * });\n */\nexport const directive = (f: F): F =>\n ((...args: unknown[]) => {\n const d = f(...args);\n directives.set(d, true);\n return d;\n }) as F;\n\nexport const isDirective = (o: unknown): o is DirectiveFn => {\n return typeof o === 'function' && directives.has(o);\n};\n","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * The Part interface represents a dynamic part of a template instance rendered\n * by lit-html.\n */\nexport interface Part {\n readonly value: unknown;\n\n /**\n * Sets the current part value, but does not write it to the DOM.\n * @param value The value that will be committed.\n */\n setValue(value: unknown): void;\n\n /**\n * Commits the current part value, causing it to actually be written to the\n * DOM.\n *\n * Directives are run at the start of `commit`, so that if they call\n * `part.setValue(...)` synchronously that value will be used in the current\n * commit, and there's no need to call `part.commit()` within the directive.\n * If directives set a part value asynchronously, then they must call\n * `part.commit()` manually.\n */\n commit(): void;\n}\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = {};\n\n/**\n * A sentinel value that signals a NodePart to fully clear its content.\n */\nexport const nothing = {};\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isCEPolyfill} from './dom.js';\nimport {Part} from './part.js';\nimport {RenderOptions} from './render-options.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {isTemplatePartActive, Template, TemplatePart} from './template.js';\n\n/**\n * An instance of a `Template` that can be attached to the DOM and updated\n * with new values.\n */\nexport class TemplateInstance {\n private readonly __parts: Array = [];\n readonly processor: TemplateProcessor;\n readonly options: RenderOptions;\n readonly template: Template;\n\n constructor(\n template: Template, processor: TemplateProcessor,\n options: RenderOptions) {\n this.template = template;\n this.processor = processor;\n this.options = options;\n }\n\n update(values: readonly unknown[]) {\n let i = 0;\n for (const part of this.__parts) {\n if (part !== undefined) {\n part.setValue(values[i]);\n }\n i++;\n }\n for (const part of this.__parts) {\n if (part !== undefined) {\n part.commit();\n }\n }\n }\n\n _clone(): DocumentFragment {\n // There are a number of steps in the lifecycle of a template instance's\n // DOM fragment:\n // 1. Clone - create the instance fragment\n // 2. Adopt - adopt into the main document\n // 3. Process - find part markers and create parts\n // 4. Upgrade - upgrade custom elements\n // 5. Update - set node, attribute, property, etc., values\n // 6. Connect - connect to the document. Optional and outside of this\n // method.\n //\n // We have a few constraints on the ordering of these steps:\n // * We need to upgrade before updating, so that property values will pass\n // through any property setters.\n // * We would like to process before upgrading so that we're sure that the\n // cloned fragment is inert and not disturbed by self-modifying DOM.\n // * We want custom elements to upgrade even in disconnected fragments.\n //\n // Given these constraints, with full custom elements support we would\n // prefer the order: Clone, Process, Adopt, Upgrade, Update, Connect\n //\n // But Safari does not implement CustomElementRegistry#upgrade, so we\n // can not implement that order and still have upgrade-before-update and\n // upgrade disconnected fragments. So we instead sacrifice the\n // process-before-upgrade constraint, since in Custom Elements v1 elements\n // must not modify their light DOM in the constructor. We still have issues\n // when co-existing with CEv0 elements like Polymer 1, and with polyfills\n // that don't strictly adhere to the no-modification rule because shadow\n // DOM, which may be created in the constructor, is emulated by being placed\n // in the light DOM.\n //\n // The resulting order is on native is: Clone, Adopt, Upgrade, Process,\n // Update, Connect. document.importNode() performs Clone, Adopt, and Upgrade\n // in one step.\n //\n // The Custom Elements v1 polyfill supports upgrade(), so the order when\n // polyfilled is the more ideal: Clone, Process, Adopt, Upgrade, Update,\n // Connect.\n\n const fragment = isCEPolyfill ?\n this.template.element.content.cloneNode(true) as DocumentFragment :\n document.importNode(this.template.element.content, true);\n\n const stack: Node[] = [];\n const parts = this.template.parts;\n // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n const walker = document.createTreeWalker(\n fragment,\n 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n null,\n false);\n let partIndex = 0;\n let nodeIndex = 0;\n let part: TemplatePart;\n let node = walker.nextNode();\n // Loop through all the nodes and parts of a template\n while (partIndex < parts.length) {\n part = parts[partIndex];\n if (!isTemplatePartActive(part)) {\n this.__parts.push(undefined);\n partIndex++;\n continue;\n }\n\n // Progress the tree walker until we find our next part's node.\n // Note that multiple parts may share the same node (attribute parts\n // on a single element), so this loop may not run at all.\n while (nodeIndex < part.index) {\n nodeIndex++;\n if (node!.nodeName === 'TEMPLATE') {\n stack.push(node!);\n walker.currentNode = (node as HTMLTemplateElement).content;\n }\n if ((node = walker.nextNode()) === null) {\n // We've exhausted the content inside a nested template element.\n // Because we still have parts (the outer for-loop), we know:\n // - There is a template in the stack\n // - The walker will find a nextNode outside the template\n walker.currentNode = stack.pop()!;\n node = walker.nextNode();\n }\n }\n\n // We've arrived at our part's node.\n if (part.type === 'node') {\n const part = this.processor.handleTextExpression(this.options);\n part.insertAfterNode(node!.previousSibling!);\n this.__parts.push(part);\n } else {\n this.__parts.push(...this.processor.handleAttributeExpressions(\n node as Element, part.name, part.strings, this.options));\n }\n partIndex++;\n }\n\n if (isCEPolyfill) {\n document.adoptNode(fragment);\n customElements.upgrade(fragment);\n }\n return fragment;\n }\n}\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * @module lit-html\n */\n\nimport {reparentNodes} from './dom.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {boundAttributeSuffix, lastAttributeNameRegex, marker, nodeMarker} from './template.js';\n\ndeclare const trustedTypes: typeof window.trustedTypes;\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = window.trustedTypes &&\n trustedTypes!.createPolicy('lit-html', {createHTML: (s) => s});\n\nconst commentMarker = ` ${marker} `;\n\n/**\n * The return type of `html`, which holds a Template and the values from\n * interpolated expressions.\n */\nexport class TemplateResult {\n readonly strings: TemplateStringsArray;\n readonly values: readonly unknown[];\n readonly type: string;\n readonly processor: TemplateProcessor;\n\n constructor(\n strings: TemplateStringsArray, values: readonly unknown[], type: string,\n processor: TemplateProcessor) {\n this.strings = strings;\n this.values = values;\n this.type = type;\n this.processor = processor;\n }\n\n /**\n * Returns a string of HTML used to create a `