@postnord/pn-marketweb-components 3.0.3 → 3.1.0

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 (758) hide show
  1. package/cjs/{FetchHelper-8d537d38.js → FetchHelper-dcfe4038.js} +122 -123
  2. package/cjs/FetchHelper-dcfe4038.js.map +1 -0
  3. package/cjs/loader.cjs.js +1 -1
  4. package/cjs/pn-address-autofill.cjs.entry.js +47 -49
  5. package/cjs/pn-address-autofill.cjs.entry.js.map +1 -1
  6. package/cjs/pn-animated-tile.cjs.entry.js +4 -4
  7. package/cjs/pn-animated-tile.cjs.entry.js.map +1 -1
  8. package/cjs/pn-app-banner.cjs.entry.js +15 -15
  9. package/cjs/pn-app-banner.cjs.entry.js.map +1 -1
  10. package/cjs/pn-bonus-progressbar-level.cjs.entry.js +1 -1
  11. package/cjs/pn-bonus-progressbar-level.cjs.entry.js.map +1 -1
  12. package/cjs/pn-bonus-progressbar.cjs.entry.js +1 -1
  13. package/cjs/pn-bonus-progressbar.cjs.entry.js.map +1 -1
  14. package/cjs/pn-breakpoints.cjs.entry.js +1 -1
  15. package/cjs/pn-breakpoints.cjs.entry.js.map +1 -1
  16. package/cjs/pn-chart.cjs.entry.js +47 -10
  17. package/cjs/pn-chart.cjs.entry.js.map +1 -1
  18. package/cjs/pn-charts-card.cjs.entry.js +7 -7
  19. package/cjs/pn-charts-card.cjs.entry.js.map +1 -1
  20. package/cjs/pn-choice-button.cjs.entry.js +1 -1
  21. package/cjs/pn-choice-button.cjs.entry.js.map +1 -1
  22. package/cjs/pn-cta-block.cjs.entry.js +1 -1
  23. package/cjs/pn-cta-block.cjs.entry.js.map +1 -1
  24. package/cjs/pn-customernumber-selector-option.cjs.entry.js +1 -1
  25. package/cjs/pn-customernumber-selector-option.cjs.entry.js.map +1 -1
  26. package/cjs/pn-customernumber-selector.cjs.entry.js +1 -1
  27. package/cjs/pn-customernumber-selector.cjs.entry.js.map +1 -1
  28. package/cjs/pn-date-and-time.cjs.entry.js +13 -15
  29. package/cjs/pn-date-and-time.cjs.entry.js.map +1 -1
  30. package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js +33 -36
  31. package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js.map +1 -1
  32. package/cjs/pn-dropdown-with-multi-input-rows-row.cjs.entry.js +13 -10
  33. package/cjs/pn-dropdown-with-multi-input-rows-row.cjs.entry.js.map +1 -1
  34. package/cjs/pn-dropdown-with-multi-input-rows.cjs.entry.js +46 -40
  35. package/cjs/pn-dropdown-with-multi-input-rows.cjs.entry.js.map +1 -1
  36. package/cjs/pn-filter-checkbox.cjs.entry.js +2 -3
  37. package/cjs/pn-filter-checkbox.cjs.entry.js.map +1 -1
  38. package/cjs/pn-find-price.cjs.entry.js +1 -2
  39. package/cjs/pn-find-price.cjs.entry.js.map +1 -1
  40. package/cjs/pn-find-service-and-price.cjs.entry.js +2 -3
  41. package/cjs/pn-find-service-and-price.cjs.entry.js.map +1 -1
  42. package/cjs/pn-hero-block-international.cjs.entry.js +3 -3
  43. package/cjs/pn-hero-block-international.cjs.entry.js.map +1 -1
  44. package/cjs/pn-language-selector_9.cjs.entry.js +83 -79
  45. package/cjs/pn-language-selector_9.cjs.entry.js.map +1 -1
  46. package/cjs/pn-line-shape.cjs.entry.js +1 -1
  47. package/cjs/pn-line-shape.cjs.entry.js.map +1 -1
  48. package/cjs/pn-link-list.cjs.entry.js +33 -37
  49. package/cjs/pn-link-list.cjs.entry.js.map +1 -1
  50. package/cjs/pn-mainnav-link.cjs.entry.js +2 -2
  51. package/cjs/pn-mainnav-link.cjs.entry.js.map +1 -1
  52. package/cjs/pn-market-web-components.cjs.js +1 -1
  53. package/cjs/pn-marketweb-input.cjs.entry.js +1 -2
  54. package/cjs/pn-marketweb-input.cjs.entry.js.map +1 -1
  55. package/cjs/pn-marketweb-search.cjs.entry.js +5 -1
  56. package/cjs/pn-marketweb-search.cjs.entry.js.map +1 -1
  57. package/cjs/pn-marketweb-sitefooter.cjs.entry.js +18 -24
  58. package/cjs/pn-marketweb-sitefooter.cjs.entry.js.map +1 -1
  59. package/cjs/pn-marketweb-siteheader-login-button_5.cjs.entry.js +17 -20
  60. package/cjs/pn-marketweb-siteheader-login-button_5.cjs.entry.js.map +1 -1
  61. package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js +5 -5
  62. package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js.map +1 -1
  63. package/cjs/pn-marketweb-siteheader.cjs.entry.js +22 -27
  64. package/cjs/pn-marketweb-siteheader.cjs.entry.js.map +1 -1
  65. package/cjs/pn-media-block.cjs.entry.js +31 -29
  66. package/cjs/pn-media-block.cjs.entry.js.map +1 -1
  67. package/cjs/pn-multi-row-connected-dropdown-row.cjs.entry.js +37 -45
  68. package/cjs/pn-multi-row-connected-dropdown-row.cjs.entry.js.map +1 -1
  69. package/cjs/pn-multi-row-connected-dropdown.cjs.entry.js +39 -33
  70. package/cjs/pn-multi-row-connected-dropdown.cjs.entry.js.map +1 -1
  71. package/cjs/pn-multiple-input.cjs.entry.js +9 -6
  72. package/cjs/pn-multiple-input.cjs.entry.js.map +1 -1
  73. package/cjs/pn-parcel-tracker.cjs.entry.js +1 -1
  74. package/cjs/pn-parcel-tracker.cjs.entry.js.map +1 -1
  75. package/cjs/pn-pex-pricefinder.cjs.entry.js +1 -1
  76. package/cjs/pn-pex-pricefinder.cjs.entry.js.map +1 -1
  77. package/cjs/pn-play-on-scroll.cjs.entry.js +19 -17
  78. package/cjs/pn-play-on-scroll.cjs.entry.js.map +1 -1
  79. package/cjs/pn-product-pricelist.cjs.entry.js +2 -3
  80. package/cjs/pn-product-pricelist.cjs.entry.js.map +1 -1
  81. package/cjs/pn-profile-modal-customernumber.cjs.entry.js +2 -1
  82. package/cjs/pn-profile-modal-customernumber.cjs.entry.js.map +1 -1
  83. package/cjs/pn-profile-modal-profile.cjs.entry.js +3 -1
  84. package/cjs/pn-profile-modal-profile.cjs.entry.js.map +1 -1
  85. package/cjs/pn-profile-modal-type.cjs.entry.js +1 -1
  86. package/cjs/pn-profile-modal-type.cjs.entry.js.map +1 -1
  87. package/cjs/pn-profile-modal.cjs.entry.js +1 -1
  88. package/cjs/pn-profile-modal.cjs.entry.js.map +1 -1
  89. package/cjs/pn-profile-selector-option.cjs.entry.js +1 -1
  90. package/cjs/pn-profile-selector-option.cjs.entry.js.map +1 -1
  91. package/cjs/pn-profile-selector.cjs.entry.js +1 -1
  92. package/cjs/pn-profile-selector.cjs.entry.js.map +1 -1
  93. package/cjs/pn-proxio-findprice-result.cjs.entry.js +8 -12
  94. package/cjs/pn-proxio-findprice-result.cjs.entry.js.map +1 -1
  95. package/cjs/pn-proxio-findprice.cjs.entry.js +16 -23
  96. package/cjs/pn-proxio-findprice.cjs.entry.js.map +1 -1
  97. package/cjs/pn-proxio-pricegroup.cjs.entry.js +9 -13
  98. package/cjs/pn-proxio-pricegroup.cjs.entry.js.map +1 -1
  99. package/cjs/pn-quick-cta.cjs.entry.js +1 -1
  100. package/cjs/pn-quick-cta.cjs.entry.js.map +1 -1
  101. package/cjs/pn-quote-card.cjs.entry.js +1 -1
  102. package/cjs/pn-quote-card.cjs.entry.js.map +1 -1
  103. package/cjs/pn-scroll_2.cjs.entry.js +16 -15
  104. package/cjs/pn-scroll_2.cjs.entry.js.map +1 -1
  105. package/cjs/pn-share-item.cjs.entry.js +1 -1
  106. package/cjs/pn-share-item.cjs.entry.js.map +1 -1
  107. package/cjs/pn-share.cjs.entry.js +1 -1
  108. package/cjs/pn-share.cjs.entry.js.map +1 -1
  109. package/cjs/pn-sidenav-level.cjs.entry.js +3 -4
  110. package/cjs/pn-sidenav-level.cjs.entry.js.map +1 -1
  111. package/cjs/pn-sidenav-link.cjs.entry.js +2 -2
  112. package/cjs/pn-sidenav-link.cjs.entry.js.map +1 -1
  113. package/cjs/pn-sidenav-togglebutton.cjs.entry.js +1 -1
  114. package/cjs/pn-sidenav-togglebutton.cjs.entry.js.map +1 -1
  115. package/cjs/pn-sidenav.cjs.entry.js +1 -1
  116. package/cjs/pn-sidenav.cjs.entry.js.map +1 -1
  117. package/cjs/pn-site-footer_3.cjs.entry.js +1 -1
  118. package/cjs/pn-site-footer_3.cjs.entry.js.map +1 -1
  119. package/cjs/pn-spotlight.cjs.entry.js +1 -1
  120. package/cjs/pn-spotlight.cjs.entry.js.map +1 -1
  121. package/cjs/pn-stats-info-data.cjs.entry.js +5 -5
  122. package/cjs/pn-stats-info-data.cjs.entry.js.map +1 -1
  123. package/cjs/pn-teaser-card.cjs.entry.js +2 -3
  124. package/cjs/pn-teaser-card.cjs.entry.js.map +1 -1
  125. package/cjs/pn-titletag.cjs.entry.js +1 -1
  126. package/cjs/pn-titletag.cjs.entry.js.map +1 -1
  127. package/cjs/pn-usp-promoter.cjs.entry.js +1 -1
  128. package/cjs/pn-usp-promoter.cjs.entry.js.map +1 -1
  129. package/collection/components/animation/pn-animated-tile/pn-animated-tile.js +4 -3
  130. package/collection/components/animation/pn-animated-tile/pn-animated-tile.js.map +1 -1
  131. package/collection/components/animation/pn-play-on-scroll/pn-play-on-scroll.js +19 -16
  132. package/collection/components/animation/pn-play-on-scroll/pn-play-on-scroll.js.map +1 -1
  133. package/collection/components/animation/pn-play-on-scroll/pn-video-overlay/pn-video-overlay.js +11 -9
  134. package/collection/components/animation/pn-play-on-scroll/pn-video-overlay/pn-video-overlay.js.map +1 -1
  135. package/collection/components/animation/pn-scroll/pn-scroll.js +5 -4
  136. package/collection/components/animation/pn-scroll/pn-scroll.js.map +1 -1
  137. package/collection/components/cards/pn-quote-card/pn-line-shape/pn-line-shape.js +1 -0
  138. package/collection/components/cards/pn-quote-card/pn-line-shape/pn-line-shape.js.map +1 -1
  139. package/collection/components/cards/pn-quote-card/pn-quote-card.js +1 -0
  140. package/collection/components/cards/pn-quote-card/pn-quote-card.js.map +1 -1
  141. package/collection/components/cards/pn-teaser-card/pn-teaser-card.js +2 -2
  142. package/collection/components/cards/pn-teaser-card/pn-teaser-card.js.map +1 -1
  143. package/collection/components/charts/pn-chart/pn-chart-helper.js +32 -7
  144. package/collection/components/charts/pn-chart/pn-chart-helper.js.map +1 -1
  145. package/collection/components/charts/pn-chart/pn-chart.js +15 -2
  146. package/collection/components/charts/pn-chart/pn-chart.js.map +1 -1
  147. package/collection/components/charts/pn-charts-card/pn-charts-card.js +7 -6
  148. package/collection/components/charts/pn-charts-card/pn-charts-card.js.map +1 -1
  149. package/collection/components/cta/pn-cta-block/pn-cta-block.js +1 -0
  150. package/collection/components/cta/pn-cta-block/pn-cta-block.js.map +1 -1
  151. package/collection/components/cta/pn-parcel-tracker/pn-parcel-tracker.js +1 -0
  152. package/collection/components/cta/pn-parcel-tracker/pn-parcel-tracker.js.map +1 -1
  153. package/collection/components/cta/pn-quick-cta/pn-quick-cta.js +1 -0
  154. package/collection/components/cta/pn-quick-cta/pn-quick-cta.js.map +1 -1
  155. package/collection/components/cta/pn-share/pn-share-item.js +1 -0
  156. package/collection/components/cta/pn-share/pn-share-item.js.map +1 -1
  157. package/collection/components/cta/pn-share/pn-share.js +1 -0
  158. package/collection/components/cta/pn-share/pn-share.js.map +1 -1
  159. package/collection/components/cta/pn-spotlight/pn-spotlight.js +1 -0
  160. package/collection/components/cta/pn-spotlight/pn-spotlight.js.map +1 -1
  161. package/collection/components/data-visualization/pn-stats-info/pn-stats-info-data/pn-stats-info-data.js +5 -5
  162. package/collection/components/data-visualization/pn-stats-info/pn-stats-info-data/pn-stats-info-data.js.map +1 -1
  163. package/collection/components/input/pn-address-autofill/pn-address-autofill.js +46 -47
  164. package/collection/components/input/pn-address-autofill/pn-address-autofill.js.map +1 -1
  165. package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar-level.js +1 -0
  166. package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar-level.js.map +1 -1
  167. package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar.js +1 -0
  168. package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar.js.map +1 -1
  169. package/collection/components/input/pn-choice-button/pn-choice-button.js +1 -0
  170. package/collection/components/input/pn-choice-button/pn-choice-button.js.map +1 -1
  171. package/collection/components/input/pn-date-and-time/pn-date-and-time.js +13 -14
  172. package/collection/components/input/pn-date-and-time/pn-date-and-time.js.map +1 -1
  173. package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js +51 -35
  174. package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js.map +1 -1
  175. package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.stories.js +1 -1
  176. package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.js +13 -9
  177. package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.js.map +1 -1
  178. package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.js +46 -39
  179. package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.js.map +1 -1
  180. package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.stories.js +1 -1
  181. package/collection/components/input/pn-filter-checkbox/pn-filter-checkbox.js +2 -2
  182. package/collection/components/input/pn-filter-checkbox/pn-filter-checkbox.js.map +1 -1
  183. package/collection/components/input/pn-marketweb-input/pn-marketweb-input.js +1 -2
  184. package/collection/components/input/pn-marketweb-input/pn-marketweb-input.js.map +1 -1
  185. package/collection/components/input/pn-marketweb-search/pn-marketweb-search.js +5 -0
  186. package/collection/components/input/pn-marketweb-search/pn-marketweb-search.js.map +1 -1
  187. package/collection/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown-row.js +37 -44
  188. package/collection/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown-row.js.map +1 -1
  189. package/collection/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown.js +39 -32
  190. package/collection/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown.js.map +1 -1
  191. package/collection/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown.stories.js +1 -1
  192. package/collection/components/input/pn-multiple-input/pn-multiple-input.js +9 -5
  193. package/collection/components/input/pn-multiple-input/pn-multiple-input.js.map +1 -1
  194. package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.js +17 -22
  195. package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.js.map +1 -1
  196. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.js +2 -0
  197. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.js.map +1 -1
  198. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js +5 -4
  199. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js.map +1 -1
  200. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.js +6 -7
  201. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.js.map +1 -1
  202. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.js +1 -0
  203. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.js.map +1 -1
  204. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js +7 -8
  205. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js.map +1 -1
  206. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.js +7 -6
  207. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.js.map +1 -1
  208. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-search.js +3 -2
  209. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-search.js.map +1 -1
  210. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.js +1 -0
  211. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.js.map +1 -1
  212. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js +21 -25
  213. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js.map +1 -1
  214. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js +5 -22
  215. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js.map +1 -1
  216. package/collection/components/media/pn-media-block/pn-media-block.js +31 -28
  217. package/collection/components/media/pn-media-block/pn-media-block.js.map +1 -1
  218. package/collection/components/minor/pn-app-banner/pn-app-banner.js +15 -14
  219. package/collection/components/minor/pn-app-banner/pn-app-banner.js.map +1 -1
  220. package/collection/components/minor/pn-swan/pn-swan.js +1 -0
  221. package/collection/components/minor/pn-swan/pn-swan.js.map +1 -1
  222. package/collection/components/minor/pn-titletag/pn-titletag.js +1 -0
  223. package/collection/components/minor/pn-titletag/pn-titletag.js.map +1 -1
  224. package/collection/components/navigation/pn-language-selector/pn-language-selector-option.js +1 -0
  225. package/collection/components/navigation/pn-language-selector/pn-language-selector-option.js.map +1 -1
  226. package/collection/components/navigation/pn-language-selector/pn-language-selector.js +4 -2
  227. package/collection/components/navigation/pn-language-selector/pn-language-selector.js.map +1 -1
  228. package/collection/components/navigation/pn-mainnav/pn-mainnav-level.js +2 -1
  229. package/collection/components/navigation/pn-mainnav/pn-mainnav-level.js.map +1 -1
  230. package/collection/components/navigation/pn-mainnav/pn-mainnav-link.js +2 -1
  231. package/collection/components/navigation/pn-mainnav/pn-mainnav-link.js.map +1 -1
  232. package/collection/components/navigation/pn-mainnav/pn-mainnav-list.js +1 -0
  233. package/collection/components/navigation/pn-mainnav/pn-mainnav-list.js.map +1 -1
  234. package/collection/components/navigation/pn-mainnav/pn-mainnav.js +4 -0
  235. package/collection/components/navigation/pn-mainnav/pn-mainnav.js.map +1 -1
  236. package/collection/components/navigation/pn-sidenav/pn-sidenav-level.js +3 -3
  237. package/collection/components/navigation/pn-sidenav/pn-sidenav-level.js.map +1 -1
  238. package/collection/components/navigation/pn-sidenav/pn-sidenav-link.js +2 -1
  239. package/collection/components/navigation/pn-sidenav/pn-sidenav-link.js.map +1 -1
  240. package/collection/components/navigation/pn-sidenav/pn-sidenav-togglebutton.js +1 -0
  241. package/collection/components/navigation/pn-sidenav/pn-sidenav-togglebutton.js.map +1 -1
  242. package/collection/components/navigation/pn-sidenav/pn-sidenav.js +1 -0
  243. package/collection/components/navigation/pn-sidenav/pn-sidenav.js.map +1 -1
  244. package/collection/components/navigation/pn-site-selector/pn-site-selector.js +1 -0
  245. package/collection/components/navigation/pn-site-selector/pn-site-selector.js.map +1 -1
  246. package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector-option.js +1 -0
  247. package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector-option.js.map +1 -1
  248. package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector.js +1 -0
  249. package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector.js.map +1 -1
  250. package/collection/components/profile/pn-profile-modal/pn-profile-modal-customernumber.js +2 -0
  251. package/collection/components/profile/pn-profile-modal/pn-profile-modal-customernumber.js.map +1 -1
  252. package/collection/components/profile/pn-profile-modal/pn-profile-modal-profile.js +3 -0
  253. package/collection/components/profile/pn-profile-modal/pn-profile-modal-profile.js.map +1 -1
  254. package/collection/components/profile/pn-profile-modal/pn-profile-modal-type.js +1 -0
  255. package/collection/components/profile/pn-profile-modal/pn-profile-modal-type.js.map +1 -1
  256. package/collection/components/profile/pn-profile-modal/pn-profile-modal.js +1 -0
  257. package/collection/components/profile/pn-profile-modal/pn-profile-modal.js.map +1 -1
  258. package/collection/components/profile/pn-profile-selector/pn-profile-selector-option.js +1 -0
  259. package/collection/components/profile/pn-profile-selector/pn-profile-selector-option.js.map +1 -1
  260. package/collection/components/profile/pn-profile-selector/pn-profile-selector.js +1 -0
  261. package/collection/components/profile/pn-profile-selector/pn-profile-selector.js.map +1 -1
  262. package/collection/components/utilities/pn-breakpoints/pn-breakpoints.js +1 -0
  263. package/collection/components/utilities/pn-breakpoints/pn-breakpoints.js.map +1 -1
  264. package/collection/components/widgets/pn-find-price/pn-find-price.js +1 -2
  265. package/collection/components/widgets/pn-find-price/pn-find-price.js.map +1 -1
  266. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.js +2 -3
  267. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.js.map +1 -1
  268. package/collection/components/widgets/pn-hero-block-international/pn-hero-block-international.js +3 -2
  269. package/collection/components/widgets/pn-hero-block-international/pn-hero-block-international.js.map +1 -1
  270. package/collection/components/widgets/pn-link-list/pn-link-list.js +33 -37
  271. package/collection/components/widgets/pn-link-list/pn-link-list.js.map +1 -1
  272. package/collection/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder.js +1 -0
  273. package/collection/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder.js.map +1 -1
  274. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.js +2 -3
  275. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.js.map +1 -1
  276. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.js +8 -12
  277. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.js.map +1 -1
  278. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.js +15 -22
  279. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.js.map +1 -1
  280. package/collection/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.js +8 -12
  281. package/collection/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.js.map +1 -1
  282. package/collection/components/widgets/pn-usp-promoter/pn-usp-promoter.js +1 -0
  283. package/collection/components/widgets/pn-usp-promoter/pn-usp-promoter.js.map +1 -1
  284. package/collection/globals/FetchHelper.js +35 -35
  285. package/collection/globals/FetchHelper.js.map +1 -1
  286. package/collection/globals/MarketWebContextService.js +86 -87
  287. package/collection/globals/MarketWebContextService.js.map +1 -1
  288. package/collection/globals/MarketWebLoginManager.js +60 -61
  289. package/collection/globals/MarketWebLoginManager.js.map +1 -1
  290. package/components/FetchHelper.js +121 -122
  291. package/components/FetchHelper.js.map +1 -1
  292. package/components/pn-address-autofill.js +46 -48
  293. package/components/pn-address-autofill.js.map +1 -1
  294. package/components/pn-animated-tile.js +4 -4
  295. package/components/pn-animated-tile.js.map +1 -1
  296. package/components/pn-app-banner.js +15 -15
  297. package/components/pn-app-banner.js.map +1 -1
  298. package/components/pn-bonus-progressbar-level.js +1 -1
  299. package/components/pn-bonus-progressbar-level.js.map +1 -1
  300. package/components/pn-bonus-progressbar.js +1 -1
  301. package/components/pn-bonus-progressbar.js.map +1 -1
  302. package/components/pn-breakpoints.js +1 -1
  303. package/components/pn-breakpoints.js.map +1 -1
  304. package/components/pn-chart.js +47 -10
  305. package/components/pn-chart.js.map +1 -1
  306. package/components/pn-charts-card.js +7 -7
  307. package/components/pn-charts-card.js.map +1 -1
  308. package/components/pn-choice-button2.js +1 -1
  309. package/components/pn-choice-button2.js.map +1 -1
  310. package/components/pn-cta-block.js +1 -1
  311. package/components/pn-cta-block.js.map +1 -1
  312. package/components/pn-customernumber-selector-option.js +1 -1
  313. package/components/pn-customernumber-selector-option.js.map +1 -1
  314. package/components/pn-customernumber-selector.js +1 -1
  315. package/components/pn-customernumber-selector.js.map +1 -1
  316. package/components/pn-date-and-time.js +13 -15
  317. package/components/pn-date-and-time.js.map +1 -1
  318. package/components/pn-dropdown-choice-adds-row.js +34 -36
  319. package/components/pn-dropdown-choice-adds-row.js.map +1 -1
  320. package/components/pn-dropdown-with-multi-input-rows-row2.js +13 -10
  321. package/components/pn-dropdown-with-multi-input-rows-row2.js.map +1 -1
  322. package/components/pn-dropdown-with-multi-input-rows.js +46 -40
  323. package/components/pn-dropdown-with-multi-input-rows.js.map +1 -1
  324. package/components/pn-filter-checkbox2.js +2 -3
  325. package/components/pn-filter-checkbox2.js.map +1 -1
  326. package/components/pn-find-price.js +1 -2
  327. package/components/pn-find-price.js.map +1 -1
  328. package/components/pn-find-service-and-price.js +2 -3
  329. package/components/pn-find-service-and-price.js.map +1 -1
  330. package/components/pn-hero-block-international.js +3 -3
  331. package/components/pn-hero-block-international.js.map +1 -1
  332. package/components/pn-language-selector-option2.js +1 -0
  333. package/components/pn-language-selector-option2.js.map +1 -1
  334. package/components/pn-language-selector2.js +4 -3
  335. package/components/pn-language-selector2.js.map +1 -1
  336. package/components/pn-line-shape.js +1 -1
  337. package/components/pn-line-shape.js.map +1 -1
  338. package/components/pn-link-list.js +33 -37
  339. package/components/pn-link-list.js.map +1 -1
  340. package/components/pn-mainnav-level2.js +2 -2
  341. package/components/pn-mainnav-level2.js.map +1 -1
  342. package/components/pn-mainnav-link2.js +2 -2
  343. package/components/pn-mainnav-link2.js.map +1 -1
  344. package/components/pn-mainnav-list2.js +1 -1
  345. package/components/pn-mainnav-list2.js.map +1 -1
  346. package/components/pn-mainnav2.js +4 -1
  347. package/components/pn-mainnav2.js.map +1 -1
  348. package/components/pn-marketweb-input2.js +1 -2
  349. package/components/pn-marketweb-input2.js.map +1 -1
  350. package/components/pn-marketweb-search.js +5 -1
  351. package/components/pn-marketweb-search.js.map +1 -1
  352. package/components/pn-marketweb-sitefooter.js +17 -23
  353. package/components/pn-marketweb-sitefooter.js.map +1 -1
  354. package/components/pn-marketweb-siteheader-login-button2.js +2 -1
  355. package/components/pn-marketweb-siteheader-login-button2.js.map +1 -1
  356. package/components/pn-marketweb-siteheader-login-linklist2.js +5 -5
  357. package/components/pn-marketweb-siteheader-login-linklist2.js.map +1 -1
  358. package/components/pn-marketweb-siteheader-login-links2.js +6 -8
  359. package/components/pn-marketweb-siteheader-login-links2.js.map +1 -1
  360. package/components/pn-marketweb-siteheader-login-mypage-button2.js +1 -1
  361. package/components/pn-marketweb-siteheader-login-mypage-button2.js.map +1 -1
  362. package/components/pn-marketweb-siteheader-login-profileselection2.js +7 -9
  363. package/components/pn-marketweb-siteheader-login-profileselection2.js.map +1 -1
  364. package/components/pn-marketweb-siteheader-login2.js +67 -68
  365. package/components/pn-marketweb-siteheader-login2.js.map +1 -1
  366. package/components/pn-marketweb-siteheader-search2.js +3 -3
  367. package/components/pn-marketweb-siteheader-search2.js.map +1 -1
  368. package/components/pn-marketweb-siteheader-unified-login2.js +1 -1
  369. package/components/pn-marketweb-siteheader-unified-login2.js.map +1 -1
  370. package/components/pn-marketweb-siteheader.js +21 -26
  371. package/components/pn-marketweb-siteheader.js.map +1 -1
  372. package/components/pn-media-block.js +31 -29
  373. package/components/pn-media-block.js.map +1 -1
  374. package/components/pn-multi-row-connected-dropdown-row2.js +37 -45
  375. package/components/pn-multi-row-connected-dropdown-row2.js.map +1 -1
  376. package/components/pn-multi-row-connected-dropdown.js +39 -33
  377. package/components/pn-multi-row-connected-dropdown.js.map +1 -1
  378. package/components/pn-multiple-input.js +9 -6
  379. package/components/pn-multiple-input.js.map +1 -1
  380. package/components/pn-parcel-tracker.js +1 -1
  381. package/components/pn-parcel-tracker.js.map +1 -1
  382. package/components/pn-pex-pricefinder.js +1 -1
  383. package/components/pn-pex-pricefinder.js.map +1 -1
  384. package/components/pn-play-on-scroll2.js +19 -17
  385. package/components/pn-play-on-scroll2.js.map +1 -1
  386. package/components/pn-product-pricelist.js +2 -3
  387. package/components/pn-product-pricelist.js.map +1 -1
  388. package/components/pn-profile-modal-customernumber.js +2 -1
  389. package/components/pn-profile-modal-customernumber.js.map +1 -1
  390. package/components/pn-profile-modal-profile.js +3 -1
  391. package/components/pn-profile-modal-profile.js.map +1 -1
  392. package/components/pn-profile-modal-type.js +1 -1
  393. package/components/pn-profile-modal-type.js.map +1 -1
  394. package/components/pn-profile-modal.js +1 -1
  395. package/components/pn-profile-modal.js.map +1 -1
  396. package/components/pn-profile-selector-option.js +1 -1
  397. package/components/pn-profile-selector-option.js.map +1 -1
  398. package/components/pn-profile-selector.js +1 -1
  399. package/components/pn-profile-selector.js.map +1 -1
  400. package/components/pn-proxio-findprice-result2.js +8 -12
  401. package/components/pn-proxio-findprice-result2.js.map +1 -1
  402. package/components/pn-proxio-findprice.js +15 -22
  403. package/components/pn-proxio-findprice.js.map +1 -1
  404. package/components/pn-proxio-pricegroup.js +8 -12
  405. package/components/pn-proxio-pricegroup.js.map +1 -1
  406. package/components/pn-quick-cta.js +1 -1
  407. package/components/pn-quick-cta.js.map +1 -1
  408. package/components/pn-quote-card.js +1 -1
  409. package/components/pn-quote-card.js.map +1 -1
  410. package/components/pn-scroll2.js +5 -5
  411. package/components/pn-scroll2.js.map +1 -1
  412. package/components/pn-share-item2.js +1 -1
  413. package/components/pn-share-item2.js.map +1 -1
  414. package/components/pn-share.js +1 -1
  415. package/components/pn-share.js.map +1 -1
  416. package/components/pn-sidenav-level.js +3 -4
  417. package/components/pn-sidenav-level.js.map +1 -1
  418. package/components/pn-sidenav-link.js +2 -2
  419. package/components/pn-sidenav-link.js.map +1 -1
  420. package/components/pn-sidenav-togglebutton.js +1 -1
  421. package/components/pn-sidenav-togglebutton.js.map +1 -1
  422. package/components/pn-sidenav.js +1 -1
  423. package/components/pn-sidenav.js.map +1 -1
  424. package/components/pn-site-selector2.js +1 -1
  425. package/components/pn-site-selector2.js.map +1 -1
  426. package/components/pn-spotlight.js +1 -1
  427. package/components/pn-spotlight.js.map +1 -1
  428. package/components/pn-stats-info-data2.js +5 -5
  429. package/components/pn-stats-info-data2.js.map +1 -1
  430. package/components/pn-swan2.js +1 -1
  431. package/components/pn-swan2.js.map +1 -1
  432. package/components/pn-teaser-card.js +2 -3
  433. package/components/pn-teaser-card.js.map +1 -1
  434. package/components/pn-titletag2.js +1 -1
  435. package/components/pn-titletag2.js.map +1 -1
  436. package/components/pn-usp-promoter.js +1 -1
  437. package/components/pn-usp-promoter.js.map +1 -1
  438. package/components/pn-video-overlay2.js +11 -10
  439. package/components/pn-video-overlay2.js.map +1 -1
  440. package/esm/{FetchHelper-03b37a44.js → FetchHelper-da579b12.js} +122 -123
  441. package/esm/FetchHelper-da579b12.js.map +1 -0
  442. package/esm/loader.js +1 -1
  443. package/esm/pn-address-autofill.entry.js +48 -50
  444. package/esm/pn-address-autofill.entry.js.map +1 -1
  445. package/esm/pn-animated-tile.entry.js +5 -5
  446. package/esm/pn-animated-tile.entry.js.map +1 -1
  447. package/esm/pn-app-banner.entry.js +16 -16
  448. package/esm/pn-app-banner.entry.js.map +1 -1
  449. package/esm/pn-bonus-progressbar-level.entry.js +2 -2
  450. package/esm/pn-bonus-progressbar-level.entry.js.map +1 -1
  451. package/esm/pn-bonus-progressbar.entry.js +2 -2
  452. package/esm/pn-bonus-progressbar.entry.js.map +1 -1
  453. package/esm/pn-breakpoints.entry.js +2 -2
  454. package/esm/pn-breakpoints.entry.js.map +1 -1
  455. package/esm/pn-chart.entry.js +48 -11
  456. package/esm/pn-chart.entry.js.map +1 -1
  457. package/esm/pn-charts-card.entry.js +8 -8
  458. package/esm/pn-charts-card.entry.js.map +1 -1
  459. package/esm/pn-choice-button.entry.js +2 -2
  460. package/esm/pn-choice-button.entry.js.map +1 -1
  461. package/esm/pn-cta-block.entry.js +2 -2
  462. package/esm/pn-cta-block.entry.js.map +1 -1
  463. package/esm/pn-customernumber-selector-option.entry.js +2 -2
  464. package/esm/pn-customernumber-selector-option.entry.js.map +1 -1
  465. package/esm/pn-customernumber-selector.entry.js +2 -2
  466. package/esm/pn-customernumber-selector.entry.js.map +1 -1
  467. package/esm/pn-date-and-time.entry.js +14 -16
  468. package/esm/pn-date-and-time.entry.js.map +1 -1
  469. package/esm/pn-dropdown-choice-adds-row.entry.js +34 -37
  470. package/esm/pn-dropdown-choice-adds-row.entry.js.map +1 -1
  471. package/esm/pn-dropdown-with-multi-input-rows-row.entry.js +14 -11
  472. package/esm/pn-dropdown-with-multi-input-rows-row.entry.js.map +1 -1
  473. package/esm/pn-dropdown-with-multi-input-rows.entry.js +47 -41
  474. package/esm/pn-dropdown-with-multi-input-rows.entry.js.map +1 -1
  475. package/esm/pn-filter-checkbox.entry.js +3 -4
  476. package/esm/pn-filter-checkbox.entry.js.map +1 -1
  477. package/esm/pn-find-price.entry.js +1 -2
  478. package/esm/pn-find-price.entry.js.map +1 -1
  479. package/esm/pn-find-service-and-price.entry.js +2 -3
  480. package/esm/pn-find-service-and-price.entry.js.map +1 -1
  481. package/esm/pn-hero-block-international.entry.js +4 -4
  482. package/esm/pn-hero-block-international.entry.js.map +1 -1
  483. package/esm/pn-language-selector_9.entry.js +84 -80
  484. package/esm/pn-language-selector_9.entry.js.map +1 -1
  485. package/esm/pn-line-shape.entry.js +2 -2
  486. package/esm/pn-line-shape.entry.js.map +1 -1
  487. package/esm/pn-link-list.entry.js +33 -37
  488. package/esm/pn-link-list.entry.js.map +1 -1
  489. package/esm/pn-mainnav-link.entry.js +3 -3
  490. package/esm/pn-mainnav-link.entry.js.map +1 -1
  491. package/esm/pn-market-web-components.js +1 -1
  492. package/esm/pn-marketweb-input.entry.js +1 -2
  493. package/esm/pn-marketweb-input.entry.js.map +1 -1
  494. package/esm/pn-marketweb-search.entry.js +6 -2
  495. package/esm/pn-marketweb-search.entry.js.map +1 -1
  496. package/esm/pn-marketweb-sitefooter.entry.js +19 -25
  497. package/esm/pn-marketweb-sitefooter.entry.js.map +1 -1
  498. package/esm/pn-marketweb-siteheader-login-button_5.entry.js +18 -21
  499. package/esm/pn-marketweb-siteheader-login-button_5.entry.js.map +1 -1
  500. package/esm/pn-marketweb-siteheader-login-linklist.entry.js +6 -6
  501. package/esm/pn-marketweb-siteheader-login-linklist.entry.js.map +1 -1
  502. package/esm/pn-marketweb-siteheader.entry.js +23 -28
  503. package/esm/pn-marketweb-siteheader.entry.js.map +1 -1
  504. package/esm/pn-media-block.entry.js +32 -30
  505. package/esm/pn-media-block.entry.js.map +1 -1
  506. package/esm/pn-multi-row-connected-dropdown-row.entry.js +38 -46
  507. package/esm/pn-multi-row-connected-dropdown-row.entry.js.map +1 -1
  508. package/esm/pn-multi-row-connected-dropdown.entry.js +40 -34
  509. package/esm/pn-multi-row-connected-dropdown.entry.js.map +1 -1
  510. package/esm/pn-multiple-input.entry.js +10 -7
  511. package/esm/pn-multiple-input.entry.js.map +1 -1
  512. package/esm/pn-parcel-tracker.entry.js +2 -2
  513. package/esm/pn-parcel-tracker.entry.js.map +1 -1
  514. package/esm/pn-pex-pricefinder.entry.js +2 -2
  515. package/esm/pn-pex-pricefinder.entry.js.map +1 -1
  516. package/esm/pn-play-on-scroll.entry.js +20 -18
  517. package/esm/pn-play-on-scroll.entry.js.map +1 -1
  518. package/esm/pn-product-pricelist.entry.js +2 -3
  519. package/esm/pn-product-pricelist.entry.js.map +1 -1
  520. package/esm/pn-profile-modal-customernumber.entry.js +3 -2
  521. package/esm/pn-profile-modal-customernumber.entry.js.map +1 -1
  522. package/esm/pn-profile-modal-profile.entry.js +4 -2
  523. package/esm/pn-profile-modal-profile.entry.js.map +1 -1
  524. package/esm/pn-profile-modal-type.entry.js +2 -2
  525. package/esm/pn-profile-modal-type.entry.js.map +1 -1
  526. package/esm/pn-profile-modal.entry.js +2 -2
  527. package/esm/pn-profile-modal.entry.js.map +1 -1
  528. package/esm/pn-profile-selector-option.entry.js +2 -2
  529. package/esm/pn-profile-selector-option.entry.js.map +1 -1
  530. package/esm/pn-profile-selector.entry.js +2 -2
  531. package/esm/pn-profile-selector.entry.js.map +1 -1
  532. package/esm/pn-proxio-findprice-result.entry.js +8 -12
  533. package/esm/pn-proxio-findprice-result.entry.js.map +1 -1
  534. package/esm/pn-proxio-findprice.entry.js +16 -23
  535. package/esm/pn-proxio-findprice.entry.js.map +1 -1
  536. package/esm/pn-proxio-pricegroup.entry.js +9 -13
  537. package/esm/pn-proxio-pricegroup.entry.js.map +1 -1
  538. package/esm/pn-quick-cta.entry.js +2 -2
  539. package/esm/pn-quick-cta.entry.js.map +1 -1
  540. package/esm/pn-quote-card.entry.js +2 -2
  541. package/esm/pn-quote-card.entry.js.map +1 -1
  542. package/esm/pn-scroll_2.entry.js +17 -16
  543. package/esm/pn-scroll_2.entry.js.map +1 -1
  544. package/esm/pn-share-item.entry.js +2 -2
  545. package/esm/pn-share-item.entry.js.map +1 -1
  546. package/esm/pn-share.entry.js +2 -2
  547. package/esm/pn-share.entry.js.map +1 -1
  548. package/esm/pn-sidenav-level.entry.js +4 -5
  549. package/esm/pn-sidenav-level.entry.js.map +1 -1
  550. package/esm/pn-sidenav-link.entry.js +3 -3
  551. package/esm/pn-sidenav-link.entry.js.map +1 -1
  552. package/esm/pn-sidenav-togglebutton.entry.js +2 -2
  553. package/esm/pn-sidenav-togglebutton.entry.js.map +1 -1
  554. package/esm/pn-sidenav.entry.js +2 -2
  555. package/esm/pn-sidenav.entry.js.map +1 -1
  556. package/esm/pn-site-footer_3.entry.js +1 -1
  557. package/esm/pn-site-footer_3.entry.js.map +1 -1
  558. package/esm/pn-spotlight.entry.js +2 -2
  559. package/esm/pn-spotlight.entry.js.map +1 -1
  560. package/esm/pn-stats-info-data.entry.js +5 -5
  561. package/esm/pn-stats-info-data.entry.js.map +1 -1
  562. package/esm/pn-teaser-card.entry.js +3 -4
  563. package/esm/pn-teaser-card.entry.js.map +1 -1
  564. package/esm/pn-titletag.entry.js +2 -2
  565. package/esm/pn-titletag.entry.js.map +1 -1
  566. package/esm/pn-usp-promoter.entry.js +2 -2
  567. package/esm/pn-usp-promoter.entry.js.map +1 -1
  568. package/package.json +1 -2
  569. package/pn-market-web-components/{p-8ca34ec3.entry.js → p-0247c553.entry.js} +2 -2
  570. package/pn-market-web-components/p-0247c553.entry.js.map +1 -0
  571. package/pn-market-web-components/{p-3f50be05.entry.js → p-09b9cc06.entry.js} +2 -2
  572. package/pn-market-web-components/{p-3f50be05.entry.js.map → p-09b9cc06.entry.js.map} +1 -1
  573. package/pn-market-web-components/{p-03dfc155.entry.js → p-0a522476.entry.js} +2 -2
  574. package/pn-market-web-components/{p-03dfc155.entry.js.map → p-0a522476.entry.js.map} +1 -1
  575. package/pn-market-web-components/{p-2b2b615e.entry.js → p-1317587f.entry.js} +4 -4
  576. package/pn-market-web-components/{p-2b2b615e.entry.js.map → p-1317587f.entry.js.map} +1 -1
  577. package/pn-market-web-components/p-1535a09f.entry.js +2 -0
  578. package/pn-market-web-components/p-1535a09f.entry.js.map +1 -0
  579. package/pn-market-web-components/{p-470ca6e7.entry.js → p-1578e02e.entry.js} +2 -2
  580. package/pn-market-web-components/{p-470ca6e7.entry.js.map → p-1578e02e.entry.js.map} +1 -1
  581. package/pn-market-web-components/p-16f70311.entry.js +2 -0
  582. package/pn-market-web-components/{p-b7a5fb1b.entry.js.map → p-16f70311.entry.js.map} +1 -1
  583. package/pn-market-web-components/{p-c8bbdd96.entry.js → p-190c671b.entry.js} +2 -2
  584. package/pn-market-web-components/{p-c8bbdd96.entry.js.map → p-190c671b.entry.js.map} +1 -1
  585. package/pn-market-web-components/{p-3e4208bb.entry.js → p-1bd5fa26.entry.js} +2 -2
  586. package/pn-market-web-components/{p-3e4208bb.entry.js.map → p-1bd5fa26.entry.js.map} +1 -1
  587. package/pn-market-web-components/{p-e74e962e.entry.js → p-2044eddc.entry.js} +2 -2
  588. package/pn-market-web-components/{p-e74e962e.entry.js.map → p-2044eddc.entry.js.map} +1 -1
  589. package/pn-market-web-components/p-370829c6.entry.js +2 -0
  590. package/pn-market-web-components/p-370829c6.entry.js.map +1 -0
  591. package/pn-market-web-components/p-391970af.entry.js +2 -0
  592. package/pn-market-web-components/p-391970af.entry.js.map +1 -0
  593. package/pn-market-web-components/{p-49fd7182.entry.js → p-40538914.entry.js} +2 -2
  594. package/pn-market-web-components/{p-49fd7182.entry.js.map → p-40538914.entry.js.map} +1 -1
  595. package/pn-market-web-components/{p-fa9ea740.entry.js → p-4372d10e.entry.js} +2 -2
  596. package/pn-market-web-components/p-4372d10e.entry.js.map +1 -0
  597. package/pn-market-web-components/p-4ea1409d.entry.js +2 -0
  598. package/pn-market-web-components/p-4ea1409d.entry.js.map +1 -0
  599. package/pn-market-web-components/{p-66981606.entry.js → p-56bd346e.entry.js} +2 -2
  600. package/pn-market-web-components/{p-66981606.entry.js.map → p-56bd346e.entry.js.map} +1 -1
  601. package/pn-market-web-components/p-586a1e3c.entry.js +2 -0
  602. package/pn-market-web-components/{p-f8eb860b.entry.js.map → p-586a1e3c.entry.js.map} +1 -1
  603. package/pn-market-web-components/{p-baa28521.entry.js → p-5a467ca6.entry.js} +2 -2
  604. package/pn-market-web-components/{p-baa28521.entry.js.map → p-5a467ca6.entry.js.map} +1 -1
  605. package/pn-market-web-components/p-5ac23b38.entry.js +2 -0
  606. package/pn-market-web-components/p-5ac23b38.entry.js.map +1 -0
  607. package/pn-market-web-components/{p-7fdc49d1.entry.js → p-63505736.entry.js} +2 -2
  608. package/pn-market-web-components/p-63505736.entry.js.map +1 -0
  609. package/pn-market-web-components/{p-3696ebf8.entry.js → p-67d862ac.entry.js} +2 -2
  610. package/pn-market-web-components/{p-3696ebf8.entry.js.map → p-67d862ac.entry.js.map} +1 -1
  611. package/pn-market-web-components/{p-3d3f0648.entry.js → p-68aa55f7.entry.js} +2 -2
  612. package/pn-market-web-components/{p-3d3f0648.entry.js.map → p-68aa55f7.entry.js.map} +1 -1
  613. package/pn-market-web-components/{p-d2109ea6.entry.js → p-6e9875e5.entry.js} +2 -2
  614. package/pn-market-web-components/p-6e9875e5.entry.js.map +1 -0
  615. package/pn-market-web-components/p-7021985c.entry.js +2 -0
  616. package/pn-market-web-components/{p-c64cb117.entry.js.map → p-7021985c.entry.js.map} +1 -1
  617. package/pn-market-web-components/{p-716165d2.entry.js → p-721598b8.entry.js} +2 -2
  618. package/pn-market-web-components/p-721598b8.entry.js.map +1 -0
  619. package/pn-market-web-components/p-73cef33c.js +2 -0
  620. package/pn-market-web-components/p-73cef33c.js.map +1 -0
  621. package/pn-market-web-components/p-74203d3e.entry.js +2 -0
  622. package/pn-market-web-components/{p-545ea4ef.entry.js.map → p-74203d3e.entry.js.map} +1 -1
  623. package/pn-market-web-components/p-781ef432.entry.js +2 -0
  624. package/pn-market-web-components/p-781ef432.entry.js.map +1 -0
  625. package/pn-market-web-components/{p-3a08299c.entry.js → p-78fbc88c.entry.js} +2 -2
  626. package/pn-market-web-components/{p-3a08299c.entry.js.map → p-78fbc88c.entry.js.map} +1 -1
  627. package/pn-market-web-components/{p-22a65c3e.entry.js → p-796ebfee.entry.js} +2 -2
  628. package/pn-market-web-components/p-796ebfee.entry.js.map +1 -0
  629. package/pn-market-web-components/p-7b05d7c7.entry.js +2 -0
  630. package/pn-market-web-components/p-7b05d7c7.entry.js.map +1 -0
  631. package/pn-market-web-components/{p-6b2009dc.entry.js → p-81b3e038.entry.js} +2 -2
  632. package/pn-market-web-components/{p-6b2009dc.entry.js.map → p-81b3e038.entry.js.map} +1 -1
  633. package/pn-market-web-components/p-828449da.entry.js +2 -0
  634. package/pn-market-web-components/{p-db2f3f6d.entry.js.map → p-828449da.entry.js.map} +1 -1
  635. package/pn-market-web-components/p-85d57c9d.entry.js +2 -0
  636. package/pn-market-web-components/p-85d57c9d.entry.js.map +1 -0
  637. package/pn-market-web-components/p-90ba1d8e.entry.js +2 -0
  638. package/pn-market-web-components/{p-655e6f71.entry.js.map → p-90ba1d8e.entry.js.map} +1 -1
  639. package/pn-market-web-components/{p-eee5ec0a.entry.js → p-931d3a9b.entry.js} +2 -2
  640. package/pn-market-web-components/{p-eee5ec0a.entry.js.map → p-931d3a9b.entry.js.map} +1 -1
  641. package/pn-market-web-components/{p-9a93bcd0.entry.js → p-95c10b7e.entry.js} +2 -2
  642. package/pn-market-web-components/{p-9a93bcd0.entry.js.map → p-95c10b7e.entry.js.map} +1 -1
  643. package/pn-market-web-components/{p-138ecede.entry.js → p-95e054fd.entry.js} +2 -2
  644. package/pn-market-web-components/{p-138ecede.entry.js.map → p-95e054fd.entry.js.map} +1 -1
  645. package/pn-market-web-components/p-9776a1c5.entry.js +2 -0
  646. package/pn-market-web-components/p-9776a1c5.entry.js.map +1 -0
  647. package/pn-market-web-components/{p-db2e2762.entry.js → p-9998c29d.entry.js} +2 -2
  648. package/pn-market-web-components/p-9998c29d.entry.js.map +1 -0
  649. package/pn-market-web-components/p-9a7abcee.entry.js +2 -0
  650. package/pn-market-web-components/p-9a7abcee.entry.js.map +1 -0
  651. package/pn-market-web-components/{p-0dca82de.entry.js → p-9be27d72.entry.js} +2 -2
  652. package/pn-market-web-components/{p-0dca82de.entry.js.map → p-9be27d72.entry.js.map} +1 -1
  653. package/pn-market-web-components/{p-48f6e683.entry.js → p-a8220c88.entry.js} +2 -2
  654. package/pn-market-web-components/{p-48f6e683.entry.js.map → p-a8220c88.entry.js.map} +1 -1
  655. package/pn-market-web-components/p-a9d2f528.entry.js +2 -0
  656. package/pn-market-web-components/p-a9d2f528.entry.js.map +1 -0
  657. package/pn-market-web-components/p-acbe60df.entry.js +2 -0
  658. package/pn-market-web-components/p-acbe60df.entry.js.map +1 -0
  659. package/pn-market-web-components/{p-5666f0e7.entry.js → p-ade7ffcf.entry.js} +2 -2
  660. package/pn-market-web-components/p-ade7ffcf.entry.js.map +1 -0
  661. package/pn-market-web-components/p-b2dcce7c.entry.js +2 -0
  662. package/pn-market-web-components/p-b2dcce7c.entry.js.map +1 -0
  663. package/pn-market-web-components/{p-10a3c6f4.entry.js → p-b765e4a9.entry.js} +2 -2
  664. package/pn-market-web-components/p-b765e4a9.entry.js.map +1 -0
  665. package/pn-market-web-components/{p-914e1d15.entry.js → p-c224d7c4.entry.js} +2 -2
  666. package/pn-market-web-components/p-c224d7c4.entry.js.map +1 -0
  667. package/pn-market-web-components/{p-787e20a1.entry.js → p-c5856c0b.entry.js} +2 -2
  668. package/pn-market-web-components/{p-787e20a1.entry.js.map → p-c5856c0b.entry.js.map} +1 -1
  669. package/pn-market-web-components/p-c696bedf.entry.js +2 -0
  670. package/pn-market-web-components/{p-012ee486.entry.js.map → p-c696bedf.entry.js.map} +1 -1
  671. package/pn-market-web-components/p-c9f21ea3.entry.js +2 -0
  672. package/pn-market-web-components/{p-03cb46c2.entry.js.map → p-c9f21ea3.entry.js.map} +1 -1
  673. package/pn-market-web-components/{p-87aa1f73.entry.js → p-d07cf4c8.entry.js} +2 -2
  674. package/pn-market-web-components/{p-87aa1f73.entry.js.map → p-d07cf4c8.entry.js.map} +1 -1
  675. package/pn-market-web-components/p-d40ff187.entry.js +2 -0
  676. package/pn-market-web-components/p-d40ff187.entry.js.map +1 -0
  677. package/pn-market-web-components/{p-f21fdae0.entry.js → p-e42f0fbe.entry.js} +2 -2
  678. package/pn-market-web-components/{p-f21fdae0.entry.js.map → p-e42f0fbe.entry.js.map} +1 -1
  679. package/pn-market-web-components/{p-4f2a7d41.entry.js → p-e4c7aaec.entry.js} +2 -2
  680. package/pn-market-web-components/{p-4f2a7d41.entry.js.map → p-e4c7aaec.entry.js.map} +1 -1
  681. package/pn-market-web-components/{p-107568aa.entry.js → p-e5345c69.entry.js} +2 -2
  682. package/pn-market-web-components/p-e5345c69.entry.js.map +1 -0
  683. package/pn-market-web-components/p-e9501c6f.entry.js +2 -0
  684. package/pn-market-web-components/p-e9501c6f.entry.js.map +1 -0
  685. package/pn-market-web-components/{p-fa3ccbfb.entry.js → p-ebaeee5e.entry.js} +2 -2
  686. package/pn-market-web-components/{p-fa3ccbfb.entry.js.map → p-ebaeee5e.entry.js.map} +1 -1
  687. package/pn-market-web-components/{p-9de267ec.entry.js → p-f2d0d0cc.entry.js} +2 -2
  688. package/pn-market-web-components/{p-9de267ec.entry.js.map → p-f2d0d0cc.entry.js.map} +1 -1
  689. package/pn-market-web-components/{p-da953848.entry.js → p-f62879f6.entry.js} +2 -2
  690. package/pn-market-web-components/p-f62879f6.entry.js.map +1 -0
  691. package/pn-market-web-components/{p-ec3fcbf9.entry.js → p-fbc07c7a.entry.js} +2 -2
  692. package/pn-market-web-components/{p-ec3fcbf9.entry.js.map → p-fbc07c7a.entry.js.map} +1 -1
  693. package/pn-market-web-components/p-fbe70284.entry.js +2 -0
  694. package/pn-market-web-components/{p-663e4bb8.entry.js.map → p-fbe70284.entry.js.map} +1 -1
  695. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  696. package/pn-market-web-components/pn-market-web-components.esm.js.map +1 -1
  697. package/types/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.d.ts +1 -0
  698. package/types/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.d.ts +1 -1
  699. package/types/components.d.ts +2 -0
  700. package/umd/pn-marketweb-init.js +1 -1
  701. package/umd/pn-marketweb-salesforce.js +1 -1
  702. package/umd/standalone-loader-salesforce.js +3 -3
  703. package/umd/standalone-loader.js +2 -2
  704. package/cjs/FetchHelper-8d537d38.js.map +0 -1
  705. package/esm/FetchHelper-03b37a44.js.map +0 -1
  706. package/pn-market-web-components/p-012ee486.entry.js +0 -2
  707. package/pn-market-web-components/p-03cb46c2.entry.js +0 -2
  708. package/pn-market-web-components/p-07253be3.entry.js +0 -2
  709. package/pn-market-web-components/p-07253be3.entry.js.map +0 -1
  710. package/pn-market-web-components/p-08a64973.entry.js +0 -2
  711. package/pn-market-web-components/p-08a64973.entry.js.map +0 -1
  712. package/pn-market-web-components/p-107568aa.entry.js.map +0 -1
  713. package/pn-market-web-components/p-10a3c6f4.entry.js.map +0 -1
  714. package/pn-market-web-components/p-161970d1.entry.js +0 -2
  715. package/pn-market-web-components/p-161970d1.entry.js.map +0 -1
  716. package/pn-market-web-components/p-22a65c3e.entry.js.map +0 -1
  717. package/pn-market-web-components/p-2ac83614.entry.js +0 -2
  718. package/pn-market-web-components/p-2ac83614.entry.js.map +0 -1
  719. package/pn-market-web-components/p-2fd40198.entry.js +0 -2
  720. package/pn-market-web-components/p-2fd40198.entry.js.map +0 -1
  721. package/pn-market-web-components/p-3ae1657a.entry.js +0 -2
  722. package/pn-market-web-components/p-3ae1657a.entry.js.map +0 -1
  723. package/pn-market-web-components/p-545ea4ef.entry.js +0 -2
  724. package/pn-market-web-components/p-5666f0e7.entry.js.map +0 -1
  725. package/pn-market-web-components/p-5ff663be.entry.js +0 -2
  726. package/pn-market-web-components/p-5ff663be.entry.js.map +0 -1
  727. package/pn-market-web-components/p-655e6f71.entry.js +0 -2
  728. package/pn-market-web-components/p-657957fc.entry.js +0 -2
  729. package/pn-market-web-components/p-657957fc.entry.js.map +0 -1
  730. package/pn-market-web-components/p-663e4bb8.entry.js +0 -2
  731. package/pn-market-web-components/p-716165d2.entry.js.map +0 -1
  732. package/pn-market-web-components/p-7fdc49d1.entry.js.map +0 -1
  733. package/pn-market-web-components/p-8ca34ec3.entry.js.map +0 -1
  734. package/pn-market-web-components/p-914e1d15.entry.js.map +0 -1
  735. package/pn-market-web-components/p-af16f7e3.entry.js +0 -2
  736. package/pn-market-web-components/p-af16f7e3.entry.js.map +0 -1
  737. package/pn-market-web-components/p-b7a5fb1b.entry.js +0 -2
  738. package/pn-market-web-components/p-be6e903e.entry.js +0 -2
  739. package/pn-market-web-components/p-be6e903e.entry.js.map +0 -1
  740. package/pn-market-web-components/p-bece6791.entry.js +0 -2
  741. package/pn-market-web-components/p-bece6791.entry.js.map +0 -1
  742. package/pn-market-web-components/p-c64cb117.entry.js +0 -2
  743. package/pn-market-web-components/p-c95def57.js +0 -2
  744. package/pn-market-web-components/p-c95def57.js.map +0 -1
  745. package/pn-market-web-components/p-d2109ea6.entry.js.map +0 -1
  746. package/pn-market-web-components/p-da0c533f.entry.js +0 -2
  747. package/pn-market-web-components/p-da0c533f.entry.js.map +0 -1
  748. package/pn-market-web-components/p-da953848.entry.js.map +0 -1
  749. package/pn-market-web-components/p-db2e2762.entry.js.map +0 -1
  750. package/pn-market-web-components/p-db2f3f6d.entry.js +0 -2
  751. package/pn-market-web-components/p-e0f4dc3d.entry.js +0 -2
  752. package/pn-market-web-components/p-e0f4dc3d.entry.js.map +0 -1
  753. package/pn-market-web-components/p-e8189227.entry.js +0 -2
  754. package/pn-market-web-components/p-e8189227.entry.js.map +0 -1
  755. package/pn-market-web-components/p-f8eb860b.entry.js +0 -2
  756. package/pn-market-web-components/p-fa9ea740.entry.js.map +0 -1
  757. package/pn-market-web-components/p-fd639f58.entry.js +0 -2
  758. package/pn-market-web-components/p-fd639f58.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"pn-find-price.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-find-price/pn-find-price.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAC5C,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAC5C,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAMtC,MAAM,OAAO,WAAW;;sBACG,YAAY;wBACO,IAAI;sBACN,IAAI;6BAED,EAAE;sBACZ,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAqB;2BAC7C,CAAC;0BACc,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;4BACtB,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAA2B;;IAEnH,iBAAiB;QACf,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,YAAY,GAAG,UAAU,IAAI,CAAC,KAAK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,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,EAC5G,OAAO,EAAE,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,EACzC,QAAQ,EAAE,GAAG,EAAE;oBACb,IAAI,CAAC,MAAM,GAAI,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC5G,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;gBACvC,CAAC,IAEA,IAAI,CAAC,IAAI,CACO,CACpB,CAAC,CACE,CAEJ,CACP,CAAC,CAAC,CAAC,IAAI;YAEP,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACrD,WAAK,KAAK,EAAC,YAAY;gBACpB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAK,KAAK,EAAC,eAAe,IAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAO,CAAC,CAAC,CAAC,IAAI;gBACrG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,CAClD;oBACE,4BAAsB,IAAI,EAAE,IAAI,GAAyB,CACrD,CACP,CAAC,CACE,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Watch } from '@stencil/core';\nimport { translations, markets } from './pn-find-price-translations';\nimport { ProductPriceSourceData, ProductPriceItem, FindPriceWeight, PnfindPriceMarket, PnfindPricei18n, FindPriceSizeCategory } from './pn-find-price-types';\nimport { weights, sizeCategories, fileLocation } from './data.js';\nimport { convertFileForSizeCategogy } from '../../../globals/shared/productprice/convert.js';\nimport { state } from './pn-find-price-store';\nimport small from './img/small-package.svg';\nimport medium from './img/medium-package.svg';\nimport large from './img/large-package.svg';\nimport person from './img/postnord-person1.svg';\nimport clouds from './img/clouds.svg';\n\n@Component({\n tag: 'pn-find-price',\n styleUrl: 'pn-find-price.scss',\n})\nexport class PnfindPrice {\n @Prop() source: string = fileLocation;\n @Prop({ mutable: true }) language: string = 'sv';\n @Prop({ mutable: true }) market: string = 'se';\n\n @State() filteredItems: ProductPriceItem[] = [];\n @State() weight: FindPriceWeight = { value: 0, name: '' } as FindPriceWeight;\n @State() weightvalue: number = 0;\n @State() sourceData: ProductPriceSourceData = { types: [], data: [] };\n @State() sizecategory: FindPriceSizeCategory = { value: '', name: '', icon: '', unit: '' } as FindPriceSizeCategory;\n\n componentWillLoad() {\n this.setState();\n this.getDataSource();\n }\n\n async getDataSource() {\n const cacheBusting = `?cache=${Math.floor(Math.random() * (10000 - 1) + 1)}`;\n const req = await fetch(this.source + cacheBusting);\n const reqbody = await req.blob();\n try {\n const convertedData = await convertFileForSizeCategogy(reqbody);\n this.sourceData = convertedData;\n\n //for keeping small value preselected\n this.sizecategory = (sizeCategories as FindPriceSizeCategory[]).filter(x => x.value === 'Small')[0];\n\n this.filterItems();\n } catch (e) {\n console.log('Unable to parse data');\n }\n }\n\n @Watch('market')\n @Watch('language')\n setState() {\n if (this.market) {\n state.market = markets[this.market] as PnfindPriceMarket;\n }\n if (this.language && translations[this.language]) {\n state.i18n = translations[this.language] as PnfindPricei18n;\n }\n }\n\n @Watch('sizecategory')\n @Watch('weightvalue')\n filterItems() {\n if (!this.sourceData?.data) {\n console.log('Data has not yet been loaded');\n return;\n }\n\n //to handle withing country search\n const deliveryScopeData = this.sourceData.data.filter(x => x.deliveryscope.toLocaleLowerCase() === state.market.country.toLocaleLowerCase());\n if (!this.sizecategory) {\n return;\n }\n\n const sizeItemData = deliveryScopeData.filter(x => x.sizecategory.toLocaleLowerCase() === this.sizecategory.value.toLocaleLowerCase());\n\n if (!this.weight) {\n return;\n }\n const comparisonWeight = this.weight.value <= 20 ? this.weight.value * 1000 : this.weight.value;\n\n let weightFilteredData = sizeItemData.filter(x => (x.maxweight <= 20 ? x.maxweight * 1000 : x.maxweight) === comparisonWeight);\n\n if (this.weightvalue !== 0) {\n let clubbedProducts = sizeItemData\n .filter(x => x.maxweight.toString().includes('upto'))\n .filter(x => Number(x.maxweight.toString().toLocaleLowerCase().replace('upto', '')) - comparisonWeight >= 0);\n weightFilteredData = weightFilteredData.concat(clubbedProducts);\n }\n\n if (weightFilteredData.length === 0 && this.weightvalue !== 0) {\n weightFilteredData = sizeItemData.filter(x => (x.maxweight <= 20 ? x.maxweight * 1000 : x.maxweight) >= comparisonWeight);\n\n if (weightFilteredData.length > 0) {\n //sort based on the maxvalue\n weightFilteredData.sort((a, b) => {\n return a.maxweight - b.maxweight;\n });\n\n // map to get the next unique item\n const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item['id'], item])).values()];\n if (uniqueWeightOptions.length > 0) {\n weightFilteredData = uniqueWeightOptions;\n }\n }\n }\n\n //10000 to handle the null values in the rank column, to keep such products at the end of the list\n weightFilteredData.sort((a, b) => {\n var ra = a.rank ? a.rank : 10000;\n var rb = b.rank ? b.rank : 10000;\n\n var ua = a.highestrankusp ? a.highestrankusp : 'z';\n var ub = b.highestrankusp ? b.highestrankusp : 'z';\n\n const compareUsp = ua.localeCompare(ub);\n const compareRank = ra - rb;\n\n return compareUsp || compareRank;\n });\n\n this.filteredItems = weightFilteredData;\n }\n\n render() {\n return (\n <div class=\"findprice-form\">\n <div>\n <h4 class=\"heading\">{state.i18n.sizeheading}</h4>\n <div class=\"sizecategory\">\n <table class=\"sizeTable\">\n <img id=\"clouds\" src={clouds}></img>\n <tr>\n <td>\n <img class=\"firstCell\" src={person}></img>\n </td>\n <td>\n <img src={small}></img>\n </td>\n <td>\n <img src={medium}></img>\n </td>\n <td>\n <img src={large}></img>\n </td>\n </tr>\n <tr>\n <td></td>\n {sizeCategories.map(sizeCategory => (\n <td>\n <pn-radio-button\n id={'findpricecategory-' + sizeCategory.value}\n radioid={sizeCategory.value}\n value={sizeCategory.value}\n name=\"sizecategory\"\n checked={sizeCategory.value === this.sizecategory.value}\n onChange={() => {\n this.sizecategory = (sizeCategories as FindPriceSizeCategory[]).filter(x => x.value === sizeCategory.value)[0];\n\n this.weight = { value: 0, name: '' } as FindPriceWeight;\n this.weightvalue = this.weight.value;\n }}\n ></pn-radio-button>\n </td>\n ))}\n </tr>\n </table>\n </div>\n </div>\n\n <h4 class=\"heading\">{state.i18n.weightheading}</h4>\n {this.sizecategory.value && weights[this.sizecategory.unit] ? (\n <div class=\"weightoption\">\n {\n <div class=\"weightoption-content\">\n {weights[this.sizecategory.unit].map(wght => (\n <pn-choice-button\n id={'findpriceweight-' + wght.value}\n choiceid={this.sizecategory.value + wght.value}\n name=\"weight\"\n type=\"radio\"\n value={!this.weight.value ? 0 : weights[this.sizecategory.unit].findIndex(x => x.value === this.weightvalue)}\n checked={wght.value === this.weight.value}\n onChange={() => {\n this.weight = (weights[this.sizecategory.unit] as FindPriceWeight[]).filter(x => x.value === wght.value)[0];\n this.weightvalue = this.weight.value;\n }}\n >\n {wght.name}\n </pn-choice-button>\n ))}\n </div>\n }\n </div>\n ) : null}\n\n {this.filteredItems && this.filteredItems.length > 0 ? (\n <div class=\"resultlist\">\n {state.i18n.resultlistheading ? <div class=\"resultHeading\">{state.i18n.resultlistheading}</div> : null}\n {this.filteredItems.map((item: ProductPriceItem) => (\n <div>\n <pn-find-price-result item={item}></pn-find-price-result>\n </div>\n ))}\n </div>\n ) : null}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pn-find-price.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-find-price/pn-find-price.tsx"],"names":[],"mappings":"AAAA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,CAAC,IAAI,CAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC5G,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;gBACvC,CAAC,IAEA,IAAI,CAAC,IAAI,CACO,CACpB,CAAC,CACE,CAEJ,CACP,CAAC,CAAC,CAAC,IAAI;YAEP,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACrD,WAAK,KAAK,EAAC,YAAY;gBACpB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAK,KAAK,EAAC,eAAe,IAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAO,CAAC,CAAC,CAAC,IAAI;gBACrG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,CAClD;oBACE,4BAAsB,IAAI,EAAE,IAAI,GAAyB,CACrD,CACP,CAAC,CACE,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Watch } from '@stencil/core';\nimport { translations, markets } from './pn-find-price-translations';\nimport { ProductPriceSourceData, ProductPriceItem, FindPriceWeight, PnfindPriceMarket, PnfindPricei18n, FindPriceSizeCategory } from './pn-find-price-types';\nimport { weights, sizeCategories, fileLocation } from './data.js';\nimport { convertFileForSizeCategogy } from '../../../globals/shared/productprice/convert.js';\nimport { state } from './pn-find-price-store';\nimport small from './img/small-package.svg';\nimport medium from './img/medium-package.svg';\nimport large from './img/large-package.svg';\nimport person from './img/postnord-person1.svg';\nimport clouds from './img/clouds.svg';\n\n@Component({\n tag: 'pn-find-price',\n styleUrl: 'pn-find-price.scss',\n})\nexport class PnfindPrice {\n @Prop() source: string = fileLocation;\n @Prop({ mutable: true }) language: string = 'sv';\n @Prop({ mutable: true }) market: string = 'se';\n\n @State() filteredItems: ProductPriceItem[] = [];\n @State() weight: FindPriceWeight = { value: 0, name: '' } as FindPriceWeight;\n @State() weightvalue: number = 0;\n @State() sourceData: ProductPriceSourceData = { types: [], data: [] };\n @State() sizecategory: FindPriceSizeCategory = { value: '', name: '', icon: '', unit: '' } as FindPriceSizeCategory;\n\n componentWillLoad() {\n this.setState();\n this.getDataSource();\n }\n\n async getDataSource() {\n const cacheBusting = `?cache=${Math.floor(Math.random() * (10000 - 1) + 1)}`;\n const req = await fetch(this.source + cacheBusting);\n const reqbody = await req.blob();\n try {\n const convertedData = await convertFileForSizeCategogy(reqbody);\n this.sourceData = convertedData;\n\n //for keeping small value preselected\n this.sizecategory = (sizeCategories as FindPriceSizeCategory[]).filter(x => x.value === 'Small')[0];\n\n this.filterItems();\n } catch (e) {\n console.log('Unable to parse data');\n }\n }\n\n @Watch('market')\n @Watch('language')\n setState() {\n if (this.market) {\n state.market = markets[this.market] as PnfindPriceMarket;\n }\n if (this.language && translations[this.language]) {\n state.i18n = translations[this.language] as PnfindPricei18n;\n }\n }\n\n @Watch('sizecategory')\n @Watch('weightvalue')\n filterItems() {\n if (!this.sourceData?.data) {\n console.log('Data has not yet been loaded');\n return;\n }\n\n //to handle withing country search\n const deliveryScopeData = this.sourceData.data.filter(x => x.deliveryscope.toLocaleLowerCase() === state.market.country.toLocaleLowerCase());\n if (!this.sizecategory) {\n return;\n }\n\n const sizeItemData = deliveryScopeData.filter(x => x.sizecategory.toLocaleLowerCase() === this.sizecategory.value.toLocaleLowerCase());\n\n if (!this.weight) {\n return;\n }\n const comparisonWeight = this.weight.value <= 20 ? this.weight.value * 1000 : this.weight.value;\n\n let weightFilteredData = sizeItemData.filter(x => (x.maxweight <= 20 ? x.maxweight * 1000 : x.maxweight) === comparisonWeight);\n\n if (this.weightvalue !== 0) {\n let clubbedProducts = sizeItemData\n .filter(x => x.maxweight.toString().includes('upto'))\n .filter(x => Number(x.maxweight.toString().toLocaleLowerCase().replace('upto', '')) - comparisonWeight >= 0);\n weightFilteredData = weightFilteredData.concat(clubbedProducts);\n }\n\n if (weightFilteredData.length === 0 && this.weightvalue !== 0) {\n weightFilteredData = sizeItemData.filter(x => (x.maxweight <= 20 ? x.maxweight * 1000 : x.maxweight) >= comparisonWeight);\n\n if (weightFilteredData.length > 0) {\n //sort based on the maxvalue\n weightFilteredData.sort((a, b) => {\n return a.maxweight - b.maxweight;\n });\n\n // map to get the next unique item\n const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item['id'], item])).values()];\n if (uniqueWeightOptions.length > 0) {\n weightFilteredData = uniqueWeightOptions;\n }\n }\n }\n\n //10000 to handle the null values in the rank column, to keep such products at the end of the list\n weightFilteredData.sort((a, b) => {\n var ra = a.rank ? a.rank : 10000;\n var rb = b.rank ? b.rank : 10000;\n\n var ua = a.highestrankusp ? a.highestrankusp : 'z';\n var ub = b.highestrankusp ? b.highestrankusp : 'z';\n\n const compareUsp = ua.localeCompare(ub);\n const compareRank = ra - rb;\n\n return compareUsp || compareRank;\n });\n\n this.filteredItems = weightFilteredData;\n }\n\n render() {\n return (\n <div class=\"findprice-form\">\n <div>\n <h4 class=\"heading\">{state.i18n.sizeheading}</h4>\n <div class=\"sizecategory\">\n <table class=\"sizeTable\">\n <img id=\"clouds\" src={clouds}></img>\n <tr>\n <td>\n <img class=\"firstCell\" src={person}></img>\n </td>\n <td>\n <img src={small}></img>\n </td>\n <td>\n <img src={medium}></img>\n </td>\n <td>\n <img src={large}></img>\n </td>\n </tr>\n <tr>\n <td></td>\n {sizeCategories.map(sizeCategory => (\n <td>\n <pn-radio-button\n id={'findpricecategory-' + sizeCategory.value}\n radioid={sizeCategory.value}\n value={sizeCategory.value}\n name=\"sizecategory\"\n checked={sizeCategory.value === this.sizecategory.value}\n onChange={() => {\n this.sizecategory = (sizeCategories as FindPriceSizeCategory[]).filter(x => x.value === sizeCategory.value)[0];\n\n this.weight = { value: 0, name: '' } as FindPriceWeight;\n this.weightvalue = this.weight.value;\n }}\n ></pn-radio-button>\n </td>\n ))}\n </tr>\n </table>\n </div>\n </div>\n\n <h4 class=\"heading\">{state.i18n.weightheading}</h4>\n {this.sizecategory.value && weights[this.sizecategory.unit] ? (\n <div class=\"weightoption\">\n {\n <div class=\"weightoption-content\">\n {weights[this.sizecategory.unit].map(wght => (\n <pn-choice-button\n id={'findpriceweight-' + wght.value}\n choiceid={this.sizecategory.value + wght.value}\n name=\"weight\"\n type=\"radio\"\n value={!this.weight.value ? 0 : weights[this.sizecategory.unit].findIndex(x => x.value === this.weightvalue)}\n checked={wght.value === this.weight.value}\n onChange={() => {\n this.weight = (weights[this.sizecategory.unit] as FindPriceWeight[]).filter(x => x.value === wght.value)[0];\n this.weightvalue = this.weight.value;\n }}\n >\n {wght.name}\n </pn-choice-button>\n ))}\n </div>\n }\n </div>\n ) : null}\n\n {this.filteredItems && this.filteredItems.length > 0 ? (\n <div class=\"resultlist\">\n {state.i18n.resultlistheading ? <div class=\"resultHeading\">{state.i18n.resultlistheading}</div> : null}\n {this.filteredItems.map((item: ProductPriceItem) => (\n <div>\n <pn-find-price-result item={item}></pn-find-price-result>\n </div>\n ))}\n </div>\n ) : null}\n </div>\n );\n }\n}\n"]}
