adp-web-components 0.3.13 → 0.3.15

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 (383) hide show
  1. package/dist/cjs/{add-icon-BaoMAIgg.js → add-icon-BklgM02f.js} +1 -1
  2. package/dist/cjs/{app-globals-DBRBLgev.js → app-globals-XGpRBTr6.js} +1 -1
  3. package/dist/cjs/{arrow-icon-CJX1aUJ8.js → arrow-icon-yMlETDbD.js} +1 -1
  4. package/dist/cjs/{arrow-up-icon-B3Z5Myqt.js → arrow-up-icon-BLo1aQC2.js} +1 -1
  5. package/dist/cjs/{form-dialog_13.cjs.entry.js → branch-slot-dropdown_15.cjs.entry.js} +578 -41
  6. package/dist/cjs/{calendar-days-icon-CsHz2cgV.js → calendar-days-icon-Cf14ROXV.js} +1 -1
  7. package/dist/cjs/{check-icon-CqTKjw2o.js → check-icon-DaQxP2EY.js} +1 -1
  8. package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +11 -11
  9. package/dist/cjs/{decode-time-offset-DOSaziv5.js → decode-time-offset-DOUImlif.js} +1 -1
  10. package/dist/cjs/flexible-container.cjs.entry.js +4 -4
  11. package/dist/cjs/form-checkbox.cjs.entry.js +6 -6
  12. package/dist/cjs/form-date-picker.cjs.entry.js +8 -8
  13. package/dist/cjs/{form-error-message-K-KI154V.js → form-error-message-BtLdHgxO.js} +1 -1
  14. package/dist/cjs/{form-input-PYkIVe7J.js → form-input-BBY_3Qk7.js} +8 -6
  15. package/dist/cjs/{form-input-label-uhneFYXO.js → form-input-label-B4lkF89K.js} +1 -1
  16. package/dist/cjs/form-input_7.cjs.entry.js +26 -26
  17. package/dist/cjs/form-switch.cjs.entry.js +6 -6
  18. package/dist/cjs/form-time-picker.cjs.entry.js +9 -9
  19. package/dist/cjs/{functions-Bu1AQDD2.js → functions-BHYWCotp.js} +5 -11
  20. package/dist/cjs/general-form.cjs.entry.js +11 -11
  21. package/dist/cjs/general-inquiry-form.cjs.entry.js +11 -11
  22. package/dist/cjs/{get-language-from-url-p2OXldYh.js → get-language-from-url-DwOt9DVH.js} +5 -1
  23. package/dist/cjs/{get-local-language-BR0p0bBg.js → get-local-language-BSOLV9z2.js} +7 -3
  24. package/dist/cjs/{get-mock-files-Dljv5P4k.js → get-mock-files-Dv8XsTW8.js} +2 -2
  25. package/dist/cjs/{index-Bi6W8dMN.js → index-BdHAYIvO.js} +16 -0
  26. package/dist/cjs/information-table.cjs.entry.js +2 -2
  27. package/dist/cjs/{loader-icon-By94sKO7.js → loader-icon-aY56OHXW.js} +1 -1
  28. package/dist/cjs/loader.cjs.js +3 -3
  29. package/dist/cjs/loading-spinner.cjs.entry.js +2 -2
  30. package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +4 -4
  31. package/dist/cjs/{mappers-DF2WCWpn.js → mappers-BlH-TAo7.js} +27 -5
  32. package/dist/cjs/{material-card-BqsZgRVE.js → material-card-D1UQcy6U.js} +1 -1
  33. package/dist/cjs/part-lookup.cjs.entry.js +3 -3
  34. package/dist/cjs/{qr-code-scan-B-8WHa22.js → qr-code-scan-CtKK6wLL.js} +1 -1
  35. package/dist/cjs/service-booking-form.cjs.entry.js +11 -11
  36. package/dist/cjs/shift-accordion.cjs.entry.js +2 -2
  37. package/dist/cjs/shift-checkbox.cjs.entry.js +4 -4
  38. package/dist/cjs/shift-components.cjs.js +3 -3
  39. package/dist/cjs/shift-slider.cjs.entry.js +2 -2
  40. package/dist/cjs/shift-switch.cjs.entry.js +3 -3
  41. package/dist/cjs/shift-tab-content.cjs.entry.js +2 -2
  42. package/dist/cjs/shift-tabs_2.cjs.entry.js +13 -13
  43. package/dist/cjs/ssc-lookup-form.cjs.entry.js +11 -11
  44. package/dist/cjs/test-drive-form.cjs.entry.js +11 -11
  45. package/dist/cjs/{triangle-alert-CN15U99s.js → triangle-alert-BjQBwsRv.js} +1 -1
  46. package/dist/cjs/{validation-jJwLyk27.js → validation-5ZUxalyW.js} +3 -1
  47. package/dist/cjs/{vehicle-accessories_7.cjs.entry.js → vehicle-accessories_8.cjs.entry.js} +418 -19
  48. package/dist/cjs/{vehicle-info-layout-sV6altzn.js → vehicle-info-layout-CRpL8UMY.js} +1 -1
  49. package/dist/cjs/vehicle-lookup.cjs.entry.js +9 -5
  50. package/dist/cjs/vehicle-quotation-form.cjs.entry.js +7 -7
  51. package/dist/cjs/{get-custom-classes-for-portal-NNOxAU3P.js → white-loader-CveXuRsH.js} +15 -15
  52. package/dist/collection/collection-manifest.json +3 -0
  53. package/dist/collection/components/components/empty.css +1 -1
  54. package/dist/collection/components/components/flexible-container.css +1 -1
  55. package/dist/collection/components/components/flexible-container.js +2 -2
  56. package/dist/collection/components/components/loading-spinner.js +1 -1
  57. package/dist/collection/components/components/shift-accordion.js +1 -1
  58. package/dist/collection/components/components/shift-checkbox.js +1 -1
  59. package/dist/collection/components/components/shift-portal.css +1 -1
  60. package/dist/collection/components/components/shift-select-dropdown.css +1 -1
  61. package/dist/collection/components/components/shift-select-dropdown.js +2 -2
  62. package/dist/collection/components/components/shift-select.css +1 -1
  63. package/dist/collection/components/components/shift-select.js +3 -3
  64. package/dist/collection/components/components/shift-slider.js +1 -1
  65. package/dist/collection/components/components/shift-switch.js +1 -1
  66. package/dist/collection/components/components/shift-tab-content.js +1 -1
  67. package/dist/collection/components/components/shift-tabs.js +2 -2
  68. package/dist/collection/components/form-elements/branch-slot-dropdown.css +1 -0
  69. package/dist/collection/components/form-elements/branch-slot-dropdown.js +405 -0
  70. package/dist/collection/components/form-elements/branch-slot-picker.css +1 -0
  71. package/dist/collection/components/form-elements/branch-slot-picker.js +921 -0
  72. package/dist/collection/components/form-elements/form-checkbox.js +1 -1
  73. package/dist/collection/components/form-elements/form-date-picker-legacy.js +4 -4
  74. package/dist/collection/components/form-elements/form-dialog.js +1 -1
  75. package/dist/collection/components/form-elements/form-file.js +22 -4
  76. package/dist/collection/components/form-elements/form-input.js +2 -2
  77. package/dist/collection/components/form-elements/form-inputs.css +1 -1
  78. package/dist/collection/components/form-elements/form-picker-input.js +2 -2
  79. package/dist/collection/components/form-elements/form-shadow-input.js +1 -1
  80. package/dist/collection/components/form-elements/form-stepper-control.js +2 -2
  81. package/dist/collection/components/form-elements/form-stepper-submit.js +2 -2
  82. package/dist/collection/components/form-elements/form-stepper.js +1 -1
  83. package/dist/collection/components/form-elements/form-structure-error.js +1 -1
  84. package/dist/collection/components/form-elements/form-submit.js +2 -2
  85. package/dist/collection/components/form-elements/form-switch.js +1 -1
  86. package/dist/collection/components/form-elements/form-text-area.js +2 -2
  87. package/dist/collection/components/form-elements/form-time-picker-legacy.js +5 -5
  88. package/dist/collection/components/form-elements/form-vin-input.js +2 -2
  89. package/dist/collection/components/forms/defaults/mappers.js +23 -1
  90. package/dist/collection/components/forms/defaults/validation.js +2 -1
  91. package/dist/collection/components/forms/general-form.js +2 -2
  92. package/dist/collection/components/forms/general-inquiry.js +2 -2
  93. package/dist/collection/components/forms/service-booking.js +2 -2
  94. package/dist/collection/components/forms/ssc-lookup.js +2 -2
  95. package/dist/collection/components/forms/test-drive.js +2 -2
  96. package/dist/collection/components/forms/vehicle-quotation.js +2 -2
  97. package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
  98. package/dist/collection/components/part-lookup/dead-stock-lookup.js +2 -2
  99. package/dist/collection/components/part-lookup/distributor-lookup.js +2 -2
  100. package/dist/collection/components/part-lookup/manufacturer-part-lookup.js +1 -1
  101. package/dist/collection/components/vehicle-lookup/components/CoverageTimeline.js +317 -0
  102. package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +2 -2
  103. package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +5 -5
  104. package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.js +7 -7
  105. package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +6 -2
  106. package/dist/collection/components/vehicle-lookup/vehicle-sale-information.js +2 -2
  107. package/dist/collection/components/vehicle-lookup/vehicle-service-history.js +1 -1
  108. package/dist/collection/components/vehicle-lookup/vehicle-specification.js +1 -1
  109. package/dist/collection/components/vehicle-lookup/vehicle-warranty-timeline.css +1 -0
  110. package/dist/collection/components/vehicle-lookup/vehicle-warranty-timeline.js +467 -0
  111. package/dist/collection/components/vin-extractor/vin-extractor.js +1 -1
  112. package/dist/collection/features/form-hook/form-hook.js +4 -0
  113. package/dist/collection/features/form-hook/functions.js +2 -8
  114. package/dist/collection/features/form-hook/inputs/form-input.js +7 -5
  115. package/dist/collection/global/types/generated/vehicle-lookup/vehicle-extended-warranty-dto.js +1 -0
  116. package/dist/collection/locale-mapper.js +5 -1
  117. package/dist/collection/locales/vehicleLookup/warrantyTimeline/type.js +31 -0
  118. package/dist/collection/templates/vehicle-lookup/prototype-assets/extended-warranty/adp-logo.svg +11 -0
  119. package/dist/collection/templates/vehicle-lookup/warranty-mock-data.js +96 -1
  120. package/dist/components/branch-slot-dropdown.d.ts +11 -0
  121. package/dist/components/branch-slot-dropdown.js +5 -0
  122. package/dist/components/branch-slot-picker.d.ts +11 -0
  123. package/dist/components/branch-slot-picker.js +5 -0
  124. package/dist/components/dead-stock-lookup.js +1 -1
  125. package/dist/components/distributor-lookup.js +1 -1
  126. package/dist/components/flexible-container.js +1 -1
  127. package/dist/components/form-checkbox.js +1 -1
  128. package/dist/components/form-date-picker.js +1 -1
  129. package/dist/components/form-dialog.js +1 -1
  130. package/dist/components/form-file.js +1 -1
  131. package/dist/components/form-input-preview.js +1 -1
  132. package/dist/components/form-input.js +1 -1
  133. package/dist/components/form-phone-number.js +1 -1
  134. package/dist/components/form-picker-input.js +1 -1
  135. package/dist/components/form-select.js +1 -1
  136. package/dist/components/form-shadow-input.js +1 -1
  137. package/dist/components/form-stepper-control.js +1 -1
  138. package/dist/components/form-stepper-submit.js +1 -1
  139. package/dist/components/form-stepper.js +1 -1
  140. package/dist/components/form-structure-error.js +1 -1
  141. package/dist/components/form-structure.js +1 -1
  142. package/dist/components/form-submit.js +1 -1
  143. package/dist/components/form-switch.js +1 -1
  144. package/dist/components/form-text-area.js +1 -1
  145. package/dist/components/form-time-picker.js +1 -1
  146. package/dist/components/form-vin-input.js +1 -1
  147. package/dist/components/general-form.js +1 -1
  148. package/dist/components/general-inquiry-form.js +1 -1
  149. package/dist/components/index.js +1 -1
  150. package/dist/components/information-table.js +1 -1
  151. package/dist/components/loading-spinner.js +1 -1
  152. package/dist/components/manufacturer-lookup.js +1 -1
  153. package/dist/components/manufacturer-part-lookup.js +1 -1
  154. package/dist/components/{p-CKrwCtec.js → p--qz4ecXR.js} +1 -1
  155. package/dist/components/{p-BMxw31OW.js → p-3xgnJUhD.js} +1 -1
  156. package/dist/components/{p-DJ0awYVE.js → p-87NLGlyb.js} +1 -1
  157. package/dist/components/{p-dRP9cgZF.js → p-B2FtamaW.js} +1 -1
  158. package/dist/components/{p-Cl-rntc3.js → p-B47kSZHb.js} +1 -1
  159. package/dist/components/p-B7gfOpxv.js +5 -0
  160. package/dist/components/{p-CjByjVT0.js → p-B83lw3YO.js} +1 -1
  161. package/dist/components/p-B9ClwHPb.js +5 -0
  162. package/dist/components/p-B9_-Tb0H.js +5 -0
  163. package/dist/components/{p-CtyIp56a.js → p-BAtXT_Mt.js} +1 -1
  164. package/dist/components/p-BGX0qdUG.js +5 -0
  165. package/dist/components/{p-Hlqj6HsH.js → p-BPnD6Cqq.js} +1 -1
  166. package/dist/components/{p-BNs9PHd8.js → p-BQC1g-wS.js} +1 -1
  167. package/dist/components/p-B__72-PA.js +5 -0
  168. package/dist/components/{p-Wv20cFTm.js → p-BaKmifzr.js} +1 -1
  169. package/dist/components/{p-CRJSM0nN.js → p-BcDVkdxZ.js} +1 -1
  170. package/dist/components/{p-D-0CfzDk.js → p-ByA_B82T.js} +1 -1
  171. package/dist/components/p-C0JoH_yH.js +5 -0
  172. package/dist/components/{p-BjLQXN9e.js → p-C2RnTSH-.js} +1 -1
  173. package/dist/components/{p-B3Vlmu9F.js → p-C4ud82ie.js} +1 -1
  174. package/dist/components/p-CCuYl9VQ.js +5 -0
  175. package/dist/components/{p-BIeJEFM6.js → p-CDQ5F3Oe.js} +1 -1
  176. package/dist/components/{p-ubqjXh5U.js → p-CGJ8ndBw.js} +1 -1
  177. package/dist/components/p-CNcA_RyS.js +5 -0
  178. package/dist/components/{p-BcRom3sV.js → p-C_ZtLgwx.js} +1 -1
  179. package/dist/components/{p-BHYsBcpG.js → p-Cq13CFua.js} +1 -1
  180. package/dist/components/p-CzVOOo8C.js +5 -0
  181. package/dist/components/{p-B42vuL_p.js → p-D-6PSzhd.js} +1 -1
  182. package/dist/components/{p-DBErZTaY.js → p-D2H3RzIC.js} +1 -1
  183. package/dist/components/{p-CMgPnaDZ.js → p-DHaTQ9vT.js} +1 -1
  184. package/dist/components/{p-8EOK_QhL.js → p-DQGcS-zL.js} +1 -1
  185. package/dist/components/p-DQopO8HS.js +5 -0
  186. package/dist/components/p-DTk3bhGl.js +5 -0
  187. package/dist/components/p-Dal_X4-W.js +5 -0
  188. package/dist/components/{p-CoAe_PpX.js → p-DdB_zKQz.js} +1 -1
  189. package/dist/components/{p-BP6R1nYk.js → p-Dhi7g1w3.js} +1 -1
  190. package/dist/components/p-Dr_ggnvT.js +5 -0
  191. package/dist/components/{p-C55Gk63d.js → p-Dx0NcxCM.js} +1 -1
  192. package/dist/components/{p-50EIzP4j.js → p-HT-TmIJD.js} +1 -1
  193. package/dist/components/{p-BFAzCUQY.js → p-ZTI11kto.js} +1 -1
  194. package/dist/components/{p-DbAAihIH.js → p-a5fTeexp.js} +1 -1
  195. package/dist/components/{p-BDlZ35Dv.js → p-bOkg1-34.js} +1 -1
  196. package/dist/components/{p-DWGSY0dp.js → p-gzdpekMI.js} +1 -1
  197. package/dist/components/{p-DNZ31iYw.js → p-pIanEonc.js} +1 -1
  198. package/dist/components/{p-BDHTK4yJ.js → p-qGX3WTkQ.js} +1 -1
  199. package/dist/components/{p-CnZZ3ASF.js → p-qs0MTheD.js} +1 -1
  200. package/dist/components/{p-CD1XArUc.js → p-txgHrQYx.js} +1 -1
  201. package/dist/components/{p-BsgLxjfx.js → p-v_TjAHaO.js} +1 -1
  202. package/dist/components/part-lookup.js +1 -1
  203. package/dist/components/service-booking-form.js +1 -1
  204. package/dist/components/shift-accordion.js +1 -1
  205. package/dist/components/shift-checkbox.js +1 -1
  206. package/dist/components/shift-portal.js +1 -1
  207. package/dist/components/shift-select-dropdown.js +1 -1
  208. package/dist/components/shift-select.js +1 -1
  209. package/dist/components/shift-slider.js +1 -1
  210. package/dist/components/shift-switch.js +1 -1
  211. package/dist/components/shift-tab-content.js +1 -1
  212. package/dist/components/shift-tabs.js +1 -1
  213. package/dist/components/ssc-lookup-form.js +1 -1
  214. package/dist/components/test-drive-form.js +1 -1
  215. package/dist/components/vehicle-accessories.js +1 -1
  216. package/dist/components/vehicle-claimable-items.js +1 -1
  217. package/dist/components/vehicle-item-claim-form.js +1 -1
  218. package/dist/components/vehicle-lookup.js +1 -1
  219. package/dist/components/vehicle-paint-thickness.js +1 -1
  220. package/dist/components/vehicle-quotation-form.js +1 -1
  221. package/dist/components/vehicle-sale-information.js +1 -1
  222. package/dist/components/vehicle-service-history.js +1 -1
  223. package/dist/components/vehicle-specification.js +1 -1
  224. package/dist/components/vehicle-warranty-details.js +1 -1
  225. package/dist/components/vehicle-warranty-timeline.d.ts +11 -0
  226. package/dist/components/vehicle-warranty-timeline.js +5 -0
  227. package/dist/components/vin-extractor.js +1 -1
  228. package/dist/esm/{add-icon-DxQVyX6U.js → add-icon-DHh6DJXR.js} +1 -1
  229. package/dist/esm/{app-globals-ci3rJxmu.js → app-globals-CusTGK9D.js} +1 -1
  230. package/dist/esm/{arrow-icon-DRTeN2D5.js → arrow-icon-DziuNOTp.js} +1 -1
  231. package/dist/esm/{arrow-up-icon-FAYFxG6c.js → arrow-up-icon-Dw_d-rG9.js} +1 -1
  232. package/dist/esm/{form-dialog_13.entry.js → branch-slot-dropdown_15.entry.js} +575 -40
  233. package/dist/esm/{calendar-days-icon-BOy0a_W-.js → calendar-days-icon-CnASOv7M.js} +1 -1
  234. package/dist/esm/{check-icon-BYK1ESZG.js → check-icon-BZQF4tzH.js} +1 -1
  235. package/dist/esm/dead-stock-lookup_3.entry.js +11 -11
  236. package/dist/esm/{decode-time-offset-ChO_PV6l.js → decode-time-offset-Cib1aJfV.js} +1 -1
  237. package/dist/esm/flexible-container.entry.js +4 -4
  238. package/dist/esm/form-checkbox.entry.js +6 -6
  239. package/dist/esm/form-date-picker.entry.js +8 -8
  240. package/dist/esm/{form-error-message-YvMHko71.js → form-error-message-DWl6p6Dz.js} +1 -1
  241. package/dist/esm/{form-input-DAgayhNz.js → form-input-B8SwfkAd.js} +8 -6
  242. package/dist/esm/{form-input-label-cuvgzRcH.js → form-input-label-6blOw1BN.js} +1 -1
  243. package/dist/esm/form-input_7.entry.js +25 -25
  244. package/dist/esm/form-switch.entry.js +6 -6
  245. package/dist/esm/form-time-picker.entry.js +9 -9
  246. package/dist/esm/{functions-DHzedl_R.js → functions-BObezuTv.js} +5 -11
  247. package/dist/esm/general-form.entry.js +11 -11
  248. package/dist/esm/general-inquiry-form.entry.js +11 -11
  249. package/dist/esm/{get-language-from-url-U4hZ4dwn.js → get-language-from-url-fV-K15uy.js} +5 -1
  250. package/dist/esm/{get-local-language-TRD6vPH7.js → get-local-language-DcxL5hdi.js} +7 -3
  251. package/dist/esm/{get-mock-files-K2mWecRb.js → get-mock-files-IEjS5G9N.js} +2 -2
  252. package/dist/esm/{index-Cg4V9l26.js → index-CteZTPhq.js} +16 -1
  253. package/dist/esm/information-table.entry.js +2 -2
  254. package/dist/esm/{loader-icon-B2ls1yXl.js → loader-icon-BvAmA41s.js} +1 -1
  255. package/dist/esm/loader.js +4 -4
  256. package/dist/esm/loading-spinner.entry.js +2 -2
  257. package/dist/esm/manufacturer-part-lookup.entry.js +4 -4
  258. package/dist/esm/{mappers-CeTQZn37.js → mappers-9IKbvPiR.js} +27 -5
  259. package/dist/esm/{material-card-BMtefyp-.js → material-card-jbQd-0as.js} +1 -1
  260. package/dist/esm/part-lookup.entry.js +3 -3
  261. package/dist/esm/{qr-code-scan-CktgNBSD.js → qr-code-scan-B1nViqZl.js} +1 -1
  262. package/dist/esm/service-booking-form.entry.js +11 -11
  263. package/dist/esm/shift-accordion.entry.js +2 -2
  264. package/dist/esm/shift-checkbox.entry.js +4 -4
  265. package/dist/esm/shift-components.js +4 -4
  266. package/dist/esm/shift-slider.entry.js +2 -2
  267. package/dist/esm/shift-switch.entry.js +3 -3
  268. package/dist/esm/shift-tab-content.entry.js +2 -2
  269. package/dist/esm/shift-tabs_2.entry.js +13 -13
  270. package/dist/esm/ssc-lookup-form.entry.js +11 -11
  271. package/dist/esm/test-drive-form.entry.js +11 -11
  272. package/dist/esm/{triangle-alert-D4H9aWiT.js → triangle-alert-Brtqhx2d.js} +1 -1
  273. package/dist/esm/{validation-oieVWBn1.js → validation-lB1iHxfZ.js} +3 -2
  274. package/dist/esm/{vehicle-accessories_7.entry.js → vehicle-accessories_8.entry.js} +418 -20
  275. package/dist/esm/{vehicle-info-layout-DQ12Civq.js → vehicle-info-layout-Dmx94GLp.js} +1 -1
  276. package/dist/esm/vehicle-lookup.entry.js +9 -5
  277. package/dist/esm/vehicle-quotation-form.entry.js +7 -7
  278. package/dist/esm/{get-custom-classes-for-portal-C4LvwyrX.js → white-loader-B3tJFuNO.js} +15 -15
  279. package/dist/integration-manifest.json +66 -2
  280. package/dist/locales/vehicleLookup/warrantyTimeline/ar.json +25 -0
  281. package/dist/locales/vehicleLookup/warrantyTimeline/en.json +25 -0
  282. package/dist/locales/vehicleLookup/warrantyTimeline/ku.json +25 -0
  283. package/dist/locales/vehicleLookup/warrantyTimeline/ru.json +25 -0
  284. package/dist/locales/vehicleLookup/warrantyTimeline/type.ts +29 -0
  285. package/dist/mocks/generated/broker-dealer/vehicle-lookup.json +19 -1
  286. package/dist/mocks/generated/edge-cases/vehicle-lookup.json +57 -0
  287. package/dist/mocks/generated/standard-dealer/vehicle-lookup.json +27 -2
  288. package/dist/shift-components/{p-960fedbb.entry.js → p-088c8e4c.entry.js} +1 -1
  289. package/dist/shift-components/{p-3fcb1657.entry.js → p-12f36d97.entry.js} +1 -1
  290. package/dist/shift-components/p-17862b0b.entry.js +5 -0
  291. package/dist/shift-components/p-187cbdf5.entry.js +5 -0
  292. package/dist/shift-components/{p-fa39d151.entry.js → p-1c7c9c13.entry.js} +1 -1
  293. package/dist/shift-components/{p-7a41a739.entry.js → p-28e29ce7.entry.js} +1 -1
  294. package/dist/shift-components/p-383342be.entry.js +5 -0
  295. package/dist/shift-components/{p-fe7ece41.entry.js → p-3dcba301.entry.js} +1 -1
  296. package/dist/shift-components/{p-6b82a9b3.entry.js → p-5ba85e5c.entry.js} +1 -1
  297. package/dist/shift-components/{p-031f2ae6.entry.js → p-65beafcc.entry.js} +1 -1
  298. package/dist/shift-components/{p-22648595.entry.js → p-7cc6806c.entry.js} +1 -1
  299. package/dist/shift-components/{p-332ebda4.entry.js → p-7f44f655.entry.js} +1 -1
  300. package/dist/shift-components/{p-61ecc144.entry.js → p-868d554f.entry.js} +1 -1
  301. package/dist/shift-components/{p-a4086c90.entry.js → p-880c103a.entry.js} +1 -1
  302. package/dist/shift-components/{p-0dd7911f.entry.js → p-902a40c4.entry.js} +1 -1
  303. package/dist/shift-components/{p-10511716.entry.js → p-99886c58.entry.js} +1 -1
  304. package/dist/shift-components/{p-B8RCucpl.js → p-B9kqtQjS.js} +1 -1
  305. package/dist/shift-components/p-BTNA9XsD.js +5 -0
  306. package/dist/shift-components/{p-CiA8HlYO.js → p-C4NpWwNE.js} +1 -1
  307. package/dist/shift-components/p-C582V9TT.js +5 -0
  308. package/dist/shift-components/{p-BaC5C1YJ.js → p-C8PvXL-3.js} +1 -1
  309. package/dist/shift-components/{p-BLdwm9KB.js → p-CMMsmKvs.js} +1 -1
  310. package/dist/shift-components/p-C_QDvFTV.js +5 -0
  311. package/dist/shift-components/{p-BpCf2ue6.js → p-Ccwtsrgg.js} +1 -1
  312. package/dist/shift-components/p-CteZTPhq.js +6 -0
  313. package/dist/shift-components/{p-BG5y01yj.js → p-D1ioFMhR.js} +1 -1
  314. package/dist/shift-components/{p-FFH7sR1n.js → p-D7cqTTll.js} +1 -1
  315. package/dist/shift-components/p-D9Xf90VX.js +5 -0
  316. package/dist/shift-components/p-DWoutohJ.js +5 -0
  317. package/dist/shift-components/{p-BtLpOQVM.js → p-DtD7FZCG.js} +1 -1
  318. package/dist/shift-components/{p-CC1CaPP4.js → p-Dyo77aS3.js} +1 -1
  319. package/dist/shift-components/p-DzV_ls5o.js +5 -0
  320. package/dist/shift-components/p-HI9vdFQP.js +5 -0
  321. package/dist/shift-components/{p-08Pl1Pmo.js → p-MzYTUgsB.js} +1 -1
  322. package/dist/shift-components/{p-DwFWMVcD.js → p-OlAbjfKx.js} +1 -1
  323. package/dist/shift-components/{p-981d1f44.entry.js → p-b675fb6b.entry.js} +1 -1
  324. package/dist/shift-components/p-b8084ca2.entry.js +5 -0
  325. package/dist/shift-components/p-bad65a42.entry.js +5 -0
  326. package/dist/shift-components/{p-2f904561.entry.js → p-bb13232d.entry.js} +1 -1
  327. package/dist/shift-components/{p-CtUQMviL.js → p-bfwabdVa.js} +1 -1
  328. package/dist/shift-components/p-c4cf0a18.entry.js +5 -0
  329. package/dist/shift-components/{p-46e5146f.entry.js → p-e2868220.entry.js} +1 -1
  330. package/dist/shift-components/p-e7a99998.entry.js +5 -0
  331. package/dist/shift-components/{p-e979caa9.entry.js → p-ec3e0cce.entry.js} +1 -1
  332. package/dist/shift-components/{p-23df4ed2.entry.js → p-ee623097.entry.js} +1 -1
  333. package/dist/shift-components/{p-d33c83ac.entry.js → p-f9b8d43c.entry.js} +1 -1
  334. package/dist/shift-components/p-hABirfUj.js +5 -0
  335. package/dist/shift-components/{p-CRd5RAng.js → p-oFzLYYzz.js} +1 -1
  336. package/dist/shift-components/{p-Dvl1mJ6N.js → p-oQAUbfw7.js} +1 -1
  337. package/dist/shift-components/shift-components.esm.js +1 -1
  338. package/dist/stencil-docs.json +8462 -6793
  339. package/dist/types/components/form-elements/branch-slot-dropdown.d.ts +48 -0
  340. package/dist/types/components/form-elements/branch-slot-picker.d.ts +128 -0
  341. package/dist/types/components/form-elements/form-file.d.ts +1 -0
  342. package/dist/types/components/forms/defaults/mappers.d.ts +16 -0
  343. package/dist/types/components/forms/defaults/validation.d.ts +2 -0
  344. package/dist/types/components/vehicle-lookup/components/CoverageTimeline.d.ts +13 -0
  345. package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +3 -0
  346. package/dist/types/components/vehicle-lookup/vehicle-warranty-timeline.d.ts +46 -0
  347. package/dist/types/components.d.ts +452 -4
  348. package/dist/types/features/multi-lingual/types.d.ts +4 -4
  349. package/dist/types/global/types/generated/vehicle-lookup/vehicle-extended-warranty-dto.d.ts +9 -0
  350. package/dist/types/global/types/generated/vehicle-lookup/vehicle-warranty-dto.d.ts +4 -0
  351. package/dist/types/locale-mapper.d.ts +2 -1
  352. package/dist/types/locales/type.d.ts +2 -2
  353. package/dist/types/locales/vehicleLookup/paintThickness/type.d.ts +6 -6
  354. package/dist/types/locales/vehicleLookup/warranty/type.d.ts +4 -4
  355. package/dist/types/locales/vehicleLookup/warrantyTimeline/type.d.ts +50 -0
  356. package/dist/types/locales/vehicleLookup/wrapper-type.d.ts +10 -10
  357. package/package.json +1 -1
  358. package/dist/components/p-B8g3fLoh.js +0 -5
  359. package/dist/components/p-BshR1DsJ.js +0 -5
  360. package/dist/components/p-C24AOawm.js +0 -5
  361. package/dist/components/p-CK6WFXQF.js +0 -5
  362. package/dist/components/p-CLkGfAsm.js +0 -5
  363. package/dist/components/p-ClDpIRF9.js +0 -5
  364. package/dist/components/p-CvcaE6Ss.js +0 -5
  365. package/dist/components/p-DlG98nFs.js +0 -5
  366. package/dist/components/p-Dv_BQG7D.js +0 -5
  367. package/dist/components/p-G9UmKW9m.js +0 -5
  368. package/dist/shift-components/p-0578b913.entry.js +0 -5
  369. package/dist/shift-components/p-1500556f.entry.js +0 -5
  370. package/dist/shift-components/p-214259ae.entry.js +0 -5
  371. package/dist/shift-components/p-9c950549.entry.js +0 -5
  372. package/dist/shift-components/p-BBmr0kTe.js +0 -5
  373. package/dist/shift-components/p-BVDXHvth.js +0 -5
  374. package/dist/shift-components/p-BY1wHcOT.js +0 -5
  375. package/dist/shift-components/p-BuurMgGN.js +0 -5
  376. package/dist/shift-components/p-Cg4V9l26.js +0 -6
  377. package/dist/shift-components/p-D2XgNV12.js +0 -5
  378. package/dist/shift-components/p-DlBduQTw.js +0 -5
  379. package/dist/shift-components/p-a55ceb19.entry.js +0 -5
  380. package/dist/shift-components/p-b611f72e.entry.js +0 -5
  381. package/dist/shift-components/p-bc966aa0.entry.js +0 -5
  382. package/dist/shift-components/p-rsylYLbj.js +0 -5
  383. package/dist/shift-components/p-yhCrSkom.js +0 -5
