adp-web-components 0.0.11

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 (196) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/Loading-ee1a2ceb.js +16 -0
  3. package/dist/cjs/app-globals-3813fb46.js +9 -0
  4. package/dist/cjs/cn-f559f9e5.js +2588 -0
  5. package/dist/cjs/dead-stock-lookup.cjs.entry.js +103 -0
  6. package/dist/cjs/distributor-lookup.cjs.entry.js +109 -0
  7. package/dist/cjs/dynamic-claim.cjs.entry.js +306 -0
  8. package/dist/cjs/dynamic-redeem.cjs.entry.js +145 -0
  9. package/dist/cjs/form-input.cjs.entry.js +36 -0
  10. package/dist/cjs/general-inquiry-form.cjs.entry.js +2280 -0
  11. package/dist/cjs/image-expansion-a9c9c6f7.js +77 -0
  12. package/dist/cjs/index-d4b5214c.js +1331 -0
  13. package/dist/cjs/index.cjs.js +6 -0
  14. package/dist/cjs/loader-baf2418b.js +9 -0
  15. package/dist/cjs/loader.cjs.js +19 -0
  16. package/dist/cjs/manufacturer-lookup.cjs.entry.js +109 -0
  17. package/dist/cjs/paint-thickness.cjs.entry.js +131 -0
  18. package/dist/cjs/partInformation-2a6a018b.js +34 -0
  19. package/dist/cjs/service-history.cjs.entry.js +116 -0
  20. package/dist/cjs/shift-components.cjs.js +29 -0
  21. package/dist/cjs/vehicle-accessories.cjs.entry.js +135 -0
  22. package/dist/cjs/vehicle-specification.cjs.entry.js +111 -0
  23. package/dist/cjs/vehicleInformation-4c1dcaf2.js +52 -0
  24. package/dist/cjs/warranty-details.cjs.entry.js +281 -0
  25. package/dist/collection/collection-manifest.json +23 -0
  26. package/dist/collection/components/dynamic-claim/dynamic-claim.css +1 -0
  27. package/dist/collection/components/dynamic-claim/dynamic-claim.js +521 -0
  28. package/dist/collection/components/dynamic-claim/icons/cancelled.svg +8 -0
  29. package/dist/collection/components/dynamic-claim/icons/expired.svg +9 -0
  30. package/dist/collection/components/dynamic-claim/icons/pending.svg +9 -0
  31. package/dist/collection/components/dynamic-claim/icons/processed.svg +9 -0
  32. package/dist/collection/components/dynamic-redeem/dynamic-redeem.css +1 -0
  33. package/dist/collection/components/dynamic-redeem/dynamic-redeem.js +334 -0
  34. package/dist/collection/components/form-input/form-input.css +1 -0
  35. package/dist/collection/components/form-input/form-input.js +209 -0
  36. package/dist/collection/components/general-inquiry-form/general-inquiry-form.css +1 -0
  37. package/dist/collection/components/general-inquiry-form/general-inquiry-form.js +46 -0
  38. package/dist/collection/components/paint-thickness/paint-thickness.css +1 -0
  39. package/dist/collection/components/paint-thickness/paint-thickness.js +323 -0
  40. package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -0
  41. package/dist/collection/components/part-lookup/dead-stock-lookup.js +294 -0
  42. package/dist/collection/components/part-lookup/distributor-lookup.css +1 -0
  43. package/dist/collection/components/part-lookup/distributor-lookup.js +299 -0
  44. package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -0
  45. package/dist/collection/components/part-lookup/manufacturer-lookup.js +317 -0
  46. package/dist/collection/components/parts/Loading.js +10 -0
  47. package/dist/collection/components/service-history/service-history.css +1 -0
  48. package/dist/collection/components/service-history/service-history.js +306 -0
  49. package/dist/collection/components/vehicle-accessories/vehicle-accessories.css +1 -0
  50. package/dist/collection/components/vehicle-accessories/vehicle-accessories.js +327 -0
  51. package/dist/collection/components/vehicle-specification/vehicle-specification.css +1 -0
  52. package/dist/collection/components/vehicle-specification/vehicle-specification.js +301 -0
  53. package/dist/collection/components/warranty-details/assets/check.svg +4 -0
  54. package/dist/collection/components/warranty-details/assets/loader.svg +11 -0
  55. package/dist/collection/components/warranty-details/assets/x-mark.svg +4 -0
  56. package/dist/collection/components/warranty-details/components/CardsContainer.js +9 -0
  57. package/dist/collection/components/warranty-details/components/Loading.js +10 -0
  58. package/dist/collection/components/warranty-details/components/SSCTable.js +13 -0
  59. package/dist/collection/components/warranty-details/components/StatusCard.js +11 -0
  60. package/dist/collection/components/warranty-details/warranty-details.css +1 -0
  61. package/dist/collection/components/warranty-details/warranty-details.js +709 -0
  62. package/dist/collection/global/api/partInformation.js +30 -0
  63. package/dist/collection/global/api/vehicleInformation.js +48 -0
  64. package/dist/collection/global/assets/eye.svg +5 -0
  65. package/dist/collection/global/assets/loader.svg +11 -0
  66. package/dist/collection/global/lib/cn.js +9 -0
  67. package/dist/collection/global/lib/form-hook.js +118 -0
  68. package/dist/collection/global/lib/image-expansion.js +69 -0
  69. package/dist/collection/global/lib/utils.js +7 -0
  70. package/dist/collection/global/types/components.js +1 -0
  71. package/dist/collection/global/types/part-information.js +1 -0
  72. package/dist/collection/global/types/vehicle-information.js +5 -0
  73. package/dist/collection/index.js +1 -0
  74. package/dist/collection/templates/mock-data.js +4132 -0
  75. package/dist/collection/templates/parts/mock-data.js +221 -0
  76. package/dist/collection/templates/vehicle-lookup.js +218 -0
  77. package/dist/collection/templates/warranty-mock-data.js +2982 -0
  78. package/dist/components/dead-stock-lookup.d.ts +11 -0
  79. package/dist/components/dead-stock-lookup.js +5 -0
  80. package/dist/components/distributor-lookup.d.ts +11 -0
  81. package/dist/components/distributor-lookup.js +5 -0
  82. package/dist/components/dynamic-claim.d.ts +11 -0
  83. package/dist/components/dynamic-claim.js +5 -0
  84. package/dist/components/dynamic-redeem.d.ts +11 -0
  85. package/dist/components/dynamic-redeem.js +5 -0
  86. package/dist/components/form-input.d.ts +11 -0
  87. package/dist/components/form-input.js +5 -0
  88. package/dist/components/general-inquiry-form.d.ts +11 -0
  89. package/dist/components/general-inquiry-form.js +5 -0
  90. package/dist/components/index.d.ts +33 -0
  91. package/dist/components/index.js +5 -0
  92. package/dist/components/manufacturer-lookup.d.ts +11 -0
  93. package/dist/components/manufacturer-lookup.js +5 -0
  94. package/dist/components/p-2b0cc0c6.js +5 -0
  95. package/dist/components/p-4dc47f5f.js +5 -0
  96. package/dist/components/p-50f73226.js +5 -0
  97. package/dist/components/p-5df9bc5f.js +5 -0
  98. package/dist/components/p-8375923d.js +5 -0
  99. package/dist/components/p-98d9e7ab.js +5 -0
  100. package/dist/components/p-a454210b.js +5 -0
  101. package/dist/components/p-d265c109.js +5 -0
  102. package/dist/components/p-d5ff7544.js +5 -0
  103. package/dist/components/paint-thickness.d.ts +11 -0
  104. package/dist/components/paint-thickness.js +5 -0
  105. package/dist/components/service-history.d.ts +11 -0
  106. package/dist/components/service-history.js +5 -0
  107. package/dist/components/vehicle-accessories.d.ts +11 -0
  108. package/dist/components/vehicle-accessories.js +5 -0
  109. package/dist/components/vehicle-specification.d.ts +11 -0
  110. package/dist/components/vehicle-specification.js +5 -0
  111. package/dist/components/warranty-details.d.ts +11 -0
  112. package/dist/components/warranty-details.js +5 -0
  113. package/dist/esm/Loading-61648252.js +14 -0
  114. package/dist/esm/app-globals-8befa224.js +7 -0
  115. package/dist/esm/cn-cc419b94.js +2586 -0
  116. package/dist/esm/dead-stock-lookup.entry.js +99 -0
  117. package/dist/esm/distributor-lookup.entry.js +105 -0
  118. package/dist/esm/dynamic-claim.entry.js +302 -0
  119. package/dist/esm/dynamic-redeem.entry.js +141 -0
  120. package/dist/esm/form-input.entry.js +32 -0
  121. package/dist/esm/general-inquiry-form.entry.js +2276 -0
  122. package/dist/esm/image-expansion-08c4bf0d.js +73 -0
  123. package/dist/esm/index-ef54644b.js +1302 -0
  124. package/dist/esm/index.js +4 -0
  125. package/dist/esm/loader-027b88af.js +7 -0
  126. package/dist/esm/loader.js +15 -0
  127. package/dist/esm/manufacturer-lookup.entry.js +105 -0
  128. package/dist/esm/paint-thickness.entry.js +127 -0
  129. package/dist/esm/partInformation-73ece994.js +32 -0
  130. package/dist/esm/service-history.entry.js +112 -0
  131. package/dist/esm/shift-components.js +24 -0
  132. package/dist/esm/vehicle-accessories.entry.js +131 -0
  133. package/dist/esm/vehicle-specification.entry.js +107 -0
  134. package/dist/esm/vehicleInformation-f1081f83.js +50 -0
  135. package/dist/esm/warranty-details.entry.js +277 -0
  136. package/dist/index.cjs.js +1 -0
  137. package/dist/index.js +1 -0
  138. package/dist/shift-components/index.esm.js +4 -0
  139. package/dist/shift-components/p-15f86441.entry.js +5 -0
  140. package/dist/shift-components/p-1ae3a61f.entry.js +5 -0
  141. package/dist/shift-components/p-517b3e04.js +5 -0
  142. package/dist/shift-components/p-5df9bc5f.js +5 -0
  143. package/dist/shift-components/p-65e6ab8e.js +5 -0
  144. package/dist/shift-components/p-894e7518.entry.js +5 -0
  145. package/dist/shift-components/p-8c261972.entry.js +5 -0
  146. package/dist/shift-components/p-8e818568.entry.js +5 -0
  147. package/dist/shift-components/p-98d9e7ab.js +5 -0
  148. package/dist/shift-components/p-9bd4471c.entry.js +5 -0
  149. package/dist/shift-components/p-9f790b14.entry.js +5 -0
  150. package/dist/shift-components/p-a21e2e2e.js +5 -0
  151. package/dist/shift-components/p-c113792c.entry.js +5 -0
  152. package/dist/shift-components/p-d265c109.js +5 -0
  153. package/dist/shift-components/p-d5ff7544.js +5 -0
  154. package/dist/shift-components/p-dc9845ed.entry.js +5 -0
  155. package/dist/shift-components/p-e32b0798.entry.js +5 -0
  156. package/dist/shift-components/p-e97316d2.js +6 -0
  157. package/dist/shift-components/p-f759c597.entry.js +5 -0
  158. package/dist/shift-components/p-feb3df85.entry.js +5 -0
  159. package/dist/shift-components/shift-components.esm.js +5 -0
  160. package/dist/types/components/dynamic-claim/dynamic-claim.d.ts +48 -0
  161. package/dist/types/components/dynamic-redeem/dynamic-redeem.d.ts +34 -0
  162. package/dist/types/components/form-input/form-input.d.ts +14 -0
  163. package/dist/types/components/general-inquiry-form/general-inquiry-form.d.ts +21 -0
  164. package/dist/types/components/paint-thickness/paint-thickness.d.ts +28 -0
  165. package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +25 -0
  166. package/dist/types/components/part-lookup/distributor-lookup.d.ts +23 -0
  167. package/dist/types/components/part-lookup/manufacturer-lookup.d.ts +24 -0
  168. package/dist/types/components/parts/Loading.d.ts +5 -0
  169. package/dist/types/components/service-history/service-history.d.ts +23 -0
  170. package/dist/types/components/vehicle-accessories/vehicle-accessories.d.ts +28 -0
  171. package/dist/types/components/vehicle-specification/vehicle-specification.d.ts +22 -0
  172. package/dist/types/components/warranty-details/components/CardsContainer.d.ts +8 -0
  173. package/dist/types/components/warranty-details/components/Loading.d.ts +5 -0
  174. package/dist/types/components/warranty-details/components/SSCTable.d.ts +6 -0
  175. package/dist/types/components/warranty-details/components/StatusCard.d.ts +10 -0
  176. package/dist/types/components/warranty-details/warranty-details.d.ts +51 -0
  177. package/dist/types/components.d.ts +388 -0
  178. package/dist/types/global/api/partInformation.d.ts +19 -0
  179. package/dist/types/global/api/vehicleInformation.d.ts +33 -0
  180. package/dist/types/global/lib/cn.d.ts +2 -0
  181. package/dist/types/global/lib/form-hook.d.ts +54 -0
  182. package/dist/types/global/lib/image-expansion.d.ts +9 -0
  183. package/dist/types/global/lib/utils.d.ts +1 -0
  184. package/dist/types/global/types/components.d.ts +4 -0
  185. package/dist/types/global/types/part-information.d.ts +30 -0
  186. package/dist/types/global/types/vehicle-information.d.ts +162 -0
  187. package/dist/types/index.d.ts +10 -0
  188. package/dist/types/stencil-public-runtime.d.ts +1680 -0
  189. package/loader/cdn.js +5 -0
  190. package/loader/index.cjs.js +5 -0
  191. package/loader/index.d.ts +24 -0
  192. package/loader/index.es2017.js +5 -0
  193. package/loader/index.js +6 -0
  194. package/loader/package.json +11 -0
  195. package/package.json +61 -0
  196. package/readme.md +104 -0
