lido-player 0.0.2-alpha-49 → 0.0.2-alpha-43-dev

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 (159) hide show
  1. package/dist/cjs/{index-fe562525.js → index-6a69c33a.js} +36 -3
  2. package/dist/cjs/index.cjs.js +2 -2
  3. package/dist/cjs/{lido-avatar_19.cjs.entry.js → lido-avatar_21.cjs.entry.js} +431 -180
  4. package/dist/cjs/lido-player.cjs.js +2 -2
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/{utils-96ce5641.js → utils-079a5e7d.js} +1032 -165
  7. package/dist/collection/collection-manifest.json +2 -0
  8. package/dist/collection/components/calculator/lido-calculator.css +87 -0
  9. package/dist/collection/components/calculator/lido-calculator.js +321 -0
  10. package/dist/collection/components/cell/lido-cell.js +1 -1
  11. package/dist/collection/components/column/lido-col.js +1 -1
  12. package/dist/collection/components/container/lido-container.js +20 -1
  13. package/dist/collection/components/flashCard/lido-flash-card.js +1 -1
  14. package/dist/collection/components/float/lido-float.js +1 -1
  15. package/dist/collection/components/home/lido-home.js +9 -29
  16. package/dist/collection/components/keyboard/lido-keyboard.js +2 -2
  17. package/dist/collection/components/mathMatrix/lido-math-matrix.css +10 -2
  18. package/dist/collection/components/mathMatrix/lido-math-matrix.js +226 -20
  19. package/dist/collection/components/position/lido-pos.js +1 -1
  20. package/dist/collection/components/random/lido-random.js +1 -1
  21. package/dist/collection/components/row/lido-row.js +1 -1
  22. package/dist/collection/components/scale/lido-balance.css +114 -0
  23. package/dist/collection/components/scale/lido-balance.js +549 -0
  24. package/dist/collection/components/shape/lido-shape.js +1 -1
  25. package/dist/collection/components/slideFill/lido-slide-fill.js +1 -1
  26. package/dist/collection/components/text/lido-text.js +1 -1
  27. package/dist/collection/components/trace/lido-trace.js +49 -128
  28. package/dist/collection/components/wrap/lido-wrap.js +1 -1
  29. package/dist/collection/css/animation.css +21 -0
  30. package/dist/collection/css/index.css +45 -0
  31. package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +24 -25
  32. package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +0 -3
  33. package/dist/collection/stories/Templates/balancing/balancing.stories.js +67 -0
  34. package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +156 -0
  35. package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +49 -0
  36. package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +66 -0
  37. package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +65 -0
  38. package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +105 -0
  39. package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +92 -0
  40. package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +47 -0
  41. package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +59 -0
  42. package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +93 -0
  43. package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +100 -0
  44. package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +212 -0
  45. package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +6 -7
  46. package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +6 -7
  47. package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +158 -0
  48. package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +102 -0
  49. package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +94 -0
  50. package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +184 -0
  51. package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +213 -0
  52. package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +109 -0
  53. package/dist/collection/stories/Templates/total/total.stories.js +59 -0
  54. package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +96 -0
  55. package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +55 -0
  56. package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +5 -6
  57. package/dist/collection/utils/utils.js +439 -81
  58. package/dist/collection/utils/utilsHandlers/clickHandler.js +21 -25
  59. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +95 -42
  60. package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +67 -0
  61. package/dist/collection/utils/utilsHandlers/lidoCalculatorHandler.js +94 -0
  62. package/dist/collection/utils/utilsHandlers/matrixHandler.js +298 -0
  63. package/dist/collection/utils/utilsHandlers/slideHandler.js +4 -2
  64. package/dist/collection/utils/utilsHandlers/sortHandler.js +21 -12
  65. package/dist/components/index.js +1 -1
  66. package/dist/components/lido-avatar.js +1 -1
  67. package/dist/components/lido-balance.d.ts +11 -0
  68. package/dist/components/lido-balance.js +6 -0
  69. package/dist/components/lido-calculator.d.ts +11 -0
  70. package/dist/components/lido-calculator.js +6 -0
  71. package/dist/components/lido-cell.js +1 -1
  72. package/dist/components/lido-col.js +1 -1
  73. package/dist/components/lido-container.js +1 -1
  74. package/dist/components/lido-flash-card.js +1 -1
  75. package/dist/components/lido-float.js +1 -1
  76. package/dist/components/lido-home.js +1 -1
  77. package/dist/components/lido-image.js +1 -1
  78. package/dist/components/lido-keyboard.js +1 -1
  79. package/dist/components/lido-math-matrix.js +1 -1
  80. package/dist/components/lido-pos.js +1 -1
  81. package/dist/components/lido-random.js +1 -1
  82. package/dist/components/lido-root.js +32 -20
  83. package/dist/components/lido-row.js +1 -1
  84. package/dist/components/lido-shape.js +1 -1
  85. package/dist/components/lido-slide-fill.js +1 -1
  86. package/dist/components/lido-text.js +1 -1
  87. package/dist/components/lido-trace.js +1 -1
  88. package/dist/components/lido-wrap.js +1 -1
  89. package/dist/components/p-08d0deab.js +254 -0
  90. package/dist/components/{p-b5b6ad27.js → p-15971ede.js} +1 -1
  91. package/dist/components/{p-0bf92c7f.js → p-1fbdb431.js} +2 -2
  92. package/dist/components/{p-b43ce4e1.js → p-29bdd953.js} +2 -2
  93. package/dist/components/{p-b8af26e6.js → p-322acda6.js} +40 -48
  94. package/dist/components/{p-51943db6.js → p-3f406017.js} +2 -2
  95. package/dist/components/p-44808985.js +186 -0
  96. package/dist/components/{p-4cabbf28.js → p-52844fa4.js} +2 -2
  97. package/dist/components/{p-4882df37.js → p-73e31a86.js} +2 -2
  98. package/dist/components/{p-af54a485.js → p-74849cdd.js} +4 -4
  99. package/dist/components/{p-9c56f378.js → p-7f7e5672.js} +2 -2
  100. package/dist/components/{p-4dbae73b.js → p-835b973d.js} +2 -2
  101. package/dist/components/{p-b55af747.js → p-90465904.js} +50 -129
  102. package/dist/components/{p-cae021c6.js → p-904711c8.js} +2 -2
  103. package/dist/components/{p-e735dce9.js → p-9be56729.js} +5 -3
  104. package/dist/components/{p-cac6c8bf.js → p-afbc196f.js} +2 -2
  105. package/dist/components/{p-cfa2aec8.js → p-bed94c37.js} +1047 -164
  106. package/dist/components/{p-7f11a624.js → p-cbac3cbc.js} +1 -1
  107. package/dist/components/{p-61d97438.js → p-d37ab4dc.js} +2 -2
  108. package/dist/components/p-e36ddcc1.js +166 -0
  109. package/dist/components/{p-03e4cafe.js → p-e4e42677.js} +2 -2
  110. package/dist/esm/{index-f47852d4.js → index-170e58c7.js} +36 -4
  111. package/dist/esm/index.js +2 -2
  112. package/dist/esm/{lido-avatar_19.entry.js → lido-avatar_21.entry.js} +430 -181
  113. package/dist/esm/lido-player.js +3 -3
  114. package/dist/esm/loader.js +3 -3
  115. package/dist/esm/{utils-9ce243d8.js → utils-5df09162.js} +1031 -164
  116. package/dist/lido-player/index.esm.js +1 -1
  117. package/dist/lido-player/lido-player.css +1 -1
  118. package/dist/lido-player/lido-player.esm.js +1 -1
  119. package/dist/lido-player/p-137c99ce.js +2 -0
  120. package/dist/lido-player/p-7556e652.js +9 -0
  121. package/dist/lido-player/p-eb956325.entry.js +1 -0
  122. package/dist/types/components/calculator/lido-calculator.d.ts +40 -0
  123. package/dist/types/components/container/lido-container.d.ts +4 -0
  124. package/dist/types/components/home/lido-home.d.ts +0 -1
  125. package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +24 -4
  126. package/dist/types/components/scale/lido-balance.d.ts +160 -0
  127. package/dist/types/components/trace/lido-trace.d.ts +0 -1
  128. package/dist/types/components.d.ts +342 -14
  129. package/dist/types/stories/Templates/balancing/balancing.stories.d.ts +4 -0
  130. package/dist/types/stories/Templates/checker-block/checkerBlock.stories.d.ts +4 -0
  131. package/dist/types/stories/Templates/checkerBlock/checkerBlock.stories.d.ts +4 -0
  132. package/dist/types/stories/Templates/fillAnswer/fill-answer.stories.d.ts +4 -0
  133. package/dist/types/stories/Templates/foodJar/food-jar.stories.d.ts +4 -0
  134. package/dist/types/stories/Templates/matchBox/matchBox.stories.d.ts +4 -0
  135. package/dist/types/stories/Templates/matchBox/matchBox2.stories.d.ts +4 -0
  136. package/dist/types/stories/Templates/matchingCard/matching-card.stories.d.ts +4 -0
  137. package/dist/types/stories/Templates/multiplyBeeds/multiplyBeeds.stories.d.ts +9 -0
  138. package/dist/types/stories/Templates/nimbleTable/nimbleTable.stories.d.ts +4 -0
  139. package/dist/types/stories/Templates/numberBoardTwo/numberBoardTwo.stories.d.ts +4 -0
  140. package/dist/types/stories/Templates/numberPair/numberPair.stories.d.ts +4 -0
  141. package/dist/types/stories/Templates/questionBoard/questionBoard.stories.d.ts +15 -0
  142. package/dist/types/stories/Templates/sequenceBox/sequenceBox1.stories.d.ts +11 -0
  143. package/dist/types/stories/Templates/sequenceBox/sequenceBox2.stories.d.ts +11 -0
  144. package/dist/types/stories/Templates/shapePair/shape-pair.stories.d.ts +4 -0
  145. package/dist/types/stories/Templates/shapeTractor/shape-tractor.stories.d.ts +12 -0
  146. package/dist/types/stories/Templates/sumTogether/sumTogether.stories.d.ts +11 -0
  147. package/dist/types/stories/Templates/total/total.stories.d.ts +4 -0
  148. package/dist/types/stories/Templates/writeNumber/writeNumber.stories.d.ts +13 -0
  149. package/dist/types/stories/Templates/writeSet/writeSet.stories.d.ts +4 -0
  150. package/dist/types/utils/utils.d.ts +8 -2
  151. package/dist/types/utils/utilsHandlers/dragDropHandler.d.ts +4 -0
  152. package/dist/types/utils/utilsHandlers/lidoBalanceHandler.d.ts +2 -0
  153. package/dist/types/utils/utilsHandlers/lidoCalculatorHandler.d.ts +1 -0
  154. package/dist/types/utils/utilsHandlers/matrixHandler.d.ts +1 -0
  155. package/package.json +1 -1
  156. package/dist/components/p-a8ab771b.js +0 -160
  157. package/dist/lido-player/p-90212aa9.js +0 -9
  158. package/dist/lido-player/p-d3911ee1.entry.js +0 -1
  159. package/dist/lido-player/p-ddf627b0.js +0 -2
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-fe562525.js');
6
- const utils = require('./utils-96ce5641.js');
5
+ const index = require('./index-6a69c33a.js');
6
+ const utils = require('./utils-079a5e7d.js');
7
7
 
8
8
  var rive = {exports: {}};
9
9
 
@@ -6596,6 +6596,267 @@ const LidoAvatar = class {
6596
6596
  };
6597
6597
  LidoAvatar.style = LidoAvatarStyle0;
6598
6598
 
