@everymatrix/lottery-game-page 0.1.26 → 1.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/cjs/helper-accordion.cjs.entry.js +10 -2
  2. package/dist/cjs/helper-accordion.cjs.entry.js.map +1 -0
  3. package/dist/cjs/helper-filters_2.cjs.entry.js +1716 -1002
  4. package/dist/cjs/helper-filters_2.cjs.entry.js.map +1 -0
  5. package/dist/cjs/helper-modal.cjs.entry.js +2 -0
  6. package/dist/cjs/helper-modal.cjs.entry.js.map +1 -0
  7. package/dist/cjs/helper-pagination.cjs.entry.js +14 -0
  8. package/dist/cjs/helper-pagination.cjs.entry.js.map +1 -0
  9. package/dist/cjs/helper-tab.cjs.entry.js +2 -0
  10. package/dist/cjs/helper-tab.cjs.entry.js.map +1 -0
  11. package/dist/cjs/helper-tabs.cjs.entry.js +2 -0
  12. package/dist/cjs/helper-tabs.cjs.entry.js.map +1 -0
  13. package/dist/cjs/index-cd44e726.js +2 -0
  14. package/dist/cjs/index-cd44e726.js.map +1 -0
  15. package/dist/cjs/index.cjs.js +2 -0
  16. package/dist/cjs/index.cjs.js.map +1 -0
  17. package/dist/cjs/loader.cjs.js +3 -1
  18. package/dist/cjs/loader.cjs.js.map +1 -0
  19. package/dist/cjs/lottery-bullet_2.cjs.entry.js +13 -2
  20. package/dist/cjs/lottery-bullet_2.cjs.entry.js.map +1 -0
  21. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +45 -16
  22. package/dist/cjs/lottery-draw-results-history.cjs.entry.js.map +1 -0
  23. package/dist/cjs/lottery-game-details.cjs.entry.js +2 -0
  24. package/dist/cjs/lottery-game-details.cjs.entry.js.map +1 -0
  25. package/dist/cjs/lottery-game-page.cjs.entry.js +33 -27
  26. package/dist/cjs/lottery-game-page.cjs.entry.js.map +1 -0
  27. package/dist/cjs/lottery-game-page.cjs.js +3 -1
  28. package/dist/cjs/lottery-game-page.cjs.js.map +1 -0
  29. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +15 -2
  30. package/dist/cjs/lottery-ticket-controller.cjs.entry.js.map +1 -0
  31. package/dist/cjs/lottery-ticket.cjs.entry.js +29 -7
  32. package/dist/cjs/lottery-ticket.cjs.entry.js.map +1 -0
  33. package/dist/collection/components/lottery-game-page/lottery-game-page.css +10 -1
  34. package/dist/collection/components/lottery-game-page/lottery-game-page.js +83 -32
  35. package/dist/collection/components/lottery-game-page/lottery-game-page.js.map +1 -0
  36. package/dist/collection/index.js +1 -0
  37. package/dist/collection/index.js.map +1 -0
  38. package/dist/collection/utils/locale.utils.js +1 -0
  39. package/dist/collection/utils/locale.utils.js.map +1 -0
  40. package/dist/collection/utils/utils.js +1 -0
  41. package/dist/collection/utils/utils.js.map +1 -0
  42. package/dist/components/helper-accordion.js +2 -0
  43. package/dist/components/helper-accordion.js.map +1 -0
  44. package/dist/components/helper-accordion2.js +10 -2
  45. package/dist/components/helper-accordion2.js.map +1 -0
  46. package/dist/components/helper-filters.js +2 -0
  47. package/dist/components/helper-filters.js.map +1 -0
  48. package/dist/components/helper-filters2.js +1696 -974
  49. package/dist/components/helper-filters2.js.map +1 -0
  50. package/dist/components/helper-modal.js +2 -0
  51. package/dist/components/helper-modal.js.map +1 -0
  52. package/dist/components/helper-modal2.js +2 -0
  53. package/dist/components/helper-modal2.js.map +1 -0
  54. package/dist/components/helper-pagination.js +14 -0
  55. package/dist/components/helper-pagination.js.map +1 -0
  56. package/dist/components/helper-tab.js +2 -0
  57. package/dist/components/helper-tab.js.map +1 -0
  58. package/dist/components/helper-tab2.js +2 -0
  59. package/dist/components/helper-tab2.js.map +1 -0
  60. package/dist/components/helper-tabs.js +2 -0
  61. package/dist/components/helper-tabs.js.map +1 -0
  62. package/dist/components/helper-tabs2.js +2 -0
  63. package/dist/components/helper-tabs2.js.map +1 -0
  64. package/dist/components/index.js +2 -0
  65. package/dist/components/index.js.map +1 -0
  66. package/dist/components/lottery-bullet.js +2 -0
  67. package/dist/components/lottery-bullet.js.map +1 -0
  68. package/dist/components/lottery-bullet2.js +2 -0
  69. package/dist/components/lottery-bullet2.js.map +1 -0
  70. package/dist/components/lottery-draw-results-history.js +2 -0
  71. package/dist/components/lottery-draw-results-history.js.map +1 -0
  72. package/dist/components/lottery-draw-results-history2.js +46 -17
  73. package/dist/components/lottery-draw-results-history2.js.map +1 -0
  74. package/dist/components/lottery-draw-results.js +2 -0
  75. package/dist/components/lottery-draw-results.js.map +1 -0
  76. package/dist/components/lottery-draw-results2.js +95 -101
  77. package/dist/components/lottery-draw-results2.js.map +1 -0
  78. package/dist/components/lottery-game-details.js +2 -0
  79. package/dist/components/lottery-game-details.js.map +1 -0
  80. package/dist/components/lottery-game-details2.js +2 -0
  81. package/dist/components/lottery-game-details2.js.map +1 -0
  82. package/dist/components/lottery-game-page.js +35 -28
  83. package/dist/components/lottery-game-page.js.map +1 -0
  84. package/dist/components/lottery-grid.js +2 -0
  85. package/dist/components/lottery-grid.js.map +1 -0
  86. package/dist/components/lottery-grid2.js +13 -2
  87. package/dist/components/lottery-grid2.js.map +1 -0
  88. package/dist/components/lottery-ticket-controller.js +2 -0
  89. package/dist/components/lottery-ticket-controller.js.map +1 -0
  90. package/dist/components/lottery-ticket-controller2.js +30 -16
  91. package/dist/components/lottery-ticket-controller2.js.map +1 -0
  92. package/dist/components/lottery-ticket.js +2 -0
  93. package/dist/components/lottery-ticket.js.map +1 -0
  94. package/dist/components/lottery-ticket2.js +29 -7
  95. package/dist/components/lottery-ticket2.js.map +1 -0
  96. package/dist/esm/helper-accordion.entry.js +10 -2
  97. package/dist/esm/helper-accordion.entry.js.map +1 -0
  98. package/dist/esm/helper-filters_2.entry.js +1716 -1002
  99. package/dist/esm/helper-filters_2.entry.js.map +1 -0
  100. package/dist/esm/helper-modal.entry.js +2 -0
  101. package/dist/esm/helper-modal.entry.js.map +1 -0
  102. package/dist/esm/helper-pagination.entry.js +14 -0
  103. package/dist/esm/helper-pagination.entry.js.map +1 -0
  104. package/dist/esm/helper-tab.entry.js +2 -0
  105. package/dist/esm/helper-tab.entry.js.map +1 -0
  106. package/dist/esm/helper-tabs.entry.js +2 -0
  107. package/dist/esm/helper-tabs.entry.js.map +1 -0
  108. package/dist/esm/index-d1baacd4.js +2 -0
  109. package/dist/esm/index-d1baacd4.js.map +1 -0
  110. package/dist/esm/index.js +2 -0
  111. package/dist/esm/index.js.map +1 -0
  112. package/dist/esm/loader.js +3 -1
  113. package/dist/esm/loader.js.map +1 -0
  114. package/dist/esm/lottery-bullet_2.entry.js +13 -2
  115. package/dist/esm/lottery-bullet_2.entry.js.map +1 -0
  116. package/dist/esm/lottery-draw-results-history.entry.js +45 -16
  117. package/dist/esm/lottery-draw-results-history.entry.js.map +1 -0
  118. package/dist/esm/lottery-game-details.entry.js +2 -0
  119. package/dist/esm/lottery-game-details.entry.js.map +1 -0
  120. package/dist/esm/lottery-game-page.entry.js +34 -28
  121. package/dist/esm/lottery-game-page.entry.js.map +1 -0
  122. package/dist/esm/lottery-game-page.js +3 -1
  123. package/dist/esm/lottery-game-page.js.map +1 -0
  124. package/dist/esm/lottery-ticket-controller.entry.js +15 -2
  125. package/dist/esm/lottery-ticket-controller.entry.js.map +1 -0
  126. package/dist/esm/lottery-ticket.entry.js +29 -7
  127. package/dist/esm/lottery-ticket.entry.js.map +1 -0
  128. package/dist/lottery-game-page/index.esm.js +2 -0
  129. package/dist/lottery-game-page/index.esm.js.map +1 -0
  130. package/dist/lottery-game-page/lottery-game-page.esm.js +2 -1
  131. package/dist/lottery-game-page/lottery-game-page.esm.js.map +1 -0
  132. package/dist/lottery-game-page/p-042065c6.entry.js +2 -0
  133. package/dist/lottery-game-page/p-042065c6.entry.js.map +1 -0
  134. package/dist/lottery-game-page/p-15309f9a.entry.js +2 -0
  135. package/dist/lottery-game-page/p-15309f9a.entry.js.map +1 -0
  136. package/dist/lottery-game-page/p-167c9dbe.entry.js +2 -0
  137. package/dist/lottery-game-page/p-167c9dbe.entry.js.map +1 -0
  138. package/dist/lottery-game-page/p-2e78ed7b.entry.js +2 -0
  139. package/dist/lottery-game-page/p-2e78ed7b.entry.js.map +1 -0
  140. package/dist/lottery-game-page/p-5b49ab69.entry.js +2 -0
  141. package/dist/lottery-game-page/p-5b49ab69.entry.js.map +1 -0
  142. package/dist/lottery-game-page/p-606c0b0f.entry.js +2 -0
  143. package/dist/lottery-game-page/p-606c0b0f.entry.js.map +1 -0
  144. package/dist/lottery-game-page/p-662d9dac.entry.js +2 -0
  145. package/dist/lottery-game-page/p-662d9dac.entry.js.map +1 -0
  146. package/dist/lottery-game-page/p-66729e9c.entry.js +2 -0
  147. package/dist/lottery-game-page/p-66729e9c.entry.js.map +1 -0
  148. package/dist/lottery-game-page/p-76c280ec.entry.js +2 -0
  149. package/dist/lottery-game-page/p-76c280ec.entry.js.map +1 -0
  150. package/dist/lottery-game-page/p-a9ef5b8c.entry.js +2 -0
  151. package/dist/lottery-game-page/p-a9ef5b8c.entry.js.map +1 -0
  152. package/dist/lottery-game-page/p-aa68559a.entry.js +2 -0
  153. package/dist/lottery-game-page/p-aa68559a.entry.js.map +1 -0
  154. package/dist/lottery-game-page/p-d9e7b5da.entry.js +2899 -0
  155. package/dist/lottery-game-page/p-d9e7b5da.entry.js.map +1 -0
  156. package/dist/lottery-game-page/p-e765c7d9.js +2 -1
  157. package/dist/lottery-game-page/p-e765c7d9.js.map +1 -0
  158. package/dist/stencil.config.js +10 -1
  159. package/dist/stencil.config.js.map +1 -0
  160. package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +2 -0
  161. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +10 -1
  162. package/dist/types/components.d.ts +12 -2
  163. package/package.json +1 -1
  164. package/dist/components/assets/chrono_desktop.png +0 -0
  165. package/dist/components/assets/chrono_lottery_mobile.png +0 -0
  166. package/dist/lottery-game-page/p-023325a2.entry.js +0 -1
  167. package/dist/lottery-game-page/p-04fbc8fd.entry.js +0 -1
  168. package/dist/lottery-game-page/p-256b151c.entry.js +0 -1
  169. package/dist/lottery-game-page/p-381b5507.entry.js +0 -1
  170. package/dist/lottery-game-page/p-3f8b6ad9.entry.js +0 -1
  171. package/dist/lottery-game-page/p-4274053c.entry.js +0 -1
  172. package/dist/lottery-game-page/p-4f81cd37.entry.js +0 -1
  173. package/dist/lottery-game-page/p-5c389034.entry.js +0 -1
  174. package/dist/lottery-game-page/p-7d06371e.entry.js +0 -1
  175. package/dist/lottery-game-page/p-ca8430a0.entry.js +0 -2849
  176. package/dist/lottery-game-page/p-d6f76e8d.entry.js +0 -1
  177. package/dist/lottery-game-page/p-f6fcc22c.entry.js +0 -1
  178. package/dist/lottery-game-page/static/chrono_desktop.png +0 -0
  179. package/dist/lottery-game-page/static/chrono_lottery_mobile.png +0 -0
  180. package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -2
  181. /package/dist/{collection/components/lottery-game-page/static → assets}/chrono_desktop.png +0 -0
  182. /package/dist/{collection/components/lottery-game-page/static → assets}/chrono_lottery_mobile.png +0 -0
