@everymatrix/lottery-game-page 1.87.28 → 1.87.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/general-multi-select_16.cjs.entry.js +466 -69
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/lottery-game-page.cjs.js +1 -1
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +50 -68
- package/dist/collection/models/index.js +10 -0
- package/dist/collection/utils/api.js +33 -0
- package/dist/collection/utils/locale.utils.js +7 -5
- package/dist/collection/utils/utils.js +26 -0
- package/dist/esm/general-multi-select_16.entry.js +466 -69
- package/dist/esm/loader.js +1 -1
- package/dist/esm/lottery-game-page.js +1 -1
- package/dist/lottery-game-page/general-multi-select_16.entry.js +25 -25
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +17 -5
- package/dist/types/components.d.ts +9 -0
- package/dist/types/models/index.d.ts +106 -0
- package/dist/types/utils/api.d.ts +6 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ const I=globalThis,z=I.ShadowRoot&&(void 0===I.ShadyCSS||I.ShadyCSS.nativeShadow
|
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/,{is:F,defineProperty:j,getOwnPropertyDescriptor:R,getOwnPropertyNames:L,getOwnPropertySymbols:W
|
|
22
|
+
*/,{is:F,defineProperty:j,getOwnPropertyDescriptor:R,getOwnPropertyNames:L,getOwnPropertySymbols:$,getPrototypeOf:W}=Object,H=globalThis,G=H.trustedTypes,U=G?G.emptyScript:"",V=H.reactiveElementPolyfillSupport,q={toAttribute(t,e){switch(e){case Boolean:t=t?U: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}},Y=(t,e)=>!F(t,e),J={attribute:!0,type:String,converter:q,reflect:!1,useDefault:!1,hasChanged:Y};null!=Symbol.metadata||(Symbol.metadata=Symbol("metadata")),null!=H.litPropertyMetadata||(H.litPropertyMetadata=new WeakMap);let K=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),(null!=(e=this.l)?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=J){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&j(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){var s;const{get:r,set:o}=null!=(s=R(this.prototype,t))?s:{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const s=null==r?void 0:r.call(this);null==o||o.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return null!=(e=this.elementProperties.get(t))?e:J}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;const t=W(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){const t=this.properties,e=[...L(t),...$(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(E(t))}else void 0!==t&&e.push(E(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(){var t;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach((t=>t(this)))}addController(t){var e,i;(null!=(e=this._$EO)?e:this._$EO=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(i=t.hostConnected)||i.call(t))}removeController(t){var e;null==(e=this._$EO)||e.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(){var t;const e=null!=(t=this.shadowRoot)?t:this.attachShadow(this.constructor.shadowRootOptions);return O(e,this.constructor.elementStyles),e}connectedCallback(){var t;null!=this.renderRoot||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var i;const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(void 0!==r&&!0===s.reflect){const o=(void 0!==(null==(i=s.converter)?void 0:i.toAttribute)?s.converter:q).toAttribute(e,s.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var i,s,r;const o=this.constructor,n=o._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=o.getPropertyOptions(n),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(i=t.converter)?void 0:i.fromAttribute)?t.converter:q;this._$Em=n;const l=a.fromAttribute(e,t.type);this[n]=null!=(r=null!=l?l:null==(s=this._$Ej)?void 0:s.get(n))?r:l,this._$Em=null}}requestUpdate(t,e,i,s=!1,r){var o,n;if(void 0!==t){const a=this.constructor;if(!1===s&&(r=this[t]),null!=i||(i=a.getPropertyOptions(t)),!((null!=(o=i.hasChanged)?o:Y)(r,e)||i.useDefault&&i.reflect&&r===(null==(n=this._$Ej)?void 0:n.get(t))&&!this.hasAttribute(a._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:r},o){var n,a,l;i&&!(null!=(n=this._$Ej)?n:this._$Ej=new Map).has(t)&&(this._$Ej.set(t,null!=(a=null!=o?o:e)?a:this[t]),!0!==r||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(null!=(l=this._$Eq)?l:this._$Eq=new Set).add(t))}_$EP(){return T(this,null,(function*(){this.isUpdatePending=!0;try{yield this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&(yield t),!this.isUpdatePending}))}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(null!=this.renderRoot||(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){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)})),this.update(i)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach((t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(t){}firstUpdated(t){}};var Z;K.elementStyles=[],K.shadowRootOptions={mode:"open"},K.elementProperties=new Map,K.finalized=new Map,null==V||V({ReactiveElement:K}),(null!=(Z=H.reactiveElementVersions)?Z:H.reactiveElementVersions=[]).push("2.1.2");
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
@@ -41,7 +41,7 @@ const Rt=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
43
43
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
44
|
-
*/,Lt=[]
|
|
44
|
+
*/,Lt=[],$t=new Set,Wt=new Set;function Ht(t){return t&&Object.prototype.hasOwnProperty.call(t,"__themes")}function Gt(t,e){return(t||"").split(" ").some((t=>new RegExp(`^${t.split("*").join(".*")}$`,"u").test(e)))}function Ut(t){return t.map((t=>t.cssText)).join("\n")}const Vt="vaadin-themable-mixin-style";function qt(t){t.prototype instanceof Ot?t.elementStyles=t.finalizeStyles(t.styles):t.prototype._template.content.getElementById(Vt).textContent=Ut(t.getStylesForThis()),Wt.forEach((e=>{const i=customElements.get(e);i!==t&&i.prototype instanceof t&&qt(i)}))}function Yt(t,e,i={}){e=function(t=[]){return[t].flat(1/0).filter((t=>t instanceof P||(console.warn("An item in styles is not of type CSSResult. Use `unsafeCSS` or `css`."),!1)))}(e),window.Vaadin&&window.Vaadin.styleModules?window.Vaadin.styleModules.registerStyles(t,e,i):Lt.push({themeFor:t,styles:e,include:i.include,moduleId:i.moduleId}),t&&Wt.forEach((i=>{if(Gt(t,i)&&function(t){return Ht(customElements.get(t))}(i)){const t=customElements.get(i);!function(t,e){const i=t.__themes;return!(!i||!e)&&i.some((t=>t.styles.some((t=>e.some((e=>e.cssText===t.cssText))))))}(t,e)?(!window.Vaadin||!window.Vaadin.suppressPostFinalizeStylesWarning)&&console.warn(`The custom element definition for "${i}" was finalized before a style module was registered. Ideally, import component specific style modules before importing the corresponding custom element. This warning can be suppressed by setting "window.Vaadin.suppressPostFinalizeStylesWarning = true".`):console.warn(`Registering styles that already exist for ${i}`),qt(t),function(t){$t.forEach((e=>{const i=e.deref();i instanceof t?function(t){if(!t.shadowRoot)return;const e=t.constructor;t instanceof Ot?([...t.shadowRoot.querySelectorAll("style")].forEach((t=>t.remove())),O(t.shadowRoot,e.elementStyles)):t.shadowRoot.getElementById(Vt).textContent=e.prototype._template.content.getElementById(Vt).textContent}(i):i||$t.delete(e)}))}(t)}}))}function Jt(){return window.Vaadin&&window.Vaadin.styleModules?window.Vaadin.styleModules.getAllThemes():Lt}function Kt(t=""){let e=0;return t.startsWith("lumo-")||t.startsWith("material-")?e=1:t.startsWith("vaadin-")&&(e=2),e}function Zt(t){const e=[];return t.include&&[].concat(t.include).forEach((t=>{const i=Jt().find((e=>e.moduleId===t));i?e.push(...Zt(i),...i.styles):console.warn(`Included moduleId ${t} not found in style registry`)}),t.styles),e}function Xt(t){const e=`${t}-default-theme`,i=Jt().filter((i=>i.moduleId!==e&&Gt(i.themeFor,t))).map((t=>C(_({},t),{styles:[...Zt(t),...t.styles],includePriority:Kt(t.moduleId)}))).sort(((t,e)=>e.includePriority-t.includePriority));return i.length>0?i:Jt().filter((t=>t.moduleId===e))}const Qt=t=>class extends(Rt(t)){constructor(){super(),$t.add(new WeakRef(this))}static finalize(){if(super.finalize(),this.is&&Wt.add(this.is),this.elementStyles)return;const t=this.prototype._template;!t||Ht(this)||function(t,e){const i=document.createElement("style");i.id=Vt,i.textContent=Ut(t),e.content.appendChild(i)}(this.getStylesForThis(),t)}static finalizeStyles(t){const e=this.getStylesForThis();return t?[...[t].flat(1/0),...e]:e}static getStylesForThis(){const e=t.__themes||[],i=Object.getPrototypeOf(this.prototype);this.__themes=[...e,...(i?i.constructor.__themes:[])||[],...Xt(this.is)];const s=this.__themes.flatMap((t=>t.styles));return s.filter(((t,e)=>e===s.lastIndexOf(t)))}}
|
|
45
45
|
/**
|
|
46
46
|
* @license
|
|
47
47
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -928,7 +928,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
928
928
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
929
929
|
Code distributed by Google as part of the polymer project is also
|
|
930
930
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
931
|
-
*/;function
|
|
931
|
+
*/;function $e(t){return t.indexOf(".")>=0}function We(t){let e=t.indexOf(".");return-1===e?t:t.slice(0,e)}function He(t,e){return 0===t.indexOf(e+".")}function Ge(t,e){return 0===e.indexOf(t+".")}function Ue(t,e,i){return e+i.slice(t.length)}function Ve(t){if(Array.isArray(t)){let e=[];for(let i=0;i<t.length;i++){let s=t[i].toString().split(".");for(let t=0;t<s.length;t++)e.push(s[t])}return e.join(".")}return t}function qe(t){return Array.isArray(t)?Ve(t).split("."):t.toString().split(".")}function Ye(t,e,i){let s=t,r=qe(e);for(let t=0;t<r.length;t++){if(!s)return;s=s[r[t]]}return i&&(i.path=r.join(".")),s}function Je(t,e,i){let s=t,r=qe(e),o=r[r.length-1];if(r.length>1){for(let t=0;t<r.length-1;t++)if(s=s[r[t]],!s)return;s[o]=i}else s[e]=i;return r.join(".")}
|
|
932
932
|
/**
|
|
933
933
|
@license
|
|
934
934
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -966,7 +966,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
966
966
|
* be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
|
|
967
967
|
* Google as part of the polymer project is also subject to an additional IP
|
|
968
968
|
* rights grant found at http://polymer.github.io/PATENTS.txt
|
|
969
|
-
*/let Si=0;const Ti=[],Di={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"},Ai="__computeInfo",Ii=/[A-Z]/;function zi(t,e,i){let s=t[e];if(s){if(!t.hasOwnProperty(e)&&(s=t[e]=Object.create(t[e]),i))for(let t in s){let e=s[t],i=s[t]=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]}}else s=t[e]={};return s}function Mi(t,e,i,s,r,o){if(e){let n=!1;const a=Si++;for(let l in i){let h=e[r?$e(l):l];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==a)&&(!r||Pi(l,e.trigger))&&(e.info&&(e.info.lastRun=a),e.fn(t,l,i,s,e.info,r,o),n=!0)}return n}return!1}function Ni(t,e,i,s,r,o,n,a){let l=!1,h=e[n?$e(s):s];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==i)&&(!n||Pi(s,e.trigger))&&(e.info&&(e.info.lastRun=i),e.fn(t,s,r,o,e.info,n,a),l=!0);return l}function Pi(t,e){if(e){let i=e.name;return i==t||!(!e.structured||!He(i,t))||!(!e.wildcard||!Ge(i,t))}return!0}function Bi(t,e,i,s,r){let o="string"==typeof r.method?t[r.method]:r.method,n=r.property;o?o.call(t,t.__data[n],s[n]):r.dynamicFn||console.warn("observer method `"+r.method+"` not defined")}function Oi(t,e,i){let s=$e(e);return s!==e&&(Ei(t,ti(s)+"-changed",i[e],e),!0)}function Ei(t,e,i,s){let r={value:i,queueProperty:!0};s&&(r.path=s),Le(t).dispatchEvent(new CustomEvent(e,{detail:r}))}function Fi(t,e,i,s,r,o){let n=(o?$e(e):e)!=e?e:null,a=n?Ye(t,n):t.__data[e];n&&void 0===a&&(a=i[e]),Ei(t,r.eventName,a,n)}function ji(t,e,i,s,r){let o=t.__data[e];ue&&(o=ue(o,r.attrName,"attribute",t)),t._propertyToAttribute(e,r.attrName,o)}const Ri=(t,e,i)=>{let s=0,r=e.length-1,o=-1;for(;s<=r;){const n=s+r>>1,a=i.get(e[n].methodInfo)-i.get(t.methodInfo);if(a<0)s=n+1;else{if(!(a>0)){o=n;break}r=n-1}}o<0&&(o=r+1),e.splice(o,0,t)},Li=(t,e,i,s,r)=>{const o=e[r?$e(t):t];if(o)for(let e=0;e<o.length;e++){const n=o[e];n.info.lastRun!==Si&&(!r||Pi(t,n.trigger))&&(n.info.lastRun=Si,Ri(n.info,i,s))}};function Wi(t,e,i,s,r){let o=Yi(t,e,i,0,r);if(o===Ti)return!1;let n=r.methodInfo;return t.__dataHasAccessor&&t.__dataHasAccessor[n]?t._setPendingProperty(n,o,!0):(t[n]=o,!1)}function $i(t,e,i,s,r,o,n){i.bindings=i.bindings||[];let a={kind:s,target:r,parts:o,literal:n,isCompound:1!==o.length};if(i.bindings.push(a),function(t){return!!t.target&&"attribute"!=t.kind&&"text"!=t.kind&&!t.isCompound&&"{"===t.parts[0].mode}(a)){let{event:t,negate:e}=a.parts[0];a.listenerEvent=t||ti(r)+"-changed",a.listenerNegate=e}let l=e.nodeInfoList.length;for(let i=0;i<a.parts.length;i++){let s=a.parts[i];s.compoundIndex=i,Hi(t,e,a,s,l)}}function Hi(t,e,i,s,r){if(!s.literal)if("attribute"===i.kind&&"-"===i.target[0])console.warn("Cannot set attribute "+i.target+' because "-" is not a valid attribute starting character');else{let o=s.dependencies,n={index:r,binding:i,part:s,evaluator:t};for(let i=0;i<o.length;i++){let s=o[i];"string"==typeof s&&(s=es(s),s.wildcard=!0),t._addTemplatePropertyEffect(e,s.rootProperty,{fn:Gi,info:n,trigger:s})}}}function Gi(t,e,i,s,r,o,n){let a=n[r.index],l=r.binding,h=r.part;if(o&&h.source&&e.length>h.source.length&&"property"==l.kind&&!l.isCompound&&a.__isPropertyEffectsClient&&a.__dataHasAccessor&&a.__dataHasAccessor[l.target]){let s=i[e];e=Ue(h.source,l.target,e),a._setPendingPropertyOrPath(e,s,!1,!0)&&t._enqueueClient(a)}else{let n=r.evaluator._evaluateBinding(t,h,e,i,s,o);n!==Ti&&function(t,e,i,s,r){if(r=function(t,e,i,s){if(i.isCompound){let r=t.__dataCompoundStorage[i.target];r[s.compoundIndex]=e,e=r.join("")}return"attribute"!==i.kind&&("textContent"===i.target||"value"===i.target&&("input"===t.localName||"textarea"===t.localName))&&(e=null==e?"":e),e}(e,r,i,s),ue&&(r=ue(r,i.target,i.kind,e)),"attribute"==i.kind)t._valueToNodeAttribute(e,r,i.target);else{let s=i.target;e.__isPropertyEffectsClient&&e.__dataHasAccessor&&e.__dataHasAccessor[s]?(!e[Di.READ_ONLY]||!e[Di.READ_ONLY][s])&&e._setPendingProperty(s,r)&&t._enqueueClient(e):t._setUnmanagedPropertyToNode(e,s,r)}}(t,a,l,h,n)}}function Ui(t,e){if(e.isCompound){let i=t.__dataCompoundStorage||(t.__dataCompoundStorage={}),s=e.parts,r=new Array(s.length);for(let t=0;t<s.length;t++)r[t]=s[t].literal;let o=e.target;i[o]=r,e.literal&&"property"==e.kind&&("className"===o&&(t=Le(t)),t[o]=e.literal)}}function Vi(t,e,i){if(i.listenerEvent){let s=i.parts[0];t.addEventListener(i.listenerEvent,(function(t){!function(t,e,i,s,r){let o,n=t.detail,a=n&&n.path;a?(s=Ue(i,s,a),o=n&&n.value):o=t.currentTarget[i],o=r?!o:o,(!e[Di.READ_ONLY]||!e[Di.READ_ONLY][s])&&e._setPendingPropertyOrPath(s,o,!0,!!a)&&(!n||!n.queueProperty)&&e._invalidateProperties()}(t,e,i.target,s.source,s.negate)}))}}function qi(t,e,i,s,r,o){let n={methodName:e.methodName,args:e.args,methodInfo:r,dynamicFn:o=e.static||o&&("object"!=typeof o||o[e.methodName])};for(let r,o=0;o<e.args.length&&(r=e.args[o]);o++)r.literal||t._addPropertyEffect(r.rootProperty,i,{fn:s,info:n,trigger:r});return o&&t._addPropertyEffect(e.methodName,i,{fn:s,info:n}),n}function Yi(t,e,i,s,r){let o=t._methodHost||t,n=o[r.methodName];if(n){let s=t._marshalArgs(r.args,e,i);return s===Ti?Ti:n.apply(o,s)}r.dynamicFn||console.warn("method `"+r.methodName+"` not defined")}const Ji=[],Ki="(?:[a-zA-Z_$][\\w.:$\\-*]*)",Zi="(?:("+Ki+"|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\")))\\s*)",Xi=new RegExp("(\\[\\[|{{)\\s*(?:(!)\\s*)?("+Ki+"\\s*(?:\\(\\s*(?:(?:"+Zi+"(?:,\\s*"+Zi+")*)?)\\)\\s*)?)(?:]]|}})","g");function Qi(t){let e="";for(let i=0;i<t.length;i++)e+=t[i].literal||"";return e}function ts(t){let e=t.match(/([^\s]+?)\(([\s\S]*)\)/);if(e){let t={methodName:e[1],static:!0,args:Ji};return e[2].trim()?function(t,e){return e.args=t.map((function(t){let i=es(t);return i.literal||(e.static=!1),i}),this),e}(e[2].replace(/\\,/g,",").split(","),t):t}return null}function es(t){let e=t.trim().replace(/,/g,",").replace(/\\(.)/g,"$1"),i={name:e,value:"",literal:!1},s=e[0];switch("-"===s&&(s=e[1]),s>="0"&&s<="9"&&(s="#"),s){case"'":case'"':i.value=e.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(e),i.literal=!0}return i.literal||(i.rootProperty=$e(e),i.structured=We(e),i.structured&&(i.wildcard=".*"==e.slice(-2),i.wildcard&&(i.name=e.slice(0,-2)))),i}function is(t,e,i){let s=Ye(t,i);return void 0===s&&(s=e[i]),s}function ss(t,e,i,s){const r={indexSplices:s};ge&&!t._overrideLegacyUndefined&&(e.splices=r),t.notifyPath(i+".splices",r),t.notifyPath(i+".length",e.length),ge&&!t._overrideLegacyUndefined&&(r.indexSplices=[])}function rs(t,e,i,s,r,o){ss(t,e,i,[{index:s,addedCount:r,removed:o,object:e,type:"splice"}])}const os=Se((t=>{const e=Ci(mi(t));return class extends e{constructor(){super(),this.__isPropertyEffectsClient=!0}get PROPERTY_EFFECT_TYPES(){return Di}_initializeProperties(){super._initializeProperties(),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_registerHost(){if(ns.length){let t=ns[ns.length-1];t._enqueueClient(this),this.__dataHost=t}}_initializeProtoProperties(t){this.__data=Object.create(t),this.__dataPending=Object.create(t),this.__dataOld={}}_initializeInstanceProperties(t){let e=this[Di.READ_ONLY];for(let i in t)(!e||!e[i])&&(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=t[i])}_addPropertyEffect(t,e,i){this._createPropertyAccessor(t,e==Di.READ_ONLY);let s=zi(this,e,!0)[t];s||(s=this[e][t]=[]),s.push(i)}_removePropertyEffect(t,e,i){let s=zi(this,e,!0)[t],r=s.indexOf(i);r>=0&&s.splice(r,1)}_hasPropertyEffect(t,e){let i=this[e];return!(!i||!i[t])}_hasReadOnlyEffect(t){return this._hasPropertyEffect(t,Di.READ_ONLY)}_hasNotifyEffect(t){return this._hasPropertyEffect(t,Di.NOTIFY)}_hasReflectEffect(t){return this._hasPropertyEffect(t,Di.REFLECT)}_hasComputedEffect(t){return this._hasPropertyEffect(t,Di.COMPUTE)}_setPendingPropertyOrPath(t,e,i,s){if(s||$e(Array.isArray(t)?t[0]:t)!==t){if(!s){let i=Ye(this,t);if(!(t=Je(this,t,e))||!super._shouldPropertyChange(t,e,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(t,e,i))return function(t,e,i){let s=t.__dataLinkedPaths;if(s){let r;for(let o in s){let n=s[o];Ge(o,e)?(r=Ue(o,n,e),t._setPendingPropertyOrPath(r,i,!0,!0)):Ge(n,e)&&(r=Ue(n,o,e),t._setPendingPropertyOrPath(r,i,!0,!0))}}}(this,t,e),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[t])return this._setPendingProperty(t,e,i);this[t]=e}return!1}_setUnmanagedPropertyToNode(t,e,i){(i!==t[e]||"object"==typeof i)&&("className"===e&&(t=Le(t)),t[e]=i)}_setPendingProperty(t,e,i){let s=this.__dataHasPaths&&We(t);return!!this._shouldPropertyChange(t,e,(s?this.__dataTemp:this.__data)[t])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),t in this.__dataOld||(this.__dataOld[t]=this.__data[t]),s?this.__dataTemp[t]=e:this.__data[t]=e,this.__dataPending[t]=e,(s||this[Di.NOTIFY]&&this[Di.NOTIFY][t])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[t]=i),!0)}_setProperty(t,e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(t){this.__dataPendingClients=this.__dataPendingClients||[],t!==this&&this.__dataPendingClients.push(t)}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let t=this.__dataPendingClients;if(t){this.__dataPendingClients=null;for(let e=0;e<t.length;e++){let i=t[e];i.__dataEnabled?i.__dataPending&&i._flushProperties():i._enableProperties()}}}_readyClients(){this.__enableOrFlushClients()}setProperties(t,e){for(let i in t)(e||!this[Di.READ_ONLY]||!this[Di.READ_ONLY][i])&&this._setPendingPropertyOrPath(i,t[i],!0);this._invalidateProperties()}ready(){this._flushProperties(),this.__dataClientsReady||this._flushClients(),this.__dataPending&&this._flushProperties()}_propertiesChanged(t,e,i){let s,r=this.__dataHasPaths;this.__dataHasPaths=!1,function(t,e,i,s){let r=t[Di.COMPUTE];if(r)if(ye){Si++;const o=function(t){let e=t.constructor.__orderedComputedDeps;if(!e){e=new Map;const i=t[Di.COMPUTE];let s,{counts:r,ready:o,total:n}=function(t){const e=t[Ai],i={},s=t[Di.COMPUTE],r=[];let o=0;for(let t in e){const s=e[t];o+=i[t]=s.args.filter((t=>!t.literal)).length+(s.dynamicFn?1:0)}for(let t in s)e[t]||r.push(t);return{counts:i,ready:r,total:o}}(t);for(;s=o.shift();){e.set(s,e.size);const t=i[s];t&&t.forEach((t=>{const e=t.info.methodInfo;--n,0==--r[e]&&o.push(e)}))}0!==n&&console.warn(`Computed graph for ${t.localName} incomplete; circular?`),t.constructor.__orderedComputedDeps=e}return e}(t),n=[];for(let t in e)Li(t,r,n,o,s);let a;for(;a=n.shift();)Wi(t,"",e,0,a)&&Li(a.methodInfo,r,n,o,s);Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),t.__dataPending=null}else{let o=e;for(;Mi(t,r,o,i,s);)Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),o=t.__dataPending,t.__dataPending=null}}(this,e,i,r),s=this.__dataToNotify,this.__dataToNotify=null,this._propagatePropertyChanges(e,i,r),this._flushClients(),Mi(this,this[Di.REFLECT],e,i,r),Mi(this,this[Di.OBSERVE],e,i,r),s&&function(t,e,i,s,r){let o,n,a=t[Di.NOTIFY],l=Si++;for(let n in e)e[n]&&(a&&Ni(t,a,l,n,i,s,r)||r&&Oi(t,n,i))&&(o=!0);o&&(n=t.__dataHost)&&n._invalidateProperties&&n._invalidateProperties()}(this,s,e,i,r),1==this.__dataCounter&&(this.__dataTemp={})}_propagatePropertyChanges(t,e,i){this[Di.PROPAGATE]&&Mi(this,this[Di.PROPAGATE],t,e,i),this.__templateInfo&&this._runEffectsForTemplate(this.__templateInfo,t,e,i)}_runEffectsForTemplate(t,e,i,s){const r=(e,s)=>{Mi(this,t.propertyEffects,e,i,s,t.nodeList);for(let r=t.firstChild;r;r=r.nextSibling)this._runEffectsForTemplate(r,e,i,s)};t.runEffects?t.runEffects(r,e,s):r(e,s)}linkPaths(t,e){t=Ve(t),e=Ve(e),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[t]=e}unlinkPaths(t){t=Ve(t),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[t]}notifySplices(t,e){let i={path:""};ss(this,Ye(this,t,i),i.path,e)}get(t,e){return Ye(e||this,t)}set(t,e,i){i?Je(i,t,e):(!this[Di.READ_ONLY]||!this[Di.READ_ONLY][t])&&this._setPendingPropertyOrPath(t,e,!0)&&this._invalidateProperties()}push(t,...e){let i={path:""},s=Ye(this,t,i),r=s.length,o=s.push(...e);return e.length&&rs(this,s,i.path,r,e.length,[]),o}pop(t){let e={path:""},i=Ye(this,t,e),s=!!i.length,r=i.pop();return s&&rs(this,i,e.path,i.length,0,[r]),r}splice(t,e,i,...s){let r,o={path:""},n=Ye(this,t,o);return e<0?e=n.length-Math.floor(-e):e&&(e=Math.floor(e)),r=2===arguments.length?n.splice(e):n.splice(e,i,...s),(s.length||r.length)&&rs(this,n,o.path,e,s.length,r),r}shift(t){let e={path:""},i=Ye(this,t,e),s=!!i.length,r=i.shift();return s&&rs(this,i,e.path,0,0,[r]),r}unshift(t,...e){let i={path:""},s=Ye(this,t,i),r=s.unshift(...e);return e.length&&rs(this,s,i.path,0,e.length,[]),r}notifyPath(t,e){let i;if(1==arguments.length){let s={path:""};e=Ye(this,t,s),i=s.path}else i=Array.isArray(t)?Ve(t):t;this._setPendingPropertyOrPath(i,e,!0,!0)&&this._invalidateProperties()}_createReadOnlyProperty(t,e){this._addPropertyEffect(t,Di.READ_ONLY),e&&(this["_set"+function(t){return t[0].toUpperCase()+t.substring(1)}(t)]=function(e){this._setProperty(t,e)})}_createPropertyObserver(t,e,i){let s={property:t,method:e,dynamicFn:!!i};this._addPropertyEffect(t,Di.OBSERVE,{fn:Bi,info:s,trigger:{name:t}}),i&&this._addPropertyEffect(e,Di.OBSERVE,{fn:Bi,info:s,trigger:{name:e}})}_createMethodObserver(t,e){let i=ts(t);if(!i)throw new Error("Malformed observer expression '"+t+"'");qi(this,i,Di.OBSERVE,Yi,null,e)}_createNotifyingProperty(t){this._addPropertyEffect(t,Di.NOTIFY,{fn:Fi,info:{eventName:ti(t)+"-changed",property:t}})}_createReflectedProperty(t){let e=this.constructor.attributeNameForProperty(t);"-"===e[0]?console.warn("Property "+t+" cannot be reflected to attribute "+e+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(t,Di.REFLECT,{fn:ji,info:{attrName:e}})}_createComputedProperty(t,e,i){let s=ts(e);if(!s)throw new Error("Malformed computed expression '"+e+"'");const r=qi(this,s,Di.COMPUTE,Wi,t,i);zi(this,Ai)[t]=r}_marshalArgs(t,e,i){const s=this.__data,r=[];for(let o=0,n=t.length;o<n;o++){let{name:n,structured:a,wildcard:l,value:h,literal:c}=t[o];if(!c)if(l){const t=Ge(n,e),r=is(s,i,t?e:n);h={path:t?e:n,value:r,base:t?Ye(s,n):r}}else h=a?is(s,i,n):s[n];if(ge&&!this._overrideLegacyUndefined&&void 0===h&&t.length>1)return Ti;r[o]=h}return r}static addPropertyEffect(t,e,i){this.prototype._addPropertyEffect(t,e,i)}static createPropertyObserver(t,e,i){this.prototype._createPropertyObserver(t,e,i)}static createMethodObserver(t,e){this.prototype._createMethodObserver(t,e)}static createNotifyingProperty(t){this.prototype._createNotifyingProperty(t)}static createReadOnlyProperty(t,e){this.prototype._createReadOnlyProperty(t,e)}static createReflectedProperty(t){this.prototype._createReflectedProperty(t)}static createComputedProperty(t,e,i){this.prototype._createComputedProperty(t,e,i)}static bindTemplate(t){return this.prototype._bindTemplate(t)}_bindTemplate(t,e){let i=this.constructor._parseTemplate(t),s=this.__preBoundTemplateInfo==i;if(!s)for(let t in i.propertyEffects)this._createPropertyAccessor(t);if(e)if(i=Object.create(i),i.wasPreBound=s,this.__templateInfo){const e=t._parentTemplateInfo||this.__templateInfo,s=e.lastChild;i.parent=e,e.lastChild=i,i.previousSibling=s,s?s.nextSibling=i:e.firstChild=i}else this.__templateInfo=i;else this.__preBoundTemplateInfo=i;return i}static _addTemplatePropertyEffect(t,e,i){(t.hostProps=t.hostProps||{})[e]=!0;let s=t.propertyEffects=t.propertyEffects||{};(s[e]=s[e]||[]).push(i)}_stampTemplate(t,e){e=e||this._bindTemplate(t,!0),ns.push(this);let i=super._stampTemplate(t,e);if(ns.pop(),e.nodeList=i.nodeList,!e.wasPreBound){let t=e.childNodes=[];for(let e=i.firstChild;e;e=e.nextSibling)t.push(e)}return i.templateInfo=e,function(t,e){let{nodeList:i,nodeInfoList:s}=e;if(s.length)for(let e=0;e<s.length;e++){let r=i[e],o=s[e].bindings;if(o)for(let e=0;e<o.length;e++){let i=o[e];Ui(r,i),Vi(r,t,i)}r.__dataHost=t}}(this,e),this.__dataClientsReady&&(this._runEffectsForTemplate(e,this.__data,null,!1),this._flushClients()),i}_removeBoundDom(t){const e=t.templateInfo,{previousSibling:i,nextSibling:s,parent:r}=e;i?i.nextSibling=s:r&&(r.firstChild=s),s?s.previousSibling=i:r&&(r.lastChild=i),e.nextSibling=e.previousSibling=null;let o=e.childNodes;for(let t=0;t<o.length;t++){let e=o[t];Le(Le(e).parentNode).removeChild(e)}}static _parseTemplateNode(t,i,s){let r=e._parseTemplateNode.call(this,t,i,s);if(t.nodeType===Node.TEXT_NODE){let e=this._parseBindings(t.textContent,i);e&&(t.textContent=Qi(e)||" ",$i(this,i,s,"text","textContent",e),r=!0)}return r}static _parseTemplateNodeAttribute(t,i,s,r,o){let n=this._parseBindings(o,i);if(n){let e=r,o="property";Ii.test(r)?o="attribute":"$"==r[r.length-1]&&(r=r.slice(0,-1),o="attribute");let a=Qi(n);return a&&"attribute"==o&&("class"==r&&t.hasAttribute("class")&&(a+=" "+t.getAttribute(r)),t.setAttribute(r,a)),"attribute"==o&&"disable-upgrade$"==e&&t.setAttribute(r,""),"input"===t.localName&&"value"===e&&t.setAttribute(e,""),t.removeAttribute(e),"property"===o&&(r=Qe(r)),$i(this,i,s,o,r,n,a),!0}return e._parseTemplateNodeAttribute.call(this,t,i,s,r,o)}static _parseTemplateNestedTemplate(t,i,s){let r=e._parseTemplateNestedTemplate.call(this,t,i,s);const o=t.parentNode,n=s.templateInfo,a="dom-if"===o.localName;we&&(a||"dom-repeat"===o.localName)&&(o.removeChild(t),(s=s.parentInfo).templateInfo=n,s.noted=!0,r=!1);let l=n.hostProps;if(xe&&a)l&&(i.hostProps=Object.assign(i.hostProps||{},l),we||(s.parentInfo.noted=!0));else{let t="{";for(let e in l)$i(this,i,s,"property","_host_"+e,[{mode:t,source:e,dependencies:[e],hostProp:!0}])}return r}static _parseBindings(t,e){let i,s=[],r=0;for(;null!==(i=Xi.exec(t));){i.index>r&&s.push({literal:t.slice(r,i.index)});let o=i[1][0],n=!!i[2],a=i[3].trim(),l=!1,h="",c=-1;"{"==o&&(c=a.indexOf("::"))>0&&(h=a.substring(c+2),a=a.substring(0,c),l=!0);let d=ts(a),u=[];if(d){let{args:t,methodName:i}=d;for(let e=0;e<t.length;e++){let i=t[e];i.literal||u.push(i)}let s=e.dynamicFns;(s&&s[i]||d.static)&&(u.push(i),d.dynamicFn=!0)}else u.push(a);s.push({source:a,mode:o,negate:n,customEvent:l,signature:d,dependencies:u,event:h}),r=Xi.lastIndex}if(r&&r<t.length){let e=t.substring(r);e&&s.push({literal:e})}return s.length?s:null}static _evaluateBinding(t,e,i,s,r,o){let n;return n=e.signature?Yi(t,i,s,0,e.signature):i!=e.source?Ye(t,e.source):o&&We(i)?Ye(t,i):t.__data[i],e.negate&&(n=!n),n}}})),ns=[],as=Se((t=>{const e=ci(t);function i(t){const e=Object.getPrototypeOf(t);return e.prototype instanceof r?e:null}function s(t){if(!t.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",t))){let e=null;if(t.hasOwnProperty(JSCompiler_renameProperty("properties",t))){const i=t.properties;i&&(e=
|
|
969
|
+
*/let Si=0;const Ti=[],Di={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"},Ai="__computeInfo",Ii=/[A-Z]/;function zi(t,e,i){let s=t[e];if(s){if(!t.hasOwnProperty(e)&&(s=t[e]=Object.create(t[e]),i))for(let t in s){let e=s[t],i=s[t]=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]}}else s=t[e]={};return s}function Mi(t,e,i,s,r,o){if(e){let n=!1;const a=Si++;for(let l in i){let h=e[r?We(l):l];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==a)&&(!r||Pi(l,e.trigger))&&(e.info&&(e.info.lastRun=a),e.fn(t,l,i,s,e.info,r,o),n=!0)}return n}return!1}function Ni(t,e,i,s,r,o,n,a){let l=!1,h=e[n?We(s):s];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==i)&&(!n||Pi(s,e.trigger))&&(e.info&&(e.info.lastRun=i),e.fn(t,s,r,o,e.info,n,a),l=!0);return l}function Pi(t,e){if(e){let i=e.name;return i==t||!(!e.structured||!He(i,t))||!(!e.wildcard||!Ge(i,t))}return!0}function Bi(t,e,i,s,r){let o="string"==typeof r.method?t[r.method]:r.method,n=r.property;o?o.call(t,t.__data[n],s[n]):r.dynamicFn||console.warn("observer method `"+r.method+"` not defined")}function Oi(t,e,i){let s=We(e);return s!==e&&(Ei(t,ti(s)+"-changed",i[e],e),!0)}function Ei(t,e,i,s){let r={value:i,queueProperty:!0};s&&(r.path=s),Le(t).dispatchEvent(new CustomEvent(e,{detail:r}))}function Fi(t,e,i,s,r,o){let n=(o?We(e):e)!=e?e:null,a=n?Ye(t,n):t.__data[e];n&&void 0===a&&(a=i[e]),Ei(t,r.eventName,a,n)}function ji(t,e,i,s,r){let o=t.__data[e];ue&&(o=ue(o,r.attrName,"attribute",t)),t._propertyToAttribute(e,r.attrName,o)}const Ri=(t,e,i)=>{let s=0,r=e.length-1,o=-1;for(;s<=r;){const n=s+r>>1,a=i.get(e[n].methodInfo)-i.get(t.methodInfo);if(a<0)s=n+1;else{if(!(a>0)){o=n;break}r=n-1}}o<0&&(o=r+1),e.splice(o,0,t)},Li=(t,e,i,s,r)=>{const o=e[r?We(t):t];if(o)for(let e=0;e<o.length;e++){const n=o[e];n.info.lastRun!==Si&&(!r||Pi(t,n.trigger))&&(n.info.lastRun=Si,Ri(n.info,i,s))}};function $i(t,e,i,s,r){let o=Yi(t,e,i,0,r);if(o===Ti)return!1;let n=r.methodInfo;return t.__dataHasAccessor&&t.__dataHasAccessor[n]?t._setPendingProperty(n,o,!0):(t[n]=o,!1)}function Wi(t,e,i,s,r,o,n){i.bindings=i.bindings||[];let a={kind:s,target:r,parts:o,literal:n,isCompound:1!==o.length};if(i.bindings.push(a),function(t){return!!t.target&&"attribute"!=t.kind&&"text"!=t.kind&&!t.isCompound&&"{"===t.parts[0].mode}(a)){let{event:t,negate:e}=a.parts[0];a.listenerEvent=t||ti(r)+"-changed",a.listenerNegate=e}let l=e.nodeInfoList.length;for(let i=0;i<a.parts.length;i++){let s=a.parts[i];s.compoundIndex=i,Hi(t,e,a,s,l)}}function Hi(t,e,i,s,r){if(!s.literal)if("attribute"===i.kind&&"-"===i.target[0])console.warn("Cannot set attribute "+i.target+' because "-" is not a valid attribute starting character');else{let o=s.dependencies,n={index:r,binding:i,part:s,evaluator:t};for(let i=0;i<o.length;i++){let s=o[i];"string"==typeof s&&(s=es(s),s.wildcard=!0),t._addTemplatePropertyEffect(e,s.rootProperty,{fn:Gi,info:n,trigger:s})}}}function Gi(t,e,i,s,r,o,n){let a=n[r.index],l=r.binding,h=r.part;if(o&&h.source&&e.length>h.source.length&&"property"==l.kind&&!l.isCompound&&a.__isPropertyEffectsClient&&a.__dataHasAccessor&&a.__dataHasAccessor[l.target]){let s=i[e];e=Ue(h.source,l.target,e),a._setPendingPropertyOrPath(e,s,!1,!0)&&t._enqueueClient(a)}else{let n=r.evaluator._evaluateBinding(t,h,e,i,s,o);n!==Ti&&function(t,e,i,s,r){if(r=function(t,e,i,s){if(i.isCompound){let r=t.__dataCompoundStorage[i.target];r[s.compoundIndex]=e,e=r.join("")}return"attribute"!==i.kind&&("textContent"===i.target||"value"===i.target&&("input"===t.localName||"textarea"===t.localName))&&(e=null==e?"":e),e}(e,r,i,s),ue&&(r=ue(r,i.target,i.kind,e)),"attribute"==i.kind)t._valueToNodeAttribute(e,r,i.target);else{let s=i.target;e.__isPropertyEffectsClient&&e.__dataHasAccessor&&e.__dataHasAccessor[s]?(!e[Di.READ_ONLY]||!e[Di.READ_ONLY][s])&&e._setPendingProperty(s,r)&&t._enqueueClient(e):t._setUnmanagedPropertyToNode(e,s,r)}}(t,a,l,h,n)}}function Ui(t,e){if(e.isCompound){let i=t.__dataCompoundStorage||(t.__dataCompoundStorage={}),s=e.parts,r=new Array(s.length);for(let t=0;t<s.length;t++)r[t]=s[t].literal;let o=e.target;i[o]=r,e.literal&&"property"==e.kind&&("className"===o&&(t=Le(t)),t[o]=e.literal)}}function Vi(t,e,i){if(i.listenerEvent){let s=i.parts[0];t.addEventListener(i.listenerEvent,(function(t){!function(t,e,i,s,r){let o,n=t.detail,a=n&&n.path;a?(s=Ue(i,s,a),o=n&&n.value):o=t.currentTarget[i],o=r?!o:o,(!e[Di.READ_ONLY]||!e[Di.READ_ONLY][s])&&e._setPendingPropertyOrPath(s,o,!0,!!a)&&(!n||!n.queueProperty)&&e._invalidateProperties()}(t,e,i.target,s.source,s.negate)}))}}function qi(t,e,i,s,r,o){let n={methodName:e.methodName,args:e.args,methodInfo:r,dynamicFn:o=e.static||o&&("object"!=typeof o||o[e.methodName])};for(let r,o=0;o<e.args.length&&(r=e.args[o]);o++)r.literal||t._addPropertyEffect(r.rootProperty,i,{fn:s,info:n,trigger:r});return o&&t._addPropertyEffect(e.methodName,i,{fn:s,info:n}),n}function Yi(t,e,i,s,r){let o=t._methodHost||t,n=o[r.methodName];if(n){let s=t._marshalArgs(r.args,e,i);return s===Ti?Ti:n.apply(o,s)}r.dynamicFn||console.warn("method `"+r.methodName+"` not defined")}const Ji=[],Ki="(?:[a-zA-Z_$][\\w.:$\\-*]*)",Zi="(?:("+Ki+"|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\")))\\s*)",Xi=new RegExp("(\\[\\[|{{)\\s*(?:(!)\\s*)?("+Ki+"\\s*(?:\\(\\s*(?:(?:"+Zi+"(?:,\\s*"+Zi+")*)?)\\)\\s*)?)(?:]]|}})","g");function Qi(t){let e="";for(let i=0;i<t.length;i++)e+=t[i].literal||"";return e}function ts(t){let e=t.match(/([^\s]+?)\(([\s\S]*)\)/);if(e){let t={methodName:e[1],static:!0,args:Ji};return e[2].trim()?function(t,e){return e.args=t.map((function(t){let i=es(t);return i.literal||(e.static=!1),i}),this),e}(e[2].replace(/\\,/g,",").split(","),t):t}return null}function es(t){let e=t.trim().replace(/,/g,",").replace(/\\(.)/g,"$1"),i={name:e,value:"",literal:!1},s=e[0];switch("-"===s&&(s=e[1]),s>="0"&&s<="9"&&(s="#"),s){case"'":case'"':i.value=e.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(e),i.literal=!0}return i.literal||(i.rootProperty=We(e),i.structured=$e(e),i.structured&&(i.wildcard=".*"==e.slice(-2),i.wildcard&&(i.name=e.slice(0,-2)))),i}function is(t,e,i){let s=Ye(t,i);return void 0===s&&(s=e[i]),s}function ss(t,e,i,s){const r={indexSplices:s};ge&&!t._overrideLegacyUndefined&&(e.splices=r),t.notifyPath(i+".splices",r),t.notifyPath(i+".length",e.length),ge&&!t._overrideLegacyUndefined&&(r.indexSplices=[])}function rs(t,e,i,s,r,o){ss(t,e,i,[{index:s,addedCount:r,removed:o,object:e,type:"splice"}])}const os=Se((t=>{const e=Ci(mi(t));return class extends e{constructor(){super(),this.__isPropertyEffectsClient=!0}get PROPERTY_EFFECT_TYPES(){return Di}_initializeProperties(){super._initializeProperties(),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_registerHost(){if(ns.length){let t=ns[ns.length-1];t._enqueueClient(this),this.__dataHost=t}}_initializeProtoProperties(t){this.__data=Object.create(t),this.__dataPending=Object.create(t),this.__dataOld={}}_initializeInstanceProperties(t){let e=this[Di.READ_ONLY];for(let i in t)(!e||!e[i])&&(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=t[i])}_addPropertyEffect(t,e,i){this._createPropertyAccessor(t,e==Di.READ_ONLY);let s=zi(this,e,!0)[t];s||(s=this[e][t]=[]),s.push(i)}_removePropertyEffect(t,e,i){let s=zi(this,e,!0)[t],r=s.indexOf(i);r>=0&&s.splice(r,1)}_hasPropertyEffect(t,e){let i=this[e];return!(!i||!i[t])}_hasReadOnlyEffect(t){return this._hasPropertyEffect(t,Di.READ_ONLY)}_hasNotifyEffect(t){return this._hasPropertyEffect(t,Di.NOTIFY)}_hasReflectEffect(t){return this._hasPropertyEffect(t,Di.REFLECT)}_hasComputedEffect(t){return this._hasPropertyEffect(t,Di.COMPUTE)}_setPendingPropertyOrPath(t,e,i,s){if(s||We(Array.isArray(t)?t[0]:t)!==t){if(!s){let i=Ye(this,t);if(!(t=Je(this,t,e))||!super._shouldPropertyChange(t,e,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(t,e,i))return function(t,e,i){let s=t.__dataLinkedPaths;if(s){let r;for(let o in s){let n=s[o];Ge(o,e)?(r=Ue(o,n,e),t._setPendingPropertyOrPath(r,i,!0,!0)):Ge(n,e)&&(r=Ue(n,o,e),t._setPendingPropertyOrPath(r,i,!0,!0))}}}(this,t,e),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[t])return this._setPendingProperty(t,e,i);this[t]=e}return!1}_setUnmanagedPropertyToNode(t,e,i){(i!==t[e]||"object"==typeof i)&&("className"===e&&(t=Le(t)),t[e]=i)}_setPendingProperty(t,e,i){let s=this.__dataHasPaths&&$e(t);return!!this._shouldPropertyChange(t,e,(s?this.__dataTemp:this.__data)[t])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),t in this.__dataOld||(this.__dataOld[t]=this.__data[t]),s?this.__dataTemp[t]=e:this.__data[t]=e,this.__dataPending[t]=e,(s||this[Di.NOTIFY]&&this[Di.NOTIFY][t])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[t]=i),!0)}_setProperty(t,e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(t){this.__dataPendingClients=this.__dataPendingClients||[],t!==this&&this.__dataPendingClients.push(t)}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let t=this.__dataPendingClients;if(t){this.__dataPendingClients=null;for(let e=0;e<t.length;e++){let i=t[e];i.__dataEnabled?i.__dataPending&&i._flushProperties():i._enableProperties()}}}_readyClients(){this.__enableOrFlushClients()}setProperties(t,e){for(let i in t)(e||!this[Di.READ_ONLY]||!this[Di.READ_ONLY][i])&&this._setPendingPropertyOrPath(i,t[i],!0);this._invalidateProperties()}ready(){this._flushProperties(),this.__dataClientsReady||this._flushClients(),this.__dataPending&&this._flushProperties()}_propertiesChanged(t,e,i){let s,r=this.__dataHasPaths;this.__dataHasPaths=!1,function(t,e,i,s){let r=t[Di.COMPUTE];if(r)if(ye){Si++;const o=function(t){let e=t.constructor.__orderedComputedDeps;if(!e){e=new Map;const i=t[Di.COMPUTE];let s,{counts:r,ready:o,total:n}=function(t){const e=t[Ai],i={},s=t[Di.COMPUTE],r=[];let o=0;for(let t in e){const s=e[t];o+=i[t]=s.args.filter((t=>!t.literal)).length+(s.dynamicFn?1:0)}for(let t in s)e[t]||r.push(t);return{counts:i,ready:r,total:o}}(t);for(;s=o.shift();){e.set(s,e.size);const t=i[s];t&&t.forEach((t=>{const e=t.info.methodInfo;--n,0==--r[e]&&o.push(e)}))}0!==n&&console.warn(`Computed graph for ${t.localName} incomplete; circular?`),t.constructor.__orderedComputedDeps=e}return e}(t),n=[];for(let t in e)Li(t,r,n,o,s);let a;for(;a=n.shift();)$i(t,"",e,0,a)&&Li(a.methodInfo,r,n,o,s);Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),t.__dataPending=null}else{let o=e;for(;Mi(t,r,o,i,s);)Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),o=t.__dataPending,t.__dataPending=null}}(this,e,i,r),s=this.__dataToNotify,this.__dataToNotify=null,this._propagatePropertyChanges(e,i,r),this._flushClients(),Mi(this,this[Di.REFLECT],e,i,r),Mi(this,this[Di.OBSERVE],e,i,r),s&&function(t,e,i,s,r){let o,n,a=t[Di.NOTIFY],l=Si++;for(let n in e)e[n]&&(a&&Ni(t,a,l,n,i,s,r)||r&&Oi(t,n,i))&&(o=!0);o&&(n=t.__dataHost)&&n._invalidateProperties&&n._invalidateProperties()}(this,s,e,i,r),1==this.__dataCounter&&(this.__dataTemp={})}_propagatePropertyChanges(t,e,i){this[Di.PROPAGATE]&&Mi(this,this[Di.PROPAGATE],t,e,i),this.__templateInfo&&this._runEffectsForTemplate(this.__templateInfo,t,e,i)}_runEffectsForTemplate(t,e,i,s){const r=(e,s)=>{Mi(this,t.propertyEffects,e,i,s,t.nodeList);for(let r=t.firstChild;r;r=r.nextSibling)this._runEffectsForTemplate(r,e,i,s)};t.runEffects?t.runEffects(r,e,s):r(e,s)}linkPaths(t,e){t=Ve(t),e=Ve(e),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[t]=e}unlinkPaths(t){t=Ve(t),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[t]}notifySplices(t,e){let i={path:""};ss(this,Ye(this,t,i),i.path,e)}get(t,e){return Ye(e||this,t)}set(t,e,i){i?Je(i,t,e):(!this[Di.READ_ONLY]||!this[Di.READ_ONLY][t])&&this._setPendingPropertyOrPath(t,e,!0)&&this._invalidateProperties()}push(t,...e){let i={path:""},s=Ye(this,t,i),r=s.length,o=s.push(...e);return e.length&&rs(this,s,i.path,r,e.length,[]),o}pop(t){let e={path:""},i=Ye(this,t,e),s=!!i.length,r=i.pop();return s&&rs(this,i,e.path,i.length,0,[r]),r}splice(t,e,i,...s){let r,o={path:""},n=Ye(this,t,o);return e<0?e=n.length-Math.floor(-e):e&&(e=Math.floor(e)),r=2===arguments.length?n.splice(e):n.splice(e,i,...s),(s.length||r.length)&&rs(this,n,o.path,e,s.length,r),r}shift(t){let e={path:""},i=Ye(this,t,e),s=!!i.length,r=i.shift();return s&&rs(this,i,e.path,0,0,[r]),r}unshift(t,...e){let i={path:""},s=Ye(this,t,i),r=s.unshift(...e);return e.length&&rs(this,s,i.path,0,e.length,[]),r}notifyPath(t,e){let i;if(1==arguments.length){let s={path:""};e=Ye(this,t,s),i=s.path}else i=Array.isArray(t)?Ve(t):t;this._setPendingPropertyOrPath(i,e,!0,!0)&&this._invalidateProperties()}_createReadOnlyProperty(t,e){this._addPropertyEffect(t,Di.READ_ONLY),e&&(this["_set"+function(t){return t[0].toUpperCase()+t.substring(1)}(t)]=function(e){this._setProperty(t,e)})}_createPropertyObserver(t,e,i){let s={property:t,method:e,dynamicFn:!!i};this._addPropertyEffect(t,Di.OBSERVE,{fn:Bi,info:s,trigger:{name:t}}),i&&this._addPropertyEffect(e,Di.OBSERVE,{fn:Bi,info:s,trigger:{name:e}})}_createMethodObserver(t,e){let i=ts(t);if(!i)throw new Error("Malformed observer expression '"+t+"'");qi(this,i,Di.OBSERVE,Yi,null,e)}_createNotifyingProperty(t){this._addPropertyEffect(t,Di.NOTIFY,{fn:Fi,info:{eventName:ti(t)+"-changed",property:t}})}_createReflectedProperty(t){let e=this.constructor.attributeNameForProperty(t);"-"===e[0]?console.warn("Property "+t+" cannot be reflected to attribute "+e+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(t,Di.REFLECT,{fn:ji,info:{attrName:e}})}_createComputedProperty(t,e,i){let s=ts(e);if(!s)throw new Error("Malformed computed expression '"+e+"'");const r=qi(this,s,Di.COMPUTE,$i,t,i);zi(this,Ai)[t]=r}_marshalArgs(t,e,i){const s=this.__data,r=[];for(let o=0,n=t.length;o<n;o++){let{name:n,structured:a,wildcard:l,value:h,literal:c}=t[o];if(!c)if(l){const t=Ge(n,e),r=is(s,i,t?e:n);h={path:t?e:n,value:r,base:t?Ye(s,n):r}}else h=a?is(s,i,n):s[n];if(ge&&!this._overrideLegacyUndefined&&void 0===h&&t.length>1)return Ti;r[o]=h}return r}static addPropertyEffect(t,e,i){this.prototype._addPropertyEffect(t,e,i)}static createPropertyObserver(t,e,i){this.prototype._createPropertyObserver(t,e,i)}static createMethodObserver(t,e){this.prototype._createMethodObserver(t,e)}static createNotifyingProperty(t){this.prototype._createNotifyingProperty(t)}static createReadOnlyProperty(t,e){this.prototype._createReadOnlyProperty(t,e)}static createReflectedProperty(t){this.prototype._createReflectedProperty(t)}static createComputedProperty(t,e,i){this.prototype._createComputedProperty(t,e,i)}static bindTemplate(t){return this.prototype._bindTemplate(t)}_bindTemplate(t,e){let i=this.constructor._parseTemplate(t),s=this.__preBoundTemplateInfo==i;if(!s)for(let t in i.propertyEffects)this._createPropertyAccessor(t);if(e)if(i=Object.create(i),i.wasPreBound=s,this.__templateInfo){const e=t._parentTemplateInfo||this.__templateInfo,s=e.lastChild;i.parent=e,e.lastChild=i,i.previousSibling=s,s?s.nextSibling=i:e.firstChild=i}else this.__templateInfo=i;else this.__preBoundTemplateInfo=i;return i}static _addTemplatePropertyEffect(t,e,i){(t.hostProps=t.hostProps||{})[e]=!0;let s=t.propertyEffects=t.propertyEffects||{};(s[e]=s[e]||[]).push(i)}_stampTemplate(t,e){e=e||this._bindTemplate(t,!0),ns.push(this);let i=super._stampTemplate(t,e);if(ns.pop(),e.nodeList=i.nodeList,!e.wasPreBound){let t=e.childNodes=[];for(let e=i.firstChild;e;e=e.nextSibling)t.push(e)}return i.templateInfo=e,function(t,e){let{nodeList:i,nodeInfoList:s}=e;if(s.length)for(let e=0;e<s.length;e++){let r=i[e],o=s[e].bindings;if(o)for(let e=0;e<o.length;e++){let i=o[e];Ui(r,i),Vi(r,t,i)}r.__dataHost=t}}(this,e),this.__dataClientsReady&&(this._runEffectsForTemplate(e,this.__data,null,!1),this._flushClients()),i}_removeBoundDom(t){const e=t.templateInfo,{previousSibling:i,nextSibling:s,parent:r}=e;i?i.nextSibling=s:r&&(r.firstChild=s),s?s.previousSibling=i:r&&(r.lastChild=i),e.nextSibling=e.previousSibling=null;let o=e.childNodes;for(let t=0;t<o.length;t++){let e=o[t];Le(Le(e).parentNode).removeChild(e)}}static _parseTemplateNode(t,i,s){let r=e._parseTemplateNode.call(this,t,i,s);if(t.nodeType===Node.TEXT_NODE){let e=this._parseBindings(t.textContent,i);e&&(t.textContent=Qi(e)||" ",Wi(this,i,s,"text","textContent",e),r=!0)}return r}static _parseTemplateNodeAttribute(t,i,s,r,o){let n=this._parseBindings(o,i);if(n){let e=r,o="property";Ii.test(r)?o="attribute":"$"==r[r.length-1]&&(r=r.slice(0,-1),o="attribute");let a=Qi(n);return a&&"attribute"==o&&("class"==r&&t.hasAttribute("class")&&(a+=" "+t.getAttribute(r)),t.setAttribute(r,a)),"attribute"==o&&"disable-upgrade$"==e&&t.setAttribute(r,""),"input"===t.localName&&"value"===e&&t.setAttribute(e,""),t.removeAttribute(e),"property"===o&&(r=Qe(r)),Wi(this,i,s,o,r,n,a),!0}return e._parseTemplateNodeAttribute.call(this,t,i,s,r,o)}static _parseTemplateNestedTemplate(t,i,s){let r=e._parseTemplateNestedTemplate.call(this,t,i,s);const o=t.parentNode,n=s.templateInfo,a="dom-if"===o.localName;we&&(a||"dom-repeat"===o.localName)&&(o.removeChild(t),(s=s.parentInfo).templateInfo=n,s.noted=!0,r=!1);let l=n.hostProps;if(xe&&a)l&&(i.hostProps=Object.assign(i.hostProps||{},l),we||(s.parentInfo.noted=!0));else{let t="{";for(let e in l)Wi(this,i,s,"property","_host_"+e,[{mode:t,source:e,dependencies:[e],hostProp:!0}])}return r}static _parseBindings(t,e){let i,s=[],r=0;for(;null!==(i=Xi.exec(t));){i.index>r&&s.push({literal:t.slice(r,i.index)});let o=i[1][0],n=!!i[2],a=i[3].trim(),l=!1,h="",c=-1;"{"==o&&(c=a.indexOf("::"))>0&&(h=a.substring(c+2),a=a.substring(0,c),l=!0);let d=ts(a),u=[];if(d){let{args:t,methodName:i}=d;for(let e=0;e<t.length;e++){let i=t[e];i.literal||u.push(i)}let s=e.dynamicFns;(s&&s[i]||d.static)&&(u.push(i),d.dynamicFn=!0)}else u.push(a);s.push({source:a,mode:o,negate:n,customEvent:l,signature:d,dependencies:u,event:h}),r=Xi.lastIndex}if(r&&r<t.length){let e=t.substring(r);e&&s.push({literal:e})}return s.length?s:null}static _evaluateBinding(t,e,i,s,r,o){let n;return n=e.signature?Yi(t,i,s,0,e.signature):i!=e.source?Ye(t,e.source):o&&$e(i)?Ye(t,i):t.__data[i],e.negate&&(n=!n),n}}})),ns=[],as=Se((t=>{const e=ci(t);function i(t){const e=Object.getPrototypeOf(t);return e.prototype instanceof r?e:null}function s(t){if(!t.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",t))){let e=null;if(t.hasOwnProperty(JSCompiler_renameProperty("properties",t))){const i=t.properties;i&&(e=
|
|
970
970
|
/**
|
|
971
971
|
@license
|
|
972
972
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1507,7 +1507,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
1507
1507
|
* @license
|
|
1508
1508
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1509
1509
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1510
|
-
*/;function Ls(t){const e=[];let i;return"slot"===t.localName?i=t.assignedElements():(e.push(t),i=[...t.children]),i.forEach((t=>e.push(...Ls(t)))),e}function
|
|
1510
|
+
*/;function Ls(t){const e=[];let i;return"slot"===t.localName?i=t.assignedElements():(e.push(t),i=[...t.children]),i.forEach((t=>e.push(...Ls(t)))),e}function $s(t){return t?new Set(t.split(" ")):new Set}function Ws(t){return t?[...t].join(" "):""}function Hs(t,e,i){const s=$s(t.getAttribute(e));s.add(i),t.setAttribute(e,Ws(s))}
|
|
1511
1511
|
/**
|
|
1512
1512
|
* @license
|
|
1513
1513
|
* Copyright (c) 2023 - 2024 Vaadin Ltd.
|
|
@@ -1563,18 +1563,18 @@ const Fr=Se((t=>class extends t{get _keyboardActive(){return Ir()}ready(){this.a
|
|
|
1563
1563
|
* @license
|
|
1564
1564
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1565
1565
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1566
|
-
*/,Rr=Se((t=>class extends(Fr(jr(t))){static get properties(){return{autofocus:{type:Boolean},focusElement:{type:Object,readOnly:!0,observer:"_focusElementChanged"},_lastTabIndex:{value:0}}}constructor(){super(),this._boundOnBlur=this._onBlur.bind(this),this._boundOnFocus=this._onFocus.bind(this)}ready(){super.ready(),this.autofocus&&!this.disabled&&requestAnimationFrame((()=>{this.focus(),this.setAttribute("focus-ring","")}))}focus(){this.focusElement&&!this.disabled&&this.focusElement.focus()}blur(){this.focusElement&&this.focusElement.blur()}click(){this.focusElement&&!this.disabled&&this.focusElement.click()}_focusElementChanged(t,e){t?(t.disabled=this.disabled,this._addFocusListeners(t),this.__forwardTabIndex(this.tabindex)):e&&this._removeFocusListeners(e)}_addFocusListeners(t){t.addEventListener("blur",this._boundOnBlur),t.addEventListener("focus",this._boundOnFocus)}_removeFocusListeners(t){t.removeEventListener("blur",this._boundOnBlur),t.removeEventListener("focus",this._boundOnFocus)}_onFocus(t){t.stopPropagation(),this.dispatchEvent(new Event("focus"))}_onBlur(t){t.stopPropagation(),this.dispatchEvent(new Event("blur"))}_shouldSetFocus(t){return t.target===this.focusElement}_shouldRemoveFocus(t){return t.target===this.focusElement}_disabledChanged(t,e){super._disabledChanged(t,e),this.focusElement&&(this.focusElement.disabled=t),t&&this.blur()}_tabindexChanged(t){this.__forwardTabIndex(t)}__forwardTabIndex(t){void 0!==t&&this.focusElement&&(this.focusElement.tabIndex=t,-1!==t&&(this.tabindex=void 0)),this.disabled&&t&&(-1!==t&&(this._lastTabIndex=t),this.tabindex=void 0)}})),Lr=Se((t=>class extends t{static get properties(){return{stateTarget:{type:Object,observer:"_stateTargetChanged"}}}static get delegateAttrs(){return[]}static get delegateProps(){return[]}ready(){super.ready(),this._createDelegateAttrsObserver(),this._createDelegatePropsObserver()}_stateTargetChanged(t){t&&(this._ensureAttrsDelegated(),this._ensurePropsDelegated())}_createDelegateAttrsObserver(){this._createMethodObserver(`_delegateAttrsChanged(${this.constructor.delegateAttrs.join(", ")})`)}_createDelegatePropsObserver(){this._createMethodObserver(`_delegatePropsChanged(${this.constructor.delegateProps.join(", ")})`)}_ensureAttrsDelegated(){this.constructor.delegateAttrs.forEach((t=>{this._delegateAttribute(t,this[t])}))}_ensurePropsDelegated(){this.constructor.delegateProps.forEach((t=>{this._delegateProperty(t,this[t])}))}_delegateAttrsChanged(...t){this.constructor.delegateAttrs.forEach(((e,i)=>{this._delegateAttribute(e,t[i])}))}_delegatePropsChanged(...t){this.constructor.delegateProps.forEach(((e,i)=>{this._delegateProperty(e,t[i])}))}_delegateAttribute(t,e){this.stateTarget&&("invalid"===t&&this._delegateAttribute("aria-invalid",!!e&&"true"),"boolean"==typeof e?this.stateTarget.toggleAttribute(t,e):e?this.stateTarget.setAttribute(t,e):this.stateTarget.removeAttribute(t))}_delegateProperty(t,e){this.stateTarget&&(this.stateTarget[t]=e)}}))
|
|
1566
|
+
*/,Rr=Se((t=>class extends(Fr(jr(t))){static get properties(){return{autofocus:{type:Boolean},focusElement:{type:Object,readOnly:!0,observer:"_focusElementChanged"},_lastTabIndex:{value:0}}}constructor(){super(),this._boundOnBlur=this._onBlur.bind(this),this._boundOnFocus=this._onFocus.bind(this)}ready(){super.ready(),this.autofocus&&!this.disabled&&requestAnimationFrame((()=>{this.focus(),this.setAttribute("focus-ring","")}))}focus(){this.focusElement&&!this.disabled&&this.focusElement.focus()}blur(){this.focusElement&&this.focusElement.blur()}click(){this.focusElement&&!this.disabled&&this.focusElement.click()}_focusElementChanged(t,e){t?(t.disabled=this.disabled,this._addFocusListeners(t),this.__forwardTabIndex(this.tabindex)):e&&this._removeFocusListeners(e)}_addFocusListeners(t){t.addEventListener("blur",this._boundOnBlur),t.addEventListener("focus",this._boundOnFocus)}_removeFocusListeners(t){t.removeEventListener("blur",this._boundOnBlur),t.removeEventListener("focus",this._boundOnFocus)}_onFocus(t){t.stopPropagation(),this.dispatchEvent(new Event("focus"))}_onBlur(t){t.stopPropagation(),this.dispatchEvent(new Event("blur"))}_shouldSetFocus(t){return t.target===this.focusElement}_shouldRemoveFocus(t){return t.target===this.focusElement}_disabledChanged(t,e){super._disabledChanged(t,e),this.focusElement&&(this.focusElement.disabled=t),t&&this.blur()}_tabindexChanged(t){this.__forwardTabIndex(t)}__forwardTabIndex(t){void 0!==t&&this.focusElement&&(this.focusElement.tabIndex=t,-1!==t&&(this.tabindex=void 0)),this.disabled&&t&&(-1!==t&&(this._lastTabIndex=t),this.tabindex=void 0)}})),Lr=Se((t=>class extends t{static get properties(){return{stateTarget:{type:Object,observer:"_stateTargetChanged"}}}static get delegateAttrs(){return[]}static get delegateProps(){return[]}ready(){super.ready(),this._createDelegateAttrsObserver(),this._createDelegatePropsObserver()}_stateTargetChanged(t){t&&(this._ensureAttrsDelegated(),this._ensurePropsDelegated())}_createDelegateAttrsObserver(){this._createMethodObserver(`_delegateAttrsChanged(${this.constructor.delegateAttrs.join(", ")})`)}_createDelegatePropsObserver(){this._createMethodObserver(`_delegatePropsChanged(${this.constructor.delegateProps.join(", ")})`)}_ensureAttrsDelegated(){this.constructor.delegateAttrs.forEach((t=>{this._delegateAttribute(t,this[t])}))}_ensurePropsDelegated(){this.constructor.delegateProps.forEach((t=>{this._delegateProperty(t,this[t])}))}_delegateAttrsChanged(...t){this.constructor.delegateAttrs.forEach(((e,i)=>{this._delegateAttribute(e,t[i])}))}_delegatePropsChanged(...t){this.constructor.delegateProps.forEach(((e,i)=>{this._delegateProperty(e,t[i])}))}_delegateAttribute(t,e){this.stateTarget&&("invalid"===t&&this._delegateAttribute("aria-invalid",!!e&&"true"),"boolean"==typeof e?this.stateTarget.toggleAttribute(t,e):e?this.stateTarget.setAttribute(t,e):this.stateTarget.removeAttribute(t))}_delegateProperty(t,e){this.stateTarget&&(this.stateTarget[t]=e)}})),$r=Se((t=>class extends t{static get properties(){return{inputElement:{type:Object,readOnly:!0,observer:"_inputElementChanged"},type:{type:String,readOnly:!0},value:{type:String,value:"",observer:"_valueChanged",notify:!0,sync:!0},_hasInputValue:{type:Boolean,value:!1,observer:"_hasInputValueChanged"}}}constructor(){super(),this._boundOnInput=this.__onInput.bind(this),this._boundOnChange=this._onChange.bind(this)}get _hasValue(){return null!=this.value&&""!==this.value}get _inputElementValueProperty(){return"value"}get _inputElementValue(){return this.inputElement?this.inputElement[this._inputElementValueProperty]:void 0}set _inputElementValue(t){this.inputElement&&(this.inputElement[this._inputElementValueProperty]=t)}clear(){this._hasInputValue=!1,this.value="",this._inputElementValue=""}_addInputListeners(t){t.addEventListener("input",this._boundOnInput),t.addEventListener("change",this._boundOnChange)}_removeInputListeners(t){t.removeEventListener("input",this._boundOnInput),t.removeEventListener("change",this._boundOnChange)}_forwardInputValue(t){this.inputElement&&(this._inputElementValue=null!=t?t:"")}_inputElementChanged(t,e){t?this._addInputListeners(t):e&&this._removeInputListeners(e)}_hasInputValueChanged(t,e){(t||e)&&this.dispatchEvent(new CustomEvent("has-input-value-changed"))}__onInput(t){this._setHasInputValue(t),this._onInput(t)}_onInput(t){const e=t.composedPath()[0];this.__userInput=t.isTrusted,this.value=e.value,this.__userInput=!1}_onChange(t){}_toggleHasValue(t){this.toggleAttribute("has-value",t)}_valueChanged(t,e){this._toggleHasValue(this._hasValue),(""!==t||void 0!==e)&&(this.__userInput||this._forwardInputValue(t))}_setHasInputValue(t){const e=t.composedPath()[0];this._hasInputValue=e.value.length>0}})),Wr=Se((t=>class extends(Lr(Cr($r(t)))){static get properties(){return{checked:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0}}}static get delegateProps(){return[...super.delegateProps,"checked"]}_onChange(t){this._toggleChecked(t.target.checked)}_toggleChecked(t){this.checked=t}})),Hr=new Map;
|
|
1567
1567
|
/**
|
|
1568
1568
|
* @license
|
|
1569
1569
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1570
1570
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1571
|
-
*/function Gr(t){return Hr.has(t)||Hr.set(t,new WeakMap),Hr.get(t)}function Ur(t,e){t&&t.removeAttribute(e)}function Vr(t,e){if(!t||!e)return;const i=Gr(e);if(i.has(t))return;const s
|
|
1571
|
+
*/function Gr(t){return Hr.has(t)||Hr.set(t,new WeakMap),Hr.get(t)}function Ur(t,e){t&&t.removeAttribute(e)}function Vr(t,e){if(!t||!e)return;const i=Gr(e);if(i.has(t))return;const s=$s(t.getAttribute(e));i.set(t,new Set(s))}function qr(t,e,i={newId:null,oldId:null,fromUser:!1}){if(!t||!e)return;const{newId:s,oldId:r,fromUser:o}=i,n=Gr(e),a=n.get(t);if(!o&&a)return r&&a.delete(r),void(s&&a.add(s));o&&(a?s||n.delete(t):Vr(t,e),Ur(t,e)),function(t,e,i){const s=$s(t.getAttribute(e));s.delete(i),0!==s.size?t.setAttribute(e,Ws(s)):t.removeAttribute(e)}(t,e,r);const l=s||Ws(a);l&&Hs(t,e,l)}
|
|
1572
1572
|
/**
|
|
1573
1573
|
* @license
|
|
1574
1574
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1575
1575
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1576
1576
|
*/
|
|
1577
|
-
class Yr{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__target=t,this.__setAriaRequiredAttribute(this.__required),this.__setLabelIdToAriaAttribute(this.__labelId,this.__labelId),null!=this.__labelIdFromUser&&this.__setLabelIdToAriaAttribute(this.__labelIdFromUser,this.__labelIdFromUser,!0),this.__setErrorIdToAriaAttribute(this.__errorId),this.__setHelperIdToAriaAttribute(this.__helperId),this.setAriaLabel(this.__label)}setRequired(t){this.__setAriaRequiredAttribute(t),this.__required=t}setAriaLabel(t){this.__setAriaLabelToAttribute(t),this.__label=t}setLabelId(t,e=!1){this.__setLabelIdToAriaAttribute(t,e?this.__labelIdFromUser:this.__labelId,e),e?this.__labelIdFromUser=t:this.__labelId=t}setErrorId(t){this.__setErrorIdToAriaAttribute(t,this.__errorId),this.__errorId=t}setHelperId(t){this.__setHelperIdToAriaAttribute(t,this.__helperId),this.__helperId=t}__setAriaLabelToAttribute(t){this.__target&&(t?(function(t,e){Vr(t,e),Ur(t,e)}(this.__target,"aria-labelledby"),this.__target.setAttribute("aria-label",t)):this.__label&&(function(t,e){if(!t)return;const i=Gr(e),s=i.get(t);s&&0!==s.size?Hs(t,e
|
|
1577
|
+
class Yr{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__target=t,this.__setAriaRequiredAttribute(this.__required),this.__setLabelIdToAriaAttribute(this.__labelId,this.__labelId),null!=this.__labelIdFromUser&&this.__setLabelIdToAriaAttribute(this.__labelIdFromUser,this.__labelIdFromUser,!0),this.__setErrorIdToAriaAttribute(this.__errorId),this.__setHelperIdToAriaAttribute(this.__helperId),this.setAriaLabel(this.__label)}setRequired(t){this.__setAriaRequiredAttribute(t),this.__required=t}setAriaLabel(t){this.__setAriaLabelToAttribute(t),this.__label=t}setLabelId(t,e=!1){this.__setLabelIdToAriaAttribute(t,e?this.__labelIdFromUser:this.__labelId,e),e?this.__labelIdFromUser=t:this.__labelId=t}setErrorId(t){this.__setErrorIdToAriaAttribute(t,this.__errorId),this.__errorId=t}setHelperId(t){this.__setHelperIdToAriaAttribute(t,this.__helperId),this.__helperId=t}__setAriaLabelToAttribute(t){this.__target&&(t?(function(t,e){Vr(t,e),Ur(t,e)}(this.__target,"aria-labelledby"),this.__target.setAttribute("aria-label",t)):this.__label&&(function(t,e){if(!t)return;const i=Gr(e),s=i.get(t);s&&0!==s.size?Hs(t,e,Ws(s)):t.removeAttribute(e),i.delete(t)}(this.__target,"aria-labelledby"),this.__target.removeAttribute("aria-label")))}__setLabelIdToAriaAttribute(t,e,i){qr(this.__target,"aria-labelledby",{newId:t,oldId:e,fromUser:i})}__setErrorIdToAriaAttribute(t,e){qr(this.__target,"aria-describedby",{newId:t,oldId:e,fromUser:!1})}__setHelperIdToAriaAttribute(t,e){qr(this.__target,"aria-describedby",{newId:t,oldId:e,fromUser:!1})}__setAriaRequiredAttribute(t){this.__target&&(["input","textarea"].includes(this.__target.localName)||(t?this.__target.setAttribute("aria-required","true"):this.__target.removeAttribute("aria-required")))}}
|
|
1578
1578
|
/**
|
|
1579
1579
|
* @license
|
|
1580
1580
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -1629,7 +1629,7 @@ class Yr{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__targe
|
|
|
1629
1629
|
* @license
|
|
1630
1630
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1631
1631
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1632
|
-
*/const lo=t=>class extends(oo(
|
|
1632
|
+
*/const lo=t=>class extends(oo(Wr(Rr(Tr(t))))){static get properties(){return{indeterminate:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0},name:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},tabindex:{type:Number,value:0,reflectToAttribute:!0}}}static get observers(){return["__readonlyChanged(readonly, inputElement)"]}static get delegateProps(){return[...super.delegateProps,"indeterminate"]}static get delegateAttrs(){return[...super.delegateAttrs,"name","invalid","required"]}constructor(){super(),this._setType("checkbox"),this._boundOnInputClick=this._onInputClick.bind(this),this.value="on"}ready(){super.ready(),this.addController(new no(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new ao(this.inputElement,this._labelController)),this._createMethodObserver("_checkedChanged(checked)")}_shouldSetActive(t){return!this.readonly&&"a"!==t.target.localName&&t.target!==this._helperNode&&t.target!==this._errorNode&&super._shouldSetActive(t)}_addInputListeners(t){super._addInputListeners(t),t.addEventListener("click",this._boundOnInputClick)}_removeInputListeners(t){super._removeInputListeners(t),t.removeEventListener("click",this._boundOnInputClick)}_onInputClick(t){this.readonly&&t.preventDefault()}__readonlyChanged(t,e){e&&(t?e.setAttribute("aria-readonly","true"):e.removeAttribute("aria-readonly"))}_toggleChecked(t){this.indeterminate&&(this.indeterminate=!1),super._toggleChecked(t)}checkValidity(){return!this.required||!!this.checked}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_checkedChanged(t){(t||this.__oldChecked)&&this.validate(),this.__oldChecked=t}_requiredChanged(t){super._requiredChanged(t),!1===t&&this.validate()}_onRequiredIndicatorClick(){this._labelNode.click()}}
|
|
1633
1633
|
/**
|
|
1634
1634
|
* @license
|
|
1635
1635
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -3384,12 +3384,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
3384
3384
|
* @license
|
|
3385
3385
|
* Copyright (c) 2017 Anton Korzunov
|
|
3386
3386
|
* SPDX-License-Identifier: MIT
|
|
3387
|
-
*/let Oo=new WeakMap,Eo=new WeakMap,Fo={},jo=0;const Ro=t=>t&&t.nodeType===Node.ELEMENT_NODE,Lo=(...t)=>{console.error(`Error: ${t.join(" ")}. Skip setting aria-hidden.`)}
|
|
3387
|
+
*/let Oo=new WeakMap,Eo=new WeakMap,Fo={},jo=0;const Ro=t=>t&&t.nodeType===Node.ELEMENT_NODE,Lo=(...t)=>{console.error(`Error: ${t.join(" ")}. Skip setting aria-hidden.`)},$o=(t,e=document.body,i="data-aria-hidden")=>{const s=Array.from(Array.isArray(t)?t:[t]);return e&&s.push(...Array.from(e.querySelectorAll("[aria-live]"))),((t,e,i,s)=>{const r=((t,e)=>Ro(t)?e.map((e=>{if(!Ro(e))return Lo(e,"is not a valid element"),null;let i=e;for(;i&&i!==t;){if(t.contains(i))return e;i=i.getRootNode().host}return Lo(e,"is not contained inside",t),null})).filter((t=>!!t)):(Lo(t,"is not a valid element"),[]))(e,Array.isArray(t)?t:[t]);Fo[i]||(Fo[i]=new WeakMap);const o=Fo[i],n=[],a=new Set,l=new Set(r),h=t=>{if(!t||a.has(t))return;a.add(t);const e=t.assignedSlot;e&&h(e),h(t.parentNode||t.host)};r.forEach(h);const c=t=>{if(!t||l.has(t))return;const e=t.shadowRoot;(e?[...t.children,...e.children]:[...t.children]).forEach((t=>{if(!["template","script","style"].includes(t.localName))if(a.has(t))c(t);else{const e=t.getAttribute(s),r=null!==e&&"false"!==e,a=(Oo.get(t)||0)+1,l=(o.get(t)||0)+1;Oo.set(t,a),o.set(t,l),n.push(t),1===a&&r&&Eo.set(t,!0),1===l&&t.setAttribute(i,"true"),r||t.setAttribute(s,"true")}}))};return c(e),a.clear(),jo+=1,()=>{n.forEach((t=>{const e=Oo.get(t)-1,r=o.get(t)-1;Oo.set(t,e),o.set(t,r),e||(Eo.has(t)?Eo.delete(t):t.removeAttribute(s)),r||t.removeAttribute(i)})),jo-=1,jo||(Oo=new WeakMap,Oo=new WeakMap,Eo=new WeakMap,Fo={})}})(s,e,i,"aria-hidden")
|
|
3388
3388
|
/**
|
|
3389
3389
|
* @license
|
|
3390
3390
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3391
3391
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3392
|
-
*/};class
|
|
3392
|
+
*/};class Wo{constructor(t,e){this.host=t,this.callback="function"==typeof e?e:()=>t}showModal(){const t=this.callback();this.__showOthers=$o(t)}close(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null)}}
|
|
3393
3393
|
/**
|
|
3394
3394
|
* @license
|
|
3395
3395
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -3404,7 +3404,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
3404
3404
|
* @license
|
|
3405
3405
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3406
3406
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3407
|
-
*/const Vo=t=>class extends(Jr(t)){static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__ariaModalController=new
|
|
3407
|
+
*/const Vo=t=>class extends(Jr(t)){static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__ariaModalController=new Wo(this),this.__focusTrapController=new Uo(this),this.__focusRestorationController=new Ho}ready(){super.ready(),this.addController(this.__ariaModalController),this.addController(this.__focusTrapController),this.addController(this.__focusRestorationController)}_resetFocus(){if(this.focusTrap&&(this.__ariaModalController.close(),this.__focusTrapController.releaseFocus()),this.restoreFocusOnClose&&this._shouldRestoreFocus()){const t=!Ir();this.__focusRestorationController.restoreFocus({preventScroll:t})}}_saveFocus(){this.restoreFocusOnClose&&this.__focusRestorationController.saveFocus(this.restoreFocusNode)}_trapFocus(){this.focusTrap&&(this.__ariaModalController.showModal(),this.__focusTrapController.trapFocus(this.$.overlay))}_shouldRestoreFocus(){const t=Ar();return t===document.body||this._deepContains(t)}_deepContains(t){if(this.contains(t))return!0;let e=t;const i=t.ownerDocument;for(;e&&e!==i&&e!==this;)e=e.parentNode||e.host;return e===this}}
|
|
3408
3408
|
/**
|
|
3409
3409
|
* @license
|
|
3410
3410
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -3647,7 +3647,7 @@ const Rn=Tn(fs);class Ln extends Rn{static get is(){return"dom-repeat"}static ge
|
|
|
3647
3647
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3648
3648
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3649
3649
|
*/
|
|
3650
|
-
const
|
|
3650
|
+
const $n=t=>class extends(Fr(t)){static get properties(){return{month:{type:Object,value:new Date,sync:!0},selectedDate:{type:Object,notify:!0,sync:!0},focusedDate:{type:Object},showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:{type:Boolean},minDate:{type:Date,value:null,sync:!0},maxDate:{type:Date,value:null,sync:!0},isDateDisabled:{type:Function,value:()=>!1},disabled:{type:Boolean,reflectToAttribute:!0},_days:{type:Array},_weeks:{type:Array},_notTapping:{type:Boolean}}}static get observers(){return["__focusedDateChanged(focusedDate, _days)"]}get focusableDateElement(){return[...this.shadowRoot.querySelectorAll("[part~=date]")].find((t=>ln(t.date,this.focusedDate)))}ready(){super.ready(),fr(this.$.monthGrid,"tap",this._handleTap.bind(this))}_isDisabled(t,e,i){const s=new Date(0,0);s.setFullYear(t.getFullYear()),s.setMonth(t.getMonth()),s.setDate(1);const r=new Date(0,0);return r.setFullYear(t.getFullYear()),r.setMonth(t.getMonth()+1),r.setDate(0),!(e&&i&&e.getMonth()===i.getMonth()&&e.getMonth()===t.getMonth()&&i.getDate()-e.getDate()>=0||cn(s,e,i)||cn(r,e,i))}_getTitle(t,e){if(void 0!==t&&void 0!==e)return e.formatTitle(e.monthNames[t.getMonth()],t.getFullYear())}_onMonthGridTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300)}_dateAdd(t,e){t.setDate(t.getDate()+e)}_applyFirstDayOfWeek(t,e){if(void 0!==t&&void 0!==e)return t.slice(e).concat(t.slice(0,e))}_getWeekDayNames(t,e){if(void 0===t||void 0===e)return[];const{weekdays:i,weekdaysShort:s,firstDayOfWeek:r}=t,o=this._applyFirstDayOfWeek(s,r);return this._applyFirstDayOfWeek(i,r).map(((t,e)=>({weekDay:t,weekDayShort:o[e]}))).slice(0,7)}__focusedDateChanged(t,e){Array.isArray(e)&&e.some((e=>ln(e,t)))?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")}_getDate(t){return t?t.getDate():""}_showWeekSeparator(t,e){return t&&e&&1===e.firstDayOfWeek}_isToday(t){return ln(new Date,t)}_getDays(t,e){if(void 0===t||void 0===e)return[];const i=new Date(0,0);for(i.setFullYear(t.getFullYear()),i.setMonth(t.getMonth()),i.setDate(1);i.getDay()!==e.firstDayOfWeek;)this._dateAdd(i,-1);const s=[],r=i.getMonth(),o=t.getMonth();for(;i.getMonth()===o||i.getMonth()===r;)s.push(i.getMonth()===o?new Date(i.getTime()):null),this._dateAdd(i,1);return s}_getWeeks(t){return t.reduce(((t,e,i)=>(i%7==0&&t.push([]),t[t.length-1].push(e),t)),[])}_handleTap(t){!this.ignoreTaps&&!this._notTapping&&t.target.date&&!t.target.hasAttribute("disabled")&&(this.selectedDate=t.target.date,this.dispatchEvent(new CustomEvent("date-tap",{detail:{date:t.target.date},bubbles:!0,composed:!0})))}_preventDefault(t){t.preventDefault()}__getWeekNumber(t){
|
|
3651
3651
|
/**
|
|
3652
3652
|
* @license
|
|
3653
3653
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
@@ -3719,7 +3719,7 @@ Yt("vaadin-month-calendar",B`
|
|
|
3719
3719
|
outline: 3px solid;
|
|
3720
3720
|
}
|
|
3721
3721
|
}
|
|
3722
|
-
`,{moduleId:"vaadin-month-calendar-styles"});class
|
|
3722
|
+
`,{moduleId:"vaadin-month-calendar-styles"});class Wn extends($n(Qt(fs))){static get template(){return ps`
|
|
3723
3723
|
<div part="month-header" id="month-header" aria-hidden="true">[[_getTitle(month, i18n)]]</div>
|
|
3724
3724
|
<table
|
|
3725
3725
|
id="monthGrid"
|
|
@@ -3761,7 +3761,7 @@ Yt("vaadin-month-calendar",B`
|
|
|
3761
3761
|
</template>
|
|
3762
3762
|
</tbody>
|
|
3763
3763
|
</table>
|
|
3764
|
-
`}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate, isDateDisabled)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(t,e){t&&e&&1===e.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(t,e,i,s,r,o){const n=["date"],a=t>an(new Date),l=t<an(new Date);return this.__isDayDisabled(t,s,r,o)&&n.push("disabled"),this.__isDayFocused(t,e)&&n.push("focused"),this.__isDaySelected(t,i)&&n.push("selected"),this._isToday(t)&&n.push("today"),l&&n.push("past"),a&&n.push("future"),n.join(" ")}__isDayFocused(t,e){return ln(t,e)}__isDaySelected(t,e){return ln(t,e)}__getDayAriaSelected(t,e){if(this.__isDaySelected(t,e))return"true"}__isDayDisabled(t,e,i,s){return!cn(t,e,i,s)}__getDayAriaDisabled(t,e,i,s){if(void 0!==t&&(void 0!==e||void 0!==i||void 0!==s)&&this.__isDayDisabled(t,e,i,s))return"true"}__getDayTabindex(t,e){return this.__isDayFocused(t,e)?"0":"-1"}}D(
|
|
3764
|
+
`}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate, isDateDisabled)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(t,e){t&&e&&1===e.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(t,e,i,s,r,o){const n=["date"],a=t>an(new Date),l=t<an(new Date);return this.__isDayDisabled(t,s,r,o)&&n.push("disabled"),this.__isDayFocused(t,e)&&n.push("focused"),this.__isDaySelected(t,i)&&n.push("selected"),this._isToday(t)&&n.push("today"),l&&n.push("past"),a&&n.push("future"),n.join(" ")}__isDayFocused(t,e){return ln(t,e)}__isDaySelected(t,e){return ln(t,e)}__getDayAriaSelected(t,e){if(this.__isDaySelected(t,e))return"true"}__isDayDisabled(t,e,i,s){return!cn(t,e,i,s)}__getDayAriaDisabled(t,e,i,s){if(void 0!==t&&(void 0!==e||void 0!==i||void 0!==s)&&this.__isDayDisabled(t,e,i,s))return"true"}__getDayTabindex(t,e){return this.__isDayFocused(t,e)?"0":"-1"}}D(Wn);
|
|
3765
3765
|
/**
|
|
3766
3766
|
* @license
|
|
3767
3767
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -3869,12 +3869,12 @@ Yt("vaadin-date-picker-overlay-content",B`
|
|
|
3869
3869
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3870
3870
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3871
3871
|
*/
|
|
3872
|
-
const Vn=new WeakMap,qn=Se((t=>class extends t{get slotStyles(){return{}}connectedCallback(){super.connectedCallback(),this.__applySlotStyles()}__applySlotStyles(){const t=this.getRootNode(),e=function(t){return Vn.has(t)||Vn.set(t,new Set),Vn.get(t)}(t);this.slotStyles.forEach((i=>{e.has(i)||(function(t,e){const i=document.createElement("style");i.textContent=t,e===document?document.head.appendChild(i):e.insertBefore(i,e.firstChild)}(i,t),e.add(i))}))}})),Yn=t=>class extends(
|
|
3872
|
+
const Vn=new WeakMap,qn=Se((t=>class extends t{get slotStyles(){return{}}connectedCallback(){super.connectedCallback(),this.__applySlotStyles()}__applySlotStyles(){const t=this.getRootNode(),e=function(t){return Vn.has(t)||Vn.set(t,new Set),Vn.get(t)}(t);this.slotStyles.forEach((i=>{e.has(i)||(function(t,e){const i=document.createElement("style");i.textContent=t,e===document?document.head.appendChild(i):e.insertBefore(i,e.firstChild)}(i,t),e.add(i))}))}})),Yn=t=>class extends($r(Sr(t))){static get properties(){return{clearButtonVisible:{type:Boolean,reflectToAttribute:!0,value:!1}}}get clearElement(){return console.warn(`Please implement the 'clearElement' property in <${this.localName}>`),null}ready(){super.ready(),this.clearElement&&(this.clearElement.addEventListener("mousedown",(t=>this._onClearButtonMouseDown(t))),this.clearElement.addEventListener("click",(t=>this._onClearButtonClick(t))))}_onClearButtonClick(t){t.preventDefault(),this._onClearAction()}_onClearButtonMouseDown(t){t.preventDefault(),Bo||this.inputElement.focus()}_onEscape(t){super._onEscape(t),this.clearButtonVisible&&this.value&&!this.readonly&&(t.stopPropagation(),this._onClearAction())}_onClearAction(){this._inputElementValue="",this.inputElement.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.inputElement.dispatchEvent(new Event("change",{bubbles:!0}))}}
|
|
3873
3873
|
/**
|
|
3874
3874
|
* @license
|
|
3875
3875
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3876
3876
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3877
|
-
*/,Jn=Se((t=>class extends(Lr(ro(
|
|
3877
|
+
*/,Jn=Se((t=>class extends(Lr(ro($r(t)))){static get constraints(){return["required"]}static get delegateAttrs(){return[...super.delegateAttrs,"required"]}ready(){super.ready(),this._createConstraintsObserver()}checkValidity(){return this.inputElement&&this._hasValidConstraints(this.constructor.constraints.map((t=>this[t])))?this.inputElement.checkValidity():!this.invalid}_hasValidConstraints(t){return t.some((t=>this.__isValidConstraint(t)))}_createConstraintsObserver(){this._createMethodObserver(`_constraintsChanged(stateTarget, ${this.constructor.constraints.join(", ")})`)}_constraintsChanged(t,...e){if(!t)return;const i=this._hasValidConstraints(e),s=this.__previousHasConstraints&&!i;(this._hasValue||this.invalid)&&i?this.validate():s&&this._setInvalid(!1),this.__previousHasConstraints=i}_onChange(t){t.stopPropagation(),this.validate(),this.dispatchEvent(new CustomEvent("change",{detail:{sourceEvent:t},bubbles:t.bubbles,cancelable:t.cancelable}))}__isValidConstraint(t){return!!t||0===t}})),Kn=t=>class extends(qn(Rr(Jn(oo(Yn(Sr(t))))))){static get properties(){return{allowedCharPattern:{type:String,observer:"_allowedCharPatternChanged"},autoselect:{type:Boolean,value:!1},name:{type:String,reflectToAttribute:!0},placeholder:{type:String,reflectToAttribute:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},title:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"name","type","placeholder","readonly","invalid","title"]}constructor(){super(),this._boundOnPaste=this._onPaste.bind(this),this._boundOnDrop=this._onDrop.bind(this),this._boundOnBeforeInput=this._onBeforeInput.bind(this)}get slotStyles(){return["\n :is(input[slot='input'], textarea[slot='textarea'])::placeholder {\n font: inherit;\n color: inherit;\n }\n "]}_onFocus(t){super._onFocus(t),this.autoselect&&this.inputElement&&this.inputElement.select()}_onChange(t){t.stopPropagation(),this.validate(),this.dispatchEvent(new CustomEvent("change",{detail:{sourceEvent:t},bubbles:t.bubbles,cancelable:t.cancelable}))}_addInputListeners(t){super._addInputListeners(t),t.addEventListener("paste",this._boundOnPaste),t.addEventListener("drop",this._boundOnDrop),t.addEventListener("beforeinput",this._boundOnBeforeInput)}_removeInputListeners(t){super._removeInputListeners(t),t.removeEventListener("paste",this._boundOnPaste),t.removeEventListener("drop",this._boundOnDrop),t.removeEventListener("beforeinput",this._boundOnBeforeInput)}_onKeyDown(t){super._onKeyDown(t),this.allowedCharPattern&&!this.__shouldAcceptKey(t)&&t.target===this.inputElement&&(t.preventDefault(),this._markInputPrevented())}_markInputPrevented(){this.setAttribute("input-prevented",""),this._preventInputDebouncer=Is.debounce(this._preventInputDebouncer,Cs.after(200),(()=>{this.removeAttribute("input-prevented")}))}__shouldAcceptKey(t){return t.metaKey||t.ctrlKey||!t.key||1!==t.key.length||this.__allowedCharRegExp.test(t.key)}_onPaste(t){if(this.allowedCharPattern){const e=t.clipboardData.getData("text");this.__allowedTextRegExp.test(e)||(t.preventDefault(),this._markInputPrevented())}}_onDrop(t){if(this.allowedCharPattern){const e=t.dataTransfer.getData("text");this.__allowedTextRegExp.test(e)||(t.preventDefault(),this._markInputPrevented())}}_onBeforeInput(t){this.allowedCharPattern&&t.data&&!this.__allowedTextRegExp.test(t.data)&&(t.preventDefault(),this._markInputPrevented())}_allowedCharPatternChanged(t){if(t)try{this.__allowedCharRegExp=new RegExp(`^${t}$`,"u"),this.__allowedTextRegExp=new RegExp(`^${t}*$`,"u")}catch(t){console.error(t)}}}
|
|
3878
3878
|
/**
|
|
3879
3879
|
* @license
|
|
3880
3880
|
* Copyright (c) 2021 - 2024 Vaadin Ltd..
|
|
@@ -3959,7 +3959,7 @@ const Vn=new WeakMap,qn=Se((t=>class extends t{get slotStyles(){return{}}connect
|
|
|
3959
3959
|
* @license
|
|
3960
3960
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3961
3961
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3962
|
-
*/const ia=t=>class extends(ta(Jr(Rr(Jn(Sr(t)))))){static get properties(){return{_selectedDate:{type:Object,sync:!0},_focusedDate:{type:Object,sync:!0},value:{type:String,notify:!0,value:"",sync:!0},initialPosition:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged",sync:!0},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean,value:!1,sync:!0},_fullscreen:{type:Boolean,value:!1,sync:!0},_fullscreenMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},i18n:{type:Object,sync:!0,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,today:"Today",cancel:"Cancel",referenceDate:"",formatDate(t){const e=String(t.year).replace(/\d+/u,(t=>"0000".substr(t.length)+t));return[t.month+1,t.day,e].join("/")},parseDate(t){const e=t.split("/"),i=new Date;let s,r=i.getMonth(),o=i.getFullYear();if(3===e.length?(r=parseInt(e[0])-1,s=parseInt(e[1]),o=parseInt(e[2]),e[2].length<3&&o>=0&&(o=function(t,e,i=0,s=1){if(e>99)throw new Error("The provided year cannot have more than 2 digits.");if(e<0)throw new Error("The provided year cannot be negative.");let r=e+100*Math.floor(t.getFullYear()/100);return t<new Date(r-50,i,s)?r-=100:t>new Date(r+50,i,s)&&(r+=100),r}(this.referenceDate?pn(this.referenceDate):new Date,o,r,s))):2===e.length?(r=parseInt(e[0])-1,s=parseInt(e[1])):1===e.length&&(s=parseInt(e[0])),void 0!==s)return{day:s,month:r,year:o}},formatTitle:(t,e)=>`${t} ${e}`})},min:{type:String,sync:!0},max:{type:String,sync:!0},isDateDisabled:{type:Function},_minDate:{type:Date,computed:"__computeMinOrMaxDate(min)",sync:!0},_maxDate:{type:Date,computed:"__computeMinOrMaxDate(max)",sync:!0},_noInput:{type:Boolean,computed:"_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)"},_ios:{type:Boolean,value:No},_focusOverlayOnOpen:Boolean,_overlayContent:{type:Object,sync:!0},_hasInputValue:{type:Boolean}}}static get observers(){return["_selectedDateChanged(_selectedDate, i18n)","_focusedDateChanged(_focusedDate, i18n)","__updateOverlayContent(_overlayContent, i18n, label, _minDate, _maxDate, _focusedDate, _selectedDate, showWeekNumbers, isDateDisabled)","__updateOverlayContentTheme(_overlayContent, _theme)","__updateOverlayContentFullScreen(_overlayContent, _fullscreen)"]}static get constraints(){return[...super.constraints,"min","max"]}constructor(){super(),this._boundOnClick=this._onClick.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOverlayRenderer=this._overlayRenderer.bind(this)}get _inputElementValue(){return super._inputElementValue}set _inputElementValue(t){super._inputElementValue=t,this._hasInputValue=!1}get clearElement(){return null}get _nativeInput(){return this.inputElement?this.inputElement.focusElement||this.inputElement:null}get __unparsableValue(){return!this._inputElementValue||this.__parseDate(this._inputElementValue)?"":this._inputElementValue}_onFocus(t){super._onFocus(t),this._noInput&&!Ir()&&t.target.blur()}_onBlur(t){super._onBlur(t),this.opened||(this.__commitParsedOrFocusedDate(),document.hasFocus()&&this.validate())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new Hn(this._fullscreenMediaQuery,(t=>{this._fullscreen=t}))),this.addController(new ea(this));const t=this.$.overlay;this._overlayElement=t,t.renderer=this._boundOverlayRenderer,this.addEventListener("mousedown",(()=>this.__bringToFront())),this.addEventListener("touchstart",(()=>this.__bringToFront()))}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.$.overlay.close()}_overlayRenderer(t){if(t.firstChild)return;const e=document.createElement("vaadin-date-picker-overlay-content");t.appendChild(e),this._overlayContent=e,e.addEventListener("close",(()=>{this._close()})),e.addEventListener("focus-input",this._focusAndSelect.bind(this)),e.addEventListener("date-tap",(t=>{this.__commitDate(t.detail.date),this._close()})),e.addEventListener("date-selected",(t=>{this.__commitDate(t.detail.date)})),e.addEventListener("focusin",(()=>{this._keyboardActive&&this._setFocused(!0)})),e.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),e.addEventListener("focused-date-changed",(t=>{this._focusedDate=t.detail.value})),e.addEventListener("click",(t=>t.stopPropagation()))}__parseDate(t){if(!this.i18n.parseDate)return;let e=this.i18n.parseDate(t);return e&&(e=pn(`${e.year}-${e.month+1}-${e.day}`)),e&&!isNaN(e.getTime())?e:void 0}__formatDate(t){if(this.i18n.formatDate)return this.i18n.formatDate(hn(t))}checkValidity(){const t=this._inputElementValue,e=!t||!!this._selectedDate&&t===this.__formatDate(this._selectedDate),i=!this._selectedDate||cn(this._selectedDate,this._minDate,this._maxDate,this.isDateDisabled);let s=!0;return this.inputElement&&(this.inputElement.checkValidity?s=this.inputElement.checkValidity():this.inputElement.validate&&(s=this.inputElement.validate())),e&&i&&s}_shouldSetFocus(t){return!this._shouldKeepFocusRing}_shouldRemoveFocus(t){const{relatedTarget:e}=t;return!(!this.opened||null===e||e===document.body||this.contains(e)||this._overlayContent.contains(e))||!this.opened}_setFocused(t){super._setFocused(t),this._shouldKeepFocusRing=t&&this._keyboardActive}__commitValueChange(){const t=this.__unparsableValue;this.__committedValue!==this.value?(this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValue!==t&&(this.validate(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValue=t}__commitDate(t){this.__keepCommittedValue=!0,this._selectedDate=t,this.__keepCommittedValue=!1,this.__commitValueChange()}_close(){this._focus(),this.close()}__bringToFront(){requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))}_isNoInput(t,e,i,s,r,o){return!t||e&&(!o||r)||i&&r||!s.parseDate}_formatISO(t){return function(t){return t instanceof Date?function(t){const e=(t,e="00")=>(e+t).substr((e+t).length-e.length);let i="",s="0000",r=t.year;return r<0?(r=-r,i="-",s="000000"):t.year>=1e4&&(i="+",s="000000"),[i+e(r,s),e(t.month+1),e(t.day)].join("-")}({year:t.getFullYear(),month:t.getMonth(),day:t.getDate()}):""}(t)}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.autocomplete="off",t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",!!this.opened),this._applyInputValue(this._selectedDate))}_openedChanged(t){this.inputElement&&this.inputElement.setAttribute("aria-expanded",t)}_selectedDateChanged(t,e){void 0===t||void 0===e||(this.__keepInputValue||this._applyInputValue(t),this.value=this._formatISO(t),this._ignoreFocusedDateChange=!0,this._focusedDate=t,this._ignoreFocusedDateChange=!1)}_focusedDateChanged(t,e){void 0===t||void 0===e||!this._ignoreFocusedDateChange&&!this._noInput&&this._applyInputValue(t)}_valueChanged(t,e){const i=pn(t);!t||i?(t?ln(this._selectedDate,i)||(this._selectedDate=i,void 0!==e&&this.validate()):this._selectedDate=null,this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValue=""),this._toggleHasValue(this._hasValue)):this.value=e}__updateOverlayContent(t,e,i,s,r,o,n,a,l){t&&(t.i18n=e,t.label=i,t.minDate=s,t.maxDate=r,t.focusedDate=o,t.selectedDate=n,t.showWeekNumbers=a,t.isDateDisabled=l)}__updateOverlayContentTheme(t,e){t&&(e?t.setAttribute("theme",e):t.removeAttribute("theme"))}__updateOverlayContentFullScreen(t,e){t&&t.toggleAttribute("fullscreen",e)}_onOverlayEscapePress(){this._focusedDate=this._selectedDate,this._closedByEscape=!0,this._close(),this._closedByEscape=!1}_onOverlayOpened(){const t=this._overlayContent;t.reset();const e=this._getInitialPosition();t.initialPosition=e;const i=t.focusedDate||e;t.scrollToDate(i),this._ignoreFocusedDateChange=!0,t.focusedDate=i,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this._focusOverlayOnOpen?(t.focusDateElement(),this._focusOverlayOnOpen=!1):this._focus();const s=this._nativeInput;this._noInput&&s&&(s.blur(),this._overlayContent.focusDateElement()),this.__showOthers=Wo(this._noInput?t:[s,t])}_getInitialPosition(){const t=pn(this.initialPosition),e=this._selectedDate||this._overlayContent.initialPosition||t||new Date;return t||cn(e,this._minDate,this._maxDate,this.isDateDisabled)?e:this._minDate||this._maxDate?dn(e,[this._minDate,this._maxDate]):new Date}__commitParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const t=this.__parseDate(this._inputElementValue||"");t?this.__commitDate(t):(this.__keepInputValue=!0,this.__commitDate(null),this.__keepInputValue=!1)}else this._focusedDate&&this.__commitDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this._closedByEscape&&this._applyInputValue(this._selectedDate),this.__commitParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),!this.value&&!this._keyboardActive&&this.validate()}_onScroll(t){(t.target===window||!this._overlayContent.contains(t.target))&&this._overlayContent._repositionYearScroller()}_focus(){this._noInput||this.inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(t){this._inputElementValue=t?this.__formatDate(t):""}_setSelectionRange(t,e){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(t,e)}_onChange(t){t.stopPropagation()}_onClick(t){this._isClearButton(t)||this._onHostClick(t)}_onHostClick(t){(!this.autoOpenDisabled||this._noInput)&&(t.preventDefault(),this.open())}_onClearButtonClick(t){t.preventDefault(),this.__commitDate(null)}_onKeyDown(t){switch(super._onKeyDown(t),this._noInput&&-1===[9].indexOf(t.keyCode)&&t.preventDefault(),t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.opened?this._overlayContent.focusDateElement():(this._focusOverlayOnOpen=!0,this.open());break;case"Tab":this.opened&&(t.preventDefault(),t.stopPropagation(),this._setSelectionRange(0,0),t.shiftKey?this._overlayContent.focusCancel():this._overlayContent.focusDateElement())}}_onEnter(t){this.opened?this.close():this.__commitParsedOrFocusedDate()}_onEscape(t){if(!this.opened){if(this.clearButtonVisible&&this.value&&!this.readonly)return t.stopPropagation(),void this._onClearButtonClick(t);""===this.inputElement.value?this.__commitDate(null):this._applyInputValue(this._selectedDate)}}_isClearButton(t){return t.composedPath()[0]===this.clearElement}_onInput(){if(!this.opened&&this._inputElementValue&&!this.autoOpenDisabled&&this.open(),this._inputElementValue){const t=this.__parseDate(this._inputElementValue);t&&(this._ignoreFocusedDateChange=!0,ln(t,this._focusedDate)||(this._focusedDate=t),this._ignoreFocusedDateChange=!1)}}__computeMinOrMaxDate(t){return pn(t)}}
|
|
3962
|
+
*/const ia=t=>class extends(ta(Jr(Rr(Jn(Sr(t)))))){static get properties(){return{_selectedDate:{type:Object,sync:!0},_focusedDate:{type:Object,sync:!0},value:{type:String,notify:!0,value:"",sync:!0},initialPosition:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged",sync:!0},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean,value:!1,sync:!0},_fullscreen:{type:Boolean,value:!1,sync:!0},_fullscreenMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},i18n:{type:Object,sync:!0,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,today:"Today",cancel:"Cancel",referenceDate:"",formatDate(t){const e=String(t.year).replace(/\d+/u,(t=>"0000".substr(t.length)+t));return[t.month+1,t.day,e].join("/")},parseDate(t){const e=t.split("/"),i=new Date;let s,r=i.getMonth(),o=i.getFullYear();if(3===e.length?(r=parseInt(e[0])-1,s=parseInt(e[1]),o=parseInt(e[2]),e[2].length<3&&o>=0&&(o=function(t,e,i=0,s=1){if(e>99)throw new Error("The provided year cannot have more than 2 digits.");if(e<0)throw new Error("The provided year cannot be negative.");let r=e+100*Math.floor(t.getFullYear()/100);return t<new Date(r-50,i,s)?r-=100:t>new Date(r+50,i,s)&&(r+=100),r}(this.referenceDate?pn(this.referenceDate):new Date,o,r,s))):2===e.length?(r=parseInt(e[0])-1,s=parseInt(e[1])):1===e.length&&(s=parseInt(e[0])),void 0!==s)return{day:s,month:r,year:o}},formatTitle:(t,e)=>`${t} ${e}`})},min:{type:String,sync:!0},max:{type:String,sync:!0},isDateDisabled:{type:Function},_minDate:{type:Date,computed:"__computeMinOrMaxDate(min)",sync:!0},_maxDate:{type:Date,computed:"__computeMinOrMaxDate(max)",sync:!0},_noInput:{type:Boolean,computed:"_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)"},_ios:{type:Boolean,value:No},_focusOverlayOnOpen:Boolean,_overlayContent:{type:Object,sync:!0},_hasInputValue:{type:Boolean}}}static get observers(){return["_selectedDateChanged(_selectedDate, i18n)","_focusedDateChanged(_focusedDate, i18n)","__updateOverlayContent(_overlayContent, i18n, label, _minDate, _maxDate, _focusedDate, _selectedDate, showWeekNumbers, isDateDisabled)","__updateOverlayContentTheme(_overlayContent, _theme)","__updateOverlayContentFullScreen(_overlayContent, _fullscreen)"]}static get constraints(){return[...super.constraints,"min","max"]}constructor(){super(),this._boundOnClick=this._onClick.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOverlayRenderer=this._overlayRenderer.bind(this)}get _inputElementValue(){return super._inputElementValue}set _inputElementValue(t){super._inputElementValue=t,this._hasInputValue=!1}get clearElement(){return null}get _nativeInput(){return this.inputElement?this.inputElement.focusElement||this.inputElement:null}get __unparsableValue(){return!this._inputElementValue||this.__parseDate(this._inputElementValue)?"":this._inputElementValue}_onFocus(t){super._onFocus(t),this._noInput&&!Ir()&&t.target.blur()}_onBlur(t){super._onBlur(t),this.opened||(this.__commitParsedOrFocusedDate(),document.hasFocus()&&this.validate())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new Hn(this._fullscreenMediaQuery,(t=>{this._fullscreen=t}))),this.addController(new ea(this));const t=this.$.overlay;this._overlayElement=t,t.renderer=this._boundOverlayRenderer,this.addEventListener("mousedown",(()=>this.__bringToFront())),this.addEventListener("touchstart",(()=>this.__bringToFront()))}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.$.overlay.close()}_overlayRenderer(t){if(t.firstChild)return;const e=document.createElement("vaadin-date-picker-overlay-content");t.appendChild(e),this._overlayContent=e,e.addEventListener("close",(()=>{this._close()})),e.addEventListener("focus-input",this._focusAndSelect.bind(this)),e.addEventListener("date-tap",(t=>{this.__commitDate(t.detail.date),this._close()})),e.addEventListener("date-selected",(t=>{this.__commitDate(t.detail.date)})),e.addEventListener("focusin",(()=>{this._keyboardActive&&this._setFocused(!0)})),e.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),e.addEventListener("focused-date-changed",(t=>{this._focusedDate=t.detail.value})),e.addEventListener("click",(t=>t.stopPropagation()))}__parseDate(t){if(!this.i18n.parseDate)return;let e=this.i18n.parseDate(t);return e&&(e=pn(`${e.year}-${e.month+1}-${e.day}`)),e&&!isNaN(e.getTime())?e:void 0}__formatDate(t){if(this.i18n.formatDate)return this.i18n.formatDate(hn(t))}checkValidity(){const t=this._inputElementValue,e=!t||!!this._selectedDate&&t===this.__formatDate(this._selectedDate),i=!this._selectedDate||cn(this._selectedDate,this._minDate,this._maxDate,this.isDateDisabled);let s=!0;return this.inputElement&&(this.inputElement.checkValidity?s=this.inputElement.checkValidity():this.inputElement.validate&&(s=this.inputElement.validate())),e&&i&&s}_shouldSetFocus(t){return!this._shouldKeepFocusRing}_shouldRemoveFocus(t){const{relatedTarget:e}=t;return!(!this.opened||null===e||e===document.body||this.contains(e)||this._overlayContent.contains(e))||!this.opened}_setFocused(t){super._setFocused(t),this._shouldKeepFocusRing=t&&this._keyboardActive}__commitValueChange(){const t=this.__unparsableValue;this.__committedValue!==this.value?(this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValue!==t&&(this.validate(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValue=t}__commitDate(t){this.__keepCommittedValue=!0,this._selectedDate=t,this.__keepCommittedValue=!1,this.__commitValueChange()}_close(){this._focus(),this.close()}__bringToFront(){requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))}_isNoInput(t,e,i,s,r,o){return!t||e&&(!o||r)||i&&r||!s.parseDate}_formatISO(t){return function(t){return t instanceof Date?function(t){const e=(t,e="00")=>(e+t).substr((e+t).length-e.length);let i="",s="0000",r=t.year;return r<0?(r=-r,i="-",s="000000"):t.year>=1e4&&(i="+",s="000000"),[i+e(r,s),e(t.month+1),e(t.day)].join("-")}({year:t.getFullYear(),month:t.getMonth(),day:t.getDate()}):""}(t)}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.autocomplete="off",t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",!!this.opened),this._applyInputValue(this._selectedDate))}_openedChanged(t){this.inputElement&&this.inputElement.setAttribute("aria-expanded",t)}_selectedDateChanged(t,e){void 0===t||void 0===e||(this.__keepInputValue||this._applyInputValue(t),this.value=this._formatISO(t),this._ignoreFocusedDateChange=!0,this._focusedDate=t,this._ignoreFocusedDateChange=!1)}_focusedDateChanged(t,e){void 0===t||void 0===e||!this._ignoreFocusedDateChange&&!this._noInput&&this._applyInputValue(t)}_valueChanged(t,e){const i=pn(t);!t||i?(t?ln(this._selectedDate,i)||(this._selectedDate=i,void 0!==e&&this.validate()):this._selectedDate=null,this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValue=""),this._toggleHasValue(this._hasValue)):this.value=e}__updateOverlayContent(t,e,i,s,r,o,n,a,l){t&&(t.i18n=e,t.label=i,t.minDate=s,t.maxDate=r,t.focusedDate=o,t.selectedDate=n,t.showWeekNumbers=a,t.isDateDisabled=l)}__updateOverlayContentTheme(t,e){t&&(e?t.setAttribute("theme",e):t.removeAttribute("theme"))}__updateOverlayContentFullScreen(t,e){t&&t.toggleAttribute("fullscreen",e)}_onOverlayEscapePress(){this._focusedDate=this._selectedDate,this._closedByEscape=!0,this._close(),this._closedByEscape=!1}_onOverlayOpened(){const t=this._overlayContent;t.reset();const e=this._getInitialPosition();t.initialPosition=e;const i=t.focusedDate||e;t.scrollToDate(i),this._ignoreFocusedDateChange=!0,t.focusedDate=i,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this._focusOverlayOnOpen?(t.focusDateElement(),this._focusOverlayOnOpen=!1):this._focus();const s=this._nativeInput;this._noInput&&s&&(s.blur(),this._overlayContent.focusDateElement()),this.__showOthers=$o(this._noInput?t:[s,t])}_getInitialPosition(){const t=pn(this.initialPosition),e=this._selectedDate||this._overlayContent.initialPosition||t||new Date;return t||cn(e,this._minDate,this._maxDate,this.isDateDisabled)?e:this._minDate||this._maxDate?dn(e,[this._minDate,this._maxDate]):new Date}__commitParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const t=this.__parseDate(this._inputElementValue||"");t?this.__commitDate(t):(this.__keepInputValue=!0,this.__commitDate(null),this.__keepInputValue=!1)}else this._focusedDate&&this.__commitDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this._closedByEscape&&this._applyInputValue(this._selectedDate),this.__commitParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),!this.value&&!this._keyboardActive&&this.validate()}_onScroll(t){(t.target===window||!this._overlayContent.contains(t.target))&&this._overlayContent._repositionYearScroller()}_focus(){this._noInput||this.inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(t){this._inputElementValue=t?this.__formatDate(t):""}_setSelectionRange(t,e){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(t,e)}_onChange(t){t.stopPropagation()}_onClick(t){this._isClearButton(t)||this._onHostClick(t)}_onHostClick(t){(!this.autoOpenDisabled||this._noInput)&&(t.preventDefault(),this.open())}_onClearButtonClick(t){t.preventDefault(),this.__commitDate(null)}_onKeyDown(t){switch(super._onKeyDown(t),this._noInput&&-1===[9].indexOf(t.keyCode)&&t.preventDefault(),t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.opened?this._overlayContent.focusDateElement():(this._focusOverlayOnOpen=!0,this.open());break;case"Tab":this.opened&&(t.preventDefault(),t.stopPropagation(),this._setSelectionRange(0,0),t.shiftKey?this._overlayContent.focusCancel():this._overlayContent.focusDateElement())}}_onEnter(t){this.opened?this.close():this.__commitParsedOrFocusedDate()}_onEscape(t){if(!this.opened){if(this.clearButtonVisible&&this.value&&!this.readonly)return t.stopPropagation(),void this._onClearButtonClick(t);""===this.inputElement.value?this.__commitDate(null):this._applyInputValue(this._selectedDate)}}_isClearButton(t){return t.composedPath()[0]===this.clearElement}_onInput(){if(!this.opened&&this._inputElementValue&&!this.autoOpenDisabled&&this.open(),this._inputElementValue){const t=this.__parseDate(this._inputElementValue);t&&(this._ignoreFocusedDateChange=!0,ln(t,this._focusedDate)||(this._focusedDate=t),this._ignoreFocusedDateChange=!1)}}__computeMinOrMaxDate(t){return pn(t)}}
|
|
3963
3963
|
/**
|
|
3964
3964
|
* @license
|
|
3965
3965
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
@@ -4119,7 +4119,7 @@ Yt("vaadin-password-field-button",rn,{moduleId:"vaadin-password-field-button-sty
|
|
|
4119
4119
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4120
4120
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4121
4121
|
*/
|
|
4122
|
-
const la=t=>class extends(qn(Cr(Fr(
|
|
4122
|
+
const la=t=>class extends(qn(Cr(Fr($r(t))))){static get properties(){return{revealButtonHidden:{type:Boolean,observer:"_revealButtonHiddenChanged",value:!1},passwordVisible:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_passwordVisibleChanged",readOnly:!0},i18n:{type:Object,value:()=>({reveal:"Show password"})}}}static get observers(){return["__i18nChanged(i18n)"]}constructor(){super(),this._setType("password"),this.__boundRevealButtonClick=this._onRevealButtonClick.bind(this),this.__boundRevealButtonMouseDown=this._onRevealButtonMouseDown.bind(this),this.__lastChange=""}get slotStyles(){return[...super.slotStyles,`\n ${this.localName} [slot="input"]::-ms-reveal {\n display: none;\n }\n `]}get _revealNode(){return this._revealButtonController&&this._revealButtonController.node}ready(){super.ready(),this._revealPart=this.shadowRoot.querySelector('[part="reveal-button"]'),this._revealButtonController=new qs(this,"reveal","vaadin-password-field-button",{initializer:t=>{t.disabled=this.disabled,t.addEventListener("click",this.__boundRevealButtonClick),t.addEventListener("mousedown",this.__boundRevealButtonMouseDown)}}),this.addController(this._revealButtonController),this.__updateAriaLabel(this.i18n),this._updateToggleState(!1),this._toggleRevealHidden(this.revealButtonHidden),this.inputElement&&(this.inputElement.autocapitalize="off")}_onChange(t){super._onChange(t),this.__lastChange=this.inputElement.value}_shouldSetFocus(t){return t.target===this.inputElement||t.target===this._revealNode}_shouldRemoveFocus(t){return!(t.relatedTarget===this._revealNode||t.relatedTarget===this.inputElement&&t.target===this._revealNode)}_setFocused(t){if(super._setFocused(t),t){const t=this.getRootNode().activeElement===this._revealNode;this.toggleAttribute("focus-ring",this._keyboardActive&&!t)}else this._setPasswordVisible(!1),this.__lastChange!==this.inputElement.value&&(this.__lastChange=this.inputElement.value,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}__updateAriaLabel(t){t&&t.reveal&&this._revealNode&&this._revealNode.setAttribute("aria-label",t.reveal)}__i18nChanged(t){this.__updateAriaLabel(t)}_revealButtonHiddenChanged(t){this._toggleRevealHidden(t)}_togglePasswordVisibility(){this._setPasswordVisible(!this.passwordVisible)}_onRevealButtonClick(){this._togglePasswordVisibility()}_onRevealButtonMouseDown(t){t.preventDefault(),this.inputElement.focus()}_toggleRevealHidden(t){this._revealNode&&(t?(this._revealPart.setAttribute("hidden",""),this._revealNode.setAttribute("tabindex","-1"),this._revealNode.setAttribute("aria-hidden","true")):(this._revealPart.removeAttribute("hidden"),this._revealNode.setAttribute("tabindex","0"),this._revealNode.removeAttribute("aria-hidden")))}_updateToggleState(t){this._revealNode&&this._revealNode.setAttribute("aria-pressed",t?"true":"false")}_passwordVisibleChanged(t){this._setType(t?"text":"password"),this._updateToggleState(t)}_disabledChanged(t,e){super._disabledChanged(t,e),this._revealNode&&(this._revealNode.disabled=t)}}
|
|
4123
4123
|
/**
|
|
4124
4124
|
* @license
|
|
4125
4125
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -4460,12 +4460,12 @@ const Ma=t=>class extends(Jn(t)){static get properties(){return{pattern:{type:St
|
|
|
4460
4460
|
* @license
|
|
4461
4461
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4462
4462
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4463
|
-
*/function Ra(t){return null!=t}function La(t,e){return t.findIndex((t=>!(t instanceof Aa)&&e(t)))}const Wa=t=>class extends(ta(Jr(ro(Fr(Sr(Wr(Cr(t)))))))){static get properties(){return{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,sync:!0,observer:"_openedChanged"},autoOpenDisabled:{type:Boolean,sync:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Object,sync:!0},items:{type:Array,sync:!0,observer:"_itemsChanged"},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array,observer:"_filteredItemsChanged",sync:!0},_lastCommittedValue:String,loading:{type:Boolean,value:!1,reflectToAttribute:!0,sync:!0},_focusedIndex:{type:Number,observer:"_focusedIndexChanged",value:-1,sync:!0},filter:{type:String,value:"",notify:!0,sync:!0},selectedItem:{type:Object,notify:!0,sync:!0},itemClassNameGenerator:{type:Object},itemLabelPath:{type:String,value:"label",observer:"_itemLabelPathChanged",sync:!0},itemValuePath:{type:String,value:"value",sync:!0},itemIdPath:{type:String,sync:!0},_toggleElement:{type:Object,observer:"_toggleElementChanged"},_dropdownItems:{type:Array,sync:!0},_closeOnBlurIsPrevented:Boolean,_scroller:{type:Object,sync:!0},_overlayOpened:{type:Boolean,sync:!0,observer:"_overlayOpenedChanged"},__keepOverlayOpened:{type:Boolean,sync:!0}}}static get observers(){return["_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)","_openedOrItemsChanged(opened, _dropdownItems, loading, __keepOverlayOpened)","_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, _theme, itemClassNameGenerator)"]}constructor(){super(),this._boundOverlaySelectedItemChanged=this._overlaySelectedItemChanged.bind(this),this._boundOnClearButtonMouseDown=this.__onClearButtonMouseDown.bind(this),this._boundOnClick=this._onClick.bind(this),this._boundOnOverlayTouchAction=this._onOverlayTouchAction.bind(this),this._boundOnTouchend=this._onTouchend.bind(this)}get _tagNamePrefix(){return"vaadin-combo-box"}get _nativeInput(){return this.inputElement}_inputElementChanged(t){super._inputElementChanged(t);const e=this._nativeInput;e&&(e.autocomplete="off",e.autocapitalize="off",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",!!this.opened),e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),this._revertInputValueToValue(),this.clearElement&&this.clearElement.addEventListener("mousedown",this._boundOnClearButtonMouseDown))}ready(){super.ready(),this._initOverlay(),this._initScroller(),this._lastCommittedValue=this.value,this.addEventListener("click",this._boundOnClick),this.addEventListener("touchend",this._boundOnTouchend);const t=()=>{requestAnimationFrame((()=>{this._overlayElement.bringToFront()}))};this.addEventListener("mousedown",t),this.addEventListener("touchstart",t),ja(this),this.addController(new ea(this))}disconnectedCallback(){super.disconnectedCallback(),this.close()}requestContentUpdate(){this._scroller&&(this._scroller.requestContentUpdate(),this._getItemElements().forEach((t=>{t.requestContentUpdate()})))}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.opened=!1}_propertiesChanged(t,e,i){super._propertiesChanged(t,e,i),void 0!==e.filter&&this._filterChanged(e.filter)}updated(t){super.updated(t),t.has("filter")&&this._filterChanged(this.filter)}_initOverlay(){const t=this.$.overlay;t._comboBox=this,t.addEventListener("touchend",this._boundOnOverlayTouchAction),t.addEventListener("touchmove",this._boundOnOverlayTouchAction),t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("opened-changed",(t=>{this._overlayOpened=t.detail.value})),this._overlayElement=t}_initScroller(t){const e=document.createElement(`${this._tagNamePrefix}-scroller`);e.owner=t||this,e.getItemLabel=this._getItemLabel.bind(this),e.addEventListener("selection-changed",this._boundOverlaySelectedItemChanged);const i=this._overlayElement;i.renderer=t=>{t.innerHTML||t.appendChild(e)},i.requestContentUpdate(),this._scroller=e}_updateScroller(t,e,i,s,r,o,n,a,l,h){if(t&&(i&&(t.style.maxHeight=getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`)||"65vh"),t.setProperties({items:i?e:[],opened:i,loading:s,selectedItem:r,itemIdPath:o,focusedIndex:n,renderer:a,theme:l,itemClassNameGenerator:h}),t.performUpdate&&!t.hasUpdated))try{t.performUpdate()}catch(t){}}_openedOrItemsChanged(t,e,i,s){this._overlayOpened=t&&(s||i||!(!e||!e.length))}_overlayOpenedChanged(t,e){t?(this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-opened",{bubbles:!0,composed:!0})),this._onOpened()):e&&this._dropdownItems&&this._dropdownItems.length&&(this.close(),this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-closed",{bubbles:!0,composed:!0})))}_focusedIndexChanged(t,e){void 0!==e&&this._updateActiveDescendant(t)}_isInputFocused(){return this.inputElement&&Or(this.inputElement)}_updateActiveDescendant(t){const e=this._nativeInput;if(!e)return;const i=this._getItemElements().find((e=>e.index===t));i?e.setAttribute("aria-activedescendant",i.id):e.removeAttribute("aria-activedescendant")}_openedChanged(t,e){if(void 0===e)return;t?!this._isInputFocused()&&!Bo&&this.inputElement&&this.inputElement.focus():this._onClosed();const i=this._nativeInput;i&&(i.setAttribute("aria-expanded",!!t),t?i.setAttribute("aria-controls",this._scroller.id):i.removeAttribute("aria-controls"))}_onOverlayTouchAction(){this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1}_isClearButton(t){return t.composedPath()[0]===this.clearElement}__onClearButtonMouseDown(t){t.preventDefault(),this.inputElement.focus()}_onClearButtonClick(t){t.preventDefault(),this._onClearAction(),this.opened&&this.requestContentUpdate()}_onToggleButtonClick(t){t.preventDefault(),this.opened?this.close():this.open()}_onHostClick(t){this.autoOpenDisabled||(t.preventDefault(),this.open())}_onClick(t){this._isClearButton(t)?this._onClearButtonClick(t):t.composedPath().includes(this._toggleElement)?this._onToggleButtonClick(t):this._onHostClick(t)}_onKeyDown(t){super._onKeyDown(t),"ArrowDown"===t.key?(this._onArrowDown(),t.preventDefault()):"ArrowUp"===t.key&&(this._onArrowUp(),t.preventDefault())}_getItemLabel(t){let e=t&&this.itemLabelPath?xa(this.itemLabelPath,t):void 0;return null==e&&(e=t?t.toString():""),e}_getItemValue(t){let e=t&&this.itemValuePath?xa(this.itemValuePath,t):void 0;return void 0===e&&(e=t?t.toString():""),e}_onArrowDown(){if(this.opened){const t=this._dropdownItems;t&&(this._focusedIndex=Math.min(t.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel())}else this.open()}_onArrowUp(){if(this.opened){if(this._focusedIndex>-1)this._focusedIndex=Math.max(0,this._focusedIndex-1);else{const t=this._dropdownItems;t&&(this._focusedIndex=t.length-1)}this._prefillFocusedItemLabel()}else this.open()}_prefillFocusedItemLabel(){this._focusedIndex>-1&&(this._inputElementValue=this._getItemLabel(this._dropdownItems[this._focusedIndex]),this._markAllSelectionRange())}_setSelectionRange(t,e){this._isInputFocused()&&this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(t,e)}_markAllSelectionRange(){void 0!==this._inputElementValue&&this._setSelectionRange(0,this._inputElementValue.length)}_clearSelectionRange(){if(void 0!==this._inputElementValue){const t=this._inputElementValue?this._inputElementValue.length:0;this._setSelectionRange(t,t)}}_closeOrCommit(){this.opened||this.loading?this.close():this._commitValue()}_onEnter(t){if(!this._hasValidInputValue())return t.preventDefault(),void t.stopPropagation();this.opened&&(t.preventDefault(),t.stopPropagation()),this._closeOrCommit()}_hasValidInputValue(){const t=this._focusedIndex<0&&""!==this._inputElementValue&&this._getItemLabel(this.selectedItem)!==this._inputElementValue;return this.allowCustomValue||!t}_onEscape(t){this.autoOpenDisabled&&(this.opened||this.value!==this._inputElementValue&&this._inputElementValue.length>0)?(t.stopPropagation(),this._focusedIndex=-1,this.cancel()):this.opened?(t.stopPropagation(),this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel()):this.clearButtonVisible&&this.value&&!this.readonly&&(t.stopPropagation(),this._onClearAction())}_toggleElementChanged(t){t&&(t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("click",(()=>{Bo&&!this._isInputFocused()&&document.activeElement.blur()})))}_onClearAction(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this._detectAndDispatchChange()}_clearFilter(){this.filter=""}cancel(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this._closeOrCommit()}_onOpened(){this._lastCommittedValue=this.value}_onClosed(){(!this.loading||this.allowCustomValue)&&this._commitValue()}_commitValue(){if(this._focusedIndex>-1){const t=this._dropdownItems[this._focusedIndex];this.selectedItem!==t&&(this.selectedItem=t),this._inputElementValue=this._getItemLabel(this.selectedItem),this._focusedIndex=-1}else if(""===this._inputElementValue||void 0===this._inputElementValue)this.selectedItem=null,this.allowCustomValue&&(this.value="");else{const t=[this.selectedItem,...this._dropdownItems||[]],e=t[this.__getItemIndexByLabel(t,this._inputElementValue)];if(this.allowCustomValue&&!e){const t=this._inputElementValue;this._lastCustomValue=t;const e=new CustomEvent("custom-value-set",{detail:t,composed:!0,cancelable:!0,bubbles:!0});this.dispatchEvent(e),e.defaultPrevented||(this.value=t)}else this.allowCustomValue||this.opened||!e?this._revertInputValueToValue():this.value=this._getItemValue(e)}this._detectAndDispatchChange(),this._clearSelectionRange(),this._clearFilter()}_onInput(t){const e=this._inputElementValue,i={};this.filter===e?this._filterChanged(this.filter):i.filter=e,!this.opened&&!this._isClearButton(t)&&!this.autoOpenDisabled&&(i.opened=!0),this.setProperties(i)}_onChange(t){t.stopPropagation()}_itemLabelPathChanged(t){"string"!=typeof t&&console.error("You should set itemLabelPath to a valid string")}_filterChanged(t){this._scrollIntoView(0),this._focusedIndex=-1,this.items?this.filteredItems=this._filterItems(this.items,t):this._filteredItemsChanged(this.filteredItems)}_revertInputValue(){""!==this.filter?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()}_revertInputValueToValue(){this._inputElementValue=this.allowCustomValue&&!this.selectedItem?this.value:this._getItemLabel(this.selectedItem)}_selectedItemChanged(t){if(null==t)this.filteredItems&&(this.allowCustomValue||(this.value=""),this._toggleHasValue(this._hasValue),this._inputElementValue=this.value);else{const e=this._getItemValue(t);if(this.value!==e&&(this.value=e,this.value!==e))return;this._toggleHasValue(!0),this._inputElementValue=this._getItemLabel(t)}}_valueChanged(t,e){""===t&&void 0===e||(Ra(t)?(this._getItemValue(this.selectedItem)!==t&&this._selectItemForValue(t),!this.selectedItem&&this.allowCustomValue&&(this._inputElementValue=t),this._toggleHasValue(this._hasValue)):this.selectedItem=null,this._clearFilter(),this._lastCommittedValue=void 0)}_detectAndDispatchChange(){document.hasFocus()&&this.validate(),this.value!==this._lastCommittedValue&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._lastCommittedValue=this.value)}_itemsChanged(t,e){this._ensureItemsOrDataProvider((()=>{this.items=e})),t?this.filteredItems=t.slice(0):e&&(this.filteredItems=null)}_filteredItemsChanged(t){this._setDropdownItems(t)}_filterItems(t,e){return t&&t.filter((t=>(e=e?e.toString().toLowerCase():"",this._getItemLabel(t).toString().toLowerCase().indexOf(e)>-1)))}_selectItemForValue(t){const e=this.__getItemIndexByValue(this.filteredItems,t),i=this.selectedItem;this.selectedItem=e>=0?this.filteredItems[e]:this.dataProvider&&void 0===this.selectedItem?void 0:null,null===this.selectedItem&&null===i&&this._selectedItemChanged(this.selectedItem)}_setDropdownItems(t){const e=this._dropdownItems;this._dropdownItems=t;const i=e?e[this._focusedIndex]:null,s=this.__getItemIndexByValue(t,this.value);null==this.selectedItem&&s>=0&&(this.selectedItem=t[s]);const r=this.__getItemIndexByValue(t,this._getItemValue(i));this._focusedIndex=r>-1?r:this.__getItemIndexByLabel(t,this.filter)}_getItemElements(){return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`))}_scrollIntoView(t){this._scroller&&this._scroller.scrollIntoView(t)}__getItemIndexByValue(t,e){return t&&Ra(e)?La(t,(t=>this._getItemValue(t)===e)):-1}__getItemIndexByLabel(t,e){return t&&e?La(t,(t=>this._getItemLabel(t).toString().toLowerCase()===e.toString().toLowerCase())):-1}_overlaySelectedItemChanged(t){t.stopPropagation(),!(t.detail.item instanceof Aa)&&this.opened&&(this._focusedIndex=this.filteredItems.indexOf(t.detail.item),this.close())}_setFocused(t){if(super._setFocused(t),!t&&!this.readonly&&!this._closeOnBlurIsPrevented){if(!this.opened&&this.allowCustomValue&&this._inputElementValue===this._lastCustomValue)return void delete this._lastCustomValue;if(Ir())return void this._closeOrCommit();this.opened?this._overlayOpened||this.close():this._commitValue()}}_shouldRemoveFocus(t){return!(t.relatedTarget&&t.relatedTarget.localName===`${this._tagNamePrefix}-item`||t.relatedTarget===this._overlayElement&&(t.composedPath()[0].focus(),1))}_onTouchend(t){!this.clearElement||t.composedPath()[0]!==this.clearElement||(t.preventDefault(),this._onClearAction())}}
|
|
4463
|
+
*/function Ra(t){return null!=t}function La(t,e){return t.findIndex((t=>!(t instanceof Aa)&&e(t)))}const $a=t=>class extends(ta(Jr(ro(Fr(Sr($r(Cr(t)))))))){static get properties(){return{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,sync:!0,observer:"_openedChanged"},autoOpenDisabled:{type:Boolean,sync:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Object,sync:!0},items:{type:Array,sync:!0,observer:"_itemsChanged"},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array,observer:"_filteredItemsChanged",sync:!0},_lastCommittedValue:String,loading:{type:Boolean,value:!1,reflectToAttribute:!0,sync:!0},_focusedIndex:{type:Number,observer:"_focusedIndexChanged",value:-1,sync:!0},filter:{type:String,value:"",notify:!0,sync:!0},selectedItem:{type:Object,notify:!0,sync:!0},itemClassNameGenerator:{type:Object},itemLabelPath:{type:String,value:"label",observer:"_itemLabelPathChanged",sync:!0},itemValuePath:{type:String,value:"value",sync:!0},itemIdPath:{type:String,sync:!0},_toggleElement:{type:Object,observer:"_toggleElementChanged"},_dropdownItems:{type:Array,sync:!0},_closeOnBlurIsPrevented:Boolean,_scroller:{type:Object,sync:!0},_overlayOpened:{type:Boolean,sync:!0,observer:"_overlayOpenedChanged"},__keepOverlayOpened:{type:Boolean,sync:!0}}}static get observers(){return["_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)","_openedOrItemsChanged(opened, _dropdownItems, loading, __keepOverlayOpened)","_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, _theme, itemClassNameGenerator)"]}constructor(){super(),this._boundOverlaySelectedItemChanged=this._overlaySelectedItemChanged.bind(this),this._boundOnClearButtonMouseDown=this.__onClearButtonMouseDown.bind(this),this._boundOnClick=this._onClick.bind(this),this._boundOnOverlayTouchAction=this._onOverlayTouchAction.bind(this),this._boundOnTouchend=this._onTouchend.bind(this)}get _tagNamePrefix(){return"vaadin-combo-box"}get _nativeInput(){return this.inputElement}_inputElementChanged(t){super._inputElementChanged(t);const e=this._nativeInput;e&&(e.autocomplete="off",e.autocapitalize="off",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",!!this.opened),e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),this._revertInputValueToValue(),this.clearElement&&this.clearElement.addEventListener("mousedown",this._boundOnClearButtonMouseDown))}ready(){super.ready(),this._initOverlay(),this._initScroller(),this._lastCommittedValue=this.value,this.addEventListener("click",this._boundOnClick),this.addEventListener("touchend",this._boundOnTouchend);const t=()=>{requestAnimationFrame((()=>{this._overlayElement.bringToFront()}))};this.addEventListener("mousedown",t),this.addEventListener("touchstart",t),ja(this),this.addController(new ea(this))}disconnectedCallback(){super.disconnectedCallback(),this.close()}requestContentUpdate(){this._scroller&&(this._scroller.requestContentUpdate(),this._getItemElements().forEach((t=>{t.requestContentUpdate()})))}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.opened=!1}_propertiesChanged(t,e,i){super._propertiesChanged(t,e,i),void 0!==e.filter&&this._filterChanged(e.filter)}updated(t){super.updated(t),t.has("filter")&&this._filterChanged(this.filter)}_initOverlay(){const t=this.$.overlay;t._comboBox=this,t.addEventListener("touchend",this._boundOnOverlayTouchAction),t.addEventListener("touchmove",this._boundOnOverlayTouchAction),t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("opened-changed",(t=>{this._overlayOpened=t.detail.value})),this._overlayElement=t}_initScroller(t){const e=document.createElement(`${this._tagNamePrefix}-scroller`);e.owner=t||this,e.getItemLabel=this._getItemLabel.bind(this),e.addEventListener("selection-changed",this._boundOverlaySelectedItemChanged);const i=this._overlayElement;i.renderer=t=>{t.innerHTML||t.appendChild(e)},i.requestContentUpdate(),this._scroller=e}_updateScroller(t,e,i,s,r,o,n,a,l,h){if(t&&(i&&(t.style.maxHeight=getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`)||"65vh"),t.setProperties({items:i?e:[],opened:i,loading:s,selectedItem:r,itemIdPath:o,focusedIndex:n,renderer:a,theme:l,itemClassNameGenerator:h}),t.performUpdate&&!t.hasUpdated))try{t.performUpdate()}catch(t){}}_openedOrItemsChanged(t,e,i,s){this._overlayOpened=t&&(s||i||!(!e||!e.length))}_overlayOpenedChanged(t,e){t?(this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-opened",{bubbles:!0,composed:!0})),this._onOpened()):e&&this._dropdownItems&&this._dropdownItems.length&&(this.close(),this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-closed",{bubbles:!0,composed:!0})))}_focusedIndexChanged(t,e){void 0!==e&&this._updateActiveDescendant(t)}_isInputFocused(){return this.inputElement&&Or(this.inputElement)}_updateActiveDescendant(t){const e=this._nativeInput;if(!e)return;const i=this._getItemElements().find((e=>e.index===t));i?e.setAttribute("aria-activedescendant",i.id):e.removeAttribute("aria-activedescendant")}_openedChanged(t,e){if(void 0===e)return;t?!this._isInputFocused()&&!Bo&&this.inputElement&&this.inputElement.focus():this._onClosed();const i=this._nativeInput;i&&(i.setAttribute("aria-expanded",!!t),t?i.setAttribute("aria-controls",this._scroller.id):i.removeAttribute("aria-controls"))}_onOverlayTouchAction(){this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1}_isClearButton(t){return t.composedPath()[0]===this.clearElement}__onClearButtonMouseDown(t){t.preventDefault(),this.inputElement.focus()}_onClearButtonClick(t){t.preventDefault(),this._onClearAction(),this.opened&&this.requestContentUpdate()}_onToggleButtonClick(t){t.preventDefault(),this.opened?this.close():this.open()}_onHostClick(t){this.autoOpenDisabled||(t.preventDefault(),this.open())}_onClick(t){this._isClearButton(t)?this._onClearButtonClick(t):t.composedPath().includes(this._toggleElement)?this._onToggleButtonClick(t):this._onHostClick(t)}_onKeyDown(t){super._onKeyDown(t),"ArrowDown"===t.key?(this._onArrowDown(),t.preventDefault()):"ArrowUp"===t.key&&(this._onArrowUp(),t.preventDefault())}_getItemLabel(t){let e=t&&this.itemLabelPath?xa(this.itemLabelPath,t):void 0;return null==e&&(e=t?t.toString():""),e}_getItemValue(t){let e=t&&this.itemValuePath?xa(this.itemValuePath,t):void 0;return void 0===e&&(e=t?t.toString():""),e}_onArrowDown(){if(this.opened){const t=this._dropdownItems;t&&(this._focusedIndex=Math.min(t.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel())}else this.open()}_onArrowUp(){if(this.opened){if(this._focusedIndex>-1)this._focusedIndex=Math.max(0,this._focusedIndex-1);else{const t=this._dropdownItems;t&&(this._focusedIndex=t.length-1)}this._prefillFocusedItemLabel()}else this.open()}_prefillFocusedItemLabel(){this._focusedIndex>-1&&(this._inputElementValue=this._getItemLabel(this._dropdownItems[this._focusedIndex]),this._markAllSelectionRange())}_setSelectionRange(t,e){this._isInputFocused()&&this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(t,e)}_markAllSelectionRange(){void 0!==this._inputElementValue&&this._setSelectionRange(0,this._inputElementValue.length)}_clearSelectionRange(){if(void 0!==this._inputElementValue){const t=this._inputElementValue?this._inputElementValue.length:0;this._setSelectionRange(t,t)}}_closeOrCommit(){this.opened||this.loading?this.close():this._commitValue()}_onEnter(t){if(!this._hasValidInputValue())return t.preventDefault(),void t.stopPropagation();this.opened&&(t.preventDefault(),t.stopPropagation()),this._closeOrCommit()}_hasValidInputValue(){const t=this._focusedIndex<0&&""!==this._inputElementValue&&this._getItemLabel(this.selectedItem)!==this._inputElementValue;return this.allowCustomValue||!t}_onEscape(t){this.autoOpenDisabled&&(this.opened||this.value!==this._inputElementValue&&this._inputElementValue.length>0)?(t.stopPropagation(),this._focusedIndex=-1,this.cancel()):this.opened?(t.stopPropagation(),this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel()):this.clearButtonVisible&&this.value&&!this.readonly&&(t.stopPropagation(),this._onClearAction())}_toggleElementChanged(t){t&&(t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("click",(()=>{Bo&&!this._isInputFocused()&&document.activeElement.blur()})))}_onClearAction(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this._detectAndDispatchChange()}_clearFilter(){this.filter=""}cancel(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this._closeOrCommit()}_onOpened(){this._lastCommittedValue=this.value}_onClosed(){(!this.loading||this.allowCustomValue)&&this._commitValue()}_commitValue(){if(this._focusedIndex>-1){const t=this._dropdownItems[this._focusedIndex];this.selectedItem!==t&&(this.selectedItem=t),this._inputElementValue=this._getItemLabel(this.selectedItem),this._focusedIndex=-1}else if(""===this._inputElementValue||void 0===this._inputElementValue)this.selectedItem=null,this.allowCustomValue&&(this.value="");else{const t=[this.selectedItem,...this._dropdownItems||[]],e=t[this.__getItemIndexByLabel(t,this._inputElementValue)];if(this.allowCustomValue&&!e){const t=this._inputElementValue;this._lastCustomValue=t;const e=new CustomEvent("custom-value-set",{detail:t,composed:!0,cancelable:!0,bubbles:!0});this.dispatchEvent(e),e.defaultPrevented||(this.value=t)}else this.allowCustomValue||this.opened||!e?this._revertInputValueToValue():this.value=this._getItemValue(e)}this._detectAndDispatchChange(),this._clearSelectionRange(),this._clearFilter()}_onInput(t){const e=this._inputElementValue,i={};this.filter===e?this._filterChanged(this.filter):i.filter=e,!this.opened&&!this._isClearButton(t)&&!this.autoOpenDisabled&&(i.opened=!0),this.setProperties(i)}_onChange(t){t.stopPropagation()}_itemLabelPathChanged(t){"string"!=typeof t&&console.error("You should set itemLabelPath to a valid string")}_filterChanged(t){this._scrollIntoView(0),this._focusedIndex=-1,this.items?this.filteredItems=this._filterItems(this.items,t):this._filteredItemsChanged(this.filteredItems)}_revertInputValue(){""!==this.filter?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()}_revertInputValueToValue(){this._inputElementValue=this.allowCustomValue&&!this.selectedItem?this.value:this._getItemLabel(this.selectedItem)}_selectedItemChanged(t){if(null==t)this.filteredItems&&(this.allowCustomValue||(this.value=""),this._toggleHasValue(this._hasValue),this._inputElementValue=this.value);else{const e=this._getItemValue(t);if(this.value!==e&&(this.value=e,this.value!==e))return;this._toggleHasValue(!0),this._inputElementValue=this._getItemLabel(t)}}_valueChanged(t,e){""===t&&void 0===e||(Ra(t)?(this._getItemValue(this.selectedItem)!==t&&this._selectItemForValue(t),!this.selectedItem&&this.allowCustomValue&&(this._inputElementValue=t),this._toggleHasValue(this._hasValue)):this.selectedItem=null,this._clearFilter(),this._lastCommittedValue=void 0)}_detectAndDispatchChange(){document.hasFocus()&&this.validate(),this.value!==this._lastCommittedValue&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._lastCommittedValue=this.value)}_itemsChanged(t,e){this._ensureItemsOrDataProvider((()=>{this.items=e})),t?this.filteredItems=t.slice(0):e&&(this.filteredItems=null)}_filteredItemsChanged(t){this._setDropdownItems(t)}_filterItems(t,e){return t&&t.filter((t=>(e=e?e.toString().toLowerCase():"",this._getItemLabel(t).toString().toLowerCase().indexOf(e)>-1)))}_selectItemForValue(t){const e=this.__getItemIndexByValue(this.filteredItems,t),i=this.selectedItem;this.selectedItem=e>=0?this.filteredItems[e]:this.dataProvider&&void 0===this.selectedItem?void 0:null,null===this.selectedItem&&null===i&&this._selectedItemChanged(this.selectedItem)}_setDropdownItems(t){const e=this._dropdownItems;this._dropdownItems=t;const i=e?e[this._focusedIndex]:null,s=this.__getItemIndexByValue(t,this.value);null==this.selectedItem&&s>=0&&(this.selectedItem=t[s]);const r=this.__getItemIndexByValue(t,this._getItemValue(i));this._focusedIndex=r>-1?r:this.__getItemIndexByLabel(t,this.filter)}_getItemElements(){return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`))}_scrollIntoView(t){this._scroller&&this._scroller.scrollIntoView(t)}__getItemIndexByValue(t,e){return t&&Ra(e)?La(t,(t=>this._getItemValue(t)===e)):-1}__getItemIndexByLabel(t,e){return t&&e?La(t,(t=>this._getItemLabel(t).toString().toLowerCase()===e.toString().toLowerCase())):-1}_overlaySelectedItemChanged(t){t.stopPropagation(),!(t.detail.item instanceof Aa)&&this.opened&&(this._focusedIndex=this.filteredItems.indexOf(t.detail.item),this.close())}_setFocused(t){if(super._setFocused(t),!t&&!this.readonly&&!this._closeOnBlurIsPrevented){if(!this.opened&&this.allowCustomValue&&this._inputElementValue===this._lastCustomValue)return void delete this._lastCustomValue;if(Ir())return void this._closeOrCommit();this.opened?this._overlayOpened||this.close():this._commitValue()}}_shouldRemoveFocus(t){return!(t.relatedTarget&&t.relatedTarget.localName===`${this._tagNamePrefix}-item`||t.relatedTarget===this._overlayElement&&(t.composedPath()[0].focus(),1))}_onTouchend(t){!this.clearElement||t.composedPath()[0]!==this.clearElement||(t.preventDefault(),this._onClearAction())}}
|
|
4464
4464
|
/**
|
|
4465
4465
|
* @license
|
|
4466
4466
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4467
4467
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4468
|
-
*/;Yt("vaadin-combo-box",Qn,{moduleId:"vaadin-combo-box-styles"});class
|
|
4468
|
+
*/;Yt("vaadin-combo-box",Qn,{moduleId:"vaadin-combo-box-styles"});class Wa extends(Fa($a(Ma(Kn(Qt(Rs(fs))))))){static get is(){return"vaadin-combo-box"}static get template(){return ps`
|
|
4469
4469
|
<style>
|
|
4470
4470
|
:host([opened]) {
|
|
4471
4471
|
pointer-events: auto;
|
|
@@ -4510,7 +4510,7 @@ const Ma=t=>class extends(Jn(t)){static get properties(){return{pattern:{type:St
|
|
|
4510
4510
|
></vaadin-combo-box-overlay>
|
|
4511
4511
|
|
|
4512
4512
|
<slot name="tooltip"></slot>
|
|
4513
|
-
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new no(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new ao(this.inputElement,this._labelController)),this._tooltipController=new Ys(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}D(
|
|
4513
|
+
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new no(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new ao(this.inputElement,this._labelController)),this._tooltipController=new Ys(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}D(Wa),Yt("vaadin-multi-select-combo-box-chip",[yo,B`
|
|
4514
4514
|
:host {
|
|
4515
4515
|
font-size: var(--lumo-font-size-xxs);
|
|
4516
4516
|
line-height: 1;
|
|
@@ -4797,7 +4797,7 @@ class qa extends(Ia(fs)){static get is(){return"vaadin-multi-select-combo-box-sc
|
|
|
4797
4797
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4798
4798
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4799
4799
|
*/
|
|
4800
|
-
class Ya extends(Fa(
|
|
4800
|
+
class Ya extends(Fa($a(Qt(fs)))){static get is(){return"vaadin-multi-select-combo-box-internal"}static get template(){return ps`
|
|
4801
4801
|
<style>
|
|
4802
4802
|
:host([opened]) {
|
|
4803
4803
|
pointer-events: auto;
|
|
@@ -6654,7 +6654,7 @@ Yt("vaadin-tabs",B`
|
|
|
6654
6654
|
</div>
|
|
6655
6655
|
|
|
6656
6656
|
<div on-click="_scrollForward" part="forward-button" aria-hidden="true"></div>
|
|
6657
|
-
`}static get is(){return"vaadin-tabs"}}function Dl(t){return Dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dl(t)}function Al(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Il(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function zl(t){Il(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===Dl(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}D(Tl);var Ml={};function Nl(){return Ml}function Pl(t){Il(1,arguments);var e=zl(t),i=e.getUTCDay(),s=(i<1?7:0)+i-1;return e.setUTCDate(e.getUTCDate()-s),e.setUTCHours(0,0,0,0),e}function Bl(t){Il(1,arguments);var e=zl(t),i=e.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(i+1,0,4),s.setUTCHours(0,0,0,0);var r=Pl(s),o=new Date(0);o.setUTCFullYear(i,0,4),o.setUTCHours(0,0,0,0);var n=Pl(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=n.getTime()?i:i-1}function Ol(t,e){var i,s,r,o,n,a,l,h;Il(1,arguments);var c=Nl(),d=Al(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(n=e.locale)||void 0===n||null===(a=n.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==r?r:c.weekStartsOn)&&void 0!==s?s:null===(l=c.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==i?i:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=zl(t),p=u.getUTCDay(),m=(p<d?7:0)+p-d;return u.setUTCDate(u.getUTCDate()-m),u.setUTCHours(0,0,0,0),u}function El(t,e){var i,s,r,o,n,a,l,h;Il(1,arguments);var c=zl(t),d=c.getUTCFullYear(),u=Nl(),p=Al(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(n=e.locale)||void 0===n||null===(a=n.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==s?s:null===(l=u.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(d+1,0,p),m.setUTCHours(0,0,0,0);var f=Ol(m,e),v=new Date(0);v.setUTCFullYear(d,0,p),v.setUTCHours(0,0,0,0);var b=Ol(v,e);return c.getTime()>=f.getTime()?d+1:c.getTime()>=b.getTime()?d:d-1}function Fl(t,e){for(var i=t<0?"-":"",s=Math.abs(t).toString();s.length<e;)s="0"+s;return i+s}const jl=function(t,e){var i=t.getUTCFullYear(),s=i>0?i:1-i;return Fl("yy"===e?s%100:s,e.length)},Rl=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):Fl(i+1,2)},Ll=function(t,e){return Fl(t.getUTCDate(),e.length)},Wl=function(t,e){return Fl(t.getUTCHours()%12||12,e.length)},$l=function(t,e){return Fl(t.getUTCHours(),e.length)},Hl=function(t,e){return Fl(t.getUTCMinutes(),e.length)},Gl=function(t,e){return Fl(t.getUTCSeconds(),e.length)},Ul=function(t,e){var i=e.length,s=t.getUTCMilliseconds();return Fl(Math.floor(s*Math.pow(10,i-3)),e.length)};var Vl={G:function(t,e,i){var s=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(s,{width:"abbreviated"});case"GGGGG":return i.era(s,{width:"narrow"});default:return i.era(s,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var s=t.getUTCFullYear();return i.ordinalNumber(s>0?s:1-s,{unit:"year"})}return jl(t,e)},Y:function(t,e,i,s){var r=El(t,s),o=r>0?r:1-r;return"YY"===e?Fl(o%100,2):"Yo"===e?i.ordinalNumber(o,{unit:"year"}):Fl(o,e.length)},R:function(t,e){return Fl(Bl(t),e.length)},u:function(t,e){return Fl(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var s=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return Fl(s,2);case"Qo":return i.ordinalNumber(s,{unit:"quarter"});case"QQQ":return i.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(s,{width:"narrow",context:"formatting"});default:return i.quarter(s,{width:"wide",context:"formatting"})}},q:function(t,e,i){var s=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return Fl(s,2);case"qo":return i.ordinalNumber(s,{unit:"quarter"});case"qqq":return i.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(s,{width:"narrow",context:"standalone"});default:return i.quarter(s,{width:"wide",context:"standalone"})}},M:function(t,e,i){var s=t.getUTCMonth();switch(e){case"M":case"MM":return Rl(t,e);case"Mo":return i.ordinalNumber(s+1,{unit:"month"});case"MMM":return i.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(s,{width:"narrow",context:"formatting"});default:return i.month(s,{width:"wide",context:"formatting"})}},L:function(t,e,i){var s=t.getUTCMonth();switch(e){case"L":return String(s+1);case"LL":return Fl(s+1,2);case"Lo":return i.ordinalNumber(s+1,{unit:"month"});case"LLL":return i.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(s,{width:"narrow",context:"standalone"});default:return i.month(s,{width:"wide",context:"standalone"})}},w:function(t,e,i,s){var r=function(t,e){Il(1,arguments);var i=zl(t),s=Ol(i,e).getTime()-function(t,e){var i,s,r,o,n,a,l,h;Il(1,arguments);var c=Nl(),d=Al(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(n=e.locale)||void 0===n||null===(a=n.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==r?r:c.firstWeekContainsDate)&&void 0!==s?s:null===(l=c.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1),u=El(t,e),p=new Date(0);return p.setUTCFullYear(u,0,d),p.setUTCHours(0,0,0,0),Ol(p,e)}(i,e).getTime();return Math.round(s/6048e5)+1}(t,s);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):Fl(r,e.length)},I:function(t,e,i){var s=function(t){Il(1,arguments);var e=zl(t),i=Pl(e).getTime()-function(t){Il(1,arguments);var e=Bl(t),i=new Date(0);return i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0),Pl(i)}(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(s,{unit:"week"}):Fl(s,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):Ll(t,e)},D:function(t,e,i){var s=function(t){Il(1,arguments);var e=zl(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime();return Math.floor((i-s)/864e5)+1}(t);return"Do"===e?i.ordinalNumber(s,{unit:"dayOfYear"}):Fl(s,e.length)},E:function(t,e,i){var s=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(s,{width:"short",context:"formatting"});default:return i.day(s,{width:"wide",context:"formatting"})}},e:function(t,e,i,s){var r=t.getUTCDay(),o=(r-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return Fl(o,2);case"eo":return i.ordinalNumber(o,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,i,s){var r=t.getUTCDay(),o=(r-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return Fl(o,e.length);case"co":return i.ordinalNumber(o,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,i){var s=t.getUTCDay(),r=0===s?7:s;switch(e){case"i":return String(r);case"ii":return Fl(r,e.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(s,{width:"short",context:"formatting"});default:return i.day(s,{width:"wide",context:"formatting"})}},a:function(t,e,i){var s=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,i){var s,r=t.getUTCHours();switch(s=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,i){var s,r=t.getUTCHours();switch(s=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var s=t.getUTCHours()%12;return 0===s&&(s=12),i.ordinalNumber(s,{unit:"hour"})}return Wl(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):$l(t,e)},K:function(t,e,i){var s=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(s,{unit:"hour"}):Fl(s,e.length)},k:function(t,e,i){var s=t.getUTCHours();return 0===s&&(s=24),"ko"===e?i.ordinalNumber(s,{unit:"hour"}):Fl(s,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Hl(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Gl(t,e)},S:function(t,e){return Ul(t,e)},X:function(t,e,i,s){var r=(s._originalDate||t).getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return Yl(r);case"XXXX":case"XX":return Jl(r);default:return Jl(r,":")}},x:function(t,e,i,s){var r=(s._originalDate||t).getTimezoneOffset();switch(e){case"x":return Yl(r);case"xxxx":case"xx":return Jl(r);default:return Jl(r,":")}},O:function(t,e,i,s){var r=(s._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ql(r,":");default:return"GMT"+Jl(r,":")}},z:function(t,e,i,s){var r=(s._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ql(r,":");default:return"GMT"+Jl(r,":")}},t:function(t,e,i,s){return Fl(Math.floor((s._originalDate||t).getTime()/1e3),e.length)},T:function(t,e,i,s){return Fl((s._originalDate||t).getTime(),e.length)}};function ql(t,e){var i=t>0?"-":"+",s=Math.abs(t),r=Math.floor(s/60),o=s%60;if(0===o)return i+String(r);var n=e||"";return i+String(r)+n+Fl(o,2)}function Yl(t,e){return t%60==0?(t>0?"-":"+")+Fl(Math.abs(t)/60,2):Jl(t,e)}function Jl(t,e){var i=e||"",s=t>0?"-":"+",r=Math.abs(t);return s+Fl(Math.floor(r/60),2)+i+Fl(r%60,2)}const Kl=Vl;var Zl=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Xl=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Ql={p:Xl,P:function(t,e){var i,s=t.match(/(P+)(p+)?/)||[],r=s[1],o=s[2];if(!o)return Zl(t,e);switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",Zl(r,e)).replace("{{time}}",Xl(o,e))}};const th=Ql;var eh=["D","DD"],ih=["YY","YYYY"];function sh(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var rh={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function oh(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}var nh,ah={date:oh({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:oh({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:oh({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},lh={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function hh(t){return function(e,i){var s;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var r=t.defaultFormattingWidth||t.defaultWidth,o=null!=i&&i.width?String(i.width):r;s=t.formattingValues[o]||t.formattingValues[r]}else{var n=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;s=t.values[a]||t.values[n]}return s[t.argumentCallback?t.argumentCallback(e):e]}}function ch(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=i.width,r=e.match(s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth]);if(!r)return null;var o,n=r[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t){for(var e=0;e<t.length;e++)if(t[e].test(n))return e}(a):function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].test(n))return e}(a);return o=t.valueCallback?t.valueCallback(l):l,{value:o=i.valueCallback?i.valueCallback(o):o,rest:e.slice(n.length)}}}const dh={code:"en-US",formatDistance:function(t,e,i){var s,r=rh[t];return s="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),null!=i&&i.addSuffix?i.comparison&&i.comparison>0?"in "+s:s+" ago":s},formatLong:ah,formatRelative:function(t){return lh[t]},localize:{ordinalNumber:function(t){var e=Number(t),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:hh({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:hh({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:hh({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:hh({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:hh({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(nh={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(nh.matchPattern);if(!i)return null;var s=i[0],r=t.match(nh.parsePattern);if(!r)return null;var o=nh.valueCallback?nh.valueCallback(r[0]):r[0];return{value:o=e.valueCallback?e.valueCallback(o):o,rest:t.slice(s.length)}}),era:ch({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ch({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ch({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ch({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ch({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var uh=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ph=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mh=/^'([^]*?)'?$/,fh=/''/g,vh=/[a-zA-Z]/;function bh(t,e,i){var s,r,o,n,a,l,h,c,d,u,p,m,f,v,b,g,y,w;Il(2,arguments);var x=String(e),k=Nl(),_=null!==(s=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:k.locale)&&void 0!==s?s:dh,C=Al(null!==(o=null!==(n=null!==(a=null!==(l=null==i?void 0:i.firstWeekContainsDate)&&void 0!==l?l:null==i||null===(h=i.locale)||void 0===h||null===(c=h.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==a?a:k.firstWeekContainsDate)&&void 0!==n?n:null===(d=k.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==o?o:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var S=Al(null!==(p=null!==(m=null!==(f=null!==(v=null==i?void 0:i.weekStartsOn)&&void 0!==v?v:null==i||null===(b=i.locale)||void 0===b||null===(g=b.options)||void 0===g?void 0:g.weekStartsOn)&&void 0!==f?f:k.weekStartsOn)&&void 0!==m?m:null===(y=k.locale)||void 0===y||null===(w=y.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==p?p:0);if(!(S>=0&&S<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!_.localize)throw new RangeError("locale must contain localize property");if(!_.formatLong)throw new RangeError("locale must contain formatLong property");var T=zl(t);if(!function(t){if(Il(1,arguments),!function(t){return Il(1,arguments),t instanceof Date||"object"===Dl(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;var e=zl(t);return!isNaN(Number(e))}(T))throw new RangeError("Invalid time value");var D=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}(T),A=function(t,e){return Il(2,arguments),function(t,e){Il(2,arguments);var i=zl(t).getTime(),s=Al(e);return new Date(i+s)}(t,-Al(e))}(T,D),I={firstWeekContainsDate:C,weekStartsOn:S,locale:_,_originalDate:T};return x.match(ph).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,th[e])(t,_.formatLong):t})).join("").match(uh).map((function(s){if("''"===s)return"'";var r,o,n=s[0];if("'"===n)return(o=(r=s).match(mh))?o[1].replace(fh,"'"):r;var a=Kl[n];if(a)return null!=i&&i.useAdditionalWeekYearTokens||-1===ih.indexOf(s)||sh(s,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!(-1!==eh.indexOf(s))||sh(s,e,String(t)),a(A,s,_.localize,I);if(n.match(vh))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return s})).join("")}const gh=class{constructor(i){t(this,i),this.filterDraw=e(this,"filterDraw",7),this.filterSelection=e(this,"filterSelection",7),this.filterSelectionReset=e(this,"filterSelectionReset",7),this.handleFilterFrom=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{filterFromCalendar:`${e[2]}/${e[1]}/${e[0]}`}))},this.handleFilterTo=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{filterToCalendar:`${e[2]}/${e[1]}/${e[0]}`}))},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.handleTicketId=t=>{t.target.value&&(this.filterData.ticketId=t.target.value)},this.handleTicketType=t=>{t.detail&&t.detail.length&&(this.filterData.ticketType=t.detail)},this.activateTicketSearch=!1,this.gameId="",this.playerId="",this.session="",this.postMessage=!1,this.language="en",this.quickFiltersActive=!1,this.clientStyling="",this.clientStylingUrlContent="",this.translationUrl=void 0,this.showFilterModal=!1,this.showClearButton=!1,this.filterData={},this.filterDataReset={filterFromCalendar:"",filterToCalendar:""},this.limitStylingAppends=!1,this.ticketTypeList=[{label:"Normal",value:"NORMAL"},{label:"Subscription",value:"SUBSCRIPTION"}]}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])m[e][i]=t[e][i]})))}componentDidRender(){document.getElementById("#FilterById")&&(document.getElementById("#FilterById").value=""),!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}filterSelectionHandler(t){this.postMessage&&window.postMessage({type:"filterSelection",event:t},window.location.href),(this.filterData.filterFromCalendar||this.filterData.filterToCalendar||this.filterData.ticketId||this.filterData.ticketType.length)&&this.filterSelection.emit(t)}filterSelectionResetHandler(t){this.postMessage&&window.postMessage({type:"filterSelectionReset",event:t},window.location.href),this.filterSelectionReset.emit(t)}modalCloseEvent(){this.showFilterModal=!1}toggleFilterModal(){this.showFilterModal=!0}filterSearch(){if(this.modalCloseEvent(),this.showClearButton=!0,this.filterData.filterFromCalendar&&this.filterData.filterToCalendar){let t=this.filterData.filterFromCalendar.split("/"),e=this.filterData.filterToCalendar.split("/");const i={filterFromCalendar:new Date(Date.UTC(Number(t[2]),Number(t[1])-1,Number(t[0]),0,0,0)).toISOString(),filterToCalendar:new Date(Date.UTC(Number(e[2]),Number(e[1])-1,Number(e[0]),23,59,59)).toISOString()};this.filterData=Object.assign(Object.assign({},this.filterData),i)}this.filterSelectionHandler(this.filterData)}clearSelection(){this.comboBox.clear()}resetSearch(){this.showClearButton=!1,this.filterSelectionResetHandler(this.filterDataReset),this.clearSelection(),this.filterData={}}formateDate(t){const{year:e,month:i,day:s}=t;return bh(new Date(e,i,s),"dd/MM/yyyy")}parseDate(t){const[e,i,s]=t.split("/");return{year:s,month:parseInt(i)-1,day:e}}changeFormate(t){const[e,i,s]=t.split("/");return`${s}-${i}-${e}`}setDateFormate(t){t.i18n=Object.assign(Object.assign({},t.i18n),{formatDate:this.formateDate,parseDate:this.parseDate})}render(){return s("div",{key:"7ee50d10e804a78815214a7005b96f1473192789",class:"HelperFilters",ref:t=>this.stylingContainer=t},s("div",{key:"72fa7e2146f9ab248a3addbbc496bc076ed8fea6",class:"FilterButtonsWrapper"},s("button",{key:"c35c3f210036324414e04344c3562f68cb682cb3",class:"FilterOpen",onClick:()=>this.toggleFilterModal()},f("filterOpen",this.language)),this.showClearButton||this.quickFiltersActive?s("button",{class:"FilterClear",onClick:()=>this.resetSearch()},f("filterClear",this.language)):null),s("helper-modal",{key:"6fbf594fbc030ffc145ac99854613feaf316d1dd","title-modal":"Filter Modal",visible:this.showFilterModal,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},s("div",{key:"c1ee533b2632f6a95bc9cfe9ef7933cef777eb80",class:"FilterModalHeader"},s("h3",{key:"a50a16a9e1aaaca1505523a17413c471caa05c2c",class:"FilterModalTitle"},f(this.activateTicketSearch?"filterModalTicketTitle":"filterModalDrawTitle",this.language))),s("div",{key:"a095a53d2c5bc363983c4637bdc1c3fd1214f23e",class:"FilterModalBody"},this.activateTicketSearch&&s("div",{key:"a4c523bb2a232f59863e66af2deca3832123a1fa",class:"ticketFilterContainer"},s("div",{key:"4ecde77a7d91a90785b860f0393f49418a411c20",class:"ticketFilterItem"},s("div",{key:"abfb2d5c0c5fa275e2eae2855f1ecea1abc287f8",class:"filterKey"},f("filterTicketIdPlaceholder",this.language)),s("div",{key:"bc11ce63b8cef06ea1d2349f89491e4c78792258",class:"general-multi-select-container"},s("vaadin-text-field",{key:"79bf59b8349741961f7e5632c9ccb8912b2894ae",placeholder:f("filterTicketIdPlaceholder",this.language),value:this.filterData.ticketId,onInput:t=>this.handleTicketId(t)})),s("div",{key:"1b279f6ef35181730f7c122133bb5e852c95542c",class:"ticketFilterItem"},s("div",{key:"2f39a99823921e38702d36051f90bad62185fec9",class:"filterKey"},f("searchByTicketType",this.language)),s("div",{key:"5f8f89db867ef192d626fc7c0d25598c82d588d3",class:"general-multi-select-container"},s("general-multi-select",{key:"6fd46617301c8f64e7160821c265d6c2e6aa19a1","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrlContent,ref:t=>this.comboBox=t,placeholder:f("filterTiketTypePlaceholder",this.language),"max-visible-chips":"2",options:this.ticketTypeList.map((t=>({text:t.label,value:t.value}))),onChange:this.handleTicketType}))))),s("div",{key:"71145912a8487ffa0e9c2c6b65430970b35bf577",class:"filterItem"},s("div",{key:"e80c017965aa28dfa7d36821858b694d68b61953",class:"filterKey"},f("searchByDate",this.language)),s("div",{key:"8ebb4dd1383aff84729438e31100cf3334d659f6",class:"FilterCalendarWrapper"},s("vaadin-date-picker",{key:"e523fe9f3b2b31f093c4afb8adba90742e3d3d16",value:this.filterData.filterFromCalendar,max:void 0===this.filterData.filterToCalendar?void 0:this.changeFormate(this.filterData.filterToCalendar),onChange:this.handleFilterFrom,placeholder:f("filterFromCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}),s("vaadin-date-picker",{key:"ba247c71ecfb003f1c605c4638dac909ad5b719d",value:this.filterData.filterToCalendar,min:void 0===this.filterData.filterFromCalendar?void 0:this.changeFormate(this.filterData.filterFromCalendar),onChange:this.handleFilterTo,placeholder:f("filterToCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"})))),s("div",{key:"adbcecc5366949dcb1db0ddcf18fc17ca74559dd",class:"FilterModalFooter"},s("button",{key:"0609a99acecbee97d26d073c4e725a8fa9c21769",class:"FilterModalButton",onClick:()=>this.filterSearch()},f("filterModalButton",this.language)))))}};gh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.FilterButtonsWrapper{display:flex;justify-content:flex-end;gap:5px}.FilterButtonsWrapper .FilterOpen{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;width:max-content;background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterOpen:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterButtonsWrapper .FilterClear{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;width:max-content;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-typography-inverse, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterClear:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterModalHeader,.FilterModalBody,.FilterModalFooter{display:flex;flex-direction:column;gap:5px;align-items:center;margin:20px 0}.FilterModalHeader .filterKey,.FilterModalBody .filterKey,.FilterModalFooter .filterKey{color:var(--emw--color-primary, #009993);text-align:left;font-size:16px}.FilterModalHeader .FilterModalTitle,.FilterModalBody .FilterModalTitle,.FilterModalFooter .FilterModalTitle{margin:0;padding:0;font-weight:700;font-size:16px;color:var(--emw--color-primary, #009993);text-transform:uppercase}.FilterModalHeader .FilterModalSearch,.FilterModalBody .FilterModalSearch,.FilterModalFooter .FilterModalSearch{border-radius:var(--emw--button-border-radius, 4px);background:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-primary-variant, #004d4a);width:100%;height:26px;max-width:280px;padding:5px;font-size:15px;border:none;outline:var(--emw--color-primary, #009993)}.FilterModalHeader .FilterCalendarWrapper,.FilterModalBody .FilterCalendarWrapper,.FilterModalFooter .FilterCalendarWrapper{display:flex;gap:5px}.FilterModalHeader .FilterCalendarWrapper .VaadinDatePicker,.FilterModalBody .FilterCalendarWrapper .VaadinDatePicker,.FilterModalFooter .FilterCalendarWrapper .VaadinDatePicker{width:50%;max-width:143px}.FilterModalHeader .FilterModalButton,.FilterModalBody .FilterModalButton,.FilterModalFooter .FilterModalButton{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 60px;width:max-content;margin:5px;background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.FilterModalHeader .FilterModalButton:hover,.FilterModalBody .FilterModalButton:hover,.FilterModalFooter .FilterModalButton:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterModalHeader p,.FilterModalBody p,.FilterModalFooter p{margin:5px 0}.ticketFilterItem{margin:12px 0}.general-multi-select-container{width:var(--vaadin-field-default-width, 16em)}.general-multi-select-container vaadin-text-field{width:100%}';const yh=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),wh=class{constructor(i){t(this,i),this.cancel=e(this,"modalCloseEvent",7),this.userAgent=window.navigator.userAgent,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.titleModal=void 0,this.visible=!0,this.clientStyling="",this.clientStylingUrlContent="",this.limitStylingAppends=!1}handleHelperModalClose(){this.visible=!1,this.cancel.emit()}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return this.visible&&s("div",{key:"ba2aed789565b37bfdbb34bdf3ccace827231653",class:this.visible?"HelperModalWrapper HelperModalVisible":"HelperModalWrapper",ref:t=>this.stylingContainer=t},s("div",{key:"151ca4cd80d259ac955b92b10bf6f0df2698a937",class:"HelperModalWrapper HelperModalVisible"},s("div",{key:"804cb1dea73321c4935e4a8ddb1136e98e89a070",class:"HelperModalContent"+(yh(this.userAgent)?" HelperModalMobileContent":"")},s("span",{key:"30cf7928c1e4baa53f3514fc1930823db76c874c",class:"HelperModalClose"+(yh(this.userAgent)?" HelperModalMobileClose":""),onClick:this.handleHelperModalClose.bind(this)},"X"),s("slot",{key:"5c1323a98cdcd09669020a00affe5673856e807e"}))))}};wh.style=":host{display:block}.HelperModalWrapper{position:fixed;left:0;top:0;width:100%;height:100%;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;visibility:hidden;transform:scale(1.1);transition:visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;z-index:1}.HelperModalVisible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.HelperModalContent{position:relative;border:solid 1px var(--emw--color-gray-300, #333);box-shadow:2px 2px 2px var(--emw--color-typography-secondary, #ccc);font-size:14px;padding:10px 10px 5px 10px;background:var(--emw--color-background, #fff);position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:600px;max-height:600px;overflow-y:scroll}.HelperModalMobileContent{background:var(--emw--color-background, #fff);top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:80%;max-height:350px}.HelperModalClose{cursor:pointer;position:absolute;top:15px;right:15px;font-size:20px;color:var(--emw--color-typography, #000)}.HelperModalMobileClose{position:absolute;top:15px;right:15px;font-size:20px;color:var(--emw--color-typography, #000)}";const xh="en",kh=["en"],_h={en:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},ro:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},fr:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},ar:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},hr:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"}},Ch=(t,e)=>{const i=e;return _h[void 0!==i&&kh.includes(i)?i:xh][t]},Sh=class{constructor(e){t(this,e),this.selectedIndex=0,this.cmsEndpoint=void 0,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0,this.tabContent=""}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,e){t!=e&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription):(this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])_h[e][i]=t[e][i]})))}getHowToPlay(){return this.lowNumber&&this.highNumber&&this.maxinumAllowed&&this.minimumAllowed?((t,e)=>{const i=e.lang;let s=_h[void 0!==i&&kh.includes(i)?i:xh][t];return e?(Object.keys(e).forEach((t=>{s=s.replace(new RegExp("\\${"+t+"}","gm"),e[t])})),s):_h[void 0!==i&&kh.includes(i)?i:xh][t]})("howToPlay",{lowNumber:this.lowNumber,highNumber:this.highNumber,maxinumAllowed:this.maxinumAllowed,minimumAllowed:this.minimumAllowed,lang:this.language}):""}render(){return this.tabContent=s("div",{key:"92877a17361066f68fce6299cb8f65901f6abc60",class:"TabContent",ref:t=>this.stylingContainer=t},this.getHowToPlay()),this.selectedIndex+1==2?this.tabContent=s("div",{key:"9876b9250371034ef40dab0f5fc3fe1a5631a370",class:"TabContent",ref:t=>this.stylingContainer=t},s("ol",{key:"ef2097eb54aeb640f06871277d8cafd2f4455109"},s("li",{key:"e9a0237e1fdead445abcd9240174276ffef81a67"},Ch("register",this.language)),s("li",{key:"2bdfaffdc9f1a7ae021913cb0ba346132140dcfd"},Ch("butTickets",this.language)),s("li",{key:"bff38eaeabeaece83dc8ed1697e5b052802753f6"},Ch("reviewPurchase",this.language)))):this.selectedIndex+1==3&&(this.tabContent=s("div",{key:"49a7fb3435fb50b54572ec38d1e632e2eacf56fb",class:"TabContent",ref:t=>this.stylingContainer=t},s("ul",{key:"7f642625f35a1ed1eae7655144c0b8b1bfe25f55"},s("li",{key:"037a5913be57dd1e2dcde5a061e9c64e70365e8d"},Ch("odds",this.language)),s("li",{key:"8775a1b2e8eda285e2c248b8d7235f06ac593fc6"},Ch("winGame",this.language)),s("li",{key:"5297fc5e757c29a1349049f1fe294e926255d518"},Ch("claimPrize",this.language))))),this.tabContent}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};Sh.style=":host{display:block}.TabContent{font-size:14px;color:var(--emw--color-typography, #000);font-weight:normal}";const Th=class{constructor(e){t(this,e),this.disabled=!1,this.label=void 0,this.selected=!1,this.cmsEndpoint=void 0,this.selectedIndex=0,this.tabs=[{label:"How to Play"},{label:"About"},{label:"FAQs"}],this.clientStyling="",this.mbSource=void 0,this.clientStylingurl="",this.clientStylingUrl="",this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}connectedCallback(){}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,e){t!=e&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription):(this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return s("div",{key:"173c4774748482dc56fcffb4bac4e1666fa9170f",ref:t=>this.stylingContainer=t},s("div",{key:"680b65218e4b00f134b354f593c0c20fb5882dca",class:"Tabs"},this.tabs.map(((t,e)=>s("button",{class:"TabButton"+(this.selectedIndex==e?" Active":""),onClick:()=>this.selectedIndex=e},t.label)))),s("div",{key:"67aa26c92fb416c5d0934988fb071481f805685b"},s("helper-tab",{key:"63c8dfc253d4fc12b0310a2585a44b90807e1a9f","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,selectedIndex:this.selectedIndex,"client-styling":this.clientStyling,language:this.language,"translation-url":this.translationUrl,"client-stylingurl":this.clientStylingurl,"client-styling-url-content":this.clientStylingUrl,"mb-source":this.mbSource})))}get host(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};Th.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Tabs{display:flex;gap:10px;overflow-x:auto}.TabButton{cursor:pointer;width:auto;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;margin:5px 0 10px;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0;white-space:nowrap}.TabButton:hover{background:var(--emw--color-background-secondary, #f5f5f5)}.TabButton.Active{background:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff)}';const Dh=class{constructor(i){t(this,i),this.bulletEvent=e(this,"lotteryBulletSelection",7),this.select=()=>{this.selectable&&(this.isSelected=!this.isSelected,this.bulletEvent.emit({value:this.value,selected:this.isSelected}))},this.value="0",this.selectable=!0,this.isSelected=!1,this.isBonus=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"2cfab600728d3aa72f9f87e4e07a968ea030e415",class:"Circle "+(this.selectable?"":"Disabled")+(this.isSelected?"Selected":"")+(this.isBonus?" Bonus":""),onClick:()=>this.select(),ref:t=>this.stylingContainer=t},this.value)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Dh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:var(--emw--color-typography, #000);display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px var(--emw--color-background, #fff);background:radial-gradient(circle at top, var(--emw--color-background, #fff) 0%, var(--emw--color-background, #fff) 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 var(--emw--color-gray-300, #333);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, var(--emw--color-background, #fff) 0%, var(--emw--color-background-secondary, #f5f5f5) 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-background, #fff);background:-webkit-radial-gradient(top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));background:-moz-radial-gradient(top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));background:radial-gradient(circle at top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));border:solid 2px var(--emw--color-primary, #009993)}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-50, #f5f5f5);background:var(--emw--color-gray-250, #ccc);border:solid 2px var(--emw--color-gray-100, #e6e6e6);cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-50, #f5f5f5);background:-webkit-radial-gradient(top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));background:-moz-radial-gradient(top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));background:radial-gradient(circle at top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));border:solid 2px var(--emw--color-gray-100, #e6e6e6);cursor:default}.Circle.Bonus{background:var(--emw--color-tertiary, #ff6536)}';const Ah=["ro","en","hr"],Ih={en:{drawId:"Draw ID",drawDate:"Draw Date",drawNumbersGridDraw:"Draw Numbers",drawNumbersGridTicket:"Selected Numbers",ticketResult:"Ticket Result",amountWon:"Amount won",numberOfDraws:"Number of Draws",multiplierNum:"Multiplier Number",ticketId:"Ticket ID",ticketType:"Ticket Type",ticketAmount:"Ticket Amount",prize:"Prizes"},ro:{drawId:"Id extragere",drawDate:"Data extragerii",drawNumbersGridDraw:"Numerele extrase",drawNumbersGridTicket:"Numere selectate",ticketResult:"Rezultatul biletului",amountWon:"Suma castigata",numberOfDraws:"Numarul de extrageri",multiplierNum:"Multiplier Number",ticketId:"Id biletul",ticketType:"Ticket Type",ticketAmount:"Valoarea biletului",prize:"Premii"},fr:{drawId:"ID de tirage",drawDate:"Date du tirage",drawNumbersGridDraw:"Tirage des numéros",drawNumbersGridTicket:"Nombres sélectionnés",ticketResult:"Résultat du ticket",amountWon:"Montant gagné",numberOfDraws:"Nombre de tirages",multiplierNum:"Multiplier Number",ticketId:"ID de billets",ticketType:"Ticket Type",ticketAmount:"Montant du billet",prize:"Prix"},ar:{drawId:"معرّف السحب",drawDate:"تاريخ السحب",drawNumbersGridDraw:" أرقام السحب",drawNumbersGridTicket:"الأرقام المختارة",ticketResult:"نتيجة التذكرة",amountWon:"المبلغ الذي تم ربحه",numberOfDraws:"عدد السحوبات",multiplierNum:"Multiplier Number",ticketId:"معرّف التذكرة",ticketAmount:"مبلغ التذكرة",prize:"الجوائز"},hr:{drawId:"ID izvlačenja",drawDate:"Datum izvlačenja",drawNumbersGridDraw:"Tablica izvučenih",drawNumbersGridTicket:"Odabrani brojevi",ticketResult:"Rezultat listića",amountWon:"Osvojeni iznos",numberOfDraws:"Broj izvlačenja",multiplierNum:"Multiplier Number",ticketId:"ID listića",ticketType:"Ticket Type",ticketAmount:"Iznos listića",prize:"Nagrade"}},zh=(t,e)=>{const i=e;return Ih[void 0!==i&&Ah.includes(i)?i:"en"][t]};var Mh,Nh="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ph={exports:{}};Mh=Ph,function(t){
|
|
6657
|
+
`}static get is(){return"vaadin-tabs"}}function Dl(t){return Dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dl(t)}function Al(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Il(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function zl(t){Il(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===Dl(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}D(Tl);var Ml={};function Nl(){return Ml}var Pl=6e4,Bl=36e5;var Ol={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},El="trunc";function Fl(t){Il(1,arguments);var e=zl(t),i=e.getUTCDay(),s=(i<1?7:0)+i-1;return e.setUTCDate(e.getUTCDate()-s),e.setUTCHours(0,0,0,0),e}function jl(t){Il(1,arguments);var e=zl(t),i=e.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(i+1,0,4),s.setUTCHours(0,0,0,0);var r=Fl(s),o=new Date(0);o.setUTCFullYear(i,0,4),o.setUTCHours(0,0,0,0);var n=Fl(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=n.getTime()?i:i-1}function Rl(t,e){var i,s,r,o,n,a,l,h;Il(1,arguments);var c=Nl(),d=Al(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(n=e.locale)||void 0===n||null===(a=n.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==r?r:c.weekStartsOn)&&void 0!==s?s:null===(l=c.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==i?i:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=zl(t),p=u.getUTCDay(),m=(p<d?7:0)+p-d;return u.setUTCDate(u.getUTCDate()-m),u.setUTCHours(0,0,0,0),u}function Ll(t,e){var i,s,r,o,n,a,l,h;Il(1,arguments);var c=zl(t),d=c.getUTCFullYear(),u=Nl(),p=Al(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(n=e.locale)||void 0===n||null===(a=n.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==s?s:null===(l=u.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(d+1,0,p),m.setUTCHours(0,0,0,0);var f=Rl(m,e),v=new Date(0);v.setUTCFullYear(d,0,p),v.setUTCHours(0,0,0,0);var b=Rl(v,e);return c.getTime()>=f.getTime()?d+1:c.getTime()>=b.getTime()?d:d-1}function $l(t,e){for(var i=t<0?"-":"",s=Math.abs(t).toString();s.length<e;)s="0"+s;return i+s}const Wl=function(t,e){var i=t.getUTCFullYear(),s=i>0?i:1-i;return $l("yy"===e?s%100:s,e.length)},Hl=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):$l(i+1,2)},Gl=function(t,e){return $l(t.getUTCDate(),e.length)},Ul=function(t,e){return $l(t.getUTCHours()%12||12,e.length)},Vl=function(t,e){return $l(t.getUTCHours(),e.length)},ql=function(t,e){return $l(t.getUTCMinutes(),e.length)},Yl=function(t,e){return $l(t.getUTCSeconds(),e.length)},Jl=function(t,e){var i=e.length,s=t.getUTCMilliseconds();return $l(Math.floor(s*Math.pow(10,i-3)),e.length)};var Kl={G:function(t,e,i){var s=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(s,{width:"abbreviated"});case"GGGGG":return i.era(s,{width:"narrow"});default:return i.era(s,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var s=t.getUTCFullYear();return i.ordinalNumber(s>0?s:1-s,{unit:"year"})}return Wl(t,e)},Y:function(t,e,i,s){var r=Ll(t,s),o=r>0?r:1-r;return"YY"===e?$l(o%100,2):"Yo"===e?i.ordinalNumber(o,{unit:"year"}):$l(o,e.length)},R:function(t,e){return $l(jl(t),e.length)},u:function(t,e){return $l(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var s=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return $l(s,2);case"Qo":return i.ordinalNumber(s,{unit:"quarter"});case"QQQ":return i.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(s,{width:"narrow",context:"formatting"});default:return i.quarter(s,{width:"wide",context:"formatting"})}},q:function(t,e,i){var s=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return $l(s,2);case"qo":return i.ordinalNumber(s,{unit:"quarter"});case"qqq":return i.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(s,{width:"narrow",context:"standalone"});default:return i.quarter(s,{width:"wide",context:"standalone"})}},M:function(t,e,i){var s=t.getUTCMonth();switch(e){case"M":case"MM":return Hl(t,e);case"Mo":return i.ordinalNumber(s+1,{unit:"month"});case"MMM":return i.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(s,{width:"narrow",context:"formatting"});default:return i.month(s,{width:"wide",context:"formatting"})}},L:function(t,e,i){var s=t.getUTCMonth();switch(e){case"L":return String(s+1);case"LL":return $l(s+1,2);case"Lo":return i.ordinalNumber(s+1,{unit:"month"});case"LLL":return i.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(s,{width:"narrow",context:"standalone"});default:return i.month(s,{width:"wide",context:"standalone"})}},w:function(t,e,i,s){var r=function(t,e){Il(1,arguments);var i=zl(t),s=Rl(i,e).getTime()-function(t,e){var i,s,r,o,n,a,l,h;Il(1,arguments);var c=Nl(),d=Al(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(n=e.locale)||void 0===n||null===(a=n.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==r?r:c.firstWeekContainsDate)&&void 0!==s?s:null===(l=c.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1),u=Ll(t,e),p=new Date(0);return p.setUTCFullYear(u,0,d),p.setUTCHours(0,0,0,0),Rl(p,e)}(i,e).getTime();return Math.round(s/6048e5)+1}(t,s);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):$l(r,e.length)},I:function(t,e,i){var s=function(t){Il(1,arguments);var e=zl(t),i=Fl(e).getTime()-function(t){Il(1,arguments);var e=jl(t),i=new Date(0);return i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0),Fl(i)}(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(s,{unit:"week"}):$l(s,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):Gl(t,e)},D:function(t,e,i){var s=function(t){Il(1,arguments);var e=zl(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime();return Math.floor((i-s)/864e5)+1}(t);return"Do"===e?i.ordinalNumber(s,{unit:"dayOfYear"}):$l(s,e.length)},E:function(t,e,i){var s=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(s,{width:"short",context:"formatting"});default:return i.day(s,{width:"wide",context:"formatting"})}},e:function(t,e,i,s){var r=t.getUTCDay(),o=(r-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return $l(o,2);case"eo":return i.ordinalNumber(o,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,i,s){var r=t.getUTCDay(),o=(r-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return $l(o,e.length);case"co":return i.ordinalNumber(o,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,i){var s=t.getUTCDay(),r=0===s?7:s;switch(e){case"i":return String(r);case"ii":return $l(r,e.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(s,{width:"short",context:"formatting"});default:return i.day(s,{width:"wide",context:"formatting"})}},a:function(t,e,i){var s=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,i){var s,r=t.getUTCHours();switch(s=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,i){var s,r=t.getUTCHours();switch(s=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var s=t.getUTCHours()%12;return 0===s&&(s=12),i.ordinalNumber(s,{unit:"hour"})}return Ul(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Vl(t,e)},K:function(t,e,i){var s=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(s,{unit:"hour"}):$l(s,e.length)},k:function(t,e,i){var s=t.getUTCHours();return 0===s&&(s=24),"ko"===e?i.ordinalNumber(s,{unit:"hour"}):$l(s,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):ql(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Yl(t,e)},S:function(t,e){return Jl(t,e)},X:function(t,e,i,s){var r=(s._originalDate||t).getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return Xl(r);case"XXXX":case"XX":return Ql(r);default:return Ql(r,":")}},x:function(t,e,i,s){var r=(s._originalDate||t).getTimezoneOffset();switch(e){case"x":return Xl(r);case"xxxx":case"xx":return Ql(r);default:return Ql(r,":")}},O:function(t,e,i,s){var r=(s._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Zl(r,":");default:return"GMT"+Ql(r,":")}},z:function(t,e,i,s){var r=(s._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Zl(r,":");default:return"GMT"+Ql(r,":")}},t:function(t,e,i,s){return $l(Math.floor((s._originalDate||t).getTime()/1e3),e.length)},T:function(t,e,i,s){return $l((s._originalDate||t).getTime(),e.length)}};function Zl(t,e){var i=t>0?"-":"+",s=Math.abs(t),r=Math.floor(s/60),o=s%60;if(0===o)return i+String(r);var n=e||"";return i+String(r)+n+$l(o,2)}function Xl(t,e){return t%60==0?(t>0?"-":"+")+$l(Math.abs(t)/60,2):Ql(t,e)}function Ql(t,e){var i=e||"",s=t>0?"-":"+",r=Math.abs(t);return s+$l(Math.floor(r/60),2)+i+$l(r%60,2)}const th=Kl;var eh=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},ih=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},sh={p:ih,P:function(t,e){var i,s=t.match(/(P+)(p+)?/)||[],r=s[1],o=s[2];if(!o)return eh(t,e);switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",eh(r,e)).replace("{{time}}",ih(o,e))}};const rh=sh;var oh=["D","DD"],nh=["YY","YYYY"];function ah(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var lh={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function hh(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}var ch,dh={date:hh({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:hh({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:hh({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},uh={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ph(t){return function(e,i){var s;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var r=t.defaultFormattingWidth||t.defaultWidth,o=null!=i&&i.width?String(i.width):r;s=t.formattingValues[o]||t.formattingValues[r]}else{var n=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;s=t.values[a]||t.values[n]}return s[t.argumentCallback?t.argumentCallback(e):e]}}function mh(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=i.width,r=e.match(s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth]);if(!r)return null;var o,n=r[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t){for(var e=0;e<t.length;e++)if(t[e].test(n))return e}(a):function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].test(n))return e}(a);return o=t.valueCallback?t.valueCallback(l):l,{value:o=i.valueCallback?i.valueCallback(o):o,rest:e.slice(n.length)}}}const fh={code:"en-US",formatDistance:function(t,e,i){var s,r=lh[t];return s="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),null!=i&&i.addSuffix?i.comparison&&i.comparison>0?"in "+s:s+" ago":s},formatLong:dh,formatRelative:function(t){return uh[t]},localize:{ordinalNumber:function(t){var e=Number(t),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:ph({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ph({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ph({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ph({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ph({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ch={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(ch.matchPattern);if(!i)return null;var s=i[0],r=t.match(ch.parsePattern);if(!r)return null;var o=ch.valueCallback?ch.valueCallback(r[0]):r[0];return{value:o=e.valueCallback?e.valueCallback(o):o,rest:t.slice(s.length)}}),era:mh({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:mh({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:mh({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:mh({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:mh({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var vh=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bh=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gh=/^'([^]*?)'?$/,yh=/''/g,wh=/[a-zA-Z]/;function xh(t,e,i){var s,r,o,n,a,l,h,c,d,u,p,m,f,v,b,g,y,w;Il(2,arguments);var x=String(e),k=Nl(),_=null!==(s=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:k.locale)&&void 0!==s?s:fh,C=Al(null!==(o=null!==(n=null!==(a=null!==(l=null==i?void 0:i.firstWeekContainsDate)&&void 0!==l?l:null==i||null===(h=i.locale)||void 0===h||null===(c=h.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==a?a:k.firstWeekContainsDate)&&void 0!==n?n:null===(d=k.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==o?o:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var S=Al(null!==(p=null!==(m=null!==(f=null!==(v=null==i?void 0:i.weekStartsOn)&&void 0!==v?v:null==i||null===(b=i.locale)||void 0===b||null===(g=b.options)||void 0===g?void 0:g.weekStartsOn)&&void 0!==f?f:k.weekStartsOn)&&void 0!==m?m:null===(y=k.locale)||void 0===y||null===(w=y.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==p?p:0);if(!(S>=0&&S<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!_.localize)throw new RangeError("locale must contain localize property");if(!_.formatLong)throw new RangeError("locale must contain formatLong property");var T=zl(t);if(!function(t){if(Il(1,arguments),!function(t){return Il(1,arguments),t instanceof Date||"object"===Dl(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;var e=zl(t);return!isNaN(Number(e))}(T))throw new RangeError("Invalid time value");var D=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}(T),A=function(t,e){return Il(2,arguments),function(t,e){Il(2,arguments);var i=zl(t).getTime(),s=Al(e);return new Date(i+s)}(t,-Al(e))}(T,D),I={firstWeekContainsDate:C,weekStartsOn:S,locale:_,_originalDate:T};return x.match(bh).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,rh[e])(t,_.formatLong):t})).join("").match(vh).map((function(s){if("''"===s)return"'";var r,o,n=s[0];if("'"===n)return(o=(r=s).match(gh))?o[1].replace(yh,"'"):r;var a=th[n];if(a)return null!=i&&i.useAdditionalWeekYearTokens||-1===nh.indexOf(s)||ah(s,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!(-1!==oh.indexOf(s))||ah(s,e,String(t)),a(A,s,_.localize,I);if(n.match(wh))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return s})).join("")}function kh(t,e){var i;Il(1,arguments);var s=Al(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==s&&1!==s&&0!==s)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var r,o=function(t){var e,i={},s=t.split(_h.dateTimeDelimiter);if(s.length>2)return i;if(/:/.test(s[0])?e=s[0]:(i.date=s[0],e=s[1],_h.timeZoneDelimiter.test(i.date)&&(i.date=t.split(_h.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var r=_h.timezone.exec(e);r?(i.time=e.replace(r[1],""),i.timezone=r[1]):i.time=e}return i}(t);if(o.date){var n=function(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),s=t.match(i);if(!s)return{year:NaN,restDateString:""};var r=s[1]?parseInt(s[1]):null,o=s[2]?parseInt(s[2]):null;return{year:null===o?r:100*o,restDateString:t.slice((s[1]||s[2]).length)}}(o.date,s);r=function(t,e){if(null===e)return new Date(NaN);var i=t.match(Ch);if(!i)return new Date(NaN);var s=!!i[4],r=Dh(i[1]),o=Dh(i[2])-1,n=Dh(i[3]),a=Dh(i[4]),l=Dh(i[5])-1;if(s)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){var s=new Date(0);s.setUTCFullYear(t,0,4);var r=7*(e-1)+i+1-(s.getUTCDay()||7);return s.setUTCDate(s.getUTCDate()+r),s}(e,a,l):new Date(NaN);var h=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(Ih[e]||(zh(t)?29:28))}(e,o,n)&&function(t,e){return e>=1&&e<=(zh(t)?366:365)}(e,r)?(h.setUTCFullYear(e,o,Math.max(r,n)),h):new Date(NaN)}(n.restDateString,n.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var a,l=r.getTime(),h=0;if(o.time&&(h=function(t){var e=t.match(Sh);if(!e)return NaN;var i=Ah(e[1]),s=Ah(e[2]),r=Ah(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,s,r)?i*Bl+s*Pl+1e3*r:NaN}(o.time),isNaN(h)))return new Date(NaN);if(!o.timezone){var c=new Date(l+h),d=new Date(0);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return a=function(t){if("Z"===t)return 0;var e=t.match(Th);if(!e)return 0;var i="+"===e[1]?-1:1,s=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,r)?i*(s*Bl+r*Pl):NaN}(o.timezone),isNaN(a)?new Date(NaN):new Date(l+h+a)}var _h={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ch=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Sh=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Th=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Dh(t){return t?parseInt(t):1}function Ah(t){return t&&parseFloat(t.replace(",","."))||0}var Ih=[31,null,31,30,31,30,31,31,30,31,30,31];function zh(t){return t%400==0||t%4==0&&t%100!=0}const Mh=class{constructor(i){t(this,i),this.filterDraw=e(this,"filterDraw",7),this.filterSelection=e(this,"filterSelection",7),this.filterSelectionReset=e(this,"filterSelectionReset",7),this.handleFilterFrom=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{filterFromCalendar:`${e[2]}/${e[1]}/${e[0]}`}))},this.handleFilterTo=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{filterToCalendar:`${e[2]}/${e[1]}/${e[0]}`}))},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.handleTicketId=t=>{t.target.value&&(this.filterData.ticketId=t.target.value)},this.handleTicketType=t=>{t.detail&&t.detail.length&&(this.filterData.ticketType=t.detail)},this.activateTicketSearch=!1,this.gameId="",this.playerId="",this.session="",this.postMessage=!1,this.language="en",this.quickFiltersActive=!1,this.clientStyling="",this.clientStylingUrlContent="",this.translationUrl=void 0,this.showFilterModal=!1,this.showClearButton=!1,this.filterData={},this.filterDataReset={filterFromCalendar:"",filterToCalendar:""},this.limitStylingAppends=!1,this.ticketTypeList=[{label:"Normal",value:"NORMAL"},{label:"Subscription",value:"SUBSCRIPTION"}]}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])m[e][i]=t[e][i]})))}componentDidRender(){document.getElementById("#FilterById")&&(document.getElementById("#FilterById").value=""),!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}filterSelectionHandler(t){this.postMessage&&window.postMessage({type:"filterSelection",event:t},window.location.href),(this.filterData.filterFromCalendar||this.filterData.filterToCalendar||this.filterData.ticketId||this.filterData.ticketType.length)&&this.filterSelection.emit(t)}filterSelectionResetHandler(t){this.postMessage&&window.postMessage({type:"filterSelectionReset",event:t},window.location.href),this.filterSelectionReset.emit(t)}modalCloseEvent(){this.showFilterModal=!1}toggleFilterModal(){this.showFilterModal=!0}filterSearch(){if(this.modalCloseEvent(),this.showClearButton=!0,this.filterData.filterFromCalendar&&this.filterData.filterToCalendar){let t=this.filterData.filterFromCalendar.split("/"),e=this.filterData.filterToCalendar.split("/");const i={filterFromCalendar:new Date(Date.UTC(Number(t[2]),Number(t[1])-1,Number(t[0]),0,0,0)).toISOString(),filterToCalendar:new Date(Date.UTC(Number(e[2]),Number(e[1])-1,Number(e[0]),23,59,59)).toISOString()};this.filterData=Object.assign(Object.assign({},this.filterData),i)}this.filterSelectionHandler(this.filterData)}clearSelection(){this.comboBox.clear()}resetSearch(){this.showClearButton=!1,this.filterSelectionResetHandler(this.filterDataReset),this.clearSelection(),this.filterData={}}formateDate(t){const{year:e,month:i,day:s}=t;return xh(new Date(e,i,s),"dd/MM/yyyy")}parseDate(t){const[e,i,s]=t.split("/");return{year:s,month:parseInt(i)-1,day:e}}changeFormate(t){const[e,i,s]=t.split("/");return`${s}-${i}-${e}`}setDateFormate(t){t.i18n=Object.assign(Object.assign({},t.i18n),{formatDate:this.formateDate,parseDate:this.parseDate})}render(){return s("div",{key:"7ee50d10e804a78815214a7005b96f1473192789",class:"HelperFilters",ref:t=>this.stylingContainer=t},s("div",{key:"72fa7e2146f9ab248a3addbbc496bc076ed8fea6",class:"FilterButtonsWrapper"},s("button",{key:"c35c3f210036324414e04344c3562f68cb682cb3",class:"FilterOpen",onClick:()=>this.toggleFilterModal()},f("filterOpen",this.language)),this.showClearButton||this.quickFiltersActive?s("button",{class:"FilterClear",onClick:()=>this.resetSearch()},f("filterClear",this.language)):null),s("helper-modal",{key:"6fbf594fbc030ffc145ac99854613feaf316d1dd","title-modal":"Filter Modal",visible:this.showFilterModal,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},s("div",{key:"c1ee533b2632f6a95bc9cfe9ef7933cef777eb80",class:"FilterModalHeader"},s("h3",{key:"a50a16a9e1aaaca1505523a17413c471caa05c2c",class:"FilterModalTitle"},f(this.activateTicketSearch?"filterModalTicketTitle":"filterModalDrawTitle",this.language))),s("div",{key:"a095a53d2c5bc363983c4637bdc1c3fd1214f23e",class:"FilterModalBody"},this.activateTicketSearch&&s("div",{key:"a4c523bb2a232f59863e66af2deca3832123a1fa",class:"ticketFilterContainer"},s("div",{key:"4ecde77a7d91a90785b860f0393f49418a411c20",class:"ticketFilterItem"},s("div",{key:"abfb2d5c0c5fa275e2eae2855f1ecea1abc287f8",class:"filterKey"},f("filterTicketIdPlaceholder",this.language)),s("div",{key:"bc11ce63b8cef06ea1d2349f89491e4c78792258",class:"general-multi-select-container"},s("vaadin-text-field",{key:"79bf59b8349741961f7e5632c9ccb8912b2894ae",placeholder:f("filterTicketIdPlaceholder",this.language),value:this.filterData.ticketId,onInput:t=>this.handleTicketId(t)})),s("div",{key:"1b279f6ef35181730f7c122133bb5e852c95542c",class:"ticketFilterItem"},s("div",{key:"2f39a99823921e38702d36051f90bad62185fec9",class:"filterKey"},f("searchByTicketType",this.language)),s("div",{key:"5f8f89db867ef192d626fc7c0d25598c82d588d3",class:"general-multi-select-container"},s("general-multi-select",{key:"6fd46617301c8f64e7160821c265d6c2e6aa19a1","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrlContent,ref:t=>this.comboBox=t,placeholder:f("filterTiketTypePlaceholder",this.language),"max-visible-chips":"2",options:this.ticketTypeList.map((t=>({text:t.label,value:t.value}))),onChange:this.handleTicketType}))))),s("div",{key:"71145912a8487ffa0e9c2c6b65430970b35bf577",class:"filterItem"},s("div",{key:"e80c017965aa28dfa7d36821858b694d68b61953",class:"filterKey"},f("searchByDate",this.language)),s("div",{key:"8ebb4dd1383aff84729438e31100cf3334d659f6",class:"FilterCalendarWrapper"},s("vaadin-date-picker",{key:"e523fe9f3b2b31f093c4afb8adba90742e3d3d16",value:this.filterData.filterFromCalendar,max:void 0===this.filterData.filterToCalendar?void 0:this.changeFormate(this.filterData.filterToCalendar),onChange:this.handleFilterFrom,placeholder:f("filterFromCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}),s("vaadin-date-picker",{key:"ba247c71ecfb003f1c605c4638dac909ad5b719d",value:this.filterData.filterToCalendar,min:void 0===this.filterData.filterFromCalendar?void 0:this.changeFormate(this.filterData.filterFromCalendar),onChange:this.handleFilterTo,placeholder:f("filterToCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"})))),s("div",{key:"adbcecc5366949dcb1db0ddcf18fc17ca74559dd",class:"FilterModalFooter"},s("button",{key:"0609a99acecbee97d26d073c4e725a8fa9c21769",class:"FilterModalButton",onClick:()=>this.filterSearch()},f("filterModalButton",this.language)))))}};Mh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.FilterButtonsWrapper{display:flex;justify-content:flex-end;gap:5px}.FilterButtonsWrapper .FilterOpen{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;width:max-content;background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterOpen:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterButtonsWrapper .FilterClear{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;width:max-content;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-typography-inverse, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterClear:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterModalHeader,.FilterModalBody,.FilterModalFooter{display:flex;flex-direction:column;gap:5px;align-items:center;margin:20px 0}.FilterModalHeader .filterKey,.FilterModalBody .filterKey,.FilterModalFooter .filterKey{color:var(--emw--color-primary, #009993);text-align:left;font-size:16px}.FilterModalHeader .FilterModalTitle,.FilterModalBody .FilterModalTitle,.FilterModalFooter .FilterModalTitle{margin:0;padding:0;font-weight:700;font-size:16px;color:var(--emw--color-primary, #009993);text-transform:uppercase}.FilterModalHeader .FilterModalSearch,.FilterModalBody .FilterModalSearch,.FilterModalFooter .FilterModalSearch{border-radius:var(--emw--button-border-radius, 4px);background:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-primary-variant, #004d4a);width:100%;height:26px;max-width:280px;padding:5px;font-size:15px;border:none;outline:var(--emw--color-primary, #009993)}.FilterModalHeader .FilterCalendarWrapper,.FilterModalBody .FilterCalendarWrapper,.FilterModalFooter .FilterCalendarWrapper{display:flex;gap:5px}.FilterModalHeader .FilterCalendarWrapper .VaadinDatePicker,.FilterModalBody .FilterCalendarWrapper .VaadinDatePicker,.FilterModalFooter .FilterCalendarWrapper .VaadinDatePicker{width:50%;max-width:143px}.FilterModalHeader .FilterModalButton,.FilterModalBody .FilterModalButton,.FilterModalFooter .FilterModalButton{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 60px;width:max-content;margin:5px;background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.FilterModalHeader .FilterModalButton:hover,.FilterModalBody .FilterModalButton:hover,.FilterModalFooter .FilterModalButton:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterModalHeader p,.FilterModalBody p,.FilterModalFooter p{margin:5px 0}.ticketFilterItem{margin:12px 0}.general-multi-select-container{width:var(--vaadin-field-default-width, 16em)}.general-multi-select-container vaadin-text-field{width:100%}';const Nh=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),Ph=class{constructor(i){t(this,i),this.cancel=e(this,"modalCloseEvent",7),this.userAgent=window.navigator.userAgent,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.titleModal=void 0,this.visible=!0,this.clientStyling="",this.clientStylingUrlContent="",this.limitStylingAppends=!1}handleHelperModalClose(){this.visible=!1,this.cancel.emit()}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return this.visible&&s("div",{key:"ba2aed789565b37bfdbb34bdf3ccace827231653",class:this.visible?"HelperModalWrapper HelperModalVisible":"HelperModalWrapper",ref:t=>this.stylingContainer=t},s("div",{key:"151ca4cd80d259ac955b92b10bf6f0df2698a937",class:"HelperModalWrapper HelperModalVisible"},s("div",{key:"804cb1dea73321c4935e4a8ddb1136e98e89a070",class:"HelperModalContent"+(Nh(this.userAgent)?" HelperModalMobileContent":"")},s("span",{key:"30cf7928c1e4baa53f3514fc1930823db76c874c",class:"HelperModalClose"+(Nh(this.userAgent)?" HelperModalMobileClose":""),onClick:this.handleHelperModalClose.bind(this)},"X"),s("slot",{key:"5c1323a98cdcd09669020a00affe5673856e807e"}))))}};Ph.style=":host{display:block}.HelperModalWrapper{position:fixed;left:0;top:0;width:100%;height:100%;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;visibility:hidden;transform:scale(1.1);transition:visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;z-index:1}.HelperModalVisible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.HelperModalContent{position:relative;border:solid 1px var(--emw--color-gray-300, #333);box-shadow:2px 2px 2px var(--emw--color-typography-secondary, #ccc);font-size:14px;padding:10px 10px 5px 10px;background:var(--emw--color-background, #fff);position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:600px;max-height:600px;overflow-y:scroll}.HelperModalMobileContent{background:var(--emw--color-background, #fff);top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:80%;max-height:350px}.HelperModalClose{cursor:pointer;position:absolute;top:15px;right:15px;font-size:20px;color:var(--emw--color-typography, #000)}.HelperModalMobileClose{position:absolute;top:15px;right:15px;font-size:20px;color:var(--emw--color-typography, #000)}";const Bh="en",Oh=["en"],Eh={en:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},ro:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},fr:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},ar:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"},hr:{howToPlay:"Each play includes one set of numbers from ${lowNumber} to ${highNumber} with a selectable number of ${maxinumAllowed} and a minimum selection of ${minimumAllowed}. The winnings are automatically credited to your account.",register:"Register or Login",butTickets:'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',reviewPurchase:"Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",odds:"What are my odds of winning?",winGame:"How can I find out if I’ve won a draw game?",claimPrize:"How do I claim my prize?"}},Fh=(t,e)=>{const i=e;return Eh[void 0!==i&&Oh.includes(i)?i:Bh][t]},jh=class{constructor(e){t(this,e),this.selectedIndex=0,this.cmsEndpoint=void 0,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0,this.tabContent=""}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,e){t!=e&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription):(this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Eh[e][i]=t[e][i]})))}getHowToPlay(){return this.lowNumber&&this.highNumber&&this.maxinumAllowed&&this.minimumAllowed?((t,e)=>{const i=e.lang;let s=Eh[void 0!==i&&Oh.includes(i)?i:Bh][t];return e?(Object.keys(e).forEach((t=>{s=s.replace(new RegExp("\\${"+t+"}","gm"),e[t])})),s):Eh[void 0!==i&&Oh.includes(i)?i:Bh][t]})("howToPlay",{lowNumber:this.lowNumber,highNumber:this.highNumber,maxinumAllowed:this.maxinumAllowed,minimumAllowed:this.minimumAllowed,lang:this.language}):""}render(){return this.tabContent=s("div",{key:"92877a17361066f68fce6299cb8f65901f6abc60",class:"TabContent",ref:t=>this.stylingContainer=t},this.getHowToPlay()),this.selectedIndex+1==2?this.tabContent=s("div",{key:"9876b9250371034ef40dab0f5fc3fe1a5631a370",class:"TabContent",ref:t=>this.stylingContainer=t},s("ol",{key:"ef2097eb54aeb640f06871277d8cafd2f4455109"},s("li",{key:"e9a0237e1fdead445abcd9240174276ffef81a67"},Fh("register",this.language)),s("li",{key:"2bdfaffdc9f1a7ae021913cb0ba346132140dcfd"},Fh("butTickets",this.language)),s("li",{key:"bff38eaeabeaece83dc8ed1697e5b052802753f6"},Fh("reviewPurchase",this.language)))):this.selectedIndex+1==3&&(this.tabContent=s("div",{key:"49a7fb3435fb50b54572ec38d1e632e2eacf56fb",class:"TabContent",ref:t=>this.stylingContainer=t},s("ul",{key:"7f642625f35a1ed1eae7655144c0b8b1bfe25f55"},s("li",{key:"037a5913be57dd1e2dcde5a061e9c64e70365e8d"},Fh("odds",this.language)),s("li",{key:"8775a1b2e8eda285e2c248b8d7235f06ac593fc6"},Fh("winGame",this.language)),s("li",{key:"5297fc5e757c29a1349049f1fe294e926255d518"},Fh("claimPrize",this.language))))),this.tabContent}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};jh.style=":host{display:block}.TabContent{font-size:14px;color:var(--emw--color-typography, #000);font-weight:normal}";const Rh=class{constructor(e){t(this,e),this.disabled=!1,this.label=void 0,this.selected=!1,this.cmsEndpoint=void 0,this.selectedIndex=0,this.tabs=[{label:"How to Play"},{label:"About"},{label:"FAQs"}],this.clientStyling="",this.mbSource=void 0,this.clientStylingurl="",this.clientStylingUrl="",this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}connectedCallback(){}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,e){t!=e&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription):(this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return s("div",{key:"173c4774748482dc56fcffb4bac4e1666fa9170f",ref:t=>this.stylingContainer=t},s("div",{key:"680b65218e4b00f134b354f593c0c20fb5882dca",class:"Tabs"},this.tabs.map(((t,e)=>s("button",{class:"TabButton"+(this.selectedIndex==e?" Active":""),onClick:()=>this.selectedIndex=e},t.label)))),s("div",{key:"67aa26c92fb416c5d0934988fb071481f805685b"},s("helper-tab",{key:"63c8dfc253d4fc12b0310a2585a44b90807e1a9f","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,selectedIndex:this.selectedIndex,"client-styling":this.clientStyling,language:this.language,"translation-url":this.translationUrl,"client-stylingurl":this.clientStylingurl,"client-styling-url-content":this.clientStylingUrl,"mb-source":this.mbSource})))}get host(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};Rh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Tabs{display:flex;gap:10px;overflow-x:auto}.TabButton{cursor:pointer;width:auto;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;margin:5px 0 10px;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0;white-space:nowrap}.TabButton:hover{background:var(--emw--color-background-secondary, #f5f5f5)}.TabButton.Active{background:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff)}';const Lh=class{constructor(i){t(this,i),this.bulletEvent=e(this,"lotteryBulletSelection",7),this.select=()=>{this.selectable&&(this.isSelected=!this.isSelected,this.bulletEvent.emit({value:this.value,selected:this.isSelected}))},this.value="0",this.selectable=!0,this.isSelected=!1,this.isBonus=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"2cfab600728d3aa72f9f87e4e07a968ea030e415",class:"Circle "+(this.selectable?"":"Disabled")+(this.isSelected?"Selected":"")+(this.isBonus?" Bonus":""),onClick:()=>this.select(),ref:t=>this.stylingContainer=t},this.value)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Lh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:var(--emw--color-typography, #000);display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px var(--emw--color-background, #fff);background:radial-gradient(circle at top, var(--emw--color-background, #fff) 0%, var(--emw--color-background, #fff) 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 var(--emw--color-gray-300, #333);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, var(--emw--color-background, #fff) 0%, var(--emw--color-background-secondary, #f5f5f5) 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-background, #fff);background:-webkit-radial-gradient(top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));background:-moz-radial-gradient(top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));background:radial-gradient(circle at top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));border:solid 2px var(--emw--color-primary, #009993)}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-50, #f5f5f5);background:var(--emw--color-gray-250, #ccc);border:solid 2px var(--emw--color-gray-100, #e6e6e6);cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-50, #f5f5f5);background:-webkit-radial-gradient(top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));background:-moz-radial-gradient(top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));background:radial-gradient(circle at top, var(--emw--color-primary, #009993), var(--emw--color-primary-variant, #004d4a));border:solid 2px var(--emw--color-gray-100, #e6e6e6);cursor:default}.Circle.Bonus{background:var(--emw--color-tertiary, #ff6536)}';const $h=["ro","en","hr"],Wh={en:{drawId:"Draw ID",drawDate:"Draw Date",drawNumbersGridDraw:"Draw Numbers",drawNumbersGridTicket:"Selected Numbers",ticketResult:"Ticket Result",amountWon:"Amount won",numberOfDraws:"Number of Draws",multiplierNum:"Multiplier Number",ticketId:"Ticket ID",ticketType:"Ticket Type",ticketAmount:"Ticket Amount",prize:"Prizes"},ro:{drawId:"Id extragere",drawDate:"Data extragerii",drawNumbersGridDraw:"Numerele extrase",drawNumbersGridTicket:"Numere selectate",ticketResult:"Rezultatul biletului",amountWon:"Suma castigata",numberOfDraws:"Numarul de extrageri",multiplierNum:"Multiplier Number",ticketId:"Id biletul",ticketType:"Ticket Type",ticketAmount:"Valoarea biletului",prize:"Premii"},fr:{drawId:"ID de tirage",drawDate:"Date du tirage",drawNumbersGridDraw:"Tirage des numéros",drawNumbersGridTicket:"Nombres sélectionnés",ticketResult:"Résultat du ticket",amountWon:"Montant gagné",numberOfDraws:"Nombre de tirages",multiplierNum:"Multiplier Number",ticketId:"ID de billets",ticketType:"Ticket Type",ticketAmount:"Montant du billet",prize:"Prix"},ar:{drawId:"معرّف السحب",drawDate:"تاريخ السحب",drawNumbersGridDraw:" أرقام السحب",drawNumbersGridTicket:"الأرقام المختارة",ticketResult:"نتيجة التذكرة",amountWon:"المبلغ الذي تم ربحه",numberOfDraws:"عدد السحوبات",multiplierNum:"Multiplier Number",ticketId:"معرّف التذكرة",ticketAmount:"مبلغ التذكرة",prize:"الجوائز"},hr:{drawId:"ID izvlačenja",drawDate:"Datum izvlačenja",drawNumbersGridDraw:"Tablica izvučenih",drawNumbersGridTicket:"Odabrani brojevi",ticketResult:"Rezultat listića",amountWon:"Osvojeni iznos",numberOfDraws:"Broj izvlačenja",multiplierNum:"Multiplier Number",ticketId:"ID listića",ticketType:"Ticket Type",ticketAmount:"Iznos listića",prize:"Nagrade"}},Hh=(t,e)=>{const i=e;return Wh[void 0!==i&&$h.includes(i)?i:"en"][t]};var Gh,Uh="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Vh={exports:{}};Gh=Vh,function(t){
|
|
6658
6658
|
/*!
|
|
6659
6659
|
* decimal.js v10.6.0
|
|
6660
6660
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
@@ -6662,4 +6662,4 @@ Yt("vaadin-tabs",B`
|
|
|
6662
6662
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
6663
6663
|
* MIT Licence
|
|
6664
6664
|
*/
|
|
6665
|
-
var e,i,s,r,o=9e15,n=1e9,a="0123456789abcdef",l="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",h="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",c={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-o,maxE:o,crypto:!1},d=!0,u="[DecimalError] ",p=u+"Invalid argument: ",m=u+"Precision limit exceeded",f=u+"crypto unavailable",v="[object Decimal]",b=Math.floor,g=Math.pow,y=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,w=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,x=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,k=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_=1e7,C=7,S=l.length-1,T=h.length-1,D={toStringTag:v};function A(t){var e,i,s,r=t.length-1,o="",n=t[0];if(r>0){for(o+=n,e=1;e<r;e++)(i=C-(s=t[e]+"").length)&&(o+=R(i)),o+=s;(i=C-(s=(n=t[e])+"").length)&&(o+=R(i))}else if(0===n)return"0";for(;n%10==0;)n/=10;return o+n}function I(t,e,i){if(t!==~~t||t<e||t>i)throw Error(p+t)}function z(t,e,i,s){var r,o,n,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=C,r=0):(r=Math.ceil((e+1)/C),e%=C),o=g(10,C-e),a=t[r]%o|0,null==s?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),n=i<4&&99999==a||i>3&&49999==a||5e4==a||0==a):n=(i<4&&a+1==o||i>3&&a+1==o/2)&&(t[r+1]/o/100|0)==g(10,e-2)-1||(a==o/2||0==a)&&!(t[r+1]/o/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),n=(s||i<4)&&9999==a||!s&&i>3&&4999==a):n=((s||i<4)&&a+1==o||!s&&i>3&&a+1==o/2)&&(t[r+1]/o/1e3|0)==g(10,e-3)-1,n}function M(t,e,i){for(var s,r,o=[0],n=0,l=t.length;n<l;){for(r=o.length;r--;)o[r]*=e;for(o[0]+=a.indexOf(t.charAt(n++)),s=0;s<o.length;s++)o[s]>i-1&&(void 0===o[s+1]&&(o[s+1]=0),o[s+1]+=o[s]/i|0,o[s]%=i)}return o.reverse()}D.absoluteValue=D.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),P(t)},D.ceil=function(){return P(new this.constructor(this),this.e+1,2)},D.clampedTo=D.clamp=function(t,e){var i=this,s=i.constructor;if(t=new s(t),e=new s(e),!t.s||!e.s)return new s(NaN);if(t.gt(e))throw Error(p+e);return i.cmp(t)<0?t:i.cmp(e)>0?e:new s(i)},D.comparedTo=D.cmp=function(t){var e,i,s,r,o=this,n=o.d,a=(t=new o.constructor(t)).d,l=o.s,h=t.s;if(!n||!a)return l&&h?l!==h?l:n===a?0:!n^l<0?1:-1:NaN;if(!n[0]||!a[0])return n[0]?l:a[0]?-h:0;if(l!==h)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(e=0,i=(s=n.length)<(r=a.length)?s:r;e<i;++e)if(n[e]!==a[e])return n[e]>a[e]^l<0?1:-1;return s===r?0:s>r^l<0?1:-1},D.cosine=D.cos=function(){var t,e,i=this,s=i.constructor;return i.d?i.d[0]?(e=s.rounding,s.precision=(t=s.precision)+Math.max(i.e,i.sd())+C,s.rounding=1,i=function(t,e){var i,s,r;if(e.isZero())return e;(s=e.d.length)<32?r=(1/J(4,i=Math.ceil(s/3))).toString():(i=16,r="2.3283064365386962890625e-10"),t.precision+=i,e=Y(t,1,e.times(r),new t(1));for(var o=i;o--;){var n=e.times(e);e=n.times(n).minus(n).times(8).plus(1)}return t.precision-=i,e}(s,K(s,i)),s.precision=t,s.rounding=e,P(2==r||3==r?i.neg():i,t,e,!0)):new s(1):new s(NaN)},D.cubeRoot=D.cbrt=function(){var t,e,i,s,r,o,n,a,l,h,c=this,u=c.constructor;if(!c.isFinite()||c.isZero())return new u(c);for(d=!1,(o=c.s*g(c.s*c,1/3))&&Math.abs(o)!=1/0?s=new u(o.toString()):(i=A(c.d),(o=((t=c.e)-i.length+1)%3)&&(i+=1==o||-2==o?"0":"00"),o=g(i,1/3),t=b((t+1)/3)-(t%3==(t<0?-1:2)),(s=new u(i=o==1/0?"5e"+t:(i=o.toExponential()).slice(0,i.indexOf("e")+1)+t)).s=c.s),n=(t=u.precision)+3;;)if(h=(l=(a=s).times(a).times(a)).plus(c),s=N(h.plus(c).times(a),h.plus(l),n+2,1),A(a.d).slice(0,n)===(i=A(s.d)).slice(0,n)){if("9999"!=(i=i.slice(n-3,n+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(P(s,t+1,1),e=!s.times(s).times(s).eq(c));break}if(!r&&(P(a,t+1,0),a.times(a).times(a).eq(c))){s=a;break}n+=4,r=1}return d=!0,P(s,t,u.rounding,e)},D.decimalPlaces=D.dp=function(){var t,e=this.d,i=NaN;if(e){if(i=((t=e.length-1)-b(this.e/C))*C,t=e[t])for(;t%10==0;t/=10)i--;i<0&&(i=0)}return i},D.dividedBy=D.div=function(t){return N(this,new this.constructor(t))},D.dividedToIntegerBy=D.divToInt=function(t){var e=this.constructor;return P(N(this,new e(t),0,1,1),e.precision,e.rounding)},D.equals=D.eq=function(t){return 0===this.cmp(t)},D.floor=function(){return P(new this.constructor(this),this.e+1,3)},D.greaterThan=D.gt=function(t){return this.cmp(t)>0},D.greaterThanOrEqualTo=D.gte=function(t){var e=this.cmp(t);return 1==e||0===e},D.hyperbolicCosine=D.cosh=function(){var t,e,i,s,r,o=this,n=o.constructor,a=new n(1);if(!o.isFinite())return new n(o.s?1/0:NaN);if(o.isZero())return a;s=n.rounding,n.precision=(i=n.precision)+Math.max(o.e,o.sd())+4,n.rounding=1,(r=o.d.length)<32?e=(1/J(4,t=Math.ceil(r/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=Y(n,1,o.times(e),new n(1),!0);for(var l,h=t,c=new n(8);h--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return P(o,n.precision=i,n.rounding=s,!0)},D.hyperbolicSine=D.sinh=function(){var t,e,i,s,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(i=o.rounding,o.precision=(e=o.precision)+Math.max(r.e,r.sd())+4,o.rounding=1,(s=r.d.length)<3)r=Y(o,2,r,r,!0);else{t=1.4*Math.sqrt(s),r=Y(o,2,r=r.times(1/J(5,t=t>16?16:0|t)),r,!0);for(var n,a=new o(5),l=new o(16),h=new o(20);t--;)n=r.times(r),r=r.times(a.plus(n.times(l.times(n).plus(h))))}return o.precision=e,o.rounding=i,P(r,e,i,!0)},D.hyperbolicTangent=D.tanh=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+7,s.rounding=1,N(i.sinh(),i.cosh(),s.precision=t,s.rounding=e)):new s(i.s)},D.inverseCosine=D.acos=function(){var t=this,e=t.constructor,i=t.abs().cmp(1),s=e.precision,r=e.rounding;return-1!==i?0===i?t.isNeg()?F(e,s,r):new e(0):new e(NaN):t.isZero()?F(e,s+4,r).times(.5):(e.precision=s+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=s,e.rounding=r,t.times(2))},D.inverseHyperbolicCosine=D.acosh=function(){var t,e,i=this,s=i.constructor;return i.lte(1)?new s(i.eq(1)?0:NaN):i.isFinite()?(e=s.rounding,s.precision=(t=s.precision)+Math.max(Math.abs(i.e),i.sd())+4,s.rounding=1,d=!1,i=i.times(i).minus(1).sqrt().plus(i),d=!0,s.precision=t,s.rounding=e,i.ln()):new s(i)},D.inverseHyperbolicSine=D.asinh=function(){var t,e,i=this,s=i.constructor;return!i.isFinite()||i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+2*Math.max(Math.abs(i.e),i.sd())+6,s.rounding=1,d=!1,i=i.times(i).plus(1).sqrt().plus(i),d=!0,s.precision=t,s.rounding=e,i.ln())},D.inverseHyperbolicTangent=D.atanh=function(){var t,e,i,s,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(t=o.precision,e=o.rounding,s=r.sd(),Math.max(s,t)<2*-r.e-1?P(new o(r),t,e,!0):(o.precision=i=s-r.e,r=N(r.plus(1),new o(1).minus(r),i+t,1),o.precision=t+4,o.rounding=1,r=r.ln(),o.precision=t,o.rounding=e,r.times(.5))):new o(NaN)},D.inverseSine=D.asin=function(){var t,e,i,s,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),i=o.precision,s=o.rounding,-1!==e?0===e?((t=F(o,i+4,s).times(.5)).s=r.s,t):new o(NaN):(o.precision=i+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=i,o.rounding=s,r.times(2)))},D.inverseTangent=D.atan=function(){var t,e,i,s,r,o,n,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(h.isFinite()){if(h.isZero())return new c(h);if(h.abs().eq(1)&&u+4<=T)return(n=F(c,u+4,p).times(.25)).s=h.s,n}else{if(!h.s)return new c(NaN);if(u+4<=T)return(n=F(c,u+4,p).times(.5)).s=h.s,n}for(c.precision=a=u+10,c.rounding=1,t=i=Math.min(28,a/C+2|0);t;--t)h=h.div(h.times(h).plus(1).sqrt().plus(1));for(d=!1,e=Math.ceil(a/C),s=1,l=h.times(h),n=new c(h),r=h;-1!==t;)if(r=r.times(l),o=n.minus(r.div(s+=2)),r=r.times(l),void 0!==(n=o.plus(r.div(s+=2))).d[e])for(t=e;n.d[t]===o.d[t]&&t--;);return i&&(n=n.times(2<<i-1)),d=!0,P(n,c.precision=u,c.rounding=p,!0)},D.isFinite=function(){return!!this.d},D.isInteger=D.isInt=function(){return!!this.d&&b(this.e/C)>this.d.length-2},D.isNaN=function(){return!this.s},D.isNegative=D.isNeg=function(){return this.s<0},D.isPositive=D.isPos=function(){return this.s>0},D.isZero=function(){return!!this.d&&0===this.d[0]},D.lessThan=D.lt=function(t){return this.cmp(t)<0},D.lessThanOrEqualTo=D.lte=function(t){return this.cmp(t)<1},D.logarithm=D.log=function(t){var e,i,s,r,o,n,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(null==t)t=new c(10),e=!0;else{if(i=(t=new c(t)).d,t.s<0||!i||!i[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(i=h.d,h.s<0||!i||!i[0]||h.eq(1))return new c(i&&!i[0]?-1/0:1!=h.s?NaN:i?0:1/0);if(e)if(i.length>1)o=!0;else{for(r=i[0];r%10==0;)r/=10;o=1!==r}if(d=!1,n=G(h,a=u+5),s=e?E(c,a+10):G(t,a),z((l=N(n,s,a,1)).d,r=u,p))do{if(n=G(h,a+=10),s=e?E(c,a+10):G(t,a),l=N(n,s,a,1),!o){+A(l.d).slice(r+1,r+15)+1==1e14&&(l=P(l,u+1,0));break}}while(z(l.d,r+=10,p));return d=!0,P(l,u,p)},D.minus=D.sub=function(t){var e,i,s,r,o,n,a,l,h,c,u,p,m=this,f=m.constructor;if(t=new f(t),!m.d||!t.d)return m.s&&t.s?m.d?t.s=-t.s:t=new f(t.d||m.s!==t.s?m:NaN):t=new f(NaN),t;if(m.s!=t.s)return t.s=-t.s,m.plus(t);if(p=t.d,a=f.precision,l=f.rounding,!(h=m.d)[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!h[0])return new f(3===l?-0:0);t=new f(m)}return d?P(t,a,l):t}if(i=b(t.e/C),c=b(m.e/C),h=h.slice(),o=c-i){for((u=o<0)?(e=h,o=-o,n=p.length):(e=p,i=c,n=h.length),o>(s=Math.max(Math.ceil(a/C),n)+2)&&(o=s,e.length=1),e.reverse(),s=o;s--;)e.push(0);e.reverse()}else{for((u=(s=h.length)<(n=p.length))&&(n=s),s=0;s<n;s++)if(h[s]!=p[s]){u=h[s]<p[s];break}o=0}for(u&&(e=h,h=p,p=e,t.s=-t.s),s=p.length-(n=h.length);s>0;--s)h[n++]=0;for(s=p.length;s>o;){if(h[--s]<p[s]){for(r=s;r&&0===h[--r];)h[r]=_-1;--h[r],h[s]+=_}h[s]-=p[s]}for(;0===h[--n];)h.pop();for(;0===h[0];h.shift())--i;return h[0]?(t.d=h,t.e=O(h,i),d?P(t,a,l):t):new f(3===l?-0:0)},D.modulo=D.mod=function(t){var e,i=this,s=i.constructor;return t=new s(t),!i.d||!t.s||t.d&&!t.d[0]?new s(NaN):!t.d||i.d&&!i.d[0]?P(new s(i),s.precision,s.rounding):(d=!1,9==s.modulo?(e=N(i,t.abs(),0,3,1)).s*=t.s:e=N(i,t,0,s.modulo,1),e=e.times(t),d=!0,i.minus(e))},D.naturalExponential=D.exp=function(){return H(this)},D.naturalLogarithm=D.ln=function(){return G(this)},D.negated=D.neg=function(){var t=new this.constructor(this);return t.s=-t.s,P(t)},D.plus=D.add=function(t){var e,i,s,r,o,n,a,l,h,c,u=this,p=u.constructor;if(t=new p(t),!u.d||!t.d)return u.s&&t.s?u.d||(t=new p(t.d||u.s===t.s?u:NaN)):t=new p(NaN),t;if(u.s!=t.s)return t.s=-t.s,u.minus(t);if(c=t.d,a=p.precision,l=p.rounding,!(h=u.d)[0]||!c[0])return c[0]||(t=new p(u)),d?P(t,a,l):t;if(o=b(u.e/C),s=b(t.e/C),h=h.slice(),r=o-s){for(r<0?(i=h,r=-r,n=c.length):(i=c,s=o,n=h.length),r>(n=(o=Math.ceil(a/C))>n?o+1:n+1)&&(r=n,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((n=h.length)-(r=c.length)<0&&(r=n,i=c,c=h,h=i),e=0;r;)e=(h[--r]=h[r]+c[r]+e)/_|0,h[r]%=_;for(e&&(h.unshift(e),++s),n=h.length;0==h[--n];)h.pop();return t.d=h,t.e=O(h,s),d?P(t,a,l):t},D.precision=D.sd=function(t){var e,i=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(p+t);return i.d?(e=j(i.d),t&&i.e+1>e&&(e=i.e+1)):e=NaN,e},D.round=function(){var t=this,e=t.constructor;return P(new e(t),t.e+1,e.rounding)},D.sine=D.sin=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+Math.max(i.e,i.sd())+C,s.rounding=1,i=function(t,e){var i,s=e.d.length;if(s<3)return e.isZero()?e:Y(t,2,e,e);i=1.4*Math.sqrt(s),e=Y(t,2,e=e.times(1/J(5,i=i>16?16:0|i)),e);for(var r,o=new t(5),n=new t(16),a=new t(20);i--;)r=e.times(e),e=e.times(o.plus(r.times(n.times(r).minus(a))));return e}(s,K(s,i)),s.precision=t,s.rounding=e,P(r>2?i.neg():i,t,e,!0)):new s(NaN)},D.squareRoot=D.sqrt=function(){var t,e,i,s,r,o,n=this,a=n.d,l=n.e,h=n.s,c=n.constructor;if(1!==h||!a||!a[0])return new c(!h||h<0&&(!a||a[0])?NaN:a?n:1/0);for(d=!1,0==(h=Math.sqrt(+n))||h==1/0?(((e=A(a)).length+l)%2==0&&(e+="0"),h=Math.sqrt(e),l=b((l+1)/2)-(l<0||l%2),s=new c(e=h==1/0?"5e"+l:(e=h.toExponential()).slice(0,e.indexOf("e")+1)+l)):s=new c(h.toString()),i=(l=c.precision)+3;;)if(s=(o=s).plus(N(n,o,i+2,1)).times(.5),A(o.d).slice(0,i)===(e=A(s.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(P(s,l+1,1),t=!s.times(s).eq(n));break}if(!r&&(P(o,l+1,0),o.times(o).eq(n))){s=o;break}i+=4,r=1}return d=!0,P(s,l,c.rounding,t)},D.tangent=D.tan=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+10,s.rounding=1,(i=i.sin()).s=1,i=N(i,new s(1).minus(i.times(i)).sqrt(),t+10,0),s.precision=t,s.rounding=e,P(2==r||4==r?i.neg():i,t,e,!0)):new s(NaN)},D.times=D.mul=function(t){var e,i,s,r,o,n,a,l,h,c=this,u=c.constructor,p=c.d,m=(t=new u(t)).d;if(t.s*=c.s,!(p&&p[0]&&m&&m[0]))return new u(!t.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*t.s:t.s/0);for(i=b(c.e/C)+b(t.e/C),(l=p.length)<(h=m.length)&&(o=p,p=m,m=o,n=l,l=h,h=n),o=[],s=n=l+h;s--;)o.push(0);for(s=h;--s>=0;){for(e=0,r=l+s;r>s;)a=o[r]+m[s]*p[r-s-1]+e,o[r--]=a%_|0,e=a/_|0;o[r]=(o[r]+e)%_|0}for(;!o[--n];)o.pop();return e?++i:o.shift(),t.d=o,t.e=O(o,i),d?P(t,u.precision,u.rounding):t},D.toBinary=function(t,e){return Z(this,2,t,e)},D.toDecimalPlaces=D.toDP=function(t,e){var i=this,s=i.constructor;return i=new s(i),void 0===t?i:(I(t,0,n),void 0===e?e=s.rounding:I(e,0,8),P(i,t+i.e+1,e))},D.toExponential=function(t,e){var i,s=this,r=s.constructor;return void 0===t?i=B(s,!0):(I(t,0,n),void 0===e?e=r.rounding:I(e,0,8),i=B(s=P(new r(s),t+1,e),!0,t+1)),s.isNeg()&&!s.isZero()?"-"+i:i},D.toFixed=function(t,e){var i,s,r=this,o=r.constructor;return void 0===t?i=B(r):(I(t,0,n),void 0===e?e=o.rounding:I(e,0,8),i=B(s=P(new o(r),t+r.e+1,e),!1,t+s.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},D.toFraction=function(t){var e,i,s,r,o,n,a,l,h,c,u,m,f=this,v=f.d,b=f.constructor;if(!v)return new b(f);if(h=i=new b(1),s=l=new b(0),o=(e=new b(s)).e=j(v)-f.e-1,e.d[0]=g(10,(n=o%C)<0?C+n:n),null==t)t=o>0?e:h;else{if(!(a=new b(t)).isInt()||a.lt(h))throw Error(p+a);t=a.gt(e)?o>0?e:h:a}for(d=!1,a=new b(A(v)),c=b.precision,b.precision=o=v.length*C*2;u=N(a,e,0,1,1),1!=(r=i.plus(u.times(s))).cmp(t);)i=s,s=r,h=l.plus(u.times(r=h)),l=r,e=a.minus(u.times(r=e)),a=r;return r=N(t.minus(i),s,0,1,1),l=l.plus(r.times(h)),i=i.plus(r.times(s)),l.s=h.s=f.s,m=N(h,s,o,1).minus(f).abs().cmp(N(l,i,o,1).minus(f).abs())<1?[h,s]:[l,i],b.precision=c,d=!0,m},D.toHexadecimal=D.toHex=function(t,e){return Z(this,16,t,e)},D.toNearest=function(t,e){var i=this,s=i.constructor;if(i=new s(i),null==t){if(!i.d)return i;t=new s(1),e=s.rounding}else{if(t=new s(t),void 0===e?e=s.rounding:I(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]?(d=!1,i=N(i,t,0,e,1).times(t),d=!0,P(i)):(t.s=i.s,i=t),i},D.toNumber=function(){return+this},D.toOctal=function(t,e){return Z(this,8,t,e)},D.toPower=D.pow=function(t){var e,i,s,r,o,n,a=this,l=a.constructor,h=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(g(+a,h));if((a=new l(a)).eq(1))return a;if(s=l.precision,o=l.rounding,t.eq(1))return P(a,s,o);if((e=b(t.e/C))>=t.d.length-1&&(i=h<0?-h:h)<=9007199254740991)return r=L(l,a,i,s),t.s<0?new l(1).div(r):P(r,s,o);if((n=a.s)<0){if(e<t.d.length-1)return new l(NaN);if(1&t.d[e]||(n=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=n,a}return(e=0!=(i=g(+a,h))&&isFinite(i)?new l(i+"").e:b(h*(Math.log("0."+A(a.d))/Math.LN10+a.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?n/0:0):(d=!1,l.rounding=a.s=1,i=Math.min(12,(e+"").length),(r=H(t.times(G(a,s+i)),s)).d&&z((r=P(r,s+5,1)).d,s,o)&&+A((r=P(H(t.times(G(a,(e=s+10)+i)),e),e+5,1)).d).slice(s+1,s+15)+1==1e14&&(r=P(r,s+1,0)),r.s=n,d=!0,l.rounding=o,P(r,s,o))},D.toPrecision=function(t,e){var i,s=this,r=s.constructor;return void 0===t?i=B(s,s.e<=r.toExpNeg||s.e>=r.toExpPos):(I(t,1,n),void 0===e?e=r.rounding:I(e,0,8),i=B(s=P(new r(s),t,e),t<=s.e||s.e<=r.toExpNeg,t)),s.isNeg()&&!s.isZero()?"-"+i:i},D.toSignificantDigits=D.toSD=function(t,e){var i=this.constructor;return void 0===t?(t=i.precision,e=i.rounding):(I(t,1,n),void 0===e?e=i.rounding:I(e,0,8)),P(new i(this),t,e)},D.toString=function(){var t=this,e=t.constructor,i=B(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+i:i},D.truncated=D.trunc=function(){return P(new this.constructor(this),this.e+1,1)},D.valueOf=D.toJSON=function(){var t=this,e=t.constructor,i=B(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+i:i};var N=function(){function t(t,e,i){var s,r=0,o=t.length;for(t=t.slice();o--;)t[o]=(s=t[o]*e+r)%i|0,r=s/i|0;return r&&t.unshift(r),t}function e(t,e,i,s){var r,o;if(i!=s)o=i>s?1:-1;else for(r=o=0;r<i;r++)if(t[r]!=e[r]){o=t[r]>e[r]?1:-1;break}return o}function s(t,e,i,s){for(var r=0;i--;)t[i]-=r,t[i]=(r=t[i]<e[i]?1:0)*s+t[i]-e[i];for(;!t[0]&&t.length>1;)t.shift()}return function(r,o,n,a,l,h){var c,d,u,p,m,f,v,g,y,w,x,k,S,T,D,A,I,z,M,N,B=r.constructor,O=r.s==o.s?1:-1,E=r.d,F=o.d;if(!(E&&E[0]&&F&&F[0]))return new B(r.s&&o.s&&(E?!F||E[0]!=F[0]:F)?E&&0==E[0]||!F?0*O:O/0:NaN);for(h?(m=1,d=r.e-o.e):(h=_,d=b(r.e/(m=C))-b(o.e/m)),M=F.length,I=E.length,w=(y=new B(O)).d=[],u=0;F[u]==(E[u]||0);u++);if(F[u]>(E[u]||0)&&d--,null==n?(T=n=B.precision,a=B.rounding):T=l?n+(r.e-o.e)+1:n,T<0)w.push(1),f=!0;else{if(T=T/m+2|0,u=0,1==M){for(p=0,F=F[0],T++;(u<I||p)&&T--;u++)w[u]=(D=p*h+(E[u]||0))/F|0,p=D%F|0;f=p||u<I}else{for((p=h/(F[0]+1)|0)>1&&(F=t(F,p,h),E=t(E,p,h),M=F.length,I=E.length),A=M,k=(x=E.slice(0,M)).length;k<M;)x[k++]=0;(N=F.slice()).unshift(0),z=F[0],F[1]>=h/2&&++z;do{p=0,(c=e(F,x,M,k))<0?(S=x[0],M!=k&&(S=S*h+(x[1]||0)),(p=S/z|0)>1?(p>=h&&(p=h-1),1==(c=e(v=t(F,p,h),x,g=v.length,k=x.length))&&(p--,s(v,M<g?N:F,g,h))):(0==p&&(c=p=1),v=F.slice()),(g=v.length)<k&&v.unshift(0),s(x,v,k,h),-1==c&&(c=e(F,x,M,k=x.length))<1&&(p++,s(x,M<k?N:F,k,h)),k=x.length):0===c&&(p++,x=[0]),w[u++]=p,c&&x[0]?x[k++]=E[A]||0:(x=[E[A]],k=1)}while((A++<I||void 0!==x[0])&&T--);f=void 0!==x[0]}w[0]||w.shift()}if(1==m)y.e=d,i=f;else{for(u=1,p=w[0];p>=10;p/=10)u++;y.e=u+d*m-1,P(y,l?n+y.e+1:n,a,f)}return y}}();function P(t,e,i,s){var r,o,n,a,l,h,c,u,p,m=t.constructor;t:if(null!=e){if(!(u=t.d))return t;for(r=1,a=u[0];a>=10;a/=10)r++;if((o=e-r)<0)o+=C,l=(c=u[p=0])/g(10,r-(n=e)-1)%10|0;else if((p=Math.ceil((o+1)/C))>=(a=u.length)){if(!s)break t;for(;a++<=p;)u.push(0);c=l=0,r=1,n=(o%=C)-C+1}else{for(c=a=u[p],r=1;a>=10;a/=10)r++;l=(n=(o%=C)-C+r)<0?0:c/g(10,r-n-1)%10|0}if(s=s||e<0||void 0!==u[p+1]||(n<0?c:c%g(10,r-n-1)),h=i<4?(l||s)&&(0==i||i==(t.s<0?3:2)):l>5||5==l&&(4==i||s||6==i&&(o>0?n>0?c/g(10,r-n):0:u[p-1])%10&1||i==(t.s<0?8:7)),e<1||!u[0])return u.length=0,h?(u[0]=g(10,(C-(e-=t.e+1)%C)%C),t.e=-e||0):u[0]=t.e=0,t;if(0==o?(u.length=p,a=1,p--):(u.length=p+1,a=g(10,C-o),u[p]=n>0?(c/g(10,r-n)%g(10,n)|0)*a:0),h)for(;;){if(0==p){for(o=1,n=u[0];n>=10;n/=10)o++;for(n=u[0]+=a,a=1;n>=10;n/=10)a++;o!=a&&(t.e++,u[0]==_&&(u[0]=1));break}if(u[p]+=a,u[p]!=_)break;u[p--]=0,a=1}for(o=u.length;0===u[--o];)u.pop()}return d&&(t.e>m.maxE?(t.d=null,t.e=NaN):t.e<m.minE&&(t.e=0,t.d=[0])),t}function B(t,e,i){if(!t.isFinite())return U(t);var s,r=t.e,o=A(t.d),n=o.length;return e?(i&&(s=i-n)>0?o=o.charAt(0)+"."+o.slice(1)+R(s):n>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):r<0?(o="0."+R(-r-1)+o,i&&(s=i-n)>0&&(o+=R(s))):r>=n?(o+=R(r+1-n),i&&(s=i-r-1)>0&&(o=o+"."+R(s))):((s=r+1)<n&&(o=o.slice(0,s)+"."+o.slice(s)),i&&(s=i-n)>0&&(r+1===n&&(o+="."),o+=R(s))),o}function O(t,e){var i=t[0];for(e*=C;i>=10;i/=10)e++;return e}function E(t,e,i){if(e>S)throw d=!0,i&&(t.precision=i),Error(m);return P(new t(l),e,1,!0)}function F(t,e,i){if(e>T)throw Error(m);return P(new t(h),e,i,!0)}function j(t){var e=t.length-1,i=e*C+1;if(e=t[e]){for(;e%10==0;e/=10)i--;for(e=t[0];e>=10;e/=10)i++}return i}function R(t){for(var e="";t--;)e+="0";return e}function L(t,e,i,s){var r,o=new t(1),n=Math.ceil(s/C+4);for(d=!1;;){if(i%2&&X((o=o.times(e)).d,n)&&(r=!0),0===(i=b(i/2))){i=o.d.length-1,r&&0===o.d[i]&&++o.d[i];break}X((e=e.times(e)).d,n)}return d=!0,o}function W(t){return 1&t.d[t.d.length-1]}function $(t,e,i){for(var s,r,o=new t(e[0]),n=0;++n<e.length;){if(!(r=new t(e[n])).s){o=r;break}((s=o.cmp(r))===i||0===s&&o.s===i)&&(o=r)}return o}function H(t,e){var i,s,r,o,n,a,l,h=0,c=0,u=0,p=t.constructor,m=p.rounding,f=p.precision;if(!t.d||!t.d[0]||t.e>17)return new p(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(d=!1,l=f):l=e,a=new p(.03125);t.e>-2;)t=t.times(a),u+=5;for(l+=s=Math.log(g(2,u))/Math.LN10*2+5|0,i=o=n=new p(1),p.precision=l;;){if(o=P(o.times(t),l,1),i=i.times(++c),A((a=n.plus(N(o,i,l,1))).d).slice(0,l)===A(n.d).slice(0,l)){for(r=u;r--;)n=P(n.times(n),l,1);if(null!=e)return p.precision=f,n;if(!(h<3&&z(n.d,l-s,m,h)))return P(n,p.precision=f,m,d=!0);p.precision=l+=10,i=o=a=new p(1),c=0,h++}n=a}}function G(t,e){var i,s,r,o,n,a,l,h,c,u,p,m=1,f=t,v=f.d,b=f.constructor,g=b.rounding,y=b.precision;if(f.s<0||!v||!v[0]||!f.e&&1==v[0]&&1==v.length)return new b(v&&!v[0]?-1/0:1!=f.s?NaN:v?0:f);if(null==e?(d=!1,c=y):c=e,b.precision=c+=10,s=(i=A(v)).charAt(0),!(Math.abs(o=f.e)<15e14))return h=E(b,c+2,y).times(o+""),f=G(new b(s+"."+i.slice(1)),c-10).plus(h),b.precision=y,null==e?P(f,y,g,d=!0):f;for(;s<7&&1!=s||1==s&&i.charAt(1)>3;)s=(i=A((f=f.times(t)).d)).charAt(0),m++;for(o=f.e,s>1?(f=new b("0."+i),o++):f=new b(s+"."+i.slice(1)),u=f,l=n=f=N(f.minus(1),f.plus(1),c,1),p=P(f.times(f),c,1),r=3;;){if(n=P(n.times(p),c,1),A((h=l.plus(N(n,new b(r),c,1))).d).slice(0,c)===A(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(E(b,c+2,y).times(o+""))),l=N(l,new b(m),c,1),null!=e)return b.precision=y,l;if(!z(l.d,c-10,g,a))return P(l,b.precision=y,g,d=!0);b.precision=c+=10,h=n=f=N(u.minus(1),u.plus(1),c,1),p=P(f.times(f),c,1),r=a=1}l=h,r+=2}}function U(t){return String(t.s*t.s/0)}function V(t,e){var i,s,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(s=e.search(/e/i))>0?(i<0&&(i=s),i+=+e.slice(s+1),e=e.substring(0,s)):i<0&&(i=e.length),s=0;48===e.charCodeAt(s);s++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(s,r)){if(r-=s,t.e=i=i-s-1,t.d=[],s=(i+1)%C,i<0&&(s+=C),s<r){for(s&&t.d.push(+e.slice(0,s)),r-=C;s<r;)t.d.push(+e.slice(s,s+=C));e=e.slice(s),s=C-e.length}else s-=r;for(;s--;)e+="0";t.d.push(+e),d&&(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 q(t,i){var s,r,o,n,a,l,h,c,u;if(i.indexOf("_")>-1){if(i=i.replace(/(\d)_(?=\d)/g,"$1"),k.test(i))return V(t,i)}else if("Infinity"===i||"NaN"===i)return+i||(t.s=NaN),t.e=NaN,t.d=null,t;if(w.test(i))s=16,i=i.toLowerCase();else if(y.test(i))s=2;else{if(!x.test(i))throw Error(p+i);s=8}for((n=i.search(/p/i))>0?(h=+i.slice(n+1),i=i.substring(2,n)):i=i.slice(2),n=i.indexOf("."),r=t.constructor,(a=n>=0)&&(n=(l=(i=i.replace(".","")).length)-n,o=L(r,new r(s),n,2*n)),n=u=(c=M(i,s,_)).length-1;0===c[n];--n)c.pop();return n<0?new r(0*t.s):(t.e=O(c,u),t.d=c,d=!1,a&&(t=N(t,o,4*l)),h&&(t=t.times(Math.abs(h)<54?g(2,h):e.pow(2,h))),d=!0,t)}function Y(t,e,i,s,r){var o,n,a,l,h=t.precision,c=Math.ceil(h/C);for(d=!1,l=i.times(i),a=new t(s);;){if(n=N(a.times(l),new t(e++*e++),h,1),a=r?s.plus(n):s.minus(n),s=N(n.times(l),new t(e++*e++),h,1),void 0!==(n=a.plus(s)).d[c]){for(o=c;n.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=s,s=n,n=o}return d=!0,n.d.length=c+1,n}function J(t,e){for(var i=t;--e;)i*=t;return i}function K(t,e){var i,s=e.s<0,o=F(t,t.precision,1),n=o.times(.5);if((e=e.abs()).lte(n))return r=s?4:1,e;if((i=e.divToInt(o)).isZero())r=s?3:2;else{if((e=e.minus(i.times(o))).lte(n))return r=W(i)?s?2:3:s?4:1,e;r=W(i)?s?1:4:s?3:2}return e.minus(o).abs()}function Z(t,e,s,r){var o,l,h,c,d,u,p,m,f,v=t.constructor,b=void 0!==s;if(b?(I(s,1,n),void 0===r?r=v.rounding:I(r,0,8)):(s=v.precision,r=v.rounding),t.isFinite()){for(b?(o=2,16==e?s=4*s-3:8==e&&(s=3*s-2)):o=e,(h=(p=B(t)).indexOf("."))>=0&&(p=p.replace(".",""),(f=new v(1)).e=p.length-h,f.d=M(B(f),10,o),f.e=f.d.length),l=d=(m=M(p,10,o)).length;0==m[--d];)m.pop();if(m[0]){if(h<0?l--:((t=new v(t)).d=m,t.e=l,m=(t=N(t,f,s,r,0,o)).d,l=t.e,u=i),h=m[s],c=o/2,u=u||void 0!==m[s+1],u=r<4?(void 0!==h||u)&&(0===r||r===(t.s<0?3:2)):h>c||h===c&&(4===r||u||6===r&&1&m[s-1]||r===(t.s<0?8:7)),m.length=s,u)for(;++m[--s]>o-1;)m[s]=0,s||(++l,m.unshift(1));for(d=m.length;!m[d-1];--d);for(h=0,p="";h<d;h++)p+=a.charAt(m[h]);if(b){if(d>1)if(16==e||8==e){for(h=16==e?4:3,--d;d%h;d++)p+="0";for(d=(m=M(p,o,e)).length;!m[d-1];--d);for(h=1,p="1.";h<d;h++)p+=a.charAt(m[h])}else p=p.charAt(0)+"."+p.slice(1);p=p+(l<0?"p":"p+")+l}else if(l<0){for(;++l;)p="0"+p;p="0."+p}else if(++l>d)for(l-=d;l--;)p+="0";else l<d&&(p=p.slice(0,l)+"."+p.slice(l))}else p=b?"0p+0":"0";p=(16==e?"0x":2==e?"0b":8==e?"0o":"")+p}else p=U(t);return t.s<0?"-"+p:p}function X(t,e){if(t.length>e)return t.length=e,!0}function Q(t){return new this(t).abs()}function tt(t){return new this(t).acos()}function et(t){return new this(t).acosh()}function it(t,e){return new this(t).plus(e)}function st(t){return new this(t).asin()}function rt(t){return new this(t).asinh()}function ot(t){return new this(t).atan()}function nt(t){return new this(t).atanh()}function at(t,e){t=new this(t),e=new this(e);var i,s=this.precision,r=this.rounding,o=s+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(i=e.s<0?F(this,s,r):new this(0)).s=t.s:!t.d||e.isZero()?(i=F(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,i=this.atan(N(t,e,o,1)),e=F(this,o,1),this.precision=s,this.rounding=r,i=t.s<0?i.minus(e):i.plus(e)):i=this.atan(N(t,e,o,1)):(i=F(this,o,1).times(e.s>0?.25:.75)).s=t.s:i=new this(NaN),i}function lt(t){return new this(t).cbrt()}function ht(t){return P(t=new this(t),t.e+1,2)}function ct(t,e,i){return new this(t).clamp(e,i)}function dt(t){if(!t||"object"!=typeof t)throw Error(u+"Object expected");var e,i,s,r=!0===t.defaults,a=["precision",1,n,"rounding",0,8,"toExpNeg",-o,0,"toExpPos",0,o,"maxE",0,o,"minE",-o,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(i=a[e],r&&(this[i]=c[i]),void 0!==(s=t[i])){if(!(b(s)===s&&s>=a[e+1]&&s<=a[e+2]))throw Error(p+i+": "+s);this[i]=s}if(i="crypto",r&&(this[i]=c[i]),void 0!==(s=t[i])){if(!0!==s&&!1!==s&&0!==s&&1!==s)throw Error(p+i+": "+s);if(s){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(f);this[i]=!0}else this[i]=!1}return this}function ut(t){return new this(t).cos()}function pt(t){return new this(t).cosh()}function mt(t,e){return new this(t).div(e)}function ft(t){return new this(t).exp()}function vt(t){return P(t=new this(t),t.e+1,3)}function bt(){var t,e,i=new this(0);for(d=!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 d=!0,new this(1/0);i=e}return d=!0,i.sqrt()}function gt(t){return t instanceof e||t&&t.toStringTag===v||!1}function yt(t){return new this(t).ln()}function wt(t,e){return new this(t).log(e)}function xt(t){return new this(t).log(2)}function kt(t){return new this(t).log(10)}function _t(){return $(this,arguments,-1)}function Ct(){return $(this,arguments,1)}function St(t,e){return new this(t).mod(e)}function Tt(t,e){return new this(t).mul(e)}function Dt(t,e){return new this(t).pow(e)}function At(t){var e,i,s,r,o=0,a=new this(1),l=[];if(void 0===t?t=this.precision:I(t,1,n),s=Math.ceil(t/C),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(s));o<s;)(r=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:l[o++]=r%1e7;else{if(!crypto.randomBytes)throw Error(f);for(e=crypto.randomBytes(s*=4);o<s;)(r=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(l.push(r%1e7),o+=4);o=s/4}else for(;o<s;)l[o++]=1e7*Math.random()|0;for(s=l[--o],t%=C,s&&t&&(r=g(10,C-t),l[o]=(s/r|0)*r);0===l[o];o--)l.pop();if(o<0)i=0,l=[0];else{for(i=-1;0===l[0];i-=C)l.shift();for(s=1,r=l[0];r>=10;r/=10)s++;s<C&&(i-=C-s)}return a.e=i,a.d=l,a}function It(t){return P(t=new this(t),t.e+1,this.rounding)}function zt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Mt(t){return new this(t).sin()}function Nt(t){return new this(t).sinh()}function Pt(t){return new this(t).sqrt()}function Bt(t,e){return new this(t).sub(e)}function Ot(){var t=0,e=arguments,i=new this(e[t]);for(d=!1;i.s&&++t<e.length;)i=i.plus(e[t]);return d=!0,P(i,this.precision,this.rounding)}function Et(t){return new this(t).tan()}function Ft(t){return new this(t).tanh()}function jt(t){return P(t=new this(t),t.e+1,1)}e=function t(e){var i,s,r;function o(t){var e,i,s,r=this;if(!(r instanceof o))return new o(t);if(r.constructor=o,gt(t))return r.s=t.s,void(d?!t.d||t.e>o.maxE?(r.e=NaN,r.d=null):t.e<o.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"==(s=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(d?e>o.maxE?(r.e=NaN,r.d=null):e<o.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)):V(r,t.toString())}if("string"===s)return 45===(i=t.charCodeAt(0))?(t=t.slice(1),r.s=-1):(43===i&&(t=t.slice(1)),r.s=1),k.test(t)?V(r,t):q(r,t);if("bigint"===s)return t<0?(t=-t,r.s=-1):r.s=1,V(r,t.toString());throw Error(p+t)}if(o.prototype=D,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=dt,o.clone=t,o.isDecimal=gt,o.abs=Q,o.acos=tt,o.acosh=et,o.add=it,o.asin=st,o.asinh=rt,o.atan=ot,o.atanh=nt,o.atan2=at,o.cbrt=lt,o.ceil=ht,o.clamp=ct,o.cos=ut,o.cosh=pt,o.div=mt,o.exp=ft,o.floor=vt,o.hypot=bt,o.ln=yt,o.log=wt,o.log10=kt,o.log2=xt,o.max=_t,o.min=Ct,o.mod=St,o.mul=Tt,o.pow=Dt,o.random=At,o.round=It,o.sign=zt,o.sin=Mt,o.sinh=Nt,o.sqrt=Pt,o.sub=Bt,o.sum=Ot,o.tan=Et,o.tanh=Ft,o.trunc=jt,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(s=r[i++])||(e[s]=this[s]);return o.config(e),o}(c),e.prototype.constructor=e,e.default=e.Decimal=e,l=new e(l),h=new e(h),Mh.exports?("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(D[Symbol.for("nodejs.util.inspect.custom")]=D.toString,D[Symbol.toStringTag]="Decimal"),Mh.exports=e):(t||(t="undefined"!=typeof self&&self&&self.self==self?self:window),s=t.Decimal,e.noConflict=function(){return t.Decimal=s,e},t.Decimal=e)}(Nh);const Bh=Ph.exports,Oh=class{constructor(e){t(this,e),this.ticketDrawDetails=[],this.ticketDrawDetailsFlag=!0,this.displayPrizeCategory=t=>{const e=new Map;t.forEach((t=>{let i=t.divisionDisplayName,s=t.currency;if(i&&"None"!==i){const r=new Bh(t.amount);if(e.has(i)){const t=e.get(i),o=t.amount.plus(r);e.set(i,{amount:o,currency:s,times:t.times+1})}else e.set(i,{amount:r,currency:s,times:1})}}));const i=[];for(let[t,s]of e.entries()){const e=s.amount.times(100).floor().dividedBy(100);i.push({prizeName:t,amount:e.toNumber(),currency:s.currency,times:s.times})}return i.sort(((t,e)=>e.prizeName.localeCompare(t.prizeName))),i},this.thousandSeperator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.language="en",this.playerId=void 0,this.drawMode=!1,this.drawId="",this.gameName="",this.ticketDate="",this.ticketStatus="",this.ticketId="",this.ticketType="",this.ticketAmount="",this.ticketCurrency="",this.ticketMultiplier=!1,this.ticketMultiplierNum=void 0,this.ticketDrawCount=0,this.ticketNumbers="",this.sessionId="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.ticketDrawData="",this.historyDrawData="",this.tabValue="",this.translationUrl=void 0,this.multiplier=3,this.isLoading=!0,this.hasErrors=!1,this.errorText="",this.ticketData=[],this.ticketDataLoaded=!1,this.ticketDraws=[],this.toggleDrawer=[!1],this.drawData=void 0,this.resultMap={Won:"Win",Lost:"Lose"}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Ih[e][i]=t[e][i]})))}connectedCallback(){if(this.historyDrawData&&(this.drawData=JSON.parse(this.historyDrawData)),this.ticketNumbers){let t=JSON.parse(this.ticketNumbers);this.gridNumbers=t.map((t=>t.selections)),this.gridSecondaryNumbers=t.map((t=>t.secondarySelections||[]))}this.isLoading=!1}componentWillRender(){this.ticketDrawData&&this.ticketDrawDetailsFlag&&(this.ticketDrawDetails=JSON.parse(this.ticketDrawData),this.ticketDrawDetails.forEach((t=>{this.getDrawData(t.drawId).then((e=>{t.drawData=Object.assign({},e);let i=this.displayPrizeCategory(t.details);t.details=[...i]}))})),this.ticketDrawDetailsFlag=!1)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}getDrawData(t){return this.isLoading=!0,new Promise(((e,i)=>{let s=new URL(`${this.endpoint}/games/${this.gameId}/draws/${t||this.drawId}`);fetch(s.href).then((t=>t.json())).then((i=>{t?e(i):(this.drawData=i,e(!0)),this.isLoading=!1})).catch((t=>{i(t),this.isLoading=!1}))}))}drawerToggle(t){this.toggleDrawer=this.toggleDrawer.map(((e,i)=>i==t?!e:e)),t>=this.toggleDrawer.length&&this.toggleDrawer.push(!0)}getDivision(t,e){var i,s;let r=t.division,o=null===(s=null===(i=e.drawData)||void 0===i?void 0:i.prizes)||void 0===s?void 0:s.filter((t=>t.order===r));return o&&o.length?o[0].division:null}render(){return this.isLoading?s("p",null,"Loading, please wait ..."):this.hasErrors?void s("p",null,this.errorText):s("section",{class:"DrawResultsSection",ref:t=>this.stylingContainer=t},this.drawMode?s("div",{class:"DrawResultsArea"},this.drawData&&s("div",null,s("div",{class:"DrawResultsHeader"},s("span",null,zh("drawId",this.language),": ",this.drawData.id),s("span",null,zh("drawDate",this.language),": ",bh(new Date(this.drawData.date),"dd/MM/yyyy"))),s("div",{class:"DrawResultsBody"},s("div",{class:"DrawNumbersGrid"},s("p",null,zh("drawNumbersGridDraw",this.language)),s("div",{class:"BulletContainer"},s("lottery-grid",{"selected-numbers":this.drawData.winningNumbers.length&&this.drawData.winningNumbers[0].numbers.join(","),"secondary-numbers":this.drawData.winningNumbers.length?this.drawData.winningNumbers[0].secondaryNumbers.join(","):"","display-selected":!0,selectable:!1,language:this.language,"grid-type":"ticket","translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),s("div",{class:"DrawPrizes"},s("label",{class:"Label"},zh("prize",this.language)," "),this.drawData.prizes.length?s("div",null," ",this.drawData.prizes.filter((t=>"None"!==t.division)).map((t=>s("div",null,s("span",{style:{"margin-right":"5px"}},t.division,":"),s("span",{style:{"margin-right":"4px"}}," ",this.thousandSeperator(t.amount.value)),s("span",null,t.amount.currency))))):s("div",null,"None")))))):s("div",{class:"DrawResultsArea TicketDraws"},s("div",{class:"DrawResultsBody"},s("div",{class:"TicketIdContainer"},s("label",{class:"Label"},zh("ticketId",this.language),": ",s("span",null,this.ticketId))),s("div",{class:"TicketTypeContainer"},s("label",{class:"Label"},zh("ticketType",this.language),": ",s("span",null,this.ticketType))),s("div",{class:"TicketAmountContainer"},s("label",{class:"Label"},zh("ticketAmount",this.language),":"," ",s("span",null,`${this.thousandSeperator(this.ticketAmount)} ${this.ticketCurrency}`))),s("div",{class:"DrawNumbersGrid"},this.gridNumbers.map(((t,e)=>{var i;return s("div",null,s("label",{class:"Label"},zh("drawNumbersGridTicket",this.language),":"),s("div",{class:"BulletContainer"},s("lottery-grid",{"selected-numbers":t.join(","),"secondary-numbers":null===(i=this.gridSecondaryNumbers[e])||void 0===i?void 0:i.join(","),selectable:!1,"display-selected":!0,language:this.language,"translation-url":this.translationUrl,"grid-type":"ticket","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))}))),this.ticketMultiplier&&s("div",{class:"DrawMultipler"},s("label",{class:"Label"},zh("multiplierNum",this.language),": ",this.thousandSeperator(this.ticketMultiplierNum))),s("div",{class:"NumberOfDrawsContainer"},s("label",{class:"Label"},zh("numberOfDraws",this.language),": ",this.thousandSeperator(this.ticketDrawCount)),s("div",{class:"DrawTicketsContainer"},this.ticketDrawDetails&&this.ticketDrawDetails.length>0&&s("div",{class:"ExpandableBoxes"},this.ticketDrawDetails.map(((t,e)=>{var i,r,o,n,a,l,h,c;return s("div",{class:{ExpandableBox:!0,ShowBox:this.toggleDrawer[e]},onClick:this.drawerToggle.bind(this,e)},s("div",{class:"ExpandableBoxHeader"},s("div",{class:"TicketResultContainer"},s("p",null,zh("ticketResult",this.language),": ",this.resultMap[t.state])),"won"==t.state&&s("div",{class:"AmountWonContainer"},s("p",null,zh("amountWon",this.language),":"," ",Number(t.amount).toLocaleString("en")," ",t.currency)),"lost"==t.state&&s("div",{class:"DrawIdContainer"},s("p",null,zh("drawId",this.language),": ",t.drawId))),s("div",{class:"ExpandableBoxBody"},s("div",{class:"DrawIdContainer"},s("p",null,zh("drawId",this.language),": ",t.drawId)),s("div",{class:"DrawDateContainer"},s("p",null,zh("drawDate",this.language),": ",null===(i=t.drawData)||void 0===i?void 0:i.date.slice(0,10)," |"," ",null===(r=t.drawData)||void 0===r?void 0:r.date.slice(11,19))),s("div",{class:"DrawNumbersGrid"},t.drawData&&s("div",{class:"BulletContainer"},s("label",{class:"Label"},zh("drawNumbersGridDraw",this.language),":"),s("lottery-grid",{"selected-numbers":(null===(n=null===(o=t.drawData)||void 0===o?void 0:o.winningNumbers)||void 0===n?void 0:n.length)&&(null===(a=t.drawData.winningNumbers[0].numbers)||void 0===a?void 0:a.join(",")),"secondary-numbers":(null===(h=null===(l=t.drawData)||void 0===l?void 0:l.winningNumbers)||void 0===h?void 0:h.length)&&(null===(c=t.drawData.winningNumbers[0].secondaryNumbers)||void 0===c?void 0:c.join(",")),selectable:!1,"display-selected":!0,language:this.language,"translation-url":this.translationUrl,"grid-type":"ticket","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))),t.details.length>0&&s("div",{class:"DrawPrizes"},s("label",{class:"Label"},zh("prize",this.language),":"),s("span",null,t.details.map((t=>s("span",null,s("div",null,s("span",null,t.prizeName,t.times>1?" x "+t.times:"",":"," "),s("span",{style:{"margin-right":"4px"}},this.thousandSeperator(t.amount)),s("span",null,t.currency)))))))))}))))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Oh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.DrawResultsArea{margin-top:15px}.DrawResultsArea.TicketDraws .Content{padding:0;border:0}.DrawResultsArea.TicketDraws .DrawResultsBody{padding:0;margin-bottom:5px;border-radius:0;border:0}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background-secondary, #f5f5f5);font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawResultsBody{padding:20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid var(--emw--color-typography, #009993)}.DrawResultsBody>div{margin:10px 0}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.DrawNumbersGrid{display:flex;flex-direction:column;gap:5px;margin-bottom:10px;color:var(--emw--color-typography, #000)}.DrawNumbersGrid label{display:block;margin-bottom:7px}.Label{position:relative}.DrawTicketsContainer{display:flex;flex-direction:column;margin:20px auto 0}.DrawMultipler{margin-top:15px}.ExpandableBoxes{position:relative;display:flex;flex-direction:column;border:1px solid var(--emw--color-gray-250, #ccc);border-radius:5px;background-color:var(--emw--color-background-secondary, #f5f5f5)}.ExpandableBox{border-bottom:1px solid var(--emw--color-gray-250, #ccc);transition:height 300ms ease-in-out;overflow:hidden;height:80px;background-color:var(--emw--color-background, #fff)}.ExpandableBox:last-child{border-bottom:0}.ExpandableBoxHeader{position:relative;list-style:none;outline:0;cursor:pointer;transition:color 300ms ease-in-out;margin-bottom:24px;margin-left:5px}.ShowBox>.ExpandableBoxHeader{color:var(--emw--color-primary, #009993)}.ExpandableBoxHeader::-webkit-details-marker{display:none}.ExpandableBoxHeader:before,.ExpandableBoxHeader:after{content:"";position:absolute}.ExpandableBoxHeader:before{right:21px;top:50%;height:2px;margin-top:-1px;width:16px;background:var(--emw--color-primary, #009993)}.ExpandableBoxHeader:after{right:28px;top:50%;height:16px;margin-top:-8px;width:2px;margin-left:-1px;background:var(--emw--color-primary, #009993);transition:all 300ms ease-in-out}.ShowBox .ExpandableBoxHeader:after{opacity:0;transform:translateY(25%)}.ExpandableBoxBody{padding-top:0;font-weight:lighter;margin-left:5px}.ExpandableBox.ShowBox{height:auto}';const Eh=["ro","en","fr","ar","hr"],Fh={en:{drawResultsHeader:"Draw results history",viewAllResults:"View All",noResults:"No results.",loading:"Loading, please wait ...",resetButton:"Reset"},ro:{drawResultsHeader:"Istoricul extragerilor",viewAllResults:"Vezi toate rezultatele",noResults:"Niciun rezultat",loading:"Loading, please wait ..."},fr:{drawResultsHeader:"Dessiner l'historique des résultats",viewAllResults:"Voir tout",noResults:"Aucun résultat",loading:"Loading, please wait ..."},ar:{drawResultsHeader:"سجل نتائج السحب",viewAllResults:"عرض الكل",noResults:"لا توجد نتائج",loading:"Loading, please wait ..."},hr:{drawResultsHeader:"Povijest rezultata izvlačenja",viewAllResults:"Pogledaj sve",noResults:"Nema rezultata",loading:"Loading, please wait ..."}},jh=(t,e)=>{const i=e;return Fh[void 0!==i&&Eh.includes(i)?i:"en"][t]},Rh=class{constructor(e){t(this,e),this.isReset=!1,this.getDrawsData=()=>{this.isLoading=!0;let t=new URL(`${this.endpoint}/games/${this.gameId}/draws`);t.searchParams.append("limit",this.limit.toString()),t.searchParams.append("offset",this.offset.toString()),t.searchParams.append("status","PAYABLE"),this.dateFiltersFrom&&t.searchParams.append("from",this.dateFiltersFrom),this.dateFiltersTo&&t.searchParams.append("to",this.dateFiltersTo),fetch(t.href).then((t=>{if(t.status>=300)throw new Error("There was an error while fetching the data");return t.json()})).then((t=>{this.winningDataSetsData=t.items||[],this.drawData=this.winningDataSetsData.map((t=>t)),this.totalResults=t.total})).catch((t=>{console.log("err",t)})).finally((()=>{this.isLoading=!1,this.noResults=0==this.drawData.filter((t=>t.winningNumbers)).length}))},this.transDataToString=t=>{try{return JSON.stringify(t)}catch(t){throw new Error(t)}},this.endpoint=void 0,this.gameId=void 0,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.drawData=[],this.winningDataSetsData=[""],this.dateFiltersFrom="",this.dateFiltersTo="",this.isLoading=!1,this.noResults=!1,this.activeIndex=0,this.totalResults=0,this.limit=5,this.offset=0}filtersHandler(t){this.dateFiltersFrom=t.detail.filterFromCalendar,this.dateFiltersTo=t.detail.filterToCalendar,this.limit=5,this.offset=0,this.getDrawsData()}clearFiltersHandler(){this.dateFiltersFrom="",this.dateFiltersTo="",this.limit=5,this.offset=0,this.drawData=this.winningDataSetsData,this.getDrawsData()}hpPageChange(t){this.limit=t.detail.limit,this.offset=t.detail.offset,this.isReset=!1,this.getDrawsData()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}connectedCallback(){this.getDrawsData()}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Fh[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){clearInterval(this.interval)}render(){let t=s("div",{key:"43dea3d7f12d1ac0b4df84ee15f3ff5192a16837",class:"DrawResultsHeader"},s("div",{key:"3ee231127221e0c6dfef0e94a4b2bec613aa25f7",class:"DrawResultsHeaderContent"},s("h4",{key:"7bc26099b3bb593b6e9229322e19941ecd38e093"},jh("drawResultsHeader",this.language)),s("div",{key:"047d1f6718d26512801de33656a803435234eab1",class:"FilterSection"},s("helper-filters",{key:"2f6ffe2fd2ae0d1a544a57d330991fd72a043a78","activate-ticket-search":"false","game-id":this.gameId,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))));return s("section",{key:"007d8200c91e7a99b911ea4e2b65be8932716a8e",class:"GridWrapper",ref:t=>this.stylingContainer=t},s("div",{key:"aa947a1455794d7719fb17098743ea60e84d6eb1",class:"DrawResultsSection"},s("div",{key:"ab8019f6591d773e8e9d52bfd8ca11d61dd74b89",class:"DrawResultsAreaHistory"},t,s("div",{key:"2a3fc14445339ba4895e8a9c7e99bcece2a54ca5",class:"HistoryGridWrapper"},s("div",{key:"90a5560b549fcd9ae871084ff5a5ab998af686cd",class:"HistoryGrid"},this.isLoading&&s("p",{key:"af0bdfd22c48844da0942b128ee304b2168571b5"},jh("loading",this.language)),!this.isLoading&&!this.noResults&&this.drawData.map((t=>s("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,"draw-id":t.id,"draw-mode":!0,language:this.language,"history-draw-data":this.transDataToString(t),"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))),!this.isLoading&&this.noResults&&s("p",{key:"e0691b0f79b53410a4d4cba4439fb907552473f8",class:"errorText"},jh("noResults",this.language)))),s("div",{key:"814919c0ea3baf1286ba2ef13fd405d21e417b19",class:"DrawHistoryPaginationWrapper"},this.totalResults>this.limit&&s("lottery-pagination",{key:"29f57cc28abab4a76fecb28a3039cf4f56d3f6f3",arrowsActive:!0,numberedNavActive:!0,"is-reset":this.isReset,"first-page":!1,"prev-page":!0,"next-page":!0,offset:this.offset,limit:this.limit,total:this.totalResults,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Rh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridBanner{background-color:var(--emw--color-primary, #009993);background-repeat:no-repeat;background-position:center;color:var(--emw--color-typography, #000);padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.GridWrapper{background-color:var(--emw--color-background, #fff)}.DrawResultsSection{max-width:600px;margin:0px auto;padding-bottom:30px;color:var(--emw--color-typography, #000)}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:var(--emw--color-primary, #009993);padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:var(--emw--color-primary, #009993);padding:10px;text-align:center;color:var(--emw--color-background, #fff);padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff);outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton,.FilterSection .ResetButton{cursor:pointer;width:max-content;border-radius:var(--emw--button-border-radius, 4px);border:1px solid var(--emw--button-border-color, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .Active{background:var(--emw--color-primary-variant, #004d4a);color:var(--emw--color-background, #fff)}.FilterSection helper-filters{margin-left:auto}.errorText{color:var(--emw--color-error, #ff0000)}';const Lh=class{constructor(e){t(this,e),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"0bb2683f87461804914d26c708499902d92dc503",class:"GamePageDetailsContainer",ref:t=>this.stylingContainer=t},s("helper-accordion",{key:"2ba23b953a9519ccb36fd203c3ac98a366673822","header-title":"Game Details",collapsed:!1,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("div",{key:"54c18e3a6fde25ff0953bb7b15b8a1200e237fd0",class:"AccordionContainer",slot:"accordionContent"},s("helper-tabs",{key:"0cb93435825bf7a42636848ffd5ff67a30369cfa","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Lh.style=":host{display:block}";const Wh=["ro","en","fr","ar","hr"],$h={en:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ...",emptyText:"Sorry. The Game is not available now."},ro:{error:"Eroare",backButton:"Inapoi",lobbyButton:"Lobby",nextDraw:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",submitSuccess:"Submit successfully!",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",modalLogin:"Please login to submit a ticket",loading:"Se incarca, va rugam asteptati ..."},fr:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ..."},ar:{error:"خطأ",backButton:"خلف",lobbyButton:"ردهة",nextDraw:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",submitSuccess:"Submit successfully!",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة",loading:"Loading, please wait ..."},hr:{error:"Greška",backButton:"Nazad",lobbyButton:"Lobby",nextDraw:"Sljedeće izvlačenje za: ",buy:"Uplati listić",viewLatest:"Pogledajte najnovije rezultate",submitSuccess:"Submit successfully!",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listić",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Podnijeti",modalLogin:"Molimo prijavite se da uplatite listić",loading:"Učitavanje, molimo pričekajte ..."}},Hh=(t,e)=>{const i=e;return $h[void 0!==i&&Wh.includes(i)?i:"en"][t]},Gh=t=>new Promise(((e,i)=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])$h[e][i]=t[e][i]})),e($h)})).catch((t=>{i(t)}))})),Uh=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}));function Vh(t,e="GET",i=null,s={}){return new Promise(((r,o)=>{const n=Uh(),a={method:e,headers:Object.assign({"Content-Type":"application/json","X-Idempotency-Key":n},s),body:null};i&&(a.body=JSON.stringify(i)),fetch(t,a).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>o(t)))}))}const qh=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})},Yh=class{constructor(i){t(this,i),this.goBackEvent=e(this,"goBackEvent",7),this.goToLobbyEvent=e(this,"goToLobbyEvent",7),this.resetAllTicketSelection=e(this,"resetAllTicketSelection",7),this.quickPick=!1,this.gameData={},this.secondarySelectionAllowed=!1,this.thousandSeperator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId=void 0,this.language="en",this.backgroundUrl=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.tickets=[],this.mainTickets=[],this.secondaryTickets=[],this.tabIndex=0,this.hasErrors=!1,this.totalAmount=0,this.successVisible=!1,this.daysRemaining=void 0,this.hoursRemaining=void 0,this.minutesRemaining=void 0,this.secondsRemaining=void 0,this.nextDate=void 0,this.isLoggedIn=!1,this.loginModalVisible=!1,this.isLoading=!1,this.showSubmitError=!1,this.submitError="",this.showApiError=!1,this.apiError="",this.translationData=void 0,this.isSubscription=!1,this.subscriptionParam=null,this.showSubscriptionError=!1,this.subscriptionError="",this.isSubscribed=!1,this.isFetchingGame=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleNewTranslations(){this.isLoading=!0,Gh(this.translationUrl).then((()=>{this.isLoading=!1}))}watchGameInfoChange(t,e){t&&t!=e&&this.getGameDetails()}async componentWillLoad(){this.gameId&&this.endpoint&&this.getGameDetails(),this.sessionId&&(this.isLoggedIn=!0);const t=[];if(this.translationUrl){const e=Gh(this.translationUrl).then((t=>{this.translationData=JSON.stringify(t)})).catch((t=>{console.log(t)}));t.push(e)}return Promise.all(t)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}countdownLogic(t){const e=()=>{this.daysRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/864e5),this.hoursRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/36e5-24*this.daysRemaining),this.minutesRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/6e4-24*this.daysRemaining*60-60*this.hoursRemaining),this.secondsRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/1e3-24*this.daysRemaining*60*60-60*this.hoursRemaining*60-60*this.minutesRemaining)};e(),this.interval=setInterval(e,1e3)}disconnectedCallback(){clearInterval(this.interval)}getGameDetails(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isFetchingGame=!0,fetch(t.href).then((t=>{if(t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{var e,i;this.gameData=t,this.basicStake=this.gameData.rules.stakes.length?Number(this.gameData.rules.stakes[0].value):0,this.basicLine=(null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.length)?this.gameData.rules.betTypes[0].boardsAllowed[0]:1,this.basicBetType=this.gameData.rules.betTypes[0],this.nextDate=null===(i=this.gameData.currentDraw)||void 0===i?void 0:i.date,this.nextDate&&this.countdownLogic(this.nextDate),this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed,this.quickPick=this.gameData.rules.quickPickAvailable,this.isSubscription=this.gameData.rules.wagerTypes&&this.gameData.rules.wagerTypes.includes("Subscription");let s=this.gameData.draws?this.gameData.draws.filter((t=>!t.winningNumbers)):[];s.length>0&&(this.nextDraw=s[0].id),this.createNewTicket()})).catch((t=>{this.hasErrors=!0,console.log("Error",t)})).finally((()=>{this.isFetchingGame=!1}))}calculateTotalAmount(){const{currency:t}=this.gameData.rules.stakes[0];this.totalAmount=0,this.mainTickets.forEach((t=>{var e;t.completed.every((t=>t))&&(this.totalAmount+=t.drawCount*(t.stake||this.basicStake)*t.multiplierNum*t.lineNum*(null===(e=t.betType)||void 0===e?void 0:e.combinations))})),this.currency=t}gridFilledHandler(t){let e="secondarySelection"===t.detail.selectionType?this.secondaryTickets:this.mainTickets;e=e.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10)));let s=e.completed||[];return s[t.detail.index]=!0,{gameId:e.gameId,ticketId:e.ticketId,completed:s,drawCount:t.detail.drawCount,stake:e.stake||this.basicStake,selectedNumbers:i,multiplierNum:t.detail.multiplierNum,multiplier:t.detail.multiplier,lineNum:e.lineNum,betType:e.betType,quickPicks:t.detail.quickPicks,betName:t.detail.betName}}return e})),"secondarySelection"===t.detail.selectionType?this.secondaryTickets=e:this.mainTickets=e,this.calculateTotalAmount()}gridDirtyHandler(t){let e="secondarySelection"===t.detail.selectionType?this.secondaryTickets:this.mainTickets;e=e.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10)));let s=e.completed||[];return s[t.detail.index]=!1,{gameId:e.gameId,ticketId:e.ticketId,completed:s,drawCount:e.drawCount,stake:e.stake,selectedNumbers:i,multiplierNum:e.multiplierNum,multiplier:e.multiplier,lineNum:e.lineNum,betType:e.betType,quickPicks:e.quickPicks,betName:e.betName}}return e})),"secondarySelection"===t.detail.selectionType?this.secondaryTickets=e:this.mainTickets=e,this.calculateTotalAmount()}modalCloseEvent(){this.loginModalVisible=!1,this.successVisible=!1}stakeChangeHandler(t){const{ticketId:e,stake:i}=t.detail;this.mainTickets[e-1].stake=i,this.calculateTotalAmount()}multiplierChangeHandler(t){const{ticketId:e,multiplierNum:i,multiplier:s}=t.detail;this.mainTickets[e-1].multiplierNum=i,this.mainTickets[e-1].multiplier=s,this.calculateTotalAmount()}drawMultiplierChangeHandler(t){const{ticketId:e,drawCount:i}=t.detail;this.mainTickets[e-1].drawCount=i,this.calculateTotalAmount()}lineMultiplierChangeHandler(t){const{ticketId:e,lineNum:i}=t.detail;this.mainTickets[e-1].lineNum=i,this.mainTickets[e-1].completed=Array.from({length:i},(()=>!1)),this.mainTickets[e-1].selectedNumbers=[],this.mainTickets[e-1].quickPicks=[]}betTypeChangeHandler(t){const{ticketId:e,betType:i}=t.detail;this.mainTickets[e-1].betType=i}createNewTicket(){this.mainTickets=[...this.mainTickets,{gameId:this.gameId,ticketId:this.mainTickets.length+1,drawCount:1,multiplierNum:1,completed:[!1],stake:this.basicStake,betType:this.basicBetType,lineNum:this.basicLine,quickPicks:[!1],betName:""}],this.secondaryTickets=[...this.secondaryTickets,{gameId:this.gameId,ticketId:this.secondaryTickets.length+1,drawCount:1,multiplierNum:1,completed:[!1],stake:this.basicStake,betType:this.basicBetType,lineNum:this.basicLine}]}showLoginModal(){this.loginModalVisible=!0}handleSubscriptionReady(t){this.subscriptionParam=t.detail}handleSubscriptionCheckChange(t){this.isSubscribed=t.detail}buildTicketParam(){let t={playerId:this.playerId.toString(),tickets:[]},e=[];this.secondarySelectionAllowed&&(e=this.secondaryTickets[0].completed.reduce(((t,e,i)=>(e||t.push(i),t)),[]));let i=this.mainTickets[0].completed.reduce(((t,e,i)=>(e||t.push(i),t)),[]),s=[...new Set([...e,...i])].sort(((t,e)=>t-e));if(s.length){this.showSubmitError=!0;let t=s.map((t=>`Line${t+1}`)).join();return this.submitError=`The number of the selected number(s) on ${t} is invalid.`,setTimeout((()=>{this.showSubmitError=!1}),3e3),null}return this.mainTickets.forEach(((e,i)=>{var s;t.tickets.push({startingDrawId:this.nextDraw,amount:(e.stake*e.drawCount*e.multiplierNum*(e.lineNum||1)*(null===(s=e.betType)||void 0===s?void 0:s.combinations)).toString(),gameId:this.gameId,gameName:this.gameData.name,currency:this.currency,selection:e.selectedNumbers.map(((t,s)=>{var r;return{betType:(null===(r=e.betType)||void 0===r?void 0:r.id)||this.gameData.rules.defaultBetType,stake:e.stake,selections:t,secondarySelections:this.secondarySelectionAllowed?this.secondaryTickets[i].selectedNumbers[s]:[],quickPick:e.quickPicks[s],betName:e.betName}})),multiplier:e.multiplier,multiplierNum:e.multiplierNum,drawCount:e.drawCount,quickPick:this.quickPick})})),t}handleSubmitTickets(){this.isSubscription&&this.isSubscribed?(this.submitTickets(),this.submitSubscriptionTickets()):this.submitTickets()}async submitSubscriptionTickets(){try{let t=await this.buildTicketParam();if(!t)return;if(!this.subscriptionParam||"string"==typeof this.subscriptionParam)return this.subscriptionError="string"==typeof this.subscriptionParam?this.subscriptionParam:"Ouccurence is required.",this.showSubscriptionError=!0,void setTimeout((()=>{this.showSubscriptionError=!1}),3e3);this.isLoading=!0;const e=this.playerId.toString(),i=`${this.endpoint}/player/${e}/ruleDefinition`;this.subscriptionParam.playerId=e;const s=bh(new Date,"yyyyMMddHHMMSS");this.subscriptionParam.name=`${this.subscriptionParam.ruleType}_${e}_${s}`;const{id:r}=await Vh(i,"POST",this.subscriptionParam,{Authorization:`Bearer ${this.sessionId}`});if(t){const e=Object.assign(Object.assign({},t),{ruleDefinitionId:r}),i=`${this.endpoint}/subscription`;await Vh(i,"POST",e,{Authorization:`Bearer ${this.sessionId}`}),qh({message:"Subscription rule created successfully.",theme:"success"});const s=new CustomEvent("resetAllTicketSelection",{bubbles:!0,composed:!0});document.dispatchEvent(s),console.log("resetAllTicketSelection event emitted through document after subscription ticket submission")}}catch(t){qh({message:"Failed to create the subscription rule. Please try again.",theme:"error"})}this.isLoading=!1}submitTickets(){let t=new URL(`${this.endpoint}/tickets`);const e=this.buildTicketParam();if(e){const i=Uh();let s={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.sessionId}`,"X-Idempotency-Key":i},body:JSON.stringify(e)};this.isLoading=!0,fetch(t.href,s).then((t=>{if(t.status>300)throw this.apiError=t.statusText+".",this.showApiError=!0,setTimeout((()=>{this.showApiError=!1}),3e3),new Error(t.statusText);return t.json()})).then((()=>{qh({message:"Ticket submitted successfully.",theme:"success"}),this.resetAllTicketSelection.emit();const t=new CustomEvent("resetAllTicketSelection",{bubbles:!0,composed:!0});document.dispatchEvent(t)})).catch((t=>{console.log("Error ",t),qh({message:"Failed to purchase the ticket. Please try again.",theme:"error"})})).finally((()=>{this.isLoading=!1}))}else console.log("No valid ticket parameters to submit")}goBack(){this.goBackEvent.emit()}goToLobby(){this.goToLobbyEvent.emit()}render(){var t,e,i,r,o,n,a,l,h,c,d,u,p,m,f,v,b,g,y,w;return this.hasErrors?s("div",{class:"GamePage"},s("div",{class:"Title"},Hh("error",this.language))):s("div",{class:"GamePage",dir:"ar"==this.language?"rtl":"ltr",ref:t=>this.stylingContainer=t},s("div",{class:"GridBanner",style:{background:this.backgroundUrl?`url(${this.backgroundUrl})`:"","background-size":"contain","background-repeat":"no-repeat","background-position":"center"}},s("div",{class:"BannerButtonsWrapper"}),s("div",{class:"Tabs"},s("div",{class:"TabButton"+(0==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=0},Hh("buy",this.language)),s("div",{class:"TabButton"+(1==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=1},Hh("viewLatest",this.language)))),this.isFetchingGame?s("div",{class:"fetching"},"Loading..."):s("div",{class:"GamePageWrap"},this.nextDate?s("div",null,s("div",{class:"NextDrawWrapper"},s("div",{class:"NextDraw"},s("p",{class:"BannerText"},Hh("nextDraw",this.language)),s("div",{class:"BannerCountdown"},s("span",{class:"CountdownDays"},this.daysRemaining,"D"),s("span",{class:"CountdownHours"},this.hoursRemaining,"H"),s("span",{class:"CountdownMinutes"},this.minutesRemaining,"M"),s("span",{class:"CountdownSeconds"},this.secondsRemaining,"S")))),0==this.tabIndex&&s("div",{class:"GamePageContentWrapper"},s("div",{class:"GamePageContent"},s("div",{class:"GameDetails"},s("lottery-game-details",{"low-number":null===(e=null===(t=this.gameData.rules)||void 0===t?void 0:t.boards[0])||void 0===e?void 0:e.lowNumber,"high-number":null===(r=null===(i=this.gameData.rules)||void 0===i?void 0:i.boards[0])||void 0===r?void 0:r.highNumber,"minimum-allowed":null===(n=null===(o=this.gameData.rules)||void 0===o?void 0:o.boards[0])||void 0===n?void 0:n.minimumAllowed,"maxinum-allowed":null===(l=null===(a=this.gameData.rules)||void 0===a?void 0:a.boards[0])||void 0===l?void 0:l.maxinumAllowed,language:this.language,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,"translation-url":this.translationData})),s("div",{class:"TicketsWrapper"},this.mainTickets.map((t=>{var e,i;return s("lottery-ticket-controller",{endpoint:this.endpoint,"ticket-id":t.ticketId,"game-id":t.gameId,collapsed:!1,last:!0,language:this.language,"auto-pick":null===(e=this.gameData.rules)||void 0===e?void 0:e.quickPickAvailable,"reset-button":null===(i=this.gameData.rules)||void 0===i?void 0:i.quickPickAvailable,"total-controllers":this.mainTickets.length,"translation-url":this.translationData,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})}))),s("div",{class:"OrderSummary"},s("h3",{class:"OrderSummaryTitle"},Hh("orderSummaryTitle",this.language)),s("div",{class:"OrderTicketInfo"},s("div",{class:"Ticket"},Hh("orderSummaryTickets",this.language),": ",s("span",null,this.mainTickets.length)),s("div",null,s("span",null,this.thousandSeperator((null===(c=null===(h=this.mainTickets[0])||void 0===h?void 0:h.betType)||void 0===c?void 0:c.combinations)*(null===(d=this.mainTickets[0])||void 0===d?void 0:d.lineNum))),s("span",{class:"Multiplier"},"x"),(null===(u=this.gameData.rules)||void 0===u?void 0:u.stakeMultiplierAvailable)&&s("span",null,s("span",null,1===(null===(p=this.mainTickets[0])||void 0===p?void 0:p.multiplierNum)?`${null===(m=this.mainTickets[0])||void 0===m?void 0:m.multiplierNum} Multiplier`:`${null===(f=this.mainTickets[0])||void 0===f?void 0:f.multiplierNum} Multipliers`),s("span",{class:"Multiplier"},"x")),s("span",null,`${null===(v=this.mainTickets[0])||void 0===v?void 0:v.stake} EUR`),(null===(b=this.gameData.rules)||void 0===b?void 0:b.drawMultiplierAvailable)&&s("span",null,s("span",{class:"Multiplier"},"x"),s("span",null,1===(null===(g=this.mainTickets[0])||void 0===g?void 0:g.drawCount)?`${null===(y=this.mainTickets[0])||void 0===y?void 0:y.drawCount} Draw`:`${null===(w=this.mainTickets[0])||void 0===w?void 0:w.drawCount} Draws`)))),s("hr",null),s("div",{class:"Total"},Hh("orderSummaryTotal",this.language),":"," ",s("span",null,this.thousandSeperator(this.totalAmount)," ",this.currency)),this.isSubscription&&s("div",{class:"SubscriptionWrapper"},s("lottery-subscription",{endpoint:this.endpoint,language:this.language,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,gameName:this.gameData.name})),s("div",{class:"ButtonWrapper"},this.isLoggedIn&&s("div",null,!this.isLoading&&s("div",{class:"submitWrap"},s("div",{class:"Button",onClick:()=>this.handleSubmitTickets()},Hh("orderSummarySubmit",this.language)),this.showSubmitError&&s("div",{class:"submitError"},this.submitError),this.showApiError&&s("div",{class:"submitError"},this.apiError),this.showSubscriptionError&&s("div",{class:"submitError"},this.subscriptionError)),this.isLoading&&s("span",{class:"Button",style:{cursor:"default"}},Hh("loading",this.language))),!this.isLoggedIn&&s("div",null,s("span",{class:"Button",onClick:()=>this.showLoginModal()},Hh("orderSummarySubmit",this.language)),s("helper-modal",{"title-modal":"Success",visible:this.loginModalVisible,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("p",{class:"SubmitModalSuccess"},Hh("modalLogin",this.language)))))))),1==this.tabIndex&&s("div",{class:"HistoryContentWrapper"},s("lottery-draw-results-history",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"translation-url":this.translationData,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))):s("div",{class:"noActiveDraw"},Hh("emptyText",this.language))),s("helper-modal",{"title-modal":"Success",visible:this.successVisible,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("p",{class:"SubmitModalSuccess"},Hh("submitSuccess",this.language))))}static get assetsDirs(){return["../static"]}get element(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],translationUrl:["handleNewTranslations"],endpoint:["watchGameInfoChange"],gameId:["watchGameInfoChange"]}}};Yh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");\n:host {\n display: block;\n font-family: "Roboto", sans-serif;\n}\n\n.GamePage {\n background-color: var(--emw--color-background, #fff);\n}\n.GamePage .GridBanner {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n background-repeat: no-repeat;\n background-position: center;\n color: var(--emw--color-typography, #000);\n padding: 0 20px 10px;\n height: 220px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.GamePage .GridBanner .BannerButtonsWrapper {\n display: flex;\n justify-content: space-between;\n padding-top: 16px;\n}\n.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,\n.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 7px 15px;\n font-size: 12px;\n text-transform: uppercase;\n width: 80px;\n cursor: pointer;\n}\n.GamePage .GridBanner .GridBannerArea {\n padding-top: 30px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.GamePage .TotalWinnings {\n color: var(--emw--color-typography, #000);\n font-size: 18px;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 10px;\n text-transform: uppercase;\n}\n.GamePage .TotalWinnings span {\n font-size: 18px;\n font-weight: 700;\n}\n.GamePage .NextDraw {\n color: var(--emw--color-primary, #009993);\n font-size: 24px;\n font-weight: 600;\n margin: 0 auto;\n text-align: center;\n text-transform: uppercase;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 4px;\n}\n.GamePage .NextDraw .BannerText {\n font-weight: 400;\n font-size: 18px;\n text-transform: uppercase;\n padding: 0;\n margin: 15px 0 0 0;\n}\n.GamePage .NextDraw .BannerCountdown {\n font-size: 22px;\n color: var(--emw--color-primary, #009993);\n display: flex;\n gap: 20px;\n}\n.GamePage .Tabs {\n display: flex;\n justify-content: center;\n gap: 10px;\n}\n.GamePage .Tabs .TabButton {\n border-radius: var(--emw--button-border-radius, 4px);\n cursor: pointer;\n padding: 8px 0;\n width: 50%;\n max-width: 200px;\n border: 1px solid var(--emw--color-primary, #009993);\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.GamePage .Tabs .TabButton.Active {\n color: var(--emw--color-primary, #009993);\n background: var(--emw--color-gray-50, #f5f5f5);\n border: 1px solid var(--emw--color-gray-50, #f5f5f5);\n}\n\n.LastDrawResultsTitle {\n color: var(--emw--color-primary, #009993);\n padding: 25px 0 10px 0;\n text-align: center;\n border-radius: var(--emw--button-border-radius, 4px);\n text-transform: uppercase;\n font-size: 16px;\n font-weight: 600;\n margin: 0;\n}\n\n.NextDrawWrapper {\n padding: 10px 15px;\n background: var(--emw--color-background, #fff);\n}\n.NextDrawWrapper .BannerText {\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n color: var(--emw--color-typography, #000);\n}\n.NextDrawWrapper .BannerCountdown {\n font-size: 22px;\n display: flex;\n gap: 8px;\n color: var(--emw--color-primary, #009993);\n font-weight: bolder;\n justify-content: center;\n}\n\n.GamePageContent {\n max-width: 1200px;\n margin: 0 auto;\n background: var(--emw--color-background, #fff);\n container-type: inline-size;\n container-name: gamePage;\n}\n\n.TicketsWrapper {\n min-height: 300px;\n}\n\n@container gamePage (min-width: 1200px) {\n .GamePageContent .TicketsWrapper {\n float: left;\n width: 49%;\n }\n .GamePageContent .GameDetails {\n float: right;\n width: 49%;\n }\n .GamePageContent .OrderSummary {\n float: right;\n width: 49%;\n }\n}\n.GameDetails {\n padding-bottom: 10px;\n margin-bottom: 20px;\n}\n\n.OrderSummary {\n min-width: 200px;\n border-radius: var(--emw--button-border-radius, 4px);\n color: var(--emw--color-typography, #000);\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n background: var(--emw--color-background, #fff);\n}\n.OrderSummary .OrderSummaryTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n text-transform: uppercase;\n text-align: center;\n}\n.OrderSummary .OrderTicketInfo {\n display: flex;\n align-items: center;\n color: var(--emw--color-typography, #000);\n}\n.OrderSummary .OrderTicketInfo .Multiplier {\n margin: 0 6px;\n}\n.OrderSummary .Ticket {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n margin-right: 30px;\n}\n.OrderSummary .Ticket span {\n text-align: right;\n}\n.OrderSummary hr {\n border: none;\n border-top: 1px double var(--emw--color-gray-100, #e6e6e6);\n color: var(--emw--color-gray-100, #e6e6e6);\n width: 100%;\n}\n.OrderSummary .Total {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n}\n.OrderSummary .Total span {\n text-align: right;\n}\n\n.ButtonWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ButtonWrapper .Button {\n cursor: pointer;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 8px 60px;\n width: max-content;\n margin: 5px;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.ButtonWrapper .Button:hover {\n background: var(--emw--color-secondary, #00aba4);\n}\n.ButtonWrapper .Button.ButtonDisabled {\n pointer-events: none;\n background: var(--emw--color-background-tertiary, #ccc);\n}\n.ButtonWrapper .submitError {\n margin-top: 10px;\n color: var(--emw--color-error, #ff3d00);\n}\n.ButtonWrapper .submitWrap {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.SubmitModalSuccess {\n text-align: center;\n font-size: 18px;\n padding: 20px;\n}\n\n.DeleteTicketModalWrapper {\n padding: 20px;\n text-align: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n font-weight: 400;\n text-transform: uppercase;\n margin: 20px 0 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalText {\n font-size: 14px;\n color: var(--emw--color-typography, #000);\n line-height: 22px;\n margin-bottom: 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons {\n display: flex;\n gap: 10px;\n justify-content: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 25px;\n width: max-content;\n margin: 5px;\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-error, #ff3d00);\n border: 1px solid var(--emw--color-error, #ff3d00);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover {\n background: var(--emw--color-tertiary, #ff6536);\n border: 1px solid var(--emw--color-error, #ff3d00);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel {\n cursor: pointer;\n width: max-content;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 10px 25px;\n margin: 5px;\n border: 1px solid var(--emw--color-secondary, #00aba4);\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover {\n background: var(--emw--color-gray-50, #f5f5f5);\n}\n\n.GamePage {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.GamePage .GamePageContentWrapper,\n.GamePage .HistoryContentWrapper {\n padding: 15px;\n flex: 1;\n background: var(--emw--color-background, #fff);\n}\n\n.HistoryContentWrapper::after,\n.GamePageContent::after {\n content: "";\n display: block;\n clear: both;\n}\n\n.GamePageWrap .noActiveDraw {\n margin: 10% auto 0px;\n padding: 24px;\n border: 1px solid var(--emw--color-primary, #009993);\n border-radius: 4px;\n width: 280px;\n color: var(--emw--color-primary, #009993);\n}\n\n.fetching {\n margin: 40px auto;\n}';const Jh=class{constructor(i){t(this,i),this.gridFilledEvent=e(this,"gridFilled",7),this.gridDirtyEvent=e(this,"gridDirty",7),this.gridClearAllEvent=e(this,"gridClearAllEvent",7),this.selectedCounter=0,this.ticketId=void 0,this.totalNumbers=0,this.gameId=void 0,this.maximumAllowed=7,this.minimumAllowed=3,this.numberRange=void 0,this.selectable=!0,this.selectedNumbers="",this.secondaryNumbers="",this.displaySelected=!1,this.language="en",this.gridIndex=void 0,this.gridType="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.highNumber=47,this.lowNumber=1,this.selectionType="mainSelection",this.partialQuickpickAvailable=!1,this.numbers=[],this.bonusNumbers=[]}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}connectedCallback(){let t=[];this.selectedNumbers.length>0&&(t=this.selectedNumbers.split(","),this.selectedCounter=t.length),this.secondaryNumbers.length>0&&(this.bonusNumbers=this.secondaryNumbers.split(",").map((t=>({number:t,selected:!0,selectable:this.selectable})))),this.displaySelected?t.forEach((t=>{this.numbers.push({number:t,selected:!0,selectable:this.selectable})})):Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e)).map((t=>t.toString())).forEach((e=>{this.numbers.push({number:e,selected:t.indexOf(e)>=0,selectable:this.selectedCounter!=this.maximumAllowed&&this.selectable})}))}shuffleArray(t){const e=[];for(;t.length>0;){const i=Math.floor(Math.random()*t.length);e.push(t.splice(i,1)[0])}return e}lotteryBulletSelectionHandler(t){this.numbers=this.numbers.map((e=>({number:e.number,selected:e.number==t.detail.value?t.detail.selected:e.selected,selectable:e.selectable}))),t.detail.selected?(this.selectedCounter+=1,this.selectedCounter>=this.minimumAllowed&&this.selectedCounter<=this.maximumAllowed&&(this.numbers=this.numbers.map((t=>this.selectedCounter===this.maximumAllowed?{number:t.number,selected:t.selected,selectable:!!t.selected}:{number:t.number,selected:t.selected,selectable:!0})),JSON.parse(this.numberRange).includes(this.selectedCounter)?this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))):(this.selectedCounter-=1,this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!0}))),0===this.selectedCounter&&this.gridClearAllEvent.emit(this.gridIndex),this.selectedCounter<this.minimumAllowed?this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))}async resetSelectionHandler(t){t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex&&(this.selectedCounter=0,this.numbers=this.numbers.map((t=>({number:t.number,selected:!1,selectable:this.selectable}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:[]}))}async autoSelectionHandler(t){if(t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex){this.resetSelectionHandler(t);let e=Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e));e=this.shuffleArray(e),e=e.slice(0,this.minimumAllowed),this.numbers=this.numbers.map((t=>({number:t.number,selected:e.indexOf(parseInt(t.number,10))>=0,selectable:!!this.partialQuickpickAvailable&&e.indexOf(parseInt(t.number,10))>=0}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}),this.selectedCounter=this.minimumAllowed}}render(){return s("div",{key:"f62b5b1e5a6cf7bcaa13ce2c8a281bc93fa439f7",class:"GridContainer",ref:t=>this.stylingContainer=t},s("div",{key:"e381adbfff57e2cc343188c46037eb45ab798cac",class:"ticket"===this.gridType?"Grid TicketGrid":"Grid"},this.numbers.map((t=>s("div",null,s("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))),this.bonusNumbers.length?this.bonusNumbers.map((t=>s("div",null,s("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"is-bonus":!0,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))):""))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Jh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}';const Kh=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),Zh={en:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ro:{firstPage:"Prima",previousPage:"Anterior",nextPage:"Urmatoarea",lastPage:"Ultima"},fr:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ar:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},hu:{firstPage:"First",previousPage:"Previous",nextPage:"Következő",lastPage:"Last"},hr:{firstPage:"Prva",previousPage:"Prethodna",nextPage:"Slijedeća",lastPage:"Zadnja"}},Xh=(t,e)=>Zh[void 0!==e&&e in Zh?e:"en"][t],Qh=class{constructor(i){t(this,i),this.hpPageChange=e(this,"hpPageChange",7),this.userAgent=window.navigator.userAgent,this.currentPage=1,this.navigateTo=t=>{switch(t){case"firstPage":this.offsetInt=0;break;case"lastPage":this.offsetInt=this.endInt*this.limitInt;break;case"previousPage":this.offsetInt-=this.limitInt,this.nextPage=!0;break;case"nextPage":this.offsetInt+=this.limitInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage;break;case"fivePagesBack":this.offsetInt-=5*this.limitInt,this.offsetInt=this.offsetInt<=0?0:this.offsetInt;break;case"fivePagesForward":this.offsetInt+=5*this.limitInt,this.offsetInt=this.offsetInt/this.limitInt>=this.endInt?this.endInt*this.limitInt:this.offsetInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage}this.previousPage=!!this.offsetInt,this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})},this.paginationNavigation=(t,e)=>{isNaN(t)?0===e&&this.currentPage<=4?this.navigateTo("firstPage"):0===e&&this.currentPage>4?this.navigateTo("fivePagesBack"):4===e&&this.endInt-this.currentPage>=2&&this.navigateTo("fivePagesForward"):(1===t?(this.offsetInt=t-1,this.previousPage=!1):(this.offsetInt=(t-1)*this.limitInt,this.nextPage=!(t>this.endInt)),this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt}))},this.nextPage=!1,this.prevPage=!1,this.offset=0,this.limit=10,this.total=1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.arrowsActive=void 0,this.secondaryArrowsActive=void 0,this.numberedNavActive=void 0,this.isReset=!1,this.translationUrl=void 0,this.offsetInt=void 0,this.lastPage=!1,this.previousPage=!1,this.limitInt=void 0,this.totalInt=void 0,this.pagesArray=[],this.endInt=0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Zh[e][i]=t[e][i]})))}componentWillRender(){this.offsetInt=this.offset,this.limitInt=this.limit,this.nextPage=!!this.isReset||this.nextPage,this.currentPage=this.offsetInt/this.limitInt+1,this.limitInt=this.limit,this.totalInt=this.total,this.endInt=Math.ceil(this.totalInt/this.limitInt)-1,this.lastPage=!(this.offsetInt>=this.endInt*this.limitInt),1==this.currentPage||2==this.currentPage?this.endInt>3?(this.pagesArray=Array.from({length:4},((t,e)=>e+1)),this.pagesArray.push("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,e)=>e+1)):this.currentPage>=3&&this.endInt-this.currentPage>=2?(this.pagesArray=Array.from({length:3},((t,e)=>this.currentPage+e-1)),this.pagesArray.push("..."),this.pagesArray.unshift("...")):this.endInt-this.currentPage<3&&(this.endInt>4?(this.pagesArray=Array.from({length:4},((t,e)=>this.endInt-2+e)),this.pagesArray.unshift("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,e)=>e+1)))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){let t=s("ul",{class:"PaginationArea"},this.pagesArray.map(((t,e)=>s("li",{class:"PaginationItem"+(t===this.currentPage?" ActiveItem":" ")+" "+(Kh(this.userAgent)?"MobileButtons":"")},s("button",{disabled:t===this.currentPage,onClick:this.paginationNavigation.bind(this,t,e)},s("span",null,t)))))),e=s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"firstPage")},s("span",{class:"NavigationButton"},Xh("firstPage",this.language)),s("span",{class:"NavigationIcon"})),i=s("div",{class:"LeftItems"},this.secondaryArrowsActive&&e,s("button",{disabled:!this.prevPage||1===this.currentPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},Xh("previousPage",this.language)),s("span",{class:"NavigationIcon"})));Kh(this.userAgent)&&(i=s("div",{class:"LeftItems"},s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},Xh("previousPage",this.language)),s("span",{class:"NavigationIcon"}))));let r=s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"lastPage")},s("span",{class:"NavigationButton"},Xh("lastPage",this.language)),s("span",{class:"NavigationIcon"})),o=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},Xh("nextPage",this.language)),s("span",{class:"NavigationIcon"})),this.secondaryArrowsActive&&r);return Kh(this.userAgent)&&(o=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},Xh("nextPage",this.language)),s("span",{class:"NavigationIcon"})))),s("div",{id:"PaginationContainer",ref:t=>this.stylingContainer=t},this.arrowsActive&&i,this.numberedNavActive&&t,this.arrowsActive&&o)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Qh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993)}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:var(--emw--color-typography, #000);cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);opacity:0.8}button{width:100px;height:32px;border:1px solid var(--emw--color-gray-150, #6f6f6f);border-radius:5px;background:var(--emw--color-gray-150, #6f6f6f);color:var(--emw--color-typography-inverse, #fff);font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:var(--emw--color-primary-variant, #004d4a);border-color:var(--emw--color-primary-variant, #004d4a)}button:disabled{background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-typography-inverse, #fff);cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:14px}}@media screen and (max-width: 480px){button{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}}';const tc=["ro","en","hr"],ec={en:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},ro:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},fr:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},ar:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},hr:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"}},ic=(t,e)=>{const i=e;return ec[void 0!==i&&tc.includes(i)?i:"en"][t]};function sc(t,e="GET",i=null,s={}){return new Promise(((r,o)=>{const n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),a={method:e,headers:Object.assign({"Content-Type":"application/json","X-Idempotency-Key":n},s),body:null};i&&(a.body=JSON.stringify(i)),fetch(t,a).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>o(t)))}))}const rc=class{constructor(i){t(this,i),this.subscriptionCompleted=e(this,"subscriptionCompleted",7),this.subscriptionCheckChange=e(this,"subscriptionCheckChange",7),this.changeDateParam=()=>{if(this.filterData.from&&!this.filterData.to){let t=this.filterData.from,e=t.split("/");t=new Date(Date.UTC(Number(e[2]),Number(e[1])-1,Number(e[0]),0,0,0)).toISOString();const i={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:t,fieldId:this.startDateRule.id},{value:"",fieldId:this.endDateRule.id},{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};i.params=this.paramRule.fields.map((t=>({value:"",field:t,fieldId:t.id}))),this.subscriptionCompleted.emit(i)}if(this.filterData.from&&this.filterData.to){const{from:t,to:e}=this.transDate(this.filterData.from,this.filterData.to),i={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:t,fieldId:this.startDateRule.id},{value:e,fieldId:this.endDateRule.id},{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};i.params=this.paramRule.fields.map((t=>({value:"",field:t,fieldId:t.id}))),this.subscriptionCompleted.emit(i)}},this.handleFilterFrom=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{from:`${e[2]}/${e[1]}/${e[0]}`})),this.changeDateParam()},this.handleFilterTo=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{to:`${e[2]}/${e[1]}/${e[0]}`})),this.changeDateParam()},this.translationUrl=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.endpoint=void 0,this.language="en",this.gameName=void 0,this.isSubscribed=!1,this.frequenceList=[],this.frequenceState="",this.filterData={from:"",to:""},this.subscriptionCode="lottery-subscription-widget001",this.conditionId="",this.paramId="",this.conditionRule=void 0,this.paramRule=void 0,this.peroidRule=void 0,this.startDateRule=void 0,this.endDateRule=void 0,this.gameNameRule=void 0,this.ruleType=""}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])ec[e][i]=t[e][i]}))),this.getSubscriptionData()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}transDate(t,e){let i=t.split("/"),s=e.split("/");return{from:new Date(Date.UTC(Number(i[2]),Number(i[1])-1,Number(i[0]),0,0,0)).toISOString(),to:new Date(Date.UTC(Number(s[2]),Number(s[1])-1,Number(s[0]),23,59,59)).toISOString()}}async getSubscriptionData(){try{const t=`${this.endpoint}/feWidgetConfig/${this.subscriptionCode}`,{conditionMetadataId:e,paramMetadataId:i,ruleType:s}=await sc(t);this.conditionId=e,this.paramId=i,this.ruleType=s;const r=`${this.endpoint}/metadata/${this.conditionId}`,o=`${this.endpoint}/metadata/${this.paramId}`,[n,a]=await Promise.allSettled([sc(r),sc(o)]);if("fulfilled"!==n.status||"fulfilled"!==a.status)throw new Error("Failed to get subscription data");this.conditionRule=n.value,this.paramRule=a.value,this.conditionRule.fields&&(this.peroidRule=this.conditionRule.fields.find((t=>"Period"===t.code)),this.startDateRule=this.conditionRule.fields.find((t=>"StartDate"===t.code)),this.endDateRule=this.conditionRule.fields.find((t=>"EndDate"===t.code)),this.gameNameRule=this.conditionRule.fields.find((t=>"GameName"===t.code)),this.frequenceList=this.peroidRule.enums.map((t=>({label:t.text,value:t.key}))))}catch(t){console.error(t)}}handleCheckboxchange(t){this.isSubscribed=t.target.checked,this.subscriptionCheckChange.emit(this.isSubscribed)}handleSelectionChange(t){if(this.frequenceState=t.detail.value,"NeverMissADraw"===this.frequenceState&&this.isSubscribed){const t={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};t.params=this.paramRule.fields.map((t=>({value:"",fieldId:t.id}))),this.subscriptionCompleted.emit(t)}else"Custom"===this.frequenceState&&this.isSubscribed&&this.subscriptionCompleted.emit("Subscription start date is required.")}formateDate(t){const{year:e,month:i,day:s}=t;return bh(new Date(e,i,s),"dd/MM/yyyy")}parseDate(t){const[e,i,s]=t.split("/");return{year:s,month:parseInt(i)-1,day:e}}changeFormate(t){const[e,i,s]=t.split("/");return`${s}-${i}-${e}`}setDateFormate(t){t&&(t.i18n=Object.assign(Object.assign({},t.i18n),{formatDate:this.formateDate,parseDate:this.parseDate}))}render(){return s("div",{key:"185b4f76308ff8df614f520f5eb93a19c619cbcd",class:"subscripitonContainer",ref:t=>this.stylingContainer=t},s("vaadin-checkbox",{key:"c3af7821b5bacbfc8527ad242ddc6cb9d8b5234d",label:"Subscription",checked:this.isSubscribed,onChange:this.handleCheckboxchange.bind(this)}),this.isSubscribed&&s("div",{key:"e567968dca8f1150f751662e2834ffeb60e791cd",class:"secondConditon"},s("span",{key:"5999241e246949594cf39d1dade31deb04e17f1a",style:{"margin-right":"8px"}},"Occurrence: "),s("vaadin-select",{key:"50a04ac0202ab7912cd56043cda5d8f915a9151e",items:this.frequenceList,value:this.frequenceState,"on-value-changed":this.handleSelectionChange.bind(this)}),"Custom"===this.frequenceState&&s("div",{key:"329650009ba11791abf137bfd75b18ce982c6ee9",class:"thirdCondition"},s("div",{key:"f29c8951aa53637f6f66ab523b847e0937f2f323",class:"filterCalenderWrap"},s("div",{key:"a19a4c4ba091397bf79c0969b9fc7bafd3fef519",class:"filterText"},"Subscription Start Date*"),s("div",{key:"fd91ca7fc3df5250e2e88f6c34cd92e8b91b9907",class:"filter"},s("vaadin-date-picker",{value:this.filterData.from,key:"filterFromCalendar",max:void 0===this.filterData.to?void 0:this.changeFormate(this.filterData.to),onChange:this.handleFilterFrom,placeholder:ic("filterFromCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))),s("div",{key:"450a8c165db8ddb42d3c731f49257d17e9426c40",class:"filterCalenderWrap"},s("div",{key:"e66f7308e413493e84ae659b02f8eb11a025f559",class:"filterText"},"Subscription End Date"),s("div",{key:"4644c0873295e22573f9e2d1927b649e10ecd3f5",class:"filter"},s("vaadin-date-picker",{value:this.filterData.to,key:"filterToCalendar",min:void 0===this.filterData.from?void 0:this.changeFormate(this.filterData.from),onChange:this.handleFilterTo,placeholder:ic("filterToCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};rc.style=".subscripitonContainer{margin-bottom:40px}.subscripitonContainer vaadin-checkbox[checked]::part(checkbox){background-color:var(--emw--color-primary, #009993)}.subscripitonContainer .secondCondition{padding-left:24px}.subscripitonContainer .thirdCondition{display:flex;gap:24px;align-items:center}.subscripitonContainer .thirdCondition,.subscripitonContainer .secondConditon{margin:16px 0}";const oc=["ro","en","hr"],nc={en:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},fr:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ar:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},hr:{loading:"Učitavanje, molimo pričekajte ...",error:"Došlo je do pogreške prilikom pokušaja dohvaćanja podataka",multiplier:"Multiplikator",numberOfDraws:"Broj izvlačenja",wagerPerDraw:"Ulog po izvlačenju",resetButton:"Resetiraj",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"}},ac=(t,e)=>{const i=e;return nc[void 0!==i&&oc.includes(i)?i:"en"][t]},lc=class{constructor(i){t(this,i),this.ticketCompleted=e(this,"ticketCompleted",7),this.autoSelection=e(this,"autoSelection",7),this.resetSelection=e(this,"resetSelection",7),this.stakeChange=e(this,"stakeChange",7),this.multiplierChange=e(this,"multiplierChange",7),this.drawMultiplierChange=e(this,"drawMultiplierChange",7),this.lineMultiplierChange=e(this,"lineMultiplierChange",7),this.betTypeChange=e(this,"betTypeChange",7),this.endpoint=void 0,this.gameId=void 0,this.numberOfGrids=1,this.multipleDraws=!0,this.ticketId=void 0,this.resetButton=!1,this.autoPick=!1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.isLoading=!0,this.hasErrors=!1,this.ticketDone=[],this.isCustomSelect=!1,this.amountInfo={},this.stakeMultiplier="1",this.lineMultiplier=0,this.isCustomSelectStake=!1,this.isCustomSelectDraw=!1,this.isCustomSelectLine=!1,this.drawMultiplier=1,this.secondarySelectionAllowed=!1,this.partialQuickpickAvailable=!1,this.boardsAllowed=[],this.tabIndex=0,this.groupType=[],this.playType=[],this.selectedPlayTypeId="",this.maximumAllowed=6,this.numberRange=[],this.secondaryNumberRange=[],this.secondaryMaximumAllowed=1,this.minimumAllowed=6,this.secondaryMinimumAllowed=1,this.quickPicks=[]}handleLineMultiplierChange(t){this.grids=Array.from({length:t},((t,e)=>e+1)),this.ticketDone=Array.from({length:t},(()=>!1)),this.quickPicks=Array.from({length:t},(()=>!1)),this.grids.forEach(((t,e)=>{this.resetSelection.emit({ticketId:this.ticketId,index:e})}))}handleTabIndexChange(t){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)})),this.setDrawMultiplier(1),this.setStakeMultiplier("1"),this.amountInfo=this.gameData.rules.stakes[0],this.setWagerPerDraw(this.amountInfo),this.playType=this.groupType[t].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.boardsAllowed=this.playType[0].boardsAllowed,this.setLineMultiplier(this.boardsAllowed[0]),this.selectedPlayTypeId=this.playType[0].value,this.numberRange=this.playType[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=this.playType[0].secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange),this.betTypeChange.emit({ticketId:this.ticketId,betType:this.playType[0]})}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}checkForClickOutside(t){this.selectRef&&!this.selectRef.contains(t.composedPath()[0])&&(this.isCustomSelect=!1),this.selectStakeRef&&!this.selectStakeRef.contains(t.composedPath()[0])&&(this.isCustomSelectStake=!1),this.selectDrawRef&&!this.selectDrawRef.contains(t.composedPath()[0])&&(this.isCustomSelectDraw=!1),this.selectLineRef&&!this.selectLineRef.contains(t.composedPath()[0])&&(this.isCustomSelectLine=!1)}connectedCallback(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.ok)return t.json();this.hasErrors=!0})).then((t=>{var e;this.isLoading=!1,this.gameData=t,this.amountInfo=this.gameData.rules.stakes[0],this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed;const i=this.gameData.rules.betTypes.reduce(((t,e)=>(e.group?(t.groups[e.group]||(t.groups[e.group]=[]),t.groups[e.group].push(e)):t.noGroup.push({groupName:e.name||e.id,betType:[Object.assign({},e)]}),t)),{groups:{},noGroup:[]}),s=Object.entries(i.groups).map((([t,e])=>({groupName:t,betType:e})));this.groupType=[...i.noGroup,...s],this.playType=this.groupType[0].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.partialQuickpickAvailable=this.gameData.rules.partialQuickpickAvailable,this.boardsAllowed=null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.filter((t=>"Prima"===t.id))[0].boardsAllowed,this.lineMultiplier=this.boardsAllowed[0];let r=this.gameData.rules.betTypes[0].secondarySelectionRules;this.numberRange=this.gameData.rules.betTypes[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=r.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange)})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)}))}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])nc[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}gridFilledHandler(t){this.ticket=Object.assign(Object.assign({},t.detail),{drawCount:this.drawMultiplier,multiplierNum:Number(this.stakeMultiplier),multiplier:this.gameData.rules.stakeMultiplierAvailable,quickPicks:this.quickPicks,betName:this.playType.length>1?this.playType.find((t=>t.value===this.selectedPlayTypeId)).label:this.groupType[this.tabIndex].groupName}),this.ticketDone=[...this.ticketDone.slice(0,t.detail.index),!0,...this.ticketDone.slice(t.detail.index+1)],this.ticketCompleted.emit(this.ticket)}handleGridClearAllEvent(t){let e=t.detail;this.ticketDone=[...this.ticketDone.slice(0,e),!1,...this.ticketDone.slice(e+1)],this.quickPicks[e]=!1}toggleAutoSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!0,...this.ticketDone.slice(t+1)],this.autoSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!0}toggleResetSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!1,...this.ticketDone.slice(t+1)],this.resetSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!1}toggleResetAllSeletion(){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)}))}changeStake(t,e){this.stakeChange.emit({ticketId:t,stake:e})}toggleClass(){this.isCustomSelect=!this.isCustomSelect}toggleSelection(){this.isCustomSelectStake=!this.isCustomSelectStake}toggleLineSelection(){this.isCustomSelectLine=!this.isCustomSelectLine}toggleDrawSelection(){this.isCustomSelectDraw=!this.isCustomSelectDraw}setWagerPerDraw(t){this.amountInfo={value:t.value,currency:t.currency},this.isCustomSelect=!1,this.changeStake(this.ticketId,t.value)}setStakeMultiplier(t){this.stakeMultiplier=t,this.isCustomSelectStake=!1,this.multiplierChange.emit({ticketId:this.ticketId,multiplierNum:Number(t),multiplier:this.gameData.rules.stakeMultiplierAvailable})}setLineMultiplier(t){this.lineMultiplier=t,this.isCustomSelectLine=!1,this.lineMultiplierChange.emit({ticketId:this.ticketId,lineNum:t})}setDrawMultiplier(t){this.drawMultiplier=t,this.isCustomSelectDraw=!1,this.drawMultiplierChange.emit({ticketId:this.ticketId,drawCount:t})}handlePlayTypeChange(t){this.selectedPlayTypeId=t;let e=this.playType.filter((e=>e.id===t))[0];this.boardsAllowed=e.boardsAllowed,this.numberRange=e.selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=e.secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange);for(let t=0;t<this.lineMultiplier;t++)this.toggleResetSelection(t);this.betTypeChange.emit({ticketId:this.ticketId,betType:e}),this.setLineMultiplier(this.boardsAllowed[0])}render(){if(this.isLoading)return s("div",null,s("p",null,ac("loading",this.language)));if(this.hasErrors)return s("div",null,s("p",null,ac("error",this.language)));{const{rules:t}=this.gameData;return s("div",{class:"TicketContainer",ref:t=>this.stylingContainer=t},s("p",{class:"TicketTitle"},this.gameData.name),s("div",{class:"TicketTabs"},this.groupType.map(((t,e)=>s("div",{class:"TabButton"+(this.tabIndex==e?" Active":""),onClick:()=>this.tabIndex=e},t.groupName)))),this.playType.length>1&&s("div",null,s("label",{class:"Label"},ac("playType",this.language),": "),s("vaadin-select",{style:{width:"160px"},items:this.playType,value:this.selectedPlayTypeId,"on-value-changed":t=>this.handlePlayTypeChange(t.detail.value)})),this.boardsAllowed.length>1&&s("div",null,s("label",{class:"Label"},ac("lines",this.language),": "),s("div",{class:"WagerInput"},s("div",{ref:t=>this.selectLineRef=t,class:this.isCustomSelectLine?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleLineSelection()},s("span",null,this.lineMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},this.boardsAllowed.map((t=>s("li",{class:this.lineMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setLineMultiplier(t)},t)))))))),this.grids.map(((e,i)=>s("div",null,s("div",{class:"TicketGridHeader"},s("div",null,ac("lineName",this.language),i+1),this.resetButton&&this.ticketDone[i]&&s("div",{class:"ButtonContainer"},s("a",{class:"ResetButton",onClick:()=>this.toggleResetSelection(i)},ac("resetButton",this.language))),this.autoPick&&!this.ticketDone[i]&&s("div",{class:"ButtonContainer"},s("a",{class:"AutoButton",onClick:()=>this.toggleAutoSelection(i)},ac("autoButton",this.language)))),s("div",{class:"TicketGridBullets"},s("p",{class:"TicketGridTitle"},t.boards[0].selectionName),s("lottery-grid",{"grid-index":i,"maximum-allowed":this.maximumAllowed,"minimum-allowed":this.minimumAllowed,"number-range":JSON.stringify(this.numberRange),"high-number":t.boards[0].highNumber,"low-number":t.boards[0].lowNumber,"total-numbers":t.boards[0].highNumber-t.boards[0].lowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"mainSelection","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),this.secondarySelectionAllowed&&s("div",{class:"SecondarySelectionWrapper"},s("div",{class:"TicketGridBullets"},s("p",{class:"TicketGridTitle"},t.boards[0].secondarySelectionName),s("lottery-grid",{"grid-index":i,"maximum-allowed":this.secondaryMaximumAllowed,"minimum-allowed":this.secondaryMinimumAllowed,"number-range":JSON.stringify(this.secondaryNumberRange),"high-number":t.boards[0].secondaryHighNumber,"low-number":t.boards[0].secondaryLowNumber,"total-numbers":t.boards[0].secondaryHighNumber-t.boards[0].secondaryLowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"secondarySelection","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))))),t.stakeMultiplierAvailable&&s("div",null,s("label",{class:"Label"},ac("multiplier",this.language),": "),s("div",{class:"WagerInput"},t.stakeMultipliers.length>1?s("div",{ref:t=>this.selectStakeRef=t,class:this.isCustomSelectStake?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleSelection()},s("span",null,this.stakeMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.stakeMultipliers.map((t=>s("li",{class:this.stakeMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setStakeMultiplier(t)},t)))))):s("div",null,s("input",{min:"1",value:t.stakeMultipliers[0]||1,type:"number",disabled:!0})))),t.drawMultiplierAvailable&&s("div",null,s("label",{class:"Label"},ac("numberOfDraws",this.language),": "),s("div",{class:"WagerInput"},t.durations.length>1?s("div",{ref:t=>this.selectDrawRef=t,class:this.isCustomSelectDraw?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleDrawSelection()},s("span",null,this.drawMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.durations.map((t=>s("li",{class:this.drawMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setDrawMultiplier(t)},t)))))):s("div",null,s("input",{min:"1",value:t.durations[0]||1,type:"number",disabled:!0})))),s("div",null,s("label",{class:"Label"},ac("wagerPerDraw",this.language),": "),s("div",{class:"WagerInput"},t.stakes.length>1?s("div",{ref:t=>this.selectRef=t,class:this.isCustomSelect?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleClass()},s("span",null,this.amountInfo.value," ",this.amountInfo.currency),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.stakes.map((t=>s("li",{class:this.amountInfo.value==t.value?"SelectedValue":"",value:t.value,onClick:()=>this.setWagerPerDraw(t)},t.value," ",t.currency)))))):s("div",null,s("input",{min:"1",value:t.stakes[0].value,type:"number",disabled:!0}),s("span",{class:"WagerInputTitle"},t.stakes[0].currency)))))}}static get watchers(){return{lineMultiplier:["handleLineMultiplierChange"],tabIndex:["handleTabIndexChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};lc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.TicketTabs{display:flex;overflow:auto}.TicketTabs .TabButton{color:var(--emw--color-primary, #009993);margin:0 40px 10px 0;cursor:pointer}.TicketTabs .Active{border-bottom:1px solid var(--emw--color-primary, #009993)}.ButtonContainer{display:flex;justify-content:flex-end}.SecondarySelectionWrapper{margin-top:20px}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:var(--emw--color-typography, #000)}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:var(--emw--color-typography, #000);padding:10px;margin-left:8px}.AutoButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-typography-inverse, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.ResetButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:var(--emw--color-error, #ff3d00);border:1px solid var(--emw--color-error, #ff3d00);color:var(--emw--color-typography-inverse, #fff)}.ResetButton:hover{background:var(--emw--color-tertiary, #ff6536);border:1px solid var(--emw--color-error, #ff3d00)}.TicketGridHeader{display:flex;justify-content:space-between;align-items:center;font-weight:bold;margin-top:10px}.TicketGridBullets{background:var(--emw--color-background-secondary, #f5f5f5);border-radius:4px;padding:20px;margin-top:5px;margin-bottom:10px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background, #009993)}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background, #009993)}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid var(--emw--color-background-tertiary, #ccc);border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid var(--emw--color-background-tertiary, #ccc);overflow:hidden;background:var(--emw--color-typography-inverse, #fff);z-index:20}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:var(--emw--color-background, #009993);color:var(--emw--color-typography-inverse, #fff)}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:var(--emw--color-background-secondary, #f5f5f5);border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:var(--emw--color-background-tertiary, #ccc);border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:var(--emw--color-background-secondary, #f5f5f5)}';const hc=["ro","en","fr","ar","hr"],cc={en:{ticket:"Ticket"},ro:{ticket:"Bilet"},fr:{ticket:"Billet"},ar:{ticket:"تذكرة"},hr:{ticket:"Listić"}},dc=(t,e)=>{const i=e;return cc[void 0!==i&&hc.includes(i)?i:"en"][t]},uc=class{constructor(i){t(this,i),this.deleteTicketEvent=e(this,"deleteTicket",7),this.endpoint="",this.ticketId=1,this.ticketDescription=void 0,this.gameId=void 0,this.postMessage=!1,this.eventName="deleteTicketAction",this.collapsed=!0,this.numberOfGrids=1,this.last=!1,this.language="en",this.autoPick=!1,this.resetButton=!1,this.totalControllers=1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0}helperAccordionActionHandler(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.deleteTicketEvent.emit({ticketId:this.ticketId})}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])cc[e][i]=t[e][i]})))}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"28756fcff01b738bfe8339114445032a5da757c2",class:"LotteryTicketControllerContainer",ref:t=>this.stylingContainer=t},s("helper-accordion",{key:"18a566d1c97ccbf74cd759215df3a18faf5c43dc","header-title":`${dc("ticket",this.language)} ${this.ticketId}`,"header-subtitle":this.ticketDescription,footer:!0,"delete-tab":1!==this.totalControllers,collapsed:!this.last||this.collapsed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("div",{key:"3a056f64dc8572b66f50cb151adde2caea2cd427",slot:"accordionContent"},s("lottery-ticket",{key:"06a0696b79840c05381429b1b87af94b478b09f0",endpoint:this.endpoint,"game-id":this.gameId,"ticket-id":this.ticketId,"number-of-grids":this.numberOfGrids,language:this.language,"translation-url":this.translationUrl,"reset-button":this.resetButton,"auto-pick":this.autoPick,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};uc.style=':host{font-family:"Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}';export{h as general_multi_select,u as helper_accordion,gh as helper_filters,wh as helper_modal,Sh as helper_tab,Th as helper_tabs,Dh as lottery_bullet,Oh as lottery_draw_results,Rh as lottery_draw_results_history,Lh as lottery_game_details,Yh as lottery_game_page,Jh as lottery_grid,Qh as lottery_pagination,rc as lottery_subscription,lc as lottery_ticket,uc as lottery_ticket_controller}
|
|
6665
|
+
var e,i,s,r,o=9e15,n=1e9,a="0123456789abcdef",l="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",h="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",c={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-o,maxE:o,crypto:!1},d=!0,u="[DecimalError] ",p=u+"Invalid argument: ",m=u+"Precision limit exceeded",f=u+"crypto unavailable",v="[object Decimal]",b=Math.floor,g=Math.pow,y=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,w=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,x=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,k=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_=1e7,C=7,S=l.length-1,T=h.length-1,D={toStringTag:v};function A(t){var e,i,s,r=t.length-1,o="",n=t[0];if(r>0){for(o+=n,e=1;e<r;e++)(i=C-(s=t[e]+"").length)&&(o+=R(i)),o+=s;(i=C-(s=(n=t[e])+"").length)&&(o+=R(i))}else if(0===n)return"0";for(;n%10==0;)n/=10;return o+n}function I(t,e,i){if(t!==~~t||t<e||t>i)throw Error(p+t)}function z(t,e,i,s){var r,o,n,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=C,r=0):(r=Math.ceil((e+1)/C),e%=C),o=g(10,C-e),a=t[r]%o|0,null==s?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),n=i<4&&99999==a||i>3&&49999==a||5e4==a||0==a):n=(i<4&&a+1==o||i>3&&a+1==o/2)&&(t[r+1]/o/100|0)==g(10,e-2)-1||(a==o/2||0==a)&&!(t[r+1]/o/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),n=(s||i<4)&&9999==a||!s&&i>3&&4999==a):n=((s||i<4)&&a+1==o||!s&&i>3&&a+1==o/2)&&(t[r+1]/o/1e3|0)==g(10,e-3)-1,n}function M(t,e,i){for(var s,r,o=[0],n=0,l=t.length;n<l;){for(r=o.length;r--;)o[r]*=e;for(o[0]+=a.indexOf(t.charAt(n++)),s=0;s<o.length;s++)o[s]>i-1&&(void 0===o[s+1]&&(o[s+1]=0),o[s+1]+=o[s]/i|0,o[s]%=i)}return o.reverse()}D.absoluteValue=D.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),P(t)},D.ceil=function(){return P(new this.constructor(this),this.e+1,2)},D.clampedTo=D.clamp=function(t,e){var i=this,s=i.constructor;if(t=new s(t),e=new s(e),!t.s||!e.s)return new s(NaN);if(t.gt(e))throw Error(p+e);return i.cmp(t)<0?t:i.cmp(e)>0?e:new s(i)},D.comparedTo=D.cmp=function(t){var e,i,s,r,o=this,n=o.d,a=(t=new o.constructor(t)).d,l=o.s,h=t.s;if(!n||!a)return l&&h?l!==h?l:n===a?0:!n^l<0?1:-1:NaN;if(!n[0]||!a[0])return n[0]?l:a[0]?-h:0;if(l!==h)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(e=0,i=(s=n.length)<(r=a.length)?s:r;e<i;++e)if(n[e]!==a[e])return n[e]>a[e]^l<0?1:-1;return s===r?0:s>r^l<0?1:-1},D.cosine=D.cos=function(){var t,e,i=this,s=i.constructor;return i.d?i.d[0]?(e=s.rounding,s.precision=(t=s.precision)+Math.max(i.e,i.sd())+C,s.rounding=1,i=function(t,e){var i,s,r;if(e.isZero())return e;(s=e.d.length)<32?r=(1/J(4,i=Math.ceil(s/3))).toString():(i=16,r="2.3283064365386962890625e-10"),t.precision+=i,e=Y(t,1,e.times(r),new t(1));for(var o=i;o--;){var n=e.times(e);e=n.times(n).minus(n).times(8).plus(1)}return t.precision-=i,e}(s,K(s,i)),s.precision=t,s.rounding=e,P(2==r||3==r?i.neg():i,t,e,!0)):new s(1):new s(NaN)},D.cubeRoot=D.cbrt=function(){var t,e,i,s,r,o,n,a,l,h,c=this,u=c.constructor;if(!c.isFinite()||c.isZero())return new u(c);for(d=!1,(o=c.s*g(c.s*c,1/3))&&Math.abs(o)!=1/0?s=new u(o.toString()):(i=A(c.d),(o=((t=c.e)-i.length+1)%3)&&(i+=1==o||-2==o?"0":"00"),o=g(i,1/3),t=b((t+1)/3)-(t%3==(t<0?-1:2)),(s=new u(i=o==1/0?"5e"+t:(i=o.toExponential()).slice(0,i.indexOf("e")+1)+t)).s=c.s),n=(t=u.precision)+3;;)if(h=(l=(a=s).times(a).times(a)).plus(c),s=N(h.plus(c).times(a),h.plus(l),n+2,1),A(a.d).slice(0,n)===(i=A(s.d)).slice(0,n)){if("9999"!=(i=i.slice(n-3,n+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(P(s,t+1,1),e=!s.times(s).times(s).eq(c));break}if(!r&&(P(a,t+1,0),a.times(a).times(a).eq(c))){s=a;break}n+=4,r=1}return d=!0,P(s,t,u.rounding,e)},D.decimalPlaces=D.dp=function(){var t,e=this.d,i=NaN;if(e){if(i=((t=e.length-1)-b(this.e/C))*C,t=e[t])for(;t%10==0;t/=10)i--;i<0&&(i=0)}return i},D.dividedBy=D.div=function(t){return N(this,new this.constructor(t))},D.dividedToIntegerBy=D.divToInt=function(t){var e=this.constructor;return P(N(this,new e(t),0,1,1),e.precision,e.rounding)},D.equals=D.eq=function(t){return 0===this.cmp(t)},D.floor=function(){return P(new this.constructor(this),this.e+1,3)},D.greaterThan=D.gt=function(t){return this.cmp(t)>0},D.greaterThanOrEqualTo=D.gte=function(t){var e=this.cmp(t);return 1==e||0===e},D.hyperbolicCosine=D.cosh=function(){var t,e,i,s,r,o=this,n=o.constructor,a=new n(1);if(!o.isFinite())return new n(o.s?1/0:NaN);if(o.isZero())return a;s=n.rounding,n.precision=(i=n.precision)+Math.max(o.e,o.sd())+4,n.rounding=1,(r=o.d.length)<32?e=(1/J(4,t=Math.ceil(r/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=Y(n,1,o.times(e),new n(1),!0);for(var l,h=t,c=new n(8);h--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return P(o,n.precision=i,n.rounding=s,!0)},D.hyperbolicSine=D.sinh=function(){var t,e,i,s,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(i=o.rounding,o.precision=(e=o.precision)+Math.max(r.e,r.sd())+4,o.rounding=1,(s=r.d.length)<3)r=Y(o,2,r,r,!0);else{t=1.4*Math.sqrt(s),r=Y(o,2,r=r.times(1/J(5,t=t>16?16:0|t)),r,!0);for(var n,a=new o(5),l=new o(16),h=new o(20);t--;)n=r.times(r),r=r.times(a.plus(n.times(l.times(n).plus(h))))}return o.precision=e,o.rounding=i,P(r,e,i,!0)},D.hyperbolicTangent=D.tanh=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+7,s.rounding=1,N(i.sinh(),i.cosh(),s.precision=t,s.rounding=e)):new s(i.s)},D.inverseCosine=D.acos=function(){var t=this,e=t.constructor,i=t.abs().cmp(1),s=e.precision,r=e.rounding;return-1!==i?0===i?t.isNeg()?F(e,s,r):new e(0):new e(NaN):t.isZero()?F(e,s+4,r).times(.5):(e.precision=s+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=s,e.rounding=r,t.times(2))},D.inverseHyperbolicCosine=D.acosh=function(){var t,e,i=this,s=i.constructor;return i.lte(1)?new s(i.eq(1)?0:NaN):i.isFinite()?(e=s.rounding,s.precision=(t=s.precision)+Math.max(Math.abs(i.e),i.sd())+4,s.rounding=1,d=!1,i=i.times(i).minus(1).sqrt().plus(i),d=!0,s.precision=t,s.rounding=e,i.ln()):new s(i)},D.inverseHyperbolicSine=D.asinh=function(){var t,e,i=this,s=i.constructor;return!i.isFinite()||i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+2*Math.max(Math.abs(i.e),i.sd())+6,s.rounding=1,d=!1,i=i.times(i).plus(1).sqrt().plus(i),d=!0,s.precision=t,s.rounding=e,i.ln())},D.inverseHyperbolicTangent=D.atanh=function(){var t,e,i,s,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(t=o.precision,e=o.rounding,s=r.sd(),Math.max(s,t)<2*-r.e-1?P(new o(r),t,e,!0):(o.precision=i=s-r.e,r=N(r.plus(1),new o(1).minus(r),i+t,1),o.precision=t+4,o.rounding=1,r=r.ln(),o.precision=t,o.rounding=e,r.times(.5))):new o(NaN)},D.inverseSine=D.asin=function(){var t,e,i,s,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),i=o.precision,s=o.rounding,-1!==e?0===e?((t=F(o,i+4,s).times(.5)).s=r.s,t):new o(NaN):(o.precision=i+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=i,o.rounding=s,r.times(2)))},D.inverseTangent=D.atan=function(){var t,e,i,s,r,o,n,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(h.isFinite()){if(h.isZero())return new c(h);if(h.abs().eq(1)&&u+4<=T)return(n=F(c,u+4,p).times(.25)).s=h.s,n}else{if(!h.s)return new c(NaN);if(u+4<=T)return(n=F(c,u+4,p).times(.5)).s=h.s,n}for(c.precision=a=u+10,c.rounding=1,t=i=Math.min(28,a/C+2|0);t;--t)h=h.div(h.times(h).plus(1).sqrt().plus(1));for(d=!1,e=Math.ceil(a/C),s=1,l=h.times(h),n=new c(h),r=h;-1!==t;)if(r=r.times(l),o=n.minus(r.div(s+=2)),r=r.times(l),void 0!==(n=o.plus(r.div(s+=2))).d[e])for(t=e;n.d[t]===o.d[t]&&t--;);return i&&(n=n.times(2<<i-1)),d=!0,P(n,c.precision=u,c.rounding=p,!0)},D.isFinite=function(){return!!this.d},D.isInteger=D.isInt=function(){return!!this.d&&b(this.e/C)>this.d.length-2},D.isNaN=function(){return!this.s},D.isNegative=D.isNeg=function(){return this.s<0},D.isPositive=D.isPos=function(){return this.s>0},D.isZero=function(){return!!this.d&&0===this.d[0]},D.lessThan=D.lt=function(t){return this.cmp(t)<0},D.lessThanOrEqualTo=D.lte=function(t){return this.cmp(t)<1},D.logarithm=D.log=function(t){var e,i,s,r,o,n,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(null==t)t=new c(10),e=!0;else{if(i=(t=new c(t)).d,t.s<0||!i||!i[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(i=h.d,h.s<0||!i||!i[0]||h.eq(1))return new c(i&&!i[0]?-1/0:1!=h.s?NaN:i?0:1/0);if(e)if(i.length>1)o=!0;else{for(r=i[0];r%10==0;)r/=10;o=1!==r}if(d=!1,n=G(h,a=u+5),s=e?E(c,a+10):G(t,a),z((l=N(n,s,a,1)).d,r=u,p))do{if(n=G(h,a+=10),s=e?E(c,a+10):G(t,a),l=N(n,s,a,1),!o){+A(l.d).slice(r+1,r+15)+1==1e14&&(l=P(l,u+1,0));break}}while(z(l.d,r+=10,p));return d=!0,P(l,u,p)},D.minus=D.sub=function(t){var e,i,s,r,o,n,a,l,h,c,u,p,m=this,f=m.constructor;if(t=new f(t),!m.d||!t.d)return m.s&&t.s?m.d?t.s=-t.s:t=new f(t.d||m.s!==t.s?m:NaN):t=new f(NaN),t;if(m.s!=t.s)return t.s=-t.s,m.plus(t);if(p=t.d,a=f.precision,l=f.rounding,!(h=m.d)[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!h[0])return new f(3===l?-0:0);t=new f(m)}return d?P(t,a,l):t}if(i=b(t.e/C),c=b(m.e/C),h=h.slice(),o=c-i){for((u=o<0)?(e=h,o=-o,n=p.length):(e=p,i=c,n=h.length),o>(s=Math.max(Math.ceil(a/C),n)+2)&&(o=s,e.length=1),e.reverse(),s=o;s--;)e.push(0);e.reverse()}else{for((u=(s=h.length)<(n=p.length))&&(n=s),s=0;s<n;s++)if(h[s]!=p[s]){u=h[s]<p[s];break}o=0}for(u&&(e=h,h=p,p=e,t.s=-t.s),s=p.length-(n=h.length);s>0;--s)h[n++]=0;for(s=p.length;s>o;){if(h[--s]<p[s]){for(r=s;r&&0===h[--r];)h[r]=_-1;--h[r],h[s]+=_}h[s]-=p[s]}for(;0===h[--n];)h.pop();for(;0===h[0];h.shift())--i;return h[0]?(t.d=h,t.e=O(h,i),d?P(t,a,l):t):new f(3===l?-0:0)},D.modulo=D.mod=function(t){var e,i=this,s=i.constructor;return t=new s(t),!i.d||!t.s||t.d&&!t.d[0]?new s(NaN):!t.d||i.d&&!i.d[0]?P(new s(i),s.precision,s.rounding):(d=!1,9==s.modulo?(e=N(i,t.abs(),0,3,1)).s*=t.s:e=N(i,t,0,s.modulo,1),e=e.times(t),d=!0,i.minus(e))},D.naturalExponential=D.exp=function(){return H(this)},D.naturalLogarithm=D.ln=function(){return G(this)},D.negated=D.neg=function(){var t=new this.constructor(this);return t.s=-t.s,P(t)},D.plus=D.add=function(t){var e,i,s,r,o,n,a,l,h,c,u=this,p=u.constructor;if(t=new p(t),!u.d||!t.d)return u.s&&t.s?u.d||(t=new p(t.d||u.s===t.s?u:NaN)):t=new p(NaN),t;if(u.s!=t.s)return t.s=-t.s,u.minus(t);if(c=t.d,a=p.precision,l=p.rounding,!(h=u.d)[0]||!c[0])return c[0]||(t=new p(u)),d?P(t,a,l):t;if(o=b(u.e/C),s=b(t.e/C),h=h.slice(),r=o-s){for(r<0?(i=h,r=-r,n=c.length):(i=c,s=o,n=h.length),r>(n=(o=Math.ceil(a/C))>n?o+1:n+1)&&(r=n,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((n=h.length)-(r=c.length)<0&&(r=n,i=c,c=h,h=i),e=0;r;)e=(h[--r]=h[r]+c[r]+e)/_|0,h[r]%=_;for(e&&(h.unshift(e),++s),n=h.length;0==h[--n];)h.pop();return t.d=h,t.e=O(h,s),d?P(t,a,l):t},D.precision=D.sd=function(t){var e,i=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(p+t);return i.d?(e=j(i.d),t&&i.e+1>e&&(e=i.e+1)):e=NaN,e},D.round=function(){var t=this,e=t.constructor;return P(new e(t),t.e+1,e.rounding)},D.sine=D.sin=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+Math.max(i.e,i.sd())+C,s.rounding=1,i=function(t,e){var i,s=e.d.length;if(s<3)return e.isZero()?e:Y(t,2,e,e);i=1.4*Math.sqrt(s),e=Y(t,2,e=e.times(1/J(5,i=i>16?16:0|i)),e);for(var r,o=new t(5),n=new t(16),a=new t(20);i--;)r=e.times(e),e=e.times(o.plus(r.times(n.times(r).minus(a))));return e}(s,K(s,i)),s.precision=t,s.rounding=e,P(r>2?i.neg():i,t,e,!0)):new s(NaN)},D.squareRoot=D.sqrt=function(){var t,e,i,s,r,o,n=this,a=n.d,l=n.e,h=n.s,c=n.constructor;if(1!==h||!a||!a[0])return new c(!h||h<0&&(!a||a[0])?NaN:a?n:1/0);for(d=!1,0==(h=Math.sqrt(+n))||h==1/0?(((e=A(a)).length+l)%2==0&&(e+="0"),h=Math.sqrt(e),l=b((l+1)/2)-(l<0||l%2),s=new c(e=h==1/0?"5e"+l:(e=h.toExponential()).slice(0,e.indexOf("e")+1)+l)):s=new c(h.toString()),i=(l=c.precision)+3;;)if(s=(o=s).plus(N(n,o,i+2,1)).times(.5),A(o.d).slice(0,i)===(e=A(s.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(P(s,l+1,1),t=!s.times(s).eq(n));break}if(!r&&(P(o,l+1,0),o.times(o).eq(n))){s=o;break}i+=4,r=1}return d=!0,P(s,l,c.rounding,t)},D.tangent=D.tan=function(){var t,e,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(e=s.rounding,s.precision=(t=s.precision)+10,s.rounding=1,(i=i.sin()).s=1,i=N(i,new s(1).minus(i.times(i)).sqrt(),t+10,0),s.precision=t,s.rounding=e,P(2==r||4==r?i.neg():i,t,e,!0)):new s(NaN)},D.times=D.mul=function(t){var e,i,s,r,o,n,a,l,h,c=this,u=c.constructor,p=c.d,m=(t=new u(t)).d;if(t.s*=c.s,!(p&&p[0]&&m&&m[0]))return new u(!t.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*t.s:t.s/0);for(i=b(c.e/C)+b(t.e/C),(l=p.length)<(h=m.length)&&(o=p,p=m,m=o,n=l,l=h,h=n),o=[],s=n=l+h;s--;)o.push(0);for(s=h;--s>=0;){for(e=0,r=l+s;r>s;)a=o[r]+m[s]*p[r-s-1]+e,o[r--]=a%_|0,e=a/_|0;o[r]=(o[r]+e)%_|0}for(;!o[--n];)o.pop();return e?++i:o.shift(),t.d=o,t.e=O(o,i),d?P(t,u.precision,u.rounding):t},D.toBinary=function(t,e){return Z(this,2,t,e)},D.toDecimalPlaces=D.toDP=function(t,e){var i=this,s=i.constructor;return i=new s(i),void 0===t?i:(I(t,0,n),void 0===e?e=s.rounding:I(e,0,8),P(i,t+i.e+1,e))},D.toExponential=function(t,e){var i,s=this,r=s.constructor;return void 0===t?i=B(s,!0):(I(t,0,n),void 0===e?e=r.rounding:I(e,0,8),i=B(s=P(new r(s),t+1,e),!0,t+1)),s.isNeg()&&!s.isZero()?"-"+i:i},D.toFixed=function(t,e){var i,s,r=this,o=r.constructor;return void 0===t?i=B(r):(I(t,0,n),void 0===e?e=o.rounding:I(e,0,8),i=B(s=P(new o(r),t+r.e+1,e),!1,t+s.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},D.toFraction=function(t){var e,i,s,r,o,n,a,l,h,c,u,m,f=this,v=f.d,b=f.constructor;if(!v)return new b(f);if(h=i=new b(1),s=l=new b(0),o=(e=new b(s)).e=j(v)-f.e-1,e.d[0]=g(10,(n=o%C)<0?C+n:n),null==t)t=o>0?e:h;else{if(!(a=new b(t)).isInt()||a.lt(h))throw Error(p+a);t=a.gt(e)?o>0?e:h:a}for(d=!1,a=new b(A(v)),c=b.precision,b.precision=o=v.length*C*2;u=N(a,e,0,1,1),1!=(r=i.plus(u.times(s))).cmp(t);)i=s,s=r,h=l.plus(u.times(r=h)),l=r,e=a.minus(u.times(r=e)),a=r;return r=N(t.minus(i),s,0,1,1),l=l.plus(r.times(h)),i=i.plus(r.times(s)),l.s=h.s=f.s,m=N(h,s,o,1).minus(f).abs().cmp(N(l,i,o,1).minus(f).abs())<1?[h,s]:[l,i],b.precision=c,d=!0,m},D.toHexadecimal=D.toHex=function(t,e){return Z(this,16,t,e)},D.toNearest=function(t,e){var i=this,s=i.constructor;if(i=new s(i),null==t){if(!i.d)return i;t=new s(1),e=s.rounding}else{if(t=new s(t),void 0===e?e=s.rounding:I(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]?(d=!1,i=N(i,t,0,e,1).times(t),d=!0,P(i)):(t.s=i.s,i=t),i},D.toNumber=function(){return+this},D.toOctal=function(t,e){return Z(this,8,t,e)},D.toPower=D.pow=function(t){var e,i,s,r,o,n,a=this,l=a.constructor,h=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(g(+a,h));if((a=new l(a)).eq(1))return a;if(s=l.precision,o=l.rounding,t.eq(1))return P(a,s,o);if((e=b(t.e/C))>=t.d.length-1&&(i=h<0?-h:h)<=9007199254740991)return r=L(l,a,i,s),t.s<0?new l(1).div(r):P(r,s,o);if((n=a.s)<0){if(e<t.d.length-1)return new l(NaN);if(1&t.d[e]||(n=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=n,a}return(e=0!=(i=g(+a,h))&&isFinite(i)?new l(i+"").e:b(h*(Math.log("0."+A(a.d))/Math.LN10+a.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?n/0:0):(d=!1,l.rounding=a.s=1,i=Math.min(12,(e+"").length),(r=H(t.times(G(a,s+i)),s)).d&&z((r=P(r,s+5,1)).d,s,o)&&+A((r=P(H(t.times(G(a,(e=s+10)+i)),e),e+5,1)).d).slice(s+1,s+15)+1==1e14&&(r=P(r,s+1,0)),r.s=n,d=!0,l.rounding=o,P(r,s,o))},D.toPrecision=function(t,e){var i,s=this,r=s.constructor;return void 0===t?i=B(s,s.e<=r.toExpNeg||s.e>=r.toExpPos):(I(t,1,n),void 0===e?e=r.rounding:I(e,0,8),i=B(s=P(new r(s),t,e),t<=s.e||s.e<=r.toExpNeg,t)),s.isNeg()&&!s.isZero()?"-"+i:i},D.toSignificantDigits=D.toSD=function(t,e){var i=this.constructor;return void 0===t?(t=i.precision,e=i.rounding):(I(t,1,n),void 0===e?e=i.rounding:I(e,0,8)),P(new i(this),t,e)},D.toString=function(){var t=this,e=t.constructor,i=B(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+i:i},D.truncated=D.trunc=function(){return P(new this.constructor(this),this.e+1,1)},D.valueOf=D.toJSON=function(){var t=this,e=t.constructor,i=B(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+i:i};var N=function(){function t(t,e,i){var s,r=0,o=t.length;for(t=t.slice();o--;)t[o]=(s=t[o]*e+r)%i|0,r=s/i|0;return r&&t.unshift(r),t}function e(t,e,i,s){var r,o;if(i!=s)o=i>s?1:-1;else for(r=o=0;r<i;r++)if(t[r]!=e[r]){o=t[r]>e[r]?1:-1;break}return o}function s(t,e,i,s){for(var r=0;i--;)t[i]-=r,t[i]=(r=t[i]<e[i]?1:0)*s+t[i]-e[i];for(;!t[0]&&t.length>1;)t.shift()}return function(r,o,n,a,l,h){var c,d,u,p,m,f,v,g,y,w,x,k,S,T,D,A,I,z,M,N,B=r.constructor,O=r.s==o.s?1:-1,E=r.d,F=o.d;if(!(E&&E[0]&&F&&F[0]))return new B(r.s&&o.s&&(E?!F||E[0]!=F[0]:F)?E&&0==E[0]||!F?0*O:O/0:NaN);for(h?(m=1,d=r.e-o.e):(h=_,d=b(r.e/(m=C))-b(o.e/m)),M=F.length,I=E.length,w=(y=new B(O)).d=[],u=0;F[u]==(E[u]||0);u++);if(F[u]>(E[u]||0)&&d--,null==n?(T=n=B.precision,a=B.rounding):T=l?n+(r.e-o.e)+1:n,T<0)w.push(1),f=!0;else{if(T=T/m+2|0,u=0,1==M){for(p=0,F=F[0],T++;(u<I||p)&&T--;u++)w[u]=(D=p*h+(E[u]||0))/F|0,p=D%F|0;f=p||u<I}else{for((p=h/(F[0]+1)|0)>1&&(F=t(F,p,h),E=t(E,p,h),M=F.length,I=E.length),A=M,k=(x=E.slice(0,M)).length;k<M;)x[k++]=0;(N=F.slice()).unshift(0),z=F[0],F[1]>=h/2&&++z;do{p=0,(c=e(F,x,M,k))<0?(S=x[0],M!=k&&(S=S*h+(x[1]||0)),(p=S/z|0)>1?(p>=h&&(p=h-1),1==(c=e(v=t(F,p,h),x,g=v.length,k=x.length))&&(p--,s(v,M<g?N:F,g,h))):(0==p&&(c=p=1),v=F.slice()),(g=v.length)<k&&v.unshift(0),s(x,v,k,h),-1==c&&(c=e(F,x,M,k=x.length))<1&&(p++,s(x,M<k?N:F,k,h)),k=x.length):0===c&&(p++,x=[0]),w[u++]=p,c&&x[0]?x[k++]=E[A]||0:(x=[E[A]],k=1)}while((A++<I||void 0!==x[0])&&T--);f=void 0!==x[0]}w[0]||w.shift()}if(1==m)y.e=d,i=f;else{for(u=1,p=w[0];p>=10;p/=10)u++;y.e=u+d*m-1,P(y,l?n+y.e+1:n,a,f)}return y}}();function P(t,e,i,s){var r,o,n,a,l,h,c,u,p,m=t.constructor;t:if(null!=e){if(!(u=t.d))return t;for(r=1,a=u[0];a>=10;a/=10)r++;if((o=e-r)<0)o+=C,l=(c=u[p=0])/g(10,r-(n=e)-1)%10|0;else if((p=Math.ceil((o+1)/C))>=(a=u.length)){if(!s)break t;for(;a++<=p;)u.push(0);c=l=0,r=1,n=(o%=C)-C+1}else{for(c=a=u[p],r=1;a>=10;a/=10)r++;l=(n=(o%=C)-C+r)<0?0:c/g(10,r-n-1)%10|0}if(s=s||e<0||void 0!==u[p+1]||(n<0?c:c%g(10,r-n-1)),h=i<4?(l||s)&&(0==i||i==(t.s<0?3:2)):l>5||5==l&&(4==i||s||6==i&&(o>0?n>0?c/g(10,r-n):0:u[p-1])%10&1||i==(t.s<0?8:7)),e<1||!u[0])return u.length=0,h?(u[0]=g(10,(C-(e-=t.e+1)%C)%C),t.e=-e||0):u[0]=t.e=0,t;if(0==o?(u.length=p,a=1,p--):(u.length=p+1,a=g(10,C-o),u[p]=n>0?(c/g(10,r-n)%g(10,n)|0)*a:0),h)for(;;){if(0==p){for(o=1,n=u[0];n>=10;n/=10)o++;for(n=u[0]+=a,a=1;n>=10;n/=10)a++;o!=a&&(t.e++,u[0]==_&&(u[0]=1));break}if(u[p]+=a,u[p]!=_)break;u[p--]=0,a=1}for(o=u.length;0===u[--o];)u.pop()}return d&&(t.e>m.maxE?(t.d=null,t.e=NaN):t.e<m.minE&&(t.e=0,t.d=[0])),t}function B(t,e,i){if(!t.isFinite())return U(t);var s,r=t.e,o=A(t.d),n=o.length;return e?(i&&(s=i-n)>0?o=o.charAt(0)+"."+o.slice(1)+R(s):n>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):r<0?(o="0."+R(-r-1)+o,i&&(s=i-n)>0&&(o+=R(s))):r>=n?(o+=R(r+1-n),i&&(s=i-r-1)>0&&(o=o+"."+R(s))):((s=r+1)<n&&(o=o.slice(0,s)+"."+o.slice(s)),i&&(s=i-n)>0&&(r+1===n&&(o+="."),o+=R(s))),o}function O(t,e){var i=t[0];for(e*=C;i>=10;i/=10)e++;return e}function E(t,e,i){if(e>S)throw d=!0,i&&(t.precision=i),Error(m);return P(new t(l),e,1,!0)}function F(t,e,i){if(e>T)throw Error(m);return P(new t(h),e,i,!0)}function j(t){var e=t.length-1,i=e*C+1;if(e=t[e]){for(;e%10==0;e/=10)i--;for(e=t[0];e>=10;e/=10)i++}return i}function R(t){for(var e="";t--;)e+="0";return e}function L(t,e,i,s){var r,o=new t(1),n=Math.ceil(s/C+4);for(d=!1;;){if(i%2&&X((o=o.times(e)).d,n)&&(r=!0),0===(i=b(i/2))){i=o.d.length-1,r&&0===o.d[i]&&++o.d[i];break}X((e=e.times(e)).d,n)}return d=!0,o}function $(t){return 1&t.d[t.d.length-1]}function W(t,e,i){for(var s,r,o=new t(e[0]),n=0;++n<e.length;){if(!(r=new t(e[n])).s){o=r;break}((s=o.cmp(r))===i||0===s&&o.s===i)&&(o=r)}return o}function H(t,e){var i,s,r,o,n,a,l,h=0,c=0,u=0,p=t.constructor,m=p.rounding,f=p.precision;if(!t.d||!t.d[0]||t.e>17)return new p(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(d=!1,l=f):l=e,a=new p(.03125);t.e>-2;)t=t.times(a),u+=5;for(l+=s=Math.log(g(2,u))/Math.LN10*2+5|0,i=o=n=new p(1),p.precision=l;;){if(o=P(o.times(t),l,1),i=i.times(++c),A((a=n.plus(N(o,i,l,1))).d).slice(0,l)===A(n.d).slice(0,l)){for(r=u;r--;)n=P(n.times(n),l,1);if(null!=e)return p.precision=f,n;if(!(h<3&&z(n.d,l-s,m,h)))return P(n,p.precision=f,m,d=!0);p.precision=l+=10,i=o=a=new p(1),c=0,h++}n=a}}function G(t,e){var i,s,r,o,n,a,l,h,c,u,p,m=1,f=t,v=f.d,b=f.constructor,g=b.rounding,y=b.precision;if(f.s<0||!v||!v[0]||!f.e&&1==v[0]&&1==v.length)return new b(v&&!v[0]?-1/0:1!=f.s?NaN:v?0:f);if(null==e?(d=!1,c=y):c=e,b.precision=c+=10,s=(i=A(v)).charAt(0),!(Math.abs(o=f.e)<15e14))return h=E(b,c+2,y).times(o+""),f=G(new b(s+"."+i.slice(1)),c-10).plus(h),b.precision=y,null==e?P(f,y,g,d=!0):f;for(;s<7&&1!=s||1==s&&i.charAt(1)>3;)s=(i=A((f=f.times(t)).d)).charAt(0),m++;for(o=f.e,s>1?(f=new b("0."+i),o++):f=new b(s+"."+i.slice(1)),u=f,l=n=f=N(f.minus(1),f.plus(1),c,1),p=P(f.times(f),c,1),r=3;;){if(n=P(n.times(p),c,1),A((h=l.plus(N(n,new b(r),c,1))).d).slice(0,c)===A(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(E(b,c+2,y).times(o+""))),l=N(l,new b(m),c,1),null!=e)return b.precision=y,l;if(!z(l.d,c-10,g,a))return P(l,b.precision=y,g,d=!0);b.precision=c+=10,h=n=f=N(u.minus(1),u.plus(1),c,1),p=P(f.times(f),c,1),r=a=1}l=h,r+=2}}function U(t){return String(t.s*t.s/0)}function V(t,e){var i,s,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(s=e.search(/e/i))>0?(i<0&&(i=s),i+=+e.slice(s+1),e=e.substring(0,s)):i<0&&(i=e.length),s=0;48===e.charCodeAt(s);s++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(s,r)){if(r-=s,t.e=i=i-s-1,t.d=[],s=(i+1)%C,i<0&&(s+=C),s<r){for(s&&t.d.push(+e.slice(0,s)),r-=C;s<r;)t.d.push(+e.slice(s,s+=C));e=e.slice(s),s=C-e.length}else s-=r;for(;s--;)e+="0";t.d.push(+e),d&&(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 q(t,i){var s,r,o,n,a,l,h,c,u;if(i.indexOf("_")>-1){if(i=i.replace(/(\d)_(?=\d)/g,"$1"),k.test(i))return V(t,i)}else if("Infinity"===i||"NaN"===i)return+i||(t.s=NaN),t.e=NaN,t.d=null,t;if(w.test(i))s=16,i=i.toLowerCase();else if(y.test(i))s=2;else{if(!x.test(i))throw Error(p+i);s=8}for((n=i.search(/p/i))>0?(h=+i.slice(n+1),i=i.substring(2,n)):i=i.slice(2),n=i.indexOf("."),r=t.constructor,(a=n>=0)&&(n=(l=(i=i.replace(".","")).length)-n,o=L(r,new r(s),n,2*n)),n=u=(c=M(i,s,_)).length-1;0===c[n];--n)c.pop();return n<0?new r(0*t.s):(t.e=O(c,u),t.d=c,d=!1,a&&(t=N(t,o,4*l)),h&&(t=t.times(Math.abs(h)<54?g(2,h):e.pow(2,h))),d=!0,t)}function Y(t,e,i,s,r){var o,n,a,l,h=t.precision,c=Math.ceil(h/C);for(d=!1,l=i.times(i),a=new t(s);;){if(n=N(a.times(l),new t(e++*e++),h,1),a=r?s.plus(n):s.minus(n),s=N(n.times(l),new t(e++*e++),h,1),void 0!==(n=a.plus(s)).d[c]){for(o=c;n.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=s,s=n,n=o}return d=!0,n.d.length=c+1,n}function J(t,e){for(var i=t;--e;)i*=t;return i}function K(t,e){var i,s=e.s<0,o=F(t,t.precision,1),n=o.times(.5);if((e=e.abs()).lte(n))return r=s?4:1,e;if((i=e.divToInt(o)).isZero())r=s?3:2;else{if((e=e.minus(i.times(o))).lte(n))return r=$(i)?s?2:3:s?4:1,e;r=$(i)?s?1:4:s?3:2}return e.minus(o).abs()}function Z(t,e,s,r){var o,l,h,c,d,u,p,m,f,v=t.constructor,b=void 0!==s;if(b?(I(s,1,n),void 0===r?r=v.rounding:I(r,0,8)):(s=v.precision,r=v.rounding),t.isFinite()){for(b?(o=2,16==e?s=4*s-3:8==e&&(s=3*s-2)):o=e,(h=(p=B(t)).indexOf("."))>=0&&(p=p.replace(".",""),(f=new v(1)).e=p.length-h,f.d=M(B(f),10,o),f.e=f.d.length),l=d=(m=M(p,10,o)).length;0==m[--d];)m.pop();if(m[0]){if(h<0?l--:((t=new v(t)).d=m,t.e=l,m=(t=N(t,f,s,r,0,o)).d,l=t.e,u=i),h=m[s],c=o/2,u=u||void 0!==m[s+1],u=r<4?(void 0!==h||u)&&(0===r||r===(t.s<0?3:2)):h>c||h===c&&(4===r||u||6===r&&1&m[s-1]||r===(t.s<0?8:7)),m.length=s,u)for(;++m[--s]>o-1;)m[s]=0,s||(++l,m.unshift(1));for(d=m.length;!m[d-1];--d);for(h=0,p="";h<d;h++)p+=a.charAt(m[h]);if(b){if(d>1)if(16==e||8==e){for(h=16==e?4:3,--d;d%h;d++)p+="0";for(d=(m=M(p,o,e)).length;!m[d-1];--d);for(h=1,p="1.";h<d;h++)p+=a.charAt(m[h])}else p=p.charAt(0)+"."+p.slice(1);p=p+(l<0?"p":"p+")+l}else if(l<0){for(;++l;)p="0"+p;p="0."+p}else if(++l>d)for(l-=d;l--;)p+="0";else l<d&&(p=p.slice(0,l)+"."+p.slice(l))}else p=b?"0p+0":"0";p=(16==e?"0x":2==e?"0b":8==e?"0o":"")+p}else p=U(t);return t.s<0?"-"+p:p}function X(t,e){if(t.length>e)return t.length=e,!0}function Q(t){return new this(t).abs()}function tt(t){return new this(t).acos()}function et(t){return new this(t).acosh()}function it(t,e){return new this(t).plus(e)}function st(t){return new this(t).asin()}function rt(t){return new this(t).asinh()}function ot(t){return new this(t).atan()}function nt(t){return new this(t).atanh()}function at(t,e){t=new this(t),e=new this(e);var i,s=this.precision,r=this.rounding,o=s+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(i=e.s<0?F(this,s,r):new this(0)).s=t.s:!t.d||e.isZero()?(i=F(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,i=this.atan(N(t,e,o,1)),e=F(this,o,1),this.precision=s,this.rounding=r,i=t.s<0?i.minus(e):i.plus(e)):i=this.atan(N(t,e,o,1)):(i=F(this,o,1).times(e.s>0?.25:.75)).s=t.s:i=new this(NaN),i}function lt(t){return new this(t).cbrt()}function ht(t){return P(t=new this(t),t.e+1,2)}function ct(t,e,i){return new this(t).clamp(e,i)}function dt(t){if(!t||"object"!=typeof t)throw Error(u+"Object expected");var e,i,s,r=!0===t.defaults,a=["precision",1,n,"rounding",0,8,"toExpNeg",-o,0,"toExpPos",0,o,"maxE",0,o,"minE",-o,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(i=a[e],r&&(this[i]=c[i]),void 0!==(s=t[i])){if(!(b(s)===s&&s>=a[e+1]&&s<=a[e+2]))throw Error(p+i+": "+s);this[i]=s}if(i="crypto",r&&(this[i]=c[i]),void 0!==(s=t[i])){if(!0!==s&&!1!==s&&0!==s&&1!==s)throw Error(p+i+": "+s);if(s){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(f);this[i]=!0}else this[i]=!1}return this}function ut(t){return new this(t).cos()}function pt(t){return new this(t).cosh()}function mt(t,e){return new this(t).div(e)}function ft(t){return new this(t).exp()}function vt(t){return P(t=new this(t),t.e+1,3)}function bt(){var t,e,i=new this(0);for(d=!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 d=!0,new this(1/0);i=e}return d=!0,i.sqrt()}function gt(t){return t instanceof e||t&&t.toStringTag===v||!1}function yt(t){return new this(t).ln()}function wt(t,e){return new this(t).log(e)}function xt(t){return new this(t).log(2)}function kt(t){return new this(t).log(10)}function _t(){return W(this,arguments,-1)}function Ct(){return W(this,arguments,1)}function St(t,e){return new this(t).mod(e)}function Tt(t,e){return new this(t).mul(e)}function Dt(t,e){return new this(t).pow(e)}function At(t){var e,i,s,r,o=0,a=new this(1),l=[];if(void 0===t?t=this.precision:I(t,1,n),s=Math.ceil(t/C),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(s));o<s;)(r=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:l[o++]=r%1e7;else{if(!crypto.randomBytes)throw Error(f);for(e=crypto.randomBytes(s*=4);o<s;)(r=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(l.push(r%1e7),o+=4);o=s/4}else for(;o<s;)l[o++]=1e7*Math.random()|0;for(s=l[--o],t%=C,s&&t&&(r=g(10,C-t),l[o]=(s/r|0)*r);0===l[o];o--)l.pop();if(o<0)i=0,l=[0];else{for(i=-1;0===l[0];i-=C)l.shift();for(s=1,r=l[0];r>=10;r/=10)s++;s<C&&(i-=C-s)}return a.e=i,a.d=l,a}function It(t){return P(t=new this(t),t.e+1,this.rounding)}function zt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Mt(t){return new this(t).sin()}function Nt(t){return new this(t).sinh()}function Pt(t){return new this(t).sqrt()}function Bt(t,e){return new this(t).sub(e)}function Ot(){var t=0,e=arguments,i=new this(e[t]);for(d=!1;i.s&&++t<e.length;)i=i.plus(e[t]);return d=!0,P(i,this.precision,this.rounding)}function Et(t){return new this(t).tan()}function Ft(t){return new this(t).tanh()}function jt(t){return P(t=new this(t),t.e+1,1)}e=function t(e){var i,s,r;function o(t){var e,i,s,r=this;if(!(r instanceof o))return new o(t);if(r.constructor=o,gt(t))return r.s=t.s,void(d?!t.d||t.e>o.maxE?(r.e=NaN,r.d=null):t.e<o.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"==(s=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(d?e>o.maxE?(r.e=NaN,r.d=null):e<o.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)):V(r,t.toString())}if("string"===s)return 45===(i=t.charCodeAt(0))?(t=t.slice(1),r.s=-1):(43===i&&(t=t.slice(1)),r.s=1),k.test(t)?V(r,t):q(r,t);if("bigint"===s)return t<0?(t=-t,r.s=-1):r.s=1,V(r,t.toString());throw Error(p+t)}if(o.prototype=D,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=dt,o.clone=t,o.isDecimal=gt,o.abs=Q,o.acos=tt,o.acosh=et,o.add=it,o.asin=st,o.asinh=rt,o.atan=ot,o.atanh=nt,o.atan2=at,o.cbrt=lt,o.ceil=ht,o.clamp=ct,o.cos=ut,o.cosh=pt,o.div=mt,o.exp=ft,o.floor=vt,o.hypot=bt,o.ln=yt,o.log=wt,o.log10=kt,o.log2=xt,o.max=_t,o.min=Ct,o.mod=St,o.mul=Tt,o.pow=Dt,o.random=At,o.round=It,o.sign=zt,o.sin=Mt,o.sinh=Nt,o.sqrt=Pt,o.sub=Bt,o.sum=Ot,o.tan=Et,o.tanh=Ft,o.trunc=jt,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(s=r[i++])||(e[s]=this[s]);return o.config(e),o}(c),e.prototype.constructor=e,e.default=e.Decimal=e,l=new e(l),h=new e(h),Gh.exports?("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(D[Symbol.for("nodejs.util.inspect.custom")]=D.toString,D[Symbol.toStringTag]="Decimal"),Gh.exports=e):(t||(t="undefined"!=typeof self&&self&&self.self==self?self:window),s=t.Decimal,e.noConflict=function(){return t.Decimal=s,e},t.Decimal=e)}(Uh);const qh=Vh.exports,Yh=class{constructor(e){t(this,e),this.ticketDrawDetails=[],this.ticketDrawDetailsFlag=!0,this.displayPrizeCategory=t=>{const e=new Map;t.forEach((t=>{let i=t.divisionDisplayName,s=t.currency;if(i&&"None"!==i){const r=new qh(t.amount);if(e.has(i)){const t=e.get(i),o=t.amount.plus(r);e.set(i,{amount:o,currency:s,times:t.times+1})}else e.set(i,{amount:r,currency:s,times:1})}}));const i=[];for(let[t,s]of e.entries()){const e=s.amount.times(100).floor().dividedBy(100);i.push({prizeName:t,amount:e.toNumber(),currency:s.currency,times:s.times})}return i.sort(((t,e)=>e.prizeName.localeCompare(t.prizeName))),i},this.thousandSeperator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.language="en",this.playerId=void 0,this.drawMode=!1,this.drawId="",this.gameName="",this.ticketDate="",this.ticketStatus="",this.ticketId="",this.ticketType="",this.ticketAmount="",this.ticketCurrency="",this.ticketMultiplier=!1,this.ticketMultiplierNum=void 0,this.ticketDrawCount=0,this.ticketNumbers="",this.sessionId="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.ticketDrawData="",this.historyDrawData="",this.tabValue="",this.translationUrl=void 0,this.multiplier=3,this.isLoading=!0,this.hasErrors=!1,this.errorText="",this.ticketData=[],this.ticketDataLoaded=!1,this.ticketDraws=[],this.toggleDrawer=[!1],this.drawData=void 0,this.resultMap={Won:"Win",Lost:"Lose"}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Wh[e][i]=t[e][i]})))}connectedCallback(){if(this.historyDrawData&&(this.drawData=JSON.parse(this.historyDrawData)),this.ticketNumbers){let t=JSON.parse(this.ticketNumbers);this.gridNumbers=t.map((t=>t.selections)),this.gridSecondaryNumbers=t.map((t=>t.secondarySelections||[]))}this.isLoading=!1}componentWillRender(){this.ticketDrawData&&this.ticketDrawDetailsFlag&&(this.ticketDrawDetails=JSON.parse(this.ticketDrawData),this.ticketDrawDetails.forEach((t=>{this.getDrawData(t.drawId).then((e=>{t.drawData=Object.assign({},e);let i=this.displayPrizeCategory(t.details);t.details=[...i]}))})),this.ticketDrawDetailsFlag=!1)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}getDrawData(t){return this.isLoading=!0,new Promise(((e,i)=>{let s=new URL(`${this.endpoint}/games/${this.gameId}/draws/${t||this.drawId}`);fetch(s.href).then((t=>t.json())).then((i=>{t?e(i):(this.drawData=i,e(!0)),this.isLoading=!1})).catch((t=>{i(t),this.isLoading=!1}))}))}drawerToggle(t){this.toggleDrawer=this.toggleDrawer.map(((e,i)=>i==t?!e:e)),t>=this.toggleDrawer.length&&this.toggleDrawer.push(!0)}getDivision(t,e){var i,s;let r=t.division,o=null===(s=null===(i=e.drawData)||void 0===i?void 0:i.prizes)||void 0===s?void 0:s.filter((t=>t.order===r));return o&&o.length?o[0].division:null}render(){return this.isLoading?s("p",null,"Loading, please wait ..."):this.hasErrors?void s("p",null,this.errorText):s("section",{class:"DrawResultsSection",ref:t=>this.stylingContainer=t},this.drawMode?s("div",{class:"DrawResultsArea"},this.drawData&&s("div",null,s("div",{class:"DrawResultsHeader"},s("span",null,Hh("drawId",this.language),": ",this.drawData.id),s("span",null,Hh("drawDate",this.language),": ",xh(new Date(this.drawData.date),"dd/MM/yyyy"))),s("div",{class:"DrawResultsBody"},s("div",{class:"DrawNumbersGrid"},s("p",null,Hh("drawNumbersGridDraw",this.language)),s("div",{class:"BulletContainer"},s("lottery-grid",{"selected-numbers":this.drawData.winningNumbers.length&&this.drawData.winningNumbers[0].numbers.join(","),"secondary-numbers":this.drawData.winningNumbers.length?this.drawData.winningNumbers[0].secondaryNumbers.join(","):"","display-selected":!0,selectable:!1,language:this.language,"grid-type":"ticket","translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),s("div",{class:"DrawPrizes"},s("label",{class:"Label"},Hh("prize",this.language)," "),this.drawData.prizes.length?s("div",null," ",this.drawData.prizes.filter((t=>"None"!==t.division)).map((t=>s("div",null,s("span",{style:{"margin-right":"5px"}},t.division,":"),s("span",{style:{"margin-right":"4px"}}," ",this.thousandSeperator(t.amount.value)),s("span",null,t.amount.currency))))):s("div",null,"None")))))):s("div",{class:"DrawResultsArea TicketDraws"},s("div",{class:"DrawResultsBody"},s("div",{class:"TicketIdContainer"},s("label",{class:"Label"},Hh("ticketId",this.language),": ",s("span",null,this.ticketId))),s("div",{class:"TicketTypeContainer"},s("label",{class:"Label"},Hh("ticketType",this.language),": ",s("span",null,this.ticketType))),s("div",{class:"TicketAmountContainer"},s("label",{class:"Label"},Hh("ticketAmount",this.language),":"," ",s("span",null,`${this.thousandSeperator(this.ticketAmount)} ${this.ticketCurrency}`))),s("div",{class:"DrawNumbersGrid"},this.gridNumbers.map(((t,e)=>{var i;return s("div",null,s("label",{class:"Label"},Hh("drawNumbersGridTicket",this.language),":"),s("div",{class:"BulletContainer"},s("lottery-grid",{"selected-numbers":t.join(","),"secondary-numbers":null===(i=this.gridSecondaryNumbers[e])||void 0===i?void 0:i.join(","),selectable:!1,"display-selected":!0,language:this.language,"translation-url":this.translationUrl,"grid-type":"ticket","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))}))),this.ticketMultiplier&&s("div",{class:"DrawMultipler"},s("label",{class:"Label"},Hh("multiplierNum",this.language),": ",this.thousandSeperator(this.ticketMultiplierNum))),s("div",{class:"NumberOfDrawsContainer"},s("label",{class:"Label"},Hh("numberOfDraws",this.language),": ",this.thousandSeperator(this.ticketDrawCount)),s("div",{class:"DrawTicketsContainer"},this.ticketDrawDetails&&this.ticketDrawDetails.length>0&&s("div",{class:"ExpandableBoxes"},this.ticketDrawDetails.map(((t,e)=>{var i,r,o,n,a,l,h,c;return s("div",{class:{ExpandableBox:!0,ShowBox:this.toggleDrawer[e]},onClick:this.drawerToggle.bind(this,e)},s("div",{class:"ExpandableBoxHeader"},s("div",{class:"TicketResultContainer"},s("p",null,Hh("ticketResult",this.language),": ",this.resultMap[t.state])),"won"==t.state&&s("div",{class:"AmountWonContainer"},s("p",null,Hh("amountWon",this.language),":"," ",Number(t.amount).toLocaleString("en")," ",t.currency)),"lost"==t.state&&s("div",{class:"DrawIdContainer"},s("p",null,Hh("drawId",this.language),": ",t.drawId))),s("div",{class:"ExpandableBoxBody"},s("div",{class:"DrawIdContainer"},s("p",null,Hh("drawId",this.language),": ",t.drawId)),s("div",{class:"DrawDateContainer"},s("p",null,Hh("drawDate",this.language),": ",null===(i=t.drawData)||void 0===i?void 0:i.date.slice(0,10)," |"," ",null===(r=t.drawData)||void 0===r?void 0:r.date.slice(11,19))),s("div",{class:"DrawNumbersGrid"},t.drawData&&s("div",{class:"BulletContainer"},s("label",{class:"Label"},Hh("drawNumbersGridDraw",this.language),":"),s("lottery-grid",{"selected-numbers":(null===(n=null===(o=t.drawData)||void 0===o?void 0:o.winningNumbers)||void 0===n?void 0:n.length)&&(null===(a=t.drawData.winningNumbers[0].numbers)||void 0===a?void 0:a.join(",")),"secondary-numbers":(null===(h=null===(l=t.drawData)||void 0===l?void 0:l.winningNumbers)||void 0===h?void 0:h.length)&&(null===(c=t.drawData.winningNumbers[0].secondaryNumbers)||void 0===c?void 0:c.join(",")),selectable:!1,"display-selected":!0,language:this.language,"translation-url":this.translationUrl,"grid-type":"ticket","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))),t.details.length>0&&s("div",{class:"DrawPrizes"},s("label",{class:"Label"},Hh("prize",this.language),":"),s("span",null,t.details.map((t=>s("span",null,s("div",null,s("span",null,t.prizeName,t.times>1?" x "+t.times:"",":"," "),s("span",{style:{"margin-right":"4px"}},this.thousandSeperator(t.amount)),s("span",null,t.currency)))))))))}))))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Yh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.DrawResultsArea{margin-top:15px}.DrawResultsArea.TicketDraws .Content{padding:0;border:0}.DrawResultsArea.TicketDraws .DrawResultsBody{padding:0;margin-bottom:5px;border-radius:0;border:0}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background-secondary, #f5f5f5);font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawResultsBody{padding:20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid var(--emw--color-typography, #009993)}.DrawResultsBody>div{margin:10px 0}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.DrawNumbersGrid{display:flex;flex-direction:column;gap:5px;margin-bottom:10px;color:var(--emw--color-typography, #000)}.DrawNumbersGrid label{display:block;margin-bottom:7px}.Label{position:relative}.DrawTicketsContainer{display:flex;flex-direction:column;margin:20px auto 0}.DrawMultipler{margin-top:15px}.ExpandableBoxes{position:relative;display:flex;flex-direction:column;border:1px solid var(--emw--color-gray-250, #ccc);border-radius:5px;background-color:var(--emw--color-background-secondary, #f5f5f5)}.ExpandableBox{border-bottom:1px solid var(--emw--color-gray-250, #ccc);transition:height 300ms ease-in-out;overflow:hidden;height:80px;background-color:var(--emw--color-background, #fff)}.ExpandableBox:last-child{border-bottom:0}.ExpandableBoxHeader{position:relative;list-style:none;outline:0;cursor:pointer;transition:color 300ms ease-in-out;margin-bottom:24px;margin-left:5px}.ShowBox>.ExpandableBoxHeader{color:var(--emw--color-primary, #009993)}.ExpandableBoxHeader::-webkit-details-marker{display:none}.ExpandableBoxHeader:before,.ExpandableBoxHeader:after{content:"";position:absolute}.ExpandableBoxHeader:before{right:21px;top:50%;height:2px;margin-top:-1px;width:16px;background:var(--emw--color-primary, #009993)}.ExpandableBoxHeader:after{right:28px;top:50%;height:16px;margin-top:-8px;width:2px;margin-left:-1px;background:var(--emw--color-primary, #009993);transition:all 300ms ease-in-out}.ShowBox .ExpandableBoxHeader:after{opacity:0;transform:translateY(25%)}.ExpandableBoxBody{padding-top:0;font-weight:lighter;margin-left:5px}.ExpandableBox.ShowBox{height:auto}';const Jh=["ro","en","fr","ar","hr"],Kh={en:{drawResultsHeader:"Draw results history",viewAllResults:"View All",noResults:"No results.",loading:"Loading, please wait ...",resetButton:"Reset"},ro:{drawResultsHeader:"Istoricul extragerilor",viewAllResults:"Vezi toate rezultatele",noResults:"Niciun rezultat",loading:"Loading, please wait ..."},fr:{drawResultsHeader:"Dessiner l'historique des résultats",viewAllResults:"Voir tout",noResults:"Aucun résultat",loading:"Loading, please wait ..."},ar:{drawResultsHeader:"سجل نتائج السحب",viewAllResults:"عرض الكل",noResults:"لا توجد نتائج",loading:"Loading, please wait ..."},hr:{drawResultsHeader:"Povijest rezultata izvlačenja",viewAllResults:"Pogledaj sve",noResults:"Nema rezultata",loading:"Loading, please wait ..."}},Zh=(t,e)=>{const i=e;return Kh[void 0!==i&&Jh.includes(i)?i:"en"][t]},Xh=class{constructor(e){t(this,e),this.isReset=!1,this.getDrawsData=()=>{this.isLoading=!0;let t=new URL(`${this.endpoint}/games/${this.gameId}/draws`);t.searchParams.append("limit",this.limit.toString()),t.searchParams.append("offset",this.offset.toString()),t.searchParams.append("status","PAYABLE"),this.dateFiltersFrom&&t.searchParams.append("from",this.dateFiltersFrom),this.dateFiltersTo&&t.searchParams.append("to",this.dateFiltersTo),fetch(t.href).then((t=>{if(t.status>=300)throw new Error("There was an error while fetching the data");return t.json()})).then((t=>{this.winningDataSetsData=t.items||[],this.drawData=this.winningDataSetsData.map((t=>t)),this.totalResults=t.total})).catch((t=>{console.log("err",t)})).finally((()=>{this.isLoading=!1,this.noResults=0==this.drawData.filter((t=>t.winningNumbers)).length}))},this.transDataToString=t=>{try{return JSON.stringify(t)}catch(t){throw new Error(t)}},this.endpoint=void 0,this.gameId=void 0,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.drawData=[],this.winningDataSetsData=[""],this.dateFiltersFrom="",this.dateFiltersTo="",this.isLoading=!1,this.noResults=!1,this.activeIndex=0,this.totalResults=0,this.limit=5,this.offset=0}filtersHandler(t){this.dateFiltersFrom=t.detail.filterFromCalendar,this.dateFiltersTo=t.detail.filterToCalendar,this.limit=5,this.offset=0,this.getDrawsData()}clearFiltersHandler(){this.dateFiltersFrom="",this.dateFiltersTo="",this.limit=5,this.offset=0,this.drawData=this.winningDataSetsData,this.getDrawsData()}hpPageChange(t){this.limit=t.detail.limit,this.offset=t.detail.offset,this.isReset=!1,this.getDrawsData()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}connectedCallback(){this.getDrawsData()}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Kh[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){clearInterval(this.interval)}render(){let t=s("div",{key:"43dea3d7f12d1ac0b4df84ee15f3ff5192a16837",class:"DrawResultsHeader"},s("div",{key:"3ee231127221e0c6dfef0e94a4b2bec613aa25f7",class:"DrawResultsHeaderContent"},s("h4",{key:"7bc26099b3bb593b6e9229322e19941ecd38e093"},Zh("drawResultsHeader",this.language)),s("div",{key:"047d1f6718d26512801de33656a803435234eab1",class:"FilterSection"},s("helper-filters",{key:"2f6ffe2fd2ae0d1a544a57d330991fd72a043a78","activate-ticket-search":"false","game-id":this.gameId,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))));return s("section",{key:"007d8200c91e7a99b911ea4e2b65be8932716a8e",class:"GridWrapper",ref:t=>this.stylingContainer=t},s("div",{key:"aa947a1455794d7719fb17098743ea60e84d6eb1",class:"DrawResultsSection"},s("div",{key:"ab8019f6591d773e8e9d52bfd8ca11d61dd74b89",class:"DrawResultsAreaHistory"},t,s("div",{key:"2a3fc14445339ba4895e8a9c7e99bcece2a54ca5",class:"HistoryGridWrapper"},s("div",{key:"90a5560b549fcd9ae871084ff5a5ab998af686cd",class:"HistoryGrid"},this.isLoading&&s("p",{key:"af0bdfd22c48844da0942b128ee304b2168571b5"},Zh("loading",this.language)),!this.isLoading&&!this.noResults&&this.drawData.map((t=>s("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,"draw-id":t.id,"draw-mode":!0,language:this.language,"history-draw-data":this.transDataToString(t),"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))),!this.isLoading&&this.noResults&&s("p",{key:"e0691b0f79b53410a4d4cba4439fb907552473f8",class:"errorText"},Zh("noResults",this.language)))),s("div",{key:"814919c0ea3baf1286ba2ef13fd405d21e417b19",class:"DrawHistoryPaginationWrapper"},this.totalResults>this.limit&&s("lottery-pagination",{key:"29f57cc28abab4a76fecb28a3039cf4f56d3f6f3",arrowsActive:!0,numberedNavActive:!0,"is-reset":this.isReset,"first-page":!1,"prev-page":!0,"next-page":!0,offset:this.offset,limit:this.limit,total:this.totalResults,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Xh.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridBanner{background-color:var(--emw--color-primary, #009993);background-repeat:no-repeat;background-position:center;color:var(--emw--color-typography, #000);padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-primary, #009993);border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.GridWrapper{background-color:var(--emw--color-background, #fff)}.DrawResultsSection{max-width:600px;margin:0px auto;padding-bottom:30px;color:var(--emw--color-typography, #000)}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:var(--emw--color-primary, #009993);padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:var(--emw--color-primary, #009993);padding:10px;text-align:center;color:var(--emw--color-background, #fff);padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:var(--emw--color-primary, #009993);color:var(--emw--color-background, #fff);outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton,.FilterSection .ResetButton{cursor:pointer;width:max-content;border-radius:var(--emw--button-border-radius, 4px);border:1px solid var(--emw--button-border-color, #009993);background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .Active{background:var(--emw--color-primary-variant, #004d4a);color:var(--emw--color-background, #fff)}.FilterSection helper-filters{margin-left:auto}.errorText{color:var(--emw--color-error, #ff0000)}';const Qh=class{constructor(e){t(this,e),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.lowNumber=void 0,this.highNumber=void 0,this.minimumAllowed=void 0,this.maxinumAllowed=void 0,this.language="en",this.translationUrl=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"0bb2683f87461804914d26c708499902d92dc503",class:"GamePageDetailsContainer",ref:t=>this.stylingContainer=t},s("helper-accordion",{key:"2ba23b953a9519ccb36fd203c3ac98a366673822","header-title":"Game Details",collapsed:!1,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("div",{key:"54c18e3a6fde25ff0953bb7b15b8a1200e237fd0",class:"AccordionContainer",slot:"accordionContent"},s("helper-tabs",{key:"0cb93435825bf7a42636848ffd5ff67a30369cfa","low-number":this.lowNumber,"high-number":this.highNumber,"minimum-allowed":this.minimumAllowed,"maxinum-allowed":this.maxinumAllowed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Qh.style=":host{display:block}";const tc=["ro","en","fr","ar","hr"],ec={en:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDrawIn:"Next draw in: ",startIn:"Sales Start in:",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",ticketFailed:"Failed to submit tickets.",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ...",emptyText:"Sorry. The Game is not available now."},ro:{error:"Eroare",backButton:"Inapoi",lobbyButton:"Lobby",nextDrawIn:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",submitSuccess:"Submit successfully!",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",modalLogin:"Please login to submit a ticket",loading:"Se incarca, va rugam asteptati ..."},fr:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDrawIn:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ..."},ar:{error:"خطأ",backButton:"خلف",lobbyButton:"ردهة",nextDrawIn:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",submitSuccess:"Submit successfully!",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة",loading:"Loading, please wait ..."},hr:{error:"Greška",backButton:"Nazad",lobbyButton:"Lobby",nextDrawIn:"Sljedeće izvlačenje za: ",buy:"Uplati listić",viewLatest:"Pogledajte najnovije rezultate",submitSuccess:"Submit successfully!",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listić",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Podnijeti",modalLogin:"Molimo prijavite se da uplatite listić",loading:"Učitavanje, molimo pričekajte ..."}},ic=(t,e)=>{const i=e;return ec[void 0!==i&&tc.includes(i)?i:"en"][t]},sc=t=>new Promise(((e,i)=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])ec[e][i]=t[e][i]})),e(ec)})).catch((t=>{i(t)}))}));var rc,oc;!function(t){t.OPEN="OPEN"}(rc||(rc={})),function(t){t.Settled="Settled",t.Purchased="Purchased",t.Canceled="Canceled"}(oc||(oc={}));const nc=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}));function ac(t,e="GET",i=null,s={}){return new Promise(((r,o)=>{const n=nc(),a={method:e,headers:Object.assign({"Content-Type":"application/json","X-Idempotency-Key":n},s),body:null};i&&(a.body=JSON.stringify(i)),fetch(t,a).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>o(t)))}))}const lc=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})};function hc(t,e){if(!t)return;let i=function(t,e,i){Il(2,arguments);var s,r=function(t,e){return Il(2,arguments),zl(t).getTime()-zl(e).getTime()}(t,e)/1e3;return((s=null==i?void 0:i.roundingMethod)?Ol[s]:Ol[El])(r)}("string"==typeof t?kh(t):t,e&&new Date);if(i<0)return"0D 00H 00M 00S";const s=Math.floor(i/86400);i%=86400;const r=Math.floor(i/3600);i%=3600;const o=Math.floor(i/60),n=i%60;return`${s}D ${r.toString().padStart(2,"0")}H ${o.toString().padStart(2,"0")}M ${n.toString().padStart(2,"0")}S`}const cc="TICKET_INVALID_TOKEN",dc=class{constructor(i){t(this,i),this.goBackEvent=e(this,"goBackEvent",7),this.goToLobbyEvent=e(this,"goToLobbyEvent",7),this.resetAllTicketSelection=e(this,"resetAllTicketSelection",7),this.quickPick=!1,this.gameData={},this.secondarySelectionAllowed=!1,this.thousandSeperator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId=void 0,this.language="en",this.backgroundUrl=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.tickets=[],this.mainTickets=[],this.secondaryTickets=[],this.tabIndex=0,this.hasErrors=!1,this.totalAmount=0,this.successVisible=!1,this.nextDate=void 0,this.isLoggedIn=!1,this.loginModalVisible=!1,this.isLoading=!1,this.showSubmitError=!1,this.submitError="",this.showApiError=!1,this.apiError="",this.translationData=void 0,this.isSubscription=!1,this.subscriptionParam=null,this.showSubscriptionError=!1,this.subscriptionError="",this.isSubscribed=!1,this.isFetchingGame=!1,this.drawSubmitAvailable=!1,this.formattedTime=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleNewTranslations(){this.isLoading=!0,sc(this.translationUrl).then((()=>{this.isLoading=!1}))}watchGameInfoChange(t,e){t&&t!=e&&this.getGameDetails()}async componentWillLoad(){this.gameId&&this.endpoint&&this.getGameDetails(),this.sessionId&&(this.isLoggedIn=!0);const t=[];if(this.translationUrl){const e=sc(this.translationUrl).then((t=>{this.translationData=JSON.stringify(t)})).catch((t=>{console.log(t)}));t.push(e)}return Promise.all(t)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.interval&&clearInterval(this.interval)}getGameDetails(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isFetchingGame=!0,fetch(t.href).then((t=>{if(t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{var e,i,s,r,o;if(this.gameData=t,this.basicStake=this.gameData.rules.stakes.length?Number(this.gameData.rules.stakes[0].value):0,this.basicLine=(null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.length)?this.gameData.rules.betTypes[0].boardsAllowed[0]:1,this.basicBetType=this.gameData.rules.betTypes[0],this.gameData&&function(t={}){return!(!t||!t.id||t.status!==rc.OPEN)}(null===(i=this.gameData)||void 0===i?void 0:i.currentDraw)){this.nextDate=null===(s=this.gameData.currentDraw)||void 0===s?void 0:s.date;const e=null===(o=null===(r=this.gameData)||void 0===r?void 0:r.currentDraw)||void 0===o?void 0:o.wagerStartTime,i=()=>{var i;const s=new Date;e&&function(t,e){Il(2,arguments);var i=zl(t),s=zl(e);return i.getTime()<s.getTime()}(s,kh(e))?(this.drawSubmitAvailable=!1,this.formattedTime={start:hc(e,s)}):(this.drawSubmitAvailable=!0,this.formattedTime={nextIn:hc(null===(i=null==t?void 0:t.currentDraw)||void 0===i?void 0:i.date,s)}),"0D 00H 00M 00S"===this.formattedTime.nextIn&&clearInterval(this.interval)};i(),this.interval=setInterval(i,1e3)}this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed,this.quickPick=this.gameData.rules.quickPickAvailable,this.isSubscription=this.gameData.rules.wagerTypes&&this.gameData.rules.wagerTypes.includes("Subscription");let n=this.gameData.draws?this.gameData.draws.filter((t=>!t.winningNumbers)):[];n.length>0&&(this.nextDraw=n[0].id),this.createNewTicket()})).catch((t=>{this.hasErrors=!0,console.log("Error",t)})).finally((()=>{this.isFetchingGame=!1}))}calculateTotalAmount(){const{currency:t}=this.gameData.rules.stakes[0];this.totalAmount=0,this.mainTickets.forEach((t=>{var e;t.completed.every((t=>t))&&(this.totalAmount+=t.drawCount*(t.stake||this.basicStake)*t.multiplierNum*t.lineNum*(null===(e=t.betType)||void 0===e?void 0:e.combinations))})),this.currency=t}gridFilledHandler(t){let e="secondarySelection"===t.detail.selectionType?this.secondaryTickets:this.mainTickets;e=e.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10)));let s=e.completed||[];return s[t.detail.index]=!0,{gameId:e.gameId,ticketId:e.ticketId,completed:s,drawCount:t.detail.drawCount,stake:e.stake||this.basicStake,selectedNumbers:i,multiplierNum:t.detail.multiplierNum,multiplier:t.detail.multiplier,lineNum:e.lineNum,betType:e.betType,quickPicks:t.detail.quickPicks,betName:t.detail.betName}}return e})),"secondarySelection"===t.detail.selectionType?this.secondaryTickets=e:this.mainTickets=e,this.calculateTotalAmount()}gridDirtyHandler(t){let e="secondarySelection"===t.detail.selectionType?this.secondaryTickets:this.mainTickets;e=e.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10)));let s=e.completed||[];return s[t.detail.index]=!1,{gameId:e.gameId,ticketId:e.ticketId,completed:s,drawCount:e.drawCount,stake:e.stake,selectedNumbers:i,multiplierNum:e.multiplierNum,multiplier:e.multiplier,lineNum:e.lineNum,betType:e.betType,quickPicks:e.quickPicks,betName:e.betName}}return e})),"secondarySelection"===t.detail.selectionType?this.secondaryTickets=e:this.mainTickets=e,this.calculateTotalAmount()}modalCloseEvent(){this.loginModalVisible=!1,this.successVisible=!1}stakeChangeHandler(t){const{ticketId:e,stake:i}=t.detail;this.mainTickets[e-1].stake=i,this.calculateTotalAmount()}multiplierChangeHandler(t){const{ticketId:e,multiplierNum:i,multiplier:s}=t.detail;this.mainTickets[e-1].multiplierNum=i,this.mainTickets[e-1].multiplier=s,this.calculateTotalAmount()}drawMultiplierChangeHandler(t){const{ticketId:e,drawCount:i}=t.detail;this.mainTickets[e-1].drawCount=i,this.calculateTotalAmount()}lineMultiplierChangeHandler(t){const{ticketId:e,lineNum:i}=t.detail;this.mainTickets[e-1].lineNum=i,this.mainTickets[e-1].completed=Array.from({length:i},(()=>!1)),this.mainTickets[e-1].selectedNumbers=[],this.mainTickets[e-1].quickPicks=[]}betTypeChangeHandler(t){const{ticketId:e,betType:i}=t.detail;this.mainTickets[e-1].betType=i}createNewTicket(){this.mainTickets=[...this.mainTickets,{gameId:this.gameId,ticketId:this.mainTickets.length+1,drawCount:1,multiplierNum:1,completed:[!1],stake:this.basicStake,betType:this.basicBetType,lineNum:this.basicLine,quickPicks:[!1],betName:""}],this.secondaryTickets=[...this.secondaryTickets,{gameId:this.gameId,ticketId:this.secondaryTickets.length+1,drawCount:1,multiplierNum:1,completed:[!1],stake:this.basicStake,betType:this.basicBetType,lineNum:this.basicLine}]}showLoginModal(){this.loginModalVisible=!0}handleSubscriptionReady(t){this.subscriptionParam=t.detail}handleSubscriptionCheckChange(t){this.isSubscribed=t.detail}buildTicketParam(){let t={playerId:this.playerId.toString(),tickets:[]},e=[];this.secondarySelectionAllowed&&(e=this.secondaryTickets[0].completed.reduce(((t,e,i)=>(e||t.push(i),t)),[]));let i=this.mainTickets[0].completed.reduce(((t,e,i)=>(e||t.push(i),t)),[]),s=[...new Set([...e,...i])].sort(((t,e)=>t-e));if(s.length){this.showSubmitError=!0;let t=s.map((t=>`Line${t+1}`)).join();return this.submitError=`The number of the selected number(s) on ${t} is invalid.`,setTimeout((()=>{this.showSubmitError=!1}),3e3),null}return this.mainTickets.forEach(((e,i)=>{var s;t.tickets.push({startingDrawId:this.nextDraw,amount:(e.stake*e.drawCount*e.multiplierNum*(e.lineNum||1)*(null===(s=e.betType)||void 0===s?void 0:s.combinations)).toString(),gameId:this.gameId,gameName:this.gameData.name,currency:this.currency,selection:e.selectedNumbers.map(((t,s)=>{var r;return{betType:(null===(r=e.betType)||void 0===r?void 0:r.id)||this.gameData.rules.defaultBetType,stake:e.stake,selections:t,secondarySelections:this.secondarySelectionAllowed?this.secondaryTickets[i].selectedNumbers[s]:[],quickPick:e.quickPicks[s],betName:e.betName}})),multiplier:e.multiplier,multiplierNum:e.multiplierNum,drawCount:e.drawCount,quickPick:this.quickPick})})),t}handleSubmitTickets(){this.drawSubmitAvailable&&(this.isSubscription&&this.isSubscribed?(this.submitTickets(),this.submitSubscriptionTickets()):this.submitTickets())}async submitSubscriptionTickets(){try{let t=await this.buildTicketParam();if(!t)return;if(!this.subscriptionParam||"string"==typeof this.subscriptionParam)return this.subscriptionError="string"==typeof this.subscriptionParam?this.subscriptionParam:"Ouccurence is required.",this.showSubscriptionError=!0,void setTimeout((()=>{this.showSubscriptionError=!1}),3e3);this.isLoading=!0;const e=this.playerId.toString(),i=`${this.endpoint}/player/${e}/ruleDefinition`;this.subscriptionParam.playerId=e;const s=xh(new Date,"yyyyMMddHHMMSS");this.subscriptionParam.name=`${this.subscriptionParam.ruleType}_${e}_${s}`;const{id:r}=await ac(i,"POST",this.subscriptionParam,{Authorization:`Bearer ${this.sessionId}`});if(t){const e=Object.assign(Object.assign({},t),{ruleDefinitionId:r}),i=`${this.endpoint}/subscription`;await ac(i,"POST",e,{Authorization:`Bearer ${this.sessionId}`}),lc({message:"Subscription rule created successfully.",theme:"success"});const s=new CustomEvent("resetAllTicketSelection",{bubbles:!0,composed:!0});document.dispatchEvent(s),console.log("resetAllTicketSelection event emitted through document after subscription ticket submission")}}catch(t){lc({message:"Failed to create the subscription rule. Please try again.",theme:"error"})}this.isLoading=!1}submitTickets(){let t=new URL(`${this.endpoint}/tickets`);const e=this.buildTicketParam();e?(this.isLoading=!0,(({body:t,sessionId:e,url:i})=>{const s={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${e}`,"X-Idempotency-Key":nc()},body:JSON.stringify(t)};return fetch(i,s).then((t=>{if(401===t.status)throw new Error(cc);if(t.status>300)throw new Error(t.statusText);return t.json().then((e=>{if(!(i=e.tickets)||!i.length||i.some((t=>t.state!==oc.Purchased)))throw new Error(t.statusText);var i;return e}))}))})({body:e,sessionId:this.sessionId,url:t.href}).then((()=>{lc({message:"Ticket submitted successfully.",theme:"success"}),this.resetAllTicketSelection.emit();const t=new CustomEvent("resetAllTicketSelection",{bubbles:!0,composed:!0});document.dispatchEvent(t)})).catch((t=>{lc(t.message!==cc?{message:ic("ticketFailed",this.language),theme:"error"}:{message:cc,theme:"error"})})).finally((()=>{this.isLoading=!1}))):console.log("No valid ticket parameters to submit")}goBack(){this.goBackEvent.emit()}goToLobby(){this.goToLobbyEvent.emit()}render(){var t,e,i,r,o,n,a,l,h,c,d,u,p,m,f,v,b,g,y,w,x,k,_;return this.hasErrors?s("div",{class:"GamePage"},s("div",{class:"Title"},ic("error",this.language))):s("div",{class:"GamePage",dir:"ar"==this.language?"rtl":"ltr",ref:t=>this.stylingContainer=t},s("div",{class:"GridBanner",style:{background:this.backgroundUrl?`url(${this.backgroundUrl})`:"","background-size":"contain","background-repeat":"no-repeat","background-position":"center"}},s("div",{class:"BannerButtonsWrapper"}),s("div",{class:"Tabs"},s("div",{class:"TabButton"+(0==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=0},ic("buy",this.language)),s("div",{class:"TabButton"+(1==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=1},ic("viewLatest",this.language)))),this.isFetchingGame?s("div",{class:"fetching"},"Loading..."):s("div",{class:"GamePageWrap"},this.nextDate?s("div",null,s("div",{class:"NextDrawWrapper"},s("div",{class:"NextDraw"},(null===(t=this.formattedTime)||void 0===t?void 0:t.start)?s("p",{class:"BannerText"},ic("startIn",this.language)):s("p",{class:"BannerText"},ic("nextDrawIn",this.language)),s("div",{class:"BannerCountdown"},(null===(e=this.formattedTime)||void 0===e?void 0:e.start)||(null===(i=this.formattedTime)||void 0===i?void 0:i.nextIn)))),0==this.tabIndex&&s("div",{class:"GamePageContentWrapper"},s("div",{class:"GamePageContent"},s("div",{class:"GameDetails"},s("lottery-game-details",{"low-number":null===(o=null===(r=this.gameData.rules)||void 0===r?void 0:r.boards[0])||void 0===o?void 0:o.lowNumber,"high-number":null===(a=null===(n=this.gameData.rules)||void 0===n?void 0:n.boards[0])||void 0===a?void 0:a.highNumber,"minimum-allowed":null===(h=null===(l=this.gameData.rules)||void 0===l?void 0:l.boards[0])||void 0===h?void 0:h.minimumAllowed,"maxinum-allowed":null===(d=null===(c=this.gameData.rules)||void 0===c?void 0:c.boards[0])||void 0===d?void 0:d.maxinumAllowed,language:this.language,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,"translation-url":this.translationData})),s("div",{class:"TicketsWrapper"},this.mainTickets.map((t=>{var e,i;return s("lottery-ticket-controller",{endpoint:this.endpoint,"ticket-id":t.ticketId,"game-id":t.gameId,collapsed:!1,last:!0,language:this.language,"auto-pick":null===(e=this.gameData.rules)||void 0===e?void 0:e.quickPickAvailable,"reset-button":null===(i=this.gameData.rules)||void 0===i?void 0:i.quickPickAvailable,"total-controllers":this.mainTickets.length,"translation-url":this.translationData,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})}))),s("div",{class:"OrderSummary"},s("h3",{class:"OrderSummaryTitle"},ic("orderSummaryTitle",this.language)),s("div",{class:"OrderTicketInfo"},s("div",{class:"Ticket"},ic("orderSummaryTickets",this.language),": ",s("span",null,this.mainTickets.length)),s("div",null,s("span",null,this.thousandSeperator((null===(p=null===(u=this.mainTickets[0])||void 0===u?void 0:u.betType)||void 0===p?void 0:p.combinations)*(null===(m=this.mainTickets[0])||void 0===m?void 0:m.lineNum))),s("span",{class:"Multiplier"},"x"),(null===(f=this.gameData.rules)||void 0===f?void 0:f.stakeMultiplierAvailable)&&s("span",null,s("span",null,1===(null===(v=this.mainTickets[0])||void 0===v?void 0:v.multiplierNum)?`${null===(b=this.mainTickets[0])||void 0===b?void 0:b.multiplierNum} Multiplier`:`${null===(g=this.mainTickets[0])||void 0===g?void 0:g.multiplierNum} Multipliers`),s("span",{class:"Multiplier"},"x")),s("span",null,`${null===(y=this.mainTickets[0])||void 0===y?void 0:y.stake} EUR`),(null===(w=this.gameData.rules)||void 0===w?void 0:w.drawMultiplierAvailable)&&s("span",null,s("span",{class:"Multiplier"},"x"),s("span",null,1===(null===(x=this.mainTickets[0])||void 0===x?void 0:x.drawCount)?`${null===(k=this.mainTickets[0])||void 0===k?void 0:k.drawCount} Draw`:`${null===(_=this.mainTickets[0])||void 0===_?void 0:_.drawCount} Draws`)))),s("hr",null),s("div",{class:"Total"},ic("orderSummaryTotal",this.language),":"," ",s("span",null,this.thousandSeperator(this.totalAmount)," ",this.currency)),this.isSubscription&&s("div",{class:"SubscriptionWrapper"},s("lottery-subscription",{endpoint:this.endpoint,language:this.language,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,gameName:this.gameData.name})),s("div",{class:"ButtonWrapper"},this.isLoggedIn&&s("div",null,!this.isLoading&&s("div",{class:"submitWrap"},s("div",{class:{Button:!0,ButtonDisabled:!this.drawSubmitAvailable},onClick:()=>this.handleSubmitTickets()},ic("orderSummarySubmit",this.language)),this.showSubmitError&&s("div",{class:"submitError"},this.submitError),this.showApiError&&s("div",{class:"submitError"},this.apiError),this.showSubscriptionError&&s("div",{class:"submitError"},this.subscriptionError)),this.isLoading&&s("span",{class:"Button",style:{cursor:"default"}},ic("loading",this.language))),!this.isLoggedIn&&s("div",null,s("span",{class:"Button",onClick:()=>this.showLoginModal()},ic("orderSummarySubmit",this.language)),s("helper-modal",{"title-modal":"Success",visible:this.loginModalVisible,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("p",{class:"SubmitModalSuccess"},ic("modalLogin",this.language)))))))),1==this.tabIndex&&s("div",{class:"HistoryContentWrapper"},s("lottery-draw-results-history",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"translation-url":this.translationData,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))):s("div",{class:"noActiveDraw"},ic("emptyText",this.language))),s("helper-modal",{"title-modal":"Success",visible:this.successVisible,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("p",{class:"SubmitModalSuccess"},ic("submitSuccess",this.language))))}static get assetsDirs(){return["../static"]}get element(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],translationUrl:["handleNewTranslations"],endpoint:["watchGameInfoChange"],gameId:["watchGameInfoChange"]}}};dc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");\n:host {\n display: block;\n font-family: "Roboto", sans-serif;\n}\n\n.GamePage {\n background-color: var(--emw--color-background, #fff);\n}\n.GamePage .GridBanner {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n background-repeat: no-repeat;\n background-position: center;\n color: var(--emw--color-typography, #000);\n padding: 0 20px 10px;\n height: 220px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.GamePage .GridBanner .BannerButtonsWrapper {\n display: flex;\n justify-content: space-between;\n padding-top: 16px;\n}\n.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,\n.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 7px 15px;\n font-size: 12px;\n text-transform: uppercase;\n width: 80px;\n cursor: pointer;\n}\n.GamePage .GridBanner .GridBannerArea {\n padding-top: 30px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.GamePage .TotalWinnings {\n color: var(--emw--color-typography, #000);\n font-size: 18px;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 10px;\n text-transform: uppercase;\n}\n.GamePage .TotalWinnings span {\n font-size: 18px;\n font-weight: 700;\n}\n.GamePage .NextDraw {\n color: var(--emw--color-primary, #009993);\n font-size: 24px;\n font-weight: 600;\n margin: 0 auto;\n text-align: center;\n text-transform: uppercase;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 4px;\n}\n.GamePage .NextDraw .BannerText {\n font-weight: 400;\n font-size: 18px;\n text-transform: uppercase;\n padding: 0;\n margin: 15px 0 0 0;\n}\n.GamePage .NextDraw .BannerCountdown {\n font-size: 22px;\n color: var(--emw--color-primary, #009993);\n display: flex;\n gap: 20px;\n}\n.GamePage .Tabs {\n display: flex;\n justify-content: center;\n gap: 10px;\n}\n.GamePage .Tabs .TabButton {\n border-radius: var(--emw--button-border-radius, 4px);\n cursor: pointer;\n padding: 8px 0;\n width: 50%;\n max-width: 200px;\n border: 1px solid var(--emw--color-primary, #009993);\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.GamePage .Tabs .TabButton.Active {\n color: var(--emw--color-primary, #009993);\n background: var(--emw--color-gray-50, #f5f5f5);\n border: 1px solid var(--emw--color-gray-50, #f5f5f5);\n}\n\n.LastDrawResultsTitle {\n color: var(--emw--color-primary, #009993);\n padding: 25px 0 10px 0;\n text-align: center;\n border-radius: var(--emw--button-border-radius, 4px);\n text-transform: uppercase;\n font-size: 16px;\n font-weight: 600;\n margin: 0;\n}\n\n.NextDrawWrapper {\n padding: 10px 15px;\n background: var(--emw--color-background, #fff);\n}\n.NextDrawWrapper .BannerText {\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n color: var(--emw--color-typography, #000);\n}\n.NextDrawWrapper .BannerCountdown {\n font-size: 22px;\n display: flex;\n gap: 8px;\n color: var(--emw--color-primary, #009993);\n font-weight: bolder;\n justify-content: center;\n}\n\n.GamePageContent {\n max-width: 1200px;\n margin: 0 auto;\n background: var(--emw--color-background, #fff);\n container-type: inline-size;\n container-name: gamePage;\n}\n\n.TicketsWrapper {\n min-height: 300px;\n}\n\n@container gamePage (min-width: 1200px) {\n .GamePageContent .TicketsWrapper {\n float: left;\n width: 49%;\n }\n .GamePageContent .GameDetails {\n float: right;\n width: 49%;\n }\n .GamePageContent .OrderSummary {\n float: right;\n width: 49%;\n }\n}\n.GameDetails {\n padding-bottom: 10px;\n margin-bottom: 20px;\n}\n\n.OrderSummary {\n min-width: 200px;\n border-radius: var(--emw--button-border-radius, 4px);\n color: var(--emw--color-typography, #000);\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n background: var(--emw--color-background, #fff);\n}\n.OrderSummary .OrderSummaryTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n text-transform: uppercase;\n text-align: center;\n}\n.OrderSummary .OrderTicketInfo {\n display: flex;\n align-items: center;\n color: var(--emw--color-typography, #000);\n}\n.OrderSummary .OrderTicketInfo .Multiplier {\n margin: 0 6px;\n}\n.OrderSummary .Ticket {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n margin-right: 30px;\n}\n.OrderSummary .Ticket span {\n text-align: right;\n}\n.OrderSummary hr {\n border: none;\n border-top: 1px double var(--emw--color-gray-100, #e6e6e6);\n color: var(--emw--color-gray-100, #e6e6e6);\n width: 100%;\n}\n.OrderSummary .Total {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n}\n.OrderSummary .Total span {\n text-align: right;\n}\n\n.ButtonWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ButtonWrapper .Button {\n cursor: pointer;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 8px 60px;\n width: max-content;\n margin: 5px;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.ButtonWrapper .Button:hover {\n background: var(--emw--color-secondary, #00aba4);\n}\n.ButtonWrapper .Button.ButtonDisabled {\n pointer-events: none;\n background: var(--emw--color-background-tertiary, #ccc);\n}\n.ButtonWrapper .submitError {\n margin-top: 10px;\n color: var(--emw--color-error, #ff3d00);\n}\n.ButtonWrapper .submitWrap {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.SubmitModalSuccess {\n text-align: center;\n font-size: 18px;\n padding: 20px;\n}\n\n.DeleteTicketModalWrapper {\n padding: 20px;\n text-align: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n font-weight: 400;\n text-transform: uppercase;\n margin: 20px 0 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalText {\n font-size: 14px;\n color: var(--emw--color-typography, #000);\n line-height: 22px;\n margin-bottom: 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons {\n display: flex;\n gap: 10px;\n justify-content: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 25px;\n width: max-content;\n margin: 5px;\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-error, #ff3d00);\n border: 1px solid var(--emw--color-error, #ff3d00);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover {\n background: var(--emw--color-tertiary, #ff6536);\n border: 1px solid var(--emw--color-error, #ff3d00);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel {\n cursor: pointer;\n width: max-content;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 10px 25px;\n margin: 5px;\n border: 1px solid var(--emw--color-secondary, #00aba4);\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover {\n background: var(--emw--color-gray-50, #f5f5f5);\n}\n\n.GamePage {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.GamePage .GamePageContentWrapper,\n.GamePage .HistoryContentWrapper {\n padding: 15px;\n flex: 1;\n background: var(--emw--color-background, #fff);\n}\n\n.HistoryContentWrapper::after,\n.GamePageContent::after {\n content: "";\n display: block;\n clear: both;\n}\n\n.GamePageWrap .noActiveDraw {\n margin: 10% auto 0px;\n padding: 24px;\n border: 1px solid var(--emw--color-primary, #009993);\n border-radius: 4px;\n width: 280px;\n color: var(--emw--color-primary, #009993);\n}\n\n.fetching {\n margin: 40px auto;\n}';const uc=class{constructor(i){t(this,i),this.gridFilledEvent=e(this,"gridFilled",7),this.gridDirtyEvent=e(this,"gridDirty",7),this.gridClearAllEvent=e(this,"gridClearAllEvent",7),this.selectedCounter=0,this.ticketId=void 0,this.totalNumbers=0,this.gameId=void 0,this.maximumAllowed=7,this.minimumAllowed=3,this.numberRange=void 0,this.selectable=!0,this.selectedNumbers="",this.secondaryNumbers="",this.displaySelected=!1,this.language="en",this.gridIndex=void 0,this.gridType="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.highNumber=47,this.lowNumber=1,this.selectionType="mainSelection",this.partialQuickpickAvailable=!1,this.numbers=[],this.bonusNumbers=[]}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}connectedCallback(){let t=[];this.selectedNumbers.length>0&&(t=this.selectedNumbers.split(","),this.selectedCounter=t.length),this.secondaryNumbers.length>0&&(this.bonusNumbers=this.secondaryNumbers.split(",").map((t=>({number:t,selected:!0,selectable:this.selectable})))),this.displaySelected?t.forEach((t=>{this.numbers.push({number:t,selected:!0,selectable:this.selectable})})):Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e)).map((t=>t.toString())).forEach((e=>{this.numbers.push({number:e,selected:t.indexOf(e)>=0,selectable:this.selectedCounter!=this.maximumAllowed&&this.selectable})}))}shuffleArray(t){const e=[];for(;t.length>0;){const i=Math.floor(Math.random()*t.length);e.push(t.splice(i,1)[0])}return e}lotteryBulletSelectionHandler(t){this.numbers=this.numbers.map((e=>({number:e.number,selected:e.number==t.detail.value?t.detail.selected:e.selected,selectable:e.selectable}))),t.detail.selected?(this.selectedCounter+=1,this.selectedCounter>=this.minimumAllowed&&this.selectedCounter<=this.maximumAllowed&&(this.numbers=this.numbers.map((t=>this.selectedCounter===this.maximumAllowed?{number:t.number,selected:t.selected,selectable:!!t.selected}:{number:t.number,selected:t.selected,selectable:!0})),JSON.parse(this.numberRange).includes(this.selectedCounter)?this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))):(this.selectedCounter-=1,this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!0}))),0===this.selectedCounter&&this.gridClearAllEvent.emit(this.gridIndex),this.selectedCounter<this.minimumAllowed?this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))}async resetSelectionHandler(t){t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex&&(this.selectedCounter=0,this.numbers=this.numbers.map((t=>({number:t.number,selected:!1,selectable:this.selectable}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:[]}))}async autoSelectionHandler(t){if(t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex){this.resetSelectionHandler(t);let e=Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e));e=this.shuffleArray(e),e=e.slice(0,this.minimumAllowed),this.numbers=this.numbers.map((t=>({number:t.number,selected:e.indexOf(parseInt(t.number,10))>=0,selectable:!!this.partialQuickpickAvailable&&e.indexOf(parseInt(t.number,10))>=0}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}),this.selectedCounter=this.minimumAllowed}}render(){return s("div",{key:"f62b5b1e5a6cf7bcaa13ce2c8a281bc93fa439f7",class:"GridContainer",ref:t=>this.stylingContainer=t},s("div",{key:"e381adbfff57e2cc343188c46037eb45ab798cac",class:"ticket"===this.gridType?"Grid TicketGrid":"Grid"},this.numbers.map((t=>s("div",null,s("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))),this.bonusNumbers.length?this.bonusNumbers.map((t=>s("div",null,s("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"is-bonus":!0,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))):""))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};uc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}';const pc=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),mc={en:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ro:{firstPage:"Prima",previousPage:"Anterior",nextPage:"Urmatoarea",lastPage:"Ultima"},fr:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ar:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},hu:{firstPage:"First",previousPage:"Previous",nextPage:"Következő",lastPage:"Last"},hr:{firstPage:"Prva",previousPage:"Prethodna",nextPage:"Slijedeća",lastPage:"Zadnja"}},fc=(t,e)=>mc[void 0!==e&&e in mc?e:"en"][t],vc=class{constructor(i){t(this,i),this.hpPageChange=e(this,"hpPageChange",7),this.userAgent=window.navigator.userAgent,this.currentPage=1,this.navigateTo=t=>{switch(t){case"firstPage":this.offsetInt=0;break;case"lastPage":this.offsetInt=this.endInt*this.limitInt;break;case"previousPage":this.offsetInt-=this.limitInt,this.nextPage=!0;break;case"nextPage":this.offsetInt+=this.limitInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage;break;case"fivePagesBack":this.offsetInt-=5*this.limitInt,this.offsetInt=this.offsetInt<=0?0:this.offsetInt;break;case"fivePagesForward":this.offsetInt+=5*this.limitInt,this.offsetInt=this.offsetInt/this.limitInt>=this.endInt?this.endInt*this.limitInt:this.offsetInt,this.nextPage=!(this.offsetInt/this.limitInt>=this.endInt)&&this.nextPage}this.previousPage=!!this.offsetInt,this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})},this.paginationNavigation=(t,e)=>{isNaN(t)?0===e&&this.currentPage<=4?this.navigateTo("firstPage"):0===e&&this.currentPage>4?this.navigateTo("fivePagesBack"):4===e&&this.endInt-this.currentPage>=2&&this.navigateTo("fivePagesForward"):(1===t?(this.offsetInt=t-1,this.previousPage=!1):(this.offsetInt=(t-1)*this.limitInt,this.nextPage=!(t>this.endInt)),this.hpPageChange.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt}))},this.nextPage=!1,this.prevPage=!1,this.offset=0,this.limit=10,this.total=1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.arrowsActive=void 0,this.secondaryArrowsActive=void 0,this.numberedNavActive=void 0,this.isReset=!1,this.translationUrl=void 0,this.offsetInt=void 0,this.lastPage=!1,this.previousPage=!1,this.limitInt=void 0,this.totalInt=void 0,this.pagesArray=[],this.endInt=0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])mc[e][i]=t[e][i]})))}componentWillRender(){this.offsetInt=this.offset,this.limitInt=this.limit,this.nextPage=!!this.isReset||this.nextPage,this.currentPage=this.offsetInt/this.limitInt+1,this.limitInt=this.limit,this.totalInt=this.total,this.endInt=Math.ceil(this.totalInt/this.limitInt)-1,this.lastPage=!(this.offsetInt>=this.endInt*this.limitInt),1==this.currentPage||2==this.currentPage?this.endInt>3?(this.pagesArray=Array.from({length:4},((t,e)=>e+1)),this.pagesArray.push("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,e)=>e+1)):this.currentPage>=3&&this.endInt-this.currentPage>=2?(this.pagesArray=Array.from({length:3},((t,e)=>this.currentPage+e-1)),this.pagesArray.push("..."),this.pagesArray.unshift("...")):this.endInt-this.currentPage<3&&(this.endInt>4?(this.pagesArray=Array.from({length:4},((t,e)=>this.endInt-2+e)),this.pagesArray.unshift("...")):this.pagesArray=Array.from({length:this.endInt+1},((t,e)=>e+1)))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){let t=s("ul",{class:"PaginationArea"},this.pagesArray.map(((t,e)=>s("li",{class:"PaginationItem"+(t===this.currentPage?" ActiveItem":" ")+" "+(pc(this.userAgent)?"MobileButtons":"")},s("button",{disabled:t===this.currentPage,onClick:this.paginationNavigation.bind(this,t,e)},s("span",null,t)))))),e=s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"firstPage")},s("span",{class:"NavigationButton"},fc("firstPage",this.language)),s("span",{class:"NavigationIcon"})),i=s("div",{class:"LeftItems"},this.secondaryArrowsActive&&e,s("button",{disabled:!this.prevPage||1===this.currentPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},fc("previousPage",this.language)),s("span",{class:"NavigationIcon"})));pc(this.userAgent)&&(i=s("div",{class:"LeftItems"},s("button",{disabled:!this.prevPage,onClick:this.navigateTo.bind(this,"previousPage")},s("span",{class:"NavigationButton"},fc("previousPage",this.language)),s("span",{class:"NavigationIcon"}))));let r=s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"lastPage")},s("span",{class:"NavigationButton"},fc("lastPage",this.language)),s("span",{class:"NavigationIcon"})),o=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},fc("nextPage",this.language)),s("span",{class:"NavigationIcon"})),this.secondaryArrowsActive&&r);return pc(this.userAgent)&&(o=s("div",{class:"RightItems"},s("button",{disabled:!this.nextPage,onClick:this.navigateTo.bind(this,"nextPage")},s("span",{class:"NavigationButton"},fc("nextPage",this.language)),s("span",{class:"NavigationIcon"})))),s("div",{id:"PaginationContainer",ref:t=>this.stylingContainer=t},this.arrowsActive&&i,this.numberedNavActive&&t,this.arrowsActive&&o)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};vc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993)}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:var(--emw--color-typography, #000);cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);opacity:0.8}button{width:100px;height:32px;border:1px solid var(--emw--color-gray-150, #6f6f6f);border-radius:5px;background:var(--emw--color-gray-150, #6f6f6f);color:var(--emw--color-typography-inverse, #fff);font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:var(--emw--color-primary-variant, #004d4a);border-color:var(--emw--color-primary-variant, #004d4a)}button:disabled{background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-typography-inverse, #fff);cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:14px}}@media screen and (max-width: 480px){button{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:var(--emw--color-primary, #009993);border-color:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}}';const bc=["ro","en","hr"],gc={en:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},ro:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},fr:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},ar:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"},hr:{filterFromCalendar:"Start Date",filterToCalendar:"End Date"}},yc=(t,e)=>{const i=e;return gc[void 0!==i&&bc.includes(i)?i:"en"][t]};function wc(t,e="GET",i=null,s={}){return new Promise(((r,o)=>{const n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),a={method:e,headers:Object.assign({"Content-Type":"application/json","X-Idempotency-Key":n},s),body:null};i&&(a.body=JSON.stringify(i)),fetch(t,a).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>o(t)))}))}const xc=class{constructor(i){t(this,i),this.subscriptionCompleted=e(this,"subscriptionCompleted",7),this.subscriptionCheckChange=e(this,"subscriptionCheckChange",7),this.changeDateParam=()=>{if(this.filterData.from&&!this.filterData.to){let t=this.filterData.from,e=t.split("/");t=new Date(Date.UTC(Number(e[2]),Number(e[1])-1,Number(e[0]),0,0,0)).toISOString();const i={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:t,fieldId:this.startDateRule.id},{value:"",fieldId:this.endDateRule.id},{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};i.params=this.paramRule.fields.map((t=>({value:"",field:t,fieldId:t.id}))),this.subscriptionCompleted.emit(i)}if(this.filterData.from&&this.filterData.to){const{from:t,to:e}=this.transDate(this.filterData.from,this.filterData.to),i={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:t,fieldId:this.startDateRule.id},{value:e,fieldId:this.endDateRule.id},{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};i.params=this.paramRule.fields.map((t=>({value:"",field:t,fieldId:t.id}))),this.subscriptionCompleted.emit(i)}},this.handleFilterFrom=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{from:`${e[2]}/${e[1]}/${e[0]}`})),this.changeDateParam()},this.handleFilterTo=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{to:`${e[2]}/${e[1]}/${e[0]}`})),this.changeDateParam()},this.translationUrl=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.endpoint=void 0,this.language="en",this.gameName=void 0,this.isSubscribed=!1,this.frequenceList=[],this.frequenceState="",this.filterData={from:"",to:""},this.subscriptionCode="lottery-subscription-widget001",this.conditionId="",this.paramId="",this.conditionRule=void 0,this.paramRule=void 0,this.peroidRule=void 0,this.startDateRule=void 0,this.endDateRule=void 0,this.gameNameRule=void 0,this.ruleType=""}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])gc[e][i]=t[e][i]}))),this.getSubscriptionData()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}transDate(t,e){let i=t.split("/"),s=e.split("/");return{from:new Date(Date.UTC(Number(i[2]),Number(i[1])-1,Number(i[0]),0,0,0)).toISOString(),to:new Date(Date.UTC(Number(s[2]),Number(s[1])-1,Number(s[0]),23,59,59)).toISOString()}}async getSubscriptionData(){try{const t=`${this.endpoint}/feWidgetConfig/${this.subscriptionCode}`,{conditionMetadataId:e,paramMetadataId:i,ruleType:s}=await wc(t);this.conditionId=e,this.paramId=i,this.ruleType=s;const r=`${this.endpoint}/metadata/${this.conditionId}`,o=`${this.endpoint}/metadata/${this.paramId}`,[n,a]=await Promise.allSettled([wc(r),wc(o)]);if("fulfilled"!==n.status||"fulfilled"!==a.status)throw new Error("Failed to get subscription data");this.conditionRule=n.value,this.paramRule=a.value,this.conditionRule.fields&&(this.peroidRule=this.conditionRule.fields.find((t=>"Period"===t.code)),this.startDateRule=this.conditionRule.fields.find((t=>"StartDate"===t.code)),this.endDateRule=this.conditionRule.fields.find((t=>"EndDate"===t.code)),this.gameNameRule=this.conditionRule.fields.find((t=>"GameName"===t.code)),this.frequenceList=this.peroidRule.enums.map((t=>({label:t.text,value:t.key}))))}catch(t){console.error(t)}}handleCheckboxchange(t){this.isSubscribed=t.target.checked,this.subscriptionCheckChange.emit(this.isSubscribed)}handleSelectionChange(t){if(this.frequenceState=t.detail.value,"NeverMissADraw"===this.frequenceState&&this.isSubscribed){const t={conditionMetadata:this.conditionRule,paramMetadata:this.paramRule,conditions:[{value:this.frequenceState,fieldId:this.peroidRule.id},{fieldId:this.gameNameRule.id,value:this.gameName}],params:[],ruleType:this.ruleType};t.params=this.paramRule.fields.map((t=>({value:"",fieldId:t.id}))),this.subscriptionCompleted.emit(t)}else"Custom"===this.frequenceState&&this.isSubscribed&&this.subscriptionCompleted.emit("Subscription start date is required.")}formateDate(t){const{year:e,month:i,day:s}=t;return xh(new Date(e,i,s),"dd/MM/yyyy")}parseDate(t){const[e,i,s]=t.split("/");return{year:s,month:parseInt(i)-1,day:e}}changeFormate(t){const[e,i,s]=t.split("/");return`${s}-${i}-${e}`}setDateFormate(t){t&&(t.i18n=Object.assign(Object.assign({},t.i18n),{formatDate:this.formateDate,parseDate:this.parseDate}))}render(){return s("div",{key:"185b4f76308ff8df614f520f5eb93a19c619cbcd",class:"subscripitonContainer",ref:t=>this.stylingContainer=t},s("vaadin-checkbox",{key:"c3af7821b5bacbfc8527ad242ddc6cb9d8b5234d",label:"Subscription",checked:this.isSubscribed,onChange:this.handleCheckboxchange.bind(this)}),this.isSubscribed&&s("div",{key:"e567968dca8f1150f751662e2834ffeb60e791cd",class:"secondConditon"},s("span",{key:"5999241e246949594cf39d1dade31deb04e17f1a",style:{"margin-right":"8px"}},"Occurrence: "),s("vaadin-select",{key:"50a04ac0202ab7912cd56043cda5d8f915a9151e",items:this.frequenceList,value:this.frequenceState,"on-value-changed":this.handleSelectionChange.bind(this)}),"Custom"===this.frequenceState&&s("div",{key:"329650009ba11791abf137bfd75b18ce982c6ee9",class:"thirdCondition"},s("div",{key:"f29c8951aa53637f6f66ab523b847e0937f2f323",class:"filterCalenderWrap"},s("div",{key:"a19a4c4ba091397bf79c0969b9fc7bafd3fef519",class:"filterText"},"Subscription Start Date*"),s("div",{key:"fd91ca7fc3df5250e2e88f6c34cd92e8b91b9907",class:"filter"},s("vaadin-date-picker",{value:this.filterData.from,key:"filterFromCalendar",max:void 0===this.filterData.to?void 0:this.changeFormate(this.filterData.to),onChange:this.handleFilterFrom,placeholder:yc("filterFromCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))),s("div",{key:"450a8c165db8ddb42d3c731f49257d17e9426c40",class:"filterCalenderWrap"},s("div",{key:"e66f7308e413493e84ae659b02f8eb11a025f559",class:"filterText"},"Subscription End Date"),s("div",{key:"4644c0873295e22573f9e2d1927b649e10ecd3f5",class:"filter"},s("vaadin-date-picker",{value:this.filterData.to,key:"filterToCalendar",min:void 0===this.filterData.from?void 0:this.changeFormate(this.filterData.from),onChange:this.handleFilterTo,placeholder:yc("filterToCalendar",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};xc.style=".subscripitonContainer{margin-bottom:40px}.subscripitonContainer vaadin-checkbox[checked]::part(checkbox){background-color:var(--emw--color-primary, #009993)}.subscripitonContainer .secondCondition{padding-left:24px}.subscripitonContainer .thirdCondition{display:flex;gap:24px;align-items:center}.subscripitonContainer .thirdCondition,.subscripitonContainer .secondConditon{margin:16px 0}";const kc=["ro","en","hr"],_c={en:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},fr:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ar:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},hr:{loading:"Učitavanje, molimo pričekajte ...",error:"Došlo je do pogreške prilikom pokušaja dohvaćanja podataka",multiplier:"Multiplikator",numberOfDraws:"Broj izvlačenja",wagerPerDraw:"Ulog po izvlačenju",resetButton:"Resetiraj",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"}},Cc=(t,e)=>{const i=e;return _c[void 0!==i&&kc.includes(i)?i:"en"][t]},Sc=class{constructor(i){t(this,i),this.ticketCompleted=e(this,"ticketCompleted",7),this.autoSelection=e(this,"autoSelection",7),this.resetSelection=e(this,"resetSelection",7),this.stakeChange=e(this,"stakeChange",7),this.multiplierChange=e(this,"multiplierChange",7),this.drawMultiplierChange=e(this,"drawMultiplierChange",7),this.lineMultiplierChange=e(this,"lineMultiplierChange",7),this.betTypeChange=e(this,"betTypeChange",7),this.endpoint=void 0,this.gameId=void 0,this.numberOfGrids=1,this.multipleDraws=!0,this.ticketId=void 0,this.resetButton=!1,this.autoPick=!1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.isLoading=!0,this.hasErrors=!1,this.ticketDone=[],this.isCustomSelect=!1,this.amountInfo={},this.stakeMultiplier="1",this.lineMultiplier=0,this.isCustomSelectStake=!1,this.isCustomSelectDraw=!1,this.isCustomSelectLine=!1,this.drawMultiplier=1,this.secondarySelectionAllowed=!1,this.partialQuickpickAvailable=!1,this.boardsAllowed=[],this.tabIndex=0,this.groupType=[],this.playType=[],this.selectedPlayTypeId="",this.maximumAllowed=6,this.numberRange=[],this.secondaryNumberRange=[],this.secondaryMaximumAllowed=1,this.minimumAllowed=6,this.secondaryMinimumAllowed=1,this.quickPicks=[]}handleLineMultiplierChange(t){this.grids=Array.from({length:t},((t,e)=>e+1)),this.ticketDone=Array.from({length:t},(()=>!1)),this.quickPicks=Array.from({length:t},(()=>!1)),this.grids.forEach(((t,e)=>{this.resetSelection.emit({ticketId:this.ticketId,index:e})}))}handleTabIndexChange(t){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)})),this.setDrawMultiplier(1),this.setStakeMultiplier("1"),this.amountInfo=this.gameData.rules.stakes[0],this.setWagerPerDraw(this.amountInfo),this.playType=this.groupType[t].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.boardsAllowed=this.playType[0].boardsAllowed,this.setLineMultiplier(this.boardsAllowed[0]),this.selectedPlayTypeId=this.playType[0].value,this.numberRange=this.playType[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=this.playType[0].secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange),this.betTypeChange.emit({ticketId:this.ticketId,betType:this.playType[0]})}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}checkForClickOutside(t){this.selectRef&&!this.selectRef.contains(t.composedPath()[0])&&(this.isCustomSelect=!1),this.selectStakeRef&&!this.selectStakeRef.contains(t.composedPath()[0])&&(this.isCustomSelectStake=!1),this.selectDrawRef&&!this.selectDrawRef.contains(t.composedPath()[0])&&(this.isCustomSelectDraw=!1),this.selectLineRef&&!this.selectLineRef.contains(t.composedPath()[0])&&(this.isCustomSelectLine=!1)}connectedCallback(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.ok)return t.json();this.hasErrors=!0})).then((t=>{var e;this.isLoading=!1,this.gameData=t,this.amountInfo=this.gameData.rules.stakes[0],this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed;const i=this.gameData.rules.betTypes.reduce(((t,e)=>(e.group?(t.groups[e.group]||(t.groups[e.group]=[]),t.groups[e.group].push(e)):t.noGroup.push({groupName:e.name||e.id,betType:[Object.assign({},e)]}),t)),{groups:{},noGroup:[]}),s=Object.entries(i.groups).map((([t,e])=>({groupName:t,betType:e})));this.groupType=[...i.noGroup,...s],this.playType=this.groupType[0].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.partialQuickpickAvailable=this.gameData.rules.partialQuickpickAvailable,this.boardsAllowed=null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.filter((t=>"Prima"===t.id))[0].boardsAllowed,this.lineMultiplier=this.boardsAllowed[0];let r=this.gameData.rules.betTypes[0].secondarySelectionRules;this.numberRange=this.gameData.rules.betTypes[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=r.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange)})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)}))}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])_c[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}gridFilledHandler(t){this.ticket=Object.assign(Object.assign({},t.detail),{drawCount:this.drawMultiplier,multiplierNum:Number(this.stakeMultiplier),multiplier:this.gameData.rules.stakeMultiplierAvailable,quickPicks:this.quickPicks,betName:this.playType.length>1?this.playType.find((t=>t.value===this.selectedPlayTypeId)).label:this.groupType[this.tabIndex].groupName}),this.ticketDone=[...this.ticketDone.slice(0,t.detail.index),!0,...this.ticketDone.slice(t.detail.index+1)],this.ticketCompleted.emit(this.ticket)}handleGridClearAllEvent(t){let e=t.detail;this.ticketDone=[...this.ticketDone.slice(0,e),!1,...this.ticketDone.slice(e+1)],this.quickPicks[e]=!1}toggleAutoSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!0,...this.ticketDone.slice(t+1)],this.autoSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!0}toggleResetSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!1,...this.ticketDone.slice(t+1)],this.resetSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!1}toggleResetAllSeletion(){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)}))}changeStake(t,e){this.stakeChange.emit({ticketId:t,stake:e})}toggleClass(){this.isCustomSelect=!this.isCustomSelect}toggleSelection(){this.isCustomSelectStake=!this.isCustomSelectStake}toggleLineSelection(){this.isCustomSelectLine=!this.isCustomSelectLine}toggleDrawSelection(){this.isCustomSelectDraw=!this.isCustomSelectDraw}setWagerPerDraw(t){this.amountInfo={value:t.value,currency:t.currency},this.isCustomSelect=!1,this.changeStake(this.ticketId,t.value)}setStakeMultiplier(t){this.stakeMultiplier=t,this.isCustomSelectStake=!1,this.multiplierChange.emit({ticketId:this.ticketId,multiplierNum:Number(t),multiplier:this.gameData.rules.stakeMultiplierAvailable})}setLineMultiplier(t){this.lineMultiplier=t,this.isCustomSelectLine=!1,this.lineMultiplierChange.emit({ticketId:this.ticketId,lineNum:t})}setDrawMultiplier(t){this.drawMultiplier=t,this.isCustomSelectDraw=!1,this.drawMultiplierChange.emit({ticketId:this.ticketId,drawCount:t})}handlePlayTypeChange(t){this.selectedPlayTypeId=t;let e=this.playType.filter((e=>e.id===t))[0];this.boardsAllowed=e.boardsAllowed,this.numberRange=e.selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=e.secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange);for(let t=0;t<this.lineMultiplier;t++)this.toggleResetSelection(t);this.betTypeChange.emit({ticketId:this.ticketId,betType:e}),this.setLineMultiplier(this.boardsAllowed[0])}render(){if(this.isLoading)return s("div",null,s("p",null,Cc("loading",this.language)));if(this.hasErrors)return s("div",null,s("p",null,Cc("error",this.language)));{const{rules:t}=this.gameData;return s("div",{class:"TicketContainer",ref:t=>this.stylingContainer=t},s("p",{class:"TicketTitle"},this.gameData.name),s("div",{class:"TicketTabs"},this.groupType.map(((t,e)=>s("div",{class:"TabButton"+(this.tabIndex==e?" Active":""),onClick:()=>this.tabIndex=e},t.groupName)))),this.playType.length>1&&s("div",null,s("label",{class:"Label"},Cc("playType",this.language),": "),s("vaadin-select",{style:{width:"160px"},items:this.playType,value:this.selectedPlayTypeId,"on-value-changed":t=>this.handlePlayTypeChange(t.detail.value)})),this.boardsAllowed.length>1&&s("div",null,s("label",{class:"Label"},Cc("lines",this.language),": "),s("div",{class:"WagerInput"},s("div",{ref:t=>this.selectLineRef=t,class:this.isCustomSelectLine?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleLineSelection()},s("span",null,this.lineMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},this.boardsAllowed.map((t=>s("li",{class:this.lineMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setLineMultiplier(t)},t)))))))),this.grids.map(((e,i)=>s("div",null,s("div",{class:"TicketGridHeader"},s("div",null,Cc("lineName",this.language),i+1),this.resetButton&&this.ticketDone[i]&&s("div",{class:"ButtonContainer"},s("a",{class:"ResetButton",onClick:()=>this.toggleResetSelection(i)},Cc("resetButton",this.language))),this.autoPick&&!this.ticketDone[i]&&s("div",{class:"ButtonContainer"},s("a",{class:"AutoButton",onClick:()=>this.toggleAutoSelection(i)},Cc("autoButton",this.language)))),s("div",{class:"TicketGridBullets"},s("p",{class:"TicketGridTitle"},t.boards[0].selectionName),s("lottery-grid",{"grid-index":i,"maximum-allowed":this.maximumAllowed,"minimum-allowed":this.minimumAllowed,"number-range":JSON.stringify(this.numberRange),"high-number":t.boards[0].highNumber,"low-number":t.boards[0].lowNumber,"total-numbers":t.boards[0].highNumber-t.boards[0].lowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"mainSelection","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),this.secondarySelectionAllowed&&s("div",{class:"SecondarySelectionWrapper"},s("div",{class:"TicketGridBullets"},s("p",{class:"TicketGridTitle"},t.boards[0].secondarySelectionName),s("lottery-grid",{"grid-index":i,"maximum-allowed":this.secondaryMaximumAllowed,"minimum-allowed":this.secondaryMinimumAllowed,"number-range":JSON.stringify(this.secondaryNumberRange),"high-number":t.boards[0].secondaryHighNumber,"low-number":t.boards[0].secondaryLowNumber,"total-numbers":t.boards[0].secondaryHighNumber-t.boards[0].secondaryLowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"secondarySelection","client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})))))),t.stakeMultiplierAvailable&&s("div",null,s("label",{class:"Label"},Cc("multiplier",this.language),": "),s("div",{class:"WagerInput"},t.stakeMultipliers.length>1?s("div",{ref:t=>this.selectStakeRef=t,class:this.isCustomSelectStake?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleSelection()},s("span",null,this.stakeMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.stakeMultipliers.map((t=>s("li",{class:this.stakeMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setStakeMultiplier(t)},t)))))):s("div",null,s("input",{min:"1",value:t.stakeMultipliers[0]||1,type:"number",disabled:!0})))),t.drawMultiplierAvailable&&s("div",null,s("label",{class:"Label"},Cc("numberOfDraws",this.language),": "),s("div",{class:"WagerInput"},t.durations.length>1?s("div",{ref:t=>this.selectDrawRef=t,class:this.isCustomSelectDraw?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleDrawSelection()},s("span",null,this.drawMultiplier),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.durations.map((t=>s("li",{class:this.drawMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setDrawMultiplier(t)},t)))))):s("div",null,s("input",{min:"1",value:t.durations[0]||1,type:"number",disabled:!0})))),s("div",null,s("label",{class:"Label"},Cc("wagerPerDraw",this.language),": "),s("div",{class:"WagerInput"},t.stakes.length>1?s("div",{ref:t=>this.selectRef=t,class:this.isCustomSelect?"SelectWrapper SelectActive":"SelectWrapper"},s("div",{class:"SelectButton",onClick:()=>this.toggleClass()},s("span",null,this.amountInfo.value," ",this.amountInfo.currency),s("span",{class:"SelectExpand"},"▼")),s("div",{class:"SelectContent"},s("ul",{class:"SelectOptions"},t.stakes.map((t=>s("li",{class:this.amountInfo.value==t.value?"SelectedValue":"",value:t.value,onClick:()=>this.setWagerPerDraw(t)},t.value," ",t.currency)))))):s("div",null,s("input",{min:"1",value:t.stakes[0].value,type:"number",disabled:!0}),s("span",{class:"WagerInputTitle"},t.stakes[0].currency)))))}}static get watchers(){return{lineMultiplier:["handleLineMultiplierChange"],tabIndex:["handleTabIndexChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Sc.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.TicketTabs{display:flex;overflow:auto}.TicketTabs .TabButton{color:var(--emw--color-primary, #009993);margin:0 40px 10px 0;cursor:pointer}.TicketTabs .Active{border-bottom:1px solid var(--emw--color-primary, #009993)}.ButtonContainer{display:flex;justify-content:flex-end}.SecondarySelectionWrapper{margin-top:20px}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:var(--emw--color-typography, #000)}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:var(--emw--color-typography, #000);padding:10px;margin-left:8px}.AutoButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-typography-inverse, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.ResetButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:var(--emw--color-error, #ff3d00);border:1px solid var(--emw--color-error, #ff3d00);color:var(--emw--color-typography-inverse, #fff)}.ResetButton:hover{background:var(--emw--color-tertiary, #ff6536);border:1px solid var(--emw--color-error, #ff3d00)}.TicketGridHeader{display:flex;justify-content:space-between;align-items:center;font-weight:bold;margin-top:10px}.TicketGridBullets{background:var(--emw--color-background-secondary, #f5f5f5);border-radius:4px;padding:20px;margin-top:5px;margin-bottom:10px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background, #009993)}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background, #009993)}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid var(--emw--color-background-tertiary, #ccc);border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid var(--emw--color-background-tertiary, #ccc);overflow:hidden;background:var(--emw--color-typography-inverse, #fff);z-index:20}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:var(--emw--color-background, #009993);color:var(--emw--color-typography-inverse, #fff)}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:var(--emw--color-background-secondary, #f5f5f5);border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:var(--emw--color-background-tertiary, #ccc);border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:var(--emw--color-background-secondary, #f5f5f5)}';const Tc=["ro","en","fr","ar","hr"],Dc={en:{ticket:"Ticket"},ro:{ticket:"Bilet"},fr:{ticket:"Billet"},ar:{ticket:"تذكرة"},hr:{ticket:"Listić"}},Ac=(t,e)=>{const i=e;return Dc[void 0!==i&&Tc.includes(i)?i:"en"][t]},Ic=class{constructor(i){t(this,i),this.deleteTicketEvent=e(this,"deleteTicket",7),this.endpoint="",this.ticketId=1,this.ticketDescription=void 0,this.gameId=void 0,this.postMessage=!1,this.eventName="deleteTicketAction",this.collapsed=!0,this.numberOfGrids=1,this.last=!1,this.language="en",this.autoPick=!1,this.resetButton=!1,this.totalControllers=1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0}helperAccordionActionHandler(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.deleteTicketEvent.emit({ticketId:this.ticketId})}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])Dc[e][i]=t[e][i]})))}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}render(){return s("div",{key:"28756fcff01b738bfe8339114445032a5da757c2",class:"LotteryTicketControllerContainer",ref:t=>this.stylingContainer=t},s("helper-accordion",{key:"18a566d1c97ccbf74cd759215df3a18faf5c43dc","header-title":`${Ac("ticket",this.language)} ${this.ticketId}`,"header-subtitle":this.ticketDescription,footer:!0,"delete-tab":1!==this.totalControllers,collapsed:!this.last||this.collapsed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},s("div",{key:"3a056f64dc8572b66f50cb151adde2caea2cd427",slot:"accordionContent"},s("lottery-ticket",{key:"06a0696b79840c05381429b1b87af94b478b09f0",endpoint:this.endpoint,"game-id":this.gameId,"ticket-id":this.ticketId,"number-of-grids":this.numberOfGrids,language:this.language,"translation-url":this.translationUrl,"reset-button":this.resetButton,"auto-pick":this.autoPick,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Ic.style=':host{font-family:"Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}';export{h as general_multi_select,u as helper_accordion,Mh as helper_filters,Ph as helper_modal,jh as helper_tab,Rh as helper_tabs,Lh as lottery_bullet,Yh as lottery_draw_results,Xh as lottery_draw_results_history,Qh as lottery_game_details,dc as lottery_game_page,uc as lottery_grid,vc as lottery_pagination,xc as lottery_subscription,Sc as lottery_ticket,Ic as lottery_ticket_controller}
|