timered-counter 1.0.0 → 1.1.1

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 (53) hide show
  1. package/custom-elements.json +253 -103
  2. package/dist/custom-elements.json +253 -103
  3. package/dist/decimal-js-number-adapter.esm-browser.js +9 -0
  4. package/dist/decimal-js-number-adapter.esm-browser.js.map +1 -0
  5. package/dist/decimal-js-number-adapter.global.js +10 -0
  6. package/dist/decimal-js-number-adapter.global.js.map +1 -0
  7. package/dist/grapheme-splitter-string-adapter.esm-browser.js +2 -0
  8. package/dist/grapheme-splitter-string-adapter.esm-browser.js.map +1 -0
  9. package/dist/grapheme-splitter-string-adapter.global.js +2 -0
  10. package/dist/grapheme-splitter-string-adapter.global.js.map +1 -0
  11. package/dist/src/index.d.ts +1 -5
  12. package/dist/src/index.js +1 -7
  13. package/dist/src/index.js.map +1 -1
  14. package/dist/src/mixins/counter-base.js +9 -9
  15. package/dist/src/mixins/counter-base.js.map +1 -1
  16. package/dist/src/number-adapter/decimal-js.d.ts +8 -1
  17. package/dist/src/number-adapter/decimal-js.js +7 -0
  18. package/dist/src/number-adapter/decimal-js.js.map +1 -1
  19. package/dist/src/number-adapter/index.d.ts +6 -4
  20. package/dist/src/number-adapter/index.js +7 -4
  21. package/dist/src/number-adapter/index.js.map +1 -1
  22. package/dist/src/string-adapter/grapheme-splitter.d.ts +7 -0
  23. package/dist/src/string-adapter/grapheme-splitter.js +7 -0
  24. package/dist/src/string-adapter/grapheme-splitter.js.map +1 -1
  25. package/dist/src/string-adapter/index.d.ts +6 -4
  26. package/dist/src/string-adapter/index.js +7 -4
  27. package/dist/src/string-adapter/index.js.map +1 -1
  28. package/dist/src/timered-counter-adapter.d.ts +65 -0
  29. package/dist/src/timered-counter-adapter.js +120 -0
  30. package/dist/src/timered-counter-adapter.js.map +1 -0
  31. package/dist/src/transitions/roller/roller-digit.js +3 -3
  32. package/dist/src/transitions/roller/roller-digit.js.map +1 -1
  33. package/dist/src/transitions/roller/roller.js +1 -1
  34. package/dist/src/transitions/roller/roller.js.map +1 -1
  35. package/dist/stories/timered-counter/decimaljs.stories.js +4 -2
  36. package/dist/stories/timered-counter/decimaljs.stories.js.map +1 -1
  37. package/dist/stories/timered-counter-number/decimaljs.stories.js +4 -2
  38. package/dist/stories/timered-counter-number/decimaljs.stories.js.map +1 -1
  39. package/dist/stories/timered-counter-string/decimaljs.stories.js +4 -2
  40. package/dist/stories/timered-counter-string/decimaljs.stories.js.map +1 -1
  41. package/dist/stories/timered-counter-string/grapheme-splitter.stories.js +7 -3
  42. package/dist/stories/timered-counter-string/grapheme-splitter.stories.js.map +1 -1
  43. package/dist/stories/timered-counter-string/intl-segmenter.stories.js +5 -3
  44. package/dist/stories/timered-counter-string/intl-segmenter.stories.js.map +1 -1
  45. package/dist/timered-counter.esm-browser.js +51 -58
  46. package/dist/timered-counter.esm-browser.js.map +1 -1
  47. package/dist/timered-counter.global.js +51 -58
  48. package/dist/timered-counter.global.js.map +1 -1
  49. package/dist/tsconfig.tsbuildinfo +1 -1
  50. package/package.json +2 -2
  51. package/dist/src/counter-adapter.d.ts +0 -38
  52. package/dist/src/counter-adapter.js +0 -71
  53. package/dist/src/counter-adapter.js.map +0 -1
@@ -1,27 +1,27 @@
1
- function t(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}function e(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}"function"==typeof SuppressedError&&SuppressedError;
1
+ function t(t,e,i,s){var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o}function e(t,e,i,s){if("a"===i&&!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"===i?s:"a"===i?s.call(t):s?s.value:e.get(t)}"function"==typeof SuppressedError&&SuppressedError;
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
6
  */
7
- const i=globalThis,n=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),s=new WeakMap;let o=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}};const a=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new o(i,t,r)},l=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,r))(e)})(t):t
7
+ const i=globalThis,s=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let o=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(s&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(e,t))}return t}toString(){return this.cssText}};const a=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new o(i,t,r)},l=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,r))(e)})(t):t
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2017 Google LLC
11
11
  * SPDX-License-Identifier: BSD-3-Clause