@@ -1,4 +1,4 @@
1
- import { proxyCustomElement, HTMLElement, getAssetPath, h } from '@stencil/core/internal/client';
1
+ import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h } from '@stencil/core/internal/client';
2
2
  import { d as defineCustomElement$d } from './helper-accordion2.js';
3
3
  import { d as defineCustomElement$c } from './helper-filters2.js';
4
4
  import { d as defineCustomElement$b } from './helper-modal2.js';
@@ -126,13 +126,15 @@ const isMobile = (userAgent) => {
126
126
  userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
127
127
  };
128
128
 
129
- const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#00958f;color:#fff;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{color:#00958f;background:#F1F1F1;border:1px solid #F1F1F1}.LastDrawResultsTitle{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px;text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.NextDrawWrapper{padding:10px 15px;background:#F1F1F1;background:linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%)}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;margin-top:10px;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;border-bottom:solid 1px #D4D4D4;line-height:50px}.OrderSummary .Ticket span{text-align:right}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.ButtonWrapper .Button.ButtonDisabled{pointer-events:none;background:#ccc;border:1px solid #ccc}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}";
129
+ const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column;gap:4px}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#00958f;color:#fff;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{color:#00958f;background:#F1F1F1;border:1px solid #F1F1F1}.LastDrawResultsTitle{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px;text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.NextDrawWrapper{padding:10px 15px;background:#F1F1F1;background:linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%)}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;margin-top:10px;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px;margin-left:15px}.OrderSummary .Ticket span{text-align:right}.OrderSummary hr{border:none;border-top:1px double #D4D4D4;color:#D4D4D4;width:100%}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px;margin-left:15px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.ButtonWrapper .Button.ButtonDisabled{pointer-events:none;background:#ccc;border:1px solid #ccc}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}";
130
130
 
131
131
  const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
132
132
  constructor() {
133
133
  super();
134
134
  this.__registerHost();
135
135
  this.__attachShadow();
136
+ this.goBackEvent = createEvent(this, "goBackEvent", 7);
137
+ this.goToLobbyEvent = createEvent(this, "goToLobbyEvent", 7);
136
138
  /**
137
139
  * Language of the widget
138
140
  */
@@ -169,6 +171,7 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
169
171
  this.userAgent = window.navigator.userAgent;
170
172
  this.multiplier = false;
171
173
  this.quickPick = false;
174
+ this.isMobile = isMobile(this.userAgent);
172
175
  this.setClientStyling = () => {
173
176
  let sheet = document.createElement('style');
174
177
  sheet.innerHTML = this.clientStyling;
@@ -190,9 +193,6 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
190
193
  };
191
194
  }
192
195
  // @TODO fix `any` type later, I'm lazy now
193
- handleSessionIdValue() {
194
- this.isLoggedIn = true;
195
- }
196
196
  connectedCallback() {
197
197
  this.getGameDetails();
198
198
  this.getDraws();
@@ -212,14 +212,12 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
212
212
  // end custom styling area
213
213
  }
214
214
  countdownLogic(date) {
215
- if (date) {
216
- this.interval = setInterval(() => {
217
- this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
218
- this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
219
- this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);
220
- this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);
221
- }, 1000);
222
- }
215
+ this.interval = setInterval(() => {
216
+ this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
217
+ this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
218
+ this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);
219
+ this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);
220
+ }, 1000);
223
221
  }
224
222
  disconnectedCallback() {
225
223
  clearInterval(this.interval);
@@ -236,9 +234,9 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
236
234
  })
237
235
  .then((data) => {
238
236
  this.gameData = data;
239
- this.basicStake = this.gameData.rules.stakes[0].amount;
237
+ this.basicStake = this.gameData.type.stakes[0].amount;
240
238
  let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
241
- this.nextDraw = draws[0].id;
239
+ draws.length > 0 && (this.nextDraw = draws[0].id);
242
240
  this.createNewTicket();
243
241
  })
244
242
  .catch((err) => {
@@ -247,7 +245,7 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
247
245
  });
248
246
  }