@@ -0,0 +1,99 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
6
+ import { g as getPartInformation } from './partInformation-73ece994.js';
7
+ import { L as Loading } from './Loading-61648252.js';
8
+ import { c as cn } from './cn-cc419b94.js';
9
+ import './loader-027b88af.js';
10
+
11
+ const deadStockLookupCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.flex{display:flex}.hidden{display:none}.max-h-screen{max-height:100vh}.rotate-180{--tw-rotate:180deg}.rotate-180,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}:host{all:initial!important;display:block}*{font-family:Arial}.accordion-item{border-bottom:1px solid #e2e8f0}.accordion-header{align-items:center;cursor:pointer;display:flex;justify-content:space-between;width:100%}.accordion-content{max-height:0;overflow:hidden;transition:max-height .3s ease-in-out}.accordion-content.max-h-screen{max-height:1000px}.icon{transition:transform .3s ease-in-out}.icon.rotate-180{transform:rotate(180deg)}.static{position:static}.relative{position:relative}.mx-auto{margin-left:auto;margin-right:auto}.mt-\\[12px\\]{margin-top:12px}.table{display:table}.h-4{height:1rem}.h-\\[40px\\]{height:40px}.max-h-0{max-height:0}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-4{width:1rem}.w-fit{width:fit-content}.w-full{width:100%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.rotate-180,.scale-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.border-slate-200{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-left{text-align:left}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
12
+ const DeadStockLookupStyle0 = deadStockLookupCss;
13
+
14
+ let mockData = {};
15
+ const DeadStockLookup = class {
16
+ constructor(hostRef) {
17
+ registerInstance(this, hostRef);
18
+ this.isDev = false;
19
+ this.baseUrl = '';
20
+ this.queryString = '';
21
+ this.loadingStateChange = undefined;
22
+ this.loadedResponse = undefined;
23
+ this.state = 'idle';
24
+ this.externalPartNumber = null;
25
+ this.errorMessage = null;
26
+ this.partInformation = undefined;
27
+ this.activeIndex = null;
28
+ }
29
+ handleSettingData(response) {
30
+ this.partInformation = response;
31
+ }
32
+ toggleAccordion(index) {
33
+ this.activeIndex = this.activeIndex === index ? null : index;
34
+ }
35
+ async setData(newData) {
36
+ clearTimeout(this.networkTimeoutRef);
37
+ if (this.abortController)
38
+ this.abortController.abort();
39
+ this.abortController = new AbortController();
40
+ let scopedTimeoutRef;
41
+ const isPartNumberRequest = typeof newData === 'string';
42
+ const partNumber = isPartNumberRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.partNumber;
43
+ this.externalPartNumber = partNumber;
44
+ try {
45
+ if (!partNumber || partNumber.trim().length === 0) {
46
+ //this.componentHeight = '0px';
47
+ this.state = 'idle';
48
+ return;
49
+ }
50
+ if (this.state === 'data' || this.state === 'error') {
51
+ this.state = (this.state + '-loading');
52
+ }
53
+ else
54
+ this.state = 'loading';
55
+ await new Promise(r => {
56
+ scopedTimeoutRef = setTimeout(r, 700);
57
+ this.networkTimeoutRef = scopedTimeoutRef;
58
+ });
59
+ const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }) : newData;
60
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
61
+ if (!partResponse)
62
+ throw new Error('Wrong response format');
63
+ this.handleSettingData(partResponse);
64
+ }
65
+ this.errorMessage = null;
66
+ this.state = 'data';
67
+ }
68
+ catch (error) {
69
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
70
+ return;
71
+ this.state = 'error';
72
+ this.partInformation = null;
73
+ this.errorMessage = error.message;
74
+ }
75
+ }
76
+ async fetchData(requestedVin = this.externalPartNumber) {
77
+ await this.setData(requestedVin);
78
+ }
79
+ async loadingListener() {
80
+ //this.calculateHeight(newState);
81
+ if (this.loadingStateChange)
82
+ this.loadingStateChange(this.state.includes('loading'));
83
+ }
84
+ async setMockData(newMockData) {
85
+ mockData = newMockData;
86
+ }
87
+ render() {
88
+ var _a, _b;
89
+ return (h(Host, { key: '7c1fd5523f284234ac9aa44b3f4963e411b48af1' }, h("div", { key: '8fe334240d09636c0ee9ca73b89405a7617a415d', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'b72e6fd1785d5ec11ba443146aa8ad5fade7d5f2' }, h(Loading, { key: '4160190f5427f8cb4475a7d2601c94ddbbfa1f6b', isLoading: this.state.includes('loading') }), h("div", { key: 'f4124cf06ed01d32bc32980db867722f227960ac', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (h("div", { key: 'f867f876e0fd07f4353c117606ca48a8ad27575d', class: "py-[16px]" }, h("div", { key: 'd8e23636133a75fc4f3099d17c0852b3c9070589', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '4599e737df0ed2afaa963e43334f38761c32db0a' }, h("div", { key: '81096a35529e599c554a5ac5b0aa174294c6f7cc', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '1666930fe03143aa2b70d4b557f79c393db81ec9', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Deadstock"), (_b = (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.deadStock) === null || _b === void 0 ? void 0 :
90
+ _b.map((deadStock, i) => (h("div", { style: { padding: '10px 20px' } }, h("div", { class: "accordion-item border-b border-slate-200", style: { boxShadow: 'rgb(225 225 225) 0px 0px 4px 1px', borderRadius: '5px', padding: '0 10px', marginBottom: '10px' }, key: deadStock.companyIntegrationID }, h("button", { class: "accordion-header w-full flex justify-between items-center py-5 text-slate-800", onClick: () => this.toggleAccordion(i) }, h("strong", null, deadStock.companyName), h("span", { class: `icon text-slate-800 transition-transform duration-300 ${this.activeIndex === i ? 'rotate-180' : ''}` }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "w-4 h-4" }, h("path", { "fill-rule": "evenodd", d: "M11.78 9.78a.75.75 0 0 1-1.06 0L8 7.06 5.28 9.78a.75.75 0 0 1-1.06-1.06l3.25-3.25a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1 0 1.06Z", "clip-rule": "evenodd" })))), h("div", { class: `accordion-content overflow-hidden transition-all duration-300 ease-in-out ${this.activeIndex === i ? 'max-h-screen' : 'max-h-0'}` }, h("table", { class: "w-full overflow-auto relative border-collapse" }, h("thead", null, h("tr", null, h("th", { class: "px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Branch"), h("th", { class: "px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Available Qty"))), h("tbody", null, deadStock === null || deadStock === void 0 ? void 0 : deadStock.branchDeadStock.map(branchDeadStock => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: branchDeadStock.companyBranchIntegrationID }, h("td", { class: cn('px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]') }, branchDeadStock.companyBranchName), h("td", { class: cn('px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]') }, h("strong", null, branchDeadStock.quantity))))))))))))))))))));
91
+ }
92
+ get el() { return getElement(this); }
93
+ static get watchers() { return {
94
+ "state": ["loadingListener"]
95
+ }; }
96
+ };
97
+ DeadStockLookup.style = DeadStockLookupStyle0;
98
+
99
+ export { DeadStockLookup as dead_stock_lookup };
@@ -0,0 +1,105 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
6
+ import { L as Loading } from './Loading-61648252.js';
7
+ import { c as cn } from './cn-cc419b94.js';
8
+ import { g as getPartInformation } from './partInformation-73ece994.js';
9
+ import './loader-027b88af.js';
10
+
11
+ const distributorLookupCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.success{color:green}.warning{color:orange}.reject{color:red}.static{position:static}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-\\[40px\\]{height:40px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
12
+ const DistributorLookupStyle0 = distributorLookupCss;
13
+
14
+ let mockData = {};
15
+ const DistributorLookup = class {
16
+ constructor(hostRef) {
17
+ registerInstance(this, hostRef);
18
+ this.baseUrl = '';
19
+ this.isDev = false;
20
+ this.queryString = '';
21
+ this.loadingStateChange = undefined;
22
+ this.loadedResponse = undefined;
23
+ this.state = 'idle';
24
+ this.externalPartNumber = null;
25
+ this.errorMessage = null;
26
+ this.partInformation = undefined;
27
+ }
28
+ handleSettingData(response) {
29
+ this.partInformation = response;
30
+ }
31
+ async setData(newData) {
32
+ clearTimeout(this.networkTimeoutRef);
33
+ if (this.abortController)
34
+ this.abortController.abort();
35
+ this.abortController = new AbortController();
36
+ let scopedTimeoutRef;
37
+ const isPartNumberRequest = typeof newData === 'string';
38
+ const partNumber = isPartNumberRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.partNumber;
39
+ this.externalPartNumber = partNumber;
40
+ try {
41
+ if (!partNumber || partNumber.trim().length === 0) {
42
+ //this.componentHeight = '0px';
43
+ this.state = 'idle';
44
+ return;
45
+ }
46
+ if (this.state === 'data' || this.state === 'error') {
47
+ this.state = (this.state + '-loading');
48
+ }
49
+ else
50
+ this.state = 'loading';
51
+ await new Promise(r => {
52
+ scopedTimeoutRef = setTimeout(r, 700);
53
+ this.networkTimeoutRef = scopedTimeoutRef;
54
+ });
55
+ const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }) : newData;
56
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
57
+ if (!partResponse)
58
+ throw new Error('Wrong response format');
59
+ this.handleSettingData(partResponse);
60
+ }
61
+ this.errorMessage = null;
62
+ this.state = 'data';
63
+ }
64
+ catch (error) {
65
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
66
+ return;
67
+ this.state = 'error';
68
+ this.partInformation = null;
69
+ this.errorMessage = error.message;
70
+ }
71
+ }
72
+ async fetchData(requestedVin = this.externalPartNumber) {
73
+ await this.setData(requestedVin);
74
+ }
75
+ //calculateHeight(componentState: string) {
76
+ // if (componentState.includes('loading') && this.componentHeight === '0px') {
77
+ // this.componentHeight = '100px';
78
+ // } else if (componentState !== 'idle') {
79
+ // setTimeout(() => {
80
+ // this.componentHeight = `${this.wrapperRef.clientHeight}px`;
81
+ // }, 50);
82
+ // } else {
83
+ // this.componentHeight = '0px';
84
+ // }
85
+ //}
86
+ async loadingListener() {
87
+ //this.calculateHeight(newState);
88
+ if (this.loadingStateChange)
89
+ this.loadingStateChange(this.state.includes('loading'));
90
+ }
91
+ async setMockData(newMockData) {
92
+ mockData = newMockData;
93
+ }
94
+ render() {
95
+ var _a;
96
+ return (h(Host, { key: '18e46bdaf73c1ac0b573a2a4c97eec437c44f9a4' }, h("div", { key: 'a69764ce918ebca3af36753836ef22ce1c8227d9', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '5ba603889723dbc2528c612f5df58c206cf4533d' }, h(Loading, { key: 'cebbe7720704e21b856e41edf33d5cdadf3e725b', isLoading: this.state.includes('loading') }), h("div", { key: '7569221713c28ab7d5d507e94af061510b1557ed', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (h("div", { key: '36ab68ce1ea56088fb75744add097325a12d4d04', class: "py-[16px]" }, h("div", { key: 'd21534b379eb44769c496a271e74ba7c10ed9041', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: 'feeaf7618048313e0bbe7ac65d9bd3931a527599' }, h("div", { key: '810ba6e23698d801ad55ae0f96019b203c1e319b', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '30202f2756157e2c8d8fc187b16c6dab20789075', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Info"), h("div", { key: 'b3955a1639641a3a8e1d0ae11be53abd665d4121', style: { padding: '10px 30px', display: 'flex', flexDirection: 'column', gap: '15px' } }, h("div", { key: 'fb814db44447289a77368611768c44bdcebb7e85', style: { display: 'flex', gap: '50px' } }, h("div", { key: 'bd68069b67a5164e96eb028f4915b63b197a5667', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: '741695e764371b9737b90761c3e34d78e93fbc78', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Description"), h("div", { key: 'ff6fb20e5ab5bce00076b0e85a0297b7a036fb07', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].partDescription)), h("div", { key: '2b1f7aaf60c75a9d32a68da96cc8d8b7cfd6d27e', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: '9b7e58c0de6a48df4fbd5ce46ffaf77e7c709aa4', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Product Group"), h("div", { key: '904c2dfdefd7d1874e221fcfdf19074bbbb7543f', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].group)), h("div", { key: '1e61388e66c73e27ce5592350b4f6ff8dd902e2a', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: 'd0eb902d9f017f378394a79986b7713b67c28eba', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Price"), h("div", { key: '50721e8cae1a9091288262ee5c27542766381720', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].price))), h("div", { key: 'fa0f96a7c34c1eb3aad0afb3a75d2067e0441544', style: { display: 'flex', gap: '50px' } }, h("div", { key: '1c955aed56abf94ba1596d4db2fa767d872eefc2', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: 'ffb39000255ae820dc0c38a11520d96dc949f2ff', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Superseded To"), h("div", { key: '115754c8e1cf584f43333341bed83ebd2e8890a5', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].supersededTo)), h("div", { key: '6acaf301536e37a6f2b0002ed15bce62105ab37c', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, h("strong", { key: '3465f5aa0fc85a9ef1d554872a711986e80a4894', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Superseded From"), h("div", { key: 'a3146550e676e90ed3a7b2290d5590bd1c631707', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].supersededFrom)), h("div", { key: '0461b4ceca6f9e5d742561c557449a94e82c0e2c', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } })))), this.partInformation.stockParts.filter(y => { return y.quantityLookUpResult === 'LookupIsSkipped' || y.quantityLookUpResult === 'QuantityNotWithinLookupThreshold'; }).length === 0 && (h("div", { key: '91ee29017615ce40d5fdf44004676a97b0af1b59', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '6440991aeaa1be892831505e53a396f825b2f571', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Distributor Stock"), h("div", { key: 'b3bc251de59876fa04a70a4b368683c0a990c758', style: { padding: '10px 30px', display: 'flex', flexDirection: 'column', gap: '15px' } }, h("table", { key: 'e0deafdbda85e2cb9b46f97dc924fec6b2660f58', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '535589783511c833d9675f1131d9be565e52443f', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '9fa39b30a8786c04bf1e6fbbb4a8552fe699814f' }, ['Location', 'Availability'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: '9d58d281010f2b32c28db6495e55c0602b10724c' }, (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.stockParts.map((stock) => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: stock.locationID }, h("td", { class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]') }, stock.locationName), h("td", { class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]') }, h("div", { class: stock.quantityLookUpResult === 'Available' ? 'success' : stock.quantityLookUpResult === 'PartiallyAvailable' ? 'warning' : 'reject' }, h("strong", null, stock.quantityLookUpResult === 'Available' ? 'Available' : stock.quantityLookUpResult === 'PartiallyAvailable' ? 'Partially Available' : 'Not Available'))))))))))))))))));
97
+ }
98
+ get el() { return getElement(this); }
99
+ static get watchers() { return {
100
+ "state": ["loadingListener"]
101
+ }; }
102
+ };
103
+ DistributorLookup.style = DistributorLookupStyle0;
104
+
105
+ export { DistributorLookup as distributor_lookup };
@@ -0,0 +1,302 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
6
+ import { c as cn } from './cn-cc419b94.js';
7
+ import { g as getVehicleInformation } from './vehicleInformation-f1081f83.js';
8
+
9
+ const expiredSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9ImJsYWNrIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiAxNkw4IDgiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiA4TDggMTYiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgPC9nPgo8L3N2Zz4=';
10
+
11
+ const pendingSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhMWExYTEiIHN0cm9rZT0iI2ExYTFhMSIgLz4KICAgICAgICA8cmVjdCB4PSI5LjUiIHk9IjgiIHdpZHRoPSIyIiBoZWlnaHQ9IjgiIGZpbGw9IiNhMWExYTEiIC8+CiAgICAgICAgPHJlY3QgeD0iMTIuNSIgeT0iOCIgd2lkdGg9IjIiIGhlaWdodD0iOCIgZmlsbD0iI2ExYTFhMSIgLz4KICAgIDwvZz4KPC9zdmc+';
12
+
13
+ const cancelledSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhODAwMDAiIHN0cm9rZT0iI2E4MDAwMCIgLz4KICAgICAgICA8cGF0aCBkPSJNMTggMThMNiA2IiBzdHJva2Utd2lkdGg9IjEuMiIgc3Ryb2tlPSIjYTgwMDAwIiAvPgogICAgPC9nPgo8L3N2Zz4=';
14
+
15
+ const processedSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiMzMDcxYTkiIHN0cm9rZT0iIzMwNzFhOSIgLz4KICAgICAgICA8cGF0aCBkPSJNOC41IDExTDExLjM5MzkgMTMuODkzOUMxMS40NTI1IDEzLjk1MjUgMTEuNTQ3NSAxMy45NTI1IDExLjYwNjEgMTMuODkzOUwxOS41IDYiIHN0cm9rZT0iIzMwNzFhOSIKICAgICAgICAgICAgc3Ryb2tlLXdpZHRoPSIxLjIiIC8+CiAgICA8L2c+Cjwvc3ZnPg==';
16
+
17
+ const dynamicClaimCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.visible{visibility:visible}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.block{display:block}.flex{display:flex}.table{display:table}.hidden{display:none}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.border{border-width:1px}.outline{outline-style:solid}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}:host{all:initial!important;display:block;flex:1 1 0!important;flex-shrink:0!important;width:100%!important}*{box-sizing:content-box;font-family:Arial;margin:revert;padding:revert}.dynamic-claim-wrapper{background:#fdfdfd;border:1px solid #dcdcdc;border-radius:5px;box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 hsla(0,0%,100%,.1);overflow:hidden;padding:0;position:relative}.dynamic-claim-header{background:#f6f6f6;border:1px solid #ededed;padding:15px 0;text-align:center}.dynamic-claim-header-vin{display:inline-block;transition:.4s}.idle .dynamic-claim-header-vin,.loading .dynamic-claim-header-vin{opacity:0;transform:scale(150%);visibility:hidden}.dynamic-claim-body{display:flex;overflow-x:scroll;padding:100px 30px;transition:scrollbar-color .5s ease}.idle .dynamic-claim-body,.loading .dynamic-claim-body{pointer-events:none}.dynamic-claim-wrapper ::-webkit-scrollbar{height:10px;width:10px}.dynamic-claim-wrapper ::-webkit-scrollbar-track{background:#f6f6f6;border-radius:5px;border-top:1px solid #dcdcdc;border-top-left-radius:0;border-top-right-radius:0}.idle .dynamic-claim-body::-webkit-scrollbar-thumb,.loading .dynamic-claim-body::-webkit-scrollbar-thumb{background:transparent}.dynamic-claim-wrapper ::-webkit-scrollbar-thumb{background:#c5c5c5;border-radius:10px}.dynamic-claim-wrapper ::-webkit-scrollbar-thumb:hover{background:#a1a1a1}.dynamic-claim-progress-lane,.loading-lane{align-items:center;background-color:#f2f2f2;border:1px solid #ddd;border-radius:10px;display:flex;flex:1;flex-direction:row;height:10px;justify-content:space-around;position:relative}.idle .dynamic-claim-progress-lane,.loading .dynamic-claim-progress-lane{background-color:transparent;border:1px solid transparent}.loading-lane{position:absolute;visibility:hidden;width:calc(100% - 60px)}.loading .loading-lane{visibility:visible}.dynamic-claim-progress-bar{background-image:linear-gradient(180deg,#428bca,#3071a9);border:1px solid #ddd;border-radius:10px;height:10px;left:0;position:absolute;transition:all;transition-duration:.5s;transition-timing-function:ease-in-out;width:0;z-index:0}.idle .dynamic-claim-progress-bar,.loading .dynamic-claim-progress-bar{opacity:0;width:0!important}.dynamic-claim-item{align-items:center;display:flex;flex-direction:column;font-size:14px;gap:5px;min-width:250px}.popup-position-ref{bottom:0;display:flex;height:0;justify-content:center;position:absolute;width:0}.popup-container{position:fixed;z-index:100}.dynamic-claim-item-popup-info{background-color:#f9f9f9;border:1px solid #ddd;border-radius:5px;color:#282828;opacity:0;padding:20px;transition:.4s;visibility:hidden;width:auto}.dynamic-claim-item-popup-info-triangle.show,.dynamic-claim-item-popup-info.show{opacity:1;visibility:visible}.dynamic-claim-item-popup-info table{border-collapse:collapse;width:100%}.dynamic-claim-item-popup-info table td,.dynamic-claim-item-popup-info table th{border-bottom:1px solid #ddd;padding:10px 50px 10px 10px;text-align:left;white-space:nowrap}.dynamic-claim-item-popup-info table td{font-weight:400}.dynamic-claim-item-popup-info .claim-button{justify-content:center;margin:15px auto auto;width:80%}.dynamic-claim-item-popup-info-triangle{display:flex;justify-content:center;opacity:0;position:relative;transform:translateY(-9px);transition:.4s;visibility:hidden;width:100%;z-index:101}.dynamic-claim-item-popup-info-triangle-up{border-bottom:10px solid #ddd}.dynamic-claim-item-popup-info-triangle-up,.dynamic-claim-item-popup-info-triangle-up2{border-left:10px solid transparent;border-right:10px solid transparent;height:0;position:absolute;width:0}.dynamic-claim-item-popup-info-triangle-up2{border-bottom:10px solid #f9f9f9;margin-top:1px}.dynamic-claim-item-header{align-items:center;cursor:pointer;display:flex;flex-direction:column;height:3em;line-height:1em;padding:10px 0;position:relative;transition:.4s}.dynamic-claim-item-header.load-animation{animation:item-header-fade-in .65s ease forwards}@keyframes item-header-fade-in{0%{opacity:0;transform:translateY(-5px) scale(70%)}to{opacity:1;transform:translateY(0) scale(100%)}}.dynamic-claim-item-header span{font-weight:700}.dynamic-claim-item-header img{transition:.4s}.dynamic-claim-item-header:hover>img{transform:rotate(1turn) scale(125%)}.idle .dynamic-claim-item-header,.loading .dynamic-claim-item-header{opacity:0;transform:translateY(-5px) scale(70%)}.dynamic-claim-item-footer{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;height:4.5em;line-height:1.5em;margin:0;overflow:hidden;padding:0 20px;text-align:center;text-overflow:ellipsis;transition:.4s}.dynamic-claim-item-footer.load-animation{animation:item-footer-fade-in .65s ease forwards}@keyframes item-footer-fade-in{0%{opacity:0;transform:translateY(5px) scale(70%);visibility:hidden}to{opacity:1;transform:translateY(0) scale(100%);visibility:visible}}.idle .dynamic-claim-item-footer,.loading .dynamic-claim-item-footer{opacity:0;transform:translateY(5px) scale(70%);visibility:hidden}.dynamic-claim-item-circle{background-color:#a1a1a1;border:5px double #ececec;border-radius:50%;height:18px;transition:.4s;width:18px;z-index:1}.dynamic-claim-item-circle.load-animation{animation:item-circle-fade-in .65s ease forwards}@keyframes item-circle-fade-in{0%{opacity:0;transform:scale(150%);visibility:hidden}to{opacity:1;transform:scale(100%);visibility:visible}}.idle .dynamic-claim-item-circle,.loading .dynamic-claim-item-circle{opacity:0;transform:scale(150%);visibility:hidden}.dynamic-claim-item.processed .dynamic-claim-item-circle{background-color:#3071a9}.dynamic-claim-item.processed .dynamic-claim-item-header{color:#3071a9}.dynamic-claim-item.expired .dynamic-claim-item-circle{background-color:#282828}.dynamic-claim-item.expired .dynamic-claim-item-headaer{color:#282828}.dynamic-claim-item.cancelled .dynamic-claim-item-circle{background-color:#a80000}.dynamic-claim-item.cancelled .dynamic-claim-item-header{color:#a80000}.dynamic-claim-item.pending .dynamic-claim-item-circle{background-color:#00a300}.dynamic-claim-item.pending .dynamic-claim-item-header{color:#00a300}.dynamic-claim-loading-slider{border-radius:4px;height:10px;left:0;overflow-x:hidden;position:relative;position:absolute;top:0;width:100%}.dynamic-claim-loading-slider-line{background:#ddd;height:10px;opacity:0;position:absolute;width:150%}.dynamic-claim-loading-slider-subline{background-image:linear-gradient(180deg,#428bca,#3071a9);height:10px;position:absolute}.dynamic-claim-wrapper.loading .dynamic-claim-inc{animation:dynamic-claim-increase 2.5s ease infinite}.dynamic-claim-wrapper.loading .dynamic-claim-dec{animation:dynamic-claim-decrease 2.5s ease 1s infinite}@keyframes dynamic-claim-increase{0%{left:-5%;width:5%}to{left:130%;width:100%}}@keyframes dynamic-claim-decrease{0%{left:-80%;width:80%}to{left:110%;width:10%}}.dynamic-claim-button{align-items:center;border:none;border-radius:5px;color:#fff;cursor:pointer;display:flex;font-weight:700;gap:3px;outline:none;padding:0 10px 0 0;transition:.3s}.dynamic-claim-button svg{transition:.2s}.claim-button{stroke:#27ae60;fill:#27ae60;background-color:transparent;border:1px solid #27ae60;color:#27ae60}.claim-button circle{fill:#2ecc71}.claim-button:hover{stroke:#fff;fill:#fff;background-color:#2ecc71;color:#fff}.claim-button:hover circle{fill:#fff}.claim-button:active{background-color:#27ae60}.claim-button:active svg{transform:scale(125%)}.cancel-button{stroke:#c0392b;fill:#c0392b;background-color:transparent;border:1px solid #c0392b;color:#c0392b}.cancel-button circle{fill:#c0392b;transition:.1s}.cancel-button:hover{stroke:#fff;fill:#fff;background-color:#e74c3c;color:#fff}.cancel-button:hover circle{fill:#fff}.static{position:static}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.m-\\[3px\\]{margin:3px}.my-4{margin-bottom:1rem;margin-top:1rem}.ml-1{margin-left:.25rem}.border-separate{border-collapse:separate}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.pl-10{padding-left:2.5rem}";
18
+ const DynamicClaimStyle0 = dynamicClaimCss;
19
+
20
+ let mockData = {};
21
+ const icons = {
22
+ expired: expiredSvg,
23
+ pending: pendingSvg,
24
+ processed: processedSvg,
25
+ cancelled: cancelledSvg,
26
+ };
27
+ const DynamicClaim = class {
28
+ constructor(hostRef) {
29
+ registerInstance(this, hostRef);
30
+ this.pendingItemHighlighted = false;
31
+ this.onMouseLeave = () => {
32
+ clearTimeout(this.timeoutRef);
33
+ this.popupClasses = '';
34
+ this.timeoutRef = setTimeout(() => {
35
+ this.activePopupIndex = null;
36
+ }, 400);
37
+ };
38
+ this.onMouseEnter = (dynamicClaimItemHeader, idx) => {
39
+ clearTimeout(this.timeoutRef);
40
+ this.activePopupIndex = idx;
41
+ this.timeoutRef = setTimeout(() => {
42
+ const positionRef = dynamicClaimItemHeader.querySelector('.popup-position-ref');
43
+ this.popupPositionRef = positionRef;
44
+ this.calculatePopupPos(this.el.shadowRoot);
45
+ this.popupClasses = 'show';
46
+ }, 50);
47
+ };
48
+ this.baseUrl = undefined;
49
+ this.isDev = false;
50
+ this.queryString = '';
51
+ this.isIdle = true;
52
+ this.popupClasses = '';
53
+ this.externalVin = null;
54
+ this.activePopupIndex = null;
55
+ this.vehicleInformation = undefined;
56
+ this.errorMessage = null;
57
+ this.isLoading = false;
58
+ this.loadingStateChange = undefined;
59
+ this.loadedResponse = undefined;
60
+ }
61
+ async componentDidLoad() {
62
+ this.dynamicClaimBody = this.el.shadowRoot.querySelector('.dynamic-claim-body');
63
+ this.dynamicRedeem = this.el.shadowRoot.getElementById('dynamic-redeem');
64
+ this.dynamicClaimProgressBar = this.el.shadowRoot.querySelector('.dynamic-claim-progress-bar');
65
+ }
66
+ async setMockData(newMockData) {
67
+ mockData = newMockData;
68
+ }
69
+ async setData(newData) {
70
+ clearTimeout(this.networkTimeoutRef);
71
+ if (this.abortController)
72
+ this.abortController.abort();
73
+ this.abortController = new AbortController();
74
+ let scopedTimeoutRef;
75
+ const isVinRequest = typeof newData === 'string';
76
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
77
+ this.externalVin = vin;
78
+ try {
79
+ if (!vin || vin.trim().length === 0) {
80
+ this.isIdle = true;
81
+ return;
82
+ }
83
+ this.isLoading = true;
84
+ this.isIdle = false;
85
+ await new Promise(r => {
86
+ scopedTimeoutRef = setTimeout(r, 1000);
87
+ this.networkTimeoutRef = scopedTimeoutRef;
88
+ });
89
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
90
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
91
+ if (!vehicleResponse)
92
+ throw new Error('Wrong response format');
93
+ if (!Array.isArray(vehicleResponse.serviceItems))
94
+ throw new Error('No Service Available');
95
+ this.vehicleInformation = vehicleResponse;
96
+ }
97
+ this.errorMessage = null;
98
+ this.isLoading = false;
99
+ }
100
+ catch (error) {
101
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
102
+ return;
103
+ this.isLoading = false;
104
+ this.vehicleInformation = null;
105
+ this.errorMessage = error.message;
106
+ }
107
+ }
108
+ async fetchData(requestedVin = this.externalVin) {
109
+ await this.setData(requestedVin);
110
+ }
111
+ onLoadingChange(newValue) {
112
+ if (this.loadingStateChange)
113
+ this.loadingStateChange(newValue);
114
+ this.setLoadingUi(newValue);
115
+ }
116
+ async setLoadingUi(isLoading) {
117
+ if (!isLoading) {
118
+ this.dynamicClaimProgressBar.style.width = '0';
119
+ await new Promise(r => setTimeout(r, 200));
120
+ this.updateProgressBar();
121
+ }
122
+ }
123
+ updateProgressBar() {
124
+ var _a;
125
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
126
+ if (serviceItems.filter(x => x.status === 'pending').length === 0) {
127
+ if (serviceItems.length === 0)
128
+ this.dynamicClaimProgressBar.style.width = '0%';
129
+ else
130
+ this.dynamicClaimProgressBar.style.width = '100%';
131
+ this.dynamicClaimBody.scrollTo({
132
+ left: this.dynamicClaimBody.scrollWidth,
133
+ behavior: 'smooth',
134
+ });
135
+ }
136
+ else {
137
+ const firstPendingItem = serviceItems.find(x => x.status === 'pending');
138
+ const firstPendingItemIndex = serviceItems.indexOf(firstPendingItem) + 1;
139
+ const firstPendingItemRef = this.dynamicClaimBody.getElementsByClassName('dynamic-claim-item')[firstPendingItemIndex - 1];
140
+ this.dynamicClaimProgressBar.style.width = (firstPendingItemIndex / serviceItems.length - 1 / (serviceItems.length * 2)) * 100 + '%';
141
+ this.dynamicClaimBody.scrollTo({
142
+ left: firstPendingItemRef.offsetLeft - firstPendingItemRef.clientWidth * 3,
143
+ behavior: 'smooth',
144
+ });
145
+ }
146
+ }
147
+ resetProgressBar() {
148
+ setTimeout(() => {
149
+ this.updateProgressBar();
150
+ }, 100);
151
+ }
152
+ windowScrollListener(newValue) {
153
+ if (newValue) {
154
+ this.scrollListenerRef = () => this.calculatePopupPos(this.el.shadowRoot);
155
+ window.addEventListener('scroll', this.scrollListenerRef);
156
+ this.dynamicClaimBody.addEventListener('scroll', this.scrollListenerRef);
157
+ }
158
+ else {
159
+ window.removeEventListener('scroll', this.scrollListenerRef);
160
+ this.dynamicClaimBody.removeEventListener('scroll', this.scrollListenerRef);
161
+ }
162
+ }
163
+ calculatePopupPos(root) {
164
+ const popupPositionRef = root.querySelector('.popup-position-ref');
165
+ let { x, y } = popupPositionRef.getBoundingClientRect();
166
+ const popupContainer = popupPositionRef.querySelector('.popup-container');
167
+ const { width } = popupContainer.getBoundingClientRect();
168
+ const popupInfo = popupContainer.querySelector('.dynamic-claim-item-popup-info');
169
+ const windowWidth = window.innerWidth; // Get the viewport's width
170
+ popupContainer.style.top = `${y}px`;
171
+ popupContainer.style.left = `${x - width / 2}px`;
172
+ const offsetFromLeft = x - width / 2; // Distance from left side of the viewport
173
+ const offsetFromRight = windowWidth - (x + width / 2); // Distance from right side of the viewport
174
+ let movingNeeded = 0;
175
+ let horizontalMargin = 16;
176
+ if (offsetFromRight < horizontalMargin)
177
+ movingNeeded = offsetFromRight - horizontalMargin;
178
+ else if (offsetFromLeft < horizontalMargin)
179
+ movingNeeded = Math.abs(offsetFromLeft - horizontalMargin);
180
+ popupInfo.style.transform = `translateX(${movingNeeded}px)`;
181
+ }
182
+ removeLoadAnimationClass(event) {
183
+ const component = event.target;
184
+ component.classList.remove('load-animation');
185
+ }
186
+ async completeClaim() {
187
+ var _a;
188
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
189
+ const item = this.cachedClaimItem;
190
+ const serviceDataClone = JSON.parse(JSON.stringify(serviceItems));
191
+ const index = serviceItems.indexOf(item);
192
+ const pendingItemsBefore = serviceDataClone.slice(0, index).filter(x => x.status === 'pending');
193
+ serviceDataClone[index].status = 'processed';
194
+ pendingItemsBefore.forEach(function (otherItem) {
195
+ otherItem.status = 'cancelled';
196
+ });
197
+ this.pendingItemHighlighted = false;
198
+ const vehicleDataClone = JSON.parse(JSON.stringify(this.vehicleInformation));
199
+ vehicleDataClone.serviceItems = serviceDataClone;
200
+ this.vehicleInformation = JSON.parse(JSON.stringify(vehicleDataClone));
201
+ }
202
+ claim(item) {
203
+ var _a;
204
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
205
+ const vinDataClone = JSON.parse(JSON.stringify(serviceItems));
206
+ const index = serviceItems.indexOf(item);
207
+ //Find other items before this item that have status 'pending'
208
+ let pendingItemsBefore = vinDataClone.slice(0, index).filter(x => x.status === 'pending');
209
+ this.cachedClaimItem = item;
210
+ if (item.maximumMileage === null) {
211
+ pendingItemsBefore = [];
212
+ }
213
+ this.onMouseLeave();
214
+ this.openRedeem(item, pendingItemsBefore);
215
+ }
216
+ async handleRedeemScanner() {
217
+ if (this.isDev) {
218
+ this.dynamicRedeem.handleScanner = async (_) => {
219
+ await new Promise(r => setTimeout(r, 500));
220
+ this.dynamicRedeem.quite();
221
+ this.completeClaim();
222
+ this.dynamicRedeem.handleScanner = null;
223
+ };
224
+ }
225
+ else {
226
+ this.dynamicRedeem.handleScanner = async (code) => {
227
+ try {
228
+ const vehicleInformation = this.vehicleInformation;
229
+ const payload = {
230
+ vin: vehicleInformation.vin,
231
+ brandIntegrationID: vehicleInformation.identifiers.brandIntegrationID,
232
+ invoice: code,
233
+ saleInformation: vehicleInformation.saleInformation,
234
+ serviceItem: this.dynamicRedeem.item,
235
+ cancelledServiceItems: this.dynamicRedeem.canceledItems,
236
+ };
237
+ const response = await fetch('/api/vehicle/swift-claim', {
238
+ method: 'POST',
239
+ headers: {
240
+ 'Content-Type': 'application/json',
241
+ },
242
+ body: JSON.stringify(payload),
243
+ });
244
+ const data = await response.json();
245
+ if (!data.Success) {
246
+ alert(data.Message);
247
+ this.dynamicRedeem.quite();
248
+ this.dynamicRedeem.handleScanner = null;
249
+ return;
250
+ }
251
+ this.dynamicRedeem.quite();
252
+ this.completeClaim();
253
+ this.dynamicRedeem.handleScanner = null;
254
+ }
255
+ catch (error) {
256
+ console.error(error);
257
+ alert('Request failed please try again later');
258
+ this.dynamicRedeem.quite();
259
+ this.dynamicRedeem.handleScanner = null;
260
+ }
261
+ };
262
+ }
263
+ }
264
+ openRedeem(item, oldItems) {
265
+ var _a, _b, _c, _d, _e;
266
+ const vehicleInformation = this.vehicleInformation;
267
+ this.dynamicRedeem.vin = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.vin;
268
+ this.dynamicRedeem.item = item;
269
+ this.dynamicRedeem.canceledItems = oldItems;
270
+ 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)
271
+ this.dynamicRedeem.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;
272
+ else
273
+ this.dynamicRedeem.unInvoicedByBrokerName = null;
274
+ this.handleRedeemScanner();
275
+ }
276
+ createPopup(item) {
277
+ return (h("div", { class: "popup-position-ref" }, h("div", { class: "popup-container" }, h("div", { class: cn('dynamic-claim-item-popup-info-triangle', this.popupClasses) }, h("div", { class: "dynamic-claim-item-popup-info-triangle-up" }), h("div", { class: "dynamic-claim-item-popup-info-triangle-up2" })), h("div", { class: cn('dynamic-claim-item-popup-info', this.popupClasses) }, h("table", null, h("tbody", null, h("tr", null, h("th", null, "Service Type:"), h("td", null, item.type.charAt(0).toUpperCase() + item.type.slice(1))), h("tr", null, h("th", null, "Activation Date"), h("td", null, item.activatedAt)), h("tr", null, h("th", null, "Expiry Date"), h("td", null, item.expiresAt)), h("tr", null, h("th", null, "Claimed At"), h("td", null, item.redeemDate)), h("tr", null, h("th", null, "Redeeming Dealer"), h("td", null, item.dealerName)), h("tr", null, h("th", null, "Invoice Number"), h("td", null, item.invoiceNumber)), h("tr", null, h("th", null, "WIP"), h("td", null, item.wip)), h("tr", null, h("th", null, "Menu Code"), h("td", null, item.menuCode)))), item.status === 'pending' && (h("button", { onClick: () => this.claim(item), class: "dynamic-claim-button claim-button" }, h("svg", { width: "30px", height: "30px", 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, "Claim")))))));
278
+ }
279
+ render() {
280
+ var _a, _b;
281
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
282
+ return (h(Host, { key: '69015f288435250b4aa463712cccce2170ee94cb' }, h("dynamic-redeem", { key: '1b304bc3204e4647d50c8272de19d946924ab612', id: "dynamic-redeem" }), h("div", { key: '6bc9e818c42a534eb72a333b25223539fc091531', class: cn('dynamic-claim-wrapper', { loading: this.isLoading, idle: this.isIdle }) }, h("div", { key: '584e4380f4eb890cc6695291858eba95d9fa1e56', class: "dynamic-claim-header" }, h("strong", { key: 'a4a2e927c9fcc1bd92a1b8a90784145f67a09490', onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-header-vin load-animation" }, this.errorMessage && h("span", { key: '6166bb327b7bcd7a8f91a5f38914073862dc7d8f', style: { color: 'red' } }, this.errorMessage), !this.errorMessage && ((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin))), h("div", { key: 'ded5c343882c16009dc2060ce09e3010aa2377cc', class: "dynamic-claim-body" }, h("div", { key: '2658f01a11bd29d449d33354a50b684272eff43a', class: "loading-lane" }, h("div", { key: '9b4136a86be3d26b2400d679e2f8906a12ad63a1', class: "dynamic-claim-loading-slider" }, h("div", { key: 'e5683ba9359f20e88b2e3e4b120bc0c9206b597c', class: "dynamic-claim-loading-slider-line" }), h("div", { key: '502bac6c4f2c7f22cc9c01bd2ee101ab5b615947', class: "dynamic-claim-loading-slider-subline dynamic-claim-inc" }), h("div", { key: 'b262ef4ae0abf92657c60a31e67a93ba2ed0b9a4', class: "dynamic-claim-loading-slider-subline dynamic-claim-dec" }))), h("div", { key: 'b46adda04f3b05c15bb101b9a26d66f47e9c3079', class: "dynamic-claim-progress-lane" }, serviceItems.map((item, idx) => {
283
+ let statusClass = '';
284
+ if (item.status === 'pending') {
285
+ if (serviceItems.findIndex(i => i.status === 'pending') === idx)
286
+ statusClass = item.status;
287
+ }
288
+ else
289
+ statusClass = item.status;
290
+ return (h("div", { key: item.name, class: cn('dynamic-claim-item', statusClass), onMouseLeave: this.onMouseLeave }, h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-header load-animation", onMouseEnter: event => this.onMouseEnter(event.target, idx) }, h("img", { src: icons[item.status], alt: "status icon" }), h("span", null, item.status.charAt(0).toUpperCase() + item.status.slice(1)), this.activePopupIndex === idx && this.createPopup(item)), h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-circle load-animation" }), h("p", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-footer load-animation" }, item.name)));
291
+ }), h("div", { key: '395e563bc4188ffb8a320f80f4ea57bf173bf9ec', class: "dynamic-claim-progress-bar" }))))));
292
+ }
293
+ get el() { return getElement(this); }
294
+ static get watchers() { return {
295
+ "isLoading": ["onLoadingChange"],
296
+ "vehicleInformation": ["resetProgressBar"],
297
+ "popupClasses": ["windowScrollListener"]
298
+ }; }
299
+ };
300
+ DynamicClaim.style = DynamicClaimStyle0;
301
+
302
+ export { DynamicClaim as dynamic_claim };