adp-web-components 0.0.90 → 0.0.91

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 (333) hide show
  1. package/dist/cjs/activation-icon-DEYW0itX.js +16 -0
  2. package/dist/cjs/contact-us-form.cjs.entry.js +4 -4
  3. package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +282 -325
  4. package/dist/cjs/empty-table-icon-PdTX6gpI.js +16 -0
  5. package/dist/cjs/flexible-container.cjs.entry.js +43 -46
  6. package/dist/cjs/form-dialog_8.cjs.entry.js +12 -12
  7. package/dist/cjs/{get-local-language-XsAJEAsO.js → get-local-language-AedNCS4v.js} +38 -38
  8. package/dist/cjs/information-table.cjs.entry.js +6 -3
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
  11. package/dist/cjs/material-card-Cd0L1Get.js +43 -0
  12. package/dist/cjs/part-lookup.cjs.entry.js +32 -11
  13. package/dist/cjs/service-booking-form.cjs.entry.js +4 -4
  14. package/dist/cjs/shift-components.cjs.js +1 -1
  15. package/dist/cjs/shift-tab-content.cjs.entry.js +42 -0
  16. package/dist/cjs/shift-tabs_2.cjs.entry.js +266 -235
  17. package/dist/cjs/{vehicle-info-layout-BSAeLW7e.js → type-A-Wi_ktA.js} +48 -9
  18. package/dist/cjs/{type-BAD2dFzP.js → type-Dm3JBAef.js} +1 -1
  19. package/dist/cjs/{type-DT5vXP0E.js → type-ooYU2cCM.js} +1 -1
  20. package/dist/cjs/vehicle-accessories_6.cjs.entry.js +1206 -0
  21. package/dist/cjs/vehicle-info-layout-Dp2Po_uc.js +16 -0
  22. package/dist/cjs/vehicle-lookup.cjs.entry.js +19 -16
  23. package/dist/cjs/vin-extractor.cjs.entry.js +3 -3
  24. package/dist/collection/components/components/flexible-container.css +1 -1
  25. package/dist/collection/components/components/flexible-container.js +34 -36
  26. package/dist/collection/components/components/information-table.css +1 -1
  27. package/dist/collection/components/components/information-table.js +45 -2
  28. package/dist/collection/components/components/loading-spinner.css +1 -1
  29. package/dist/collection/components/components/material-card.js +2 -2
  30. package/dist/collection/components/components/shift-tab-content.css +1 -1
  31. package/dist/collection/components/components/shift-tab-content.js +1 -1
  32. package/dist/collection/components/components/shift-tabs.css +1 -1
  33. package/dist/collection/components/form-elements/form-dialog.js +6 -6
  34. package/dist/collection/components/form-elements/form-input.js +4 -4
  35. package/dist/collection/components/form-elements/form-select.js +6 -6
  36. package/dist/collection/components/form-elements/form-structure-error.js +4 -4
  37. package/dist/collection/components/form-elements/form-structure.js +3 -3
  38. package/dist/collection/components/form-elements/form-submit.js +5 -5
  39. package/dist/collection/components/form-elements/form-text-area.js +4 -4
  40. package/dist/collection/components/forms/contact-us/element-mapper.js +1 -1
  41. package/dist/collection/components/forms/contact-us-form.js +4 -4
  42. package/dist/collection/components/forms/service-booking/element-mapper.js +1 -1
  43. package/dist/collection/components/forms/service-booking-form.js +4 -4
  44. package/dist/collection/components/part-lookup/components/dead-stock-item.js +15 -0
  45. package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
  46. package/dist/collection/components/part-lookup/dead-stock-lookup.js +153 -175
  47. package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
  48. package/dist/collection/components/part-lookup/distributor-lookup.js +192 -224
  49. package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
  50. package/dist/collection/components/part-lookup/manufacturer-lookup.js +165 -224
  51. package/dist/collection/components/part-lookup/part-lookup.css +1 -1
  52. package/dist/collection/components/part-lookup/part-lookup.js +127 -57
  53. package/dist/collection/components/vehicle-lookup/components/CardsContainer.js +1 -1
  54. package/dist/collection/components/vehicle-lookup/components/StatusCard.js +2 -2
  55. package/dist/collection/components/vehicle-lookup/components/claimable-item-popover.js +73 -0
  56. package/dist/collection/components/vehicle-lookup/components/claimable-item.js +27 -0
  57. package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
  58. package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +108 -187
  59. package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
  60. package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +371 -504
  61. package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
  62. package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.js +271 -319
  63. package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
  64. package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +59 -56
  65. package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
  66. package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.js +106 -192
  67. package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -3
  68. package/dist/collection/components/vehicle-lookup/vehicle-service-history.js +106 -176
  69. package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -3
  70. package/dist/collection/components/vehicle-lookup/vehicle-specification.js +104 -168
  71. package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -3
  72. package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.js +198 -274
  73. package/dist/collection/components/vin-extractor/vin-extractor.js +13 -4
  74. package/dist/collection/{global/lib/image-expansion.js → features/image-viewer/image-viewer-logic.js} +15 -11
  75. package/dist/collection/features/image-viewer/image-viewer.js +9 -0
  76. package/dist/collection/features/image-viewer/index.js +7 -0
  77. package/dist/collection/features/image-viewer/interface.js +1 -0
  78. package/dist/collection/{global/lib → features/multi-lingual}/get-local-language.js +1 -5
  79. package/dist/collection/features/multi-lingual/index.js +7 -0
  80. package/dist/collection/features/multi-lingual/interface.js +1 -0
  81. package/dist/collection/{global/types/locale.js → features/multi-lingual/types.js} +6 -0
  82. package/dist/collection/features/part-lookup-components/index.js +7 -0
  83. package/dist/collection/features/part-lookup-components/interface.js +1 -0
  84. package/dist/collection/features/part-lookup-components/part-lookup-api-integration.js +84 -0
  85. package/dist/collection/features/part-lookup-components/types.js +1 -0
  86. package/dist/collection/features/vehicle-info-layout/index.js +6 -0
  87. package/dist/collection/features/vehicle-info-layout/interface.js +1 -0
  88. package/dist/collection/{components/components → features/vehicle-info-layout}/vehicle-info-layout.js +1 -1
  89. package/dist/collection/features/vehicle-lookup-component/index.js +7 -0
  90. package/dist/collection/features/vehicle-lookup-component/interface.js +1 -0
  91. package/dist/collection/features/vehicle-lookup-component/types.js +17 -0
  92. package/dist/collection/features/vehicle-lookup-component/vehicle-lookup-api-integration.js +87 -0
  93. package/dist/collection/global/assets/activation-icon.js +6 -0
  94. package/dist/collection/global/assets/add-icon.js +6 -0
  95. package/dist/collection/global/assets/alert-icon.js +6 -0
  96. package/dist/collection/global/assets/arrow-up-icon.js +6 -0
  97. package/dist/collection/global/assets/attach-icon.js +6 -0
  98. package/dist/collection/global/assets/check-icon.js +6 -0
  99. package/dist/collection/global/assets/empty-table-icon.js +6 -0
  100. package/dist/collection/global/assets/form-submit-svg.js +6 -0
  101. package/dist/collection/global/assets/print-icon.js +6 -0
  102. package/dist/collection/global/assets/triangle-icon.js +6 -0
  103. package/dist/collection/global/lib/parents-with-tag.js +22 -0
  104. package/dist/collection/locales/vehicleLookup/claimableItems/type.js +2 -1
  105. package/dist/collection/templates/part-lookup/mock-data.js +85 -2
  106. package/dist/components/contact-us-form.js +1 -1
  107. package/dist/components/dead-stock-lookup.js +1 -1
  108. package/dist/components/distributor-lookup.js +1 -1
  109. package/dist/components/flexible-container.js +1 -1
  110. package/dist/components/form-dialog.js +1 -1
  111. package/dist/components/form-input.js +1 -1
  112. package/dist/components/form-select.js +1 -1
  113. package/dist/components/form-structure-error.js +1 -1
  114. package/dist/components/form-structure.js +1 -1
  115. package/dist/components/form-submit.js +1 -1
  116. package/dist/components/form-text-area.js +1 -1
  117. package/dist/components/information-table.js +1 -1
  118. package/dist/components/loading-spinner.js +1 -1
  119. package/dist/components/manufacturer-lookup.js +1 -1
  120. package/dist/components/p-B1fdQNyr.js +5 -0
  121. package/dist/components/{p-C-4kx8qU.js → p-BkfCVIF9.js} +1 -1
  122. package/dist/components/{p-B6QhQCZi.js → p-BsHunqQT.js} +1 -1
  123. package/dist/components/p-BwUMwWdE.js +5 -0
  124. package/dist/components/p-C4zpDhOi.js +5 -0
  125. package/dist/components/p-CHE0gMDU.js +5 -0
  126. package/dist/components/p-CRB_syll.js +5 -0
  127. package/dist/components/{p-D7yku_Qi.js → p-CV6-hCEd.js} +1 -1
  128. package/dist/components/p-CYfVWbdE.js +5 -0
  129. package/dist/components/{p-BaJpYztb.js → p-CYs-Cfbz.js} +1 -1
  130. package/dist/components/p-Ce4X3l8Z.js +5 -0
  131. package/dist/components/p-CffGxxO4.js +5 -0
  132. package/dist/components/p-CgP_rdz5.js +5 -0
  133. package/dist/components/p-CmuF1zVa.js +5 -0
  134. package/dist/components/p-DPxUsrGL.js +5 -0
  135. package/dist/components/{p-CK4E5G0i.js → p-DSIG_p-W.js} +1 -1
  136. package/dist/components/p-DXHFdZX_.js +5 -0
  137. package/dist/components/p-Dkva9a7P.js +5 -0
  138. package/dist/components/p-DrFf_ORZ.js +5 -0
  139. package/dist/components/p-DsfktPnM.js +5 -0
  140. package/dist/components/{p-CjWDXQ_q.js → p-DyWp9Iox.js} +1 -1
  141. package/dist/components/{p-JtBlsz4j.js → p-Fudjizxb.js} +1 -1
  142. package/dist/components/p-QtVWfPMe.js +5 -0
  143. package/dist/components/p-THNpWs_W.js +5 -0
  144. package/dist/components/p-gwgMa4kM.js +5 -0
  145. package/dist/components/p-iCYlD4i9.js +5 -0
  146. package/dist/components/p-kp6CyIhI.js +5 -0
  147. package/dist/components/{p-D63WC2_Y.js → p-nBbuIowK.js} +1 -1
  148. package/dist/components/p-piZ41_ho.js +5 -0
  149. package/dist/components/p-qw7FLuM-.js +5 -0
  150. package/dist/components/p-vhsj8wEw.js +5 -0
  151. package/dist/components/p-zDS3r6-j.js +5 -0
  152. package/dist/components/part-lookup.js +1 -1
  153. package/dist/components/service-booking-form.js +1 -1
  154. package/dist/components/shift-accordion.js +1 -1
  155. package/dist/components/shift-slider.js +1 -1
  156. package/dist/components/shift-tab-content.js +1 -1
  157. package/dist/components/shift-tabs.js +1 -1
  158. package/dist/components/vehicle-accessories.js +1 -1
  159. package/dist/components/vehicle-claimable-items.js +1 -1
  160. package/dist/components/vehicle-item-claim-form.js +1 -1
  161. package/dist/components/vehicle-lookup.js +1 -1
  162. package/dist/components/vehicle-paint-thickness.js +1 -1
  163. package/dist/components/vehicle-service-history.js +1 -1
  164. package/dist/components/vehicle-specification.js +1 -1
  165. package/dist/components/vehicle-warranty-details.js +1 -1
  166. package/dist/components/vin-extractor.js +1 -1
  167. package/dist/esm/activation-icon-7GJaxZ20.js +14 -0
  168. package/dist/esm/contact-us-form.entry.js +4 -4
  169. package/dist/esm/dead-stock-lookup_3.entry.js +283 -326
  170. package/dist/esm/empty-table-icon-DvQk12N9.js +14 -0
  171. package/dist/esm/flexible-container.entry.js +43 -46
  172. package/dist/esm/form-dialog_8.entry.js +12 -12
  173. package/dist/esm/{get-local-language-BPo-xYwK.js → get-local-language-DuHpVAu5.js} +38 -38
  174. package/dist/esm/information-table.entry.js +6 -3
  175. package/dist/esm/loader.js +1 -1
  176. package/dist/esm/loading-spinner.entry.js +1 -1
  177. package/dist/esm/material-card-DiAl-884.js +40 -0
  178. package/dist/esm/part-lookup.entry.js +32 -11
  179. package/dist/esm/service-booking-form.entry.js +4 -4
  180. package/dist/esm/shift-components.js +1 -1
  181. package/dist/esm/shift-tab-content.entry.js +40 -0
  182. package/dist/esm/shift-tabs_2.entry.js +266 -235
  183. package/dist/esm/{type-DHujxJVp.js → type-B6613elJ.js} +1 -1
  184. package/dist/esm/{type-D9Rd8Kcd.js → type-CFBDfJID.js} +1 -1
  185. package/dist/esm/type-CnAEgqjH.js +82 -0
  186. package/dist/esm/vehicle-accessories_6.entry.js +1199 -0
  187. package/dist/esm/vehicle-info-layout-CNGGKAia.js +14 -0
  188. package/dist/esm/vehicle-lookup.entry.js +14 -11
  189. package/dist/esm/vin-extractor.entry.js +3 -3
  190. package/dist/locales/vehicleLookup/claimableItems/ar.json +2 -1
  191. package/dist/locales/vehicleLookup/claimableItems/en.json +2 -1
  192. package/dist/locales/vehicleLookup/claimableItems/ku.json +2 -1
  193. package/dist/locales/vehicleLookup/claimableItems/ru.json +2 -1
  194. package/dist/locales/vehicleLookup/claimableItems/type.ts +2 -1
  195. package/dist/shift-components/p-010b5793.entry.js +5 -0
  196. package/dist/shift-components/{p-b6497f63.entry.js → p-03483842.entry.js} +1 -1
  197. package/dist/shift-components/p-0a55771f.entry.js +5 -0
  198. package/dist/shift-components/p-20bdbcb5.entry.js +5 -0
  199. package/dist/shift-components/p-42218765.entry.js +5 -0
  200. package/dist/shift-components/p-526a4ff7.entry.js +5 -0
  201. package/dist/shift-components/p-701e3fb0.entry.js +5 -0
  202. package/dist/shift-components/p-7225e52b.entry.js +5 -0
  203. package/dist/shift-components/p-BSpTbUWi.js +5 -0
  204. package/dist/shift-components/{p-DHb8KxaG.js → p-CC-dsMaG.js} +1 -1
  205. package/dist/shift-components/{p-CIU9c3pi.js → p-CsAICJSF.js} +1 -1
  206. package/dist/shift-components/p-CxstRFDI.js +5 -0
  207. package/dist/shift-components/{p-CuQ84qxe.js → p-DF2jCW4D.js} +1 -1
  208. package/dist/shift-components/p-DdH9nNoC.js +5 -0
  209. package/dist/shift-components/p-Wtw8qj6x.js +5 -0
  210. package/dist/shift-components/p-a76db330.entry.js +5 -0
  211. package/dist/shift-components/{p-f282c740.entry.js → p-d46b0857.entry.js} +1 -1
  212. package/dist/shift-components/p-d843769d.entry.js +5 -0
  213. package/dist/shift-components/p-ebc23eef.entry.js +5 -0
  214. package/dist/shift-components/p-ef9ad340.entry.js +5 -0
  215. package/dist/shift-components/p-fyqwD4fB.js +5 -0
  216. package/dist/shift-components/shift-components.esm.js +1 -1
  217. package/dist/types/components/components/flexible-container.d.ts +2 -5
  218. package/dist/types/components/components/information-table.d.ts +2 -0
  219. package/dist/types/components/components/material-card.d.ts +1 -1
  220. package/dist/types/components/form-elements/form-dialog.d.ts +1 -2
  221. package/dist/types/components/form-elements/form-input.d.ts +1 -2
  222. package/dist/types/components/form-elements/form-select.d.ts +1 -2
  223. package/dist/types/components/form-elements/form-structure-error.d.ts +1 -2
  224. package/dist/types/components/form-elements/form-structure.d.ts +2 -3
  225. package/dist/types/components/form-elements/form-submit.d.ts +1 -1
  226. package/dist/types/components/form-elements/form-text-area.d.ts +1 -1
  227. package/dist/types/components/forms/contact-us-form.d.ts +1 -1
  228. package/dist/types/components/forms/service-booking-form.d.ts +1 -1
  229. package/dist/types/components/part-lookup/components/dead-stock-item.d.ts +14 -0
  230. package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +25 -23
  231. package/dist/types/components/part-lookup/distributor-lookup.d.ts +23 -24
  232. package/dist/types/components/part-lookup/manufacturer-lookup.d.ts +23 -25
  233. package/dist/types/components/part-lookup/part-lookup.d.ts +17 -12
  234. package/dist/types/components/vehicle-lookup/components/claimable-item-popover.d.ts +17 -0
  235. package/dist/types/components/vehicle-lookup/components/claimable-item.d.ts +12 -0
  236. package/dist/types/components/vehicle-lookup/vehicle-accessories.d.ts +23 -28
  237. package/dist/types/components/vehicle-lookup/vehicle-claimable-items.d.ts +53 -55
  238. package/dist/types/components/vehicle-lookup/vehicle-item-claim-form.d.ts +35 -53
  239. package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +8 -9
  240. package/dist/types/components/vehicle-lookup/vehicle-paint-thickness.d.ts +23 -29
  241. package/dist/types/components/vehicle-lookup/vehicle-service-history.d.ts +20 -23
  242. package/dist/types/components/vehicle-lookup/vehicle-specification.d.ts +20 -22
  243. package/dist/types/components/vehicle-lookup/vehicle-warranty-details.d.ts +27 -31
  244. package/dist/types/components/vin-extractor/vin-extractor.d.ts +2 -2
  245. package/dist/types/components.d.ts +145 -161
  246. package/dist/types/features/image-viewer/image-viewer-logic.d.ts +3 -0
  247. package/dist/types/features/image-viewer/image-viewer.d.ts +7 -0
  248. package/dist/types/features/image-viewer/index.d.ts +3 -0
  249. package/dist/types/features/image-viewer/interface.d.ts +5 -0
  250. package/dist/types/features/multi-lingual/get-local-language.d.ts +4 -0
  251. package/dist/types/features/multi-lingual/index.d.ts +3 -0
  252. package/dist/types/features/multi-lingual/interface.d.ts +8 -0
  253. package/dist/types/{global/lib/get-local-language.d.ts → features/multi-lingual/types.d.ts} +17 -6
  254. package/dist/types/features/part-lookup-components/index.d.ts +3 -0
  255. package/dist/types/features/part-lookup-components/interface.d.ts +25 -0
  256. package/dist/types/features/part-lookup-components/part-lookup-api-integration.d.ts +14 -0
  257. package/dist/types/features/part-lookup-components/types.d.ts +3 -0
  258. package/dist/types/features/vehicle-info-layout/index.d.ts +2 -0
  259. package/dist/types/features/vehicle-info-layout/interface.d.ts +3 -0
  260. package/dist/types/{components/components → features/vehicle-info-layout}/vehicle-info-layout.d.ts +3 -3
  261. package/dist/types/features/vehicle-lookup-component/index.d.ts +3 -0
  262. package/dist/types/features/vehicle-lookup-component/interface.d.ts +24 -0
  263. package/dist/types/features/vehicle-lookup-component/types.d.ts +17 -0
  264. package/dist/types/features/vehicle-lookup-component/vehicle-lookup-api-integration.d.ts +15 -0
  265. package/dist/types/global/assets/activation-icon.d.ts +6 -0
  266. package/dist/types/global/assets/add-icon.d.ts +6 -0
  267. package/dist/types/global/assets/alert-icon.d.ts +6 -0
  268. package/dist/types/global/assets/arrow-up-icon.d.ts +6 -0
  269. package/dist/types/global/assets/attach-icon.d.ts +6 -0
  270. package/dist/types/global/assets/check-icon.d.ts +6 -0
  271. package/dist/types/global/assets/empty-table-icon.d.ts +6 -0
  272. package/dist/types/global/assets/form-submit-svg.d.ts +6 -0
  273. package/dist/types/global/assets/print-icon.d.ts +6 -0
  274. package/dist/types/global/assets/triangle-icon.d.ts +6 -0
  275. package/dist/types/global/lib/parents-with-tag.d.ts +1 -0
  276. package/dist/types/global/lib/recaptcha.d.ts +1 -1
  277. package/dist/types/global/types/components.d.ts +0 -1
  278. package/dist/types/global/types/forms.d.ts +1 -1
  279. package/dist/types/locales/vehicleLookup/accessories/type.d.ts +2 -2
  280. package/dist/types/locales/vehicleLookup/claimableItems/type.d.ts +8 -4
  281. package/dist/types/locales/vehicleLookup/wrapper-type.d.ts +6 -4
  282. package/package.json +1 -2
  283. package/dist/cjs/shift-tab-content_7.cjs.entry.js +0 -1487
  284. package/dist/cjs/type-CCsnwaKp.js +0 -56
  285. package/dist/collection/global/api/partInformation.js +0 -32
  286. package/dist/collection/global/api/vehicleInformation.js +0 -48
  287. package/dist/components/p-1vy-Ba6r.js +0 -5
  288. package/dist/components/p-B5YdqGVm.js +0 -5
  289. package/dist/components/p-BDkK65_1.js +0 -5
  290. package/dist/components/p-BT4rhLRL.js +0 -5
  291. package/dist/components/p-C1F_f1WE.js +0 -5
  292. package/dist/components/p-CACnUI7c.js +0 -5
  293. package/dist/components/p-CDOvd2iD.js +0 -5
  294. package/dist/components/p-CGzOJT7g.js +0 -5
  295. package/dist/components/p-CINfIgzX.js +0 -5
  296. package/dist/components/p-CJpwqpuQ.js +0 -5
  297. package/dist/components/p-CUqXnLyM.js +0 -5
  298. package/dist/components/p-Cl9ct-bZ.js +0 -5
  299. package/dist/components/p-CqGVdvFp.js +0 -5
  300. package/dist/components/p-D2bxjSGr.js +0 -5
  301. package/dist/components/p-DXHx6lre.js +0 -5
  302. package/dist/components/p-DXj5zsQK.js +0 -5
  303. package/dist/components/p-DsCtgcZn.js +0 -5
  304. package/dist/components/p-DxjQlmaz.js +0 -5
  305. package/dist/components/p-nxlqujKv.js +0 -5
  306. package/dist/components/p-vvHN2Olh.js +0 -5
  307. package/dist/components/p-yQ70lKV2.js +0 -5
  308. package/dist/esm/shift-tab-content_7.entry.js +0 -1479
  309. package/dist/esm/type-CfLRnI1J.js +0 -53
  310. package/dist/esm/vehicle-info-layout-D1bvY1nt.js +0 -43
  311. package/dist/shift-components/p-389f444c.entry.js +0 -5
  312. package/dist/shift-components/p-5dd208de.entry.js +0 -5
  313. package/dist/shift-components/p-5f91eb5f.entry.js +0 -5
  314. package/dist/shift-components/p-76dd44e9.entry.js +0 -5
  315. package/dist/shift-components/p-9a51dae0.entry.js +0 -5
  316. package/dist/shift-components/p-BAMA88Mr.js +0 -5
  317. package/dist/shift-components/p-Br0JD1CD.js +0 -5
  318. package/dist/shift-components/p-af44ca99.entry.js +0 -5
  319. package/dist/shift-components/p-d0e6cd78.entry.js +0 -5
  320. package/dist/shift-components/p-f1225504.entry.js +0 -5
  321. package/dist/shift-components/p-faabbd23.entry.js +0 -5
  322. package/dist/shift-components/p-ff0fec09.entry.js +0 -5
  323. package/dist/types/global/api/partInformation.d.ts +0 -19
  324. package/dist/types/global/api/vehicleInformation.d.ts +0 -33
  325. package/dist/types/global/lib/image-expansion.d.ts +0 -9
  326. package/dist/types/global/types/locale.d.ts +0 -11
  327. /package/dist/collection/{components/vehicle-lookup → global}/assets/activationRequired.svg +0 -0
  328. /package/dist/collection/{components/vehicle-lookup → global}/assets/cancelled.svg +0 -0
  329. /package/dist/collection/{components/vehicle-lookup → global}/assets/check.svg +0 -0
  330. /package/dist/collection/{components/vehicle-lookup → global}/assets/expired.svg +0 -0
  331. /package/dist/collection/{components/vehicle-lookup → global}/assets/pending.svg +0 -0
  332. /package/dist/collection/{components/vehicle-lookup → global}/assets/processed.svg +0 -0
  333. /package/dist/collection/{components/vehicle-lookup → global}/assets/x-mark.svg +0 -0
