@mantou/gem 1.6.3 → 1.6.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/README.md +6 -38
- package/dist/gem.es.js +3272 -0
- package/dist/gem.umd.js +229 -0
- package/elements/dialog-base.d.ts +2 -2
- package/elements/dialog-base.d.ts.map +1 -1
- package/elements/dialog-base.js +6 -6
- package/elements/dialog-base.js.map +1 -1
- package/elements/gesture.d.ts +2 -1
- package/elements/gesture.d.ts.map +1 -1
- package/elements/gesture.js +6 -5
- package/elements/gesture.js.map +1 -1
- package/elements/link.d.ts +1 -1
- package/elements/link.d.ts.map +1 -1
- package/elements/link.js +11 -16
- package/elements/link.js.map +1 -1
- package/elements/modal-base.d.ts +4 -4
- package/elements/modal-base.d.ts.map +1 -1
- package/elements/modal-base.js +9 -4
- package/elements/modal-base.js.map +1 -1
- package/elements/reflect.d.ts +1 -1
- package/elements/reflect.d.ts.map +1 -1
- package/elements/reflect.js +2 -1
- package/elements/reflect.js.map +1 -1
- package/elements/route.d.ts +7 -3
- package/elements/route.d.ts.map +1 -1
- package/elements/route.js +12 -6
- package/elements/route.js.map +1 -1
- package/elements/title.d.ts +1 -1
- package/elements/title.d.ts.map +1 -1
- package/elements/title.js +4 -1
- package/elements/title.js.map +1 -1
- package/elements/unsafe.d.ts +1 -1
- package/elements/unsafe.d.ts.map +1 -1
- package/elements/unsafe.js +2 -1
- package/elements/unsafe.js.map +1 -1
- package/elements/use.d.ts +1 -1
- package/elements/use.d.ts.map +1 -1
- package/elements/use.js +2 -1
- package/elements/use.js.map +1 -1
- package/helper/i18n.js +47 -58
- package/helper/i18n.js.map +1 -1
- package/helper/request.js +11 -19
- package/helper/request.js.map +1 -1
- package/index.d.ts +5 -4
- package/index.d.ts.map +1 -1
- package/index.js +4 -2
- package/index.js.map +1 -1
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js +1 -1
- package/lib/element.js.map +1 -1
- package/lib/history.js +17 -5
- package/lib/history.js.map +1 -1
- package/lib/utils.d.ts +3 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +7 -4
- package/lib/utils.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +26 -53
- package/src/{umd.ts → dist.ts} +1 -5
- package/src/elements/dialog-base.ts +5 -4
- package/src/elements/gesture.ts +2 -1
- package/src/elements/link.ts +5 -15
- package/src/elements/modal-base.ts +3 -1
- package/src/elements/reflect.ts +2 -1
- package/src/elements/route.ts +8 -20
- package/src/elements/title.ts +4 -1
- package/src/elements/unsafe.ts +2 -1
- package/src/elements/use.ts +2 -1
- package/src/index.ts +4 -6
- package/src/lib/element.ts +2 -1
- package/src/lib/history.ts +1 -1
- package/src/lib/utils.ts +10 -4
- package/src/lib/version.ts +1 -1
- package/src/test/gem-element/advance.test.ts +1 -0
- package/src/test/gem-element/basic.test.ts +1 -0
- package/src/test/gem-element/decorators.test.ts +1 -0
- package/src/test/gem-element/multi.test.ts +1 -0
- package/src/test/history.test.ts +1 -0
- package/src/test/store.test.ts +1 -0
- package/src/test/utils.test.ts +1 -0
- package/src/examples/base-path/index.ts +0 -44
- package/src/examples/controlled/index.ts +0 -75
- package/src/examples/decorator/chidren.ts +0 -77
- package/src/examples/decorator/index.ts +0 -110
- package/src/examples/dialog/index.ts +0 -148
- package/src/examples/effect/index.ts +0 -45
- package/src/examples/elements/env.ts +0 -7
- package/src/examples/elements/layout.ts +0 -53
- package/src/examples/elements/nav.ts +0 -71
- package/src/examples/elements/source.ts +0 -68
- package/src/examples/gesture/canvas.ts +0 -69
- package/src/examples/gesture/index.ts +0 -97
- package/src/examples/gesture/manifest.json +0 -3
- package/src/examples/hash/index.ts +0 -55
- package/src/examples/i18n/index.ts +0 -63
- package/src/examples/index/index.ts +0 -33
- package/src/examples/index/manifest.json +0 -5
- package/src/examples/light-dom/index.ts +0 -31
- package/src/examples/multi-page/api.ts +0 -9
- package/src/examples/multi-page/index.ts +0 -78
- package/src/examples/multi-page/page-a.ts +0 -16
- package/src/examples/multi-page/page-b.ts +0 -12
- package/src/examples/multi-page/page-c.ts +0 -40
- package/src/examples/multi-page/store.ts +0 -10
- package/src/examples/perf-demo/index.ts +0 -136
- package/src/examples/ref-route/index.ts +0 -109
- package/src/examples/reflect/index.ts +0 -61
- package/src/examples/styled/index.ts +0 -39
- package/src/examples/svg-icon/index.ts +0 -31
- package/src/examples/theme/index.ts +0 -56
- package/src/examples/unsafe/index.ts +0 -29
- package/umd.d.ts +0 -18
- package/umd.d.ts.map +0 -1
- package/umd.js +0 -54
- package/umd.js.LICENSE.txt +0 -13
- package/umd.js.map +0 -1
package/dist/gem.umd.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
var Qs=Object.defineProperty,Zs=Object.defineProperties;var Xs=Object.getOwnPropertyDescriptors;var is=Object.getOwnPropertySymbols;var Ys=Object.prototype.hasOwnProperty,ei=Object.prototype.propertyIsEnumerable;var rs=(a,m,w)=>m in a?Qs(a,m,{enumerable:!0,configurable:!0,writable:!0,value:w}):a[m]=w,T=(a,m)=>{for(var w in m||(m={}))Ys.call(m,w)&&rs(a,w,m[w]);if(is)for(var w of is(m))ei.call(m,w)&&rs(a,w,m[w]);return a},je=(a,m)=>Zs(a,Xs(m));var Jt=(a,m,w)=>{if(!m.has(a))throw TypeError("Cannot "+w)};var y=(a,m,w)=>(Jt(a,m,"read from private field"),w?w.call(a):m.get(a)),N=(a,m,w)=>{if(m.has(a))throw TypeError("Cannot add the same private member more than once");m instanceof WeakSet?m.add(a):m.set(a,w)},G=(a,m,w,Q)=>(Jt(a,m,"write to private field"),Q?Q.call(a,w):m.set(a,w),w);var ut=(a,m,w)=>(Jt(a,m,"access private method"),w);(function(a,m){typeof exports=="object"&&typeof module!="undefined"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):(a=typeof globalThis!="undefined"?globalThis:a||self,m(a.Gem={}))})(this,function(a){var ne,se,le,we,Qt,Ee,ct,Se,ve,he,ss,_e,Zt,lt,ti,ht,ni,ue,dt,be,Xt;"use strict";var m=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",get StoreListenerMap(){return ie},get createStore(){return F},get createStoreSet(){return vn},get updateStore(){return P},get connect(){return re},get disconnect(){return Ct},get history(){return h},get basePathStore(){return Ge},get titleStore(){return q},get html(){return M},get svg(){return fn},get render(){return Ue},get directive(){return Q},get TemplateResult(){return Te},get SVGTemplateResult(){return pt},get repeat(){return Tn},get guard(){return Ln},get ifDefined(){return Nt},get GemElement(){return R},get defineAttribute(){return Ye},get defineProperty(){return ye},get defineRef(){return et},get defineCSSState(){return tt},get nativeDefineElement(){return nt},get refobject(){return Mn},get attribute(){return L},get boolattribute(){return On},get numattribute(){return An},get property(){return U},get state(){return Ae},get slot(){return Rn},get part(){return Wt},get emitter(){return Re},get globalemitter(){return Gn},get adoptedStyle(){return In},get connectStore(){return ce},get rootElement(){return Vn},get customElement(){return z},get addMicrotask(){return H},get addMicrotaskToStack(){return mn},get absoluteLocation(){return qe},get LinkedList(){return Et},get PropProxyMap(){return St},get QueryString(){return fe},get raw(){return me},get css(){return pn},get SheetToken(){return xe},get useNativeCSSStyleSheet(){return a.useNativeCSSStyleSheet},get createCSSSheet(){return gn},get randomStr(){return $e},get styled(){return wn},get camelToKebabCase(){return I},get kebabToCamelCase(){return pe},get cleanObject(){return Ne},get GemError(){return K},get isArrayChange(){return _t},get removeItems(){return bt},get styleMap(){return En},get classMap(){return Pt},get partMap(){return Sn},get version(){return ns}});/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
4
|
+
* This code may only be used under the BSD style license found at
|
|
5
|
+
* http://polymer.github.io/LICENSE.txt
|
|
6
|
+
* The complete set of authors may be found at
|
|
7
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
8
|
+
* The complete set of contributors may be found at
|
|
9
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
10
|
+
* Code distributed by Google as part of the polymer project is also
|
|
11
|
+
* subject to an additional IP rights grant found at
|
|
12
|
+
* http://polymer.github.io/PATENTS.txt
|
|
13
|
+
*/const w=new WeakMap,Q=t=>(...e)=>{const n=t(...e);return w.set(n,!0),n},Pe=t=>typeof t=="function"&&w.has(t);/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
16
|
+
* This code may only be used under the BSD style license found at
|
|
17
|
+
* http://polymer.github.io/LICENSE.txt
|
|
18
|
+
* The complete set of authors may be found at
|
|
19
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
20
|
+
* The complete set of contributors may be found at
|
|
21
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
22
|
+
* Code distributed by Google as part of the polymer project is also
|
|
23
|
+
* subject to an additional IP rights grant found at
|
|
24
|
+
* http://polymer.github.io/PATENTS.txt
|
|
25
|
+
*/const Yt=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,en=(t,e,n=null,s=null)=>{for(;e!==n;){const i=e.nextSibling;t.insertBefore(e,s),e=i}},ft=(t,e,n=null)=>{for(;e!==n;){const s=e.nextSibling;t.removeChild(e),e=s}};/**
|
|
26
|
+
* @license
|
|
27
|
+
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
28
|
+
* This code may only be used under the BSD style license found at
|
|
29
|
+
* http://polymer.github.io/LICENSE.txt
|
|
30
|
+
* The complete set of authors may be found at
|
|
31
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
32
|
+
* The complete set of contributors may be found at
|
|
33
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
34
|
+
* Code distributed by Google as part of the polymer project is also
|
|
35
|
+
* subject to an additional IP rights grant found at
|
|
36
|
+
* http://polymer.github.io/PATENTS.txt
|
|
37
|
+
*/const D={},tn={};/**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
40
|
+
* This code may only be used under the BSD style license found at
|
|
41
|
+
* http://polymer.github.io/LICENSE.txt
|
|
42
|
+
* The complete set of authors may be found at
|
|
43
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
44
|
+
* The complete set of contributors may be found at
|
|
45
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
46
|
+
* Code distributed by Google as part of the polymer project is also
|
|
47
|
+
* subject to an additional IP rights grant found at
|
|
48
|
+
* http://polymer.github.io/PATENTS.txt
|
|
49
|
+
*/const Z=`{{lit-${String(Math.random()).slice(2)}}}`,nn=`<!--${Z}-->`,sn=new RegExp(`${Z}|${nn}`),Ce="$lit$";class as{constructor(e,n){this.parts=[],this.element=n;const s=[],i=[],r=document.createTreeWalker(n.content,133,null,!1);let o=0,c=-1,l=0;const{strings:u,values:{length:p}}=e;for(;l<p;){const d=r.nextNode();if(d===null){r.currentNode=i.pop();continue}if(c++,d.nodeType===1){if(d.hasAttributes()){const $=d.attributes,{length:E}=$;let S=0;for(let g=0;g<E;g++)rn($[g].name,Ce)&&S++;for(;S-- >0;){const g=u[l],v=mt.exec(g)[2],b=v.toLowerCase()+Ce,x=d.getAttribute(b);d.removeAttribute(b);const W=x.split(sn);this.parts.push({type:"attribute",index:c,name:v,strings:W}),l+=W.length-1}}d.tagName==="TEMPLATE"&&(i.push(d),r.currentNode=d.content)}else if(d.nodeType===3){const $=d.data;if($.indexOf(Z)>=0){const E=d.parentNode,S=$.split(sn),g=S.length-1;for(let v=0;v<g;v++){let b,x=S[v];if(x==="")b=B();else{const W=mt.exec(x);W!==null&&rn(W[2],Ce)&&(x=x.slice(0,W.index)+W[1]+W[2].slice(0,-Ce.length)+W[3]),b=document.createTextNode(x)}E.insertBefore(b,d),this.parts.push({type:"node",index:++c})}S[g]===""?(E.insertBefore(B(),d),s.push(d)):d.data=S[g],l+=g}}else if(d.nodeType===8)if(d.data===Z){const $=d.parentNode;(d.previousSibling===null||c===o)&&(c++,$.insertBefore(B(),d)),o=c,this.parts.push({type:"node",index:c}),d.nextSibling===null?d.data="":(s.push(d),c--),l++}else{let $=-1;for(;($=d.data.indexOf(Z,$+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(const d of s)d.parentNode.removeChild(d)}}const rn=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},os=t=>t.index!==-1,B=()=>document.createComment(""),mt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;/**
|
|
50
|
+
* @license
|
|
51
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
52
|
+
* This code may only be used under the BSD style license found at
|
|
53
|
+
* http://polymer.github.io/LICENSE.txt
|
|
54
|
+
* The complete set of authors may be found at
|
|
55
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
56
|
+
* The complete set of contributors may be found at
|
|
57
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
58
|
+
* Code distributed by Google as part of the polymer project is also
|
|
59
|
+
* subject to an additional IP rights grant found at
|
|
60
|
+
* http://polymer.github.io/PATENTS.txt
|
|
61
|
+
*/class an{constructor(e,n,s){this.__parts=[],this.template=e,this.processor=n,this.options=s}update(e){let n=0;for(const s of this.__parts)s!==void 0&&s.setValue(e[n]),n++;for(const s of this.__parts)s!==void 0&&s.commit()}_clone(){const e=Yt?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=[],s=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let r=0,o=0,c,l=i.nextNode();for(;r<s.length;){if(c=s[r],!os(c)){this.__parts.push(void 0),r++;continue}for(;o<c.index;)o++,l.nodeName==="TEMPLATE"&&(n.push(l),i.currentNode=l.content),(l=i.nextNode())===null&&(i.currentNode=n.pop(),l=i.nextNode());if(c.type==="node"){const u=this.processor.handleTextExpression(this.options);u.insertAfterNode(l.previousSibling),this.__parts.push(u)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));r++}return Yt&&(document.adoptNode(e),customElements.upgrade(e)),e}}/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
64
|
+
* This code may only be used under the BSD style license found at
|
|
65
|
+
* http://polymer.github.io/LICENSE.txt
|
|
66
|
+
* The complete set of authors may be found at
|
|
67
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
68
|
+
* The complete set of contributors may be found at
|
|
69
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
70
|
+
* Code distributed by Google as part of the polymer project is also
|
|
71
|
+
* subject to an additional IP rights grant found at
|
|
72
|
+
* http://polymer.github.io/PATENTS.txt
|
|
73
|
+
*/const on=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),cs=` ${Z} `;class Te{constructor(e,n,s,i){this.strings=e,this.values=n,this.type=s,this.processor=i}getHTML(){const e=this.strings.length-1;let n="",s=!1;for(let i=0;i<e;i++){const r=this.strings[i],o=r.lastIndexOf("<!--");s=(o>-1||s)&&r.indexOf("-->",o+1)===-1;const c=mt.exec(r);c===null?n+=r+(s?cs:nn):n+=r.substr(0,c.index)+c[1]+c[2]+Ce+c[3]+Z}return n+=this.strings[e],n}getTemplateElement(){const e=document.createElement("template");let n=this.getHTML();return on!==void 0&&(n=on.createHTML(n)),e.innerHTML=n,e}}class pt extends Te{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const e=super.getTemplateElement(),n=e.content,s=n.firstChild;return n.removeChild(s),en(n,s.firstChild),e}}/**
|
|
74
|
+
* @license
|
|
75
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
76
|
+
* This code may only be used under the BSD style license found at
|
|
77
|
+
* http://polymer.github.io/LICENSE.txt
|
|
78
|
+
* The complete set of authors may be found at
|
|
79
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
80
|
+
* The complete set of contributors may be found at
|
|
81
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
82
|
+
* Code distributed by Google as part of the polymer project is also
|
|
83
|
+
* subject to an additional IP rights grant found at
|
|
84
|
+
* http://polymer.github.io/PATENTS.txt
|
|
85
|
+
*/const gt=t=>t===null||!(typeof t=="object"||typeof t=="function"),yt=t=>Array.isArray(t)||!!(t&&t[Symbol.iterator]);class cn{constructor(e,n,s){this.dirty=!0,this.element=e,this.name=n,this.strings=s,this.parts=[];for(let i=0;i<s.length-1;i++)this.parts[i]=this._createPart()}_createPart(){return new wt(this)}_getValue(){const e=this.strings,n=e.length-1,s=this.parts;if(n===1&&e[0]===""&&e[1]===""){const r=s[0].value;if(typeof r=="symbol")return String(r);if(typeof r=="string"||!yt(r))return r}let i="";for(let r=0;r<n;r++){i+=e[r];const o=s[r];if(o!==void 0){const c=o.value;if(gt(c)||!yt(c))i+=typeof c=="string"?c:String(c);else for(const l of c)i+=typeof l=="string"?l:String(l)}}return i+=e[n],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class wt{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==D&&(!gt(e)||e!==this.value)&&(this.value=e,Pe(e)||(this.committer.dirty=!0))}commit(){for(;Pe(this.value);){const e=this.value;this.value=D,e(this)}this.value!==D&&this.committer.commit()}}class de{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(B()),this.endNode=e.appendChild(B())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=B()),e.__insert(this.endNode=B())}insertAfterPart(e){e.__insert(this.startNode=B()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;Pe(this.__pendingValue);){const n=this.__pendingValue;this.__pendingValue=D,n(this)}const e=this.__pendingValue;e!==D&&(gt(e)?e!==this.value&&this.__commitText(e):e instanceof Te?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):yt(e)?this.__commitIterable(e):e===tn?(this.value=tn,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 n=this.startNode.nextSibling;e=e==null?"":e;const s=typeof e=="string"?e:String(e);n===this.endNode.previousSibling&&n.nodeType===3?n.data=s:this.__commitNode(document.createTextNode(s)),this.value=e}__commitTemplateResult(e){const n=this.options.templateFactory(e);if(this.value instanceof an&&this.value.template===n)this.value.update(e.values);else{const s=new an(n,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 n=this.value;let s=0,i;for(const r of e)i=n[s],i===void 0&&(i=new de(this.options),n.push(i),s===0?i.appendIntoPart(this):i.insertAfterPart(n[s-1])),i.setValue(r),i.commit(),s++;s<n.length&&(n.length=s,this.clear(i&&i.endNode))}clear(e=this.startNode){ft(this.startNode.parentNode,e.nextSibling,this.endNode)}}class ls{constructor(e,n,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=n,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;Pe(this.__pendingValue);){const n=this.__pendingValue;this.__pendingValue=D,n(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 hs extends cn{constructor(e,n,s){super(e,n,s);this.single=s.length===2&&s[0]===""&&s[1]===""}_createPart(){return new us(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class us extends wt{}let ln=!1;(()=>{try{const t={get capture(){return ln=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{}})();class ds{constructor(e,n,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=n,this.eventContext=s,this.__boundHandleEvent=i=>this.handleEvent(i)}setValue(e){this.__pendingValue=e}commit(){for(;Pe(this.__pendingValue);){const r=this.__pendingValue;this.__pendingValue=D,r(this)}if(this.__pendingValue===D)return;const e=this.__pendingValue,n=this.value,s=e==null||n!=null&&(e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive),i=e!=null&&(n==null||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=fs(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 fs=t=>t&&(ln?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);/**
|
|
86
|
+
* @license
|
|
87
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
88
|
+
* This code may only be used under the BSD style license found at
|
|
89
|
+
* http://polymer.github.io/LICENSE.txt
|
|
90
|
+
* The complete set of authors may be found at
|
|
91
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
92
|
+
* The complete set of contributors may be found at
|
|
93
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
94
|
+
* Code distributed by Google as part of the polymer project is also
|
|
95
|
+
* subject to an additional IP rights grant found at
|
|
96
|
+
* http://polymer.github.io/PATENTS.txt
|
|
97
|
+
*/class ms{handleAttributeExpressions(e,n,s,i){const r=n[0];return r==="."?new hs(e,n.slice(1),s).parts:r==="@"?[new ds(e,n.slice(1),i.eventContext)]:r==="?"?[new ls(e,n.slice(1),s)]:new cn(e,n,s).parts}handleTextExpression(e){return new de(e)}}const hn=new ms;/**
|
|
98
|
+
* @license
|
|
99
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
100
|
+
* This code may only be used under the BSD style license found at
|
|
101
|
+
* http://polymer.github.io/LICENSE.txt
|
|
102
|
+
* The complete set of authors may be found at
|
|
103
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
104
|
+
* The complete set of contributors may be found at
|
|
105
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
106
|
+
* Code distributed by Google as part of the polymer project is also
|
|
107
|
+
* subject to an additional IP rights grant found at
|
|
108
|
+
* http://polymer.github.io/PATENTS.txt
|
|
109
|
+
*/function ps(t){let e=un.get(t.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},un.set(t.type,e));let n=e.stringsArray.get(t.strings);if(n!==void 0)return n;const s=t.strings.join(Z);return n=e.keyString.get(s),n===void 0&&(n=new as(t,t.getTemplateElement()),e.keyString.set(s,n)),e.stringsArray.set(t.strings,n),n}const un=new Map;/**
|
|
110
|
+
* @license
|
|
111
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
112
|
+
* This code may only be used under the BSD style license found at
|
|
113
|
+
* http://polymer.github.io/LICENSE.txt
|
|
114
|
+
* The complete set of authors may be found at
|
|
115
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
116
|
+
* The complete set of contributors may be found at
|
|
117
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
118
|
+
* Code distributed by Google as part of the polymer project is also
|
|
119
|
+
* subject to an additional IP rights grant found at
|
|
120
|
+
* http://polymer.github.io/PATENTS.txt
|
|
121
|
+
*/const dn=new WeakMap,Ue=(t,e,n)=>{let s=dn.get(e);s===void 0&&(ft(e,e.firstChild),dn.set(e,s=new de(Object.assign({templateFactory:ps},n))),s.appendInto(e)),s.setValue(t),s.commit()};/**
|
|
122
|
+
* @license
|
|
123
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
124
|
+
* This code may only be used under the BSD style license found at
|
|
125
|
+
* http://polymer.github.io/LICENSE.txt
|
|
126
|
+
* The complete set of authors may be found at
|
|
127
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
128
|
+
* The complete set of contributors may be found at
|
|
129
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
130
|
+
* Code distributed by Google as part of the polymer project is also
|
|
131
|
+
* subject to an additional IP rights grant found at
|
|
132
|
+
* http://polymer.github.io/PATENTS.txt
|
|
133
|
+
*/typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const M=(t,...e)=>new Te(t,e,"html",hn),fn=(t,...e)=>new pt(t,e,"svg",hn),Le=new Set;function H(t){typeof t=="function"&&(Le.size||globalThis.queueMicrotask(()=>{Le.forEach(e=>e()),Le.clear()}),Le.delete(t),Le.add(t))}const ke=[];function gs(){for(let t=ke.length-1;t>=0;t--)ke[t]();ke.length=0}function mn(t){ke.length||H(gs),ke.push(t)}function qe(t="",e=""){const{pathname:n,search:s,hash:i}=new URL(e,location.origin+t);return n+s+i}class Et extends(globalThis.EventTarget||Object){constructor(){super(...arguments);N(this,we);N(this,ne,void 0);N(this,se,void 0);N(this,le,void 0);G(this,ne,new Map)}get size(){return y(this,ne).size}add(e){y(this,le)||this.dispatchEvent(new CustomEvent("start"));const n=ut(this,we,Qt).call(this,e)||{value:e};n.prev=y(this,le),n.prev&&(n.prev.next=n),n.next=void 0,G(this,le,n),y(this,se)||G(this,se,n),y(this,ne).set(e,n)}delete(e){const n=ut(this,we,Qt).call(this,e);return y(this,se)||this.dispatchEvent(new CustomEvent("end")),n}get(){const e=y(this,se);if(!!e)return ut(this,we,Qt).call(this,e.value),e.value}}ne=new WeakMap,se=new WeakMap,le=new WeakMap,we=new WeakSet,Qt=function(e){const n=y(this,ne).get(e);return n&&(n.prev?n.prev.next=n.next:G(this,se,n.next),n.next?n.next.prev=n.prev:G(this,le,n.prev),y(this,ne).delete(e)),n};class St extends WeakMap{get(e){let n=super.get(e);return n||(n={},this.set(e,n)),n}}class fe extends URLSearchParams{constructor(e){super(e);N(this,Ee,e=>typeof e=="string"?e:JSON.stringify(e));N(this,ct,e=>{if(!e)return null;try{return JSON.parse(e)}catch{return null}})}concat(e){let n;typeof e=="string"?n=Object.fromEntries(new URLSearchParams(e).entries()):n=e,Object.entries(n).forEach(([s,i])=>{this.append(s,y(this,Ee).call(this,i))})}setAny(e,n){if(Array.isArray(n))this.delete(e),n.forEach(s=>this.append(e,y(this,Ee).call(this,s)));else{const s=y(this,Ee).call(this,n);s?this.set(e,s):this.delete(e)}}getAny(e){return this.getAnyAll(e)[0]}getAnyAll(e){return this.getAll(e).filter(n=>n!=="").map(n=>y(this,ct).call(this,n))}toString(){const e=super.toString();return e?`?${e}`:""}toJSON(){return this.toString()}}Ee=new WeakMap,ct=new WeakMap;function me(t,...e){return t.reduce((n,s,i)=>{var r;return n+((r=e[i-1])!=null?r:"")+s})}function pn(t,...e){return me(t,...e)}const xe=Symbol("sheet token");a.useNativeCSSStyleSheet=!0;let vt=window.CSSStyleSheet;try{new vt}catch{a.useNativeCSSStyleSheet=!1,vt=class{constructor(){this.media={mediaText:""},this.style="",this.replaceSync=t=>this.style=t}}}function gn(t,e=""){const n=new vt,s={};n.media.mediaText=e;let i="";return typeof t=="string"?i=t:Object.keys(t).forEach(r=>{s[r]=`${r}-${$e()}`,i+=t[r].styledContent.replace(/&/g,s[r])}),n.replaceSync(i),s[xe]=n,s}function $e(t=5,e="0123456789abcdefghijklmnopqrstuvwxyz"){const n=e.length;let s="";for(let i=0;i<t;i++)s+=e[Math.floor(Math.random()*n)];return s}const ys=new RegExp(`&.*{((.|
|
|
134
|
+
)*)}`,"g");function yn(t,e){const n=[];let s=`& {${t.replace(ys,i=>(n.push(i),""))}}`+n.join("");return s=s.replace(/&/g,e==="class"?".&":"#&"),{styledContent:s,type:e}}const wn={class:(t,...e)=>{const n=me(t,...e);return yn(n,"class")},id:(t,...e)=>{const n=me(t,...e);return yn(n,"id")},keyframes:(t,...e)=>({styledContent:`@keyframes & {${me(t,...e)}}`,type:"keyframes"})};function I(t){return t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function pe(t){return t.replace(/-(.)/g,(e,n)=>n.toUpperCase())}function Ne(t){return Object.keys(t).forEach(e=>{const n=e;delete t[n]}),t}class K extends Error{constructor(e){super(e);this.message=`gem: ${this.message}`}}function _t(t,e){const n=t.length;if(e.length!==n)return!0;for(let s=0;s<n;s++)if(t[s]!==e[s])return!0;return!1}function bt(t,e){const n=new Set(e);return t.filter(s=>n.has(s)?(n.delete(s),!1):!0)}function En(t){let e="";for(const n in t)t[n]!==void 0&&(e+=`${I(n)}:${t[n]};`);return e}function Pt(t){let e=" ";for(const n in t)t[n]&&(e+=`${n} `);return e}const Sn=Pt,ie=new WeakMap;function F(t){if(ie.has(t))throw new K("argument error");return ie.set(t,new Set),t}function vn(t){return Object.keys(t).forEach(n=>{F(t[n])}),t}function P(t,e){Object.assign(t,e);const n=ie.get(t);n==null||n.forEach(s=>{H(s)})}function re(t,e){const n=ie.get(t);n==null||n.add(e)}function Ct(t,e){const n=ie.get(t);n==null||n.delete(e)}/**
|
|
135
|
+
* @license
|
|
136
|
+
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
137
|
+
* This code may only be used under the BSD style license found at
|
|
138
|
+
* http://polymer.github.io/LICENSE.txt
|
|
139
|
+
* The complete set of authors may be found at
|
|
140
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
141
|
+
* The complete set of contributors may be found at
|
|
142
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
143
|
+
* Code distributed by Google as part of the polymer project is also
|
|
144
|
+
* subject to an additional IP rights grant found at
|
|
145
|
+
* http://polymer.github.io/PATENTS.txt
|
|
146
|
+
*/const _n=(t,e)=>{const n=t.startNode.parentNode,s=e===void 0?t.endNode:e.startNode,i=n.insertBefore(B(),s);n.insertBefore(B(),s);const r=new de(t.options);return r.insertAfterNode(i),r},ae=(t,e)=>(t.setValue(e),t.commit(),t),Tt=(t,e,n)=>{const s=t.startNode.parentNode,i=n?n.startNode:t.endNode,r=e.endNode.nextSibling;r!==i&&en(s,e.startNode,r,i)},Lt=t=>{ft(t.startNode.parentNode,t.startNode,t.endNode.nextSibling)},bn=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Pn=new WeakMap,Cn=new WeakMap,Tn=Q((t,e,n)=>{let s;return n===void 0?n=e:e!==void 0&&(s=e),i=>{if(!(i instanceof de))throw new Error("repeat can only be used in text bindings");const r=Pn.get(i)||[],o=Cn.get(i)||[],c=[],l=[],u=[];let p=0;for(const b of t)u[p]=s?s(b,p):p,l[p]=n(b,p),p++;let d,$,E=0,S=r.length-1,g=0,v=l.length-1;for(;E<=S&&g<=v;)if(r[E]===null)E++;else if(r[S]===null)S--;else if(o[E]===u[g])c[g]=ae(r[E],l[g]),E++,g++;else if(o[S]===u[v])c[v]=ae(r[S],l[v]),S--,v--;else if(o[E]===u[v])c[v]=ae(r[E],l[v]),Tt(i,r[E],c[v+1]),E++,v--;else if(o[S]===u[g])c[g]=ae(r[S],l[g]),Tt(i,r[S],r[E]),S--,g++;else if(d===void 0&&(d=bn(u,g,v),$=bn(o,E,S)),!d.has(o[E]))Lt(r[E]),E++;else if(!d.has(o[S]))Lt(r[S]),S--;else{const b=$.get(u[g]),x=b!==void 0?r[b]:null;if(x===null){const W=_n(i,r[E]);ae(W,l[g]),c[g]=W}else c[g]=ae(x,l[g]),Tt(i,x,r[E]),r[b]=null;g++}for(;g<=v;){const b=_n(i,c[v+1]);ae(b,l[g]),c[g++]=b}for(;E<=S;){const b=r[E++];b!==null&&Lt(b)}Pn.set(i,c),Cn.set(i,u)}});/**
|
|
147
|
+
* @license
|
|
148
|
+
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
149
|
+
* This code may only be used under the BSD style license found at
|
|
150
|
+
* http://polymer.github.io/LICENSE.txt
|
|
151
|
+
* The complete set of authors may be found at
|
|
152
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
153
|
+
* The complete set of contributors may be found at
|
|
154
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
155
|
+
* Code distributed by Google as part of the polymer project is also
|
|
156
|
+
* subject to an additional IP rights grant found at
|
|
157
|
+
* http://polymer.github.io/PATENTS.txt
|
|
158
|
+
*/const kt=new WeakMap,Ln=Q((t,e)=>n=>{const s=kt.get(n);if(Array.isArray(t)){if(Array.isArray(s)&&s.length===t.length&&t.every((i,r)=>i===s[r]))return}else if(s===t&&(t!==void 0||kt.has(n)))return;n.setValue(e()),kt.set(n,Array.isArray(t)?Array.from(t):t)});/**
|
|
159
|
+
* @license
|
|
160
|
+
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
161
|
+
* This code may only be used under the BSD style license found at
|
|
162
|
+
* http://polymer.github.io/LICENSE.txt
|
|
163
|
+
* The complete set of authors may be found at
|
|
164
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
165
|
+
* The complete set of contributors may be found at
|
|
166
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
167
|
+
* Code distributed by Google as part of the polymer project is also
|
|
168
|
+
* subject to an additional IP rights grant found at
|
|
169
|
+
* http://polymer.github.io/PATENTS.txt
|
|
170
|
+
*/const $t=new WeakMap,Nt=Q(t=>e=>{const n=$t.get(e);if(t===void 0&&e instanceof wt){if(n!==void 0||!$t.has(e)){const s=e.committer.name;e.committer.element.removeAttribute(s)}}else t!==n&&e.setValue(t);$t.set(e,t)});var kn=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},f=(t,e,n)=>(kn(t,e,"read from private field"),n?n.call(t):e.get(t)),C=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},J=(t,e,n,s)=>(kn(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),ge,oe,Me,Oe,X,Y,Be,Ke,Mt,Ot,At,Fe,Rt,ze,ee,Gt,Je;function ws(){}function Ht(t){typeof t=="function"&&t()}const Qe=new Et,It=(t=performance.now())=>{if(performance.now()>t+16)return requestAnimationFrame(It);const e=Qe.get();e&&(e(),It(t))};Qe.addEventListener("start",()=>H(It));const Ze=Symbol("init"),$n=Symbol("update");class R extends HTMLElement{constructor({isAsync:e,isLight:n,delegatesFocus:s}={}){super();C(this,ge,void 0),C(this,oe,void 0),C(this,Me,void 0),C(this,Oe,void 0),C(this,X,void 0),C(this,Y,void 0),C(this,Be,void 0),this.setState=r=>{if(!this.state)throw new K("`state` not initialized");Object.assign(this.state,r),H(f(this,ee))},C(this,Ke,r=>{r==null||r.forEach(o=>{const{callback:c,getDep:l,values:u,preCallback:p}=o,d=l==null?void 0:l();(!l||!u||_t(u,d))&&(Ht(p),o.preCallback=c(d,u),o.values=d)})}),C(this,Mt,()=>{f(this,Ke).call(this,f(this,X))}),C(this,Ot,()=>{f(this,Ke).call(this,f(this,Y))}),this.effect=(r,o)=>{f(this,X)||J(this,X,[]);const c={callback:r,getDep:o,values:void 0,initialized:!!this.isConnected};this.isConnected&&(c.values=o==null?void 0:o(),c.preCallback=r(c.values)),f(this,X).push(c)},this.memo=(r,o)=>{f(this,Y)||J(this,Y,[]),f(this,Y).push({callback:r,getDep:o,values:[Symbol()],initialized:this.isConnected})},C(this,At,()=>{var r;(r=f(this,X))==null||r.forEach(o=>{const{callback:c,getDep:l,initialized:u}=o;u||(o.values=l==null?void 0:l(),o.preCallback=c(o.values),o.initialized=!0)})}),C(this,Fe,()=>{var o,c;f(this,Ot).call(this);const r=a.useNativeCSSStyleSheet?"":M`${(c=(o=this.shadowRoot)==null?void 0:o.adoptedStyleSheets)==null?void 0:c.map(l=>M`
|
|
171
|
+
<style media=${l.media.mediaText}>
|
|
172
|
+
${l.style}
|
|
173
|
+
</style>
|
|
174
|
+
`)}`;return this.render?M`${this.render()}${r}`:f(this,ge)===this?void 0:M`<slot></slot>${r}`}),C(this,Rt,()=>this.shouldUpdate?this.shouldUpdate():!0),C(this,ze,()=>{if(this.isConnected&&f(this,Rt).call(this)){const r=f(this,Fe).call(this);r!==void 0&&Ue(r,f(this,ge)),H(f(this,Gt)),H(f(this,Mt))}}),C(this,ee,()=>{f(this,Oe)?Qe.add(f(this,ze)):f(this,ze).call(this)}),this.update=()=>{H(f(this,ee))},C(this,Gt,()=>{var r;(r=this.updated)==null||r.call(this)}),C(this,Je,()=>{var l,u,p;if(f(this,Me)){J(this,Me,!1);return}(l=this.willMount)==null||l.call(this);const{observedStores:r,rootElement:o}=this.constructor;r==null||r.forEach(d=>{re(d,f(this,ee))});const c=f(this,Fe).call(this);if(c!==void 0&&Ue(c,f(this,ge)),J(this,Be,(u=this.mounted)==null?void 0:u.call(this)),f(this,At).call(this),o&&((p=this.getRootNode().host)==null?void 0:p.tagName)!==o.toUpperCase())throw new K("not allow current root type")}),H(()=>this[Ze]=!1),this[Ze]=!0,this[$n]=()=>{this.isConnected&&H(f(this,ee))},J(this,Oe,e),J(this,ge,n?this:this.attachShadow({mode:"open",delegatesFocus:s}));const{adoptedStyleSheets:i}=new.target;if(i){const r=i.map(o=>o[xe]||o);this.shadowRoot?this.shadowRoot.adoptedStyleSheets=r:this.effect(()=>{const o=this.getRootNode();if(a.useNativeCSSStyleSheet)return o.adoptedStyleSheets=[...o.adoptedStyleSheets,...r],()=>{o.adoptedStyleSheets=bt(o.adoptedStyleSheets,r)};{const c=o===document?document.body:o;return c._sheets=c._sheets||{},r.forEach(({style:l,media:u})=>{if(c._sheets[l])c._sheets[l].count++;else{const p=document.createElement("style");p.innerHTML=l,p.media=u.mediaText,c.append(p),c._sheets[l]={ele:p,count:1}}}),()=>{r.forEach(({style:l})=>{c._sheets[l].count--,c._sheets[l].count||delete c._sheets[l]})}}},()=>[])}}get internals(){if(!f(this,oe)){const e=()=>{const n=s=>s.replace(/-/g,"");return{has:s=>n(s)in this.dataset,add:s=>{this.dataset[n(s)]=""},delete:s=>delete this.dataset[n(s)]}};this.attachInternals||(this.attachInternals=()=>({states:e()})),J(this,oe,this.attachInternals()),f(this,oe).states||(f(this,oe).states=e())}return f(this,oe)}attributeChangedCallback(){this.isConnected&&H(f(this,ee))}closestElement(e){const n=typeof e=="function",s=typeof e=="string"&&e.toUpperCase(),i=r=>{const o=r.parentElement||r.getRootNode().host;if(!o)return null;if(n){if(o.constructor===e)return o}else if(o.tagName===s)return o;return i(o)};return i(this)}connectedCallback(){f(this,Oe)?Qe.add(f(this,Je)):f(this,Je).call(this)}disconnectedCallback(){var n,s,i;if(this.isConnected){J(this,Me,!0);return}const{observedStores:e}=this.constructor;e==null||e.forEach(r=>{Ct(r,f(this,ee))}),Ht(f(this,Be)),(n=this.unmounted)==null||n.call(this),(s=f(this,X))==null||s.forEach(r=>{Ht(r.preCallback)}),J(this,Y,(i=f(this,Y))==null?void 0:i.filter(({initialized:r})=>!r))}}ge=new WeakMap,oe=new WeakMap,Me=new WeakMap,Oe=new WeakMap,X=new WeakMap,Y=new WeakMap,Be=new WeakMap,Ke=new WeakMap,Mt=new WeakMap,Ot=new WeakMap,At=new WeakMap,Fe=new WeakMap,Rt=new WeakMap,ze=new WeakMap,ee=new WeakMap,Gt=new WeakMap,Je=new WeakMap;const Xe=new St;function Ye(t,e,n){const{booleanAttributes:s,numberAttributes:i}=t.constructor;Object.defineProperty(t,e,{configurable:!0,get(){if(!(Ze in this))return;const o=this.getAttribute(n);return(s==null?void 0:s.has(n))?o!==null:(i==null?void 0:i.has(n))?Number(o):o||""},set(r){const o=this,c=Xe.get(this),l=c[e],u=o.getAttribute(n);if(this[Ze]&&u!==null&&!l)return;c[e]=!0;const p=s==null?void 0:s.has(n);r==null?o.removeAttribute(n):p?o.toggleAttribute(n,!!r):u!==String(r)&&o.setAttribute(n,String(r))}})}const Nn=Symbol("event handle");function ye(t,e,n,s){Object.defineProperty(t,e,{configurable:!0,get(){const i=Xe.get(this)[e];return i||!n?i:(this[e]=ws,this[e])},set(i){const r=this,o=Xe.get(r);i!==o[e]&&(n?(o[e]=(i==null?void 0:i[Nn])?i:(c,l)=>{const u=new CustomEvent(n,je(T(T({},l),s),{detail:c}));r.dispatchEvent(u),i(c,l)},o[e][Nn]=!0):(o[e]=i,this[$n]()))}})}function et(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){const s=Xe.get(this);let i=s[e];if(!i){const r=this,o=r.shadowRoot||r;i={get ref(){return n},get element(){const c=[...o.querySelectorAll("gem-reflect")].map(l=>l.target);for(const l of[o,...c]){const u=l.querySelector(`[ref=${n}]`);if(u)return u}}},s[e]=i}return i}})}function tt(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){var r;const s=this,{states:i}=s.internals;return(r=i.has)==null?void 0:r.call(i,n)},set(s){const i=this,{states:r}=i.internals;s?r.add(n):r.delete(n)}})}const nt=customElements.define.bind(customElements);customElements.define=(t,e,n)=>{if(e.prototype instanceof R){const{observedAttributes:s,observedPropertys:i,defineEvents:r,defineCSSStates:o,defineRefs:c}=e;s==null||s.forEach(l=>Ye(e.prototype,pe(l),l)),i==null||i.forEach(l=>ye(e.prototype,l)),r==null||r.forEach(l=>ye(e.prototype,pe(l),l)),o==null||o.forEach(l=>tt(e.prototype,pe(l),`--${l}`)),c==null||c.forEach(l=>et(e.prototype,pe(l),l))}nt(t,e,n)};function j(t,e,n,s=!1){const i=t.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"](n)}function Mn(t,e){const n=`${I(e)}-${$e()}`;j(t,"defineRefs",n),et(t,e,n)}function Vt(t,e,n){j(t,"observedAttributes",n),Ye(t,e,n)}function L(t,e){Vt(t,e,I(e))}function On(t,e){const n=I(e);j(t,"booleanAttributes",n,!0),Vt(t,e,n)}function An(t,e){const n=I(e);j(t,"numberAttributes",n,!0),Vt(t,e,n)}function U(t,e){j(t,"observedPropertys",e),ye(t,e)}function Ae(t,e){const n=I(e);j(t,"defineCSSStates",n),tt(t,e,`--${n}`)}function Rn(t,e){const n=I(t[e]||e);t[e]=n,j(t instanceof R?t:t.prototype,"defineSlots",n)}function Wt(t,e){const n=I(t[e]||e);t[e]=n,j(t instanceof R?t:t.prototype,"defineParts",n)}function Re(t,e){Hn(t,e)}function Gn(t,e){Hn(t,e,{bubbles:!0,composed:!0})}function Hn(t,e,n){const s=I(e);j(t,"defineEvents",s),ye(t,e,s,n)}function In(t){return function(e){j(e.prototype,"adoptedStyleSheets",t)}}function ce(t){return function(e){j(e.prototype,"observedStores",t)}}function Vn(t){return function(e){const n=e;n.rootElement=t}}function z(t){return function(e){nt(t,e)}}const h=window.history,V=window.location,Wn=h.pushState.bind(h),Dn=h.replaceState.bind(h);let Es=0;const Dt=()=>`${performance.now()}-${++Es}`,_=F({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),O=new Map;function jn({$key:t,$hasCloseHandle:e,$hasOpenHandle:n,$hasShouldCloseHandle:s}={}){if(_.$key!==t){if(t)throw new K("`$key` is not allowed");if(e)throw new K("`$hasCloseHandle` is not allowed");if(n)throw new K("`$hasOpenHandle` is not allowed");if(s)throw new K("`$hasShouldCloseHandle` is not allowed")}}function Un(t){return h.basePath?h.basePath+t:t}function qn(t){return t===h.basePath?"/":t.replace(new RegExp(`^${h.basePath}/`),"/")}function st(t){const e=O.get(_.$key)||{},n=t.path?qe(e.path,t.path):qn(V.pathname),s=new fe(t.query||(t.path?"":V.search)),i=t.path&&t.path!==e.path||t.query&&String(t.query)!==String(e.query),r=t.title||(i?"":document.title),o=t.close||t.data||t.open||t.shouldClose,c=t.hash||(!i&&o?decodeURIComponent(V.hash):"");return je(T({},t),{title:r,path:n,query:s,hash:c})}function xn(t,e){jn(e.data);const n=st(e),{title:s,path:i,query:r,hash:o,close:c,open:l,shouldClose:u,data:p}=n,d=T({$hasCloseHandle:!!c,$hasOpenHandle:!!l,$hasShouldCloseHandle:!!u,$key:Dt()},p);O.set(d.$key,n),P(Ne(_),d);const $=Un(i)+new fe(r)+o,E=decodeURIComponent(V.hash);(t==="push"?Wn:Dn)(d,s,$),E!==o&&window.dispatchEvent(new CustomEvent("hashchange"))}function Bn(t,e,n,s){jn(e);const i=T({$key:Dt()},e||{}),{pathname:r,search:o,hash:c}=new URL(s,V.origin+V.pathname),l=st({path:r,query:new fe(o),hash:c,title:n,data:e});O.set(i.$key,l),P(Ne(_),i);const u=Un(r)+l.query+c,p=V.hash;(t==="push"?Wn:Dn)(i,n,u),p!==c&&window.dispatchEvent(new CustomEvent("hashchange"))}const Ge=F({basePath:""});if(window.addEventListener("hashchange",({isTrusted:t})=>{t&&h.replace({hash:decodeURIComponent(V.hash)})}),Object.defineProperties(h,{basePath:{get(){return Ge.basePath},set(t){P(Ge,{basePath:t}),Object.assign(O.get(_.$key),{path:qn(V.pathname)})}},getParams:{value:function(){return O.get(_.$key)}},updateParams:{value:function(t){Object.assign(O.get(_.$key),t),P(_,{})}},store:{value:_},push:{value:function(t){h.pushState(t,"")}},pushIgnoreCloseHandle:{value:function(t){var e,n;_.$hasCloseHandle?((n=(e=O.get(_.$key))==null?void 0:e.close)==null||n.call(e),h.replace(t)):h.push(t)}},replace:{value:function(t){xn("replace",t)}}}),h.pushState=function(t,e,n){n?Bn("push",t,e,n):xn("push",t)},h.replaceState=function(t,e,n){Bn("replace",t,e,n)},h.state)if(h.state.$hasCloseHandle){P(_,h.state);const t=st({title:document.title});O.set(_.$key,t),h.back()}else{const t=st({title:document.title,hash:V.hash});P(_,T({$key:Dt()},h.state||{})),O.set(_.$key,t)}else{const{pathname:t,search:e,hash:n}=V;h.replace({path:t,query:e,hash:n})}const q=F({title:""});re(q,()=>{const t=O.get(_.$key);t&&(t.title=q.title)}),re(_,()=>{const{title:t}=h.getParams();t!==q.title&&P(q,{title:t})});let it=!1;window.addEventListener("popstate",t=>{var s,i;const e=t.state;if(!(e==null?void 0:e.$key))return;if(it){it=!1;return}if(!O.has(e.$key)){const{pathname:r,search:o,hash:c}=V;O.set(e.$key,{path:r,query:new fe(o),hash:c,title:document.title,data:e})}const n=_;if(parseFloat(e.$key)>parseFloat(n.$key)&&e.$hasOpenHandle)(i=(s=O.get(e.$key))==null?void 0:s.open)==null||i.call(s);else if(n.$hasCloseHandle){const r=O.get(n.$key),o=r==null?void 0:r.close,c=r==null?void 0:r.shouldClose;if(c&&!c()){it=!0,h.forward();return}else o?o():e.$hasCloseHandle&&(it=!0,h.back())}P(Ne(_),e)});var Ss=Object.defineProperty,vs=Object.getOwnPropertyDescriptor,te=(t,e,n,s)=>{for(var i=s>1?void 0:s?vs(e,n):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(s?o(e,n,i):o(i))||i);return s&&i&&Ss(e,n,i),i},Kn=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},He=(t,e,n)=>(Kn(t,e,"read from private field"),n?n.call(t):e.get(t)),jt=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Fn=(t,e,n,s)=>(Kn(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),Ie,rt,at;class _s extends RegExp{constructor(e){const n={};let s=0;super(`^${e.replace(/:([^/$]+)/g,(i,r)=>(n[r]=s++,"([^/]+)")).replace("*",".*")}$`,"i");this.namePosition=n}}function Ut(t,e){const n=new _s(t),s=e.match(n)||`${e}/`.match(n);if(!s)return null;const i={};return s&&Object.keys(n.namePosition).forEach(r=>{i[r]=s[n.namePosition[r]+1]}),i}function qt(t,e){let n=t.pattern;const s=e==null?void 0:e.params;return s&&Object.keys(s).forEach(i=>{n=n.replace(new RegExp(`:${i}`,"g"),s[i])}),n}function zn(t,e){const n=qt(t,e);return T({path:n},e)}a.GemRouteElement=class extends R{constructor({isLight:t,routes:e}={}){super({isLight:t});this.currentParams={},jt(this,Ie,void 0),this.state={content:void 0},jt(this,rt,()=>{if(this.locationStore){const{path:n,query:s,data:i}=h.getParams();P(this.locationStore,{path:n,params:this.currentParams,query:s,data:i})}}),jt(this,at,(n,s,i)=>{Fn(this,Ie,void 0),this.currentRoute=n,this.currentParams=s,this.setState({content:i}),this.routechange(this.currentRoute);const r=n==null?void 0:n.title;r&&P(q,{title:r}),He(this,rt).call(this)}),this.routes=e}mounted(){this.effect(([t,e],n)=>{if(n&&t===n[0]&&e===n[1]){He(this,rt).call(this);return}const{route:s,params:i={}}=a.GemRouteElement.findRoute(this.routes,e),{redirect:r,content:o,getContent:c}=s||{};if(r){h.replace({path:r});return}const l=o||(c==null?void 0:c(i));if(l instanceof Promise){this.loading(s),Fn(this,Ie,l);const u=()=>He(this,Ie)===l;l.then(p=>{u()&&He(this,at).call(this,s,i,p)}).catch(p=>{u()&&this.error(p)});return}He(this,at).call(this,s,i,l)},()=>{const{path:t}=h.getParams();return[this.key,t,location.search]})}shouldUpdate(){return!this.inert}render(){const{content:t}=this.state;return this.shadowRoot?M`
|
|
175
|
+
<style>
|
|
176
|
+
:host,
|
|
177
|
+
:not(:defined) {
|
|
178
|
+
display: contents;
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
181
|
+
${t!=null?t:M`<slot></slot>`}
|
|
182
|
+
`:M`${t}`}},Ie=new WeakMap,rt=new WeakMap,at=new WeakMap,a.GemRouteElement.createLocationStore=()=>{const{path:t,query:e,data:n}=h.getParams();return F({path:t,query:e,data:n,params:{}})},a.GemRouteElement.findRoute=(t=[],e)=>{let n=null,s;t instanceof Array?s=t:s=Object.values(t);for(const i of s)if(i.pattern==="*")n=i;else{const r=Ut(i.pattern,e);if(r)return{route:i,params:r}}return{route:n}},te([U],a.GemRouteElement.prototype,"routes",2),te([U],a.GemRouteElement.prototype,"locationStore",2),te([U],a.GemRouteElement.prototype,"key",2),te([Re],a.GemRouteElement.prototype,"routechange",2),te([Re],a.GemRouteElement.prototype,"loading",2),te([Re],a.GemRouteElement.prototype,"error",2),a.GemRouteElement=te([ce(h.store),z("gem-route")],a.GemRouteElement),a.GemLightRouteElement=class extends a.GemRouteElement{constructor(t={}){super(je(T({},t),{isLight:!0}))}},a.GemLightRouteElement=te([z("gem-light-route")],a.GemLightRouteElement);var bs=Object.defineProperty,Ps=Object.getOwnPropertyDescriptor,k=(t,e,n,s)=>{for(var i=s>1?void 0:s?Ps(e,n):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(s?o(e,n,i):o(i))||i);return s&&i&&bs(e,n,i),i};a.GemLinkElement=class extends R{constructor(){super();this.clickHandle=async t=>{var r;const e=this.getPathInfo();if(!e)return;if(this.isExternal(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:n,query:s,hash:i}=h.getParams();if(n+s+i!==e)if(t.stopPropagation(),await((r=this.prepare)==null?void 0:r.call(this)),this.route)h.pushIgnoreCloseHandle(je(T({},zn(this.route,this.options)),{title:this.route.title||this.docTitle}));else if(this.href){const{pathname:o,search:c,hash:l}=new URL(e,location.origin);h.pushIgnoreCloseHandle({path:o,query:c,hash:l,title:this.docTitle})}else h.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash,title:this.docTitle})},this.preventDefault=t=>{t.preventDefault()},this.addEventListener("click",this.clickHandle)}getPathInfo(){var t,e;if(this.route){const n=((t=this.options)==null?void 0:t.query)||"",s=((e=this.options)==null?void 0:e.hash)||"";return qt(this.route,this.options)+n+s}else{const n=this.href||this.path+this.query+this.hash,{path:s,query:i}=h.getParams();return n.startsWith("#")?`${s}${i}${n}`:n.startsWith("?")?`${s}${n}`:n.startsWith(".")?qe(s,n):n}}isExternal(t){return!t.startsWith("/")}render(t=this.getPathInfo()){return M`
|
|
183
|
+
<style>
|
|
184
|
+
:host {
|
|
185
|
+
/* link default style */
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
color: blue;
|
|
188
|
+
text-decoration: underline;
|
|
189
|
+
}
|
|
190
|
+
a {
|
|
191
|
+
all: unset;
|
|
192
|
+
display: contents;
|
|
193
|
+
}
|
|
194
|
+
a:visited {
|
|
195
|
+
color: unset;
|
|
196
|
+
}
|
|
197
|
+
</style>
|
|
198
|
+
<a
|
|
199
|
+
part=${this.link}
|
|
200
|
+
@click=${this.preventDefault}
|
|
201
|
+
href=${Nt(this.hint==="off"?void 0:this.isExternal(t)?t:new URL(h.basePath+t,location.origin).toString())}
|
|
202
|
+
>
|
|
203
|
+
<slot></slot>
|
|
204
|
+
</a>
|
|
205
|
+
`}},k([L],a.GemLinkElement.prototype,"href",2),k([L],a.GemLinkElement.prototype,"target",2),k([L],a.GemLinkElement.prototype,"path",2),k([L],a.GemLinkElement.prototype,"query",2),k([L],a.GemLinkElement.prototype,"hash",2),k([L],a.GemLinkElement.prototype,"docTitle",2),k([L],a.GemLinkElement.prototype,"hint",2),k([U],a.GemLinkElement.prototype,"route",2),k([U],a.GemLinkElement.prototype,"options",2),k([U],a.GemLinkElement.prototype,"prepare",2),k([Wt],a.GemLinkElement.prototype,"link",2),a.GemLinkElement=k([z("gem-link"),ce(Ge)],a.GemLinkElement),a.GemActiveLinkElement=class extends a.GemLinkElement{render(){const{path:t,query:e,hash:n}=h.getParams(),s=this.pattern&&Ut(this.pattern,t),i=this.getPathInfo();return s||t+e+n===i?this.active=!0:this.active=!1,super.render(i)}},k([L],a.GemActiveLinkElement.prototype,"pattern",2),k([Ae],a.GemActiveLinkElement.prototype,"active",2),a.GemActiveLinkElement=k([z("gem-active-link"),ce(h.store)],a.GemActiveLinkElement);var Cs=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,Jn=(t,e,n,s)=>{for(var i=s>1?void 0:s?Ts(e,n):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(s?o(e,n,i):o(i))||i);return s&&i&&Cs(e,n,i),i};a.GemTitleElement=class extends R{static setTitle(t){P(q,{title:t})}static updateTitle(t="",e=""){const{title:n}=q;n&&n!==a.GemTitleElement.defaultTitle?(a.GemTitleElement.title=n,document.title=a.GemTitleElement.title+e):t?(a.GemTitleElement.title=t,document.title=a.GemTitleElement.title+e):(a.GemTitleElement.title=a.GemTitleElement.defaultTitle,document.title=a.GemTitleElement.title)}constructor(){super();new MutationObserver(()=>this.update()).observe(this,{childList:!0,characterData:!0,subtree:!0})}render(){return a.GemTitleElement.updateTitle(this.textContent||"",this.suffix),this.hidden?M``:M`${a.GemTitleElement.title}`}},a.GemTitleElement.title=document.title,a.GemTitleElement.defaultTitle=document.title,a.GemTitleElement.defaultSuffix=` - ${document.title}`,Jn([L],a.GemTitleElement.prototype,"suffix",2),a.GemTitleElement=Jn([ce(q),z("gem-title")],a.GemTitleElement),re(q,a.GemTitleElement.updateTitle);var Ls=Object.defineProperty,ks=Object.getOwnPropertyDescriptor,Ve=(t,e,n,s)=>{for(var i=s>1?void 0:s?ks(e,n):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(s?o(e,n,i):o(i))||i);return s&&i&&Ls(e,n,i),i};const Qn=new Map;a.GemUseElement=class extends R{getContent(){const t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if(typeof t=="string"){let e=Qn.get(t);return e||(e=document.createElement("template"),e.innerHTML=t,Qn.set(t,e)),e.content.cloneNode(!0)}else return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t==null?void 0:t.cloneNode(!0)}render(){return M`
|
|
206
|
+
<style>
|
|
207
|
+
:host {
|
|
208
|
+
position: relative;
|
|
209
|
+
}
|
|
210
|
+
:host(:not([hidden])) {
|
|
211
|
+
display: inline-flex;
|
|
212
|
+
align-items: center;
|
|
213
|
+
}
|
|
214
|
+
svg {
|
|
215
|
+
width: 100%;
|
|
216
|
+
height: 100%;
|
|
217
|
+
}
|
|
218
|
+
</style>
|
|
219
|
+
${this.getContent()}
|
|
220
|
+
<slot></slot>
|
|
221
|
+
`}},Ve([L],a.GemUseElement.prototype,"selector",2),Ve([U],a.GemUseElement.prototype,"root",2),Ve([U],a.GemUseElement.prototype,"element",2),Ve([Ae],a.GemUseElement.prototype,"active",2),a.GemUseElement=Ve([z("gem-use")],a.GemUseElement);var $s=Object.defineProperty,Ns=Object.getOwnPropertyDescriptor,xt=(t,e,n,s)=>{for(var i=s>1?void 0:s?Ns(e,n):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(s?o(e,n,i):o(i))||i);return s&&i&&$s(e,n,i),i};a.GemUnsafeElement=class extends R{constructor(){super();this.effect(()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=`
|
|
222
|
+
<style>
|
|
223
|
+
:host {
|
|
224
|
+
display: contents;
|
|
225
|
+
}
|
|
226
|
+
${this.contentcss}
|
|
227
|
+
</style>
|
|
228
|
+
${this.content}
|
|
229
|
+
`)},()=>[this.content,this.contentcss])}render(){}},xt([L],a.GemUnsafeElement.prototype,"content",2),xt([L],a.GemUnsafeElement.prototype,"contentcss",2),a.GemUnsafeElement=xt([z("gem-unsafe")],a.GemUnsafeElement);var Ms=Object.defineProperty,Os=Object.getOwnPropertyDescriptor,Zn=(t,e,n,s)=>{for(var i=s>1?void 0:s?Os(e,n):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(s?o(e,n,i):o(i))||i);return s&&i&&Ms(e,n,i),i};document.querySelectorAll("[data-reflect]").forEach(t=>t.remove()),a.GemReflectElement=class extends R{constructor(){super({isLight:!0});this.target=document.head,this.hidden=!0,this.effect(()=>{const t=[...this.childNodes];return t.forEach(e=>{e instanceof HTMLElement&&(e.dataset.reflect=""),this.target.append(e)}),()=>{t.forEach(e=>e.remove())}},()=>[this.target])}},Zn([U],a.GemReflectElement.prototype,"target",2),a.GemReflectElement=Zn([z("gem-reflect")],a.GemReflectElement);const ot=Symbol("open mark");function As(t){var e;return e=class extends R{constructor(){super();this.label="",this.internals.role="alertdialog",this.internals.ariaModal="true"}static get isOpen(){return this.store[ot]}static get observedStores(){return[h.store,this.store]}static open(n){const s=new this;this.instance=s,this.inertStore=[...document.body.children].filter(r=>!r.inert),this.inertStore.forEach(r=>r.inert=!0),document.body.append(s);const i=()=>P(this.store,T({[ot]:!0},n));setTimeout(()=>{i(),h.push({title:s.label,open:i,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100)}static close(){h.back()}static closeHandle(){var n;this.inertStore.forEach(s=>s.inert=!1),(n=this.instance)==null||n.remove(),P(this.store,T({[ot]:!1},t))}static shouldClose(){return!0}},e.inertStore=[],e.instance=null,e.store=F(T({[ot]:!1},t)),e}var Rs=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,Bt=(t,e,n,s)=>{for(var i=s>1?void 0:s?Gs(e,n):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(s?o(e,n,i):o(i))||i);return s&&i&&Rs(e,n,i),i};a.DialogBaseElement=(ss=class extends R{constructor(){super();N(this,Se,void 0);N(this,ve,void 0);N(this,he,void 0);this.inert=!0,G(this,he,[]),this.closeHandle=()=>{var t;this.inert=!0,y(this,he).forEach(e=>e.inert=!1),y(this,Se)?y(this,Se).before(this):y(this,ve)&&((t=y(this,ve))==null||t.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1},this.openHandle=()=>{this.hidden=!1,this.inert=!1,G(this,Se,this.nextSibling),G(this,ve,this.parentElement||this.getRootNode()),G(this,he,[...document.body.children].filter(t=>!t.inert)),y(this,he).forEach(t=>t.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0},this.open=()=>{this.opened||(this.openHandle(),h.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}))},this.close=()=>{h.back()},this.forceClose=()=>{this.opened=!1,setTimeout(this.close,100)},this.internals.role="dialog",this.internals.ariaModal="true"}shouldClose(){return!0}},Se=new WeakMap,ve=new WeakMap,he=new WeakMap,ss),Bt([L],a.DialogBaseElement.prototype,"label",2),Bt([Ae],a.DialogBaseElement.prototype,"opened",2),a.DialogBaseElement=Bt([ce(h.store)],a.DialogBaseElement);const Kt=new WeakMap;function Xn(t){return Kt.get(t)}const Ft=new WeakMap;function Hs(t){return Ft.get(t)}function Is(t,e){const n=Kt.get(e),s=Ft.get(e),i=Object.keys(n).reduce((r,o)=>n[o]?r+`${s[o]}:${n[o]};`:r,"");t.textContent=`:root, :host {${i}}`}function Vs(t){const e=$e(),n=document.createElement("style"),s=F(t),i={},r={};Ft.set(i,r),Kt.set(i,s),Object.keys(s).forEach(c=>{r[c]=`--${I(c)}-${e}`,i[c]=`var(${r[c]})`});const o=()=>Is(n,i);return re(s,o),o(),(document.head||document.documentElement).append(n),i}function Ws(t,e){const n=Xn(t);P(n,e)}const Ds=/\$\d(?:<[^>]*>)?/,js=/\$(\d)(<([^>]*)>)?/g,Us=3;function Yn(t,...e){const n=t.split(Ds),s=[];let i;for(;i=js.exec(t);){const r=i[Us],o=Number(i[1])-1,c=e[o];s.push(typeof c=="string"?c:c(r))}return M(n,...s)}const We=new Set,zt=class{constructor(e){N(this,_e);N(this,lt);N(this,ht);N(this,ue);N(this,be);if(this.cachePrefix="gem-i18n",!e.resources[e.fallbackLanguage])throw new K("i18n: fallbackLanguage invalid");this.store=F(this),Object.assign(this,e);let n=y(this,lt,ti)||this.currentLanguage||y(this,ht,ni);const s=document.querySelector(`[type*=${this.cachePrefix}]`);if(s)try{const i=JSON.parse(s.textContent||"");n=i.currentLanguage,this.resources[i.currentLanguage]=i.currentLanguagePack}catch{}n?(G(this,be,n,Xt),this.setLanguage(n)):this.resetLanguage()}get(e,...n){const s=this.resources[this.currentLanguage],i=this.resources[this.fallbackLanguage],r=s[e]||i[e],o=(r==null?void 0:r.message)||r||`[${e}]`;return n.length?Yn(o,...n):o}detectLanguage(){const e=Object.keys(this.resources),n=navigator.languages.map(s=>s.replace(/-(.*)/,i=>i.toUpperCase()));for(const s of n){const i=e.find(r=>r===s||s.startsWith(`${r}-`));if(i)return i}return this.fallbackLanguage}async setLanguage(e){y(this,ue,dt)&&We.forEach(async i=>await i.setLanguage(e));let n;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}`,o=localStorage.getItem(r),c=async()=>{const l=await(await fetch(s)).json();if(this.cache){for(let u=0;u<localStorage.length;u++){const p=localStorage.key(u);p.startsWith(i)&&localStorage.removeItem(p)}localStorage.setItem(r,JSON.stringify(l))}return l};if(o)try{n=JSON.parse(o)}catch{n=await c()}else n=await c()}else n=s;return this.resources[e]=n,P(this.store,{}),e!==this.currentLanguage&&G(this,be,e,Xt),this.cache===!0&&this.setCache(),e}resetLanguage(){return y(this,ue,dt)&&We.forEach(e=>e.resetLanguage()),G(this,be,this.fallbackLanguage,Xt),this.cache&&localStorage.removeItem(y(this,_e,Zt)),this.setLanguage(this.detectLanguage())}setCache(){y(this,ue,dt)&&We.forEach(e=>e.setCache()),localStorage.setItem(y(this,_e,Zt),this.currentLanguage)}createSubModule(e,n){const s=new zt({resources:n,cachePrefix:`${this.cachePrefix}-${e}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return We.add(s),s}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}};let es=zt;_e=new WeakSet,Zt=function(){return`${this.cachePrefix}:current`},lt=new WeakSet,ti=function(){const{hostname:e,pathname:n,search:s}=location,i=e.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return n.split("/")[1];default:const r=this.urlParamsName&&new URLSearchParams(s).get(this.urlParamsName)||"";return r in this.resources?r:""}},ht=new WeakSet,ni=function(){return this.cache&&localStorage.getItem(y(this,_e,Zt))||""},ue=new WeakSet,dt=function(){return!We.has(this)},be=new WeakSet,Xt=function(e){var n;y(this,ue,dt)&&(document.documentElement.lang=e),this.currentLanguage=e,(n=this.onChange)==null||n.call(this,e)};const qs={credentials:"include",mode:"cors"};async function De(t,e={}){const n=await fetch(t,T(T({},qs),e));if(n.status===0)throw new Error("Request fail");if(n.status>=500)throw new Error(n.statusText);if(n.status>=400)throw new Error(await n.text()||n.statusText);return await n.json()}const xs=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array));function ts(t){return t instanceof FormData||t instanceof Blob||t instanceof xs||t instanceof URLSearchParams||t instanceof ReadableStream||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t}function Bs(t,e){const{origin:n,pathname:s,search:i}=new URL(t,location.origin),r=new URLSearchParams(e).toString();return De(`${n}${s}${i?`${i}&`:r?"?":""}${r}`,{method:"GET"})}function Ks(t){return De(t,{method:"DELETE"})}function Fs(t,e){return De(t,{method:"PUT",body:ts(e)})}function zs(t,e){return De(t,{method:"POST",body:ts(e)})}const A=t=>window.matchMedia(t).matches,Js={PRINT:"print",get isPrint(){return A(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return A(this.HOVER)},PHONE:"(min-width: 319px) and (max-width: 480px)",get isPhone(){return A(this.PHONE)},LAPTOP:"(min-width: 1023px) and (max-width: 1280px) and (orientation: landscape)",get isLaptop(){return A(this.LAPTOP)},DESKTOP:"(min-width: 1279px) and (orientation: landscape)",get isDesktop(){return A(this.DESKTOP)},WIDTHSCREEN:"(min-width: 1919px) and (orientation: landscape)",get isWidthScreen(){return A(this.WIDTHSCREEN)},PHONE_LANDSCAPE:"(min-width: 479px) and (max-width: 767px) and (orientation: landscape)",get isPhoneLandscape(){return A(this.PHONE_LANDSCAPE)},TABLET:"(min-width: 768px) and (max-width: 1024px)",get isTablet(){return A(this.TABLET)},SMALL_PHONE:"(min-width: 319px) and (max-width: 480px) and (max-height: 640px)",get isSmallPhone(){return A(this.SMALL_PHONE)},WATCH:"(max-width: 319px)",get isWatch(){return A(this.WATCH)},SHORT:"(min-width: 479px) and (max-height: 320px)",get isShort(){return A(this.SHORT)},PWA:"(display-mode: standalone)",get isPWA(){return A(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return A(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return A(this.DATA_REDUCE)}},ns="1.6.5";window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,T({},m)),a.GemElement=R,a.GemError=K,a.I18n=es,a.LinkedList=Et,a.PropProxyMap=St,a.QueryString=fe,a.SVGTemplateResult=pt,a.SheetToken=xe,a.StoreListenerMap=ie,a.TemplateResult=Te,a.absoluteLocation=qe,a.addMicrotask=H,a.addMicrotaskToStack=mn,a.adoptedStyle=In,a.attribute=L,a.basePathStore=Ge,a.boolattribute=On,a.camelToKebabCase=I,a.classMap=Pt,a.cleanObject=Ne,a.connect=re,a.connectStore=ce,a.createCSSSheet=gn,a.createHistoryParams=zn,a.createModalClass=As,a.createPath=qt,a.createStore=F,a.createStoreSet=vn,a.createTheme=Vs,a.css=pn,a.customElement=z,a.defineAttribute=Ye,a.defineCSSState=tt,a.defineProperty=ye,a.defineRef=et,a.del=Ks,a.directive=Q,a.disconnect=Ct,a.emitter=Re,a.get=Bs,a.getThemeProp=Hs,a.getThemeStore=Xn,a.globalemitter=Gn,a.guard=Ln,a.history=h,a.html=M,a.ifDefined=Nt,a.isArrayChange=_t,a.kebabToCamelCase=pe,a.matchPath=Ut,a.mediaQuery=Js,a.nativeDefineElement=nt,a.numattribute=An,a.part=Wt,a.partMap=Sn,a.post=zs,a.property=U,a.put=Fs,a.randomStr=$e,a.raw=me,a.refobject=Mn,a.removeItems=bt,a.render=Ue,a.repeat=Tn,a.request=De,a.rootElement=Vn,a.slot=Rn,a.splice=Yn,a.state=Ae,a.styleMap=En,a.styled=wn,a.svg=fn,a.titleStore=q,a.updateStore=P,a.updateTheme=Ws,a.version=ns,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GemElement } from '
|
|
1
|
+
import { GemElement } from '../lib/element';
|
|
2
2
|
/**
|
|
3
3
|
* 在模版中声明的 dialog,使用 `open` 方法 打开;
|
|
4
4
|
* 如果要应用关闭动画,可以在动画执行完后设置 `hidden` 属性;
|
|
@@ -8,9 +8,9 @@ import { GemElement } from '..';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare abstract class DialogBaseElement extends GemElement {
|
|
10
10
|
#private;
|
|
11
|
+
label: string;
|
|
11
12
|
opened: boolean;
|
|
12
13
|
inert: boolean;
|
|
13
|
-
label: string;
|
|
14
14
|
constructor();
|
|
15
15
|
/**
|
|
16
16
|
* @final
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-base.d.ts","sourceRoot":"","sources":["../src/elements/dialog-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"dialog-base.d.ts","sourceRoot":"","sources":["../src/elements/dialog-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C;;;;;;GAMG;AACH,8BACsB,iBAAkB,SAAQ,UAAU;;IAC7C,KAAK,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAEvB,KAAK,UAAQ;;IAYb;;;OAGG;IACH,WAAW,aAUT;IAEF;;;OAGG;IACH,UAAU,aAUR;IAEF,YAAY;IACZ,IAAI,aASF;IAEF,WAAW;IAIX,YAAY;IACZ,KAAK,aAEH;IAEF;;;;;OAKG;IACH,UAAU,aAGR;CACH"}
|
package/elements/dialog-base.js
CHANGED
|
@@ -16,7 +16,9 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
16
16
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
17
17
|
};
|
|
18
18
|
var _DialogBaseElement_nextSibling, _DialogBaseElement_parentElement, _DialogBaseElement_inertStore;
|
|
19
|
-
import { GemElement
|
|
19
|
+
import { GemElement } from '../lib/element';
|
|
20
|
+
import { attribute, state, connectStore } from '../lib/decorators';
|
|
21
|
+
import { history } from '../lib/history';
|
|
20
22
|
/**
|
|
21
23
|
* 在模版中声明的 dialog,使用 `open` 方法 打开;
|
|
22
24
|
* 如果要应用关闭动画,可以在动画执行完后设置 `hidden` 属性;
|
|
@@ -27,12 +29,10 @@ import { GemElement, connectStore, history, state, attribute } from '..';
|
|
|
27
29
|
let DialogBaseElement = class DialogBaseElement extends GemElement {
|
|
28
30
|
constructor() {
|
|
29
31
|
super();
|
|
30
|
-
this.opened = false;
|
|
31
32
|
this.inert = true;
|
|
32
33
|
_DialogBaseElement_nextSibling.set(this, void 0);
|
|
33
34
|
_DialogBaseElement_parentElement.set(this, void 0);
|
|
34
35
|
_DialogBaseElement_inertStore.set(this, []);
|
|
35
|
-
this.label = '';
|
|
36
36
|
/**
|
|
37
37
|
* @final
|
|
38
38
|
* 进入关闭状态
|
|
@@ -99,12 +99,12 @@ let DialogBaseElement = class DialogBaseElement extends GemElement {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
_DialogBaseElement_nextSibling = new WeakMap(), _DialogBaseElement_parentElement = new WeakMap(), _DialogBaseElement_inertStore = new WeakMap();
|
|
102
|
-
__decorate([
|
|
103
|
-
state
|
|
104
|
-
], DialogBaseElement.prototype, "opened", void 0);
|
|
105
102
|
__decorate([
|
|
106
103
|
attribute
|
|
107
104
|
], DialogBaseElement.prototype, "label", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
state
|
|
107
|
+
], DialogBaseElement.prototype, "opened", void 0);
|
|
108
108
|
DialogBaseElement = __decorate([
|
|
109
109
|
connectStore(history.store)
|
|
110
110
|
], DialogBaseElement);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-base.js","sourceRoot":"","sources":["../src/elements/dialog-base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"dialog-base.js","sourceRoot":"","sources":["../src/elements/dialog-base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;GAMG;AAEH,IAAsB,iBAAiB,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 -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gesture.d.ts","sourceRoot":"","sources":["../src/elements/gesture.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"gesture.d.ts","sourceRoot":"","sources":["../src/elements/gesture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAqC,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE/E,oBAAY,cAAc,GAAG;IAE3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,gBAAgB;IAE/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,iBAAiB;IAEhC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;CAChB;AAiBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IACtC,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACjC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACnC,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACjC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,WAAW,EAAE,MAAM,CAAC;IAE/B,OAAO,UAAS;IAChB,UAAU,SAAK;IAEf,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IACrD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAa;;IAWpD,QAAQ,CAAC,SAAS,EAAE,MAAM;IAI1B,aAAa,CAAC,SAAS,EAAE,MAAM;IAI/B,gBAAgB,CAAC,SAAS,EAAE,MAAM;IASlC,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAgBjC,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAgBjC,OAAO,CAAC,GAAG,EAAE,YAAY;IAczB,MAAM,CAAC,GAAG,EAAE,YAAY;IAkDxB,KAAK,CAAC,GAAG,EAAE,YAAY;IA2CvB,MAAM;CAYP"}
|
package/elements/gesture.js
CHANGED
|
@@ -4,11 +4,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { GemElement, html } from '../lib/element';
|
|
8
|
+
import { attribute, customElement, emitter } from '../lib/decorators';
|
|
8
9
|
function angleAB(a, b, c, { clientX: x1, clientY: y1 }, { clientX: x2, clientY: y2 }, { clientX: x3, clientY: y3 }) {
|
|
9
10
|
// https://en.wikipedia.org/wiki/Law_of_cosines
|
|
10
11
|
// https://blog.csdn.net/z278930050/article/details/53319091
|
|
11
|
-
return (Math.sign((x2 - x1) * (y3 - y2) - (y2 - y1) * (x3 - x2)) * Math.acos((
|
|
12
|
+
return (Math.sign((x2 - x1) * (y3 - y2) - (y2 - y1) * (x3 - x2)) * Math.acos((a ** 2 + b ** 2 - c ** 2) / (2 * a * b)) * 180);
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* 块级元素,如果要设置成 `contents`,则内容块要设置 `touch-action: none`
|
|
@@ -121,9 +122,9 @@ let GemGestureElement = class GemGestureElement extends GemElement {
|
|
|
121
122
|
this.pan(move);
|
|
122
123
|
if (this.movesMap.size !== 1) {
|
|
123
124
|
const secondaryPoint = this.getOtherLastmove(pointerId);
|
|
124
|
-
const moveLen = Math.sqrt(
|
|
125
|
-
const distanceLen = Math.sqrt(
|
|
126
|
-
const newDistanceLen = Math.sqrt(
|
|
125
|
+
const moveLen = Math.sqrt(movementX ** 2 + movementY ** 2);
|
|
126
|
+
const distanceLen = Math.sqrt((lastMove.clientX - secondaryPoint.clientX) ** 2 + (lastMove.clientY - secondaryPoint.clientY) ** 2);
|
|
127
|
+
const newDistanceLen = Math.sqrt((clientX - secondaryPoint.clientX) ** 2 + (clientY - secondaryPoint.clientY) ** 2);
|
|
127
128
|
const x = (lastMove.clientX + secondaryPoint.clientX) / 2;
|
|
128
129
|
const y = (lastMove.clientY + secondaryPoint.clientY) / 2;
|
|
129
130
|
this.pinch({ x, y, scale: newDistanceLen / distanceLen });
|
package/elements/gesture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gesture.js","sourceRoot":"","sources":["../src/elements/gesture.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"gesture.js","sourceRoot":"","sources":["../src/elements/gesture.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAW,MAAM,mBAAmB,CAAC;AA6B/E,SAAS,OAAO,CACd,CAAS,EACT,CAAS,EACT,CAAS,EACT,EAA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AoB;AAEjB;IAAV,SAAS;sDAAqB;AARpB,iBAAiB;IAD7B,aAAa,CAAC,aAAa,CAAC;GAChB,iBAAiB,CAiM7B;SAjMY,iBAAiB"}
|
package/elements/link.d.ts
CHANGED
package/elements/link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../src/elements/link.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../src/elements/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAK7D,OAAO,EAAa,SAAS,EAAE,YAAY,EAAmC,MAAM,SAAS,CAAC;AAE9F;;;;;;;;;;;;;GAaG;AACH,qBAEa,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,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,YAAY,GAAG,SAAS,CAAC;IAClC,OAAO,EAAE,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;IAEtD,IAAI,EAAE,MAAM,CAAC;;IAQnB,WAAW;IAoBX,UAAU,CAAC,QAAQ,EAAE,MAAM;IAI3B,WAAW,MAAa,UAAU,mBAiDhC;IAEF,cAAc,MAAO,UAAU,UAE7B;IAEF,MAAM,CAAC,QAAQ,SAAqB;CAgCrC;AAED;;;;GAIG;AACH,qBAEa,oBAAqB,SAAQ,cAAc;IAC3C,OAAO,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAEvB,MAAM;CAWP"}
|
package/elements/link.js
CHANGED
|
@@ -4,16 +4,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
import { GemElement, html, history, basePathStore, part, attribute, property, connectStore, customElement, state, ifDefined, } from '../';
|
|
7
|
+
import { GemElement, html, ifDefined } from '../lib/element';
|
|
8
|
+
import { attribute, property, customElement, state, part, connectStore } from '../lib/decorators';
|
|
9
|
+
import { history, basePathStore } from '../lib/history';
|
|
17
10
|
import { absoluteLocation } from '../lib/utils';
|
|
18
11
|
import { matchPath, createHistoryParams, createPath } from './route';
|
|
19
12
|
/**
|
|
@@ -33,7 +26,7 @@ import { matchPath, createHistoryParams, createPath } from './route';
|
|
|
33
26
|
let GemLinkElement = class GemLinkElement extends GemElement {
|
|
34
27
|
constructor() {
|
|
35
28
|
super();
|
|
36
|
-
this.clickHandle = (e) =>
|
|
29
|
+
this.clickHandle = async (e) => {
|
|
37
30
|
var _a;
|
|
38
31
|
const pathInfo = this.getPathInfo();
|
|
39
32
|
if (!pathInfo)
|
|
@@ -61,24 +54,26 @@ let GemLinkElement = class GemLinkElement extends GemElement {
|
|
|
61
54
|
return;
|
|
62
55
|
}
|
|
63
56
|
e.stopPropagation();
|
|
64
|
-
|
|
57
|
+
await ((_a = this.prepare) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
65
58
|
if (this.route) {
|
|
66
|
-
history.pushIgnoreCloseHandle(
|
|
59
|
+
history.pushIgnoreCloseHandle({
|
|
60
|
+
...createHistoryParams(this.route, this.options),
|
|
61
|
+
title: this.route.title || this.docTitle,
|
|
62
|
+
});
|
|
67
63
|
}
|
|
68
64
|
else if (this.href) {
|
|
69
65
|
const { pathname, search, hash } = new URL(pathInfo, location.origin);
|
|
70
66
|
history.pushIgnoreCloseHandle({
|
|
71
67
|
path: pathname,
|
|
72
68
|
query: search,
|
|
73
|
-
|
|
74
|
-
hash: decodeURIComponent(hash),
|
|
69
|
+
hash: hash,
|
|
75
70
|
title: this.docTitle,
|
|
76
71
|
});
|
|
77
72
|
}
|
|
78
73
|
else {
|
|
79
74
|
history.pushIgnoreCloseHandle({ path: this.path, query: this.query, hash: this.hash, title: this.docTitle });
|
|
80
75
|
}
|
|
81
|
-
}
|
|
76
|
+
};
|
|
82
77
|
this.preventDefault = (e) => {
|
|
83
78
|
e.preventDefault();
|
|
84
79
|
};
|
package/elements/link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../src/elements/link.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../src/elements/link.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,SAAS,EAA2B,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAA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