249
247
  calculateTotalAmount() {
250
- const { currency } = this.gameData.rules.stakes[0];
248
+ const { currency } = this.gameData.type.stakes[0];
251
249
  this.totalAmount = 0;
252
250
  this.tickets.forEach((item) => {
253
251
  if (item.completed) {
@@ -325,20 +323,22 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
325
323
  return response.json();
326
324
  })
327
325
  .then((data) => {
328
- var _a, _b;
326
+ var _a;
329
327
  let upcoming = data.items.filter((item) => {
330
328
  if (Date.parse(item.date) > new Date().getTime()) {
331
329
  return !item.winningNumbers;
332
330
  }
333
331
  });
334
332
  let past = data.items.filter((item) => item.winningNumbers);
335
- this.latestDraw = upcoming[0] || {};
336
- this.nextDate = (_a = this.latestDraw) === null || _a === void 0 ? void 0 : _a.date;
337
- this.countdownLogic(this.nextDate || '');
333
+ if (!upcoming[0])
334
+ return;
335
+ this.latestDraw = upcoming[0];
336
+ this.nextDate = this.latestDraw.date;
337
+ this.countdownLogic(this.nextDate);
338
338
  this.lastDrawId = past[past.length - 1].id;
339
339
  // calculate total winnings
340
340
  // @TODO fix any type
341
- (_b = this.latestDraw) === null || _b === void 0 ? void 0 : _b.prizes.forEach((element) => {
341
+ (_a = this.latestDraw) === null || _a === void 0 ? void 0 : _a.prizes.forEach((element) => {
342
342
  this.totalWinningsAmount += JSON.parse(element.amount);
343
343
  });
344
344
  })
@@ -405,6 +405,7 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
405
405
  return res.json();
406
406
  })
407
407
  .then((data) => {
408
+ // should we treat this res?
408
409
  console.log('data', data);
409
410
  })
410
411
  .catch((err) => {
@@ -412,25 +413,28 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
412
413
  });
413
414
  this.successVisible = true;
414
415
  }
416
+ goBack() {
417
+ this.goBackEvent.emit();
418
+ }
419
+ goToLobby() {
420
+ this.goToLobbyEvent.emit();
421
+ }
415
422
  render() {
416
- const backgroundSrc = getAssetPath('./static/chrono_lottery_mobile.png');
417
- const backgroundDesktopSrc = getAssetPath('./static/chrono_desktop.png');
423
+ //Get path for background image
424
+ const backgroundImagePath = getAssetPath(this.isMobile ? '/assets/chrono_lottery_mobile.png' : '/assets/chrono_desktop.png');
418
425
  if (this.hasErrors) {
419
426
  return (h("div", { class: "GamePage" }, h("div", { class: "Title" }, translate('error', this.language))));
420
427
  }
421
428
  return (
422
429
  /* Game details */
423
- h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: el => this.stylingContainer = el }, h("div", { class: "GridBanner", style: { backgroundImage: isMobile(this.userAgent) ? `url(${backgroundSrc})` : `url(${backgroundDesktopSrc})` } }, h("div", { class: "BannerButtonsWrapper" }, h("button", { class: "BannerBackButton" }, h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), h("div", { class: "NextDrawWrapper" }, h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), h("div", { class: "NextDraw" }, h("p", { class: "BannerText" }, translate('nextDraw', this.language)), h("div", { class: "BannerCountdown" }, h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
424
- h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", { "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("div", { class: "TicketsWrapper" }, this.tickets.map((item) => h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("div", { class: "CreateNewTicket" }, h("button", { onClick: () => this.createNewTicket() }, "+"), h("span", null, translate('createTicket', this.language)))), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", h("span", null, this.tickets.length)), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", h("span", null, this.totalAmount, " ", this.currency)), h("div", { class: "ButtonWrapper" }, this.isLoggedIn &&
430
+ h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: el => this.stylingContainer = el }, h("div", { class: "GridBanner", style: { 'background': `url(${this.backgroundUrl ? this.backgroundUrl : backgroundImagePath})`, 'background-size': 'contain', 'background-repeat': 'no-repeat', 'background-position': 'center' } }, h("div", { class: "BannerButtonsWrapper" }, h("button", { class: "BannerBackButton", onClick: this.goBack.bind(this) }, h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), h("button", { class: "BannerLobbyButton", onClick: this.goToLobby.bind(this) }, translate('lobbyButton', this.language))), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), h("div", { class: "NextDrawWrapper" }, h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), h("div", { class: "NextDraw" }, h("p", { class: "BannerText" }, translate('nextDraw', this.language)), h("div", { class: "BannerCountdown" }, h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
431
+ h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", { "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("div", { class: "TicketsWrapper" }, this.tickets.map((item) => h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton, "total-controllers": this.tickets.length, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("div", { class: "CreateNewTicket" }, h("button", { onClick: () => this.createNewTicket() }, "+"), h("span", null, translate('createTicket', this.language)))), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", h("span", null, this.tickets.length)), h("hr", null), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", h("span", null, this.totalAmount, " ", this.currency)), h("div", { class: "ButtonWrapper" }, this.isLoggedIn &&
425
432
  h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language)), !this.isLoggedIn &&
426
433
  h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
427
434
  h("div", null, h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)), h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }), h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { class: "DeleteTicketModalWrapper" }, h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), h("div", { class: "DeleteTicketModalButtons" }, h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
428
435
  }
429
436
  static get assetsDirs() { return ["static"]; }
430
437
  get element() { return this; }
431
- static get watchers() { return {
432
- "sessionId": ["handleSessionIdValue"]
433
- }; }
434
438
  static get style() { return lotteryGamePageCss; }
435
439
  }, [1, "lottery-game-page", {
436
440
  "endpoint": [1],
@@ -438,6 +442,7 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
438
442
  "playerId": [2, "player-id"],
439
443
  "sessionId": [1, "session-id"],
440
444
  "language": [1],
445
+ "backgroundUrl": [1, "background-url"],
441
446
  "autoPick": [4, "auto-pick"],
442
447
  "resetButton": [4, "reset-button"],
443
448
  "clientStyling": [1, "client-styling"],
@@ -540,3 +545,5 @@ const LotteryGamePage = LotteryGamePage$1;
540
545
  const defineCustomElement = defineCustomElement$1;
541
546
 
542
547
  export { LotteryGamePage, defineCustomElement };
548
+
549
+ //# sourceMappingURL=lottery-game-page.js.map
@@ -0,0 +1 @@
1
+ {"file":"lottery-game-page.js","mappings":";;;;;;;;;;;;;;AAWA,MAAM,gBAAgB,GAAS,IAAI,CAAA;AACnC,MAAM,mBAAmB,GAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC/D,MAAM,YAAY,GAAiB;EACjC,EAAE,EAAE;IACF,KAAK,EAAE,OAAO;IACd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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["LotteryGamePage"],"sources":["../../../packages/lottery-game-page/src/utils/locale.utils.ts","../../../packages/lottery-game-page/src/utils/utils.ts","../../../packages/lottery-game-page/src/components/lottery-game-page/lottery-game-page.scss?tag=lottery-game-page&encapsulation=shadow","../../../packages/lottery-game-page/src/components/lottery-game-page/lottery-game-page.tsx"],"sourcesContent":["interface Translation {\n [key: string]: string;\n}\n\ninterface Translations {\n en: Translation,\n ro: Translation,\n fr: Translation,\n ar: Translation,\n}\n\nconst DEFAULT_LANGUAGE: 'en' = 'en'\nconst SUPPORTED_LANGUAGES: string[] = ['ro', 'en', 'fr', 'ar'];\nconst TRANSLATIONS: Translations = {\n en: {\n error: 'Error',\n title: 'Chrono',\n backButton: 'Back',\n lobbyButton: 'Lobby',\n prize: 'Prize',\n winUpTo: 'Win up to',\n nextDraw: 'Next draw in: ',\n buy: 'Buy tickets',\n viewLatest: 'View latest results',\n createTicket: 'Create Ticket',\n modalSuccess: 'Purchase successfully completed!',\n deleteTicketModalTitle: 'Delete Ticket',\n deleteTicketModalText: 'Are you sure you want to delete this ticket?',\n deleteTicketModalCancel: 'Cancel',\n deleteTicketModalConfirm: 'Delete',\n orderSummaryTitle: 'Order Summary',\n orderSummaryTickets: 'Ticket',\n orderSummaryTotal: 'Total',\n orderSummarySubmit: 'Submit',\n lastDrawResultsTitle: 'Last Draw Results',\n modalLogin: 'Please login to submit a ticket',\n },\n ro: {\n error: 'Eroare',\n title: 'Loto 6/49',\n backButton: 'Inapoi',\n lobbyButton: 'Lobby',\n prize: 'MARELE JACKPOT OMG',\n winUpTo: 'Castiga pana la',\n nextDraw: 'Urmatoarea extragere:',\n buy: 'Cumpara bilet',\n viewLatest: 'Ultimile extrageri',\n createTicket: 'Creeaza bilet',\n modalSuccess: 'Achizitie efectuata cu succes',\n deleteTicketModalTitle: 'Sterge biletul',\n deleteTicketModalText: 'Esti sigur ca vrei sa stergi acest bilet?',\n deleteTicketModalCancel: 'Anuleaza',\n deleteTicketModalConfirm: 'Sterge',\n orderSummaryTitle: 'Rezumat comanda',\n orderSummaryTickets: 'Bilet',\n orderSummaryTotal: 'Total',\n orderSummarySubmit: 'Trimite',\n lastDrawResultsTitle: 'Cele mai recente extrageri',\n modalLogin: 'Please login to submit a ticket',\n },\n fr: {\n error: 'Error',\n title: 'Chrono',\n backButton: 'Back',\n lobbyButton: 'Lobby',\n prize: 'Prize',\n winUpTo: 'Win up to',\n nextDraw: 'Next draw in: ',\n buy: 'Buy tickets',\n viewLatest: 'View latest results',\n createTicket: 'Create Ticket',\n modalSuccess: 'Purchase successfully completed!',\n deleteTicketModalTitle: 'Delete Ticket',\n deleteTicketModalText: 'Are you sure you want to delete this ticket?',\n deleteTicketModalCancel: 'Cancel',\n deleteTicketModalConfirm: 'Delete',\n orderSummaryTitle: 'Order Summary',\n orderSummaryTickets: 'Ticket',\n orderSummaryTotal: 'Total',\n orderSummarySubmit: 'Submit',\n lastDrawResultsTitle: 'Résultats du dernier tirage',\n modalLogin: 'Please login to submit a ticket',\n },\n ar: {\n error: 'خطأ',\n title: 'كرونو',\n backButton: 'خلف',\n lobbyButton: 'ردهة',\n prize: 'جائزة',\n winUpTo: 'الفوز بما يصل الى',\n nextDraw: 'السحب التالي:',\n buy: 'اشتري تذاكر',\n viewLatest: 'عرض أحدث النتائج',\n createTicket: 'إنشاء تذكرة',\n modalSuccess: '!سيتم الشراء بنجاح قريبًا',\n deleteTicketModalTitle: 'حذف التذكرة',\n deleteTicketModalText: 'هل أنت متأكد أنك تريد حذف هذه التذكرة؟',\n deleteTicketModalCancel: 'يلغي',\n deleteTicketModalConfirm: 'حذف',\n orderSummaryTitle: 'ملخص الطلب',\n orderSummaryTickets: 'تذكرة',\n orderSummaryTotal: 'المجموع',\n orderSummarySubmit: 'يُقدِّم',\n lastDrawResultsTitle: 'نتائج آخر سحب',\n modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة'\n }\n};\n\nexport const translate = (key: string, customLang?): string => {\n const lang: string | undefined = customLang;\n return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];\n};\n","/**\n * @name isMobile\n * @description A method that returns if the browser used to access the app is from a mobile device or not\n * @param {String} userAgent window.navigator.userAgent\n * @returns {Boolean} true or false\n */\nexport const isMobile = (userAgent:string):boolean => {\n return !!(\n userAgent.toLowerCase().match(/android/i) ||\n userAgent.toLowerCase().match(/blackberry|bb/i) ||\n userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||\n userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)\n );\n}\n","@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap');\n\n:host {\n display: block;\n font-family: 'Roboto', sans-serif;\n}\n.GamePage {\n\n .GridBanner {\n background-color: #009993;\n background-repeat: no-repeat;\n background-position: center;\n color: #111;\n padding: 0 20px 10px;\n height: 220px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n .BannerButtonsWrapper {\n display: flex;\n justify-content: space-between;\n padding-top: 16px;\n .BannerBackButton, .BannerLobbyButton {\n background: #fff;\n border: 1px solid #D4D4D4;\n border-radius: 4px;\n padding: 7px 15px;\n font-size: 12px;\n text-transform: uppercase;\n width: 80px;\n cursor: pointer;\n }\n }\n .GridBannerArea {\n padding-top: 30px;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n\n .TotalWinnings {\n color: #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 span {\n font-size: 18px;\n font-weight: 700;\n }\n }\n .NextDraw {\n color: #00958f;\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 .BannerText {\n font-weight: 400;\n font-size: 18px;\n text-transform: uppercase;\n padding: 0;\n margin: 15px 0 0 0;\n }\n\n .BannerCountdown {\n font-size: 22px;\n color: #00958f;\n display: flex;\n gap: 20px;\n }\n }\n\n .Tabs {\n display: flex;\n justify-content: center;\n gap: 10px;\n\n .TabButton {\n border-radius: 4px;\n cursor: pointer;\n padding: 8px 0;\n width: 50%;\n max-width: 200px;\n border: 1px solid #00958f;\n background: #00958f;\n color:#fff;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n\n &.Active {\n color: #00958f;\n background: #F1F1F1;\n border: 1px solid #F1F1F1;\n }\n }\n }\n}\n\n.LastDrawResultsTitle {\n color: #009993;\n padding: 25px 0 10px 0;\n text-align: center;\n 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: #F1F1F1;\n background: linear-gradient(0deg, rgba(241,241,241,1) 0%, rgba(253,187,45,0) 100%);\n .BannerText {\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n }\n\n .BannerCountdown {\n font-size: 22px;\n display: flex;\n gap: 8px;\n color: #009993;\n font-weight: bolder;\n justify-content: center;\n }\n}\n\n.GamePageContent {\n padding: 15px;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.GameDetails {\n padding-bottom: 10px;\n margin-bottom: 20px;\n}\n\n.CreateNewTicket {\n background: #004D4A;\n height: 100px;\n width: 100%;\n display: flex;\n margin-top: 10px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n\n button {\n cursor: pointer;\n display: inline-block;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n margin: 5px;\n border: 1px solid #FFF;\n background: #FFF;\n color: #004D4A;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n\n &:hover {\n background: #F1F1F1;\n }\n }\n\n span {\n display: inline-block;\n font-size:12px;\n text-align: center;\n margin: 0 auto;\n color: #FFF;\n }\n}\n\n.OrderSummary {\n min-width: 200px;\n border-radius: 4px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n background: #fff;\n\n .OrderSummaryTitle {\n font-size: 16px;\n color: #009993;\n text-transform: uppercase;\n text-align: center;\n }\n\n .Ticket {\n display: inline-block;\n color: #000;\n font-size:14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n\n span {\n text-align: right;\n }\n }\n\n hr {\n border: none;\n border-top: 1px double #D4D4D4;\n color: #D4D4D4;\n width: 100%;\n }\n\n .Total {\n display: inline-block;\n color: #000;\n font-size:14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n\n span {\n text-align: right;\n }\n }\n}\n\n.ButtonWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n\n .Button {\n cursor: pointer;\n 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: #009993;\n border: 1px solid #009993;\n color: #FFF;\n &:hover {\n background: #00ABA4;\n }\n &.ButtonDisabled {\n pointer-events: none;\n background: #ccc;\n border: 1px solid #ccc;\n }\n }\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 .DeleteTicketModalTitle {\n font-size: 16px;\n color: #00958f;\n font-weight: 400;\n text-transform: uppercase;\n margin: 20px 0 40px;\n }\n .DeleteTicketModalText {\n font-size: 14px;\n color: #000;\n line-height: 22px;\n margin-bottom: 40px;\n }\n .DeleteTicketModalButtons {\n display: flex;\n gap: 10px;\n justify-content: center;\n .DeleteTicketModalConfirm {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 25px;\n width: max-content;\n margin: 5px;\n color: #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: #FF3D00;\n border: 1px solid #FF3D00;\n color: #FFF;\n &:hover {\n background: #FF6536;\n border: 1px solid #FF3D00;\n }\n }\n .DeleteTicketModalCancel {\n cursor: pointer;\n width: max-content;\n border-radius: 4px;\n padding: 10px 25px;\n margin: 5px;\n border: 1px solid #00958f;\n background: #FFF;\n color: #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 &:hover {\n background: #F1F1F1;\n }\n }\n }\n}\n\n@media (min-width: 1200px) {\n .GamePageContent {\n .TicketsWrapper {\n float: left;\n width: 49%;\n }\n .GameDetails {\n float: right;\n width: 49%;\n }\n .OrderSummary {\n float: right;\n width: 49%;\n }\n }\n}\n","import { Component, h, Prop, State, Listen, Element, EventEmitter, Event, getAssetPath } from '@stencil/core';\nimport { translate } from '../../utils/locale.utils';\nimport { isMobile } from \"../../utils/utils\";\n\nimport '@everymatrix/lottery-ticket-controller';\nimport '@everymatrix/helper-modal';\nimport '@everymatrix/lottery-game-details';\nimport '@everymatrix/lottery-draw-results-history';\nimport '@everymatrix/lottery-draw-results';\n\n@Component({\n tag: 'lottery-game-page',\n styleUrl: 'lottery-game-page.scss',\n shadow: true,\n assetsDirs: ['static']\n})\nexport class LotteryGamePage {\n /**\n * Endpoint URL for the source of data\n */\n @Prop() endpoint: string;\n /**\n * GameID of the lottery game\n */\n @Prop() gameId: string;\n /**\n * Player ID\n */\n @Prop() playerId: number;\n /**\n * GIC Session\n */\n @Prop() sessionId: string;\n /**\n * Language of the widget\n */\n @Prop() language: string = 'en';\n /**\n * Url for banner's custom background image \n */\n @Prop() backgroundUrl: string;\n /**\n * Shows the auto-pick button\n */\n @Prop() autoPick: boolean = false;\n /**\n * Shows the reset button\n */\n @Prop() resetButton: boolean = false;\n /**\n * Client custom styling via string\n */\n @Prop() clientStyling:string = '';\n /**\n * Client custom styling via url\n */\n @Prop() clientStylingurl:string = '';\n\n @State() clientStylingUrlContent:string = '';\n @State() tickets: Array<any> = [];\n @State() tabIndex: number = 0;\n @State() hasErrors: boolean = false;\n @State() totalAmount: number = 0;\n @State() successVisible: boolean = false;\n @State() deleteVisible: boolean = false;\n @State() deleteEventData: any;\n\n @State() private daysRemaining: number;\n @State() private hoursRemaining: number;\n @State() private minutesRemaining: number;\n @State() private secondsRemaining: number;\n @State() private latestDraw:any = {};\n @State() private totalWinningsAmount:number = 0;\n @State() private nextDate:string;\n @State() private isLoggedIn:boolean = false;\n @State() private loginModalVisible:boolean = false;\n @State() private limitStylingAppends:boolean = false;\n @Element() element: HTMLElement;\n\n @Event({bubbles: true, composed: true}) goBackEvent: EventEmitter<string>;\n @Event({bubbles: true, composed: true}) goToLobbyEvent: EventEmitter<string>;\n\n // @TODO fix any type\n private userAgent:string = window.navigator.userAgent;\n\n private stylingContainer:HTMLElement;\n private basicStake: number;\n private multiplier: boolean = false;\n private quickPick: boolean = false;\n private nextDraw: string;\n private lastDrawId: string;\n\n private currency: string;\n private gameData:any;\n private interval:any;\n private isMobile:boolean = isMobile(this.userAgent);\n // @TODO fix `any` type later, I'm lazy now\n\n connectedCallback(): void {\n this.getGameDetails();\n this.getDraws();\n\n if (this.sessionId) {\n this.isLoggedIn = true;\n }\n }\n\n componentDidRender(): void {\n // start custom styling area\n if(!this.limitStylingAppends && this.stylingContainer) {\n if(this.clientStyling) this.setClientStyling();\n if(this.clientStylingurl) this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n\n countdownLogic(date:any):void {\n this.interval = setInterval(() => {\n this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));\n this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);\n this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);\n this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);\n }, 1000);\n }\n\n disconnectedCallback(): void {\n clearInterval(this.interval);\n }\n\n getGameDetails(): void {\n let url:URL = new URL(`${this.endpoint}/games/${this.gameId}`);\n\n fetch(url.href)\n .then((res:any) => {\n if (res.status >= 300) {\n this.hasErrors = true;\n throw new Error('There was an error while fetching the data');\n }\n\n return res.json();\n })\n .then((data:any) => {\n this.gameData = data;\n this.basicStake = this.gameData.type.stakes[0].amount;\n\n let draws = this.gameData.draws.filter((item) => !item.winningNumbers);\n draws.length > 0 && (this.nextDraw = draws[0].id);\n this.createNewTicket();\n })\n .catch((err:any) => {\n this.hasErrors = true;\n console.log('Error', err);\n });\n }\n\n calculateTotalAmount(): void {\n const { currency } = this.gameData.type.stakes[0];\n\n this.totalAmount = 0;\n\n this.tickets.forEach((item:any) => {\n if (item.completed) {\n this.totalAmount += item.amount * item.stake;\n }\n });\n this.currency = currency;\n }\n\n // @TODO CustomEvent type\n @Listen('ticketCompleted')\n gridFilledHandler(event: CustomEvent<any>): void {\n // @TODO item ts\n this.tickets = this.tickets.map((item:any) => {\n if (item.ticketId == event.detail.id) {\n let arr = item.selectedNumbers || [];\n arr[event.detail.index] = event.detail.selectedNumbers.map((item:string) => parseInt(item, 10));\n\n return {\n gameId: item.gameId,\n ticketId: item.ticketId,\n completed: true,\n amount: event.detail.draws,\n stake: item.stake,\n selectedNumbers: arr\n };\n }\n\n return item;\n });\n\n this.calculateTotalAmount();\n }\n\n @Listen('gridDirty')\n // @TODO fix any type\n gridDirtyHandler(event: CustomEvent<any>) {\n // @TODO item ts\n this.tickets = this.tickets.map((item:any) => {\n if (item.gameId == event.detail.id) {\n return {\n gameId: item.gameId,\n ticketId: item.ticketId,\n completed: false,\n amount: item.amount,\n stake: item.stake,\n grids: []\n };\n }\n\n return item;\n });\n }\n\n // @TODO CustomEvent type\n @Listen('deleteTicket')\n deleteTicketHandler(event: CustomEvent<any>): void {\n this.deleteVisible = true;\n this.deleteEventData = event;\n }\n\n @Listen('modalCloseEvent')\n modalCloseEvent(): void {\n this.deleteVisible = false;\n this.loginModalVisible = false;\n }\n\n @Listen('stakeChange')\n stakeChangeHandler(event:any): void {\n const { ticketId, stake } = event.detail;\n this.tickets[ticketId - 1].stake = stake;\n this.calculateTotalAmount();\n }\n\n @Listen('multiplierChange')\n multiplierChangeHandler(event:CustomEvent<any>): void {\n this.multiplier = event.detail;\n }\n\n getDraws(): void {\n // append from query param with the current date value in order to get the next draw\n let url:URL = new URL(`${this.endpoint}/games/${this.gameId}/draws`);\n\n let drawOptions = {\n method: \"GET\",\n headers: {\n 'Content-Type': \"application/json\",\n 'Accept': 'application/json',\n },\n };\n\n fetch( url.href , drawOptions )\n .then((response:any) => {\n return response.json();\n })\n .then((data:any) => {\n let upcoming:Array<any> = data.items.filter((item:any) => {\n if(Date.parse(item.date) > new Date().getTime()) {\n return !item.winningNumbers;\n }\n });\n\n let past:Array<any> = data.items.filter((item:any) => item.winningNumbers);\n if (!upcoming[0]) return;\n\n this.latestDraw = upcoming[0];\n this.nextDate = this.latestDraw.date;\n this.countdownLogic(this.nextDate);\n\n this.lastDrawId = past[past.length - 1].id;\n // calculate total winnings\n // @TODO fix any type\n this.latestDraw?.prizes.forEach((element:any) => {\n this.totalWinningsAmount += JSON.parse(element.amount);\n });\n })\n .catch((err:any) => {\n console.log('error ', err);\n });\n };\n\n // @TODO fix any type\n confirmDeleteTicketHandler(event:any): void {\n // @TODO fix any type\n this.tickets = this.tickets.filter((item:any) => {\n if (item.ticketId == event.detail.ticketId) {\n return false;\n }\n\n return true;\n });\n\n this.calculateTotalAmount();\n this.deleteVisible = false;\n }\n\n createNewTicket(): void {\n this.tickets = [\n ...this.tickets,\n { gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }\n ];\n }\n\n showLoginModal(): void {\n this.loginModalVisible = true;\n }\n\n submitTickets(): void {\n let url:URL = new URL(`${this.endpoint}/tickets`);\n\n // @TODO Body TS type\n let body:any = {\n gameId: this.gameId,\n tickets: []\n }\n\n this.tickets.forEach((item:any) => {\n body.tickets.push({\n startingDrawId: this.nextDraw,\n amount: item.stake,\n gameId: this.gameId,\n currency: this.currency,\n selection: item.selectedNumbers,\n multiplier: this.multiplier,\n drawCount: item.amount,\n quickPick: this.quickPick,\n })\n });\n \n // @TODO Options TS type\n let options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'Authorization': `Bearer ${this.sessionId}`\n },\n body: JSON.stringify(body)\n };\n\n fetch(url.href, options)\n .then((res:any) => {\n if (res.status > 300) {\n throw new Error('err');\n }\n\n return res.json();\n })\n .then((data:any) => {\n // should we treat this res?\n console.log('data', data)\n })\n .catch((err:any) => {\n console.log('error ', err);\n });\n\n this.successVisible = true;\n }\n\n goBack() {\n this.goBackEvent.emit();\n }\n\n goToLobby() {\n this.goToLobbyEvent.emit();\n }\n\n setClientStyling = ():void => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n }\n\n setClientStylingURL = ():void => {\n\n let url:URL = new URL(this.clientStylingurl);\n let cssFile:HTMLElement = document.createElement('style');\n \n fetch(url.href)\n .then((res:any) => res.text())\n .then((data:any) => {\n this.clientStylingUrlContent = data;\n cssFile.innerHTML = data;\n setTimeout(() => { this.stylingContainer.prepend(cssFile) }, 1);\n })\n .catch((err:any) => {\n console.log('error ', err);\n });\n }\n\n render(): void {\n //Get path for background image\n const backgroundImagePath = getAssetPath(this.isMobile ? '/assets/chrono_lottery_mobile.png' : '/assets/chrono_desktop.png');\n\n if (this.hasErrors) {\n return (\n <div class=\"GamePage\">\n <div class=\"Title\">{translate('error', this.language)}</div>\n </div>\n )\n }\n\n return (\n /* Game details */\n <div class=\"GamePage\" dir={this.language == 'ar' ? 'rtl' : 'ltr'} ref={el => this.stylingContainer = el as HTMLInputElement}>\n <div class=\"GridBanner\" style={{ 'background': `url(${ this.backgroundUrl ? this.backgroundUrl : backgroundImagePath})` , 'background-size': 'contain' , 'background-repeat': 'no-repeat', 'background-position': 'center' }}>\n <div class=\"BannerButtonsWrapper\">\n <button class=\"BannerBackButton\" onClick={this.goBack.bind(this)}><span class=\"BannerBackButtonArrow\">&#5176; </span>{translate('backButton', this.language)}</button>\n <button class=\"BannerLobbyButton\" onClick={this.goToLobby.bind(this)}>{translate('lobbyButton', this.language)}</button>\n </div>\n <div class=\"Tabs\">\n <div class={'TabButton' + (this.tabIndex == 0 ? ' Active' : '')}\n onClick={() => this.tabIndex = 0}>{translate('buy', this.language)}</div>\n <div class={'TabButton' + (this.tabIndex == 1 ? ' Active' : '')}\n onClick={() => this.tabIndex = 1}>{translate('viewLatest', this.language)}</div>\n </div>\n </div>\n <div class=\"NextDrawWrapper\">\n <div class=\"TotalWinnings\">{translate('winUpTo', this.language)}: <span>${this.totalWinningsAmount.toLocaleString('en-US', {maximumFractionDigits:2})}</span></div>\n <div class=\"NextDraw\">\n <p class=\"BannerText\">{translate('nextDraw', this.language)}</p>\n <div class=\"BannerCountdown\">\n <span class=\"CountdownDays\">{this.daysRemaining}D</span>\n <span class=\"CountdownHours\">{this.hoursRemaining}H</span>\n <span class=\"CountdownMinutes\">{this.minutesRemaining}M</span>\n <span class=\"CountdownSeconds\">{this.secondsRemaining}S</span>\n </div>\n </div>\n </div>\n {this.tabIndex == 0 &&\n <div class=\"GamePageContent\">\n <div class=\"GameDetails\">\n <lottery-game-details\n client-styling={this.clientStyling}\n client-styling-url-content={this.clientStylingUrlContent}>\n </lottery-game-details>\n </div>\n <div class=\"TicketsWrapper\">\n {this.tickets.map((item) =>\n <lottery-ticket-controller\n endpoint={this.endpoint}\n ticket-id={item.ticketId}\n game-id={item.gameId}\n collapsed={false}\n last={true}\n language={this.language}\n auto-pick={this.autoPick}\n reset-button={this.resetButton}\n total-controllers={this.tickets.length}\n client-styling={this.clientStyling}\n client-styling-url-content={this.clientStylingUrlContent}>\n </lottery-ticket-controller>\n )}\n <div class=\"CreateNewTicket\">\n <button onClick={() => this.createNewTicket()}>+</button>\n <span>{translate('createTicket', this.language)}</span>\n </div>\n </div>\n <div class=\"OrderSummary\">\n <h3 class=\"OrderSummaryTitle\">{translate('orderSummaryTitle', this.language)}</h3>\n <div class=\"Ticket\">{translate('orderSummaryTickets', this.language)}: <span>{this.tickets.length}</span></div>\n <hr />\n <div class=\"Total\">{translate('orderSummaryTotal', this.language)}: <span>{this.totalAmount} {this.currency}</span></div>\n <div class=\"ButtonWrapper\">\n {this.isLoggedIn && \n <span class=\"Button\" onClick={() => this.submitTickets()}>{translate('orderSummarySubmit', this.language)}</span>\n }\n {!this.isLoggedIn &&\n <div>\n <span class=\"Button\" onClick={() => this.showLoginModal()}>{translate('orderSummarySubmit', this.language)}</span>\n <helper-modal\n title-modal=\"Success\"\n visible={this.loginModalVisible}\n client-styling={this.clientStyling}\n client-styling-url-content={this.clientStylingUrlContent}>\n <p class=\"SubmitModalSuccess\">{translate('modalLogin', this.language)}</p>\n </helper-modal>\n </div>\n }\n </div>\n </div>\n </div>\n }\n {this.tabIndex == 1 &&\n <div>\n <h4 class=\"LastDrawResultsTitle\">{translate('lastDrawResultsTitle', this.language)}</h4>\n <lottery-draw-results \n endpoint={this.endpoint}\n game-id={this.gameId}\n language={this.language}\n draw-id={this.lastDrawId}\n draw-mode={true}\n client-styling={this.clientStyling}\n client-styling-url-content={this.clientStylingUrlContent}>\n </lottery-draw-results>\n <lottery-draw-results-history\n endpoint={this.endpoint}\n game-id={this.gameId}\n language={this.language}\n client-styling={this.clientStyling}\n client-styling-url-content={this.clientStylingUrlContent}>\n </lottery-draw-results-history>\n </div>}\n <helper-modal\n title-modal=\"Success\"\n visible={this.successVisible}\n client-styling={this.clientStyling}\n client-styling-url-content={this.clientStylingUrlContent}>\n <p class=\"SubmitModalSuccess\">{translate('modalSuccess', this.language)}</p>\n </helper-modal>\n <helper-modal\n title-modal=\"Delete Ticket\"\n visible={this.deleteVisible}\n client-styling={this.clientStyling}\n client-styling-url-content={this.clientStylingUrlContent}>\n <div class=\"DeleteTicketModalWrapper\">\n <h3 class=\"DeleteTicketModalTitle\">{translate('deleteTicketModalTitle', this.language)}</h3>\n <p class=\"DeleteTicketModalText\">{translate('deleteTicketModalText', this.language)}</p>\n <div class=\"DeleteTicketModalButtons\">\n <button class=\"DeleteTicketModalCancel\" onClick={() => this.modalCloseEvent()}>{translate('deleteTicketModalCancel', this.language)}</button>\n <button class=\"DeleteTicketModalConfirm\" onClick={() => this.confirmDeleteTicketHandler(this.deleteEventData)}>{translate('deleteTicketModalConfirm', this.language)}</button>\n </div>\n </div>\n </helper-modal>\n </div>\n );\n }\n}\n"],"version":3}
@@ -4,3 +4,5 @@ const LotteryGrid = LotteryGrid$1;
4
4
  const defineCustomElement = defineCustomElement$1;
5
5
 
6
6
  export { LotteryGrid, defineCustomElement };
7
+
8
+ //# sourceMappingURL=lottery-grid.js.map
@@ -0,0 +1 @@
1
+ {"file":"lottery-grid.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -104,6 +104,15 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
104
104
  }
105
105
  // end custom styling area
106
106
  }
107
+ // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
108
+ shuffleArray(array) {
109
+ const result = [];
110
+ while (array.length > 0) {
111
+ const randomIndex = Math.floor(Math.random() * (array.length));
112
+ result.push(array.splice(randomIndex, 1)[0]);
113
+ }
114
+ return result;
115
+ }
107
116
  lotteryBulletSelectionHandler(event) {
108
117
  this.numbers = this.numbers.map((item) => {
109
118
  if (item.number == event.detail.value) {
@@ -175,8 +184,8 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
175
184
  if (event.detail && event.detail == this.ticketId) {
176
185
  this.resetSelectionHandler(event);
177
186
  let array = [...Array(this.totalNumbers).keys()]
178
- .map(number => number + 1)
179
- .sort(() => 0.5 - Math.random());
187
+ .map(number => number + 1);
188
+ array = this.shuffleArray(array);
180
189
  array = array.slice(0, this.minimumAllowed);
181
190
  this.numbers = this.numbers.map((item) => {
182
191
  return {
@@ -235,3 +244,5 @@ function defineCustomElement() {
235
244
  defineCustomElement();
236
245
 
237
246
  export { LotteryGrid as L, defineCustomElement as d };
247
+
248
+ //# sourceMappingURL=lottery-grid2.js.map
@@ -0,0 +1 @@
1
+ {"file":"lottery-grid2.js","mappings":";;;AAAA,MAAM,cAAc,GAAG,mUAAmU;;MCG7U,WAAW;EACtB;;;;;;;;;IAIE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;;;;IAItB,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;;;;IAIxB,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;;;;IAIxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;;;;IAIvB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;;;;IAI1B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;;;;IAI7B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;;;;IAIrB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;;;;IAInB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;;;;IAIxB,IAAI,CAAC,uBAAuB,GAAG,EAAE,CAAC;IAClC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IAClB,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACjC,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;IACzB,IAAI,CAAC,gBAAgB,GAAG;MACtB,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;MAC5C,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC;MACrC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KACtC,CAAC;IACF,IAAI,CAAC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,EAAE,4BAA4B,EAAE,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;GACnN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../lottery-grid/dist/collection/components/lottery-grid/lottery-grid.css?tag=lottery-grid&encapsulation=shadow","../lottery-grid/dist/collection/components/lottery-grid/lottery-grid.js"],"sourcesContent":["@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.GridContainer {\n display: flex;\n flex-direction: column;\n max-width: 1200px;\n}\n\n.Grid {\n margin-top: 10px 0 10px 0;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 20px;\n}\n.Grid.TicketGrid {\n gap: 5px;\n}","import { Component, h, Prop, Listen, State, Event } from '@stencil/core';\n// import { translate } from '../../utils/locale.utils';\nimport '@everymatrix/lottery-bullet';\nexport class LotteryGrid {\n constructor() {\n /**\n * Number of bullets of grid\n */\n this.totalNumbers = 0;\n /**\n * Number of maximum bullets that can be selected\n */\n this.maximumAllowed = 0;\n /**\n * Minimum allowed of bullets\n */\n this.minimumAllowed = 1;\n /**\n * Allows the user to select numbers on the grid\n */\n this.selectable = true;\n /**\n * Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')\n */\n this.selectedNumbers = '';\n /**\n * Show only selected numbers\n */\n this.displaySelected = false;\n /**\n * Language\n */\n this.language = 'en';\n /**\n * Personalize grid for ticket\n */\n this.gridType = '';\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.numbers = [];\n this.limitStylingAppends = false;\n this.selectedCounter = 0;\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n connectedCallback() {\n let selected = [];\n if (this.selectedNumbers.length > 0) {\n selected = this.selectedNumbers.split(',');\n this.selectedCounter = selected.length;\n }\n if (this.displaySelected) {\n selected.forEach((item) => {\n this.numbers.push({\n number: item,\n selected: true,\n selectable: this.selectable\n });\n });\n }\n else {\n [...Array(this.totalNumbers).keys()]\n .map(number => (number + 1).toString())\n .forEach((number) => {\n this.numbers.push({\n number,\n selected: selected.indexOf(number) >= 0 ? true : false,\n selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable\n });\n });\n }\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices\n shuffleArray(array) {\n const result = [];\n while (array.length > 0) {\n const randomIndex = Math.floor(Math.random() * (array.length));\n result.push(array.splice(randomIndex, 1)[0]);\n }\n return result;\n }\n lotteryBulletSelectionHandler(event) {\n this.numbers = this.numbers.map((item) => {\n if (item.number == event.detail.value) {\n return {\n number: item.number,\n selected: event.detail.selected,\n selectable: item.selectable\n };\n }\n return {\n number: item.number,\n selected: item.selected,\n selectable: item.selectable\n };\n });\n if (event.detail.selected) {\n this.selectedCounter += 1;\n if (this.selectedCounter == this.maximumAllowed) {\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: item.selected,\n selectable: item.selected ? true : false\n };\n });\n this.gridFilledEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n }\n }\n else {\n if (this.selectedCounter == this.maximumAllowed) {\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: item.selected,\n selectable: true\n };\n });\n this.gridDirtyEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n }\n this.selectedCounter -= 1;\n }\n }\n async resetSelectionHandler(event) {\n if (event.detail && event.detail == this.ticketId) {\n this.selectedCounter = 0;\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: false,\n selectable: this.selectable\n };\n });\n this.gridDirtyEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n }\n }\n async autoSelectionHandler(event) {\n if (event.detail && event.detail == this.ticketId) {\n this.resetSelectionHandler(event);\n let array = [...Array(this.totalNumbers).keys()]\n .map(number => number + 1);\n array = this.shuffleArray(array);\n array = array.slice(0, this.minimumAllowed);\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,\n selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,\n };\n });\n this.gridFilledEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n this.selectedCounter = this.maximumAllowed;\n }\n }\n render() {\n return (h(\"div\", { class: \"GridContainer\", ref: el => this.stylingContainer = el },\n h(\"div\", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h(\"div\", null,\n h(\"lottery-bullet\", { value: item.number, selectable: item.selectable, \"is-selected\": item.selected, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent }))))));\n }\n static get is() { return \"lottery-grid\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"lottery-grid.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"lottery-grid.css\"]\n }; }\n static get properties() { return {\n \"ticketId\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Identifier for the ticket\"\n },\n \"attribute\": \"ticket-id\",\n \"reflect\": false\n },\n \"totalNumbers\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of bullets of grid\"\n },\n \"attribute\": \"total-numbers\",\n \"reflect\": false,\n \"defaultValue\": \"0\"\n },\n \"gameId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Game ID\"\n },\n \"attribute\": \"game-id\",\n \"reflect\": false\n },\n \"maximumAllowed\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of maximum bullets that can be selected\"\n },\n \"attribute\": \"maximum-allowed\",\n \"reflect\": false,\n \"defaultValue\": \"0\"\n },\n \"minimumAllowed\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Minimum allowed of bullets\"\n },\n \"attribute\": \"minimum-allowed\",\n \"reflect\": false,\n \"defaultValue\": \"1\"\n },\n \"selectable\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Allows the user to select numbers on the grid\"\n },\n \"attribute\": \"selectable\",\n \"reflect\": false,\n \"defaultValue\": \"true\"\n },\n \"selectedNumbers\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')\"\n },\n \"attribute\": \"selected-numbers\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n },\n \"displaySelected\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Show only selected numbers\"\n },\n \"attribute\": \"display-selected\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": false,\n \"defaultValue\": \"'en'\"\n },\n \"gridIndex\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The index of the number\"\n },\n \"attribute\": \"grid-index\",\n \"reflect\": false\n },\n \"gridType\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Personalize grid for ticket\"\n },\n \"attribute\": \"grid-type\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n },\n \"clientStyling\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": false,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"numbers\": {},\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"gridFilledEvent\",\n \"name\": \"gridFilled\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"When the grid is completed, it emits this event with selected numbers\"\n },\n \"complexType\": {\n \"original\": \"GridEvent\",\n \"resolved\": \"GridEvent\",\n \"references\": {\n \"GridEvent\": {\n \"location\": \"import\",\n \"path\": \"./lottery-grid.types\"\n }\n }\n }\n }, {\n \"method\": \"gridDirtyEvent\",\n \"name\": \"gridDirty\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"When the grid is uncomplete after being completed once (reset or change), it emits this event\"\n },\n \"complexType\": {\n \"original\": \"GridEvent\",\n \"resolved\": \"GridEvent\",\n \"references\": {\n \"GridEvent\": {\n \"location\": \"import\",\n \"path\": \"./lottery-grid.types\"\n }\n }\n }\n }]; }\n static get listeners() { return [{\n \"name\": \"lotteryBulletSelection\",\n \"method\": \"lotteryBulletSelectionHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"resetSelection\",\n \"method\": \"resetSelectionHandler\",\n \"target\": \"document\",\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"autoSelection\",\n \"method\": \"autoSelectionHandler\",\n \"target\": \"document\",\n \"capture\": false,\n \"passive\": false\n }]; }\n}\n"],"version":3}
@@ -4,3 +4,5 @@ const LotteryTicketController = LotteryTicketController$1;
4
4
  const defineCustomElement = defineCustomElement$1;
5
5
 
6
6
  export { LotteryTicketController, defineCustomElement };
7
+
8
+ //# sourceMappingURL=lottery-ticket-controller.js.map
@@ -0,0 +1 @@
1
+ {"file":"lottery-ticket-controller.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -5,7 +5,7 @@ import { d as defineCustomElement$2 } from './lottery-grid2.js';
5
5
  import { d as defineCustomElement$1 } from './lottery-ticket2.js';
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
- const SUPPORTED_LANGUAGES = ['ro', 'en'];
8
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
9
9
  const TRANSLATIONS = {
10
10
  en: {
11
11
  ticket: 'Ticket',
@@ -13,6 +13,12 @@ const TRANSLATIONS = {
13
13
  ro: {
14
14
  ticket: 'Bilet',
15
15
  },
16
+ fr: {
17
+ ticket: 'Billet'
18
+ },
19
+ ar: {
20
+ ticket: 'تذكرة',
21
+ }
16
22
  };
17
23
  const translate = (key, customLang) => {
18
24
  const lang = customLang;
@@ -67,6 +73,10 @@ const LotteryTicketController = /*@__PURE__*/ proxyCustomElement(class extends H
67
73
  * Shows the reset button
68
74
  */
69
75
  this.resetButton = false;
76
+ /**
77
+ * Number of ticket controllers
78
+ */
79
+ this.totalControllers = 1;
70
80
  /**
71
81
  * Client custom styling via string
72
82
  */
@@ -110,24 +120,26 @@ const LotteryTicketController = /*@__PURE__*/ proxyCustomElement(class extends H
110
120
  // end custom styling area
111
121
  }
112
122
  render() {
113
- return (h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, h("helper-accordion", { "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, 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, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
123
+ console.log('ticket id:', this.ticketId);
124
+ return (h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, h("helper-accordion", { "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": this.totalControllers !== 1, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, 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, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
114
125
  }
115
126
  static get style() { return lotteryTicketControllerCss; }
116
127
  }, [1, "lottery-ticket-controller", {
117
- "endpoint": [1],
118
- "ticketId": [2, "ticket-id"],
119
- "ticketDescription": [1, "ticket-description"],
120
- "gameId": [1, "game-id"],
121
- "postMessage": [4, "post-message"],
122
- "eventName": [1, "event-name"],
123
- "collapsed": [4],
124
- "numberOfGrids": [2, "number-of-grids"],
125
- "last": [4],
126
- "language": [1],
127
- "autoPick": [4, "auto-pick"],
128
- "resetButton": [4, "reset-button"],
129
- "clientStyling": [1, "client-styling"],
130
- "clientStylingUrlContent": [1, "client-styling-url-content"],
128
+ "endpoint": [513],
129
+ "ticketId": [514, "ticket-id"],
130
+ "ticketDescription": [513, "ticket-description"],
131
+ "gameId": [513, "game-id"],
132
+ "postMessage": [516, "post-message"],
133
+ "eventName": [513, "event-name"],
134
+ "collapsed": [516],
135
+ "numberOfGrids": [514, "number-of-grids"],
136
+ "last": [516],
137
+ "language": [513],
138
+ "autoPick": [516, "auto-pick"],
139
+ "resetButton": [516, "reset-button"],
140
+ "totalControllers": [514, "total-controllers"],
141
+ "clientStyling": [513, "client-styling"],
142
+ "clientStylingUrlContent": [513, "client-styling-url-content"],
131
143
  "limitStylingAppends": [32]
132
144
  }, [[0, "helperAccordionAction", "helperAccordionActionHandler"]]]);
133
145
  function defineCustomElement() {
@@ -166,3 +178,5 @@ function defineCustomElement() {
166
178
  defineCustomElement();
167
179
 
168
180
  export { LotteryTicketController as L, defineCustomElement as d };
181
+
182
+ //# sourceMappingURL=lottery-ticket-controller2.js.map
@@ -0,0 +1 @@
1
+ {"file":"lottery-ticket-controller2.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACrD,MAAM,YAAY,GAAG;AACrB,EAAE,EAAE,EAAE;AACN,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,MAAM,EAAE,OAAO;AACnB,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,MAAM,EAAE,OAAO;AACnB,GAAG;AACH,CAAC,CAAC;AACK,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,UAAU,KAAK;AAC9C,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC;AAC1B,EAAE,OAAO,YAAY,CAAC,IAAI,KAAK,SAAS,IAAI,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,gBAAgB,CAAC,C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E,4BAA4B,EAAE,IAAI,CAAC,uBAAuB,EAAE,EACxW,CAAC,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,EACnC,CAAC,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,CAAC,aAAa,EAAE,4BAA4B,EAAE,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;GAChV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../lottery-ticket-controller/dist/collection/utils/locale.utils.js","../lottery-ticket-controller/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.css?tag=lottery-ticket-controller&encapsulation=shadow","../lottery-ticket-controller/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.js"],"sourcesContent":["const DEFAULT_LANGUAGE = 'en';\nconst SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];\nconst TRANSLATIONS = {\n en: {\n ticket: 'Ticket',\n },\n ro: {\n ticket: 'Bilet',\n },\n fr: {\n ticket: 'Billet'\n },\n ar: {\n ticket: 'تذكرة',\n }\n};\nexport const translate = (key, customLang) => {\n const lang = customLang;\n return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];\n};\n",":host {\n display: block;\n}","import { Component, h, Listen, Prop, Event, State } from '@stencil/core';\nimport '@everymatrix/helper-accordion';\nimport '@everymatrix/lottery-ticket';\nimport { translate } from '../../utils/locale.utils';\nexport class LotteryTicketController {\n constructor() {\n /**\n * Endpoint URL for the source of data (NorWAy standard)\n */\n this.endpoint = '';\n /**\n * Ticket number\n */\n this.ticketId = 1;\n /**\n * Activates postMessages as events for actions from the widget\n */\n this.postMessage = false;\n /**\n * Name of the event emitter by the action button\n */\n this.eventName = 'deleteTicketAction';\n /**\n * Collapsed\n */\n this.collapsed = true;\n /**\n * Number of grids?\n */\n this.numberOfGrids = 1;\n /**\n * This toggles if the last ticket added should be expanded or not\n */\n this.last = false;\n /**\n * Language\n */\n this.language = 'en';\n /**\n * Shows the auto-pick button\n */\n this.autoPick = false;\n /**\n * Shows the reset button\n */\n this.resetButton = false;\n /**\n * Number of ticket controllers\n */\n this.totalControllers = 1;\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.limitStylingAppends = false;\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n // @TODO fix the `any` type\n helperAccordionActionHandler() {\n if (this.postMessage) {\n window.postMessage({ type: this.eventName }, window.location.href);\n }\n this.deleteTicketEvent.emit({\n ticketId: this.ticketId\n });\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n render() {\n console.log('ticket id:', this.ticketId);\n return (h(\"div\", { class: \"LotteryTicketControllerContainer\", ref: el => this.stylingContainer = el },\n h(\"helper-accordion\", { \"header-title\": `${translate('ticket', this.language)} ${this.ticketId}`, \"header-subtitle\": this.ticketDescription, footer: true, \"delete-tab\": this.totalControllers !== 1, collapsed: !this.last || this.collapsed, language: this.language, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent },\n h(\"div\", { slot: \"accordionContent\" },\n 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, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent })))));\n }\n static get is() { return \"lottery-ticket-controller\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"lottery-ticket-controller.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"lottery-ticket-controller.css\"]\n }; }\n static get properties() { return {\n \"endpoint\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Endpoint URL for the source of data (NorWAy standard)\"\n },\n \"attribute\": \"endpoint\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"ticketId\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Ticket number\"\n },\n \"attribute\": \"ticket-id\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"ticketDescription\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Ticket header description\"\n },\n \"attribute\": \"ticket-description\",\n \"reflect\": true\n },\n \"gameId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"ID of the lottery game\"\n },\n \"attribute\": \"game-id\",\n \"reflect\": true\n },\n \"postMessage\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Activates postMessages as events for actions from the widget\"\n },\n \"attribute\": \"post-message\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"eventName\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Name of the event emitter by the action button\"\n },\n \"attribute\": \"event-name\",\n \"reflect\": true,\n \"defaultValue\": \"'deleteTicketAction'\"\n },\n \"collapsed\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Collapsed\"\n },\n \"attribute\": \"collapsed\",\n \"reflect\": true,\n \"defaultValue\": \"true\"\n },\n \"numberOfGrids\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of grids?\"\n },\n \"attribute\": \"number-of-grids\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"last\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"This toggles if the last ticket added should be expanded or not\"\n },\n \"attribute\": \"last\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": true,\n \"defaultValue\": \"'en'\"\n },\n \"autoPick\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Shows the auto-pick button\"\n },\n \"attribute\": \"auto-pick\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"resetButton\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Shows the reset button\"\n },\n \"attribute\": \"reset-button\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"totalControllers\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of ticket controllers\"\n },\n \"attribute\": \"total-controllers\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"clientStyling\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"deleteTicketEvent\",\n \"name\": \"deleteTicket\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n }\n }]; }\n static get listeners() { return [{\n \"name\": \"helperAccordionAction\",\n \"method\": \"helperAccordionActionHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }]; }\n}\n"],"version":3}
@@ -4,3 +4,5 @@ const LotteryTicket = LotteryTicket$1;
4
4
  const defineCustomElement = defineCustomElement$1;
5
5
 
6
6
  export { LotteryTicket, defineCustomElement };
7
+
8
+ //# sourceMappingURL=lottery-ticket.js.map
@@ -0,0 +1 @@
1
+ {"file":"lottery-ticket.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}