@@ -17,267 +17,287 @@ var __rest = (this && this.__rest) || function (s, e) {
17
17
  import { Host, h } from "@stencil/core";
18
18
  import cn from "../../global/lib/cn";
19
19
  import { scrollIntoContainerView } from "../../global/lib/scroll-into-container-view";
20
- import { getLocaleLanguage, getSharedLocal, sharedLocalesSchema } from "../../global/lib/get-local-language";
21
- import expiredIcon from "./assets/expired.svg";
22
- import pendingIcon from "./assets/pending.svg";
23
- import cancelledIcon from "./assets/cancelled.svg";
24
- import processedIcon from "./assets/processed.svg";
25
- import activationRequiredIcon from "./assets/activationRequired.svg";
26
- import { getVehicleInformation } from "../../global/api/vehicleInformation";
20
+ import { VehicleInfoLayout } from "../../features/vehicle-info-layout/index";
21
+ import { setVehicleLookupData, setVehicleLookupErrorState } from "../../features/vehicle-lookup-component/index";
22
+ import { getLocaleLanguage, getSharedLocal, sharedLocalesSchema } from "../../features/multi-lingual/index";
23
+ import { ClaimableItem } from "./components/claimable-item";
24
+ import { ClaimableItemPopover } from "./components/claimable-item-popover";
27
25
  import dynamicClaimSchema from "../../locales/vehicleLookup/claimableItems/type";
28
- import { VehicleInfoLayout } from "../components/vehicle-info-layout";
29
- let mockData = {};
30
- const icons = {
31
- expired: expiredIcon,
32
- pending: pendingIcon,
33
- processed: processedIcon,
34
- cancelled: cancelledIcon,
35
- activationRequired: activationRequiredIcon,
36
- };
26
+ import { PrintIcon } from "../../global/assets/print-icon";
27
+ import { ActivationIcon } from "../../global/assets/activation-icon";
28
+ import { EmptyTableIcon } from "../../global/assets/empty-table-icon";
37
29
  export class VehicleClaimableItems {
38
30
  constructor() {
31
+ // ====== Start Localization
32
+ this.language = 'en';
33
+ this.locale = Object.assign({ sharedLocales: sharedLocalesSchema.getDefault() }, dynamicClaimSchema.getDefault());
34
+ // ====== End Localization
35
+ // ====== Start Vehicle info layout prop
36
+ this.coreOnly = false;
39
37
  this.headers = {};
40
- this.isDev = false;
41
38
  this.queryString = '';
42
- this.coreOnly = false;
43
- this.language = 'en';
39
+ this.uploadMultipleDocumentsAtTheForm = true;
40
+ this.isError = false;
41
+ this.isLoading = false;
44
42
  this.maximumDocumentFileSizeInMb = 30;
45
43
  this.claimEndPoint = 'api/vehicle/swift-claim';
46
- this.sharedLocales = sharedLocalesSchema.getDefault();
47
- this.locale = dynamicClaimSchema.getDefault();
48
44
  this.activeTab = '';
49
- this.isError = false;
50
- this.showPopup = false;
51
- this.isLoading = false;
52
- this.externalVin = null;
53
45
  this.showPrintBox = false;
54
- this.errorMessage = null;
55
46
  this.tabAnimationLoading = false;
56
- this.activePopupIndex = null;
57
- this.tabs = [];
58
47
  this.lastSuccessfulClaimResponse = null;
59
- this.pendingItemHighlighted = false;
60
- this.onMouseLeave = () => {
61
- clearTimeout(this.timeoutRef);
62
- this.showPopup = false;
63
- this.timeoutRef = setTimeout(() => {
64
- this.activePopupIndex = null;
65
- }, 400);
66
- };
67
- this.onMouseEnter = (dynamicClaimItemHeader, idx) => {
68
- clearTimeout(this.timeoutRef);
69
- this.activePopupIndex = idx;
70
- this.timeoutRef = setTimeout(() => {
71
- const positionRef = dynamicClaimItemHeader.querySelector('.popup-ref');
72
- this.popupPositionRef = positionRef;
73
- this.calculatePopupPos(this.el.shadowRoot);
74
- this.showPopup = true;
75
- }, 50);
76
- };
48
+ this.showClaimableItemPopover = false;
49
+ this.tabs = [];
50
+ this.popoverTargetLocation = { left: 0, bottom: 0, top: 0 };
77
51
  this.getServiceItems = () => {
78
52
  var _a, _b, _c, _d, _e;
79
- if (!((_b = (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) === null || _b === void 0 ? void 0 : _b.length))
53
+ if (!((_b = (_a = this.vehicleLookup) === null || _a === void 0 ? void 0 : _a.serviceItems) === null || _b === void 0 ? void 0 : _b.length))
80
54
  return [];
81
55
  if (!((_c = this.tabs) === null || _c === void 0 ? void 0 : _c.length))
82
- return (_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.serviceItems;
83
- return (_e = this.vehicleInformation) === null || _e === void 0 ? void 0 : _e.serviceItems.filter(serviceItem => { var _a; return ((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.group) === null || _a === void 0 ? void 0 : _a.name) === this.activeTab; });
56
+ return (_d = this.vehicleLookup) === null || _d === void 0 ? void 0 : _d.serviceItems;
57
+ return (_e = this.vehicleLookup) === null || _e === void 0 ? void 0 : _e.serviceItems.filter(serviceItem => { var _a; return ((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.group) === null || _a === void 0 ? void 0 : _a.name) === this.activeTab; });
58
+ };
59
+ this.parseGroupData = (vehicleLookup) => {
60
+ var _a;
61
+ if ((_a = vehicleLookup === null || vehicleLookup === void 0 ? void 0 : vehicleLookup.serviceItems) === null || _a === void 0 ? void 0 : _a.length) {
62
+ let orderedGroups = [];
63
+ const unOrderedGroups = [];
64
+ vehicleLookup.serviceItems.forEach(({ group }) => {
65
+ if (!(group === null || group === void 0 ? void 0 : group.name))
66
+ return;
67
+ if ([...orderedGroups, ...unOrderedGroups].find(g => (g === null || g === void 0 ? void 0 : g.name) === (group === null || group === void 0 ? void 0 : group.name)))
68
+ return;
69
+ if (group === null || group === void 0 ? void 0 : group.isDefault)
70
+ this.activeTab = group === null || group === void 0 ? void 0 : group.name;
71
+ if (typeof (group === null || group === void 0 ? void 0 : group.tabOrder) === 'number')
72
+ orderedGroups.push(group);
73
+ else
74
+ unOrderedGroups.push(group);
75
+ });
76
+ if (!!unOrderedGroups.length || !!orderedGroups.length) {
77
+ orderedGroups = orderedGroups.sort((a, b) => a.tabOrder - b.tabOrder);
78
+ this.tabs = [...orderedGroups, ...unOrderedGroups];
79
+ if (!this.activeTab)
80
+ this.activeTab = this.tabs[0].name;
81
+ }
82
+ else {
83
+ this.tabs = [];
84
+ this.activeTab = '';
85
+ }
86
+ }
87
+ else {
88
+ this.tabs = [];
89
+ this.activeTab = '';
90
+ }
91
+ return vehicleLookup;
92
+ };
93
+ this.updateProgressBar = async (payload) => {
94
+ var _a, _b;
95
+ // payload indicates its not a fresh list rather it is an update to current one
96
+ if (!payload) {
97
+ // hard reset of the bar
98
+ this.progressBar.style.transitionDuration = '0s';
99
+ this.progressBar.style.opacity = '0';
100
+ this.progressBar.style.width = '0%';
101
+ // apply changes
102
+ await new Promise(r => setTimeout(r, 10));
103
+ }
104
+ this.progressBar.style.transitionDuration = '1s';
105
+ this.progressBar.style.opacity = '1';
106
+ if (!this.vehicleLookup)
107
+ return;
108
+ if (!!((_a = this.tabs) === null || _a === void 0 ? void 0 : _a.length) && this.tabs.find(tab => tab.name === this.activeTab) && !((_b = this.tabs.find(tab => tab.name === this.activeTab)) === null || _b === void 0 ? void 0 : _b.isSequential))
109
+ return;
110
+ const serviceItems = this.getServiceItems();
111
+ const firstPendingItemIndex = serviceItems.findIndex(x => x.status === 'pending');
112
+ if (firstPendingItemIndex !== -1) {
113
+ const pendingItemRef = this.el.shadowRoot.querySelectorAll('.claimable-item')[firstPendingItemIndex];
114
+ const progressLaneRef = this.el.shadowRoot.querySelector('.progress-lane');
115
+ const { left: pendingItemLeftOffset } = pendingItemRef.getBoundingClientRect();
116
+ const { width: progressLaneWidth, left: progressLeftOffset } = progressLaneRef.getBoundingClientRect();
117
+ const offsetToLeftRatio = ((pendingItemLeftOffset - progressLeftOffset) / progressLaneWidth) * 100;
118
+ this.progressBar.style.width = `${offsetToLeftRatio.toFixed(2)}%`;
119
+ if (firstPendingItemIndex === serviceItems.length - 1)
120
+ this.claimableItemsBox.scrollTo({
121
+ left: this.claimableItemsBox.scrollWidth,
122
+ behavior: 'smooth',
123
+ });
124
+ else
125
+ scrollIntoContainerView(pendingItemRef, this.claimableItemsBox);
126
+ }
127
+ else if (!(serviceItems.length === 0 || serviceItems.filter(x => x.status === 'activationRequired').length === serviceItems.length)) {
128
+ this.progressBar.style.width = '100%';
129
+ this.claimableItemsBox.scrollTo({
130
+ left: this.claimableItemsBox.scrollWidth,
131
+ behavior: 'smooth',
132
+ });
133
+ }
84
134
  };
85
135
  this.onActiveTabChange = ({ label }) => {
86
136
  this.tabAnimationLoading = true;
87
137
  clearTimeout(this.tabAnimationTimeoutRef);
88
138
  this.tabAnimationTimeoutRef = setTimeout(() => {
89
139
  this.activeTab = label;
90
- this.claimableContentWrapper.scrollLeft = 0;
140
+ // wait for jsx update
91
141
  setTimeout(() => {
92
142
  this.tabAnimationLoading = false;
93
143
  this.updateProgressBar();
94
- }, 100);
95
- }, 500);
144
+ }, 50);
145
+ }, 750);
146
+ };
147
+ this.activateClaimItem = () => {
148
+ if (this.activate)
149
+ this.activate(this.vehicleLookup);
150
+ };
151
+ this.printLastClaimResponse = () => {
152
+ if (this.print) {
153
+ this.print(this.lastSuccessfulClaimResponse);
154
+ }
155
+ else {
156
+ if (this.lastSuccessfulClaimResponse.PrintURL) {
157
+ window.open(this.lastSuccessfulClaimResponse.PrintURL, '_blank').focus();
158
+ }
159
+ }
160
+ };
161
+ this.updatePopoverLocation = () => {
162
+ if (!this.claimableItemPopoverRef)
163
+ return;
164
+ const { left, bottom, width, top } = this.claimableItemPopoverRef.getBoundingClientRect();
165
+ this.popoverTargetLocation = { left: left + width / 2, bottom, top };
166
+ };
167
+ this.setClaimableItemPopover = (showPopover, claimableItem, claimableItemPopoverRef) => {
168
+ if (showPopover) {
169
+ this.claimableItemPopoverRef = claimableItemPopoverRef;
170
+ this.updatePopoverLocation();
171
+ this.selectedClaimItem = claimableItem;
172
+ this.showClaimableItemPopover = true;
173
+ }
174
+ else {
175
+ this.showClaimableItemPopover = false;
176
+ }
177
+ };
178
+ this.handleClaim = async (_a) => {
179
+ var { documents } = _a, payload = __rest(_a, ["documents"]);
180
+ try {
181
+ const formData = new FormData();
182
+ formData.append('payload', JSON.stringify(Object.assign(Object.assign({}, payload), { vin: this.vehicleLookup.vin, serviceItem: this.claimForm.item, saleInformation: this.vehicleLookup.saleInformation, cancelledServiceItems: this.claimForm.canceledItems })));
183
+ if (documents && documents.length > 0) {
184
+ documents.forEach(doc => {
185
+ formData.append('document', doc);
186
+ });
187
+ }
188
+ await new Promise((resolve, reject) => {
189
+ const xhr = new XMLHttpRequest();
190
+ xhr.open('POST', this.claimEndPoint);
191
+ Object.entries(this.headers || {}).forEach(([key, value]) => {
192
+ xhr.setRequestHeader(key, value);
193
+ });
194
+ xhr.upload.onprogress = e => {
195
+ if (e.lengthComputable)
196
+ this.claimForm.setFileUploadProgression(Math.round((e.loaded / e.total) * 100));
197
+ };
198
+ xhr.onload = () => {
199
+ if (xhr.status === 200) {
200
+ try {
201
+ const responseData = JSON.parse(xhr.responseText);
202
+ this.completeClaim(responseData);
203
+ resolve();
204
+ }
205
+ catch (parseError) {
206
+ console.error('Response is not valid JSON', {
207
+ rawResponse: xhr.responseText,
208
+ error: parseError,
209
+ });
210
+ reject(new Error('Upload succeeded but response is not valid JSON'));
211
+ }
212
+ resolve();
213
+ }
214
+ else {
215
+ try {
216
+ const responseData = JSON.parse(xhr.responseText);
217
+ alert(responseData.Message);
218
+ }
219
+ catch (_a) {
220
+ reject(new Error(`Upload failed with status ${xhr.status}`));
221
+ }
222
+ }
223
+ };
224
+ xhr.onerror = e => {
225
+ console.log(e);
226
+ reject(new Error('Network error'));
227
+ };
228
+ xhr.send(formData);
229
+ });
230
+ }
231
+ catch (error) {
232
+ console.error(error);
233
+ alert(this.locale.sharedLocales.errors.requestFailedPleaseTryAgainLater);
234
+ }
235
+ };
236
+ this.handleDevClaim = async ({ documents }) => {
237
+ if (documents && documents.length > 0) {
238
+ this.claimForm.setFileUploadProgression(0);
239
+ let uploadChunks = 20;
240
+ for (let index = 0; index < uploadChunks; index++) {
241
+ const uploadPercentage = Math.round(((index + 1) / uploadChunks) * 100);
242
+ await new Promise(r => setTimeout(r, 200));
243
+ this.claimForm.setFileUploadProgression(uploadPercentage);
244
+ }
245
+ }
246
+ await new Promise(r => setTimeout(r, 1000));
247
+ this.completeClaim({ Success: true, ID: '11223344', PrintURL: 'http://localhost/test/print/1122' });
96
248
  };
97
249
  }