6599
+ const lidoBalanceCss = "#lido-balance{position:relative;height:500px;width:1205px;top:20%;left:-91px;z-index:0}.lido-balance-symbol{position:absolute;top:64%;left:50%;transform:translate(-50%, -50%);font-size:5vw;font-weight:bold;color:black;pointer-events:none;z-index:999}@media (orientation: portrait){#pivotimg{position:absolute;height:auto;width:23%;bottom:18%;left:38%;z-index:100}}@media (orientation: landscape){#pivotimg{position:absolute;height:auto;width:23%;bottom:8%;left:38%;z-index:100}}.lido-balance .pivot svg{width:100%;height:auto}#scaleimg{position:absolute;width:73%;height:auto;top:61%;left:14%;z-index:90}.lido-balance .scale svg{width:100%;height:auto}@media (orientation: landscape){#handlerimg{position:absolute;width:35%;height:auto;top:49%;left:2%}}@media (orientation:portrait ){#handlerimg{position:absolute;width:35%;height:auto;top:53%;left:2%}}.lido-balance .handler svg{width:100%;height:auto;fill:brown}@media (orientation: landscape){#handimg{position:absolute;width:35%;height:auto;top:49%;right:2%}}@media (orientation:portrait){#handimg{position:absolute;width:35%;height:auto;top:53%;right:2%}}.lido-balance .hand svg{width:100%;height:auto;fill:brown}.pivot svg path:nth-of-type(1){fill:brown}.pivot svg path[d^=\"M78.9414\"]{fill:white}";
6600
+ const LidoBalanceStyle0 = lidoBalanceCss;
6601
+
6602
+ const LidoBalance = class {
6603
+ constructor(hostRef) {
6604
+ index.registerInstance(this, hostRef);
6605
+ this.currentAngle = 0;
6606
+ this.pivotimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Display%20stand.svg';
6607
+ this.scaleimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Bar.svg';
6608
+ this.handlerimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Stands.svg';
6609
+ this.fill = 'brown';
6610
+ this.tilt = 0;
6611
+ this.maxTilt = 9.5;
6612
+ this.onEntry = '';
6613
+ this.height = 'auto';
6614
+ this.width = 'auto';
6615
+ this.x = '0px';
6616
+ this.y = '0px';
6617
+ this.z = '0';
6618
+ this.visible = false;
6619
+ this.margin = '';
6620
+ this.padding = '';
6621
+ this.balanceSymbol = '=';
6622
+ this.showSymbol = false;
6623
+ this.operation = 'count';
6624
+ this.pivotSvg = '';
6625
+ this.scaleSvg = '';
6626
+ this.handlerSvg = '';
6627
+ this.style = {};
6628
+ this.tiltf = 0;
6629
+ this.leftVal = 0;
6630
+ this.rightVal = 0;
6631
+ }
6632
+ async revealSymbol() {
6633
+ this.showSymbol = true;
6634
+ }
6635
+ async hideSymbol() {
6636
+ this.showSymbol = false;
6637
+ }
6638
+ async componentWillLoad() {
6639
+ this.updateStyles();
6640
+ this.pivotSvg = await this.fetchAndApplyFill(this.pivotimage);
6641
+ this.scaleSvg = await this.fetchAndApplyFill(this.scaleimage);
6642
+ this.handlerSvg = await this.fetchAndApplyFill(this.handlerimage);
6643
+ }
6644
+ componentDidLoad() {
6645
+ setTimeout(() => {
6646
+ this.animateBalance();
6647
+ }, 4000);
6648
+ this.leftParentEl = document.getElementById("leftparent");
6649
+ this.rightParentEl = document.getElementById("rightparent");
6650
+ utils.initEventsForElement(this.el);
6651
+ }
6652
+ disconnectedCallback() {
6653
+ if (this.animationFrameId != null)
6654
+ cancelAnimationFrame(this.animationFrameId);
6655
+ }
6656
+ async fetchAndApplyFill(url) {
6657
+ try {
6658
+ const res = await fetch(url);
6659
+ if (!res.ok)
6660
+ return '';
6661
+ let svg = await res.text();
6662
+ svg = svg.replace(/fill="[^"]*"/g, '');
6663
+ svg = svg.replace(/stroke="[^"]*"/g, '');
6664
+ svg = svg.replace(/<svg([^>]*)>/, `<svg$1 fill="${this.fill}" stroke="${this.fill}">`);
6665
+ return svg;
6666
+ }
6667
+ catch (e) {
6668
+ console.error('SVG fetch failed:', e);
6669
+ return '';
6670
+ }
6671
+ }
6672
+ tiltChanged(newValue) {
6673
+ this.tiltf = newValue;
6674
+ }
6675
+ async updateTilt(leftVal, rightVal) {
6676
+ const diff = rightVal - leftVal;
6677
+ const newTilt = Math.max(-5, Math.min(5, diff));
6678
+ this.tiltf = newTilt;
6679
+ }
6680
+ animateBalance() {
6681
+ const rotate = () => {
6682
+ let targetAngle = (this.tiltf / 5) * this.maxTilt;
6683
+ if (targetAngle > this.maxTilt)
6684
+ targetAngle = this.maxTilt;
6685
+ if (targetAngle < -this.maxTilt)
6686
+ targetAngle = -this.maxTilt;
6687
+ this.currentAngle += (targetAngle - this.currentAngle) * 0.1;
6688
+ if (this.currentAngle > this.maxTilt)
6689
+ this.currentAngle = this.maxTilt;
6690
+ if (this.currentAngle < -this.maxTilt)
6691
+ this.currentAngle = -this.maxTilt;
6692
+ if (this.scaleEl) {
6693
+ this.scaleEl.style.transform = `rotate(${this.currentAngle}deg)`;
6694
+ this.scaleEl.style.transformOrigin = '50% 80%';
6695
+ }
6696
+ if (this.leftParentEl && this.rightParentEl) {
6697
+ const maxOffset = 60;
6698
+ const offset = (this.currentAngle / this.maxTilt) * maxOffset;
6699
+ this.leftParentEl.style.transform = `translateY(${-offset}px)`;
6700
+ this.rightParentEl.style.transform = `translateY(${offset}px)`;
6701
+ }
6702
+ if (this.leftHandleEl && this.rightHandleEl) {
6703
+ const isPortrait = window.innerHeight > window.innerWidth;
6704
+ const maxOffset = isPortrait ? 40 : 60;
6705
+ const offset = (this.currentAngle / this.maxTilt) * maxOffset;
6706
+ this.leftHandleEl.style.transform = `translateY(${-offset}px)`;
6707
+ this.rightHandleEl.style.transform = `translateY(${offset}px)`;
6708
+ }
6709
+ this.animationFrameId = requestAnimationFrame(rotate);
6710
+ };
6711
+ rotate();
6712
+ }
6713
+ updateStyles() {
6714
+ const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
6715
+ this.style = {
6716
+ height: utils.parseProp(this.height, orientation),
6717
+ width: utils.parseProp(this.width, orientation),
6718
+ top: utils.parseProp(this.y, orientation),
6719
+ left: utils.parseProp(this.x, orientation),
6720
+ zIndex: this.z,
6721
+ display: utils.parseProp(`${this.visible}`, orientation) === "true" ? 'flex' : 'none',
6722
+ margin: utils.parseProp(this.margin, orientation),
6723
+ padding: utils.parseProp(this.padding, orientation),
6724
+ };
6725
+ }
6726
+ render() {
6727
+ return (index.h(index.Host, { key: '868cc05ae503a6e04039c615815102470eb402d4', id: "lido-balance", onEntry: this.onEntry, class: "lido-balance", tilt: this.tilt.toString(), style: this.style, operation: this.operation.toString() }, index.h("div", { key: '2627a49d1ad5045bd9a3ac217354c9be98f1f52b', innerHTML: this.pivotSvg, id: "pivotimg", class: "pivot" }), index.h("div", { key: 'c5b2432f5e3c62ebbb7f17146f18e22e7e2b29bb', innerHTML: this.scaleSvg, id: "scaleimg", class: "scale", ref: (el) => (this.scaleEl = el) }), index.h("div", { key: 'd5e8051aedb784189f19a1e7b0dfd645e95ed4a5', innerHTML: this.handlerSvg, id: "handlerimg", class: "handler", ref: (el) => (this.leftHandleEl = el) }), index.h("div", { key: '3779886d4fc8dfadc0791f69cb87df78d5f843c8', innerHTML: this.handlerSvg, id: "handimg", class: "hand", ref: (el) => (this.rightHandleEl = el) }), index.h("div", { key: 'df5d4094c302548bf64f166643a3f05d262d95b1', id: "balanceSymbol", class: "lido-balance-symbol", "aria-hidden": !this.showSymbol }, this.showSymbol ? this.balanceSymbol : '')));
6728
+ }
6729
+ get el() { return index.getElement(this); }
6730
+ static get watchers() { return {
6731
+ "tilt": ["tiltChanged"]
6732
+ }; }
6733
+ };
6734
+ LidoBalance.style = LidoBalanceStyle0;
6735
+
6736
+ const lidoCalculatorCss = "#lidoCalculator{border-radius:19px;border:5px solid #029A9A;position:relative;display:flex;flex-direction:column;padding:2%;box-sizing:border-box}.lido-calculator-btn-special{background-color:#014D4D !important;--btn-shadow-color:#0a2f2f !important}.lido-calculator-btn-default{background-color:#029A9A !important;color:#000;--btn-shadow-color:#0f4242 !important}#lido-calculator-penIcon{--btn-bg-color:#FB7038 !important;--btn-shadow-px:0 8px 0 !important;--btn-shadow-color:#D74B12 !important;border-radius:5px !important}.lido-calculator-displayParent{width:89%;height:107px;background-color:rgb(68, 186, 186);border-radius:5px;margin:14px auto 17px auto;overflow:hidden;display:flex;align-items:end}.lido-calculator-display{width:97%;height:94px;background:#029A9A;color:#fff;text-align:right;display:flex;justify-content:flex-end;align-items:center;font-size:72px;font-weight:700;font-family:'Baloo Bhai 2', serif;border-radius:5px 0px 0px 5px;box-sizing:border-box;margin:0 0px -6px auto}.lido-calculator-buttons{flex:1;display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;gap:0%;width:100%;justify-items:center;align-items:center;position:relative;top:-1%}.lido-calculator-buttons lido-text{display:flex !important;justify-content:center;align-items:center;width:96px !important;height:80px !important;font-size:72px !important;font-weight:700 !important;color:#fff;border-radius:5px !important;cursor:pointer;text-align:center;line-height:1;box-sizing:border-box;transition:transform 0.1s}.lido-calculator-buttons lido-text:active{transform:scale(0.95)}";
6737
+ const LidoCalculatorStyle0 = lidoCalculatorCss;
6738
+
6739
+ const LidoCalculator = class {
6740
+ constructor(hostRef) {
6741
+ index.registerInstance(this, hostRef);
6742
+ this.onOk = index.createEvent(this, "onOk", 7);
6743
+ this.userAnswers = []; // store all calculator inputs
6744
+ this.width = '479px';
6745
+ this.visible = false;
6746
+ this.height = '711px';
6747
+ this.objective = '';
6748
+ this.onEntry = '';
6749
+ this.x = '0px';
6750
+ this.y = '0px';
6751
+ this.bgColor = '#60DADA';
6752
+ this.penIcon = "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/calculator/Pen--Streamline-Solar%201.svg";
6753
+ this.displayValue = '';
6754
+ this.style = {};
6755
+ }
6756
+ updateValueAttr() {
6757
+ this.el.setAttribute('value', this.displayValue);
6758
+ }
6759
+ componentWillLoad() {
6760
+ if (!this.objective) {
6761
+ const container = this.el.closest('lido-container');
6762
+ if (container) {
6763
+ this.objective = (container.getAttribute('objective') || '').replace('=', '').trim();
6764
+ }
6765
+ }
6766
+ this.updateValueAttr();
6767
+ }
6768
+ handleClick(value) {
6769
+ const MAX_LENGTH = 10;
6770
+ if (value === 'OK') {
6771
+ this.verifyAnswer();
6772
+ }
6773
+ else if (value === '←') {
6774
+ this.displayValue = this.displayValue.slice(0, -1);
6775
+ }
6776
+ else {
6777
+ if (this.displayValue.length < MAX_LENGTH) {
6778
+ this.displayValue += value;
6779
+ }
6780
+ }
6781
+ this.updateValueAttr();
6782
+ }
6783
+ async verifyAnswer() {
6784
+ const userInput = this.displayValue.trim();
6785
+ if (!userInput)
6786
+ return;
6787
+ let isCorrect = false;
6788
+ const container = this.el.closest('lido-container');
6789
+ if (!container)
6790
+ return;
6791
+ if (this.objective && this.objective.length === 1) {
6792
+ isCorrect = userInput === this.objective;
6793
+ }
6794
+ // --- Multiple Objectives ---
6795
+ else if (this.objective && this.objective.includes(',')) {
6796
+ const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
6797
+ const objectives = this.objective.split(',').map(obj => obj.trim());
6798
+ const currentIndex = this.userAnswers.length;
6799
+ // Compare current input with corresponding objective
6800
+ if (currentIndex < objectives.length && Number(userInput) === Number(objectives[currentIndex])) {
6801
+ isCorrect = true;
6802
+ }
6803
+ else {
6804
+ isCorrect = false;
6805
+ }
6806
+ // Store behavior based on mode
6807
+ if (isContinueOnCorrect) {
6808
+ // PRACTICE MODE → store only correct answers
6809
+ if (isCorrect) {
6810
+ this.userAnswers.push(Number(userInput));
6811
+ }
6812
+ }
6813
+ else {
6814
+ // TEST MODE → store all user inputs
6815
+ this.userAnswers.push(Number(userInput));
6816
+ }
6817
+ }
6818
+ else if (this.objective === '') {
6819
+ const equationAttr = container.getAttribute('equationCheck') || '';
6820
+ if (!equationAttr)
6821
+ return;
6822
+ try {
6823
+ const calculatedValue = utils.equationCheck(equationAttr);
6824
+ isCorrect = Number(calculatedValue) === Number(userInput.trim());
6825
+ console.log('Equation check:', calculatedValue, userInput, isCorrect);
6826
+ }
6827
+ catch (err) {
6828
+ console.error('Error evaluating equation:', err);
6829
+ isCorrect = false;
6830
+ }
6831
+ }
6832
+ this.onOk.emit(isCorrect);
6833
+ if (isCorrect) {
6834
+ this.displayValue = "";
6835
+ utils.storingEachActivityScore(isCorrect);
6836
+ const onCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onCorrect')) || '';
6837
+ await utils.executeActions(onCorrect, container);
6838
+ if (this.objective.length === 0) {
6839
+ window.dispatchEvent(new CustomEvent(utils.NextContainerKey));
6840
+ }
6841
+ }
6842
+ else {
6843
+ this.displayValue = "";
6844
+ utils.storingEachActivityScore(isCorrect);
6845
+ const onInCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onInCorrect')) || '';
6846
+ await utils.executeActions(onInCorrect, container);
6847
+ }
6848
+ }
6849
+ render() {
6850
+ const numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '←', '0', 'OK'];
6851
+ return (index.h(index.Host, { key: '61d14ce0ff858db8ff04b502c0d303f18f5552b8', onEntry: this.onEntry, id: "lidoCalculator", style: { width: this.width, height: this.height, backgroundColor: this.bgColor, left: this.x, top: this.y } }, index.h("lido-cell", { key: '86318d0fb2a707af14fca1b1a615536e7bcdb9a3', visible: "true", height: "94px", width: "60px" }, index.h("lido-text", { key: 'd552cf17bedcbb321af0c7fb5fc0b44c89be4561', visible: "true", id: "lido-calculator-penIcon", type: "click", height: "80px", x: "176%", width: "96px", onEntry: "this.position='relative';", class: "top-icon" }, index.h("img", { key: '46f9003a72906617169fb76b19a208e6f6cbb0bc', src: this.penIcon, alt: "pen", style: { width: '100%', height: '100%' } }))), index.h("div", { key: 'a7ffc6dbdaabfa944e115eeecf08cc53808c0234', class: "lido-calculator-displayParent" }, index.h("div", { key: '27926d1370cbdd4423404ad1f78b1ade381288d9', class: "lido-calculator-display" }, this.displayValue)), index.h("div", { key: '58288a987ea3090da498fff03220d4d4b24aa7c5', class: "lido-calculator-buttons" }, numbers.map((num, i) => (index.h("lido-text", { id: `btn-${i}`, string: num, visible: "true", type: "click", class: {
6852
+ 'lido-calculator-btn-special': num === '←' || num === 'OK',
6853
+ 'lido-calculator-btn-default': num !== '←' && num !== 'OK'
6854
+ }, onClick: () => this.handleClick(num) }))))));
6855
+ }
6856
+ get el() { return index.getElement(this); }
6857
+ };
6858
+ LidoCalculator.style = LidoCalculatorStyle0;
6859
+
6599
6860
  const lidoCellCss = ".lido-col{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);padding:15px;border-radius:10px;display:flex;justify-content:space-around;flex-direction:column;align-items:center}.lido-col>*{}.lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}.lido-wrap{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill, minmax(186px, auto))}.lido-wrap>*{padding:10px;box-sizing:border-box}.lido-flex{display:flex;flex-wrap:wrap;align-content:flex-start;gap:10px}.lido-pos{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);display:flex;justify-content:space-around;flex-direction:column;position:fixed}.lido-pos>*{position:absolute}.lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}.lido-col::-webkit-scrollbar,.lido-wrap::-webkit-scrollbar,.lido-flex::-webkit-scrollbar{width:var(--scrollbar-width);height:var(--scrollbar-width)}.lido-col::-webkit-scrollbar-thumb,.lido-wrap::-webkit-scrollbar-thumb,.lido-flex::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px;border:3px solid transparent;background-clip:content-box}.lido-col::-webkit-scrollbar-track,.lido-wrap::-webkit-scrollbar-track,.lido-flex::-webkit-scrollbar-track{background:#f1f1f1}";
