crmbonus-component-wake 0.0.26 → 0.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  3. package/dist/cjs/app-modal_2.cjs.entry.js +134 -0
  4. package/dist/cjs/app-modal_2.cjs.entry.js.map +1 -0
  5. package/dist/cjs/crm-bonus.cjs.entry.js +55 -0
  6. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
  7. package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
  8. package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
  9. package/dist/cjs/crmbonus.service-8412ddbf.js +3798 -0
  10. package/dist/cjs/crmbonus.service-8412ddbf.js.map +1 -0
  11. package/dist/cjs/giftback-finish_5.cjs.entry.js +155 -0
  12. package/dist/cjs/giftback-finish_5.cjs.entry.js.map +1 -0
  13. package/dist/cjs/index-52d8a075.js +1248 -0
  14. package/dist/cjs/index-52d8a075.js.map +1 -0
  15. package/dist/cjs/index.cjs.js +11 -0
  16. package/dist/cjs/index.cjs.js.map +1 -0
  17. package/dist/cjs/loader.cjs.js +17 -0
  18. package/dist/cjs/loader.cjs.js.map +1 -0
  19. package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
  20. package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
  21. package/dist/cjs/pedido-finalizado.cjs.entry.js +36 -0
  22. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
  23. package/dist/collection/collection-manifest.json +21 -0
  24. package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
  25. package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
  26. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
  27. package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
  28. package/dist/collection/components/crm-bonus/crm-bonus.css +20 -0
  29. package/dist/collection/components/crm-bonus/crm-bonus.js +132 -0
  30. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
  31. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +32 -0
  32. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +216 -0
  33. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
  34. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
  35. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
  36. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
  37. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +74 -0
  38. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +127 -0
  39. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
  40. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +109 -0
  41. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
  42. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
  43. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
  44. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
  45. package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
  46. package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
  47. package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
  48. package/dist/collection/components/modal/app-modal.css +45 -0
  49. package/dist/collection/components/modal/app-modal.js +83 -0
  50. package/dist/collection/components/modal/app-modal.js.map +1 -0
  51. package/dist/collection/components/pedido/pedido.js +83 -0
  52. package/dist/collection/components/pedido/pedido.js.map +1 -0
  53. package/dist/collection/components/phone/phone-input-mask.css +47 -0
  54. package/dist/collection/components/phone/phone-input-mask.js +90 -0
  55. package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
  56. package/dist/collection/contants/index.js +8 -0
  57. package/dist/collection/contants/index.js.map +1 -0
  58. package/dist/collection/contants/mocks.js +28 -0
  59. package/dist/collection/contants/mocks.js.map +1 -0
  60. package/dist/collection/dto/pin.sent.js +2 -0
  61. package/dist/collection/dto/pin.sent.js.map +1 -0
  62. package/dist/collection/dto/update.order.dto.js +2 -0
  63. package/dist/collection/dto/update.order.dto.js.map +1 -0
  64. package/dist/collection/dto/validate.pin.bonus.js +2 -0
  65. package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
  66. package/dist/collection/index.js +11 -0
  67. package/dist/collection/index.js.map +1 -0
  68. package/dist/collection/services/crmbonus.service.js +42 -0
  69. package/dist/collection/services/crmbonus.service.js.map +1 -0
  70. package/dist/collection/utils/utils.js +4 -0
  71. package/dist/collection/utils/utils.js.map +1 -0
  72. package/dist/components/app-modal.js +8 -0
  73. package/dist/components/app-modal.js.map +1 -0
  74. package/dist/components/crm-bonus-form.js +8 -0
  75. package/dist/components/crm-bonus-form.js.map +1 -0
  76. package/dist/components/crm-bonus.js +126 -0
  77. package/dist/components/crm-bonus.js.map +1 -0
  78. package/dist/components/giftback-finish.js +8 -0
  79. package/dist/components/giftback-finish.js.map +1 -0
  80. package/dist/components/giftback-pin.js +8 -0
  81. package/dist/components/giftback-pin.js.map +1 -0
  82. package/dist/components/giftback-progress.js +8 -0
  83. package/dist/components/giftback-progress.js.map +1 -0
  84. package/dist/components/index.js +9 -0
  85. package/dist/components/index.js.map +1 -0
  86. package/dist/components/loading-spinner.js +8 -0
  87. package/dist/components/loading-spinner.js.map +1 -0
  88. package/dist/{crmbonus-component-wake/crmbonus.service-5208f883.js → components/p-374de9ae.js} +91 -166
  89. package/dist/components/p-374de9ae.js.map +1 -0
  90. package/dist/components/p-462c12d8.js +69 -0
  91. package/dist/components/p-462c12d8.js.map +1 -0
  92. package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-6442ffce.js} +39 -9
  93. package/dist/components/p-6442ffce.js.map +1 -0
  94. package/dist/components/p-878ce0aa.js +174 -0
  95. package/dist/components/p-878ce0aa.js.map +1 -0
  96. package/dist/components/p-8fcf8924.js +52 -0
  97. package/dist/components/p-8fcf8924.js.map +1 -0
  98. package/dist/components/p-cb5a1fdf.js +39 -0
  99. package/dist/components/p-cb5a1fdf.js.map +1 -0
  100. package/dist/components/p-cbade307.js +36 -0
  101. package/dist/components/p-cbade307.js.map +1 -0
  102. package/dist/{crmbonus-component-wake/phone-input-mask.entry.js → components/p-e40cf14d.js} +30 -9
  103. package/dist/components/p-e40cf14d.js.map +1 -0
  104. package/dist/components/p-e816fb90.js +43 -0
  105. package/dist/components/p-e816fb90.js.map +1 -0
  106. package/dist/components/p-faf7103e.js +1064 -0
  107. package/dist/components/p-faf7103e.js.map +1 -0
  108. package/dist/components/pedido-finalizado.js +54 -0
  109. package/dist/components/pedido-finalizado.js.map +1 -0
  110. package/dist/components/phone-input-mask.js +8 -0
  111. package/dist/components/phone-input-mask.js.map +1 -0
  112. package/dist/components/phone-input.js +8 -0
  113. package/dist/components/phone-input.js.map +1 -0
  114. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
  115. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  116. package/dist/crmbonus-component-wake/index.esm.js +1 -16
  117. package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
  118. package/dist/crmbonus-component-wake/p-374de9ae.js +2 -0
  119. package/dist/crmbonus-component-wake/p-374de9ae.js.map +1 -0
  120. package/dist/crmbonus-component-wake/p-4306a717.entry.js +2 -0
  121. package/dist/crmbonus-component-wake/p-4306a717.entry.js.map +1 -0
  122. package/dist/crmbonus-component-wake/p-72510682.js +3 -0
  123. package/dist/crmbonus-component-wake/p-72510682.js.map +1 -0
  124. package/dist/crmbonus-component-wake/p-9985f639.entry.js +2 -0
  125. package/dist/crmbonus-component-wake/p-9985f639.entry.js.map +1 -0
  126. package/dist/crmbonus-component-wake/p-be1a56de.entry.js +2 -0
  127. package/dist/crmbonus-component-wake/p-be1a56de.entry.js.map +1 -0
  128. package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
  129. package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
  130. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js +2 -0
  131. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js.map +1 -0
  132. package/dist/crmbonus-component-wake/p-f74e4a71.entry.js +2 -0
  133. package/dist/crmbonus-component-wake/p-f74e4a71.entry.js.map +1 -0
  134. package/dist/env.js +5 -0
  135. package/dist/env.js.map +1 -0
  136. package/dist/{crmbonus-component-wake/crm-bonus-form.entry.js → esm/app-modal_2.entry.js} +26 -6
  137. package/dist/esm/app-modal_2.entry.js.map +1 -0
  138. package/dist/{crmbonus-component-wake → esm}/crm-bonus.entry.js +5 -4
  139. package/dist/esm/crm-bonus.entry.js.map +1 -0
  140. package/dist/esm/crmbonus-component-wake.js +22 -0
  141. package/dist/esm/crmbonus-component-wake.js.map +1 -0
  142. package/dist/esm/crmbonus.service-053a9e38.js +3796 -0
  143. package/dist/esm/crmbonus.service-053a9e38.js.map +1 -0
  144. package/dist/esm/giftback-finish_5.entry.js +147 -0
  145. package/dist/esm/giftback-finish_5.entry.js.map +1 -0
  146. package/dist/esm/index-9f7bde48.js +1220 -0
  147. package/dist/esm/index-9f7bde48.js.map +1 -0
  148. package/dist/esm/index.js +7 -0
  149. package/dist/esm/index.js.map +1 -0
  150. package/dist/esm/loader.js +13 -0
  151. package/dist/esm/loader.js.map +1 -0
  152. package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +4 -3
  153. package/dist/esm/loading-spinner.entry.js.map +1 -0
  154. package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +3 -3
  155. package/dist/esm/pedido-finalizado.entry.js.map +1 -0
  156. package/dist/index.cjs.js +1 -0
  157. package/dist/index.js +1 -0
  158. package/package.json +1 -1
  159. package/dist/crmbonus-component-wake/app-modal.entry.js +0 -23
  160. package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
  161. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +0 -1
  162. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
  163. package/dist/crmbonus-component-wake/crmbonus.service-5208f883.js.map +0 -1
  164. package/dist/crmbonus-component-wake/giftback-finish.entry.js +0 -19
  165. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
  166. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
  167. package/dist/crmbonus-component-wake/giftback-progress.entry.js +0 -40
  168. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
  169. package/dist/crmbonus-component-wake/index-f557ce7c.js +0 -3039
  170. package/dist/crmbonus-component-wake/index-f557ce7c.js.map +0 -1
  171. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
  172. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
  173. package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
  174. package/dist/crmbonus-component-wake/phone-input.entry.js +0 -21
  175. package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
  176. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
  177. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
  178. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
  179. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