@@ -55,9 +55,8 @@ export class PnfindServiceAndPrice {
55
55
  }
56
56
  }
57
57
  filterItems() {
58
- var _a;
59
58
  // this.debug = `Postagetype: ${this.postagetype.value}. <br/>Weight: ${ this.weight.value }`;
60
- if (!((_a = this.sourceData) === null || _a === void 0 ? void 0 : _a.data)) {
59
+ if (!this.sourceData?.data) {
61
60
  console.log('Data has not yet been loaded');
62
61
  return;
63
62
  }
@@ -125,7 +124,7 @@ export class PnfindServiceAndPrice {
125
124
  if (weights[this.postagetype.value].length > 6) {
126
125
  labelText = weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1 ? weight.name : '';
127
126
  }
128
- return h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {})));
127
+ return h("option", { value: weightindex, ...(labelText ? { label: labelText } : {}) });
129
128
  })))))) : null), this.filteredItems && this.filteredItems.length > 0 ? (h("div", { class: "resultlist" }, state.i18n.resultlistheading ? h("div", { class: "heading" }, state.i18n.resultlistheading) : null, this.filteredItems.map((item) => (h("div", null, h("pn-find-service-and-price-result", { item: item })))))) : null));
130
129
  }
131
130
  static get is() { return "pn-find-service-and-price"; }