6600
6861
  const LidoCellStyle0 = lidoCellCss;
6601
6862
 
@@ -6724,7 +6985,7 @@ const LidoCell = class {
6724
6985
  this.el.className = `lido-${utils.parseProp(this.layout, orientation)}`;
6725
6986
  }
6726
6987
  render() {
6727
- return (index.h(index.Host, { key: '8c2593f5b6493530e0ab725b7f9f543f884d086d', id: this.id, class: "lido-cell", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "flex-direction": this.flexDirection, "disable-speak": this.disableSpeak }, index.h("slot", { key: '1497f2f179a474a4a2a8944d03c0841d055b1b6d' })));
6988
+ return (index.h(index.Host, { key: '00183a8d67c4c64eae2d2bb2e3db5def7ffe3caf', id: this.id, class: "lido-cell", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "flex-direction": this.flexDirection, "disable-speak": this.disableSpeak }, index.h("slot", { key: '33fbb691c5c8f015bc9c6cf1e86c237758f126c3' })));
6728
6989
  }
6729
6990
  get el() { return index.getElement(this); }
6730
6991
  };
@@ -6809,7 +7070,7 @@ const LidoCol = class {
6809
7070
  };
6810
7071
  }
6811
7072
  render() {
6812
- return (index.h(index.Host, { key: '753487ca4817b020aaf7e34dadff00a61c826dfc', id: this.id, class: "lido-col", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, index.h("slot", { key: 'a9d9f0f2c30dc02e6468e597b5a02e032d786538' })));
7073
+ return (index.h(index.Host, { key: '1cf21bb1e817c9078213312aa7165423eaf54ea7', id: this.id, class: "lido-col", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, index.h("slot", { key: 'c3bc168ccccacf1425b5d93853bc27ab2962436f' })));
6813
7074
  }
6814
7075
  get el() { return index.getElement(this); }
6815
7076
  };
@@ -6857,6 +7118,7 @@ const LidoContainer = class {
6857
7118
  this.showPrevButton = 'false';
6858
7119
  this.showNextButton = 'false';
6859
7120
  this.delayVisible = '';
7121
+ this.disableSpeak = false;
6860
7122
  }
6861
7123
  convertToPixels(height, parentElement = document.body) {
6862
7124
  if (!height)
@@ -6939,7 +7201,7 @@ const LidoContainer = class {
6939
7201
  userSelect: 'none', // Prevent any field selection
6940
7202
  };
6941
7203
  console.log('🚀 ~ LidoContainer ~ canplay:', this.canplay);
6942
- return (index.h(index.Host, { key: '782cc0c88592899d58f942245db8e0561714d35c', id: "lido-container", "tab-index": 0, class: "lido-container", objective: this.objective, baseUrl: this.baseUrl, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, onTouch: this.onTouch, onInCorrect: this.onInCorrect, onCorrect: this.onCorrect, onEntry: this.onEntry, "show-check": `${this.showCheck}`, "is-continue-on-correct": `${this.isContinueOnCorrect}`, "is-allow-only-correct": `${this.isAllowOnlyCorrect}`, canplay: `${this.canplay}`, appendToDropOnCompletion: `${this.appendToDropOnCompletion}`, "show-prev-button": `${this.showPrevButton}`, "show-next-button": `${this.showNextButton}`, "show-drop-border": `${this.showDropBorder}`, "bg-image": this.bgImage, "exit-button-url": this.exitButtonUrl, "prev-button-url": this.prevButtonUrl, "next-button-url": this.nextButtonUrl, "speaker-button-url": this.speakerButtonUrl }, index.h("slot", { key: 'e23be1cba95353ad3678c2d1d41b4d23ae76f2d9' })));
7204
+ return (index.h(index.Host, { key: '1f61c4443b96466e2802b5550e8d999319b41ce7', id: "lido-container", "tab-index": 0, class: "lido-container", objective: this.objective, baseUrl: this.baseUrl, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, onTouch: this.onTouch, onInCorrect: this.onInCorrect, onCorrect: this.onCorrect, onEntry: this.onEntry, "show-check": `${this.showCheck}`, "is-continue-on-correct": `${this.isContinueOnCorrect}`, "is-allow-only-correct": `${this.isAllowOnlyCorrect}`, canplay: `${this.canplay}`, appendToDropOnCompletion: `${this.appendToDropOnCompletion}`, "show-prev-button": `${this.showPrevButton}`, "show-next-button": `${this.showNextButton}`, "show-drop-border": `${this.showDropBorder}`, "bg-image": this.bgImage, "exit-button-url": this.exitButtonUrl, "prev-button-url": this.prevButtonUrl, "next-button-url": this.nextButtonUrl, "speaker-button-url": this.speakerButtonUrl, "disable-speak": this.disableSpeak }, index.h("slot", { key: '2df61e731d3a9de3fd9cdb23f47035ee2e35c30a' })));
6943
7205
  }
6944
7206
  get el() { return index.getElement(this); }
6945
7207
  };
@@ -7020,7 +7282,7 @@ const LidoFlash = class {
7020
7282
  }
7021
7283
  /* ---------- Render ---------- */
7022
7284
  render() {
7023
- return (index.h(index.Host, { key: 'e0140af2e33c8cdc9d5c94743bcd83b98d0ce2f4', value: this.value, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, type: this.type, onClick: this.handleFlip, "disable-speak": this.disableSpeak }, index.h("div", { key: '11b7e0be1957e15ac5644b73b4ffbd00a27a93ff', class: `card ${this.flipped ? 'flipped' : ''}` }, index.h("div", { key: 'acd9ae1eb8b1d6ac2658dbdcb26d9d7f6549811c', class: "card-face card-front" }, this.front != null ? this.front : index.h("slot", { name: "front" })), index.h("div", { key: 'd62cbfdd84fcc6596aefe6d8d55f7e5ffeaaa5f2', class: "card-face card-back" }, this.back != null ? this.back : index.h("slot", { name: "back" })))));
7285
+ return (index.h(index.Host, { key: 'df221d302a1e91eb995af2f70aa69957cb769ffe', value: this.value, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, type: this.type, onClick: this.handleFlip, "disable-speak": this.disableSpeak }, index.h("div", { key: 'd799a3525d9af4ba98d7750a3a76a313dd9cdd76', class: `card ${this.flipped ? 'flipped' : ''}` }, index.h("div", { key: 'fb7734ca5648e2cf8a91d551b383a5c2c3eae255', class: "card-face card-front" }, this.front != null ? this.front : index.h("slot", { name: "front" })), index.h("div", { key: '6071da403b17a079f80f0c5dd576dac7b5a2c357', class: "card-face card-back" }, this.back != null ? this.back : index.h("slot", { name: "back" })))));
7024
7286
  }
7025
7287
  get el() { return index.getElement(this); }
7026
7288
  static get watchers() { return {
@@ -7088,16 +7350,16 @@ const LidoFloat = class {
7088
7350
  };
7089
7351
  }
7090
7352
  render() {
7091
- return (index.h(index.Host, { key: '2866d98e4a22a5825c24f23324473016c5e8c33f', class: "lido-float", "float-direction": this.floatDirection, id: this.id, "tab-index": this.tabIndex, style: this.style, onEntry: this.onEntry }, index.h("slot", { key: 'dd0a4405b91e1ddb95e90d6dfa1e16f8ac106c58' })));
7353
+ return (index.h(index.Host, { key: 'b4c271689b52272251d5623e53b67ef78389c012', class: "lido-float", "float-direction": this.floatDirection, id: this.id, "tab-index": this.tabIndex, style: this.style, onEntry: this.onEntry }, index.h("slot", { key: '852149328b2a8e85e84fdf9e2a4a64bb2ec8ad3a' })));
7092
7354
  }
7093
7355
  get el() { return index.getElement(this); }
7094
7356
  };