@@ -0,0 +1,147 @@
1
+ import { r as registerInstance, h } from './index-9f7bde48.js';
2
+
3
+ const successSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiANCgkgdmlld0JveD0iMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxjaXJjbGUgc3R5bGU9ImZpbGw6IzI1QUU4ODsiIGN4PSIyNSIgY3k9IjI1IiByPSIyNSIvPg0KPHBvbHlsaW5lIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwOyIgcG9pbnRzPSINCgkzOCwxNSAyMiwzMyAxMiwyNSAiLz4NCjwvc3ZnPg==';
4
+
5
+ const giftbackFinishCss = ".message-finish{align-content:center;text-align:center}.message-finish p{color:#777676;font-size:xx-large;font-family:sans-serif}";
6
+ const GiftbackFinishStyle0 = giftbackFinishCss;
7
+
8
+ const GiftbackFinish = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ }
12
+ render() {
13
+ return (h("div", { key: 'e72f82799146a6e94acbdd62324e07cdf9f77009', class: "message-finish" }, h("img", { key: '46e2436a3dbe4745225c3b9674e6bf6c299ad63e', src: successSvgrepoComSvg, width: 80 }), h("p", { key: '270e42050956f7f3d1ae9b90f314211fa310f797' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
14
+ }
15
+ };
16
+ GiftbackFinish.style = GiftbackFinishStyle0;
17
+
18
+ const giftbackPinCss = ":host{display:block;font-family:Arial, sans-serif}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;gap:10px;margin:26px 0}input{width:58px;height:40px;font-size:18px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}button:hover{background-color:#bbb}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.footer-button{display:flex;justify-content:space-between;width:100%}";
19
+ const GiftbackPinStyle0 = giftbackPinCss;
20
+
21
+ const GiftbackPin = class {
22
+ constructor(hostRef) {
23
+ registerInstance(this, hostRef);
24
+ this.sent = undefined;
25
+ this.validate = undefined;
26
+ this.cancel = undefined;
27
+ this.pin = ['', '', '', ''];
28
+ this.isVerified = false;
29
+ this.loading = false;
30
+ }
31
+ handleInput(event, index) {
32
+ const input = event.target;
33
+ const value = input.value.slice(0, 1); // Limitar a um único dígito
34
+ this.pin[index] = value;
35
+ // Focar no próximo campo, se possível
36
+ if (value && index < this.pin.length - 1) {
37
+ const nextInput = input.nextElementSibling;
38
+ nextInput === null || nextInput === void 0 ? void 0 : nextInput.focus();
39
+ }
40
+ this.pin = [...this.pin];
41
+ }
42
+ validatePin() {
43
+ console.log('this.pin', this.pin);
44
+ this.validate(this.pin.join(""));
45
+ }
46
+ verifyPin() {
47
+ const pinCode = this.pin.join('');
48
+ if (pinCode === '9999') {
49
+ this.isVerified = true;
50
+ }
51
+ }
52
+ render() {
53
+ return (h("div", { key: '7fe6a9f55ca436ecfcc20f106c1efeddd8387490', class: "form-container-pin" }, h("div", { key: 'aece84fab5ecf94ce5ca90fd1912623dd3c1b9b8' }, h("p", { key: '5134dd8eb3478f59dcfcdca6612e885b76578cba' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), h("div", { key: '8855be06a09925746a5b18323726dd67ec73d7c3', class: "pin-container" }, this.pin.map((_, index) => (h("input", { type: "text", maxLength: 1, value: this.pin[index], onInput: (event) => this.handleInput(event, index) }))))), h("div", { key: '1c5523feb6c9dafbfddd5388170de5fea7627f62', class: "footer-button" }, h("button", { key: '8506cd68998d4ecb76f8a8a262373605a06827de', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '4dda0af894ad5849ba27d3a4f6c15c80d6c984ae', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : h("loading-spinner", { size: "15px", color: "#fff" })))));
54
+ }
55
+ };
56
+ GiftbackPin.style = GiftbackPinStyle0;
57
+
58
+ const giftbackProgressCss = ":host{display:flex;font-family:Arial, sans-serif;border-radius:10px;padding:16px;max-width:100%;flex-direction:column}.giftback-container{display:flex;flex-direction:column}.giftback-container p{font-size:medium}h3{margin:0 0 10px;font-size:18px}p{margin:5px 0;font-size:14px;align-self:start}.validity{font-size:12px;color:#888}.progress-container{display:flex;align-items:center;margin:10px 0}progress-container span{font-size:12px;color:#666}input[type='range']{flex:1;margin:0 10px;appearance:none;background-color:#ccc;height:6px;border-radius:3px;outline:none;cursor:pointer}input[type='range']::-webkit-slider-thumb{appearance:none;width:14px;height:14px;border-radius:50%;background-color:#555;cursor:pointer}.remaining{font-weight:bold;font-size:14px;color:#333}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.disabled{opacity:0.6;cursor:not-allowed}.footer-button-giftback{display:flex;justify-content:space-between;margin-top:14px}";
59
+ const GiftbackProgressStyle0 = giftbackProgressCss;
60
+
61
+ const GiftbackProgress = class {
62
+ constructor(hostRef) {
63
+ registerInstance(this, hostRef);
64
+ this.usedValue = 0;
65
+ this.loading = false;
66
+ this.bonus = {
67
+ totalBonus: 0,
68
+ cartId: "",
69
+ minimumPurchase: 0,
70
+ bonusBalance: 0,
71
+ calculatedValue: 0,
72
+ firstValidityDate: ""
73
+ };
74
+ this.reserve = undefined;
75
+ this.cancel = undefined;
76
+ }
77
+ componentWillLoad() {
78
+ this.usedValue = parseFloat(this.bonus.bonusBalance.toString());
79
+ }
80
+ handleSliderChange(event) {
81
+ const input = event.target;
82
+ this.usedValue = parseFloat(input.value);
83
+ }
84
+ async handleReserve() {
85
+ this.reserve(this.usedValue);
86
+ }
87
+ render() {
88
+ const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
89
+ return (h("div", { key: '0949784aa871d4e5a1e3fd5e68f24abd92f9b4f9', class: "giftback-container" }, h("p", { key: '129a7c66ec49abe6d1cf2e93ad8be39030807ce0' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: '4872e8b42cc25c9339004f5fa7518a269894cc04' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: 'd47e314d9f597a2a44a43d353f76f4382e77657d', class: "validity" }, "V\u00E1lido at\u00E9: ", new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')), h("p", { key: '8f3cb7e066eacf5073c5154c3c418fad05b66b67' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: 'aff6a1a0c1be96396640d35cb1429f8e2ece2f1e' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: 'ab8b39df640a1ad036209410cbcda37caf8b6825', class: "progress-container" }, h("span", { key: 'adc4ee7e73575394b2e19e70440cc86474033011' }, "R$ 0"), h("input", { key: '2b80b3ac24e278e002c68fa25449416791e36b9c', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: '74453f038dcac7a8755edfc9d13f5b0908f5f484' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: 'c48bc53e9eb4213ddc2580c968b9f170a6805b9c', class: "remaining" }, "Faltam ", h("strong", { key: 'd0e91b9121c82ff8051910180496503581f6e498' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: 'd87e4ade049fc1ad8cc4094ab4d1482edea2d9f7', class: "footer-button-giftback" }, h("button", { key: '49ed40adb615dfedcf97ca369d82275e1037b078', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '5cba6462515c0b9995660bd5974da88b2c90bdda', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve() }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
90
+ }
91
+ };
92
+ GiftbackProgress.style = GiftbackProgressStyle0;
93
+
94
+ const PhoneInput = class {
95
+ constructor(hostRef) {
96
+ registerInstance(this, hostRef);
97
+ this.sendPin = undefined;
98
+ this.loading = undefined;
99
+ this.value = undefined;
100
+ }
101
+ async validatePhone() {
102
+ const phone = await this.phoneInputMask.getPhone();
103
+ await this.sendPin(phone);
104
+ }
105
+ render() {
106
+ return (h("div", { key: '8deb65295383b9a14e1ac5c3050ce2cab709c208', class: "form-container" }, h("phone-input-mask", { key: 'd5c9b2fb84b166c67fdfa653f4d0194818d7ae54', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '666403560be459bd387d743936b4de1d0cb29ade', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
107
+ }
108
+ };
109
+
110
+ const phoneInputMaskCss = ".inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{width:300px;height:50px;font-size:18px;padding:10px;color:grey;border:1px solid #d3c6c6;outline:none}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity, transform, color}";
111
+ const PhoneInputMaskStyle0 = phoneInputMaskCss;
112
+
113
+ const PhoneInputMask = class {
114
+ constructor(hostRef) {
115
+ registerInstance(this, hostRef);
116
+ this.phone = '';
117
+ this.initialValue = undefined;
118
+ }
119
+ componentWillLoad() {
120
+ this.phone = this.initialValue;
121
+ }
122
+ formatPhone(value) {
123
+ const cleaned = value.replace(/\D/g, ''); // Remove tudo que não for número
124
+ const match = cleaned.match(/^(\d{0,2})(\d{0,5})(\d{0,4})$/);
125
+ if (!match)
126
+ return value;
127
+ const part1 = match[1] ? `(${match[1]}` : '';
128
+ const part2 = match[2] ? `) ${match[2]}` : '';
129
+ const part3 = match[3] ? `-${match[3]}` : '';
130
+ return `${part1}${part2}${part3}`;
131
+ }
132
+ handleInput(event) {
133
+ const input = event.target;
134
+ this.phone = this.formatPhone(input.value);
135
+ }
136
+ async getPhone() {
137
+ return this.phone;
138
+ }
139
+ render() {
140
+ return (h("input", { key: 'eb90a08eb68463fb8dcb81e22d45621b8b59c754', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
141
+ }
142
+ };
143
+ PhoneInputMask.style = PhoneInputMaskStyle0;
144
+
145
+ export { GiftbackFinish as giftback_finish, GiftbackPin as giftback_pin, GiftbackProgress as giftback_progress, PhoneInput as phone_input, PhoneInputMask as phone_input_mask };
146
+
147
+ //# sourceMappingURL=giftback-finish_5.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"giftback-finish.giftback-pin.giftback-progress.phone-input.phone-input-mask.entry.js","mappings":";;AAAA,MAAM,oBAAoB,GAAG,4rBAA4rB;;ACAztB,MAAM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m-bonus/assets/svg/success-svgrepo-com.svg","src/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css?tag=giftback-finish&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.tsx","src/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css?tag=giftback-pin&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.tsx","src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css?tag=giftback-progress&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.tsx","src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx","src/components/phone/phone-input-mask.css?tag=phone-input-mask&encapsulation=shadow","src/components/phone/phone-input-mask.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\r\n<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg version=\"1.1\" id=\"Capa_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" \r\n\t viewBox=\"0 0 50 50\" xml:space=\"preserve\">\r\n<circle style=\"fill:#25AE88;\" cx=\"25\" cy=\"25\" r=\"25\"/>\r\n<polyline style=\"fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;\" points=\"\r\n\t38,15 22,33 12,25 \"/>\r\n</svg>",".message-finish {\n align-content: center;\n text-align: center;\n}\n\n.message-finish p {\n color: #777676;\n font-size: xx-large;\n font-family: sans-serif;\n}","import { Component, h } from \"@stencil/core\";\nimport success from '../../../crm-bonus/assets/svg/success-svgrepo-com.svg'\n\n@Component({\n tag: 'giftback-finish',\n styleUrl: 'giftback-finish.css',\n shadow: true\n})\nexport class GiftbackFinish {\n render() {\n return (\n <div class=\"message-finish\">\n <img src={success} width={80} />\n <p>Legal! O Bônus será aplicado na sua compra.</p>\n </div>\n )\n }\n}",":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n gap: 10px;\n margin: 26px 0;\n}\n\ninput {\n width: 58px;\n height: 40px;\n font-size: 18px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\nbutton:hover {\n background-color: #bbb;\n}\n\n.success {\n color: green;\n margin-top: 10px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.footer-button {\n display: flex;\n justify-content: space-between;\n width: 100%;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\n\n@Component({\n tag: 'giftback-pin',\n styleUrl: 'giftback-pin.css',\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() sent: IPinSent;\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n\n @Prop() loading: boolean = false;\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n console.log('this.pin', this.pin);\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n render() {\n return (\n <div class=\"form-container-pin\">\n <div >\n <p>Insira o PIN de 4 dígitos enviado por SMS.</p>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n </div>\n\n <div class=\"footer-button\">\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePin()}>\n {\n !this.loading ? \"Enviar\" : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n {/* <button onClick={() => this.verifyPin()}>Enviar</button>\n {this.isVerified && <p class=\"success\">Código verificado com sucesso!</p>} */}\n </div>\n );\n }\n}\n",":host {\n display: flex;\n font-family: Arial, sans-serif;\n /* background-color: #f8f4eb; */\n border-radius: 10px;\n padding: 16px;\n /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */\n max-width: 100%;\n flex-direction: column;\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n}\n\n.giftback-container p {\n font-size: medium;\n}\n\nh3 {\n margin: 0 0 10px;\n font-size: 18px;\n}\n\np {\n margin: 5px 0;\n font-size: 14px;\n align-self: start;\n}\n\n.validity {\n font-size: 12px;\n color: #888;\n}\n\n.progress-container {\n display: flex;\n align-items: center;\n margin: 10px 0;\n}\n\nprogress-container span {\n font-size: 12px;\n color: #666;\n}\n\ninput[type='range'] {\n flex: 1;\n margin: 0 10px;\n appearance: none;\n background-color: #ccc;\n height: 6px;\n border-radius: 3px;\n outline: none;\n cursor: pointer;\n}\n\ninput[type='range']::-webkit-slider-thumb {\n appearance: none;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #555;\n cursor: pointer;\n}\n\n.remaining {\n font-weight: bold;\n font-size: 14px;\n color: #333;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.footer-button-giftback {\n display: flex;\n justify-content: space-between;\n margin-top: 14px;\n}","import { Component, h, State, Prop } from '@stencil/core';\nimport { IBonus } from '../../../../dto/validate.pin.bonus';\n\n@Component({\n tag: 'giftback-progress',\n styleUrl: 'giftback-progress.css',\n shadow: true,\n})\nexport class GiftbackProgress {\n @State() usedValue: number = 0;\n\n @Prop() loading: boolean = false;\n\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n };\n\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n componentWillLoad() {\n this.usedValue = parseFloat(this.bonus.bonusBalance.toString());\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n }\n\n async handleReserve() {\n this.reserve(this.usedValue);\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n return (\n <div class=\"giftback-container\">\n <p>\n Você possui até <strong>R$ {this.bonus.totalBonus.toFixed(2)}</strong> de Giftback nessa compra!\n </p>\n <p class=\"validity\">Válido até: {new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')}</p>\n\n <p>Você está utilizando <strong>R$ {this.usedValue.toFixed(2)}</strong> nessa compra</p>\n\n <div class=\"progress-container\">\n <span>R$ 0</span>\n <input\n disabled\n type=\"range\"\n min=\"0\"\n step=\"0.01\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n onInput={(event) => this.handleSliderChange(event)}\n />\n <span>R$ {this.bonus.totalBonus.toFixed(2)}</span>\n </div>\n\n <p class=\"remaining\">\n Faltam <strong>R$ {remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)}</strong> para utilizar o valor total do Giftback.\n </p>\n\n <div class=\"footer-button-giftback\">\n\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.handleReserve()}>\n {\n !this.loading ? \"Aplicar\" : <loading-spinner size=\"10px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n );\n }\n}\n","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"25px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}",".inline-text-field-container {\n display: flex;\n flex-direction: column;\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-right: max(16px, var(--mdc-shape-small, 4px));\n }\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));\n }\n}\n\n.mdc-text-field--outlined {\n height: 55px;\n overflow: visible;\n}\n\n.phone {\n width: 300px;\n height: 50px;\n font-size: 18px;\n padding: 10px;\n color: grey;\n border: 1px solid #d3c6c6;\n outline: none;\n}\n\n.mdc-text-field {\n border-top-left-radius: 4px;\n border-top-left-radius: var(--mdc-shape-small, 4px);\n border-top-right-radius: 4px;\n border-top-right-radius: var(--mdc-shape-small, 4px);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-flex;\n align-items: baseline;\n padding: 0 16px;\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n will-change: opacity, transform, color;\n}","import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"],"version":3}