@@ -1 +1 @@
1
- {"version":3,"file":"pn-find-service-and-price.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-find-service-and-price/pn-find-service-and-price.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,0CAA0C,CAAC;AASjF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAM1D,MAAM,OAAO,qBAAqB;;sBACP,+EAA+E;wBAC5D,IAAI;sBACN,IAAI;6BAED,EAAE;2BACQ;YACrD,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,EAAE;SACyB;sBACU,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAA+B;2BACjE,CAAC;6BAC2B;YACzD,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,EAAE;SAC2B;0BACS,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;;IAEr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C,CAAC,IAAI,CACJ,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Watch } from '@stencil/core';\nimport { translations, markets } from './pn-find-service-and-price-translations';\nimport { ProductPriceSourceData, ProductPriceItem } from '../../../globals/shared/productprice/product-price-types';\nimport {\n FindServiceAndPricePostageType,\n FindServiceAndPriceWeight,\n FindServiceAndPriceDeliveryScope,\n PnfindServiceAndPriceMarket,\n PnfindServiceAndPricei18n,\n} from './pn-find-service-and-price-types';\nimport { postagetypes, weights, deliveryscopes } from './data.js';\nimport { convertFileFromStream } from '../../../globals/shared/productprice/convert.js';\nimport { state } from './pn-find-service-and-price-store';\n\n@Component({\n tag: 'pn-find-service-and-price',\n styleUrl: 'pn-find-service-and-price.scss',\n})\nexport class PnfindServiceAndPrice {\n @Prop() source: string = 'https://com-inte.postnord.com/globalassets/global/prices/sv-se-findprice.xlsx';\n @Prop({ mutable: true }) language: string = 'sv';\n @Prop({ mutable: true }) market: string = 'se';\n\n @State() filteredItems: ProductPriceItem[] = [];\n @State() postagetype: FindServiceAndPricePostageType = {\n value: '',\n name: '',\n icon: '',\n } as FindServiceAndPricePostageType;\n @State() weight: FindServiceAndPriceWeight = { value: 0, name: '' } as FindServiceAndPriceWeight;\n @State() weightvalue: number = 0;\n @State() deliveryscope: FindServiceAndPriceDeliveryScope = {\n value: '',\n name: '',\n icon: '',\n } as FindServiceAndPriceDeliveryScope;\n @State() sourceData: ProductPriceSourceData = { types: [], data: [] };\n\n componentWillLoad() {\n this.setState();\n this.getDataSource();\n\n // window.setTimeout(() => {\n // this.postagetype = postagetypes[0];\n // this.deliveryscope = deliveryscopes[this.postagetype.value][0];\n // this.weight = weights[this.postagetype.value][0];\n // this.weightvalue = this.weight.value;\n // }, 500)\n }\n\n async getDataSource() {\n const cacheBusting = `?cache=${Math.floor(Math.random() * (10000 - 1) + 1)}`;\n const req = await fetch(this.source + cacheBusting);\n const reqbody = await req.blob();\n try {\n const convertedData = await convertFileFromStream(reqbody);\n this.sourceData = convertedData;\n this.filterItems();\n } catch (e) {\n console.log('Unable to parse data');\n }\n }\n\n @Watch('market')\n @Watch('language')\n setState() {\n if (this.market) {\n state.market = markets[this.market] as PnfindServiceAndPriceMarket;\n }\n if (this.language && translations[this.language]) {\n state.i18n = translations[this.language] as PnfindServiceAndPricei18n;\n }\n }\n\n @Watch('postagetype')\n @Watch('deliveryscope')\n @Watch('weightvalue')\n filterItems() {\n // this.debug = `Postagetype: ${this.postagetype.value}. <br/>Weight: ${ this.weight.value }`;\n if (!this.sourceData?.data) {\n console.log('Data has not yet been loaded');\n return;\n }\n if (!this.postagetype) {\n return;\n }\n const typeData = this.sourceData.data.filter(x => x.what === this.postagetype.value);\n if (!this.deliveryscope) {\n return;\n }\n const deliveryScopeData = typeData.filter(x => x.deliveryscope === this.deliveryscope.value);\n if (!this.weight || !this.weight.value) {\n return;\n }\n\n // For letters we use grams. Otherwise we use KG\n const comparisonWeight = this.weight.abbreviation.toLocaleLowerCase() === 'kg' && this.postagetype.value === 'letter' ? this.weight.value * 1000 : this.weight.value;\n\n let weightFilteredData = deliveryScopeData.filter(x => x.maxweight === comparisonWeight);\n\n // In parcels the maxwidths don't necessarily start at 1kg so we fetch any type below the user selected value\n if (weightFilteredData.length === 0) {\n weightFilteredData = deliveryScopeData.filter(x => x.maxweight >= comparisonWeight);\n if (weightFilteredData.length > 0) {\n // We reverse the result array since the map will take the last unique item instead of the first\n const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item['id'], item])).values()];\n if (uniqueWeightOptions.length > 0) {\n weightFilteredData = uniqueWeightOptions;\n }\n }\n }\n\n this.filteredItems = weightFilteredData;\n }\n\n render() {\n return (\n <div>\n <div class=\"findprice-form\">\n {state.i18n.componentheading ? <h2>{state.i18n.componentheading}</h2> : null}\n <div class=\"postagetypes\">\n {postagetypes.map(postagetype => (\n <pn-choice-button\n choiceid={postagetype.value}\n value={postagetype.value}\n name=\"postagetype\"\n type=\"radio\"\n checked={postagetype.value === this.postagetype.value}\n onChange={() => {\n this.postagetype = (postagetypes as FindServiceAndPricePostageType[]).filter(x => x.value === postagetype.value)[0];\n this.deliveryscope = { value: '', name: '', icon: '' } as FindServiceAndPriceDeliveryScope;\n this.weight = { value: 0, name: '' } as FindServiceAndPriceWeight;\n this.weightvalue = this.weight.value;\n }}\n >\n <pn-illustration illustration={postagetype.illustration}></pn-illustration> {postagetype.name}\n </pn-choice-button>\n ))}\n </div>\n\n {this.postagetype.value && deliveryscopes[this.postagetype.value] ? (\n <div>\n {state.i18n.deliveryscopeheading ? <div class=\"heading\">{state.i18n.deliveryscopeheading}</div> : null}\n <div class=\"deliveryscope\">\n {deliveryscopes[this.postagetype.value].map(deliveryscope => (\n <pn-choice-button\n choiceid={this.postagetype.value + deliveryscope.value}\n value={deliveryscope.value}\n name=\"deliveryscope\"\n type=\"radio\"\n checked={deliveryscope.value === this.deliveryscope.value}\n onChange={() => {\n this.deliveryscope = (deliveryscopes[this.postagetype.value] as FindServiceAndPriceDeliveryScope[]).filter(x => x.value === deliveryscope.value)[0];\n if (this.weight.value === 0) {\n this.weight = weights[this.postagetype.value][0];\n this.weightvalue = this.weight.value;\n }\n }}\n >\n <pn-illustration illustration={deliveryscope.illustration}></pn-illustration> {deliveryscope.name}\n </pn-choice-button>\n ))}\n </div>\n </div>\n ) : null}\n\n {this.postagetype.value && weights[this.postagetype.value] && this.deliveryscope.value ? (\n <div>\n {state.i18n.sizeheading ? <div class=\"heading\">{state.i18n.sizeheading}</div> : null}\n <div class=\"weightoption\">\n <div class=\"weightoption-input\">\n <pn-input\n inputid=\"weightvalue\"\n name=\"weightvalue\"\n type=\"number\"\n label={state.i18n.weightlabel}\n value={this.weightvalue}\n onChange={e => {\n if (e && e.target && e.target.value) {\n const weightNum = parseInt(e.target.value, 10);\n if (!isNaN(weightNum)) {\n let matchingWeights = (weights[this.postagetype.value] as FindServiceAndPriceWeight[]).filter(x => {\n let weightInGrams = x.abbreviation === 'kg' ? x.value * 1000 : x.value;\n return weightInGrams >= weightNum;\n });\n if (matchingWeights && matchingWeights.length > 0) {\n this.weight = matchingWeights[0];\n this.weightvalue = this.weight.value;\n }\n }\n }\n }}\n ></pn-input>\n <span class=\"weightoption-input-abbreviation\">{this.weight.abbreviation}</span>\n </div>\n <div class=\"weightoption-range\">\n <input\n type=\"range\"\n id=\"weightrange\"\n name=\"weightrange\"\n list=\"weightlist\"\n value={!this.weight.value ? 0 : weights[this.postagetype.value].findIndex(x => x.value === this.weightvalue)}\n onChange={e => {\n const value = (e.target as HTMLInputElement).value;\n this.weight = weights[this.postagetype.value][value];\n this.weightvalue = this.weight.value;\n }}\n min=\"0\"\n // max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }\n max={weights[this.postagetype.value].length - 1}\n />\n <datalist id=\"weightlist\">\n {weights[this.postagetype.value].map((weight, weightindex) => {\n let labelText = weight.name;\n if (weights[this.postagetype.value].length > 6) {\n labelText = weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1 ? weight.name : '';\n }\n return <option value={weightindex} {...(labelText ? { label: labelText } : {})}></option>;\n })}\n </datalist>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n {this.filteredItems && this.filteredItems.length > 0 ? (\n <div class=\"resultlist\">\n {state.i18n.resultlistheading ? <div class=\"heading\">{state.i18n.resultlistheading}</div> : null}\n {this.filteredItems.map((item: ProductPriceItem) => (\n <div>\n <pn-find-service-and-price-result item={item}></pn-find-service-and-price-result>\n </div>\n ))}\n </div>\n ) : null}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pn-find-service-and-price.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-find-service-and-price/pn-find-service-and-price.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,E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AAC;gCACD,OAAO,cAAQ,KAAK,EAAE,WAAW,KAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAW,CAAC;4BAC5F,CAAC,CAAC,CACO,CACP,CACF,CACF,CACP,CAAC,CAAC,CAAC,IAAI,CACJ;YACL,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACrD,WAAK,KAAK,EAAC,YAAY;gBACpB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAK,KAAK,EAAC,SAAS,IAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAO,CAAC,CAAC,CAAC,IAAI;gBAC/F,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,CAClD;oBACE,wCAAkC,IAAI,EAAE,IAAI,GAAqC,CAC7E,CACP,CAAC,CACE,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Watch } from '@stencil/core';\nimport { translations, markets } from './pn-find-service-and-price-translations';\nimport { ProductPriceSourceData, ProductPriceItem } from '../../../globals/shared/productprice/product-price-types';\nimport {\n FindServiceAndPricePostageType,\n FindServiceAndPriceWeight,\n FindServiceAndPriceDeliveryScope,\n PnfindServiceAndPriceMarket,\n PnfindServiceAndPricei18n,\n} from './pn-find-service-and-price-types';\nimport { postagetypes, weights, deliveryscopes } from './data.js';\nimport { convertFileFromStream } from '../../../globals/shared/productprice/convert.js';\nimport { state } from './pn-find-service-and-price-store';\n\n@Component({\n tag: 'pn-find-service-and-price',\n styleUrl: 'pn-find-service-and-price.scss',\n})\nexport class PnfindServiceAndPrice {\n @Prop() source: string = 'https://com-inte.postnord.com/globalassets/global/prices/sv-se-findprice.xlsx';\n @Prop({ mutable: true }) language: string = 'sv';\n @Prop({ mutable: true }) market: string = 'se';\n\n @State() filteredItems: ProductPriceItem[] = [];\n @State() postagetype: FindServiceAndPricePostageType = {\n value: '',\n name: '',\n icon: '',\n } as FindServiceAndPricePostageType;\n @State() weight: FindServiceAndPriceWeight = { value: 0, name: '' } as FindServiceAndPriceWeight;\n @State() weightvalue: number = 0;\n @State() deliveryscope: FindServiceAndPriceDeliveryScope = {\n value: '',\n name: '',\n icon: '',\n } as FindServiceAndPriceDeliveryScope;\n @State() sourceData: ProductPriceSourceData = { types: [], data: [] };\n\n componentWillLoad() {\n this.setState();\n this.getDataSource();\n\n // window.setTimeout(() => {\n // this.postagetype = postagetypes[0];\n // this.deliveryscope = deliveryscopes[this.postagetype.value][0];\n // this.weight = weights[this.postagetype.value][0];\n // this.weightvalue = this.weight.value;\n // }, 500)\n }\n\n async getDataSource() {\n const cacheBusting = `?cache=${Math.floor(Math.random() * (10000 - 1) + 1)}`;\n const req = await fetch(this.source + cacheBusting);\n const reqbody = await req.blob();\n try {\n const convertedData = await convertFileFromStream(reqbody);\n this.sourceData = convertedData;\n this.filterItems();\n } catch (e) {\n console.log('Unable to parse data');\n }\n }\n\n @Watch('market')\n @Watch('language')\n setState() {\n if (this.market) {\n state.market = markets[this.market] as PnfindServiceAndPriceMarket;\n }\n if (this.language && translations[this.language]) {\n state.i18n = translations[this.language] as PnfindServiceAndPricei18n;\n }\n }\n\n @Watch('postagetype')\n @Watch('deliveryscope')\n @Watch('weightvalue')\n filterItems() {\n // this.debug = `Postagetype: ${this.postagetype.value}. <br/>Weight: ${ this.weight.value }`;\n if (!this.sourceData?.data) {\n console.log('Data has not yet been loaded');\n return;\n }\n if (!this.postagetype) {\n return;\n }\n const typeData = this.sourceData.data.filter(x => x.what === this.postagetype.value);\n if (!this.deliveryscope) {\n return;\n }\n const deliveryScopeData = typeData.filter(x => x.deliveryscope === this.deliveryscope.value);\n if (!this.weight || !this.weight.value) {\n return;\n }\n\n // For letters we use grams. Otherwise we use KG\n const comparisonWeight = this.weight.abbreviation.toLocaleLowerCase() === 'kg' && this.postagetype.value === 'letter' ? this.weight.value * 1000 : this.weight.value;\n\n let weightFilteredData = deliveryScopeData.filter(x => x.maxweight === comparisonWeight);\n\n // In parcels the maxwidths don't necessarily start at 1kg so we fetch any type below the user selected value\n if (weightFilteredData.length === 0) {\n weightFilteredData = deliveryScopeData.filter(x => x.maxweight >= comparisonWeight);\n if (weightFilteredData.length > 0) {\n // We reverse the result array since the map will take the last unique item instead of the first\n const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item['id'], item])).values()];\n if (uniqueWeightOptions.length > 0) {\n weightFilteredData = uniqueWeightOptions;\n }\n }\n }\n\n this.filteredItems = weightFilteredData;\n }\n\n render() {\n return (\n <div>\n <div class=\"findprice-form\">\n {state.i18n.componentheading ? <h2>{state.i18n.componentheading}</h2> : null}\n <div class=\"postagetypes\">\n {postagetypes.map(postagetype => (\n <pn-choice-button\n choiceid={postagetype.value}\n value={postagetype.value}\n name=\"postagetype\"\n type=\"radio\"\n checked={postagetype.value === this.postagetype.value}\n onChange={() => {\n this.postagetype = (postagetypes as FindServiceAndPricePostageType[]).filter(x => x.value === postagetype.value)[0];\n this.deliveryscope = { value: '', name: '', icon: '' } as FindServiceAndPriceDeliveryScope;\n this.weight = { value: 0, name: '' } as FindServiceAndPriceWeight;\n this.weightvalue = this.weight.value;\n }}\n >\n <pn-illustration illustration={postagetype.illustration}></pn-illustration> {postagetype.name}\n </pn-choice-button>\n ))}\n </div>\n\n {this.postagetype.value && deliveryscopes[this.postagetype.value] ? (\n <div>\n {state.i18n.deliveryscopeheading ? <div class=\"heading\">{state.i18n.deliveryscopeheading}</div> : null}\n <div class=\"deliveryscope\">\n {deliveryscopes[this.postagetype.value].map(deliveryscope => (\n <pn-choice-button\n choiceid={this.postagetype.value + deliveryscope.value}\n value={deliveryscope.value}\n name=\"deliveryscope\"\n type=\"radio\"\n checked={deliveryscope.value === this.deliveryscope.value}\n onChange={() => {\n this.deliveryscope = (deliveryscopes[this.postagetype.value] as FindServiceAndPriceDeliveryScope[]).filter(x => x.value === deliveryscope.value)[0];\n if (this.weight.value === 0) {\n this.weight = weights[this.postagetype.value][0];\n this.weightvalue = this.weight.value;\n }\n }}\n >\n <pn-illustration illustration={deliveryscope.illustration}></pn-illustration> {deliveryscope.name}\n </pn-choice-button>\n ))}\n </div>\n </div>\n ) : null}\n\n {this.postagetype.value && weights[this.postagetype.value] && this.deliveryscope.value ? (\n <div>\n {state.i18n.sizeheading ? <div class=\"heading\">{state.i18n.sizeheading}</div> : null}\n <div class=\"weightoption\">\n <div class=\"weightoption-input\">\n <pn-input\n inputid=\"weightvalue\"\n name=\"weightvalue\"\n type=\"number\"\n label={state.i18n.weightlabel}\n value={this.weightvalue}\n onChange={e => {\n if (e && e.target && e.target.value) {\n const weightNum = parseInt(e.target.value, 10);\n if (!isNaN(weightNum)) {\n let matchingWeights = (weights[this.postagetype.value] as FindServiceAndPriceWeight[]).filter(x => {\n let weightInGrams = x.abbreviation === 'kg' ? x.value * 1000 : x.value;\n return weightInGrams >= weightNum;\n });\n if (matchingWeights && matchingWeights.length > 0) {\n this.weight = matchingWeights[0];\n this.weightvalue = this.weight.value;\n }\n }\n }\n }}\n ></pn-input>\n <span class=\"weightoption-input-abbreviation\">{this.weight.abbreviation}</span>\n </div>\n <div class=\"weightoption-range\">\n <input\n type=\"range\"\n id=\"weightrange\"\n name=\"weightrange\"\n list=\"weightlist\"\n value={!this.weight.value ? 0 : weights[this.postagetype.value].findIndex(x => x.value === this.weightvalue)}\n onChange={e => {\n const value = (e.target as HTMLInputElement).value;\n this.weight = weights[this.postagetype.value][value];\n this.weightvalue = this.weight.value;\n }}\n min=\"0\"\n // max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }\n max={weights[this.postagetype.value].length - 1}\n />\n <datalist id=\"weightlist\">\n {weights[this.postagetype.value].map((weight, weightindex) => {\n let labelText = weight.name;\n if (weights[this.postagetype.value].length > 6) {\n labelText = weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1 ? weight.name : '';\n }\n return <option value={weightindex} {...(labelText ? { label: labelText } : {})}></option>;\n })}\n </datalist>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n {this.filteredItems && this.filteredItems.length > 0 ? (\n <div class=\"resultlist\">\n {state.i18n.resultlistheading ? <div class=\"heading\">{state.i18n.resultlistheading}</div> : null}\n {this.filteredItems.map((item: ProductPriceItem) => (\n <div>\n <pn-find-service-and-price-result item={item}></pn-find-service-and-price-result>\n </div>\n ))}\n </div>\n ) : null}\n </div>\n );\n }\n}\n"]}
@@ -1,8 +1,6 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  export class PnHeroBlockInternational {
3
3
  constructor() {
4
- this.hasCtaButtonSlot = false;
5
- this.animateSideloader = false;
6
4
  this.heading = null;
7
5
  this.subHeading = null;
8
6
  this.preamble = null;
@@ -10,6 +8,9 @@ export class PnHeroBlockInternational {
10
8
  this.showSideLoader = true;
11
9
  this.centeredLayout = false;
12
10
  }
11
+ hostElement;
12
+ hasCtaButtonSlot = false;
13
+ animateSideloader = false;
13
14
  async componentWillLoad() {
14
15
  this.hasCtaButtonSlot = !!this.hostElement.querySelector('[slot="hero-international-cta"]');
15
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pn-hero-block-international.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-hero-block-international/pn-hero-block-international.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAS,MAAM,eAAe,CAAC;AAMzE,MAAM,OAAO,wBAAwB;;QAU3B,qBAAgB,GAAY,KAAK,CAAC;QAClC,sBAAiB,GAAY,KAAK,CAAC;uBARjB,IAAI;0BACD,IAAI;wB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,gBAAgB,IAAI,CACxB,4DAAK,KAAK,EAAC,kCAAkC;4BAC3C,6DAAM,IAAI,EAAC,wBAAwB,GAAQ,CACvC,CACP,CACG;oBAEL,CAAC,IAAI,CAAC,cAAc,IAAI,CACvB,4DAAK,KAAK,EAAC,uCAAuC;wBAChD,4DAAK,KAAK,EAAC,8CAA8C;4BACvD,4DAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,aAAa;gCAC3D,+DAAQ,KAAK,EAAC,OAAO,EAAC,EAAE,EAAC,KAAK,EAAC,EAAE,EAAC,KAAK,EAAC,CAAC,EAAC,KAAK,GAAE;gCACjD,+DAAQ,KAAK,EAAC,OAAO,EAAC,EAAE,EAAC,KAAK,EAAC,EAAE,EAAC,KAAK,EAAC,CAAC,EAAC,KAAK,GAAE;gCACjD,6DAAM,KAAK,EAAC,OAAO,EAAC,CAAC,EAAC,qBAAqB,GAAE;gCAC7C,6DAAM,CAAC,EAAC,koDAAkoD,EAAC,KAAK,EAAC,iBAAiB,GAAE;gCACpqD,6DAAM,CAAC,EAAC,47DAA47D,EAAC,KAAK,EAAC,iBAAiB,GAAE,CAC19D,CACF,CACF,CACP,CACG;gBAEL,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,CAC9C,4DAAK,KAAK,EAAE,mCAAmC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,0CAA0C,CAAC,CAAC,CAAC,EAAE,EAAE;oBACvH,4DAAK,KAAK,EAAC,OAAO,GAAO,CACrB,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'pn-hero-block-international',\n styleUrl: 'pn-hero-block-international.scss',\n})\nexport class PnHeroBlockInternational {\n @Element() hostElement: HTMLElement;\n\n @Prop() heading: string = null;\n @Prop() subHeading: string = null;\n @Prop() preamble: string = null;\n @Prop() animateLogo: boolean = false;\n @Prop() showSideLoader: boolean = true;\n @Prop() centeredLayout: boolean = false;\n\n private hasCtaButtonSlot: boolean = false;\n private animateSideloader: boolean = false;\n\n async componentWillLoad() {\n this.hasCtaButtonSlot = !!this.hostElement.querySelector('[slot=\"hero-international-cta\"]');\n }\n\n componentDidLoad() {\n if (this.animateLogo) {\n const image = this.hostElement.querySelector('.hero-international__content__logo-col__image');\n const sideLoader = this.hostElement.querySelector('.hero-international__side-loader--animate');\n this.animateSideloader = true;\n\n if (image) {\n image.classList.add('animate-in');\n }\n if (sideLoader) {\n sideLoader.classList.add('animate-in');\n }\n }\n }\n\n render() {\n return (\n <Host class={`hero-international ${this.centeredLayout ? 'hero-international--centered-layout' : ''} ${this.animateLogo ? 'hero-international--animate' : ''}`}>\n <div class=\"hero-international__content\">\n <div class=\"flex-wrapper\">\n <div class=\"content-col\">\n <span class=\"hero-international__content__site-tag\">International</span>\n <h1 class=\"hero-international__content__heading\">\n {this.heading} <span>{this.subHeading}</span>\n </h1>\n <p class=\"hero-international__content__preamble\">{this.preamble}</p>\n\n {this.hasCtaButtonSlot && (\n <div class=\"hero-international__content__cta\">\n <slot name=\"hero-international-cta\"></slot>\n </div>\n )}\n </div>\n\n {!this.centeredLayout && (\n <div class=\"hero-international__content__logo-col\">\n <div class=\"hero-international__content__logo-col__image\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 919 336\">\n <circle class=\"cls-1\" cx=\"168\" cy=\"168\" r=\"168\"/>\n <circle class=\"cls-1\" cx=\"519\" cy=\"168\" r=\"168\"/>\n <path class=\"cls-1\" d=\"M510 0h409v336H510z\"/>\n <path d=\"M235.51 155.55c0 11.19-9.19 15.88-17.84 15.88s-17.46-4.58-17.46-15.4 9.02-15.88 17.84-15.88c8.6 0 17.46 4.63 17.46 15.4Zm-11.65.33c0-3.68-2.42-6.18-6.02-6.18s-6.07 2.5-6.07 6.18c0 3.46 2.48 6.02 6.07 6.02s6.02-2.56 6.02-6.02Zm-147.53 0c0 8.53-5.91 15.56-15.1 15.56-5.64 0-8.27-2.77-8.27-2.77v10.34H42v-37.89h10.96V144s2.85-3.84 9.08-3.84c9.13 0 14.29 6.98 14.29 15.72Zm-11.6 0c0-3.68-2.42-6.18-6.02-6.18s-6.07 2.5-6.07 6.18c0 3.46 2.47 6.02 6.07 6.02s6.02-2.56 6.02-6.02Zm184.35.47c0-4.47 2.74-5.86 6.4-5.86 2.25 0 3.71.53 3.71.53l.27-10.02s-.7-.32-2.58-.32c-6.12 0-7.79 3.84-7.79 3.84v-3.41h-10.96v29.42h10.96v-14.18ZM294 132v38.53h-10.96v-2.88s-2.85 3.84-9.08 3.84c-9.13 0-14.29-6.98-14.29-15.72s5.91-15.56 15.1-15.56c5.64 0 8.27 2.77 8.27 2.77v-8.85L294 132Zm-10.64 23.77c0-3.47-2.47-6.02-6.07-6.02s-6.02 2.56-6.02 6.02c0 3.67 2.42 6.18 6.02 6.18s6.07-2.51 6.07-6.18Zm-96.71-15.62c-6.39 0-8.71 3.84-8.71 3.84v-2.88h-10.96v29.42h10.96v-15.08c0-3.73 1.4-5.44 4.78-5.44s3.87 2.77 3.87 6.29v14.23h11.07v-18.07c0-8.1-3.92-12.31-11.01-12.31Zm-30.74-5.65h-10.96v36.03h10.96v-20.25h5.16l5-9.17h-10.16v-6.61Zm-24.55 17.27c-3.55-.53-5.11-.53-5.11-1.92 0-1.17 1.45-1.65 4.3-1.65 4.83 0 9.08 1.6 9.08 1.6l1.93-8.26s-4.67-1.33-10.91-1.33c-10.48 0-15.96 4-15.96 10.39 0 4.96 2.96 7.89 11.61 9 3.65.48 5 .69 5 2.03s-1.45 1.7-3.98 1.7c-5.48 0-10.64-2.29-10.64-2.29l-2.2 8.53s5.16 1.81 11.88 1.81c11.28 0 16.49-3.95 16.49-10.39 0-5.11-2.79-7.88-11.49-9.22Zm-17.9 3.78c0 11.19-9.19 15.88-17.84 15.88s-17.46-4.58-17.46-15.4 9.03-15.88 17.84-15.88c8.6 0 17.46 4.63 17.46 15.4Zm-11.66.33c0-3.68-2.42-6.18-6.02-6.18s-6.07 2.5-6.07 6.18c0 3.46 2.47 6.02 6.07 6.02s6.02-2.56 6.02-6.02Z\" class=\"svg-path-style2\"/>\n <path d=\"M167 197.67v-15.01h2.71v15.01H167Zm15.27-7.02c0-2.41-1.92-4.08-4.24-4.08-1.46 0-2.6.59-3.29 1.7v-1.41h-2.32v10.81h2.47v-6.2c0-1.52 1.04-2.58 2.51-2.58s2.38 1.02 2.38 2.54v6.24h2.47v-7.02Zm8-3.8h-2.8v-3.62H185v10.99c0 2.01 1.43 3.44 3.46 3.44h1.81v-2.29h-1.32c-.9 0-1.48-.55-1.48-1.48v-4.94h1.67l1.14-2.1Zm11.93 6.2c0-.15.04-.71.04-.97 0-3.31-2.25-5.56-5.49-5.56s-5.56 2.56-5.56 5.74 2.49 5.74 5.73 5.74c2.12 0 3.86-.84 4.98-2.58l-2.05-1.1c-.6.88-1.52 1.48-2.93 1.48-1.68 0-3-1.04-3.33-2.74h8.6m-8.53-1.94c.37-1.48 1.52-2.47 3.07-2.47 1.7 0 2.78.95 3.09 2.47h-6.16Zm16.03-4.26c-1.61 0-2.62.84-3.09 1.83v-1.83h-2.32v10.81h2.47v-5.25c0-1.68 1.1-3 2.71-3h1.08v-2.56h-.86Zm12.55 3.79c0-2.41-1.92-4.08-4.23-4.08-1.46 0-2.6.59-3.29 1.7v-1.41h-2.32v10.81h2.47v-6.2c0-1.52 1.04-2.58 2.51-2.58s2.38 1.02 2.38 2.54v6.24h2.47v-7.02Zm11.06-2.27c-.75-1.13-2.14-1.81-3.7-1.81-3.15 0-5.34 2.47-5.34 5.67s2.18 5.67 5.34 5.67c1.56 0 2.95-.68 3.7-1.83v1.59h2.32v-10.81h-2.32v1.52Zm0 3.86c0 1.87-1.32 3.35-3.29 3.35s-3.27-1.48-3.27-3.35 1.3-3.38 3.27-3.38 3.29 1.5 3.29 3.38Zm10.31-5.39h-2.8v-3.62h-2.47v10.99c0 2.01 1.43 3.44 3.46 3.44h1.81v-2.29h-1.32c-.91 0-1.48-.55-1.48-1.48v-4.94h1.67l1.14-2.1Zm1.84-3.22c0 .84.68 1.52 1.54 1.52s1.57-.68 1.57-1.52-.71-1.5-1.57-1.5-1.54.69-1.54 1.5Zm2.78 14.04v-10.81h-2.47v10.81h2.47Zm2.12-5.41c0 3.18 2.49 5.74 5.78 5.74s5.76-2.56 5.76-5.74-2.49-5.74-5.76-5.74-5.78 2.54-5.78 5.74Zm9.06 0c0 1.88-1.39 3.38-3.29 3.38s-3.29-1.5-3.29-3.38 1.37-3.38 3.29-3.38 3.29 1.48 3.29 3.38Zm14.41-1.61c0-2.41-1.92-4.08-4.23-4.08-1.46 0-2.6.59-3.29 1.7v-1.41h-2.32v10.81h2.47v-6.2c0-1.52 1.04-2.58 2.52-2.58s2.38 1.02 2.38 2.54v6.24h2.47v-7.02Zm11.06-2.27c-.75-1.13-2.14-1.81-3.7-1.81-3.15 0-5.34 2.47-5.34 5.67s2.18 5.67 5.34 5.67c1.57 0 2.95-.68 3.7-1.83v1.59h2.32v-10.81h-2.32v1.52Zm0 3.86c0 1.87-1.32 3.35-3.29 3.35s-3.26-1.48-3.26-3.35 1.3-3.38 3.26-3.38 3.29 1.5 3.29 3.38Zm9.12 3.2h-.46c-.77 0-1.15-.4-1.15-1.17V182h-2.47v12.69c0 1.81 1.23 2.98 3.13 2.98h.95v-2.23Z\" class=\"svg-path-style1\"/>\n </svg>\n </div>\n </div>\n )}\n </div>\n\n {this.showSideLoader && !this.centeredLayout && (\n <div class={`hero-international__side-loader ${this.animateSideloader ? 'hero-international__side-loader--animate' : ''}`}>\n <div class=\"shape\"></div>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pn-hero-block-international.js","sourceRoot":"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AO,GAAO,CACrB,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'pn-hero-block-international',\n styleUrl: 'pn-hero-block-international.scss',\n})\nexport class PnHeroBlockInternational {\n @Element() hostElement: HTMLElement;\n\n @Prop() heading: string = null;\n @Prop() subHeading: string = null;\n @Prop() preamble: string = null;\n @Prop() animateLogo: boolean = false;\n @Prop() showSideLoader: boolean = true;\n @Prop() centeredLayout: boolean = false;\n\n private hasCtaButtonSlot: boolean = false;\n private animateSideloader: boolean = false;\n\n async componentWillLoad() {\n this.hasCtaButtonSlot = !!this.hostElement.querySelector('[slot=\"hero-international-cta\"]');\n }\n\n componentDidLoad() {\n if (this.animateLogo) {\n const image = this.hostElement.querySelector('.hero-international__content__logo-col__image');\n const sideLoader = this.hostElement.querySelector('.hero-international__side-loader--animate');\n this.animateSideloader = true;\n\n if (image) {\n image.classList.add('animate-in');\n }\n if (sideLoader) {\n sideLoader.classList.add('animate-in');\n }\n }\n }\n\n render() {\n return (\n <Host class={`hero-international ${this.centeredLayout ? 'hero-international--centered-layout' : ''} ${this.animateLogo ? 'hero-international--animate' : ''}`}>\n <div class=\"hero-international__content\">\n <div class=\"flex-wrapper\">\n <div class=\"content-col\">\n <span class=\"hero-international__content__site-tag\">International</span>\n <h1 class=\"hero-international__content__heading\">\n {this.heading} <span>{this.subHeading}</span>\n </h1>\n <p class=\"hero-international__content__preamble\">{this.preamble}</p>\n\n {this.hasCtaButtonSlot && (\n <div class=\"hero-international__content__cta\">\n <slot name=\"hero-international-cta\"></slot>\n </div>\n )}\n </div>\n\n {!this.centeredLayout && (\n <div class=\"hero-international__content__logo-col\">\n <div class=\"hero-international__content__logo-col__image\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 919 336\">\n <circle class=\"cls-1\" cx=\"168\" cy=\"168\" r=\"168\"/>\n <circle class=\"cls-1\" cx=\"519\" cy=\"168\" r=\"168\"/>\n <path class=\"cls-1\" d=\"M510 0h409v336H510z\"/>\n <path d=\"M235.51 155.55c0 11.19-9.19 15.88-17.84 15.88s-17.46-4.58-17.46-15.4 9.02-15.88 17.84-15.88c8.6 0 17.46 4.63 17.46 15.4Zm-11.65.33c0-3.68-2.42-6.18-6.02-6.18s-6.07 2.5-6.07 6.18c0 3.46 2.48 6.02 6.07 6.02s6.02-2.56 6.02-6.02Zm-147.53 0c0 8.53-5.91 15.56-15.1 15.56-5.64 0-8.27-2.77-8.27-2.77v10.34H42v-37.89h10.96V144s2.85-3.84 9.08-3.84c9.13 0 14.29 6.98 14.29 15.72Zm-11.6 0c0-3.68-2.42-6.18-6.02-6.18s-6.07 2.5-6.07 6.18c0 3.46 2.47 6.02 6.07 6.02s6.02-2.56 6.02-6.02Zm184.35.47c0-4.47 2.74-5.86 6.4-5.86 2.25 0 3.71.53 3.71.53l.27-10.02s-.7-.32-2.58-.32c-6.12 0-7.79 3.84-7.79 3.84v-3.41h-10.96v29.42h10.96v-14.18ZM294 132v38.53h-10.96v-2.88s-2.85 3.84-9.08 3.84c-9.13 0-14.29-6.98-14.29-15.72s5.91-15.56 15.1-15.56c5.64 0 8.27 2.77 8.27 2.77v-8.85L294 132Zm-10.64 23.77c0-3.47-2.47-6.02-6.07-6.02s-6.02 2.56-6.02 6.02c0 3.67 2.42 6.18 6.02 6.18s6.07-2.51 6.07-6.18Zm-96.71-15.62c-6.39 0-8.71 3.84-8.71 3.84v-2.88h-10.96v29.42h10.96v-15.08c0-3.73 1.4-5.44 4.78-5.44s3.87 2.77 3.87 6.29v14.23h11.07v-18.07c0-8.1-3.92-12.31-11.01-12.31Zm-30.74-5.65h-10.96v36.03h10.96v-20.25h5.16l5-9.17h-10.16v-6.61Zm-24.55 17.27c-3.55-.53-5.11-.53-5.11-1.92 0-1.17 1.45-1.65 4.3-1.65 4.83 0 9.08 1.6 9.08 1.6l1.93-8.26s-4.67-1.33-10.91-1.33c-10.48 0-15.96 4-15.96 10.39 0 4.96 2.96 7.89 11.61 9 3.65.48 5 .69 5 2.03s-1.45 1.7-3.98 1.7c-5.48 0-10.64-2.29-10.64-2.29l-2.2 8.53s5.16 1.81 11.88 1.81c11.28 0 16.49-3.95 16.49-10.39 0-5.11-2.79-7.88-11.49-9.22Zm-17.9 3.78c0 11.19-9.19 15.88-17.84 15.88s-17.46-4.58-17.46-15.4 9.03-15.88 17.84-15.88c8.6 0 17.46 4.63 17.46 15.4Zm-11.66.33c0-3.68-2.42-6.18-6.02-6.18s-6.07 2.5-6.07 6.18c0 3.46 2.47 6.02 6.07 6.02s6.02-2.56 6.02-6.02Z\" class=\"svg-path-style2\"/>\n <path d=\"M167 197.67v-15.01h2.71v15.01H167Zm15.27-7.02c0-2.41-1.92-4.08-4.24-4.08-1.46 0-2.6.59-3.29 1.7v-1.41h-2.32v10.81h2.47v-6.2c0-1.52 1.04-2.58 2.51-2.58s2.38 1.02 2.38 2.54v6.24h2.47v-7.02Zm8-3.8h-2.8v-3.62H185v10.99c0 2.01 1.43 3.44 3.46 3.44h1.81v-2.29h-1.32c-.9 0-1.48-.55-1.48-1.48v-4.94h1.67l1.14-2.1Zm11.93 6.2c0-.15.04-.71.04-.97 0-3.31-2.25-5.56-5.49-5.56s-5.56 2.56-5.56 5.74 2.49 5.74 5.73 5.74c2.12 0 3.86-.84 4.98-2.58l-2.05-1.1c-.6.88-1.52 1.48-2.93 1.48-1.68 0-3-1.04-3.33-2.74h8.6m-8.53-1.94c.37-1.48 1.52-2.47 3.07-2.47 1.7 0 2.78.95 3.09 2.47h-6.16Zm16.03-4.26c-1.61 0-2.62.84-3.09 1.83v-1.83h-2.32v10.81h2.47v-5.25c0-1.68 1.1-3 2.71-3h1.08v-2.56h-.86Zm12.55 3.79c0-2.41-1.92-4.08-4.23-4.08-1.46 0-2.6.59-3.29 1.7v-1.41h-2.32v10.81h2.47v-6.2c0-1.52 1.04-2.58 2.51-2.58s2.38 1.02 2.38 2.54v6.24h2.47v-7.02Zm11.06-2.27c-.75-1.13-2.14-1.81-3.7-1.81-3.15 0-5.34 2.47-5.34 5.67s2.18 5.67 5.34 5.67c1.56 0 2.95-.68 3.7-1.83v1.59h2.32v-10.81h-2.32v1.52Zm0 3.86c0 1.87-1.32 3.35-3.29 3.35s-3.27-1.48-3.27-3.35 1.3-3.38 3.27-3.38 3.29 1.5 3.29 3.38Zm10.31-5.39h-2.8v-3.62h-2.47v10.99c0 2.01 1.43 3.44 3.46 3.44h1.81v-2.29h-1.32c-.91 0-1.48-.55-1.48-1.48v-4.94h1.67l1.14-2.1Zm1.84-3.22c0 .84.68 1.52 1.54 1.52s1.57-.68 1.57-1.52-.71-1.5-1.57-1.5-1.54.69-1.54 1.5Zm2.78 14.04v-10.81h-2.47v10.81h2.47Zm2.12-5.41c0 3.18 2.49 5.74 5.78 5.74s5.76-2.56 5.76-5.74-2.49-5.74-5.76-5.74-5.78 2.54-5.78 5.74Zm9.06 0c0 1.88-1.39 3.38-3.29 3.38s-3.29-1.5-3.29-3.38 1.37-3.38 3.29-3.38 3.29 1.48 3.29 3.38Zm14.41-1.61c0-2.41-1.92-4.08-4.23-4.08-1.46 0-2.6.59-3.29 1.7v-1.41h-2.32v10.81h2.47v-6.2c0-1.52 1.04-2.58 2.52-2.58s2.38 1.02 2.38 2.54v6.24h2.47v-7.02Zm11.06-2.27c-.75-1.13-2.14-1.81-3.7-1.81-3.15 0-5.34 2.47-5.34 5.67s2.18 5.67 5.34 5.67c1.57 0 2.95-.68 3.7-1.83v1.59h2.32v-10.81h-2.32v1.52Zm0 3.86c0 1.87-1.32 3.35-3.29 3.35s-3.26-1.48-3.26-3.35 1.3-3.38 3.26-3.38 3.29 1.5 3.29 3.38Zm9.12 3.2h-.46c-.77 0-1.15-.4-1.15-1.17V182h-2.47v12.69c0 1.81 1.23 2.98 3.13 2.98h.95v-2.23Z\" class=\"svg-path-style1\"/>\n </svg>\n </div>\n </div>\n )}\n </div>\n\n {this.showSideLoader && !this.centeredLayout && (\n <div class={`hero-international__side-loader ${this.animateSideloader ? 'hero-international__side-loader--animate' : ''}`}>\n <div class=\"shape\"></div>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -1,43 +1,6 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class PnLinkList {
3
3
  constructor() {
4
- this.slider = null;
5
- this.isDragging = false;
6
- this.startX = 0;
7
- this.scrollLeft = 0;
8
- this.handleMouseDown = (e) => {
9
- var _a, _b, _c;
10
- const target = e.target;
11
- const isContainerClick = target.classList.contains('link-list__container');
12
- const isLinkClick = target.tagName === 'A';
13
- if (isContainerClick || isLinkClick) {
14
- this.isDragging = true;
15
- (_a = this.slider) === null || _a === void 0 ? void 0 : _a.classList.add('link-list__active');
16
- this.startX = e.pageX - ((_b = this.slider) === null || _b === void 0 ? void 0 : _b.offsetLeft);
17
- this.scrollLeft = (_c = this.slider) === null || _c === void 0 ? void 0 : _c.scrollLeft;
18
- if (isLinkClick) {
19
- e.preventDefault();
20
- }
21
- }
22
- };
23
- this.handleMouseLeave = () => {
24
- var _a;
25
- this.isDragging = false;
26
- (_a = this.slider) === null || _a === void 0 ? void 0 : _a.classList.remove('link-list__active');
27
- };
28
- this.handleMouseUp = () => {
29
- var _a;
30
- this.isDragging = false;
31
- (_a = this.slider) === null || _a === void 0 ? void 0 : _a.classList.remove('link-list__active');
32
- };
33
- this.handleMouseMove = (e) => {
34
- var _a;
35
- if (this.isDragging) {
36
- const x = e.pageX - ((_a = this.slider) === null || _a === void 0 ? void 0 : _a.offsetLeft);
37
- const move = (x - this.startX) * 2;
38
- this.slider.scrollLeft = this.scrollLeft - move;
39
- }
40
- };
41
4
  this.heading = null;
42
5
  this.label = null;
43
6
  this.preamble = null;
@@ -45,9 +8,42 @@ export class PnLinkList {
45
8
  this.showMoreLabel = null;
46
9
  this.showMoreUrl = null;
47
10
  }
11
+ slider = null;
12
+ isDragging = false;
13
+ startX = 0;
14
+ scrollLeft = 0;
48
15
  componentDidLoad() {
49
16
  this.slider = document.querySelector('.link-list__container');
50
17
  }
18
+ handleMouseDown = (e) => {
19
+ const target = e.target;
20
+ const isContainerClick = target.classList.contains('link-list__container');
21
+ const isLinkClick = target.tagName === 'A';
22
+ if (isContainerClick || isLinkClick) {
23
+ this.isDragging = true;
24
+ this.slider?.classList.add('link-list__active');
25
+ this.startX = e.pageX - this.slider?.offsetLeft;
26
+ this.scrollLeft = this.slider?.scrollLeft;
27
+ if (isLinkClick) {
28
+ e.preventDefault();
29
+ }
30
+ }
31
+ };
32
+ handleMouseLeave = () => {
33
+ this.isDragging = false;
34
+ this.slider?.classList.remove('link-list__active');
35
+ };
36
+ handleMouseUp = () => {
37
+ this.isDragging = false;
38
+ this.slider?.classList.remove('link-list__active');
39
+ };
40
+ handleMouseMove = (e) => {
41
+ if (this.isDragging) {
42
+ const x = e.pageX - this.slider?.offsetLeft;
43
+ const move = (x - this.startX) * 2;
44
+ this.slider.scrollLeft = this.scrollLeft - move;
45
+ }
46
+ };
51
47
  render() {
52
48
  return (h(Host, { key: '8f0fd9ebec39f1dccfe36bfff99edc0aef098a24' }, h("div", { key: '619a149f108ef20d4929819805ee09f618af6d89', class: "link-list__header" }, h("h2", { key: '7a90aa34b99dd843c10ff78c7be1a91a42750ba1', class: "link-list__heading" }, this.heading), h("p", { key: 'b73f73665f873b1b68261888fbccc0fd211c0316', class: "link-list__preamble" }, this.preamble)), h("div", { key: '964f6e83fd0861b5c2651c9fcc27fb910be39be8', class: "link-list" }, h("div", { key: 'e7bcc50515f1d5d14b480f3b7fadba72c18fd557', class: "link-list__container", onMouseDown: this.handleMouseDown, onMouseUp: this.handleMouseUp, onMouseLeave: this.handleMouseLeave, onMouseMove: this.handleMouseMove }, h("div", { key: '3f453caf064d04bf5fd403bec1d92896607b61f2', class: "link-list__scrollable" }, h("slot", { key: '64db6a263d40f0dc595c308a242b1cbb8bfa4020', name: "linklist" })))), this.showMoreUrl ? (h("div", { class: "link-list__button" }, h("pn-button", { appearance: "light", href: this.showMoreUrl }, this.showMoreLabel), ' ')) : ('')));
53
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pn-link-list.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-link-list/pn-link-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAMzD,MAAM,OAAO,UAAU;;QAQb,WAAM,GAAgB,IAAI,CAAC;QAC3B,eAAU,GAAG,KAAK,CAAC;QACnB,WAAM,GAAG,CAAC,CAAC;QACX,eAAU,GAAG,CAAC,CAAC;QAMf,oBAAe,GAAG,CAAC,CAAa,EAAE,EAAE;;YAC1C,MAAM,MAAM,GAAG,CAAC,CAAC,MAAqB,CAAC;YAEvC,MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;YAC3E,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,KAAK,GAAG,CAAC;YAE3C,IAAI,gBAAgB,IAAI,WAAW,EAAE,CAAC;gBACpC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;gBACvB,MAAA,IAAI,CAAC,MAAM,0CAAE,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;gBAChD,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAG,MAAA,IAAI,CAAC,MAAM,0CAAE,UAAU,CAAA,CAAC;gBAChD,IAAI,CAAC,UAAU,GAAG,MAAA,IAAI,CAAC,MAAM,0CAAE,UAAU,CAAC;gBAE1C,IAAI,WAAW,EAAE,CAAC;oBAChB,CAAC,CAAC,cAAc,EAAE,CAAC;gBACrB,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEM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SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,YAAY,EAAE,IAAI,CAAC,gBAAgB,EACnC,WAAW,EAAE,IAAI,CAAC,eAAe;oBAEjC,4DAAK,KAAK,EAAC,uBAAuB;wBAChC,6DAAM,IAAI,EAAC,UAAU,GAAG,CACpB,CACF,CACF;YACL,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAClB,WAAK,KAAK,EAAC,mBAAmB;gBAC5B,iBAAW,UAAU,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,CAAC,WAAW,IACjD,IAAI,CAAC,aAAa,CACT;gBAAC,GAAG,CACZ,CACP,CAAC,CAAC,CAAC,CACF,EAAE,CACH,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'pn-link-list',\n styleUrl: 'pn-link-list.scss',\n})\nexport class PnLinkList {\n @Prop() heading: string = null;\n @Prop() label: string = null;\n @Prop() preamble: string = null;\n @Prop() url: string = null;\n @Prop() showMoreLabel: string = null;\n @Prop() showMoreUrl: string = null;\n\n private slider: HTMLElement = null;\n private isDragging = false;\n private startX = 0;\n private scrollLeft = 0;\n\n componentDidLoad() {\n this.slider = document.querySelector('.link-list__container') as HTMLElement;\n }\n\n private handleMouseDown = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n\n const isContainerClick = target.classList.contains('link-list__container');\n const isLinkClick = target.tagName === 'A';\n\n if (isContainerClick || isLinkClick) {\n this.isDragging = true;\n this.slider?.classList.add('link-list__active');\n this.startX = e.pageX - this.slider?.offsetLeft;\n this.scrollLeft = this.slider?.scrollLeft;\n\n if (isLinkClick) {\n e.preventDefault();\n }\n }\n };\n\n private handleMouseLeave = () => {\n this.isDragging = false;\n this.slider?.classList.remove('link-list__active');\n };\n\n private handleMouseUp = () => {\n this.isDragging = false;\n this.slider?.classList.remove('link-list__active');\n };\n\n private handleMouseMove = (e: MouseEvent) => {\n if (this.isDragging) {\n const x = e.pageX - this.slider?.offsetLeft;\n const move = (x - this.startX) * 2;\n this.slider.scrollLeft = this.scrollLeft - move;\n }\n };\n\n render() {\n return (\n <Host>\n <div class=\"link-list__header\">\n <h2 class=\"link-list__heading\">{this.heading}</h2>\n <p class=\"link-list__preamble\">{this.preamble}</p>\n </div>\n <div class=\"link-list\">\n <div\n class=\"link-list__container\"\n onMouseDown={this.handleMouseDown}\n onMouseUp={this.handleMouseUp}\n onMouseLeave={this.handleMouseLeave}\n onMouseMove={this.handleMouseMove}\n >\n <div class=\"link-list__scrollable\">\n <slot name=\"linklist\" />\n </div>\n </div>\n </div>\n {this.showMoreUrl ? (\n <div class=\"link-list__button\">\n <pn-button appearance=\"light\" href={this.showMoreUrl}>\n {this.showMoreLabel}\n </pn-button>{' '}\n </div>\n ) : (\n ''\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pn-link-list.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-link-list/pn-link-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAMzD,MAAM,OAAO,UAAU;;uBACK,IAAI;qBACN,IAAI;wBACD,IAAI;mBACT,IAAI;6BACM,IAAI;2BACN,IAAI;;IAE1B,MAAM,GAAgB,IAAI,CAAC;IAC3B,UAAU,GAAG,KAAK,CAAC;IACnB,MAAM,GAAG,CAAC,CAAC;IACX,UAAU,GAAG,CAAC,CAAC;IAEvB,gBAAgB;QACd,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,uBAAuB,CAAgB,CAAC;IAC/E,CAAC;IAEO,eAAe,GAAG,CAAC,CAAa,EAAE,EAAE;QAC1C,MAAM,MAA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,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QAClD,CAAC;IACH,CAAC,CAAC;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAC,mBAAmB;gBAC5B,2DAAI,KAAK,EAAC,oBAAoB,IAAE,IAAI,CAAC,OAAO,CAAM;gBAClD,0DAAG,KAAK,EAAC,qBAAqB,IAAE,IAAI,CAAC,QAAQ,CAAK,CAC9C;YACN,4DAAK,KAAK,EAAC,WAAW;gBACpB,4DACE,KAAK,EAAC,sBAAsB,EAC5B,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,YAAY,EAAE,IAAI,CAAC,gBAAgB,EACnC,WAAW,EAAE,IAAI,CAAC,eAAe;oBAEjC,4DAAK,KAAK,EAAC,uBAAuB;wBAChC,6DAAM,IAAI,EAAC,UAAU,GAAG,CACpB,CACF,CACF;YACL,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAClB,WAAK,KAAK,EAAC,mBAAmB;gBAC5B,iBAAW,UAAU,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,CAAC,WAAW,IACjD,IAAI,CAAC,aAAa,CACT;gBAAC,GAAG,CACZ,CACP,CAAC,CAAC,CAAC,CACF,EAAE,CACH,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'pn-link-list',\n styleUrl: 'pn-link-list.scss',\n})\nexport class PnLinkList {\n @Prop() heading: string = null;\n @Prop() label: string = null;\n @Prop() preamble: string = null;\n @Prop() url: string = null;\n @Prop() showMoreLabel: string = null;\n @Prop() showMoreUrl: string = null;\n\n private slider: HTMLElement = null;\n private isDragging = false;\n private startX = 0;\n private scrollLeft = 0;\n\n componentDidLoad() {\n this.slider = document.querySelector('.link-list__container') as HTMLElement;\n }\n\n private handleMouseDown = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n\n const isContainerClick = target.classList.contains('link-list__container');\n const isLinkClick = target.tagName === 'A';\n\n if (isContainerClick || isLinkClick) {\n this.isDragging = true;\n this.slider?.classList.add('link-list__active');\n this.startX = e.pageX - this.slider?.offsetLeft;\n this.scrollLeft = this.slider?.scrollLeft;\n\n if (isLinkClick) {\n e.preventDefault();\n }\n }\n };\n\n private handleMouseLeave = () => {\n this.isDragging = false;\n this.slider?.classList.remove('link-list__active');\n };\n\n private handleMouseUp = () => {\n this.isDragging = false;\n this.slider?.classList.remove('link-list__active');\n };\n\n private handleMouseMove = (e: MouseEvent) => {\n if (this.isDragging) {\n const x = e.pageX - this.slider?.offsetLeft;\n const move = (x - this.startX) * 2;\n this.slider.scrollLeft = this.scrollLeft - move;\n }\n };\n\n render() {\n return (\n <Host>\n <div class=\"link-list__header\">\n <h2 class=\"link-list__heading\">{this.heading}</h2>\n <p class=\"link-list__preamble\">{this.preamble}</p>\n </div>\n <div class=\"link-list\">\n <div\n class=\"link-list__container\"\n onMouseDown={this.handleMouseDown}\n onMouseUp={this.handleMouseUp}\n onMouseLeave={this.handleMouseLeave}\n onMouseMove={this.handleMouseMove}\n >\n <div class=\"link-list__scrollable\">\n <slot name=\"linklist\" />\n </div>\n </div>\n </div>\n {this.showMoreUrl ? (\n <div class=\"link-list__button\">\n <pn-button appearance=\"light\" href={this.showMoreUrl}>\n {this.showMoreLabel}\n </pn-button>{' '}\n </div>\n ) : (\n ''\n )}\n </Host>\n );\n }\n}\n"]}
@@ -13,6 +13,7 @@ export class PnPexPricefinder {
13
13
  this.when = '';
14
14
  this.response = null;
15
15
  }
16
+ hostElement;
16
17
  componentWillLoad() {
17
18
  this.init();
18
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pn-pex-pricefinder.js","sour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EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,GAAuB,CACrJ,CACF,CACG;gBACX;oBACE;wBACE,kEAAW,IAAI,EAAC,QAAQ,IAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAa,CAC7D,CACG,CACN;YACN,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CACf,WAAK,KAAK,EAAC,0BAA0B;gBACnC;oBACG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK;;oBAAG,IAAI,CAAC,QAAQ,CAClC,CACL,CACP,CAAC,CAAC,CAAC,IAAI,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Element, Prop, State, Listen } from '@stencil/core';\nimport { translations } from './translations';\nimport { PexPriceFinderi18n, PexPriceFinderResponse } from './types';\nimport { PEX_truck } from 'pn-design-assets/pn-assets/illustrations.js';\n\n@Component({\n tag: 'pn-pex-pricefinder',\n styleUrl: 'pn-pex-pricefinder.scss',\n})\nexport class PnPexPricefinder {\n @Element() hostElement: HTMLElement;\n /** Specifies which language we want to show component in (sv,da,fi,no,en) */\n @Prop() language: string = 'sv';\n /** Currency (Kr, €)*/\n @Prop() currency: string = 'Kr';\n /** API Url */\n @Prop() apiUrl: string = '/api/pex/order';\n\n @State() i18n: PexPriceFinderi18n = translations.sv;\n\n @State() fromzip: number = null;\n @State() tozip: number = null;\n @State() weight: number = 1;\n\n @State() when: string = '';\n\n @State() response: PexPriceFinderResponse = null;\n\n componentWillLoad() {\n this.init();\n }\n\n async init() {\n this.setInitialTime();\n this.checkParameters();\n this.setLanguage();\n }\n\n setInitialTime() {\n const initialTime = new Date();\n initialTime.setHours(initialTime.getHours() + 1);\n initialTime.setMinutes(0);\n const splitTime = initialTime.toLocaleString('sv', { timeZoneName: 'short' }).split(' ');\n this.when = `${splitTime[0]}T${splitTime[1].substring(0, 5)}`;\n }\n\n checkParameters() {\n const params = new URLSearchParams(window.location.href);\n if (!params) {\n return;\n }\n const paramKeys = ['fromzip', 'tozip', 'weight', 'when'];\n paramKeys.forEach(key => {\n if (params.get(key)) {\n this[key] = params.get(key);\n }\n });\n }\n\n @Listen('language')\n setLanguage() {\n if (translations[this.language]) {\n this.i18n = translations[this.language] as PexPriceFinderi18n;\n }\n }\n\n onSubmit(e) {\n e.preventDefault();\n const formData = new FormData(e.target);\n const requestQuery = this.compileRequestQuery(formData);\n this.fetchResult(requestQuery);\n }\n\n compileRequestQuery(formData: FormData) {\n let query = {\n from: formData.get('fromzip'),\n to: formData.get('tozip'),\n weight: formData.get('weight'),\n when: formData.get('when'),\n };\n if (!query.when) {\n query.when = (this.hostElement.querySelector('input.date-input') as HTMLInputElement).value;\n }\n if (!formData.get('fromzip') || !formData.get('tozip') || !formData.get('weight')) {\n console.error('Form data is not compliant');\n return;\n }\n return query;\n }\n\n async fetchResult(query: any) {\n this.response = null;\n const params = new URLSearchParams(query);\n const req = await fetch(`${this.apiUrl}?${params.toString()}`, {\n method: 'get',\n headers: {\n 'Content-Type': 'application/json',\n },\n }).catch(this.onFetchError.bind(this));\n let response = await req.json().catch(this.onFetchError.bind(this));\n if (!response) {\n response = await (await import('./mockresponse.json')).default;\n }\n if (response) {\n this.response = response as PexPriceFinderResponse;\n }\n }\n\n onFetchError(error) {\n console.error('onFetchError(error', error);\n }\n\n render() {\n return (\n <Host>\n <div class=\"pex-pricefinder-top\">\n <pn-illustration illustration={PEX_truck} />\n <h2>{this.i18n.heading}</h2>\n </div>\n <form method=\"get\" action=\"\" class=\"pex-pricefinder-form\" onSubmit={this.onSubmit.bind(this)}>\n <fieldset>\n <div>\n <pn-input type=\"number\" label={this.i18n.labelFrom} inputid=\"fromzip\" name=\"fromzip\" placeholder={this.i18n.zipPlaceholder} required value={this.fromzip}></pn-input>\n <pn-input type=\"number\" label={this.i18n.labelTo} inputid=\"tozip\" name=\"tozip\" placeholder={this.i18n.zipPlaceholder} required value={this.tozip}></pn-input>\n </div>\n </fieldset>\n <fieldset>\n <div>\n <pn-input\n type=\"number\"\n label={this.i18n.labelWeight}\n inputid=\"weight\"\n name=\"weight\"\n placeholder={this.i18n.weightPlaceholder}\n required\n value={this.weight}\n ></pn-input>\n <div class=\"datepicker\">\n <label htmlFor=\"when\">{this.i18n.labelWhen}</label>\n <pn-marketweb-input inputid=\"when\" name=\"when\" type=\"datetime-local\" min={new Date().toISOString().split('T')[0]} value={this.when}></pn-marketweb-input>\n </div>\n </div>\n </fieldset>\n <fieldset>\n <div>\n <pn-button type=\"submit\">{this.i18n.submitButtonText}</pn-button>\n </div>\n </fieldset>\n </form>\n {this.response ? (\n <div class=\"pex-pricefinder-response\">\n <strong>\n {this.response.data.value} {this.currency}\n </strong>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pn-pex-pricefinder.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAMxE,MAAM,OAAO,gBAAgB;;wBAGA,IAAI;wBAEJ,IAAI;sBAEN,gBAAgB;oBAEL,YAAY,CAAC,EAAE;uBAExB,IAAI;qBACN,IAAI;sBACH,CAAC;oBAEH,EAAE;wBAEkB,IAAI;;IAhBrC,WAAW,CAAc;IAkBpC,iBAAiB;QACf,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,KAAK,CAAC,IAAI;QACR,I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;;;;;CACF","sourcesContent":["import { Component, h, Host, Element, Prop, State, Listen } from '@stencil/core';\nimport { translations } from './translations';\nimport { PexPriceFinderi18n, PexPriceFinderResponse } from './types';\nimport { PEX_truck } from 'pn-design-assets/pn-assets/illustrations.js';\n\n@Component({\n tag: 'pn-pex-pricefinder',\n styleUrl: 'pn-pex-pricefinder.scss',\n})\nexport class PnPexPricefinder {\n @Element() hostElement: HTMLElement;\n /** Specifies which language we want to show component in (sv,da,fi,no,en) */\n @Prop() language: string = 'sv';\n /** Currency (Kr, €)*/\n @Prop() currency: string = 'Kr';\n /** API Url */\n @Prop() apiUrl: string = '/api/pex/order';\n\n @State() i18n: PexPriceFinderi18n = translations.sv;\n\n @State() fromzip: number = null;\n @State() tozip: number = null;\n @State() weight: number = 1;\n\n @State() when: string = '';\n\n @State() response: PexPriceFinderResponse = null;\n\n componentWillLoad() {\n this.init();\n }\n\n async init() {\n this.setInitialTime();\n this.checkParameters();\n this.setLanguage();\n }\n\n setInitialTime() {\n const initialTime = new Date();\n initialTime.setHours(initialTime.getHours() + 1);\n initialTime.setMinutes(0);\n const splitTime = initialTime.toLocaleString('sv', { timeZoneName: 'short' }).split(' ');\n this.when = `${splitTime[0]}T${splitTime[1].substring(0, 5)}`;\n }\n\n checkParameters() {\n const params = new URLSearchParams(window.location.href);\n if (!params) {\n return;\n }\n const paramKeys = ['fromzip', 'tozip', 'weight', 'when'];\n paramKeys.forEach(key => {\n if (params.get(key)) {\n this[key] = params.get(key);\n }\n });\n }\n\n @Listen('language')\n setLanguage() {\n if (translations[this.language]) {\n this.i18n = translations[this.language] as PexPriceFinderi18n;\n }\n }\n\n onSubmit(e) {\n e.preventDefault();\n const formData = new FormData(e.target);\n const requestQuery = this.compileRequestQuery(formData);\n this.fetchResult(requestQuery);\n }\n\n compileRequestQuery(formData: FormData) {\n let query = {\n from: formData.get('fromzip'),\n to: formData.get('tozip'),\n weight: formData.get('weight'),\n when: formData.get('when'),\n };\n if (!query.when) {\n query.when = (this.hostElement.querySelector('input.date-input') as HTMLInputElement).value;\n }\n if (!formData.get('fromzip') || !formData.get('tozip') || !formData.get('weight')) {\n console.error('Form data is not compliant');\n return;\n }\n return query;\n }\n\n async fetchResult(query: any) {\n this.response = null;\n const params = new URLSearchParams(query);\n const req = await fetch(`${this.apiUrl}?${params.toString()}`, {\n method: 'get',\n headers: {\n 'Content-Type': 'application/json',\n },\n }).catch(this.onFetchError.bind(this));\n let response = await req.json().catch(this.onFetchError.bind(this));\n if (!response) {\n response = await (await import('./mockresponse.json')).default;\n }\n if (response) {\n this.response = response as PexPriceFinderResponse;\n }\n }\n\n onFetchError(error) {\n console.error('onFetchError(error', error);\n }\n\n render() {\n return (\n <Host>\n <div class=\"pex-pricefinder-top\">\n <pn-illustration illustration={PEX_truck} />\n <h2>{this.i18n.heading}</h2>\n </div>\n <form method=\"get\" action=\"\" class=\"pex-pricefinder-form\" onSubmit={this.onSubmit.bind(this)}>\n <fieldset>\n <div>\n <pn-input type=\"number\" label={this.i18n.labelFrom} inputid=\"fromzip\" name=\"fromzip\" placeholder={this.i18n.zipPlaceholder} required value={this.fromzip}></pn-input>\n <pn-input type=\"number\" label={this.i18n.labelTo} inputid=\"tozip\" name=\"tozip\" placeholder={this.i18n.zipPlaceholder} required value={this.tozip}></pn-input>\n </div>\n </fieldset>\n <fieldset>\n <div>\n <pn-input\n type=\"number\"\n label={this.i18n.labelWeight}\n inputid=\"weight\"\n name=\"weight\"\n placeholder={this.i18n.weightPlaceholder}\n required\n value={this.weight}\n ></pn-input>\n <div class=\"datepicker\">\n <label htmlFor=\"when\">{this.i18n.labelWhen}</label>\n <pn-marketweb-input inputid=\"when\" name=\"when\" type=\"datetime-local\" min={new Date().toISOString().split('T')[0]} value={this.when}></pn-marketweb-input>\n </div>\n </div>\n </fieldset>\n <fieldset>\n <div>\n <pn-button type=\"submit\">{this.i18n.submitButtonText}</pn-button>\n </div>\n </fieldset>\n </form>\n {this.response ? (\n <div class=\"pex-pricefinder-response\">\n <strong>\n {this.response.data.value} {this.currency}\n </strong>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"]}
@@ -49,8 +49,7 @@ export class PnFindProductPricelist {
49
49
  }
50
50
  }
51
51
  filterItems() {
52
- var _a;
53
- if (!((_a = this.sourceData) === null || _a === void 0 ? void 0 : _a.data)) {
52
+ if (!this.sourceData?.data) {
54
53
  console.info('Data has not yet been loaded');
55
54
  return;
56
55
  }
@@ -110,7 +109,7 @@ export class PnFindProductPricelist {
110
109
  if (weights[this.postagetype.value].length > 6) {
111
110
  labelText = weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1 ? weight.name : '';
112
111
  }
113
- return h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {})));
112
+ return h("option", { value: weightindex, ...(labelText ? { label: labelText } : {}) });
114
113
  })))))) : null, h("div", { key: '127647cb62f60930cce591e009f1c19132857407', class: "resultlist", "data-list-count": this.filteredItems.length }, this.filteredItems.map((item) => (h("div", null, h("pn-find-price-result", { item: item })))))));