98
250
  async componentWillLoad() {
99
251
  await this.changeLanguage(this.language);
100
252
  }
101
253
  async changeLanguage(newLanguage) {
102
- const localeResponses = await Promise.all([getLocaleLanguage(newLanguage, 'vehicleLookup.claimableItems', dynamicClaimSchema), getSharedLocal(newLanguage)]);
103
- this.locale = localeResponses[0];
104
- this.sharedLocales = localeResponses[1];
105
- }
106
- async componentDidLoad() {
107
- this.claimableContentWrapper = this.el.shadowRoot.querySelector('.claimable-content-wrapper');
108
- this.claimForm = this.el.shadowRoot.getElementById('vehicle-item-claim-form');
109
- this.progressBar = this.el.shadowRoot.querySelector('.progress-bar');
254
+ const [sharedLocales, locale] = await Promise.all([getSharedLocal(newLanguage), getLocaleLanguage(newLanguage, 'vehicleLookup.claimableItems', dynamicClaimSchema)]);
255
+ this.locale = Object.assign({ sharedLocales }, locale);
110
256
  }
111
257
  async setMockData(newMockData) {
112
- mockData = newMockData;
258
+ this.mockData = newMockData;
113
259
  }
114
- async setData(newData, headers = {}) {
115
- var _a;
116
- clearTimeout(this.networkTimeoutRef);
117
- if (this.abortController)
118
- this.abortController.abort();
119
- this.abortController = new AbortController();
120
- let scopedTimeoutRef;
121
- const isVinRequest = typeof newData === 'string';
122
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
123
- this.externalVin = vin;
124
- try {
125
- if (!vin || vin.trim().length === 0) {
126
- this.isError = false;
127
- this.vehicleInformation = null;
128
- return;
129
- }
130
- this.isLoading = true;
260
+ async fetchData(newData, headers = {}) {
261
+ const beforeAssignment = async (vehicleLookup) => {
131
262
  this.showPrintBox = false;
132
- await new Promise(r => {
133
- scopedTimeoutRef = setTimeout(r, 1000);
134
- this.networkTimeoutRef = scopedTimeoutRef;
135
- });
136
- this.claimableContentWrapper.scrollLeft = 0;
137
- const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
138
- if (this.networkTimeoutRef === scopedTimeoutRef) {
139
- if (!vehicleResponse)
140
- throw new Error('wrongResponseFormat');
141
- if (!Array.isArray(vehicleResponse.serviceItems))
142
- throw new Error('noServiceAvailable');
143
- this.vehicleInformation = vehicleResponse;
144
- if ((_a = vehicleResponse === null || vehicleResponse === void 0 ? void 0 : vehicleResponse.serviceItems) === null || _a === void 0 ? void 0 : _a.length) {
145
- let orderedGroups = [];
146
- const unOrderedGroups = [];
147
- vehicleResponse.serviceItems.forEach(({ group }) => {
148
- if (!(group === null || group === void 0 ? void 0 : group.name))
149
- return;
150
- if ([...orderedGroups, ...unOrderedGroups].find(g => (g === null || g === void 0 ? void 0 : g.name) === (group === null || group === void 0 ? void 0 : group.name)))
151
- return;
152
- if (group === null || group === void 0 ? void 0 : group.isDefault)
153
- this.activeTab = group === null || group === void 0 ? void 0 : group.name;
154
- if (typeof (group === null || group === void 0 ? void 0 : group.tabOrder) === 'number')
155
- orderedGroups.push(group);
156
- else
157
- unOrderedGroups.push(group);
158
- });
159
- if (!!unOrderedGroups.length || !!orderedGroups.length) {
160
- orderedGroups = orderedGroups.sort((a, b) => a.tabOrder - b.tabOrder);
161
- this.tabs = [...orderedGroups, ...unOrderedGroups];
162
- if (!this.activeTab)
163
- this.activeTab = this.tabs[0].name;
164
- }
165
- else {
166
- this.tabs = [];
167
- this.activeTab = '';
168
- }
169
- }
170
- else {
171
- this.tabs = [];
172
- this.activeTab = '';
173
- }
174
- }
175
- this.errorMessage = null;
176
- this.isLoading = false;
177
- this.isError = false;
178
- }
179
- catch (error) {
180
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
181
- return;
182
- if (this.errorCallback)
183
- this.errorCallback(error.message);
184
- console.error(error);
185
- this.setErrorMessage(error.message);
186
- }
263
+ await this.parseGroupData(vehicleLookup);
264
+ return vehicleLookup;
265
+ };
266
+ await setVehicleLookupData(this, newData, headers, { beforeAssignment });
187
267
  }
188
268
  async setErrorMessage(message) {
189
- this.isError = true;
190
- this.isLoading = false;
191
- this.vehicleInformation = null;
192
- this.errorMessage = message;
193
- }
194
- async fetchData(requestedVin = this.externalVin, headers = {}) {
195
- await this.setData(requestedVin, headers);
269
+ setVehicleLookupErrorState(this, message);
196
270
  }
197
271
  onLoadingChange(newValue) {
198
272
  if (this.loadingStateChange)
199
273
  this.loadingStateChange(newValue);
200
- this.setLoadingUi(newValue);
201
274
  }
202
- async setLoadingUi(isLoading) {
203
- if (!isLoading) {
204
- this.progressBar.style.width = '0';
205
- this.progressBar.style.opacity = '0';
206
- await new Promise(r => setTimeout(r, 200));
207
- this.updateProgressBar();
208
- }
275
+ async componentDidLoad() {
276
+ this.progressBar = this.el.shadowRoot.querySelector('.progress-bar');
277
+ this.claimForm = this.el.shadowRoot.querySelector('.vehicle-item-claim-form');
278
+ this.claimableItemsBox = this.el.shadowRoot.querySelector('.claimable-items-box');
279
+ window.addEventListener('resize', this.updateProgressBar);
280
+ if (this.claimableItemsBox)
281
+ this.claimableItemsBox.addEventListener('scroll', this.updatePopoverLocation);
282
+ window.addEventListener('scroll', this.updatePopoverLocation);
283
+ window.addEventListener('resize', this.updatePopoverLocation);
209
284
  }
210
- updateProgressBar() {
211
- var _a, _b;
212
- const serviceItems = this.getServiceItems();
213
- if (!!((_a = this.tabs) === null || _a === void 0 ? void 0 : _a.length) && this.tabs.find(tab => tab.name === this.activeTab) && !((_b = this.tabs.find(tab => tab.name === this.activeTab)) === null || _b === void 0 ? void 0 : _b.isSequential)) {
214
- this.progressBar.style.width = '0%';
215
- this.progressBar.style.opacity = '0';
216
- return;
217
- }
218
- if (serviceItems.filter(x => x.status === 'pending').length === 0) {
219
- if (serviceItems.length === 0 || serviceItems.filter(x => x.status === 'activationRequired').length === serviceItems.length) {
220
- this.progressBar.style.width = '0%';
221
- this.progressBar.style.opacity = '0';
222
- }
223
- else {
224
- this.progressBar.style.width = '100%';
225
- this.progressBar.style.opacity = '1';
226
- const claimableItems = this.claimableContentWrapper.getElementsByClassName('claimable-item');
227
- scrollIntoContainerView(claimableItems[claimableItems.length - 1], this.claimableContentWrapper);
228
- }
229
- }
230
- else {
231
- const firstPendingItem = serviceItems.find(x => x.status === 'pending');
232
- const firstPendingItemIndex = serviceItems.indexOf(firstPendingItem) + 1;
233
- const firstPendingItemRef = this.claimableContentWrapper.getElementsByClassName('claimable-item')[firstPendingItemIndex - 1];
234
- this.progressBar.style.width = (firstPendingItemIndex / serviceItems.length - 1 / (serviceItems.length * 2)) * 100 + '%';
235
- this.progressBar.style.opacity = this.progressBar.style.width === '0%' ? '0' : '1';
236
- scrollIntoContainerView(firstPendingItemRef, this.claimableContentWrapper);
237
- }
285
+ async disconnectedCallback() {
286
+ window.removeEventListener('resize', this.updateProgressBar);
287
+ if (this.claimableItemsBox)
288
+ this.claimableItemsBox.removeEventListener('scroll', this.updatePopoverLocation);
289
+ window.removeEventListener('scroll', this.updatePopoverLocation);
290
+ window.removeEventListener('resize', this.updatePopoverLocation);
238
291
  }
239
- resetProgressBar() {
292
+ async onVehicleChange() {
293
+ // wait for jsx update
240
294
  setTimeout(() => {
241
295
  this.updateProgressBar();
242
- }, 100);
243
- }
244
- windowScrollListener(newValue) {
245
- if (newValue) {
246
- this.scrollListenerRef = () => this.calculatePopupPos(this.el.shadowRoot);
247
- window.addEventListener('scroll', this.scrollListenerRef);
248
- this.claimableContentWrapper.addEventListener('scroll', this.scrollListenerRef);
249
- }
250
- else {
251
- window.removeEventListener('scroll', this.scrollListenerRef);
252
- this.claimableContentWrapper.removeEventListener('scroll', this.scrollListenerRef);
253
- }
254
- }
255
- calculatePopupPos(root) {
256
- const popupPositionRef = root.querySelector('.popup-ref');
257
- let { x, y } = popupPositionRef.getBoundingClientRect();
258
- const popupContainer = popupPositionRef.querySelector('.popup-container');
259
- const { width } = popupContainer.getBoundingClientRect();
260
- const popupInfo = popupContainer.querySelector('.popup-info');
261
- const windowWidth = window.innerWidth; // Get the viewport's width
262
- popupContainer.style.top = `${y}px`;
263
- popupContainer.style.left = `${x - width / 2}px`;
264
- const offsetFromLeft = x - width / 2; // Distance from left side of the viewport
265
- const offsetFromRight = windowWidth - (x + width / 2); // Distance from right side of the viewport
266
- let movingNeeded = 0;
267
- let horizontalMargin = 16;
268
- if (offsetFromRight < horizontalMargin)
269
- movingNeeded = offsetFromRight - horizontalMargin;
270
- else if (offsetFromLeft < horizontalMargin)
271
- movingNeeded = Math.abs(offsetFromLeft - horizontalMargin);
272
- popupInfo.style.transform = `translateX(${movingNeeded}px)`;
273
- }
274
- removeLoadAnimationClass(event) {
275
- const component = event.target;
276
- component.classList.remove('load-animation');
296
+ }, 50);
277
297
  }
278
298
  async completeClaim(response) {
279
299
  const serviceItems = this.getServiceItems();
280
- const item = this.cachedClaimItem;
300
+ const item = this.selectedClaimItem;
281
301
  const serviceDataClone = JSON.parse(JSON.stringify(serviceItems));
282
302
  const index = serviceItems.indexOf(item);
283
303
  const pendingItemsBefore = serviceDataClone.slice(0, index).filter(x => x.status === 'pending');
@@ -286,175 +306,47 @@ export class VehicleClaimableItems {
286
306
  pendingItemsBefore.forEach(function (otherItem) {
287
307
  otherItem.status = 'cancelled';
288
308
  });
289
- this.pendingItemHighlighted = false;
290
- const vehicleDataClone = JSON.parse(JSON.stringify(this.vehicleInformation));
309
+ const vehicleDataClone = JSON.parse(JSON.stringify(this.vehicleLookup));
291
310
  vehicleDataClone.serviceItems = serviceDataClone;
292
- this.vehicleInformation = JSON.parse(JSON.stringify(vehicleDataClone));
311
+ this.vehicleLookup = JSON.parse(JSON.stringify(vehicleDataClone));
293
312
  this.showPrintBox = true;
294
313
  this.lastSuccessfulClaimResponse = response;
295
314
  }
296
315
  async claim(item) {
316
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
297
317
  const serviceItems = this.getServiceItems();
298
318
  const vinDataClone = JSON.parse(JSON.stringify(serviceItems));
299
319
  const index = serviceItems.indexOf(item);
320
+ this.selectedClaimItem = item;
300
321
  //Find other items before this item that have status 'pending'
301
322
  let pendingItemsBefore = vinDataClone.slice(0, index).filter(x => x.status === 'pending');
302
- this.cachedClaimItem = item;
303
- if (item.maximumMileage === null) {
323
+ if ((item === null || item === void 0 ? void 0 : item.maximumMileage) === null)
304
324
  pendingItemsBefore = [];
305
- }
306
- this.onMouseLeave();
307
- this.openRedeem(item, pendingItemsBefore);
308
- }
309
- async handleClaiming() {
310
- if (this.isDev) {
311
- this.claimForm.handleClaiming = async ({ document }) => {
312
- if (document) {
313
- this.claimForm.uploadProgress = 0;
314
- let uploadChunks = 20;
315
- for (let index = 0; index < uploadChunks; index++) {
316
- const uploadPercentage = Math.round(((index + 1) / uploadChunks) * 100);
317
- await new Promise(r => setTimeout(r, 200));
318
- this.claimForm.setFileUploadProgression(uploadPercentage);
319
- }
320
- }
321
- this.claimForm.quite();
322
- this.completeClaim({ Success: true, ID: '11223344', PrintURL: 'http://localhost/test/print/1122' });
323
- this.claimForm.handleClaiming = null;
324
- };
325
- }
326
- else {
327
- this.claimForm.handleClaiming = async (_a) => {
328
- var { document } = _a, payload = __rest(_a, ["document"]);
329
- try {
330
- const formData = new FormData();
331
- formData.append('payload', JSON.stringify(Object.assign(Object.assign({}, payload), { vin: this.vehicleInformation.vin, saleInformation: this.vehicleInformation.saleInformation, serviceItem: this.claimForm.item, cancelledServiceItems: this.claimForm.canceledItems })));
332
- if (document)
333
- formData.append('document', document);
334
- await new Promise((resolve, reject) => {
335
- const xhr = new XMLHttpRequest();
336
- xhr.open('POST', this.claimEndPoint);
337
- Object.entries(this.headers || {}).forEach(([key, value]) => {
338
- xhr.setRequestHeader(key, value);
339
- });
340
- xhr.upload.onprogress = e => {
341
- if (e.lengthComputable)
342
- this.claimForm.setFileUploadProgression(Math.round((e.loaded / e.total) * 100));
343
- };
344
- xhr.onload = () => {
345
- this.claimForm.quite();
346
- this.claimForm.handleClaiming = null;
347
- if (xhr.status === 200) {
348
- try {
349
- const responseData = JSON.parse(xhr.responseText);
350
- this.completeClaim(responseData);
351
- resolve();
352
- }
353
- catch (parseError) {
354
- console.error('Response is not valid JSON', {
355
- rawResponse: xhr.responseText,
356
- error: parseError,
357
- });
358
- reject(new Error('Upload succeeded but response is not valid JSON'));
359
- }
360
- resolve();
361
- }
362
- else {
363
- try {
364
- const responseData = JSON.parse(xhr.responseText);
365
- alert(responseData.Message);
366
- }
367
- catch (_a) {
368
- reject(new Error(`Upload failed with status ${xhr.status}`));
369
- }
370
- }
371
- };
372
- xhr.onerror = e => {
373
- console.log(e);
374
- this.claimForm.quite();
375
- this.claimForm.handleClaiming = null;
376
- reject(new Error('Network error'));
377
- };
378
- xhr.send(formData);
379
- });
380
- }
381
- catch (error) {
382
- console.error(error);
383
- alert(this.sharedLocales.errors.requestFailedPleaseTryAgainLater);
384
- this.claimForm.quite();
385
- this.claimForm.handleClaiming = null;
386
- }
387
- };
388
- }
389
- }
390
- openRedeem(item, oldItems) {
391
- var _a, _b, _c, _d, _e;
392
- const vehicleInformation = this.vehicleInformation;
393
- this.claimForm.vin = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.vin;
394
325
  this.claimForm.item = item;
395
- this.claimForm.canceledItems = oldItems;
396
- if (((_a = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _a === void 0 ? void 0 : _a.broker) !== null && ((_c = (_b = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _b === void 0 ? void 0 : _b.broker) === null || _c === void 0 ? void 0 : _c.invoiceDate) === null)
397
- this.claimForm.unInvoicedByBrokerName = (_e = (_d = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _d === void 0 ? void 0 : _d.broker) === null || _e === void 0 ? void 0 : _e.brokerName;
326
+ this.claimForm.vin = (_a = this.vehicleLookup) === null || _a === void 0 ? void 0 : _a.vin;
327
+ this.claimForm.canceledItems = pendingItemsBefore;
328
+ if (((_c = (_b = this.vehicleLookup) === null || _b === void 0 ? void 0 : _b.saleInformation) === null || _c === void 0 ? void 0 : _c.broker) !== null && ((_f = (_e = (_d = this.vehicleLookup) === null || _d === void 0 ? void 0 : _d.saleInformation) === null || _e === void 0 ? void 0 : _e.broker) === null || _f === void 0 ? void 0 : _f.invoiceDate) === null)
329
+ this.claimForm.unInvoicedByBrokerName = (_j = (_h = (_g = this.vehicleLookup) === null || _g === void 0 ? void 0 : _g.saleInformation) === null || _h === void 0 ? void 0 : _h.broker) === null || _j === void 0 ? void 0 : _j.brokerName;
398
330
  else
399
331
  this.claimForm.unInvoicedByBrokerName = null;
400
- this.handleClaiming();
401
- }
402
- createPopup(item) {
403
- const texts = this.locale;
404
- return (h("div", { dir: this.sharedLocales.direction, class: "popup-ref w-0 h-0 bottom-0 flex absolute justify-center" }, h("div", { class: "popup-container fixed z-[100]" }, h("div", { class: cn('opacity-0 w-full z-[101] flex transition-all duration-[0.4s] relative invisible justify-center translate-y-[-9px]', {
405
- '!opacity-100 !visible': this.showPopup,
406
- }) }, h("div", { class: "absolute w-0 h-0 border-[10px] border-t-0 !border-b-[#dddddd] border-transparent" }), h("div", { class: "mt-[1px] absolute w-0 h-0 border-[10px] border-t-0 !border-b-[#f9f9f9] border-transparent" })), h("div", { class: cn('popup-info bg-[#f9f9f9] border border-[#ddd] w-auto p-[20px] rounded-[5px] transition-all duration-[0.4s] text-[#282828] opacity-0 invisible', {
407
- '!opacity-100 !visible': this.showPopup,
408
- }) }, h("table", { class: cn('w-full border-collapse', '[&_th]:border-b [&_th]:border-[#ddd] [&_th]:p-[10px] [&_th]:pe-[50px] [&_th]:text-start [&_th]:whitespace-nowrap', '[&_td]:border-b [&_td]:border-[#ddd] [&_td]:p-[10px] [&_td]:pe-[50px] [&_td]:text-start [&_td]:whitespace-nowrap') }, h("tbody", null, h("tr", null, h("th", null, texts.serviceType), h("td", null, item.type.charAt(0).toUpperCase() + item.type.slice(1))), h("tr", null, h("th", null, texts.activationDate), h("td", null, item.activatedAt)), h("tr", null, h("th", null, texts.expireDate), h("td", null, item.expiresAt)), h("tr", null, h("th", null, texts.claimAt), h("td", null, item.claimDate)), h("tr", null, h("th", null, texts.claimingCompany), h("td", null, item.companyName)), h("tr", null, h("th", null, texts.invoiceNumber), h("td", null, item.invoiceNumber)), h("tr", null, h("th", null, texts.jobNumber), h("td", null, item.jobNumber)), h("tr", null, h("th", null, texts.packageCode), h("td", null, item.packageCode)))), item.claimable && (h("button", { onClick: () => this.claim(item), class: "claim-button m-auto mt-[15px] w-[80%] justify-center" }, h("svg", { class: "size-[30px] duration-200", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { "stroke-width": "0" }), h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), h("g", null, h("circle", { cx: "12", cy: "12", r: "8", "fill-opacity": "0.24" }), h("path", { d: "M8.5 11L11.3939 13.8939C11.4525 13.9525 11.5475 13.9525 11.6061 13.8939L19.5 6", "stroke-width": "1.2" }))), h("span", null, texts.claim)))))));
332
+ this.claimForm.handleClaiming = this.isDev ? this.handleDevClaim.bind(this) : this.handleClaim.bind(this);
333
+ this.claimForm.open();
409
334
  }
335
+ // ====== End Component Logic
410
336
  render() {
411
337
  var _a;
412
338
  const serviceItems = this.getServiceItems();
413
- const texts = this.locale;
414
- const hasInactiveItems = serviceItems.filter(x => x.status === 'activationRequired').length > 0;
339
+ const isNoServicesAvailable = !this.isLoading && this.vehicleLookup && !serviceItems.length;
415
340
  const hideTabs = this.isLoading || this.isError || !this.tabs.length || !serviceItems.length;
416
341
  const tabs = this.tabs.map(group => group.name);
417
- return (h(Host, { key: '650300d8b2495485e104a8450e6849111f45a843' }, h("vehicle-item-claim-form", { key: '205514a455cab1507e9798c66924d10b6b10e09c', locale: texts.claimForm, language: this.language, id: "vehicle-item-claim-form", maximumDocumentFileSizeInMb: this.maximumDocumentFileSizeInMb }), h(VehicleInfoLayout, { key: '24bcc50ed3fd697fe0e1bd536b04300572905519', isError: this.isError, coreOnly: this.coreOnly, isLoading: this.isLoading, vin: (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin, direction: this.sharedLocales.direction, errorMessage: this.sharedLocales.errors[this.errorMessage] || this.sharedLocales.errors.wildCard }, h("div", { key: 'a133d8beadb9dfc21efc4ea3f3eca8f9c97643e5', class: "absolute z-10 w-full pt-[16px]" }, h("div", { key: '3e27fb454add0e0a7a103bddecafaa98fdf39fea', class: cn('duration-300', { 'translate-y-[-50%] opacity-0': hideTabs }) }, h("shift-tabs", { key: 'a71888699a3189bef9f8391b811c0ab2bbbe82d3', activeTabLabel: this.activeTab, changeActiveTab: this.onActiveTabChange, tabs: tabs }))), h("div", { key: 'f879a081b412cf82ff15592034aa8a190edd5964', class: "relative" }, h("div", { key: 'ce6e960144465d725acf883b14a723835bec1292', class: "flex px-[30px] absolute w-full h-[320px] items-center" }, h("div", { key: 'bf3a6cd026eae91abcd895ae4550098f14648273', class: "h-[10px] translate-y-[-5px] relative bg-[#f2f2f2] border border-[#ddd] rounded-[10px] w-[calc(100%-62px)] items-center justify-around" }, h("div", { key: '0bd1d257ab6a49da3dfb15fda773e0ee7a7b951e', class: "w-full h-full rounded-[4px] overflow-x-hidden absolute left-0 top-0" }, h("div", { key: '73b1ab665d109c6f4e77c975ced5c7f8ff587495', class: "absolute opacity-0 bg-[#1a1a1a] w-[150%] h-full" }), h("div", { key: 'cdce5de783b1c1eec2b50d3775f07997af209bff', class: "absolute h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] lane-inc" }), h("div", { key: 'c34ecca02274697dd705f522e06d194747e94c76', class: "absolute h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] lane-dec" })))), h("div", { key: '4230dfc62c4398edb5277c884e2641260ff736d4', dir: "ltr", class: cn('flex overflow-x-scroll px-[30px] relative h-[320px] items-center transition-all duration-300 claimable-content-wrapper', {
418
- 'hide-scroll': this.tabAnimationLoading,
419
- }) }, h("div", { key: 'caa65ad50775e49b88d082409ece04b9a2e20b6a', class: cn('h-[10px] bg-[#f2f2f2] border flex-1 border-[#ddd] rounded-[10px] flex items-center justify-around relative', {
420
- 'bg-transparent border-transparent': this.isLoading || this.tabAnimationLoading || !serviceItems.length,
421
- }) }, serviceItems.map((item, idx) => {
422
- let statusClass = '';
423
- if (item.status === 'pending') {
424
- if (serviceItems.findIndex(i => i.status === 'pending') === idx)
425
- statusClass = item.status;
426
- }
427
- else
428
- statusClass = item.status;
429
- return (h("div", { key: item.name, class: cn('claimable-item flex flex-col items-center gap-[5px] font-[14px] min-w-[250px]', statusClass), onMouseLeave: this.onMouseLeave }, h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: cn('claimable-item-header load-animation hover:[&>img]:rotate-[360deg] hover:[&>img]:scale-[125%] relative duration-[0.4s] py-[10px] leading-[1em] h-[3em] flex flex-col items-center cursor-pointer', {
430
- '!opacity-0 !translate-y-[-5px] !scale-[70%]': this.isLoading || this.tabAnimationLoading,
431
- }), onMouseEnter: event => this.onMouseEnter(event.target, idx) }, h("img", { class: "duration-[0.4s]", src: icons[item.status], alt: "status icon" }), h("span", { dir: this.sharedLocales.direction, class: "font-bold" }, texts[item.status]), this.activePopupIndex === idx && this.createPopup(item)), h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: cn('claimable-item-circle load-animation w-[18px] translate-y-[2px] h-[18px] rounded-[50%] bg-[#a1a1a1] border-[5px] border-double border-[#ececec] transition-all duration-[0.4s] z-[1]', {
432
- '!opacity-0 !scale-[150%]': this.isLoading || this.tabAnimationLoading,
433
- }) }), h("p", { onAnimationEnd: this.removeLoadAnimationClass, class: cn('claimable-item-footer load-animation transition-all duration-[0.4s] px-[20px] text-center leading-[1.5em] h-[4.5em] overflow-hidden text-ellipsis m-0', {
434
- '!opacity-0 !translate-y-[10px] !scale-[70%]': this.isLoading || this.tabAnimationLoading,
435
- }) }, item.name)));
436
- }), h("div", { key: 'bde59a64354da72d443fe00d4f5e655e17f4010b', class: cn('progress-bar h-[10px] opacity-0 bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] border border-[#ddd] rounded-[10px] w-0 absolute left-0 transition-all duration-500 z-0', {
437
- '!w-0 !opacity-0': this.isLoading || this.tabAnimationLoading,
438
- }) })), h("div", { key: '0d26706af93683381eeb154d660e30888a55ef57', class: cn('absolute w-[90%] left-1/2 ml-[-45%] bottom-[40px] z-[1]', { '!z-[-1]': !(this.vehicleInformation && hasInactiveItems) }) }, h("div", { key: '65f407d2ead8a828ba8cbd85f745286ed7c182a4', class: cn('card warning-card span-entire-1st-row activation-panel', {
439
- loading: this.isLoading || this.tabAnimationLoading,
440
- visible: hasInactiveItems,
441
- }), onAnimationEnd: this.removeLoadAnimationClass }, h("p", { key: '3bc24cddfff666c5e5d6151128e5556246f4191c', class: "no-padding flex gap-2" }, h("span", { key: '97ec53465789ac41c60ba78476865c526516f28d', class: "font-semibold" }, texts.warrantyAndServicesNotActivated)), h("button", { key: '3559fbedb98d0d66a018448b47a0c5ae22181e13', onClick: () => {
442
- if (this.activate) {
443
- this.activate(this.vehicleInformation);
444
- }
445
- }, class: "claim-button" }, h("svg", { key: 'afaad252b24ef036246d7ea4e5dfa0e586072286', class: "size-[30px] duration-200", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { key: '29417f41b50310c2a3196aa09f9ec8356f444b2b', "stroke-width": "0" }), h("g", { key: '337ff662f389278eb4252e67d7297b8104b58ad9', "stroke-linecap": "round", "stroke-linejoin": "round" }), h("g", { key: '69055decd90dbf005e604c49e1b8758766b4e59d' }, h("circle", { key: '0e241fa0f14d0363201609a701bf1fe5d09c611f', cx: "12", cy: "12", r: "8", "fill-opacity": "0.24" }), h("path", { key: 'cdc48fe47ee90b76cb94f6db6fbd2b66170c4fdd', d: "M8.5 11L11.3939 13.8939C11.4525 13.9525 11.5475 13.9525 11.6061 13.8939L19.5 6", "stroke-width": "1.2" }))), h("span", { key: '5cfe67e43afa0342e680e9f195dd37c95f0d2dbb' }, texts.activateNow)))), h("div", { key: '2ecd71e4bd4f8e096473b74e330de8f50272f6c5', class: cn('absolute w-[90%] left-1/2 ml-[-45%] bottom-[40px] z-[1]', { '!z-[-1]': !this.showPrintBox }) }, h("div", { key: 'bda52bd244b2af92b3c6c0501e8f85eded6c56c5', class: cn('card warning-card span-entire-1st-row activation-panel', {
446
- loading: this.isLoading,
447
- visible: this.showPrintBox,
448
- }), onAnimationEnd: this.removeLoadAnimationClass }, h("p", { key: '77be3dfd74e1271f4a6c8799feed44d611733604', class: "no-padding flex gap-2" }, h("span", { key: '7cb43c7a81f928396fe932385955bdbe9543a487', class: "font-semibold" }, texts.successFulClaimMessage)), h("button", { key: 'ea9a839303813a7177b66023cc1f961954f4f91b', onClick: () => {
449
- if (this.print) {
450
- this.print(this.lastSuccessfulClaimResponse);
451
- }
452
- else {
453
- if (this.lastSuccessfulClaimResponse.PrintURL) {
454
- window.open(this.lastSuccessfulClaimResponse.PrintURL, '_blank').focus();
455
- }
456
- }
457
- }, class: "claim-button dynamic-claim-button" }, h("svg", { key: 'fec1b6e0cf6615788bcf9ef246a3e9259ae694f9', width: "30px", height: "30px", viewBox: "-5 -5 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'f2348cb0d49cb586e28111952f6b0620948b7d25', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M17 7H7V6h10v1zm0 12H7v-6h10v6zm2-12V3H5v4H1v8.996C1 17.103 1.897 18 3.004 18H5v3h14v-3h1.996A2.004 2.004 0 0 0 23 15.996V7h-4z", fill: "rgb(252, 248, 227)" })), h("span", { key: 'cf58fe2d58d553130b8281d28c3057b5a89097e3' }, texts.print)))))))));
342
+ const hasInactiveItems = serviceItems.filter(x => x.status === 'activationRequired').length > 0;
343
+ return (h(Host, { key: '44360220c1bc6d62278f09d2e2dedf5e607636e2' }, h("vehicle-item-claim-form", { key: '84bf2c209a66abfa205e724ba14ea74d16787198', class: "vehicle-item-claim-form", maximumDocumentFileSizeInMb: this.maximumDocumentFileSizeInMb, uploadMultipleDocuments: this.uploadMultipleDocumentsAtTheForm, locale: Object.assign({ sharedLocales: this.locale.sharedLocales }, this.locale.claimForm) }), h(ClaimableItemPopover, { key: '9afc9a2220229a1a18dfcf60eddc82c9fccf5086', locale: this.locale, claim: this.claim.bind(this), item: this.selectedClaimItem, showPopover: this.showClaimableItemPopover, targetLocation: this.popoverTargetLocation }), h(VehicleInfoLayout, { key: 'e29f026f769f9ba2faf944d8fc9c89a58d54c56f', isError: this.isError, coreOnly: this.coreOnly, header: (_a = this.vehicleLookup) === null || _a === void 0 ? void 0 : _a.vin, direction: this.locale.sharedLocales.direction, isLoading: this.isLoading || this.tabAnimationLoading, errorMessage: this.locale.sharedLocales.errors[this.errorMessage] || this.locale.sharedLocales.errors.wildCard }, h("div", { key: 'e0a9efd29b5597e4dcb4eeb866f6509248956f8b', dir: "ltr", class: cn('relative flex items-center h-[320px] transition-all duration-300', { loading: this.isLoading || this.tabAnimationLoading }) }, h("div", { key: '318a1e9f274cbaffeccb4e031ed45727942da8f6', dir: this.locale.sharedLocales.direction, class: "absolute top-0 z-10 w-full pt-[16px]" }, h("div", { key: '610e25bec66ff292599b940107ca8d47b9b7296a', class: cn('duration-300', { 'translate-y-[-50%] opacity-0': hideTabs }) }, h("shift-tabs", { key: '09776839ef94cc3669122708b569035461ec9b13', activeTabLabel: this.activeTab, changeActiveTab: this.onActiveTabChange, tabs: tabs }))), h("div", { key: '0aecf12769963ca12e3b89a888bc6aef95284933', class: cn('absolute w-[calc(100%-60px)] left-[30px] progress-container-style opacity-0', { 'opacity-100': this.isLoading || this.tabAnimationLoading }) }, h("div", { key: 'bf6e063fd65c34efb40cbd87ab6282617e533f63', class: "w-full h-full rounded-[4px] overflow-x-hidden absolute left-0 top-0" }, h("div", { key: 'a3041409aadacc17c846208fa8a37b140dcc2179', class: "absolute opacity-0 bg-[#1a1a1a] w-[150%] h-full" }), h("div", { key: '8071ef4c5df5bb97a08d78e55354cd313d2bc001', class: "absolute h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] lane-inc" }), h("div", { key: 'f9191cf4d792b4ddb44c629e48de1d8e7f266a46', class: "absolute h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)] lane-dec" }))), h("div", { key: '861ef1c868847ed41d3a183187ec47f35fd4b771', dir: this.locale.sharedLocales.direction, class: cn('absolute w-[90%] z-10 pointer-events-none border opacity-0 translate-y-[-5px] scale-[70%] text-[#8a6d3b] bg-[#fcf8e3] border-[#faebcc] p-[25px] text-[16px] rounded-[6px] flex items-center justify-between left-1/2 -translate-x-1/2 h-10 bottom-[40px] transition duration-500', {
344
+ 'opacity-100 pointer-events-auto translate-y-0 scale-100': !this.isLoading && this.vehicleLookup && !this.tabAnimationLoading && (hasInactiveItems || this.showPrintBox),
345
+ }) }, h("span", { key: '1524fe7df95945e61b47d1eeb61fe0ea71bae523', class: "font-semibold" }, this.showPrintBox ? this.locale.successFulClaimMessage : this.locale.warrantyAndServicesNotActivated), h("button", { key: '83e2945f1874e1f72042d3256144ce6497f527c5', class: "claim-button", onClick: this.showPrintBox ? this.printLastClaimResponse : this.activateClaimItem }, this.showPrintBox ? h(PrintIcon, { class: "size-[30px] duration-200" }) : h(ActivationIcon, { class: "size-[30px] duration-200" }), h("span", { key: 'b40c96dff55772899aed1f2fdf5a3d97c200dd4b' }, this.showPrintBox ? this.locale.print : this.locale.activateNow))), h("div", { key: 'e283a8e067b2a25fa700383923f4b1fcb8b9f64a', class: "claimable-items-box px-[30px] min-w-full relative overflow-x-scroll h-full overflow-y-hidden" }, h("div", { key: 'cc7b8b22ecdba6060e8823ad3c44143328cc9a64', class: "flex relative w-fit min-w-full items-center h-full [&_*]:shrink-0 gap-[250px] justify-between" }, h("div", { key: 'd56212043b5e13ace1f023b1b617605282ba6753', class: cn('progress-container-style progress-lane absolute overflow-hidden w-[calc(100%-0px)] translate-y-0 opacity-100', {
346
+ 'opacity-0': this.isLoading || this.tabAnimationLoading || isNoServicesAvailable || !this.vehicleLookup,
347
+ }) }, h("div", { key: 'a537adcf3a231d964282b7b1791e93fd490e62a1', part: "progress-bar", class: "progress-bar transition-all w-1/2 h-full bg-[linear-gradient(to_bottom,_#428bca_0%,_#3071a9_100%)]" })), h("div", { key: 'beb0abf55009aa202bd29ccfaaa7720a5a475ed7', class: "ml-[-125px]" }), serviceItems.map((item, idx) => (h(ClaimableItem, { item: item, locale: this.locale, setClaimableItemPopover: this.setClaimableItemPopover, addStatusClass: item.status !== 'pending' || serviceItems.findIndex(i => i.status === 'pending') === idx }))), h("div", { key: 'a035f9892e2ac7a4136bffe471c03e2d02eb6c85', class: "ml-[-125px]" })), h("div", { key: '7411e36b7cebaaab816e18480ccfcb2e202323c3', dir: this.locale.sharedLocales.direction, class: cn('absolute top-0 left-0 pointer-events-none size-full box-content flex flex-col justify-center opacity-0 transition duration-500 items-center text-slate-700', {
348
+ 'opacity-100 scale-100': isNoServicesAvailable,
349
+ }) }, h(EmptyTableIcon, { key: '116b499c66991c504a80092b6b142219b414ce64', class: "size-[90px]" }), h("div", { key: '4e75124a913148beb49815ae3b4c16d58eb3d3b3', class: "text-[22px]" }, this.locale.sharedLocales.errors.noServiceAvailable)))))));
458
350
  }
459
351
  static get is() { return "vehicle-claimable-items"; }
460
352
  static get encapsulation() { return "shadow"; }
@@ -470,14 +362,20 @@ export class VehicleClaimableItems {
470
362
  }
471
363
  static get properties() {
472
364
  return {
473
- "baseUrl": {
365
+ "language": {
474
366
  "type": "string",
475
- "attribute": "base-url",
367
+ "attribute": "language",
476
368
  "mutable": false,
477
369
  "complexType": {
478
- "original": "string",
479
- "resolved": "string",
480
- "references": {}
370
+ "original": "LanguageKeys",
371
+ "resolved": "\"ar\" | \"en\" | \"ku\" | \"ru\"",
372
+ "references": {
373
+ "LanguageKeys": {
374
+ "location": "import",
375
+ "path": "~features/multi-lingual",
376
+ "id": "src/features/multi-lingual/index.ts::LanguageKeys"
377
+ }
378
+ }
481
379
  },
482
380
  "required": false,
483
381
  "optional": false,
@@ -487,15 +385,16 @@ export class VehicleClaimableItems {
487
385
  },
488
386
  "getter": false,
489
387
  "setter": false,
490
- "reflect": false
388
+ "reflect": false,
389
+ "defaultValue": "'en'"
491
390
  },
492
- "headers": {
493
- "type": "any",
494
- "attribute": "headers",
391
+ "coreOnly": {
392
+ "type": "boolean",
393
+ "attribute": "core-only",
495
394
  "mutable": false,
496
395
  "complexType": {
497
- "original": "any",
498
- "resolved": "any",
396
+ "original": "boolean",
397
+ "resolved": "boolean",
499
398
  "references": {}
500
399
  },
501
400
  "required": false,
@@ -507,7 +406,7 @@ export class VehicleClaimableItems {
507
406
  "getter": false,
508
407
  "setter": false,
509
408
  "reflect": false,
510
- "defaultValue": "{}"
409
+ "defaultValue": "false"
511
410
  },
512
411
  "isDev": {
513
412
  "type": "boolean",
@@ -526,12 +425,11 @@ export class VehicleClaimableItems {
526
425
  },
527
426
  "getter": false,
528
427
  "setter": false,
529
- "reflect": false,
530
- "defaultValue": "false"
428
+ "reflect": false
531
429
  },
532
- "queryString": {
430
+ "baseUrl": {
533
431
  "type": "string",
534
- "attribute": "query-string",
432
+ "attribute": "base-url",
535
433
  "mutable": false,
536
434
  "complexType": {
537
435
  "original": "string",
@@ -546,16 +444,15 @@ export class VehicleClaimableItems {
546
444
  },
547
445
  "getter": false,
548
446
  "setter": false,
549
- "reflect": false,
550
- "defaultValue": "''"
447
+ "reflect": false
551
448
  },
552
- "coreOnly": {
553
- "type": "boolean",
554
- "attribute": "core-only",
449
+ "headers": {
450
+ "type": "unknown",
451
+ "attribute": "headers",
555
452
  "mutable": false,
556
453
  "complexType": {
557
- "original": "boolean",
558
- "resolved": "boolean",
454
+ "original": "object",
455
+ "resolved": "object",
559
456
  "references": {}
560
457
  },
561
458
  "required": false,
@@ -566,60 +463,15 @@ export class VehicleClaimableItems {
566
463
  },
567
464
  "getter": false,
568
465
  "setter": false,
569
- "reflect": false,
570
- "defaultValue": "false"
466
+ "defaultValue": "{}"
571
467
  },
572
- "language": {
468
+ "queryString": {
573
469
  "type": "string",
574
- "attribute": "language",
575
- "mutable": false,
576
- "complexType": {
577
- "original": "LanguageKeys",
578
- "resolved": "\"ar\" | \"en\" | \"ku\" | \"ru\"",
579
- "references": {
580
- "LanguageKeys": {
581
- "location": "import",
582
- "path": "~types/locale",
583
- "id": "src/global/types/locale.ts::LanguageKeys"
584
- }
585
- }
586
- },
587
- "required": false,
588
- "optional": false,
589
- "docs": {
590
- "tags": [],
591
- "text": ""
592
- },
593
- "getter": false,
594
- "setter": false,
595
- "reflect": false,
596
- "defaultValue": "'en'"
597
- },
598
- "print": {
599
- "type": "unknown",
600
- "attribute": "print",
601
- "mutable": false,
602
- "complexType": {
603
- "original": "(claimResponse: any) => void",
604
- "resolved": "(claimResponse: any) => void",
605
- "references": {}
606
- },
607
- "required": false,
608
- "optional": true,
609
- "docs": {
610
- "tags": [],
611
- "text": ""
612
- },
613
- "getter": false,
614
- "setter": false
615
- },
616
- "maximumDocumentFileSizeInMb": {
617
- "type": "number",
618
- "attribute": "maximum-document-file-size-in-mb",
470
+ "attribute": "query-string",
619
471
  "mutable": false,
620
472
  "complexType": {
621
- "original": "number",
622
- "resolved": "number",
473
+ "original": "string",
474
+ "resolved": "string",
623
475
  "references": {}
624
476
  },
625
477
  "required": false,
@@ -631,15 +483,15 @@ export class VehicleClaimableItems {
631
483
  "getter": false,
632
484
  "setter": false,
633
485
  "reflect": false,
634
- "defaultValue": "30"
486
+ "defaultValue": "''"
635
487
  },
636
- "claimEndPoint": {
637
- "type": "string",
638
- "attribute": "claim-end-point",
488
+ "uploadMultipleDocumentsAtTheForm": {
489
+ "type": "boolean",
490
+ "attribute": "upload-multiple-documents-at-the-form",
639
491
  "mutable": false,
640
492
  "complexType": {
641
- "original": "string",
642
- "resolved": "string",
493
+ "original": "boolean",
494
+ "resolved": "boolean",
643
495
  "references": {}
644
496
  },
645
497
  "required": false,
@@ -651,7 +503,7 @@ export class VehicleClaimableItems {
651
503
  "getter": false,
652
504
  "setter": false,
653
505
  "reflect": false,
654
- "defaultValue": "'api/vehicle/swift-claim'"
506
+ "defaultValue": "true"
655
507
  },
656
508
  "errorCallback": {
657
509
  "type": "unknown",
@@ -663,13 +515,13 @@ export class VehicleClaimableItems {
663
515
  "references": {
664
516
  "ErrorKeys": {
665
517
  "location": "import",
666
- "path": "~lib/get-local-language",
667
- "id": "src/global/lib/get-local-language.ts::ErrorKeys"
518
+ "path": "~features/multi-lingual",
519
+ "id": "src/features/multi-lingual/index.ts::ErrorKeys"
668
520
  }
669
521
  }
670
522
  },
671
523
  "required": false,
672
- "optional": false,
524
+ "optional": true,
673
525
  "docs": {
674
526
  "tags": [],
675
527
  "text": ""
@@ -719,6 +571,64 @@ export class VehicleClaimableItems {
719
571
  "getter": false,
720
572
  "setter": false
721
573
  },
574
+ "print": {
575
+ "type": "unknown",
576
+ "attribute": "print",
577
+ "mutable": false,
578
+ "complexType": {
579
+ "original": "(claimResponse: any) => void",
580
+ "resolved": "(claimResponse: any) => void",
581
+ "references": {}
582
+ },
583
+ "required": false,
584
+ "optional": true,
585
+ "docs": {
586
+ "tags": [],
587
+ "text": ""
588
+ },
589
+ "getter": false,
590
+ "setter": false
591
+ },
592
+ "maximumDocumentFileSizeInMb": {
593
+ "type": "number",
594
+ "attribute": "maximum-document-file-size-in-mb",
595
+ "mutable": false,
596
+ "complexType": {
597
+ "original": "number",
598
+ "resolved": "number",
599
+ "references": {}
600
+ },
601
+ "required": false,
602
+ "optional": false,
603
+ "docs": {
604
+ "tags": [],
605
+ "text": ""
606
+ },
607
+ "getter": false,
608
+ "setter": false,
609
+ "reflect": false,
610
+ "defaultValue": "30"
611
+ },
612
+ "claimEndPoint": {
613
+ "type": "string",
614
+ "attribute": "claim-end-point",
615
+ "mutable": false,
616
+ "complexType": {
617
+ "original": "string",
618
+ "resolved": "string",
619
+ "references": {}
620
+ },
621
+ "required": false,
622
+ "optional": false,
623
+ "docs": {
624
+ "tags": [],
625
+ "text": ""
626
+ },
627
+ "getter": false,
628
+ "setter": false,
629
+ "reflect": false,
630
+ "defaultValue": "'api/vehicle/swift-claim'"
631
+ },
722
632
  "activate": {
723
633
  "type": "unknown",
724
634
  "attribute": "activate",
@@ -747,27 +657,26 @@ export class VehicleClaimableItems {
747
657
  }
748
658
  static get states() {
749
659
  return {
750
- "sharedLocales": {},
751
660
  "locale": {},
752
- "activeTab": {},
753
661
  "isError": {},
754
- "showPopup": {},
662
+ "errorMessage": {},
755
663
  "isLoading": {},
756
- "externalVin": {},
664
+ "vehicleLookup": {},
665
+ "activeTab": {},
757
666
  "showPrintBox": {},
758
- "errorMessage": {},
759
667
  "tabAnimationLoading": {},
760
- "activePopupIndex": {},
761
- "tabs": {},
762
668
  "lastSuccessfulClaimResponse": {},
763
- "vehicleInformation": {}
669
+ "showClaimableItemPopover": {},
670
+ "selectedClaimItem": {},
671
+ "tabs": {},
672
+ "popoverTargetLocation": {}
764
673
  };
765
674
  }
766
675
  static get methods() {
767
676
  return {
768
677
  "setMockData": {
769
678
  "complexType": {
770
- "signature": "(newMockData: MockJson<VehicleLookupDTO>) => Promise<void>",
679
+ "signature": "(newMockData: VehicleLookupMock) => Promise<void>",
771
680
  "parameters": [{
772
681
  "name": "newMockData",
773
682
  "type": "{ [key: string]: VehicleLookupDTO; }",
@@ -778,15 +687,10 @@ export class VehicleClaimableItems {
778
687
  "location": "global",
779
688
  "id": "global::Promise"
780
689
  },
781
- "MockJson": {
690
+ "VehicleLookupMock": {
782
691
  "location": "import",
783
- "path": "~types/components",
784
- "id": "src/global/types/components.ts::MockJson"
785
- },
786
- "VehicleLookupDTO": {
787
- "location": "import",
788
- "path": "~types/generated/vehicle-lookup/vehicle-lookup-dto",
789
- "id": "src/global/types/generated/vehicle-lookup/vehicle-lookup-dto.ts::VehicleLookupDTO"
692
+ "path": "~features/vehicle-lookup-component/types",
693
+ "id": "src/features/vehicle-lookup-component/types.ts::VehicleLookupMock"
790
694
  }
791
695
  },
792
696
  "return": "Promise<void>"
@@ -796,7 +700,7 @@ export class VehicleClaimableItems {
796
700
  "tags": []
797
701
  }
798
702
  },
799
- "setData": {
703
+ "fetchData": {
800
704
  "complexType": {
801
705
  "signature": "(newData: VehicleLookupDTO | string, headers?: any) => Promise<void>",
802
706
  "parameters": [{
@@ -817,15 +721,6 @@ export class VehicleClaimableItems {
817
721
  "location": "import",
818
722
  "path": "~types/generated/vehicle-lookup/vehicle-lookup-dto",
819
723
  "id": "src/global/types/generated/vehicle-lookup/vehicle-lookup-dto.ts::VehicleLookupDTO"
820
- },
821
- "ReturnType": {
822
- "location": "global",
823
- "id": "global::ReturnType"
824
- },
825
- "VehicleServiceItemDTO": {
826
- "location": "import",
827
- "path": "~types/generated/vehicle-lookup/vehicle-service-item-dto",
828
- "id": "src/global/types/generated/vehicle-lookup/vehicle-service-item-dto.ts::VehicleServiceItemDTO"
829
724
  }
830
725
  },
831
726
  "return": "Promise<void>"
@@ -850,33 +745,8 @@ export class VehicleClaimableItems {
850
745
  },
851
746
  "ErrorKeys": {
852
747
  "location": "import",
853
- "path": "~lib/get-local-language",
854
- "id": "src/global/lib/get-local-language.ts::ErrorKeys"
855
- }
856
- },
857
- "return": "Promise<void>"
858
- },
859
- "docs": {
860
- "text": "",
861
- "tags": []
862
- }
863
- },
864
- "fetchData": {
865
- "complexType": {
866
- "signature": "(requestedVin?: string, headers?: any) => Promise<void>",
867
- "parameters": [{
868
- "name": "requestedVin",
869
- "type": "string",
870
- "docs": ""
871
- }, {
872
- "name": "headers",
873
- "type": "any",
874
- "docs": ""
875
- }],
876
- "references": {
877
- "Promise": {
878
- "location": "global",
879
- "id": "global::Promise"
748
+ "path": "~features/multi-lingual",
749
+ "id": "src/features/multi-lingual/index.ts::ErrorKeys"
880
750
  }
881
751
  },
882
752
  "return": "Promise<void>"
@@ -949,11 +819,8 @@ export class VehicleClaimableItems {
949
819
  "propName": "isLoading",
950
820
  "methodName": "onLoadingChange"
951
821
  }, {
952
- "propName": "vehicleInformation",
953
- "methodName": "resetProgressBar"
954
- }, {
955
- "propName": "popupClasses",
956
- "methodName": "windowScrollListener"
822
+ "propName": "vehicleLookup",
823
+ "methodName": "onVehicleChange"
957
824
  }];
958
825
  }
959
826
  }