@@ -0,0 +1,921 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ import { Host, h } from "@stencil/core";
6
+ import cn from "../../global/lib/cn";
7
+ import { ArrowUpIcon } from "../../global/assets/arrow-up-icon";
8
+ import getCustomClassesForPortal from "../../global/lib/get-custom-classes-for-portal";
9
+ import { getInputLocalization } from "../../features/form-hook/index";
10
+ import { FormInputLabel } from "./components/form-input-label";
11
+ import { FormErrorMessage } from "./components/form-error-message";
12
+ const FALLBACK_COPY = {
13
+ en: {
14
+ day: 'Pick a day',
15
+ time: 'Pick a time',
16
+ days: 'days available',
17
+ slots: 'slots',
18
+ idle: 'Choose a branch first',
19
+ empty: 'No times available at this branch',
20
+ error: "Couldn't load available times",
21
+ retry: 'Try again',
22
+ choose: 'Choose date & time',
23
+ loading: 'Loading times…',
24
+ },
25
+ ar: {
26
+ day: 'اختر اليوم',
27
+ time: 'اختر الوقت',
28
+ days: 'يوماً متاحاً',
29
+ slots: 'موعداً',
30
+ idle: 'اختر الفرع أولاً',
31
+ empty: 'لا توجد أوقات متاحة في هذا الفرع',
32
+ error: 'تعذّر تحميل الأوقات المتاحة',
33
+ retry: 'أعد المحاولة',
34
+ choose: 'اختر التاريخ والوقت',
35
+ loading: 'جارٍ تحميل الأوقات…',
36
+ },
37
+ ku: {
38
+ day: 'ڕۆژێک هەڵبژێرە',
39
+ time: 'کاتێک هەڵبژێرە',
40
+ days: 'ڕۆژی بەردەست',
41
+ slots: 'کات',
42
+ idle: 'سەرەتا لقێک هەڵبژێرە',
43
+ empty: 'هیچ کاتێکی بەردەست نییە لەم لقەدا',
44
+ error: 'نەتوانرا کاتە بەردەستەکان باربکرێن',
45
+ retry: 'دووبارە هەوڵ بدە',
46
+ choose: 'بەروار و کات هەڵبژێرە',
47
+ loading: 'کاتەکان باردەکرێن…',
48
+ },
49
+ ru: {
50
+ day: 'Выберите день',
51
+ time: 'Выберите время',
52
+ days: 'дней доступно',
53
+ slots: 'слотов',
54
+ idle: 'Сначала выберите филиал',
55
+ empty: 'В этом филиале нет свободного времени',
56
+ error: 'Не удалось загрузить свободное время',
57
+ retry: 'Повторить',
58
+ choose: 'Выберите дату и время',
59
+ loading: 'Загрузка времени…',
60
+ },
61
+ };
62
+ /**
63
+ * Branch-aware booking slot field.
64
+ *
65
+ * Presents as a normal dropdown — the same `form-input-select` trigger as every
66
+ * other select in the form — and portals its panel onto `document.body` through
67
+ * `shift-portal`, exactly as `shift-select` does.
68
+ *
69
+ * Standalone by design: `form` is optional. Drop `<branch-slot-picker>` on any
70
+ * page, in a PWA or in a native WebView, give it the four ids, and listen to
71
+ * `slotChange`.
72
+ */
73
+ export class BranchSlotPicker {
74
+ constructor() {
75
+ /** Field name. Only meaningful when `form` is supplied. */
76
+ this.name = 'bookingSlot';
77
+ /** How far ahead to ask. The endpoint caps its own response at 15 days. */
78
+ this.daysAhead = 30;
79
+ /** Gap between the trigger and the panel, matching shift-select's default. */
80
+ this.gap = 8;
81
+ this.isRequired = false;
82
+ this.isDisabled = false;
83
+ this.language = 'en';
84
+ this.localization = {};
85
+ this.status = 'idle';
86
+ this.days = [];
87
+ this.selectedDate = '';
88
+ this.selectedRaw = '';
89
+ this.isOpen = false;
90
+ this.dropdownAncestorClasses = '';
91
+ /**
92
+ * The day being browsed in the panel. Kept apart from `selectedDate` so that
93
+ * opening the panel, scrubbing through days and then dismissing it leaves the
94
+ * committed selection untouched.
95
+ */
96
+ this.draftDate = '';
97
+ this.dropdownEl = null;
98
+ this.lockedScrollY = 0;
99
+ this.boundKeyDown = (event) => this.handleKeyDown(event);
100
+ this.displayTime = (raw) => {
101
+ const total = this.minutesOf(raw);
102
+ const date = new Date(2000, 0, 1, Math.floor(total / 60), total % 60);
103
+ return new Intl.DateTimeFormat(this.intlLocales, { hour: 'numeric', minute: '2-digit' }).format(date);
104
+ };
105
+ this.formatDay = (date, options) => {
106
+ // Midday, not midnight: a midnight Date in a negative-offset zone rolls back
107
+ // a day, which silently mislabels every chip.
108
+ const [y, m, d] = date.split('-').map(x => parseInt(x, 10));
109
+ return new Intl.DateTimeFormat(this.intlLocales, options).format(new Date(y, m - 1, d, 12));
110
+ };
111
+ this.setDropdownRef = (el) => {
112
+ this.dropdownEl = el;
113
+ };
114
+ /** Mirrors shift-select: anchor to the trigger, flip up when space is short. */
115
+ this.adjustDropdownPosition = () => {
116
+ const dropdown = this.dropdownEl;
117
+ const trigger = this.getTriggerEl();
118
+ if (!dropdown || !trigger)
119
+ return;
120
+ // Sheet mode is viewport-anchored; CSS owns it entirely.
121
+ if (this.isSheet)
122
+ return;
123
+ const rect = trigger.getBoundingClientRect();
124
+ // Scrolled out of sight — a panel floating over unrelated content is worse
125
+ // than no panel.
126
+ if (!this.isTriggerInView(rect)) {
127
+ this.isOpen = false;
128
+ return;
129
+ }
130
+ const width = Math.max(rect.width, 288);
131
+ dropdown.style.setProperty('--branch-slot-width', `${width}px`);
132
+ const spaceBelow = window.innerHeight - rect.bottom - this.gap * 2;
133
+ const spaceAbove = rect.top - this.gap * 2;
134
+ const openUpwards = spaceBelow < dropdown.offsetHeight && spaceAbove > spaceBelow;
135
+ // Cap the panel to the room that actually exists. Without this the fixed
136
+ // 320px runs off-screen in landscape and with the keyboard up, and there is
137
+ // nothing to scroll to reach it.
138
+ dropdown.style.setProperty('--branch-slot-max-height', `${Math.max(160, Math.min(320, openUpwards ? spaceAbove : spaceBelow))}px`);
139
+ const height = dropdown.offsetHeight;
140
+ // Keep it on-screen horizontally — the panel has a min-width, so a field
141
+ // near the right edge would otherwise hang off it.
142
+ const left = Math.max(this.gap, Math.min(rect.left, window.innerWidth - width - this.gap));
143
+ dropdown.style.setProperty('--branch-slot-left', `${left}px`);
144
+ dropdown.style.setProperty('--branch-slot-top', `${openUpwards ? rect.top - height - this.gap : rect.bottom + this.gap}px`);
145
+ };
146
+ this.handleResize = () => {
147
+ if (this.isOpen)
148
+ this.adjustDropdownPosition();
149
+ };
150
+ this.handleScroll = (event) => {
151
+ if (!this.isOpen)
152
+ return;
153
+ // The sheet does not move with the page, and the page is locked anyway.
154
+ if (this.isSheet)
155
+ return;
156
+ const target = event.target;
157
+ if (this.dropdownEl && (this.dropdownEl === target || this.dropdownEl.contains(target)))
158
+ return;
159
+ this.adjustDropdownPosition();
160
+ };
161
+ this.closeOnOutsideClick = (event) => {
162
+ const path = event.composedPath();
163
+ if (path.includes(this.el))
164
+ return;
165
+ if (this.dropdownEl && path.includes(this.dropdownEl))
166
+ return;
167
+ this.isOpen = false;
168
+ };
169
+ this.toggle = () => {
170
+ if (this.isOpen)
171
+ this.isOpen = false;
172
+ else if (this.status === 'error')
173
+ this.load();
174
+ else
175
+ this.openDropdown();
176
+ };
177
+ this.handleDay = (date) => {
178
+ this.draftDate = date;
179
+ };
180
+ this.handleTime = (raw) => {
181
+ this.selectedDate = raw.split(' ')[0];
182
+ this.selectedRaw = raw;
183
+ this.isOpen = false;
184
+ // The form pulls values — it calls getValue() on every subscribed element at
185
+ // submit time — so there is nothing to push. This only fires the public
186
+ // event, which is what standalone hosts listen to.
187
+ this.slotChange.emit({ date: this.selectedDate, raw, value: this.toFormValue(raw) });
188
+ };
189
+ }
190
+ componentWillLoad() {
191
+ var _a;
192
+ (_a = this.form) === null || _a === void 0 ? void 0 : _a.subscribe(this.name, this);
193
+ this.load();
194
+ }
195
+ componentDidLoad() {
196
+ document.addEventListener('click', this.closeOnOutsideClick);
197
+ document.addEventListener('keydown', this.boundKeyDown);
198
+ window.addEventListener('resize', this.handleResize);
199
+ window.addEventListener('scroll', this.handleScroll, true);
200
+ // The panel is portaled out of the form, so theme classes have to travel
201
+ // with it or it renders unstyled against the host page.
202
+ this.dropdownAncestorClasses = `${this.name}-slot-picker ${getCustomClassesForPortal(this.el)}`;
203
+ }
204
+ disconnectedCallback() {
205
+ var _a, _b;
206
+ (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
207
+ (_b = this.form) === null || _b === void 0 ? void 0 : _b.unsubscribe(this.name);
208
+ document.removeEventListener('click', this.closeOnOutsideClick);
209
+ document.removeEventListener('keydown', this.boundKeyDown);
210
+ window.removeEventListener('resize', this.handleResize);
211
+ window.removeEventListener('scroll', this.handleScroll, true);
212
+ // A teardown while the sheet is open would otherwise leave the page frozen.
213
+ this.releaseScroll();
214
+ }
215
+ onOpenChange(isOpen) {
216
+ // Only the sheet needs this. An anchored dropdown repositions on scroll and
217
+ // freezing the page under it would be wrong.
218
+ if (!this.isSheet)
219
+ return;
220
+ if (isOpen)
221
+ this.lockScroll();
222
+ else
223
+ this.releaseScroll();
224
+ }
225
+ /**
226
+ * Pinning the body position rather than just hiding overflow: on iOS,
227
+ * `overflow: hidden` alone still lets the page rubber-band behind the sheet.
228
+ */
229
+ lockScroll() {
230
+ if (document.body.style.position === 'fixed')
231
+ return;
232
+ this.lockedScrollY = window.scrollY;
233
+ Object.assign(document.body.style, { position: 'fixed', top: `-${this.lockedScrollY}px`, left: '0', right: '0', width: '100%' });
234
+ }
235
+ releaseScroll() {
236
+ if (document.body.style.position !== 'fixed')
237
+ return;
238
+ Object.assign(document.body.style, { position: '', top: '', left: '', right: '', width: '' });
239
+ window.scrollTo(0, this.lockedScrollY);
240
+ }
241
+ onTargetChange() {
242
+ // A different branch invalidates the whole selection, not just the times.
243
+ this.selectedDate = '';
244
+ this.selectedRaw = '';
245
+ this.draftDate = '';
246
+ this.isOpen = false;
247
+ this.load();
248
+ }
249
+ /** FormElement contract. */
250
+ reset(newValue) {
251
+ var _a;
252
+ this.defaultValue = (_a = newValue) !== null && _a !== void 0 ? _a : '';
253
+ this.selectedDate = '';
254
+ this.selectedRaw = '';
255
+ this.draftDate = '';
256
+ }
257
+ getValue() {
258
+ return this.selectedRaw ? this.toFormValue(this.selectedRaw) : this.defaultValue || '';
259
+ }
260
+ /** Lets a host force a refetch, e.g. after a token refresh. */
261
+ async refresh() {
262
+ this.load();
263
+ }
264
+ async openDropdown() {
265
+ var _a;
266
+ if (this.status === 'idle')
267
+ return;
268
+ this.draftDate = this.selectedDate || ((_a = this.days[0]) === null || _a === void 0 ? void 0 : _a.date) || '';
269
+ this.adjustDropdownPosition();
270
+ this.isOpen = true;
271
+ }
272
+ async closeDropdown() {
273
+ this.isOpen = false;
274
+ }
275
+ get isRtl() {
276
+ return this.language === 'ar' || this.language === 'ku';
277
+ }
278
+ get copy() {
279
+ var _a;
280
+ return (_a = FALLBACK_COPY[this.language]) !== null && _a !== void 0 ? _a : FALLBACK_COPY.en;
281
+ }
282
+ get intlLocales() {
283
+ // An array lets Intl fall back on its own when a locale is unavailable —
284
+ // ckb has patchy support in older Android WebViews.
285
+ if (this.language === 'ar')
286
+ return ['ar-IQ', 'ar', 'en-GB'];
287
+ if (this.language === 'ku')
288
+ return ['ckb-IQ', 'ckb', 'ar-IQ', 'en-GB'];
289
+ if (this.language === 'ru')
290
+ return ['ru-RU', 'en-GB'];
291
+ return ['en-GB'];
292
+ }
293
+ pad(n) {
294
+ return String(n).padStart(2, '0');
295
+ }
296
+ /** `2026-08-13 09:00 AM` → minutes since midnight. */
297
+ minutesOf(raw) {
298
+ var _a, _b;
299
+ const parts = raw.split(' ');
300
+ const clock = (_a = parts[1]) !== null && _a !== void 0 ? _a : '00:00';
301
+ const meridiem = ((_b = parts[2]) !== null && _b !== void 0 ? _b : '').toUpperCase();
302
+ const [h, m] = clock.split(':').map(x => parseInt(x, 10) || 0);
303
+ let hour = h % 12;
304
+ if (meridiem === 'PM')
305
+ hour += 12;
306
+ return hour * 60 + m;
307
+ }
308
+ toFormValue(raw) {
309
+ const date = raw.split(' ')[0];
310
+ const total = this.minutesOf(raw);
311
+ return `${date}T${this.pad(Math.floor(total / 60))}:${this.pad(total % 60)}`;
312
+ }
313
+ queryUrl() {
314
+ if (!this.calendarApi || !this.companyId || !this.branchId || !this.departmentId || !this.brandId)
315
+ return null;
316
+ const from = new Date();
317
+ const to = new Date();
318
+ to.setDate(to.getDate() + this.daysAhead);
319
+ const iso = (d) => `${d.getFullYear()}-${this.pad(d.getMonth() + 1)}-${this.pad(d.getDate())}`;
320
+ const qs = new URLSearchParams({
321
+ from: iso(from),
322
+ to: iso(to),
323
+ companyId: this.companyId,
324
+ branchId: this.branchId,
325
+ departmentId: this.departmentId,
326
+ brandId: this.brandId,
327
+ });
328
+ return `${this.calendarApi}${this.calendarApi.includes('?') ? '&' : '?'}${qs.toString()}`;
329
+ }
330
+ /**
331
+ * Overlapping work periods of equal priority make the endpoint emit the same
332
+ * slot more than once (branch 45 returns every time twice), and a merged
333
+ * response is not necessarily ordered. Both are fixed here rather than in the
334
+ * panel, so anything reading `days` gets clean data.
335
+ */
336
+ normalise(raw) {
337
+ return raw
338
+ .filter(entry => entry && entry.Date && Array.isArray(entry.Times) && entry.Times.length)
339
+ .map(entry => ({
340
+ date: entry.Date,
341
+ times: Array.from(new Set(entry.Times)).sort((a, b) => this.minutesOf(a) - this.minutesOf(b)),
342
+ }))
343
+ .sort((a, b) => a.date.localeCompare(b.date));
344
+ }
345
+ async load() {
346
+ var _a;
347
+ const url = this.queryUrl();
348
+ (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
349
+ if (!url) {
350
+ this.status = 'idle';
351
+ this.days = [];
352
+ return;
353
+ }
354
+ this.abortController = new AbortController();
355
+ this.status = 'loading';
356
+ try {
357
+ const response = await fetch(url, {
358
+ signal: this.abortController.signal,
359
+ headers: { 'Accept-Language': this.language },
360
+ });
361
+ if (!response.ok)
362
+ throw new Error(`calendar ${response.status}`);
363
+ this.days = this.normalise(await response.json());
364
+ if (!this.days.length) {
365
+ this.status = 'empty';
366
+ return;
367
+ }
368
+ const preset = this.days.find(day => this.defaultValue && this.defaultValue.startsWith(day.date));
369
+ this.draftDate = (preset !== null && preset !== void 0 ? preset : this.days[0]).date;
370
+ this.status = 'ready';
371
+ }
372
+ catch (error) {
373
+ if ((error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
374
+ return;
375
+ this.status = 'error';
376
+ }
377
+ }
378
+ getTriggerEl() {
379
+ return this.el.getElementsByClassName('form-input-select')[0];
380
+ }
381
+ isTriggerInView(rect) {
382
+ return rect.bottom > 0 && rect.top < window.innerHeight && rect.right > 0 && rect.left < window.innerWidth;
383
+ }
384
+ /**
385
+ * Below this width the panel is a bottom sheet pinned to the viewport, so it
386
+ * is not anchored to anything and none of the positioning below applies. Kept
387
+ * in sync with the media query in branch-slot-dropdown.css.
388
+ */
389
+ get isSheet() {
390
+ return typeof window !== 'undefined' && window.matchMedia('(max-width: 599px)').matches;
391
+ }
392
+ handleKeyDown(event) {
393
+ if (!this.isOpen)
394
+ return;
395
+ if (event.key === 'Escape')
396
+ this.isOpen = false;
397
+ }
398
+ /** What the trigger shows: the committed slot, or why it cannot be opened. */
399
+ triggerText() {
400
+ if (this.status === 'idle')
401
+ return this.copy.idle;
402
+ if (this.status === 'loading')
403
+ return this.copy.loading;
404
+ if (this.status === 'empty')
405
+ return this.copy.empty;
406
+ if (this.status === 'error')
407
+ return this.copy.error;
408
+ if (!this.selectedRaw)
409
+ return '';
410
+ const day = this.formatDay(this.selectedDate, { weekday: 'short', day: 'numeric', month: 'short' });
411
+ return `${day} · ${this.displayTime(this.selectedRaw)}`;
412
+ }
413
+ render() {
414
+ var _a, _b, _c, _d, _e;
415
+ // Inside a form, required/disabled/error come from the form's own state, so
416
+ // this field validates and reports exactly like every other one. Standalone,
417
+ // there is no form to ask and the props stand on their own.
418
+ const state = (_a = this.form) === null || _a === void 0 ? void 0 : _a.getInputState(this.name);
419
+ const localised = this.form ? getInputLocalization(this, state === null || state === void 0 ? void 0 : state.meta, state === null || state === void 0 ? void 0 : state.errorMessage) : null;
420
+ const label = (localised === null || localised === void 0 ? void 0 : localised.label) || ((_c = (_b = this.localization) === null || _b === void 0 ? void 0 : _b[this.language]) === null || _c === void 0 ? void 0 : _c.label) || this.label;
421
+ const placeholder = (localised === null || localised === void 0 ? void 0 : localised.placeholder) || ((_e = (_d = this.localization) === null || _d === void 0 ? void 0 : _d[this.language]) === null || _e === void 0 ? void 0 : _e.placeholder) || this.copy.choose;
422
+ const isRequired = (state === null || state === void 0 ? void 0 : state.isRequired) || this.isRequired;
423
+ // Idle/loading/empty cannot be opened; error can, because the trigger then
424
+ // doubles as the retry affordance.
425
+ const blocked = this.isDisabled || (state === null || state === void 0 ? void 0 : state.disabled) || this.status === 'idle' || this.status === 'loading' || this.status === 'empty';
426
+ const dropdownProps = {
427
+ name: this.name,
428
+ days: this.days,
429
+ copy: this.copy,
430
+ status: this.status,
431
+ isOpen: this.isOpen,
432
+ idleText: this.copy.idle,
433
+ activeDate: this.draftDate,
434
+ handleDay: this.handleDay,
435
+ handleTime: this.handleTime,
436
+ handleRetry: () => this.load(),
437
+ handleDismiss: () => (this.isOpen = false),
438
+ selectedRaw: this.selectedRaw,
439
+ formatDay: this.formatDay,
440
+ displayTime: this.displayTime,
441
+ setElementRef: this.setDropdownRef,
442
+ direction: this.isRtl ? 'rtl' : 'ltr',
443
+ };
444
+ return (h(Host, { key: 'f25a68a643369d3071a1d1634882d50703ede14d', translate: "no" }, h("label", { key: 'fbfdec7c4a82efc2fe6dfe8508120baab17cbe09', part: `${this.name}`, id: this.wrapperId, class: cn('form-input-label-container', this.wrapperClass, { disabled: blocked }) }, h(FormInputLabel, { key: 'f8b700c24e388e90ba72735f9b6f0fc40e71779c', name: this.name, label: label, isRequired: isRequired }), h("div", { key: '7cff4cd85d9ff56544fbb3ecbc985d171fcf2c68', part: `${this.name}-container form-input-container`, class: cn('form-input-container', { open: this.isOpen, disabled: blocked }) }, h("input", { key: 'd3f6d0e49d24550a960c3deb62fcdc7a80abfa06', type: "text", readOnly: true, disabled: blocked, value: this.triggerText(), placeholder: placeholder, onClick: this.toggle, part: `${this.name}-input-select form-input-select`, class: "form-input-style form-input-select branch-slot-trigger" }), h("div", { key: '913e0d8268f8e2ad2f1a7a121badbe6878ef4a50', part: `${this.name}-select-icon-container form-input-select-icon-container`, class: "form-input-select-icon-container" }, h(ArrowUpIcon, { key: '380c441c1ff629206f2490d63866c62bdbe1f1eb', part: `${this.name}-arrow-icon select-arrow`, class: "form-input-select-icon pointer-events-none! arrow cursor-pointer" })),
445
+ // Stencil only bundles a lazily-portaled component if it also sees
446
+ // the tag in a template. Same guard shift-select uses.
447
+ // @ts-ignore
448
+ false && h("branch-slot-dropdown", { key: '76a27a164f1fee2c0b0f9282108556a9318f3ae9' }), h("shift-portal", { key: 'ac4ad2c23dde76bc1091fba264faed0a591ab544', tag: "branch-slot-dropdown", inheritedClasses: this.dropdownAncestorClasses, componentProps: dropdownProps })), h(FormErrorMessage, { key: 'e6fbd13c4674de5801eeabb981998da37f82183f', name: this.name, isError: !!(state === null || state === void 0 ? void 0 : state.isError), errorMessage: (localised === null || localised === void 0 ? void 0 : localised.errorTextMessage) || '' }))));
449
+ }
450
+ static get is() { return "branch-slot-picker"; }
451
+ static get originalStyleUrls() {
452
+ return {
453
+ "$": ["branch-slot-picker.css"]
454
+ };
455
+ }
456
+ static get styleUrls() {
457
+ return {
458
+ "$": ["branch-slot-picker.css"]
459
+ };
460
+ }
461
+ static get properties() {
462
+ return {
463
+ "name": {
464
+ "type": "string",
465
+ "mutable": false,
466
+ "complexType": {
467
+ "original": "string",
468
+ "resolved": "string",
469
+ "references": {}
470
+ },
471
+ "required": false,
472
+ "optional": false,
473
+ "docs": {
474
+ "tags": [],
475
+ "text": "Field name. Only meaningful when `form` is supplied."
476
+ },
477
+ "getter": false,
478
+ "setter": false,
479
+ "reflect": false,
480
+ "attribute": "name",
481
+ "defaultValue": "'bookingSlot'"
482
+ },
483
+ "form": {
484
+ "type": "unknown",
485
+ "mutable": false,
486
+ "complexType": {
487
+ "original": "FormHook<any>",
488
+ "resolved": "FormHook<any>",
489
+ "references": {
490
+ "FormHook": {
491
+ "location": "import",
492
+ "path": "~features/form-hook/form-hook",
493
+ "id": "src/features/form-hook/form-hook.ts::FormHook",
494
+ "referenceLocation": "FormHook"
495
+ }
496
+ }
497
+ },
498
+ "required": false,
499
+ "optional": true,
500
+ "docs": {
501
+ "tags": [],
502
+ "text": "Optional \u2014 omit for standalone use and listen to `slotChange` instead."
503
+ },
504
+ "getter": false,
505
+ "setter": false
506
+ },
507
+ "calendarApi": {
508
+ "type": "string",
509
+ "mutable": false,
510
+ "complexType": {
511
+ "original": "string",
512
+ "resolved": "string",
513
+ "references": {}
514
+ },
515
+ "required": false,
516
+ "optional": false,
517
+ "docs": {
518
+ "tags": [],
519
+ "text": "Full URL of the calendar endpoint, e.g. `https://\u2026/api/public/calendar`."
520
+ },
521
+ "getter": false,
522
+ "setter": false,
523
+ "reflect": false,
524
+ "attribute": "calendar-api"
525
+ },
526
+ "companyId": {
527
+ "type": "string",
528
+ "mutable": false,
529
+ "complexType": {
530
+ "original": "string",
531
+ "resolved": "string",
532
+ "references": {}
533
+ },
534
+ "required": false,
535
+ "optional": false,
536
+ "docs": {
537
+ "tags": [],
538
+ "text": "Integration ids. The field stays idle until all four are present."
539
+ },
540
+ "getter": false,
541
+ "setter": false,
542
+ "reflect": false,
543
+ "attribute": "company-id"
544
+ },
545
+ "branchId": {
546
+ "type": "string",
547
+ "mutable": false,
548
+ "complexType": {
549
+ "original": "string",
550
+ "resolved": "string",
551
+ "references": {}
552
+ },
553
+ "required": false,
554
+ "optional": false,
555
+ "docs": {
556
+ "tags": [],
557
+ "text": ""
558
+ },
559
+ "getter": false,
560
+ "setter": false,
561
+ "reflect": false,
562
+ "attribute": "branch-id"
563
+ },
564
+ "departmentId": {
565
+ "type": "string",
566
+ "mutable": false,
567
+ "complexType": {
568
+ "original": "string",
569
+ "resolved": "string",
570
+ "references": {}
571
+ },
572
+ "required": false,
573
+ "optional": false,
574
+ "docs": {
575
+ "tags": [],
576
+ "text": ""
577
+ },
578
+ "getter": false,
579
+ "setter": false,
580
+ "reflect": false,
581
+ "attribute": "department-id"
582
+ },
583
+ "brandId": {
584
+ "type": "string",
585
+ "mutable": false,
586
+ "complexType": {
587
+ "original": "string",
588
+ "resolved": "string",
589
+ "references": {}
590
+ },
591
+ "required": false,
592
+ "optional": false,
593
+ "docs": {
594
+ "tags": [],
595
+ "text": ""
596
+ },
597
+ "getter": false,
598
+ "setter": false,
599
+ "reflect": false,
600
+ "attribute": "brand-id"
601
+ },
602
+ "daysAhead": {
603
+ "type": "number",
604
+ "mutable": false,
605
+ "complexType": {
606
+ "original": "number",
607
+ "resolved": "number",
608
+ "references": {}
609
+ },
610
+ "required": false,
611
+ "optional": false,
612
+ "docs": {
613
+ "tags": [],
614
+ "text": "How far ahead to ask. The endpoint caps its own response at 15 days."
615
+ },
616
+ "getter": false,
617
+ "setter": false,
618
+ "reflect": false,
619
+ "attribute": "days-ahead",
620
+ "defaultValue": "30"
621
+ },
622
+ "gap": {
623
+ "type": "number",
624
+ "mutable": false,
625
+ "complexType": {
626
+ "original": "number",
627
+ "resolved": "number",
628
+ "references": {}
629
+ },
630
+ "required": false,
631
+ "optional": false,
632
+ "docs": {
633
+ "tags": [],
634
+ "text": "Gap between the trigger and the panel, matching shift-select's default."
635
+ },
636
+ "getter": false,
637
+ "setter": false,
638
+ "reflect": false,
639
+ "attribute": "gap",
640
+ "defaultValue": "8"
641
+ },
642
+ "label": {
643
+ "type": "string",
644
+ "mutable": false,
645
+ "complexType": {
646
+ "original": "string",
647
+ "resolved": "string",
648
+ "references": {}
649
+ },
650
+ "required": false,
651
+ "optional": true,
652
+ "docs": {
653
+ "tags": [],
654
+ "text": ""
655
+ },
656
+ "getter": false,
657
+ "setter": false,
658
+ "reflect": false,
659
+ "attribute": "label"
660
+ },
661
+ "wrapperId": {
662
+ "type": "string",
663
+ "mutable": false,
664
+ "complexType": {
665
+ "original": "string",
666
+ "resolved": "string",
667
+ "references": {}
668
+ },
669
+ "required": false,
670
+ "optional": false,
671
+ "docs": {
672
+ "tags": [],
673
+ "text": ""
674
+ },
675
+ "getter": false,
676
+ "setter": false,
677
+ "reflect": false,
678
+ "attribute": "wrapper-id"
679
+ },
680
+ "wrapperClass": {
681
+ "type": "string",
682
+ "mutable": false,
683
+ "complexType": {
684
+ "original": "string",
685
+ "resolved": "string",
686
+ "references": {}
687
+ },
688
+ "required": false,
689
+ "optional": false,
690
+ "docs": {
691
+ "tags": [],
692
+ "text": ""
693
+ },
694
+ "getter": false,
695
+ "setter": false,
696
+ "reflect": false,
697
+ "attribute": "wrapper-class"
698
+ },
699
+ "isRequired": {
700
+ "type": "boolean",
701
+ "mutable": false,
702
+ "complexType": {
703
+ "original": "boolean",
704
+ "resolved": "boolean",
705
+ "references": {}
706
+ },
707
+ "required": false,
708
+ "optional": false,
709
+ "docs": {
710
+ "tags": [],
711
+ "text": ""
712
+ },
713
+ "getter": false,
714
+ "setter": false,
715
+ "reflect": false,
716
+ "attribute": "is-required",
717
+ "defaultValue": "false"
718
+ },
719
+ "isDisabled": {
720
+ "type": "boolean",
721
+ "mutable": false,
722
+ "complexType": {
723
+ "original": "boolean",
724
+ "resolved": "boolean",
725
+ "references": {}
726
+ },
727
+ "required": false,
728
+ "optional": false,
729
+ "docs": {
730
+ "tags": [],
731
+ "text": ""
732
+ },
733
+ "getter": false,
734
+ "setter": false,
735
+ "reflect": false,
736
+ "attribute": "is-disabled",
737
+ "defaultValue": "false"
738
+ },
739
+ "language": {
740
+ "type": "string",
741
+ "mutable": false,
742
+ "complexType": {
743
+ "original": "LanguageKeys",
744
+ "resolved": "\"ar\" | \"en\" | \"ku\" | \"ru\"",
745
+ "references": {
746
+ "LanguageKeys": {
747
+ "location": "import",
748
+ "path": "~features/multi-lingual",
749
+ "id": "src/features/multi-lingual/index.ts::LanguageKeys",
750
+ "referenceLocation": "LanguageKeys"
751
+ }
752
+ }
753
+ },
754
+ "required": false,
755
+ "optional": false,
756
+ "docs": {
757
+ "tags": [],
758
+ "text": ""
759
+ },
760
+ "getter": false,
761
+ "setter": false,
762
+ "reflect": false,
763
+ "attribute": "language",
764
+ "defaultValue": "'en'"
765
+ },
766
+ "localization": {
767
+ "type": "unknown",
768
+ "mutable": false,
769
+ "complexType": {
770
+ "original": "FormInputLocalization",
771
+ "resolved": "T",
772
+ "references": {
773
+ "FormInputLocalization": {
774
+ "location": "import",
775
+ "path": "~features/form-hook",
776
+ "id": "src/features/form-hook/index.ts::FormInputLocalization",
777
+ "referenceLocation": "FormInputLocalization"
778
+ }
779
+ }
780
+ },
781
+ "required": false,
782
+ "optional": true,
783
+ "docs": {
784
+ "tags": [],
785
+ "text": ""
786
+ },
787
+ "getter": false,
788
+ "setter": false,
789
+ "defaultValue": "{}"
790
+ },
791
+ "defaultValue": {
792
+ "type": "string",
793
+ "mutable": true,
794
+ "complexType": {
795
+ "original": "string",
796
+ "resolved": "string",
797
+ "references": {}
798
+ },
799
+ "required": false,
800
+ "optional": true,
801
+ "docs": {
802
+ "tags": [],
803
+ "text": "Preselects a slot, in the same `YYYY-MM-DDTHH:mm` form the field emits."
804
+ },
805
+ "getter": false,
806
+ "setter": false,
807
+ "reflect": false,
808
+ "attribute": "default-value"
809
+ }
810
+ };
811
+ }
812
+ static get states() {
813
+ return {
814
+ "status": {},
815
+ "days": {},
816
+ "selectedDate": {},
817
+ "selectedRaw": {},
818
+ "isOpen": {},
819
+ "dropdownAncestorClasses": {},
820
+ "draftDate": {}
821
+ };
822
+ }
823
+ static get events() {
824
+ return [{
825
+ "method": "slotChange",
826
+ "name": "slotChange",
827
+ "bubbles": true,
828
+ "cancelable": true,
829
+ "composed": true,
830
+ "docs": {
831
+ "tags": [],
832
+ "text": "Fires on every confirmed day+time selection. The standalone contract."
833
+ },
834
+ "complexType": {
835
+ "original": "BranchSlotSelection",
836
+ "resolved": "BranchSlotSelection",
837
+ "references": {
838
+ "BranchSlotSelection": {
839
+ "location": "local",
840
+ "path": "/home/vsts/work/1/s/ADP.WebComponents/adp-web-components/src/components/form-elements/branch-slot-picker.tsx",
841
+ "id": "src/components/form-elements/branch-slot-picker.tsx::BranchSlotSelection"
842
+ }
843
+ }
844
+ }
845
+ }];
846
+ }
847
+ static get methods() {
848
+ return {
849
+ "refresh": {
850
+ "complexType": {
851
+ "signature": "() => Promise<void>",
852
+ "parameters": [],
853
+ "references": {
854
+ "Promise": {
855
+ "location": "global",
856
+ "id": "global::Promise"
857
+ }
858
+ },
859
+ "return": "Promise<void>"
860
+ },
861
+ "docs": {
862
+ "text": "Lets a host force a refetch, e.g. after a token refresh.",
863
+ "tags": []
864
+ }
865
+ },
866
+ "openDropdown": {
867
+ "complexType": {
868
+ "signature": "() => Promise<void>",
869
+ "parameters": [],
870
+ "references": {
871
+ "Promise": {
872
+ "location": "global",
873
+ "id": "global::Promise"
874
+ }
875
+ },
876
+ "return": "Promise<void>"
877
+ },
878
+ "docs": {
879
+ "text": "",
880
+ "tags": []
881
+ }
882
+ },
883
+ "closeDropdown": {
884
+ "complexType": {
885
+ "signature": "() => Promise<void>",
886
+ "parameters": [],
887
+ "references": {
888
+ "Promise": {
889
+ "location": "global",
890
+ "id": "global::Promise"
891
+ }
892
+ },
893
+ "return": "Promise<void>"
894
+ },
895
+ "docs": {
896
+ "text": "",
897
+ "tags": []
898
+ }
899
+ }
900
+ };
901
+ }
902
+ static get elementRef() { return "el"; }
903
+ static get watchers() {
904
+ return [{
905
+ "propName": "isOpen",
906
+ "methodName": "onOpenChange"
907
+ }, {
908
+ "propName": "branchId",
909
+ "methodName": "onTargetChange"
910
+ }, {
911
+ "propName": "departmentId",
912
+ "methodName": "onTargetChange"
913
+ }, {
914
+ "propName": "brandId",
915
+ "methodName": "onTargetChange"
916
+ }, {
917
+ "propName": "companyId",
918
+ "methodName": "onTargetChange"
919
+ }];
920
+ }
921
+ }