12
- */,{is:c,defineProperty:u,getOwnPropertyDescriptor:h,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:f}=Object,g=globalThis,m=g.trustedTypes,_=m?m.emptyScript:"",y=g.reactiveElementPolyfillSupport,v=(t,e)=>t,b={toAttribute(t,e){switch(e){case Boolean:t=t?_:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},w=(t,e)=>!c(t,e),A={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;class $ extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=A){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);void 0!==n&&u(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:r}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return n?.call(this)},set(e){const s=n?.call(this);r.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??A}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const t=f(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const t=this.properties,e=[...d(t),...p(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(n)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of e){const e=document.createElement("style"),r=i.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=n.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:b).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:b;this._$Em=n,this[n]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??w)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[v("elementProperties")]=new Map,$[v("finalized")]=new Map,y?.({ReactiveElement:$}),(g.reactiveElementVersions??=[]).push("2.0.4");
12
+ */,{is:c,defineProperty:h,getOwnPropertyDescriptor:u,getOwnPropertyNames:p,getOwnPropertySymbols:d,getPrototypeOf:f}=Object,m=globalThis,_=m.trustedTypes,g=_?_.emptyScript:"",y=m.reactiveElementPolyfillSupport,A=(t,e)=>t,b={toAttribute(t,e){switch(e){case Boolean:t=t?g:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},$=(t,e)=>!c(t,e),v={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:$};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=v){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&h(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=u(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return s?.call(this)},set(e){const n=s?.call(this);r.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??v}static _$Ei(){if(this.hasOwnProperty(A("elementProperties")))return;const t=f(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(A("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(A("properties"))){const t=this.properties,e=[...p(t),...d(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(s)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const s of e){const e=document.createElement("style"),r=i.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:b).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:b;this._$Em=s,this[s]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??$)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[A("elementProperties")]=new Map,S[A("finalized")]=new Map,y?.({ReactiveElement:S}),(m.reactiveElementVersions??=[]).push("2.0.4");
13
13
  /**
14
14
  * @license
15
15
  * Copyright 2017 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
17
  */
18
- const S=globalThis,x=S.trustedTypes,N=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,E="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+O,P=`<${C}>`,M=document,D=()=>M.createComment(""),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,R="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,L=/>/g,j=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,H=/"/g,F=/^(?:script|style|textarea|title)$/i,q=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),B=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),Y=new WeakMap,Z=M.createTreeWalker(M,129);function W(t,e){if(!k(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==N?N.createHTML(e):e}class Q{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,s=0;const o=t.length-1,a=this.parts,[l,c]=((t,e)=>{const i=t.length-1,n=[];let r,s=2===e?"<svg>":3===e?"<math>":"",o=U;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,u=0;for(;u<i.length&&(o.lastIndex=u,l=o.exec(i),null!==l);)u=o.lastIndex,o===U?"!--"===l[1]?o=I:void 0!==l[1]?o=L:void 0!==l[2]?(F.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=j):void 0!==l[3]&&(o=j):o===j?">"===l[0]?(o=r??U,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?j:'"'===l[3]?H:V):o===H||o===V?o=j:o===I||o===L?o=U:(o=j,r=void 0);const h=o===j&&t[e+1].startsWith("/>")?" ":"";s+=o===U?i+P:c>=0?(n.push(a),i.slice(0,c)+E+i.slice(c)+O+h):i+O+(-2===c?e:h)}return[W(t,s+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]})(t,e);if(this.el=Q.createElement(l,i),Z.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=Z.nextNode())&&a.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(E)){const e=c[s++],i=n.getAttribute(t).split(O),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:o[2],strings:i,ctor:"."===o[1]?tt:"?"===o[1]?et:"@"===o[1]?it:X}),n.removeAttribute(t)}else t.startsWith(O)&&(a.push({type:6,index:r}),n.removeAttribute(t));if(F.test(n.tagName)){const t=n.textContent.split(O),e=t.length-1;if(e>0){n.textContent=x?x.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],D()),Z.nextNode(),a.push({type:2,index:++r});n.append(t[e],D())}}}else if(8===n.nodeType)if(n.data===C)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=n.data.indexOf(O,t+1));)a.push({type:7,index:r}),t+=O.length-1}r++}}static createElement(t,e){const i=M.createElement("template");return i.innerHTML=t,i}}function G(t,e,i=t,n){if(e===B)return e;let r=void 0!==n?i._$Co?.[n]:i._$Cl;const s=T(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),void 0===s?r=void 0:(r=new s(t),r._$AT(t,i,n)),void 0!==n?(i._$Co??=[])[n]=r:i._$Cl=r),void 0!==r&&(e=G(t,r._$AS(t,e.values),r,n)),e}let K=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,n=(t?.creationScope??M).importNode(e,!0);Z.currentNode=n;let r=Z.nextNode(),s=0,o=0,a=i[0];for(;void 0!==a;){if(s===a.index){let e;2===a.type?e=new J(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new nt(r,this,t)),this._$AV.push(e),a=i[++o]}s!==a?.index&&(r=Z.nextNode(),s++)}return Z.currentNode=M,n}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}};class J{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=G(this,t,e),T(t)?t===z||null==t||""===t?(this._$AH!==z&&this._$AR(),this._$AH=z):t!==this._$AH&&t!==B&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>k(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==z&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(M.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,n="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Q.createElement(W(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new K(n,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Y.get(t.strings);return void 0===e&&Y.set(t.strings,e=new Q(t)),e}k(t){k(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const r of t)n===e.length?e.push(i=new J(this.O(D()),this.O(D()),this,this.options)):i=e[n],i._$AI(r),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}let X=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,r){this.type=1,this._$AH=z,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=z}_$AI(t,e=this,i,n){const r=this.strings;let s=!1;if(void 0===r)t=G(this,t,e,0),s=!T(t)||t!==this._$AH&&t!==B,s&&(this._$AH=t);else{const n=t;let o,a;for(t=r[0],o=0;o<r.length-1;o++)a=G(this,n[i+o],e,o),a===B&&(a=this._$AH[o]),s||=!T(a)||a!==this._$AH[o],a===z?t=z:t!==z&&(t+=(a??"")+r[o+1]),this._$AH[o]=a}s&&!n&&this.j(t)}j(t){t===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class tt extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===z?void 0:t}}class et extends X{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==z)}}class it extends X{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){if((t=G(this,t,e,0)??z)===B)return;const i=this._$AH,n=t===z&&i!==z||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==z&&(i===z||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class nt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){G(this,t)}}const rt={I:J},st=S.litHtmlPolyfillSupport;st?.(Q,J),(S.litHtmlVersions??=[]).push("3.2.1");
18
+ const w=globalThis,x=w.trustedTypes,E=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,O="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+C,D=`<${P}>`,T=document,M=()=>T.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,R="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,L=/>/g,V=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),j=/'/g,H=/"/g,B=/^(?:script|style|textarea|title)$/i,z=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),F=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),W=new WeakMap,q=T.createTreeWalker(T,129);function Q(t,e){if(!k(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(e):e}class K{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,n=0;const o=t.length-1,a=this.parts,[l,c]=((t,e)=>{const i=t.length-1,s=[];let r,n=2===e?"<svg>":3===e?"<math>":"",o=U;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,h=0;for(;h<i.length&&(o.lastIndex=h,l=o.exec(i),null!==l);)h=o.lastIndex,o===U?"!--"===l[1]?o=I:void 0!==l[1]?o=L:void 0!==l[2]?(B.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=V):void 0!==l[3]&&(o=V):o===V?">"===l[0]?(o=r??U,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?V:'"'===l[3]?H:j):o===H||o===j?o=V:o===I||o===L?o=U:(o=V,r=void 0);const u=o===V&&t[e+1].startsWith("/>")?" ":"";n+=o===U?i+D:c>=0?(s.push(a),i.slice(0,c)+O+i.slice(c)+C+u):i+C+(-2===c?e:u)}return[Q(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=K.createElement(l,i),q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=q.nextNode())&&a.length<o;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(O)){const e=c[n++],i=s.getAttribute(t).split(C),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:o[2],strings:i,ctor:"."===o[1]?tt:"?"===o[1]?et:"@"===o[1]?it:X}),s.removeAttribute(t)}else t.startsWith(C)&&(a.push({type:6,index:r}),s.removeAttribute(t));if(B.test(s.tagName)){const t=s.textContent.split(C),e=t.length-1;if(e>0){s.textContent=x?x.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],M()),q.nextNode(),a.push({type:2,index:++r});s.append(t[e],M())}}}else if(8===s.nodeType)if(s.data===P)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(C,t+1));)a.push({type:7,index:r}),t+=C.length-1}r++}}static createElement(t,e){const i=T.createElement("template");return i.innerHTML=t,i}}function G(t,e,i=t,s){if(e===F)return e;let r=void 0!==s?i._$Co?.[s]:i._$Cl;const n=N(e)?void 0:e._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),void 0===n?r=void 0:(r=new n(t),r._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=r:i._$Cl=r),void 0!==r&&(e=G(t,r._$AS(t,e.values),r,s)),e}let J=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??T).importNode(e,!0);q.currentNode=s;let r=q.nextNode(),n=0,o=0,a=i[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new Z(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new st(r,this,t)),this._$AV.push(e),a=i[++o]}n!==a?.index&&(r=q.nextNode(),n++)}return q.currentNode=T,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}};class Z{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=Y,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=G(this,t,e),N(t)?t===Y||null==t||""===t?(this._$AH!==Y&&this._$AR(),this._$AH=Y):t!==this._$AH&&t!==F&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>k(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Y&&N(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=K.createElement(Q(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new J(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=W.get(t.strings);return void 0===e&&W.set(t.strings,e=new K(t)),e}k(t){k(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new Z(this.O(M()),this.O(M()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}let X=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=Y,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Y}_$AI(t,e=this,i,s){const r=this.strings;let n=!1;if(void 0===r)t=G(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==F,n&&(this._$AH=t);else{const s=t;let o,a;for(t=r[0],o=0;o<r.length-1;o++)a=G(this,s[i+o],e,o),a===F&&(a=this._$AH[o]),n||=!N(a)||a!==this._$AH[o],a===Y?t=Y:t!==Y&&(t+=(a??"")+r[o+1]),this._$AH[o]=a}n&&!s&&this.j(t)}j(t){t===Y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class tt extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Y?void 0:t}}class et extends X{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Y)}}class it extends X{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=G(this,t,e,0)??Y)===F)return;const i=this._$AH,s=t===Y&&i!==Y||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==Y&&(i===Y||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){G(this,t)}}const rt={I:Z},nt=w.litHtmlPolyfillSupport;nt?.(K,Z),(w.litHtmlVersions??=[]).push("3.2.1");
19
19
  /**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
23
  */
24
- let ot=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const n=i?.renderBefore??e;let r=n._$litPart$;if(void 0===r){const t=i?.renderBefore??null;n._$litPart$=r=new J(e.insertBefore(D(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return B}};ot._$litElement$=!0,ot.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:ot});const at=globalThis.litElementPolyfillSupport;at?.({LitElement:ot}),(globalThis.litElementVersions??=[]).push("4.1.1");
24
+ let ot=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const s=i?.renderBefore??e;let r=s._$litPart$;if(void 0===r){const t=i?.renderBefore??null;s._$litPart$=r=new Z(e.insertBefore(M(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return F}};ot._$litElement$=!0,ot.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:ot});const at=globalThis.litElementPolyfillSupport;at?.({LitElement:ot}),(globalThis.litElementVersions??=[]).push("4.1.1");
25
25
  /**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
@@ -32,12 +32,12 @@ const lt=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)
32
32
  * @license
33
33
  * Copyright 2017 Google LLC
34
34
  * SPDX-License-Identifier: BSD-3-Clause
35
- */,ct={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:w},ut=(t=ct,e,i)=>{const{kind:n,metadata:r}=i;let s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),s.set(i.name,t),"accessor"===n){const{name:n}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(n,r,t)},init(e){return void 0!==e&&this.P(n,void 0,t),e}}}if("setter"===n){const{name:n}=i;return function(i){const r=this[n];e.call(this,i),this.requestUpdate(n,r,t)}}throw Error("Unsupported decorator location: "+n)};function ht(t){return(e,i)=>"object"==typeof i?ut(t,e,i):((t,e,i)=>{const n=e.hasOwnProperty(i);return e.constructor.createProperty(i,n?{...t,wrapped:!0}:t),n?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)
35
+ */,ct={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:$},ht=(t=ct,e,i)=>{const{kind:s,metadata:r}=i;let n=globalThis.litPropertyMetadata.get(r);if(void 0===n&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,r,t)},init(e){return void 0!==e&&this.P(s,void 0,t),e}}}if("setter"===s){const{name:s}=i;return function(i){const r=this[s];e.call(this,i),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+s)};function ut(t){return(e,i)=>"object"==typeof i?ht(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,s?{...t,wrapped:!0}:t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)
36
36
  /**
37
37
  * @license
38
38
  * Copyright 2017 Google LLC
39
39
  * SPDX-License-Identifier: BSD-3-Clause
40
- */}function dt(t){return ht({...t,state:!0,attribute:!1})}
40
+ */}function pt(t){return ut({...t,state:!0,attribute:!1})}
41
41
  /**
42
42
  * @license
43
43
  * Copyright 2017 Google LLC
@@ -48,29 +48,22 @@ const lt=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)
48
48
  * Copyright 2017 Google LLC
49
49
  * SPDX-License-Identifier: BSD-3-Clause
50
50
  */
51
- function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}
51
+ function dt(t,e){return(e,i,s)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}
52
52
  /**
53
53
  * @license
54
54
  * Copyright 2017 Google LLC
55
55
  * SPDX-License-Identifier: BSD-3-Clause
56
- */const ft=1,gt=2,mt=t=>(...e)=>({_$litDirective$:t,values:e});let _t=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
56
+ */const ft=1,mt=2,_t=t=>(...e)=>({_$litDirective$:t,values:e});let gt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
57
57
  /**
58
58
  * @license
59
59
  * Copyright 2020 Google LLC
60
60
  * SPDX-License-Identifier: BSD-3-Clause
61
- */const{I:yt}=rt,vt=()=>document.createComment(""),bt=(t,e,i)=>{const n=t._$AA.parentNode,r=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=n.insertBefore(vt(),r),s=n.insertBefore(vt(),r);i=new yt(e,s,t,t.options)}else{const e=i._$AB.nextSibling,s=i._$AM,o=s!==t;if(o){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==s._$AU&&i._$AP(e)}if(e!==r||o){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;n.insertBefore(t,r),t=e}}}return i},wt=(t,e,i=t)=>(t._$AI(e,i),t),At={},$t=t=>{t._$AP?.(!1,!0);let e=t._$AA;const i=t._$AB.nextSibling;for(;e!==i;){const t=e.nextSibling;e.remove(),e=t}},St=(t,e,i)=>{const n=new Map;for(let r=e;r<=i;r++)n.set(t[r],r);return n},xt=mt(class extends _t{constructor(t){if(super(t),t.type!==gt)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let n;void 0===i?i=e:void 0!==e&&(n=e);const r=[],s=[];let o=0;for(const e of t)r[o]=n?n(e,o):o,s[o]=i(e,o),o++;return{values:s,keys:r}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,n]){const r=(t=>t._$AH)(t),{values:s,keys:o}=this.dt(e,i,n);if(!Array.isArray(r))return this.ut=o,s;const a=this.ut??=[],l=[];let c,u,h=0,d=r.length-1,p=0,f=s.length-1;for(;h<=d&&p<=f;)if(null===r[h])h++;else if(null===r[d])d--;else if(a[h]===o[p])l[p]=wt(r[h],s[p]),h++,p++;else if(a[d]===o[f])l[f]=wt(r[d],s[f]),d--,f--;else if(a[h]===o[f])l[f]=wt(r[h],s[f]),bt(t,l[f+1],r[h]),h++,f--;else if(a[d]===o[p])l[p]=wt(r[d],s[p]),bt(t,r[h],r[d]),d--,p++;else if(void 0===c&&(c=St(o,p,f),u=St(a,h,d)),c.has(a[h]))if(c.has(a[d])){const e=u.get(o[p]),i=void 0!==e?r[e]:null;if(null===i){const e=bt(t,r[h]);wt(e,s[p]),l[p]=e}else l[p]=wt(i,s[p]),bt(t,r[h],i),r[e]=null;p++}else $t(r[d]),d--;else $t(r[h]),h++;for(;p<=f;){const e=bt(t,l[f+1]);wt(e,s[p]),l[p++]=e}for(;h<=d;){const t=r[h++];null!==t&&$t(t)}return this.ut=o,((t,e=At)=>{t._$AH=e})(t,l),B}});
61
+ */const{I:yt}=rt,At=()=>document.createComment(""),bt=(t,e,i)=>{const s=t._$AA.parentNode,r=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=s.insertBefore(At(),r),n=s.insertBefore(At(),r);i=new yt(e,n,t,t.options)}else{const e=i._$AB.nextSibling,n=i._$AM,o=n!==t;if(o){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==n._$AU&&i._$AP(e)}if(e!==r||o){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;s.insertBefore(t,r),t=e}}}return i},$t=(t,e,i=t)=>(t._$AI(e,i),t),vt={},St=t=>{t._$AP?.(!1,!0);let e=t._$AA;const i=t._$AB.nextSibling;for(;e!==i;){const t=e.nextSibling;e.remove(),e=t}},wt=(t,e,i)=>{const s=new Map;for(let r=e;r<=i;r++)s.set(t[r],r);return s},xt=_t(class extends gt{constructor(t){if(super(t),t.type!==mt)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let s;void 0===i?i=e:void 0!==e&&(s=e);const r=[],n=[];let o=0;for(const e of t)r[o]=s?s(e,o):o,n[o]=i(e,o),o++;return{values:n,keys:r}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,s]){const r=(t=>t._$AH)(t),{values:n,keys:o}=this.dt(e,i,s);if(!Array.isArray(r))return this.ut=o,n;const a=this.ut??=[],l=[];let c,h,u=0,p=r.length-1,d=0,f=n.length-1;for(;u<=p&&d<=f;)if(null===r[u])u++;else if(null===r[p])p--;else if(a[u]===o[d])l[d]=$t(r[u],n[d]),u++,d++;else if(a[p]===o[f])l[f]=$t(r[p],n[f]),p--,f--;else if(a[u]===o[f])l[f]=$t(r[u],n[f]),bt(t,l[f+1],r[u]),u++,f--;else if(a[p]===o[d])l[d]=$t(r[p],n[d]),bt(t,r[u],r[p]),p--,d++;else if(void 0===c&&(c=wt(o,d,f),h=wt(a,u,p)),c.has(a[u]))if(c.has(a[p])){const e=h.get(o[d]),i=void 0!==e?r[e]:null;if(null===i){const e=bt(t,r[u]);$t(e,n[d]),l[d]=e}else l[d]=$t(i,n[d]),bt(t,r[u],i),r[e]=null;d++}else St(r[p]),p--;else St(r[u]),u++;for(;d<=f;){const e=bt(t,l[f+1]);$t(e,n[d]),l[d++]=e}for(;u<=p;){const t=r[u++];null!==t&&St(t)}return this.ut=o,((t,e=vt)=>{t._$AH=e})(t,l),F}});
62
62
  /**
63
63
  * @license
64
64
  * Copyright 2017 Google LLC
65
65
  * SPDX-License-Identifier: BSD-3-Clause
66
- */var Nt={done:!0,hasNext:!1},Et={done:!1,hasNext:!1},Ot=()=>Nt;function Ct(t,...e){let i=t,n=e.map((t=>"lazy"in t?function(t){let{lazy:e,lazyArgs:i}=t,n=e(...i);return Object.assign(n,{isSingle:e.single??!1,index:0,items:[]})}(t):void 0)),r=0;for(;r<e.length;){if(void 0===n[r]||!Mt(i)){i=(0,e[r])(i),r+=1;continue}let t=[];for(let i=r;i<e.length;i++){let e=n[i];if(void 0===e||(t.push(e),e.isSingle))break}let s=[];for(let e of i)if(Pt(e,s,t))break;let{isSingle:o}=t.at(-1);i=o?s[0]:s,r+=t.length}return i}function Pt(t,e,i){if(0===i.length)return e.push(t),!1;let n=t,r=Et,s=!1;for(let[t,o]of i.entries()){let{index:a,items:l}=o;if(l.push(n),r=o(n,a,l),o.index+=1,r.hasNext){if(r.hasMany){for(let n of r.next)if(Pt(n,e,i.slice(t+1)))return!0;return s}n=r.next}if(!r.hasNext)break;r.done&&(s=!0)}return r.hasNext&&e.push(n),s}function Mt(t){return"string"==typeof t||"object"==typeof t&&null!==t&&Symbol.iterator in t}function Dt(t,e,i){let n=t.length-e.length;if(0===n)return t(...e);if(1===n)return function(t,e,i){let n=i=>t(i,...e);return void 0===i?n:Object.assign(n,{lazy:i,lazyArgs:e})}(t,e,i);throw new Error("Wrong number of arguments")}function Tt(...t){return Dt(kt,t)}var kt=(t,e)=>t.length>=e;function Rt(t,e){let i=[];for(let n=t;n<e;n++)i.push(n);return i}function Ut(t,e){if(!Tt(e,1))return{...t};if(!Tt(e,2)){let{[e[0]]:i,...n}=t;return n}let i={...t};for(let t of e)delete i[t];return i}function It(...t){return Dt(Lt,t)}var Lt=(t,e)=>({...t,...e});function jt(...t){return Dt(Vt,t,Ht)}var Vt=(t,e)=>t.map(e),Ht=t=>(e,i,n)=>({done:!1,hasNext:!0,next:t(e,i,n)});function Ft(t){return"number"==typeof t&&!Number.isNaN(t)}function qt(t){return"string"==typeof t}function Bt(t){return void 0===t||("string"==typeof t||Array.isArray(t)?0===t.length:0===Object.keys(t).length)}function zt(t){return null==t}function Yt(t){return Array.isArray(t)}function Zt(t){return"boolean"==typeof t}function Wt(t){return t instanceof Date}function Qt(...t){return Dt(Gt,t)}function Gt(t,e){if(t===e||Object.is(t,e))return!0;if("object"!=typeof t||"object"!=typeof e||null===t||null===e||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;if(Array.isArray(t))return function(t,e){if(t.length!==e.length)return!1;for(let[i,n]of t.entries())if(!Gt(n,e[i]))return!1;return!0}(t,e);if(t instanceof Map)return function(t,e){if(t.size!==e.size)return!1;for(let[i,n]of t.entries())if(!e.has(i)||!Gt(n,e.get(i)))return!1;return!0}(t,e);if(t instanceof Set)return function(t,e){if(t.size!==e.size)return!1;let i=[...e];for(let e of t){let t=!1;for(let[n,r]of i.entries())if(Gt(e,r)){t=!0,i.splice(n,1);break}if(!t)return!1}return!0}(t,e);if(t instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp)return t.toString()===e.toString();if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let[i,n]of Object.entries(t))if(!(i in e)||!Gt(n,e[i]))return!1;return!0}function Kt(...t){return function(t,e){let i=e.length-t.length;if(1===i){let[i,...n]=e;return Ct(i,{lazy:t,lazyArgs:n})}if(0===i){let i={lazy:t,lazyArgs:e};return Object.assign((t=>Ct(t,i)),i)}throw new Error("Wrong number of arguments")}(Jt,t)}function Jt(t){if(0===t.length)return Ot;let e=new Map;for(let i of t)e.set(i,(e.get(i)??0)+1);return t=>{let i=e.get(t);return void 0===i||0===i?Et:(1===i?e.delete(t):e.set(t,i-1),{hasNext:!0,next:t,done:0===e.size})}}function Xt(t,e){const i=function(t,e){return function(t){return"function"==typeof t}(t)?t(e):t}(t,e),{data:n}=e,r=[];for(let t=0;t<n.length;t+=1){const e=Yt(i)?i[t]:i;r.push(e)}return r}function te(t,e){const i=Xt(t,e),{data:n}=e,r=[];for(let t=0;t<n.length;t+=1){const{digits:e}=n[t],s=i[t];r.push([]);for(let i=0;i<e.length;i+=1){const e=Yt(s)?s[i]:s;r[t].push(e)}}return r}function ee(t,e){const i=te(t,e),{data:n}=e,r=[];for(let t=0;t<n.length;t+=1){const{digits:e}=n[t],s=i[t];r.push([]);for(let i=0;i<e.length;i+=1){const{data:n}=e[i],o=s[i];r[t].push([]);for(let e=0;e<n.length;e+=1){const n=Yt(o)?o[e]:o;r[t][i].push(n)}}}return r}function ie(t,e){return It(t??{},e??{})}function ne(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const n of i){const i=Number.parseInt(n,10);t[i]=ie(t[i],e[i])}return t}function re(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const n of i){const i=Number.parseInt(n,10);t[i]=ne(t[i],e[i])}return t}const se=e=>{class i extends e{constructor(){super(...arguments),this.cellStyles={},this.cachedCellStyles=[],this.digitStyles={},this.cachedDigitStyles=[],this.partStyles={},this.cachedPartStyles=[],this.color="inherit"}extractCellStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=function(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const n of i){const i=Number.parseInt(n,10);t[i]=re(t[i],e[i])}return t}(ee(this.cellStyles??{},t),ee(this.cellStylesDynamic??{},t));return Qt(this.cachedCellStyles,e)||(this.cachedCellStyles=e),this.cachedCellStyles}extractDigitStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=re(te(this.digitStyles??{},t),te(this.digitStylesDynamic??{},t));return Qt(this.cachedDigitStyles,e)||(this.cachedDigitStyles=e),this.cachedDigitStyles}extractPartStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=ne(Xt(this.partStyles??{},t),Xt(this.partStylesDynamic??{},t));return Qt(this.cachedPartStyles,e)||(this.cachedPartStyles=e),this.cachedPartStyles}}return t([ht({type:Object,attribute:"cell-styles",reflect:!0})],i.prototype,"cellStyles",void 0),t([ht({type:Object,attribute:"digit-styles",reflect:!0})],i.prototype,"digitStyles",void 0),t([ht({type:Object,attribute:"part-styles",reflect:!0})],i.prototype,"partStyles",void 0),t([ht({type:String,reflect:!0})],i.prototype,"color",void 0),i};function oe(t){return t.length}function ae(){return function(t){if(!(r=t.length))return[];for(var e=-1,i=function(t,e){let i;if(void 0===e)for(const e of t)null!=e&&(i>e||void 0===i&&e>=e)&&(i=e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(i>r||void 0===i&&r>=r)&&(i=r)}return i}(t,oe),n=new Array(i);++e<i;)for(var r,s=-1,o=n[e]=new Array(r);++s<r;)o[s]=t[s][e];return n}(arguments)}function le(t,e){const[i,n]=t,[r,s]=e,o={animate:!0,cancelPrevAnimation:!1};let a="";return 1===r.data.length&&(o.animate=!1,o.cancelPrevAnimation=!0,a="only one digit"),i!==n||(r.data[0]===r.data[r.data.length-1]&&(o.animate=!1,o.cancelPrevAnimation=!0,a="same head and tail"),Qt(r,s)&&(o.animate=!1,a="same digits"),a&&(o.earlyReturn=a)),o}function ce(t){try{return JSON.parse(t)}catch(e){return t}}function ue(t){const e={};return Yt(t.digitToChar)?t.digitToChar.forEach(((t,i)=>{var n;e[(n=i,String.fromCodePoint(n+48))]=t})):function(t){return"object"==typeof t&&null!==t}(t.digitToChar)&&Object.entries(t.digitToChar).forEach((([t,i])=>{e[t]=i})),{...t,digitToChar:e}}const he=i=>{var n,r;class s extends i{constructor(){super(...arguments),r.set(this,{...n.DEFAULT_PARTS_OPTIONS}),this.parts=[],this.oldParts=[],this.partPreprocessDataList=[]}get partsOptions(){return e(this,r,"f")}set partsOptions(t){const i=e(this,r,"f");!function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?r.call(t,i):r?r.value=i:e.set(t,i)}(this,r,ue({...n.DEFAULT_PARTS_OPTIONS,...t}),"f"),this.requestUpdate("partsOptions",i)}sampling(t,e){return function(t,e,i,n){let r=n;const s=t.isInteger(e)&&t.isInteger(i)?function(t,e,i){return function(n){return t.round(t.add(t.mul(e,t.sub(t.create(1),n)),t.mul(i,n)))}}(t,e,i):function(t,e,i){return function(n){return t.add(t.mul(e,t.sub(t.create(1),n)),t.mul(i,n))}}(t,e,i);t.eq(e,i)&&(r=1);const o=[];for(let e=0;e<r;e++){const i=t.div(t.create(e),t.create(Math.max(r-1,1)));o.push(s(i))}return o}(this.numberAdapter,this.numberAdapter.max(t,e),this.numberAdapter.min(t,e),this.partsOptions.sampleCount)}sampleSplit(t){return[t.slice()]}sampleToString(t){return this.numberAdapter.toString(t)}willUpdate(t){super.willUpdate(t),t.has("value")&&(this.oldParts=this.parts),(t.has("value")||t.has("partsOptions"))&&(this.parts=this.processPartData()),t.has("value")&&(this.partPreprocessDataList=function(t,e,i,n){const r=[];let s=0;for(let o=0;o<e.length;o++){const a=e[o],l=n?.[o],c=[];for(let e=0;e<a.digits.length;e++){const n=a.digits[e],r=l?.digits.find((t=>t.place===n.place));c.push({...le([t,i],[n,r]),index:s++,partIndex:o,digitIndex:e})}r.push(c)}return r}(this.direction,this.parts,this.oldDirection,this.oldParts))}processPartData(){const{decimalSeparator:t,digitToChar:e,minPlaces:i,fillChar:n,type:r}=this.partsOptions,s=this.value,o=this.oldValue;let a=e=>this.sampleToString(e).split(t);"string"===r&&(a=t=>[this.sampleToString(t),""]);const l=[],c=this.sampleSplit(this.sampling(s,o));{const r=this.numberAdapter.gt(s,o)?"down":"up";for(let s=0;s<c.length;s++){const o=c[s],u=o["down"===r?0:o.length-1],[h=1,d=0]=i,p=a(u),f=Math.max(this.stringAdapter.stringToChars(p[0]).length,h),g=Math.max(this.stringAdapter.stringToChars(p[1]??"").length,d),m=ae(...o.map((e=>{const[i="",r=""]=a(e),s=this.stringAdapter.stringToChars(i),o=this.stringAdapter.stringToChars(r),l=Math.max(f-s.length,0),c=Math.max(g-o.length,0);let u=[].concat(new Array(l).fill(n),s);return g>0&&(u=u.concat([t],o,new Array(c).fill(n))),u}))).map(((t,i,n)=>({data:t.filter(((t,e,i)=>0===e||t!==i[e-1])).map((t=>e[t]??t)),place:n.length-i})));l.push({digits:m})}}return l}}return n=s,r=new WeakMap,s.DEFAULT_PARTS_OPTIONS={sampleCount:16,decimalSeparator:".",fillChar:"0",minPlaces:[1,0],digitToChar:{},type:"number"},t([ht({type:Object,attribute:"parts-options",converter:t=>ce(t??"")??{},noAccessor:!0})],s.prototype,"partsOptions",null),s},de=()=>({create(t){const e=Number(t);return Number.isFinite(e)?e:0},add:(t,e)=>t+e,sub:(t,e)=>t-e,mul:(t,e)=>t*e,div:(t,e)=>t/e,compare:(t,e)=>t>e?1:t<e?-1:0,eq:(t,e)=>t===e,gt:(t,e)=>t>e,gte:(t,e)=>t>=e,lt:(t,e)=>t<e,lte:(t,e)=>t<=e,isInteger:t=>Number.isInteger(t),isNegative:t=>t<0,isPositive:t=>t>0,isZero:t=>0===t,isNaN:t=>Number.isNaN(t),isFinite:t=>Number.isFinite(t),abs:t=>Math.abs(t),ceil:t=>Math.ceil(t),floor:t=>Math.floor(t),round:t=>Math.round(t),max:(t,e)=>Math.max(t,e),min:(t,e)=>Math.min(t,e),toNumber:t=>Number(t),toString:t=>String(t)})
67
- /*!
68
- * decimal.js v10.4.3
69
- * An arbitrary-precision Decimal type for JavaScript.
70
- * https://github.com/MikeMcl/decimal.js
71
- * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
72
- * MIT Licence
73
- */;var pe,fe,ge=9e15,me=1e9,_e="0123456789abcdef",ye="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ve="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",be={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:ge,crypto:!1},we=!0,Ae="[DecimalError] ",$e=Ae+"Invalid argument: ",Se=Ae+"Precision limit exceeded",xe=Ae+"crypto unavailable",Ne="[object Decimal]",Ee=Math.floor,Oe=Math.pow,Ce=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Pe=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Me=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,De=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Te=1e7,ke=ye.length-1,Re=ve.length-1,Ue={toStringTag:Ne};function Ie(t){var e,i,n,r=t.length-1,s="",o=t[0];if(r>0){for(s+=o,e=1;e<r;e++)(i=7-(n=t[e]+"").length)&&(s+=We(i)),s+=n;(i=7-(n=(o=t[e])+"").length)&&(s+=We(i))}else if(0===o)return"0";for(;o%10==0;)o/=10;return s+o}function Le(t,e,i){if(t!==~~t||t<e||t>i)throw Error($e+t)}function je(t,e,i,n){var r,s,o,a;for(s=t[0];s>=10;s/=10)--e;return--e<0?(e+=7,r=0):(r=Math.ceil((e+1)/7),e%=7),s=Oe(10,7-e),a=t[r]%s|0,null==n?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),o=i<4&&99999==a||i>3&&49999==a||5e4==a||0==a):o=(i<4&&a+1==s||i>3&&a+1==s/2)&&(t[r+1]/s/100|0)==Oe(10,e-2)-1||(a==s/2||0==a)&&!(t[r+1]/s/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),o=(n||i<4)&&9999==a||!n&&i>3&&4999==a):o=((n||i<4)&&a+1==s||!n&&i>3&&a+1==s/2)&&(t[r+1]/s/1e3|0)==Oe(10,e-3)-1,o}function Ve(t,e,i){for(var n,r,s=[0],o=0,a=t.length;o<a;){for(r=s.length;r--;)s[r]*=e;for(s[0]+=_e.indexOf(t.charAt(o++)),n=0;n<s.length;n++)s[n]>i-1&&(void 0===s[n+1]&&(s[n+1]=0),s[n+1]+=s[n]/i|0,s[n]%=i)}return s.reverse()}Ue.absoluteValue=Ue.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Fe(t)},Ue.ceil=function(){return Fe(new this.constructor(this),this.e+1,2)},Ue.clampedTo=Ue.clamp=function(t,e){var i=this,n=i.constructor;if(t=new n(t),e=new n(e),!t.s||!e.s)return new n(NaN);if(t.gt(e))throw Error($e+e);return i.cmp(t)<0?t:i.cmp(e)>0?e:new n(i)},Ue.comparedTo=Ue.cmp=function(t){var e,i,n,r,s=this,o=s.d,a=(t=new s.constructor(t)).d,l=s.s,c=t.s;if(!o||!a)return l&&c?l!==c?l:o===a?0:!o^l<0?1:-1:NaN;if(!o[0]||!a[0])return o[0]?l:a[0]?-c:0;if(l!==c)return l;if(s.e!==t.e)return s.e>t.e^l<0?1:-1;for(e=0,i=(n=o.length)<(r=a.length)?n:r;e<i;++e)if(o[e]!==a[e])return o[e]>a[e]^l<0?1:-1;return n===r?0:n>r^l<0?1:-1},Ue.cosine=Ue.cos=function(){var t,e,i=this,n=i.constructor;return i.d?i.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(i.e,i.sd())+7,n.rounding=1,i=function(t,e){var i,n,r;if(e.isZero())return e;n=e.d.length,n<32?r=(1/ri(4,i=Math.ceil(n/3))).toString():(i=16,r="2.3283064365386962890625e-10");t.precision+=i,e=ni(t,1,e.times(r),new t(1));for(var s=i;s--;){var o=e.times(e);e=o.times(o).minus(o).times(8).plus(1)}return t.precision-=i,e}(n,si(n,i)),n.precision=t,n.rounding=e,Fe(2==fe||3==fe?i.neg():i,t,e,!0)):new n(1):new n(NaN)},Ue.cubeRoot=Ue.cbrt=function(){var t,e,i,n,r,s,o,a,l,c,u=this,h=u.constructor;if(!u.isFinite()||u.isZero())return new h(u);for(we=!1,(s=u.s*Oe(u.s*u,1/3))&&Math.abs(s)!=1/0?n=new h(s.toString()):(i=Ie(u.d),(s=((t=u.e)-i.length+1)%3)&&(i+=1==s||-2==s?"0":"00"),s=Oe(i,1/3),t=Ee((t+1)/3)-(t%3==(t<0?-1:2)),(n=new h(i=s==1/0?"5e"+t:(i=s.toExponential()).slice(0,i.indexOf("e")+1)+t)).s=u.s),o=(t=h.precision)+3;;)if(c=(l=(a=n).times(a).times(a)).plus(u),n=He(c.plus(u).times(a),c.plus(l),o+2,1),Ie(a.d).slice(0,o)===(i=Ie(n.d)).slice(0,o)){if("9999"!=(i=i.slice(o-3,o+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(Fe(n,t+1,1),e=!n.times(n).times(n).eq(u));break}if(!r&&(Fe(a,t+1,0),a.times(a).times(a).eq(u))){n=a;break}o+=4,r=1}return we=!0,Fe(n,t,h.rounding,e)},Ue.decimalPlaces=Ue.dp=function(){var t,e=this.d,i=NaN;if(e){if(i=7*((t=e.length-1)-Ee(this.e/7)),t=e[t])for(;t%10==0;t/=10)i--;i<0&&(i=0)}return i},Ue.dividedBy=Ue.div=function(t){return He(this,new this.constructor(t))},Ue.dividedToIntegerBy=Ue.divToInt=function(t){var e=this.constructor;return Fe(He(this,new e(t),0,1,1),e.precision,e.rounding)},Ue.equals=Ue.eq=function(t){return 0===this.cmp(t)},Ue.floor=function(){return Fe(new this.constructor(this),this.e+1,3)},Ue.greaterThan=Ue.gt=function(t){return this.cmp(t)>0},Ue.greaterThanOrEqualTo=Ue.gte=function(t){var e=this.cmp(t);return 1==e||0===e},Ue.hyperbolicCosine=Ue.cosh=function(){var t,e,i,n,r,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;i=o.precision,n=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,(r=s.d.length)<32?e=(1/ri(4,t=Math.ceil(r/3))).toString():(t=16,e="2.3283064365386962890625e-10"),s=ni(o,1,s.times(e),new o(1),!0);for(var l,c=t,u=new o(8);c--;)l=s.times(s),s=a.minus(l.times(u.minus(l.times(u))));return Fe(s,o.precision=i,o.rounding=n,!0)},Ue.hyperbolicSine=Ue.sinh=function(){var t,e,i,n,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(e=s.precision,i=s.rounding,s.precision=e+Math.max(r.e,r.sd())+4,s.rounding=1,(n=r.d.length)<3)r=ni(s,2,r,r,!0);else{t=(t=1.4*Math.sqrt(n))>16?16:0|t,r=ni(s,2,r=r.times(1/ri(5,t)),r,!0);for(var o,a=new s(5),l=new s(16),c=new s(20);t--;)o=r.times(r),r=r.times(a.plus(o.times(l.times(o).plus(c))))}return s.precision=e,s.rounding=i,Fe(r,e,i,!0)},Ue.hyperbolicTangent=Ue.tanh=function(){var t,e,i=this,n=i.constructor;return i.isFinite()?i.isZero()?new n(i):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,He(i.sinh(),i.cosh(),n.precision=t,n.rounding=e)):new n(i.s)},Ue.inverseCosine=Ue.acos=function(){var t,e=this,i=e.constructor,n=e.abs().cmp(1),r=i.precision,s=i.rounding;return-1!==n?0===n?e.isNeg()?Ye(i,r,s):new i(0):new i(NaN):e.isZero()?Ye(i,r+4,s).times(.5):(i.precision=r+6,i.rounding=1,e=e.asin(),t=Ye(i,r+4,s).times(.5),i.precision=r,i.rounding=s,t.minus(e))},Ue.inverseHyperbolicCosine=Ue.acosh=function(){var t,e,i=this,n=i.constructor;return i.lte(1)?new n(i.eq(1)?0:NaN):i.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(i.e),i.sd())+4,n.rounding=1,we=!1,i=i.times(i).minus(1).sqrt().plus(i),we=!0,n.precision=t,n.rounding=e,i.ln()):new n(i)},Ue.inverseHyperbolicSine=Ue.asinh=function(){var t,e,i=this,n=i.constructor;return!i.isFinite()||i.isZero()?new n(i):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(i.e),i.sd())+6,n.rounding=1,we=!1,i=i.times(i).plus(1).sqrt().plus(i),we=!0,n.precision=t,n.rounding=e,i.ln())},Ue.inverseHyperbolicTangent=Ue.atanh=function(){var t,e,i,n,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(t=s.precision,e=s.rounding,n=r.sd(),Math.max(n,t)<2*-r.e-1?Fe(new s(r),t,e,!0):(s.precision=i=n-r.e,r=He(r.plus(1),new s(1).minus(r),i+t,1),s.precision=t+4,s.rounding=1,r=r.ln(),s.precision=t,s.rounding=e,r.times(.5))):new s(NaN)},Ue.inverseSine=Ue.asin=function(){var t,e,i,n,r=this,s=r.constructor;return r.isZero()?new s(r):(e=r.abs().cmp(1),i=s.precision,n=s.rounding,-1!==e?0===e?((t=Ye(s,i+4,n).times(.5)).s=r.s,t):new s(NaN):(s.precision=i+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=n,r.times(2)))},Ue.inverseTangent=Ue.atan=function(){var t,e,i,n,r,s,o,a,l,c=this,u=c.constructor,h=u.precision,d=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&h+4<=Re)return(o=Ye(u,h+4,d).times(.25)).s=c.s,o}else{if(!c.s)return new u(NaN);if(h+4<=Re)return(o=Ye(u,h+4,d).times(.5)).s=c.s,o}for(u.precision=a=h+10,u.rounding=1,t=i=Math.min(28,a/7+2|0);t;--t)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(we=!1,e=Math.ceil(a/7),n=1,l=c.times(c),o=new u(c),r=c;-1!==t;)if(r=r.times(l),s=o.minus(r.div(n+=2)),r=r.times(l),void 0!==(o=s.plus(r.div(n+=2))).d[e])for(t=e;o.d[t]===s.d[t]&&t--;);return i&&(o=o.times(2<<i-1)),we=!0,Fe(o,u.precision=h,u.rounding=d,!0)},Ue.isFinite=function(){return!!this.d},Ue.isInteger=Ue.isInt=function(){return!!this.d&&Ee(this.e/7)>this.d.length-2},Ue.isNaN=function(){return!this.s},Ue.isNegative=Ue.isNeg=function(){return this.s<0},Ue.isPositive=Ue.isPos=function(){return this.s>0},Ue.isZero=function(){return!!this.d&&0===this.d[0]},Ue.lessThan=Ue.lt=function(t){return this.cmp(t)<0},Ue.lessThanOrEqualTo=Ue.lte=function(t){return this.cmp(t)<1},Ue.logarithm=Ue.log=function(t){var e,i,n,r,s,o,a,l,c=this,u=c.constructor,h=u.precision,d=u.rounding;if(null==t)t=new u(10),e=!0;else{if(i=(t=new u(t)).d,t.s<0||!i||!i[0]||t.eq(1))return new u(NaN);e=t.eq(10)}if(i=c.d,c.s<0||!i||!i[0]||c.eq(1))return new u(i&&!i[0]?-1/0:1!=c.s?NaN:i?0:1/0);if(e)if(i.length>1)s=!0;else{for(r=i[0];r%10==0;)r/=10;s=1!==r}if(we=!1,o=Xe(c,a=h+5),n=e?ze(u,a+10):Xe(t,a),je((l=He(o,n,a,1)).d,r=h,d))do{if(o=Xe(c,a+=10),n=e?ze(u,a+10):Xe(t,a),l=He(o,n,a,1),!s){+Ie(l.d).slice(r+1,r+15)+1==1e14&&(l=Fe(l,h+1,0));break}}while(je(l.d,r+=10,d));return we=!0,Fe(l,h,d)},Ue.minus=Ue.sub=function(t){var e,i,n,r,s,o,a,l,c,u,h,d,p=this,f=p.constructor;if(t=new f(t),!p.d||!t.d)return p.s&&t.s?p.d?t.s=-t.s:t=new f(t.d||p.s!==t.s?p:NaN):t=new f(NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(c=p.d,d=t.d,a=f.precision,l=f.rounding,!c[0]||!d[0]){if(d[0])t.s=-t.s;else{if(!c[0])return new f(3===l?-0:0);t=new f(p)}return we?Fe(t,a,l):t}if(i=Ee(t.e/7),u=Ee(p.e/7),c=c.slice(),s=u-i){for((h=s<0)?(e=c,s=-s,o=d.length):(e=d,i=u,o=c.length),s>(n=Math.max(Math.ceil(a/7),o)+2)&&(s=n,e.length=1),e.reverse(),n=s;n--;)e.push(0);e.reverse()}else{for((h=(n=c.length)<(o=d.length))&&(o=n),n=0;n<o;n++)if(c[n]!=d[n]){h=c[n]<d[n];break}s=0}for(h&&(e=c,c=d,d=e,t.s=-t.s),o=c.length,n=d.length-o;n>0;--n)c[o++]=0;for(n=d.length;n>s;){if(c[--n]<d[n]){for(r=n;r&&0===c[--r];)c[r]=Te-1;--c[r],c[n]+=Te}c[n]-=d[n]}for(;0===c[--o];)c.pop();for(;0===c[0];c.shift())--i;return c[0]?(t.d=c,t.e=Be(c,i),we?Fe(t,a,l):t):new f(3===l?-0:0)},Ue.modulo=Ue.mod=function(t){var e,i=this,n=i.constructor;return t=new n(t),!i.d||!t.s||t.d&&!t.d[0]?new n(NaN):!t.d||i.d&&!i.d[0]?Fe(new n(i),n.precision,n.rounding):(we=!1,9==n.modulo?(e=He(i,t.abs(),0,3,1)).s*=t.s:e=He(i,t,0,n.modulo,1),e=e.times(t),we=!0,i.minus(e))},Ue.naturalExponential=Ue.exp=function(){return Je(this)},Ue.naturalLogarithm=Ue.ln=function(){return Xe(this)},Ue.negated=Ue.neg=function(){var t=new this.constructor(this);return t.s=-t.s,Fe(t)},Ue.plus=Ue.add=function(t){var e,i,n,r,s,o,a,l,c,u,h=this,d=h.constructor;if(t=new d(t),!h.d||!t.d)return h.s&&t.s?h.d||(t=new d(t.d||h.s===t.s?h:NaN)):t=new d(NaN),t;if(h.s!=t.s)return t.s=-t.s,h.minus(t);if(c=h.d,u=t.d,a=d.precision,l=d.rounding,!c[0]||!u[0])return u[0]||(t=new d(h)),we?Fe(t,a,l):t;if(s=Ee(h.e/7),n=Ee(t.e/7),c=c.slice(),r=s-n){for(r<0?(i=c,r=-r,o=u.length):(i=u,n=s,o=c.length),r>(o=(s=Math.ceil(a/7))>o?s+1:o+1)&&(r=o,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((o=c.length)-(r=u.length)<0&&(r=o,i=u,u=c,c=i),e=0;r;)e=(c[--r]=c[r]+u[r]+e)/Te|0,c[r]%=Te;for(e&&(c.unshift(e),++n),o=c.length;0==c[--o];)c.pop();return t.d=c,t.e=Be(c,n),we?Fe(t,a,l):t},Ue.precision=Ue.sd=function(t){var e,i=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error($e+t);return i.d?(e=Ze(i.d),t&&i.e+1>e&&(e=i.e+1)):e=NaN,e},Ue.round=function(){var t=this,e=t.constructor;return Fe(new e(t),t.e+1,e.rounding)},Ue.sine=Ue.sin=function(){var t,e,i=this,n=i.constructor;return i.isFinite()?i.isZero()?new n(i):(t=n.precision,e=n.rounding,n.precision=t+Math.max(i.e,i.sd())+7,n.rounding=1,i=function(t,e){var i,n=e.d.length;if(n<3)return e.isZero()?e:ni(t,2,e,e);i=1.4*Math.sqrt(n),i=i>16?16:0|i,e=e.times(1/ri(5,i)),e=ni(t,2,e,e);for(var r,s=new t(5),o=new t(16),a=new t(20);i--;)r=e.times(e),e=e.times(s.plus(r.times(o.times(r).minus(a))));return e}(n,si(n,i)),n.precision=t,n.rounding=e,Fe(fe>2?i.neg():i,t,e,!0)):new n(NaN)},Ue.squareRoot=Ue.sqrt=function(){var t,e,i,n,r,s,o=this,a=o.d,l=o.e,c=o.s,u=o.constructor;if(1!==c||!a||!a[0])return new u(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);for(we=!1,0==(c=Math.sqrt(+o))||c==1/0?(((e=Ie(a)).length+l)%2==0&&(e+="0"),c=Math.sqrt(e),l=Ee((l+1)/2)-(l<0||l%2),n=new u(e=c==1/0?"5e"+l:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+l)):n=new u(c.toString()),i=(l=u.precision)+3;;)if(n=(s=n).plus(He(o,s,i+2,1)).times(.5),Ie(s.d).slice(0,i)===(e=Ie(n.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Fe(n,l+1,1),t=!n.times(n).eq(o));break}if(!r&&(Fe(s,l+1,0),s.times(s).eq(o))){n=s;break}i+=4,r=1}return we=!0,Fe(n,l,u.rounding,t)},Ue.tangent=Ue.tan=function(){var t,e,i=this,n=i.constructor;return i.isFinite()?i.isZero()?new n(i):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,(i=i.sin()).s=1,i=He(i,new n(1).minus(i.times(i)).sqrt(),t+10,0),n.precision=t,n.rounding=e,Fe(2==fe||4==fe?i.neg():i,t,e,!0)):new n(NaN)},Ue.times=Ue.mul=function(t){var e,i,n,r,s,o,a,l,c,u=this,h=u.constructor,d=u.d,p=(t=new h(t)).d;if(t.s*=u.s,!(d&&d[0]&&p&&p[0]))return new h(!t.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:d&&p?0*t.s:t.s/0);for(i=Ee(u.e/7)+Ee(t.e/7),(l=d.length)<(c=p.length)&&(s=d,d=p,p=s,o=l,l=c,c=o),s=[],n=o=l+c;n--;)s.push(0);for(n=c;--n>=0;){for(e=0,r=l+n;r>n;)a=s[r]+p[n]*d[r-n-1]+e,s[r--]=a%Te|0,e=a/Te|0;s[r]=(s[r]+e)%Te|0}for(;!s[--o];)s.pop();return e?++i:s.shift(),t.d=s,t.e=Be(s,i),we?Fe(t,h.precision,h.rounding):t},Ue.toBinary=function(t,e){return oi(this,2,t,e)},Ue.toDecimalPlaces=Ue.toDP=function(t,e){var i=this,n=i.constructor;return i=new n(i),void 0===t?i:(Le(t,0,me),void 0===e?e=n.rounding:Le(e,0,8),Fe(i,t+i.e+1,e))},Ue.toExponential=function(t,e){var i,n=this,r=n.constructor;return void 0===t?i=qe(n,!0):(Le(t,0,me),void 0===e?e=r.rounding:Le(e,0,8),i=qe(n=Fe(new r(n),t+1,e),!0,t+1)),n.isNeg()&&!n.isZero()?"-"+i:i},Ue.toFixed=function(t,e){var i,n,r=this,s=r.constructor;return void 0===t?i=qe(r):(Le(t,0,me),void 0===e?e=s.rounding:Le(e,0,8),i=qe(n=Fe(new s(r),t+r.e+1,e),!1,t+n.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},Ue.toFraction=function(t){var e,i,n,r,s,o,a,l,c,u,h,d,p=this,f=p.d,g=p.constructor;if(!f)return new g(p);if(c=i=new g(1),n=l=new g(0),o=(s=(e=new g(n)).e=Ze(f)-p.e-1)%7,e.d[0]=Oe(10,o<0?7+o:o),null==t)t=s>0?e:c;else{if(!(a=new g(t)).isInt()||a.lt(c))throw Error($e+a);t=a.gt(e)?s>0?e:c:a}for(we=!1,a=new g(Ie(f)),u=g.precision,g.precision=s=7*f.length*2;h=He(a,e,0,1,1),1!=(r=i.plus(h.times(n))).cmp(t);)i=n,n=r,r=c,c=l.plus(h.times(r)),l=r,r=e,e=a.minus(h.times(r)),a=r;return r=He(t.minus(i),n,0,1,1),l=l.plus(r.times(c)),i=i.plus(r.times(n)),l.s=c.s=p.s,d=He(c,n,s,1).minus(p).abs().cmp(He(l,i,s,1).minus(p).abs())<1?[c,n]:[l,i],g.precision=u,we=!0,d},Ue.toHexadecimal=Ue.toHex=function(t,e){return oi(this,16,t,e)},Ue.toNearest=function(t,e){var i=this,n=i.constructor;if(i=new n(i),null==t){if(!i.d)return i;t=new n(1),e=n.rounding}else{if(t=new n(t),void 0===e?e=n.rounding:Le(e,0,8),!i.d)return t.s?i:t;if(!t.d)return t.s&&(t.s=i.s),t}return t.d[0]?(we=!1,i=He(i,t,0,e,1).times(t),we=!0,Fe(i)):(t.s=i.s,i=t),i},Ue.toNumber=function(){return+this},Ue.toOctal=function(t,e){return oi(this,8,t,e)},Ue.toPower=Ue.pow=function(t){var e,i,n,r,s,o,a=this,l=a.constructor,c=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(Oe(+a,c));if((a=new l(a)).eq(1))return a;if(n=l.precision,s=l.rounding,t.eq(1))return Fe(a,n,s);if((e=Ee(t.e/7))>=t.d.length-1&&(i=c<0?-c:c)<=9007199254740991)return r=Qe(l,a,i,n),t.s<0?new l(1).div(r):Fe(r,n,s);if((o=a.s)<0){if(e<t.d.length-1)return new l(NaN);if(1&t.d[e]||(o=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=o,a}return(e=0!=(i=Oe(+a,c))&&isFinite(i)?new l(i+"").e:Ee(c*(Math.log("0."+Ie(a.d))/Math.LN10+a.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?o/0:0):(we=!1,l.rounding=a.s=1,i=Math.min(12,(e+"").length),(r=Je(t.times(Xe(a,n+i)),n)).d&&je((r=Fe(r,n+5,1)).d,n,s)&&(e=n+10,+Ie((r=Fe(Je(t.times(Xe(a,e+i)),e),e+5,1)).d).slice(n+1,n+15)+1==1e14&&(r=Fe(r,n+1,0))),r.s=o,we=!0,l.rounding=s,Fe(r,n,s))},Ue.toPrecision=function(t,e){var i,n=this,r=n.constructor;return void 0===t?i=qe(n,n.e<=r.toExpNeg||n.e>=r.toExpPos):(Le(t,1,me),void 0===e?e=r.rounding:Le(e,0,8),i=qe(n=Fe(new r(n),t,e),t<=n.e||n.e<=r.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+i:i},Ue.toSignificantDigits=Ue.toSD=function(t,e){var i=this.constructor;return void 0===t?(t=i.precision,e=i.rounding):(Le(t,1,me),void 0===e?e=i.rounding:Le(e,0,8)),Fe(new i(this),t,e)},Ue.toString=function(){var t=this,e=t.constructor,i=qe(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+i:i},Ue.truncated=Ue.trunc=function(){return Fe(new this.constructor(this),this.e+1,1)},Ue.valueOf=Ue.toJSON=function(){var t=this,e=t.constructor,i=qe(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+i:i};var He=function(){function t(t,e,i){var n,r=0,s=t.length;for(t=t.slice();s--;)n=t[s]*e+r,t[s]=n%i|0,r=n/i|0;return r&&t.unshift(r),t}function e(t,e,i,n){var r,s;if(i!=n)s=i>n?1:-1;else for(r=s=0;r<i;r++)if(t[r]!=e[r]){s=t[r]>e[r]?1:-1;break}return s}function i(t,e,i,n){for(var r=0;i--;)t[i]-=r,r=t[i]<e[i]?1:0,t[i]=r*n+t[i]-e[i];for(;!t[0]&&t.length>1;)t.shift()}return function(n,r,s,o,a,l){var c,u,h,d,p,f,g,m,_,y,v,b,w,A,$,S,x,N,E,O,C=n.constructor,P=n.s==r.s?1:-1,M=n.d,D=r.d;if(!(M&&M[0]&&D&&D[0]))return new C(n.s&&r.s&&(M?!D||M[0]!=D[0]:D)?M&&0==M[0]||!D?0*P:P/0:NaN);for(l?(p=1,u=n.e-r.e):(l=Te,p=7,u=Ee(n.e/p)-Ee(r.e/p)),E=D.length,x=M.length,y=(_=new C(P)).d=[],h=0;D[h]==(M[h]||0);h++);if(D[h]>(M[h]||0)&&u--,null==s?(A=s=C.precision,o=C.rounding):A=a?s+(n.e-r.e)+1:s,A<0)y.push(1),f=!0;else{if(A=A/p+2|0,h=0,1==E){for(d=0,D=D[0],A++;(h<x||d)&&A--;h++)$=d*l+(M[h]||0),y[h]=$/D|0,d=$%D|0;f=d||h<x}else{for((d=l/(D[0]+1)|0)>1&&(D=t(D,d,l),M=t(M,d,l),E=D.length,x=M.length),S=E,b=(v=M.slice(0,E)).length;b<E;)v[b++]=0;(O=D.slice()).unshift(0),N=D[0],D[1]>=l/2&&++N;do{d=0,(c=e(D,v,E,b))<0?(w=v[0],E!=b&&(w=w*l+(v[1]||0)),(d=w/N|0)>1?(d>=l&&(d=l-1),1==(c=e(g=t(D,d,l),v,m=g.length,b=v.length))&&(d--,i(g,E<m?O:D,m,l))):(0==d&&(c=d=1),g=D.slice()),(m=g.length)<b&&g.unshift(0),i(v,g,b,l),-1==c&&(c=e(D,v,E,b=v.length))<1&&(d++,i(v,E<b?O:D,b,l)),b=v.length):0===c&&(d++,v=[0]),y[h++]=d,c&&v[0]?v[b++]=M[S]||0:(v=[M[S]],b=1)}while((S++<x||void 0!==v[0])&&A--);f=void 0!==v[0]}y[0]||y.shift()}if(1==p)_.e=u,pe=f;else{for(h=1,d=y[0];d>=10;d/=10)h++;_.e=h+u*p-1,Fe(_,a?s+_.e+1:s,o,f)}return _}}();function Fe(t,e,i,n){var r,s,o,a,l,c,u,h,d,p=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(r=1,a=h[0];a>=10;a/=10)r++;if((s=e-r)<0)s+=7,o=e,l=(u=h[d=0])/Oe(10,r-o-1)%10|0;else if((d=Math.ceil((s+1)/7))>=(a=h.length)){if(!n)break t;for(;a++<=d;)h.push(0);u=l=0,r=1,o=(s%=7)-7+1}else{for(u=a=h[d],r=1;a>=10;a/=10)r++;l=(o=(s%=7)-7+r)<0?0:u/Oe(10,r-o-1)%10|0}if(n=n||e<0||void 0!==h[d+1]||(o<0?u:u%Oe(10,r-o-1)),c=i<4?(l||n)&&(0==i||i==(t.s<0?3:2)):l>5||5==l&&(4==i||n||6==i&&(s>0?o>0?u/Oe(10,r-o):0:h[d-1])%10&1||i==(t.s<0?8:7)),e<1||!h[0])return h.length=0,c?(e-=t.e+1,h[0]=Oe(10,(7-e%7)%7),t.e=-e||0):h[0]=t.e=0,t;if(0==s?(h.length=d,a=1,d--):(h.length=d+1,a=Oe(10,7-s),h[d]=o>0?(u/Oe(10,r-o)%Oe(10,o)|0)*a:0),c)for(;;){if(0==d){for(s=1,o=h[0];o>=10;o/=10)s++;for(o=h[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(t.e++,h[0]==Te&&(h[0]=1));break}if(h[d]+=a,h[d]!=Te)break;h[d--]=0,a=1}for(s=h.length;0===h[--s];)h.pop()}return we&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e<p.minE&&(t.e=0,t.d=[0])),t}function qe(t,e,i){if(!t.isFinite())return ti(t);var n,r=t.e,s=Ie(t.d),o=s.length;return e?(i&&(n=i-o)>0?s=s.charAt(0)+"."+s.slice(1)+We(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(t.e<0?"e":"e+")+t.e):r<0?(s="0."+We(-r-1)+s,i&&(n=i-o)>0&&(s+=We(n))):r>=o?(s+=We(r+1-o),i&&(n=i-r-1)>0&&(s=s+"."+We(n))):((n=r+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),i&&(n=i-o)>0&&(r+1===o&&(s+="."),s+=We(n))),s}function Be(t,e){var i=t[0];for(e*=7;i>=10;i/=10)e++;return e}function ze(t,e,i){if(e>ke)throw we=!0,i&&(t.precision=i),Error(Se);return Fe(new t(ye),e,1,!0)}function Ye(t,e,i){if(e>Re)throw Error(Se);return Fe(new t(ve),e,i,!0)}function Ze(t){var e=t.length-1,i=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)i--;for(e=t[0];e>=10;e/=10)i++}return i}function We(t){for(var e="";t--;)e+="0";return e}function Qe(t,e,i,n){var r,s=new t(1),o=Math.ceil(n/7+4);for(we=!1;;){if(i%2&&ai((s=s.times(e)).d,o)&&(r=!0),0===(i=Ee(i/2))){i=s.d.length-1,r&&0===s.d[i]&&++s.d[i];break}ai((e=e.times(e)).d,o)}return we=!0,s}function Ge(t){return 1&t.d[t.d.length-1]}function Ke(t,e,i){for(var n,r=new t(e[0]),s=0;++s<e.length;){if(!(n=new t(e[s])).s){r=n;break}r[i](n)&&(r=n)}return r}function Je(t,e){var i,n,r,s,o,a,l,c=0,u=0,h=0,d=t.constructor,p=d.rounding,f=d.precision;if(!t.d||!t.d[0]||t.e>17)return new d(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(we=!1,l=f):l=e,a=new d(.03125);t.e>-2;)t=t.times(a),h+=5;for(l+=n=Math.log(Oe(2,h))/Math.LN10*2+5|0,i=s=o=new d(1),d.precision=l;;){if(s=Fe(s.times(t),l,1),i=i.times(++u),Ie((a=o.plus(He(s,i,l,1))).d).slice(0,l)===Ie(o.d).slice(0,l)){for(r=h;r--;)o=Fe(o.times(o),l,1);if(null!=e)return d.precision=f,o;if(!(c<3&&je(o.d,l-n,p,c)))return Fe(o,d.precision=f,p,we=!0);d.precision=l+=10,i=s=a=new d(1),u=0,c++}o=a}}function Xe(t,e){var i,n,r,s,o,a,l,c,u,h,d,p=1,f=t,g=f.d,m=f.constructor,_=m.rounding,y=m.precision;if(f.s<0||!g||!g[0]||!f.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=f.s?NaN:g?0:f);if(null==e?(we=!1,u=y):u=e,m.precision=u+=10,n=(i=Ie(g)).charAt(0),!(Math.abs(s=f.e)<15e14))return c=ze(m,u+2,y).times(s+""),f=Xe(new m(n+"."+i.slice(1)),u-10).plus(c),m.precision=y,null==e?Fe(f,y,_,we=!0):f;for(;n<7&&1!=n||1==n&&i.charAt(1)>3;)n=(i=Ie((f=f.times(t)).d)).charAt(0),p++;for(s=f.e,n>1?(f=new m("0."+i),s++):f=new m(n+"."+i.slice(1)),h=f,l=o=f=He(f.minus(1),f.plus(1),u,1),d=Fe(f.times(f),u,1),r=3;;){if(o=Fe(o.times(d),u,1),Ie((c=l.plus(He(o,new m(r),u,1))).d).slice(0,u)===Ie(l.d).slice(0,u)){if(l=l.times(2),0!==s&&(l=l.plus(ze(m,u+2,y).times(s+""))),l=He(l,new m(p),u,1),null!=e)return m.precision=y,l;if(!je(l.d,u-10,_,a))return Fe(l,m.precision=y,_,we=!0);m.precision=u+=10,c=o=f=He(h.minus(1),h.plus(1),u,1),d=Fe(f.times(f),u,1),r=a=1}l=c,r+=2}}function ti(t){return String(t.s*t.s/0)}function ei(t,e){var i,n,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(i<0&&(i=n),i+=+e.slice(n+1),e=e.substring(0,n)):i<0&&(i=e.length),n=0;48===e.charCodeAt(n);n++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(n,r)){if(r-=n,t.e=i=i-n-1,t.d=[],n=(i+1)%7,i<0&&(n+=7),n<r){for(n&&t.d.push(+e.slice(0,n)),r-=7;n<r;)t.d.push(+e.slice(n,n+=7));n=7-(e=e.slice(n)).length}else n-=r;for(;n--;)e+="0";t.d.push(+e),we&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function ii(t,e){var i,n,r,s,o,a,l,c,u;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),De.test(e))return ei(t,e)}else if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(Pe.test(e))i=16,e=e.toLowerCase();else if(Ce.test(e))i=2;else{if(!Me.test(e))throw Error($e+e);i=8}for((s=e.search(/p/i))>0?(l=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),o=(s=e.indexOf("."))>=0,n=t.constructor,o&&(s=(a=(e=e.replace(".","")).length)-s,r=Qe(n,new n(i),s,2*s)),s=u=(c=Ve(e,i,Te)).length-1;0===c[s];--s)c.pop();return s<0?new n(0*t.s):(t.e=Be(c,u),t.d=c,we=!1,o&&(t=He(t,r,4*a)),l&&(t=t.times(Math.abs(l)<54?Oe(2,l):Wi.pow(2,l))),we=!0,t)}function ni(t,e,i,n,r){var s,o,a,l,c=t.precision,u=Math.ceil(c/7);for(we=!1,l=i.times(i),a=new t(n);;){if(o=He(a.times(l),new t(e++*e++),c,1),a=r?n.plus(o):n.minus(o),n=He(o.times(l),new t(e++*e++),c,1),void 0!==(o=a.plus(n)).d[u]){for(s=u;o.d[s]===a.d[s]&&s--;);if(-1==s)break}s=a,a=n,n=o,o=s}return we=!0,o.d.length=u+1,o}function ri(t,e){for(var i=t;--e;)i*=t;return i}function si(t,e){var i,n=e.s<0,r=Ye(t,t.precision,1),s=r.times(.5);if((e=e.abs()).lte(s))return fe=n?4:1,e;if((i=e.divToInt(r)).isZero())fe=n?3:2;else{if((e=e.minus(i.times(r))).lte(s))return fe=Ge(i)?n?2:3:n?4:1,e;fe=Ge(i)?n?1:4:n?3:2}return e.minus(r).abs()}function oi(t,e,i,n){var r,s,o,a,l,c,u,h,d,p=t.constructor,f=void 0!==i;if(f?(Le(i,1,me),void 0===n?n=p.rounding:Le(n,0,8)):(i=p.precision,n=p.rounding),t.isFinite()){for(f?(r=2,16==e?i=4*i-3:8==e&&(i=3*i-2)):r=e,(o=(u=qe(t)).indexOf("."))>=0&&(u=u.replace(".",""),(d=new p(1)).e=u.length-o,d.d=Ve(qe(d),10,r),d.e=d.d.length),s=l=(h=Ve(u,10,r)).length;0==h[--l];)h.pop();if(h[0]){if(o<0?s--:((t=new p(t)).d=h,t.e=s,h=(t=He(t,d,i,n,0,r)).d,s=t.e,c=pe),o=h[i],a=r/2,c=c||void 0!==h[i+1],c=n<4?(void 0!==o||c)&&(0===n||n===(t.s<0?3:2)):o>a||o===a&&(4===n||c||6===n&&1&h[i-1]||n===(t.s<0?8:7)),h.length=i,c)for(;++h[--i]>r-1;)h[i]=0,i||(++s,h.unshift(1));for(l=h.length;!h[l-1];--l);for(o=0,u="";o<l;o++)u+=_e.charAt(h[o]);if(f){if(l>1)if(16==e||8==e){for(o=16==e?4:3,--l;l%o;l++)u+="0";for(l=(h=Ve(u,r,e)).length;!h[l-1];--l);for(o=1,u="1.";o<l;o++)u+=_e.charAt(h[o])}else u=u.charAt(0)+"."+u.slice(1);u=u+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)u="0"+u;u="0."+u}else if(++s>l)for(s-=l;s--;)u+="0";else s<l&&(u=u.slice(0,s)+"."+u.slice(s))}else u=f?"0p+0":"0";u=(16==e?"0x":2==e?"0b":8==e?"0o":"")+u}else u=ti(t);return t.s<0?"-"+u:u}function ai(t,e){if(t.length>e)return t.length=e,!0}function li(t){return new this(t).abs()}function ci(t){return new this(t).acos()}function ui(t){return new this(t).acosh()}function hi(t,e){return new this(t).plus(e)}function di(t){return new this(t).asin()}function pi(t){return new this(t).asinh()}function fi(t){return new this(t).atan()}function gi(t){return new this(t).atanh()}function mi(t,e){t=new this(t),e=new this(e);var i,n=this.precision,r=this.rounding,s=n+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(i=e.s<0?Ye(this,n,r):new this(0)).s=t.s:!t.d||e.isZero()?(i=Ye(this,s,1).times(.5)).s=t.s:e.s<0?(this.precision=s,this.rounding=1,i=this.atan(He(t,e,s,1)),e=Ye(this,s,1),this.precision=n,this.rounding=r,i=t.s<0?i.minus(e):i.plus(e)):i=this.atan(He(t,e,s,1)):(i=Ye(this,s,1).times(e.s>0?.25:.75)).s=t.s:i=new this(NaN),i}function _i(t){return new this(t).cbrt()}function yi(t){return Fe(t=new this(t),t.e+1,2)}function vi(t,e,i){return new this(t).clamp(e,i)}function bi(t){if(!t||"object"!=typeof t)throw Error(Ae+"Object expected");var e,i,n,r=!0===t.defaults,s=["precision",1,me,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,ge,"maxE",0,ge,"minE",-9e15,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(i=s[e],r&&(this[i]=be[i]),void 0!==(n=t[i])){if(!(Ee(n)===n&&n>=s[e+1]&&n<=s[e+2]))throw Error($e+i+": "+n);this[i]=n}if(i="crypto",r&&(this[i]=be[i]),void 0!==(n=t[i])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error($e+i+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(xe);this[i]=!0}else this[i]=!1}return this}function wi(t){return new this(t).cos()}function Ai(t){return new this(t).cosh()}function $i(t,e){return new this(t).div(e)}function Si(t){return new this(t).exp()}function xi(t){return Fe(t=new this(t),t.e+1,3)}function Ni(){var t,e,i=new this(0);for(we=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)i.d&&(i=i.plus(e.times(e)));else{if(e.s)return we=!0,new this(1/0);i=e}return we=!0,i.sqrt()}function Ei(t){return t instanceof Wi||t&&t.toStringTag===Ne||!1}function Oi(t){return new this(t).ln()}function Ci(t,e){return new this(t).log(e)}function Pi(t){return new this(t).log(2)}function Mi(t){return new this(t).log(10)}function Di(){return Ke(this,arguments,"lt")}function Ti(){return Ke(this,arguments,"gt")}function ki(t,e){return new this(t).mod(e)}function Ri(t,e){return new this(t).mul(e)}function Ui(t,e){return new this(t).pow(e)}function Ii(t){var e,i,n,r,s=0,o=new this(1),a=[];if(void 0===t?t=this.precision:Le(t,1,me),n=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));s<n;)(r=e[s])>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=r%1e7;else{if(!crypto.randomBytes)throw Error(xe);for(e=crypto.randomBytes(n*=4);s<n;)(r=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((127&e[s+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,s):(a.push(r%1e7),s+=4);s=n/4}else for(;s<n;)a[s++]=1e7*Math.random()|0;for(t%=7,(n=a[--s])&&t&&(r=Oe(10,7-t),a[s]=(n/r|0)*r);0===a[s];s--)a.pop();if(s<0)i=0,a=[0];else{for(i=-1;0===a[0];i-=7)a.shift();for(n=1,r=a[0];r>=10;r/=10)n++;n<7&&(i-=7-n)}return o.e=i,o.d=a,o}function Li(t){return Fe(t=new this(t),t.e+1,this.rounding)}function ji(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Vi(t){return new this(t).sin()}function Hi(t){return new this(t).sinh()}function Fi(t){return new this(t).sqrt()}function qi(t,e){return new this(t).sub(e)}function Bi(){var t=0,e=arguments,i=new this(e[t]);for(we=!1;i.s&&++t<e.length;)i=i.plus(e[t]);return we=!0,Fe(i,this.precision,this.rounding)}function zi(t){return new this(t).tan()}function Yi(t){return new this(t).tanh()}function Zi(t){return Fe(t=new this(t),t.e+1,1)}Ue[Symbol.for("nodejs.util.inspect.custom")]=Ue.toString,Ue[Symbol.toStringTag]="Decimal";var Wi=Ue.constructor=function t(e){var i,n,r;function s(t){var e,i,n,r=this;if(!(r instanceof s))return new s(t);if(r.constructor=s,Ei(t))return r.s=t.s,void(we?!t.d||t.e>s.maxE?(r.e=NaN,r.d=null):t.e<s.minE?(r.e=0,r.d=[0]):(r.e=t.e,r.d=t.d.slice()):(r.e=t.e,r.d=t.d?t.d.slice():t.d));if("number"===(n=typeof t)){if(0===t)return r.s=1/t<0?-1:1,r.e=0,void(r.d=[0]);if(t<0?(t=-t,r.s=-1):r.s=1,t===~~t&&t<1e7){for(e=0,i=t;i>=10;i/=10)e++;return void(we?e>s.maxE?(r.e=NaN,r.d=null):e<s.minE?(r.e=0,r.d=[0]):(r.e=e,r.d=[t]):(r.e=e,r.d=[t]))}return 0*t!=0?(t||(r.s=NaN),r.e=NaN,void(r.d=null)):ei(r,t.toString())}if("string"!==n)throw Error($e+t);return 45===(i=t.charCodeAt(0))?(t=t.slice(1),r.s=-1):(43===i&&(t=t.slice(1)),r.s=1),De.test(t)?ei(r,t):ii(r,t)}if(s.prototype=Ue,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=bi,s.clone=t,s.isDecimal=Ei,s.abs=li,s.acos=ci,s.acosh=ui,s.add=hi,s.asin=di,s.asinh=pi,s.atan=fi,s.atanh=gi,s.atan2=mi,s.cbrt=_i,s.ceil=yi,s.clamp=vi,s.cos=wi,s.cosh=Ai,s.div=$i,s.exp=Si,s.floor=xi,s.hypot=Ni,s.ln=Oi,s.log=Ci,s.log10=Mi,s.log2=Pi,s.max=Di,s.min=Ti,s.mod=ki,s.mul=Ri,s.pow=Ui,s.random=Ii,s.round=Li,s.sign=ji,s.sin=Vi,s.sinh=Hi,s.sqrt=Fi,s.sub=qi,s.sum=Bi,s.tan=zi,s.tanh=Yi,s.trunc=Zi,void 0===e&&(e={}),e&&!0!==e.defaults)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<r.length;)e.hasOwnProperty(n=r[i++])||(e[n]=this[n]);return s.config(e),s}(be);ye=new Wi(ye),ve=new Wi(ve);const Qi=/^-?\d+(\.\d+)?$/,Gi=()=>({stringToChars:t=>Array.from(t)});function Ki(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ji,Xi={exports:{}};var tn,en=(Ji||(Ji=1,(tn=Xi).exports&&(tn.exports=function(){var t=3,e=4,i=12,n=13,r=16,s=17;function o(t,e){void 0===e&&(e=0);var i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e<t.length-1){var n=i;return 56320<=(r=t.charCodeAt(e+1))&&r<=57343?1024*(n-55296)+(r-56320)+65536:n}if(56320<=i&&i<=57343&&e>=1){var r=i;return 55296<=(n=t.charCodeAt(e-1))&&n<=56319?1024*(n-55296)+(r-56320)+65536:r}return i}function a(o,a,l){var c=[o].concat(a).concat([l]),u=c[c.length-2],h=l,d=c.lastIndexOf(14);if(d>1&&c.slice(1,d).every((function(e){return e==t}))&&-1==[t,n,s].indexOf(o))return 2;var p=c.lastIndexOf(e);if(p>0&&c.slice(1,p).every((function(t){return t==e}))&&-1==[i,e].indexOf(u))return c.filter((function(t){return t==e})).length%2==1?3:4;if(0==u&&1==h)return 0;if(2==u||0==u||1==u)return 14==h&&a.every((function(e){return e==t}))?2:1;if(2==h||0==h||1==h)return 1;if(6==u&&(6==h||7==h||9==h||10==h))return 0;if(!(9!=u&&7!=u||7!=h&&8!=h))return 0;if((10==u||8==u)&&8==h)return 0;if(h==t||15==h)return 0;if(5==h)return 0;if(u==i)return 0;var f=-1!=c.indexOf(t)?c.lastIndexOf(t)-1:c.length-2;return-1!=[n,s].indexOf(c[f])&&c.slice(f+1,-1).every((function(e){return e==t}))&&14==h||15==u&&-1!=[r,s].indexOf(h)?0:-1!=a.indexOf(e)?2:u==e&&h==e?0:1}function l(o){return 1536<=o&&o<=1541||1757==o||1807==o||2274==o||3406==o||69821==o||70082<=o&&o<=70083||72250==o||72326<=o&&o<=72329||73030==o?i:13==o?0:10==o?1:0<=o&&o<=9||11<=o&&o<=12||14<=o&&o<=31||127<=o&&o<=159||173==o||1564==o||6158==o||8203==o||8206<=o&&o<=8207||8232==o||8233==o||8234<=o&&o<=8238||8288<=o&&o<=8292||8293==o||8294<=o&&o<=8303||55296<=o&&o<=57343||65279==o||65520<=o&&o<=65528||65529<=o&&o<=65531||113824<=o&&o<=113827||119155<=o&&o<=119162||917504==o||917505==o||917506<=o&&o<=917535||917632<=o&&o<=917759||918e3<=o&&o<=921599?2:768<=o&&o<=879||1155<=o&&o<=1159||1160<=o&&o<=1161||1425<=o&&o<=1469||1471==o||1473<=o&&o<=1474||1476<=o&&o<=1477||1479==o||1552<=o&&o<=1562||1611<=o&&o<=1631||1648==o||1750<=o&&o<=1756||1759<=o&&o<=1764||1767<=o&&o<=1768||1770<=o&&o<=1773||1809==o||1840<=o&&o<=1866||1958<=o&&o<=1968||2027<=o&&o<=2035||2070<=o&&o<=2073||2075<=o&&o<=2083||2085<=o&&o<=2087||2089<=o&&o<=2093||2137<=o&&o<=2139||2260<=o&&o<=2273||2275<=o&&o<=2306||2362==o||2364==o||2369<=o&&o<=2376||2381==o||2385<=o&&o<=2391||2402<=o&&o<=2403||2433==o||2492==o||2494==o||2497<=o&&o<=2500||2509==o||2519==o||2530<=o&&o<=2531||2561<=o&&o<=2562||2620==o||2625<=o&&o<=2626||2631<=o&&o<=2632||2635<=o&&o<=2637||2641==o||2672<=o&&o<=2673||2677==o||2689<=o&&o<=2690||2748==o||2753<=o&&o<=2757||2759<=o&&o<=2760||2765==o||2786<=o&&o<=2787||2810<=o&&o<=2815||2817==o||2876==o||2878==o||2879==o||2881<=o&&o<=2884||2893==o||2902==o||2903==o||2914<=o&&o<=2915||2946==o||3006==o||3008==o||3021==o||3031==o||3072==o||3134<=o&&o<=3136||3142<=o&&o<=3144||3146<=o&&o<=3149||3157<=o&&o<=3158||3170<=o&&o<=3171||3201==o||3260==o||3263==o||3266==o||3270==o||3276<=o&&o<=3277||3285<=o&&o<=3286||3298<=o&&o<=3299||3328<=o&&o<=3329||3387<=o&&o<=3388||3390==o||3393<=o&&o<=3396||3405==o||3415==o||3426<=o&&o<=3427||3530==o||3535==o||3538<=o&&o<=3540||3542==o||3551==o||3633==o||3636<=o&&o<=3642||3655<=o&&o<=3662||3761==o||3764<=o&&o<=3769||3771<=o&&o<=3772||3784<=o&&o<=3789||3864<=o&&o<=3865||3893==o||3895==o||3897==o||3953<=o&&o<=3966||3968<=o&&o<=3972||3974<=o&&o<=3975||3981<=o&&o<=3991||3993<=o&&o<=4028||4038==o||4141<=o&&o<=4144||4146<=o&&o<=4151||4153<=o&&o<=4154||4157<=o&&o<=4158||4184<=o&&o<=4185||4190<=o&&o<=4192||4209<=o&&o<=4212||4226==o||4229<=o&&o<=4230||4237==o||4253==o||4957<=o&&o<=4959||5906<=o&&o<=5908||5938<=o&&o<=5940||5970<=o&&o<=5971||6002<=o&&o<=6003||6068<=o&&o<=6069||6071<=o&&o<=6077||6086==o||6089<=o&&o<=6099||6109==o||6155<=o&&o<=6157||6277<=o&&o<=6278||6313==o||6432<=o&&o<=6434||6439<=o&&o<=6440||6450==o||6457<=o&&o<=6459||6679<=o&&o<=6680||6683==o||6742==o||6744<=o&&o<=6750||6752==o||6754==o||6757<=o&&o<=6764||6771<=o&&o<=6780||6783==o||6832<=o&&o<=6845||6846==o||6912<=o&&o<=6915||6964==o||6966<=o&&o<=6970||6972==o||6978==o||7019<=o&&o<=7027||7040<=o&&o<=7041||7074<=o&&o<=7077||7080<=o&&o<=7081||7083<=o&&o<=7085||7142==o||7144<=o&&o<=7145||7149==o||7151<=o&&o<=7153||7212<=o&&o<=7219||7222<=o&&o<=7223||7376<=o&&o<=7378||7380<=o&&o<=7392||7394<=o&&o<=7400||7405==o||7412==o||7416<=o&&o<=7417||7616<=o&&o<=7673||7675<=o&&o<=7679||8204==o||8400<=o&&o<=8412||8413<=o&&o<=8416||8417==o||8418<=o&&o<=8420||8421<=o&&o<=8432||11503<=o&&o<=11505||11647==o||11744<=o&&o<=11775||12330<=o&&o<=12333||12334<=o&&o<=12335||12441<=o&&o<=12442||42607==o||42608<=o&&o<=42610||42612<=o&&o<=42621||42654<=o&&o<=42655||42736<=o&&o<=42737||43010==o||43014==o||43019==o||43045<=o&&o<=43046||43204<=o&&o<=43205||43232<=o&&o<=43249||43302<=o&&o<=43309||43335<=o&&o<=43345||43392<=o&&o<=43394||43443==o||43446<=o&&o<=43449||43452==o||43493==o||43561<=o&&o<=43566||43569<=o&&o<=43570||43573<=o&&o<=43574||43587==o||43596==o||43644==o||43696==o||43698<=o&&o<=43700||43703<=o&&o<=43704||43710<=o&&o<=43711||43713==o||43756<=o&&o<=43757||43766==o||44005==o||44008==o||44013==o||64286==o||65024<=o&&o<=65039||65056<=o&&o<=65071||65438<=o&&o<=65439||66045==o||66272==o||66422<=o&&o<=66426||68097<=o&&o<=68099||68101<=o&&o<=68102||68108<=o&&o<=68111||68152<=o&&o<=68154||68159==o||68325<=o&&o<=68326||69633==o||69688<=o&&o<=69702||69759<=o&&o<=69761||69811<=o&&o<=69814||69817<=o&&o<=69818||69888<=o&&o<=69890||69927<=o&&o<=69931||69933<=o&&o<=69940||70003==o||70016<=o&&o<=70017||70070<=o&&o<=70078||70090<=o&&o<=70092||70191<=o&&o<=70193||70196==o||70198<=o&&o<=70199||70206==o||70367==o||70371<=o&&o<=70378||70400<=o&&o<=70401||70460==o||70462==o||70464==o||70487==o||70502<=o&&o<=70508||70512<=o&&o<=70516||70712<=o&&o<=70719||70722<=o&&o<=70724||70726==o||70832==o||70835<=o&&o<=70840||70842==o||70845==o||70847<=o&&o<=70848||70850<=o&&o<=70851||71087==o||71090<=o&&o<=71093||71100<=o&&o<=71101||71103<=o&&o<=71104||71132<=o&&o<=71133||71219<=o&&o<=71226||71229==o||71231<=o&&o<=71232||71339==o||71341==o||71344<=o&&o<=71349||71351==o||71453<=o&&o<=71455||71458<=o&&o<=71461||71463<=o&&o<=71467||72193<=o&&o<=72198||72201<=o&&o<=72202||72243<=o&&o<=72248||72251<=o&&o<=72254||72263==o||72273<=o&&o<=72278||72281<=o&&o<=72283||72330<=o&&o<=72342||72344<=o&&o<=72345||72752<=o&&o<=72758||72760<=o&&o<=72765||72767==o||72850<=o&&o<=72871||72874<=o&&o<=72880||72882<=o&&o<=72883||72885<=o&&o<=72886||73009<=o&&o<=73014||73018==o||73020<=o&&o<=73021||73023<=o&&o<=73029||73031==o||92912<=o&&o<=92916||92976<=o&&o<=92982||94095<=o&&o<=94098||113821<=o&&o<=113822||119141==o||119143<=o&&o<=119145||119150<=o&&o<=119154||119163<=o&&o<=119170||119173<=o&&o<=119179||119210<=o&&o<=119213||119362<=o&&o<=119364||121344<=o&&o<=121398||121403<=o&&o<=121452||121461==o||121476==o||121499<=o&&o<=121503||121505<=o&&o<=121519||122880<=o&&o<=122886||122888<=o&&o<=122904||122907<=o&&o<=122913||122915<=o&&o<=122916||122918<=o&&o<=122922||125136<=o&&o<=125142||125252<=o&&o<=125258||917536<=o&&o<=917631||917760<=o&&o<=917999?t:127462<=o&&o<=127487?e:2307==o||2363==o||2366<=o&&o<=2368||2377<=o&&o<=2380||2382<=o&&o<=2383||2434<=o&&o<=2435||2495<=o&&o<=2496||2503<=o&&o<=2504||2507<=o&&o<=2508||2563==o||2622<=o&&o<=2624||2691==o||2750<=o&&o<=2752||2761==o||2763<=o&&o<=2764||2818<=o&&o<=2819||2880==o||2887<=o&&o<=2888||2891<=o&&o<=2892||3007==o||3009<=o&&o<=3010||3014<=o&&o<=3016||3018<=o&&o<=3020||3073<=o&&o<=3075||3137<=o&&o<=3140||3202<=o&&o<=3203||3262==o||3264<=o&&o<=3265||3267<=o&&o<=3268||3271<=o&&o<=3272||3274<=o&&o<=3275||3330<=o&&o<=3331||3391<=o&&o<=3392||3398<=o&&o<=3400||3402<=o&&o<=3404||3458<=o&&o<=3459||3536<=o&&o<=3537||3544<=o&&o<=3550||3570<=o&&o<=3571||3635==o||3763==o||3902<=o&&o<=3903||3967==o||4145==o||4155<=o&&o<=4156||4182<=o&&o<=4183||4228==o||6070==o||6078<=o&&o<=6085||6087<=o&&o<=6088||6435<=o&&o<=6438||6441<=o&&o<=6443||6448<=o&&o<=6449||6451<=o&&o<=6456||6681<=o&&o<=6682||6741==o||6743==o||6765<=o&&o<=6770||6916==o||6965==o||6971==o||6973<=o&&o<=6977||6979<=o&&o<=6980||7042==o||7073==o||7078<=o&&o<=7079||7082==o||7143==o||7146<=o&&o<=7148||7150==o||7154<=o&&o<=7155||7204<=o&&o<=7211||7220<=o&&o<=7221||7393==o||7410<=o&&o<=7411||7415==o||43043<=o&&o<=43044||43047==o||43136<=o&&o<=43137||43188<=o&&o<=43203||43346<=o&&o<=43347||43395==o||43444<=o&&o<=43445||43450<=o&&o<=43451||43453<=o&&o<=43456||43567<=o&&o<=43568||43571<=o&&o<=43572||43597==o||43755==o||43758<=o&&o<=43759||43765==o||44003<=o&&o<=44004||44006<=o&&o<=44007||44009<=o&&o<=44010||44012==o||69632==o||69634==o||69762==o||69808<=o&&o<=69810||69815<=o&&o<=69816||69932==o||70018==o||70067<=o&&o<=70069||70079<=o&&o<=70080||70188<=o&&o<=70190||70194<=o&&o<=70195||70197==o||70368<=o&&o<=70370||70402<=o&&o<=70403||70463==o||70465<=o&&o<=70468||70471<=o&&o<=70472||70475<=o&&o<=70477||70498<=o&&o<=70499||70709<=o&&o<=70711||70720<=o&&o<=70721||70725==o||70833<=o&&o<=70834||70841==o||70843<=o&&o<=70844||70846==o||70849==o||71088<=o&&o<=71089||71096<=o&&o<=71099||71102==o||71216<=o&&o<=71218||71227<=o&&o<=71228||71230==o||71340==o||71342<=o&&o<=71343||71350==o||71456<=o&&o<=71457||71462==o||72199<=o&&o<=72200||72249==o||72279<=o&&o<=72280||72343==o||72751==o||72766==o||72873==o||72881==o||72884==o||94033<=o&&o<=94078||119142==o||119149==o?5:4352<=o&&o<=4447||43360<=o&&o<=43388?6:4448<=o&&o<=4519||55216<=o&&o<=55238?7:4520<=o&&o<=4607||55243<=o&&o<=55291?8:44032==o||44060==o||44088==o||44116==o||44144==o||44172==o||44200==o||44228==o||44256==o||44284==o||44312==o||44340==o||44368==o||44396==o||44424==o||44452==o||44480==o||44508==o||44536==o||44564==o||44592==o||44620==o||44648==o||44676==o||44704==o||44732==o||44760==o||44788==o||44816==o||44844==o||44872==o||44900==o||44928==o||44956==o||44984==o||45012==o||45040==o||45068==o||45096==o||45124==o||45152==o||45180==o||45208==o||45236==o||45264==o||45292==o||45320==o||45348==o||45376==o||45404==o||45432==o||45460==o||45488==o||45516==o||45544==o||45572==o||45600==o||45628==o||45656==o||45684==o||45712==o||45740==o||45768==o||45796==o||45824==o||45852==o||45880==o||45908==o||45936==o||45964==o||45992==o||46020==o||46048==o||46076==o||46104==o||46132==o||46160==o||46188==o||46216==o||46244==o||46272==o||46300==o||46328==o||46356==o||46384==o||46412==o||46440==o||46468==o||46496==o||46524==o||46552==o||46580==o||46608==o||46636==o||46664==o||46692==o||46720==o||46748==o||46776==o||46804==o||46832==o||46860==o||46888==o||46916==o||46944==o||46972==o||47e3==o||47028==o||47056==o||47084==o||47112==o||47140==o||47168==o||47196==o||47224==o||47252==o||47280==o||47308==o||47336==o||47364==o||47392==o||47420==o||47448==o||47476==o||47504==o||47532==o||47560==o||47588==o||47616==o||47644==o||47672==o||47700==o||47728==o||47756==o||47784==o||47812==o||47840==o||47868==o||47896==o||47924==o||47952==o||47980==o||48008==o||48036==o||48064==o||48092==o||48120==o||48148==o||48176==o||48204==o||48232==o||48260==o||48288==o||48316==o||48344==o||48372==o||48400==o||48428==o||48456==o||48484==o||48512==o||48540==o||48568==o||48596==o||48624==o||48652==o||48680==o||48708==o||48736==o||48764==o||48792==o||48820==o||48848==o||48876==o||48904==o||48932==o||48960==o||48988==o||49016==o||49044==o||49072==o||49100==o||49128==o||49156==o||49184==o||49212==o||49240==o||49268==o||49296==o||49324==o||49352==o||49380==o||49408==o||49436==o||49464==o||49492==o||49520==o||49548==o||49576==o||49604==o||49632==o||49660==o||49688==o||49716==o||49744==o||49772==o||49800==o||49828==o||49856==o||49884==o||49912==o||49940==o||49968==o||49996==o||50024==o||50052==o||50080==o||50108==o||50136==o||50164==o||50192==o||50220==o||50248==o||50276==o||50304==o||50332==o||50360==o||50388==o||50416==o||50444==o||50472==o||50500==o||50528==o||50556==o||50584==o||50612==o||50640==o||50668==o||50696==o||50724==o||50752==o||50780==o||50808==o||50836==o||50864==o||50892==o||50920==o||50948==o||50976==o||51004==o||51032==o||51060==o||51088==o||51116==o||51144==o||51172==o||51200==o||51228==o||51256==o||51284==o||51312==o||51340==o||51368==o||51396==o||51424==o||51452==o||51480==o||51508==o||51536==o||51564==o||51592==o||51620==o||51648==o||51676==o||51704==o||51732==o||51760==o||51788==o||51816==o||51844==o||51872==o||51900==o||51928==o||51956==o||51984==o||52012==o||52040==o||52068==o||52096==o||52124==o||52152==o||52180==o||52208==o||52236==o||52264==o||52292==o||52320==o||52348==o||52376==o||52404==o||52432==o||52460==o||52488==o||52516==o||52544==o||52572==o||52600==o||52628==o||52656==o||52684==o||52712==o||52740==o||52768==o||52796==o||52824==o||52852==o||52880==o||52908==o||52936==o||52964==o||52992==o||53020==o||53048==o||53076==o||53104==o||53132==o||53160==o||53188==o||53216==o||53244==o||53272==o||53300==o||53328==o||53356==o||53384==o||53412==o||53440==o||53468==o||53496==o||53524==o||53552==o||53580==o||53608==o||53636==o||53664==o||53692==o||53720==o||53748==o||53776==o||53804==o||53832==o||53860==o||53888==o||53916==o||53944==o||53972==o||54e3==o||54028==o||54056==o||54084==o||54112==o||54140==o||54168==o||54196==o||54224==o||54252==o||54280==o||54308==o||54336==o||54364==o||54392==o||54420==o||54448==o||54476==o||54504==o||54532==o||54560==o||54588==o||54616==o||54644==o||54672==o||54700==o||54728==o||54756==o||54784==o||54812==o||54840==o||54868==o||54896==o||54924==o||54952==o||54980==o||55008==o||55036==o||55064==o||55092==o||55120==o||55148==o||55176==o?9:44033<=o&&o<=44059||44061<=o&&o<=44087||44089<=o&&o<=44115||44117<=o&&o<=44143||44145<=o&&o<=44171||44173<=o&&o<=44199||44201<=o&&o<=44227||44229<=o&&o<=44255||44257<=o&&o<=44283||44285<=o&&o<=44311||44313<=o&&o<=44339||44341<=o&&o<=44367||44369<=o&&o<=44395||44397<=o&&o<=44423||44425<=o&&o<=44451||44453<=o&&o<=44479||44481<=o&&o<=44507||44509<=o&&o<=44535||44537<=o&&o<=44563||44565<=o&&o<=44591||44593<=o&&o<=44619||44621<=o&&o<=44647||44649<=o&&o<=44675||44677<=o&&o<=44703||44705<=o&&o<=44731||44733<=o&&o<=44759||44761<=o&&o<=44787||44789<=o&&o<=44815||44817<=o&&o<=44843||44845<=o&&o<=44871||44873<=o&&o<=44899||44901<=o&&o<=44927||44929<=o&&o<=44955||44957<=o&&o<=44983||44985<=o&&o<=45011||45013<=o&&o<=45039||45041<=o&&o<=45067||45069<=o&&o<=45095||45097<=o&&o<=45123||45125<=o&&o<=45151||45153<=o&&o<=45179||45181<=o&&o<=45207||45209<=o&&o<=45235||45237<=o&&o<=45263||45265<=o&&o<=45291||45293<=o&&o<=45319||45321<=o&&o<=45347||45349<=o&&o<=45375||45377<=o&&o<=45403||45405<=o&&o<=45431||45433<=o&&o<=45459||45461<=o&&o<=45487||45489<=o&&o<=45515||45517<=o&&o<=45543||45545<=o&&o<=45571||45573<=o&&o<=45599||45601<=o&&o<=45627||45629<=o&&o<=45655||45657<=o&&o<=45683||45685<=o&&o<=45711||45713<=o&&o<=45739||45741<=o&&o<=45767||45769<=o&&o<=45795||45797<=o&&o<=45823||45825<=o&&o<=45851||45853<=o&&o<=45879||45881<=o&&o<=45907||45909<=o&&o<=45935||45937<=o&&o<=45963||45965<=o&&o<=45991||45993<=o&&o<=46019||46021<=o&&o<=46047||46049<=o&&o<=46075||46077<=o&&o<=46103||46105<=o&&o<=46131||46133<=o&&o<=46159||46161<=o&&o<=46187||46189<=o&&o<=46215||46217<=o&&o<=46243||46245<=o&&o<=46271||46273<=o&&o<=46299||46301<=o&&o<=46327||46329<=o&&o<=46355||46357<=o&&o<=46383||46385<=o&&o<=46411||46413<=o&&o<=46439||46441<=o&&o<=46467||46469<=o&&o<=46495||46497<=o&&o<=46523||46525<=o&&o<=46551||46553<=o&&o<=46579||46581<=o&&o<=46607||46609<=o&&o<=46635||46637<=o&&o<=46663||46665<=o&&o<=46691||46693<=o&&o<=46719||46721<=o&&o<=46747||46749<=o&&o<=46775||46777<=o&&o<=46803||46805<=o&&o<=46831||46833<=o&&o<=46859||46861<=o&&o<=46887||46889<=o&&o<=46915||46917<=o&&o<=46943||46945<=o&&o<=46971||46973<=o&&o<=46999||47001<=o&&o<=47027||47029<=o&&o<=47055||47057<=o&&o<=47083||47085<=o&&o<=47111||47113<=o&&o<=47139||47141<=o&&o<=47167||47169<=o&&o<=47195||47197<=o&&o<=47223||47225<=o&&o<=47251||47253<=o&&o<=47279||47281<=o&&o<=47307||47309<=o&&o<=47335||47337<=o&&o<=47363||47365<=o&&o<=47391||47393<=o&&o<=47419||47421<=o&&o<=47447||47449<=o&&o<=47475||47477<=o&&o<=47503||47505<=o&&o<=47531||47533<=o&&o<=47559||47561<=o&&o<=47587||47589<=o&&o<=47615||47617<=o&&o<=47643||47645<=o&&o<=47671||47673<=o&&o<=47699||47701<=o&&o<=47727||47729<=o&&o<=47755||47757<=o&&o<=47783||47785<=o&&o<=47811||47813<=o&&o<=47839||47841<=o&&o<=47867||47869<=o&&o<=47895||47897<=o&&o<=47923||47925<=o&&o<=47951||47953<=o&&o<=47979||47981<=o&&o<=48007||48009<=o&&o<=48035||48037<=o&&o<=48063||48065<=o&&o<=48091||48093<=o&&o<=48119||48121<=o&&o<=48147||48149<=o&&o<=48175||48177<=o&&o<=48203||48205<=o&&o<=48231||48233<=o&&o<=48259||48261<=o&&o<=48287||48289<=o&&o<=48315||48317<=o&&o<=48343||48345<=o&&o<=48371||48373<=o&&o<=48399||48401<=o&&o<=48427||48429<=o&&o<=48455||48457<=o&&o<=48483||48485<=o&&o<=48511||48513<=o&&o<=48539||48541<=o&&o<=48567||48569<=o&&o<=48595||48597<=o&&o<=48623||48625<=o&&o<=48651||48653<=o&&o<=48679||48681<=o&&o<=48707||48709<=o&&o<=48735||48737<=o&&o<=48763||48765<=o&&o<=48791||48793<=o&&o<=48819||48821<=o&&o<=48847||48849<=o&&o<=48875||48877<=o&&o<=48903||48905<=o&&o<=48931||48933<=o&&o<=48959||48961<=o&&o<=48987||48989<=o&&o<=49015||49017<=o&&o<=49043||49045<=o&&o<=49071||49073<=o&&o<=49099||49101<=o&&o<=49127||49129<=o&&o<=49155||49157<=o&&o<=49183||49185<=o&&o<=49211||49213<=o&&o<=49239||49241<=o&&o<=49267||49269<=o&&o<=49295||49297<=o&&o<=49323||49325<=o&&o<=49351||49353<=o&&o<=49379||49381<=o&&o<=49407||49409<=o&&o<=49435||49437<=o&&o<=49463||49465<=o&&o<=49491||49493<=o&&o<=49519||49521<=o&&o<=49547||49549<=o&&o<=49575||49577<=o&&o<=49603||49605<=o&&o<=49631||49633<=o&&o<=49659||49661<=o&&o<=49687||49689<=o&&o<=49715||49717<=o&&o<=49743||49745<=o&&o<=49771||49773<=o&&o<=49799||49801<=o&&o<=49827||49829<=o&&o<=49855||49857<=o&&o<=49883||49885<=o&&o<=49911||49913<=o&&o<=49939||49941<=o&&o<=49967||49969<=o&&o<=49995||49997<=o&&o<=50023||50025<=o&&o<=50051||50053<=o&&o<=50079||50081<=o&&o<=50107||50109<=o&&o<=50135||50137<=o&&o<=50163||50165<=o&&o<=50191||50193<=o&&o<=50219||50221<=o&&o<=50247||50249<=o&&o<=50275||50277<=o&&o<=50303||50305<=o&&o<=50331||50333<=o&&o<=50359||50361<=o&&o<=50387||50389<=o&&o<=50415||50417<=o&&o<=50443||50445<=o&&o<=50471||50473<=o&&o<=50499||50501<=o&&o<=50527||50529<=o&&o<=50555||50557<=o&&o<=50583||50585<=o&&o<=50611||50613<=o&&o<=50639||50641<=o&&o<=50667||50669<=o&&o<=50695||50697<=o&&o<=50723||50725<=o&&o<=50751||50753<=o&&o<=50779||50781<=o&&o<=50807||50809<=o&&o<=50835||50837<=o&&o<=50863||50865<=o&&o<=50891||50893<=o&&o<=50919||50921<=o&&o<=50947||50949<=o&&o<=50975||50977<=o&&o<=51003||51005<=o&&o<=51031||51033<=o&&o<=51059||51061<=o&&o<=51087||51089<=o&&o<=51115||51117<=o&&o<=51143||51145<=o&&o<=51171||51173<=o&&o<=51199||51201<=o&&o<=51227||51229<=o&&o<=51255||51257<=o&&o<=51283||51285<=o&&o<=51311||51313<=o&&o<=51339||51341<=o&&o<=51367||51369<=o&&o<=51395||51397<=o&&o<=51423||51425<=o&&o<=51451||51453<=o&&o<=51479||51481<=o&&o<=51507||51509<=o&&o<=51535||51537<=o&&o<=51563||51565<=o&&o<=51591||51593<=o&&o<=51619||51621<=o&&o<=51647||51649<=o&&o<=51675||51677<=o&&o<=51703||51705<=o&&o<=51731||51733<=o&&o<=51759||51761<=o&&o<=51787||51789<=o&&o<=51815||51817<=o&&o<=51843||51845<=o&&o<=51871||51873<=o&&o<=51899||51901<=o&&o<=51927||51929<=o&&o<=51955||51957<=o&&o<=51983||51985<=o&&o<=52011||52013<=o&&o<=52039||52041<=o&&o<=52067||52069<=o&&o<=52095||52097<=o&&o<=52123||52125<=o&&o<=52151||52153<=o&&o<=52179||52181<=o&&o<=52207||52209<=o&&o<=52235||52237<=o&&o<=52263||52265<=o&&o<=52291||52293<=o&&o<=52319||52321<=o&&o<=52347||52349<=o&&o<=52375||52377<=o&&o<=52403||52405<=o&&o<=52431||52433<=o&&o<=52459||52461<=o&&o<=52487||52489<=o&&o<=52515||52517<=o&&o<=52543||52545<=o&&o<=52571||52573<=o&&o<=52599||52601<=o&&o<=52627||52629<=o&&o<=52655||52657<=o&&o<=52683||52685<=o&&o<=52711||52713<=o&&o<=52739||52741<=o&&o<=52767||52769<=o&&o<=52795||52797<=o&&o<=52823||52825<=o&&o<=52851||52853<=o&&o<=52879||52881<=o&&o<=52907||52909<=o&&o<=52935||52937<=o&&o<=52963||52965<=o&&o<=52991||52993<=o&&o<=53019||53021<=o&&o<=53047||53049<=o&&o<=53075||53077<=o&&o<=53103||53105<=o&&o<=53131||53133<=o&&o<=53159||53161<=o&&o<=53187||53189<=o&&o<=53215||53217<=o&&o<=53243||53245<=o&&o<=53271||53273<=o&&o<=53299||53301<=o&&o<=53327||53329<=o&&o<=53355||53357<=o&&o<=53383||53385<=o&&o<=53411||53413<=o&&o<=53439||53441<=o&&o<=53467||53469<=o&&o<=53495||53497<=o&&o<=53523||53525<=o&&o<=53551||53553<=o&&o<=53579||53581<=o&&o<=53607||53609<=o&&o<=53635||53637<=o&&o<=53663||53665<=o&&o<=53691||53693<=o&&o<=53719||53721<=o&&o<=53747||53749<=o&&o<=53775||53777<=o&&o<=53803||53805<=o&&o<=53831||53833<=o&&o<=53859||53861<=o&&o<=53887||53889<=o&&o<=53915||53917<=o&&o<=53943||53945<=o&&o<=53971||53973<=o&&o<=53999||54001<=o&&o<=54027||54029<=o&&o<=54055||54057<=o&&o<=54083||54085<=o&&o<=54111||54113<=o&&o<=54139||54141<=o&&o<=54167||54169<=o&&o<=54195||54197<=o&&o<=54223||54225<=o&&o<=54251||54253<=o&&o<=54279||54281<=o&&o<=54307||54309<=o&&o<=54335||54337<=o&&o<=54363||54365<=o&&o<=54391||54393<=o&&o<=54419||54421<=o&&o<=54447||54449<=o&&o<=54475||54477<=o&&o<=54503||54505<=o&&o<=54531||54533<=o&&o<=54559||54561<=o&&o<=54587||54589<=o&&o<=54615||54617<=o&&o<=54643||54645<=o&&o<=54671||54673<=o&&o<=54699||54701<=o&&o<=54727||54729<=o&&o<=54755||54757<=o&&o<=54783||54785<=o&&o<=54811||54813<=o&&o<=54839||54841<=o&&o<=54867||54869<=o&&o<=54895||54897<=o&&o<=54923||54925<=o&&o<=54951||54953<=o&&o<=54979||54981<=o&&o<=55007||55009<=o&&o<=55035||55037<=o&&o<=55063||55065<=o&&o<=55091||55093<=o&&o<=55119||55121<=o&&o<=55147||55149<=o&&o<=55175||55177<=o&&o<=55203?10:9757==o||9977==o||9994<=o&&o<=9997||127877==o||127938<=o&&o<=127940||127943==o||127946<=o&&o<=127948||128066<=o&&o<=128067||128070<=o&&o<=128080||128110==o||128112<=o&&o<=128120||128124==o||128129<=o&&o<=128131||128133<=o&&o<=128135||128170==o||128372<=o&&o<=128373||128378==o||128400==o||128405<=o&&o<=128406||128581<=o&&o<=128583||128587<=o&&o<=128591||128675==o||128692<=o&&o<=128694||128704==o||128716==o||129304<=o&&o<=129308||129310<=o&&o<=129311||129318==o||129328<=o&&o<=129337||129341<=o&&o<=129342||129489<=o&&o<=129501?n:127995<=o&&o<=127999?14:8205==o?15:9792==o||9794==o||9877<=o&&o<=9878||9992==o||10084==o||127752==o||127806==o||127859==o||127891==o||127908==o||127912==o||127979==o||127981==o||128139==o||128187<=o&&o<=128188||128295==o||128300==o||128488==o||128640==o||128658==o?r:128102<=o&&o<=128105?s:11}return this.nextBreak=function(t,e){if(void 0===e&&(e=0),e<0)return 0;if(e>=t.length-1)return t.length;for(var i,n,r=l(o(t,e)),s=[],c=e+1;c<t.length;c++)if(n=c-1,!(55296<=(i=t).charCodeAt(n)&&i.charCodeAt(n)<=56319&&56320<=i.charCodeAt(n+1)&&i.charCodeAt(n+1)<=57343)){var u=l(o(t,c));if(a(r,s,u))return c;s.push(u)}return t.length},this.splitGraphemes=function(t){for(var e,i=[],n=0;(e=this.nextBreak(t,n))<t.length;)i.push(t.slice(n,e)),n=e;return n<t.length&&i.push(t.slice(n)),i},this.iterateGraphemes=function(t){var e=0,i={next:function(){var i,n;return(n=this.nextBreak(t,e))<t.length?(i=t.slice(e,n),e=n,{value:i,done:!1}):e<t.length?(i=t.slice(e),e=t.length,{value:i,done:!1}):{value:void 0,done:!0}}.bind(this)};return"undefined"!=typeof Symbol&&Symbol.iterator&&(i[Symbol.iterator]=function(){return i}),i},this.countGraphemes=function(t){for(var e,i=0,n=0;(e=this.nextBreak(t,n))<t.length;)n=e,i++;return n<t.length&&i++,i},this})),Xi.exports),nn=Ki(en);class rn{static setNumberAdapter(t,e){let i=de();qt(t)?"number"===t?i=de():["decimal.js","decimaljs"].includes(t)&&(i=((t={precision:1e3})=>{const e=Wi.clone(t);return{create:t=>(qt(t)&&!Qi.test(t)&&(t=0),new e(t)),add:(t,e)=>t.plus(e),sub:(t,e)=>t.minus(e),mul:(t,e)=>t.times(e),div:(t,e)=>t.div(e),compare:(t,e)=>t.cmp(e),eq:(t,e)=>t.eq(e),gt:(t,e)=>t.gt(e),gte:(t,e)=>t.gte(e),lt:(t,e)=>t.lt(e),lte:(t,e)=>t.lte(e),isInteger:t=>t.isInteger(),isNegative:t=>t.isNegative(),isPositive:t=>t.isPositive(),isZero:t=>t.isZero(),isNaN:t=>t.isNaN(),isFinite:t=>t.isFinite(),abs:t=>t.abs(),ceil:t=>t.ceil(),floor:t=>t.floor(),round:t=>t.round(),max:(t,i)=>e.max(t,i),min:(t,i)=>e.min(t,i),toNumber:t=>t.toNumber(),toString:t=>t.toFixed()}})(e)):i=t,rn.NUMBER_ADAPTER=i}static setStringAdapter(t){let e=Gi();qt(t)?"string"===t?e=Gi():"intl-segmenter"===t?e=(t=>{const e=new Intl.Segmenter(t,{granularity:"grapheme"});return{stringToChars:t=>Array.from(e.segment(t)).map((t=>t.segment))}})():"grapheme-splitter"===t&&(e=(()=>{const t=new nn;return{stringToChars:e=>t.splitGraphemes(e)}})()):e=t,rn.STRING_ADAPTER=e}}rn.NUMBER_ADAPTER=de(),rn.STRING_ADAPTER=Gi(),rn.VALUE_CONVERTER={fromAttribute:t=>t,toAttribute:t=>zt(t)?t:rn.NUMBER_ADAPTER.toString(t)};const sn=e=>{class i extends e{get value(){return this.numberAdapter.create(this.__value)}set value(t){t=rn.NUMBER_ADAPTER.create(zt(t)||qt(t)&&""===t.trim()?0:t);const e=this.__value;this.__value=t,this.numberAdapter.eq(this.__value,e)||this.requestUpdate("value",e)}get oldValue(){return this.numberAdapter.create(this.__oldValue)}set oldValue(t){const e=this.__oldValue;this.__oldValue=t,this.requestUpdate("oldValue",e)}get initialValue(){return zt(this.__initialValue)?this.__initialValue:this.numberAdapter.create(this.__initialValue)}set initialValue(t){const e=this.__initialValue;this.__initialValue=t,this.requestUpdate("initialValue",e)}get locale(){return this.__locale}set locale(t){const e=this.__locale;this.__locale=t,this.requestUpdate("locale",e),this.localeInstance=qt(this.__locale)?new Intl.Locale(this.__locale):new Intl.Locale(...this.__locale)}constructor(...t){super(...t),this.__value=rn.NUMBER_ADAPTER.create(0),this.__oldValue=rn.NUMBER_ADAPTER.create(0),this.__initialValue=null,this.__locale="en-US",this.localeInstance=qt(this.locale)?new Intl.Locale(this.locale):new Intl.Locale(...this.locale),this.direction="up",this.oldDirection=this.direction,this.numberAdapter=rn.NUMBER_ADAPTER,this.stringAdapter=rn.STRING_ADAPTER}willUpdate(t){super.willUpdate(t),t.has("value")&&!t.has("oldValue")&&(this.oldValue=t.get("value")??this.value),this.oldDirection=this.direction,this.numberAdapter.eq(this.value,this.oldValue)||(this.direction=this.numberAdapter.gt(this.value,this.oldValue)?"down":"up")}connectedCallback(){super.connectedCallback(),this.oldValue=function(t){return null!=t}(this.initialValue)?this.initialValue:this.value}}return t([ht({attribute:"value",reflect:!0,converter:{toAttribute:rn.VALUE_CONVERTER.toAttribute},noAccessor:!0})],i.prototype,"value",null),t([ht({attribute:"old-value",reflect:!0,converter:rn.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"oldValue",null),t([ht({attribute:"initial-value",reflect:!0,converter:rn.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"initialValue",null),t([ht({converter:t=>{if(zt(t))return t;try{return JSON.parse(t)}catch(e){return t}},reflect:!0,noAccessor:!0})],i.prototype,"locale",null),t([dt()],i.prototype,"direction",void 0),t([dt()],i.prototype,"oldDirection",void 0),i},on=a`
66
+ */var Et={done:!0,hasNext:!1},Ot={done:!1,hasNext:!1},Ct=()=>Et;function Pt(t,...e){let i=t,s=e.map((t=>"lazy"in t?function(t){let{lazy:e,lazyArgs:i}=t,s=e(...i);return Object.assign(s,{isSingle:e.single??!1,index:0,items:[]})}(t):void 0)),r=0;for(;r<e.length;){if(void 0===s[r]||!Tt(i)){i=(0,e[r])(i),r+=1;continue}let t=[];for(let i=r;i<e.length;i++){let e=s[i];if(void 0===e||(t.push(e),e.isSingle))break}let n=[];for(let e of i)if(Dt(e,n,t))break;let{isSingle:o}=t.at(-1);i=o?n[0]:n,r+=t.length}return i}function Dt(t,e,i){if(0===i.length)return e.push(t),!1;let s=t,r=Ot,n=!1;for(let[t,o]of i.entries()){let{index:a,items:l}=o;if(l.push(s),r=o(s,a,l),o.index+=1,r.hasNext){if(r.hasMany){for(let s of r.next)if(Dt(s,e,i.slice(t+1)))return!0;return n}s=r.next}if(!r.hasNext)break;r.done&&(n=!0)}return r.hasNext&&e.push(s),n}function Tt(t){return"string"==typeof t||"object"==typeof t&&null!==t&&Symbol.iterator in t}function Mt(t,e,i){let s=t.length-e.length;if(0===s)return t(...e);if(1===s)return function(t,e,i){let s=i=>t(i,...e);return void 0===i?s:Object.assign(s,{lazy:i,lazyArgs:e})}(t,e,i);throw new Error("Wrong number of arguments")}function Nt(...t){return Mt(kt,t)}var kt=(t,e)=>t.length>=e;function Rt(t,e){let i=[];for(let s=t;s<e;s++)i.push(s);return i}function Ut(t,e){if(!Nt(e,1))return{...t};if(!Nt(e,2)){let{[e[0]]:i,...s}=t;return s}let i={...t};for(let t of e)delete i[t];return i}function It(...t){return Mt(Lt,t)}var Lt=(t,e)=>({...t,...e});function Vt(...t){return Mt(jt,t,Ht)}var jt=(t,e)=>t.map(e),Ht=t=>(e,i,s)=>({done:!1,hasNext:!0,next:t(e,i,s)});function Bt(t){return"number"==typeof t&&!Number.isNaN(t)}function zt(t){return"string"==typeof t}function Ft(t){return void 0===t||("string"==typeof t||Array.isArray(t)?0===t.length:0===Object.keys(t).length)}function Yt(t){return null==t}function Wt(t){return Array.isArray(t)}function qt(t){return"boolean"==typeof t}function Qt(t){return t instanceof Date}function Kt(...t){return Mt(Gt,t)}function Gt(t,e){if(t===e||Object.is(t,e))return!0;if("object"!=typeof t||"object"!=typeof e||null===t||null===e||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;if(Array.isArray(t))return function(t,e){if(t.length!==e.length)return!1;for(let[i,s]of t.entries())if(!Gt(s,e[i]))return!1;return!0}(t,e);if(t instanceof Map)return function(t,e){if(t.size!==e.size)return!1;for(let[i,s]of t.entries())if(!e.has(i)||!Gt(s,e.get(i)))return!1;return!0}(t,e);if(t instanceof Set)return function(t,e){if(t.size!==e.size)return!1;let i=[...e];for(let e of t){let t=!1;for(let[s,r]of i.entries())if(Gt(e,r)){t=!0,i.splice(s,1);break}if(!t)return!1}return!0}(t,e);if(t instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp)return t.toString()===e.toString();if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let[i,s]of Object.entries(t))if(!(i in e)||!Gt(s,e[i]))return!1;return!0}function Jt(...t){return function(t,e){let i=e.length-t.length;if(1===i){let[i,...s]=e;return Pt(i,{lazy:t,lazyArgs:s})}if(0===i){let i={lazy:t,lazyArgs:e};return Object.assign((t=>Pt(t,i)),i)}throw new Error("Wrong number of arguments")}(Zt,t)}function Zt(t){if(0===t.length)return Ct;let e=new Map;for(let i of t)e.set(i,(e.get(i)??0)+1);return t=>{let i=e.get(t);return void 0===i||0===i?Ot:(1===i?e.delete(t):e.set(t,i-1),{hasNext:!0,next:t,done:0===e.size})}}function Xt(t,e){const i=function(t,e){return function(t){return"function"==typeof t}(t)?t(e):t}(t,e),{data:s}=e,r=[];for(let t=0;t<s.length;t+=1){const e=Wt(i)?i[t]:i;r.push(e)}return r}function te(t,e){const i=Xt(t,e),{data:s}=e,r=[];for(let t=0;t<s.length;t+=1){const{digits:e}=s[t],n=i[t];r.push([]);for(let i=0;i<e.length;i+=1){const e=Wt(n)?n[i]:n;r[t].push(e)}}return r}function ee(t,e){const i=te(t,e),{data:s}=e,r=[];for(let t=0;t<s.length;t+=1){const{digits:e}=s[t],n=i[t];r.push([]);for(let i=0;i<e.length;i+=1){const{data:s}=e[i],o=n[i];r[t].push([]);for(let e=0;e<s.length;e+=1){const s=Wt(o)?o[e]:o;r[t][i].push(s)}}}return r}function ie(t,e){return It(t??{},e??{})}function se(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const s of i){const i=Number.parseInt(s,10);t[i]=ie(t[i],e[i])}return t}function re(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const s of i){const i=Number.parseInt(s,10);t[i]=se(t[i],e[i])}return t}const ne=e=>{class i extends e{constructor(){super(...arguments),this.cellStyles={},this.cachedCellStyles=[],this.digitStyles={},this.cachedDigitStyles=[],this.partStyles={},this.cachedPartStyles=[],this.color="inherit"}extractCellStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=function(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const s of i){const i=Number.parseInt(s,10);t[i]=re(t[i],e[i])}return t}(ee(this.cellStyles??{},t),ee(this.cellStylesDynamic??{},t));return Kt(this.cachedCellStyles,e)||(this.cachedCellStyles=e),this.cachedCellStyles}extractDigitStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=re(te(this.digitStyles??{},t),te(this.digitStylesDynamic??{},t));return Kt(this.cachedDigitStyles,e)||(this.cachedDigitStyles=e),this.cachedDigitStyles}extractPartStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=se(Xt(this.partStyles??{},t),Xt(this.partStylesDynamic??{},t));return Kt(this.cachedPartStyles,e)||(this.cachedPartStyles=e),this.cachedPartStyles}}return t([ut({type:Object,attribute:"cell-styles",reflect:!0})],i.prototype,"cellStyles",void 0),t([ut({type:Object,attribute:"digit-styles",reflect:!0})],i.prototype,"digitStyles",void 0),t([ut({type:Object,attribute:"part-styles",reflect:!0})],i.prototype,"partStyles",void 0),t([ut({type:String,reflect:!0})],i.prototype,"color",void 0),i};function oe(t){return t.length}function ae(){return function(t){if(!(r=t.length))return[];for(var e=-1,i=function(t,e){let i;if(void 0===e)for(const e of t)null!=e&&(i>e||void 0===i&&e>=e)&&(i=e);else{let s=-1;for(let r of t)null!=(r=e(r,++s,t))&&(i>r||void 0===i&&r>=r)&&(i=r)}return i}(t,oe),s=new Array(i);++e<i;)for(var r,n=-1,o=s[e]=new Array(r);++n<r;)o[n]=t[n][e];return s}(arguments)}function le(t,e){const[i,s]=t,[r,n]=e,o={animate:!0,cancelPrevAnimation:!1};let a="";return 1===r.data.length&&(o.animate=!1,o.cancelPrevAnimation=!0,a="only one digit"),i!==s||(r.data[0]===r.data[r.data.length-1]&&(o.animate=!1,o.cancelPrevAnimation=!0,a="same head and tail"),Kt(r,n)&&(o.animate=!1,a="same digits"),a&&(o.earlyReturn=a)),o}function ce(t){try{return JSON.parse(t)}catch(e){return t}}function he(t){const e={};return Wt(t.digitToChar)?t.digitToChar.forEach(((t,i)=>{var s;e[(s=i,String.fromCodePoint(s+48))]=t})):function(t){return"object"==typeof t&&null!==t}(t.digitToChar)&&Object.entries(t.digitToChar).forEach((([t,i])=>{e[t]=i})),{...t,digitToChar:e}}const ue=i=>{var s,r;class n extends i{constructor(){super(...arguments),r.set(this,{...s.DEFAULT_PARTS_OPTIONS}),this.parts=[],this.oldParts=[],this.partPreprocessDataList=[]}get partsOptions(){return e(this,r,"f")}set partsOptions(t){const i=e(this,r,"f");!function(t,e,i,s,r){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===s?r.call(t,i):r?r.value=i:e.set(t,i)}(this,r,he({...s.DEFAULT_PARTS_OPTIONS,...t}),"f"),this.requestUpdate("partsOptions",i)}sampling(t,e){return function(t,e,i,s){let r=s;const n=t.isInteger(e)&&t.isInteger(i)?function(t,e,i){return function(s){return t.round(t.add(t.mul(e,t.sub(t.create(1),s)),t.mul(i,s)))}}(t,e,i):function(t,e,i){return function(s){return t.add(t.mul(e,t.sub(t.create(1),s)),t.mul(i,s))}}(t,e,i);t.eq(e,i)&&(r=1);const o=[];for(let e=0;e<r;e++){const i=t.div(t.create(e),t.create(Math.max(r-1,1)));o.push(n(i))}return o}(this.numberAdapter,this.numberAdapter.max(t,e),this.numberAdapter.min(t,e),this.partsOptions.sampleCount)}sampleSplit(t){return[t.slice()]}sampleToString(t){return this.numberAdapter.toString(t)}willUpdate(t){super.willUpdate(t),t.has("value")&&(this.oldParts=this.parts),(t.has("value")||t.has("partsOptions"))&&(this.parts=this.processPartData()),t.has("value")&&(this.partPreprocessDataList=function(t,e,i,s){const r=[];let n=0;for(let o=0;o<e.length;o++){const a=e[o],l=s?.[o],c=[];for(let e=0;e<a.digits.length;e++){const s=a.digits[e],r=l?.digits.find((t=>t.place===s.place));c.push({...le([t,i],[s,r]),index:n++,partIndex:o,digitIndex:e})}r.push(c)}return r}(this.direction,this.parts,this.oldDirection,this.oldParts))}processPartData(){const{decimalSeparator:t,digitToChar:e,minPlaces:i,fillChar:s,type:r}=this.partsOptions,n=this.value,o=this.oldValue;let a=e=>this.sampleToString(e).split(t);"string"===r&&(a=t=>[this.sampleToString(t),""]);const l=[],c=this.sampleSplit(this.sampling(n,o));{const r=this.numberAdapter.gt(n,o)?"down":"up";for(let n=0;n<c.length;n++){const o=c[n],h=o["down"===r?0:o.length-1],[u=1,p=0]=i,d=a(h),f=Math.max(this.stringAdapter.stringToChars(d[0]).length,u),m=Math.max(this.stringAdapter.stringToChars(d[1]??"").length,p),_=ae(...o.map((e=>{const[i="",r=""]=a(e),n=this.stringAdapter.stringToChars(i),o=this.stringAdapter.stringToChars(r),l=Math.max(f-n.length,0),c=Math.max(m-o.length,0);let h=[].concat(new Array(l).fill(s),n);return m>0&&(h=h.concat([t],o,new Array(c).fill(s))),h}))).map(((t,i,s)=>({data:t.filter(((t,e,i)=>0===e||t!==i[e-1])).map((t=>e[t]??t)),place:s.length-i})));l.push({digits:_})}}return l}}return s=n,r=new WeakMap,n.DEFAULT_PARTS_OPTIONS={sampleCount:16,decimalSeparator:".",fillChar:"0",minPlaces:[1,0],digitToChar:{},type:"number"},t([ut({type:Object,attribute:"parts-options",converter:t=>ce(t??"")??{},noAccessor:!0})],n.prototype,"partsOptions",null),n},pe=()=>({create(t){const e=Number(t);return Number.isFinite(e)?e:0},add:(t,e)=>t+e,sub:(t,e)=>t-e,mul:(t,e)=>t*e,div:(t,e)=>t/e,compare:(t,e)=>t>e?1:t<e?-1:0,eq:(t,e)=>t===e,gt:(t,e)=>t>e,gte:(t,e)=>t>=e,lt:(t,e)=>t<e,lte:(t,e)=>t<=e,isInteger:t=>Number.isInteger(t),isNegative:t=>t<0,isPositive:t=>t>0,isZero:t=>0===t,isNaN:t=>Number.isNaN(t),isFinite:t=>Number.isFinite(t),abs:t=>Math.abs(t),ceil:t=>Math.ceil(t),floor:t=>Math.floor(t),round:t=>Math.round(t),max:(t,e)=>Math.max(t,e),min:(t,e)=>Math.min(t,e),toNumber:t=>Number(t),toString:t=>String(t)}),de=()=>({stringToChars:t=>Array.from(t)});class fe{static setNumberAdapter(t){let e=pe();if(zt(t)){for(const[i,s]of fe.AVAILABLE_NUMBER_ADAPTERS)if(i.includes(t)){e=s();break}}else e=t;fe.NUMBER_ADAPTER=e}static setStringAdapter(t){let e=de();if(zt(t)){for(const[i,s]of fe.AVAILABLE_STRING_ADAPTERS)if(i.includes(t)){e=s();break}}else e=t;fe.STRING_ADAPTER=e}static registerNumberAdapter(t,e){fe.AVAILABLE_NUMBER_ADAPTERS.set(t,e)}static registerStringAdapter(t,e){fe.AVAILABLE_STRING_ADAPTERS.set(t,e)}static registryAdapter(t){t.register(this)}}function me(...t){fe.setNumberAdapter(...t)}function _e(...t){fe.setStringAdapter(...t)}function ge(...t){fe.registerNumberAdapter(...t)}function ye(...t){fe.registerStringAdapter(...t)}fe.AVAILABLE_NUMBER_ADAPTERS=new Map([[["number"],pe]]),fe.AVAILABLE_STRING_ADAPTERS=new Map([[["string"],de],[["intl-segmenter"],t=>{const e=new Intl.Segmenter(t,{granularity:"grapheme"});return{stringToChars:t=>Array.from(e.segment(t)).map((t=>t.segment))}}]]),fe.NUMBER_ADAPTER=pe(),fe.STRING_ADAPTER=de(),fe.VALUE_CONVERTER={fromAttribute:t=>t,toAttribute:t=>Yt(t)?t:fe.NUMBER_ADAPTER.toString(t)};const Ae=e=>{class i extends e{get value(){return this.numberAdapter.create(this.__value)}set value(t){t=fe.NUMBER_ADAPTER.create(Yt(t)||zt(t)&&""===t.trim()?0:t);const e=this.__value;this.__value=t,this.numberAdapter.eq(this.__value,e)||this.requestUpdate("value",e)}get oldValue(){return this.numberAdapter.create(this.__oldValue)}set oldValue(t){const e=this.__oldValue;this.__oldValue=t,this.requestUpdate("oldValue",e)}get initialValue(){return Yt(this.__initialValue)?this.__initialValue:this.numberAdapter.create(this.__initialValue)}set initialValue(t){const e=this.__initialValue;this.__initialValue=t,this.requestUpdate("initialValue",e)}get locale(){return this.__locale}set locale(t){const e=this.__locale;this.__locale=t,this.requestUpdate("locale",e),this.localeInstance=zt(this.__locale)?new Intl.Locale(this.__locale):new Intl.Locale(...this.__locale)}constructor(...t){super(...t),this.__value=fe.NUMBER_ADAPTER.create(0),this.__oldValue=fe.NUMBER_ADAPTER.create(0),this.__initialValue=null,this.__locale="en-US",this.localeInstance=zt(this.locale)?new Intl.Locale(this.locale):new Intl.Locale(...this.locale),this.direction="up",this.oldDirection=this.direction,this.numberAdapter=fe.NUMBER_ADAPTER,this.stringAdapter=fe.STRING_ADAPTER}willUpdate(t){super.willUpdate(t),t.has("value")&&!t.has("oldValue")&&(this.oldValue=t.get("value")??this.value),this.oldDirection=this.direction,this.numberAdapter.eq(this.value,this.oldValue)||(this.direction=this.numberAdapter.gt(this.value,this.oldValue)?"down":"up")}connectedCallback(){super.connectedCallback(),this.oldValue=function(t){return null!=t}(this.initialValue)?this.initialValue:this.value}}return t([ut({attribute:"value",reflect:!0,converter:{toAttribute:fe.VALUE_CONVERTER.toAttribute},noAccessor:!0})],i.prototype,"value",null),t([ut({attribute:"old-value",reflect:!0,converter:fe.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"oldValue",null),t([ut({attribute:"initial-value",reflect:!0,converter:fe.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"initialValue",null),t([ut({converter:t=>{if(Yt(t))return t;try{return JSON.parse(t)}catch(e){return t}},reflect:!0,noAccessor:!0})],i.prototype,"locale",null),t([pt()],i.prototype,"direction",void 0),t([pt()],i.prototype,"oldDirection",void 0),i},be=a`
74
67
  :host {
75
68
  position: relative;
76
69
  white-space: nowrap;
@@ -99,7 +92,7 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
99
92
  // font-size: 0.4em;
100
93
  // line-height: 1;
101
94
  //}
102
- `,an=e=>{class i extends e{constructor(){super(...arguments),this.animationOptions={},this.cachedAnimationOptions=[],this.keyframes={},this.cachedKeyframes=[]}extractAnimationOptions(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=re(te(this.animationOptions??{},t),te(this.animationOptionsDynamic??{},t));return Qt(this.cachedAnimationOptions,e)||(this.cachedAnimationOptions=e),this.cachedAnimationOptions}extractKeyframes(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=re(te(this.keyframes??{},t),te(this.keyframesDynamic??{},t));return Qt(this.cachedKeyframes,e)||(this.cachedKeyframes=e),this.cachedKeyframes}}return t([ht({type:Object,attribute:"animation-options",reflect:!0})],i.prototype,"animationOptions",void 0),t([ht({type:Object,attribute:"keyframes",reflect:!0})],i.prototype,"keyframes",void 0),i},ln="important",cn=" !"+ln,un=mt(class extends _t{constructor(t){if(super(t),t.type!==ft||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const n=t[i];return null==n?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const n=e[t];if(null!=n){this.ft.add(t);const e="string"==typeof n&&n.endsWith(cn);t.includes("-")||e?i.setProperty(t,e?n.slice(0,-11):n,e?ln:""):i[t]=n}}return B}}),hn=mt(class extends _t{constructor(t){if(super(t),t.type!==ft||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const n=!!e[t];n===this.st.has(t)||this.nt?.has(t)||(n?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return B}}),dn=a`
95
+ `,$e=e=>{class i extends e{constructor(){super(...arguments),this.animationOptions={},this.cachedAnimationOptions=[],this.keyframes={},this.cachedKeyframes=[]}extractAnimationOptions(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=re(te(this.animationOptions??{},t),te(this.animationOptionsDynamic??{},t));return Kt(this.cachedAnimationOptions,e)||(this.cachedAnimationOptions=e),this.cachedAnimationOptions}extractKeyframes(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=re(te(this.keyframes??{},t),te(this.keyframesDynamic??{},t));return Kt(this.cachedKeyframes,e)||(this.cachedKeyframes=e),this.cachedKeyframes}}return t([ut({type:Object,attribute:"animation-options",reflect:!0})],i.prototype,"animationOptions",void 0),t([ut({type:Object,attribute:"keyframes",reflect:!0})],i.prototype,"keyframes",void 0),i},ve="important",Se=" !"+ve,we=_t(class extends gt{constructor(t){if(super(t),t.type!==ft||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const s=t[i];return null==s?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const s=e[t];if(null!=s){this.ft.add(t);const e="string"==typeof s&&s.endsWith(Se);t.includes("-")||e?i.setProperty(t,e?s.slice(0,-11):s,e?ve:""):i[t]=s}}return F}}),xe=_t(class extends gt{constructor(t){if(super(t),t.type!==ft||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return F}}),Ee=a`
103
96
  :host {
104
97
  display: inline-flex;
105
98
  overflow: hidden;
@@ -134,7 +127,7 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
134
127
  .roller-part .roller-part__suffix {
135
128
  display: inline-block;
136
129
  }
137
- `,pn=a`
130
+ `,Oe=a`
138
131
  .roller-part-digit {
139
132
  position: relative;
140
133
  display: inline-block;
@@ -187,72 +180,72 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
187
180
  position: absolute;
188
181
  bottom: 100%;
189
182
  }
190
- `,fn=t=>t,gn=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function mn(t,e,i,n){if(t===e&&i===n)return fn;const r=e=>function(t,e,i,n,r){let s,o,a=0;do{o=e+(i-e)/2,s=gn(o,n,r)-t,s>0?i=o:e=o}while(Math.abs(s)>1e-7&&++a<12);return o}(e,0,1,t,i);return t=>0===t||1===t?t:gn(r(t),e,n)}const _n=mn(.12,0,.39,0),yn=mn(.61,1,.88,1),vn=mn(.37,0,.63,1),bn=mn(.11,0,.5,0),wn=mn(.5,1,.89,1),An=mn(.45,0,.55,1),$n=mn(.32,0,.67,0),Sn=mn(.33,1,.68,1),xn=mn(.65,0,.35,1),Nn=mn(.5,0,.75,0),En=mn(.25,1,.5,1),On=mn(.76,0,.24,1),Cn=mn(.64,0,.78,0),Pn=mn(.22,1,.36,1),Mn=mn(.83,0,.17,1),Dn=mn(.7,0,.84,0),Tn=mn(.16,1,.3,1),kn=mn(.87,0,.13,1),Rn=mn(.55,0,1,.45),Un=mn(0,.55,.45,1),In=mn(.85,0,.15,1),Ln=mn(.36,0,.66,-.56),jn=mn(.34,1.56,.64,1),Vn=mn(.68,-.6,.32,1.6);function Hn(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-(2**(10*t-10))*Math.sin((10*t-10.75)*e)}function Fn(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:2**(-10*t)*Math.sin((10*t-.75)*e)+1}function qn(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-(2**(20*t-10))*Math.sin((20*t-11.125)*e)/2:2**(-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}function Bn(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375}function zn(t){return 1-Bn(1-t)}function Yn(t){return t<.5?(1-Bn(1-2*t))/2:(1+Bn(2*t-1))/2}var Zn=Object.freeze({__proto__:null,easeInBack:Ln,easeInBounce:zn,easeInCirc:Rn,easeInCubic:$n,easeInElastic:Hn,easeInExpo:Dn,easeInOutBack:Vn,easeInOutBounce:Yn,easeInOutCirc:In,easeInOutCubic:xn,easeInOutElastic:qn,easeInOutExpo:kn,easeInOutQuad:An,easeInOutQuart:On,easeInOutQuint:Mn,easeInOutSine:vn,easeInQuad:bn,easeInQuart:Nn,easeInQuint:Cn,easeInSine:_n,easeOutBack:jn,easeOutBounce:Bn,easeOutCirc:Un,easeOutCubic:Sn,easeOutElastic:Fn,easeOutExpo:Tn,easeOutQuad:wn,easeOutQuart:En,easeOutQuint:Pn,easeOutSine:yn});class Wn extends Event{}let Qn=class extends ot{constructor(){super(),this.digit={data:[],place:0},this.preprocessData={animate:!0,cancelPrevAnimation:!1,earlyReturn:"",index:0,partIndex:0,digitIndex:0},this.direction="up",this.textStyle={},this.cellStyle=[],this.animationOptions={},this.keyframes={},this.digitWidth=0,this.resizeObserver=new ResizeObserver((()=>{this.digitWidth=(this.clonedRollDigitList?this.clonedRollDigitList.getBoundingClientRect():new DOMRect).width}))}firstUpdated(t){super.firstUpdated(t),this.clonedRollDigitList&&this.resizeObserver.observe(this.clonedRollDigitList)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.disconnect()}updated(t){super.updated(t),Kt(Array.from(t.keys()),["digit","preprocessData","direction","animationOptions","keyframes"]).length>0&&this.shouldAnimate()&&this.startAnimation().then()}render(){const t=this.cellStyle.map((t=>function(...t){return Dt(Ut,t)}(t,["position"])));return q`<span class="roller-part-digit">
183
+ `,Ce=t=>t,Pe=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function De(t,e,i,s){if(t===e&&i===s)return Ce;const r=e=>function(t,e,i,s,r){let n,o,a=0;do{o=e+(i-e)/2,n=Pe(o,s,r)-t,n>0?i=o:e=o}while(Math.abs(n)>1e-7&&++a<12);return o}(e,0,1,t,i);return t=>0===t||1===t?t:Pe(r(t),e,s)}const Te=De(.12,0,.39,0),Me=De(.61,1,.88,1),Ne=De(.37,0,.63,1),ke=De(.11,0,.5,0),Re=De(.5,1,.89,1),Ue=De(.45,0,.55,1),Ie=De(.32,0,.67,0),Le=De(.33,1,.68,1),Ve=De(.65,0,.35,1),je=De(.5,0,.75,0),He=De(.25,1,.5,1),Be=De(.76,0,.24,1),ze=De(.64,0,.78,0),Fe=De(.22,1,.36,1),Ye=De(.83,0,.17,1),We=De(.7,0,.84,0),qe=De(.16,1,.3,1),Qe=De(.87,0,.13,1),Ke=De(.55,0,1,.45),Ge=De(0,.55,.45,1),Je=De(.85,0,.15,1),Ze=De(.36,0,.66,-.56),Xe=De(.34,1.56,.64,1),ti=De(.68,-.6,.32,1.6);function ei(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-(2**(10*t-10))*Math.sin((10*t-10.75)*e)}function ii(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:2**(-10*t)*Math.sin((10*t-.75)*e)+1}function si(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-(2**(20*t-10))*Math.sin((20*t-11.125)*e)/2:2**(-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}function ri(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375}function ni(t){return 1-ri(1-t)}function oi(t){return t<.5?(1-ri(1-2*t))/2:(1+ri(2*t-1))/2}var ai=Object.freeze({__proto__:null,easeInBack:Ze,easeInBounce:ni,easeInCirc:Ke,easeInCubic:Ie,easeInElastic:ei,easeInExpo:We,easeInOutBack:ti,easeInOutBounce:oi,easeInOutCirc:Je,easeInOutCubic:Ve,easeInOutElastic:si,easeInOutExpo:Qe,easeInOutQuad:Ue,easeInOutQuart:Be,easeInOutQuint:Ye,easeInOutSine:Ne,easeInQuad:ke,easeInQuart:je,easeInQuint:ze,easeInSine:Te,easeOutBack:Xe,easeOutBounce:ri,easeOutCirc:Ge,easeOutCubic:Le,easeOutElastic:ii,easeOutExpo:qe,easeOutQuad:Re,easeOutQuart:He,easeOutQuint:Fe,easeOutSine:Me});class li extends Event{}let ci=class extends ot{constructor(){super(),this.digit={data:[],place:0},this.preprocessData={animate:!0,cancelPrevAnimation:!1,earlyReturn:"",index:0,partIndex:0,digitIndex:0},this.direction="up",this.textStyle={},this.cellStyle=[],this.animationOptions={},this.keyframes={},this.digitWidth=0,this.resizeObserver=new ResizeObserver((()=>{this.digitWidth=this.clonedRollDigitList?this.clonedRollDigitList.offsetWidth:0}))}firstUpdated(t){super.firstUpdated(t),this.clonedRollDigitList&&this.resizeObserver.observe(this.clonedRollDigitList)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.disconnect()}updated(t){super.updated(t),Jt(Array.from(t.keys()),["digit","preprocessData","direction","animationOptions","keyframes"]).length>0&&this.shouldAnimate()&&this.startAnimation().then()}render(){const t=this.cellStyle.map((t=>function(...t){return Mt(Ut,t)}(t,["position"])));return z`<span class="roller-part-digit">
191
184
  <!-- 占位 -->
192
185
  <span
193
186
  class="placeholder"
194
- style=${un({width:`${Math.round(this.digitWidth)}px`})}
187
+ style=${we({width:`${Math.round(this.digitWidth)}px`})}
195
188
  >0</span
196
189
  >
197
190
  <!-- 一个不可见的滚动列表的复制, 用于计算该列表的最大宽度. -->
198
191
  <span class="roll-list__shadow">
199
- ${xt(this.digit.data,((t,e)=>e),((e,i)=>q`<span style=${un(t[i])}
192
+ ${xt(this.digit.data,((t,e)=>e),((e,i)=>z`<span style=${we(t[i])}
200
193
  >${e}</span
201
194
  >`))}
202
195
  </span>
203
196
  <span
204
- class=${hn({"roll-list__up":"up"===this.direction,"roll-list__down":"down"===this.direction,"roll-list":!0})}
197
+ class=${xe({"roll-list__up":"up"===this.direction,"roll-list__down":"down"===this.direction,"roll-list":!0})}
205
198
  >
206
- ${this.digit.data.length>1?xt(this.digit.data,((t,e)=>e),((t,e)=>"up"===this.direction&&e===this.digit.data.length-1?q`<span
199
+ ${this.digit.data.length>1?xt(this.digit.data,((t,e)=>e),((t,e)=>"up"===this.direction&&e===this.digit.data.length-1?z`<span
207
200
  part="cell"
208
201
  class="roll-item roll-item__head"
209
- style=${un(this.cellStyle[e])}
210
- ><span style=${un(this.textStyle)}
202
+ style=${we(this.cellStyle[e])}
203
+ ><span style=${we(this.textStyle)}
211
204
  >${t}</span
212
205
  ></span
213
- >`:"down"===this.direction&&0===e?q`
206
+ >`:"down"===this.direction&&0===e?z`
214
207
  <span
215
208
  part="cell"
216
209
  class="roll-item roll-item__tail"
217
- style=${un(this.cellStyle[e])}
218
- ><span style=${un(this.textStyle)}
210
+ style=${we(this.cellStyle[e])}
211
+ ><span style=${we(this.textStyle)}
219
212
  >${t}</span
220
213
  ></span
221
214
  >
222
- `:q`<span
215
+ `:z`<span
223
216
  part="cell"
224
217
  class="roll-item"
225
- style=${un(this.cellStyle[e])}
226
- ><span style=${un(this.textStyle)}
218
+ style=${we(this.cellStyle[e])}
219
+ ><span style=${we(this.textStyle)}
227
220
  >${t}</span
228
221
  ></span
229
- >`)):q`<span
222
+ >`)):z`<span
230
223
  part="cell"
231
224
  class="roll-item"
232
- style=${un(this.cellStyle[0])}
233
- ><span style=${un(this.textStyle)}
225
+ style=${we(this.cellStyle[0])}
226
+ ><span style=${we(this.textStyle)}
234
227
  >${this.digit.data[0]}</span
235
228
  ></span
236
229
  >`}</span
237
230
  ></span
238
- > `}shouldAnimate(){const{cancelPrevAnimation:t,animate:e}=this.preprocessData;return t&&(this.animation&&this.animation.cancel(),this.rollList&&this.rollList.style&&this.rollList.style.cssText&&(this.rollList.style.cssText="")),!!e}async startAnimation(){if(zt(this.rollList))return;this.__emitAnimationStart();const t=It({duration:1e3,iterations:1,easing:"ease-out",fill:"forwards"},this.animationOptions),e=Bt(this.keyframes)?{up:{transform:["translateY(0)","translateY(-100%)"]},down:{transform:["translateY(0)","translateY(100%)"]}}[this.direction]:this.keyframes;if(qt(t.easing)&&Zn[t.easing]){const e=Zn[t.easing];t.easing=`linear(${function(...t){return Dt(Rt,t)}(0,64).map(((t,i)=>e(i/63))).join(",")})`}try{this.clearAnimation(),this.animation=this.rollList.animate(e,t),this.animation.addEventListener("finish",(()=>this.__emitAnimationEnd()),{once:!0})}catch(t){console.error(t)}}clearAnimation(){this.animation?.removeEventListener("finish",this.__emitAnimationEnd),this.animation?.cancel()}__emitAnimationStart(){this.isConnected&&this.dispatchEvent(new Wn("roller-digit-animation-start"))}__emitAnimationEnd(){this.isConnected&&this.dispatchEvent(new Wn("roller-digit-animation-end"))}};Qn.styles=[pn],t([ht({type:Object})],Qn.prototype,"digit",void 0),t([ht({type:Object})],Qn.prototype,"preprocessData",void 0),t([ht({type:String})],Qn.prototype,"direction",void 0),t([ht({type:Object})],Qn.prototype,"textStyle",void 0),t([ht({type:Array})],Qn.prototype,"cellStyle",void 0),t([ht({type:Object})],Qn.prototype,"animationOptions",void 0),t([ht({type:Object})],Qn.prototype,"keyframes",void 0),t([pt(".roll-list__shadow")],Qn.prototype,"clonedRollDigitList",void 0),t([pt(".roll-list")],Qn.prototype,"rollList",void 0),t([dt()],Qn.prototype,"digitWidth",void 0),Qn=t([lt("timered-counter-roller-digit")],Qn);class Gn extends Event{}let Kn=class extends ot{constructor(){super(...arguments),this.color="",this.direction="up",this.parts=[],this.partPreprocessDataList=[],this.animationOptions=[],this.keyframes=[],this.cellStyles=[],this.digitStyles=[],this.partStyles=[],this.parentContainerRect={},this.__partDigitsColorStyles=[],this.digitAnimateEndCount=0,this.digitAnimatedCount=0}render(){return q`<span
231
+ > `}shouldAnimate(){const{cancelPrevAnimation:t,animate:e}=this.preprocessData;return t&&(this.animation&&this.animation.cancel(),this.rollList&&this.rollList.style&&this.rollList.style.cssText&&(this.rollList.style.cssText="")),!!e}async startAnimation(){if(Yt(this.rollList))return;this.__emitAnimationStart();const t=It({duration:1e3,iterations:1,easing:"ease-out",fill:"forwards"},this.animationOptions),e=Ft(this.keyframes)?{up:{transform:["translateY(0)","translateY(-100%)"]},down:{transform:["translateY(0)","translateY(100%)"]}}[this.direction]:this.keyframes;if(zt(t.easing)&&ai[t.easing]){const e=ai[t.easing];t.easing=`linear(${function(...t){return Mt(Rt,t)}(0,64).map(((t,i)=>e(i/63))).join(",")})`}try{this.clearAnimation(),this.animation=this.rollList.animate(e,t),this.animation.addEventListener("finish",(()=>this.__emitAnimationEnd()),{once:!0})}catch(t){console.error(t)}}clearAnimation(){this.animation?.removeEventListener("finish",this.__emitAnimationEnd),this.animation?.cancel()}__emitAnimationStart(){this.isConnected&&this.dispatchEvent(new li("roller-digit-animation-start"))}__emitAnimationEnd(){this.isConnected&&this.dispatchEvent(new li("roller-digit-animation-end"))}};ci.styles=[Oe],t([ut({type:Object})],ci.prototype,"digit",void 0),t([ut({type:Object})],ci.prototype,"preprocessData",void 0),t([ut({type:String})],ci.prototype,"direction",void 0),t([ut({type:Object})],ci.prototype,"textStyle",void 0),t([ut({type:Array})],ci.prototype,"cellStyle",void 0),t([ut({type:Object})],ci.prototype,"animationOptions",void 0),t([ut({type:Object})],ci.prototype,"keyframes",void 0),t([dt(".roll-list__shadow")],ci.prototype,"clonedRollDigitList",void 0),t([dt(".roll-list")],ci.prototype,"rollList",void 0),t([pt()],ci.prototype,"digitWidth",void 0),ci=t([lt("timered-counter-roller-digit")],ci);class hi extends Event{}let ui=class extends ot{constructor(){super(...arguments),this.color="",this.direction="up",this.parts=[],this.partPreprocessDataList=[],this.animationOptions=[],this.keyframes=[],this.cellStyles=[],this.digitStyles=[],this.partStyles=[],this.parentContainerRect={},this.__partDigitsColorStyles=[],this.digitAnimateEndCount=0,this.digitAnimatedCount=0}render(){return z`<span
239
232
  class="roller__prefix"
240
233
  data-part-id="-1"
241
234
  data-digit-id="0"
242
- style=${un(this.__partDigitsColorStyles?.[-1]?.[0]??{})}
235
+ style=${we(this.__partDigitsColorStyles?.[-1]?.[0]??{})}
243
236
  >
244
237
  <slot part="prefix" name="prefix"></slot>
245
238
  </span>
246
239
  <span class="counter-parts">
247
- ${xt(this.parts,((t,e)=>e),((t,e)=>q`<span
240
+ ${xt(this.parts,((t,e)=>e),((t,e)=>z`<span
248
241
  part="part"
249
242
  class="roller-part"
250
- style=${un(this.partStyles?.[e]??{})}
251
- >${xt(t.digits,((e,i)=>""+(t.digits.length-i)),((t,i)=>q`<timered-counter-roller-digit
243
+ style=${we(this.partStyles?.[e]??{})}
244
+ >${xt(t.digits,((e,i)=>""+(t.digits.length-i)),((t,i)=>z`<timered-counter-roller-digit
252
245
  exportparts="digit, cell"
253
246
  part="digit"
254
247
  class="roller-part__wrapper"
255
- style=${un(this.digitStyles?.[e]?.[i]??{})}
248
+ style=${we(this.digitStyles?.[e]?.[i]??{})}
256
249
  data-part-id="${e}"
257
250
  data-digit-id="${i}"
258
251
  .digit=${t}
@@ -263,11 +256,11 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
263
256
  .animationOptions=${this.animationOptions[e][i]}
264
257
  .keyframes=${this.keyframes[e][i]}
265
258
  @roller-digit-animation-end=${this.__handleDigitAnimationEnd}
266
- ></timered-counter-roller-digit>`))}${q`<span
259
+ ></timered-counter-roller-digit>`))}${z`<span
267
260
  class="roller-part__suffix"
268
261
  data-part-id="${e}"
269
262
  data-digit-id="-1"
270
- style=${un(this.__partDigitsColorStyles?.[e]?.[-1]??{})}
263
+ style=${we(this.__partDigitsColorStyles?.[e]?.[-1]??{})}
271
264
  ><slot
272
265
  part="part-suffix"
273
266
  name=${`part-suffix-${e}`}
@@ -278,9 +271,9 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
278
271
  class="roller__suffix"
279
272
  data-part-id="-2"
280
273
  data-digit-id="0"
281
- style=${un(this.__partDigitsColorStyles?.[-2]?.[0]??{})}
274
+ style=${we(this.__partDigitsColorStyles?.[-2]?.[0]??{})}
282
275
  ><slot part="suffix" name="suffix"></slot
283
- ></span>`}willUpdate(t){super.willUpdate(t),(t.has("direction")||t.has("parts"))&&(this.digitAnimateEndCount=0,this.digitAnimatedCount=this.partPreprocessDataList.flat().filter((({animate:t})=>t)).length,this.digitAnimatedCount>0&&this.__emitAnimationStart()),this.__partDigitsColorStyles=this.__generatePartDigitsColorStyles()}__handleDigitAnimationEnd(){this.digitAnimateEndCount++,this.digitAnimateEndCount<this.digitAnimatedCount||this.__emitAnimationEnd()}__emitAnimationStart(){this.isConnected&&this.dispatchEvent(new Gn("roller-animation-start"))}__emitAnimationEnd(){this.isConnected&&this.dispatchEvent(new Gn("roller-animation-end"))}__generatePartDigitsColorStyles(){const t=[],e=this.parentContainerRect,{prefixContainer:i,suffixContainer:n,color:r}=this,s=Array.from(this.shadowRoot?.querySelectorAll("[data-part-id]").values()??[]);if(!e)return t;i&&(s[-1]=i),n&&(s[-2]=n);for(const i of function(...t){return Dt(Object.values,t)}(s)){const n=Number.parseInt(i.dataset.partId??"-1",10),s=Number.parseInt(i.dataset.digitId??"-1",10);if(!Ft(n)||!Ft(s))throw new Error("The data-part-id and data-digit-id attributes are required.");t[n]||(t[n]=[]),CSS.supports("color",r)?t[n][s]={color:r}:CSS.supports("background-image",r)?t[n][s]={backgroundImage:r,backgroundClip:"text",backgroundSize:`${e.width}px ${e.height}px`,backgroundPositionX:-i.offsetLeft+"px",backgroundPositionY:-i.offsetTop+"px",backgroundRepeat:"no-repeat",color:"transparent","-webkit-text-fill-color":"transparent"}:(t[n][s]={},console.warn(new Error("The color property is not supported.")))}return t}};Kn.styles=[dn],t([ht({type:String})],Kn.prototype,"color",void 0),t([ht({type:String})],Kn.prototype,"direction",void 0),t([ht({type:Array})],Kn.prototype,"parts",void 0),t([ht({type:Array})],Kn.prototype,"partPreprocessDataList",void 0),t([ht({type:Array})],Kn.prototype,"animationOptions",void 0),t([ht({type:Array})],Kn.prototype,"keyframes",void 0),t([ht({type:Array})],Kn.prototype,"cellStyles",void 0),t([ht({type:Array})],Kn.prototype,"digitStyles",void 0),t([ht({type:Array})],Kn.prototype,"partStyles",void 0),t([ht({type:Object})],Kn.prototype,"parentContainerRect",void 0),t([pt(".roller__prefix")],Kn.prototype,"prefixContainer",void 0),t([pt(".roller__suffix")],Kn.prototype,"suffixContainer",void 0),Kn=t([lt("timered-counter-roller")],Kn);const Jn=e=>{class i extends e{constructor(){super(...arguments),this.ariaLabel="",this.ariaLive="polite"}generateAriaLabel(){let t="";const{direction:e}=this;for(const i of this.parts)for(const n of i.digits)t+=`${n.data["up"===e?n.data.length-1:0]}`;return t}willUpdate(t){super.willUpdate(t),this.ariaLabel=this.generateAriaLabel()}}return t([ht({attribute:"aria-label",reflect:!0})],i.prototype,"ariaLabel",void 0),t([ht({attribute:"aira-live",reflect:!0})],i.prototype,"ariaLive",void 0),i};class Xn extends Event{}let tr=class extends(Jn(an(se(he(sn(ot)))))){constructor(){super(),this.resizeObserver=new ResizeObserver((()=>{this.partsContainerRect=this.partsContainer?this.partsContainer.getBoundingClientRect():new DOMRect}))}firstUpdated(t){super.firstUpdated(t),this.partsContainer&&this.resizeObserver.observe(this.partsContainer)}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),n=this.extractAnimationOptions(),r=this.extractKeyframes();return q`
276
+ ></span>`}willUpdate(t){super.willUpdate(t),(t.has("direction")||t.has("parts"))&&(this.digitAnimateEndCount=0,this.digitAnimatedCount=this.partPreprocessDataList.flat().filter((({animate:t})=>t)).length,this.digitAnimatedCount>0&&this.__emitAnimationStart()),this.__partDigitsColorStyles=this.__generatePartDigitsColorStyles()}__handleDigitAnimationEnd(){this.digitAnimateEndCount++,this.digitAnimateEndCount<this.digitAnimatedCount||this.__emitAnimationEnd()}__emitAnimationStart(){this.isConnected&&this.dispatchEvent(new hi("roller-animation-start"))}__emitAnimationEnd(){this.isConnected&&this.dispatchEvent(new hi("roller-animation-end"))}__generatePartDigitsColorStyles(){const t=[],e=this.parentContainerRect,{prefixContainer:i,suffixContainer:s,color:r}=this,n=Array.from(this.shadowRoot?.querySelectorAll("[data-part-id]").values()??[]);if(!e)return t;i&&(n[-1]=i),s&&(n[-2]=s);for(const e of function(...t){return Mt(Object.values,t)}(n)){const i=Number.parseInt(e.dataset.partId??"-1",10),s=Number.parseInt(e.dataset.digitId??"-1",10);if(!Bt(i)||!Bt(s))throw new Error("The data-part-id and data-digit-id attributes are required.");t[i]||(t[i]=[]),CSS.supports("color",r)?t[i][s]={color:r}:CSS.supports("background-image",r)?t[i][s]={backgroundImage:r,backgroundClip:"text",backgroundSize:`${this.offsetWidth}px ${this.offsetHeight}px`,backgroundPositionX:-e.offsetLeft+"px",backgroundPositionY:-e.offsetTop+"px",backgroundRepeat:"no-repeat",color:"transparent","-webkit-text-fill-color":"transparent"}:(t[i][s]={},console.warn(new Error("The color property is not supported.")))}return t}};ui.styles=[Ee],t([ut({type:String})],ui.prototype,"color",void 0),t([ut({type:String})],ui.prototype,"direction",void 0),t([ut({type:Array})],ui.prototype,"parts",void 0),t([ut({type:Array})],ui.prototype,"partPreprocessDataList",void 0),t([ut({type:Array})],ui.prototype,"animationOptions",void 0),t([ut({type:Array})],ui.prototype,"keyframes",void 0),t([ut({type:Array})],ui.prototype,"cellStyles",void 0),t([ut({type:Array})],ui.prototype,"digitStyles",void 0),t([ut({type:Array})],ui.prototype,"partStyles",void 0),t([ut({type:Object})],ui.prototype,"parentContainerRect",void 0),t([dt(".roller__prefix")],ui.prototype,"prefixContainer",void 0),t([dt(".roller__suffix")],ui.prototype,"suffixContainer",void 0),ui=t([lt("timered-counter-roller")],ui);const pi=e=>{class i extends e{constructor(){super(...arguments),this.ariaLabel="",this.ariaLive="polite"}generateAriaLabel(){let t="";const{direction:e}=this;for(const i of this.parts)for(const s of i.digits)t+=`${s.data["up"===e?s.data.length-1:0]}`;return t}willUpdate(t){super.willUpdate(t),this.ariaLabel=this.generateAriaLabel()}}return t([ut({attribute:"aria-label",reflect:!0})],i.prototype,"ariaLabel",void 0),t([ut({attribute:"aira-live",reflect:!0})],i.prototype,"ariaLive",void 0),i};class di extends Event{}let fi=class extends(pi($e(ne(ue(Ae(ot)))))){constructor(){super(),this.resizeObserver=new ResizeObserver((()=>{this.partsContainerRect=this.partsContainer?this.partsContainer.getBoundingClientRect():new DOMRect}))}firstUpdated(t){super.firstUpdated(t),this.partsContainer&&this.resizeObserver.observe(this.partsContainer)}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),s=this.extractAnimationOptions(),r=this.extractKeyframes();return z`
284
277
  <timered-counter-roller
285
278
  exportparts="group, part, digit, cell, prefix, suffix, part-suffix"
286
279
  part="group"
@@ -290,7 +283,7 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
290
283
  .parentContainerRect=${this.partsContainerRect}
291
284
  .parts=${this.parts}
292
285
  .partPreprocessDataList=${this.partPreprocessDataList}
293
- .animationOptions=${n}
286
+ .animationOptions=${s}
294
287
  .keyframes=${r}
295
288
  .cellStyles=${t}
296
289
  .digitStyles=${e}
@@ -301,12 +294,12 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
301
294
  >
302
295
  <slot name="prefix" slot="prefix"></slot>
303
296
  <slot name="suffix" slot="suffix"></slot>
304
- ${xt(this.parts,((t,e)=>e),((t,e)=>q`<slot
297
+ ${xt(this.parts,((t,e)=>e),((t,e)=>z`<slot
305
298
  name=${`part-suffix-${e}`}
306
299
  slot=${`part-suffix-${e}`}
307
300
  ></slot>`))}
308
301
  </timered-counter-roller>
309
- `}dispatchTimeredCounterAnimationStart(){this.dispatchEvent(new Xn("timered-counter-animation-start"))}dispatchTimeredCounterAnimationEnd(){this.dispatchEvent(new Xn("timered-counter-animation-end"))}};tr.styles=[on],t([dt()],tr.prototype,"partsContainerRect",void 0),t([pt("timered-counter-roller")],tr.prototype,"partsContainer",void 0),tr=t([lt("timered-counter")],tr);const er=a``;let ir=class extends tr{constructor(){super(...arguments),this.localeNumber=!1,this.localeNumberInstance=new Intl.NumberFormat(this.localeInstance,Zt(this.localeNumber)?{}:this.localeNumber),this.localDecimalSeparator="",this.localeGroupingSeparator=""}sampleToString(t){return this.localeNumber?this.localeNumberInstance.format(this.numberAdapter.toNumber(t)):this.numberAdapter.toString(t)}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),n=this.extractAnimationOptions(),r=this.extractKeyframes();return q`
302
+ `}dispatchTimeredCounterAnimationStart(){this.dispatchEvent(new di("timered-counter-animation-start"))}dispatchTimeredCounterAnimationEnd(){this.dispatchEvent(new di("timered-counter-animation-end"))}};fi.styles=[be],t([pt()],fi.prototype,"partsContainerRect",void 0),t([dt("timered-counter-roller")],fi.prototype,"partsContainer",void 0),fi=t([lt("timered-counter")],fi);const mi=a``;let _i=class extends fi{constructor(){super(...arguments),this.localeNumber=!1,this.localeNumberInstance=new Intl.NumberFormat(this.localeInstance,qt(this.localeNumber)?{}:this.localeNumber),this.localDecimalSeparator="",this.localeGroupingSeparator=""}sampleToString(t){return this.localeNumber?this.localeNumberInstance.format(this.numberAdapter.toNumber(t)):this.numberAdapter.toString(t)}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),s=this.extractAnimationOptions(),r=this.extractKeyframes();return z`
310
303
  <timered-counter-roller
311
304
  class="timered-counter timered-counter-datetime-duration"
312
305
  exportparts="group, part, digit, cell, prefix, suffix, part-suffix"
@@ -316,7 +309,7 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
316
309
  .parentContainerRect=${this.partsContainerRect}
317
310
  .parts=${this.parts}
318
311
  .partPreprocessDataList=${this.partPreprocessDataList}
319
- .animationOptions=${n}
312
+ .animationOptions=${s}
320
313
  .keyframes=${r}
321
314
  .cellStyles=${t}
322
315
  .digitStyles=${e}
@@ -327,20 +320,20 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
327
320
  >
328
321
  <slot name="prefix" slot="prefix"></slot>
329
322
  <slot name="suffix" slot="suffix"></slot>
330
- ${xt(this.parts,((t,e)=>e),((t,e)=>q`<slot
323
+ ${xt(this.parts,((t,e)=>e),((t,e)=>z`<slot
331
324
  name=${`part-suffix-${e}`}
332
325
  slot=${`part-suffix-${e}`}
333
326
  ></slot>`))}
334
327
  </timered-counter-roller>
335
- `}willUpdate(t){if(t.has("localeNumber")||t.has("locale")){this.localeNumberInstance=new Intl.NumberFormat(this.localeInstance,Zt(this.localeNumber)?{}:this.localeNumber);{const e=this.localeNumberInstance.formatToParts(123456.789),i=e.find((t=>"decimal"===t.type))?.value||".",n=e.find((t=>"group"===t.type))?.value||"";if(this.localDecimalSeparator!==i||this.localeGroupingSeparator!==n){this.localDecimalSeparator=i;const e=this.partsOptions;this.partsOptions={...e,decimalSeparator:this.localDecimalSeparator},t.set("partsOptions",e)}}}super.willUpdate(t)}};ir.styles=[...tr.styles,er],t([ht({converter:t=>{if(zt(t))return!1;try{return JSON.parse(t)}catch(t){return!0}},reflect:!0,attribute:"locale-number"})],ir.prototype,"localeNumber",void 0),t([dt()],ir.prototype,"localDecimalSeparator",void 0),t([dt()],ir.prototype,"localeGroupingSeparator",void 0),ir=t([lt("timered-counter-number")],ir);const nr=a``
328
+ `}willUpdate(t){if(t.has("localeNumber")||t.has("locale")){this.localeNumberInstance=new Intl.NumberFormat(this.localeInstance,qt(this.localeNumber)?{}:this.localeNumber);{const e=this.localeNumberInstance.formatToParts(123456.789),i=e.find((t=>"decimal"===t.type))?.value||".",s=e.find((t=>"group"===t.type))?.value||"";if(this.localDecimalSeparator!==i||this.localeGroupingSeparator!==s){this.localDecimalSeparator=i;const e=this.partsOptions;this.partsOptions={...e,decimalSeparator:this.localDecimalSeparator},t.set("partsOptions",e)}}}super.willUpdate(t)}};_i.styles=[...fi.styles,mi],t([ut({converter:t=>{if(Yt(t))return!1;try{return JSON.parse(t)}catch(t){return!0}},reflect:!0,attribute:"locale-number"})],_i.prototype,"localeNumber",void 0),t([pt()],_i.prototype,"localDecimalSeparator",void 0),t([pt()],_i.prototype,"localeGroupingSeparator",void 0),_i=t([lt("timered-counter-number")],_i);const gi=a``
336
329
  /**
337
330
  * @license https://github.com/HarasimowiczKamil/any-base
338
- */;function rr(t,e,i){return n=>function(t,e,i){let n,r,s,{length:o}=i;const a={},l=t.length,c=e.length,u=[];if(!function(t,e){for(const i of t)if(-1===e.indexOf(i))return!1;return!0}(i,t))throw new Error(`Number "${i}" contains of non-alphabetic digits (${t})`);if(Qt(t,e))return i.join("");for(n=0;n<o;n++)a[n]=t.indexOf(i[n]);do{for(r=0,s=0,n=0;n<o;n++)r=r*l+a[n],r>=c?(a[s++]=Math.floor(r/c),r%=c):s>0&&(a[s++]=0);o=s,u.push(e[r])}while(0!==s);return u.reverse().join("")}(t.stringToChars(e),t.stringToChars(i),t.stringToChars(n))}const sr=" ";let or=class extends tr{constructor(){super(...arguments),this.__alphabet="",this.__initialValueString="",this.__valueString="",this.__oldValueString="",this.__partsOptions=null,this.__decimalToAnyBase=rr(this.stringAdapter,"0123456789",this.__alphabet),this.__anyBaseToDecimal=rr(this.stringAdapter,this.__alphabet,"0123456789")}get initialValue(){return super.initialValue}set initialValue(t){if(!qt(t))try{t=t.toString()}catch(e){throw new Error(`value ${t} is not a string.`)}this.__initialValueString=t??"",Bt(this.__initialValueString)?super.initialValue=this.numberAdapter.create(0):(this.__updateAlphabet(this.__valueString,this.__initialValueString),super.initialValue=this.numberAdapter.create(this.__anyBaseToDecimal(this.__initialValueString)),super.value=this.numberAdapter.create(this.__anyBaseToDecimal(this.__valueString)))}get value(){return super.value}set value(t){if(qt(t)){if(this.__valueString===t)return}else try{t=t.toString()}catch(e){throw new Error(`value ${t} is not a string.`)}this.__oldValueString=this.__valueString,this.__valueString=t??"",Bt(this.__valueString)?super.value=this.numberAdapter.create(0):(this.__updateAlphabet(this.__valueString,this.__oldValueString),super.oldValue=this.numberAdapter.create(this.__anyBaseToDecimal(this.__oldValueString)),super.value=this.numberAdapter.create(this.__anyBaseToDecimal(this.__valueString)))}get partsOptions(){return super.partsOptions}set partsOptions(t){this.__partsOptions=t,super.partsOptions={type:"string",fillChar:sr,...this.__partsOptions,digitToChar:{" ":sr,...this.__partsOptions.digitToChar}}}__updateAlphabet(t,e){const i=Bt(t)&&Bt(e)?"":`\0${e??""}${t??""}`,n=new Set(this.stringAdapter.stringToChars(i));this.__alphabet=Array.from(n).sort().join("");const r=this.stringAdapter,s=this.__alphabet;this.__decimalToAnyBase=rr(r,"0123456789",s),this.__anyBaseToDecimal=rr(r,s,"0123456789")}sampleToString(t){return this.__decimalToAnyBase(this.numberAdapter.toString(t))}connectedCallback(){this.__updateAlphabet(this.__valueString,this.__initialValueString),this.initialValue=this.__initialValueString,this.value=this.__valueString,this.partsOptions=this.__partsOptions??{},super.connectedCallback()}};or.styles=[...tr.styles,nr],or=t([lt("timered-counter-string")],or);const ar=36e5,lr=Symbol.for("constructDateFrom");function cr(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&lr in t?t[lr](e):t instanceof Date?new t.constructor(e):new Date(e)}function ur(t,e){return cr(t,t)}function hr(t,e,i){const n=ur(t);return isNaN(e)?cr(t,NaN):e?(n.setDate(n.getDate()+e),n):n}function dr(t,e,i){const n=ur(t);if(isNaN(e))return cr(t,NaN);if(!e)return n;const r=n.getDate(),s=cr(t,n.getTime());s.setMonth(n.getMonth()+e+1,0);return r>=s.getDate()?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}function pr(t,e,i){return cr(t,+ur(t)+e)}function fr(t){const e=ur(t),i=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return i.setUTCFullYear(e.getFullYear()),+t-+i}function gr(t,...e){const i=cr.bind(null,e.find((t=>"object"==typeof t)));return e.map(i)}function mr(t,e){const i=ur(t);return i.setHours(0,0,0,0),i}function _r(t,e){const i=+ur(t)-+ur(e);return i<0?-1:i>0?1:i}function yr(t){return!(!((e=t)instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof t||isNaN(+ur(t)));var e}function vr(t,e,i){const[n,r]=gr(0,t,e),s=br(n,r),o=Math.abs(function(t,e){const[i,n]=gr(0,t,e),r=mr(i),s=mr(n),o=+r-fr(r),a=+s-fr(s);return Math.round((o-a)/864e5)}(n,r));n.setDate(n.getDate()-s*o);const a=s*(o-Number(br(n,r)===-s));return 0===a?0:a}function br(t,e){const i=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return i<0?-1:i>0?1:i}function wr(t){return e=>{const i=(t?Math[t]:Math.trunc)(e);return 0===i?0:i}}function Ar(t,e,i){const[n,r]=gr(0,t,e),s=(+n-+r)/ar;return wr(i?.roundingMethod)(s)}function $r(t,e){return+ur(t)-+ur(e)}function Sr(t,e,i){const n=$r(t,e)/6e4;return wr(i?.roundingMethod)(n)}function xr(t,e){const i=ur(t);return+function(t){const e=ur(t);return e.setHours(23,59,59,999),e}(i)==+function(t){const e=ur(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}(i)}function Nr(t,e,i){const[n,r,s]=gr(0,t,t,e),o=_r(r,s),a=Math.abs(function(t,e){const[i,n]=gr(0,t,e);return 12*(i.getFullYear()-n.getFullYear())+(i.getMonth()-n.getMonth())}(r,s));if(a<1)return 0;1===r.getMonth()&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let l=_r(r,s)===-o;xr(n)&&1===a&&1===_r(n,s)&&(l=!1);const c=o*(a-+l);return 0===c?0:c}function Er(t,e,i){const n=Nr(t,e)/3;return wr(i?.roundingMethod)(n)}function Or(t,e,i){const n=$r(t,e)/1e3;return wr(i?.roundingMethod)(n)}function Cr(t,e,i){const n=vr(t,e)/7;return wr(i?.roundingMethod)(n)}function Pr(t,e,i){const[n,r]=gr(0,t,e),s=_r(n,r),o=Math.abs(function(t,e){const[i,n]=gr(0,t,e);return i.getFullYear()-n.getFullYear()}(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=s*(o-+(_r(n,r)===-s));return 0===a?0:a}function Mr(t,e){return+ur(t)<+ur(e)}function Dr(t,e,i){return hr(t,-e)}function Tr(t,e,i){return function(t,e){return pr(t,e*ar)}(t,-e)}function kr(t,e,i){return pr(t,-e)}function Rr(t,e,i){return function(t,e){const i=ur(t);return i.setTime(i.getTime()+6e4*e),i}(t,-e)}function Ur(t,e,i){return function(t,e){return dr(t,3*e)}(t,-e)}function Ir(t,e,i){return function(t,e){return pr(t,1e3*e)}(t,-e)}function Lr(t,e,i){return function(t,e){return hr(t,7*e)}(t,-e)}function jr(t,e,i){return function(t,e){return dr(t,12*e)}(t,-e)}var Vr;!function(t){t.Millisecond="millisecond",t.Second="second",t.Minute="minute",t.Hour="hour",t.Day="day",t.Week="weekOfYear",t.Month="month",t.Quarter="quarter",t.Year="year"}(Vr||(Vr={}));const Hr={[Vr.Millisecond]:1,[Vr.Second]:1e3,[Vr.Minute]:6e4,[Vr.Hour]:36e5,[Vr.Day]:864e5,[Vr.Week]:6048e5,[Vr.Month]:26298e5,[Vr.Quarter]:78894e5,[Vr.Year]:315576e5},Fr={1:Vr.Millisecond,1e3:Vr.Second,6e4:Vr.Minute,36e5:Vr.Hour,864e5:Vr.Day,6048e5:Vr.Week,26298e5:Vr.Month,78894e5:Vr.Quarter,315576e5:Vr.Year},qr=["era","year","quarter","month","weekOfYear","weekday","day","dayPeriod","hour","minute","second","timeZoneName"];function Br(t,e,i){let n=e;const r={};for(const e of i){let i=0;switch(e){case Vr.Year:i=Pr(n,t),n=jr(n,i);break;case Vr.Quarter:i=Er(n,t),n=Ur(n,i);break;case Vr.Month:i=Nr(n,t),n=dr(n,-i);break;case Vr.Week:i=Cr(n,t),n=Lr(n,i);break;case Vr.Day:i=vr(n,t),n=Dr(n,i);break;case Vr.Hour:i=Ar(n,t),n=Tr(n,i);break;case Vr.Minute:i=Sr(n,t),n=Rr(n,i);break;case Vr.Second:i=Or(n,t),n=Ir(n,i);break;case Vr.Millisecond:i=$r(n,t),n=kr(n,i);break;default:throw new Error(`Unknown duration part: ${e}`)}r[e]=i}return r}function zr(t,e,i){const n=Br(t,e,i);return i.map((t=>n[t]))}const Yr={[Vr.Year]:"Y",[Vr.Month]:"M",[Vr.Week]:"W",[Vr.Day]:"D",[Vr.Hour]:"H",[Vr.Minute]:"M",[Vr.Second]:"S"},Zr=[Vr.Year,Vr.Month,Vr.Week,Vr.Day],Wr=[Vr.Hour,Vr.Minute,Vr.Second];const Qr=a`
331
+ */;function yi(t,e,i){return s=>function(t,e,i){let s,r,n,{length:o}=i;const a={},l=t.length,c=e.length,h=[];if(!function(t,e){for(const i of t)if(-1===e.indexOf(i))return!1;return!0}(i,t))throw new Error(`Number "${i}" contains of non-alphabetic digits (${t})`);if(Kt(t,e))return i.join("");for(s=0;s<o;s++)a[s]=t.indexOf(i[s]);do{for(r=0,n=0,s=0;s<o;s++)r=r*l+a[s],r>=c?(a[n++]=Math.floor(r/c),r%=c):n>0&&(a[n++]=0);o=n,h.push(e[r])}while(0!==n);return h.reverse().join("")}(t.stringToChars(e),t.stringToChars(i),t.stringToChars(s))}const Ai=" ";let bi=class extends fi{constructor(){super(...arguments),this.__alphabet="",this.__initialValueString="",this.__valueString="",this.__oldValueString="",this.__partsOptions=null,this.__decimalToAnyBase=yi(this.stringAdapter,"0123456789",this.__alphabet),this.__anyBaseToDecimal=yi(this.stringAdapter,this.__alphabet,"0123456789")}get initialValue(){return super.initialValue}set initialValue(t){if(!zt(t))try{t=t.toString()}catch(e){throw new Error(`value ${t} is not a string.`)}this.__initialValueString=t??"",Ft(this.__initialValueString)?super.initialValue=this.numberAdapter.create(0):(this.__updateAlphabet(this.__valueString,this.__initialValueString),super.initialValue=this.numberAdapter.create(this.__anyBaseToDecimal(this.__initialValueString)),super.value=this.numberAdapter.create(this.__anyBaseToDecimal(this.__valueString)))}get value(){return super.value}set value(t){if(zt(t)){if(this.__valueString===t)return}else try{t=t.toString()}catch(e){throw new Error(`value ${t} is not a string.`)}this.__oldValueString=this.__valueString,this.__valueString=t??"",Ft(this.__valueString)?super.value=this.numberAdapter.create(0):(this.__updateAlphabet(this.__valueString,this.__oldValueString),super.oldValue=this.numberAdapter.create(this.__anyBaseToDecimal(this.__oldValueString)),super.value=this.numberAdapter.create(this.__anyBaseToDecimal(this.__valueString)))}get partsOptions(){return super.partsOptions}set partsOptions(t){this.__partsOptions=t,super.partsOptions={type:"string",fillChar:Ai,...this.__partsOptions,digitToChar:{" ":Ai,...this.__partsOptions.digitToChar}}}__updateAlphabet(t,e){const i=Ft(t)&&Ft(e)?"":`\0${e??""}${t??""}`,s=new Set(this.stringAdapter.stringToChars(i));this.__alphabet=Array.from(s).sort().join("");const r=this.stringAdapter,n=this.__alphabet;this.__decimalToAnyBase=yi(r,"0123456789",n),this.__anyBaseToDecimal=yi(r,n,"0123456789")}sampleToString(t){return this.__decimalToAnyBase(this.numberAdapter.toString(t))}connectedCallback(){this.__updateAlphabet(this.__valueString,this.__initialValueString),this.initialValue=this.__initialValueString,this.value=this.__valueString,this.partsOptions=this.__partsOptions??{},super.connectedCallback()}};bi.styles=[...fi.styles,gi],bi=t([lt("timered-counter-string")],bi);const $i=36e5,vi=Symbol.for("constructDateFrom");function Si(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&vi in t?t[vi](e):t instanceof Date?new t.constructor(e):new Date(e)}function wi(t,e){return Si(t,t)}function xi(t,e,i){const s=wi(t);return isNaN(e)?Si(t,NaN):e?(s.setDate(s.getDate()+e),s):s}function Ei(t,e,i){const s=wi(t);if(isNaN(e))return Si(t,NaN);if(!e)return s;const r=s.getDate(),n=Si(t,s.getTime());n.setMonth(s.getMonth()+e+1,0);return r>=n.getDate()?n:(s.setFullYear(n.getFullYear(),n.getMonth(),r),s)}function Oi(t,e,i){return Si(t,+wi(t)+e)}function Ci(t){const e=wi(t),i=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return i.setUTCFullYear(e.getFullYear()),+t-+i}function Pi(t,...e){const i=Si.bind(null,e.find((t=>"object"==typeof t)));return e.map(i)}function Di(t,e){const i=wi(t);return i.setHours(0,0,0,0),i}function Ti(t,e){const i=+wi(t)-+wi(e);return i<0?-1:i>0?1:i}function Mi(t){return!(!((e=t)instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof t||isNaN(+wi(t)));var e}function Ni(t,e,i){const[s,r]=Pi(0,t,e),n=ki(s,r),o=Math.abs(function(t,e){const[i,s]=Pi(0,t,e),r=Di(i),n=Di(s),o=+r-Ci(r),a=+n-Ci(n);return Math.round((o-a)/864e5)}(s,r));s.setDate(s.getDate()-n*o);const a=n*(o-Number(ki(s,r)===-n));return 0===a?0:a}function ki(t,e){const i=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return i<0?-1:i>0?1:i}function Ri(t){return e=>{const i=(t?Math[t]:Math.trunc)(e);return 0===i?0:i}}function Ui(t,e,i){const[s,r]=Pi(0,t,e),n=(+s-+r)/$i;return Ri(i?.roundingMethod)(n)}function Ii(t,e){return+wi(t)-+wi(e)}function Li(t,e,i){const s=Ii(t,e)/6e4;return Ri(i?.roundingMethod)(s)}function Vi(t,e){const i=wi(t);return+function(t){const e=wi(t);return e.setHours(23,59,59,999),e}(i)==+function(t){const e=wi(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}(i)}function ji(t,e,i){const[s,r,n]=Pi(0,t,t,e),o=Ti(r,n),a=Math.abs(function(t,e){const[i,s]=Pi(0,t,e);return 12*(i.getFullYear()-s.getFullYear())+(i.getMonth()-s.getMonth())}(r,n));if(a<1)return 0;1===r.getMonth()&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let l=Ti(r,n)===-o;Vi(s)&&1===a&&1===Ti(s,n)&&(l=!1);const c=o*(a-+l);return 0===c?0:c}function Hi(t,e,i){const s=ji(t,e)/3;return Ri(i?.roundingMethod)(s)}function Bi(t,e,i){const s=Ii(t,e)/1e3;return Ri(i?.roundingMethod)(s)}function zi(t,e,i){const s=Ni(t,e)/7;return Ri(i?.roundingMethod)(s)}function Fi(t,e,i){const[s,r]=Pi(0,t,e),n=Ti(s,r),o=Math.abs(function(t,e){const[i,s]=Pi(0,t,e);return i.getFullYear()-s.getFullYear()}(s,r));s.setFullYear(1584),r.setFullYear(1584);const a=n*(o-+(Ti(s,r)===-n));return 0===a?0:a}function Yi(t,e){return+wi(t)<+wi(e)}function Wi(t,e,i){return xi(t,-e)}function qi(t,e,i){return function(t,e){return Oi(t,e*$i)}(t,-e)}function Qi(t,e,i){return Oi(t,-e)}function Ki(t,e,i){return function(t,e){const i=wi(t);return i.setTime(i.getTime()+6e4*e),i}(t,-e)}function Gi(t,e,i){return function(t,e){return Ei(t,3*e)}(t,-e)}function Ji(t,e,i){return function(t,e){return Oi(t,1e3*e)}(t,-e)}function Zi(t,e,i){return function(t,e){return xi(t,7*e)}(t,-e)}function Xi(t,e,i){return function(t,e){return Ei(t,12*e)}(t,-e)}var ts;!function(t){t.Millisecond="millisecond",t.Second="second",t.Minute="minute",t.Hour="hour",t.Day="day",t.Week="weekOfYear",t.Month="month",t.Quarter="quarter",t.Year="year"}(ts||(ts={}));const es={[ts.Millisecond]:1,[ts.Second]:1e3,[ts.Minute]:6e4,[ts.Hour]:36e5,[ts.Day]:864e5,[ts.Week]:6048e5,[ts.Month]:26298e5,[ts.Quarter]:78894e5,[ts.Year]:315576e5},is={1:ts.Millisecond,1e3:ts.Second,6e4:ts.Minute,36e5:ts.Hour,864e5:ts.Day,6048e5:ts.Week,26298e5:ts.Month,78894e5:ts.Quarter,315576e5:ts.Year},ss=["era","year","quarter","month","weekOfYear","weekday","day","dayPeriod","hour","minute","second","timeZoneName"];function rs(t,e,i){let s=e;const r={};for(const e of i){let i=0;switch(e){case ts.Year:i=Fi(s,t),s=Xi(s,i);break;case ts.Quarter:i=Hi(s,t),s=Gi(s,i);break;case ts.Month:i=ji(s,t),s=Ei(s,-i);break;case ts.Week:i=zi(s,t),s=Zi(s,i);break;case ts.Day:i=Ni(s,t),s=Wi(s,i);break;case ts.Hour:i=Ui(s,t),s=qi(s,i);break;case ts.Minute:i=Li(s,t),s=Ki(s,i);break;case ts.Second:i=Bi(s,t),s=Ji(s,i);break;case ts.Millisecond:i=Ii(s,t),s=Qi(s,i);break;default:throw new Error(`Unknown duration part: ${e}`)}r[e]=i}return r}function ns(t,e,i){const s=rs(t,e,i);return i.map((t=>s[t]))}const os={[ts.Year]:"Y",[ts.Month]:"M",[ts.Week]:"W",[ts.Day]:"D",[ts.Hour]:"H",[ts.Minute]:"M",[ts.Second]:"S"},as=[ts.Year,ts.Month,ts.Week,ts.Day],ls=[ts.Hour,ts.Minute,ts.Second];const cs=a`
339
332
  ::part(part-suffix) {
340
333
  font-size: 0.4em;
341
334
  line-height: 1;
342
335
  }
343
- `;function Gr(t,e){qt(t)&&(t=ce(t)),Yt(t)||(t=[t,t]);const i=[Wt(t[0])?t[0]:ur(t[0]),Wt(t[1])?t[1]:ur(t[1])];if(!yr(i[0])||!yr(i[1]))throw new Error(`value ${t[0]} or ${t[1]} is not a valid date.`);const n=Math.abs(i[1].getTime()-function(t,e,i){const n=Hr[i],r=t.getTime(),s=e.getTime();return r-r%n+(Math.abs(s-r)%n>0?(r<s?-1:1)*n:0)+s%n}(i[0],i[1],e));return{durationInMilliseconds:n,from:i[0],to:i[1]}}let Kr=class extends tr{constructor(){super(...arguments),this.__precision=[Vr.Second,Vr.Day],this.__initialValuePlain=null,this.__partsOptions=null,this.__from=new Date,this.__to=new Date,this.__minPrecision=Vr.Second,this.__maxPrecision=Vr.Day,this.__availableDurationParts=[],this.__dateTimeFieldLabels={}}get precision(){return this.__precision}set precision(t){qt(t)&&(t=ce(t)),this.__precision=t,this.__minPrecision=Yt(this.__precision)?this.__precision[0]:this.__precision,this.__maxPrecision=Yt(this.__precision)?this.__precision[1]:this.__precision,this.__availableDurationParts=Object.values(Vr).reverse().map((t=>{const e=Hr[this.__minPrecision],i=Hr[this.__maxPrecision],n=Hr[t];return{type:t,available:n>=e&&n<=i}})).filter((t=>t.available))}get value(){return super.value}set value(t){const{from:e,to:i,durationInMilliseconds:n}=Gr(t,this.__minPrecision);this.__from=e,this.__to=i,super.value=n}get initialValue(){return super.initialValue}set initialValue(t){this.__initialValuePlain=t;const{durationInMilliseconds:e}=Gr(t,this.__minPrecision);super.initialValue=e}get partsOptions(){return super.partsOptions}set partsOptions(t){this.__partsOptions=t,super.partsOptions={minPlaces:[2,void 0],...this.__partsOptions}}sampleSplit(t){const e=jt(this.__availableDurationParts,(t=>t.type)),i=e.map((()=>[]));for(const n of t){const t=this.numberAdapter.toNumber(n);zr(new Date(Math.min(t,0)),new Date(Math.max(t,0)),e).forEach(((t,e)=>i[e].push(t)))}return i}generateAriaLabel(){return function(t){const e=Zr.map((e=>Ft(t[e])?`${t[e]}${Yr[e]}`:"")),i=Wr.map((e=>Ft(t[e])?`${t[e]}${Yr[e]}`:""));return`P${e.join("")}T${i.join("")}`}(Br(Mr(this.__from,this.__to)?this.__from:this.__to,Mr(this.__from,this.__to)?this.__to:this.__from,jt(this.__availableDurationParts,(t=>t.type))))}connectedCallback(){this.role="timer",this.partsOptions=this.__partsOptions??{},this.initialValue=this.__initialValuePlain,this.precision=this.__precision,super.connectedCallback()}willUpdate(t){super.willUpdate(t),t.has("locale")&&(this.__dateTimeFieldLabels=function(t){const e=new Intl.DisplayNames(t,{type:"dateTimeField"});return qr.reduce(((t,i)=>(t[i]=e.of(i)??"",t)),{})}(this.localeInstance))}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),n=this.extractAnimationOptions(),r=this.extractKeyframes(),s=jt(this.__availableDurationParts,(t=>t.type));return q`
336
+ `;function hs(t,e){zt(t)&&(t=ce(t)),Wt(t)||(t=[t,t]);const i=[Qt(t[0])?t[0]:wi(t[0]),Qt(t[1])?t[1]:wi(t[1])];if(!Mi(i[0])||!Mi(i[1]))throw new Error(`value ${t[0]} or ${t[1]} is not a valid date.`);const s=Math.abs(i[1].getTime()-function(t,e,i){const s=es[i],r=t.getTime(),n=e.getTime();return r-r%s+(Math.abs(n-r)%s>0?(r<n?-1:1)*s:0)+n%s}(i[0],i[1],e));return{durationInMilliseconds:s,from:i[0],to:i[1]}}let us=class extends fi{constructor(){super(...arguments),this.__precision=[ts.Second,ts.Day],this.__initialValuePlain=null,this.__partsOptions=null,this.__from=new Date,this.__to=new Date,this.__minPrecision=ts.Second,this.__maxPrecision=ts.Day,this.__availableDurationParts=[],this.__dateTimeFieldLabels={}}get precision(){return this.__precision}set precision(t){zt(t)&&(t=ce(t)),this.__precision=t,this.__minPrecision=Wt(this.__precision)?this.__precision[0]:this.__precision,this.__maxPrecision=Wt(this.__precision)?this.__precision[1]:this.__precision,this.__availableDurationParts=Object.values(ts).reverse().map((t=>{const e=es[this.__minPrecision],i=es[this.__maxPrecision],s=es[t];return{type:t,available:s>=e&&s<=i}})).filter((t=>t.available))}get value(){return super.value}set value(t){const{from:e,to:i,durationInMilliseconds:s}=hs(t,this.__minPrecision);this.__from=e,this.__to=i,super.value=s}get initialValue(){return super.initialValue}set initialValue(t){this.__initialValuePlain=t;const{durationInMilliseconds:e}=hs(t,this.__minPrecision);super.initialValue=e}get partsOptions(){return super.partsOptions}set partsOptions(t){this.__partsOptions=t,super.partsOptions={minPlaces:[2,void 0],...this.__partsOptions}}sampleSplit(t){const e=Vt(this.__availableDurationParts,(t=>t.type)),i=e.map((()=>[]));for(const s of t){const t=this.numberAdapter.toNumber(s);ns(new Date(Math.min(t,0)),new Date(Math.max(t,0)),e).forEach(((t,e)=>i[e].push(t)))}return i}generateAriaLabel(){return function(t){const e=as.map((e=>Bt(t[e])?`${t[e]}${os[e]}`:"")),i=ls.map((e=>Bt(t[e])?`${t[e]}${os[e]}`:""));return`P${e.join("")}T${i.join("")}`}(rs(Yi(this.__from,this.__to)?this.__from:this.__to,Yi(this.__from,this.__to)?this.__to:this.__from,Vt(this.__availableDurationParts,(t=>t.type))))}connectedCallback(){this.role="timer",this.partsOptions=this.__partsOptions??{},this.initialValue=this.__initialValuePlain,this.precision=this.__precision,super.connectedCallback()}willUpdate(t){super.willUpdate(t),t.has("locale")&&(this.__dateTimeFieldLabels=function(t){const e=new Intl.DisplayNames(t,{type:"dateTimeField"});return ss.reduce(((t,i)=>(t[i]=e.of(i)??"",t)),{})}(this.localeInstance))}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),s=this.extractAnimationOptions(),r=this.extractKeyframes(),n=Vt(this.__availableDurationParts,(t=>t.type));return z`
344
337
  <timered-counter-roller
345
338
  class="timered-counter timered-counter-datetime-duration"
346
339
  exportparts="group, part, digit, cell, prefix, suffix, part-suffix"
@@ -350,7 +343,7 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
350
343
  .parentContainerRect=${this.partsContainerRect}
351
344
  .parts=${this.parts}
352
345
  .partPreprocessDataList=${this.partPreprocessDataList}
353
- .animationOptions=${n}
346
+ .animationOptions=${s}
354
347
  .keyframes=${r}
355
348
  .cellStyles=${t}
356
349
  .digitStyles=${e}
@@ -359,9 +352,9 @@ function pt(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
359
352
  @roller-animation-start=${this.dispatchTimeredCounterAnimationStart}
360
353
  @roller-animation-end=${this.dispatchTimeredCounterAnimationEnd}
361
354
  ><slot name="prefix" slot="prefix"></slot
362
- ><slot name="suffix" slot="suffix"></slot>${xt(this.parts,((t,e)=>e),((t,e)=>q`<span slot=${`part-suffix-${e}`} class="duration-unit"
363
- >${this.__dateTimeFieldLabels[s[e]]}</span
355
+ ><slot name="suffix" slot="suffix"></slot>${xt(this.parts,((t,e)=>e),((t,e)=>z`<span slot=${`part-suffix-${e}`} class="duration-unit"
356
+ >${this.__dateTimeFieldLabels[n[e]]}</span
364
357
  >`))}
365
358
  </timered-counter-roller>
366
- `}};Kr.styles=[...tr.styles,Qr],t([ht({reflect:!0,converter:t=>zt(t)?t:ce(t)})],Kr.prototype,"precision",null),Kr=t([lt("timered-counter-datetime-duration")],Kr);const Jr=t=>t;function Xr(t,e){rn.setNumberAdapter(t,e)}function ts(t){rn.setStringAdapter(t)}export{Hr as DurationPartMillisecond,Fr as DurationPartMillisecondToType,Vr as DurationPartType,tr as TimeredCounter,Kr as TimeredCounterDatetimeDuration,ir as TimeredCounterNumber,or as TimeredCounterString,mn as cubicBezier,Ln as easeInBack,zn as easeInBounce,Rn as easeInCirc,$n as easeInCubic,Hn as easeInElastic,Dn as easeInExpo,Vn as easeInOutBack,Yn as easeInOutBounce,In as easeInOutCirc,xn as easeInOutCubic,qn as easeInOutElastic,kn as easeInOutExpo,An as easeInOutQuad,On as easeInOutQuart,Mn as easeInOutQuint,vn as easeInOutSine,bn as easeInQuad,Nn as easeInQuart,Cn as easeInQuint,_n as easeInSine,jn as easeOutBack,Bn as easeOutBounce,Un as easeOutCirc,Sn as easeOutCubic,Fn as easeOutElastic,Tn as easeOutExpo,wn as easeOutQuad,En as easeOutQuart,Pn as easeOutQuint,yn as easeOutSine,Jr as linear,fn as noop,Xr as setNumberAdapter,ts as setStringAdapter};
359
+ `}};us.styles=[...fi.styles,cs],t([ut({reflect:!0,converter:t=>Yt(t)?t:ce(t)})],us.prototype,"precision",null),us=t([lt("timered-counter-datetime-duration")],us);const ps=t=>t;export{es as DurationPartMillisecond,is as DurationPartMillisecondToType,ts as DurationPartType,fi as TimeredCounter,fe as TimeredCounterAdapter,us as TimeredCounterDatetimeDuration,_i as TimeredCounterNumber,bi as TimeredCounterString,De as cubicBezier,Ze as easeInBack,ni as easeInBounce,Ke as easeInCirc,Ie as easeInCubic,ei as easeInElastic,We as easeInExpo,ti as easeInOutBack,oi as easeInOutBounce,Je as easeInOutCirc,Ve as easeInOutCubic,si as easeInOutElastic,Qe as easeInOutExpo,Ue as easeInOutQuad,Be as easeInOutQuart,Ye as easeInOutQuint,Ne as easeInOutSine,ke as easeInQuad,je as easeInQuart,ze as easeInQuint,Te as easeInSine,Xe as easeOutBack,ri as easeOutBounce,Ge as easeOutCirc,Le as easeOutCubic,ii as easeOutElastic,qe as easeOutExpo,Re as easeOutQuad,He as easeOutQuart,Fe as easeOutQuint,Me as easeOutSine,ps as linear,Ce as noop,ge as registerNumberAdapter,ye as registerStringAdapter,me as setNumberAdapter,_e as setStringAdapter};
367
360
  //# sourceMappingURL=timered-counter.esm-browser.js.map