211 lines
1.8 MiB
JavaScript
211 lines
1.8 MiB
JavaScript
|
/*! *****************************************************************************
|
||
|
Copyright (c) Microsoft Corporation.
|
||
|
|
||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||
|
purpose with or without fee is hereby granted.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
|
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 n(n,e,t,o){var a,r=arguments.length,i=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(n,e,t,o);else for(var l=n.length-1;l>=0;l--)(a=n[l])&&(i=(r<3?a(i):r>3?a(e,t,i):a(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i}!function(){if(!("adoptedStyleSheets"in document)){var n="ShadyCSS"in window&&!window.ShadyCSS.nativeShadow,e=[],t=[],o=new WeakMap,a=new WeakMap,r=new WeakMap,i=new WeakMap,l=new WeakMap,f={loaded:!1},c={body:null,CSSStyleSheet:null},p=CSSStyleSheet,d=/@import\surl(.*?);/gi,s=["addImport","addPageRule","addRule","deleteRule","insertRule","removeImport","removeRule"],m=["replace","replaceSync"],g=function(){function n(){var n=document.createElement("style");f.loaded?c.body.appendChild(n):(document.head.appendChild(n),n.disabled=!0,e.push(n));var t=n.sheet;return a.set(t,{adopters:new Map,actions:[],basicStyleElement:n}),t}var t=n.prototype;return t.replace=function(n){var e=this,t=h(n);return new Promise((function(n,o){if(a.has(e)){var r=a.get(e).basicStyleElement;r.innerHTML=t,n(r.sheet),x(e)}else o(new Error("Can't call replace on non-constructed CSSStyleSheets."))}))},t.replaceSync=function(n){var e=h(n);if(a.has(this)){var t=a.get(this).basicStyleElement;return t.innerHTML=e,x(this),t.sheet}throw new Error("Failed to execute 'replaceSync' on 'CSSStyleSheet': Can't call replaceSync on non-constructed CSSStyleSheets.")},n}();Object.defineProperty(g,Symbol.hasInstance,{configurable:!0,value:b}),v(p.prototype),window.CSSStyleSheet=g,function(){var e={configurable:!0,get:function(){return o.get(this)||[]},set:function(n){var e=o.get(this)||[];!function(n,e){var t=e===document?"Document":"ShadowRoot";if(!Array.isArray(n))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+t+": Iterator getter is not callable.");if(!n.every(b))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+t+": Failed to convert value to 'CSSStyleSheet'");var a=n.filter((function(e,t){return n.indexOf(e)===t}));o.set(e,a)}(n,this);var t=this===document?u()?this.head:this.body:this,r="isConnected"in t?t.isConnected:document.body.contains(t);window.requestAnimationFrame((function(){r&&(w(t),function(n,e){for(var t=_(n),o=0,r=e.length;o<r;o++)if(!(t.indexOf(e[o])>-1)){var l=a.get(e[o]).adopters,f=i.get(n),c=l.get(n);c||(c=l.get(document.head)),f.disconnect(),c.parentNode.removeChild(c),f.observe()}}(t,e))}))}};if(Object.defineProperty(Document.prototype,"adoptedStyleSheets",e),"undefined"!=typeof ShadowRoot){var t=Element.prototype.attachShadow;Element.prototype.attachShadow=function(){var e=n?this:t.apply(this,arguments);return y(e),e},Object.defineProperty(ShadowRoot.prototype,"adoptedStyleSheets",e)}}(),u()?document.addEventListener("DOMContentLoaded",C):C()}function b(n){return n instanceof p||n instanceof c.CSSStyleSheet}function u(){return"loading"===document.readyState}function _(n){return o.get(n.parentNode===document.documentElement?document:n)}function h(n){var e=n.match(d,"")||[],t=n;return e.length&&(console.warn("@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418"),e.forEach((function(n){t=t.replace(n,"")}))),t}function v(n){m.forEach((function(e){n[e]=function(){return g.prototype[e].apply(this,arguments)}})),s.forEach((function(e){var t=n[e];n[e]=function(){var n=arguments,o=t.apply(this,n);if(a.has(this)){var r=a.get(this),i=r.adopters,l=r.actions;i.forEach((function(t){t.sheet&&t.sheet[e].apply(t.sheet,n)})),l.push([e,n])}return o}}))}function x(n){var e=a.get(n),t=e.adopters,o=e.basicStyleElement;t.forEach((function(n){n.innerHTML=o.innerHTML}))}function w(n){for(var e=document.createDocumentFragment(),o=_(n),f=i.get(n),c=0,p=o.length;c<p;c++){var d=a.get(o[c]),s=d.adopters,m=d.basicStyleElement,g=s.get(n);g?(f.disconnect(),e.appendChild(g),(!g.innerHTML||g.sheet&&!g.sheet.cssText)&&(g.innerHTML=m.innerHTML),f.observe()):((g=document.createElement("style")).innerHTML=m.innerHTML,r.set(g,n),l.set(g,0),s.set(
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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 e="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,t=(n,e,t=null)=>{for(;e!==t;){const t=e.nextSibling;n.removeChild(e),e=t}},o=`{{lit-${String(Math.random()).slice(2)}}}`,a=`\x3c!--${o}--\x3e`,r=new RegExp(`${o}|${a}`);class i{constructor(n,e){this.parts=[],this.element=e;const t=[],a=[],i=document.createTreeWalker(e.content,133,null,!1);let f=0,d=-1,s=0;const{strings:m,values:{length:g}}=n;for(;s<g;){const n=i.nextNode();if(null!==n){if(d++,1===n.nodeType){if(n.hasAttributes()){const e=n.attributes,{length:t}=e;let o=0;for(let n=0;n<t;n++)l(e[n].name,"$lit$")&&o++;for(;o-- >0;){const e=m[s],t=p.exec(e)[2],o=t.toLowerCase()+"$lit$",a=n.getAttribute(o);n.removeAttribute(o);const i=a.split(r);this.parts.push({type:"attribute",index:d,name:t,strings:i}),s+=i.length-1}}"TEMPLATE"===n.tagName&&(a.push(n),i.currentNode=n.content)}else if(3===n.nodeType){const e=n.data;if(e.indexOf(o)>=0){const o=n.parentNode,a=e.split(r),i=a.length-1;for(let e=0;e<i;e++){let t,r=a[e];if(""===r)t=c();else{const n=p.exec(r);null!==n&&l(n[2],"$lit$")&&(r=r.slice(0,n.index)+n[1]+n[2].slice(0,-"$lit$".length)+n[3]),t=document.createTextNode(r)}o.insertBefore(t,n),this.parts.push({type:"node",index:++d})}""===a[i]?(o.insertBefore(c(),n),t.push(n)):n.data=a[i],s+=i}}else if(8===n.nodeType)if(n.data===o){const e=n.parentNode;null!==n.previousSibling&&d!==f||(d++,e.insertBefore(c(),n)),f=d,this.parts.push({type:"node",index:d}),null===n.nextSibling?n.data="":(t.push(n),d--),s++}else{let e=-1;for(;-1!==(e=n.data.indexOf(o,e+1));)this.parts.push({type:"node",index:-1}),s++}}else i.currentNode=a.pop()}for(const n of t)n.parentNode.removeChild(n)}}const l=(n,e)=>{const t=n.length-e.length;return t>=0&&n.slice(t)===e},f=n=>-1!==n.index,c=()=>document.createComment(""),p=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function d(n,e){const{element:{content:t},parts:o}=n,a=document.createTreeWalker(t,133,null,!1);let r=m(o),i=o[r],l=-1,f=0;const c=[];let p=null;for(;a.nextNode();){l++;const n=a.currentNode;for(n.previousSibling===p&&(p=null),e.has(n)&&(c.push(n),null===p&&(p=n)),null!==p&&f++;void 0!==i&&i.index===l;)i.index=null!==p?-1:i.index-f,r=m(o,r),i=o[r]}c.forEach((n=>n.parentNode.removeChild(n)))}const s=n=>{let e=11===n.nodeType?0:1;const t=document.createTreeWalker(n,133,null,!1);for(;t.nextNode();)e++;return e},m=(n,e=-1)=>{for(let t=e+1;t<n.length;t++){const e=n[t];if(f(e))return t}return-1};
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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 g=new WeakMap,b=n=>"function"==typeof n&&g.has(n),u={},_={};
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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
|
||
|
*/
|
||
|
class h{constructor(n,e,t){this.__parts=[],this.template=n,this.processor=e,this.options=t}update(n){let e=0;for(const t of this.__parts)void 0!==t&&t.setValue(n[e]),e++;for(const n of this.__parts)void 0!==n&&n.commit()}_clone(){const n=e?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],o=this.template.parts,a=document.createTreeWalker(n,133,null,!1);let r,i=0,l=0,c=a.nextNode();for(;i<o.length;)if(r=o[i],f(r)){for(;l<r.index;)l++,"TEMPLATE"===c.nodeName&&(t.push(c),a.currentNode=c.content),null===(c=a.nextNode())&&(a.currentNode=t.pop(),c=a.nextNode());if("node"===r.type){const n=this.processor.handleTextExpression(this.options);n.insertAfterNode(c.previousSibling),this.__parts.push(n)}else this.__parts.push(...this.processor.handleAttributeExpressions(c,r.name,r.strings,this.options));i++}else this.__parts.push(void 0),i++;return e&&(document.adoptNode(n),customElements.upgrade(n)),n}}
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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 v=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:n=>n}),x=` ${o} `;class w{constructor(n,e,t,o){this.strings=n,this.values=e,this.type=t,this.processor=o}getHTML(){const n=this.strings.length-1;let e="",t=!1;for(let r=0;r<n;r++){const n=this.strings[r],i=n.lastIndexOf("\x3c!--");t=(i>-1||t)&&-1===n.indexOf("--\x3e",i+1);const l=p.exec(n);e+=null===l?n+(t?x:a):n.substr(0,l.index)+l[1]+l[2]+"$lit$"+l[3]+o}return e+=this.strings[n],e}getTemplateElement(){const n=document.createElement("template");let e=this.getHTML();return void 0!==v&&(e=v.createHTML(e)),n.innerHTML=e,n}}
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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 k=n=>null===n||!("object"==typeof n||"function"==typeof n),y=n=>Array.isArray(n)||!(!n||!n[Symbol.iterator]);class C{constructor(n,e,t){this.dirty=!0,this.element=n,this.name=e,this.strings=t,this.parts=[];for(let n=0;n<t.length-1;n++)this.parts[n]=this._createPart()}_createPart(){return new B(this)}_getValue(){const n=this.strings,e=n.length-1,t=this.parts;if(1===e&&""===n[0]&&""===n[1]){const n=t[0].value;if("symbol"==typeof n)return String(n);if("string"==typeof n||!y(n))return n}let o="";for(let a=0;a<e;a++){o+=n[a];const e=t[a];if(void 0!==e){const n=e.value;if(k(n)||!y(n))o+="string"==typeof n?n:String(n);else for(const e of n)o+="string"==typeof e?e:String(e)}}return o+=n[e],o}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class B{constructor(n){this.value=void 0,this.committer=n}setValue(n){n===u||k(n)&&n===this.value||(this.value=n,b(n)||(this.committer.dirty=!0))}commit(){for(;b(this.value);){const n=this.value;this.value=u,n(this)}this.value!==u&&this.committer.commit()}}class P{constructor(n){this.value=void 0,this.__pendingValue=void 0,this.options=n}appendInto(n){this.startNode=n.appendChild(c()),this.endNode=n.appendChild(c())}insertAfterNode(n){this.startNode=n,this.endNode=n.nextSibling}appendIntoPart(n){n.__insert(this.startNode=c()),n.__insert(this.endNode=c())}insertAfterPart(n){n.__insert(this.startNode=c()),this.endNode=n.endNode,n.endNode=this.startNode}setValue(n){this.__pendingValue=n}commit(){if(null===this.startNode.parentNode)return;for(;b(this.__pendingValue);){const n=this.__pendingValue;this.__pendingValue=u,n(this)}const n=this.__pendingValue;n!==u&&(k(n)?n!==this.value&&this.__commitText(n):n instanceof w?this.__commitTemplateResult(n):n instanceof Node?this.__commitNode(n):y(n)?this.__commitIterable(n):n===_?(this.value=_,this.clear()):this.__commitText(n))}__insert(n){this.endNode.parentNode.insertBefore(n,this.endNode)}__commitNode(n){this.value!==n&&(this.clear(),this.__insert(n),this.value=n)}__commitText(n){const e=this.startNode.nextSibling,t="string"==typeof(n=null==n?"":n)?n:String(n);e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this.__commitNode(document.createTextNode(t)),this.value=n}__commitTemplateResult(n){const e=this.options.templateFactory(n);if(this.value instanceof h&&this.value.template===e)this.value.update(n.values);else{const t=new h(e,n.processor,this.options),o=t._clone();t.update(n.values),this.__commitNode(o),this.value=t}}__commitIterable(n){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let t,o=0;for(const a of n)t=e[o],void 0===t&&(t=new P(this.options),e.push(t),0===o?t.appendIntoPart(this):t.insertAfterPart(e[o-1])),t.setValue(a),t.commit(),o++;o<e.length&&(e.length=o,this.clear(t&&t.endNode))}clear(n=this.startNode){t(this.startNode.parentNode,n.nextSibling,this.endNode)}}class S{constructor(n,e,t){if(this.value=void 0,this.__pendingValue=void 0,2!==t.length||""!==t[0]||""!==t[1])throw new Error("Boolean attributes can only contain a single expression");this.element=n,this.name=e,this.strings=t}setValue(n){this.__pendingValue=n}commit(){for(;b(this.__pendingValue);){const n=this.__pendingValue;this.__pendingValue=u,n(this)}if(this.__pendingValue===u)return;const n=!!this.__pendingValue;this.value!==n&&(n?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=n),this.__pendingValue=u}}class T extends C{constructor(n,e,t){super(n,e,t),this.single=2===t.length&&""===t[0]&&""===t[1]}_createPart(){return new M(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class M extends B{}let L=!1;(()=>{try{const n={get capture(){return L=!0,!1}};window.addEventListener("test",n,n),window.removeEventListener("test",n,n)}catch(n){}})();class z{constructor(n,e,t){this.value=void 0,this.__pendingValue=void 0,this.element=n,this.eventName=e,this.eventContext=t,this.__boundHandleEvent=n=>this.handleEvent(n)}setValue(n){this.__pendingValue=n}com
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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
|
||
|
*/;function R(n){let e=F.get(n.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},F.set(n.type,e));let t=e.stringsArray.get(n.strings);if(void 0!==t)return t;const a=n.strings.join(o);return t=e.keyString.get(a),void 0===t&&(t=new i(n,n.getTemplateElement()),e.keyString.set(a,t)),e.stringsArray.set(n.strings,t),t}const F=new Map,D=new WeakMap;
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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 O=new
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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
|
||
|
*/
|
||
|
class{handleAttributeExpressions(n,e,t,o){const a=e[0];if("."===a){return new T(n,e.slice(1),t).parts}if("@"===a)return[new z(n,e.slice(1),o.eventContext)];if("?"===a)return[new S(n,e.slice(1),t)];return new C(n,e,t).parts}handleTextExpression(n){return new P(n)}};
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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
|
||
|
*/"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const A=(n,...e)=>new w(n,e,"html",O)
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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
|
||
|
*/,I=(n,e)=>`${n}--${e}`;let H=!0;void 0===window.ShadyCSS?H=!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."),H=!1);const N=n=>e=>{const t=I(e.type,n);let a=F.get(t);void 0===a&&(a={stringsArray:new WeakMap,keyString:new Map},F.set(t,a));let r=a.stringsArray.get(e.strings);if(void 0!==r)return r;const l=e.strings.join(o);if(r=a.keyString.get(l),void 0===r){const t=e.getTemplateElement();H&&window.ShadyCSS.prepareTemplateDom(t,n),r=new i(e,t),a.keyString.set(l,r)}return a.stringsArray.set(e.strings,r),r},E=["html","svg"],j=new Set,G=(n,e,t)=>{j.add(n);const o=t?t.element:document.createElement("template"),a=e.querySelectorAll("style"),{length:r}=a;if(0===r)return void window.ShadyCSS.prepareTemplateStyles(o,n);const i=document.createElement("style");for(let n=0;n<r;n++){const e=a[n];e.parentNode.removeChild(e),i.textContent+=e.textContent}(n=>{E.forEach((e=>{const t=F.get(I(e,n));void 0!==t&&t.keyString.forEach((n=>{const{element:{content:e}}=n,t=new Set;Array.from(e.querySelectorAll("style")).forEach((n=>{t.add(n)})),d(n,t)}))}))})(n);const l=o.content;t?function(n,e,t=null){const{element:{content:o},parts:a}=n;if(null==t)return void o.appendChild(e);const r=document.createTreeWalker(o,133,null,!1);let i=m(a),l=0,f=-1;for(;r.nextNode();)for(f++,r.currentNode===t&&(l=s(e),t.parentNode.insertBefore(e,t));-1!==i&&a[i].index===f;){if(l>0){for(;-1!==i;)a[i].index+=l,i=m(a,i);return}i=m(a,i)}}(t,i,l.firstChild):l.insertBefore(i,l.firstChild),window.ShadyCSS.prepareTemplateStyles(o,n);const f=l.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==f)e.insertBefore(f.cloneNode(!0),e.firstChild);else if(t){l.insertBefore(i,l.firstChild);const n=new Set;n.add(i),d(t,n)}};window.JSCompiler_renameProperty=(n,e)=>n;const Y={toAttribute(n,e){switch(e){case Boolean:return n?"":null;case Object:case Array:return null==n?n:JSON.stringify(n)}return n},fromAttribute(n,e){switch(e){case Boolean:return null!==n;case Number:return null===n?null:Number(n);case Object:case Array:return JSON.parse(n)}return n}},V=(n,e)=>e!==n&&(e==e||n==n),q={attribute:!0,type:String,converter:Y,reflect:!1,hasChanged:V};class U extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const n=[];return this._classProperties.forEach(((e,t)=>{const o=this._attributeNameForProperty(t,e);void 0!==o&&(this._attributeToPropertyMap.set(o,t),n.push(o))})),n}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const n=Object.getPrototypeOf(this)._classProperties;void 0!==n&&n.forEach(((n,e)=>this._classProperties.set(e,n)))}}static createProperty(n,e=q){if(this._ensureClassProperties(),this._classProperties.set(n,e),e.noAccessor||this.prototype.hasOwnProperty(n))return;const t="symbol"==typeof n?Symbol():"__"+n,o=this.getPropertyDescriptor(n,t,e);void 0!==o&&Object.defineProperty(this.prototype,n,o)}static getPropertyDescriptor(n,e,t){return{get(){return this[e]},set(o){const a=this[n];this[e]=o,this.requestUpdateInternal(n,a,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this._classProperties&&this._classProperties.get(n)||q}static finalize(){const n=Object.getPrototypeOf(this);if(n.hasOwnProperty("finalized")||n.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const n=this.properties,e=[...Object.getOwnPropertyNames(n),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n):[]];for(const t of e)this.createProperty(t,n[t])}}static _attributeNameForProperty(n,e){const t=e.attribute;return!1===t?void 0:"string"==typeof t?t:"string"==typeof n?n.toLowerCase():void 0}static _valueHasChanged(n,e,t=V){return t(n,e)}static _propertyValueFromAttribute(n,e){const t=e.type,o=e.converter||Y,a="function"==typeof o?o:o.fromAtt
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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=n=>e=>"function"==typeof e?((n,e)=>(window.customElements.define(n,e),e))(n,e):((n,e)=>{const{kind:t,elements:o}=e;return{kind:t,elements:o,finisher(e){window.customElements.define(n,e)}}})(n,e),Z=(n,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(t){t.createProperty(e.key,n)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,n)}};function $(n){return(e,t)=>void 0!==t?((n,e,t)=>{e.constructor.createProperty(t,n)})(n,e,t):Z(n,e)}
|
||
|
/**
|
||
|
@license
|
||
|
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
|
||
|
This code may only be used under the BSD style license found at
|
||
|
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
||
|
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 K=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol();class Q{constructor(n,e){if(e!==J)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n}get styleSheet(){return void 0===this._styleSheet&&(K?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const nn=(n,...e)=>{const t=e.reduce(((e,t,o)=>e+(n=>{if(n instanceof Q)return n.cssText;if("number"==typeof n)return n;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${n}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(t)+n[o+1]),n[0]);return new Q(t,J)};
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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
|
||
|
*/
|
||
|
(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const en={};class tn extends U{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const n=this.getStyles();if(Array.isArray(n)){const e=(n,t)=>n.reduceRight(((n,t)=>Array.isArray(t)?e(t,n):(n.add(t),n)),t),t=e(n,new Set),o=[];t.forEach((n=>o.unshift(n))),this._styles=o}else this._styles=void 0===n?[]:[n];this._styles=this._styles.map((n=>{if(n instanceof CSSStyleSheet&&!K){const e=Array.prototype.slice.call(n.cssRules).reduce(((n,e)=>n+e.cssText),"");return new Q(String(e),J)}return n}))}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 n=this.constructor._styles;0!==n.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?K?this.renderRoot.adoptedStyleSheets=n.map((n=>n instanceof CSSStyleSheet?n:n.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(n.map((n=>n.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(n){const e=this.render();super.update(n),e!==en&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((n=>{const e=document.createElement("style");e.textContent=n.cssText,this.renderRoot.appendChild(e)})))}render(){return en}}tn.finalized=!0,tn.render=(n,e,o)=>{if(!o||"object"!=typeof o||!o.scopeName)throw new Error("The `scopeName` option is required.");const a=o.scopeName,r=D.has(e),i=H&&11===e.nodeType&&!!e.host,l=i&&!j.has(a),f=l?document.createDocumentFragment():e;if(((n,e,o)=>{let a=D.get(e);void 0===a&&(t(e,e.firstChild),D.set(e,a=new P(Object.assign({templateFactory:R},o))),a.appendInto(e)),a.setValue(n),a.commit()})(n,f,Object.assign({templateFactory:N(a)},o)),l){const n=D.get(f);D.delete(f);const o=n.value instanceof h?n.value.template:void 0;G(a,f,o),t(e,e.firstChild),e.appendChild(f),D.set(e,n)}!r&&i&&window.ShadyCSS.styleElement(e.host)};const on=new CSSStyleSheet;on.replaceSync('html,\nbody,\np,\nol,\nul,\nli,\ndl,\ndt,\ndd,\nblockquote,\nfigure,\nfieldset,\nlegend,\ntextarea,\npre,\niframe,\nhr,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n padding: 0;\n margin: 0; }\n\nhtml,\nbody {\n height: 100%; }\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: 100%;\n font-weight: var(--pf-global--FontWeight--normal); }\n\nul {\n list-style: none; }\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: 100%;\n line-height: var(--pf-global--LineHeight--md);\n color: var(--pf-global--Color--100); }\n\nimg,\nembed,\niframe,\nobject,\naudio,\nvideo {\n max-width: 100%;\n height: auto; }\n\niframe {\n border: 0; }\n\ntable {\n border-spacing: 0;\n border-collapse: collapse; }\n\ntd,\nth {\n padding: 0;\n text-align: left; }\n\n*,\n*::before,\n*::after {\n box-sizing: border-box; }\n\nhtml {\n font-family: sans-serif;\n line-height: 1.15; }\n\nbody {\n font-family: var(--pf-global--FontFamily--sans-serif);\n font-size: var(--pf-global--FontSize--md);\n font-weight: var(--pf-global--FontWeight--normal);\n line-height: var(--pf-global--LineHeight--md);\n text-align: left;\n background-color: var(--pf-global--BackgroundColor--100); }\n\na {\n font-weight: var(--pf-global--link--FontWeight);\n color: var(--pf-global--link--Color);\n text-decoration: var(--pf-global--link--TextDecoration); }\n a:hover {\n --pf-global--link--Color: var(--pf-global--link--Color--hover);\n --pf-global--link--TextDecoration: var(--pf-global--link--TextDecoration--hover); }\n\nbutton,\na {\n cursor: pointer; }\n\nbutton::-moz-focus-inner,\n[type="button"]::-moz-focus-inner,\n[type="reset"]::-moz-focu
|
||
|
//! moment.js
|
||
|
o.version="2.29.1",a(Zt),o.fn=cr,o.min=Qt,o.max=no,o.now=eo,o.utc=g,o.unix=pr,o.months=_r,o.isDate=d,o.locale=bt,o.invalid=h,o.duration=Mo,o.isMoment=y,o.weekdays=vr,o.parseZone=dr,o.localeData=ht,o.isDuration=lo,o.monthsShort=hr,o.weekdaysMin=wr,o.defineLocale=ut,o.updateLocale=_t,o.locales=vt,o.weekdaysShort=xr,o.normalizeUnits=on,o.relativeTimeRounding=ai,o.relativeTimeThreshold=ri,o.calendarFormat=jo,o.prototype=cr,o.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"},o}()})),sn=pn((function(n,e){
|
||
|
/*!
|
||
|
* Chart.js v2.9.4
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2020 Chart.js Contributors
|
||
|
* Released under the MIT License
|
||
|
*/
|
||
|
n.exports=function(n){function e(n,e){return n(e={exports:{}},e.exports),e.exports}function t(n){return n&&n.default||n}n=n&&n.hasOwnProperty("default")?n.default:n;var o={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]},a=e((function(n){var e={};for(var t in o)o.hasOwnProperty(t)&&(e[o[t]]=t);var a=n.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:{
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
|
* This code may only be used under the BSD style license found at
|
||
|
* http://polymer.github.io/LICENSE.txt
|
||
|
* The complete set of authors may be found at
|
||
|
* 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
|
||
|
*/var qn;class Un extends tn{constructor(){super(...arguments),this.data={}}static get styles(){return nn`table{width:100%}table,td,tr{border:1px inset #fff;border-collapse:collapse}td,th{padding:.5rem}td:hover{border:1px solid red}`}renderRows(){return Mn.fetch(...this.apiEndpoint()).then((n=>this.data=n)).then((()=>this.data.results.map((n=>this.row(n).map((n=>n))))))}render(){return A`<table><thead><tr>${this.columns().map((n=>A`<th>${n}</th>`))}</tr></thead><tbody>${Vn(this.renderRows(),A`<tr><td>loading...</td></tr>`)}</tbody></table>`}}let Xn=class extends Un{apiEndpoint(){return["policies","bindings","?target="+this.target]}columns(){return["Foo"]}row(n){return[A`${n}`]}};n([$()],Xn.prototype,"target",void 0),Xn=n([X("pb-bound-policies-list")],Xn);let Zn=class extends tn{set args(n){this.applicationSlug=n.slug}set applicationSlug(n){(class{static get(n){return Mn.fetch("core","applications",n)}}).get(n).then((n=>this.application=n))}static get styles(){return Gn.concat(nn`img.pf-icon{max-height:24px}`)}render(){return this.application?A`<section class="pf-c-page__main-section pf-m-light"><div class="pf-c-content"><h1><img class="pf-icon" src="${this.application?.meta_icon||""}"> ${this.application?.name}</h1><p>${this.application?.meta_publisher}</p></div></section><pb-tabs><section slot="page-1" tab-title="Users" class="pf-c-page__main-section pf-m-no-padding-mobile"><div class="pf-l-gallery pf-m-gutter"><div class="pf-c-card pf-c-card-aggregate pf-l-gallery__item pf-m-4-col" style="grid-column-end:span 3;grid-row-end:span 2"><div class="pf-c-card__header"><div class="pf-c-card__header-main"><i class="pf-icon pf-icon-server"></i> Logins over the last 24 hours</div></div><div class="pf-c-card__body"><pb-admin-logins-chart url="${Mn.makeUrl("core","applications",this.application?.slug,"metrics")}"></pb-admin-logins-chart></div></div></div></section><div slot="page-2" tab-title="Policy Bindings" class="pf-c-page__main-section pf-m-no-padding-mobile"><div class="pf-l-gallery pf-m-gutter"><div class="pf-c-card pf-c-card-aggregate pf-l-gallery__item pf-m-4-col" style="grid-column-end:span 3;grid-row-end:span 2"><pb-bound-policies-list .target="${this.application.pk}"></pb-bound-policies-list></div></div></div></pb-tabs>`:A``}};var $n;n([$()],Zn.prototype,"args",null),n([$()],Zn.prototype,"applicationSlug",null),n([$()],Zn.prototype,"application",void 0),Zn=n([X("pb-application-view")],Zn),function(n){n.redirect="redirect",n.template="template"}($n||($n={}));let Kn=class extends tn{constructor(){super(...arguments),this.flowBodyUrl=""}createRenderRoot(){return this}firstUpdated(){fetch(this.flowBodyUrl).then((n=>{if(404===n.status)window.location.pathname="/";else if(!n.ok)throw Error(n.statusText);return n})).then((n=>n.json())).then((n=>{this.updateCard(n)})).catch((n=>{this.errorMessage(n)}))}async updateCard(n){switch(n.type){case $n.redirect:window.location.assign(n.to);break;case $n.template:this.flowBody=n.body,await this.requestUpdate(),this.checkAutofocus(),this.loadFormCode(),this.setFormSubmitHandlers();break;default:console.debug("passbook/flows: unexpected data type "+n.type)}}loadFormCode(){this.querySelectorAll("script").forEach((n=>{let e=document.createElement("script");e.src=n.src,document.head.appendChild(e)}))}checkAutofocus(){const n=this.querySelector("[autofocus]");null!==n&&n.focus()}updateFormAction(n){for(let e=0;e<n.elements.length;e++){if(n.elements[e].value===n.action)return console.debug("passbook/flows: Found Form action URL in form elements, not changing form action."),!1}return n.action=this.flowBodyUrl,console.debug("passbook/flows: updated form.action "+this.flowBodyUrl),!0}checkAutosubmit(n){if("autosubmit"in n.attributes)return n.submit()}setFormSubmitHandlers(){this.querySelectorAll("form").forEach((n=>{console.debug("passbook/flows: Checking for autosubmit attribute "+n),this.checkAutosubmit(n),console.debug("passbook/flows: Setting action for form "+n),this.updateFormAction(n),console.debug("passbook/flows: Adding handler for form "+n),n.addEventListener("submit",(e=>{e.preventD
|
||
|
//# sourceMappingURL=main.js.map
|