@mantou/gem 1.7.8 → 1.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gem.es.js +234 -102
- package/dist/gem.umd.js +24 -24
- package/elements/base/dialog.d.ts.map +1 -1
- package/elements/base/dialog.js +1 -1
- package/elements/base/dialog.js.map +1 -1
- package/elements/base/link.d.ts.map +1 -1
- package/elements/base/link.js +8 -4
- package/elements/base/link.js.map +1 -1
- package/elements/base/modal-factory.d.ts +28 -6
- package/elements/base/modal-factory.d.ts.map +1 -1
- package/elements/base/reflect.d.ts +8 -0
- package/elements/base/reflect.d.ts.map +1 -1
- package/elements/base/reflect.js +36 -9
- package/elements/base/reflect.js.map +1 -1
- package/elements/base/route.d.ts +25 -10
- package/elements/base/route.d.ts.map +1 -1
- package/elements/base/route.js +90 -56
- package/elements/base/route.js.map +1 -1
- package/elements/base/title.d.ts.map +1 -1
- package/elements/base/title.js +8 -2
- package/elements/base/title.js.map +1 -1
- package/helper/i18n.d.ts +8 -1
- package/helper/i18n.d.ts.map +1 -1
- package/helper/i18n.js +6 -2
- package/helper/i18n.js.map +1 -1
- package/helper/logger.d.ts +9 -0
- package/helper/logger.d.ts.map +1 -0
- package/helper/logger.js +16 -0
- package/helper/logger.js.map +1 -0
- package/helper/ssr-shim.d.ts.map +1 -1
- package/helper/ssr-shim.js +12 -4
- package/helper/ssr-shim.js.map +1 -1
- package/lib/element.d.ts +5 -5
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js +40 -14
- package/lib/element.js.map +1 -1
- package/lib/history.d.ts +3 -2
- package/lib/history.d.ts.map +1 -1
- package/lib/history.js +22 -9
- package/lib/history.js.map +1 -1
- package/lib/utils.d.ts +2 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +10 -8
- package/lib/utils.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/elements/base/dialog.ts +4 -1
- package/src/elements/base/link.ts +8 -4
- package/src/elements/base/reflect.ts +43 -9
- package/src/elements/base/route.ts +102 -51
- package/src/elements/base/title.ts +9 -2
- package/src/helper/i18n.ts +11 -3
- package/src/helper/logger.ts +21 -0
- package/src/helper/ssr-shim.ts +14 -4
- package/src/lib/element.ts +46 -17
- package/src/lib/history.ts +30 -12
- package/src/lib/utils.ts +16 -9
- package/src/lib/version.ts +1 -1
- package/src/test/elements/link.test.ts +15 -0
- package/src/test/elements/reflect.test.ts +27 -0
- package/src/test/elements/title.test.ts +25 -0
- package/src/test/utils.test.ts +14 -0
package/dist/gem.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var gn=(o,S,T)=>{if(!S.has(o))throw TypeError("Cannot "+T)};var d=(o,S,T)=>(gn(o,S,"read from private field"),T?T.call(o):S.get(o)),v=(o,S,T)=>{if(S.has(o))throw TypeError("Cannot add the same private member more than once");S instanceof WeakSet?S.add(o):S.set(o,T)},C=(o,S,T,te)=>(gn(o,S,"write to private field"),te?te.call(o,T):S.set(o,T),T);var yn=(o,S,T)=>(gn(o,S,"access private method"),T);(function(o,S){typeof exports=="object"&&typeof module!="undefined"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(o=typeof globalThis!="undefined"?globalThis:o||self,S(o.Gem={}))})(this,function(o){var Z,ee,ae,Fe,wn,Pe,kt,ue,Xe,Tt,Os,Ke,ze,Je,Ms,Qe,Ce,Le,de,Ns,ke,Nt,$t,Rs,Mt,As,fe,Ye,Te,Ot;"use strict";var S=Object.freeze(Object.defineProperty({__proto__:null,get GemElement(){return N},get defineAttribute(){return ft},get defineProperty(){return _e},get defineRef(){return pt},get defineCSSState(){return mt},get nativeDefineElement(){return gt},get html(){return z},get svg(){return On},get render(){return Wt},get directive(){return te},get TemplateResult(){return Ne},get SVGTemplateResult(){return Ht},get repeat(){return Un},get guard(){return Bn},get ifDefined(){return Kt}},Symbol.toStringTag,{value:"Module"}));/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
4
4
|
* This code may only be used under the BSD style license found at
|
|
@@ -10,7 +10,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
10
10
|
* Code distributed by Google as part of the polymer project is also
|
|
11
11
|
* subject to an additional IP rights grant found at
|
|
12
12
|
* http://polymer.github.io/PATENTS.txt
|
|
13
|
-
*/const
|
|
13
|
+
*/const T=new WeakMap,te=n=>(...e)=>{const t=n(...e);return T.set(t,!0),t},$e=n=>typeof n=="function"&&T.has(n);/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
16
16
|
* This code may only be used under the BSD style license found at
|
|
@@ -22,7 +22,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
22
22
|
* Code distributed by Google as part of the polymer project is also
|
|
23
23
|
* subject to an additional IP rights grant found at
|
|
24
24
|
* http://polymer.github.io/PATENTS.txt
|
|
25
|
-
*/const
|
|
25
|
+
*/const _n=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,vn=(n,e,t=null,s=null)=>{for(;e!==t;){const i=e.nextSibling;n.insertBefore(e,s),e=i}},Rt=(n,e,t=null)=>{for(;e!==t;){const s=e.nextSibling;n.removeChild(e),e=s}};/**
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
28
28
|
* This code may only be used under the BSD style license found at
|
|
@@ -34,7 +34,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
34
34
|
* Code distributed by Google as part of the polymer project is also
|
|
35
35
|
* subject to an additional IP rights grant found at
|
|
36
36
|
* http://polymer.github.io/PATENTS.txt
|
|
37
|
-
*/const
|
|
37
|
+
*/const D={},Sn={};/**
|
|
38
38
|
* @license
|
|
39
39
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
40
40
|
* This code may only be used under the BSD style license found at
|
|
@@ -46,7 +46,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
46
46
|
* Code distributed by Google as part of the polymer project is also
|
|
47
47
|
* subject to an additional IP rights grant found at
|
|
48
48
|
* http://polymer.github.io/PATENTS.txt
|
|
49
|
-
*/const
|
|
49
|
+
*/const ne=`{{lit-${String(Math.random()).slice(2)}}}`,En=`<!--${ne}-->`,bn=new RegExp(`${ne}|${En}`),Me="$lit$";class Hs{constructor(e,t){this.parts=[],this.element=t;const s=[],i=[],r=document.createTreeWalker(t.content,133,null,!1);let a=0,c=-1,l=0;const{strings:h,values:{length:g}}=e;for(;l<g;){const f=r.nextNode();if(f===null){r.currentNode=i.pop();continue}if(c++,f.nodeType===1){if(f.hasAttributes()){const M=f.attributes,{length:m}=M;let w=0;for(let p=0;p<m;p++)Pn(M[p].name,Me)&&w++;for(;w-- >0;){const p=h[l],E=At.exec(p)[2],b=E.toLowerCase()+Me,F=f.getAttribute(b);f.removeAttribute(b);const V=F.split(bn);this.parts.push({type:"attribute",index:c,name:E,strings:V}),l+=V.length-1}}f.tagName==="TEMPLATE"&&(i.push(f),r.currentNode=f.content)}else if(f.nodeType===3){const M=f.data;if(M.indexOf(ne)>=0){const m=f.parentNode,w=M.split(bn),p=w.length-1;for(let E=0;E<p;E++){let b,F=w[E];if(F==="")b=K();else{const V=At.exec(F);V!==null&&Pn(V[2],Me)&&(F=F.slice(0,V.index)+V[1]+V[2].slice(0,-Me.length)+V[3]),b=document.createTextNode(F)}m.insertBefore(b,f),this.parts.push({type:"node",index:++c})}w[p]===""?(m.insertBefore(K(),f),s.push(f)):f.data=w[p],l+=p}}else if(f.nodeType===8)if(f.data===ne){const M=f.parentNode;(f.previousSibling===null||c===a)&&(c++,M.insertBefore(K(),f)),a=c,this.parts.push({type:"node",index:c}),f.nextSibling===null?f.data="":(s.push(f),c--),l++}else{let M=-1;for(;(M=f.data.indexOf(ne,M+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(const f of s)f.parentNode.removeChild(f)}}const Pn=(n,e)=>{const t=n.length-e.length;return t>=0&&n.slice(t)===e},Gs=n=>n.index!==-1,K=()=>document.createComment(""),At=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;/**
|
|
50
50
|
* @license
|
|
51
51
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
52
52
|
* This code may only be used under the BSD style license found at
|
|
@@ -58,7 +58,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
58
58
|
* Code distributed by Google as part of the polymer project is also
|
|
59
59
|
* subject to an additional IP rights grant found at
|
|
60
60
|
* http://polymer.github.io/PATENTS.txt
|
|
61
|
-
*/class
|
|
61
|
+
*/class Cn{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)s!==void 0&&s.setValue(e[t]),t++;for(const s of this.__parts)s!==void 0&&s.commit()}_clone(){const e=_n?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let r=0,a=0,c,l=i.nextNode();for(;r<s.length;){if(c=s[r],!Gs(c)){this.__parts.push(void 0),r++;continue}for(;a<c.index;)a++,l.nodeName==="TEMPLATE"&&(t.push(l),i.currentNode=l.content),(l=i.nextNode())===null&&(i.currentNode=t.pop(),l=i.nextNode());if(c.type==="node"){const h=this.processor.handleTextExpression(this.options);h.insertAfterNode(l.previousSibling),this.__parts.push(h)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));r++}return _n&&(document.adoptNode(e),customElements.upgrade(e)),e}}/**
|
|
62
62
|
* @license
|
|
63
63
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
64
64
|
* This code may only be used under the BSD style license found at
|
|
@@ -70,7 +70,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
70
70
|
* Code distributed by Google as part of the polymer project is also
|
|
71
71
|
* subject to an additional IP rights grant found at
|
|
72
72
|
* http://polymer.github.io/PATENTS.txt
|
|
73
|
-
*/const
|
|
73
|
+
*/const Ln=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:n=>n}),xs=` ${ne} `;class Ne{constructor(e,t,s,i){this.strings=e,this.values=t,this.type=s,this.processor=i}getHTML(){const e=this.strings.length-1;let t="",s=!1;for(let i=0;i<e;i++){const r=this.strings[i],a=r.lastIndexOf("<!--");s=(a>-1||s)&&r.indexOf("-->",a+1)===-1;const c=At.exec(r);c===null?t+=r+(s?xs:En):t+=r.substr(0,c.index)+c[1]+c[2]+Me+c[3]+ne}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return Ln!==void 0&&(t=Ln.createHTML(t)),e.innerHTML=t,e}}class Ht extends Ne{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const e=super.getTemplateElement(),t=e.content,s=t.firstChild;return t.removeChild(s),vn(t,s.firstChild),e}}/**
|
|
74
74
|
* @license
|
|
75
75
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
76
76
|
* This code may only be used under the BSD style license found at
|
|
@@ -82,7 +82,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
82
82
|
* Code distributed by Google as part of the polymer project is also
|
|
83
83
|
* subject to an additional IP rights grant found at
|
|
84
84
|
* http://polymer.github.io/PATENTS.txt
|
|
85
|
-
*/const
|
|
85
|
+
*/const Gt=n=>n===null||!(typeof n=="object"||typeof n=="function"),xt=n=>Array.isArray(n)||!!(n&&n[Symbol.iterator]);class kn{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let i=0;i<s.length-1;i++)this.parts[i]=this._createPart()}_createPart(){return new It(this)}_getValue(){const e=this.strings,t=e.length-1,s=this.parts;if(t===1&&e[0]===""&&e[1]===""){const r=s[0].value;if(typeof r=="symbol")return String(r);if(typeof r=="string"||!xt(r))return r}let i="";for(let r=0;r<t;r++){i+=e[r];const a=s[r];if(a!==void 0){const c=a.value;if(Gt(c)||!xt(c))i+=typeof c=="string"?c:String(c);else for(const l of c)i+=typeof l=="string"?l:String(l)}}return i+=e[t],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class It{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==D&&(!Gt(e)||e!==this.value)&&(this.value=e,$e(e)||(this.committer.dirty=!0))}commit(){for(;$e(this.value);){const e=this.value;this.value=D,e(this)}this.value!==D&&this.committer.commit()}}class pe{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(K()),this.endNode=e.appendChild(K())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=K()),e.__insert(this.endNode=K())}insertAfterPart(e){e.__insert(this.startNode=K()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;$e(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=D,t(this)}const e=this.__pendingValue;e!==D&&(Gt(e)?e!==this.value&&this.__commitText(e):e instanceof Ne?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):xt(e)?this.__commitIterable(e):e===Sn?(this.value=Sn,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling;e=e==null?"":e;const s=typeof e=="string"?e:String(e);t===this.endNode.previousSibling&&t.nodeType===3?t.data=s:this.__commitNode(document.createTextNode(s)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof Cn&&this.value.template===t)this.value.update(e.values);else{const s=new Cn(t,e.processor,this.options),i=s._clone();s.update(e.values),this.__commitNode(i),this.value=s}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s=0,i;for(const r of e)i=t[s],i===void 0&&(i=new pe(this.options),t.push(i),s===0?i.appendIntoPart(this):i.insertAfterPart(t[s-1])),i.setValue(r),i.commit(),s++;s<t.length&&(t.length=s,this.clear(i&&i.endNode))}clear(e=this.startNode){Rt(this.startNode.parentNode,e.nextSibling,this.endNode)}}class Is{constructor(e,t,s){if(this.value=void 0,this.__pendingValue=void 0,s.length!==2||s[0]!==""||s[1]!=="")throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;$e(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=D,t(this)}if(this.__pendingValue===D)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=D}}class Ws extends kn{constructor(e,t,s){super(e,t,s),this.single=s.length===2&&s[0]===""&&s[1]===""}_createPart(){return new Vs(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Vs extends It{}let Tn=!1;(()=>{try{const n={get capture(){return Tn=!0,!1}};window.addEventListener("test",n,n),window.removeEventListener("test",n,n)}catch{}})();class Ds{constructor(e,t,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this.__boundHandleEvent=i=>this.handleEvent(i)}setValue(e){this.__pendingValue=e}commit(){for(;$e(this.__pendingValue);){const r=this.__pendingValue;this.__pendingValue=D,r(this)}if(this.__pendingValue===D)return;const e=this.__pendingValue,t=this.value,s=e==null||t!=null&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=e!=null&&(t==null||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=js(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=D}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const js=n=>n&&(Tn?{capture:n.capture,passive:n.passive,once:n.once}:n.capture);/**
|
|
86
86
|
* @license
|
|
87
87
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
88
88
|
* This code may only be used under the BSD style license found at
|
|
@@ -94,7 +94,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
94
94
|
* Code distributed by Google as part of the polymer project is also
|
|
95
95
|
* subject to an additional IP rights grant found at
|
|
96
96
|
* http://polymer.github.io/PATENTS.txt
|
|
97
|
-
*/class
|
|
97
|
+
*/class qs{handleAttributeExpressions(e,t,s,i){const r=t[0];return r==="."?new Ws(e,t.slice(1),s).parts:r==="@"?[new Ds(e,t.slice(1),i.eventContext)]:r==="?"?[new Is(e,t.slice(1),s)]:new kn(e,t,s).parts}handleTextExpression(e){return new pe(e)}}const $n=new qs;/**
|
|
98
98
|
* @license
|
|
99
99
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
100
100
|
* This code may only be used under the BSD style license found at
|
|
@@ -106,7 +106,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
106
106
|
* Code distributed by Google as part of the polymer project is also
|
|
107
107
|
* subject to an additional IP rights grant found at
|
|
108
108
|
* http://polymer.github.io/PATENTS.txt
|
|
109
|
-
*/function
|
|
109
|
+
*/function Us(n){let e=Mn.get(n.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},Mn.set(n.type,e));let t=e.stringsArray.get(n.strings);if(t!==void 0)return t;const s=n.strings.join(ne);return t=e.keyString.get(s),t===void 0&&(t=new Hs(n,n.getTemplateElement()),e.keyString.set(s,t)),e.stringsArray.set(n.strings,t),t}const Mn=new Map;/**
|
|
110
110
|
* @license
|
|
111
111
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
112
112
|
* This code may only be used under the BSD style license found at
|
|
@@ -118,7 +118,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
118
118
|
* Code distributed by Google as part of the polymer project is also
|
|
119
119
|
* subject to an additional IP rights grant found at
|
|
120
120
|
* http://polymer.github.io/PATENTS.txt
|
|
121
|
-
*/const
|
|
121
|
+
*/const Nn=new WeakMap,Wt=(n,e,t)=>{let s=Nn.get(e);s===void 0&&(Rt(e,e.firstChild),Nn.set(e,s=new pe(Object.assign({templateFactory:Us},t))),s.appendInto(e)),s.setValue(n),s.commit()};/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
124
124
|
* This code may only be used under the BSD style license found at
|
|
@@ -130,8 +130,8 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
130
130
|
* Code distributed by Google as part of the polymer project is also
|
|
131
131
|
* subject to an additional IP rights grant found at
|
|
132
132
|
* http://polymer.github.io/PATENTS.txt
|
|
133
|
-
*/typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const
|
|
134
|
-
)*)}`,"g");function
|
|
133
|
+
*/typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const z=(n,...e)=>new Ne(n,e,"html",$n),On=(n,...e)=>new Ht(n,e,"svg",$n),Oe=new Set;function G(n){typeof n=="function"&&(Oe.size||globalThis.queueMicrotask(()=>{Oe.forEach(e=>e()),Oe.clear()}),Oe.delete(n),Oe.add(n))}const Re=[];function Bs(){for(let n=Re.length-1;n>=0;n--)Re[n]();Re.length=0}function Fs(n){Re.length||G(Bs),Re.push(n)}function Vt(n="",e=""){const{pathname:t,search:s,hash:i}=new URL(e,location.origin+n);return t+s+decodeURIComponent(i)}function Dt(n,e,t,s){return n.addEventListener(e,t,s),()=>n.removeEventListener(e,t,s)}class Rn extends EventTarget{constructor(){super(...arguments);v(this,Fe);v(this,Z,void 0);v(this,ee,void 0);v(this,ae,void 0);C(this,Z,new Map)}get size(){return d(this,Z).size}get first(){return d(this,ee)}get last(){return d(this,ae)}isSuperLinkOf(t){let s=t.first;if(!s)return!0;let i=this.find(s.value);for(;i&&i.value===s.value;){if(s=s.next,!s)return!0;i=i.next}return!1}find(t){return d(this,Z).get(t)}add(t){d(this,ae)||this.dispatchEvent(new CustomEvent("start"));const s=yn(this,Fe,wn).call(this,t)||{value:t};s.prev=d(this,ae),s.prev&&(s.prev.next=s),s.next=void 0,C(this,ae,s),d(this,ee)||C(this,ee,s),d(this,Z).set(t,s)}delete(t){const s=yn(this,Fe,wn).call(this,t);return d(this,ee)||this.dispatchEvent(new CustomEvent("end")),s}get(){const t=d(this,ee);if(!!t)return this.delete(t.value),t.value}}Z=new WeakMap,ee=new WeakMap,ae=new WeakMap,Fe=new WeakSet,wn=function(t){const s=d(this,Z).get(t);return s&&(s.prev?s.prev.next=s.next:C(this,ee,s.next),s.next?s.next.prev=s.prev:C(this,ae,s.prev),d(this,Z).delete(t)),s};class An extends WeakMap{get(e){let t=super.get(e);return t||(t={},this.set(e,t)),t}}class me extends URLSearchParams{constructor(t){super(t);v(this,Pe,t=>typeof t=="string"?t:JSON.stringify(t));v(this,kt,t=>{if(!t)return null;try{return JSON.parse(t)}catch{return null}})}concat(t){let s;typeof t=="string"?s=Object.fromEntries(new URLSearchParams(t).entries()):s=t,Object.entries(s).forEach(([i,r])=>{this.append(i,d(this,Pe).call(this,r))})}setAny(t,s){if(Array.isArray(s))this.delete(t),s.forEach(i=>this.append(t,d(this,Pe).call(this,i)));else{const i=d(this,Pe).call(this,s);i?this.set(t,i):this.delete(t)}}getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter(s=>s!=="").map(s=>d(this,kt).call(this,s))}toString(){const t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}Pe=new WeakMap,kt=new WeakMap;function Ae(n,...e){return n.reduce((t,s,i)=>{var r;return t+((r=e[i-1])!=null?r:"")+s})}function Ks(n,...e){return Ae(n,...e)}const jt=Symbol.for("gem@sheetToken");function zs(n,e=""){const t=new CSSStyleSheet,s={};t.media.mediaText=e;let i="";return typeof n=="string"?i=n:Object.keys(n).forEach(r=>{s[r]=`${r}-${He()}`,i+=n[r].styledContent.replace(/&/g,s[r])}),t.replaceSync(i),s[jt]=t,s}function He(n=5){const e=Math.random().toString(36).slice(2).slice(0,n);return e.length<n?e+He(n-e.length):e}const Js=new RegExp(`&.*{((.|
|
|
134
|
+
)*)}`,"g");function Hn(n,e){const t=[];let s=`& {${n.replace(Js,i=>(t.push(i),""))}}`+t.join("");return s=s.replace(/&/g,e==="class"?".&":"#&"),{styledContent:s,type:e}}const Qs={class:(n,...e)=>{const t=Ae(n,...e);return Hn(t,"class")},id:(n,...e)=>{const t=Ae(n,...e);return Hn(t,"id")},keyframes:(n,...e)=>({styledContent:`@keyframes & {${Ae(n,...e)}}`,type:"keyframes"})};function j(n){return n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function se(n){return n.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Ze(n){return Object.keys(n).forEach(e=>{const t=e;delete n[t]}),n}class J extends Error{constructor(e){super(e),this.message=`gem: ${this.message}`}}function Gn(n,e){const t=n.length;if(e.length!==t)return!0;for(let s=0;s<t;s++)if(n[s]!==e[s])return!0;return!1}function xn(n,e){const t=new Set(e);return n.filter(s=>t.has(s)?(t.delete(s),!1):!0)}function et(n,e,t){let s=e;for(const i in n){const r=t(i,n[i]);s+=r?r+e:""}return s}function Xs(n){return et(n,";",(e,t)=>t!=null?`${j(e)}:${t}`:"")}function In(n){return et(n," ",(e,t)=>t?e:"")}const Ys=In;function Zs(n){return et(n,",",(e,t)=>t===!0||e===t?e:t?`${e}:${t}`:"")}const ge=new WeakMap;function ye(n){if(ge.has(n))throw new J("argument error");return ge.set(n,new Set),n}function Q(n,e){var t;Object.assign(n,e),(t=ge.get(n))==null||t.forEach(s=>{G(s)})}function tt(n){const e=ye(n);return[e,t=>Q(e,t)]}function ie(n,e){const t=ge.get(n);return t==null||t.add(e),()=>t==null?void 0:t.delete(e)}function ei(n,e){const t=ge.get(n);t==null||t.delete(e)}const Wn="1.7.9";var ti=Object.freeze(Object.defineProperty({__proto__:null,version:Wn},Symbol.toStringTag,{value:"Module"}));/**
|
|
135
135
|
* @license
|
|
136
136
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
137
137
|
* This code may only be used under the BSD style license found at
|
|
@@ -143,7 +143,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
143
143
|
* Code distributed by Google as part of the polymer project is also
|
|
144
144
|
* subject to an additional IP rights grant found at
|
|
145
145
|
* http://polymer.github.io/PATENTS.txt
|
|
146
|
-
*/const
|
|
146
|
+
*/const Vn=(n,e)=>{const t=n.startNode.parentNode,s=e===void 0?n.endNode:e.startNode,i=t.insertBefore(K(),s);t.insertBefore(K(),s);const r=new pe(n.options);return r.insertAfterNode(i),r},ce=(n,e)=>(n.setValue(e),n.commit(),n),qt=(n,e,t)=>{const s=n.startNode.parentNode,i=t?t.startNode:n.endNode,r=e.endNode.nextSibling;r!==i&&vn(s,e.startNode,r,i)},Ut=n=>{Rt(n.startNode.parentNode,n.startNode,n.endNode.nextSibling)},Dn=(n,e,t)=>{const s=new Map;for(let i=e;i<=t;i++)s.set(n[i],i);return s},jn=new WeakMap,qn=new WeakMap,Un=te((n,e,t)=>{let s;return t===void 0?t=e:e!==void 0&&(s=e),i=>{if(!(i instanceof pe))throw new Error("repeat can only be used in text bindings");const r=jn.get(i)||[],a=qn.get(i)||[],c=[],l=[],h=[];let g=0;for(const b of n)h[g]=s?s(b,g):g,l[g]=t(b,g),g++;let f,M,m=0,w=r.length-1,p=0,E=l.length-1;for(;m<=w&&p<=E;)if(r[m]===null)m++;else if(r[w]===null)w--;else if(a[m]===h[p])c[p]=ce(r[m],l[p]),m++,p++;else if(a[w]===h[E])c[E]=ce(r[w],l[E]),w--,E--;else if(a[m]===h[E])c[E]=ce(r[m],l[E]),qt(i,r[m],c[E+1]),m++,E--;else if(a[w]===h[p])c[p]=ce(r[w],l[p]),qt(i,r[w],r[m]),w--,p++;else if(f===void 0&&(f=Dn(h,p,E),M=Dn(a,m,w)),!f.has(a[m]))Ut(r[m]),m++;else if(!f.has(a[w]))Ut(r[w]),w--;else{const b=M.get(h[p]),F=b!==void 0?r[b]:null;if(F===null){const V=Vn(i,r[m]);ce(V,l[p]),c[p]=V}else c[p]=ce(F,l[p]),qt(i,F,r[m]),r[b]=null;p++}for(;p<=E;){const b=Vn(i,c[E+1]);ce(b,l[p]),c[p++]=b}for(;m<=w;){const b=r[m++];b!==null&&Ut(b)}jn.set(i,c),qn.set(i,h)}});/**
|
|
147
147
|
* @license
|
|
148
148
|
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
149
149
|
* This code may only be used under the BSD style license found at
|
|
@@ -155,7 +155,7 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
155
155
|
* Code distributed by Google as part of the polymer project is also
|
|
156
156
|
* subject to an additional IP rights grant found at
|
|
157
157
|
* http://polymer.github.io/PATENTS.txt
|
|
158
|
-
*/const
|
|
158
|
+
*/const Bt=new WeakMap,Bn=te((n,e)=>t=>{const s=Bt.get(t);if(Array.isArray(n)){if(Array.isArray(s)&&s.length===n.length&&n.every((i,r)=>i===s[r]))return}else if(s===n&&(n!==void 0||Bt.has(t)))return;t.setValue(e()),Bt.set(t,Array.isArray(n)?Array.from(n):n)});/**
|
|
159
159
|
* @license
|
|
160
160
|
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
161
161
|
* This code may only be used under the BSD style license found at
|
|
@@ -167,15 +167,15 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
167
167
|
* Code distributed by Google as part of the polymer project is also
|
|
168
168
|
* subject to an additional IP rights grant found at
|
|
169
169
|
* http://polymer.github.io/PATENTS.txt
|
|
170
|
-
*/const jt=new WeakMap,Dt=Y(n=>e=>{const t=jt.get(e);if(n===void 0&&e instanceof At){if(t!==void 0||!jt.has(e)){const s=e.committer.name;e.committer.element.removeAttribute(s)}}else n!==t&&e.setValue(n);jt.set(e,n)});var In=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},u=(n,e,t)=>(In(n,e,"read from private field"),t?t.call(n):e.get(n)),w=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},N=(n,e,t,s)=>(In(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),me,Re,te,Ne,J,Oe,F,ne,Ye,Ze,qt,Ut,Bt,et,Ft,tt,ae,zt,nt,st,it;function Bs(){}function Kt(n){typeof n=="function"&&n()}const rt=new Cn,Jt=(n=performance.now())=>{if(performance.now()>n+16)return requestAnimationFrame(Jt);const e=rt.get();e&&(e(),Jt(n))};rt.addEventListener("start",()=>I(Jt));const ot=Symbol("constructor"),at=Symbol("init"),Vn=Symbol("update"),Ae=class extends HTMLElement{constructor({isAsync:n,isLight:e,delegatesFocus:t,slotAssignment:s}={}){super(),w(this,Re,void 0),w(this,te,void 0),w(this,Ne,void 0),w(this,J,void 0),w(this,Oe,void 0),w(this,F,void 0),w(this,ne,void 0),w(this,Ye,void 0),this.setState=r=>{if(!this.state)throw new z("`state` not initialized");Object.assign(this.state,r),I(u(this,ae))},w(this,Ze,r=>{r==null||r.forEach(a=>{const{callback:c,getDep:l,values:h,preCallback:p}=a,d=l==null?void 0:l();(!l||!h||$n(h,d))&&(Kt(p),a.preCallback=c(d,h),a.values=d)})}),w(this,qt,()=>{u(this,Ze).call(this,u(this,F))}),w(this,Ut,()=>{u(this,Ze).call(this,u(this,ne))}),this.effect=(r,a)=>{u(this,F)||N(this,F,[]);const c={callback:r,getDep:a,initialized:u(this,J),inConstructor:this[ot]};u(this,J)&&(c.values=a==null?void 0:a(),c.preCallback=r(c.values)),u(this,F).push(c)},this.memo=(r,a)=>{u(this,ne)||N(this,ne,[]),u(this,ne).push({callback:r,getDep:a,inConstructor:this[ot]})},w(this,Bt,()=>{var r;(r=u(this,F))==null||r.forEach(a=>{const{callback:c,getDep:l,initialized:h}=a;h||(a.values=l==null?void 0:l(),a.preCallback=c(a.values),a.initialized=!0)})}),w(this,et,()=>{u(this,Ut).call(this);const r=u(this,Re)===this,a=this.render?this.render():r?void 0:B`<slot></slot>`;a!==void 0&&Ht(a,u(this,Re))}),w(this,Ft,()=>this.shouldUpdate?this.shouldUpdate():!0),w(this,tt,()=>{u(this,J)&&u(this,Ft).call(this)&&(u(this,et).call(this),I(u(this,zt)),I(u(this,qt)))}),w(this,ae,()=>{u(this,Oe)?rt.add(u(this,tt)):u(this,tt).call(this)}),this.update=()=>{I(u(this,ae))},w(this,zt,()=>{var r;(r=this.updated)==null||r.call(this)}),w(this,nt,void 0),w(this,st,()=>{var c,l,h;if(u(this,Ne)){N(this,Ne,!1);return}Reflect.set(this,ot,!1),(c=this.willMount)==null||c.call(this);const{observedStores:r,rootElement:a}=this.constructor;if(N(this,nt,r==null?void 0:r.map(p=>re(p,u(this,ae)))),u(this,et).call(this),N(this,J,!0),N(this,Ye,(l=this.mounted)==null?void 0:l.call(this)),u(this,Bt).call(this),a&&this.isConnected&&((h=this.getRootNode().host)==null?void 0:h.tagName)!==a.toUpperCase())throw new z("not allow current root type")}),w(this,it,r=>(r.initialized=!1,r.inConstructor)),I(()=>Reflect.set(this,at,!1)),Reflect.set(this,ot,!0),Reflect.set(this,at,!0),Reflect.set(this,Vn,()=>{u(this,J)&&I(u(this,ae))}),N(this,Oe,n),N(this,Re,e?this:this.attachShadow({mode:"open",delegatesFocus:t,slotAssignment:s}));const{adoptedStyleSheets:i}=new.target;if(i){const r=i.map(a=>a[Wt]||a);this.shadowRoot?this.shadowRoot.adoptedStyleSheets=r:this.effect(()=>{const a=this.getRootNode();return a.adoptedStyleSheets=[...a.adoptedStyleSheets,...r],()=>{a.adoptedStyleSheets=Tn(a.adoptedStyleSheets,r)}},()=>[])}}get internals(){if(!u(this,te)){N(this,te,this.attachInternals());try{u(this,te).states.add("foo"),u(this,te).states.delete("foo")}catch{Reflect.defineProperty(u(this,te),"states",{value:{has:n=>ee(n)in this.dataset,add:n=>this.dataset[ee(n)]="",delete:n=>delete this.dataset[ee(n)]}})}}return u(this,te)}attributeChangedCallback(){return u(this,J)&&I(u(this,ae)),u(Ae,me)}closestElement(n){const e=typeof n=="function",t=typeof n=="string"&&n.toUpperCase(),s=i=>{const r=i.parentElement||i.getRootNode().host;if(!r)return null;if(e){if(r.constructor===n)return r}else if(r.tagName===t)return r;return s(r)};return s(this)}connectedCallback(){return this.isConnected&&u(this,Oe)?rt.add(u(this,st)):u(this,st).call(this),u(Ae,me)}adoptedCallback(){return u(Ae,me)}disconnectedCallback(){var n,e,t,s,i;if(this.isConnected){N(this,Ne,!0);return}return N(this,J,!1),(n=u(this,nt))==null||n.forEach(r=>r()),Kt(u(this,Ye)),(e=this.unmounted)==null||e.call(this),(t=u(this,F))==null||t.forEach(({preCallback:r})=>Kt(r)),N(this,F,(s=u(this,F))==null?void 0:s.filter(u(this,it))),N(this,ne,(i=u(this,ne))==null?void 0:i.filter(u(this,it))),u(Ae,me)}};let M=Ae;me=new WeakMap,Re=new WeakMap,te=new WeakMap,Ne=new WeakMap,J=new WeakMap,Oe=new WeakMap,F=new WeakMap,ne=new WeakMap,Ye=new WeakMap,Ze=new WeakMap,qt=new WeakMap,Ut=new WeakMap,Bt=new WeakMap,et=new WeakMap,Ft=new WeakMap,tt=new WeakMap,ae=new WeakMap,zt=new WeakMap,nt=new WeakMap,st=new WeakMap,it=new WeakMap,w(M,me,Symbol());const ct=new Ln;function lt(n,e,t){const{booleanAttributes:s,numberAttributes:i}=n.constructor;Object.defineProperty(n,e,{configurable:!0,get(){if(!(at in this))return;const a=this.getAttribute(t);return s!=null&&s.has(t)?a!==null:i!=null&&i.has(t)?Number(a):a||""},set(r){const a=this,c=ct.get(this),l=c[e],h=a.getAttribute(t);if(this[at]&&h!==null&&!l)return;c[e]=!0;const p=s==null?void 0:s.has(t);r==null?a.removeAttribute(t):p?a.toggleAttribute(t,!!r):h!==String(r)&&a.setAttribute(t,String(r))}})}const xn=Symbol("event handle");function pe(n,e,t,s){Object.defineProperty(n,e,{configurable:!0,get(){const i=ct.get(this)[e];return i||!t?i:(this[e]=Bs,this[e])},set(i){const r=this,a=ct.get(r);i!==a[e]&&(t?(a[e]=i!=null&&i[xn]?i:(c,l)=>{const h=new CustomEvent(t,{...l,...s,detail:c});r.dispatchEvent(h),i(c,l)},Reflect.set(a[e],xn,!0)):(a[e]=i,this[Vn]()))}})}function ht(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=ct.get(this);let i=s[e];if(!i){const r=this,a=r.shadowRoot||r;i={get ref(){return t},get element(){const c=[...a.querySelectorAll("[data-gem-reflect]")].map(l=>l.target);for(const l of[a,...c]){const h=l.querySelector(`[ref=${t}]`);if(h)return h}}},s[e]=i}return i}})}function ut(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=this,{states:i}=s.internals;return i==null?void 0:i.has(t)},set(s){const i=this,{states:r}=i.internals;s?r==null||r.add(t):r==null||r.delete(t)}})}const dt=customElements.define.bind(customElements);customElements.define=(n,e,t)=>{if(e.prototype instanceof M){const{observedAttributes:s,observedProperties:i,defineEvents:r,defineCSSStates:a,defineRefs:c}=e;s==null||s.forEach(l=>lt(e.prototype,ee(l),l)),i==null||i.forEach(l=>pe(e.prototype,l)),r==null||r.forEach(l=>pe(e.prototype,ee(l),l)),a==null||a.forEach(l=>ut(e.prototype,ee(l),l)),c==null||c.forEach(l=>ht(e.prototype,ee(l),l))}dt(n,e,t)},window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,{..._,...Us});function x(n,e,t,s=!1){const i=n.constructor,r=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(r):r?Array.from(r):[]}),i[e][s?"add":"push"](t)}function Fs(n,e){const t=`${V(e)}-${Ke()}`;x(n,"defineRefs",t),ht(n,e,t)}function Qt(n,e,t){x(n,"observedAttributes",t),lt(n,e,t)}function $(n,e){Qt(n,e,V(e))}function Xt(n,e){const t=V(e);x(n,"booleanAttributes",t,!0),Qt(n,e,t)}function zs(n,e){const t=V(e);x(n,"numberAttributes",t,!0),Qt(n,e,t)}function j(n,e){x(n,"observedProperties",e),pe(n,e)}function ft(n,e){const t=V(e);x(n,"defineCSSStates",t),ut(n,e,t)}function Ks(n,e){const t=V(n[e]||e);n[e]=t,x(n instanceof M?n:n.prototype,"defineSlots",t)}function jn(n,e){const t=V(n[e]||e);n[e]=t,x(n instanceof M?n:n.prototype,"defineParts",t)}function mt(n,e){Dn(n,e)}function Js(n,e){Dn(n,e,{bubbles:!0,composed:!0})}function Dn(n,e,t){const s=V(e);x(n,"defineEvents",s),pe(n,e,s,t)}function Qs(n){return function(e){x(e.prototype,"adoptedStyleSheets",n)}}function He(n){return function(e){x(e.prototype,"observedStores",n)}}function Xs(n){return function(e){const t=e;t.rootElement=n}}function Ys(n){return function(e){dt(n,e)}}const A=window.history,qn=A.pushState.bind(A),Un=A.replaceState.bind(A);let Zs=0;const Yt=()=>`${performance.now()}-${++Zs}`,[C,ge]=Xe({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),R=new Map;function Bn(n){const{$key:e,$hasCloseHandle:t,$hasOpenHandle:s,$hasShouldCloseHandle:i}=n||{};if(C.$key!==e){if(e)throw new z("`$key` is not allowed");if(t)throw new z("`$hasCloseHandle` is not allowed");if(s)throw new z("`$hasOpenHandle` is not allowed");if(i)throw new z("`$hasShouldCloseHandle` is not allowed")}}function Fn(n){return D.basePath?D.basePath+n:n}function zn(n){return n===D.basePath?"/":n.replace(new RegExp(`^${D.basePath}/`),"/")}function pt(n){const e=R.get(C.$key)||{},t=n.path?Gt(e.path,n.path):zn(location.pathname),s=new Te(n.query||(n.path?"":location.search)),i=n.path&&n.path!==e.path||n.query&&String(n.query)!==String(e.query),r=n.title||(i?"":document.title),a=n.close||n.data||n.open||n.shouldClose,c=n.hash||(!i&&a?decodeURIComponent(location.hash):"");return{...n,title:r,path:t,query:s,hash:c}}function Kn(n,e){Bn(n.data);const t=pt(n),{title:s,path:i,query:r,hash:a,close:c,open:l,shouldClose:h,data:p}=t,d={$hasCloseHandle:!!c,$hasOpenHandle:!!l,$hasShouldCloseHandle:!!h,$key:Yt(),$title:s,...p};R.set(d.$key,t),Je(C),ge(d);const T=Fn(i)+new Te(r)+a,g=decodeURIComponent(location.hash);e(d,s,T),g!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}function Jn(n,e,t,s){Bn(n);const i={$key:Yt(),$title:e,...n||{}},{pathname:r,search:a,hash:c}=new URL(t,location.origin+location.pathname),l=pt({path:r,query:new Te(a),hash:c,title:e,data:n});R.set(i.$key,l),Je(C),ge(i);const h=Fn(r)+l.query+c,p=location.hash;s(i,e,h),p!==c&&window.dispatchEvent(new CustomEvent("hashchange"))}const[Qn,ei]=Xe({basePath:""});class ti{get store(){return C}get basePath(){return Qn.basePath}set basePath(e){ei({basePath:e}),Object.assign(R.get(C.$key),{path:zn(location.pathname)})}getParams(){return R.get(C.$key)}updateParams(e){Object.assign(R.get(C.$key),e),ge()}push(e){Kn(e,qn)}replace(e){Kn(e,Un)}pushIgnoreCloseHandle(e){var t,s;C.$hasCloseHandle?((s=(t=R.get(C.$key))==null?void 0:t.close)==null||s.call(t),this.replace(e)):this.push(e)}forward(){A.forward()}back(){A.back()}}const D=new ti,[gt,ni]=Xe({title:""}),si={history:D,titleStore:gt,basePathStore:Qn};if(!window._GEMHISTORY){if(window._GEMHISTORY=si,A.pushState=function(e,t,s){Jn(e,t,s,qn)},A.replaceState=function(e,t,s){Jn(e,t,s,Un)},window.addEventListener("hashchange",({isTrusted:e})=>{e&&D.replace({hash:decodeURIComponent(location.hash)})}),A.state)if(A.state.$hasCloseHandle){ge(A.state);const e=pt({title:document.title});R.set(C.$key,e),D.back()}else{const e=pt({title:document.title,hash:location.hash});ge({$key:Yt(),...A.state||{}}),R.set(C.$key,e)}else{const{pathname:e,search:t,hash:s}=location;D.replace({path:e,query:t,hash:s})}re(gt,()=>{const e=R.get(C.$key);e&&(e.title=gt.title)}),re(C,()=>{const{title:e}=D.getParams();e!==gt.title&&ni({title:e})});let n=!1;window.addEventListener("popstate",e=>{var r,a;const t=e.state;if(!(t!=null&&t.$key))return;if(n){n=!1;return}if(!R.has(t.$key)){const{pathname:c,search:l,hash:h}=location;R.set(t.$key,{path:c,query:new Te(l),hash:h,title:t.$title,data:t})}const s=C;if(parseFloat(t.$key)>parseFloat(s.$key)&&t.$hasOpenHandle)(a=(r=R.get(t.$key))==null?void 0:r.open)==null||a.call(r);else if(s.$hasCloseHandle){const c=R.get(s.$key),l=c==null?void 0:c.close,h=c==null?void 0:c.shouldClose;if(h&&!h()){n=!0,D.forward();return}else l?l():t.$hasCloseHandle&&(n=!0,D.back())}Je(C),ge(t)})}const{history:v,titleStore:ye,basePathStore:Xn}=window._GEMHISTORY;var ii=Object.defineProperty,ri=Object.getOwnPropertyDescriptor,se=(n,e,t,s)=>{for(var i=s>1?void 0:s?ri(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&ii(e,t,i),i},Yn=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Ge=(n,e,t)=>(Yn(n,e,"read from private field"),t?t.call(n):e.get(n)),Zt=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Zn=(n,e,t,s)=>(Yn(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),We,yt,wt;class oi extends RegExp{constructor(e){const t={};let s=0;super(`^${e.replace(/:([^/$]+)/g,(i,r)=>(t[r]=s++,"([^/]+)")).replace("*",".*")}$`,"i"),this.namePosition=t}}function en(n,e){if(window.URLPattern){const r=new window.URLPattern({pathname:n}),a=r.exec({pathname:e})||r.exec({pathname:`${e}/`});return a?a.pathname.groups:null}const t=new oi(n),s=e.match(t)||`${e}/`.match(t);if(!s)return null;const i={};return s&&Object.keys(t.namePosition).forEach(r=>{i[r]=s[t.namePosition[r]+1]}),i}function tn(n,e){let t=n.pattern;const s=e==null?void 0:e.params;return s&&Object.keys(s).forEach(i=>{t=t.replace(new RegExp(`:${i}`,"g"),s[i])}),t}function es(n,e){return{path:tn(n,e),...e}}o.GemRouteElement=class extends M{constructor({isLight:n,routes:e}={}){super({isLight:n}),this.currentParams={},Zt(this,We,void 0),this.state={content:void 0},Zt(this,yt,()=>{if(this.locationStore){const{path:t,query:s,data:i}=v.getParams();K(this.locationStore,{path:t,params:this.currentParams,query:s,data:i})}}),Zt(this,wt,(t,s,i)=>{Zn(this,We,void 0),this.currentRoute=t,this.currentParams=s;const r=()=>{this.setState({content:i}),this.routechange(this.currentRoute),Ge(this,yt).call(this)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>(r(),Promise.resolve())):r()}),this.routes=e}mounted(){this.effect(([n,e],t)=>{if(t&&n===t[0]&&e===t[1]){Ge(this,yt).call(this);return}const{route:s,params:i={}}=o.GemRouteElement.findRoute(this.routes,e),{redirect:r,content:a,getContent:c}=s||{};if(r){v.replace({path:r});return}const l=s==null?void 0:s.title;l&&K(ye,{title:l});const h=a||(c==null?void 0:c(i));if(h instanceof Promise){this.loading(s),Zn(this,We,h);const p=()=>Ge(this,We)===h;h.then(d=>{p()&&Ge(this,wt).call(this,s,i,d)}).catch(d=>{p()&&this.error(d)});return}Ge(this,wt).call(this,s,i,h)},()=>{const{path:n}=v.getParams();return[this.key,n,location.search]})}shouldUpdate(){return!this.inert}render(){const{content:n}=this.state;return this.shadowRoot?B`
|
|
170
|
+
*/const Ft=new WeakMap,Kt=te(n=>e=>{const t=Ft.get(e);if(n===void 0&&e instanceof It){if(t!==void 0||!Ft.has(e)){const s=e.committer.name;e.committer.element.removeAttribute(s)}}else n!==t&&e.setValue(n);Ft.set(e,n)});var Fn=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},u=(n,e,t)=>(Fn(n,e,"read from private field"),t?t.call(n):e.get(n)),_=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},A=(n,e,t,s)=>(Fn(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),we,Ge,re,xe,X,Ie,Y,oe,nt,st,zt,Jt,Qt,it,Xt,rt,le,Yt,ot,at,ct;function ni(){}function Zt(n){typeof n=="function"&&n()}const lt=new Rn,en=(n=performance.now())=>{if(performance.now()>n+16)return requestAnimationFrame(en);const e=lt.get();e&&(e(),en(n))};lt.addEventListener("start",()=>G(en));const ht=Symbol("constructor"),ut=Symbol("init"),Kn=Symbol("update"),We=class extends HTMLElement{constructor(n={}){super(),_(this,Ge,void 0),_(this,re,void 0),_(this,xe,void 0),_(this,X,void 0),_(this,Ie,void 0),_(this,Y,void 0),_(this,oe,void 0),_(this,nt,void 0),this.setState=s=>{if(!this.state)throw new J("`state` not initialized");Object.assign(this.state,s),G(u(this,le))},_(this,st,s=>{s==null||s.forEach(i=>{const{callback:r,getDep:a,values:c,preCallback:l}=i,h=a==null?void 0:a();(!a||!c||Gn(c,h))&&(Zt(l),i.preCallback=r(h,c),i.values=h)})}),_(this,zt,()=>{u(this,st).call(this,u(this,Y))}),_(this,Jt,()=>{u(this,st).call(this,u(this,oe))}),this.effect=(s,i)=>{u(this,Y)||A(this,Y,[]);const r={callback:s,getDep:i,initialized:u(this,X),inConstructor:this[ht]};u(this,X)&&(r.values=i==null?void 0:i(),r.preCallback=s(r.values)),u(this,Y).push(r)},this.memo=(s,i)=>{u(this,oe)||A(this,oe,[]),u(this,oe).push({callback:s,getDep:i,inConstructor:this[ht]})},_(this,Qt,()=>{var s;(s=u(this,Y))==null||s.forEach(i=>{const{callback:r,getDep:a,initialized:c}=i;c||(i.values=a==null?void 0:a(),i.preCallback=r(i.values),i.initialized=!0)})}),_(this,it,()=>{u(this,Jt).call(this);const s=u(this,Ge)===this,i=this.render?this.render():s?void 0:z`<slot></slot>`;i!==void 0&&Wt(i,u(this,Ge))}),_(this,Xt,()=>this.shouldUpdate?this.shouldUpdate():!0),_(this,rt,()=>{u(this,X)&&u(this,Xt).call(this)&&(u(this,it).call(this),G(u(this,Yt)),G(u(this,zt)))}),_(this,le,()=>{u(this,Ie)?lt.add(u(this,rt)):u(this,rt).call(this)}),this.update=()=>{G(u(this,le))},_(this,Yt,()=>{var s;(s=this.updated)==null||s.call(this)}),_(this,ot,void 0),_(this,at,()=>{var r,a,c;if(u(this,xe)){A(this,xe,!1);return}Reflect.set(this,ht,!1),(r=this.willMount)==null||r.call(this);const{observedStores:s,rootElement:i}=this.constructor;if(A(this,ot,s==null?void 0:s.map(l=>ie(l,u(this,le)))),u(this,it).call(this),A(this,X,!0),A(this,nt,(a=this.mounted)==null?void 0:a.call(this)),u(this,Qt).call(this),i&&this.isConnected&&((c=this.getRootNode().host)==null?void 0:c.tagName)!==i.toUpperCase())throw new J("not allow current root type")}),_(this,ct,s=>s==null?void 0:s.filter(i=>(Zt(i.preCallback),i.initialized=!1,i.inConstructor))),G(()=>Reflect.set(this,ut,!1)),Reflect.set(this,ht,!0),Reflect.set(this,ut,!0),Reflect.set(this,Kn,()=>{u(this,X)&&G(u(this,le))}),A(this,Ie,n.isAsync),A(this,Ge,n.isLight?this:this.attachShadow({mode:n.mode||"open",delegatesFocus:n.delegatesFocus,slotAssignment:n.slotAssignment}));let e;this.effect(([s=!1])=>{if(e===void 0&&(e=this.hasAttribute("tabindex")),this.internals.ariaDisabled=String(s),n.focusable&&!e&&(this.tabIndex=-Number(s)),(n.focusable||n.delegatesFocus)&&s)return Dt(this,"click",i=>i.isTrusted&&i.stopImmediatePropagation(),{capture:!0})},()=>[Reflect.get(this,"disabled")]);const{adoptedStyleSheets:t}=new.target;if(t){const s=t.map(i=>i[jt]||i);this.shadowRoot?this.shadowRoot.adoptedStyleSheets=s:this.effect(()=>{const i=this.getRootNode();return i.adoptedStyleSheets=[...i.adoptedStyleSheets,...s],()=>{i.adoptedStyleSheets=xn(i.adoptedStyleSheets,s)}},()=>[])}}get internals(){if(!u(this,re)){A(this,re,this.attachInternals());try{u(this,re).states.add("foo"),u(this,re).states.delete("foo")}catch{Reflect.defineProperty(u(this,re),"states",{value:{has:n=>se(n)in this.dataset,add:n=>this.dataset[se(n)]="",delete:n=>delete this.dataset[se(n)]}})}}return u(this,re)}attributeChangedCallback(){return u(this,X)&&G(u(this,le)),u(We,we)}closestElement(n){const e=typeof n=="function",t=typeof n=="string"&&n.toUpperCase(),s=i=>{const r=i.parentElement||i.getRootNode().host;if(!r)return null;if(e){if(r.constructor===n)return r}else if(r.tagName===t)return r;return s(r)};return s(this)}connectedCallback(){return this.isConnected&&u(this,Ie)?lt.add(u(this,at)):u(this,at).call(this),u(We,we)}adoptedCallback(){return u(We,we)}disconnectedCallback(){var n,e;if(this.isConnected){A(this,xe,!0);return}return A(this,X,!1),(n=u(this,ot))==null||n.forEach(t=>t()),Zt(u(this,nt)),(e=this.unmounted)==null||e.call(this),A(this,Y,u(this,ct).call(this,u(this,Y))),A(this,oe,u(this,ct).call(this,u(this,oe))),u(We,we)}};let N=We;we=new WeakMap,Ge=new WeakMap,re=new WeakMap,xe=new WeakMap,X=new WeakMap,Ie=new WeakMap,Y=new WeakMap,oe=new WeakMap,nt=new WeakMap,st=new WeakMap,zt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,it=new WeakMap,Xt=new WeakMap,rt=new WeakMap,le=new WeakMap,Yt=new WeakMap,ot=new WeakMap,at=new WeakMap,ct=new WeakMap,_(N,we,Symbol());const dt=new An;function ft(n,e,t){const{booleanAttributes:s,numberAttributes:i}=n.constructor;Object.defineProperty(n,e,{configurable:!0,get(){if(!(ut in this))return;const a=this.getAttribute(t);return s!=null&&s.has(t)?a!==null:i!=null&&i.has(t)?Number(a):a||""},set(r){const a=this,c=dt.get(this),l=c[e],h=a.getAttribute(t);if(this[ut]&&h!==null&&!l)return;c[e]=!0;const g=s==null?void 0:s.has(t);r==null?a.removeAttribute(t):g?a.toggleAttribute(t,!!r):h!==String(r)&&a.setAttribute(t,String(r))}})}const zn=Symbol("event handle");function _e(n,e,t,s){Object.defineProperty(n,e,{configurable:!0,get(){const i=dt.get(this)[e];return i||!t?i:(this[e]=ni,this[e])},set(i){const r=this,a=dt.get(r);i!==a[e]&&(t?(a[e]=i!=null&&i[zn]?i:(c,l)=>{const h=new CustomEvent(t,{...l,...s,detail:c});r.dispatchEvent(h),i(c,l)},Reflect.set(a[e],zn,!0)):(a[e]=i,this[Kn]()))}})}function pt(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=dt.get(this);let i=s[e];if(!i){const r=this,a=r.shadowRoot||r;i={get ref(){return t},get element(){const c=[...a.querySelectorAll("[data-gem-reflect]")].map(l=>l.target);for(const l of[a,...c]){const h=l.querySelector(`[ref=${t}]`);if(h)return h}}},s[e]=i}return i}})}function mt(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=this,{states:i}=s.internals;return i==null?void 0:i.has(t)},set(s){const i=this,{states:r}=i.internals;s?r==null||r.add(t):r==null||r.delete(t)}})}const gt=customElements.define.bind(customElements);customElements.define=(n,e,t)=>{if(e.prototype instanceof N){const{observedAttributes:s,observedProperties:i,defineEvents:r,defineCSSStates:a,defineRefs:c}=e;s==null||s.forEach(l=>ft(e.prototype,se(l),l)),i==null||i.forEach(l=>_e(e.prototype,l)),r==null||r.forEach(l=>_e(e.prototype,se(l),l)),a==null||a.forEach(l=>mt(e.prototype,se(l),l)),c==null||c.forEach(l=>pt(e.prototype,se(l),l))}gt(n,e,t)},window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,{...S,...ti});function q(n,e,t,s=!1){const i=n.constructor,r=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(r):r?Array.from(r):[]}),i[e][s?"add":"push"](t)}function si(n,e){const t=`${j(e)}-${He()}`;q(n,"defineRefs",t),pt(n,e,t)}function tn(n,e,t){q(n,"observedAttributes",t),ft(n,e,t)}function $(n,e){tn(n,e,j(e))}function nn(n,e){const t=j(e);q(n,"booleanAttributes",t,!0),tn(n,e,t)}function ii(n,e){const t=j(e);q(n,"numberAttributes",t,!0),tn(n,e,t)}function O(n,e){q(n,"observedProperties",e),_e(n,e)}function yt(n,e){const t=j(e);q(n,"defineCSSStates",t),mt(n,e,t)}function ri(n,e){const t=j(n[e]||e);n[e]=t,q(n instanceof N?n:n.prototype,"defineSlots",t)}function Jn(n,e){const t=j(n[e]||e);n[e]=t,q(n instanceof N?n:n.prototype,"defineParts",t)}function Ve(n,e){Qn(n,e)}function oi(n,e){Qn(n,e,{bubbles:!0,composed:!0})}function Qn(n,e,t){const s=j(e);q(n,"defineEvents",s),_e(n,e,s,t)}function ai(n){return function(e){q(e.prototype,"adoptedStyleSheets",n)}}function wt(n){return function(e){q(e.prototype,"observedStores",n)}}function ci(n){return function(e){const t=e;t.rootElement=n}}function li(n){return function(e){gt(n,e)}}const x=window.history,Xn=x.pushState.bind(x),Yn=x.replaceState.bind(x);let hi=0;const sn=()=>`${performance.now()}-${++hi}`,[P,ve]=tt({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),R=new Map;function Zn(n){const{$key:e,$hasCloseHandle:t,$hasOpenHandle:s,$hasShouldCloseHandle:i}=n||{};if(P.$key!==e){if(e)throw new J("`$key` is not allowed");if(t)throw new J("`$hasCloseHandle` is not allowed");if(s)throw new J("`$hasOpenHandle` is not allowed");if(i)throw new J("`$hasShouldCloseHandle` is not allowed")}}function es(n){return I.basePath?I.basePath+n:n}function rn(n){return n===I.basePath?"/":n.replace(new RegExp(`^${I.basePath}/`),"/")}function on(){I.dispatchEvent(new CustomEvent("beforechange"))}function _t(n){var g,f;const e=R.get(P.$key)||{path:rn(location.pathname),query:new me},t=n.path?Vt(e.path,n.path):rn(location.pathname),s=new me((g=n.query)!=null?g:n.path?"":location.search),i=String(s)!==String(e.query),r=i?s:e.query,a=t!==e.path||i,c=n.title||(a?"":document.title),l=n.close||n.data||n.open||n.shouldClose,h=decodeURIComponent((f=n.hash)!=null?f:!a&&l?location.hash:"");return{...n,title:c,path:t,query:r,hash:h}}function ts(n,e){Zn(n.data);const t=_t(n),{title:s,path:i,query:r,hash:a,close:c,open:l,shouldClose:h,data:g}=t,f={$hasCloseHandle:!!c,$hasOpenHandle:!!l,$hasShouldCloseHandle:!!h,$key:sn(),$title:s,...g};R.set(f.$key,t),on(),Ze(P),ve(f);const M=es(i)+new me(r)+a,m=decodeURIComponent(location.hash);e(f,s,M),m!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}function ns(n,e,t,s){Zn(n);const i={$key:sn(),$title:e,...n||{}},{pathname:r,search:a,hash:c}=new URL(t,location.origin+location.pathname),l=_t({path:r,query:new me(a),hash:c,title:e,data:n});R.set(i.$key,l),on(),Ze(P),ve(i);const h=es(r)+l.query+c,g=location.hash;s(i,e,h),g!==c&&window.dispatchEvent(new CustomEvent("hashchange"))}const[ss,ui]=tt({basePath:""});class di extends EventTarget{get store(){return P}get currentKey(){return P.$key}get basePath(){return ss.basePath}set basePath(e){ui({basePath:e}),Object.assign(R.get(P.$key),{path:rn(location.pathname)})}getParams(){return R.get(P.$key)}updateParams(e){Object.assign(R.get(P.$key),e),ve()}push(e){ts(e,Xn)}replace(e){ts(e,Yn)}pushIgnoreCloseHandle(e){var t,s;P.$hasCloseHandle?((s=(t=R.get(P.$key))==null?void 0:t.close)==null||s.call(t),this.replace(e)):this.push(e)}forward(){x.forward()}back(){x.back()}}const I=new di,[vt,fi]=tt({title:""}),pi={history:I,titleStore:vt,basePathStore:ss};if(!window._GEMHISTORY){if(window._GEMHISTORY=pi,x.pushState=function(e,t,s){ns(e,t,s,Xn)},x.replaceState=function(e,t,s){ns(e,t,s,Yn)},window.addEventListener("hashchange",({isTrusted:e})=>{e&&I.replace({hash:location.hash})}),x.state)if(x.state.$hasCloseHandle){ve(x.state);const e=_t({title:document.title});R.set(P.$key,e),I.back()}else{const e=_t({title:document.title,hash:location.hash});ve({$key:sn(),...x.state||{}}),R.set(P.$key,e)}else{const{pathname:e,search:t,hash:s}=location;I.replace({path:e,query:t,hash:s})}ie(vt,()=>{const e=R.get(P.$key);e&&(e.title=vt.title)}),ie(P,()=>{const{title:e}=I.getParams();e!==vt.title&&fi({title:e})});let n=!1;window.addEventListener("popstate",e=>{var r,a;const t=e.state;if(!(t!=null&&t.$key))return;if(n){n=!1;return}if(!R.has(t.$key)){const{pathname:c,search:l,hash:h}=location;R.set(t.$key,{path:c,query:new me(l),hash:decodeURIComponent(h),title:t.$title,data:t})}const s=P;if(parseFloat(t.$key)>parseFloat(s.$key)&&t.$hasOpenHandle)(a=(r=R.get(t.$key))==null?void 0:r.open)==null||a.call(r);else if(s.$hasCloseHandle){const c=R.get(s.$key),l=c==null?void 0:c.close,h=c==null?void 0:c.shouldClose;if(h&&!h()){n=!0,I.forward();return}else l?l():t.$hasCloseHandle&&(n=!0,I.back())}on(),Ze(P),ve(t)})}const{history:y,titleStore:Se,basePathStore:is}=window._GEMHISTORY;var mi=Object.defineProperty,gi=Object.getOwnPropertyDescriptor,U=(n,e,t,s)=>{for(var i=s>1?void 0:s?gi(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&mi(e,t,i),i},rs=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},B=(n,e,t)=>(rs(n,e,"read from private field"),t?t.call(n):e.get(n)),De=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},os=(n,e,t,s)=>(rs(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),je,he,Ee,St,an,Et;class yi extends RegExp{constructor(e){const t={};let s=0;super(`^${e.replace(/:([^/$]+)/g,(i,r)=>(t[r]=s++,"([^/]+)")).replace("*",".*")}$`,"i"),this.namePosition=t}}function cn(n,e){if(window.URLPattern){const r=new window.URLPattern({pathname:n}),a=r.exec({pathname:e})||r.exec({pathname:`${e}/`});return a?a.pathname.groups:null}const t=new yi(n),s=e.match(t)||`${e}/`.match(t);if(!s)return null;const i={};return s&&Object.keys(t.namePosition).forEach(r=>{i[r]=s[t.namePosition[r]+1]}),i}function ln(n,e){let t=n.pattern;const s=e==null?void 0:e.params;return s&&Object.keys(s).forEach(i=>{t=t.replace(new RegExp(`:${i}`,"g"),s[i])}),t}function as(n,e){return{path:ln(n,e),...e}}const cs=new Map,ls=class extends N{constructor({isLight:n,routes:e}={}){super({isLight:n}),De(this,he),this.trigger=y,this.currentParams={},De(this,je,void 0),this.state={content:void 0},De(this,St,()=>{if(!this.locationStore)return;const{path:t,query:s,hash:i,data:r}=y.getParams();Q(this.locationStore,{path:t,params:this.currentParams,query:s,hash:i,data:r})}),De(this,an,()=>{if(!B(this,he,Ee))return;const t=cs.get(y.currentKey);t?B(this,he,Ee).scroll(0,t):(this.scrollIgnoreHash||!y.getParams().hash)&&B(this,he,Ee).scroll(0,0)}),De(this,Et,(t,s,i)=>{this.beforeroutechange(t),os(this,je,void 0),this.currentRoute=t,this.currentParams=s;const r=async()=>{this.setState({content:i}),B(this,St).call(this),await Promise.resolve(),B(this,an).call(this),this.routechange(this.currentRoute)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>r()):r()}),this.update=()=>{const{route:t,params:s={}}=ls.findRoute(this.routes,this.trigger.getParams().path),{redirect:i,content:r,getContent:a}=t||{};if(i){this.trigger.replace({path:i});return}this.trigger===y&&Q(Se,{title:t==null?void 0:t.title});const c=r||(a==null?void 0:a(s));if(this.loading(t),c instanceof Promise){os(this,je,c);const l=()=>B(this,je)===c;c.then(h=>{l()&&B(this,Et).call(this,t,s,h)}).catch(h=>{l()&&this.error(h)});return}B(this,Et).call(this,t,s,c)},this.routes=e}mounted(){this.effect(()=>{if(!!B(this,he,Ee))return Dt(y,"beforechange",()=>cs.set(y.currentKey,B(this,he,Ee).scrollTop))},()=>[this.scrollContainer]),this.effect(()=>ie(this.trigger.store,()=>this.setState({})),()=>[this.trigger]),this.effect(([n,e],t)=>{if(t&&n===t[0]&&e===t[1]){B(this,St).call(this);return}this.update()},()=>{const{path:n,query:e,hash:t}=this.trigger.getParams();return[this.key,n,e,t]})}shouldUpdate(){return!this.inert}render(){const{content:n}=this.state;return this.shadowRoot?z`
|
|
171
171
|
<style>
|
|
172
172
|
:host(:where(:not([hidden]))),
|
|
173
173
|
:not(:defined) {
|
|
174
174
|
display: contents;
|
|
175
175
|
}
|
|
176
176
|
</style>
|
|
177
|
-
${n!=null?n:
|
|
178
|
-
`:
|
|
177
|
+
${n!=null?n:z`<slot></slot>`}
|
|
178
|
+
`:z`${n}`}};let L=ls;je=new WeakMap,he=new WeakSet,Ee=function(){return typeof this.scrollContainer=="function"?this.scrollContainer():this.scrollContainer},St=new WeakMap,an=new WeakMap,Et=new WeakMap,L.createLocationStore=()=>{const{path:n,query:e,hash:t,data:s}=y.getParams();return ye({path:n,query:e,hash:t,data:s,params:{}})},L.findRoute=(n=[],e)=>{let t=null,s;n instanceof Array?s=n:s=Object.values(n);for(const i of s)if(i.pattern==="*")t=i;else{const r=cn(i.pattern,e);if(r)return{route:i,params:r}}return{route:t}},U([nn],L.prototype,"transition",2),U([O],L.prototype,"routes",2),U([O],L.prototype,"locationStore",2),U([O],L.prototype,"key",2),U([Ve],L.prototype,"loading",2),U([Ve],L.prototype,"beforeroutechange",2),U([Ve],L.prototype,"routechange",2),U([Ve],L.prototype,"error",2),U([O],L.prototype,"scrollContainer",2),U([O],L.prototype,"scrollIgnoreHash",2),U([O],L.prototype,"trigger",2);class hs extends L{constructor(e={}){super({...e,isLight:!0})}}var wi=Object.defineProperty,_i=Object.getOwnPropertyDescriptor,k=(n,e,t,s)=>{for(var i=s>1?void 0:s?_i(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&wi(e,t,i),i};function us(n){return!n.startsWith("/")}o.GemLinkElement=(Ms=class extends N{constructor(){super({focusable:!0});v(this,ue);v(this,Tt);v(this,Ke,void 0);v(this,ze,void 0);v(this,Je,void 0);C(this,Ke,async()=>{var r;const e=this.getLocationString();if(!e)return;if(us(e))switch(this.target){case"_self":window.location.href=e;return;case"_parent":window.parent.location.href=e;return;case"_top":window.top.location.href=e;return;default:window.open(e);return}const{path:t,query:s,hash:i}=y.getParams();if(t+s+i!==e)if(await((r=this.prepare)==null?void 0:r.call(this)),this.route)y.pushIgnoreCloseHandle({...as(this.route,d(this,ue,Xe)),title:this.route.title||this.docTitle});else if(this.href){const{pathname:a,search:c,hash:l}=new URL(e,location.origin);y.pushIgnoreCloseHandle({path:a,query:c,hash:l,title:this.docTitle})}else y.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash,title:this.docTitle})}),C(this,ze,e=>{e.preventDefault()}),C(this,Je,()=>{const e=this.getLocationString();return us(e)?e:new URL(y.basePath+e,location.origin).toString()}),this.addEventListener("click",d(this,Ke))}render(){return z`
|
|
179
179
|
<style>
|
|
180
180
|
:host {
|
|
181
181
|
/* link default style */
|
|
@@ -193,12 +193,12 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
193
193
|
</style>
|
|
194
194
|
<a
|
|
195
195
|
part=${this.link}
|
|
196
|
-
@click=${
|
|
197
|
-
href=${
|
|
196
|
+
@click=${d(this,ze)}
|
|
197
|
+
href=${Kt(d(this,Tt,Os)==="off"?void 0:d(this,Je).call(this))}
|
|
198
198
|
>
|
|
199
199
|
<slot></slot>
|
|
200
200
|
</a>
|
|
201
|
-
`}getLocationString(){var e,t;if(this.route){const s=((e=
|
|
201
|
+
`}getLocationString(){var e,t;if(this.route){const s=((e=d(this,ue,Xe))==null?void 0:e.query)||"",i=((t=d(this,ue,Xe))==null?void 0:t.hash)||"";return ln(this.route,d(this,ue,Xe))+s+i}else{const s=this.href||this.path+this.query+this.hash,{path:i,query:r}=y.getParams();return s.startsWith("#")?`${i}${r}${s}`:s.startsWith("?")?`${i}${s}`:s.startsWith(".")?Vt(i,s):s}}},ue=new WeakSet,Xe=function(){return this.routeOptions||this.options},Tt=new WeakSet,Os=function(){return this.hint||"on"},Ke=new WeakMap,ze=new WeakMap,Je=new WeakMap,Ms),k([$],o.GemLinkElement.prototype,"href",2),k([$],o.GemLinkElement.prototype,"target",2),k([$],o.GemLinkElement.prototype,"path",2),k([$],o.GemLinkElement.prototype,"query",2),k([$],o.GemLinkElement.prototype,"hash",2),k([$],o.GemLinkElement.prototype,"docTitle",2),k([$],o.GemLinkElement.prototype,"hint",2),k([O],o.GemLinkElement.prototype,"route",2),k([O],o.GemLinkElement.prototype,"options",2),k([O],o.GemLinkElement.prototype,"routeOptions",2),k([O],o.GemLinkElement.prototype,"prepare",2),k([Jn],o.GemLinkElement.prototype,"link",2),o.GemLinkElement=k([wt(is)],o.GemLinkElement),o.GemActiveLinkElement=class extends o.GemLinkElement{constructor(){super(),this.effect(()=>{const{path:n,query:e,hash:t}=y.getParams(),s=this.pattern&&cn(this.pattern,n);this.active=!!s||n+e+t===this.getLocationString()})}},k([$],o.GemActiveLinkElement.prototype,"pattern",2),k([yt],o.GemActiveLinkElement.prototype,"active",2),o.GemActiveLinkElement=k([wt(y.store)],o.GemActiveLinkElement),customElements.define("gem-link",o.GemLinkElement),customElements.define("gem-active-link",o.GemActiveLinkElement),customElements.define("gem-route",L),customElements.define("gem-light-route",hs);var vi=Object.defineProperty,Si=Object.getOwnPropertyDescriptor,hn=(n,e,t,s)=>{for(var i=s>1?void 0:s?Si(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&vi(e,t,i),i};const bt=document.title;let un="";const Ei=()=>document.title=un;function ds(n,e="",t=""){const s=Se.title||n;s&&s!==bt?(W.title=s,un=e+W.title+t):(W.title=bt,un=W.title),G(Ei)}ie(Se,ds);const fs=`${bt} | `,ps=` - ${bt}`,ms=class extends N{constructor(){super(),this.mounted=()=>{this.effect(()=>!this.inert&&ie(Se,this.update),()=>[this.inert])},new MutationObserver(()=>this.update()).observe(this,{characterData:!0,childList:!0,subtree:!0})}static setTitle(n){Q(Se,{title:n})}render(){var n;return ds((n=this.textContent)==null?void 0:n.trim(),this.prefix,this.suffix),z`${ms.title}`}};let W=ms;W.title=document.title,W.defaultPrefix=fs,W.defaultSuffix=ps,hn([$],W.prototype,"prefix",2),hn([$],W.prototype,"suffix",2),hn([nn],W.prototype,"inert",2),customElements.define("gem-title",W);var bi=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor,Pt=(n,e,t,s)=>{for(var i=s>1?void 0:s?Pi(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&bi(e,t,i),i};const gs=new Map;class be extends N{constructor(){super(...arguments);v(this,Qe,void 0);C(this,Qe,()=>{const t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if(typeof t=="string"){let s=gs.get(t);return s||(s=document.createElement("template"),s.innerHTML=t,gs.set(t,s)),s.content.cloneNode(!0)}else return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t==null?void 0:t.cloneNode(!0)})}render(){return z`
|
|
202
202
|
<style>
|
|
203
203
|
:host(:where(:not([hidden]))) {
|
|
204
204
|
position: relative;
|
|
@@ -210,9 +210,9 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
210
210
|
height: 100%;
|
|
211
211
|
}
|
|
212
212
|
</style>
|
|
213
|
-
${
|
|
213
|
+
${d(this,Qe).call(this)}
|
|
214
214
|
<slot></slot>
|
|
215
|
-
`}}
|
|
215
|
+
`}}Qe=new WeakMap,Pt([$],be.prototype,"selector",2),Pt([O],be.prototype,"root",2),Pt([O],be.prototype,"element",2),Pt([yt],be.prototype,"active",2),customElements.define("gem-use",be);var Ci=Object.defineProperty,Li=Object.getOwnPropertyDescriptor,ys=(n,e,t,s)=>{for(var i=s>1?void 0:s?Li(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Ci(e,t,i),i};class Ct extends N{constructor(){super(),this.effect(()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=`
|
|
216
216
|
<style>
|
|
217
217
|
:host(:where(:not([hidden]))) {
|
|
218
218
|
display: contents;
|
|
@@ -220,4 +220,4 @@ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o
|
|
|
220
220
|
${this.contentcss}
|
|
221
221
|
</style>
|
|
222
222
|
${this.content}
|
|
223
|
-
`)},()=>[this.content,this.contentcss])}render(){}}cs([$],vt.prototype,"content",2),cs([$],vt.prototype,"contentcss",2),customElements.define("gem-unsafe",vt);var pi=Object.defineProperty,gi=Object.getOwnPropertyDescriptor,yi=(n,e,t,s)=>{for(var i=s>1?void 0:s?gi(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&pi(e,t,i),i};class sn extends M{constructor(){super({isLight:!0}),this.target=document.head,this.hidden=!0,this.dataset.gemReflect="",this.effect(()=>{const e=[...this.childNodes];return e.forEach(t=>{t instanceof HTMLElement&&(t.dataset.reflect=""),this.target.append(t)}),()=>{e.forEach(t=>t.remove())}},()=>[this.target])}}yi([j],sn.prototype,"target",2),customElements.define("gem-reflect",sn);const St=Symbol("open mark");function wi(n){var e;const t=Symbol();return e=class extends M{constructor(){super(),this.label="",this.internals.role="alertdialog",this.internals.ariaModal="true"}static get isOpen(){return this.store[St]}static get observedStores(){return[v.store,this.store]}static open(s){const i=new this;this.instance=i,this.inertStore=[...document.body.children].filter(a=>!a.inert),this.inertStore.forEach(a=>a.inert=!0),document.body.append(i);const r=()=>K(this.store,{[St]:!0,...s});return setTimeout(()=>{r(),v.push({title:i.label,open:r,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100),t}static close(){return v.back(),t}static closeHandle(){var s;return this.inertStore.forEach(i=>i.inert=!1),(s=this.instance)==null||s.remove(),K(this.store,{[St]:!1,...n}),t}static shouldClose(){return!0}},e.inertStore=[],e.instance=null,e.store=fe({[St]:!1,...n}),e}var Ei=Object.defineProperty,_i=Object.getOwnPropertyDescriptor,rn=(n,e,t,s)=>{for(var i=s>1?void 0:s?_i(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Ei(e,t,i),i};const Ie=Symbol();o.GemDialogBaseElement=(_s=class extends M{constructor(){super();E(this,_e,void 0);E(this,ve,void 0);E(this,le,void 0);P(this,le,[]),this.closeHandle=()=>{var e;return this.inert=!0,f(this,le).forEach(t=>t.inert=!1),f(this,_e)?f(this,_e).before(this):f(this,ve)&&((e=f(this,ve))==null||e.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1,Ie},this.openHandle=()=>(this.hidden=!1,this.inert=!1,P(this,_e,this.nextSibling),P(this,ve,this.parentElement||this.getRootNode()),P(this,le,[...document.body.children].filter(e=>!e.inert)),f(this,le).forEach(e=>e.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0,Ie),this.open=()=>{if(!this.opened)return this.openHandle(),v.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}),Ie},this.close=()=>(v.back(),Ie),this.forceClose=()=>(this.opened=!1,setTimeout(this.close,100),Ie),this.inert=!0,this.internals.role="dialog",this.internals.ariaModal="true"}shouldClose(){return!0}},_e=new WeakMap,ve=new WeakMap,le=new WeakMap,_s),rn([$],o.GemDialogBaseElement.prototype,"label",2),rn([ft],o.GemDialogBaseElement.prototype,"opened",2),o.GemDialogBaseElement=rn([He(v.store)],o.GemDialogBaseElement);const ls=new WeakMap;function hs(n){return ls.get(n)}const us=new WeakMap;function vi(n){return us.get(n)}const ds=new WeakMap;function fs(n){const e=Ke(),t=document.createElement("style"),s=fe(n),i={},r={};us.set(i,r),ls.set(i,s);const a=()=>Object.keys(s).forEach(h=>{r[h]||(r[h]=`--${V(h)}-${e}`,i[h]=`var(${r[h]})`)});ds.set(i,a),a();const c=()=>`:root, :host {${Object.keys(s).reduce((h,p)=>h+`${r[p]}:${s[p]};`,"")}}`,l=()=>t.textContent=c();return re(s,l),l(),(document.head||document.documentElement).append(t),i}function ms(n,e){K(hs(n),e),ds.get(n)()}function Si(n){const e=fs(n);return[e,t=>ms(e,t)]}const bi=/\$\d(?:<[^>]*>)?/,Pi=/\$(\d)(<([^>]*)>)?/g,Ci=3;function ps(n,...e){const t=n.split(bi),s=[];let i;for(;i=Pi.exec(n);){const r=i[Ci],a=Number(i[1])-1,c=e[a];s.push(typeof c=="function"?c(r):c)}return B(t,...s)}const Ve=new Set,an=class{constructor(e){E(this,Se);E(this,Ct);E(this,Lt);E(this,he);E(this,be);if(this.cachePrefix="gem-i18n",!e.resources[e.fallbackLanguage])throw new z("i18n: fallbackLanguage invalid");this.store=fe(this),Object.assign(this,e);let t=f(this,Ct,Ss)||this.currentLanguage||f(this,Lt,bs);const s=document.querySelector(`[type*=${this.cachePrefix}]`);if(s)try{const i=JSON.parse(s.textContent||"");t=i.currentLanguage,this.resources[i.currentLanguage]=i.currentLanguagePack}catch{}t?(P(this,be,t,$t),this.setLanguage(t)):this.resetLanguage()}get(e,...t){const s=this.resources[this.currentLanguage],i=this.resources[this.fallbackLanguage],r=s[e]||i[e],a=(r==null?void 0:r.message)||r||`[${e}]`;return t.length?ps(a,...t):a}detectLanguage(){const e=Object.keys(this.resources),t=navigator.languages.map(s=>s.replace(/-(.*)/,i=>i.toUpperCase()));for(const s of t){const i=e.find(r=>r===s||s.startsWith(`${r}-`));if(i)return i}return this.fallbackLanguage}async setLanguage(e){f(this,he,ze)&&Ve.forEach(async i=>await i.setLanguage(e));let t;const s=this.resources[e];if(!s)return console.warn(`${this.cachePrefix}: not found \`${e}\``),this.resetLanguage();if(typeof s=="string"){const i=`${this.cachePrefix}:`,r=`${i}${s}`,a=localStorage.getItem(r),c=async()=>{const l=await(await fetch(s)).json();if(this.cache){for(let h=0;h<localStorage.length;h++){const p=localStorage.key(h);p.startsWith(i)&&localStorage.removeItem(p)}localStorage.setItem(r,JSON.stringify(l))}return l};if(a)try{t=JSON.parse(a)}catch{t=await c()}else t=await c()}else t=s;return this.resources[e]=t,K(this.store,{}),e!==this.currentLanguage&&P(this,be,e,$t),this.cache===!0&&this.setCache(),e}resetLanguage(){return f(this,he,ze)&&Ve.forEach(e=>e.resetLanguage()),P(this,be,this.fallbackLanguage,$t),this.cache&&localStorage.removeItem(f(this,Se,kt)),this.setLanguage(this.detectLanguage())}setCache(){f(this,he,ze)&&Ve.forEach(e=>e.setCache()),localStorage.setItem(f(this,Se,kt),this.currentLanguage)}createSubModule(e,t){const s=new an({resources:t,cachePrefix:`${this.cachePrefix}-${e}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return Ve.add(s),s}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}};let on=an;Se=new WeakSet,kt=function(){return`${this.cachePrefix}:current`},Ct=new WeakSet,Ss=function(){const{hostname:e,pathname:t,search:s}=location,i=e.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return t.split("/")[1];default:const r=this.urlParamsName&&new URLSearchParams(s).get(this.urlParamsName)||"";return r in this.resources?r:""}},Lt=new WeakSet,bs=function(){return this.cache&&localStorage.getItem(f(this,Se,kt))||""},he=new WeakSet,ze=function(){return!Ve.has(this)},be=new WeakSet,$t=function(e){var t;f(this,he,ze)&&(document.documentElement.lang=e),this.currentLanguage=e,(t=this.onChange)==null||t.call(this,e)};const gs={headers:{"Content-Type":"application/json"}};async function xe(n,e={}){const t=await fetch(n,{...gs,...e});if(t.status===0)throw new Error("Request fail");if(t.status>=500)throw new Error(t.statusText);try{const s=await t.json();if(t.status>=400)throw new Error((s==null?void 0:s.message)||t.statusText,{cause:s});return s}catch{throw new Error("Server error")}}const Li=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function ys(n){return n instanceof FormData||n instanceof Blob||n instanceof Li||n instanceof URLSearchParams||n instanceof ReadableStream||n instanceof ArrayBuffer?n:typeof n=="object"?JSON.stringify(n):n}function ws(n,e){const{origin:t,pathname:s,search:i}=new URL(n,location.origin),r=new URLSearchParams(e).toString();return`${t}${s}${i?`${i}&`:r?"?":""}${r}`}function ki(n,e){return xe(ws(n,e),{method:"GET"})}function $i(n,e){return xe(ws(n,e),{method:"DELETE"})}function Ti(n,e){return xe(n,{method:"PUT",body:ys(e)})}function Mi(n,e){return xe(n,{method:"POST",body:ys(e)})}const O=n=>window.matchMedia(n).matches,Ri={PRINT:"print",get isPrint(){return O(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return O(this.HOVER)},PWA:"(display-mode: standalone)",get isPWA(){return O(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return O(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return O(this.DATA_REDUCE)},WATCH:"(width < 320px)",get isWatch(){return O(this.WATCH)},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return O(this.SMALL_PHONE)},PHONE:"(320px <= width <= 480px)",get isPhone(){return O(this.PHONE)},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return O(this.PHONE_LANDSCAPE)},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return O(this.SHORT)},TABLET:"(480px < width <= 1280px)",get isTablet(){return O(this.TABLET)},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return O(this.DESKTOP)},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return O(this.WIDTHSCREEN)}};o.GemElement=M,o.GemError=z,o.GemLightRouteElement=ts,o.GemReflectElement=sn,o.GemTitleElement=H,o.GemUnsafeElement=vt,o.GemUseElement=we,o.I18n=on,o.LinkedList=Cn,o.PREFIX=is,o.PropProxyMap=Ln,o.QueryString=Te,o.SUFFIX=rs,o.SVGTemplateResult=Rt,o.SheetToken=Wt,o.StoreListenerMap=de,o.TemplateResult=Le,o.absoluteLocation=Gt,o.addMicrotask=I,o.addMicrotaskToStack=Hs,o.adoptedStyle=Qs,o.attribute=$,o.basePathStore=Xn,o.boolattribute=Xt,o.camelToKebabCase=V,o.classMap=Mn,o.cleanObject=Je,o.connect=re,o.connectStore=He,o.createCSSSheet=Ws,o.createHistoryParams=es,o.createModalClass=wi,o.createPath=tn,o.createStore=fe,o.createTheme=fs,o.css=Gs,o.customElement=Ys,o.defaultReqInit=gs,o.defineAttribute=lt,o.defineCSSState=ut,o.defineProperty=pe,o.defineRef=ht,o.del=$i,o.directive=Y,o.disconnect=qs,o.emitter=mt,o.exportPartsMap=Ds,o.get=ki,o.getThemeProps=vi,o.getThemeStore=hs,o.globalemitter=Js,o.guard=Wn,o.history=v,o.html=B,o.ifDefined=Dt,o.isArrayChange=$n,o.kebabToCamelCase=ee,o.matchPath=en,o.mediaQuery=Ri,o.nativeDefineElement=dt,o.numattribute=zs,o.objectMapToString=Qe,o.part=jn,o.partMap=js,o.post=Mi,o.property=j,o.put=Ti,o.randomStr=Ke,o.raw=Me,o.refobject=Fs,o.removeItems=Tn,o.render=Ht,o.repeat=Gn,o.request=xe,o.rootElement=Xs,o.slot=Ks,o.splice=ps,o.state=ft,o.styleMap=xs,o.styled=Vs,o.svg=Pn,o.titleStore=ye,o.updateStore=K,o.updateTheme=ms,o.useStore=Xe,o.useTheme=Si,o.version=Rn,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
223
|
+
`)},()=>[this.content,this.contentcss])}render(){}}ys([$],Ct.prototype,"content",2),ys([$],Ct.prototype,"contentcss",2),customElements.define("gem-unsafe",Ct);var ki=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,$i=(n,e,t,s)=>{for(var i=s>1?void 0:s?Ti(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&ki(e,t,i),i};const Mi="gem-reflect-start",ws="gem-reflect-end",_s=n=>new Comment(n),Ni=n=>{const e=[];let t=n;for(;t&&(e.push(t),t.nodeValue!==ws);)t=t.nextSibling;return e};class dn extends N{constructor(){super({isLight:!0}),this.target=document.head,this.effect(()=>{this.hidden=!0,this.dataset.gemReflect=""},()=>[]);const e=_s(Mi),t=_s(ws);let s;this.effect(()=>(s?s.forEach(i=>this.target.append(i)):[e,...this.childNodes,t].forEach(i=>this.target.append(i)),()=>{s=Ni(e),s.forEach(i=>i.remove())}),()=>[this.target])}}$i([O],dn.prototype,"target",2),customElements.define("gem-reflect",dn);const Lt=Symbol("open mark");function Oi(n){var e;const t=Symbol();return e=class extends N{constructor(){super(),this.label="",this.internals.role="alertdialog",this.internals.ariaModal="true"}static get isOpen(){return this.store[Lt]}static get observedStores(){return[y.store,this.store]}static open(s){const i=new this;this.instance=i,this.inertStore=[...document.body.children].filter(a=>!a.inert),this.inertStore.forEach(a=>a.inert=!0),document.body.append(i);const r=()=>Q(this.store,{[Lt]:!0,...s});return setTimeout(()=>{r(),y.push({title:i.label,open:r,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100),t}static close(){return y.back(),t}static closeHandle(){var s;return this.inertStore.forEach(i=>i.inert=!1),(s=this.instance)==null||s.remove(),Q(this.store,{[Lt]:!1,...n}),t}static shouldClose(){return!0}},e.inertStore=[],e.instance=null,e.store=ye({[Lt]:!1,...n}),e}var Ri=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,fn=(n,e,t,s)=>{for(var i=s>1?void 0:s?Ai(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Ri(e,t,i),i};const qe=Symbol();o.GemDialogBaseElement=(Ns=class extends N{constructor(){super();v(this,Ce,void 0);v(this,Le,void 0);v(this,de,void 0);C(this,de,[]),this.closeHandle=()=>{var e;return this.inert=!0,d(this,de).forEach(t=>t.inert=!1),d(this,Ce)?d(this,Ce).before(this):d(this,Le)&&((e=d(this,Le))==null||e.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1,qe},this.openHandle=()=>(this.hidden=!1,this.inert=!1,C(this,Ce,this.nextSibling),C(this,Le,this.parentElement||this.getRootNode()),C(this,de,[...document.body.children].filter(e=>!e.inert)),d(this,de).forEach(e=>e.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0,qe),this.open=()=>{if(!this.opened)return this.openHandle(),y.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}),qe},this.close=()=>(y.back(),qe),this.forceClose=()=>(this.opened=!1,setTimeout(this.close,100),qe),this.effect(()=>this.inert=!0,()=>[]),this.internals.role="dialog",this.internals.ariaModal="true"}shouldClose(){return!0}},Ce=new WeakMap,Le=new WeakMap,de=new WeakMap,Ns),fn([$],o.GemDialogBaseElement.prototype,"label",2),fn([yt],o.GemDialogBaseElement.prototype,"opened",2),o.GemDialogBaseElement=fn([wt(y.store)],o.GemDialogBaseElement);const vs=new WeakMap;function Ss(n){return vs.get(n)}const Es=new WeakMap;function Hi(n){return Es.get(n)}const bs=new WeakMap;function Ps(n){const e=He(),t=document.createElement("style"),s=ye(n),i={},r={};Es.set(i,r),vs.set(i,s);const a=()=>Object.keys(s).forEach(h=>{r[h]||(r[h]=`--${j(h)}-${e}`,i[h]=`var(${r[h]})`)});bs.set(i,a),a();const c=()=>`:root, :host {${Object.keys(s).reduce((h,g)=>h+`${r[g]}:${s[g]};`,"")}}`,l=()=>t.textContent=c();return ie(s,l),l(),(document.head||document.documentElement).append(t),i}function Cs(n,e){Q(Ss(n),e),bs.get(n)()}function Gi(n){const e=Ps(n);return[e,t=>Cs(e,t)]}class xi{constructor(e){this.info=(...t)=>{console.log(`[${this._type}]:`,...t)},this.warn=(...t)=>{console.warn(`[${this._type}]:`,...t)},this.error=(...t)=>{console.error(`[${this._type}]:`,...t)},this._type=e}}const Ii=new xi("GEM"),Wi=/\$\d(?:<[^>]*>)?/,Vi=/\$(\d)(<([^>]*)>)?/g,Di=3;function Ls(n,...e){const t=n.split(Wi),s=[];let i;for(;i=Vi.exec(n);){const r=i[Di],a=Number(i[1])-1,c=e[a];s.push(typeof c=="function"?c(r):c)}return z(t,...s)}const Ue=new Set,mn=class{constructor(e){v(this,ke);v(this,$t);v(this,Mt);v(this,fe);v(this,Te);if(this.cachePrefix="gem-i18n",this.replace=({path:i})=>{this.setLanguage(i)},this.getParams=()=>({path:this.currentLanguage}),!e.resources[e.fallbackLanguage])throw new J("i18n: fallbackLanguage invalid");this.store=ye(this),Object.assign(this,e);let t=d(this,$t,Rs)||this.currentLanguage||d(this,Mt,As);const s=document.querySelector(`[type*=${this.cachePrefix}]`);if(s)try{const i=JSON.parse(s.textContent||"");t=i.currentLanguage,this.resources[i.currentLanguage]=i.currentLanguagePack}catch{}t?(C(this,Te,t,Ot),this.setLanguage(t)):this.resetLanguage()}get(e,...t){const s=this.resources[this.currentLanguage],i=this.resources[this.fallbackLanguage],r=s[e]||i[e],a=(r==null?void 0:r.message)||r||`[${e}]`;return t.length?Ls(a,...t):a}detectLanguage(){const e=Object.keys(this.resources),t=navigator.languages.map(s=>s.replace(/-(.*)/,i=>i.toUpperCase()));for(const s of t){const i=e.find(r=>r===s||s.startsWith(`${r}-`));if(i)return i}return this.fallbackLanguage}async setLanguage(e){d(this,fe,Ye)&&Ue.forEach(async i=>await i.setLanguage(e));let t;const s=this.resources[e];if(!s)return Ii.warn(`${this.cachePrefix}: not found \`${e}\``),this.resetLanguage();if(typeof s=="string"){const i=`${this.cachePrefix}:`,r=`${i}${s}`,a=localStorage.getItem(r),c=async()=>{const l=await(await fetch(s)).json();if(this.cache){for(let h=0;h<localStorage.length;h++){const g=localStorage.key(h);g.startsWith(i)&&localStorage.removeItem(g)}localStorage.setItem(r,JSON.stringify(l))}return l};if(a)try{t=JSON.parse(a)}catch{t=await c()}else t=await c()}else t=s;return this.resources[e]=t,Q(this.store,{}),e!==this.currentLanguage&&C(this,Te,e,Ot),this.cache===!0&&this.setCache(),e}resetLanguage(){return d(this,fe,Ye)&&Ue.forEach(e=>e.resetLanguage()),C(this,Te,this.fallbackLanguage,Ot),this.cache&&localStorage.removeItem(d(this,ke,Nt)),this.setLanguage(this.detectLanguage())}setCache(){d(this,fe,Ye)&&Ue.forEach(e=>e.setCache()),localStorage.setItem(d(this,ke,Nt),this.currentLanguage)}createSubModule(e,t){const s=new mn({resources:t,cachePrefix:`${this.cachePrefix}-${e}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return Ue.add(s),s}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}};let pn=mn;ke=new WeakSet,Nt=function(){return`${this.cachePrefix}:current`},$t=new WeakSet,Rs=function(){const{hostname:e,pathname:t,search:s}=location,i=e.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return t.split("/")[1];default:const r=this.urlParamsName&&new URLSearchParams(s).get(this.urlParamsName)||"";return r in this.resources?r:""}},Mt=new WeakSet,As=function(){return this.cache&&localStorage.getItem(d(this,ke,Nt))||""},fe=new WeakSet,Ye=function(){return!Ue.has(this)},Te=new WeakSet,Ot=function(e){var t;d(this,fe,Ye)&&(document.documentElement.lang=e),this.currentLanguage=e,(t=this.onChange)==null||t.call(this,e)};const ks={headers:{"Content-Type":"application/json"}};async function Be(n,e={}){const t=await fetch(n,{...ks,...e});if(t.status===0)throw new Error("Request fail");if(t.status>=500)throw new Error(t.statusText);try{const s=await t.json();if(t.status>=400)throw new Error((s==null?void 0:s.message)||t.statusText,{cause:s});return s}catch{throw new Error("Server error")}}const ji=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function Ts(n){return n instanceof FormData||n instanceof Blob||n instanceof ji||n instanceof URLSearchParams||n instanceof ReadableStream||n instanceof ArrayBuffer?n:typeof n=="object"?JSON.stringify(n):n}function $s(n,e){const{origin:t,pathname:s,search:i}=new URL(n,location.origin),r=new URLSearchParams(e).toString();return`${t}${s}${i?`${i}&`:r?"?":""}${r}`}function qi(n,e){return Be($s(n,e),{method:"GET"})}function Ui(n,e){return Be($s(n,e),{method:"DELETE"})}function Bi(n,e){return Be(n,{method:"PUT",body:Ts(e)})}function Fi(n,e){return Be(n,{method:"POST",body:Ts(e)})}const H=n=>window.matchMedia(n).matches,Ki={PRINT:"print",get isPrint(){return H(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return H(this.HOVER)},PWA:"(display-mode: standalone)",get isPWA(){return H(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return H(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return H(this.DATA_REDUCE)},WATCH:"(width < 320px)",get isWatch(){return H(this.WATCH)},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return H(this.SMALL_PHONE)},PHONE:"(320px <= width <= 480px)",get isPhone(){return H(this.PHONE)},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return H(this.PHONE_LANDSCAPE)},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return H(this.SHORT)},TABLET:"(480px < width <= 1280px)",get isTablet(){return H(this.TABLET)},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return H(this.DESKTOP)},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return H(this.WIDTHSCREEN)}};o.GemElement=N,o.GemError=J,o.GemLightRouteElement=hs,o.GemReflectElement=dn,o.GemRouteElement=L,o.GemTitleElement=W,o.GemUnsafeElement=Ct,o.GemUseElement=be,o.I18n=pn,o.LinkedList=Rn,o.PREFIX=fs,o.PropProxyMap=An,o.QueryString=me,o.SUFFIX=ps,o.SVGTemplateResult=Ht,o.SheetToken=jt,o.StoreListenerMap=ge,o.TemplateResult=Ne,o.absoluteLocation=Vt,o.addListener=Dt,o.addMicrotask=G,o.addMicrotaskToStack=Fs,o.adoptedStyle=ai,o.attribute=$,o.basePathStore=is,o.boolattribute=nn,o.camelToKebabCase=j,o.classMap=In,o.cleanObject=Ze,o.connect=ie,o.connectStore=wt,o.createCSSSheet=zs,o.createHistoryParams=as,o.createModalClass=Oi,o.createPath=ln,o.createStore=ye,o.createTheme=Ps,o.css=Ks,o.customElement=li,o.defaultReqInit=ks,o.defineAttribute=ft,o.defineCSSState=mt,o.defineProperty=_e,o.defineRef=pt,o.del=Ui,o.directive=te,o.disconnect=ei,o.emitter=Ve,o.exportPartsMap=Zs,o.get=qi,o.getThemeProps=Hi,o.getThemeStore=Ss,o.globalemitter=oi,o.guard=Bn,o.history=y,o.html=z,o.ifDefined=Kt,o.isArrayChange=Gn,o.kebabToCamelCase=se,o.matchPath=cn,o.mediaQuery=Ki,o.nativeDefineElement=gt,o.numattribute=ii,o.objectMapToString=et,o.part=Jn,o.partMap=Ys,o.post=Fi,o.property=O,o.put=Bi,o.randomStr=He,o.raw=Ae,o.refobject=si,o.removeItems=xn,o.render=Wt,o.repeat=Un,o.request=Be,o.rootElement=ci,o.slot=ri,o.splice=Ls,o.state=yt,o.styleMap=Xs,o.styled=Qs,o.svg=On,o.titleStore=Se,o.updateStore=Q,o.updateTheme=Cs,o.useStore=tt,o.useTheme=Gi,o.version=Wn,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/elements/base/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,QAAA,MAAM,KAAK,eAAW,CAAC;AAEvB;;;;;;;GAOG;AACH,8BACsB,oBAAqB,SAAQ,UAAU;;IAChD,KAAK,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/elements/base/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,QAAA,MAAM,KAAK,eAAW,CAAC;AAEvB;;;;;;;GAOG;AACH,8BACsB,oBAAqB,SAAQ,UAAU;;IAChD,KAAK,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;;IAgBvB;;;OAGG;IACH,WAAW,eAWT;IAEF;;;OAGG;IACH,UAAU,eAWR;IAEF,YAAY;IACZ,IAAI,iCAUF;IAEF,WAAW;IAIX,YAAY;IACZ,KAAK,eAGH;IAEF;;;;;OAKG;IACH,UAAU,eAIR;CACH"}
|
package/elements/base/dialog.js
CHANGED
|
@@ -97,7 +97,7 @@ let GemDialogBaseElement = class GemDialogBaseElement extends GemElement {
|
|
|
97
97
|
setTimeout(this.close, 100);
|
|
98
98
|
return final;
|
|
99
99
|
};
|
|
100
|
-
this.inert = true;
|
|
100
|
+
this.effect(() => (this.inert = true), () => []);
|
|
101
101
|
this.internals.role = 'dialog';
|
|
102
102
|
this.internals.ariaModal = 'true';
|
|
103
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/elements/base/dialog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;AAEvB;;;;;;;GAOG;AAEI,IAAe,oBAAoB,GAAnC,MAAe,oBAAqB,SAAQ,UAAU;IAQ3D;QACE,KAAK,EAAE,CAAC;QALV,oDAA+B;QAC/B,sDAA4B;QAC5B,2CAA6B,EAAE,EAAC;
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/elements/base/dialog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;AAEvB;;;;;;;GAOG;AAEI,IAAe,oBAAoB,GAAnC,MAAe,oBAAqB,SAAQ,UAAU;IAQ3D;QACE,KAAK,EAAE,CAAC;QALV,oDAA+B;QAC/B,sDAA4B;QAC5B,2CAA6B,EAAE,EAAC;QAYhC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AAY,CAAC,OAAO,CAAC,KAAK,CAAC;GACN,oBAAoB,CAsFzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,mBAAmB,CAAC;AAKhE,OAAO,EAAa,SAAS,EAAE,YAAY,EAAmC,MAAM,SAAS,CAAC;AAM9F;;;;;;;;;;;;GAYG;AACH,qBACa,cAAe,SAAQ,UAAU;;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,IAAI,GAAG,KAAK,CAAC;IAGpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAC5B,iBAAiB;IACP,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,IAAI,EAAE,MAAM,CAAC;;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,mBAAmB,CAAC;AAKhE,OAAO,EAAa,SAAS,EAAE,YAAY,EAAmC,MAAM,SAAS,CAAC;AAM9F;;;;;;;;;;;;GAYG;AACH,qBACa,cAAe,SAAQ,UAAU;;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,IAAI,GAAG,KAAK,CAAC;IAGpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAC5B,iBAAiB;IACP,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,IAAI,EAAE,MAAM,CAAC;;IAgFnB,MAAM;IA2BN;;OAEG;IACH,iBAAiB;CAmBlB;AAED;;;GAGG;AACH,qBACa,oBAAqB,SAAQ,cAAc;IAC3C,OAAO,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;;CAUxB"}
|
package/elements/base/link.js
CHANGED
|
@@ -33,7 +33,7 @@ function isExternal(path) {
|
|
|
33
33
|
*/
|
|
34
34
|
let GemLinkElement = class GemLinkElement extends GemElement {
|
|
35
35
|
constructor() {
|
|
36
|
-
super();
|
|
36
|
+
super({ focusable: true });
|
|
37
37
|
_GemLinkElement_instances.add(this);
|
|
38
38
|
_GemLinkElement_onClick.set(this, async () => {
|
|
39
39
|
var _a;
|
|
@@ -74,12 +74,17 @@ let GemLinkElement = class GemLinkElement extends GemElement {
|
|
|
74
74
|
history.pushIgnoreCloseHandle({
|
|
75
75
|
path: pathname,
|
|
76
76
|
query: search,
|
|
77
|
-
hash
|
|
77
|
+
hash,
|
|
78
78
|
title: this.docTitle,
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
history.pushIgnoreCloseHandle({
|
|
82
|
+
history.pushIgnoreCloseHandle({
|
|
83
|
+
path: this.path,
|
|
84
|
+
query: this.query,
|
|
85
|
+
hash: this.hash,
|
|
86
|
+
title: this.docTitle,
|
|
87
|
+
});
|
|
83
88
|
}
|
|
84
89
|
});
|
|
85
90
|
_GemLinkElement_preventDefault.set(this, (e) => {
|
|
@@ -91,7 +96,6 @@ let GemLinkElement = class GemLinkElement extends GemElement {
|
|
|
91
96
|
? locationString
|
|
92
97
|
: new URL(history.basePath + locationString, location.origin).toString();
|
|
93
98
|
});
|
|
94
|
-
this.tabIndex = 0;
|
|
95
99
|
this.addEventListener('click', __classPrivateFieldGet(this, _GemLinkElement_onClick, "f"));
|
|
96
100
|
}
|
|
97
101
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAA2B,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE9F,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;;;;;;GAYG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IA0B5C;QACE,KAAK,EAAE,CAAC;;
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,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