115
114
  }
116
115
  static get is() { return "pn-product-pricelist"; }
@@ -1 +1 @@
1
- {"version":3,"file":"pn-product-pricelist.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-product-pricelist/pn-product-pricelist.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAI5E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,wDAAwD;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAM7D,MAAM,OAAO,sBAAsB;;sBACR,iFAAiF;wBAC9D,IAAI;sBACN,IAAI;yBAClB,EAAE;6BAEe,EAAE;0B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CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;4BAC1I,CAAC;4BACD,OAAO,4BAAQ,KAAK,EAAE,WAAW,IAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAW,CAAC;wBAC5F,CAAC,CAAC,CACO,CACP,CACF,CACF,CACP,CAAC,CAAC,CAAC,IAAI;YAER,4DAAK,KAAK,EAAC,YAAY,qBAAkB,IAAI,CAAC,aAAa,CAAC,MAAM,IAC/D,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,CAClD;gBAEE,4BAAsB,IAAI,EAAE,IAAI,GAAyB,CACrD,CACP,CAAC,CACE,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Host, Watch } from '@stencil/core';\nimport { translations, markets } from './pn-product-pricelist-translations';\nimport { FindPriceWeight, PnfindPriceMarket, PnfindPricei18n, FindPriceSizeCategory } from '../pn-find-price/pn-find-price-types';\nimport { ProductPriceSourceData, ProductPriceItem } from '../../../globals/shared/productprice/product-price-types';\nimport { ProductPriceListi18n, ProductPriceListMarket, ProductPriceListWeight } from './pn-product-pricelist-types';\nimport { weights } from './data.js';\nimport { convertFileFromStream } from '../../../globals/shared/productprice/convert.js';\n// import { state } from \"./pn-product-pricelist-store\";\nimport { state } from '../pn-find-price/pn-find-price-store';\n\n@Component({\n tag: 'pn-product-pricelist',\n styleUrl: 'pn-product-pricelist.scss',\n})\nexport class PnFindProductPricelist {\n @Prop() source: string = 'https://com-inte.postnord.com/globalassets/global/prices/sv-findprice-1-PN.xlsx';\n @Prop({ mutable: true }) language: string = 'sv';\n @Prop({ mutable: true }) market: string = 'se';\n @Prop() productid: string = '';\n\n @State() filteredItems: ProductPriceItem[] = [];\n @State() sourceData: ProductPriceSourceData = { types: [], data: [] };\n @State() gotData: boolean = false;\n @State() loading: boolean = false;\n\n @State() postagetype: any = { value: '' };\n @State() weight: ProductPriceListWeight = { value: 0, name: '' } as ProductPriceListWeight;\n @State() weightvalue: number = 0;\n\n componentWillLoad() {\n this.setState();\n this.getDataSource().then(() => {});\n }\n\n @Watch('market')\n @Watch('language')\n setState() {\n if (this.market) {\n state.market = markets[this.market] as ProductPriceListMarket;\n }\n if (this.language && translations[this.language]) {\n state.i18n = translations[this.language] as PnfindPricei18n;\n }\n }\n\n async getDataSource() {\n if (!this.productid) {\n return;\n }\n this.loading = true;\n const cacheBusting = `?cache=${Math.floor(Math.random() * (10000 - 1) + 1)}`;\n const req = await fetch(this.source + cacheBusting);\n const reqbody = await req.blob();\n try {\n const convertedData = await convertFileFromStream(reqbody);\n this.sourceData = convertedData;\n this.filterItems();\n } catch (e) {\n this.loading = false;\n console.warn('Unable to parse data');\n }\n }\n\n @Watch('postagetype')\n @Watch('weightvalue')\n filterItems() {\n if (!this.sourceData?.data) {\n console.info('Data has not yet been loaded');\n return;\n }\n this.loading = false;\n const productIdItems = this.sourceData.data.filter(x => x.id === this.productid);\n if (productIdItems.length === 0) {\n return;\n }\n this.postagetype.value = productIdItems[0].what;\n\n if (!weights[this.postagetype.value] || weights[this.postagetype.value].length === 0) {\n return;\n }\n if (this.weightvalue === 0) {\n this.weight = weights[this.postagetype.value][0];\n this.weightvalue = this.weight.value;\n }\n\n // For letters we use grams. Otherwise we use KG\n const comparisonWeight = this.weight.abbreviation.toLocaleLowerCase() === 'kg' && this.postagetype.value === 'letter' ? this.weight.value * 1000 : this.weight.value;\n\n let weightFilteredData = productIdItems.filter(x => x.maxweight === comparisonWeight);\n\n // In parcels the maxwidths don't necessarily start at 1kg so we fetch any type below the user selected value\n if (weightFilteredData.length === 0) {\n weightFilteredData = productIdItems.filter(x => x.maxweight >= comparisonWeight);\n if (weightFilteredData.length > 0) {\n // We reverse the result array since the map will take the last unique item instead of the first\n const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item['id'], item])).values()];\n if (uniqueWeightOptions.length > 0) {\n weightFilteredData = uniqueWeightOptions;\n }\n }\n }\n\n this.filteredItems = weightFilteredData;\n\n this.gotData = this.filteredItems.length > 0;\n }\n\n render() {\n return (\n <Host>\n <div class=\"content\">\n <slot />\n </div>\n\n {this.loading ? <pn-spinner></pn-spinner> : null}\n\n {this.postagetype.value && weights[this.postagetype.value] ? (\n <div class=\"weightselection\">\n <div class=\"weightoption\">\n <div class=\"weightoption-input\">\n <pn-input\n inputid=\"weightvalue\"\n name=\"weightvalue\"\n type=\"number\"\n label={state.i18n.weightlabel}\n value={this.weightvalue}\n onChange={e => {\n if (e && e.target && e.target.value) {\n const weightNum = parseInt(e.target.value, 10);\n if (!isNaN(weightNum)) {\n let matchingWeights = (weights[this.postagetype.value] as ProductPriceListWeight[]).filter(x => {\n let weightInGrams = x.abbreviation === 'kg' ? x.value * 1000 : x.value;\n return weightInGrams >= weightNum;\n });\n if (matchingWeights && matchingWeights.length > 0) {\n this.weight = matchingWeights[0];\n this.weightvalue = this.weight.value;\n }\n }\n }\n }}\n ></pn-input>\n <span class=\"weightoption-input-abbreviation\">{this.weight.abbreviation}</span>\n </div>\n <div class=\"weightoption-range\">\n <input\n type=\"range\"\n id=\"weightrange\"\n name=\"weightrange\"\n list=\"weightlist\"\n value={!this.weight.value ? 0 : weights[this.postagetype.value].findIndex(x => x.value === this.weightvalue)}\n onChange={e => {\n const value = (e.target as HTMLInputElement).value;\n this.weight = weights[this.postagetype.value][value];\n this.weightvalue = this.weight.value;\n }}\n min=\"0\"\n // max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }\n max={weights[this.postagetype.value].length - 1}\n />\n <datalist id=\"weightlist\">\n {weights[this.postagetype.value].map((weight, weightindex) => {\n let labelText = weight.name;\n if (weights[this.postagetype.value].length > 6) {\n labelText = weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1 ? weight.name : '';\n }\n return <option value={weightindex} {...(labelText ? { label: labelText } : {})}></option>;\n })}\n </datalist>\n </div>\n </div>\n </div>\n ) : null}\n\n <div class=\"resultlist\" data-list-count={this.filteredItems.length}>\n {this.filteredItems.map((item: ProductPriceItem) => (\n <div>\n {/* <pn-product-pricelist-result item={item}></pn-product-pricelist-result> */}\n <pn-find-price-result item={item}></pn-find-price-result>\n </div>\n ))}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pn-product-pricelist.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-product-pricelist/pn-product-pricelist.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAI5E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,wDAAwD;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAM7D,MAAM,OAAO,sBAAsB;;sBACR,iFAAiF;wBAC9D,IAAI;sBACN,IAAI;yBAClB,EAAE;6BAEe,EAAE;0BACD,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;uBACzC,KAAK;uBACL,KAAK;2BAEL,EAAE,KAAK,EAAE,EAAE,EAAE;sBACC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAA4B;2BAC3D,CAAC;;IAEhC,iBAAiB;QACf,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,C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IAAI;YAER,4DAAK,KAAK,EAAC,YAAY,qBAAkB,IAAI,CAAC,aAAa,CAAC,MAAM,IAC/D,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,CAClD;gBAEE,4BAAsB,IAAI,EAAE,IAAI,GAAyB,CACrD,CACP,CAAC,CACE,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Host, Watch } from '@stencil/core';\nimport { translations, markets } from './pn-product-pricelist-translations';\nimport { FindPriceWeight, PnfindPriceMarket, PnfindPricei18n, FindPriceSizeCategory } from '../pn-find-price/pn-find-price-types';\nimport { ProductPriceSourceData, ProductPriceItem } from '../../../globals/shared/productprice/product-price-types';\nimport { ProductPriceListi18n, ProductPriceListMarket, ProductPriceListWeight } from './pn-product-pricelist-types';\nimport { weights } from './data.js';\nimport { convertFileFromStream } from '../../../globals/shared/productprice/convert.js';\n// import { state } from \"./pn-product-pricelist-store\";\nimport { state } from '../pn-find-price/pn-find-price-store';\n\n@Component({\n tag: 'pn-product-pricelist',\n styleUrl: 'pn-product-pricelist.scss',\n})\nexport class PnFindProductPricelist {\n @Prop() source: string = 'https://com-inte.postnord.com/globalassets/global/prices/sv-findprice-1-PN.xlsx';\n @Prop({ mutable: true }) language: string = 'sv';\n @Prop({ mutable: true }) market: string = 'se';\n @Prop() productid: string = '';\n\n @State() filteredItems: ProductPriceItem[] = [];\n @State() sourceData: ProductPriceSourceData = { types: [], data: [] };\n @State() gotData: boolean = false;\n @State() loading: boolean = false;\n\n @State() postagetype: any = { value: '' };\n @State() weight: ProductPriceListWeight = { value: 0, name: '' } as ProductPriceListWeight;\n @State() weightvalue: number = 0;\n\n componentWillLoad() {\n this.setState();\n this.getDataSource().then(() => {});\n }\n\n @Watch('market')\n @Watch('language')\n setState() {\n if (this.market) {\n state.market = markets[this.market] as ProductPriceListMarket;\n }\n if (this.language && translations[this.language]) {\n state.i18n = translations[this.language] as PnfindPricei18n;\n }\n }\n\n async getDataSource() {\n if (!this.productid) {\n return;\n }\n this.loading = true;\n const cacheBusting = `?cache=${Math.floor(Math.random() * (10000 - 1) + 1)}`;\n const req = await fetch(this.source + cacheBusting);\n const reqbody = await req.blob();\n try {\n const convertedData = await convertFileFromStream(reqbody);\n this.sourceData = convertedData;\n this.filterItems();\n } catch (e) {\n this.loading = false;\n console.warn('Unable to parse data');\n }\n }\n\n @Watch('postagetype')\n @Watch('weightvalue')\n filterItems() {\n if (!this.sourceData?.data) {\n console.info('Data has not yet been loaded');\n return;\n }\n this.loading = false;\n const productIdItems = this.sourceData.data.filter(x => x.id === this.productid);\n if (productIdItems.length === 0) {\n return;\n }\n this.postagetype.value = productIdItems[0].what;\n\n if (!weights[this.postagetype.value] || weights[this.postagetype.value].length === 0) {\n return;\n }\n if (this.weightvalue === 0) {\n this.weight = weights[this.postagetype.value][0];\n this.weightvalue = this.weight.value;\n }\n\n // For letters we use grams. Otherwise we use KG\n const comparisonWeight = this.weight.abbreviation.toLocaleLowerCase() === 'kg' && this.postagetype.value === 'letter' ? this.weight.value * 1000 : this.weight.value;\n\n let weightFilteredData = productIdItems.filter(x => x.maxweight === comparisonWeight);\n\n // In parcels the maxwidths don't necessarily start at 1kg so we fetch any type below the user selected value\n if (weightFilteredData.length === 0) {\n weightFilteredData = productIdItems.filter(x => x.maxweight >= comparisonWeight);\n if (weightFilteredData.length > 0) {\n // We reverse the result array since the map will take the last unique item instead of the first\n const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item['id'], item])).values()];\n if (uniqueWeightOptions.length > 0) {\n weightFilteredData = uniqueWeightOptions;\n }\n }\n }\n\n this.filteredItems = weightFilteredData;\n\n this.gotData = this.filteredItems.length > 0;\n }\n\n render() {\n return (\n <Host>\n <div class=\"content\">\n <slot />\n </div>\n\n {this.loading ? <pn-spinner></pn-spinner> : null}\n\n {this.postagetype.value && weights[this.postagetype.value] ? (\n <div class=\"weightselection\">\n <div class=\"weightoption\">\n <div class=\"weightoption-input\">\n <pn-input\n inputid=\"weightvalue\"\n name=\"weightvalue\"\n type=\"number\"\n label={state.i18n.weightlabel}\n value={this.weightvalue}\n onChange={e => {\n if (e && e.target && e.target.value) {\n const weightNum = parseInt(e.target.value, 10);\n if (!isNaN(weightNum)) {\n let matchingWeights = (weights[this.postagetype.value] as ProductPriceListWeight[]).filter(x => {\n let weightInGrams = x.abbreviation === 'kg' ? x.value * 1000 : x.value;\n return weightInGrams >= weightNum;\n });\n if (matchingWeights && matchingWeights.length > 0) {\n this.weight = matchingWeights[0];\n this.weightvalue = this.weight.value;\n }\n }\n }\n }}\n ></pn-input>\n <span class=\"weightoption-input-abbreviation\">{this.weight.abbreviation}</span>\n </div>\n <div class=\"weightoption-range\">\n <input\n type=\"range\"\n id=\"weightrange\"\n name=\"weightrange\"\n list=\"weightlist\"\n value={!this.weight.value ? 0 : weights[this.postagetype.value].findIndex(x => x.value === this.weightvalue)}\n onChange={e => {\n const value = (e.target as HTMLInputElement).value;\n this.weight = weights[this.postagetype.value][value];\n this.weightvalue = this.weight.value;\n }}\n min=\"0\"\n // max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }\n max={weights[this.postagetype.value].length - 1}\n />\n <datalist id=\"weightlist\">\n {weights[this.postagetype.value].map((weight, weightindex) => {\n let labelText = weight.name;\n if (weights[this.postagetype.value].length > 6) {\n labelText = weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1 ? weight.name : '';\n }\n return <option value={weightindex} {...(labelText ? { label: labelText } : {})}></option>;\n })}\n </datalist>\n </div>\n </div>\n </div>\n ) : null}\n\n <div class=\"resultlist\" data-list-count={this.filteredItems.length}>\n {this.filteredItems.map((item: ProductPriceItem) => (\n <div>\n {/* <pn-product-pricelist-result item={item}></pn-product-pricelist-result> */}\n <pn-find-price-result item={item}></pn-find-price-result>\n </div>\n ))}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -28,7 +28,6 @@ export class PnProxioFindPriceResult {
28
28
  this.shownitems = [this.item];
29
29
  }