7095
7357
  LidoFloat.style = LidoFloatStyle0;
7096
7358
 
7097
- const indexCss = "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400..800&display=swap'); body{overflow:hidden;background-position:center;background-size:cover;background-repeat:no-repeat;height:100vh}*{user-select:none}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}.diagonal-target,.diagonal-drop *{transform:scale(0.8) !important;opacity:1 !important}.cloned-element{display:flex !important;position:absolute !important;filter:grayscale(100%);pointer-events:none}.removeShadow{box-shadow:0px 0px 0px 0px #ff8900 !important}.highlight-element{border:2px solid white;box-shadow:0 2px 4px rgba(151, 150, 150, 0.1) !important}.drop-element.empty{border:4px dashed #f34d08 !important}.drop-element.filled{border:'none' !important}.drag-element{box-shadow:0px 15px 11px rgba(43, 0, 0, 0.3) !important}.drag-element.dropped{box-shadow:none !important}.click-element{background-color:var(--btn-bg-color, rgba(255, 172, 76, 1)) !important;box-shadow:var(--btn-shadow-px) var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;cursor:pointer;transition:box-shadow 0.1s ease-out, transform 0.2s ease-out;}.click-element:active{box-shadow:0px 0px 0px var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;transform:translateY(var(--btn-active));}.click-element:focus{outline:2px solid dodgerblue;outline-offset:3px}.after-drop-popup-container{width:200%;height:200%;background-color:rgba(0, 0, 0, 0.8);position:absolute;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center !important;gap:80px}.after-drop-popup-drag-element{scale:1.5;border-radius:8px;transform:none !important;position:unset !important}.after-drop-popup-drop-element{scale:1.5;border:unset;border-radius:8px;transform:none !important;position:unset !important}@keyframes zoomFadeIn{0%{transform:scale(0.6);opacity:0}100%{transform:scale(1);opacity:1}}.zoom-fade-in{animation:zoomFadeIn 0.8s ease-out forwards}@keyframes zoomFadeOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0.6);opacity:0}}.zoom-fade-out{animation:zoomFadeOut 0.8s ease-in forwards}.slide-numbers{width:70px;height:70px;border:1px solid #f57139;background-color:white;font-weight:500;color:#f57139;font-size:44px;border-radius:40px;display:flex;align-items:center;justify-content:center;font-family:'Baloo Bhai 2', serif}.slide-numbers-bottom{position:absolute;display:flex;justify-content:space-around;align-items:center;bottom:-25px;width:100%;height:50px}.slide-numbers-left{position:absolute;display:flex;flex-direction:column;justify-content:space-around;height:100%;width:50px;left:-25px;bottom:0px}.lido-speak-icon{width:56px;height:56px;position:absolute;top:-25px;right:-25px;z-index:10;background-image:url(\"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/template/audioIcon.png\");background-color:white;border:4px solid #F34D08;border-radius:16px;box-shadow:0px 4px 0px 0px #F34D08;background-size:contain;background-repeat:no-repeat;cursor:pointer}.lido-speak-icon:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px !important}.lido-strong-shake{animation:strongShake 0.3s ease}.lido-scaled-shake{animation:scaledShake 0.6s ease-in-out}.lido-horizontal-shake{animation:horizontalShake 0.6s ease-in-out;border-radius:20px}.lido-vertical-shake{animation:verticalShake 0.6s ease-in-out;border-radius:20px}.lido-diagonal-shake{animation:diagonalShake 0.5s ease-in-out;border-radius:20px;will-change:transform}";
7359
+ const indexCss = "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400..800&display=swap'); body{overflow:hidden;background-position:center;background-size:cover;background-repeat:no-repeat;height:100vh}*{user-select:none}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}.diagonal-target,.diagonal-drop *{transform:scale(0.8) !important;opacity:1 !important}.cloned-element{display:flex !important;position:absolute !important;filter:grayscale(100%);pointer-events:none}.removeShadow{box-shadow:0px 0px 0px 0px #ff8900 !important}.highlight-element{border:2px solid white;box-shadow:0 2px 4px rgba(151, 150, 150, 0.1) !important}.drop-element.empty{border:4px dashed #f34d08 !important}.drop-element.filled{border:'none' !important}.drag-element{box-shadow:0px 15px 11px rgba(43, 0, 0, 0.3) !important}.drag-element.dropped{box-shadow:none !important}.click-element{background-color:var(--btn-bg-color, rgba(255, 172, 76, 1)) !important;box-shadow:var(--btn-shadow-px) var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;cursor:pointer;transition:box-shadow 0.1s ease-out, transform 0.2s ease-out;}.click-element:active{box-shadow:0px 0px 0px var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;transform:translateY(var(--btn-active));}.click-element:focus{outline:2px solid dodgerblue;outline-offset:3px}.after-drop-popup-container{width:200%;height:200%;background-color:rgba(0, 0, 0, 0.8);position:absolute;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center !important;gap:80px}.after-drop-popup-drag-element{scale:1.5;border-radius:8px;transform:none !important;position:unset !important}.after-drop-popup-drop-element{scale:1.5;border:unset;border-radius:8px;transform:none !important;position:unset !important}@keyframes zoomFadeIn{0%{transform:scale(0.6);opacity:0}100%{transform:scale(1);opacity:1}}.zoom-fade-in{animation:zoomFadeIn 0.8s ease-out forwards}@keyframes zoomFadeOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0.6);opacity:0}}.zoom-fade-out{animation:zoomFadeOut 0.8s ease-in forwards}.slide-numbers{width:70px;height:70px;border:1px solid #f57139;background-color:white;font-weight:500;color:#f57139;font-size:44px;border-radius:40px;display:flex;align-items:center;justify-content:center;font-family:'Baloo Bhai 2', serif}.slide-numbers-bottom{position:absolute;display:flex;justify-content:space-around;align-items:center;bottom:-25px;width:100%;height:50px}.slide-numbers-left{position:absolute;display:flex;flex-direction:column;justify-content:space-around;height:100%;width:50px;left:-25px;bottom:0px}.lido-speak-icon{width:56px;height:56px;position:absolute;top:-25px;right:-25px;z-index:10;background-image:url(\"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/template/audioIcon.png\");background-color:white;border:4px solid #F34D08;border-radius:16px;box-shadow:0px 4px 0px 0px #F34D08;background-size:contain;background-repeat:no-repeat;cursor:pointer}.lido-speak-icon:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px !important}.lido-strong-shake{animation:strongShake 0.3s ease}.lido-scaled-shake{animation:scaledShake 0.6s ease-in-out}.lido-horizontal-shake{animation:horizontalShake 0.6s ease-in-out;border-radius:20px}.lido-vertical-shake{animation:verticalShake 0.6s ease-in-out;border-radius:20px}.lido-diagonal-shake{animation:diagonalShake 0.5s ease-in-out;border-radius:20px;will-change:transform}.lido-glow{animation:glowPulse 1s infinite alternate;transition:opacity 0.5s ease-in-out}.lido-box-highlight{animation:topToPlace 0.3s linear}.lido-display-hiddenvalue{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:80px;font-weight:1000;color:brown;-webkit-text-stroke:2px white;font-family:'Baloo Bhai 2', sans-serif;pointer-events:none}.lido-image-colorize{position:relative;display:inline-block}.lido-image-colorize::after{content:'';position:absolute;inset:0;background:var(--tint-color);mix-blend-mode:multiply;opacity:0.8;pointer-events:none;mask-image:var(--mask-url);mask-size:cover;mask-repeat:no-repeat;mask-position:center}";
7098
7360
  const LidoHomeStyle0 = indexCss;
7099
7361
 
7100
- const animationCss = "@keyframes rightToPlace{from{transform:translateX(2000px)}to{transform:translateX(0)}}@keyframes topToPlace{from{transform:translateY(-1000px)}to{transform:translateY(0)}}@keyframes bottomToPlace{from{transform:translateY(1000px)}to{transform:translateY(0)}}@keyframes placeToLeft{from{}to{transform:translateX(-2000px)}}@keyframes leftToPlace{from{transform:translateX(-2000px)}to{transform:translateX(0)}}@keyframes shake{0%{transform:translateX(0)}10%{transform:translateX(-5px)}20%{transform:translateX(5px)}30%{transform:translateX(-5px)}40%{transform:translateX(5px)}50%{transform:translateX(-5px)}60%{transform:translateX(5px)}70%{transform:translateX(-5px)}80%{transform:translateX(5px)}90%{transform:translateX(-5px)}100%{transform:translateX(0)}}@keyframes fallAndBounce{0%{transform:translateY(-1000px)}25%{transform:translateY(0px)}50%{transform:translateY(-200px)}75%{transform:translateY(0)}90%{transform:translateY(-100px)}100%{transform:translateY(0)}}@keyframes placeToDown{0%{transform:translateY(0)}100%{transform:translateY(1000px)}}@keyframes strongShake{0%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}100%{transform:translateX(0)}}@keyframes scaledShake{0%{transform:scale(1) translateX(0);box-shadow:0 0 0 transparent}20%{transform:scale(1.10) translateX(-12px);box-shadow:0 0 10px red}40%{transform:scale(1.10) translateX(12px);box-shadow:0 0 12px red}60%{transform:scale(1.10) translateX(-8px);box-shadow:0 0 10px red}80%{transform:scale(1.10) translateX(8px);box-shadow:0 0 12px red}100%{transform:scale(1) translateX(0);box-shadow:none}}@keyframes horizontalShake{0%{transform:scale(1) translateX(0);background-color:transparent}20%{transform:translateX(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateX(20px);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateX(-10px);background-color:rgba(255, 0, 0, 0.3)}80%{transform:translateX(10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translateX(0);background-color:transparent}}@keyframes verticalShake{0%{transform:translateY(0);background-color:transparent}20%{transform:translateY(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateY(20px);background-color:rgba(255, 0, 0, 0.2)}80%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.1)}100%{transform:translateY(0);background-color:transparent}}@keyframes diagonalShake{0%{transform:translate(0, 0);background-color:transparent}25%{transform:translate(20px, -20px);background-color:rgba(255, 0, 0, 0.2)}50%{transform:translate(-20px, 20px);background-color:rgba(255, 0, 0, 0.3)}75%{transform:translate(10px, -10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translate(0, 0);background-color:transparent}}";
7362
+ const animationCss = "@keyframes rightToPlace{from{transform:translateX(2000px)}to{transform:translateX(0)}}@keyframes topToPlace{from{transform:translateY(-1000px)}to{transform:translateY(0)}}@keyframes bottomToPlace{from{transform:translateY(1000px)}to{transform:translateY(0)}}@keyframes placeToLeft{from{}to{transform:translateX(-2000px)}}@keyframes leftToPlace{from{transform:translateX(-2000px)}to{transform:translateX(0)}}@keyframes shake{0%{transform:translateX(0)}10%{transform:translateX(-5px)}20%{transform:translateX(5px)}30%{transform:translateX(-5px)}40%{transform:translateX(5px)}50%{transform:translateX(-5px)}60%{transform:translateX(5px)}70%{transform:translateX(-5px)}80%{transform:translateX(5px)}90%{transform:translateX(-5px)}100%{transform:translateX(0)}}@keyframes fallAndBounce{0%{transform:translateY(-1000px)}25%{transform:translateY(0px)}50%{transform:translateY(-200px)}75%{transform:translateY(0)}90%{transform:translateY(-100px)}100%{transform:translateY(0)}}@keyframes placeToDown{0%{transform:translateY(0)}100%{transform:translateY(1000px)}}@keyframes strongShake{0%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}100%{transform:translateX(0)}}@keyframes scaledShake{0%{transform:scale(1) translateX(0);box-shadow:0 0 0 transparent}20%{transform:scale(1.10) translateX(-12px);box-shadow:0 0 10px red}40%{transform:scale(1.10) translateX(12px);box-shadow:0 0 12px red}60%{transform:scale(1.10) translateX(-8px);box-shadow:0 0 10px red}80%{transform:scale(1.10) translateX(8px);box-shadow:0 0 12px red}100%{transform:scale(1) translateX(0);box-shadow:none}}@keyframes horizontalShake{0%{transform:scale(1) translateX(0);background-color:transparent}20%{transform:translateX(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateX(20px);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateX(-10px);background-color:rgba(255, 0, 0, 0.3)}80%{transform:translateX(10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translateX(0);background-color:transparent}}@keyframes verticalShake{0%{transform:translateY(0);background-color:transparent}20%{transform:translateY(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateY(20px);background-color:rgba(255, 0, 0, 0.2)}80%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.1)}100%{transform:translateY(0);background-color:transparent}}@keyframes diagonalShake{0%{transform:translate(0, 0);background-color:transparent}25%{transform:translate(20px, -20px);background-color:rgba(255, 0, 0, 0.2)}50%{transform:translate(-20px, 20px);background-color:rgba(255, 0, 0, 0.3)}75%{transform:translate(10px, -10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translate(0, 0);background-color:transparent}}@keyframes glowPulse{0%{filter:drop-shadow(0 0 5px yellow)\n drop-shadow(0 0 10px yellow)\n drop-shadow(0 0 20px yellow)\n drop-shadow(0 0 30px orange)}50%{filter:drop-shadow(0 0 10px yellow)\n drop-shadow(0 0 20px yellow)\n drop-shadow(0 0 40px yellow)\n drop-shadow(0 0 50px orange)}100%{filter:drop-shadow(0 0 5px yellow)\n drop-shadow(0 0 10px yellow)\n drop-shadow(0 0 20px yellow)\n drop-shadow(0 0 30px orange)}}";
7101
7363
  const LidoHomeStyle1 = animationCss;
