@mantou/gem 1.6.4 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/elements/route.d.ts +2 -2
- package/elements/route.js +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/elements/route.ts +3 -3
- package/src/lib/version.ts +1 -1
- package/umd.js +3 -3
- package/umd.js.map +1 -1
package/elements/route.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ declare type State = {
|
|
|
29
29
|
/**
|
|
30
30
|
* @customElement gem-route
|
|
31
31
|
* @attr inert 暂停路由更新
|
|
32
|
-
* @fires
|
|
32
|
+
* @fires routechange
|
|
33
33
|
* @fires error
|
|
34
34
|
* @fires loading
|
|
35
35
|
*/
|
|
@@ -48,7 +48,7 @@ export declare class GemRouteElement extends GemElement<State> {
|
|
|
48
48
|
data?: any;
|
|
49
49
|
}>;
|
|
50
50
|
key: any;
|
|
51
|
-
|
|
51
|
+
routechange: Emitter<RouteItem | null>;
|
|
52
52
|
loading: Emitter<RouteItem>;
|
|
53
53
|
error: Emitter<any>;
|
|
54
54
|
currentRoute: RouteItem | null;
|
package/elements/route.js
CHANGED
|
@@ -69,7 +69,7 @@ export function createHistoryParams(route, options) {
|
|
|
69
69
|
/**
|
|
70
70
|
* @customElement gem-route
|
|
71
71
|
* @attr inert 暂停路由更新
|
|
72
|
-
* @fires
|
|
72
|
+
* @fires routechange
|
|
73
73
|
* @fires error
|
|
74
74
|
* @fires loading
|
|
75
75
|
*/
|
|
@@ -98,7 +98,7 @@ let GemRouteElement = GemRouteElement_1 = class GemRouteElement extends GemEleme
|
|
|
98
98
|
this.currentRoute = route;
|
|
99
99
|
this.currentParams = params;
|
|
100
100
|
this.setState({ content });
|
|
101
|
-
this.
|
|
101
|
+
this.routechange(this.currentRoute);
|
|
102
102
|
const title = route === null || route === void 0 ? void 0 : route.title;
|
|
103
103
|
if (title)
|
|
104
104
|
updateStore(titleStore, { title });
|
|
@@ -199,7 +199,7 @@ __decorate([
|
|
|
199
199
|
], GemRouteElement.prototype, "key", void 0);
|
|
200
200
|
__decorate([
|
|
201
201
|
emitter
|
|
202
|
-
], GemRouteElement.prototype, "
|
|
202
|
+
], GemRouteElement.prototype, "routechange", void 0);
|
|
203
203
|
__decorate([
|
|
204
204
|
emitter
|
|
205
205
|
], GemRouteElement.prototype, "loading", void 0);
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.6.
|
|
1
|
+
export declare const version = "1.6.5";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
package/src/elements/route.ts
CHANGED
|
@@ -98,7 +98,7 @@ type State = {
|
|
|
98
98
|
/**
|
|
99
99
|
* @customElement gem-route
|
|
100
100
|
* @attr inert 暂停路由更新
|
|
101
|
-
* @fires
|
|
101
|
+
* @fires routechange
|
|
102
102
|
* @fires error
|
|
103
103
|
* @fires loading
|
|
104
104
|
*/
|
|
@@ -113,7 +113,7 @@ export class GemRouteElement extends GemElement<State> {
|
|
|
113
113
|
*/
|
|
114
114
|
@property locationStore?: Store<{ path: string; params: Params; query: QueryString; data?: any }>;
|
|
115
115
|
@property key: any; // 除了 href 提供另外一种方式来更新,比如语言更新也需要刷新 <gem-route>
|
|
116
|
-
@emitter
|
|
116
|
+
@emitter routechange: Emitter<RouteItem | null>; // path 改变或者 key 改变,包含初始渲染
|
|
117
117
|
@emitter loading: Emitter<RouteItem>;
|
|
118
118
|
@emitter error: Emitter<any>;
|
|
119
119
|
|
|
@@ -175,7 +175,7 @@ export class GemRouteElement extends GemElement<State> {
|
|
|
175
175
|
this.currentRoute = route;
|
|
176
176
|
this.currentParams = params;
|
|
177
177
|
this.setState({ content });
|
|
178
|
-
this.
|
|
178
|
+
this.routechange(this.currentRoute);
|
|
179
179
|
const title = route?.title;
|
|
180
180
|
if (title) updateStore(titleStore, { title });
|
|
181
181
|
this.#updateLocationStore();
|
package/src/lib/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Do not modify manually
|
|
2
|
-
export const version = '1.6.
|
|
2
|
+
export const version = '1.6.5';
|
package/umd.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<style media=${t.media.mediaText}>
|
|
4
4
|
${t.style}
|
|
5
5
|
</style>
|
|
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`
|
|
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) {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
</style>
|
|
13
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,"
|
|
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 */
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
</style>
|
|
51
51
|
${this.getContent()}
|
|
52
52
|
<slot></slot>
|
|
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})()}));
|
|
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.5";return window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,Object.assign({},n)),e})()}));
|
|
54
54
|
//# sourceMappingURL=umd.js.map
|