30
30
  getPriceString(product) {
31
- var _a, _b;
32
31
  if (!product.productWeightGroupList) {
33
32
  return null;
34
33
  }
@@ -36,41 +35,38 @@ export class PnProxioFindPriceResult {
36
35
  let price = '';
37
36
  if (this.showInternational && this.selectedCountrycode && this.selectedCountrycode !== this.market && product.weightPriceCountryList) {
38
37
  let weightPriceCountryList = product.weightPriceCountryList.filter(item => item.item3.includes(this.selectedCountrycode.toUpperCase()));
39
- price = weightPriceCountryList ? (_a = weightPriceCountryList[activeIndex]) === null || _a === void 0 ? void 0 : _a.item2 : '';
38
+ price = weightPriceCountryList ? weightPriceCountryList[activeIndex]?.item2 : '';
40
39
  }
41
40
  else {
42
- price = product.weightAndPriceList ? (_b = product === null || product === void 0 ? void 0 : product.weightAndPriceList[activeIndex]) === null || _b === void 0 ? void 0 : _b.item2 : '';
41
+ price = product.weightAndPriceList ? product?.weightAndPriceList[activeIndex]?.item2 : '';
43
42
  }
44
43
  return price ? this.i18n.from + price : '';
45
44
  }
46
45
  getProductLink(product, productWeightGroupList) {
47
- var _a;
48
46
  if (product.productWeightGroupList) {
49
47
  const activeIndex = product.productWeightGroupList.findIndex(item => item.item1 === this.activeweight);
50
- let productId = (_a = productWeightGroupList[activeIndex]) === null || _a === void 0 ? void 0 : _a.item2;
51
- let productLink = product.productLink ? product === null || product === void 0 ? void 0 : product.productLink : '';
48
+ let productId = productWeightGroupList[activeIndex]?.item2;
49
+ let productLink = product.productLink ? product?.productLink : '';
52
50
  return productLink ? productLink + (productId ? '?productId=' + productId : '') : '';
53
51
  }
54
52
  return null;
55
53
  }
56
54
  getDeliveryInformation(product) {
57
- var _a, _b;
58
55
  if (!this.showInternational || !product.deliveryDateInternationalInformation) {
59
56
  return product.deliveryDateInformation;
60
57
  }
61
- const internationalShipment = (_a = product === null || product === void 0 ? void 0 : product.deliveryDateInternationalInformation) === null || _a === void 0 ? void 0 : _a.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
62
- if ((_b = !(internationalShipment === null || internationalShipment === void 0 ? void 0 : internationalShipment.item2)) !== null && _b !== void 0 ? _b : true) {
58
+ const internationalShipment = product?.deliveryDateInternationalInformation?.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
59
+ if (!internationalShipment?.item2 ?? true) {
63
60
  return product.deliveryDateInformation;
64
61
  }
65
62
  return internationalShipment.item2;
66
63
  }
67
64
  getInsuranceAmountText(product) {
68
- var _a, _b;
69
65
  if (!product.insuranceAmounts) {
70
66
  return '';
71
67
  }
72
- const insuranceAmount = (_a = product === null || product === void 0 ? void 0 : product.insuranceAmounts) === null || _a === void 0 ? void 0 : _a.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
73
- if ((_b = !(insuranceAmount === null || insuranceAmount === void 0 ? void 0 : insuranceAmount.item2)) !== null && _b !== void 0 ? _b : true) {
68
+ const insuranceAmount = product?.insuranceAmounts?.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
69
+ if (!insuranceAmount?.item2 ?? true) {
74
70
  return '';
75
71
  }
76
72
  return insuranceAmount.item2;