@everymatrix/lottery-ticket-controller 0.1.1 → 0.1.2
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/helper-accordion_5.cjs.entry.js +487 -0
- package/dist/cjs/{index-4814ed9d.js → index-c560cdc6.js} +38 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-ticket-controller.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +18 -0
- package/dist/components/helper-accordion2.js +2 -7
- package/dist/components/lottery-bullet.js +6 -0
- package/dist/components/lottery-bullet2.js +56 -0
- package/dist/components/lottery-grid.js +6 -0
- package/dist/components/lottery-grid2.js +196 -0
- package/dist/components/lottery-ticket-controller.js +20 -3
- package/dist/components/lottery-ticket.js +6 -0
- package/dist/components/lottery-ticket2.js +183 -0
- package/dist/esm/helper-accordion_5.entry.js +479 -0
- package/dist/esm/{index-116c3025.js → index-0b72e6e4.js} +38 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-ticket-controller.js +2 -2
- package/dist/lottery-ticket-controller/lottery-ticket-controller.esm.js +1 -1
- package/dist/lottery-ticket-controller/p-62871984.entry.js +1 -0
- package/dist/lottery-ticket-controller/p-e0a7e661.js +1 -0
- package/package.json +1 -1
- package/dist/cjs/helper-accordion_2.cjs.entry.js +0 -156
- package/dist/esm/helper-accordion_2.entry.js +0 -151
- package/dist/lottery-ticket-controller/p-b4ec0994.js +0 -1
- package/dist/lottery-ticket-controller/p-efb11dcf.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},c=e=>Promise.resolve(e),r=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=(e,t,n)=>{n&&n.map((([n,l,s])=>{const c=a(e,n),r=u(t,s),i=f(n);o.ael(c,l,r,i),(t.o=t.o||[]).push((()=>o.rel(c,l,r,i)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){J(e)}},a=(e,t)=>4&t?s:e,f=e=>0!=(2&e),h=new WeakMap,y=e=>"sc-"+e.h,$={},d=e=>"object"==(e=typeof e)||"function"===e,m=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!d(l))&&(l+=""),s&&o?c[c.length-1].$+=l:c.push(s?p(null,l):l),o=s)};if(r(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=p(e,null);return i.m=t,c.length>0&&(i.p=c),i},p=(e,t)=>({t:0,S:e,$:t,g:null,p:null,m:null}),b={},w=(e,t,n,s,c,r)=>{if(n!==s){let i=I(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=g(n),o=g(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(i||"o"!==t[0]||"n"!==t[1]){const l=d(s);if((i||l&&null!==s)&&!c)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||c)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):I(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},S=/\s/,g=e=>e?e.split(S):[],j=(e,t,n,l)=>{const s=11===t.g.nodeType&&t.g.host?t.g.host:t.g,o=e&&e.m||$,c=t.m||$;for(l in o)l in c||w(s,l,o[l],void 0,n,t.t);for(l in c)w(s,l,o[l],c[l],n,t.t)},v=(t,n,l)=>{let o,c,r=n.p[l],i=0;if(null!==r.$)o=r.g=s.createTextNode(r.$);else if(o=r.g=s.createElement(r.S),j(null,r,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),r.p)for(i=0;i<r.p.length;++i)c=v(t,r,i),c&&o.appendChild(c);return o},k=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=v(null,l,o),r&&(s[o].g=r,i.insertBefore(r,n)))},M=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.g.remove()},C=(e,t)=>e.S===t.S,O=(e,t)=>{const n=t.g=e.g,l=e.p,s=t.p,o=t.$;null===o?("slot"===t.S||j(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],h=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==h?h=l[--a]:C(i,f)?(O(i,f),i=t[++o],f=l[++c]):C(u,h)?(O(u,h),u=t[--r],h=l[--a]):C(i,h)?(O(i,h),e.insertBefore(i.g,u.g.nextSibling),i=t[++o],h=l[--a]):C(u,f)?(O(u,f),e.insertBefore(u.g,i.g),u=t[--r],f=l[++c]):(s=v(t&&t[c],n,c),f=l[++c],s&&i.g.parentNode.insertBefore(s,i.g));o>r?k(e,null==l[a+1]?null:l[a+1].g,n,l,c,a):c>a&&M(t,o,r)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),k(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.$!==o&&(n.data=o)},P=(e,t,n)=>{const l=(e=>B(e).j)(e);return{emit:e=>x(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},x=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},E=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},N=(e,t)=>{if(e.t|=16,!(4&e.t))return E(e,e.k),se((()=>T(e,t)));e.t|=512},T=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>U(n,e,t))),e.u=null)),W(void 0,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.j,l=t.t,o=((e,t)=>{let n=y(t),l=X.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=h.get(e=e.head||e);o||h.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);F(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>L(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},F=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.C||p(null,null),c=(e=>e&&e.S===b)(l)?l:m(null,null,l);t=s.tagName,c.S=null,c.t|=4,n.C=c,c.g=o.g=s.shadowRoot||s,e=s["s-sc"],O(o,c)})(n,l)}catch(e){J(e,n.j)}return null},L=e=>{const t=e.j,n=e.k;64&e.t||(e.t|=64,q(t),e.O(t),n||R()),e.v&&(e.v(),e.v=void 0),512&e.t&&le((()=>N(e,!1))),e.t&=-517},R=()=>{q(s.documentElement),le((()=>x(l,"appload",{detail:{namespace:"lottery-ticket-controller"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){J(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),q=e=>e.classList.add("hydrated"),H=(e,t,n)=>{if(t.P){e.watchers&&(t.N=e.watchers);const l=Object.entries(t.P),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>B(this).T.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=B(e),o=s.j,c=s.T.get(t),r=s.t,i=s.i;if(n=((e,t)=>null==e||d(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.P[t][0]),(!(8&r)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(s.T.set(t,n),i)){if(l.N&&128&r){const e=l.N[t];e&&e.map((e=>{try{i[e](n,c,t)}catch(e){J(e,o)}}))}2==(18&r)&&N(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},V=e=>{U(e,"connectedCallback")},_=(e,t={})=>{const n=[],c=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),h=s.createElement("style"),$=[];let d,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],P:t[2],A:t[3]};l.P=t[2],l.A=t[3],l.N={};const s=l.h,a=class extends HTMLElement{constructor(e){super(e),G(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),m?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=B(e),n=t.M,l=()=>{};if(1&t.t)i(e,t,n.A),V(t.i);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){E(t,t.k=n);break}}n.P&&Object.entries(n.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Q(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.N=s.watchers,H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){J(e)}t.t&=-9,t.t|=128,e(),V(t.i)}if(s.style){let e=s.style;const t=y(n);if(!X.has(t)){const l=()=>{};((e,t,n)=>{let l=X.get(e);r&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.k,c=()=>N(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=B(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return B(this).F}};l.L=e[0],c.includes(s)||u.get(s)||(n.push(s),u.define(s,H(a,l,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),a.insertBefore(h,f?f.nextSibling:a.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>d=setTimeout(R,30)))},z=new WeakMap,B=e=>z.get(e),D=(e,t)=>z.set(t.i=e,t),G=(e,t)=>{const n={t:0,j:e,M:t,T:new Map};return n.F=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],i(e,n,t.A),z.set(e,n)},I=(e,t)=>t in e,J=(e,t)=>(0,console.error)(e,t),K=new Map,Q=e=>{const t=e.h.replace(/-/g,"_"),n=e.L,l=K.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(K.set(n,e),e[t])),J)},X=new Map,Y=[],Z=[],ee=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?le(ne):o.raf(ne))},te=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){J(e)}e.length=0},ne=()=>{te(Y),te(Z),(n=Y.length>0)&&o.raf(ne)},le=e=>c().then(e),se=ee(Z,!0);export{_ as b,P as c,m as h,c as p,D as r}
|
package/package.json
CHANGED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-4814ed9d.js');
|
|
6
|
-
require('@everymatrix/lottery-ticket');
|
|
7
|
-
|
|
8
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
9
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
10
|
-
const TRANSLATIONS = {
|
|
11
|
-
en: {
|
|
12
|
-
deleteTicket: 'Delete ticket'
|
|
13
|
-
},
|
|
14
|
-
ro: {
|
|
15
|
-
deleteTicket: 'Sterge biletul'
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
const translate = (key, customLang) => {
|
|
19
|
-
const lang = customLang;
|
|
20
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:4px 4px 0 0;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
|
|
24
|
-
|
|
25
|
-
const Accordion = class {
|
|
26
|
-
constructor(hostRef) {
|
|
27
|
-
index.registerInstance(this, hostRef);
|
|
28
|
-
this.accordionEvent = index.createEvent(this, "helperAccordionAction", 7);
|
|
29
|
-
/**
|
|
30
|
-
* Flag for ticket history
|
|
31
|
-
*/
|
|
32
|
-
this.ticketHistoryFlag = false;
|
|
33
|
-
/**
|
|
34
|
-
* Title (top header)
|
|
35
|
-
*/
|
|
36
|
-
this.headerTitle = '';
|
|
37
|
-
/**
|
|
38
|
-
* SubTitle (top header)
|
|
39
|
-
*/
|
|
40
|
-
this.headerSubtitle = '';
|
|
41
|
-
/**
|
|
42
|
-
* Description
|
|
43
|
-
*/
|
|
44
|
-
this.description = '';
|
|
45
|
-
/**
|
|
46
|
-
* Enables footer content
|
|
47
|
-
*/
|
|
48
|
-
this.footer = false;
|
|
49
|
-
/**
|
|
50
|
-
* Enables footer button for tab deletion
|
|
51
|
-
*/
|
|
52
|
-
this.deleteTab = false;
|
|
53
|
-
/**
|
|
54
|
-
* Activates postMessages as events for actions from the widget
|
|
55
|
-
*/
|
|
56
|
-
this.postMessage = false;
|
|
57
|
-
/**
|
|
58
|
-
* Name of the event emitter by the action button
|
|
59
|
-
*/
|
|
60
|
-
this.eventName = 'helperAccordionAction';
|
|
61
|
-
/**
|
|
62
|
-
* Collapsed
|
|
63
|
-
*/
|
|
64
|
-
this.collapsed = true;
|
|
65
|
-
/**
|
|
66
|
-
* Language
|
|
67
|
-
*/
|
|
68
|
-
this.language = 'en';
|
|
69
|
-
}
|
|
70
|
-
// @TODO fix the `any` type :)
|
|
71
|
-
connectedCallback() {
|
|
72
|
-
this.showContent = !this.collapsed;
|
|
73
|
-
}
|
|
74
|
-
toggleContent() {
|
|
75
|
-
this.showContent = !this.showContent;
|
|
76
|
-
}
|
|
77
|
-
deleteAction() {
|
|
78
|
-
if (this.postMessage) {
|
|
79
|
-
// @TODO maybe change the name type, this one sucks
|
|
80
|
-
window.postMessage({ type: this.eventName }, window.location.href);
|
|
81
|
-
}
|
|
82
|
-
this.accordionEvent.emit();
|
|
83
|
-
}
|
|
84
|
-
render() {
|
|
85
|
-
return (index.h("div", { class: "Wrapper" }, index.h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, index.h("p", { class: "Title" }, this.headerTitle), index.h("p", { class: "Subtitle" }, this.headerSubtitle), index.h("p", { class: "Subtitle" }, this.description), index.h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
|
|
86
|
-
index.h("div", null, index.h("div", { class: "Content" }, index.h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
87
|
-
index.h("div", null, this.deleteTab &&
|
|
88
|
-
index.h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
Accordion.style = helperAccordionCss;
|
|
92
|
-
|
|
93
|
-
const lotteryTicketControllerCss = ":host{display:block}";
|
|
94
|
-
|
|
95
|
-
const LotteryTicketController = class {
|
|
96
|
-
constructor(hostRef) {
|
|
97
|
-
index.registerInstance(this, hostRef);
|
|
98
|
-
this.deleteTicketEvent = index.createEvent(this, "deleteTicket", 7);
|
|
99
|
-
/**
|
|
100
|
-
* Endpoint URL for the source of data (NorWAy standard)
|
|
101
|
-
*/
|
|
102
|
-
this.endpoint = '';
|
|
103
|
-
/**
|
|
104
|
-
* Ticket number
|
|
105
|
-
*/
|
|
106
|
-
this.ticketId = 1;
|
|
107
|
-
/**
|
|
108
|
-
* Activates postMessages as events for actions from the widget
|
|
109
|
-
*/
|
|
110
|
-
this.postMessage = false;
|
|
111
|
-
/**
|
|
112
|
-
* Name of the event emitter by the action button
|
|
113
|
-
*/
|
|
114
|
-
this.eventName = 'deleteTicketAction';
|
|
115
|
-
/**
|
|
116
|
-
* Collapsed
|
|
117
|
-
*/
|
|
118
|
-
this.collapsed = true;
|
|
119
|
-
/**
|
|
120
|
-
* Number of grids?
|
|
121
|
-
*/
|
|
122
|
-
this.numberOfGrids = 1;
|
|
123
|
-
/**
|
|
124
|
-
* This toggles if the last ticket added should be expanded or not
|
|
125
|
-
*/
|
|
126
|
-
this.last = false;
|
|
127
|
-
/**
|
|
128
|
-
* Language
|
|
129
|
-
*/
|
|
130
|
-
this.language = 'en';
|
|
131
|
-
/**
|
|
132
|
-
* Shows the auto-pick button
|
|
133
|
-
*/
|
|
134
|
-
this.autoPick = false;
|
|
135
|
-
/**
|
|
136
|
-
* Shows the reset button
|
|
137
|
-
*/
|
|
138
|
-
this.resetButton = false;
|
|
139
|
-
}
|
|
140
|
-
// @TODO fix the `any` type
|
|
141
|
-
helperAccordionActionHandler() {
|
|
142
|
-
if (this.postMessage) {
|
|
143
|
-
window.postMessage({ type: this.eventName }, window.location.href);
|
|
144
|
-
}
|
|
145
|
-
this.deleteTicketEvent.emit({
|
|
146
|
-
ticketId: this.ticketId
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
render() {
|
|
150
|
-
return (index.h("div", null, index.h("helper-accordion", { "header-title": 'Ticket ' + this.ticketId, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language }, index.h("div", { slot: "accordionContent" }, index.h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick })))));
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
LotteryTicketController.style = lotteryTicketControllerCss;
|
|
154
|
-
|
|
155
|
-
exports.helper_accordion = Accordion;
|
|
156
|
-
exports.lottery_ticket_controller = LotteryTicketController;
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-116c3025.js';
|
|
2
|
-
import '@everymatrix/lottery-ticket';
|
|
3
|
-
|
|
4
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
5
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
6
|
-
const TRANSLATIONS = {
|
|
7
|
-
en: {
|
|
8
|
-
deleteTicket: 'Delete ticket'
|
|
9
|
-
},
|
|
10
|
-
ro: {
|
|
11
|
-
deleteTicket: 'Sterge biletul'
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
const translate = (key, customLang) => {
|
|
15
|
-
const lang = customLang;
|
|
16
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:4px 4px 0 0;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
|
|
20
|
-
|
|
21
|
-
const Accordion = class {
|
|
22
|
-
constructor(hostRef) {
|
|
23
|
-
registerInstance(this, hostRef);
|
|
24
|
-
this.accordionEvent = createEvent(this, "helperAccordionAction", 7);
|
|
25
|
-
/**
|
|
26
|
-
* Flag for ticket history
|
|
27
|
-
*/
|
|
28
|
-
this.ticketHistoryFlag = false;
|
|
29
|
-
/**
|
|
30
|
-
* Title (top header)
|
|
31
|
-
*/
|
|
32
|
-
this.headerTitle = '';
|
|
33
|
-
/**
|
|
34
|
-
* SubTitle (top header)
|
|
35
|
-
*/
|
|
36
|
-
this.headerSubtitle = '';
|
|
37
|
-
/**
|
|
38
|
-
* Description
|
|
39
|
-
*/
|
|
40
|
-
this.description = '';
|
|
41
|
-
/**
|
|
42
|
-
* Enables footer content
|
|
43
|
-
*/
|
|
44
|
-
this.footer = false;
|
|
45
|
-
/**
|
|
46
|
-
* Enables footer button for tab deletion
|
|
47
|
-
*/
|
|
48
|
-
this.deleteTab = false;
|
|
49
|
-
/**
|
|
50
|
-
* Activates postMessages as events for actions from the widget
|
|
51
|
-
*/
|
|
52
|
-
this.postMessage = false;
|
|
53
|
-
/**
|
|
54
|
-
* Name of the event emitter by the action button
|
|
55
|
-
*/
|
|
56
|
-
this.eventName = 'helperAccordionAction';
|
|
57
|
-
/**
|
|
58
|
-
* Collapsed
|
|
59
|
-
*/
|
|
60
|
-
this.collapsed = true;
|
|
61
|
-
/**
|
|
62
|
-
* Language
|
|
63
|
-
*/
|
|
64
|
-
this.language = 'en';
|
|
65
|
-
}
|
|
66
|
-
// @TODO fix the `any` type :)
|
|
67
|
-
connectedCallback() {
|
|
68
|
-
this.showContent = !this.collapsed;
|
|
69
|
-
}
|
|
70
|
-
toggleContent() {
|
|
71
|
-
this.showContent = !this.showContent;
|
|
72
|
-
}
|
|
73
|
-
deleteAction() {
|
|
74
|
-
if (this.postMessage) {
|
|
75
|
-
// @TODO maybe change the name type, this one sucks
|
|
76
|
-
window.postMessage({ type: this.eventName }, window.location.href);
|
|
77
|
-
}
|
|
78
|
-
this.accordionEvent.emit();
|
|
79
|
-
}
|
|
80
|
-
render() {
|
|
81
|
-
return (h("div", { class: "Wrapper" }, h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, h("p", { class: "Title" }, this.headerTitle), h("p", { class: "Subtitle" }, this.headerSubtitle), h("p", { class: "Subtitle" }, this.description), h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
|
|
82
|
-
h("div", null, h("div", { class: "Content" }, h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
83
|
-
h("div", null, this.deleteTab &&
|
|
84
|
-
h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
Accordion.style = helperAccordionCss;
|
|
88
|
-
|
|
89
|
-
const lotteryTicketControllerCss = ":host{display:block}";
|
|
90
|
-
|
|
91
|
-
const LotteryTicketController = class {
|
|
92
|
-
constructor(hostRef) {
|
|
93
|
-
registerInstance(this, hostRef);
|
|
94
|
-
this.deleteTicketEvent = createEvent(this, "deleteTicket", 7);
|
|
95
|
-
/**
|
|
96
|
-
* Endpoint URL for the source of data (NorWAy standard)
|
|
97
|
-
*/
|
|
98
|
-
this.endpoint = '';
|
|
99
|
-
/**
|
|
100
|
-
* Ticket number
|
|
101
|
-
*/
|
|
102
|
-
this.ticketId = 1;
|
|
103
|
-
/**
|
|
104
|
-
* Activates postMessages as events for actions from the widget
|
|
105
|
-
*/
|
|
106
|
-
this.postMessage = false;
|
|
107
|
-
/**
|
|
108
|
-
* Name of the event emitter by the action button
|
|
109
|
-
*/
|
|
110
|
-
this.eventName = 'deleteTicketAction';
|
|
111
|
-
/**
|
|
112
|
-
* Collapsed
|
|
113
|
-
*/
|
|
114
|
-
this.collapsed = true;
|
|
115
|
-
/**
|
|
116
|
-
* Number of grids?
|
|
117
|
-
*/
|
|
118
|
-
this.numberOfGrids = 1;
|
|
119
|
-
/**
|
|
120
|
-
* This toggles if the last ticket added should be expanded or not
|
|
121
|
-
*/
|
|
122
|
-
this.last = false;
|
|
123
|
-
/**
|
|
124
|
-
* Language
|
|
125
|
-
*/
|
|
126
|
-
this.language = 'en';
|
|
127
|
-
/**
|
|
128
|
-
* Shows the auto-pick button
|
|
129
|
-
*/
|
|
130
|
-
this.autoPick = false;
|
|
131
|
-
/**
|
|
132
|
-
* Shows the reset button
|
|
133
|
-
*/
|
|
134
|
-
this.resetButton = false;
|
|
135
|
-
}
|
|
136
|
-
// @TODO fix the `any` type
|
|
137
|
-
helperAccordionActionHandler() {
|
|
138
|
-
if (this.postMessage) {
|
|
139
|
-
window.postMessage({ type: this.eventName }, window.location.href);
|
|
140
|
-
}
|
|
141
|
-
this.deleteTicketEvent.emit({
|
|
142
|
-
ticketId: this.ticketId
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
render() {
|
|
146
|
-
return (h("div", null, h("helper-accordion", { "header-title": 'Ticket ' + this.ticketId, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language }, h("div", { slot: "accordionContent" }, h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick })))));
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
LotteryTicketController.style = lotteryTicketControllerCss;
|
|
150
|
-
|
|
151
|
-
export { Accordion as helper_accordion, LotteryTicketController as lottery_ticket_controller };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},c=e=>Promise.resolve(e),r=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=(e,t,n)=>{n&&n.map((([n,l,s])=>{const c=e,r=u(t,s),i=a(n);o.ael(c,l,r,i),(t.o=t.o||[]).push((()=>o.rel(c,l,r,i)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){I(e)}},a=e=>0!=(2&e),f=new WeakMap,h=e=>"sc-"+e.h,$={},d=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!d(l))&&(l+=""),s&&o?c[c.length-1].$+=l:c.push(s?m(null,l):l),o=s)};if(r(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=m(e,null);return i.m=t,c.length>0&&(i.p=c),i},m=(e,t)=>({t:0,S:e,$:t,g:null,p:null,m:null}),p={},b=(e,t,n,s,c,r)=>{if(n!==s){let i=G(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=S(n),o=S(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(i||"o"!==t[0]||"n"!==t[1]){const l=d(s);if((i||l&&null!==s)&&!c)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||c)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):G(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},w=/\s/,S=e=>e?e.split(w):[],g=(e,t,n,l)=>{const s=11===t.g.nodeType&&t.g.host?t.g.host:t.g,o=e&&e.m||$,c=t.m||$;for(l in o)l in c||b(s,l,o[l],void 0,n,t.t);for(l in c)b(s,l,o[l],c[l],n,t.t)},j=(t,n,l)=>{let o,c,r=n.p[l],i=0;if(null!==r.$)o=r.g=s.createTextNode(r.$);else if(o=r.g=s.createElement(r.S),g(null,r,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),r.p)for(i=0;i<r.p.length;++i)c=j(t,r,i),c&&o.appendChild(c);return o},v=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=j(null,l,o),r&&(s[o].g=r,i.insertBefore(r,n)))},k=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.g.remove()},M=(e,t)=>e.S===t.S,C=(e,t)=>{const n=t.g=e.g,l=e.p,s=t.p,o=t.$;null===o?("slot"===t.S||g(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],h=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==h?h=l[--a]:M(i,f)?(C(i,f),i=t[++o],f=l[++c]):M(u,h)?(C(u,h),u=t[--r],h=l[--a]):M(i,h)?(C(i,h),e.insertBefore(i.g,u.g.nextSibling),i=t[++o],h=l[--a]):M(u,f)?(C(u,f),e.insertBefore(u.g,i.g),u=t[--r],f=l[++c]):(s=j(t&&t[c],n,c),f=l[++c],s&&i.g.parentNode.insertBefore(s,i.g));o>r?v(e,null==l[a+1]?null:l[a+1].g,n,l,c,a):c>a&&k(t,o,r)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&k(l,0,l.length-1)):e.$!==o&&(n.data=o)},O=(e,t,n)=>{const l=(e=>z(e).j)(e);return{emit:e=>P(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},P=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},x=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},E=(e,t)=>{if(e.t|=16,!(4&e.t))return x(e,e.k),le((()=>N(e,t)));e.t|=512},N=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>R(n,e,t))),e.u=null)),U(void 0,(()=>T(e,n,t)))},T=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.j,l=t.t,o=((e,t)=>{let n=h(t),l=Q.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=f.get(e=e.head||e);o||f.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);A(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>F(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},A=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.C||m(null,null),c=(e=>e&&e.S===p)(l)?l:y(null,null,l);t=s.tagName,c.S=null,c.t|=4,n.C=c,c.g=o.g=s.shadowRoot||s,e=s["s-sc"],C(o,c)})(n,l)}catch(e){I(e,n.j)}return null},F=e=>{const t=e.j,n=e.k;64&e.t||(e.t|=64,W(t),e.O(t),n||L()),e.v&&(e.v(),e.v=void 0),512&e.t&&ne((()=>E(e,!1))),e.t&=-517},L=()=>{W(s.documentElement),ne((()=>P(l,"appload",{detail:{namespace:"lottery-ticket-controller"}})))},R=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){I(e)}},U=(e,t)=>e&&e.then?e.then(t):t(),W=e=>e.classList.add("hydrated"),q=(e,t,n)=>{if(t.P){const l=Object.entries(t.P),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>z(this).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=z(e),o=s.N.get(t),c=s.t,r=s.i;n=((e,t)=>null==e||d(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.P[t][0]),8&c&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.N.set(t,n),r&&2==(18&c)&&E(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},H=e=>{R(e,"connectedCallback")},V=(e,t={})=>{const n=[],c=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),$=s.createElement("style"),d=[];let y,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],P:t[2],T:t[3]};l.P=t[2],l.T=t[3];const s=l.h,a=class extends HTMLElement{constructor(e){super(e),D(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),m?d.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=z(e),n=t.M,l=()=>{};if(1&t.t)i(e,t,n.T),H(t.i);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){x(t,t.k=n);break}}n.P&&Object.entries(n.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=K(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(q(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){I(e)}t.t&=-9,e(),H(t.i)}if(s.style){let e=s.style;const t=h(n);if(!Q.has(t)){const l=()=>{};((e,t,n)=>{let l=Q.get(e);r&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,Q.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.k,c=()=>E(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=z(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return z(this).A}};l.F=e[0],c.includes(s)||u.get(s)||(n.push(s),u.define(s,q(a,l,1)))}))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),a.insertBefore($,f?f.nextSibling:a.firstChild),m=!1,d.length?d.map((e=>e.connectedCallback())):o.jmp((()=>y=setTimeout(L,30)))},_=new WeakMap,z=e=>_.get(e),B=(e,t)=>_.set(t.i=e,t),D=(e,t)=>{const n={t:0,j:e,M:t,N:new Map};return n.A=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],i(e,n,t.T),_.set(e,n)},G=(e,t)=>t in e,I=(e,t)=>(0,console.error)(e,t),J=new Map,K=e=>{const t=e.h.replace(/-/g,"_"),n=e.F,l=J.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(J.set(n,e),e[t])),I)},Q=new Map,X=[],Y=[],Z=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?ne(te):o.raf(te))},ee=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){I(e)}e.length=0},te=()=>{ee(X),ee(Y),(n=X.length>0)&&o.raf(te)},ne=e=>c().then(e),le=Z(Y,!0);export{V as b,O as c,y as h,c as p,B as r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-b4ec0994.js";import"@everymatrix/lottery-ticket";const s=["ro","en"],o={en:{deleteTicket:"Delete ticket"},ro:{deleteTicket:"Sterge biletul"}},r=class{constructor(i){t(this,i),this.accordionEvent=e(this,"helperAccordionAction",7),this.ticketHistoryFlag=!1,this.headerTitle="",this.headerSubtitle="",this.description="",this.footer=!1,this.deleteTab=!1,this.postMessage=!1,this.eventName="helperAccordionAction",this.collapsed=!0,this.language="en"}connectedCallback(){this.showContent=!this.collapsed}toggleContent(){this.showContent=!this.showContent}deleteAction(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.accordionEvent.emit()}render(){return i("div",{class:"Wrapper"},i("div",{class:!0===this.ticketHistoryFlag?"HeaderTicketHistory":"Header"},i("p",{class:"Title"},this.headerTitle),i("p",{class:"Subtitle"},this.headerSubtitle),i("p",{class:"Subtitle"},this.description),i("span",{class:"Expand",onClick:()=>this.toggleContent()},this.showContent?"<":">")),this.showContent&&i("div",null,i("div",{class:"Content"},i("slot",{name:"accordionContent"}),this.footer&&this.showContent&&i("div",null,this.deleteTab&&i("span",{class:"ActionButton",onClick:()=>this.deleteAction()},(()=>{const t=this.language;return o[void 0!==t&&s.includes(t)?t:"en"].deleteTicket})())))))}};r.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Header{border-radius:4px 4px 0 0;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}';const n=class{constructor(i){t(this,i),this.deleteTicketEvent=e(this,"deleteTicket",7),this.endpoint="",this.ticketId=1,this.postMessage=!1,this.eventName="deleteTicketAction",this.collapsed=!0,this.numberOfGrids=1,this.last=!1,this.language="en",this.autoPick=!1,this.resetButton=!1}helperAccordionActionHandler(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.deleteTicketEvent.emit({ticketId:this.ticketId})}render(){return i("div",null,i("helper-accordion",{"header-title":"Ticket "+this.ticketId,"header-subtitle":this.ticketDescription,footer:!0,"delete-tab":!0,collapsed:!this.last||this.collapsed,language:this.language},i("div",{slot:"accordionContent"},i("lottery-ticket",{endpoint:this.endpoint,"game-id":this.gameId,"ticket-id":this.ticketId,"number-of-grids":this.numberOfGrids,language:this.language,"reset-button":this.resetButton,"auto-pick":this.autoPick}))))}};n.style=":host{display:block}";export{r as helper_accordion,n as lottery_ticket_controller}
|