@mantou/gem 1.6.0 → 1.6.4

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.
Files changed (59) hide show
  1. package/elements/dialog-base.d.ts +1 -1
  2. package/elements/dialog-base.d.ts.map +1 -1
  3. package/elements/dialog-base.js +3 -1
  4. package/elements/dialog-base.js.map +1 -1
  5. package/elements/gesture.d.ts +2 -1
  6. package/elements/gesture.d.ts.map +1 -1
  7. package/elements/gesture.js +2 -1
  8. package/elements/gesture.js.map +1 -1
  9. package/elements/link.d.ts +1 -1
  10. package/elements/link.d.ts.map +1 -1
  11. package/elements/link.js +3 -1
  12. package/elements/link.js.map +1 -1
  13. package/elements/modal-base.d.ts +16 -7
  14. package/elements/modal-base.d.ts.map +1 -1
  15. package/elements/modal-base.js +3 -1
  16. package/elements/modal-base.js.map +1 -1
  17. package/elements/reflect.d.ts +1 -1
  18. package/elements/reflect.d.ts.map +1 -1
  19. package/elements/reflect.js +2 -1
  20. package/elements/reflect.js.map +1 -1
  21. package/elements/route.d.ts +5 -1
  22. package/elements/route.d.ts.map +1 -1
  23. package/elements/route.js +4 -1
  24. package/elements/route.js.map +1 -1
  25. package/elements/title.d.ts +1 -1
  26. package/elements/title.d.ts.map +1 -1
  27. package/elements/title.js +4 -1
  28. package/elements/title.js.map +1 -1
  29. package/elements/unsafe.d.ts +1 -1
  30. package/elements/unsafe.d.ts.map +1 -1
  31. package/elements/unsafe.js +2 -1
  32. package/elements/unsafe.js.map +1 -1
  33. package/elements/use.d.ts +1 -1
  34. package/elements/use.d.ts.map +1 -1
  35. package/elements/use.js +2 -1
  36. package/elements/use.js.map +1 -1
  37. package/lib/element.d.ts.map +1 -1
  38. package/lib/element.js +31 -5
  39. package/lib/element.js.map +1 -1
  40. package/lib/utils.d.ts.map +1 -1
  41. package/lib/utils.js +4 -1
  42. package/lib/utils.js.map +1 -1
  43. package/lib/version.d.ts +1 -1
  44. package/lib/version.js +1 -1
  45. package/package.json +2 -1
  46. package/src/elements/dialog-base.ts +3 -1
  47. package/src/elements/gesture.ts +2 -1
  48. package/src/elements/link.ts +3 -13
  49. package/src/elements/modal-base.ts +3 -1
  50. package/src/elements/reflect.ts +2 -1
  51. package/src/elements/route.ts +5 -17
  52. package/src/elements/title.ts +4 -1
  53. package/src/elements/unsafe.ts +2 -1
  54. package/src/elements/use.ts +2 -1
  55. package/src/lib/element.ts +30 -6
  56. package/src/lib/utils.ts +3 -1
  57. package/src/lib/version.ts +1 -1
  58. package/umd.js +7 -7
  59. package/umd.js.map +1 -1
