@mantou/gem 1.5.5 → 1.5.6
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/elements/modal-base.d.ts +24 -14
- package/elements/modal-base.d.ts.map +1 -1
- package/lib/element.d.ts +2 -1
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js +21 -23
- package/lib/element.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +2 -0
- 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/lib/element.ts +22 -22
- package/src/lib/utils.ts +2 -0
- package/src/lib/version.ts +1 -1
- package/src/test/gem-element/advance.test.ts +8 -2
- package/umd.js +1 -1
- package/umd.js.map +1 -1
package/umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see umd.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Gem=e():t.Gem=e()}(self,(function(){return(()=>{"use strict";var t={d:(e,n)=>{for(var s in n)t.o(n,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:n[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{DialogBaseElement:()=>Hn,GemActiveLinkElement:()=>yn,GemElement:()=>$e,GemError:()=>N,GemLightRouteElement:()=>mn,GemLinkElement:()=>vn,GemReflectElement:()=>Cn,GemRouteElement:()=>fn,GemTitleElement:()=>Sn,GemUnsafeElement:()=>kn,GemUseElement:()=>Pn,I18n:()=>zn,LinkedList:()=>y,PropProxyMap:()=>w,QueryString:()=>b,SVGTemplateResult:()=>Ct,SheetToken:()=>x,StoreListenerMap:()=>W,TemplateResult:()=>Tt,absoluteLocation:()=>v,addMicrotask:()=>p,addMicrotaskToStack:()=>g,adoptedStyle:()=>Ze,attribute:()=>Ie,basePathStore:()=>it,boolattribute:()=>qe,camelToKebabCase:()=>O,classMap:()=>R,cleanObject:()=>M,connect:()=>q,connectStore:()=>Xe,createCSSSheet:()=>P,createHistoryParams:()=>pn,createModalClass:()=>$n,createPath:()=>dn,createStore:()=>V,createStoreSet:()=>D,createTheme:()=>qn,css:()=>E,customElement:()=>tn,defineAttribute:()=>Ne,defineCSSState:()=>Re,defineProperty:()=>je,defineRef:()=>Ae,del:()=>Yn,directive:()=>ct,disconnect:()=>U,emitter:()=>Ke,get:()=>Xn,getThemeProp:()=>In,getThemeStore:()=>Vn,globalemitter:()=>Je,guard:()=>ne,history:()=>G,html:()=>Bt,ifDefined:()=>ie,isArrayChange:()=>L,kebabToCamelCase:()=>$,matchPath:()=>un,mediaQuery:()=>ns,nativeDefineElement:()=>He,numattribute:()=>Ue,part:()=>ze,partMap:()=>H,post:()=>es,property:()=>Ge,put:()=>ts,randomStr:()=>_,raw:()=>S,refobject:()=>Ve,removeItems:()=>j,render:()=>Gt,repeat:()=>te,request:()=>Jn,rootElement:()=>Ye,slot:()=>Fe,state:()=>Be,styleMap:()=>A,styled:()=>C,svg:()=>Ft,titleStore:()=>ot,updateStore:()=>I,updateTheme:()=>Un,version:()=>en});var n={};t.r(n),t.d(n,{GemElement:()=>$e,GemError:()=>N,LinkedList:()=>y,PropProxyMap:()=>w,QueryString:()=>b,SVGTemplateResult:()=>Ct,SheetToken:()=>x,StoreListenerMap:()=>W,TemplateResult:()=>Tt,absoluteLocation:()=>v,addMicrotask:()=>p,addMicrotaskToStack:()=>g,adoptedStyle:()=>Ze,attribute:()=>Ie,basePathStore:()=>it,boolattribute:()=>qe,camelToKebabCase:()=>O,classMap:()=>R,cleanObject:()=>M,connect:()=>q,connectStore:()=>Xe,createCSSSheet:()=>P,createStore:()=>V,createStoreSet:()=>D,css:()=>E,customElement:()=>tn,defineAttribute:()=>Ne,defineCSSState:()=>Re,defineProperty:()=>je,defineRef:()=>Ae,directive:()=>ct,disconnect:()=>U,emitter:()=>Ke,globalemitter:()=>Je,guard:()=>ne,history:()=>G,html:()=>Bt,ifDefined:()=>ie,isArrayChange:()=>L,kebabToCamelCase:()=>$,nativeDefineElement:()=>He,numattribute:()=>Ue,part:()=>ze,partMap:()=>H,property:()=>Ge,randomStr:()=>_,raw:()=>S,refobject:()=>Ve,removeItems:()=>j,render:()=>Gt,repeat:()=>te,rootElement:()=>Ye,slot:()=>Fe,state:()=>Be,styleMap:()=>A,styled:()=>C,svg:()=>Ft,titleStore:()=>ot,updateStore:()=>I,version:()=>en});var s,i,o,r,a,c,l,h=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)},u=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n};const d=new Set;function p(t){"function"==typeof t&&(d.size||globalThis.queueMicrotask((()=>{d.forEach((t=>t())),d.clear()})),d.delete(t),d.add(t))}const f=[];function m(){for(let t=f.length-1;t>=0;t--)f[t]();f.length=0}function g(t){f.length||p(m),f.push(t)}function v(t="",e=""){const{pathname:n,search:s,hash:i}=new URL(e,location.origin+t);return n+s+i}class y extends(globalThis.EventTarget||Object){constructor(){super(...arguments),s.add(this),i.set(this,new Map),o.set(this,void 0),r.set(this,void 0)}get size(){return h(this,i,"f").size}add(t){h(this,r,"f")||this.dispatchEvent(new CustomEvent("start"));const e=h(this,s,"m",a).call(this,t)||{value:t};e.prev=h(this,r,"f"),e.prev&&(e.prev.next=e),e.next=void 0,u(this,r,e,"f"),h(this,o,"f")||u(this,o,e,"f"),h(this,i,"f").set(t,e)}delete(t){const e=h(this,s,"m",a).call(this,t);return h(this,o,"f")||this.dispatchEvent(new CustomEvent("end")),e}get(){const t=h(this,o,"f");if(t)return h(this,s,"m",a).call(this,t.value),t.value}}i=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakSet,a=function(t){const e=h(this,i,"f").get(t);return e&&(e.prev?e.prev.next=e.next:u(this,o,e.next,"f"),e.next?e.next.prev=e.prev:u(this,r,e.prev,"f"),h(this,i,"f").delete(t)),e};class w extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class b extends URLSearchParams{constructor(t){super(t),c.set(this,(t=>"string"==typeof t?t:JSON.stringify(t))),l.set(this,(t=>{if(!t)return null;try{return JSON.parse(t)}catch(t){return null}}))}concat(t){let e;e="string"==typeof t?Object.fromEntries(new URLSearchParams(t).entries()):t,Object.entries(e).forEach((([t,e])=>{this.append(t,h(this,c,"f").call(this,e))}))}setAny(t,e){if(Array.isArray(e))this.delete(t),e.forEach((e=>this.append(t,h(this,c,"f").call(this,e))));else{const n=h(this,c,"f").call(this,e);n?this.set(t,n):this.delete(t)}}getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter((t=>""!==t)).map((t=>h(this,l,"f").call(this,t)))}toString(){const t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}function S(t,...e){return t.reduce(((t,n,s)=>{var i;return t+(null!==(i=e[s-1])&&void 0!==i?i:"")+n}))}function E(t,...e){return S(t,...e)}c=new WeakMap,l=new WeakMap;const x=Symbol("sheet token");function P(t,e=""){const n=new CSSStyleSheet,s={};n.media.mediaText=e;let i="";return"string"==typeof t?i=t:Object.keys(t).forEach((e=>{s[e]=`${e}-${_()}`,i+=t[e].styledContent.replace(/&/g,s[e])})),n.replaceSync(i),s[x]=n,s}function _(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 k=new RegExp("&.*{((.|\n)*)}","g");function T(t,e){const n=[];let s=`& {${t.replace(k,(t=>(n.push(t),"")))}}`+n.join("");return s=s.replace(/&/g,"class"===e?".&":"#&"),{styledContent:s,type:e}}const C={class:(t,...e)=>T(S(t,...e),"class"),id:(t,...e)=>T(S(t,...e),"id"),keyframes:(t,...e)=>({styledContent:`@keyframes & {${S(t,...e)}}`,type:"keyframes"})};function O(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}function $(t){return t.replace(/-(.)/g,((t,e)=>e.toUpperCase()))}function M(t){return Object.keys(t).forEach((e=>{delete t[e]})),t}class N extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function L(t,e){const n=t.length;for(let s=0;s<n;s++)if(t[s]!==e[s])return!0;return!1}function j(t,e){const n=new Set(e);return t.filter((t=>!n.has(t)||(n.delete(t),!1)))}function A(t){let e="";for(const n in t)t[n]&&(e+=`${O(n)}:${t[n]};`);return e}function R(t){let e=" ";for(const n in t)t[n]&&(e+=`${n} `);return e}const H=R,W=new WeakMap;function V(t){if(W.has(t))throw new N("argument error");return W.set(t,new Set),t}function D(t){return Object.keys(t).forEach((e=>{V(t[e])})),t}function I(t,e){Object.assign(t,e);const n=W.get(t);null==n||n.forEach((t=>{p(t)}))}function q(t,e){const n=W.get(t);null==n||n.add(e)}function U(t,e){const n=W.get(t);null==n||n.delete(e)}const G=window.history,B=window.location,F=G.pushState.bind(G),z=G.replaceState.bind(G);let K=0;const J=()=>`${performance.now()}-${++K}`,Q=V({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),Z=new Map;function X({$key:t,$hasCloseHandle:e,$hasOpenHandle:n,$hasShouldCloseHandle:s}={}){if(Q.$key!==t){if(t)throw new N("`$key` is not allowed");if(e)throw new N("`$hasCloseHandle` is not allowed");if(n)throw new N("`$hasOpenHandle` is not allowed");if(s)throw new N("`$hasShouldCloseHandle` is not allowed")}}function Y(t){return G.basePath?G.basePath+t:t}function tt(t){return t===G.basePath?"/":t.replace(new RegExp(`^${G.basePath}/`),"/")}function et(t){const e=Z.get(Q.$key)||{},n=t.path?v(e.path,t.path):tt(B.pathname),s=new b(t.query||(t.path?"":B.search)),i=t.path&&t.path!==e.path||t.query&&String(t.query)!==String(e.query),o=t.title||"",r=t.close||t.data||t.open||t.shouldClose,a=t.hash||(!i&&r?decodeURIComponent(B.hash):"");return Object.assign(Object.assign({},t),{title:o,path:n,query:s,hash:a})}function nt(t,e){X(e.data);const n=et(e),{title:s,path:i,query:o,hash:r,close:a,open:c,shouldClose:l,data:h}=n,u=Object.assign({$hasCloseHandle:!!a,$hasOpenHandle:!!c,$hasShouldCloseHandle:!!l,$key:J()},h);Z.set(u.$key,n),I(M(Q),u);const d=Y(i)+new b(o)+r,p=decodeURIComponent(B.hash);("push"===t?F:z)(u,s,d),p!==r&&window.dispatchEvent(new CustomEvent("hashchange"))}function st(t,e,n,s){X(e);const i=Object.assign({$key:J()},e||{}),{pathname:o,search:r,hash:a}=new URL(s,B.origin+B.pathname),c=et({path:o,query:new b(r),hash:a,title:n,data:e});Z.set(i.$key,c),I(M(Q),i);const l=Y(o)+c.query+a,h=B.hash;("push"===t?F:z)(i,n,l),h!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}const it=V({basePath:""});if(window.addEventListener("hashchange",(({isTrusted:t})=>{t&&G.replace({hash:decodeURIComponent(B.hash)})})),Object.defineProperties(G,{basePath:{get:()=>it.basePath,set(t){I(it,{basePath:t}),Object.assign(Z.get(Q.$key),{path:tt(B.pathname)})}},getParams:{value:function(){return Z.get(Q.$key)}},updateParams:{value:function(t){Object.assign(Z.get(Q.$key),t),I(Q,{})}},store:{value:Q},push:{value:function(t){G.pushState(t,"")}},pushIgnoreCloseHandle:{value:function(t){var e,n;Q.$hasCloseHandle?(null===(n=null===(e=Z.get(Q.$key))||void 0===e?void 0:e.close)||void 0===n||n.call(e),G.replace(t)):G.push(t)}},replace:{value:function(t){nt("replace",t)}}}),G.pushState=function(t,e,n){n?st("push",t,e,n):nt("push",t)},G.replaceState=function(t,e,n){st("replace",t,e,n)},G.state)if(G.state.$hasCloseHandle){I(Q,G.state);const t=et({title:document.title});Z.set(Q.$key,t),G.back()}else{const t=et({title:document.title,hash:B.hash});I(Q,Object.assign({$key:J()},G.state||{})),Z.set(Q.$key,t)}else{const{pathname:t,search:e,hash:n}=B;G.replace({path:t,query:e,hash:n})}const ot=V({title:""});q(ot,(()=>{const t=Z.get(Q.$key);t&&(t.title=ot.title)})),q(Q,(()=>{const{title:t}=G.getParams();t!==ot.title&&I(ot,{title:t})}));let rt=!1;window.addEventListener("popstate",(t=>{var e,n;const s=t.state;if(!(null==s?void 0:s.$key))return;if(rt)return void(rt=!1);if(!Z.has(s.$key)){const{pathname:t,search:e,hash:n}=B;Z.set(s.$key,{path:t,query:new b(e),hash:n,title:document.title,data:s})}const i=Q;if(parseFloat(s.$key)>parseFloat(i.$key)&&s.$hasOpenHandle)null===(n=null===(e=Z.get(s.$key))||void 0===e?void 0:e.open)||void 0===n||n.call(e);else if(i.$hasCloseHandle){const t=Z.get(i.$key),e=null==t?void 0:t.close,n=null==t?void 0:t.shouldClose;if(n&&!n())return rt=!0,void G.forward();e?e():s.$hasCloseHandle&&(rt=!0,G.back())}I(M(Q),s)}));const at=new WeakMap,ct=t=>(...e)=>{const n=t(...e);return at.set(n,!0),n},lt=t=>"function"==typeof t&&at.has(t),ht="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,ut=(t,e,n=null,s=null)=>{for(;e!==n;){const n=e.nextSibling;t.insertBefore(e,s),e=n}},dt=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},pt={},ft={},mt=`{{lit-${String(Math.random()).slice(2)}}}`,gt=`\x3c!--${mt}--\x3e`,vt=new RegExp(`${mt}|${gt}`),yt="$lit$";class wt{constructor(t,e){this.parts=[],this.element=e;const n=[],s=[],i=document.createTreeWalker(e.content,133,null,!1);let o=0,r=-1,a=0;const{strings:c,values:{length:l}}=t;for(;a<l;){const t=i.nextNode();if(null!==t){if(r++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:n}=e;let s=0;for(let t=0;t<n;t++)bt(e[t].name,yt)&&s++;for(;s-- >0;){const e=c[a],n=xt.exec(e)[2],s=n.toLowerCase()+yt,i=t.getAttribute(s);t.removeAttribute(s);const o=i.split(vt);this.parts.push({type:"attribute",index:r,name:n,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(s.push(t),i.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(mt)>=0){const s=t.parentNode,i=e.split(vt),o=i.length-1;for(let e=0;e<o;e++){let n,o=i[e];if(""===o)n=Et();else{const t=xt.exec(o);null!==t&&bt(t[2],yt)&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-yt.length)+t[3]),n=document.createTextNode(o)}s.insertBefore(n,t),this.parts.push({type:"node",index:++r})}""===i[o]?(s.insertBefore(Et(),t),n.push(t)):t.data=i[o],a+=o}}else if(8===t.nodeType)if(t.data===mt){const e=t.parentNode;null!==t.previousSibling&&r!==o||(r++,e.insertBefore(Et(),t)),o=r,this.parts.push({type:"node",index:r}),null===t.nextSibling?t.data="":(n.push(t),r--),a++}else{let e=-1;for(;-1!==(e=t.data.indexOf(mt,e+1));)this.parts.push({type:"node",index:-1}),a++}}else i.currentNode=s.pop()}for(const t of n)t.parentNode.removeChild(t)}}const bt=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},St=t=>-1!==t.index,Et=()=>document.createComment(""),xt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class Pt{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=ht?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,s=document.createTreeWalker(t,133,null,!1);let i,o=0,r=0,a=s.nextNode();for(;o<n.length;)if(i=n[o],St(i)){for(;r<i.index;)r++,"TEMPLATE"===a.nodeName&&(e.push(a),s.currentNode=a.content),null===(a=s.nextNode())&&(s.currentNode=e.pop(),a=s.nextNode());if("node"===i.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(a.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(a,i.name,i.strings,this.options));o++}else this.__parts.push(void 0),o++;return ht&&(document.adoptNode(t),customElements.upgrade(t)),t}}const _t=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),kt=` ${mt} `;class Tt{constructor(t,e,n,s){this.strings=t,this.values=e,this.type=n,this.processor=s}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let s=0;s<t;s++){const t=this.strings[s],i=t.lastIndexOf("\x3c!--");n=(i>-1||n)&&-1===t.indexOf("--\x3e",i+1);const o=xt.exec(t);e+=null===o?t+(n?kt:gt):t.substr(0,o.index)+o[1]+o[2]+yt+o[3]+mt}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==_t&&(e=_t.createHTML(e)),t.innerHTML=e,t}}class Ct extends Tt{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,n=e.firstChild;return e.removeChild(n),ut(e,n.firstChild),t}}const Ot=t=>null===t||!("object"==typeof t||"function"==typeof t),$t=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class Mt{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t<n.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new Nt(this)}_getValue(){const t=this.strings,e=t.length-1,n=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=n[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!$t(t))return t}let s="";for(let i=0;i<e;i++){s+=t[i];const e=n[i];if(void 0!==e){const t=e.value;if(Ot(t)||!$t(t))s+="string"==typeof t?t:String(t);else for(const e of t)s+="string"==typeof e?e:String(e)}}return s+=t[e],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Nt{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===pt||Ot(t)&&t===this.value||(this.value=t,lt(t)||(this.committer.dirty=!0))}commit(){for(;lt(this.value);){const t=this.value;this.value=pt,t(this)}this.value!==pt&&this.committer.commit()}}class Lt{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(Et()),this.endNode=t.appendChild(Et())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=Et()),t.__insert(this.endNode=Et())}insertAfterPart(t){t.__insert(this.startNode=Et()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;lt(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=pt,t(this)}const t=this.__pendingValue;t!==pt&&(Ot(t)?t!==this.value&&this.__commitText(t):t instanceof Tt?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):$t(t)?this.__commitIterable(t):t===ft?(this.value=ft,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,n="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=n:this.__commitNode(document.createTextNode(n)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof Pt&&this.value.template===e)this.value.update(t.values);else{const n=new Pt(e,t.processor,this.options),s=n._clone();n.update(t.values),this.__commitNode(s),this.value=n}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,s=0;for(const i of t)n=e[s],void 0===n&&(n=new Lt(this.options),e.push(n),0===s?n.appendIntoPart(this):n.insertAfterPart(e[s-1])),n.setValue(i),n.commit(),s++;s<e.length&&(e.length=s,this.clear(n&&n.endNode))}clear(t=this.startNode){dt(this.startNode.parentNode,t.nextSibling,this.endNode)}}class jt{constructor(t,e,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this.__pendingValue=t}commit(){for(;lt(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=pt,t(this)}if(this.__pendingValue===pt)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=pt}}class At extends Mt{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new Rt(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Rt extends Nt{}let Ht=!1;(()=>{try{const t={get capture(){return Ht=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class Wt{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;lt(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=pt,t(this)}if(this.__pendingValue===pt)return;const t=this.__pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),s=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=Vt(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=pt}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const Vt=t=>t&&(Ht?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),Dt=new class{handleAttributeExpressions(t,e,n,s){const i=e[0];return"."===i?new At(t,e.slice(1),n).parts:"@"===i?[new Wt(t,e.slice(1),s.eventContext)]:"?"===i?[new jt(t,e.slice(1),n)]:new Mt(t,e,n).parts}handleTextExpression(t){return new Lt(t)}};function It(t){let e=qt.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},qt.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const s=t.strings.join(mt);return n=e.keyString.get(s),void 0===n&&(n=new wt(t,t.getTemplateElement()),e.keyString.set(s,n)),e.stringsArray.set(t.strings,n),n}const qt=new Map,Ut=new WeakMap,Gt=(t,e,n)=>{let s=Ut.get(e);void 0===s&&(dt(e,e.firstChild),Ut.set(e,s=new Lt(Object.assign({templateFactory:It},n))),s.appendInto(e)),s.setValue(t),s.commit()};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const Bt=(t,...e)=>new Tt(t,e,"html",Dt),Ft=(t,...e)=>new Ct(t,e,"svg",Dt),zt=(t,e)=>{const n=t.startNode.parentNode,s=void 0===e?t.endNode:e.startNode,i=n.insertBefore(Et(),s);n.insertBefore(Et(),s);const o=new Lt(t.options);return o.insertAfterNode(i),o},Kt=(t,e)=>(t.setValue(e),t.commit(),t),Jt=(t,e,n)=>{const s=t.startNode.parentNode,i=n?n.startNode:t.endNode,o=e.endNode.nextSibling;o!==i&&ut(s,e.startNode,o,i)},Qt=t=>{dt(t.startNode.parentNode,t.startNode,t.endNode.nextSibling)},Zt=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Xt=new WeakMap,Yt=new WeakMap,te=ct(((t,e,n)=>{let s;return void 0===n?n=e:void 0!==e&&(s=e),e=>{if(!(e instanceof Lt))throw new Error("repeat can only be used in text bindings");const i=Xt.get(e)||[],o=Yt.get(e)||[],r=[],a=[],c=[];let l,h,u=0;for(const e of t)c[u]=s?s(e,u):u,a[u]=n(e,u),u++;let d=0,p=i.length-1,f=0,m=a.length-1;for(;d<=p&&f<=m;)if(null===i[d])d++;else if(null===i[p])p--;else if(o[d]===c[f])r[f]=Kt(i[d],a[f]),d++,f++;else if(o[p]===c[m])r[m]=Kt(i[p],a[m]),p--,m--;else if(o[d]===c[m])r[m]=Kt(i[d],a[m]),Jt(e,i[d],r[m+1]),d++,m--;else if(o[p]===c[f])r[f]=Kt(i[p],a[f]),Jt(e,i[p],i[d]),p--,f++;else if(void 0===l&&(l=Zt(c,f,m),h=Zt(o,d,p)),l.has(o[d]))if(l.has(o[p])){const t=h.get(c[f]),n=void 0!==t?i[t]:null;if(null===n){const t=zt(e,i[d]);Kt(t,a[f]),r[f]=t}else r[f]=Kt(n,a[f]),Jt(e,n,i[d]),i[t]=null;f++}else Qt(i[p]),p--;else Qt(i[d]),d++;for(;f<=m;){const t=zt(e,r[m+1]);Kt(t,a[f]),r[f++]=t}for(;d<=p;){const t=i[d++];null!==t&&Qt(t)}Xt.set(e,r),Yt.set(e,c)}})),ee=new WeakMap,ne=ct(((t,e)=>n=>{const s=ee.get(n);if(Array.isArray(t)){if(Array.isArray(s)&&s.length===t.length&&t.every(((t,e)=>t===s[e])))return}else if(s===t&&(void 0!==t||ee.has(n)))return;n.setValue(e()),ee.set(n,Array.isArray(t)?Array.from(t):t)})),se=new WeakMap,ie=ct((t=>e=>{const n=se.get(e);if(void 0===t&&e instanceof Nt){if(void 0!==n||!se.has(e)){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else t!==n&&e.setValue(t);se.set(e,t)}));var oe,re,ae,ce,le,he,ue,de,pe,fe,me,ge,ve,ye,we,be,Se,Ee=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)},xe=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n};function Pe(){}function _e(t){"function"==typeof t&&t()}const ke=new y,Te=()=>{window.requestAnimationFrame((function t(e){if(performance.now()>e+16)return void Te();const n=ke.get();n&&(n(),t(e))}))};ke.addEventListener("start",Te);const Ce=Symbol("init"),Oe=Symbol("update");class $e extends HTMLElement{constructor({isAsync:t,isLight:e,delegatesFocus:n}={}){super(),oe.set(this,void 0),re.set(this,void 0),ae.set(this,void 0),ce.set(this,void 0),le.set(this,void 0),he.set(this,void 0),ue.set(this,void 0),this.setState=t=>{if(!this.state)throw new N("`state` not initialized");Object.assign(this.state,t),p(Ee(this,we,"f"))},de.set(this,(t=>{null==t||t.forEach((t=>{const{callback:e,getDep:n,values:s,preCallback:i}=t,o=null==n?void 0:n();n&&!L(s,o)||(_e(i),t.preCallback=e(o,s),t.values=o)}))})),pe.set(this,(()=>{Ee(this,de,"f").call(this,Ee(this,le,"f"))})),fe.set(this,(()=>{Ee(this,de,"f").call(this,Ee(this,he,"f"))})),this.effect=(t,e)=>{Ee(this,le,"f")||xe(this,le,[],"f");const n=null==e?void 0:e(),s={callback:t,getDep:e,values:n,initialized:!!this.isConnected};this.isConnected&&(s.preCallback=t(n)),Ee(this,le,"f").push(s)},this.memo=(t,e)=>{Ee(this,he,"f")||xe(this,he,[],"f"),Ee(this,he,"f").push({callback:t,getDep:e,values:[Symbol()],initialized:this.isConnected})},me.set(this,(()=>{var t;null===(t=Ee(this,le,"f"))||void 0===t||t.forEach((t=>{const{callback:e,getDep:n,initialized:s}=t;s||(t.preCallback=e(null==n?void 0:n()),t.initialized=!0)}))})),ge.set(this,(()=>(Ee(this,fe,"f").call(this),this.render?this.render():Ee(this,oe,"f")===this?void 0:Bt`<slot></slot>`))),ve.set(this,(()=>!this.shouldUpdate||this.shouldUpdate())),ye.set(this,(()=>{if(this.isConnected&&Ee(this,ve,"f").call(this)){const t=Ee(this,ge,"f").call(this);void 0!==t&&Gt(t,Ee(this,oe,"f")),p(Ee(this,be,"f")),p(Ee(this,pe,"f"))}})),we.set(this,(()=>{Ee(this,ce,"f")?ke.add(Ee(this,ye,"f")):Ee(this,ye,"f").call(this)})),this.update=()=>{p(Ee(this,we,"f"))},be.set(this,(()=>{var t;null===(t=this.updated)||void 0===t||t.call(this)})),Se.set(this,(()=>{var t,e,n;if(Ee(this,ae,"f"))return void xe(this,ae,!1,"f");null===(t=this.willMount)||void 0===t||t.call(this);const{observedStores:s,rootElement:i}=this.constructor;null==s||s.forEach((t=>{q(t,Ee(this,we,"f"))}));const o=Ee(this,ge,"f").call(this);if(void 0!==o&&Gt(o,Ee(this,oe,"f")),xe(this,ue,null===(e=this.mounted)||void 0===e?void 0:e.call(this),"f"),Ee(this,me,"f").call(this),i&&(null===(n=this.getRootNode().host)||void 0===n?void 0:n.tagName)!==i.toUpperCase())throw new N("not allow current root type")})),p((()=>this[Ce]=!1)),this[Ce]=!0,this[Oe]=()=>{this.isConnected&&p(Ee(this,we,"f"))},xe(this,ce,t,"f"),xe(this,oe,e?this:this.attachShadow({mode:"open",delegatesFocus:n}),"f");const{adoptedStyleSheets:s}=new.target;if(s){const t=s.map((t=>t[x]||t));this.shadowRoot?this.shadowRoot.adoptedStyleSheets=t:this.effect((()=>{const e=this.getRootNode();return e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t],()=>{e.adoptedStyleSheets=j(e.adoptedStyleSheets,t)}}),(()=>[]))}}get internals(){if(!Ee(this,re,"f")){const t=()=>{const{classList:t}=this;return{has:e=>t.contains(e),add:e=>t.add(e),delete:e=>t.remove(e)}};this.attachInternals||(this.attachInternals=()=>({states:t()})),xe(this,re,this.attachInternals(),"f"),Ee(this,re,"f").states||(Ee(this,re,"f").states=t())}return Ee(this,re,"f")}attributeChangedCallback(){this.isConnected&&p(Ee(this,we,"f"))}closestElement(t){const e="function"==typeof t,n="string"==typeof t&&t.toUpperCase(),s=i=>{const o=i.parentElement||i.getRootNode().host;if(!o)return null;if(e){if(o.constructor===t)return o}else if(o.tagName===n)return o;return s(o)};return s(this)}connectedCallback(){Ee(this,ce,"f")?ke.add(Ee(this,Se,"f")):Ee(this,Se,"f").call(this)}disconnectedCallback(){var t,e,n;if(this.isConnected)return void xe(this,ae,!0,"f");const{observedStores:s}=this.constructor;null==s||s.forEach((t=>{U(t,Ee(this,we,"f"))})),_e(Ee(this,ue,"f")),null===(t=this.unmounted)||void 0===t||t.call(this),null===(e=Ee(this,le,"f"))||void 0===e||e.forEach((t=>{_e(t.preCallback)})),xe(this,he,null===(n=Ee(this,he,"f"))||void 0===n?void 0:n.filter((({initialized:t})=>!t)),"f")}}oe=new WeakMap,re=new WeakMap,ae=new WeakMap,ce=new WeakMap,le=new WeakMap,he=new WeakMap,ue=new WeakMap,de=new WeakMap,pe=new WeakMap,fe=new WeakMap,me=new WeakMap,ge=new WeakMap,ve=new WeakMap,ye=new WeakMap,we=new WeakMap,be=new WeakMap,Se=new WeakMap;const Me=new w;function Ne(t,e,n){const{booleanAttributes:s,numberAttributes:i}=t.constructor;Object.defineProperty(t,e,{configurable:!0,get(){if(!(Ce in this))return;const t=this.getAttribute(n);return(null==s?void 0:s.has(n))?null!==t:(null==i?void 0:i.has(n))?Number(t):t||""},set(t){const i=this,o=Me.get(this),r=o[e],a=i.getAttribute(n);if(this[Ce]&&null!==a&&!r)return;o[e]=!0;const c=null==s?void 0:s.has(n);null==t?i.removeAttribute(n):c?i.toggleAttribute(n,!!t):a!==String(t)&&i.setAttribute(n,String(t))}})}const Le=Symbol("event handle");function je(t,e,n,s){Object.defineProperty(t,e,{configurable:!0,get(){const t=Me.get(this)[e];return t||!n?t:(this[e]=Pe,this[e])},set(t){const i=this,o=Me.get(i);t!==o[e]&&(n?(o[e]=(null==t?void 0:t[Le])?t:(e,o)=>{const r=new CustomEvent(n,Object.assign(Object.assign(Object.assign({},o),s),{detail:e}));i.dispatchEvent(r),t(e,o)},o[e][Le]=!0):(o[e]=t,this[Oe]()))}})}function Ae(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){const t=Me.get(this);let s=t[e];if(!s){const i=this,o=i.shadowRoot||i;s={get ref(){return n},get element(){const t=[...o.querySelectorAll("gem-reflect")].map((t=>t.target));for(const e of[o,...t]){const t=e.querySelector(`[ref=${n}]`);if(t)return t}}},t[e]=s}return s}})}function Re(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){var t;const{states:e}=this.internals;return null===(t=e.has)||void 0===t?void 0:t.call(e,n)},set(t){const{states:e}=this.internals;t?e.add(n):e.delete(n)}})}const He=customElements.define.bind(customElements);function We(t,e,n,s=!1){const i=t.constructor,o=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(o):o?Array.from(o):[]}),i[e][s?"add":"push"](n)}function Ve(t,e){const n=`${O(e)}-${_()}`;We(t,"defineRefs",n),Ae(t,e,n)}function De(t,e,n){We(t,"observedAttributes",n),Ne(t,e,n)}function Ie(t,e){De(t,e,O(e))}function qe(t,e){const n=O(e);We(t,"booleanAttributes",n,!0),De(t,e,n)}function Ue(t,e){const n=O(e);We(t,"numberAttributes",n,!0),De(t,e,n)}function Ge(t,e){We(t,"observedPropertys",e),je(t,e)}function Be(t,e){const n=O(e);We(t,"defineCSSStates",n),Re(t,e,`--${n}`)}function Fe(t,e){const n=O(t[e]||e);t[e]=n,We(t instanceof $e?t:t.prototype,"defineSlots",n)}function ze(t,e){const n=O(t[e]||e);t[e]=n,We(t instanceof $e?t:t.prototype,"defineParts",n)}function Ke(t,e){Qe(t,e)}function Je(t,e){Qe(t,e,{bubbles:!0,composed:!0})}function Qe(t,e,n){const s=O(e);We(t,"defineEvents",s),je(t,e,s,n)}function Ze(t){return function(e){We(e.prototype,"adoptedStyleSheets",t)}}function Xe(t){return function(e){We(e.prototype,"observedStores",t)}}function Ye(t){return function(e){e.rootElement=t}}function tn(t){return function(e){He(t,e)}}customElements.define=(t,e,n)=>{if(e.prototype instanceof $e){const{observedAttributes:t,observedPropertys:n,defineEvents:s,defineCSSStates:i,defineRefs:o}=e;null==t||t.forEach((t=>Ne(e.prototype,$(t),t))),null==n||n.forEach((t=>je(e.prototype,t))),null==s||s.forEach((t=>je(e.prototype,$(t),t))),null==i||i.forEach((t=>Re(e.prototype,$(t),`--${t}`))),null==o||o.forEach((t=>Ae(e.prototype,$(t),t)))}He(t,e,n)};const en="1.5.5";window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,Object.assign({},n));var nn,sn,on,rn,an=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},cn=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},ln=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};class hn extends RegExp{constructor(t){const e={};let n=0;super(`^${t.replace(/:([^/$]+)/g,((t,s)=>(e[s]=n++,"([^/]+)"))).replace("*",".*")}$`,"i"),this.namePosition=e}}function un(t,e){const n=new hn(t),s=e.match(n)||`${e}/`.match(n);if(!s)return null;const i={};return s&&Object.keys(n.namePosition).forEach((t=>{i[t]=s[n.namePosition[t]+1]})),i}function dn(t,e){let n=t.pattern;const s=null==e?void 0:e.params;return s&&Object.keys(s).forEach((t=>{n=n.replace(new RegExp(`:${t}`,"g"),s[t])})),n}function pn(t,e){const n=dn(t,e);return Object.assign({path:n},e)}let fn=rn=class extends $e{constructor({isLight:t,routes:e}={}){super({isLight:t}),this.currentParams={},nn.set(this,void 0),this.state={content:void 0},sn.set(this,(()=>{if(this.locationStore){const{path:t,query:e,data:n}=G.getParams();I(this.locationStore,{path:t,params:this.currentParams,query:e,data:n})}})),on.set(this,((t,e,n)=>{cn(this,nn,void 0,"f"),this.currentRoute=t,this.currentParams=e,this.setState({content:n}),this.routeChange(this.currentRoute);const s=null==t?void 0:t.title;s&&I(ot,{title:s}),ln(this,sn,"f").call(this)})),this.routes=e}mounted(){this.effect((([t,e],n)=>{if(n&&t===n[0]&&e===n[1])return void ln(this,sn,"f").call(this);const{route:s,params:i={}}=rn.findRoute(this.routes,e),{redirect:o,content:r,getContent:a}=s||{};if(o)return void G.replace({path:o});const c=r||(null==a?void 0:a(i));if(c instanceof Promise){this.loading(s),cn(this,nn,c,"f");const t=()=>ln(this,nn,"f")===c;c.then((e=>{t()&&ln(this,on,"f").call(this,s,i,e)})).catch((e=>{t()&&this.error(e)}))}else ln(this,on,"f").call(this,s,i,c)}),(()=>{const{path:t}=G.getParams();return[this.key,t,location.search]}))}shouldUpdate(){return!this.inert}render(){const{content:t}=this.state;return this.shadowRoot?Bt`
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Gem=e():t.Gem=e()}(self,(function(){return(()=>{"use strict";var t={d:(e,n)=>{for(var s in n)t.o(n,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:n[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{DialogBaseElement:()=>Hn,GemActiveLinkElement:()=>yn,GemElement:()=>$e,GemError:()=>N,GemLightRouteElement:()=>mn,GemLinkElement:()=>vn,GemReflectElement:()=>Cn,GemRouteElement:()=>fn,GemTitleElement:()=>Sn,GemUnsafeElement:()=>kn,GemUseElement:()=>Pn,I18n:()=>zn,LinkedList:()=>y,PropProxyMap:()=>w,QueryString:()=>b,SVGTemplateResult:()=>Ct,SheetToken:()=>x,StoreListenerMap:()=>W,TemplateResult:()=>Tt,absoluteLocation:()=>v,addMicrotask:()=>p,addMicrotaskToStack:()=>g,adoptedStyle:()=>Ze,attribute:()=>Ie,basePathStore:()=>it,boolattribute:()=>qe,camelToKebabCase:()=>O,classMap:()=>R,cleanObject:()=>M,connect:()=>q,connectStore:()=>Xe,createCSSSheet:()=>P,createHistoryParams:()=>pn,createModalClass:()=>$n,createPath:()=>dn,createStore:()=>V,createStoreSet:()=>D,createTheme:()=>qn,css:()=>E,customElement:()=>tn,defineAttribute:()=>Ne,defineCSSState:()=>Re,defineProperty:()=>je,defineRef:()=>Ae,del:()=>Yn,directive:()=>ct,disconnect:()=>U,emitter:()=>Ke,get:()=>Xn,getThemeProp:()=>In,getThemeStore:()=>Vn,globalemitter:()=>Je,guard:()=>ne,history:()=>G,html:()=>Bt,ifDefined:()=>ie,isArrayChange:()=>L,kebabToCamelCase:()=>$,matchPath:()=>un,mediaQuery:()=>ns,nativeDefineElement:()=>He,numattribute:()=>Ue,part:()=>ze,partMap:()=>H,post:()=>es,property:()=>Ge,put:()=>ts,randomStr:()=>_,raw:()=>S,refobject:()=>Ve,removeItems:()=>j,render:()=>Gt,repeat:()=>te,request:()=>Jn,rootElement:()=>Ye,slot:()=>Fe,state:()=>Be,styleMap:()=>A,styled:()=>C,svg:()=>Ft,titleStore:()=>ot,updateStore:()=>I,updateTheme:()=>Un,version:()=>en});var n={};t.r(n),t.d(n,{GemElement:()=>$e,GemError:()=>N,LinkedList:()=>y,PropProxyMap:()=>w,QueryString:()=>b,SVGTemplateResult:()=>Ct,SheetToken:()=>x,StoreListenerMap:()=>W,TemplateResult:()=>Tt,absoluteLocation:()=>v,addMicrotask:()=>p,addMicrotaskToStack:()=>g,adoptedStyle:()=>Ze,attribute:()=>Ie,basePathStore:()=>it,boolattribute:()=>qe,camelToKebabCase:()=>O,classMap:()=>R,cleanObject:()=>M,connect:()=>q,connectStore:()=>Xe,createCSSSheet:()=>P,createStore:()=>V,createStoreSet:()=>D,css:()=>E,customElement:()=>tn,defineAttribute:()=>Ne,defineCSSState:()=>Re,defineProperty:()=>je,defineRef:()=>Ae,directive:()=>ct,disconnect:()=>U,emitter:()=>Ke,globalemitter:()=>Je,guard:()=>ne,history:()=>G,html:()=>Bt,ifDefined:()=>ie,isArrayChange:()=>L,kebabToCamelCase:()=>$,nativeDefineElement:()=>He,numattribute:()=>Ue,part:()=>ze,partMap:()=>H,property:()=>Ge,randomStr:()=>_,raw:()=>S,refobject:()=>Ve,removeItems:()=>j,render:()=>Gt,repeat:()=>te,rootElement:()=>Ye,slot:()=>Fe,state:()=>Be,styleMap:()=>A,styled:()=>C,svg:()=>Ft,titleStore:()=>ot,updateStore:()=>I,version:()=>en});var s,i,o,r,a,c,l,h=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)},u=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n};const d=new Set;function p(t){"function"==typeof t&&(d.size||globalThis.queueMicrotask((()=>{d.forEach((t=>t())),d.clear()})),d.delete(t),d.add(t))}const f=[];function m(){for(let t=f.length-1;t>=0;t--)f[t]();f.length=0}function g(t){f.length||p(m),f.push(t)}function v(t="",e=""){const{pathname:n,search:s,hash:i}=new URL(e,location.origin+t);return n+s+i}class y extends(globalThis.EventTarget||Object){constructor(){super(...arguments),s.add(this),i.set(this,new Map),o.set(this,void 0),r.set(this,void 0)}get size(){return h(this,i,"f").size}add(t){h(this,r,"f")||this.dispatchEvent(new CustomEvent("start"));const e=h(this,s,"m",a).call(this,t)||{value:t};e.prev=h(this,r,"f"),e.prev&&(e.prev.next=e),e.next=void 0,u(this,r,e,"f"),h(this,o,"f")||u(this,o,e,"f"),h(this,i,"f").set(t,e)}delete(t){const e=h(this,s,"m",a).call(this,t);return h(this,o,"f")||this.dispatchEvent(new CustomEvent("end")),e}get(){const t=h(this,o,"f");if(t)return h(this,s,"m",a).call(this,t.value),t.value}}i=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakSet,a=function(t){const e=h(this,i,"f").get(t);return e&&(e.prev?e.prev.next=e.next:u(this,o,e.next,"f"),e.next?e.next.prev=e.prev:u(this,r,e.prev,"f"),h(this,i,"f").delete(t)),e};class w extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class b extends URLSearchParams{constructor(t){super(t),c.set(this,(t=>"string"==typeof t?t:JSON.stringify(t))),l.set(this,(t=>{if(!t)return null;try{return JSON.parse(t)}catch(t){return null}}))}concat(t){let e;e="string"==typeof t?Object.fromEntries(new URLSearchParams(t).entries()):t,Object.entries(e).forEach((([t,e])=>{this.append(t,h(this,c,"f").call(this,e))}))}setAny(t,e){if(Array.isArray(e))this.delete(t),e.forEach((e=>this.append(t,h(this,c,"f").call(this,e))));else{const n=h(this,c,"f").call(this,e);n?this.set(t,n):this.delete(t)}}getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter((t=>""!==t)).map((t=>h(this,l,"f").call(this,t)))}toString(){const t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}function S(t,...e){return t.reduce(((t,n,s)=>{var i;return t+(null!==(i=e[s-1])&&void 0!==i?i:"")+n}))}function E(t,...e){return S(t,...e)}c=new WeakMap,l=new WeakMap;const x=Symbol("sheet token");function P(t,e=""){const n=new CSSStyleSheet,s={};n.media.mediaText=e;let i="";return"string"==typeof t?i=t:Object.keys(t).forEach((e=>{s[e]=`${e}-${_()}`,i+=t[e].styledContent.replace(/&/g,s[e])})),n.replaceSync(i),s[x]=n,s}function _(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 k=new RegExp("&.*{((.|\n)*)}","g");function T(t,e){const n=[];let s=`& {${t.replace(k,(t=>(n.push(t),"")))}}`+n.join("");return s=s.replace(/&/g,"class"===e?".&":"#&"),{styledContent:s,type:e}}const C={class:(t,...e)=>T(S(t,...e),"class"),id:(t,...e)=>T(S(t,...e),"id"),keyframes:(t,...e)=>({styledContent:`@keyframes & {${S(t,...e)}}`,type:"keyframes"})};function O(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}function $(t){return t.replace(/-(.)/g,((t,e)=>e.toUpperCase()))}function M(t){return Object.keys(t).forEach((e=>{delete t[e]})),t}class N extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function L(t,e){const n=t.length;for(let s=0;s<n;s++)if(t[s]!==e[s])return!0;return!1}function j(t,e){const n=new Set(e);return t.filter((t=>!n.has(t)||(n.delete(t),!1)))}function A(t){let e="";for(const n in t)t[n]&&(e+=`${O(n)}:${t[n]};`);return e}function R(t){let e=" ";for(const n in t)t[n]&&(e+=`${n} `);return e}const H=R,W=new WeakMap;function V(t){if(W.has(t))throw new N("argument error");return W.set(t,new Set),t}function D(t){return Object.keys(t).forEach((e=>{V(t[e])})),t}function I(t,e){Object.assign(t,e);const n=W.get(t);null==n||n.forEach((t=>{p(t)}))}function q(t,e){const n=W.get(t);null==n||n.add(e)}function U(t,e){const n=W.get(t);null==n||n.delete(e)}const G=window.history,B=window.location,F=G.pushState.bind(G),z=G.replaceState.bind(G);let K=0;const J=()=>`${performance.now()}-${++K}`,Q=V({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),Z=new Map;function X({$key:t,$hasCloseHandle:e,$hasOpenHandle:n,$hasShouldCloseHandle:s}={}){if(Q.$key!==t){if(t)throw new N("`$key` is not allowed");if(e)throw new N("`$hasCloseHandle` is not allowed");if(n)throw new N("`$hasOpenHandle` is not allowed");if(s)throw new N("`$hasShouldCloseHandle` is not allowed")}}function Y(t){return G.basePath?G.basePath+t:t}function tt(t){return t===G.basePath?"/":t.replace(new RegExp(`^${G.basePath}/`),"/")}function et(t){const e=Z.get(Q.$key)||{},n=t.path?v(e.path,t.path):tt(B.pathname),s=new b(t.query||(t.path?"":B.search)),i=t.path&&t.path!==e.path||t.query&&String(t.query)!==String(e.query),o=t.title||"",r=t.close||t.data||t.open||t.shouldClose,a=t.hash||(!i&&r?decodeURIComponent(B.hash):"");return Object.assign(Object.assign({},t),{title:o,path:n,query:s,hash:a})}function nt(t,e){X(e.data);const n=et(e),{title:s,path:i,query:o,hash:r,close:a,open:c,shouldClose:l,data:h}=n,u=Object.assign({$hasCloseHandle:!!a,$hasOpenHandle:!!c,$hasShouldCloseHandle:!!l,$key:J()},h);Z.set(u.$key,n),I(M(Q),u);const d=Y(i)+new b(o)+r,p=decodeURIComponent(B.hash);("push"===t?F:z)(u,s,d),p!==r&&window.dispatchEvent(new CustomEvent("hashchange"))}function st(t,e,n,s){X(e);const i=Object.assign({$key:J()},e||{}),{pathname:o,search:r,hash:a}=new URL(s,B.origin+B.pathname),c=et({path:o,query:new b(r),hash:a,title:n,data:e});Z.set(i.$key,c),I(M(Q),i);const l=Y(o)+c.query+a,h=B.hash;("push"===t?F:z)(i,n,l),h!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}const it=V({basePath:""});if(window.addEventListener("hashchange",(({isTrusted:t})=>{t&&G.replace({hash:decodeURIComponent(B.hash)})})),Object.defineProperties(G,{basePath:{get:()=>it.basePath,set(t){I(it,{basePath:t}),Object.assign(Z.get(Q.$key),{path:tt(B.pathname)})}},getParams:{value:function(){return Z.get(Q.$key)}},updateParams:{value:function(t){Object.assign(Z.get(Q.$key),t),I(Q,{})}},store:{value:Q},push:{value:function(t){G.pushState(t,"")}},pushIgnoreCloseHandle:{value:function(t){var e,n;Q.$hasCloseHandle?(null===(n=null===(e=Z.get(Q.$key))||void 0===e?void 0:e.close)||void 0===n||n.call(e),G.replace(t)):G.push(t)}},replace:{value:function(t){nt("replace",t)}}}),G.pushState=function(t,e,n){n?st("push",t,e,n):nt("push",t)},G.replaceState=function(t,e,n){st("replace",t,e,n)},G.state)if(G.state.$hasCloseHandle){I(Q,G.state);const t=et({title:document.title});Z.set(Q.$key,t),G.back()}else{const t=et({title:document.title,hash:B.hash});I(Q,Object.assign({$key:J()},G.state||{})),Z.set(Q.$key,t)}else{const{pathname:t,search:e,hash:n}=B;G.replace({path:t,query:e,hash:n})}const ot=V({title:""});q(ot,(()=>{const t=Z.get(Q.$key);t&&(t.title=ot.title)})),q(Q,(()=>{const{title:t}=G.getParams();t!==ot.title&&I(ot,{title:t})}));let rt=!1;window.addEventListener("popstate",(t=>{var e,n;const s=t.state;if(!(null==s?void 0:s.$key))return;if(rt)return void(rt=!1);if(!Z.has(s.$key)){const{pathname:t,search:e,hash:n}=B;Z.set(s.$key,{path:t,query:new b(e),hash:n,title:document.title,data:s})}const i=Q;if(parseFloat(s.$key)>parseFloat(i.$key)&&s.$hasOpenHandle)null===(n=null===(e=Z.get(s.$key))||void 0===e?void 0:e.open)||void 0===n||n.call(e);else if(i.$hasCloseHandle){const t=Z.get(i.$key),e=null==t?void 0:t.close,n=null==t?void 0:t.shouldClose;if(n&&!n())return rt=!0,void G.forward();e?e():s.$hasCloseHandle&&(rt=!0,G.back())}I(M(Q),s)}));const at=new WeakMap,ct=t=>(...e)=>{const n=t(...e);return at.set(n,!0),n},lt=t=>"function"==typeof t&&at.has(t),ht="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,ut=(t,e,n=null,s=null)=>{for(;e!==n;){const n=e.nextSibling;t.insertBefore(e,s),e=n}},dt=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},pt={},ft={},mt=`{{lit-${String(Math.random()).slice(2)}}}`,gt=`\x3c!--${mt}--\x3e`,vt=new RegExp(`${mt}|${gt}`),yt="$lit$";class wt{constructor(t,e){this.parts=[],this.element=e;const n=[],s=[],i=document.createTreeWalker(e.content,133,null,!1);let o=0,r=-1,a=0;const{strings:c,values:{length:l}}=t;for(;a<l;){const t=i.nextNode();if(null!==t){if(r++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:n}=e;let s=0;for(let t=0;t<n;t++)bt(e[t].name,yt)&&s++;for(;s-- >0;){const e=c[a],n=xt.exec(e)[2],s=n.toLowerCase()+yt,i=t.getAttribute(s);t.removeAttribute(s);const o=i.split(vt);this.parts.push({type:"attribute",index:r,name:n,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(s.push(t),i.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(mt)>=0){const s=t.parentNode,i=e.split(vt),o=i.length-1;for(let e=0;e<o;e++){let n,o=i[e];if(""===o)n=Et();else{const t=xt.exec(o);null!==t&&bt(t[2],yt)&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-yt.length)+t[3]),n=document.createTextNode(o)}s.insertBefore(n,t),this.parts.push({type:"node",index:++r})}""===i[o]?(s.insertBefore(Et(),t),n.push(t)):t.data=i[o],a+=o}}else if(8===t.nodeType)if(t.data===mt){const e=t.parentNode;null!==t.previousSibling&&r!==o||(r++,e.insertBefore(Et(),t)),o=r,this.parts.push({type:"node",index:r}),null===t.nextSibling?t.data="":(n.push(t),r--),a++}else{let e=-1;for(;-1!==(e=t.data.indexOf(mt,e+1));)this.parts.push({type:"node",index:-1}),a++}}else i.currentNode=s.pop()}for(const t of n)t.parentNode.removeChild(t)}}const bt=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},St=t=>-1!==t.index,Et=()=>document.createComment(""),xt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class Pt{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=ht?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,s=document.createTreeWalker(t,133,null,!1);let i,o=0,r=0,a=s.nextNode();for(;o<n.length;)if(i=n[o],St(i)){for(;r<i.index;)r++,"TEMPLATE"===a.nodeName&&(e.push(a),s.currentNode=a.content),null===(a=s.nextNode())&&(s.currentNode=e.pop(),a=s.nextNode());if("node"===i.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(a.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(a,i.name,i.strings,this.options));o++}else this.__parts.push(void 0),o++;return ht&&(document.adoptNode(t),customElements.upgrade(t)),t}}const _t=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),kt=` ${mt} `;class Tt{constructor(t,e,n,s){this.strings=t,this.values=e,this.type=n,this.processor=s}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let s=0;s<t;s++){const t=this.strings[s],i=t.lastIndexOf("\x3c!--");n=(i>-1||n)&&-1===t.indexOf("--\x3e",i+1);const o=xt.exec(t);e+=null===o?t+(n?kt:gt):t.substr(0,o.index)+o[1]+o[2]+yt+o[3]+mt}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==_t&&(e=_t.createHTML(e)),t.innerHTML=e,t}}class Ct extends Tt{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,n=e.firstChild;return e.removeChild(n),ut(e,n.firstChild),t}}const Ot=t=>null===t||!("object"==typeof t||"function"==typeof t),$t=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class Mt{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t<n.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new Nt(this)}_getValue(){const t=this.strings,e=t.length-1,n=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=n[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!$t(t))return t}let s="";for(let i=0;i<e;i++){s+=t[i];const e=n[i];if(void 0!==e){const t=e.value;if(Ot(t)||!$t(t))s+="string"==typeof t?t:String(t);else for(const e of t)s+="string"==typeof e?e:String(e)}}return s+=t[e],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Nt{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===pt||Ot(t)&&t===this.value||(this.value=t,lt(t)||(this.committer.dirty=!0))}commit(){for(;lt(this.value);){const t=this.value;this.value=pt,t(this)}this.value!==pt&&this.committer.commit()}}class Lt{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(Et()),this.endNode=t.appendChild(Et())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=Et()),t.__insert(this.endNode=Et())}insertAfterPart(t){t.__insert(this.startNode=Et()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;lt(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=pt,t(this)}const t=this.__pendingValue;t!==pt&&(Ot(t)?t!==this.value&&this.__commitText(t):t instanceof Tt?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):$t(t)?this.__commitIterable(t):t===ft?(this.value=ft,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,n="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=n:this.__commitNode(document.createTextNode(n)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof Pt&&this.value.template===e)this.value.update(t.values);else{const n=new Pt(e,t.processor,this.options),s=n._clone();n.update(t.values),this.__commitNode(s),this.value=n}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,s=0;for(const i of t)n=e[s],void 0===n&&(n=new Lt(this.options),e.push(n),0===s?n.appendIntoPart(this):n.insertAfterPart(e[s-1])),n.setValue(i),n.commit(),s++;s<e.length&&(e.length=s,this.clear(n&&n.endNode))}clear(t=this.startNode){dt(this.startNode.parentNode,t.nextSibling,this.endNode)}}class jt{constructor(t,e,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this.__pendingValue=t}commit(){for(;lt(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=pt,t(this)}if(this.__pendingValue===pt)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=pt}}class At extends Mt{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new Rt(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Rt extends Nt{}let Ht=!1;(()=>{try{const t={get capture(){return Ht=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class Wt{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;lt(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=pt,t(this)}if(this.__pendingValue===pt)return;const t=this.__pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),s=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=Vt(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=pt}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const Vt=t=>t&&(Ht?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),Dt=new class{handleAttributeExpressions(t,e,n,s){const i=e[0];return"."===i?new At(t,e.slice(1),n).parts:"@"===i?[new Wt(t,e.slice(1),s.eventContext)]:"?"===i?[new jt(t,e.slice(1),n)]:new Mt(t,e,n).parts}handleTextExpression(t){return new Lt(t)}};function It(t){let e=qt.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},qt.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const s=t.strings.join(mt);return n=e.keyString.get(s),void 0===n&&(n=new wt(t,t.getTemplateElement()),e.keyString.set(s,n)),e.stringsArray.set(t.strings,n),n}const qt=new Map,Ut=new WeakMap,Gt=(t,e,n)=>{let s=Ut.get(e);void 0===s&&(dt(e,e.firstChild),Ut.set(e,s=new Lt(Object.assign({templateFactory:It},n))),s.appendInto(e)),s.setValue(t),s.commit()};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const Bt=(t,...e)=>new Tt(t,e,"html",Dt),Ft=(t,...e)=>new Ct(t,e,"svg",Dt),zt=(t,e)=>{const n=t.startNode.parentNode,s=void 0===e?t.endNode:e.startNode,i=n.insertBefore(Et(),s);n.insertBefore(Et(),s);const o=new Lt(t.options);return o.insertAfterNode(i),o},Kt=(t,e)=>(t.setValue(e),t.commit(),t),Jt=(t,e,n)=>{const s=t.startNode.parentNode,i=n?n.startNode:t.endNode,o=e.endNode.nextSibling;o!==i&&ut(s,e.startNode,o,i)},Qt=t=>{dt(t.startNode.parentNode,t.startNode,t.endNode.nextSibling)},Zt=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Xt=new WeakMap,Yt=new WeakMap,te=ct(((t,e,n)=>{let s;return void 0===n?n=e:void 0!==e&&(s=e),e=>{if(!(e instanceof Lt))throw new Error("repeat can only be used in text bindings");const i=Xt.get(e)||[],o=Yt.get(e)||[],r=[],a=[],c=[];let l,h,u=0;for(const e of t)c[u]=s?s(e,u):u,a[u]=n(e,u),u++;let d=0,p=i.length-1,f=0,m=a.length-1;for(;d<=p&&f<=m;)if(null===i[d])d++;else if(null===i[p])p--;else if(o[d]===c[f])r[f]=Kt(i[d],a[f]),d++,f++;else if(o[p]===c[m])r[m]=Kt(i[p],a[m]),p--,m--;else if(o[d]===c[m])r[m]=Kt(i[d],a[m]),Jt(e,i[d],r[m+1]),d++,m--;else if(o[p]===c[f])r[f]=Kt(i[p],a[f]),Jt(e,i[p],i[d]),p--,f++;else if(void 0===l&&(l=Zt(c,f,m),h=Zt(o,d,p)),l.has(o[d]))if(l.has(o[p])){const t=h.get(c[f]),n=void 0!==t?i[t]:null;if(null===n){const t=zt(e,i[d]);Kt(t,a[f]),r[f]=t}else r[f]=Kt(n,a[f]),Jt(e,n,i[d]),i[t]=null;f++}else Qt(i[p]),p--;else Qt(i[d]),d++;for(;f<=m;){const t=zt(e,r[m+1]);Kt(t,a[f]),r[f++]=t}for(;d<=p;){const t=i[d++];null!==t&&Qt(t)}Xt.set(e,r),Yt.set(e,c)}})),ee=new WeakMap,ne=ct(((t,e)=>n=>{const s=ee.get(n);if(Array.isArray(t)){if(Array.isArray(s)&&s.length===t.length&&t.every(((t,e)=>t===s[e])))return}else if(s===t&&(void 0!==t||ee.has(n)))return;n.setValue(e()),ee.set(n,Array.isArray(t)?Array.from(t):t)})),se=new WeakMap,ie=ct((t=>e=>{const n=se.get(e);if(void 0===t&&e instanceof Nt){if(void 0!==n||!se.has(e)){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else t!==n&&e.setValue(t);se.set(e,t)}));var oe,re,ae,ce,le,he,ue,de,pe,fe,me,ge,ve,ye,we,be,Se,Ee=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)},xe=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n};function Pe(){}function _e(t){"function"==typeof t&&t()}const ke=new y,Te=(t=performance.now())=>{if(performance.now()>t+16)return requestAnimationFrame(Te);const e=ke.get();e&&(e(),Te(t))};ke.addEventListener("start",(()=>p(Te)));const Ce=Symbol("init"),Oe=Symbol("update");class $e extends HTMLElement{constructor({isAsync:t,isLight:e,delegatesFocus:n}={}){super(),oe.set(this,void 0),re.set(this,void 0),ae.set(this,void 0),ce.set(this,void 0),le.set(this,void 0),he.set(this,void 0),ue.set(this,void 0),this.setState=t=>{if(!this.state)throw new N("`state` not initialized");Object.assign(this.state,t),p(Ee(this,we,"f"))},de.set(this,(t=>{null==t||t.forEach((t=>{const{callback:e,getDep:n,values:s,preCallback:i}=t,o=null==n?void 0:n();n&&s&&!L(s,o)||(_e(i),t.preCallback=e(o,s),t.values=o)}))})),pe.set(this,(()=>{Ee(this,de,"f").call(this,Ee(this,le,"f"))})),fe.set(this,(()=>{Ee(this,de,"f").call(this,Ee(this,he,"f"))})),this.effect=(t,e)=>{Ee(this,le,"f")||xe(this,le,[],"f");const n={callback:t,getDep:e,values:void 0,initialized:!!this.isConnected};this.isConnected&&(n.values=null==e?void 0:e(),n.preCallback=t(n.values)),Ee(this,le,"f").push(n)},this.memo=(t,e)=>{Ee(this,he,"f")||xe(this,he,[],"f"),Ee(this,he,"f").push({callback:t,getDep:e,values:[Symbol()],initialized:this.isConnected})},me.set(this,(()=>{var t;null===(t=Ee(this,le,"f"))||void 0===t||t.forEach((t=>{const{callback:e,getDep:n,initialized:s}=t;s||(t.values=null==n?void 0:n(),t.preCallback=e(t.values),t.initialized=!0)}))})),ge.set(this,(()=>(Ee(this,fe,"f").call(this),this.render?this.render():Ee(this,oe,"f")===this?void 0:Bt`<slot></slot>`))),ve.set(this,(()=>!this.shouldUpdate||this.shouldUpdate())),ye.set(this,(()=>{if(this.isConnected&&Ee(this,ve,"f").call(this)){const t=Ee(this,ge,"f").call(this);void 0!==t&&Gt(t,Ee(this,oe,"f")),p(Ee(this,be,"f")),p(Ee(this,pe,"f"))}})),we.set(this,(()=>{Ee(this,ce,"f")?ke.add(Ee(this,ye,"f")):Ee(this,ye,"f").call(this)})),this.update=()=>{p(Ee(this,we,"f"))},be.set(this,(()=>{var t;null===(t=this.updated)||void 0===t||t.call(this)})),Se.set(this,(()=>{var t,e,n;if(Ee(this,ae,"f"))return void xe(this,ae,!1,"f");null===(t=this.willMount)||void 0===t||t.call(this);const{observedStores:s,rootElement:i}=this.constructor;null==s||s.forEach((t=>{q(t,Ee(this,we,"f"))}));const o=Ee(this,ge,"f").call(this);if(void 0!==o&&Gt(o,Ee(this,oe,"f")),xe(this,ue,null===(e=this.mounted)||void 0===e?void 0:e.call(this),"f"),Ee(this,me,"f").call(this),i&&(null===(n=this.getRootNode().host)||void 0===n?void 0:n.tagName)!==i.toUpperCase())throw new N("not allow current root type")})),p((()=>this[Ce]=!1)),this[Ce]=!0,this[Oe]=()=>{this.isConnected&&p(Ee(this,we,"f"))},xe(this,ce,t,"f"),xe(this,oe,e?this:this.attachShadow({mode:"open",delegatesFocus:n}),"f");const{adoptedStyleSheets:s}=new.target;if(s){const t=s.map((t=>t[x]||t));this.shadowRoot?this.shadowRoot.adoptedStyleSheets=t:this.effect((()=>{const e=this.getRootNode();return e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t],()=>{e.adoptedStyleSheets=j(e.adoptedStyleSheets,t)}}),(()=>[]))}}get internals(){if(!Ee(this,re,"f")){const t=()=>{const{classList:t}=this;return{has:e=>t.contains(e),add:e=>t.add(e),delete:e=>t.remove(e)}};this.attachInternals||(this.attachInternals=()=>({states:t()})),xe(this,re,this.attachInternals(),"f"),Ee(this,re,"f").states||(Ee(this,re,"f").states=t())}return Ee(this,re,"f")}attributeChangedCallback(){this.isConnected&&p(Ee(this,we,"f"))}closestElement(t){const e="function"==typeof t,n="string"==typeof t&&t.toUpperCase(),s=i=>{const o=i.parentElement||i.getRootNode().host;if(!o)return null;if(e){if(o.constructor===t)return o}else if(o.tagName===n)return o;return s(o)};return s(this)}connectedCallback(){Ee(this,ce,"f")?ke.add(Ee(this,Se,"f")):Ee(this,Se,"f").call(this)}disconnectedCallback(){var t,e,n;if(this.isConnected)return void xe(this,ae,!0,"f");const{observedStores:s}=this.constructor;null==s||s.forEach((t=>{U(t,Ee(this,we,"f"))})),_e(Ee(this,ue,"f")),null===(t=this.unmounted)||void 0===t||t.call(this),null===(e=Ee(this,le,"f"))||void 0===e||e.forEach((t=>{_e(t.preCallback)})),xe(this,he,null===(n=Ee(this,he,"f"))||void 0===n?void 0:n.filter((({initialized:t})=>!t)),"f")}}oe=new WeakMap,re=new WeakMap,ae=new WeakMap,ce=new WeakMap,le=new WeakMap,he=new WeakMap,ue=new WeakMap,de=new WeakMap,pe=new WeakMap,fe=new WeakMap,me=new WeakMap,ge=new WeakMap,ve=new WeakMap,ye=new WeakMap,we=new WeakMap,be=new WeakMap,Se=new WeakMap;const Me=new w;function Ne(t,e,n){const{booleanAttributes:s,numberAttributes:i}=t.constructor;Object.defineProperty(t,e,{configurable:!0,get(){if(!(Ce in this))return;const t=this.getAttribute(n);return(null==s?void 0:s.has(n))?null!==t:(null==i?void 0:i.has(n))?Number(t):t||""},set(t){const i=this,o=Me.get(this),r=o[e],a=i.getAttribute(n);if(this[Ce]&&null!==a&&!r)return;o[e]=!0;const c=null==s?void 0:s.has(n);null==t?i.removeAttribute(n):c?i.toggleAttribute(n,!!t):a!==String(t)&&i.setAttribute(n,String(t))}})}const Le=Symbol("event handle");function je(t,e,n,s){Object.defineProperty(t,e,{configurable:!0,get(){const t=Me.get(this)[e];return t||!n?t:(this[e]=Pe,this[e])},set(t){const i=this,o=Me.get(i);t!==o[e]&&(n?(o[e]=(null==t?void 0:t[Le])?t:(e,o)=>{const r=new CustomEvent(n,Object.assign(Object.assign(Object.assign({},o),s),{detail:e}));i.dispatchEvent(r),t(e,o)},o[e][Le]=!0):(o[e]=t,this[Oe]()))}})}function Ae(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){const t=Me.get(this);let s=t[e];if(!s){const i=this,o=i.shadowRoot||i;s={get ref(){return n},get element(){const t=[...o.querySelectorAll("gem-reflect")].map((t=>t.target));for(const e of[o,...t]){const t=e.querySelector(`[ref=${n}]`);if(t)return t}}},t[e]=s}return s}})}function Re(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){var t;const{states:e}=this.internals;return null===(t=e.has)||void 0===t?void 0:t.call(e,n)},set(t){const{states:e}=this.internals;t?e.add(n):e.delete(n)}})}const He=customElements.define.bind(customElements);function We(t,e,n,s=!1){const i=t.constructor,o=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(o):o?Array.from(o):[]}),i[e][s?"add":"push"](n)}function Ve(t,e){const n=`${O(e)}-${_()}`;We(t,"defineRefs",n),Ae(t,e,n)}function De(t,e,n){We(t,"observedAttributes",n),Ne(t,e,n)}function Ie(t,e){De(t,e,O(e))}function qe(t,e){const n=O(e);We(t,"booleanAttributes",n,!0),De(t,e,n)}function Ue(t,e){const n=O(e);We(t,"numberAttributes",n,!0),De(t,e,n)}function Ge(t,e){We(t,"observedPropertys",e),je(t,e)}function Be(t,e){const n=O(e);We(t,"defineCSSStates",n),Re(t,e,`--${n}`)}function Fe(t,e){const n=O(t[e]||e);t[e]=n,We(t instanceof $e?t:t.prototype,"defineSlots",n)}function ze(t,e){const n=O(t[e]||e);t[e]=n,We(t instanceof $e?t:t.prototype,"defineParts",n)}function Ke(t,e){Qe(t,e)}function Je(t,e){Qe(t,e,{bubbles:!0,composed:!0})}function Qe(t,e,n){const s=O(e);We(t,"defineEvents",s),je(t,e,s,n)}function Ze(t){return function(e){We(e.prototype,"adoptedStyleSheets",t)}}function Xe(t){return function(e){We(e.prototype,"observedStores",t)}}function Ye(t){return function(e){e.rootElement=t}}function tn(t){return function(e){He(t,e)}}customElements.define=(t,e,n)=>{if(e.prototype instanceof $e){const{observedAttributes:t,observedPropertys:n,defineEvents:s,defineCSSStates:i,defineRefs:o}=e;null==t||t.forEach((t=>Ne(e.prototype,$(t),t))),null==n||n.forEach((t=>je(e.prototype,t))),null==s||s.forEach((t=>je(e.prototype,$(t),t))),null==i||i.forEach((t=>Re(e.prototype,$(t),`--${t}`))),null==o||o.forEach((t=>Ae(e.prototype,$(t),t)))}He(t,e,n)};const en="1.5.6";window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,Object.assign({},n));var nn,sn,on,rn,an=function(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},cn=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},ln=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};class hn extends RegExp{constructor(t){const e={};let n=0;super(`^${t.replace(/:([^/$]+)/g,((t,s)=>(e[s]=n++,"([^/]+)"))).replace("*",".*")}$`,"i"),this.namePosition=e}}function un(t,e){const n=new hn(t),s=e.match(n)||`${e}/`.match(n);if(!s)return null;const i={};return s&&Object.keys(n.namePosition).forEach((t=>{i[t]=s[n.namePosition[t]+1]})),i}function dn(t,e){let n=t.pattern;const s=null==e?void 0:e.params;return s&&Object.keys(s).forEach((t=>{n=n.replace(new RegExp(`:${t}`,"g"),s[t])})),n}function pn(t,e){const n=dn(t,e);return Object.assign({path:n},e)}let fn=rn=class extends $e{constructor({isLight:t,routes:e}={}){super({isLight:t}),this.currentParams={},nn.set(this,void 0),this.state={content:void 0},sn.set(this,(()=>{if(this.locationStore){const{path:t,query:e,data:n}=G.getParams();I(this.locationStore,{path:t,params:this.currentParams,query:e,data:n})}})),on.set(this,((t,e,n)=>{cn(this,nn,void 0,"f"),this.currentRoute=t,this.currentParams=e,this.setState({content:n}),this.routeChange(this.currentRoute);const s=null==t?void 0:t.title;s&&I(ot,{title:s}),ln(this,sn,"f").call(this)})),this.routes=e}mounted(){this.effect((([t,e],n)=>{if(n&&t===n[0]&&e===n[1])return void ln(this,sn,"f").call(this);const{route:s,params:i={}}=rn.findRoute(this.routes,e),{redirect:o,content:r,getContent:a}=s||{};if(o)return void G.replace({path:o});const c=r||(null==a?void 0:a(i));if(c instanceof Promise){this.loading(s),cn(this,nn,c,"f");const t=()=>ln(this,nn,"f")===c;c.then((e=>{t()&&ln(this,on,"f").call(this,s,i,e)})).catch((e=>{t()&&this.error(e)}))}else ln(this,on,"f").call(this,s,i,c)}),(()=>{const{path:t}=G.getParams();return[this.key,t,location.search]}))}shouldUpdate(){return!this.inert}render(){const{content:t}=this.state;return this.shadowRoot?Bt`
|
|
3
3
|
<style>
|
|
4
4
|
:host,
|
|
5
5
|
:not(:defined) {
|