7102
7364
 
7103
7365
  const lidoHomeCss = ".lido-snackbar{visibility:visible;min-width:250px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;bottom:30px;left:50%;transform:translateX(-50%);font-size:17px}.lido-dot-container{display:flex;justify-content:space-between;align-items:center;visibility:hidden;position:absolute;left:50%;padding:0 5px;z-index:1;width:100vw;max-width:100vw;box-sizing:border-box;height:0px}.lido-dot{height:18px;width:18px;margin:0 4px;background-color:#bbb;border-radius:50%;display:inline-block;transition:background-color 0.3s;cursor:pointer;z-index:1}.lido-btn-dot-container{flex-shrink:1;flex-grow:1;display:flex;justify-content:center;align-items:center;text-align:center;z-index:1;min-width:0;height:0px}.lido-dot.completed{background-color:grey}.lido-dot.current{background-color:green}.lido-dot:not(.completed):not(.current){background-color:#bbb}#lido-arrow-left,#lido-arrow-right{width:88px;height:88px;display:flex;align-items:center;justify-content:center;border-radius:12px;z-index:1000;box-shadow:0px 8px 0px 0px #8b310f;background-color:#f34d08;cursor:pointer;visibility:hidden;flex-shrink:0}#lido-arrow-left:active,#lido-arrow-right:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px}.navbar{display:flex;justify-content:center}.lido-exit-button,#main-audio{width:80px;height:80px;z-index:1000;cursor:pointer;background-color:white;display:flex;align-items:center;justify-content:center;border:4px solid #f34d08;border-radius:16px;box-shadow:0px 8px #f34d08;flex-shrink:0;}#main-audio:active,.popup-button:active .lido-exit-button:active{margin-bottom:-8px;box-shadow:0px 0px 0px 0px !important}.lido-alert-popup{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000}@media (max-width: 768px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0 8px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0 8px}.lido-dot{height:16px;width:16px;margin:0 2.5px}}@media (max-width: 480px){#lido-arrow-left,#lido-arrow-right{width:74px;height:74px;margin:0px 5px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0px 5px}.lido-dot{height:15px;width:15px;margin:0 1.5px}.lido-dot-container{padding:0 3px}}@media (max-width: 375px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 3px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 3px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 2px}}@media (max-width: 320px){#lido-arrow-left,#lido-arrow-right,.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 2px}.lido-dot{height:12px;width:12px;margin:0 0.5px}.lido-dot-container{padding:0 2px}}@media (max-width: 900px) and (orientation: landscape){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 5px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 5px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 5px}}.popup-exit-text{white-space:nowrap;font-size:22px;font-weight:600;margin-top:-8%}.lido-alert-parent{z-index:10000 !important;position:absolute;top:0;left:0}.popup-button{width:80px;height:80px;z-index:1000;cursor:pointer;display:flex;align-items:center;justify-content:center;border:4px solid #F34D08;border-radius:16px;box-shadow:0 8px 0 #F34D08}.nav-for-lanai{position:absolute;top:0%;left:0%;max-width:none;width:100%;height:auto;visibility:visible}";