package/umd.js CHANGED
@@ -1,17 +1,17 @@
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:()=>Wn,GemActiveLinkElement:()=>wn,GemElement:()=>Ne,GemError:()=>j,GemLightRouteElement:()=>mn,GemLinkElement:()=>yn,GemReflectElement:()=>On,GemRouteElement:()=>gn,GemTitleElement:()=>En,GemUnsafeElement:()=>Tn,GemUseElement:()=>kn,I18n:()=>is,LinkedList:()=>y,PropProxyMap:()=>w,QueryString:()=>b,SVGTemplateResult:()=>Ot,SheetToken:()=>x,StoreListenerMap:()=>V,TemplateResult:()=>Ct,absoluteLocation:()=>v,addMicrotask:()=>p,addMicrotaskToStack:()=>m,adoptedStyle:()=>Xe,attribute:()=>qe,basePathStore:()=>ot,boolattribute:()=>Ue,camelToKebabCase:()=>$,classMap:()=>H,cleanObject:()=>L,connect:()=>U,connectStore:()=>Ye,createCSSSheet:()=>k,createHistoryParams:()=>fn,createModalClass:()=>Nn,createPath:()=>pn,createStore:()=>D,createStoreSet:()=>I,createTheme:()=>Un,css:()=>E,customElement:()=>en,defineAttribute:()=>je,defineCSSState:()=>He,defineProperty:()=>Re,defineRef:()=>Ae,del:()=>hs,directive:()=>ct,disconnect:()=>G,emitter:()=>Ke,get:()=>cs,getThemeProp:()=>qn,getThemeStore:()=>Dn,globalemitter:()=>Qe,guard:()=>se,history:()=>B,html:()=>Ft,ifDefined:()=>oe,isArrayChange:()=>M,kebabToCamelCase:()=>N,matchPath:()=>dn,mediaQuery:()=>fs,nativeDefineElement:()=>We,numattribute:()=>Ge,part:()=>Je,partMap:()=>W,post:()=>ds,property:()=>Be,put:()=>us,randomStr:()=>_,raw:()=>S,refobject:()=>De,removeItems:()=>R,render:()=>Bt,repeat:()=>ee,request:()=>rs,rootElement:()=>tn,slot:()=>ze,splice:()=>ns,state:()=>Fe,styleMap:()=>A,styled:()=>O,svg:()=>zt,titleStore:()=>rt,updateStore:()=>q,updateTheme:()=>Gn,useNativeCSSStyleSheet:()=>P,version:()=>nn});var n={};t.r(n),t.d(n,{GemElement:()=>Ne,GemError:()=>j,LinkedList:()=>y,PropProxyMap:()=>w,QueryString:()=>b,SVGTemplateResult:()=>Ot,SheetToken:()=>x,StoreListenerMap:()=>V,TemplateResult:()=>Ct,absoluteLocation:()=>v,addMicrotask:()=>p,addMicrotaskToStack:()=>m,adoptedStyle:()=>Xe,attribute:()=>qe,basePathStore:()=>ot,boolattribute:()=>Ue,camelToKebabCase:()=>$,classMap:()=>H,cleanObject:()=>L,connect:()=>U,connectStore:()=>Ye,createCSSSheet:()=>k,createStore:()=>D,createStoreSet:()=>I,css:()=>E,customElement:()=>en,defineAttribute:()=>je,defineCSSState:()=>He,defineProperty:()=>Re,defineRef:()=>Ae,directive:()=>ct,disconnect:()=>G,emitter:()=>Ke,globalemitter:()=>Qe,guard:()=>se,history:()=>B,html:()=>Ft,ifDefined:()=>oe,isArrayChange:()=>M,kebabToCamelCase:()=>N,nativeDefineElement:()=>We,numattribute:()=>Ge,part:()=>Je,partMap:()=>W,property:()=>Be,randomStr:()=>_,raw:()=>S,refobject:()=>De,removeItems:()=>R,render:()=>Bt,repeat:()=>ee,rootElement:()=>tn,slot:()=>ze,state:()=>Fe,styleMap:()=>A,styled:()=>O,svg:()=>zt,titleStore:()=>rt,updateStore:()=>q,useNativeCSSStyleSheet:()=>P,version:()=>nn});var s,i,o,r,a,l,c,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 g(){for(let t=f.length-1;t>=0;t--)f[t]();f.length=0}function m(t){f.length||p(g),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),l.set(this,(t=>"string"==typeof t?t:JSON.stringify(t))),c.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,l,"f").call(this,e))}))}setAny(t,e){if(Array.isArray(e))this.delete(t),e.forEach((e=>this.append(t,h(this,l,"f").call(this,e))));else{const n=h(this,l,"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,c,"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)}l=new WeakMap,c=new WeakMap;const x=Symbol("sheet token");let P=!0;try{new CSSStyleSheet}catch(t){P=!1,window.CSSStyleSheet=class{constructor(){this.media={mediaText:""},this.style="",this.replaceSync=t=>this.style=t}}}function k(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 T=new RegExp("&.*{((.|\n)*)}","g");function C(t,e){const n=[];let s=`& {${t.replace(T,(t=>(n.push(t),"")))}}`+n.join("");return s=s.replace(/&/g,"class"===e?".&":"#&"),{styledContent:s,type:e}}const O={class:(t,...e)=>C(S(t,...e),"class"),id:(t,...e)=>C(S(t,...e),"id"),keyframes:(t,...e)=>({styledContent:`@keyframes & {${S(t,...e)}}`,type:"keyframes"})};function $(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}function N(t){return t.replace(/-(.)/g,((t,e)=>e.toUpperCase()))}function L(t){return Object.keys(t).forEach((e=>{delete t[e]})),t}class j extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function M(t,e){const n=t.length;for(let s=0;s<n;s++)if(t[s]!==e[s])return!0;return!1}function R(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+=`${$(n)}:${t[n]};`);return e}function H(t){let e=" ";for(const n in t)t[n]&&(e+=`${n} `);return e}const W=H,V=new WeakMap;function D(t){if(V.has(t))throw new j("argument error");return V.set(t,new Set),t}function I(t){return Object.keys(t).forEach((e=>{D(t[e])})),t}function q(t,e){Object.assign(t,e);const n=V.get(t);null==n||n.forEach((t=>{p(t)}))}function U(t,e){const n=V.get(t);null==n||n.add(e)}function G(t,e){const n=V.get(t);null==n||n.delete(e)}const B=window.history,F=window.location,z=B.pushState.bind(B),J=B.replaceState.bind(B);let K=0;const Q=()=>`${performance.now()}-${++K}`,Z=D({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),X=new Map;function Y({$key:t,$hasCloseHandle:e,$hasOpenHandle:n,$hasShouldCloseHandle:s}={}){if(Z.$key!==t){if(t)throw new j("`$key` is not allowed");if(e)throw new j("`$hasCloseHandle` is not allowed");if(n)throw new j("`$hasOpenHandle` is not allowed");if(s)throw new j("`$hasShouldCloseHandle` is not allowed")}}function tt(t){return B.basePath?B.basePath+t:t}function et(t){return t===B.basePath?"/":t.replace(new RegExp(`^${B.basePath}/`),"/")}function nt(t){const e=X.get(Z.$key)||{},n=t.path?v(e.path,t.path):et(F.pathname),s=new b(t.query||(t.path?"":F.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(F.hash):"");return Object.assign(Object.assign({},t),{title:o,path:n,query:s,hash:a})}function st(t,e){Y(e.data);const n=nt(e),{title:s,path:i,query:o,hash:r,close:a,open:l,shouldClose:c,data:h}=n,u=Object.assign({$hasCloseHandle:!!a,$hasOpenHandle:!!l,$hasShouldCloseHandle:!!c,$key:Q()},h);X.set(u.$key,n),q(L(Z),u);const d=tt(i)+new b(o)+r,p=decodeURIComponent(F.hash);("push"===t?z:J)(u,s,d),p!==r&&window.dispatchEvent(new CustomEvent("hashchange"))}function it(t,e,n,s){Y(e);const i=Object.assign({$key:Q()},e||{}),{pathname:o,search:r,hash:a}=new URL(s,F.origin+F.pathname),l=nt({path:o,query:new b(r),hash:a,title:n,data:e});X.set(i.$key,l),q(L(Z),i);const c=tt(o)+l.query+a,h=F.hash;("push"===t?z:J)(i,n,c),h!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}const ot=D({basePath:""});if(window.addEventListener("hashchange",(({isTrusted:t})=>{t&&B.replace({hash:decodeURIComponent(F.hash)})})),Object.defineProperties(B,{basePath:{get:()=>ot.basePath,set(t){q(ot,{basePath:t}),Object.assign(X.get(Z.$key),{path:et(F.pathname)})}},getParams:{value:function(){return X.get(Z.$key)}},updateParams:{value:function(t){Object.assign(X.get(Z.$key),t),q(Z,{})}},store:{value:Z},push:{value:function(t){B.pushState(t,"")}},pushIgnoreCloseHandle:{value:function(t){var e,n;Z.$hasCloseHandle?(null===(n=null===(e=X.get(Z.$key))||void 0===e?void 0:e.close)||void 0===n||n.call(e),B.replace(t)):B.push(t)}},replace:{value:function(t){st("replace",t)}}}),B.pushState=function(t,e,n){n?it("push",t,e,n):st("push",t)},B.replaceState=function(t,e,n){it("replace",t,e,n)},B.state)if(B.state.$hasCloseHandle){q(Z,B.state);const t=nt({title:document.title});X.set(Z.$key,t),B.back()}else{const t=nt({title:document.title,hash:F.hash});q(Z,Object.assign({$key:Q()},B.state||{})),X.set(Z.$key,t)}else{const{pathname:t,search:e,hash:n}=F;B.replace({path:t,query:e,hash:n})}const rt=D({title:""});U(rt,(()=>{const t=X.get(Z.$key);t&&(t.title=rt.title)})),U(Z,(()=>{const{title:t}=B.getParams();t!==rt.title&&q(rt,{title:t})}));let at=!1;window.addEventListener("popstate",(t=>{var e,n;const s=t.state;if(!(null==s?void 0:s.$key))return;if(at)return void(at=!1);if(!X.has(s.$key)){const{pathname:t,search:e,hash:n}=F;X.set(s.$key,{path:t,query:new b(e),hash:n,title:document.title,data:s})}const i=Z;if(parseFloat(s.$key)>parseFloat(i.$key)&&s.$hasOpenHandle)null===(n=null===(e=X.get(s.$key))||void 0===e?void 0:e.open)||void 0===n||n.call(e);else if(i.$hasCloseHandle){const t=X.get(i.$key),e=null==t?void 0:t.close,n=null==t?void 0:t.shouldClose;if(n&&!n())return at=!0,void B.forward();e?e():s.$hasCloseHandle&&(at=!0,B.back())}q(L(Z),s)}));const lt=new WeakMap,ct=t=>(...e)=>{const n=t(...e);return lt.set(n,!0),n},ht=t=>"function"==typeof t&&lt.has(t),ut="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,dt=(t,e,n=null,s=null)=>{for(;e!==n;){const n=e.nextSibling;t.insertBefore(e,s),e=n}},pt=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},ft={},gt={},mt=`{{lit-${String(Math.random()).slice(2)}}}`,vt=`\x3c!--${mt}--\x3e`,yt=new RegExp(`${mt}|${vt}`),wt="$lit$";class bt{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:l,values:{length:c}}=t;for(;a<c;){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++)St(e[t].name,wt)&&s++;for(;s-- >0;){const e=l[a],n=Pt.exec(e)[2],s=n.toLowerCase()+wt,i=t.getAttribute(s);t.removeAttribute(s);const o=i.split(yt);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(yt),o=i.length-1;for(let e=0;e<o;e++){let n,o=i[e];if(""===o)n=xt();else{const t=Pt.exec(o);null!==t&&St(t[2],wt)&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-wt.length)+t[3]),n=document.createTextNode(o)}s.insertBefore(n,t),this.parts.push({type:"node",index:++r})}""===i[o]?(s.insertBefore(xt(),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(xt(),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 St=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},Et=t=>-1!==t.index,xt=()=>document.createComment(""),Pt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class kt{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=ut?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],Et(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 ut&&(document.adoptNode(t),customElements.upgrade(t)),t}}const _t=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),Tt=` ${mt} `;class Ct{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=Pt.exec(t);e+=null===o?t+(n?Tt:vt):t.substr(0,o.index)+o[1]+o[2]+wt+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 Ot extends Ct{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,n=e.firstChild;return e.removeChild(n),dt(e,n.firstChild),t}}const $t=t=>null===t||!("object"==typeof t||"function"==typeof t),Nt=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class Lt{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 jt(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||!Nt(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($t(t)||!Nt(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 jt{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===ft||$t(t)&&t===this.value||(this.value=t,ht(t)||(this.committer.dirty=!0))}commit(){for(;ht(this.value);){const t=this.value;this.value=ft,t(this)}this.value!==ft&&this.committer.commit()}}class Mt{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(xt()),this.endNode=t.appendChild(xt())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=xt()),t.__insert(this.endNode=xt())}insertAfterPart(t){t.__insert(this.startNode=xt()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;ht(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=ft,t(this)}const t=this.__pendingValue;t!==ft&&($t(t)?t!==this.value&&this.__commitText(t):t instanceof Ct?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):Nt(t)?this.__commitIterable(t):t===gt?(this.value=gt,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 kt&&this.value.template===e)this.value.update(t.values);else{const n=new kt(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 Mt(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){pt(this.startNode.parentNode,t.nextSibling,this.endNode)}}class Rt{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(;ht(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=ft,t(this)}if(this.__pendingValue===ft)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=ft}}class At extends Lt{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new Ht(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Ht extends jt{}let Wt=!1;(()=>{try{const t={get capture(){return Wt=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class Vt{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(;ht(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=ft,t(this)}if(this.__pendingValue===ft)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=Dt(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=ft}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const Dt=t=>t&&(Wt?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),It=new class{handleAttributeExpressions(t,e,n,s){const i=e[0];return"."===i?new At(t,e.slice(1),n).parts:"@"===i?[new Vt(t,e.slice(1),s.eventContext)]:"?"===i?[new Rt(t,e.slice(1),n)]:new Lt(t,e,n).parts}handleTextExpression(t){return new Mt(t)}};function qt(t){let e=Ut.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},Ut.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 bt(t,t.getTemplateElement()),e.keyString.set(s,n)),e.stringsArray.set(t.strings,n),n}const Ut=new Map,Gt=new WeakMap,Bt=(t,e,n)=>{let s=Gt.get(e);void 0===s&&(pt(e,e.firstChild),Gt.set(e,s=new Mt(Object.assign({templateFactory:qt},n))),s.appendInto(e)),s.setValue(t),s.commit()};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const Ft=(t,...e)=>new Ct(t,e,"html",It),zt=(t,...e)=>new Ot(t,e,"svg",It),Jt=(t,e)=>{const n=t.startNode.parentNode,s=void 0===e?t.endNode:e.startNode,i=n.insertBefore(xt(),s);n.insertBefore(xt(),s);const o=new Mt(t.options);return o.insertAfterNode(i),o},Kt=(t,e)=>(t.setValue(e),t.commit(),t),Qt=(t,e,n)=>{const s=t.startNode.parentNode,i=n?n.startNode:t.endNode,o=e.endNode.nextSibling;o!==i&&dt(s,e.startNode,o,i)},Zt=t=>{pt(t.startNode.parentNode,t.startNode,t.endNode.nextSibling)},Xt=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Yt=new WeakMap,te=new WeakMap,ee=ct(((t,e,n)=>{let s;return void 0===n?n=e:void 0!==e&&(s=e),e=>{if(!(e instanceof Mt))throw new Error("repeat can only be used in text bindings");const i=Yt.get(e)||[],o=te.get(e)||[],r=[],a=[],l=[];let c,h,u=0;for(const e of t)l[u]=s?s(e,u):u,a[u]=n(e,u),u++;let d=0,p=i.length-1,f=0,g=a.length-1;for(;d<=p&&f<=g;)if(null===i[d])d++;else if(null===i[p])p--;else if(o[d]===l[f])r[f]=Kt(i[d],a[f]),d++,f++;else if(o[p]===l[g])r[g]=Kt(i[p],a[g]),p--,g--;else if(o[d]===l[g])r[g]=Kt(i[d],a[g]),Qt(e,i[d],r[g+1]),d++,g--;else if(o[p]===l[f])r[f]=Kt(i[p],a[f]),Qt(e,i[p],i[d]),p--,f++;else if(void 0===c&&(c=Xt(l,f,g),h=Xt(o,d,p)),c.has(o[d]))if(c.has(o[p])){const t=h.get(l[f]),n=void 0!==t?i[t]:null;if(null===n){const t=Jt(e,i[d]);Kt(t,a[f]),r[f]=t}else r[f]=Kt(n,a[f]),Qt(e,n,i[d]),i[t]=null;f++}else Zt(i[p]),p--;else Zt(i[d]),d++;for(;f<=g;){const t=Jt(e,r[g+1]);Kt(t,a[f]),r[f++]=t}for(;d<=p;){const t=i[d++];null!==t&&Zt(t)}Yt.set(e,r),te.set(e,l)}})),ne=new WeakMap,se=ct(((t,e)=>n=>{const s=ne.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||ne.has(n)))return;n.setValue(e()),ne.set(n,Array.isArray(t)?Array.from(t):t)})),ie=new WeakMap,oe=ct((t=>e=>{const n=ie.get(e);if(void 0===t&&e instanceof jt){if(void 0!==n||!ie.has(e)){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else t!==n&&e.setValue(t);ie.set(e,t)}));var re,ae,le,ce,he,ue,de,pe,fe,ge,me,ve,ye,we,be,Se,Ee,xe=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)},Pe=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 ke(){}function _e(t){"function"==typeof t&&t()}const Te=new y,Ce=(t=performance.now())=>{if(performance.now()>t+16)return requestAnimationFrame(Ce);const e=Te.get();e&&(e(),Ce(t))};Te.addEventListener("start",(()=>p(Ce)));const Oe=Symbol("init"),$e=Symbol("update");class Ne extends HTMLElement{constructor({isAsync:t,isLight:e,delegatesFocus:n}={}){super(),re.set(this,void 0),ae.set(this,void 0),le.set(this,void 0),ce.set(this,void 0),he.set(this,void 0),ue.set(this,void 0),de.set(this,void 0),this.setState=t=>{if(!this.state)throw new j("`state` not initialized");Object.assign(this.state,t),p(xe(this,be,"f"))},pe.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&&!M(s,o)||(_e(i),t.preCallback=e(o,s),t.values=o)}))})),fe.set(this,(()=>{xe(this,pe,"f").call(this,xe(this,he,"f"))})),ge.set(this,(()=>{xe(this,pe,"f").call(this,xe(this,ue,"f"))})),this.effect=(t,e)=>{xe(this,he,"f")||Pe(this,he,[],"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)),xe(this,he,"f").push(n)},this.memo=(t,e)=>{xe(this,ue,"f")||Pe(this,ue,[],"f"),xe(this,ue,"f").push({callback:t,getDep:e,values:[Symbol()],initialized:this.isConnected})},me.set(this,(()=>{var t;null===(t=xe(this,he,"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)}))})),ve.set(this,(()=>{var t,e;xe(this,ge,"f").call(this);const n=P?"":Ft`${null===(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.adoptedStyleSheets)||void 0===e?void 0:e.map((t=>Ft`
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:()=>Wn,GemActiveLinkElement:()=>wn,GemElement:()=>ge,GemError:()=>bt,GemLightRouteElement:()=>mn,GemLinkElement:()=>yn,GemReflectElement:()=>On,GemRouteElement:()=>gn,GemTitleElement:()=>En,GemUnsafeElement:()=>Tn,GemUseElement:()=>Pn,I18n:()=>is,LinkedList:()=>it,PropProxyMap:()=>ot,QueryString:()=>rt,SVGTemplateResult:()=>_,SheetToken:()=>ct,StoreListenerMap:()=>kt,TemplateResult:()=>x,absoluteLocation:()=>st,addMicrotask:()=>Y,addMicrotaskToStack:()=>nt,adoptedStyle:()=>Ae,attribute:()=>ke,basePathStore:()=>tn,boolattribute:()=>Te,camelToKebabCase:()=>vt,classMap:()=>_t,cleanObject:()=>wt,connect:()=>$t,connectStore:()=>He,createCSSSheet:()=>dt,createHistoryParams:()=>fn,createModalClass:()=>Nn,createPath:()=>pn,createStore:()=>Tt,createStoreSet:()=>Ct,createTheme:()=>Un,css:()=>lt,customElement:()=>Ve,defineAttribute:()=>ve,defineCSSState:()=>Se,defineProperty:()=>we,defineRef:()=>be,del:()=>hs,directive:()=>i,disconnect:()=>Nt,emitter:()=>je,get:()=>cs,getThemeProp:()=>qn,getThemeStore:()=>Dn,globalemitter:()=>Me,guard:()=>It,history:()=>De,html:()=>I,ifDefined:()=>Ut,isArrayChange:()=>St,kebabToCamelCase:()=>yt,matchPath:()=>dn,mediaQuery:()=>fs,nativeDefineElement:()=>Ee,numattribute:()=>Ce,part:()=>Le,partMap:()=>Pt,post:()=>ds,property:()=>Oe,put:()=>us,randomStr:()=>pt,raw:()=>at,refobject:()=>_e,removeItems:()=>Et,render:()=>D,repeat:()=>Vt,request:()=>rs,rootElement:()=>We,slot:()=>Ne,splice:()=>ns,state:()=>$e,styleMap:()=>xt,styled:()=>mt,svg:()=>q,titleStore:()=>en,updateStore:()=>Ot,updateTheme:()=>Gn,useNativeCSSStyleSheet:()=>ht,version:()=>gs});var n={};t.r(n),t.d(n,{GemElement:()=>ge,GemError:()=>bt,LinkedList:()=>it,PropProxyMap:()=>ot,QueryString:()=>rt,SVGTemplateResult:()=>_,SheetToken:()=>ct,StoreListenerMap:()=>kt,TemplateResult:()=>x,absoluteLocation:()=>st,addMicrotask:()=>Y,addMicrotaskToStack:()=>nt,adoptedStyle:()=>Ae,attribute:()=>ke,basePathStore:()=>tn,boolattribute:()=>Te,camelToKebabCase:()=>vt,classMap:()=>_t,cleanObject:()=>wt,connect:()=>$t,connectStore:()=>He,createCSSSheet:()=>dt,createStore:()=>Tt,createStoreSet:()=>Ct,css:()=>lt,customElement:()=>Ve,defineAttribute:()=>ve,defineCSSState:()=>Se,defineProperty:()=>we,defineRef:()=>be,directive:()=>i,disconnect:()=>Nt,emitter:()=>je,globalemitter:()=>Me,guard:()=>It,history:()=>De,html:()=>I,ifDefined:()=>Ut,isArrayChange:()=>St,kebabToCamelCase:()=>yt,nativeDefineElement:()=>Ee,numattribute:()=>Ce,part:()=>Le,partMap:()=>Pt,property:()=>Oe,randomStr:()=>pt,raw:()=>at,refobject:()=>_e,removeItems:()=>Et,render:()=>D,repeat:()=>Vt,rootElement:()=>We,slot:()=>Ne,state:()=>$e,styleMap:()=>xt,styled:()=>mt,svg:()=>q,titleStore:()=>en,updateStore:()=>Ot,useNativeCSSStyleSheet:()=>ht,version:()=>gs});const s=new WeakMap,i=t=>(...e)=>{const n=t(...e);return s.set(n,!0),n},o=t=>"function"==typeof t&&s.has(t),r="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,a=(t,e,n=null,s=null)=>{for(;e!==n;){const n=e.nextSibling;t.insertBefore(e,s),e=n}},l=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},c={},h={},u=`{{lit-${String(Math.random()).slice(2)}}}`,d=`\x3c!--${u}--\x3e`,p=new RegExp(`${u}|${d}`),f="$lit$";class g{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:l,values:{length:c}}=t;for(;a<c;){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++)m(e[t].name,f)&&s++;for(;s-- >0;){const e=l[a],n=w.exec(e)[2],s=n.toLowerCase()+f,i=t.getAttribute(s);t.removeAttribute(s);const o=i.split(p);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(u)>=0){const s=t.parentNode,i=e.split(p),o=i.length-1;for(let e=0;e<o;e++){let n,o=i[e];if(""===o)n=y();else{const t=w.exec(o);null!==t&&m(t[2],f)&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-f.length)+t[3]),n=document.createTextNode(o)}s.insertBefore(n,t),this.parts.push({type:"node",index:++r})}""===i[o]?(s.insertBefore(y(),t),n.push(t)):t.data=i[o],a+=o}}else if(8===t.nodeType)if(t.data===u){const e=t.parentNode;null!==t.previousSibling&&r!==o||(r++,e.insertBefore(y(),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(u,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 m=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},v=t=>-1!==t.index,y=()=>document.createComment(""),w=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class b{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=r?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,a=0,l=s.nextNode();for(;o<n.length;)if(i=n[o],v(i)){for(;a<i.index;)a++,"TEMPLATE"===l.nodeName&&(e.push(l),s.currentNode=l.content),null===(l=s.nextNode())&&(s.currentNode=e.pop(),l=s.nextNode());if("node"===i.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(l.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,i.name,i.strings,this.options));o++}else this.__parts.push(void 0),o++;return r&&(document.adoptNode(t),customElements.upgrade(t)),t}}const S=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),E=` ${u} `;class x{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=w.exec(t);e+=null===o?t+(n?E:d):t.substr(0,o.index)+o[1]+o[2]+f+o[3]+u}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==S&&(e=S.createHTML(e)),t.innerHTML=e,t}}class _ extends x{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,n=e.firstChild;return e.removeChild(n),a(e,n.firstChild),t}}const P=t=>null===t||!("object"==typeof t||"function"==typeof t),k=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class T{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 C(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||!k(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(P(t)||!k(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 C{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===c||P(t)&&t===this.value||(this.value=t,o(t)||(this.committer.dirty=!0))}commit(){for(;o(this.value);){const t=this.value;this.value=c,t(this)}this.value!==c&&this.committer.commit()}}class O{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(y()),this.endNode=t.appendChild(y())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=y()),t.__insert(this.endNode=y())}insertAfterPart(t){t.__insert(this.startNode=y()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;o(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=c,t(this)}const t=this.__pendingValue;t!==c&&(P(t)?t!==this.value&&this.__commitText(t):t instanceof x?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):k(t)?this.__commitIterable(t):t===h?(this.value=h,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 b&&this.value.template===e)this.value.update(t.values);else{const n=new b(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 O(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){l(this.startNode.parentNode,t.nextSibling,this.endNode)}}class ${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(;o(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=c,t(this)}if(this.__pendingValue===c)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=c}}class N extends T{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new L(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class L extends C{}let j=!1;(()=>{try{const t={get capture(){return j=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class M{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(;o(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=c,t(this)}if(this.__pendingValue===c)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=R(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=c}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const R=t=>t&&(j?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),A=new class{handleAttributeExpressions(t,e,n,s){const i=e[0];return"."===i?new N(t,e.slice(1),n).parts:"@"===i?[new M(t,e.slice(1),s.eventContext)]:"?"===i?[new $(t,e.slice(1),n)]:new T(t,e,n).parts}handleTextExpression(t){return new O(t)}};function H(t){let e=W.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},W.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const s=t.strings.join(u);return n=e.keyString.get(s),void 0===n&&(n=new g(t,t.getTemplateElement()),e.keyString.set(s,n)),e.stringsArray.set(t.strings,n),n}const W=new Map,V=new WeakMap,D=(t,e,n)=>{let s=V.get(e);void 0===s&&(l(e,e.firstChild),V.set(e,s=new O(Object.assign({templateFactory:H},n))),s.appendInto(e)),s.setValue(t),s.commit()};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const I=(t,...e)=>new x(t,e,"html",A),q=(t,...e)=>new _(t,e,"svg",A);var U,G,B,F,z,J,K,Q=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)},Z=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 X=new Set;function Y(t){"function"==typeof t&&(X.size||globalThis.queueMicrotask((()=>{X.forEach((t=>t())),X.clear()})),X.delete(t),X.add(t))}const tt=[];function et(){for(let t=tt.length-1;t>=0;t--)tt[t]();tt.length=0}function nt(t){tt.length||Y(et),tt.push(t)}function st(t="",e=""){const{pathname:n,search:s,hash:i}=new URL(e,location.origin+t);return n+s+i}class it extends(globalThis.EventTarget||Object){constructor(){super(...arguments),U.add(this),G.set(this,new Map),B.set(this,void 0),F.set(this,void 0)}get size(){return Q(this,G,"f").size}add(t){Q(this,F,"f")||this.dispatchEvent(new CustomEvent("start"));const e=Q(this,U,"m",z).call(this,t)||{value:t};e.prev=Q(this,F,"f"),e.prev&&(e.prev.next=e),e.next=void 0,Z(this,F,e,"f"),Q(this,B,"f")||Z(this,B,e,"f"),Q(this,G,"f").set(t,e)}delete(t){const e=Q(this,U,"m",z).call(this,t);return Q(this,B,"f")||this.dispatchEvent(new CustomEvent("end")),e}get(){const t=Q(this,B,"f");if(t)return Q(this,U,"m",z).call(this,t.value),t.value}}G=new WeakMap,B=new WeakMap,F=new WeakMap,U=new WeakSet,z=function(t){const e=Q(this,G,"f").get(t);return e&&(e.prev?e.prev.next=e.next:Z(this,B,e.next,"f"),e.next?e.next.prev=e.prev:Z(this,F,e.prev,"f"),Q(this,G,"f").delete(t)),e};class ot extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class rt extends URLSearchParams{constructor(t){super(t),J.set(this,(t=>"string"==typeof t?t:JSON.stringify(t))),K.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,Q(this,J,"f").call(this,e))}))}setAny(t,e){if(Array.isArray(e))this.delete(t),e.forEach((e=>this.append(t,Q(this,J,"f").call(this,e))));else{const n=Q(this,J,"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=>Q(this,K,"f").call(this,t)))}toString(){const t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}function at(t,...e){return t.reduce(((t,n,s)=>{var i;return t+(null!==(i=e[s-1])&&void 0!==i?i:"")+n}))}function lt(t,...e){return at(t,...e)}J=new WeakMap,K=new WeakMap;const ct=Symbol("sheet token");let ht=!0,ut=window.CSSStyleSheet;try{new ut}catch(t){ht=!1,ut=class{constructor(){this.media={mediaText:""},this.style="",this.replaceSync=t=>this.style=t}}}function dt(t,e=""){const n=new ut,s={};n.media.mediaText=e;let i="";return"string"==typeof t?i=t:Object.keys(t).forEach((e=>{s[e]=`${e}-${pt()}`,i+=t[e].styledContent.replace(/&/g,s[e])})),n.replaceSync(i),s[ct]=n,s}function pt(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 ft=new RegExp("&.*{((.|\n)*)}","g");function gt(t,e){const n=[];let s=`& {${t.replace(ft,(t=>(n.push(t),"")))}}`+n.join("");return s=s.replace(/&/g,"class"===e?".&":"#&"),{styledContent:s,type:e}}const mt={class:(t,...e)=>gt(at(t,...e),"class"),id:(t,...e)=>gt(at(t,...e),"id"),keyframes:(t,...e)=>({styledContent:`@keyframes & {${at(t,...e)}}`,type:"keyframes"})};function vt(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}function yt(t){return t.replace(/-(.)/g,((t,e)=>e.toUpperCase()))}function wt(t){return Object.keys(t).forEach((e=>{delete t[e]})),t}class bt extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function St(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 Et(t,e){const n=new Set(e);return t.filter((t=>!n.has(t)||(n.delete(t),!1)))}function xt(t){let e="";for(const n in t)t[n]&&(e+=`${vt(n)}:${t[n]};`);return e}function _t(t){let e=" ";for(const n in t)t[n]&&(e+=`${n} `);return e}const Pt=_t,kt=new WeakMap;function Tt(t){if(kt.has(t))throw new bt("argument error");return kt.set(t,new Set),t}function Ct(t){return Object.keys(t).forEach((e=>{Tt(t[e])})),t}function Ot(t,e){Object.assign(t,e);const n=kt.get(t);null==n||n.forEach((t=>{Y(t)}))}function $t(t,e){const n=kt.get(t);null==n||n.add(e)}function Nt(t,e){const n=kt.get(t);null==n||n.delete(e)}const Lt=(t,e)=>{const n=t.startNode.parentNode,s=void 0===e?t.endNode:e.startNode,i=n.insertBefore(y(),s);n.insertBefore(y(),s);const o=new O(t.options);return o.insertAfterNode(i),o},jt=(t,e)=>(t.setValue(e),t.commit(),t),Mt=(t,e,n)=>{const s=t.startNode.parentNode,i=n?n.startNode:t.endNode,o=e.endNode.nextSibling;o!==i&&a(s,e.startNode,o,i)},Rt=t=>{l(t.startNode.parentNode,t.startNode,t.endNode.nextSibling)},At=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Ht=new WeakMap,Wt=new WeakMap,Vt=i(((t,e,n)=>{let s;return void 0===n?n=e:void 0!==e&&(s=e),e=>{if(!(e instanceof O))throw new Error("repeat can only be used in text bindings");const i=Ht.get(e)||[],o=Wt.get(e)||[],r=[],a=[],l=[];let c,h,u=0;for(const e of t)l[u]=s?s(e,u):u,a[u]=n(e,u),u++;let d=0,p=i.length-1,f=0,g=a.length-1;for(;d<=p&&f<=g;)if(null===i[d])d++;else if(null===i[p])p--;else if(o[d]===l[f])r[f]=jt(i[d],a[f]),d++,f++;else if(o[p]===l[g])r[g]=jt(i[p],a[g]),p--,g--;else if(o[d]===l[g])r[g]=jt(i[d],a[g]),Mt(e,i[d],r[g+1]),d++,g--;else if(o[p]===l[f])r[f]=jt(i[p],a[f]),Mt(e,i[p],i[d]),p--,f++;else if(void 0===c&&(c=At(l,f,g),h=At(o,d,p)),c.has(o[d]))if(c.has(o[p])){const t=h.get(l[f]),n=void 0!==t?i[t]:null;if(null===n){const t=Lt(e,i[d]);jt(t,a[f]),r[f]=t}else r[f]=jt(n,a[f]),Mt(e,n,i[d]),i[t]=null;f++}else Rt(i[p]),p--;else Rt(i[d]),d++;for(;f<=g;){const t=Lt(e,r[g+1]);jt(t,a[f]),r[f++]=t}for(;d<=p;){const t=i[d++];null!==t&&Rt(t)}Ht.set(e,r),Wt.set(e,l)}})),Dt=new WeakMap,It=i(((t,e)=>n=>{const s=Dt.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||Dt.has(n)))return;n.setValue(e()),Dt.set(n,Array.isArray(t)?Array.from(t):t)})),qt=new WeakMap,Ut=i((t=>e=>{const n=qt.get(e);if(void 0===t&&e instanceof C){if(void 0!==n||!qt.has(e)){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else t!==n&&e.setValue(t);qt.set(e,t)}));var Gt,Bt,Ft,zt,Jt,Kt,Qt,Zt,Xt,Yt,te,ee,ne,se,ie,oe,re,ae=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)},le=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 ce(){}function he(t){"function"==typeof t&&t()}const ue=new it,de=(t=performance.now())=>{if(performance.now()>t+16)return requestAnimationFrame(de);const e=ue.get();e&&(e(),de(t))};ue.addEventListener("start",(()=>Y(de)));const pe=Symbol("init"),fe=Symbol("update");class ge extends HTMLElement{constructor({isAsync:t,isLight:e,delegatesFocus:n}={}){super(),Gt.set(this,void 0),Bt.set(this,void 0),Ft.set(this,void 0),zt.set(this,void 0),Jt.set(this,void 0),Kt.set(this,void 0),Qt.set(this,void 0),this.setState=t=>{if(!this.state)throw new bt("`state` not initialized");Object.assign(this.state,t),Y(ae(this,ie,"f"))},Zt.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&&!St(s,o)||(he(i),t.preCallback=e(o,s),t.values=o)}))})),Xt.set(this,(()=>{ae(this,Zt,"f").call(this,ae(this,Jt,"f"))})),Yt.set(this,(()=>{ae(this,Zt,"f").call(this,ae(this,Kt,"f"))})),this.effect=(t,e)=>{ae(this,Jt,"f")||le(this,Jt,[],"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)),ae(this,Jt,"f").push(n)},this.memo=(t,e)=>{ae(this,Kt,"f")||le(this,Kt,[],"f"),ae(this,Kt,"f").push({callback:t,getDep:e,values:[Symbol()],initialized:this.isConnected})},te.set(this,(()=>{var t;null===(t=ae(this,Jt,"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)}))})),ee.set(this,(()=>{var t,e;ae(this,Yt,"f").call(this);const n=ht?"":I`${null===(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.adoptedStyleSheets)||void 0===e?void 0:e.map((t=>I`
3
3
  <style media=${t.media.mediaText}>
4
4
  ${t.style}
5
5
  </style>
6
- `))}`;return this.render?Ft`${this.render()}${n}`:xe(this,re,"f")===this?void 0:Ft`<slot></slot>${n}`})),ye.set(this,(()=>!this.shouldUpdate||this.shouldUpdate())),we.set(this,(()=>{if(this.isConnected&&xe(this,ye,"f").call(this)){const t=xe(this,ve,"f").call(this);void 0!==t&&Bt(t,xe(this,re,"f")),p(xe(this,Se,"f")),p(xe(this,fe,"f"))}})),be.set(this,(()=>{xe(this,ce,"f")?Te.add(xe(this,we,"f")):xe(this,we,"f").call(this)})),this.update=()=>{p(xe(this,be,"f"))},Se.set(this,(()=>{var t;null===(t=this.updated)||void 0===t||t.call(this)})),Ee.set(this,(()=>{var t,e,n;if(xe(this,le,"f"))return void Pe(this,le,!1,"f");null===(t=this.willMount)||void 0===t||t.call(this);const{observedStores:s,rootElement:i}=this.constructor;null==s||s.forEach((t=>{U(t,xe(this,be,"f"))}));const o=xe(this,ve,"f").call(this);if(void 0!==o&&Bt(o,xe(this,re,"f")),Pe(this,de,null===(e=this.mounted)||void 0===e?void 0:e.call(this),"f"),xe(this,me,"f").call(this),i&&(null===(n=this.getRootNode().host)||void 0===n?void 0:n.tagName)!==i.toUpperCase())throw new j("not allow current root type")})),p((()=>this[Oe]=!1)),this[Oe]=!0,this[$e]=()=>{this.isConnected&&p(xe(this,be,"f"))},Pe(this,ce,t,"f"),Pe(this,re,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=R(e.adoptedStyleSheets,t)}}),(()=>[]))}}get internals(){if(!xe(this,ae,"f")){const t=()=>{const t=t=>t.replace("--","");return{has:e=>t(e)in this.dataset,add:e=>{this.dataset[t(e)]=""},delete:e=>delete this.dataset[t(e)]}};this.attachInternals||(this.attachInternals=()=>({states:t()})),Pe(this,ae,this.attachInternals(),"f"),xe(this,ae,"f").states||(xe(this,ae,"f").states=t())}return xe(this,ae,"f")}attributeChangedCallback(){this.isConnected&&p(xe(this,be,"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(){xe(this,ce,"f")?Te.add(xe(this,Ee,"f")):xe(this,Ee,"f").call(this)}disconnectedCallback(){var t,e,n;if(this.isConnected)return void Pe(this,le,!0,"f");const{observedStores:s}=this.constructor;null==s||s.forEach((t=>{G(t,xe(this,be,"f"))})),_e(xe(this,de,"f")),null===(t=this.unmounted)||void 0===t||t.call(this),null===(e=xe(this,he,"f"))||void 0===e||e.forEach((t=>{_e(t.preCallback)})),Pe(this,ue,null===(n=xe(this,ue,"f"))||void 0===n?void 0:n.filter((({initialized:t})=>!t)),"f")}}re=new WeakMap,ae=new WeakMap,le=new WeakMap,ce=new WeakMap,he=new WeakMap,ue=new WeakMap,de=new WeakMap,pe=new WeakMap,fe=new WeakMap,ge=new WeakMap,me=new WeakMap,ve=new WeakMap,ye=new WeakMap,we=new WeakMap,be=new WeakMap,Se=new WeakMap,Ee=new WeakMap;const Le=new w;function je(t,e,n){const{booleanAttributes:s,numberAttributes:i}=t.constructor;Object.defineProperty(t,e,{configurable:!0,get(){if(!(Oe 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=Le.get(this),r=o[e],a=i.getAttribute(n);if(this[Oe]&&null!==a&&!r)return;o[e]=!0;const l=null==s?void 0:s.has(n);null==t?i.removeAttribute(n):l?i.toggleAttribute(n,!!t):a!==String(t)&&i.setAttribute(n,String(t))}})}const Me=Symbol("event handle");function Re(t,e,n,s){Object.defineProperty(t,e,{configurable:!0,get(){const t=Le.get(this)[e];return t||!n?t:(this[e]=ke,this[e])},set(t){const i=this,o=Le.get(i);t!==o[e]&&(n?(o[e]=(null==t?void 0:t[Me])?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][Me]=!0):(o[e]=t,this[$e]()))}})}function Ae(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){const t=Le.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 He(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 We=customElements.define.bind(customElements);function Ve(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 De(t,e){const n=`${$(e)}-${_()}`;Ve(t,"defineRefs",n),Ae(t,e,n)}function Ie(t,e,n){Ve(t,"observedAttributes",n),je(t,e,n)}function qe(t,e){Ie(t,e,$(e))}function Ue(t,e){const n=$(e);Ve(t,"booleanAttributes",n,!0),Ie(t,e,n)}function Ge(t,e){const n=$(e);Ve(t,"numberAttributes",n,!0),Ie(t,e,n)}function Be(t,e){Ve(t,"observedPropertys",e),Re(t,e)}function Fe(t,e){const n=$(e);Ve(t,"defineCSSStates",n),He(t,e,`--${n}`)}function ze(t,e){const n=$(t[e]||e);t[e]=n,Ve(t instanceof Ne?t:t.prototype,"defineSlots",n)}function Je(t,e){const n=$(t[e]||e);t[e]=n,Ve(t instanceof Ne?t:t.prototype,"defineParts",n)}function Ke(t,e){Ze(t,e)}function Qe(t,e){Ze(t,e,{bubbles:!0,composed:!0})}function Ze(t,e,n){const s=$(e);Ve(t,"defineEvents",s),Re(t,e,s,n)}function Xe(t){return function(e){Ve(e.prototype,"adoptedStyleSheets",t)}}function Ye(t){return function(e){Ve(e.prototype,"observedStores",t)}}function tn(t){return function(e){e.rootElement=t}}function en(t){return function(e){We(t,e)}}customElements.define=(t,e,n)=>{if(e.prototype instanceof Ne){const{observedAttributes:t,observedPropertys:n,defineEvents:s,defineCSSStates:i,defineRefs:o}=e;null==t||t.forEach((t=>je(e.prototype,N(t),t))),null==n||n.forEach((t=>Re(e.prototype,t))),null==s||s.forEach((t=>Re(e.prototype,N(t),t))),null==i||i.forEach((t=>He(e.prototype,N(t),`--${t}`))),null==o||o.forEach((t=>Ae(e.prototype,N(t),t)))}We(t,e,n)};const nn="1.6.0";window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,Object.assign({},n));var sn,on,rn,an,ln=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},hn=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 un extends RegExp{constructor(t){const e={};let n=0;super(`^${t.replace(/:([^/$]+)/g,((t,s)=>(e[s]=n++,"([^/]+)"))).replace("*",".*")}$`,"i"),this.namePosition=e}}function dn(t,e){const n=new un(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 pn(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 fn(t,e){const n=pn(t,e);return Object.assign({path:n},e)}let gn=an=class extends Ne{constructor({isLight:t,routes:e}={}){super({isLight:t}),this.currentParams={},sn.set(this,void 0),this.state={content:void 0},on.set(this,(()=>{if(this.locationStore){const{path:t,query:e,data:n}=B.getParams();q(this.locationStore,{path:t,params:this.currentParams,query:e,data:n})}})),rn.set(this,((t,e,n)=>{cn(this,sn,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&&q(rt,{title:s}),hn(this,on,"f").call(this)})),this.routes=e}mounted(){this.effect((([t,e],n)=>{if(n&&t===n[0]&&e===n[1])return void hn(this,on,"f").call(this);const{route:s,params:i={}}=an.findRoute(this.routes,e),{redirect:o,content:r,getContent:a}=s||{};if(o)return void B.replace({path:o});const l=r||(null==a?void 0:a(i));if(l instanceof Promise){this.loading(s),cn(this,sn,l,"f");const t=()=>hn(this,sn,"f")===l;l.then((e=>{t()&&hn(this,rn,"f").call(this,s,i,e)})).catch((e=>{t()&&this.error(e)}))}else hn(this,rn,"f").call(this,s,i,l)}),(()=>{const{path:t}=B.getParams();return[this.key,t,location.search]}))}shouldUpdate(){return!this.inert}render(){const{content:t}=this.state;return this.shadowRoot?Ft`
6
+ `))}`;return this.render?I`${this.render()}${n}`:ae(this,Gt,"f")===this?void 0:I`<slot></slot>${n}`})),ne.set(this,(()=>!this.shouldUpdate||this.shouldUpdate())),se.set(this,(()=>{if(this.isConnected&&ae(this,ne,"f").call(this)){const t=ae(this,ee,"f").call(this);void 0!==t&&D(t,ae(this,Gt,"f")),Y(ae(this,oe,"f")),Y(ae(this,Xt,"f"))}})),ie.set(this,(()=>{ae(this,zt,"f")?ue.add(ae(this,se,"f")):ae(this,se,"f").call(this)})),this.update=()=>{Y(ae(this,ie,"f"))},oe.set(this,(()=>{var t;null===(t=this.updated)||void 0===t||t.call(this)})),re.set(this,(()=>{var t,e,n;if(ae(this,Ft,"f"))return void le(this,Ft,!1,"f");null===(t=this.willMount)||void 0===t||t.call(this);const{observedStores:s,rootElement:i}=this.constructor;null==s||s.forEach((t=>{$t(t,ae(this,ie,"f"))}));const o=ae(this,ee,"f").call(this);if(void 0!==o&&D(o,ae(this,Gt,"f")),le(this,Qt,null===(e=this.mounted)||void 0===e?void 0:e.call(this),"f"),ae(this,te,"f").call(this),i&&(null===(n=this.getRootNode().host)||void 0===n?void 0:n.tagName)!==i.toUpperCase())throw new bt("not allow current root type")})),Y((()=>this[pe]=!1)),this[pe]=!0,this[fe]=()=>{this.isConnected&&Y(ae(this,ie,"f"))},le(this,zt,t,"f"),le(this,Gt,e?this:this.attachShadow({mode:"open",delegatesFocus:n}),"f");const{adoptedStyleSheets:s}=new.target;if(s){const t=s.map((t=>t[ct]||t));this.shadowRoot?this.shadowRoot.adoptedStyleSheets=t:this.effect((()=>{const e=this.getRootNode();if(ht)return e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t],()=>{e.adoptedStyleSheets=Et(e.adoptedStyleSheets,t)};{const n=e===document?document.body:e;return n._sheets=n._sheets||{},t.forEach((({style:t,media:e})=>{if(n._sheets[t])n._sheets[t].count++;else{const s=document.createElement("style");s.innerHTML=t,s.media=e.mediaText,n.append(s),n._sheets[t]={ele:s,count:1}}})),()=>{t.forEach((({style:t})=>{n._sheets[t].count--,n._sheets[t].count||delete n._sheets[t]}))}}}),(()=>[]))}}get internals(){if(!ae(this,Bt,"f")){const t=()=>{const t=t=>t.replace(/-/g,"");return{has:e=>t(e)in this.dataset,add:e=>{this.dataset[t(e)]=""},delete:e=>delete this.dataset[t(e)]}};this.attachInternals||(this.attachInternals=()=>({states:t()})),le(this,Bt,this.attachInternals(),"f"),ae(this,Bt,"f").states||(ae(this,Bt,"f").states=t())}return ae(this,Bt,"f")}attributeChangedCallback(){this.isConnected&&Y(ae(this,ie,"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(){ae(this,zt,"f")?ue.add(ae(this,re,"f")):ae(this,re,"f").call(this)}disconnectedCallback(){var t,e,n;if(this.isConnected)return void le(this,Ft,!0,"f");const{observedStores:s}=this.constructor;null==s||s.forEach((t=>{Nt(t,ae(this,ie,"f"))})),he(ae(this,Qt,"f")),null===(t=this.unmounted)||void 0===t||t.call(this),null===(e=ae(this,Jt,"f"))||void 0===e||e.forEach((t=>{he(t.preCallback)})),le(this,Kt,null===(n=ae(this,Kt,"f"))||void 0===n?void 0:n.filter((({initialized:t})=>!t)),"f")}}Gt=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,zt=new WeakMap,Jt=new WeakMap,Kt=new WeakMap,Qt=new WeakMap,Zt=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,te=new WeakMap,ee=new WeakMap,ne=new WeakMap,se=new WeakMap,ie=new WeakMap,oe=new WeakMap,re=new WeakMap;const me=new ot;function ve(t,e,n){const{booleanAttributes:s,numberAttributes:i}=t.constructor;Object.defineProperty(t,e,{configurable:!0,get(){if(!(pe 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[pe]&&null!==a&&!r)return;o[e]=!0;const l=null==s?void 0:s.has(n);null==t?i.removeAttribute(n):l?i.toggleAttribute(n,!!t):a!==String(t)&&i.setAttribute(n,String(t))}})}const ye=Symbol("event handle");function we(t,e,n,s){Object.defineProperty(t,e,{configurable:!0,get(){const t=me.get(this)[e];return t||!n?t:(this[e]=ce,this[e])},set(t){const i=this,o=me.get(i);t!==o[e]&&(n?(o[e]=(null==t?void 0:t[ye])?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][ye]=!0):(o[e]=t,this[fe]()))}})}function be(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 Se(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 Ee=customElements.define.bind(customElements);function xe(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 _e(t,e){const n=`${vt(e)}-${pt()}`;xe(t,"defineRefs",n),be(t,e,n)}function Pe(t,e,n){xe(t,"observedAttributes",n),ve(t,e,n)}function ke(t,e){Pe(t,e,vt(e))}function Te(t,e){const n=vt(e);xe(t,"booleanAttributes",n,!0),Pe(t,e,n)}function Ce(t,e){const n=vt(e);xe(t,"numberAttributes",n,!0),Pe(t,e,n)}function Oe(t,e){xe(t,"observedPropertys",e),we(t,e)}function $e(t,e){const n=vt(e);xe(t,"defineCSSStates",n),Se(t,e,`--${n}`)}function Ne(t,e){const n=vt(t[e]||e);t[e]=n,xe(t instanceof ge?t:t.prototype,"defineSlots",n)}function Le(t,e){const n=vt(t[e]||e);t[e]=n,xe(t instanceof ge?t:t.prototype,"defineParts",n)}function je(t,e){Re(t,e)}function Me(t,e){Re(t,e,{bubbles:!0,composed:!0})}function Re(t,e,n){const s=vt(e);xe(t,"defineEvents",s),we(t,e,s,n)}function Ae(t){return function(e){xe(e.prototype,"adoptedStyleSheets",t)}}function He(t){return function(e){xe(e.prototype,"observedStores",t)}}function We(t){return function(e){e.rootElement=t}}function Ve(t){return function(e){Ee(t,e)}}customElements.define=(t,e,n)=>{if(e.prototype instanceof ge){const{observedAttributes:t,observedPropertys:n,defineEvents:s,defineCSSStates:i,defineRefs:o}=e;null==t||t.forEach((t=>ve(e.prototype,yt(t),t))),null==n||n.forEach((t=>we(e.prototype,t))),null==s||s.forEach((t=>we(e.prototype,yt(t),t))),null==i||i.forEach((t=>Se(e.prototype,yt(t),`--${t}`))),null==o||o.forEach((t=>be(e.prototype,yt(t),t)))}Ee(t,e,n)};const De=window.history,Ie=window.location,qe=De.pushState.bind(De),Ue=De.replaceState.bind(De);let Ge=0;const Be=()=>`${performance.now()}-${++Ge}`,Fe=Tt({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),ze=new Map;function Je({$key:t,$hasCloseHandle:e,$hasOpenHandle:n,$hasShouldCloseHandle:s}={}){if(Fe.$key!==t){if(t)throw new bt("`$key` is not allowed");if(e)throw new bt("`$hasCloseHandle` is not allowed");if(n)throw new bt("`$hasOpenHandle` is not allowed");if(s)throw new bt("`$hasShouldCloseHandle` is not allowed")}}function Ke(t){return De.basePath?De.basePath+t:t}function Qe(t){return t===De.basePath?"/":t.replace(new RegExp(`^${De.basePath}/`),"/")}function Ze(t){const e=ze.get(Fe.$key)||{},n=t.path?st(e.path,t.path):Qe(Ie.pathname),s=new rt(t.query||(t.path?"":Ie.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(Ie.hash):"");return Object.assign(Object.assign({},t),{title:o,path:n,query:s,hash:a})}function Xe(t,e){Je(e.data);const n=Ze(e),{title:s,path:i,query:o,hash:r,close:a,open:l,shouldClose:c,data:h}=n,u=Object.assign({$hasCloseHandle:!!a,$hasOpenHandle:!!l,$hasShouldCloseHandle:!!c,$key:Be()},h);ze.set(u.$key,n),Ot(wt(Fe),u);const d=Ke(i)+new rt(o)+r,p=decodeURIComponent(Ie.hash);("push"===t?qe:Ue)(u,s,d),p!==r&&window.dispatchEvent(new CustomEvent("hashchange"))}function Ye(t,e,n,s){Je(e);const i=Object.assign({$key:Be()},e||{}),{pathname:o,search:r,hash:a}=new URL(s,Ie.origin+Ie.pathname),l=Ze({path:o,query:new rt(r),hash:a,title:n,data:e});ze.set(i.$key,l),Ot(wt(Fe),i);const c=Ke(o)+l.query+a,h=Ie.hash;("push"===t?qe:Ue)(i,n,c),h!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}const tn=Tt({basePath:""});if(window.addEventListener("hashchange",(({isTrusted:t})=>{t&&De.replace({hash:decodeURIComponent(Ie.hash)})})),Object.defineProperties(De,{basePath:{get:()=>tn.basePath,set(t){Ot(tn,{basePath:t}),Object.assign(ze.get(Fe.$key),{path:Qe(Ie.pathname)})}},getParams:{value:function(){return ze.get(Fe.$key)}},updateParams:{value:function(t){Object.assign(ze.get(Fe.$key),t),Ot(Fe,{})}},store:{value:Fe},push:{value:function(t){De.pushState(t,"")}},pushIgnoreCloseHandle:{value:function(t){var e,n;Fe.$hasCloseHandle?(null===(n=null===(e=ze.get(Fe.$key))||void 0===e?void 0:e.close)||void 0===n||n.call(e),De.replace(t)):De.push(t)}},replace:{value:function(t){Xe("replace",t)}}}),De.pushState=function(t,e,n){n?Ye("push",t,e,n):Xe("push",t)},De.replaceState=function(t,e,n){Ye("replace",t,e,n)},De.state)if(De.state.$hasCloseHandle){Ot(Fe,De.state);const t=Ze({title:document.title});ze.set(Fe.$key,t),De.back()}else{const t=Ze({title:document.title,hash:Ie.hash});Ot(Fe,Object.assign({$key:Be()},De.state||{})),ze.set(Fe.$key,t)}else{const{pathname:t,search:e,hash:n}=Ie;De.replace({path:t,query:e,hash:n})}const en=Tt({title:""});$t(en,(()=>{const t=ze.get(Fe.$key);t&&(t.title=en.title)})),$t(Fe,(()=>{const{title:t}=De.getParams();t!==en.title&&Ot(en,{title:t})}));let nn=!1;window.addEventListener("popstate",(t=>{var e,n;const s=t.state;if(!(null==s?void 0:s.$key))return;if(nn)return void(nn=!1);if(!ze.has(s.$key)){const{pathname:t,search:e,hash:n}=Ie;ze.set(s.$key,{path:t,query:new rt(e),hash:n,title:document.title,data:s})}const i=Fe;if(parseFloat(s.$key)>parseFloat(i.$key)&&s.$hasOpenHandle)null===(n=null===(e=ze.get(s.$key))||void 0===e?void 0:e.open)||void 0===n||n.call(e);else if(i.$hasCloseHandle){const t=ze.get(i.$key),e=null==t?void 0:t.close,n=null==t?void 0:t.shouldClose;if(n&&!n())return nn=!0,void De.forward();e?e():s.$hasCloseHandle&&(nn=!0,De.back())}Ot(wt(Fe),s)}));var sn,on,rn,an,ln=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},hn=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 un extends RegExp{constructor(t){const e={};let n=0;super(`^${t.replace(/:([^/$]+)/g,((t,s)=>(e[s]=n++,"([^/]+)"))).replace("*",".*")}$`,"i"),this.namePosition=e}}function dn(t,e){const n=new un(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 pn(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 fn(t,e){const n=pn(t,e);return Object.assign({path:n},e)}let gn=an=class extends ge{constructor({isLight:t,routes:e}={}){super({isLight:t}),this.currentParams={},sn.set(this,void 0),this.state={content:void 0},on.set(this,(()=>{if(this.locationStore){const{path:t,query:e,data:n}=De.getParams();Ot(this.locationStore,{path:t,params:this.currentParams,query:e,data:n})}})),rn.set(this,((t,e,n)=>{cn(this,sn,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&&Ot(en,{title:s}),hn(this,on,"f").call(this)})),this.routes=e}mounted(){this.effect((([t,e],n)=>{if(n&&t===n[0]&&e===n[1])return void hn(this,on,"f").call(this);const{route:s,params:i={}}=an.findRoute(this.routes,e),{redirect:o,content:r,getContent:a}=s||{};if(o)return void De.replace({path:o});const l=r||(null==a?void 0:a(i));if(l instanceof Promise){this.loading(s),cn(this,sn,l,"f");const t=()=>hn(this,sn,"f")===l;l.then((e=>{t()&&hn(this,rn,"f").call(this,s,i,e)})).catch((e=>{t()&&this.error(e)}))}else hn(this,rn,"f").call(this,s,i,l)}),(()=>{const{path:t}=De.getParams();return[this.key,t,location.search]}))}shouldUpdate(){return!this.inert}render(){const{content:t}=this.state;return this.shadowRoot?I`
7
7
  <style>
8
8
  :host,
9
9
  :not(:defined) {
10
10
  display: contents;
11
11
  }
12
12
  </style>
13
- ${null!=t?t:Ft`<slot></slot>`}
14
- `:Ft`${t}`}};sn=new WeakMap,on=new WeakMap,rn=new WeakMap,gn.createLocationStore=()=>{const{path:t,query:e,data:n}=B.getParams();return D({path:t,query:e,data:n,params:{}})},gn.findRoute=(t=[],e)=>{let n,s=null;n=t instanceof Array?t:Object.values(t);for(const t of n)if("*"===t.pattern)s=t;else{const n=dn(t.pattern,e);if(n)return{route:t,params:n}}return{route:s}},ln([Be],gn.prototype,"routes",void 0),ln([Be],gn.prototype,"locationStore",void 0),ln([Be],gn.prototype,"key",void 0),ln([Ke],gn.prototype,"routeChange",void 0),ln([Ke],gn.prototype,"loading",void 0),ln([Ke],gn.prototype,"error",void 0),gn=an=ln([Ye(B.store),en("gem-route")],gn);let mn=class extends gn{constructor(t={}){super(Object.assign(Object.assign({},t),{isLight:!0}))}};mn=ln([en("gem-light-route")],mn);var vn=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};let yn=class extends Ne{constructor(){super(),this.clickHandle=t=>{return e=this,n=void 0,i=function*(){var e;const n=this.getPathInfo();if(!n)return;if(this.isExternal(n))switch(this.target){case"_self":return void(window.location.href=n);case"_parent":return void(window.parent.location.href=n);case"_top":return void(window.top.location.href=n);default:return void window.open(n)}const{path:s,query:i,hash:o}=B.getParams();if(s+i+o!==n)if(t.stopPropagation(),yield null===(e=this.prepare)||void 0===e?void 0:e.call(this),this.route)B.pushIgnoreCloseHandle(Object.assign(Object.assign({},fn(this.route,this.options)),{title:this.route.title||this.docTitle}));else if(this.href){const{pathname:t,search:e,hash:s}=new URL(n,location.origin);B.pushIgnoreCloseHandle({path:t,query:e,hash:decodeURIComponent(s),title:this.docTitle})}else B.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash,title:this.docTitle})},new((s=void 0)||(s=Promise))((function(t,o){function r(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof s?n:new s((function(t){t(n)}))).then(r,a)}l((i=i.apply(e,n||[])).next())}));var e,n,s,i},this.preventDefault=t=>{t.preventDefault()},this.addEventListener("click",this.clickHandle)}getPathInfo(){var t,e;if(this.route){const n=(null===(t=this.options)||void 0===t?void 0:t.query)||"",s=(null===(e=this.options)||void 0===e?void 0:e.hash)||"";return pn(this.route,this.options)+n+s}{const t=this.href||this.path+this.query+this.hash,{path:e,query:n}=B.getParams();return t.startsWith("#")?`${e}${n}${t}`:t.startsWith("?")?`${e}${t}`:t.startsWith(".")?v(e,t):t}}isExternal(t){return!t.startsWith("/")}render(t=this.getPathInfo()){return Ft`
13
+ ${null!=t?t:I`<slot></slot>`}
14
+ `:I`${t}`}};sn=new WeakMap,on=new WeakMap,rn=new WeakMap,gn.createLocationStore=()=>{const{path:t,query:e,data:n}=De.getParams();return Tt({path:t,query:e,data:n,params:{}})},gn.findRoute=(t=[],e)=>{let n,s=null;n=t instanceof Array?t:Object.values(t);for(const t of n)if("*"===t.pattern)s=t;else{const n=dn(t.pattern,e);if(n)return{route:t,params:n}}return{route:s}},ln([Oe],gn.prototype,"routes",void 0),ln([Oe],gn.prototype,"locationStore",void 0),ln([Oe],gn.prototype,"key",void 0),ln([je],gn.prototype,"routeChange",void 0),ln([je],gn.prototype,"loading",void 0),ln([je],gn.prototype,"error",void 0),gn=an=ln([He(De.store),Ve("gem-route")],gn);let mn=class extends gn{constructor(t={}){super(Object.assign(Object.assign({},t),{isLight:!0}))}};mn=ln([Ve("gem-light-route")],mn);var vn=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};let yn=class extends ge{constructor(){super(),this.clickHandle=t=>{return e=this,n=void 0,i=function*(){var e;const n=this.getPathInfo();if(!n)return;if(this.isExternal(n))switch(this.target){case"_self":return void(window.location.href=n);case"_parent":return void(window.parent.location.href=n);case"_top":return void(window.top.location.href=n);default:return void window.open(n)}const{path:s,query:i,hash:o}=De.getParams();if(s+i+o!==n)if(t.stopPropagation(),yield null===(e=this.prepare)||void 0===e?void 0:e.call(this),this.route)De.pushIgnoreCloseHandle(Object.assign(Object.assign({},fn(this.route,this.options)),{title:this.route.title||this.docTitle}));else if(this.href){const{pathname:t,search:e,hash:s}=new URL(n,location.origin);De.pushIgnoreCloseHandle({path:t,query:e,hash:decodeURIComponent(s),title:this.docTitle})}else De.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash,title:this.docTitle})},new((s=void 0)||(s=Promise))((function(t,o){function r(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof s?n:new s((function(t){t(n)}))).then(r,a)}l((i=i.apply(e,n||[])).next())}));var e,n,s,i},this.preventDefault=t=>{t.preventDefault()},this.addEventListener("click",this.clickHandle)}getPathInfo(){var t,e;if(this.route){const n=(null===(t=this.options)||void 0===t?void 0:t.query)||"",s=(null===(e=this.options)||void 0===e?void 0:e.hash)||"";return pn(this.route,this.options)+n+s}{const t=this.href||this.path+this.query+this.hash,{path:e,query:n}=De.getParams();return t.startsWith("#")?`${e}${n}${t}`:t.startsWith("?")?`${e}${t}`:t.startsWith(".")?st(e,t):t}}isExternal(t){return!t.startsWith("/")}render(t=this.getPathInfo()){return I`
15
15
  <style>
16
16
  :host {
17
17
  /* link default style */
@@ -30,11 +30,11 @@
30
30
  <a
31
31
  part=${this.link}
32
32
  @click=${this.preventDefault}
33
- href=${oe("off"===this.hint?void 0:this.isExternal(t)?t:new URL(B.basePath+t,location.origin).toString())}
33
+ href=${Ut("off"===this.hint?void 0:this.isExternal(t)?t:new URL(De.basePath+t,location.origin).toString())}
34
34
  >
35
35
  <slot></slot>
36
36
  </a>
37
- `}};vn([qe],yn.prototype,"href",void 0),vn([qe],yn.prototype,"target",void 0),vn([qe],yn.prototype,"path",void 0),vn([qe],yn.prototype,"query",void 0),vn([qe],yn.prototype,"hash",void 0),vn([qe],yn.prototype,"docTitle",void 0),vn([qe],yn.prototype,"hint",void 0),vn([Be],yn.prototype,"route",void 0),vn([Be],yn.prototype,"options",void 0),vn([Be],yn.prototype,"prepare",void 0),vn([Je],yn.prototype,"link",void 0),yn=vn([en("gem-link"),Ye(ot)],yn);let wn=class extends yn{render(){const{path:t,query:e,hash:n}=B.getParams(),s=this.pattern&&dn(this.pattern,t),i=this.getPathInfo();return this.active=!(!s&&t+e+n!==i),super.render(i)}};vn([qe],wn.prototype,"pattern",void 0),vn([Fe],wn.prototype,"active",void 0),wn=vn([en("gem-active-link"),Ye(B.store)],wn);var bn,Sn=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};let En=bn=class extends Ne{constructor(){super(),new MutationObserver((()=>this.update())).observe(this,{childList:!0,characterData:!0,subtree:!0})}static setTitle(t){q(rt,{title:t})}static updateTitle(t="",e=""){const{title:n}=rt;n&&n!==bn.defaultTitle?(bn.title=n,document.title=bn.title+e):t?(bn.title=t,document.title=bn.title+e):(bn.title=bn.defaultTitle,document.title=bn.title)}render(){return bn.updateTitle(this.textContent||"",this.suffix),this.hidden?Ft``:Ft`${bn.title}`}};En.title=document.title,En.defaultTitle=document.title,En.defaultSuffix=` - ${document.title}`,Sn([qe],En.prototype,"suffix",void 0),En=bn=Sn([Ye(rt),en("gem-title")],En),U(rt,En.updateTitle);var xn=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};const Pn=new Map;let kn=class extends Ne{getContent(){const t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if("string"==typeof t){let e=Pn.get(t);return e||(e=document.createElement("template"),e.innerHTML=t,Pn.set(t,e)),e.content.cloneNode(!0)}return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):null==t?void 0:t.cloneNode(!0)}render(){return Ft`
37
+ `}};vn([ke],yn.prototype,"href",void 0),vn([ke],yn.prototype,"target",void 0),vn([ke],yn.prototype,"path",void 0),vn([ke],yn.prototype,"query",void 0),vn([ke],yn.prototype,"hash",void 0),vn([ke],yn.prototype,"docTitle",void 0),vn([ke],yn.prototype,"hint",void 0),vn([Oe],yn.prototype,"route",void 0),vn([Oe],yn.prototype,"options",void 0),vn([Oe],yn.prototype,"prepare",void 0),vn([Le],yn.prototype,"link",void 0),yn=vn([Ve("gem-link"),He(tn)],yn);let wn=class extends yn{render(){const{path:t,query:e,hash:n}=De.getParams(),s=this.pattern&&dn(this.pattern,t),i=this.getPathInfo();return this.active=!(!s&&t+e+n!==i),super.render(i)}};vn([ke],wn.prototype,"pattern",void 0),vn([$e],wn.prototype,"active",void 0),wn=vn([Ve("gem-active-link"),He(De.store)],wn);var bn,Sn=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};let En=bn=class extends ge{constructor(){super(),new MutationObserver((()=>this.update())).observe(this,{childList:!0,characterData:!0,subtree:!0})}static setTitle(t){Ot(en,{title:t})}static updateTitle(t="",e=""){const{title:n}=en;n&&n!==bn.defaultTitle?(bn.title=n,document.title=bn.title+e):t?(bn.title=t,document.title=bn.title+e):(bn.title=bn.defaultTitle,document.title=bn.title)}render(){return bn.updateTitle(this.textContent||"",this.suffix),this.hidden?I``:I`${bn.title}`}};En.title=document.title,En.defaultTitle=document.title,En.defaultSuffix=` - ${document.title}`,Sn([ke],En.prototype,"suffix",void 0),En=bn=Sn([He(en),Ve("gem-title")],En),$t(en,En.updateTitle);var xn=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};const _n=new Map;let Pn=class extends ge{getContent(){const t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if("string"==typeof t){let e=_n.get(t);return e||(e=document.createElement("template"),e.innerHTML=t,_n.set(t,e)),e.content.cloneNode(!0)}return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):null==t?void 0:t.cloneNode(!0)}render(){return I`
38
38
  <style>
39
39
  :host {
40
40
  position: relative;
@@ -50,5 +50,5 @@
50
50
  </style>
51
51
  ${this.getContent()}
52
52
  <slot></slot>
53
- `}};xn([qe],kn.prototype,"selector",void 0),xn([Be],kn.prototype,"root",void 0),xn([Be],kn.prototype,"element",void 0),xn([Fe],kn.prototype,"active",void 0),kn=xn([en("gem-use")],kn);var _n=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};let Tn=class extends Ne{constructor(){super(),this.effect((()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=`\n <style>\n :host {\n display: contents;\n }\n ${this.contentcss}\n </style>\n ${this.content}\n `)}),(()=>[this.content,this.contentcss]))}render(){}};_n([qe],Tn.prototype,"content",void 0),_n([qe],Tn.prototype,"contentcss",void 0),Tn=_n([en("gem-unsafe")],Tn);var Cn=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};document.querySelectorAll("[data-reflect]").forEach((t=>t.remove()));let On=class extends Ne{constructor(){super({isLight:!0}),this.target=document.head,this.hidden=!0,this.effect((()=>{const t=[...this.childNodes];return t.forEach((t=>{t instanceof HTMLElement&&(t.dataset.reflect=""),this.target.append(t)})),()=>{t.forEach((t=>t.remove()))}}),(()=>[this.target]))}};Cn([Be],On.prototype,"target",void 0),On=Cn([en("gem-reflect")],On);const $n=Symbol("open mark");function Nn(t){var e;return(e=class extends Ne{constructor(){super(),this.label="",this.internals.role="alertdialog",this.internals.ariaModal="true"}static get isOpen(){return this.store[$n]}static get observedStores(){return[B.store,this.store]}static open(t){const e=new this;this.instance=e,this.inertStore=[...document.body.children].filter((t=>!t.inert)),this.inertStore.forEach((t=>t.inert=!0)),document.body.append(e);const n=()=>q(this.store,Object.assign({[$n]:!0},t));setTimeout((()=>{n(),B.push({title:e.label,open:n,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})}),100)}static close(){B.back()}static closeHandle(){var e;this.inertStore.forEach((t=>t.inert=!1)),null===(e=this.instance)||void 0===e||e.remove(),q(this.store,Object.assign({[$n]:!1},t))}static shouldClose(){return!0}}).inertStore=[],e.instance=null,e.store=D(Object.assign({[$n]:!1},t)),e}var Ln,jn,Mn,Rn=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},An=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)},Hn=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};let Wn=class extends Ne{constructor(){super(),this.opened=!1,this.inert=!0,Ln.set(this,void 0),jn.set(this,void 0),Mn.set(this,[]),this.label="",this.closeHandle=()=>{var t;this.inert=!0,An(this,Mn,"f").forEach((t=>t.inert=!1)),An(this,Ln,"f")?An(this,Ln,"f").before(this):An(this,jn,"f")&&(null===(t=An(this,jn,"f"))||void 0===t||t.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1},this.openHandle=()=>{this.hidden=!1,this.inert=!1,Hn(this,Ln,this.nextSibling,"f"),Hn(this,jn,this.parentElement||this.getRootNode(),"f"),Hn(this,Mn,[...document.body.children].filter((t=>!t.inert)),"f"),An(this,Mn,"f").forEach((t=>t.inert=!0)),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0},this.open=()=>{this.opened||(this.openHandle(),B.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}))},this.close=()=>{B.back()},this.forceClose=()=>{this.opened=!1,setTimeout(this.close,100)},this.internals.role="dialog",this.internals.ariaModal="true"}shouldClose(){return!0}};Ln=new WeakMap,jn=new WeakMap,Mn=new WeakMap,Rn([Fe],Wn.prototype,"opened",void 0),Rn([qe],Wn.prototype,"label",void 0),Wn=Rn([Ye(B.store)],Wn);const Vn=new WeakMap;function Dn(t){return Vn.get(t)}const In=new WeakMap;function qn(t){return In.get(t)}function Un(t){const e=_(),n=document.createElement("style"),s=D(t),i={},o={};In.set(i,o),Vn.set(i,s),Object.keys(s).forEach((t=>{o[t]=`--${$(t)}-${e}`,i[t]=`var(${o[t]})`}));const r=()=>function(t,e){const n=Vn.get(e),s=In.get(e),i=Object.keys(n).reduce(((t,e)=>n[e]?t+`${s[e]}:${n[e]};`:t),"");t.textContent=`:root, :host {${i}}`}(n,i);return U(s,r),r(),(document.head||document.documentElement).append(n),i}function Gn(t,e){q(Dn(t),e)}var Bn,Fn,zn,Jn,Kn,Qn,Zn=function(t,e,n,s){return new(n||(n=Promise))((function(i,o){function r(t){try{l(s.next(t))}catch(t){o(t)}}function a(t){try{l(s.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((s=s.apply(t,e||[])).next())}))},Xn=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)},Yn=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 ts=/\$\d(?:<[^>]*>)?/,es=/\$(\d)(<([^>]*)>)?/g;function ns(t,...e){const n=t.split(ts),s=[];let i;for(;i=es.exec(t);){const t=i[3],n=e[Number(i[1])-1];s.push("string"==typeof n?n:n(t))}return Ft(n,...s)}const ss=new Set;class is{constructor(t){if(Bn.add(this),this.cachePrefix="gem-i18n",!t.resources[t.fallbackLanguage])throw new j("i18n: fallbackLanguage invalid");this.store=D(this),Object.assign(this,t);let e=Xn(this,Bn,"a",zn)||this.currentLanguage||Xn(this,Bn,"a",Jn);const n=document.querySelector(`[type*=${this.cachePrefix}]`);if(n)try{const t=JSON.parse(n.textContent||"");e=t.currentLanguage,this.resources[t.currentLanguage]=t.currentLanguagePack}catch(t){}e?(Yn(this,Bn,e,"a",Qn),this.setLanguage(e)):this.resetLanguage()}get(t,...e){const n=this.resources[this.currentLanguage],s=this.resources[this.fallbackLanguage],i=n[t]||s[t],o=(null==i?void 0:i.message)||i||`[${t}]`;return e.length?ns(o,...e):o}detectLanguage(){const t=Object.keys(this.resources),e=navigator.languages.map((t=>t.replace(/-(.*)/,(t=>t.toUpperCase()))));for(const n of e){const e=t.find((t=>t===n||n.startsWith(`${t}-`)));if(e)return e}return this.fallbackLanguage}setLanguage(t){return Zn(this,void 0,void 0,(function*(){let e;Xn(this,Bn,"a",Kn)&&ss.forEach((e=>Zn(this,void 0,void 0,(function*(){return yield e.setLanguage(t)}))));const n=this.resources[t];if(!n)return console.warn(`${this.cachePrefix}: not found \`${t}\``),this.resetLanguage();if("string"==typeof n){const t=`${this.cachePrefix}:`,s=`${t}${n}`,i=localStorage.getItem(s),o=()=>Zn(this,void 0,void 0,(function*(){const e=yield(yield fetch(n)).json();if(this.cache){for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);n.startsWith(t)&&localStorage.removeItem(n)}localStorage.setItem(s,JSON.stringify(e))}return e}));if(i)try{e=JSON.parse(i)}catch(t){e=yield o()}else e=yield o()}else e=n;return this.resources[t]=e,q(this.store,{}),t!==this.currentLanguage&&Yn(this,Bn,t,"a",Qn),!0===this.cache&&this.setCache(),t}))}resetLanguage(){return Xn(this,Bn,"a",Kn)&&ss.forEach((t=>t.resetLanguage())),Yn(this,Bn,this.fallbackLanguage,"a",Qn),this.cache&&localStorage.removeItem(Xn(this,Bn,"a",Fn)),this.setLanguage(this.detectLanguage())}setCache(){Xn(this,Bn,"a",Kn)&&ss.forEach((t=>t.setCache())),localStorage.setItem(Xn(this,Bn,"a",Fn),this.currentLanguage)}createSubModule(t,e){const n=new is({resources:e,cachePrefix:`${this.cachePrefix}-${t}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return ss.add(n),n}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}}Bn=new WeakSet,Fn=function(){return`${this.cachePrefix}:current`},zn=function(){const{hostname:t,pathname:e,search:n}=location,s=t.split(".");switch(this.urlParamsType){case"ccTLD":return s.pop();case"gTLD":return s.shift();case"path":return e.split("/")[1];default:const t=this.urlParamsName&&new URLSearchParams(n).get(this.urlParamsName)||"";return t in this.resources?t:""}},Jn=function(){return this.cache&&localStorage.getItem(Xn(this,Bn,"a",Fn))||""},Kn=function(){return!ss.has(this)},Qn=function(t){var e;Xn(this,Bn,"a",Kn)&&(document.documentElement.lang=t),this.currentLanguage=t,null===(e=this.onChange)||void 0===e||e.call(this,t)};const os={credentials:"include",mode:"cors"};function rs(t,e={}){return n=this,s=void 0,o=function*(){const n=yield fetch(t,Object.assign(Object.assign({},os),e));if(0===n.status)throw new Error("Request fail");if(n.status>=500)throw new Error(n.statusText);if(n.status>=400)throw new Error((yield n.text())||n.statusText);return yield n.json()},new((i=void 0)||(i=Promise))((function(t,e){function r(t){try{l(o.next(t))}catch(t){e(t)}}function a(t){try{l(o.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,a)}l((o=o.apply(n,s||[])).next())}));var n,s,i,o}const as=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array));function ls(t){return t instanceof FormData||t instanceof Blob||t instanceof as||t instanceof URLSearchParams||t instanceof ReadableStream||t instanceof ArrayBuffer?t:"object"==typeof t?JSON.stringify(t):t}function cs(t,e){const{origin:n,pathname:s,search:i}=new URL(t,location.origin),o=new URLSearchParams(e).toString();return rs(`${n}${s}${i?`${i}&`:o?"?":""}${o}`,{method:"GET"})}function hs(t){return rs(t,{method:"DELETE"})}function us(t,e){return rs(t,{method:"PUT",body:ls(e)})}function ds(t,e){return rs(t,{method:"POST",body:ls(e)})}const ps=t=>window.matchMedia(t).matches,fs={PRINT:"print",get isPrint(){return ps(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return ps(this.HOVER)},PHONE:"(min-width: 319px) and (max-width: 480px)",get isPhone(){return ps(this.PHONE)},LAPTOP:"(min-width: 1023px) and (max-width: 1280px) and (orientation: landscape)",get isLaptop(){return ps(this.LAPTOP)},DESKTOP:"(min-width: 1279px) and (orientation: landscape)",get isDesktop(){return ps(this.DESKTOP)},WIDTHSCREEN:"(min-width: 1919px) and (orientation: landscape)",get isWidthScreen(){return ps(this.WIDTHSCREEN)},PHONE_LANDSCAPE:"(min-width: 479px) and (max-width: 767px) and (orientation: landscape)",get isPhoneLandscape(){return ps(this.PHONE_LANDSCAPE)},TABLET:"(min-width: 768px) and (max-width: 1024px)",get isTablet(){return ps(this.TABLET)},SMALL_PHONE:"(min-width: 319px) and (max-width: 480px) and (max-height: 640px)",get isSmallPhone(){return ps(this.SMALL_PHONE)},WATCH:"(max-width: 319px)",get isWatch(){return ps(this.WATCH)},SHORT:"(min-width: 479px) and (max-height: 320px)",get isShort(){return ps(this.SHORT)},PWA:"(display-mode: standalone)",get isPWA(){return ps(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return ps(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return ps(this.DATA_REDUCE)}};return e})()}));
53
+ `}};xn([ke],Pn.prototype,"selector",void 0),xn([Oe],Pn.prototype,"root",void 0),xn([Oe],Pn.prototype,"element",void 0),xn([$e],Pn.prototype,"active",void 0),Pn=xn([Ve("gem-use")],Pn);var kn=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};let Tn=class extends ge{constructor(){super(),this.effect((()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=`\n <style>\n :host {\n display: contents;\n }\n ${this.contentcss}\n </style>\n ${this.content}\n `)}),(()=>[this.content,this.contentcss]))}render(){}};kn([ke],Tn.prototype,"content",void 0),kn([ke],Tn.prototype,"contentcss",void 0),Tn=kn([Ve("gem-unsafe")],Tn);var Cn=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};document.querySelectorAll("[data-reflect]").forEach((t=>t.remove()));let On=class extends ge{constructor(){super({isLight:!0}),this.target=document.head,this.hidden=!0,this.effect((()=>{const t=[...this.childNodes];return t.forEach((t=>{t instanceof HTMLElement&&(t.dataset.reflect=""),this.target.append(t)})),()=>{t.forEach((t=>t.remove()))}}),(()=>[this.target]))}};Cn([Oe],On.prototype,"target",void 0),On=Cn([Ve("gem-reflect")],On);const $n=Symbol("open mark");function Nn(t){var e;return(e=class extends ge{constructor(){super(),this.label="",this.internals.role="alertdialog",this.internals.ariaModal="true"}static get isOpen(){return this.store[$n]}static get observedStores(){return[De.store,this.store]}static open(t){const e=new this;this.instance=e,this.inertStore=[...document.body.children].filter((t=>!t.inert)),this.inertStore.forEach((t=>t.inert=!0)),document.body.append(e);const n=()=>Ot(this.store,Object.assign({[$n]:!0},t));setTimeout((()=>{n(),De.push({title:e.label,open:n,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})}),100)}static close(){De.back()}static closeHandle(){var e;this.inertStore.forEach((t=>t.inert=!1)),null===(e=this.instance)||void 0===e||e.remove(),Ot(this.store,Object.assign({[$n]:!1},t))}static shouldClose(){return!0}}).inertStore=[],e.instance=null,e.store=Tt(Object.assign({[$n]:!1},t)),e}var Ln,jn,Mn,Rn=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},An=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)},Hn=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};let Wn=class extends ge{constructor(){super(),this.opened=!1,this.inert=!0,Ln.set(this,void 0),jn.set(this,void 0),Mn.set(this,[]),this.label="",this.closeHandle=()=>{var t;this.inert=!0,An(this,Mn,"f").forEach((t=>t.inert=!1)),An(this,Ln,"f")?An(this,Ln,"f").before(this):An(this,jn,"f")&&(null===(t=An(this,jn,"f"))||void 0===t||t.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1},this.openHandle=()=>{this.hidden=!1,this.inert=!1,Hn(this,Ln,this.nextSibling,"f"),Hn(this,jn,this.parentElement||this.getRootNode(),"f"),Hn(this,Mn,[...document.body.children].filter((t=>!t.inert)),"f"),An(this,Mn,"f").forEach((t=>t.inert=!0)),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0},this.open=()=>{this.opened||(this.openHandle(),De.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}))},this.close=()=>{De.back()},this.forceClose=()=>{this.opened=!1,setTimeout(this.close,100)},this.internals.role="dialog",this.internals.ariaModal="true"}shouldClose(){return!0}};Ln=new WeakMap,jn=new WeakMap,Mn=new WeakMap,Rn([$e],Wn.prototype,"opened",void 0),Rn([ke],Wn.prototype,"label",void 0),Wn=Rn([He(De.store)],Wn);const Vn=new WeakMap;function Dn(t){return Vn.get(t)}const In=new WeakMap;function qn(t){return In.get(t)}function Un(t){const e=pt(),n=document.createElement("style"),s=Tt(t),i={},o={};In.set(i,o),Vn.set(i,s),Object.keys(s).forEach((t=>{o[t]=`--${vt(t)}-${e}`,i[t]=`var(${o[t]})`}));const r=()=>function(t,e){const n=Vn.get(e),s=In.get(e),i=Object.keys(n).reduce(((t,e)=>n[e]?t+`${s[e]}:${n[e]};`:t),"");t.textContent=`:root, :host {${i}}`}(n,i);return $t(s,r),r(),(document.head||document.documentElement).append(n),i}function Gn(t,e){Ot(Dn(t),e)}var Bn,Fn,zn,Jn,Kn,Qn,Zn=function(t,e,n,s){return new(n||(n=Promise))((function(i,o){function r(t){try{l(s.next(t))}catch(t){o(t)}}function a(t){try{l(s.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((s=s.apply(t,e||[])).next())}))},Xn=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)},Yn=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 ts=/\$\d(?:<[^>]*>)?/,es=/\$(\d)(<([^>]*)>)?/g;function ns(t,...e){const n=t.split(ts),s=[];let i;for(;i=es.exec(t);){const t=i[3],n=e[Number(i[1])-1];s.push("string"==typeof n?n:n(t))}return I(n,...s)}const ss=new Set;class is{constructor(t){if(Bn.add(this),this.cachePrefix="gem-i18n",!t.resources[t.fallbackLanguage])throw new bt("i18n: fallbackLanguage invalid");this.store=Tt(this),Object.assign(this,t);let e=Xn(this,Bn,"a",zn)||this.currentLanguage||Xn(this,Bn,"a",Jn);const n=document.querySelector(`[type*=${this.cachePrefix}]`);if(n)try{const t=JSON.parse(n.textContent||"");e=t.currentLanguage,this.resources[t.currentLanguage]=t.currentLanguagePack}catch(t){}e?(Yn(this,Bn,e,"a",Qn),this.setLanguage(e)):this.resetLanguage()}get(t,...e){const n=this.resources[this.currentLanguage],s=this.resources[this.fallbackLanguage],i=n[t]||s[t],o=(null==i?void 0:i.message)||i||`[${t}]`;return e.length?ns(o,...e):o}detectLanguage(){const t=Object.keys(this.resources),e=navigator.languages.map((t=>t.replace(/-(.*)/,(t=>t.toUpperCase()))));for(const n of e){const e=t.find((t=>t===n||n.startsWith(`${t}-`)));if(e)return e}return this.fallbackLanguage}setLanguage(t){return Zn(this,void 0,void 0,(function*(){let e;Xn(this,Bn,"a",Kn)&&ss.forEach((e=>Zn(this,void 0,void 0,(function*(){return yield e.setLanguage(t)}))));const n=this.resources[t];if(!n)return console.warn(`${this.cachePrefix}: not found \`${t}\``),this.resetLanguage();if("string"==typeof n){const t=`${this.cachePrefix}:`,s=`${t}${n}`,i=localStorage.getItem(s),o=()=>Zn(this,void 0,void 0,(function*(){const e=yield(yield fetch(n)).json();if(this.cache){for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);n.startsWith(t)&&localStorage.removeItem(n)}localStorage.setItem(s,JSON.stringify(e))}return e}));if(i)try{e=JSON.parse(i)}catch(t){e=yield o()}else e=yield o()}else e=n;return this.resources[t]=e,Ot(this.store,{}),t!==this.currentLanguage&&Yn(this,Bn,t,"a",Qn),!0===this.cache&&this.setCache(),t}))}resetLanguage(){return Xn(this,Bn,"a",Kn)&&ss.forEach((t=>t.resetLanguage())),Yn(this,Bn,this.fallbackLanguage,"a",Qn),this.cache&&localStorage.removeItem(Xn(this,Bn,"a",Fn)),this.setLanguage(this.detectLanguage())}setCache(){Xn(this,Bn,"a",Kn)&&ss.forEach((t=>t.setCache())),localStorage.setItem(Xn(this,Bn,"a",Fn),this.currentLanguage)}createSubModule(t,e){const n=new is({resources:e,cachePrefix:`${this.cachePrefix}-${t}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return ss.add(n),n}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}}Bn=new WeakSet,Fn=function(){return`${this.cachePrefix}:current`},zn=function(){const{hostname:t,pathname:e,search:n}=location,s=t.split(".");switch(this.urlParamsType){case"ccTLD":return s.pop();case"gTLD":return s.shift();case"path":return e.split("/")[1];default:const t=this.urlParamsName&&new URLSearchParams(n).get(this.urlParamsName)||"";return t in this.resources?t:""}},Jn=function(){return this.cache&&localStorage.getItem(Xn(this,Bn,"a",Fn))||""},Kn=function(){return!ss.has(this)},Qn=function(t){var e;Xn(this,Bn,"a",Kn)&&(document.documentElement.lang=t),this.currentLanguage=t,null===(e=this.onChange)||void 0===e||e.call(this,t)};const os={credentials:"include",mode:"cors"};function rs(t,e={}){return n=this,s=void 0,o=function*(){const n=yield fetch(t,Object.assign(Object.assign({},os),e));if(0===n.status)throw new Error("Request fail");if(n.status>=500)throw new Error(n.statusText);if(n.status>=400)throw new Error((yield n.text())||n.statusText);return yield n.json()},new((i=void 0)||(i=Promise))((function(t,e){function r(t){try{l(o.next(t))}catch(t){e(t)}}function a(t){try{l(o.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,a)}l((o=o.apply(n,s||[])).next())}));var n,s,i,o}const as=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array));function ls(t){return t instanceof FormData||t instanceof Blob||t instanceof as||t instanceof URLSearchParams||t instanceof ReadableStream||t instanceof ArrayBuffer?t:"object"==typeof t?JSON.stringify(t):t}function cs(t,e){const{origin:n,pathname:s,search:i}=new URL(t,location.origin),o=new URLSearchParams(e).toString();return rs(`${n}${s}${i?`${i}&`:o?"?":""}${o}`,{method:"GET"})}function hs(t){return rs(t,{method:"DELETE"})}function us(t,e){return rs(t,{method:"PUT",body:ls(e)})}function ds(t,e){return rs(t,{method:"POST",body:ls(e)})}const ps=t=>window.matchMedia(t).matches,fs={PRINT:"print",get isPrint(){return ps(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return ps(this.HOVER)},PHONE:"(min-width: 319px) and (max-width: 480px)",get isPhone(){return ps(this.PHONE)},LAPTOP:"(min-width: 1023px) and (max-width: 1280px) and (orientation: landscape)",get isLaptop(){return ps(this.LAPTOP)},DESKTOP:"(min-width: 1279px) and (orientation: landscape)",get isDesktop(){return ps(this.DESKTOP)},WIDTHSCREEN:"(min-width: 1919px) and (orientation: landscape)",get isWidthScreen(){return ps(this.WIDTHSCREEN)},PHONE_LANDSCAPE:"(min-width: 479px) and (max-width: 767px) and (orientation: landscape)",get isPhoneLandscape(){return ps(this.PHONE_LANDSCAPE)},TABLET:"(min-width: 768px) and (max-width: 1024px)",get isTablet(){return ps(this.TABLET)},SMALL_PHONE:"(min-width: 319px) and (max-width: 480px) and (max-height: 640px)",get isSmallPhone(){return ps(this.SMALL_PHONE)},WATCH:"(max-width: 319px)",get isWatch(){return ps(this.WATCH)},SHORT:"(min-width: 479px) and (max-height: 320px)",get isShort(){return ps(this.SHORT)},PWA:"(display-mode: standalone)",get isPWA(){return ps(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return ps(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return ps(this.DATA_REDUCE)}},gs="1.6.4";return window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,Object.assign({},n)),e})()}));
54
54
  //# sourceMappingURL=umd.js.map