@@ -7119,7 +7381,7 @@ const LidoHome = class {
7119
7381
  if (index != undefined && index == this.currentContainerIndex)
7120
7382
  return;
7121
7383
  // Clear selected values from localStorage on container transition
7122
- utils.clearLocalStorage();
7384
+ // clearmemoryStorage();
7123
7385
  if (index != undefined && index < this.containers.length) {
7124
7386
  // Move to the next container
7125
7387
  this.currentContainerIndex = index;
@@ -7149,7 +7411,7 @@ const LidoHome = class {
7149
7411
  if (this.currentContainerIndex <= 0)
7150
7412
  return;
7151
7413
  // Clear selected values from localStorage on container transition
7152
- utils.clearLocalStorage();
7414
+ // clearmemoryStorage();
7153
7415
  // Move to the previous container
7154
7416
  this.currentContainerIndex--;
7155
7417
  // Dispatch event to update the UI or state
@@ -7191,7 +7453,7 @@ const LidoHome = class {
7191
7453
  utils.dispatchGameExitEvent();
7192
7454
  utils.AudioPlayer.getI().stop();
7193
7455
  localStorage.removeItem(utils.ActivityScoreKey);
7194
- utils.clearLocalStorage();
7456
+ // clearmemoryStorage();
7195
7457
  alertElement.remove();
7196
7458
  this.currentContainerIndex = 0;
7197
7459
  }
@@ -7230,7 +7492,7 @@ const LidoHome = class {
7230
7492
  };
7231
7493
  if (this.currentContainerIndex === 0) {
7232
7494
  localStorage.removeItem(utils.ActivityScoreKey);
7233
- utils.clearLocalStorage();
7495
+ // clearmemoryStorage();
7234
7496
  }
7235
7497
  // Listen for 'NextContainerKey' event to transition between containers
7236
7498
  window.addEventListener(utils.NextContainerKey, () => {
@@ -7248,7 +7510,7 @@ const LidoHome = class {
7248
7510
  window.addEventListener('beforeunload', () => {
7249
7511
  utils.AudioPlayer.getI().stop();
7250
7512
  localStorage.removeItem(utils.ActivityScoreKey);
7251
- utils.clearLocalStorage();
7513
+ // clearmemoryStorage();
7252
7514
  });
7253
7515
  }
7254
7516
  componentDidLoad() {
@@ -7391,6 +7653,8 @@ const LidoHome = class {
7391
7653
  'lido-float': index.h("lido-float", Object.assign({}, props), children),
7392
7654
  'lido-keyboard': index.h("lido-keyboard", Object.assign({}, props), children),
7393
7655
  'lido-math-matrix': index.h("lido-math-matrix", Object.assign({}, props), children),
7656
+ 'lido-balance': index.h("lido-balance", Object.assign({}, props), children),
7657
+ 'lido-calculator': index.h("lido-calculator", Object.assign({}, props), children),
7394
7658
  };
7395
7659
  // If the tag is known, return the corresponding Stencil component, otherwise log a warning
7396
7660
  if (componentMapping[tagName]) {
@@ -7414,16 +7678,6 @@ const LidoHome = class {
7414
7678
  });
7415
7679
  this.containers = containers;
7416
7680
  }
7417
- areAllDropsFilled() {
7418
- const drops = Array.from(document.querySelectorAll('[type="drop"]'));
7419
- const drags = Array.from(document.querySelectorAll('[type="drag"]')).filter(drag => drag.getAttribute('drop-to'));
7420
- console.log('drops', drops);
7421
- console.log('drags', drags);
7422
- return drops.every(drop => {
7423
- const dropId = drop.id;
7424
- return drags.some(drag => drag.getAttribute('drop-to') === dropId);
7425
- });
7426
- }
7427
7681
  async btnpopup() {
7428
7682
  utils.setCancelBtnPopup(false);
7429
7683
  await utils.AudioPlayer.getI().stop();
@@ -7443,18 +7697,6 @@ const LidoHome = class {
7443
7697
  await new Promise(resolve => setTimeout(resolve, 300));
7444
7698
  }
7445
7699
  }
7446
- if (this.areAllDropsFilled()) {
7447
- const objectiveString = container['objective'];
7448
- const objectiveArray = JSON.parse(localStorage.getItem(utils.SelectedValuesKey) || '[]');
7449
- const res = utils.matchStringPattern(objectiveString, objectiveArray);
7450
- console.log('Resultt', res);
7451
- if (res) {
7452
- utils.triggerNextContainer();
7453
- }
7454
- }
7455
- else {
7456
- console.log('Not yet filled ');
7457
- }
7458
7700
  }
7459
7701
  scaleNavbarContainer() {
7460
7702
  setTimeout(() => {
@@ -10454,10 +10696,10 @@ const LidoKeyboard = class {
10454
10696
  const keysArray = this.keys.split(',').map(k => k.trim());
10455
10697
  const container = document.getElementById(utils.LidoContainer);
10456
10698
  const showCheck = container.getAttribute('show-check') === 'true';
10457
- return (index.h(index.Host, { key: 'b01d3c5bab495def25c14239a3c94e9f6af15b4f', class: "lido-keyboard", style: { width: this.style.width, height: this.style.height, position: 'relative', margin: this.style.margin, zIndex: this.z } }, this.keyboardInput && (index.h("div", { key: '1e475df899a9e8cead3d4ee313d6e0b09a1e766f', class: "input-area" }, index.h("input", { key: '1d27787a42dc81ba97d5045718d726683bf8f32a', type: "text", value: this.inputString, class: "input-area", readonly: true, onInput: (e) => (this.inputString = e.target.value) }), index.h("lido-text", { key: '5695c9662b22bd7c3d7c7dfc49481641e795b290', visible: showCheck ? 'true' : 'false', string: "<<", "bg-color": "black", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "100px", height: "70px", type: "click", onClick: () => {
10699
+ return (index.h(index.Host, { key: 'e4cd1fc51d8d3c87ed011120f13454bbef1883b3', class: "lido-keyboard", style: { width: this.style.width, height: this.style.height, position: 'relative', margin: this.style.margin, zIndex: this.z } }, this.keyboardInput && (index.h("div", { key: '114224c18345951e749db6f1eba242cc1179431f', class: "input-area" }, index.h("input", { key: '14741df7dc29f51420c1164ddebf60fd464fade4', type: "text", value: this.inputString, class: "input-area", readonly: true, onInput: (e) => (this.inputString = e.target.value) }), index.h("lido-text", { key: '3bb801fbcab03b58a628c4c365f46113e9829fdc', visible: showCheck ? 'true' : 'false', string: "<<", "bg-color": "black", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "100px", height: "70px", type: "click", onClick: () => {
10458
10700
  this.inputString = this.inputString.slice(0, -1);
10459
10701
  this.inputValidation(event);
10460
- } }), index.h("lido-text", { key: 'd1a786e8f4015c7aeaeffe7a677f1f7e106b3691', visible: showCheck ? 'true' : 'false', id: "lido-checkButton", string: "Enter", "bg-color": "green", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "150px", height: "70px", type: "click" }))), this.letterLength && (index.h("lido-text", { key: 'bdd01380b832949bf2abbe4481ac000c1f3a358f', visible: "true", string: `${this.numberOfClick}/${this.letterLength}`, "font-size": "60px", "font-color": "white", onEntry: "this.position='absolute'; this.right='0'; this.fontWeight='800';", x: "unset" })), index.h("div", { key: 'd54959bfe639803c7e048d5112514a7dccbf9dc4', class: "keyboard-wrapper", style: {
10702
+ } }), index.h("lido-text", { key: '46212bcfe4e5c22744d13d8235d82bdb73bce802', visible: showCheck ? 'true' : 'false', id: "lido-checkButton", string: "Enter", "bg-color": "green", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "150px", height: "70px", type: "click" }))), this.letterLength && (index.h("lido-text", { key: 'a886ac1d7ceadda37eadd4bed59bd5096d46619f', visible: "true", string: `${this.numberOfClick}/${this.letterLength}`, "font-size": "60px", "font-color": "white", onEntry: "this.position='absolute'; this.right='0'; this.fontWeight='800';", x: "unset" })), index.h("div", { key: '5238d1dc1bafda2ffab63932d1f5d29ef449bf4b', class: "keyboard-wrapper", style: {
10461
10703
  display: 'flex',
10462
10704
  flexWrap: 'wrap',
10463
10705
  justifyContent: 'center',
@@ -10481,14 +10723,14 @@ const LidoKeyboard = class {
10481
10723
  };
10482
10724
  LidoKeyboard.style = LidoKeyboardStyle0;
10483
10725
 
10484
- const lidoMathMatrixCss = ".math-matrix{width:100%;height:100%;display:flex;justify-content:center}.slot{width:100%;height:100%}.slot:hover{opacity:0.7}.slot-parent{width:100%;height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column}.slot-active{background-color:var(--active-bg-color);background-image:var(--bg-image);background-size:cover;background-position:center;background-repeat:no-repeat}.slot-inactive{background-color:var(--inactive-bg-color);background-size:cover;background-position:center;background-repeat:no-repeat}.topIndex,.leftIndex,.bottomIndex{height:100%;width:100%;text-align:center;align-content:center;font-size:30px}";
10726
+ const lidoMathMatrixCss = ".math-matrix{width:100%;height:100%;display:flex;justify-content:center}.slot{width:100%;height:100%;text-align:center;align-content:center;font-size:42px;font-weight:800;font-family:'Baloo Bhai 2';box-sizing:content-box}.slot:hover{opacity:0.7}.slot-parent{width:100%;height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column}.slot-active{background-color:var(--active-bg-color);background-image:var(--bg-image);background-size:contain;background-position:center;background-repeat:no-repeat}.slot-inactive{background-color:var(--deactive-bg-color);background-size:cover;background-position:center;background-repeat:no-repeat}.topIndex,.leftIndex,.bottomIndex{height:100%;width:100%;text-align:center;align-content:center;font-size:30px;font-weight:600;font-family:'Baloo Bhai 2'}";
10485
10727
  const LidoMathMatrixStyle0 = lidoMathMatrixCss;
10486
10728
 
10487
10729
  const LidoMathMatrix = class {
10488
10730
  constructor(hostRef) {
10489
10731
  index.registerInstance(this, hostRef);
10490
- this.rows = 7;
10491
- this.cols = 5;
10732
+ this.rows = "7";
10733
+ this.cols = "5";
10492
10734
  this.defualtFill = 0;
10493
10735
  this.leftIndex = false;
10494
10736
  this.topIndex = false;
@@ -10496,8 +10738,8 @@ const LidoMathMatrix = class {
10496
10738
  this.clickable = true;
10497
10739
  this.activeOnlyVisible = false;
10498
10740
  this.matrixImage = undefined;
10499
- this.activeBgColor = 'red';
10500
- this.inactiveBgColor = 'transparent';
10741
+ this.activeBgColor = 'transparent';
10742
+ this.deactiveBgColor = 'transparent';
10501
10743
  this.border = '2px solid green';
10502
10744
  this.height = '100%';
10503
10745
  this.width = '100%';
@@ -10506,16 +10748,30 @@ const LidoMathMatrix = class {
10506
10748
  this.margin = undefined;
10507
10749
  this.padding = undefined;
10508
10750
  this.visible = 'false';
10751
+ this.text = undefined;
10752
+ this.type = undefined;
10753
+ this.value = undefined;
10754
+ this.tabIndex = undefined;
10755
+ this.x = undefined;
10756
+ this.y = undefined;
10757
+ this.fontColor = undefined;
10758
+ this.previousFilledSlot = -1;
10759
+ this.previousFilledSlotElement = null;
10509
10760
  this.style = {};
10510
10761
  }
10762
+ updateValue(index) {
10763
+ this.el.setAttribute('value', index);
10764
+ }
10511
10765
  componentDidLoad() {
10512
10766
  const slotElements = this.el.querySelectorAll('.slot');
10767
+ utils.initEventsForElement(this.el, this.type);
10513
10768
  slotElements.forEach((el, i) => {
10514
10769
  const slot = el;
10515
10770
  slot.style.setProperty('--active-bg-color', this.activeBgColor);
10516
- slot.style.setProperty('--inactive-bg-color', this.inactiveBgColor);
10771
+ slot.style.setProperty('--deactive-bg-color', this.deactiveBgColor);
10517
10772
  this.clickable ? (slot.style.pointerEvents = '') : (slot.style.pointerEvents = 'none');
10518
10773
  slot.style.border = this.border;
10774
+ slot.style.color = this.fontColor;
10519
10775
  if (slot.className.includes('slot-active')) {
10520
10776
  slot.style.visibility = 'visible';
10521
10777
  if (this.matrixImage) {
@@ -10556,6 +10812,10 @@ const LidoMathMatrix = class {
10556
10812
  const item = el;
10557
10813
  item.style.width = `${slotMaxValues}px`;
10558
10814
  item.style.height = `${slotMaxValues}px`;
10815
+ if (this.type === 'drop' || this.type === 'drag' || this.type === 'checkerBlock') {
10816
+ this.el.style.width = 'auto';
10817
+ this.el.style.height = 'auto';
10818
+ }
10559
10819
  if ((!this.topIndex && item.classList.contains('topIndex')) ||
10560
10820
  (!this.leftIndex && item.classList.contains('leftIndex')) ||
10561
10821
  (!this.bottomIndex && item.classList.contains('bottomIndex'))) {
@@ -10574,11 +10834,16 @@ const LidoMathMatrix = class {
10574
10834
  zIndex: this.z,
10575
10835
  display: utils.parseProp(`${this.visible}`, orientation) === 'true' ? 'flex' : 'none',
10576
10836
  borderRadius: utils.parseProp(this.borderRadius, orientation),
10837
+ left: utils.parseProp(this.x, orientation),
10838
+ top: utils.parseProp(this.y, orientation),
10839
+ cols: utils.parseProp(`${this.cols}`, orientation),
10840
+ rows: utils.parseProp(`${this.rows}`, orientation),
10577
10841
  };
10842
+ // console.log("cols and rows : ", );
10578
10843
  }
10579
10844
  handleClickSlot(element) {
10580
10845
  const index = parseInt(element.className.split(' ')[1].split('-')[1]);
10581
- const slotElements = document.querySelectorAll('.slot');
10846
+ const slotElements = this.el.querySelectorAll('.slot');
10582
10847
  slotElements.forEach((el, i) => {
10583
10848
  const slotEl = el;
10584
10849
  if (i < index) {
@@ -10593,10 +10858,72 @@ const LidoMathMatrix = class {
10593
10858
  slotEl.classList.add('slot-inactive');
10594
10859
  }
10595
10860
  });
10861
+ if (this.previousFilledSlot !== -1) {
10862
+ // Clear the text from the previously filled slot
10863
+ if (this.previousFilledSlotElement !== null) {
10864
+ this.previousFilledSlotElement.textContent = '';
10865
+ }
10866
+ }
10867
+ // Display the slot value/text on the clicked slot itself
10868
+ element.textContent = index.toString();
10869
+ // Track this slot as the previously filled slot for next click
10870
+ this.previousFilledSlot = index;
10871
+ this.previousFilledSlotElement = element;
10872
+ // If the slot is the bottom-most slot for this matrix, dispatch a generic event
10873
+ // so templates or global handlers can handle bottom-slot behaviour (e.g., MultiplyBeadsAnimation).
10874
+ if (index === slotElements.length) {
10875
+ try {
10876
+ const event = new CustomEvent('math-matrix-bottom-click', {
10877
+ detail: {
10878
+ matrix: this.el,
10879
+ cols: this.style.cols,
10880
+ rows: this.style.rows,
10881
+ },
10882
+ bubbles: true,
10883
+ composed: true,
10884
+ });
10885
+ // dispatch from the host so listeners on container or document receive it
10886
+ this.el.dispatchEvent(event);
10887
+ }
10888
+ catch (err) {
10889
+ console.warn('Error dispatching math-matrix-bottom-click from handleClickSlot', err);
10890
+ }
10891
+ }
10892
+ this.updateValue(index.toString());
10893
+ // trigger the next container if right slot was clicked
10894
+ utils.validateObjectiveStatus();
10895
+ }
10896
+ getSlotData() {
10897
+ const data = {};
10898
+ if (!this.text)
10899
+ return data;
10900
+ this.text.split(',').forEach((item, index) => {
10901
+ const [rawText, rawColor] = item.split('-');
10902
+ const num = parseInt(rawText.trim());
10903
+ if (!isNaN(num)) {
10904
+ data[index] = { text: rawText.trim(), color: rawColor === null || rawColor === void 0 ? void 0 : rawColor.trim() };
10905
+ }
10906
+ });
10907
+ return data;
10596
10908
  }
10597
10909
  render() {
10598
10910
  let slotNumber = 1;
10599
- return (index.h(index.Host, { key: 'bfde8ad01e4b47a0b13dc0fd325d78e5014cfef9', class: "math-matrix", style: { height: this.style.height, width: this.style.width, z: this.style.z, display: this.style.display } }, Array.from({ length: this.rows + 1 }, (_, rowIndex) => (index.h("div", { class: "slot-parent", key: `row-${rowIndex}` }, index.h("div", { style: rowIndex === 0 && { visibility: 'hidden' }, class: "topIndex" }, rowIndex), Array.from({ length: this.cols }, (_, colIndex) => rowIndex === 0 ? (index.h("div", { class: "leftIndex" }, ++colIndex)) : (index.h("div", { class: `slot slot-${slotNumber++} ${this.defualtFill + 1 >= slotNumber ? 'slot-active' : 'slot-inactive'}`, onClick: () => this.handleClickSlot(event.target), key: `slot-${rowIndex}-${colIndex}`, style: { borderRadius: this.style.borderRadius } }))), index.h("div", { style: rowIndex === 0 && { visibility: 'hidden' }, class: "bottomIndex" }, this.cols * rowIndex))))));
10911
+ const slotData = this.getSlotData();
10912
+ return (index.h(index.Host, { key: '66d627c33553f3f6473c6d1b465c9af7cc6741d3', class: "math-matrix", style: {
10913
+ height: this.style.height,
10914
+ width: this.style.width,
10915
+ z: this.style.z,
10916
+ display: this.style.display,
10917
+ top: this.style.top,
10918
+ left: this.style.left,
10919
+ }, type: this.type, value: this.value, "tab-index": this.tabIndex, rows: this.style.rows, cols: this.style.cols, text: this.text }, Array.from({ length: parseInt(this.style.rows) + 1 }, (_, rowIndex) => (index.h("div", { class: "slot-parent", key: `row-${rowIndex}` }, index.h("div", { style: rowIndex === 0 && { visibility: 'hidden' }, class: "topIndex" }, rowIndex), Array.from({ length: parseInt(this.style.cols) }, (_, colIndex) => {
10920
+ var _a, _b;
10921
+ return rowIndex === 0 ? (index.h("div", { class: "leftIndex" }, ++colIndex)) : (index.h("div", { class: `slot slot-${slotNumber} ${this.defualtFill >= slotNumber ? 'slot-active' : 'slot-inactive'}`, onClick: (ev) => this.handleClickSlot(ev.currentTarget), key: `slot-${rowIndex}-${colIndex}`, style: {
10922
+ borderRadius: this.style.borderRadius,
10923
+ backgroundColor: ((_a = slotData[slotNumber - 1]) === null || _a === void 0 ? void 0 : _a.color) || '',
10924
+ } }, (_b = slotData[slotNumber - 1]) === null || _b === void 0 ? void 0 :
10925
+ _b.text, slotNumber++ && null));
10926
+ }), index.h("div", { style: rowIndex === 0 && { visibility: 'hidden' }, class: "bottomIndex" }, parseInt(this.style.cols) * rowIndex))))));
10600
10927
  }
10601
10928
  get el() { return index.getElement(this); }
10602
10929
  };
@@ -10665,7 +10992,7 @@ const LidoPos = class {
10665
10992
  };
10666
10993
  }
10667
10994
  render() {
10668
- return (index.h(index.Host, { key: '3c032fcd1655362851d75d7ed55b26a9d12b7e6f', id: this.id, class: "lido-pos", type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, value: this.value, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, index.h("slot", { key: '99bb4083a93a247133cc6df2d439c437e3d5cb1b' })));
10995
+ return (index.h(index.Host, { key: '20b34af6af7a1f061789d00ade88dc79eec595ef', id: this.id, class: "lido-pos", type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, value: this.value, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, index.h("slot", { key: 'dae7759306330a01ecfb66be08debe8ec1f97d6e' })));
10669
10996
  }
10670
10997
  get el() { return index.getElement(this); }
10671
10998
  };
@@ -10746,7 +11073,7 @@ const LidoRandom = class {
10746
11073
  backgroundColor: this.bgColor,
10747
11074
  margin: this.margin,
10748
11075
  };
10749
- return (index.h(index.Host, { key: 'a5f930317fec6552ac0c9daf09da0348a49dcbf0', class: "lido-random", type: this.type, "tab-index": this.tabIndex, value: this.value, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, minDrops: this.minDrops, maxDrops: this.maxDrops, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, index.h("slot", { key: '1451bbc2df4f459d4af93bf6b0a6dfc52dc2113e' })));
11076
+ return (index.h(index.Host, { key: '328c7a0533a52a1be5cee0d71fc7a43338e5290f', class: "lido-random", type: this.type, "tab-index": this.tabIndex, value: this.value, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, minDrops: this.minDrops, maxDrops: this.maxDrops, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, index.h("slot", { key: 'c1a93405cbbd2a06a92134c4ff5853204215c317' })));
10750
11077
  }
10751
11078
  get el() { return index.getElement(this); }
10752
11079
  };
@@ -10890,7 +11217,7 @@ const LidoRow = class {
10890
11217
  };
10891
11218
  }
10892
11219
  render() {
10893
- return (index.h(index.Host, { key: '03f15dcfc2abc394d0313d4b40dd6465a19dc34a', class: "lido-row", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }, index.h("slot", { key: 'fbb5e6ce6b8436d718c043561e0d92908baaabdc' })));
11220
+ return (index.h(index.Host, { key: '4c1f45afe8866df81a6a798afe348e03fa1f4292', class: "lido-row", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }, index.h("slot", { key: '194de56621025a4b1a4fdb6ccae347f34dc19fdb' })));
10894
11221
  }
10895
11222
  get el() { return index.getElement(this); }
10896
11223
  };
@@ -10947,7 +11274,7 @@ const LidoShape = class {
10947
11274
  backgroundColor: this.shapeType !== 'polygon' ? this.bgColor : 'transparent', // Apply background only if not a polygon
10948
11275
  margin: this.margin,
10949
11276
  };
10950
- return (index.h(index.Host, { key: '887f02445ef694f84ebc85e05e4dfb740d0bc78b', class: `lido-shape ${this.shapeType}`, value: this.value, type: this.type, "tab-index": this.tabIndex, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }));
11277
+ return (index.h(index.Host, { key: '6712d974e85c5d82dabb5ed0d482ece4b18af16a', class: `lido-shape ${this.shapeType}`, value: this.value, type: this.type, "tab-index": this.tabIndex, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }));
10951
11278
  }
10952
11279
  get el() { return index.getElement(this); }
10953
11280
  };
@@ -11146,7 +11473,7 @@ const LidoSlideFill = class {
11146
11473
  }
11147
11474
  }
11148
11475
  render() {
11149
- return (index.h(index.Host, { key: 'a7be214e99b8917ebe3d4ae0275036e77967d3b7', id: this.id, class: "lido-slide-fill", src: this.src, fill: this.fill, fillDirection: this.fillDirection, slider: this.slider, style: this.style, min: this.min, max: this.max, division: this.division, numberType: this.numberType, onEntry: this.onEntry, type: this.type, "disable-speak": this.disableSpeak }, index.h("div", { key: 'e3210823de751a3fdff90b54bf93fc13890ca28a', innerHTML: this.svgContent, class: "svg-element" })));
11476
+ return (index.h(index.Host, { key: '57ee54a6a0e7d3bbac893ce535a3375ea529e75a', id: this.id, class: "lido-slide-fill", src: this.src, fill: this.fill, fillDirection: this.fillDirection, slider: this.slider, style: this.style, min: this.min, max: this.max, division: this.division, numberType: this.numberType, onEntry: this.onEntry, type: this.type, "disable-speak": this.disableSpeak }, index.h("div", { key: '386330e0562851f2f00aba169018c23bf5ffa4b7', innerHTML: this.svgContent, class: "svg-element" })));
11150
11477
  }
11151
11478
  get el() { return index.getElement(this); }
11152
11479
  static get watchers() { return {
@@ -11281,7 +11608,7 @@ const LidoText = class {
11281
11608
  }
11282
11609
  }
11283
11610
  render() {
11284
- return (index.h(index.Host, { key: '44444c496287fcacce28fa0073d1b87a80d07874', class: "lido-text", value: this.value, type: this.type, "tab-index": this.tabIndex, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, minDrops: this.minDrops, maxDrops: this.maxDrops, id: this.id, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, "span-type": this.spanType, "disable-speak": this.disableSpeak }, this.spanType !== '' ? index.h("div", { class: "lido-text-content" }, this.string) : this.string));
11611
+ return (index.h(index.Host, { key: '6b5b31a544cc63cfd4030aa1b56e41cc255b12cf', class: "lido-text", value: this.value, type: this.type, "tab-index": this.tabIndex, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, minDrops: this.minDrops, maxDrops: this.maxDrops, id: this.id, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, "span-type": this.spanType, "disable-speak": this.disableSpeak }, this.spanType !== '' ? index.h("div", { class: "lido-text-content" }, this.string) : this.string));
11285
11612
  }
11286
11613
  get el() { return index.getElement(this); }
11287
11614
  };
@@ -11322,7 +11649,6 @@ const LidoTrace = class {
11322
11649
  this.fileIndex = -1;
11323
11650
  this.isDragging = false;
11324
11651
  this.activePointerId = null;
11325
- this.freeTraceUpdateCounter = 0;
11326
11652
  this.idleTimer = null;
11327
11653
  this.fingerImg = null;
11328
11654
  }
@@ -11339,8 +11665,8 @@ const LidoTrace = class {
11339
11665
  circle: null,
11340
11666
  paths: [],
11341
11667
  svg: null,
11342
- proximityThreshold: 375, // Increased general proximity threshold (was 100)
11343
- freeTraceProximityThreshold: 350, // Increased proximity for free trace (was 50)
11668
+ proximityThreshold: 100, // General proximity threshold
11669
+ freeTraceProximityThreshold: 50, // Reduced proximity threshold for free trace
11344
11670
  rafId: null,
11345
11671
  pointerMoveEvent: null,
11346
11672
  activePointerId: null,
@@ -11676,7 +12002,7 @@ const LidoTrace = class {
11676
12002
  }
11677
12003
  // Modified handlePointerMove function
11678
12004
  handlePointerMove(state) {
11679
- var _a, _b, _c, _d, _e, _f;
12005
+ var _a, _b, _c, _d;
11680
12006
  if (!state.isDragging)
11681
12007
  return;
11682
12008
  if (!state.circle || !state.paths || state.paths.length === 0)
@@ -11688,15 +12014,6 @@ const LidoTrace = class {
11688
12014
  x: parseFloat(state.circle.getAttribute('cx')),
11689
12015
  y: parseFloat(state.circle.getAttribute('cy')),
11690
12016
  };
11691
- // Only update if pointer moved a minimum distance (to reduce unnecessary updates)
11692
- const MOVE_THRESHOLD = 1; // px
11693
- if (state.lastPointerPos) {
11694
- const dx = pointerPos.x - state.lastPointerPos.x;
11695
- const dy = pointerPos.y - state.lastPointerPos.y;
11696
- if (dx * dx + dy * dy < MOVE_THRESHOLD * MOVE_THRESHOLD) {
11697
- return;
11698
- }
11699
- }
11700
12017
  const currentPath = state.paths[state.currentPathIndex];
11701
12018
  if (!currentPath) {
11702
12019
  console.error('No valid path found at the current index');
@@ -11724,76 +12041,48 @@ const LidoTrace = class {
11724
12041
  }
11725
12042
  // For free trace mode and blind free trace mode, allow free drawing only if within the reduced proximity threshold
11726
12043
  if (state.mode === utils.TraceMode.FreeTrace || state.mode === utils.TraceMode.BlindFreeTrace) {
11727
- // Throttle: Only update every 2nd event (for reducing excessive dom updates)
11728
- this.freeTraceUpdateCounter = (this.freeTraceUpdateCounter || 0) + 1;
11729
- if (this.freeTraceUpdateCounter % 2 !== 0) {
11730
- return;
11731
- }
11732
12044
  // Initialize the currentFreePath array if it's not created
11733
12045
  if (!state.currentFreePath) {
11734
12046
  state.currentFreePath = [];
11735
12047
  }
11736
- // Create a new polyline element if it's the first trace for the current path index
12048
+ // Create a new path element if it's the first trace for the current path index
11737
12049
  if (!state.currentFreePath[state.currentPathIndex]) {
11738
- const newPolyline = document.createElementNS('http://www.w3.org/2000/svg', 'polyline');
12050
+ const newPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
12051
+ // newPath.setAttribute('stroke', 'green');
11739
12052
  const strokeWidth = state.paths[state.currentPathIndex].style['stroke-width'] || state.paths[state.currentPathIndex].getAttribute('stroke-width');
11740
- newPolyline.setAttribute('stroke-width', strokeWidth);
11741
- newPolyline.setAttribute('fill', 'none');
11742
- newPolyline.setAttribute('stroke-linecap', 'round');
11743
- newPolyline.setAttribute('stroke', 'lightgreen');
11744
- newPolyline.setAttribute('points', `${pointerPos.x},${pointerPos.y}`);
11745
- (_a = state.svg) === null || _a === void 0 ? void 0 : _a.appendChild(newPolyline);
11746
- state.currentFreePath[state.currentPathIndex] = newPolyline;
11747
- // Store points array for this polyline
11748
- state.currentFreePolylinePoints = state.currentFreePolylinePoints || [];
11749
- state.currentFreePolylinePoints[state.currentPathIndex] = [
11750
- { x: pointerPos.x, y: pointerPos.y }
11751
- ];
12053
+ newPath.setAttribute('stroke-width', strokeWidth);
12054
+ newPath.setAttribute('fill', 'none');
12055
+ newPath.setAttribute('stroke-linecap', 'round');
12056
+ newPath.setAttribute('stroke', 'lightgreen');
12057
+ // Start the new path at the current pointer position
12058
+ newPath.setAttribute('d', `M${pointerPos.x},${pointerPos.y}`);
12059
+ (_a = state.svg) === null || _a === void 0 ? void 0 : _a.appendChild(newPath);
12060
+ state.currentFreePath[state.currentPathIndex] = newPath;
11752
12061
  // Reset lastPointerPos for the new path
11753
12062
  state.lastPointerPos = pointerPos;
11754
- // Add a points counter to limit path growth
11755
- state.freeTracePointsCount = 1;
11756
- }
11757
- // Limit the number of points in the free trace path for performance
11758
- const MAX_FREE_TRACE_POINTS = 10;
11759
- state.freeTracePointsCount = (state.freeTracePointsCount || 1) + 1;
11760
- if (state.freeTracePointsCount > MAX_FREE_TRACE_POINTS) {
11761
- // If limit reached, skip adding more points
11762
- return;
11763
12063
  }
11764
- // Add the new point to the polyline's points array
11765
- state.currentFreePolylinePoints = state.currentFreePolylinePoints || [];
11766
- let pointsArr = state.currentFreePolylinePoints[state.currentPathIndex] || [];
11767
- pointsArr.push({ x: pointerPos.x, y: pointerPos.y });
11768
- state.currentFreePolylinePoints[state.currentPathIndex] = pointsArr;
11769
- // Update the polyline's points attribute
11770
- const pointsStr = pointsArr.map(pt => `${pt.x},${pt.y}`).join(' ');
11771
- state.currentFreePath[state.currentPathIndex].setAttribute('points', pointsStr);
12064
+ // Get the previous position to draw a smooth curve
12065
+ const previousPos = state.lastPointerPos || pointerPos;
12066
+ // Create a quadratic curve from the previous point to the current point
12067
+ const newPathData = state.currentFreePath[state.currentPathIndex].getAttribute('d');
12068
+ const midPointX = (previousPos.x + pointerPos.x) / 2;
12069
+ const midPointY = (previousPos.y + pointerPos.y) / 2;
12070
+ const updatedPathData = `${newPathData} Q ${previousPos.x},${previousPos.y} ${midPointX},${midPointY}`;
12071
+ // Update the path's 'd' attribute with the new curve
12072
+ state.currentFreePath[state.currentPathIndex].setAttribute('d', updatedPathData);
11772
12073
  // Move the draggable circle with the freehand trace
11773
12074
  state.circle.setAttribute('cx', pointerPos.x.toString());
11774
12075
  state.circle.setAttribute('cy', pointerPos.y.toString());
11775
- // Only re-append if not already children list
11776
- const childNodes = (_b = state.svg) === null || _b === void 0 ? void 0 : _b.childNodes;
11777
- let circleFound = false;
11778
- for (let i = 0; i < ((childNodes === null || childNodes === void 0 ? void 0 : childNodes.length) || 0); i++) {
11779
- const child = childNodes === null || childNodes === void 0 ? void 0 : childNodes.item(i);
11780
- if (child && child.tagName === 'circle') {
11781
- circleFound = true;
11782
- break; // No need to continue once found
11783
- }
11784
- }
11785
- // If not found, append the circle
11786
- if (!circleFound && state.circle) {
11787
- (_c = state.svg) === null || _c === void 0 ? void 0 : _c.appendChild(state.circle);
11788
- }
12076
+ // Make sure the red dot (circle) is always on top
12077
+ (_b = state.svg) === null || _b === void 0 ? void 0 : _b.appendChild(state.circle); // This moves the circle to the last child, making it the topmost
11789
12078
  // Update the last pointer position
11790
12079
  state.lastPointerPos = pointerPos;
11791
- // For polyline, estimate the end by number of points (not path length)
11792
- if (pointsArr.length >= MAX_FREE_TRACE_POINTS) {
12080
+ const currentPathLength = currentPath.getTotalLength();
12081
+ const distanceToEnd = currentPathLength - closestPoint.length;
12082
+ // If close to the end of the path, move to the next path
12083
+ if (distanceToEnd < 5) {
11793
12084
  this.moveToNextPath(state);
11794
12085
  state.currentFreePath[state.currentPathIndex] = null; // Reset free path for next path
11795
- state.currentFreePolylinePoints[state.currentPathIndex] = [];
11796
- state.freeTracePointsCount = 0;
11797
12086
  }
11798
12087
  // this.resetIdleTimer(state); // ← keep timer alive
11799
12088
  return; // Exit early since we're in free trace or blind free trace mode
@@ -11801,62 +12090,24 @@ const LidoTrace = class {
11801
12090
  // In normal modes, allow movement and drawing only within the general proximity threshold
11802
12091
  if (state.isDragging && closestPoint.length >= state.lastLength) {
11803
12092
  state.lastLength = closestPoint.length;
11804
- // Only update the circle if it moved enough
11805
- if (Math.abs(closestPoint.x - circlePos.x) > MOVE_THRESHOLD || Math.abs(closestPoint.y - circlePos.y) > MOVE_THRESHOLD) {
11806
- state.circle.setAttribute('cx', closestPoint.x.toString());
11807
- state.circle.setAttribute('cy', closestPoint.y.toString());
11808
- }
11809
- // Only re-append if not already children list
11810
- const childNodes = (_d = state.svg) === null || _d === void 0 ? void 0 : _d.childNodes;
11811
- let circleFound = false;
11812
- for (let i = 0; i < ((childNodes === null || childNodes === void 0 ? void 0 : childNodes.length) || 0); i++) {
11813
- const child = childNodes === null || childNodes === void 0 ? void 0 : childNodes.item(i);
11814
- if (child && child.tagName === 'circle') {
11815
- circleFound = true;
11816
- break; // No need to continue once found
11817
- }
11818
- }
11819
- // If not found, append the circle
11820
- if (!circleFound && state.circle) {
11821
- (_e = state.svg) === null || _e === void 0 ? void 0 : _e.appendChild(state.circle);
11822
- }
11823
- (_f = currentPath.greenPath) === null || _f === void 0 ? void 0 : _f.setAttribute('stroke-dashoffset', (state.totalPathLength - state.lastLength).toString());
11824
- // Completion logic for closed paths: only allow completion if almost all points are traced
11825
- const COMPLETION_THRESHOLD = 0.90; // 90% of the path must be traced
11826
- let percentComplete = state.lastLength / state.totalPathLength;
11827
- let startPoint = currentPath.getPointAtLength(0);
11828
- let endPoint = currentPath.getPointAtLength(currentPath.getTotalLength());
11829
- let pathIsClosed = this.getDistanceSquared(startPoint, endPoint) < 200; // threshold for overlap
11830
- console.log('lastLength, totalPathLength', state.lastLength, state.totalPathLength);
11831
- console.log('percentComplete', percentComplete);
11832
- console.log('startPoint, endPoint', startPoint, endPoint);
11833
- console.log('distance squared between start & end:', this.getDistanceSquared(startPoint, endPoint));
11834
- console.log('pathIsClosed:', pathIsClosed);
11835
- if (pathIsClosed && state.totalPathLength > 50) {
11836
- if (percentComplete >= COMPLETION_THRESHOLD) {
11837
- if (state.currentPathIndex < state.paths.length - 1) {
11838
- this.moveToNextPath(state);
11839
- }
11840
- else if (state.currentPathIndex === state.paths.length - 1) {
11841
- this.moveToNextContainer();
11842
- }
11843
- }
11844
- }
11845
- else {
11846
- // For open paths, allow completion if near the end
11847
- if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex < state.paths.length - 1) {
11848
- this.moveToNextPath(state);
11849
- }
11850
- else if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex === state.paths.length - 1) {
11851
- this.moveToNextContainer();
11852
- }
11853
- }
12093
+ state.circle.setAttribute('cx', closestPoint.x.toString());
12094
+ state.circle.setAttribute('cy', closestPoint.y.toString());
12095
+ // Make sure the red dot (circle) is always on top
12096
+ (_c = state.svg) === null || _c === void 0 ? void 0 : _c.appendChild(state.circle); // This moves the circle to the last child, making it the topmost
12097
+ (_d = currentPath.greenPath) === null || _d === void 0 ? void 0 : _d.setAttribute('stroke-dashoffset', (state.totalPathLength - state.lastLength).toString());
12098
+ }
12099
+ // Check if the current path is completed
12100
+ if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex < state.paths.length - 1) {
12101
+ this.moveToNextPath(state);
12102
+ }
12103
+ else if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex === state.paths.length - 1) {
12104
+ // this.loadAnotherSVG(state, true);
12105
+ this.moveToNextContainer();
11854
12106
  }
11855
12107
  // this.resetIdleTimer(state); // ← keep timer alive
11856
12108
  }
11857
12109
  // Move to the next container after completing the current SVG
11858
12110
  async moveToNextContainer() {
11859
- this.isDragging = false;
11860
12111
  if (this.moving)
11861
12112
  return; // Prevent multiple calls
11862
12113
  this.moving = true; // Set moving to true to prevent re-entrance
@@ -11867,19 +12118,17 @@ const LidoTrace = class {
11867
12118
  await this.playTraceAnimation();
11868
12119
  }
11869
12120
  console.log(`Moving to next container after SVG index: ${this.currentSvgIndex}`);
11870
- console.log('Total SVGs:', this.svgUrls.length);
12121
+ const delay = 1000; // milliseconds
11871
12122
  if (this.currentSvgIndex < this.svgUrls.length - 1) {
12123
+ await new Promise(resolve => setTimeout(resolve, delay));
11872
12124
  this.currentSvgIndex++;
11873
12125
  await this.initializeSVG();
11874
12126
  this.moving = false;
11875
12127
  return;
11876
12128
  }
11877
- console.log('onCorrect:', this.onCorrect);
11878
- console.log('el :', this.el);
11879
12129
  if (this.el && this.onCorrect) {
11880
12130
  await utils.executeActions(this.onCorrect, this.el);
11881
12131
  }
11882
- console.log('All SVGs completed, hiding component.');
11883
12132
  utils.triggerNextContainer();
11884
12133
  }
11885
12134
  // Get the pointer position relative to the SVG
@@ -11897,13 +12146,13 @@ const LidoTrace = class {
11897
12146
  const dy = p1.y - p2.y;
11898
12147
  return dx * dx + dy * dy;
11899
12148
  }
11900
- // Find the closest point on the given path to the specified point using two-pass sampling (optimized)
12149
+ // Find the closest point on the given path to the specified point using two-pass sampling
11901
12150
  getClosestPointOnPath(pathNode, point) {
11902
12151
  const pathLength = pathNode.getTotalLength();
11903
12152
  let closestPoint = { x: 0, y: 0, length: 0 };
11904
12153
  let minDistanceSquared = Infinity;
11905
- // Optimized: Increase coarse steps for better performance
11906
- const coarseStep = 40; // was 20
12154
+ // First pass: coarse sampling
12155
+ const coarseStep = 20; // Increased step for better performance
11907
12156
  let coarseClosestPoint = { x: 0, y: 0, length: 0 };
11908
12157
  let coarseMinDistanceSquared = Infinity;
11909
12158
  for (let i = 0; i <= pathLength; i += coarseStep) {
@@ -11919,7 +12168,7 @@ const LidoTrace = class {
11919
12168
  }
11920
12169
  }
11921
12170
  // Second pass: fine sampling around coarseClosestPoint
11922
- const fineStep = 6; // was 2
12171
+ const fineStep = 2; // Increased step to reduce computations
11923
12172
  const searchStart = Math.max(coarseClosestPoint.length - coarseStep, 0);
11924
12173
  const searchEnd = Math.min(coarseClosestPoint.length + coarseStep, pathLength);
11925
12174
  for (let i = searchStart; i <= searchEnd; i += fineStep) {
@@ -12079,7 +12328,7 @@ const LidoTrace = class {
12079
12328
  };
12080
12329
  }
12081
12330
  render() {
12082
- return (index.h(index.Host, { key: 'ca50ce7efcc822c69b8bd673993dace0b7ccad75', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, index.h("div", { key: 'e473c6c488d952be730ee0a659d216afe41d34a2', style: this.style, id: "lido-svgContainer" })));
12331
+ return (index.h(index.Host, { key: '6be6d97477a80afc0275eef5b17718a5f43ce358', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, index.h("div", { key: '4e650d7142c61549aec021fd2a8da4e592eaf94e', style: this.style, id: "lido-svgContainer" })));
12083
12332
  }
12084
12333
  static get assetsDirs() { return ["svg", "images"]; }
12085
12334
  get el() { return index.getElement(this); }
@@ -12167,13 +12416,15 @@ const LidoWrap = class {
12167
12416
  };
12168
12417
  }
12169
12418
  render() {
12170
- return (index.h(index.Host, { key: '8f9a578e3bf8c491373b7564b93c05de92a3e1a7', class: "lido-wrap", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, disableSpeak: this.disableSpeak }, index.h("slot", { key: '0dbba1d2c88bac9a29bb81340698f5f3cb36c7be' })));
12419
+ return (index.h(index.Host, { key: '7e2bb4af31b5aff0f063a9f6c3cab96cdd25f31f', class: "lido-wrap", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, disableSpeak: this.disableSpeak }, index.h("slot", { key: '03179b28e45692e61aff0bf3634ef0a72bab0726' })));
12171
12420
  }
12172
12421
  get el() { return index.getElement(this); }
12173
12422
  };
12174
12423
  LidoWrap.style = LidoWrapStyle0;
12175
12424
 
12176
12425
  exports.lido_avatar = LidoAvatar;
12426
+ exports.lido_balance = LidoBalance;
12427
+ exports.lido_calculator = LidoCalculator;
12177
12428
  exports.lido_cell = LidoCell;
12178
12429
  exports.lido_col = LidoCol;
12179
12430
  exports.lido_container = LidoContainer;