@postnord/pn-marketweb-components 4.1.1 → 4.2.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 (337) hide show
  1. package/cjs/loader.cjs.js +1 -1
  2. package/cjs/pn-chat-message_2.cjs.entry.js +5 -5
  3. package/cjs/pn-chat-message_2.cjs.entry.js.map +1 -1
  4. package/cjs/pn-chat.cjs.entry.js +18 -6
  5. package/cjs/pn-chat.cjs.entry.js.map +1 -1
  6. package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js +17 -3
  7. package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js.map +1 -1
  8. package/cjs/pn-market-web-components.cjs.js +1 -1
  9. package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js +53 -3
  10. package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js.map +1 -1
  11. package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.stories.js +4 -0
  12. package/collection/components/widgets/pn-chat/pn-chat-message/pn-chat-message.css +27 -10
  13. package/collection/components/widgets/pn-chat/pn-chat-message/pn-chat-message.js +3 -3
  14. package/collection/components/widgets/pn-chat/pn-chat-message/pn-chat-message.js.map +1 -1
  15. package/collection/components/widgets/pn-chat/pn-chat-stories-constants.js +18 -0
  16. package/collection/components/widgets/pn-chat/pn-chat-stories-constants.js.map +1 -1
  17. package/collection/components/widgets/pn-chat/pn-chat.css +24 -13
  18. package/collection/components/widgets/pn-chat/pn-chat.js +17 -5
  19. package/collection/components/widgets/pn-chat/pn-chat.js.map +1 -1
  20. package/collection/components/widgets/pn-chat/pn-chat.stories.js +43 -0
  21. package/collection/components/widgets/pn-chat/pn-chat.stories.js.map +1 -1
  22. package/components/pn-chat-message2.js +5 -5
  23. package/components/pn-chat-message2.js.map +1 -1
  24. package/components/pn-chat.js +18 -6
  25. package/components/pn-chat.js.map +1 -1
  26. package/components/pn-dropdown-choice-adds-row.js +19 -3
  27. package/components/pn-dropdown-choice-adds-row.js.map +1 -1
  28. package/esm/loader.js +1 -1
  29. package/esm/pn-chat-message_2.entry.js +5 -5
  30. package/esm/pn-chat-message_2.entry.js.map +1 -1
  31. package/esm/pn-chat.entry.js +18 -6
  32. package/esm/pn-chat.entry.js.map +1 -1
  33. package/esm/pn-dropdown-choice-adds-row.entry.js +17 -3
  34. package/esm/pn-dropdown-choice-adds-row.entry.js.map +1 -1
  35. package/esm/pn-market-web-components.js +1 -1
  36. package/package.json +14 -17
  37. package/pn-market-web-components/p-4a8ef165.entry.js +2 -0
  38. package/pn-market-web-components/p-4a8ef165.entry.js.map +1 -0
  39. package/pn-market-web-components/p-62ce6700.entry.js +2 -0
  40. package/pn-market-web-components/p-62ce6700.entry.js.map +1 -0
  41. package/pn-market-web-components/p-6f6ed930.entry.js +2 -0
  42. package/pn-market-web-components/p-6f6ed930.entry.js.map +1 -0
  43. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  44. package/pn-market-web-components/pn-market-web-components.esm.js.map +1 -1
  45. package/types/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.d.ts +2 -0
  46. package/types/components/widgets/pn-chat/pn-chat-stories-constants.d.ts +18 -0
  47. package/types/components/widgets/pn-chat/pn-chat.stories.d.ts +1 -0
  48. package/types/components.d.ts +4 -0
  49. package/umd/modules/@postnord/web-components/cjs/{index-BNXSyZmU.js → index-CNdVg5VI.js} +1 -1
  50. package/umd/modules/@postnord/web-components/cjs/{index-CAMqnx70.js → index-CfUQZtlH.js} +245 -1884
  51. package/umd/modules/@postnord/web-components/cjs/index.cjs.js +8 -5
  52. package/umd/modules/@postnord/web-components/cjs/loader.cjs.js +2 -2
  53. package/umd/modules/@postnord/web-components/cjs/pn-accordion-row.cjs.entry.js +1 -1
  54. package/umd/modules/@postnord/web-components/cjs/pn-accordion.cjs.entry.js +1 -1
  55. package/umd/modules/@postnord/web-components/cjs/pn-action-menu.cjs.entry.js +2 -2
  56. package/umd/modules/@postnord/web-components/cjs/pn-button-dropdown.cjs.entry.js +1 -1
  57. package/umd/modules/@postnord/web-components/cjs/pn-button_2.cjs.entry.js +1 -1
  58. package/umd/modules/@postnord/web-components/cjs/pn-card.cjs.entry.js +2 -2
  59. package/umd/modules/@postnord/web-components/cjs/pn-checkbox.cjs.entry.js +2 -2
  60. package/umd/modules/@postnord/web-components/cjs/pn-choice-chip.cjs.entry.js +1 -1
  61. package/umd/modules/@postnord/web-components/cjs/pn-counter.cjs.entry.js +13 -15
  62. package/umd/modules/@postnord/web-components/cjs/pn-date-picker.cjs.entry.js +12 -6
  63. package/umd/modules/@postnord/web-components/cjs/pn-fieldset.cjs.entry.js +2 -2
  64. package/umd/modules/@postnord/web-components/cjs/pn-file-upload.cjs.entry.js +2 -2
  65. package/umd/modules/@postnord/web-components/cjs/pn-footer.cjs.entry.js +2 -2
  66. package/umd/modules/@postnord/web-components/cjs/pn-header.cjs.entry.js +2 -2
  67. package/umd/modules/@postnord/web-components/cjs/pn-icon_2.cjs.entry.js +1 -1
  68. package/umd/modules/@postnord/web-components/cjs/pn-illustration.cjs.entry.js +1 -1
  69. package/umd/modules/@postnord/web-components/cjs/pn-input.cjs.entry.js +33 -16
  70. package/umd/modules/@postnord/web-components/cjs/pn-modal.cjs.entry.js +1 -1
  71. package/umd/modules/@postnord/web-components/cjs/pn-multiselect.cjs.entry.js +16 -5
  72. package/umd/modules/@postnord/web-components/cjs/pn-ocr-search.cjs.entry.js +2 -2
  73. package/umd/modules/@postnord/web-components/cjs/pn-page-nav-dropdown-item.cjs.entry.js +2 -2
  74. package/umd/modules/@postnord/web-components/cjs/pn-page-nav-item.cjs.entry.js +2 -2
  75. package/umd/modules/@postnord/web-components/cjs/pn-page-nav.cjs.entry.js +2 -2
  76. package/umd/modules/@postnord/web-components/cjs/pn-pagination.cjs.entry.js +2 -2
  77. package/umd/modules/@postnord/web-components/cjs/pn-progress-bar.cjs.entry.js +1 -1
  78. package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator-step.cjs.entry.js +1 -1
  79. package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator.cjs.entry.js +1 -1
  80. package/umd/modules/@postnord/web-components/cjs/pn-progress-stepper.cjs.entry.js +1 -1
  81. package/umd/modules/@postnord/web-components/cjs/pn-radio-button.cjs.entry.js +3 -3
  82. package/umd/modules/@postnord/web-components/cjs/pn-range.cjs.entry.js +3 -3
  83. package/umd/modules/@postnord/web-components/cjs/pn-read-only-button.cjs.entry.js +1 -1
  84. package/umd/modules/@postnord/web-components/cjs/pn-search-field.cjs.entry.js +2 -2
  85. package/umd/modules/@postnord/web-components/cjs/pn-segment.cjs.entry.js +2 -2
  86. package/umd/modules/@postnord/web-components/cjs/pn-segmented-control.cjs.entry.js +2 -2
  87. package/umd/modules/@postnord/web-components/cjs/pn-select.cjs.entry.js +10 -3
  88. package/umd/modules/@postnord/web-components/cjs/pn-tab.cjs.entry.js +2 -2
  89. package/umd/modules/@postnord/web-components/cjs/pn-table.cjs.entry.js +1 -1
  90. package/umd/modules/@postnord/web-components/cjs/pn-tablist.cjs.entry.js +2 -2
  91. package/umd/modules/@postnord/web-components/cjs/pn-text-link.cjs.entry.js +2 -2
  92. package/umd/modules/@postnord/web-components/cjs/pn-textarea.cjs.entry.js +19 -9
  93. package/umd/modules/@postnord/web-components/cjs/pn-tile.cjs.entry.js +2 -2
  94. package/umd/modules/@postnord/web-components/cjs/pn-toast.cjs.entry.js +2 -2
  95. package/umd/modules/@postnord/web-components/cjs/pn-toggle-switch.cjs.entry.js +3 -3
  96. package/umd/modules/@postnord/web-components/cjs/pn-tooltip.cjs.entry.js +1 -1
  97. package/umd/modules/@postnord/web-components/cjs/pn-wizard.cjs.entry.js +1 -1
  98. package/umd/modules/@postnord/web-components/cjs/pn-zipcode-search.cjs.entry.js +2 -2
  99. package/umd/modules/@postnord/web-components/cjs/postnord-web-components.cjs.js +3 -3
  100. package/umd/modules/@postnord/web-components/collection/collection-manifest.json +1 -1
  101. package/umd/modules/@postnord/web-components/collection/components/input/pn-counter/pn-counter.css +69 -27
  102. package/umd/modules/@postnord/web-components/collection/components/input/pn-counter/pn-counter.js +34 -13
  103. package/umd/modules/@postnord/web-components/collection/components/input/pn-date-picker/pn-date-picker.css +38 -1
  104. package/umd/modules/@postnord/web-components/collection/components/input/pn-date-picker/pn-date-picker.js +32 -3
  105. package/umd/modules/@postnord/web-components/collection/components/input/pn-fieldset/pn-fieldset.js +1 -1
  106. package/umd/modules/@postnord/web-components/collection/components/input/pn-file-upload/pn-file-upload.js +1 -1
  107. package/umd/modules/@postnord/web-components/collection/components/input/pn-input/pn-input.css +48 -9
  108. package/umd/modules/@postnord/web-components/collection/components/input/pn-input/pn-input.js +55 -15
  109. package/umd/modules/@postnord/web-components/collection/components/input/pn-multiselect/pn-multiselect.css +63 -22
  110. package/umd/modules/@postnord/web-components/collection/components/input/pn-multiselect/pn-multiselect.js +36 -2
  111. package/umd/modules/@postnord/web-components/collection/components/input/pn-radio-button/pn-radio-button.js +1 -1
  112. package/umd/modules/@postnord/web-components/collection/components/input/pn-range/pn-range.css +1 -1
  113. package/umd/modules/@postnord/web-components/collection/components/input/pn-range/pn-range.js +1 -1
  114. package/umd/modules/@postnord/web-components/collection/components/input/pn-search-field/pn-search-field.js +1 -1
  115. package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/pn-segmented-control.js +1 -1
  116. package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/segment/pn-segment.js +1 -1
  117. package/umd/modules/@postnord/web-components/collection/components/input/pn-select/pn-select.css +53 -14
  118. package/umd/modules/@postnord/web-components/collection/components/input/pn-select/pn-select.js +31 -1
  119. package/umd/modules/@postnord/web-components/collection/components/input/pn-textarea/pn-textarea.css +54 -5
  120. package/umd/modules/@postnord/web-components/collection/components/input/pn-textarea/pn-textarea.js +45 -13
  121. package/umd/modules/@postnord/web-components/collection/components/input/pn-toggle-switch/pn-toggle-switch.css +1 -1
  122. package/umd/modules/@postnord/web-components/collection/components/input/pn-toggle-switch/pn-toggle-switch.js +1 -1
  123. package/umd/modules/@postnord/web-components/collection/components/layout/pn-header/pn-header.js +1 -1
  124. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-card/pn-card.js +1 -1
  125. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-footer/pn-footer.js +1 -1
  126. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/dropdown-item/pn-page-nav-dropdown-item.js +1 -1
  127. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/item/pn-page-nav-item.js +1 -1
  128. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/menu/pn-page-nav.js +1 -1
  129. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-pagination/pn-pagination.js +1 -1
  130. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/pn-tablist.js +1 -1
  131. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/tab/pn-tab.js +1 -1
  132. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-text-link/pn-text-link.js +1 -1
  133. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tile/pn-tile.js +1 -1
  134. package/umd/modules/@postnord/web-components/collection/components/web-components/pn-ocr-search/pn-ocr-search.js +1 -1
  135. package/umd/modules/@postnord/web-components/collection/components/web-components/pn-zipcode-search/pn-zipcode-search.js +1 -1
  136. package/umd/modules/@postnord/web-components/components/helpers.js +1 -1
  137. package/umd/modules/@postnord/web-components/components/pn-card.js +1 -1
  138. package/umd/modules/@postnord/web-components/components/pn-counter.js +1 -1
  139. package/umd/modules/@postnord/web-components/components/pn-date-picker.js +1 -1
  140. package/umd/modules/@postnord/web-components/components/pn-fieldset.js +1 -1
  141. package/umd/modules/@postnord/web-components/components/pn-file-upload.js +1 -1
  142. package/umd/modules/@postnord/web-components/components/pn-footer.js +1 -1
  143. package/umd/modules/@postnord/web-components/components/pn-header.js +1 -1
  144. package/umd/modules/@postnord/web-components/components/pn-input2.js +1 -1
  145. package/umd/modules/@postnord/web-components/components/pn-multiselect.js +1 -1
  146. package/umd/modules/@postnord/web-components/components/pn-ocr-search.js +1 -1
  147. package/umd/modules/@postnord/web-components/components/pn-page-nav-dropdown-item.js +1 -1
  148. package/umd/modules/@postnord/web-components/components/pn-page-nav-item.js +1 -1
  149. package/umd/modules/@postnord/web-components/components/pn-page-nav.js +1 -1
  150. package/umd/modules/@postnord/web-components/components/pn-pagination.js +1 -1
  151. package/umd/modules/@postnord/web-components/components/pn-radio-button.js +1 -1
  152. package/umd/modules/@postnord/web-components/components/pn-range.js +1 -1
  153. package/umd/modules/@postnord/web-components/components/pn-search-field2.js +1 -1
  154. package/umd/modules/@postnord/web-components/components/pn-segment.js +1 -1
  155. package/umd/modules/@postnord/web-components/components/pn-segmented-control.js +1 -1
  156. package/umd/modules/@postnord/web-components/components/pn-select2.js +1 -1
  157. package/umd/modules/@postnord/web-components/components/pn-tab.js +1 -1
  158. package/umd/modules/@postnord/web-components/components/pn-tablist.js +1 -1
  159. package/umd/modules/@postnord/web-components/components/pn-text-link2.js +1 -1
  160. package/umd/modules/@postnord/web-components/components/pn-textarea.js +1 -1
  161. package/umd/modules/@postnord/web-components/components/pn-tile.js +1 -1
  162. package/umd/modules/@postnord/web-components/components/pn-toggle-switch.js +1 -1
  163. package/umd/modules/@postnord/web-components/components/pn-zipcode-search.js +1 -1
  164. package/umd/modules/@postnord/web-components/esm/{index-DWsprozV.js → index-CAEP792y.js} +245 -1884
  165. package/umd/modules/@postnord/web-components/esm/{index-BhpZuCL7.js → index-CosyroON.js} +1 -1
  166. package/umd/modules/@postnord/web-components/esm/index.js +9 -6
  167. package/umd/modules/@postnord/web-components/esm/loader.js +3 -3
  168. package/umd/modules/@postnord/web-components/esm/pn-accordion-row.entry.js +1 -1
  169. package/umd/modules/@postnord/web-components/esm/pn-accordion.entry.js +1 -1
  170. package/umd/modules/@postnord/web-components/esm/pn-action-menu.entry.js +2 -2
  171. package/umd/modules/@postnord/web-components/esm/pn-button-dropdown.entry.js +1 -1
  172. package/umd/modules/@postnord/web-components/esm/pn-button_2.entry.js +1 -1
  173. package/umd/modules/@postnord/web-components/esm/pn-card.entry.js +2 -2
  174. package/umd/modules/@postnord/web-components/esm/pn-checkbox.entry.js +2 -2
  175. package/umd/modules/@postnord/web-components/esm/pn-choice-chip.entry.js +1 -1
  176. package/umd/modules/@postnord/web-components/esm/pn-counter.entry.js +13 -15
  177. package/umd/modules/@postnord/web-components/esm/pn-date-picker.entry.js +12 -6
  178. package/umd/modules/@postnord/web-components/esm/pn-fieldset.entry.js +2 -2
  179. package/umd/modules/@postnord/web-components/esm/pn-file-upload.entry.js +2 -2
  180. package/umd/modules/@postnord/web-components/esm/pn-footer.entry.js +2 -2
  181. package/umd/modules/@postnord/web-components/esm/pn-header.entry.js +2 -2
  182. package/umd/modules/@postnord/web-components/esm/pn-icon_2.entry.js +1 -1
  183. package/umd/modules/@postnord/web-components/esm/pn-illustration.entry.js +1 -1
  184. package/umd/modules/@postnord/web-components/esm/pn-input.entry.js +33 -16
  185. package/umd/modules/@postnord/web-components/esm/pn-modal.entry.js +1 -1
  186. package/umd/modules/@postnord/web-components/esm/pn-multiselect.entry.js +16 -5
  187. package/umd/modules/@postnord/web-components/esm/pn-ocr-search.entry.js +2 -2
  188. package/umd/modules/@postnord/web-components/esm/pn-page-nav-dropdown-item.entry.js +2 -2
  189. package/umd/modules/@postnord/web-components/esm/pn-page-nav-item.entry.js +2 -2
  190. package/umd/modules/@postnord/web-components/esm/pn-page-nav.entry.js +2 -2
  191. package/umd/modules/@postnord/web-components/esm/pn-pagination.entry.js +2 -2
  192. package/umd/modules/@postnord/web-components/esm/pn-progress-bar.entry.js +1 -1
  193. package/umd/modules/@postnord/web-components/esm/pn-progress-indicator-step.entry.js +1 -1
  194. package/umd/modules/@postnord/web-components/esm/pn-progress-indicator.entry.js +1 -1
  195. package/umd/modules/@postnord/web-components/esm/pn-progress-stepper.entry.js +1 -1
  196. package/umd/modules/@postnord/web-components/esm/pn-radio-button.entry.js +3 -3
  197. package/umd/modules/@postnord/web-components/esm/pn-range.entry.js +3 -3
  198. package/umd/modules/@postnord/web-components/esm/pn-read-only-button.entry.js +1 -1
  199. package/umd/modules/@postnord/web-components/esm/pn-search-field.entry.js +2 -2
  200. package/umd/modules/@postnord/web-components/esm/pn-segment.entry.js +2 -2
  201. package/umd/modules/@postnord/web-components/esm/pn-segmented-control.entry.js +2 -2
  202. package/umd/modules/@postnord/web-components/esm/pn-select.entry.js +10 -3
  203. package/umd/modules/@postnord/web-components/esm/pn-tab.entry.js +2 -2
  204. package/umd/modules/@postnord/web-components/esm/pn-table.entry.js +1 -1
  205. package/umd/modules/@postnord/web-components/esm/pn-tablist.entry.js +2 -2
  206. package/umd/modules/@postnord/web-components/esm/pn-text-link.entry.js +2 -2
  207. package/umd/modules/@postnord/web-components/esm/pn-textarea.entry.js +19 -9
  208. package/umd/modules/@postnord/web-components/esm/pn-tile.entry.js +2 -2
  209. package/umd/modules/@postnord/web-components/esm/pn-toast.entry.js +2 -2
  210. package/umd/modules/@postnord/web-components/esm/pn-toggle-switch.entry.js +3 -3
  211. package/umd/modules/@postnord/web-components/esm/pn-tooltip.entry.js +1 -1
  212. package/umd/modules/@postnord/web-components/esm/pn-wizard.entry.js +1 -1
  213. package/umd/modules/@postnord/web-components/esm/pn-zipcode-search.entry.js +2 -2
  214. package/umd/modules/@postnord/web-components/esm/postnord-web-components.js +4 -4
  215. package/umd/modules/@postnord/web-components/hydrate/index.js +3597 -3562
  216. package/umd/modules/@postnord/web-components/hydrate/index.mjs +3597 -3562
  217. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/index.cjs +1 -18
  218. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/index.js +1 -18
  219. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/package.json +1 -1
  220. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/package.json +1 -1
  221. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/stencil.js +70 -12
  222. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/index.js +1 -1
  223. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/package.json +1 -1
  224. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/connector.html +2 -2
  225. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/index.js +1 -1
  226. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/package.json +1 -1
  227. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/server-process.js +2 -19
  228. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/app-data/package.json +1 -1
  229. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/app-globals/package.json +1 -1
  230. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/index.js +214 -1832
  231. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/package.json +1 -1
  232. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/patch-browser.js +1 -1
  233. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/shadow-css.js +3 -3
  234. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/index.js +5172 -5086
  235. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/package.json +1 -1
  236. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/runner.js +234 -263
  237. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/package.json +1 -1
  238. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-public-compiler.d.ts +10 -0
  239. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/index.js +113 -74
  240. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/jsx-dev-runtime.d.ts +2 -0
  241. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/jsx-dev-runtime.js +8 -0
  242. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/jsx-runtime.d.ts +2 -0
  243. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/jsx-runtime.js +9 -0
  244. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/package.json +1 -1
  245. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/index.cjs +13 -25
  246. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/index.d.ts +4 -3
  247. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/index.js +13 -25
  248. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/package.json +1 -1
  249. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/package.json +13 -2
  250. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/index.js +1 -18
  251. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/package.json +1 -1
  252. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/pixel-match.js +1 -1
  253. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/index.js +34 -34
  254. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/package.json +1 -1
  255. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/worker.js +1 -1
  256. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/index.js +19 -1
  257. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/package.json +1 -1
  258. package/umd/modules/@postnord/web-components/package.json +19 -19
  259. package/umd/modules/@postnord/web-components/postnord-web-components/index.esm.js +1 -1
  260. package/umd/modules/@postnord/web-components/postnord-web-components/{p-215a8bab.entry.js → p-01ac1c67.entry.js} +1 -1
  261. package/umd/modules/@postnord/web-components/postnord-web-components/p-0dd15cc3.entry.js +5 -0
  262. package/umd/modules/@postnord/web-components/postnord-web-components/{p-f94947bd.entry.js → p-0e94a4dd.entry.js} +1 -1
  263. package/umd/modules/@postnord/web-components/postnord-web-components/{p-511bdc31.entry.js → p-0ed2ee53.entry.js} +1 -1
  264. package/umd/modules/@postnord/web-components/postnord-web-components/{p-e545c35d.entry.js → p-109ba1fc.entry.js} +1 -1
  265. package/umd/modules/@postnord/web-components/postnord-web-components/p-153311c8.entry.js +5 -0
  266. package/umd/modules/@postnord/web-components/postnord-web-components/{p-9d3890d0.entry.js → p-1a3c49ba.entry.js} +1 -1
  267. package/umd/modules/@postnord/web-components/postnord-web-components/{p-c9b8ed0a.entry.js → p-2610f8ab.entry.js} +1 -1
  268. package/umd/modules/@postnord/web-components/postnord-web-components/p-267c323e.entry.js +5 -0
  269. package/umd/modules/@postnord/web-components/postnord-web-components/{p-dfa861a7.entry.js → p-2a364778.entry.js} +1 -1
  270. package/umd/modules/@postnord/web-components/postnord-web-components/{p-5cbd90c0.entry.js → p-2a682ff9.entry.js} +1 -1
  271. package/umd/modules/@postnord/web-components/postnord-web-components/{p-b54f1a65.entry.js → p-2cce8a9f.entry.js} +1 -1
  272. package/umd/modules/@postnord/web-components/postnord-web-components/{p-44a6fe18.entry.js → p-2f4ad4a4.entry.js} +1 -1
  273. package/umd/modules/@postnord/web-components/postnord-web-components/{p-c867fce9.entry.js → p-306ec758.entry.js} +1 -1
  274. package/umd/modules/@postnord/web-components/postnord-web-components/{p-1d7b9fe8.entry.js → p-38e44ed0.entry.js} +1 -1
  275. package/umd/modules/@postnord/web-components/postnord-web-components/{p-66b77e7e.entry.js → p-3c96cb61.entry.js} +1 -1
  276. package/umd/modules/@postnord/web-components/postnord-web-components/{p-7ec29574.entry.js → p-3d2cac86.entry.js} +1 -1
  277. package/umd/modules/@postnord/web-components/postnord-web-components/{p-499ce292.entry.js → p-3d459401.entry.js} +1 -1
  278. package/umd/modules/@postnord/web-components/postnord-web-components/{p-795f8d58.entry.js → p-3deb5a9e.entry.js} +1 -1
  279. package/umd/modules/@postnord/web-components/postnord-web-components/p-41c09d4d.entry.js +5 -0
  280. package/umd/modules/@postnord/web-components/postnord-web-components/p-484dfaa4.entry.js +5 -0
  281. package/umd/modules/@postnord/web-components/postnord-web-components/{p-61af0540.entry.js → p-50116c0d.entry.js} +1 -1
  282. package/umd/modules/@postnord/web-components/postnord-web-components/{p-b8b5201d.entry.js → p-502b8430.entry.js} +1 -1
  283. package/umd/modules/@postnord/web-components/postnord-web-components/{p-96871fc2.entry.js → p-5b7c1333.entry.js} +1 -1
  284. package/umd/modules/@postnord/web-components/postnord-web-components/{p-3bc56c7f.entry.js → p-67f55491.entry.js} +1 -1
  285. package/umd/modules/@postnord/web-components/postnord-web-components/{p-cc1291a6.entry.js → p-838c17b9.entry.js} +1 -1
  286. package/umd/modules/@postnord/web-components/postnord-web-components/{p-e221d65e.entry.js → p-849d48c6.entry.js} +1 -1
  287. package/umd/modules/@postnord/web-components/postnord-web-components/{p-584c2057.entry.js → p-89aaa3c8.entry.js} +1 -1
  288. package/umd/modules/@postnord/web-components/postnord-web-components/{p-2becf18d.entry.js → p-8b2b6f5d.entry.js} +1 -1
  289. package/umd/modules/@postnord/web-components/postnord-web-components/p-93db2b9e.entry.js +5 -0
  290. package/umd/modules/@postnord/web-components/postnord-web-components/{p-99d7a33d.entry.js → p-97ffc4b3.entry.js} +1 -1
  291. package/umd/modules/@postnord/web-components/postnord-web-components/{p-0j4cY0b7.js → p-BlM_xfdt.js} +1 -1
  292. package/umd/modules/@postnord/web-components/postnord-web-components/p-CAEP792y.js +6 -0
  293. package/umd/modules/@postnord/web-components/postnord-web-components/{p-26233654.entry.js → p-b0710b87.entry.js} +1 -1
  294. package/umd/modules/@postnord/web-components/postnord-web-components/p-b3c4e3e8.entry.js +5 -0
  295. package/umd/modules/@postnord/web-components/postnord-web-components/{p-e5d0281b.entry.js → p-b8c4423b.entry.js} +1 -1
  296. package/umd/modules/@postnord/web-components/postnord-web-components/p-ba59528f.entry.js +5 -0
  297. package/umd/modules/@postnord/web-components/postnord-web-components/{p-92aa5cfa.entry.js → p-c0ae367c.entry.js} +1 -1
  298. package/umd/modules/@postnord/web-components/postnord-web-components/{p-ddc430a5.entry.js → p-c4c4c75b.entry.js} +1 -1
  299. package/umd/modules/@postnord/web-components/postnord-web-components/p-c843ae5e.entry.js +5 -0
  300. package/umd/modules/@postnord/web-components/postnord-web-components/{p-323e7706.entry.js → p-d1e27524.entry.js} +1 -1
  301. package/umd/modules/@postnord/web-components/postnord-web-components/{p-190d83cf.entry.js → p-d214e930.entry.js} +1 -1
  302. package/umd/modules/@postnord/web-components/postnord-web-components/{p-66fdb323.entry.js → p-d7091312.entry.js} +1 -1
  303. package/umd/modules/@postnord/web-components/postnord-web-components/{p-8f732dd9.entry.js → p-db2b7e5d.entry.js} +1 -1
  304. package/umd/modules/@postnord/web-components/postnord-web-components/p-e3fb693e.entry.js +5 -0
  305. package/umd/modules/@postnord/web-components/postnord-web-components/{p-10cb744b.entry.js → p-e83de0b1.entry.js} +1 -1
  306. package/umd/modules/@postnord/web-components/postnord-web-components/{p-bde90f4f.entry.js → p-ea50ecd2.entry.js} +1 -1
  307. package/umd/modules/@postnord/web-components/postnord-web-components/{p-1c376e6a.entry.js → p-edc28eee.entry.js} +1 -1
  308. package/umd/modules/@postnord/web-components/postnord-web-components/postnord-web-components.esm.js +1 -1
  309. package/umd/modules/@postnord/web-components/types/components/input/pn-counter/pn-counter.d.ts +27 -26
  310. package/umd/modules/@postnord/web-components/types/components/input/pn-input/pn-input.d.ts +9 -0
  311. package/umd/modules/@postnord/web-components/types/components/input/pn-select/pn-select.d.ts +3 -0
  312. package/umd/modules/@postnord/web-components/types/components/input/pn-textarea/pn-textarea.d.ts +10 -8
  313. package/umd/modules/@postnord/web-components/types/components.d.ts +72 -0
  314. package/umd/modules/@postnord/web-components/vscode-data.json +24 -0
  315. package/umd/pn-marketweb-init.js +1 -1
  316. package/umd/pn-marketweb-salesforce.js +1 -1
  317. package/vscode-data.json +8 -0
  318. package/collection/components/data-visualization/pn-stats-info/pn-stats-info-data/animationHelper.test.js +0 -95
  319. package/collection/components/data-visualization/pn-stats-info/pn-stats-info-data/animationHelper.test.js.map +0 -1
  320. package/pn-market-web-components/p-22a8fd6e.entry.js +0 -2
  321. package/pn-market-web-components/p-22a8fd6e.entry.js.map +0 -1
  322. package/pn-market-web-components/p-8afc2d30.entry.js +0 -2
  323. package/pn-market-web-components/p-8afc2d30.entry.js.map +0 -1
  324. package/pn-market-web-components/p-f97e58b8.entry.js +0 -2
  325. package/pn-market-web-components/p-f97e58b8.entry.js.map +0 -1
  326. package/types/components/data-visualization/pn-stats-info/pn-stats-info-data/animationHelper.test.d.ts +0 -1
  327. package/umd/modules/@postnord/web-components/postnord-web-components/p-1bd12040.entry.js +0 -5
  328. package/umd/modules/@postnord/web-components/postnord-web-components/p-5a36a4ce.entry.js +0 -5
  329. package/umd/modules/@postnord/web-components/postnord-web-components/p-5ca4200c.entry.js +0 -5
  330. package/umd/modules/@postnord/web-components/postnord-web-components/p-8751c301.entry.js +0 -5
  331. package/umd/modules/@postnord/web-components/postnord-web-components/p-DWsprozV.js +0 -6
  332. package/umd/modules/@postnord/web-components/postnord-web-components/p-a6363f85.entry.js +0 -5
  333. package/umd/modules/@postnord/web-components/postnord-web-components/p-b46922c6.entry.js +0 -5
  334. package/umd/modules/@postnord/web-components/postnord-web-components/p-de3ae08d.entry.js +0 -5
  335. package/umd/modules/@postnord/web-components/postnord-web-components/p-e6c7e352.entry.js +0 -5
  336. package/umd/modules/@postnord/web-components/postnord-web-components/p-ee6a305b.entry.js +0 -5
  337. package/umd/modules/@postnord/web-components/postnord-web-components/p-f667cb91.entry.js +0 -5
@@ -2,4 +2,4 @@
2
2
  * Built with Stencil
3
3
  * By PostNord.
4
4
  */
5
- import{transformTag as e,proxyCustomElement as i,HTMLElement as t,createEvent as l,h as n,Host as s}from"@stencil/core/internal/client";import{u as a,g as o,k as r,o as d,e as p}from"./helpers.js";import{a as c}from"./alert_exclamation_circle.js";import{c as h}from"./check.js";import{d as f}from"./pn-button2.js";import{d as u}from"./pn-icon2.js";import{d as m}from"./pn-progress-bar2.js";import{d as b}from"./pn-spinner2.js";class g extends Error{element;code;data;constructor(e,i,t="INVALID",l=null){super(e),this.name="PNFileUploadError",this.element=i,this.code=t,this.data=l}}const v={CLICKORDRAG:{sv:"Klicka eller dra en fil hit",en:"Click or drag a file here",da:"Klik eller træk en fil hertil",fi:"Klikkaa tai vedä tiedosto tähän",no:"Klikk eller dra en fil hit"},ACCEPTEDFORMATS:{sv:"Filformat som stöds",en:"Supported formats",da:"Støttede filformater",fi:"Tuetut tiedostomuodot",no:"Understøttede filformater"},MAXFILESIZE:{sv:"Max filstorlek",en:"Max filesize",da:"Max filstørrelse",fi:"Maksimitiedostokoko",no:"Maks filstørrelse"},REMOVE_FILE:{sv:"Ta bort filen",en:"Remove file",da:"Fjern fil",fi:"Poista tiedosto",no:"Fjern fil"}},y=i(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.filesAdded=l(this,"filesAdded",7),this.update=l(this,"update",7),this.fileuploaderror=l(this,"fileuploaderror",7),this.valid=l(this,"valid",7),this.uploadFile=l(this,"uploadFile",7),this.uploadCancelled=l(this,"uploadCancelled",7),this.uploadCompleted=l(this,"uploadCompleted",7)}id="pn-file-upload-"+a();idFileUpload=this.id+"-label";idHelpertext=this.id+"-helpertext";idAccepttext=this.id+"-accept";fileInputElement;invalid=!1;maxSizeInBytes=0;get hostElement(){return this}files=[];isHovering=!1;label;helpertext;language=null;hideProgress=!1;name;accept;maxSize="";capture;limit=1;multiple;required=!1;disabled=!1;handleLimit(){this.multiple=this.limit>1}handleMaxBytes(){this.maxSizeInBytes=o(this.maxSize)}filesAdded;update;fileuploaderror;valid;uploadFile;uploadCancelled;uploadCompleted;async componentWillLoad(){this.handleLimit(),this.handleMaxBytes(),null===this.language&&await r(this.hostElement)}async startUpload(){if(!this.files.length)return;this.files=this.files.map(((e,i)=>("queue"===e.status&&(e.status="start",this.uploadFile.emit({file:e,index:i,uploader:this})),e)));const e=this.files.map((e=>e.xhrPromise().catch((()=>{}))));return Promise.all(e).then((e=>{const i=e.filter((e=>e));this.uploadCompleted.emit(i)}))}async clearUpload(){this.files=[],this.fileInputElement.value="",this.invalid=!1,this.filesAdded.emit([])}async removeFile(e){let i=!0;const t=[];for(const l in this.files){const n=this.files[l];if(n.filename)if(n.uuid!==e.uuid){try{this._validateFileSize(n),this._validateFileType(n),i=!0}catch(e){i=!1,n.error=e,n.progress=0,n.status="error"}t.push(n)}else"start"===n.status&&(n.xhr.abort(),this.uploadCancelled.emit(n))}this.filesAdded.emit(t),this.files=t,this.invalid=!i||!this._isNotGreaterThanLimit(),this._checkValidity(),this._emitUpdateEvent()}async updateFile(e,i=null){let t=this.files;if(null===i)for(const l in t)if(t[l].uuid===e.uuid){i=l;break}t[i]&&(e.progress>=100?(e.progress=100,e.status="completed"):e.progress<0&&(e.status="start",e.progress=0),e.error&&(e.progress=0,e.status="error",e.errorMessage=e.errorMessage||"There was an error uploading your file, please try again"),t[i]=e),this.files=[...t]}async _addFilesFromFileList(e){if(this.disabled||this.invalid)return;const i=Array.from(e),t=[];if(this.multiple)i.forEach((e=>t.push(this._addFile(e))));else{const e=i[0];1===this.limit?(this.files=[],t.push(this._addFile(e))):t.push(this._addFile(e))}return Promise.all(t).then((()=>{this.filesAdded.emit(this.files),this._isNotGreaterThanLimit(),this._checkValidity(),this._emitUpdateEvent()}))}async _onAddFile(){const e=this.fileInputElement.files;return await this._addFilesFromFileList(e)}_onDragOverFile(e){e.preventDefault(),e.stopPropagation(),this.isHovering=!0}_onDragLeaveFile(e){e.preventDefault(),e.stopPropagation(),this.isHovering=!1}_onDropFile(e){e.preventDefault(),e.stopPropagation(),this.isHovering=!1,d(e,this.hostElement,".pn-dropzone-inner"),this._addFilesFromFileList(e.dataTransfer.files)}_validateFileType(e){const i=this.accept?this.accept.split(","):[];if(i.length){let t=!1;for(const l of i){const i=l.trim().toLowerCase(),n=/^\w+\/[a-z\.\-]+$/i,s=e.filename.match(/\.\w{3,4}($|\?)/)?.[0]?.toLowerCase();if(n.test(i)&&e.contentType===i||s===i){t=!0;break}}if(!t){const i=new g("Invalid file type.",this.hostElement,"INVALID_FILE_TYPE",e);throw this.invalid=!0,this.fileuploaderror.emit(i),i}}}_validateFileSize(e){if(this.maxSizeInBytes>0&&e.filesize>this.maxSizeInBytes){const i=new g(`You can only add up to ${this.maxSize}.`,this.hostElement,"MAX_FILE_SIZE",e);throw this.invalid=!0,this.fileuploaderror.emit(i),i}}_validateLimit(){if(this.limit&&this.files.length>this.limit){const e=new g(`You can only add up to ${this.limit} files.`,this.hostElement,"MAX_LIMIT",this.files);throw this.invalid=!0,this.fileuploaderror.emit(e),e}}_isNotGreaterThanLimit(){try{return this._validateLimit(),!0}catch(e){return!1}}_checkValidity(){return this.invalid||this.valid.emit(this),!this.invalid}_createBase64FromFile(e){return new Promise(((i,t)=>{const l=new FileReader;l.onload=()=>i(l.result),l.onerror=e=>t(e),l.onabort=()=>t("ABORTED"),l.readAsDataURL(e)}))}async _addFile(e){return this._createBase64FromFile(e).then((i=>{const t=i.split(","),l=t[1],n=t[0].split(":")[1].split(";")[0],s=new XMLHttpRequest,o={uuid:a(),filename:e.name,filesize:e.size,progress:0,status:"queue",base64:l,contentType:n,error:null,errorMessage:"",file:e,xhr:s};try{this._validateFileSize(o),this._validateFileType(o)}catch(e){o.error=e,o.progress=0,o.status="error"}return o.xhrPromise=()=>new Promise(((e,i)=>{s.responseType="json",s.addEventListener("progress",(e=>{e.lengthComputable?(o.progress=e.loaded/e.total*100,this.updateFile(o)):(o.progress=100,this.updateFile(o))})),s.addEventListener("load",(i=>e(i.target.response))),s.addEventListener("error",(e=>{o.error=e,o.errorMessage="There was an error uploading your file, please try again",this.updateFile(o);const t=new g("There was an error uploading your file, please try again",this.hostElement,"UPLOAD_SERVER_ERROR",o);this.fileuploaderror.emit(t),i(e)}))})),this.files=[...this.files,o],o}))}_emitUpdateEvent(){this.update.emit({files:this.files,element:this.hostElement})}translate(e){return v?.[e]?.[this.language||p]||e}isLoading(e){return"start"===e.status}getFileItemClass=e=>{let i="files-list-item";return e.error&&(i+=" files-list-item-error"),i};getFileIcon(e){return e.error?c:100===e.progress?h:'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M9 7.5a4.5 4.5 0 1 1 9 0V16a6 6 0 0 1-12 0v-3a1 1 0 1 1 2 0v3a4 4 0 0 0 8 0V7.5a2.5 2.5 0 0 0-5 0V16a1 1 0 1 0 2 0v-6a1 1 0 1 1 2 0v6a3 3 0 1 1-6 0zM7 9a1 1 0 0 1 1 1v.1a1 1 0 1 1-2 0V10a1 1 0 0 1 1-1" clip-rule="evenodd"/></svg>'}getFileColor(e){return e.error?"warning":100===e.progress?"green700":"gray900"}describedBy(){const e=[this.accept&&this.idAccepttext,this.helpertext&&this.idHelpertext].filter(Boolean);return e.length?e.join(","):null}render(){return n(s,{key:"1c7df13d284805a69618cac9130a3599dac09afa"},n("div",{key:"e6f37c7ac6e0283c06049562b3e20b11cf89f1c3",class:"pn-file-upload-container"},n("div",{key:"7647d0f6afdccef876e8c86b084b7b1106715764",class:"pn-dropzone-container"},n("input",{key:"a5cc41ce25c13ef1d4046b0fb9c45372da932b86",id:this.idFileUpload,class:"pn-file-upload-input",type:"file",name:this.name,multiple:this.multiple,accept:this.accept,capture:this.capture,disabled:this.disabled,required:this.required,"aria-describedby":this.describedBy(),"aria-invalid":this.invalid?.toString(),onClick:e=>d(e,this.hostElement,".pn-dropzone-inner"),onChange:()=>this._onAddFile(),onDragOver:e=>this._onDragOverFile(e),onDragLeave:e=>this._onDragLeaveFile(e),onDrop:e=>this._onDropFile(e),ref:e=>this.fileInputElement=e}),n("div",{key:"ccd799f14663e8d645fcea967e526a4be89324dd",class:"pn-dropzone-inner","data-hover":this.isHovering,"data-invalid":this.invalid},n("pn-icon",{key:"42c98b09e804d9fa8747c16cfe20773dfecd286c",class:"pn-file-upload-icon-element",icon:'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M3 8a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v7a3 3 0 0 1-3 3h-2a1 1 0 1 1 0-2h2a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h2a1 1 0 1 1 0 2H6a3 3 0 0 1-3-3zm9 0a1 1 0 0 1 .707.293l4 4a1 1 0 0 1-1.414 1.414L13 11.414V17a1 1 0 1 1-2 0v-5.586l-2.293 2.293a1 1 0 0 1-1.414-1.414l4-4A1 1 0 0 1 12 8m-1 12.1V20a1 1 0 1 1 2 0v.1a1 1 0 1 1-2 0" clip-rule="evenodd"/></svg>',color:"blue700"}),n("label",{key:"d4c0d0d127830a82cc6c05e6b2bdb7007b87384c",htmlFor:this.idFileUpload,class:"pn-file-upload-title"},this.label||this.translate("CLICKORDRAG")),this.helpertext&&n("p",{key:"7dc83f69dd408af25194e644075ab7d852da4564",id:this.idHelpertext,class:"pn-file-upload-subtitle"},this.helpertext),this.accept&&n("p",{key:"64ba6ca78c6b2c9b626e7c4d4ca45074bbd0a6c7",id:this.idAccepttext,class:"pn-file-upload-subtitle"},this.translate("ACCEPTEDFORMATS"),": ",this.accept,this.maxSize&&n("span",{key:"1bf59a1291145d6adc7e9c6c2516f98e4b1522b2"}," ","(",this.translate("MAXFILESIZE"),": ",this.maxSize,")")))),!!this.files.length&&n("ul",{key:"06a0f4c327edee2c192e8b8fb38eb9ce5ab7e51a",class:"files-list"},this.files.map((e=>n("li",{class:"files-list-item-container",key:e.uuid},n("div",{class:this.getFileItemClass(e)},n("div",{class:"file-list-item-title"},n("pn-icon",{icon:this.getFileIcon(e),color:this.getFileColor(e)}),this.hideProgress||0===e.progress?n("div",{class:"filename"},e.filename):n("pn-progress-bar",{label:e.filename,progress:e.progress,error:e.error&&e.errorMessage})),n("pn-button",{small:!0,variant:"borderless",arialabel:`${this.translate("REMOVE_FILE")} ${e.filename}`,appearance:e.error?"warning":"light",icon:'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M10.5 4a1 1 0 0 0-1 1h5a1 1 0 0 0-1-1zm6 1a3 3 0 0 0-3-3h-3a3 3 0 0 0-3 3h-2A2.5 2.5 0 0 0 5 9.95V19a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V9.95A2.5 2.5 0 0 0 18.5 5zm.5 5H7v9a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1zM5.5 7a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1zm4.5 5a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1m4 0a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1" clip-rule="evenodd"/></svg>',iconOnly:!0,tooltip:this.translate("REMOVE_FILE"),loading:this.isLoading(e),onClick:()=>this.removeFile(e)})),e.error?n("div",{class:"files-list-item-text-error"},e.errorMessage||e.error.message):null)))),n("slot",{key:"38c1a1703b7d2c418ecc76823f32248c5d8b1ec7"})))}static get watchers(){return{limit:[{handleLimit:0}],maxSize:[{handleMaxBytes:0}]}}static get style(){return`${e("pn-file-upload")}.hover .pn-file-upload-container .pn-dropzone-container{background-color:#e0f8ff}${e("pn-file-upload")} .pn-file-upload-input{position:absolute;z-index:1;left:0;top:0;opacity:0;height:100%;width:100%;-webkit-tap-highlight-color:transparent}${e("pn-file-upload")} .pn-file-upload-input:hover{cursor:pointer}${e("pn-file-upload")} .pn-file-upload-input:hover+.pn-dropzone-inner{border-color:#005d92;background-color:#e0f8ff}${e("pn-file-upload")} .pn-file-upload-input:focus-visible+.pn-dropzone-inner{border-color:#005d92;outline-color:#005d92}${e("pn-file-upload")} .pn-file-upload-input:disabled{pointer-events:none}${e("pn-file-upload")} .pn-file-upload-input:disabled+.pn-dropzone-inner{pointer-events:none;background-color:#f3f2f2;border-color:#2d2013}${e("pn-file-upload")} .pn-file-upload-input:disabled+.pn-dropzone-inner .headline a{color:#5e554a}${e("pn-file-upload")} .pn-file-upload-input:disabled+.pn-dropzone-inner .pn-icon-svg path{fill:#5e554a}${e("pn-file-upload")} .pn-file-upload-container{position:relative;display:flex;flex-direction:column;gap:1em}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-container{position:relative}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner{position:relative;text-align:center;overflow:hidden;padding:2.5em;border:0.0625em #969087 dashed;border-radius:0.5em;display:flex;flex-direction:column;align-items:center;gap:0.5em;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, outline-color, border-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner{transition-duration:0s;transition-delay:0s}}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner .pn-ripple{animation:ripple 0.4s cubic-bezier(0.7, 0, 0.3, 1);position:absolute;border-radius:50%;background-color:#005d92;transform:translate(-50%, -50%) scale(0);opacity:0.1;pointer-events:none;z-index:3}@keyframes ripple{to{transform:translate(-50%, -50%) scale(1);opacity:0}}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner[data-hover]{background-color:#e0f8ff;border-color:#005d92}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner[data-invalid]{border-color:#a70707}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner .pn-file-upload-dropzone{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:0.5em}${e("pn-file-upload")} .files-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:1em}${e("pn-file-upload")} .files-list .filename{font-weight:400;font-size:0.75em}${e("pn-file-upload")} .files-list .files-list-item{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;align-items:center;background:#f9f8f8;padding:1em;border-radius:0.5em}${e("pn-file-upload")} .files-list .files-list-item .file-list-item-title{display:flex;align-items:center;gap:0.5em;margin-right:0.5em}${e("pn-file-upload")} .files-list .files-list-item>${e("pn-progress-bar")}{margin-right:25em;flex:1}${e("pn-file-upload")} .files-list .files-list-item.files-list-item-error{color:#a70707;background-color:#fdefee}${e("pn-file-upload")} .files-list .files-list-item-text-error{color:#a70707;font-size:0.875em;font-weight:300;margin-top:0.25em}${e("pn-file-upload")} .pn-file-upload-title{color:#2d2013}${e("pn-file-upload")} .pn-file-upload-subtitle{color:#5e554a;font-size:0.75em}`}},[772,"pn-file-upload",{label:[1],helpertext:[1],language:[1],hideProgress:[4,"hide-progress"],name:[1],accept:[1],maxSize:[1,"max-size"],capture:[1],limit:[2],multiple:[1028],required:[4],disabled:[4],files:[32],isHovering:[32],startUpload:[64],clearUpload:[64],removeFile:[64],updateFile:[64]},void 0,{limit:[{handleLimit:0}],maxSize:[{handleMaxBytes:0}]}]),k=y,w=function(){"undefined"!=typeof customElements&&["pn-file-upload","pn-button","pn-icon","pn-progress-bar","pn-spinner"].forEach((i=>{switch(i){case"pn-file-upload":customElements.get(e(e(i)))||customElements.define(e(e(i)),y);break;case"pn-button":customElements.get(e(e(i)))||f();break;case"pn-icon":customElements.get(e(e(i)))||u();break;case"pn-progress-bar":customElements.get(e(e(i)))||m();break;case"pn-spinner":customElements.get(e(e(i)))||b()}}))};export{k as PnFileUpload,w as defineCustomElement}
5
+ import{transformTag as e,proxyCustomElement as i,HTMLElement as t,createEvent as l,h as n,Host as s}from"@stencil/core/internal/client";import{u as a,g as o,k as r,o as d,e as p}from"./helpers.js";import{a as c}from"./alert_exclamation_circle.js";import{c as h}from"./check.js";import{d as f}from"./pn-button2.js";import{d as u}from"./pn-icon2.js";import{d as m}from"./pn-progress-bar2.js";import{d as g}from"./pn-spinner2.js";class b extends Error{element;code;data;constructor(e,i,t="INVALID",l=null){super(e),this.name="PNFileUploadError",this.element=i,this.code=t,this.data=l}}const v={CLICKORDRAG:{sv:"Klicka eller dra en fil hit",en:"Click or drag a file here",da:"Klik eller træk en fil hertil",fi:"Klikkaa tai vedä tiedosto tähän",no:"Klikk eller dra en fil hit"},ACCEPTEDFORMATS:{sv:"Filformat som stöds",en:"Supported formats",da:"Støttede filformater",fi:"Tuetut tiedostomuodot",no:"Understøttede filformater"},MAXFILESIZE:{sv:"Max filstorlek",en:"Max filesize",da:"Max filstørrelse",fi:"Maksimitiedostokoko",no:"Maks filstørrelse"},REMOVE_FILE:{sv:"Ta bort filen",en:"Remove file",da:"Fjern fil",fi:"Poista tiedosto",no:"Fjern fil"}},y=i(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.filesAdded=l(this,"filesAdded",7),this.update=l(this,"update",7),this.fileuploaderror=l(this,"fileuploaderror",7),this.valid=l(this,"valid",7),this.uploadFile=l(this,"uploadFile",7),this.uploadCancelled=l(this,"uploadCancelled",7),this.uploadCompleted=l(this,"uploadCompleted",7)}id="pn-file-upload-"+a();idFileUpload=this.id+"-label";idHelpertext=this.id+"-helpertext";idAccepttext=this.id+"-accept";fileInputElement;invalid=!1;maxSizeInBytes=0;get hostElement(){return this}files=[];isHovering=!1;label;helpertext;language=null;hideProgress=!1;name;accept;maxSize="";capture;limit=1;multiple;required=!1;disabled=!1;handleLimit(){this.multiple=this.limit>1}handleMaxBytes(){this.maxSizeInBytes=o(this.maxSize)}filesAdded;update;fileuploaderror;valid;uploadFile;uploadCancelled;uploadCompleted;async componentWillLoad(){this.handleLimit(),this.handleMaxBytes(),null===this.language&&await r(this.hostElement)}async startUpload(){if(!this.files.length)return;this.files=this.files.map(((e,i)=>("queue"===e.status&&(e.status="start",this.uploadFile.emit({file:e,index:i,uploader:this})),e)));const e=this.files.map((e=>e.xhrPromise().catch((()=>{}))));return Promise.all(e).then((e=>{const i=e.filter((e=>e));this.uploadCompleted.emit(i)}))}async clearUpload(){this.files=[],this.fileInputElement.value="",this.invalid=!1,this.filesAdded.emit([])}async removeFile(e){let i=!0;const t=[];for(const l in this.files){const n=this.files[l];if(n.filename)if(n.uuid!==e.uuid){try{this._validateFileSize(n),this._validateFileType(n),i=!0}catch(e){i=!1,n.error=e,n.progress=0,n.status="error"}t.push(n)}else"start"===n.status&&(n.xhr.abort(),this.uploadCancelled.emit(n))}this.filesAdded.emit(t),this.files=t,this.invalid=!i||!this._isNotGreaterThanLimit(),this._checkValidity(),this._emitUpdateEvent()}async updateFile(e,i=null){let t=this.files;if(null===i)for(const l in t)if(t[l].uuid===e.uuid){i=l;break}t[i]&&(e.progress>=100?(e.progress=100,e.status="completed"):e.progress<0&&(e.status="start",e.progress=0),e.error&&(e.progress=0,e.status="error",e.errorMessage=e.errorMessage||"There was an error uploading your file, please try again"),t[i]=e),this.files=[...t]}async _addFilesFromFileList(e){if(this.disabled||this.invalid)return;const i=Array.from(e),t=[];if(this.multiple)i.forEach((e=>t.push(this._addFile(e))));else{const e=i[0];1===this.limit?(this.files=[],t.push(this._addFile(e))):t.push(this._addFile(e))}return Promise.all(t).then((()=>{this.filesAdded.emit(this.files),this._isNotGreaterThanLimit(),this._checkValidity(),this._emitUpdateEvent()}))}async _onAddFile(){const e=this.fileInputElement.files;return await this._addFilesFromFileList(e)}_onDragOverFile(e){e.preventDefault(),e.stopPropagation(),this.isHovering=!0}_onDragLeaveFile(e){e.preventDefault(),e.stopPropagation(),this.isHovering=!1}_onDropFile(e){e.preventDefault(),e.stopPropagation(),this.isHovering=!1,d(e,this.hostElement,".pn-dropzone-inner"),this._addFilesFromFileList(e.dataTransfer.files)}_validateFileType(e){const i=this.accept?this.accept.split(","):[];if(i.length){let t=!1;for(const l of i){const i=l.trim().toLowerCase(),n=/^\w+\/[a-z\.\-]+$/i,s=e.filename.match(/\.\w{3,4}($|\?)/)?.[0]?.toLowerCase();if(n.test(i)&&e.contentType===i||s===i){t=!0;break}}if(!t){const i=new b("Invalid file type.",this.hostElement,"INVALID_FILE_TYPE",e);throw this.invalid=!0,this.fileuploaderror.emit(i),i}}}_validateFileSize(e){if(this.maxSizeInBytes>0&&e.filesize>this.maxSizeInBytes){const i=new b(`You can only add up to ${this.maxSize}.`,this.hostElement,"MAX_FILE_SIZE",e);throw this.invalid=!0,this.fileuploaderror.emit(i),i}}_validateLimit(){if(this.limit&&this.files.length>this.limit){const e=new b(`You can only add up to ${this.limit} files.`,this.hostElement,"MAX_LIMIT",this.files);throw this.invalid=!0,this.fileuploaderror.emit(e),e}}_isNotGreaterThanLimit(){try{return this._validateLimit(),!0}catch(e){return!1}}_checkValidity(){return this.invalid||this.valid.emit(this),!this.invalid}_createBase64FromFile(e){return new Promise(((i,t)=>{const l=new FileReader;l.onload=()=>i(l.result),l.onerror=e=>t(e),l.onabort=()=>t("ABORTED"),l.readAsDataURL(e)}))}async _addFile(e){return this._createBase64FromFile(e).then((i=>{const t=i.split(","),l=t[1],n=t[0].split(":")[1].split(";")[0],s=new XMLHttpRequest,o={uuid:a(),filename:e.name,filesize:e.size,progress:0,status:"queue",base64:l,contentType:n,error:null,errorMessage:"",file:e,xhr:s};try{this._validateFileSize(o),this._validateFileType(o)}catch(e){o.error=e,o.progress=0,o.status="error"}return o.xhrPromise=()=>new Promise(((e,i)=>{s.responseType="json",s.addEventListener("progress",(e=>{e.lengthComputable?(o.progress=e.loaded/e.total*100,this.updateFile(o)):(o.progress=100,this.updateFile(o))})),s.addEventListener("load",(i=>e(i.target.response))),s.addEventListener("error",(e=>{o.error=e,o.errorMessage="There was an error uploading your file, please try again",this.updateFile(o);const t=new b("There was an error uploading your file, please try again",this.hostElement,"UPLOAD_SERVER_ERROR",o);this.fileuploaderror.emit(t),i(e)}))})),this.files=[...this.files,o],o}))}_emitUpdateEvent(){this.update.emit({files:this.files,element:this.hostElement})}translate(e){return v?.[e]?.[this.language||p]||e}isLoading(e){return"start"===e.status}getFileItemClass=e=>{let i="files-list-item";return e.error&&(i+=" files-list-item-error"),i};getFileIcon(e){return e.error?c:100===e.progress?h:'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M9 7.5a4.5 4.5 0 1 1 9 0V16a6 6 0 0 1-12 0v-3a1 1 0 1 1 2 0v3a4 4 0 0 0 8 0V7.5a2.5 2.5 0 0 0-5 0V16a1 1 0 1 0 2 0v-6a1 1 0 1 1 2 0v6a3 3 0 1 1-6 0zM7 9a1 1 0 0 1 1 1v.1a1 1 0 1 1-2 0V10a1 1 0 0 1 1-1" clip-rule="evenodd"/></svg>'}getFileColor(e){return e.error?"warning":100===e.progress?"green700":"gray900"}describedBy(){const e=[this.accept&&this.idAccepttext,this.helpertext&&this.idHelpertext].filter(Boolean);return e.length?e.join(","):null}render(){return n(s,{key:"bce5d5c3684f31a2841ecf631155ab384f318879"},n("div",{key:"07abc549d0ad86fb818f446e4fa223e3b4ea6c84",class:"pn-file-upload-container"},n("div",{key:"1a9d09dd8cf39db11dc741732a7c04276e10a6a9",class:"pn-dropzone-container"},n("input",{key:"387071f47d9aa658929448b041285c01d5187da4",id:this.idFileUpload,class:"pn-file-upload-input",type:"file",name:this.name,multiple:this.multiple,accept:this.accept,capture:this.capture,disabled:this.disabled,required:this.required,"aria-describedby":this.describedBy(),"aria-invalid":this.invalid?.toString(),onClick:e=>d(e,this.hostElement,".pn-dropzone-inner"),onChange:()=>this._onAddFile(),onDragOver:e=>this._onDragOverFile(e),onDragLeave:e=>this._onDragLeaveFile(e),onDrop:e=>this._onDropFile(e),ref:e=>this.fileInputElement=e}),n("div",{key:"71c627aa6044908835b0f6e2227d7744da76680e",class:"pn-dropzone-inner","data-hover":this.isHovering,"data-invalid":this.invalid},n("pn-icon",{key:"a621fd0abb16c8c7b2efcb67932a0e50e12942dd",class:"pn-file-upload-icon-element",icon:'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M3 8a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v7a3 3 0 0 1-3 3h-2a1 1 0 1 1 0-2h2a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h2a1 1 0 1 1 0 2H6a3 3 0 0 1-3-3zm9 0a1 1 0 0 1 .707.293l4 4a1 1 0 0 1-1.414 1.414L13 11.414V17a1 1 0 1 1-2 0v-5.586l-2.293 2.293a1 1 0 0 1-1.414-1.414l4-4A1 1 0 0 1 12 8m-1 12.1V20a1 1 0 1 1 2 0v.1a1 1 0 1 1-2 0" clip-rule="evenodd"/></svg>',color:"blue700"}),n("label",{key:"cc90d1af83fe3814b8ea9991bcdf85c40f48f874",htmlFor:this.idFileUpload,class:"pn-file-upload-title"},this.label||this.translate("CLICKORDRAG")),this.helpertext&&n("p",{key:"8d4032bcd909516779d07f042be878105f3479a1",id:this.idHelpertext,class:"pn-file-upload-subtitle"},this.helpertext),this.accept&&n("p",{key:"715cc9ed4c8878068182a30affa8649c904f041d",id:this.idAccepttext,class:"pn-file-upload-subtitle"},this.translate("ACCEPTEDFORMATS"),": ",this.accept,this.maxSize&&n("span",{key:"a217dcfd8528d86deb9aee37b7750eb574936a56"}," ","(",this.translate("MAXFILESIZE"),": ",this.maxSize,")")))),!!this.files.length&&n("ul",{key:"c1a1cd0c816992c6f524eaf82296ad4fd3300a6b",class:"files-list"},this.files.map((e=>n("li",{class:"files-list-item-container",key:e.uuid},n("div",{class:this.getFileItemClass(e)},n("div",{class:"file-list-item-title"},n("pn-icon",{icon:this.getFileIcon(e),color:this.getFileColor(e)}),this.hideProgress||0===e.progress?n("div",{class:"filename"},e.filename):n("pn-progress-bar",{label:e.filename,progress:e.progress,error:e.error&&e.errorMessage})),n("pn-button",{small:!0,variant:"borderless",arialabel:`${this.translate("REMOVE_FILE")} ${e.filename}`,appearance:e.error?"warning":"light",icon:'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M10.5 4a1 1 0 0 0-1 1h5a1 1 0 0 0-1-1zm6 1a3 3 0 0 0-3-3h-3a3 3 0 0 0-3 3h-2A2.5 2.5 0 0 0 5 9.95V19a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V9.95A2.5 2.5 0 0 0 18.5 5zm.5 5H7v9a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1zM5.5 7a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1zm4.5 5a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1m4 0a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1" clip-rule="evenodd"/></svg>',iconOnly:!0,tooltip:this.translate("REMOVE_FILE"),loading:this.isLoading(e),onClick:()=>this.removeFile(e)})),e.error?n("div",{class:"files-list-item-text-error"},e.errorMessage||e.error.message):null)))),n("slot",{key:"2690ccdc2c5e97a41c99a3b385e68739bb69cecb"})))}static get watchers(){return{limit:[{handleLimit:0}],maxSize:[{handleMaxBytes:0}]}}static get style(){return`${e("pn-file-upload")}.hover .pn-file-upload-container .pn-dropzone-container{background-color:#e0f8ff}${e("pn-file-upload")} .pn-file-upload-input{position:absolute;z-index:1;left:0;top:0;opacity:0;height:100%;width:100%;-webkit-tap-highlight-color:transparent}${e("pn-file-upload")} .pn-file-upload-input:hover{cursor:pointer}${e("pn-file-upload")} .pn-file-upload-input:hover+.pn-dropzone-inner{border-color:#005d92;background-color:#e0f8ff}${e("pn-file-upload")} .pn-file-upload-input:focus-visible+.pn-dropzone-inner{border-color:#005d92;outline-color:#005d92}${e("pn-file-upload")} .pn-file-upload-input:disabled{pointer-events:none}${e("pn-file-upload")} .pn-file-upload-input:disabled+.pn-dropzone-inner{pointer-events:none;background-color:#f3f2f2;border-color:#2d2013}${e("pn-file-upload")} .pn-file-upload-input:disabled+.pn-dropzone-inner .headline a{color:#5e554a}${e("pn-file-upload")} .pn-file-upload-input:disabled+.pn-dropzone-inner .pn-icon-svg path{fill:#5e554a}${e("pn-file-upload")} .pn-file-upload-container{position:relative;display:flex;flex-direction:column;gap:1em}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-container{position:relative}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner{position:relative;text-align:center;overflow:hidden;padding:2.5em;border:0.0625em #969087 dashed;border-radius:0.5em;display:flex;flex-direction:column;align-items:center;gap:0.5em;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, outline-color, border-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner{transition-duration:0s;transition-delay:0s}}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner .pn-ripple{animation:ripple 0.4s cubic-bezier(0.7, 0, 0.3, 1);position:absolute;border-radius:50%;background-color:#005d92;transform:translate(-50%, -50%) scale(0);opacity:0.1;pointer-events:none;z-index:3}@keyframes ripple{to{transform:translate(-50%, -50%) scale(1);opacity:0}}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner[data-hover]{background-color:#e0f8ff;border-color:#005d92}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner[data-invalid]{border-color:#a70707}${e("pn-file-upload")} .pn-file-upload-container .pn-dropzone-inner .pn-file-upload-dropzone{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:0.5em}${e("pn-file-upload")} .files-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:1em}${e("pn-file-upload")} .files-list .filename{font-weight:400;font-size:0.75em}${e("pn-file-upload")} .files-list .files-list-item{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;align-items:center;background:#f9f8f8;padding:1em;border-radius:0.5em}${e("pn-file-upload")} .files-list .files-list-item .file-list-item-title{display:flex;align-items:center;gap:0.5em;margin-right:0.5em}${e("pn-file-upload")} .files-list .files-list-item>${e("pn-progress-bar")}{margin-right:25em;flex:1}${e("pn-file-upload")} .files-list .files-list-item.files-list-item-error{color:#a70707;background-color:#fdefee}${e("pn-file-upload")} .files-list .files-list-item-text-error{color:#a70707;font-size:0.875em;font-weight:300;margin-top:0.25em}${e("pn-file-upload")} .pn-file-upload-title{color:#2d2013}${e("pn-file-upload")} .pn-file-upload-subtitle{color:#5e554a;font-size:0.75em}`}},[772,"pn-file-upload",{label:[1],helpertext:[1],language:[1],hideProgress:[4,"hide-progress"],name:[1],accept:[1],maxSize:[1,"max-size"],capture:[1],limit:[2],multiple:[1028],required:[4],disabled:[4],files:[32],isHovering:[32],startUpload:[64],clearUpload:[64],removeFile:[64],updateFile:[64]},void 0,{limit:[{handleLimit:0}],maxSize:[{handleMaxBytes:0}]}]),k=y,w=function(){"undefined"!=typeof customElements&&["pn-file-upload","pn-button","pn-icon","pn-progress-bar","pn-spinner"].forEach((i=>{switch(i){case"pn-file-upload":customElements.get(e(e(i)))||customElements.define(e(e(i)),y);break;case"pn-button":customElements.get(e(e(i)))||f();break;case"pn-icon":customElements.get(e(e(i)))||u();break;case"pn-progress-bar":customElements.get(e(e(i)))||m();break;case"pn-spinner":customElements.get(e(e(i)))||g()}}))};export{k as PnFileUpload,w as defineCustomElement}
@@ -2,4 +2,4 @@
2
2
  * Built with Stencil
3
3
  * By PostNord.
4
4
  */
5
- import{transformTag as t,proxyCustomElement as o,HTMLElement as s,h as n,Host as e}from"@stencil/core/internal/client";import{o as i}from"./open_in_new.js";import{k as r,S as p,e as a,N as d}from"./helpers.js";import{d as w}from"./pn-icon2.js";import{d as c}from"./pn-text-link2.js";const f={SE:{domain:{sv:"https://www.postnord.se",en:"https://www.postnord.se/en"},contact:{sv:"https://www.postnord.se/kundservice",en:"https://www.postnord.se/en/help-and-support/contact-us"},cookies:{sv:"https://www.postnord.se/cookies",en:"https://www.postnord.se/en/cookies"},privacy:{sv:"https://www.postnord.se/integritetspolicy",en:"https://www.postnord.se/en/privacy-policy"},terms:{sv:"https://www.postnord.se/siteassets/pdf/villkor/anvandarvillkor-postnord-konto.pdf",en:"https://www.postnord.se/siteassets/pdf/villkor/anvandarvillkor-postnord-konto.pdf"}},DK:{domain:{da:"https://www.postnord.dk",en:"https://www.postnord.com/en"},contact:{da:"https://www.postnord.dk/kundeservice",en:"https://www.postnord.dk/en/help-and-support"},cookies:{da:"https://www.postnord.dk/cookies",en:"https://www.postnord.dk/en/cookies"},privacy:{da:"https://www.postnord.dk/personlige-oplysninger",en:"https://www.postnord.se/en/privacy-policy"},terms:{da:"https://www.postnord.dk/contentassets/4806069a7d6c44959c94b13417d78f22/kundeportalen.pdf",en:"https://www.postnord.dk/kundeservice/kundeservice-erhverv/forretningsbetingelser"}},FI:{domain:{fi:"https://www.postnord.fi",sv:"https://www.postnord.fi/sv",en:"https://www.postnord.fi/en"},contact:{fi:"https://www.postnord.fi/asiakaspalvelu/ota-yhteytta",sv:"https://www.postnord.fi/sv/kundtjanst",en:"https://www.postnord.fi/en/customer-service"},cookies:{fi:"https://www.postnord.fi/yksityisyydensuoja/tietoa-evasteista",sv:"https://www.postnord.fi/sv/integritetspolicy/information-om-cookies",en:"https://www.postnord.fi/en/privacy-policy/information-about-the-cookies"},privacy:{fi:"https://www.postnord.fi/yksityisyydensuoja",sv:"https://www.postnord.fi/sv/integritetspolicy",en:"https://www.postnord.se/en/privacy-policy"},terms:{fi:"https://www.postnord.fi/laheta/sopimusehdot",sv:"https://www.postnord.fi/sv/skicka/villkor",en:"https://www.postnord.fi/en/sending/terms"}},NO:{domain:{no:"https://www.postnord.no",en:"https://www.postnord.no/en"},contact:{no:"https://www.postnord.no/kundeservice",en:"https://www.postnord.no/en/contact-postnord"},cookies:{no:"https://www.postnord.no/cookies",en:"https://www.postnord.no/en/cookies"},privacy:{no:"https://www.postnord.no/personvernerklaering",en:"https://www.postnord.se/en/privacy-policy"}},contact:"https://portal.postnord.com/customerservice"},l={cookies:{sv:"Cookies",en:"Cookies",da:"Cookies",fi:"Evästeet",no:"Cookies"},questions:{sv:"Undrar du över något?",en:"Do you have any questions?",da:"Har du nogen spørgsmål?",fi:"Onko sinulla kysyttävää?",no:"Har du noen spørsmål?"},contact:{sv:"Kontakta oss",en:"Get in touch",da:"Kontakt os",fi:"Ota yhteyttä",no:"Ta kontakt"},info:{sv:"Mer information om PostNord hittar du på",en:"More information about PostNord can be found at",da:"Mere information om PostNord findes på",fi:"Lisää tietoa PostNordista löydät osoitteesta",no:"Du finner mer informasjon om PostNord på"},privacy:{sv:"Integritetspolicy",en:"Privacy policy",da:"Integritetspolitik",fi:"Yksityisyysasetukset",no:"Privacy policy"},terms:{sv:"Villkor",en:"Terms and conditions",da:"Vilkår og betingelser",fi:"Sopimusehdot",no:"Betingelser og vilkår"}},h=o(class extends s{constructor(t){super(),!1!==t&&this.__registerHost()}get hostElement(){return this}market=null;language=null;async componentWillLoad(){this.market&&this.language||await r(this.hostElement)}getLink(t){return f?.[this.market||p]?.[t]?.[this.language||a]}getText(t){return"domain"===t?this.getLink(t)?.replace("https://www.",""):l?.[t]?.[this.language]}renderLink(t){const o=this.getLink(t),s=this.getText(t);if(o&&s)return n("pn-text-link",{label:s,target:"_blank",rel:"noopener noreferrer",href:o,icon:i})}render(){return n(e,{key:"cd42b1837b00386532e130fa79d0265746ad37cd"},n("div",{key:"d55038fafcccf752f7ac479ffb66127077f7ddc2",class:"pn-footer-row"},n("p",{key:"3f90862fda949d3be7905f257806f367e25756bb"},this.getText("questions")),this.renderLink("contact")),n("div",{key:"87285a48ed5a82822bff8b28d657be62720ca0f9",class:"pn-footer-row"},this.market!==d&&this.renderLink("terms"),this.renderLink("privacy"),this.renderLink("cookies")),n("div",{key:"83fdad97337a671248f921dc7889a94bcff9a12e",class:"pn-footer-row"},n("p",{key:"bf0cdf1f3d4409922fea94aca5290ca5ad33b872"},this.getText("info")),this.renderLink("domain")))}static get style(){return`${t("pn-footer")}{color:#5e554a;padding-bottom:2em;display:block}${t("pn-footer")} .pn-footer-row{padding:0.2em 0;font-size:0.9em;text-align:center}${t("pn-footer")} .pn-footer-row p{margin:0 0.2em 0 0;display:inline-block}${t("pn-footer")} ${t("pn-text-link")}{margin-right:0.5em}${t("pn-footer")} ${t("pn-text-link")}:last-child{margin-right:0}`}},[512,"pn-footer",{market:[1],language:[1]}]),k=h,m=function(){"undefined"!=typeof customElements&&["pn-footer","pn-icon","pn-text-link"].forEach((o=>{switch(o){case"pn-footer":customElements.get(t(t(o)))||customElements.define(t(t(o)),h);break;case"pn-icon":customElements.get(t(t(o)))||w();break;case"pn-text-link":customElements.get(t(t(o)))||c()}}))};export{k as PnFooter,m as defineCustomElement}
5
+ import{transformTag as t,proxyCustomElement as o,HTMLElement as s,h as e,Host as n}from"@stencil/core/internal/client";import{o as i}from"./open_in_new.js";import{k as r,S as p,e as a,N as d}from"./helpers.js";import{d as w}from"./pn-icon2.js";import{d as c}from"./pn-text-link2.js";const l={SE:{domain:{sv:"https://www.postnord.se",en:"https://www.postnord.se/en"},contact:{sv:"https://www.postnord.se/kundservice",en:"https://www.postnord.se/en/help-and-support/contact-us"},cookies:{sv:"https://www.postnord.se/cookies",en:"https://www.postnord.se/en/cookies"},privacy:{sv:"https://www.postnord.se/integritetspolicy",en:"https://www.postnord.se/en/privacy-policy"},terms:{sv:"https://www.postnord.se/siteassets/pdf/villkor/anvandarvillkor-postnord-konto.pdf",en:"https://www.postnord.se/siteassets/pdf/villkor/anvandarvillkor-postnord-konto.pdf"}},DK:{domain:{da:"https://www.postnord.dk",en:"https://www.postnord.com/en"},contact:{da:"https://www.postnord.dk/kundeservice",en:"https://www.postnord.dk/en/help-and-support"},cookies:{da:"https://www.postnord.dk/cookies",en:"https://www.postnord.dk/en/cookies"},privacy:{da:"https://www.postnord.dk/personlige-oplysninger",en:"https://www.postnord.se/en/privacy-policy"},terms:{da:"https://www.postnord.dk/contentassets/4806069a7d6c44959c94b13417d78f22/kundeportalen.pdf",en:"https://www.postnord.dk/kundeservice/kundeservice-erhverv/forretningsbetingelser"}},FI:{domain:{fi:"https://www.postnord.fi",sv:"https://www.postnord.fi/sv",en:"https://www.postnord.fi/en"},contact:{fi:"https://www.postnord.fi/asiakaspalvelu/ota-yhteytta",sv:"https://www.postnord.fi/sv/kundtjanst",en:"https://www.postnord.fi/en/customer-service"},cookies:{fi:"https://www.postnord.fi/yksityisyydensuoja/tietoa-evasteista",sv:"https://www.postnord.fi/sv/integritetspolicy/information-om-cookies",en:"https://www.postnord.fi/en/privacy-policy/information-about-the-cookies"},privacy:{fi:"https://www.postnord.fi/yksityisyydensuoja",sv:"https://www.postnord.fi/sv/integritetspolicy",en:"https://www.postnord.se/en/privacy-policy"},terms:{fi:"https://www.postnord.fi/laheta/sopimusehdot",sv:"https://www.postnord.fi/sv/skicka/villkor",en:"https://www.postnord.fi/en/sending/terms"}},NO:{domain:{no:"https://www.postnord.no",en:"https://www.postnord.no/en"},contact:{no:"https://www.postnord.no/kundeservice",en:"https://www.postnord.no/en/contact-postnord"},cookies:{no:"https://www.postnord.no/cookies",en:"https://www.postnord.no/en/cookies"},privacy:{no:"https://www.postnord.no/personvernerklaering",en:"https://www.postnord.se/en/privacy-policy"}},contact:"https://portal.postnord.com/customerservice"},h={cookies:{sv:"Cookies",en:"Cookies",da:"Cookies",fi:"Evästeet",no:"Cookies"},questions:{sv:"Undrar du över något?",en:"Do you have any questions?",da:"Har du nogen spørgsmål?",fi:"Onko sinulla kysyttävää?",no:"Har du noen spørsmål?"},contact:{sv:"Kontakta oss",en:"Get in touch",da:"Kontakt os",fi:"Ota yhteyttä",no:"Ta kontakt"},info:{sv:"Mer information om PostNord hittar du på",en:"More information about PostNord can be found at",da:"Mere information om PostNord findes på",fi:"Lisää tietoa PostNordista löydät osoitteesta",no:"Du finner mer informasjon om PostNord på"},privacy:{sv:"Integritetspolicy",en:"Privacy policy",da:"Integritetspolitik",fi:"Yksityisyysasetukset",no:"Privacy policy"},terms:{sv:"Villkor",en:"Terms and conditions",da:"Vilkår og betingelser",fi:"Sopimusehdot",no:"Betingelser og vilkår"}},f=o(class extends s{constructor(t){super(),!1!==t&&this.__registerHost()}get hostElement(){return this}market=null;language=null;async componentWillLoad(){this.market&&this.language||await r(this.hostElement)}getLink(t){return l?.[this.market||p]?.[t]?.[this.language||a]}getText(t){return"domain"===t?this.getLink(t)?.replace("https://www.",""):h?.[t]?.[this.language]}renderLink(t){const o=this.getLink(t),s=this.getText(t);if(o&&s)return e("pn-text-link",{label:s,target:"_blank",rel:"noopener noreferrer",href:o,icon:i})}render(){return e(n,{key:"5ba1e53dd0dc631bf8bbe878a622ec577224a9f3"},e("div",{key:"530b0e803506fed3cae180d1289535538f64e1bb",class:"pn-footer-row"},e("p",{key:"47e19b88eb7c6860f0921fdacc79686aff3d2b61"},this.getText("questions")),this.renderLink("contact")),e("div",{key:"2986a92cb2183d53c871030db72ef34aa08e847b",class:"pn-footer-row"},this.market!==d&&this.renderLink("terms"),this.renderLink("privacy"),this.renderLink("cookies")),e("div",{key:"550a23c5b872b6dc9c69b4e231ce7634d5f12994",class:"pn-footer-row"},e("p",{key:"52871c90b92a2a64fc247ac83fdc62215e54a574"},this.getText("info")),this.renderLink("domain")))}static get style(){return`${t("pn-footer")}{color:#5e554a;padding-bottom:2em;display:block}${t("pn-footer")} .pn-footer-row{padding:0.2em 0;font-size:0.9em;text-align:center}${t("pn-footer")} .pn-footer-row p{margin:0 0.2em 0 0;display:inline-block}${t("pn-footer")} ${t("pn-text-link")}{margin-right:0.5em}${t("pn-footer")} ${t("pn-text-link")}:last-child{margin-right:0}`}},[512,"pn-footer",{market:[1],language:[1]}]),k=f,m=function(){"undefined"!=typeof customElements&&["pn-footer","pn-icon","pn-text-link"].forEach((o=>{switch(o){case"pn-footer":customElements.get(t(t(o)))||customElements.define(t(t(o)),f);break;case"pn-icon":customElements.get(t(t(o)))||w();break;case"pn-text-link":customElements.get(t(t(o)))||c()}}))};export{k as PnFooter,m as defineCustomElement}
@@ -2,4 +2,4 @@
2
2
  * Built with Stencil
3
3
  * By PostNord.
4
4
  */
5
- import{transformTag as e,proxyCustomElement as a,HTMLElement as t,forceUpdate as n,h as s,Host as d}from"@stencil/core/internal/client";import{k as i,e as c}from"./helpers.js";import{a as r}from"./arrow_left.js";import{d as h}from"./pn-icon2.js";import{d as o}from"./pn-text-link2.js";const l={sv:"Tillbaka",en:"Back",da:"Tilbage",fi:"Takaisin",no:"Tilbake"},b=a(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}mo;hasBreadcrumb=!1;hasButtons=!1;get hostElement(){return this}heading;maxWidth;setMaxWidth(){this.maxWidth&&this.hostElement.style.setProperty("--max-width",this.maxWidth)}goBackHref;goBackText;language=null;connectedCallback(){this.mo=new MutationObserver((()=>{n(this.hostElement),this.checkSlots()})),this.mo.observe(this.hostElement,{subtree:!0,childList:!0})}disconnectedCallback(){this.mo?.disconnect()}async componentWillLoad(){this.checkSlots(),this.setMaxWidth(),null===this.language&&await i(this.hostElement)}checkSlots(){this.hasBreadcrumb=!!this.hostElement.querySelector('[slot="breadcrumb"]'),this.hasButtons=!!this.hostElement.querySelector('[slot="buttons"]')}showBreadcrumb(){return this.hasBreadcrumb||!!this.goBackHref?.length}getButtonText(){return this.goBackText||l[this.language||c]}render(){return s(d,{key:"1ee027d9ec1a7d440bad15e7a3e21d7a1bea82d7"},s("header",{key:"94f8a61e7e4499b43e84e184ce068141d1eda7a4",class:"pn-header"},s("div",{key:"2faf70a3e269d616761a1a64e0a06373a80ccd38",class:"pn-header-container"},s("div",{key:"b802a380cb0c6f5917ac5a009ae12eb8b0eebd7d",class:"pn-header-breadcrumbs",hidden:!this.showBreadcrumb()},this.goBackHref&&s("pn-text-link",{key:"3264b691fbca455627ee57a52bd75a1d3e346deb",label:this.getButtonText(),href:this.goBackHref,icon:r,leftIcon:!0}),s("slot",{key:"1b23c5b3a3b8659e1d3cbf9d2243b82c5dc44b16",name:"breadcrumb"})),s("div",{key:"7be900c2d2569bfa16b360ac5f1707ef8c8ea9e3",class:"pn-header-content"},this.heading&&s("h1",{key:"a6cfd61f1f89f47ffbfc9f9b6457d1d4bee6d18b"},this.heading),s("slot",{key:"2ad205fcdce972fac8c276dfbc68ea81369dce43"})),s("div",{key:"52ca88b82d1672a4784f1a478d9ca620cca27e90",class:"pn-header-buttons",hidden:!this.hasButtons},s("slot",{key:"f873dab64a32aee3afe2a445d55385125d62272d",name:"buttons"})),s("slot",{key:"b9fa83ad5ebcff6478eed5bb8c02cdb9234e6449",name:"menu"}))))}static get watchers(){return{maxWidth:[{setMaxWidth:0}]}}static get style(){return`${e("pn-header")}{display:block}${e("pn-header")} h1{color:#2d2013;margin:0}${e("pn-header")} p{color:#5e554a;margin:0}${e("pn-header")} .pn-header-breadcrumbs{width:100%}${e("pn-header")} .pn-header-container{position:relative;width:100%;max-width:var(--max-width);margin:0 auto;padding:clamp(1em, 3vw, 2em) clamp(0.5em, 3vw, 2em);display:flex;flex-wrap:wrap;align-items:center;gap:1.5em}${e("pn-header")} .pn-header-container>${e("pn-text-link")}{display:block}${e("pn-header")} .pn-header-content{flex:1 1 auto;display:flex;flex-direction:column;gap:1em}${e("pn-header")} .pn-header [slot=buttons]{display:flex;flex-direction:column;gap:1em}`}},[772,"pn-header",{heading:[1],maxWidth:[1,"max-width"],goBackHref:[1,"go-back-href"],goBackText:[1,"go-back-text"],language:[1]},void 0,{maxWidth:[{setMaxWidth:0}]}]),m=b,p=function(){"undefined"!=typeof customElements&&["pn-header","pn-icon","pn-text-link"].forEach((a=>{switch(a){case"pn-header":customElements.get(e(e(a)))||customElements.define(e(e(a)),b);break;case"pn-icon":customElements.get(e(e(a)))||h();break;case"pn-text-link":customElements.get(e(e(a)))||o()}}))};export{m as PnHeader,p as defineCustomElement}
5
+ import{transformTag as e,proxyCustomElement as a,HTMLElement as t,forceUpdate as n,h as s,Host as i}from"@stencil/core/internal/client";import{k as d,e as c}from"./helpers.js";import{a as r}from"./arrow_left.js";import{d as h}from"./pn-icon2.js";import{d as o}from"./pn-text-link2.js";const l={sv:"Tillbaka",en:"Back",da:"Tilbage",fi:"Takaisin",no:"Tilbake"},b=a(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}mo;hasBreadcrumb=!1;hasButtons=!1;get hostElement(){return this}heading;maxWidth;setMaxWidth(){this.maxWidth&&this.hostElement.style.setProperty("--max-width",this.maxWidth)}goBackHref;goBackText;language=null;connectedCallback(){this.mo=new MutationObserver((()=>{n(this.hostElement),this.checkSlots()})),this.mo.observe(this.hostElement,{subtree:!0,childList:!0})}disconnectedCallback(){this.mo?.disconnect()}async componentWillLoad(){this.checkSlots(),this.setMaxWidth(),null===this.language&&await d(this.hostElement)}checkSlots(){this.hasBreadcrumb=!!this.hostElement.querySelector('[slot="breadcrumb"]'),this.hasButtons=!!this.hostElement.querySelector('[slot="buttons"]')}showBreadcrumb(){return this.hasBreadcrumb||!!this.goBackHref?.length}getButtonText(){return this.goBackText||l[this.language||c]}render(){return s(i,{key:"f19310a092999791304499d72c1b8e566949c0d3"},s("header",{key:"c6b50a1d93bf18f2050b37a9bdf69d3706b8aea4",class:"pn-header"},s("div",{key:"7bfa1bd37978daf85d266b7306a71705bdc8cac5",class:"pn-header-container"},s("div",{key:"09ed187b0f201d435c99b3c6e0f245ca48857d47",class:"pn-header-breadcrumbs",hidden:!this.showBreadcrumb()},this.goBackHref&&s("pn-text-link",{key:"ba657cb77da06d42009738c64d815a23d8dae527",label:this.getButtonText(),href:this.goBackHref,icon:r,leftIcon:!0}),s("slot",{key:"278bf254489dbd76f53e047cd16c247bcfd696eb",name:"breadcrumb"})),s("div",{key:"e9b2e873fb9ed01fabbd669aa7cace973a55cbfa",class:"pn-header-content"},this.heading&&s("h1",{key:"baec009bf6807009ea53d184be9a8c15ea0253a0"},this.heading),s("slot",{key:"7a777967b19a19077486d88d775b4a1c4f9d3134"})),s("div",{key:"46fa0cc4120b341e4a03c60bb865e077c6231986",class:"pn-header-buttons",hidden:!this.hasButtons},s("slot",{key:"8932d6bbb5e1647be6b666d1879b163575dfd760",name:"buttons"})),s("slot",{key:"afc6e39f45ef72ba762772f84a66cc24fdbcf368",name:"menu"}))))}static get watchers(){return{maxWidth:[{setMaxWidth:0}]}}static get style(){return`${e("pn-header")}{display:block}${e("pn-header")} h1{color:#2d2013;margin:0}${e("pn-header")} p{color:#5e554a;margin:0}${e("pn-header")} .pn-header-breadcrumbs{width:100%}${e("pn-header")} .pn-header-container{position:relative;width:100%;max-width:var(--max-width);margin:0 auto;padding:clamp(1em, 3vw, 2em) clamp(0.5em, 3vw, 2em);display:flex;flex-wrap:wrap;align-items:center;gap:1.5em}${e("pn-header")} .pn-header-container>${e("pn-text-link")}{display:block}${e("pn-header")} .pn-header-content{flex:1 1 auto;display:flex;flex-direction:column;gap:1em}${e("pn-header")} .pn-header [slot=buttons]{display:flex;flex-direction:column;gap:1em}`}},[772,"pn-header",{heading:[1],maxWidth:[1,"max-width"],goBackHref:[1,"go-back-href"],goBackText:[1,"go-back-text"],language:[1]},void 0,{maxWidth:[{setMaxWidth:0}]}]),m=b,p=function(){"undefined"!=typeof customElements&&["pn-header","pn-icon","pn-text-link"].forEach((a=>{switch(a){case"pn-header":customElements.get(e(e(a)))||customElements.define(e(e(a)),b);break;case"pn-icon":customElements.get(e(e(a)))||h();break;case"pn-text-link":customElements.get(e(e(a)))||o()}}))};export{m as PnHeader,p as defineCustomElement}
@@ -2,4 +2,4 @@
2
2
  * Built with Stencil
3
3
  * By PostNord.
4
4
  */
5
- import{transformTag as e,proxyCustomElement as t,HTMLElement as n,h as i,Host as a}from"@stencil/core/internal/client";import{u as s,k as p,e as r}from"./helpers.js";import{a as o}from"./alert_exclamation_circle.js";import{c as l}from"./check.js";import{c as u}from"./close.js";import{d}from"./pn-button2.js";import{d as c}from"./pn-icon2.js";import{d as h}from"./pn-spinner2.js";const f={SHOW:{sv:"Visa",en:"Show",da:"At vise",fi:"Näytä",no:"Vise"},HIDE:{sv:"Dölj",en:"Hide",da:"Skjule",fi:"Piilottaa",no:"Gjemme seg"},CLEAR:{sv:"Rensa",en:"Clear",da:"Klar",fi:"Asia selvä",no:"Klar"}},m=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost()}id=`pn-input-${s()}`;idMessage=`${this.id}-message`;prefix;suffix;mo;get hostElement(){return this}offsetLeft=0;offsetRight=0;showHelperSlot=!1;showErrorSlot=!1;showPassword=!1;togglePassword(){this.showPassword=!this.showPassword}label;helpertext;inputid=this.id;value="";language=null;icon;textPrefix;textSuffix;type="text";name;placeholder;autocomplete;maxlength;inputmode;list;pattern;min;max;step;arialabel;ariacontrols;required=!1;disabled=!1;readonly=!1;valid=!1;invalid=!1;error;handleOffset(){requestAnimationFrame((()=>requestAnimationFrame((()=>{const e=this.prefix?.clientWidth?this.prefix.clientWidth+8:0,t=this.suffix?.clientWidth?this.suffix.clientWidth+8:0;this.offsetLeft=e,this.offsetRight=t}))))}handleMessage(){this.checkSlottedHelper(),this.checkSlottedError()}async componentWillLoad(){this.handleMessage(),this.inputid!==this.id&&(this.idMessage=`${this.inputid}-message`),null===this.language&&await p(this.hostElement)}componentDidLoad(){this.handleOffset(),this.mo&&this.mo.disconnect(),this.mo=new MutationObserver((()=>{this.handleOffset(),this.handleMessage()})),this.mo.observe(this.hostElement,{subtree:!0,childList:!0})}setVal(e){const t=e.composedPath?.()[0];this.value=t.value}clearVal(){const e=new InputEvent("input",{bubbles:!0,data:""}),t=this.hostElement.querySelector("input");this.value="",t.focus(),t.value=this.value,t.dispatchEvent(e)}translate(e){return f?.[e]?.[this.language||r]}hasHelperText(){return this.helpertext?.length>0||this.showHelperSlot}hasErrorMessage(){return this.error?.length>0||this.showErrorSlot}hasError(){return this.hasErrorMessage()||this.invalid||this.showErrorSlot}hasMessage(){return this.hasHelperText()||this.hasErrorMessage()}checkSlottedHelper(){const e=this.hostElement.querySelector("[slot=helpertext]")?.textContent;this.showHelperSlot=!!e?.length}checkSlottedError(){const e=this.hostElement.querySelector("[slot=error]")?.textContent;this.showErrorSlot=!!e?.length}getInputType(){return["text","password","url","tel","search","number","email"].includes(this.type)&&!this.showPassword?this.type:"text"}isPassword(){return!this.disabled&&("password"===this.type||"text"===this.type&&this.showPassword)}passwordText(){return this.translate(this.showPassword?"HIDE":"SHOW")}displayState(){return this.valid||this.hasError()}stateIcon(){return this.valid?l:o}stateColor(){return this.valid?"green700":"warning"}showPrefix(){return this.textPrefix&&!this.icon}showSuffix(){return!this.showPrefix()&&!!this.textSuffix?.length&&!this.isPassword()&&"search"!==this.type}showClear(){return!this.disabled&&!this.readonly&&"search"===this.type&&!!this.value?.length}render(){return i(a,{key:"f6553d466069c8e7558eb98dfd6deba21905d888"},i("div",{key:"e4eb511c59f571eccf70570cff7b44145ee64a70",class:"pn-input","data-valid":this.valid,"data-error":this.hasError()},(this.label||this.maxlength>=1)&&i("label",{key:"fc2a2516335378e1b6dabdb39b5da538c4cca995",htmlFor:this.inputid,class:"pn-input-label"},this.label&&i("span",{key:"63571398139a931d8a5dd59698f7ec26e0bc6ba9"},this.label),this.maxlength>=0&&i("span",{key:"eb08d059863c41a86ff77102f837565d9eafe3ce"},`${this.value.length}/${this.maxlength}`)),i("div",{key:"56ab6a577a2712b5430749515b22e776ec9b56a8",class:"pn-input-group"},i("input",{key:"ace87466651b4ef525d739f9499b4fa8b10a36e1",type:this.getInputType(),id:this.inputid,class:"pn-input-element",name:this.name,placeholder:this.placeholder,autocomplete:this.autocomplete,maxlength:this.maxlength,list:this.list,pattern:this.pattern,min:this.min,max:this.max,step:this.step,value:this.value,inputmode:this.inputmode,disabled:this.disabled,required:this.required,readonly:this.readonly,"aria-label":this.arialabel,"aria-describedby":this.hasMessage()?this.idMessage:null,"aria-controls":this.ariacontrols,"aria-invalid":this.hasError()?.toString(),style:{"--pn-input-offset-left":`${this.offsetLeft}px`,"--pn-input-offset-right":`${this.offsetRight}px`},onInput:e=>this.setVal(e)}),i("div",{key:"334cb0b553144a1271e1a2e094ef3d19776f308d",class:"pn-input-eyecandy","data-prefix":!0,ref:e=>this.prefix=e},!!this.icon&&i("pn-icon",{key:"ac827d5f752445b4a5d0e94ae44646513deeb84f",icon:this.icon,"aria-hidden":"true"}),this.showPrefix()&&i("span",{key:"d0d4e2ad948ca3c9155e7b405ea2f4cd4f064f71",class:"pn-input-text"},this.textPrefix)),i("div",{key:"e972870933dfb2d8cf294facf51dceb7c64d8bf6",class:"pn-input-eyecandy","data-suffix":!0,ref:e=>this.suffix=e},this.showSuffix()&&i("span",{key:"d37da7ccf870f54455731417ac6afbe573589e8a",class:"pn-input-text"},this.textSuffix),this.displayState()&&i("pn-icon",{key:"5432e13d6a53b1e8d143498d0c068b035b89da21","aria-hidden":"true",icon:this.stateIcon(),color:this.stateColor()}),this.isPassword()&&i("pn-button",{key:"7a04e3189a7ed5d3b29e93d0ac1031c22ffb14e0",icon:this.showPassword?'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M12 7c-5.382 0-7.908 3.33-8.758 4.775a.43.43 0 0 0 0 .45C4.092 13.67 6.618 17 12 17s7.908-3.33 8.758-4.775a.43.43 0 0 0 0-.45C19.908 10.33 17.382 7 12 7M1.518 10.761C2.55 9.005 5.618 5 12 5s9.45 4.005 10.482 5.761a2.43 2.43 0 0 1 0 2.478C21.45 14.995 18.382 19 12 19s-9.45-4.005-10.482-5.761a2.43 2.43 0 0 1 0-2.478M8 12a4 4 0 1 1 8 0 4 4 0 0 1-8 0m4-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4" clip-rule="evenodd"/></svg>':'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M1.81 11.727a1 1 0 0 1 1.363.378c.29.513.835 1.343 1.7 2.174a9.5 9.5 0 0 0 3.457 2.128c1.03.361 2.244.593 3.67.593s2.64-.232 3.67-.593a9.5 9.5 0 0 0 3.458-2.128 9.7 9.7 0 0 0 1.698-2.174 1 1 0 0 1 1.742.984 11.5 11.5 0 0 1-1.445 2.001l1.686 2.322a1 1 0 1 1-1.618 1.175l-1.537-2.116a11.4 11.4 0 0 1-2.453 1.48l.763 2.785a1 1 0 1 1-1.928.528l-.73-2.661c-.993.251-2.093.397-3.306.397s-2.313-.146-3.306-.397l-.73 2.661a1 1 0 1 1-1.928-.528l.763-2.786a11.4 11.4 0 0 1-2.453-1.479L2.81 18.587a1 1 0 0 1-1.618-1.175l1.686-2.322a11.5 11.5 0 0 1-1.445-2 1 1 0 0 1 .379-1.363" clip-rule="evenodd"/></svg>',iconOnly:!0,arialabel:this.passwordText(),small:!0,appearance:"light",variant:"borderless",onClick:()=>this.togglePassword()}),this.showClear()&&i("pn-button",{key:"b9941892bb3cf8d64b810be56d3525b4fe7aa394",icon:u,iconOnly:!0,arialabel:this.translate("CLEAR"),small:!0,appearance:"light",variant:"borderless",onClick:()=>this.clearVal()}))),i("p",{key:"466cf477bb1a8fd5f69c24cf9769a53b77a84167",class:"pn-input-message",id:this.idMessage,role:this.hasErrorMessage()?"alert":null,hidden:!this.hasMessage()},this.hasHelperText()&&!this.hasError()&&i("span",{key:"760f744cdc4cd0f35399b3e5e5dfb563a6e326a2",class:"pn-input-helper"},this.helpertext),i("span",{key:"853ecf5094683f8ea69acd81ffa454c2ad7da383",class:"pn-input-helper-slot",hidden:!this.showHelperSlot||this.hasError()},i("slot",{key:"634e73d6d3b93a1d5f0429de708fd3901968ec31",name:"helpertext"})),this.hasErrorMessage()&&i("span",{key:"f150a81d23c50bf2b705f7082d31bf748aaf91e7",class:"pn-input-error"},this.error),i("span",{key:"2cd93c90d13a0ef9f153d051f3ee99ff9e25d025",class:"pn-input-error-slot",hidden:!this.showErrorSlot},i("slot",{key:"c1d461b5a82d635c57af689f29bf485e82117303",name:"error"})))))}static get watchers(){return{textPrefix:[{handleOffset:0}],textSuffix:[{handleOffset:0}],helpertext:[{handleMessage:0}],error:[{handleMessage:0}]}}static get style(){return`${e("pn-input")}{display:inline-flex;flex-direction:column}${e("pn-input")} .pn-input-label{cursor:pointer;display:flex;justify-content:space-between;align-items:flex-end;font-weight:400;color:#2d2013;margin:0 0 0.25em 0;gap:0.5em;-webkit-tap-highlight-color:transparent;transition-property:color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-input")} .pn-input-label{transition-duration:0s;transition-delay:0s}}${e("pn-input")} .pn-input-label>span{font-size:0.875em}${e("pn-input")} .pn-input-group{position:relative}${e("pn-input")} .pn-input-element{--pn-input-offset-left:0em;--pn-input-offset-right:0em;color:#2d2013;background-color:#ffffff;border:0.0625em solid #969087;border-radius:0.5em;padding:0.75em;font-family:inherit;font-size:1em;font-weight:500;line-height:1.5em;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}${e("pn-input")} .pn-input-element:-webkit-autofill,${e("pn-input")} .pn-input-element:-webkit-autofill:hover,${e("pn-input")} .pn-input-element:-webkit-autofill:focus,${e("pn-input")} .pn-input-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #e0f8ff inset;-webkit-text-fill-color:#2d2013}${e("pn-input")} .pn-input-element{outline:0.2rem solid transparent;outline-offset:0.2rem}${e("pn-input")} .pn-input-element:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${e("pn-input")} .pn-input-element{transition-property:outline-color, background-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-input")} .pn-input-element{transition-duration:0s;transition-delay:0s}}${e("pn-input")} .pn-input-element::placeholder{color:#5e554a;font-weight:normal}${e("pn-input")} .pn-input-element:hover{border-color:#005d92}${e("pn-input")} .pn-input-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-input")} .pn-input-element{width:100%;padding-left:calc(var(--pn-input-offset-left) + 0.75em);padding-right:calc(var(--pn-input-offset-right) + 0.75em)}${e("pn-input")} .pn-input-element:read-only{border-color:#ffffff}${e("pn-input")} .pn-input-element:disabled~.pn-input-eyecandy>${e("pn-icon")}>.pn-icon-svg>path{fill:#969087}${e("pn-input")} .pn-input-element::-webkit-calendar-picker-indicator{visibility:hidden;display:none !important}${e("pn-input")} .pn-input-element::-webkit-textfield-decoration-container,${e("pn-input")} .pn-input-element::-webkit-search-cancel-button,${e("pn-input")} .pn-input-element::-webkit-inner-spin-button,${e("pn-input")} .pn-input-element::-webkit-outer-spin-button,${e("pn-input")} .pn-input-element::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}${e("pn-input")} .pn-input-element[type=number]{appearance:textfield}${e("pn-input")} .pn-input-eyecandy{position:absolute;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;gap:0.5em;height:1.5em}${e("pn-input")} .pn-input-eyecandy[data-prefix]{left:0.75em}${e("pn-input")} .pn-input-eyecandy[data-suffix]{right:0.75em}${e("pn-input")} .pn-input-text{color:#5e554a;font-weight:400;line-height:1.5em}${e("pn-input")} .pn-input-message{color:#5e554a;font-size:0.875em;font-weight:400;margin:0.25em 0 0 0;display:flex;flex-direction:column;gap:0.25em}${e("pn-input")} .pn-input-message[hidden],${e("pn-input")} .pn-input-message>span[hidden]{display:none}${e("pn-input")} .pn-input[data-error]>.pn-input-label{color:#a70707}${e("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element{border-color:#a70707}${e("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element:hover{border-color:#500715}${e("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element:focus-visible{background-color:#ffffff;border-color:#a70707;outline-color:#a70707}${e("pn-input")} .pn-input[data-error]>.pn-input-message[role=alert]{color:#a70707}${e("pn-input")} .pn-input[data-valid]>.pn-input-label{color:#005e41}${e("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element{border-color:#005e41}${e("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element:hover{border-color:#002f24}${e("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element:focus-visible{background-color:#ffffff;border-color:#005e41;outline-color:#005e41}`}},[772,"pn-input",{label:[1],helpertext:[1],inputid:[1],value:[1025],language:[1],icon:[1],textPrefix:[1,"text-prefix"],textSuffix:[1,"text-suffix"],type:[1025],name:[1],placeholder:[1],autocomplete:[1],maxlength:[2],inputmode:[1],list:[1],pattern:[1],min:[8],max:[8],step:[8],arialabel:[1],ariacontrols:[1],required:[4],disabled:[4],readonly:[4],valid:[4],invalid:[4],error:[1],offsetLeft:[32],offsetRight:[32],showHelperSlot:[32],showErrorSlot:[32],showPassword:[32]},void 0,{textPrefix:[{handleOffset:0}],textSuffix:[{handleOffset:0}],helpertext:[{handleMessage:0}],error:[{handleMessage:0}]}]);function b(){"undefined"!=typeof customElements&&["pn-input","pn-button","pn-icon","pn-spinner"].forEach((t=>{switch(t){case"pn-input":customElements.get(e(e(t)))||customElements.define(e(e(t)),m);break;case"pn-button":customElements.get(e(e(t)))||d();break;case"pn-icon":customElements.get(e(e(t)))||c();break;case"pn-spinner":customElements.get(e(e(t)))||h()}}))}export{m as P,b as d}
5
+ import{transformTag as t,proxyCustomElement as e,HTMLElement as n,forceUpdate as i,h as a,Host as p}from"@stencil/core/internal/client";import{u as s,k as r,e as o}from"./helpers.js";import{a as l}from"./alert_exclamation_circle.js";import{c as u}from"./check.js";import{c}from"./close.js";import{d}from"./pn-button2.js";import{d as h}from"./pn-icon2.js";import{d as f}from"./pn-spinner2.js";const m={SHOW:{sv:"Visa",en:"Show",da:"At vise",fi:"Näytä",no:"Vise"},HIDE:{sv:"Dölj",en:"Hide",da:"Skjule",fi:"Piilottaa",no:"Gjemme seg"},CLEAR:{sv:"Rensa",en:"Clear",da:"Klar",fi:"Asia selvä",no:"Klar"}},b=e(class extends n{constructor(t){super(),!1!==t&&this.__registerHost()}id=`pn-input-${s()}`;idMessage=`${this.id}-message`;prefix;suffix;mo;get hostElement(){return this}offsetLeft=0;offsetRight=0;showHelperSlot=!1;showErrorSlot=!1;showPassword=!1;togglePassword(){this.showPassword=!this.showPassword}label;helpertext;inputid=this.id;value="";language=null;compact=!1;icon;textPrefix;textSuffix;type="text";name;placeholder;autocomplete;maxlength;inputmode;list;pattern;min;max;step;arialabel;ariacontrols;required=!1;disabled=!1;readonly=!1;valid=!1;invalid=!1;error;handleOffset(){requestAnimationFrame((()=>{const t=this.prefix?.clientWidth?this.prefix.clientWidth+8:0,e=this.suffix?.clientWidth?this.suffix.clientWidth+8:0;this.offsetLeft=t,this.offsetRight=e}))}handleMessage(){this.checkSlottedHelper(),this.checkSlottedError()}connectedCallback(){this.mo=new MutationObserver((()=>{i(this.hostElement),this.handleOffset(),this.handleMessage()})),this.mo.observe(this.hostElement,{childList:!0,subtree:!0})}disconnectedCallback(){this.mo&&this.mo.disconnect()}async componentWillLoad(){this.handleMessage(),this.inputid!==this.id&&(this.idMessage=`${this.inputid}-message`),null===this.language&&await r(this.hostElement)}componentDidLoad(){this.handleOffset()}setVal(t){const e=t.composedPath?.()[0];this.value=e.value}clearVal(){const t=new InputEvent("input",{bubbles:!0,data:""}),e=this.hostElement.querySelector("input");this.value="",e.focus(),e.value=this.value,e.dispatchEvent(t)}translate(t){return m?.[t]?.[this.language||o]}hasHelperText(){return this.helpertext?.length>0||this.showHelperSlot}hasErrorMessage(){return this.error?.length>0||this.showErrorSlot}hasError(){return this.hasErrorMessage()||this.invalid||this.showErrorSlot}hasMessage(){return this.hasHelperText()||this.hasErrorMessage()}checkSlottedHelper(){const t=this.hostElement.querySelector("[slot=helpertext]")?.textContent;this.showHelperSlot=!!t?.length}checkSlottedError(){const t=this.hostElement.querySelector("[slot=error]")?.textContent;this.showErrorSlot=!!t?.length}getInputType(){return["text","password","url","tel","search","number","email"].includes(this.type)&&!this.showPassword?this.type:"text"}isPassword(){return!this.disabled&&("password"===this.type||"text"===this.type&&this.showPassword)}passwordText(){return this.translate(this.showPassword?"HIDE":"SHOW")}displayState(){return this.valid||this.hasError()}stateIcon(){return this.valid?u:l}stateColor(){return this.valid?"green700":"warning"}showPrefix(){return this.textPrefix&&!this.icon}showSuffix(){return!this.showPrefix()&&!!this.textSuffix?.length&&!this.isPassword()&&"search"!==this.type}showClear(){return!this.disabled&&!this.readonly&&"search"===this.type&&!!this.value?.length}validLabel(){return this.label?.length>0||this.maxlength>=1}useLabel(){return this.validLabel()&&!this.compact}useCompactLabel(){return this.validLabel()&&this.compact}renderLabel(){return a("label",{htmlFor:this.inputid,class:"pn-input-label","data-compact":this.compact},this.label&&a("span",null,this.label),this.maxlength>=0&&a("span",null,`${this.value.length}/${this.maxlength}`))}render(){return a(p,{key:"3250630450288d09811b7c78bca5091ba93ec7ab"},a("div",{key:"db673ba19f300966eaf5c38136fe7d6143aa661d",class:"pn-input","data-valid":this.valid,"data-error":this.hasError(),style:{"--pn-input-offset-left":`${this.offsetLeft}px`,"--pn-input-offset-right":`${this.offsetRight}px`}},this.useLabel()&&this.renderLabel(),a("div",{key:"b216b7f951be237aed6e46f1ccbcfd29b2a3cad1",class:"pn-input-group"},a("input",{key:"4ee129c35c6a74a359df9d611b236132d7afac38",type:this.getInputType(),id:this.inputid,class:"pn-input-element",name:this.name,placeholder:this.compact?this.placeholder||" ":this.placeholder,autocomplete:this.autocomplete,maxlength:this.maxlength,list:this.list,pattern:this.pattern,min:this.min,max:this.max,step:this.step,value:this.value,inputmode:this.inputmode,disabled:this.disabled,required:this.required,readonly:this.readonly,"aria-label":this.arialabel,"aria-describedby":this.hasMessage()?this.idMessage:null,"aria-controls":this.ariacontrols,"aria-invalid":this.hasError()?.toString(),"data-compact":this.compact,"data-value":this.value?.length>0,onInput:t=>this.setVal(t)}),this.useCompactLabel()&&this.renderLabel(),a("div",{key:"753a9abeaf5bfa5ffb3be10042a76aa7863bce9c",class:"pn-input-eyecandy","data-prefix":!0,ref:t=>this.prefix=t},!!this.icon&&a("pn-icon",{key:"acf1a6e42c9d37cab6f6a0453d8ea674df1cd0c3",icon:this.icon,"aria-hidden":"true"}),this.showPrefix()&&a("span",{key:"70d2eb7e94e790d665a57557595c2bce4855b827",class:"pn-input-text"},this.textPrefix)),a("div",{key:"1dcae3fb8489d2dc6aa7325baea693591acef31c",class:"pn-input-eyecandy","data-suffix":!0,ref:t=>this.suffix=t},this.showSuffix()&&a("span",{key:"05044f3fbea582d507de30a0ff751abaf1da3206",class:"pn-input-text"},this.textSuffix),this.displayState()&&a("pn-icon",{key:"727650c9e6c9b9da2ef43e933fab95b6adc8a6bb","aria-hidden":"true",icon:this.stateIcon(),color:this.stateColor()}),this.isPassword()&&a("pn-button",{key:"4e28eddff11c9aea670a6764aeb0316bccba1c1c",icon:this.showPassword?'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M12 7c-5.382 0-7.908 3.33-8.758 4.775a.43.43 0 0 0 0 .45C4.092 13.67 6.618 17 12 17s7.908-3.33 8.758-4.775a.43.43 0 0 0 0-.45C19.908 10.33 17.382 7 12 7M1.518 10.761C2.55 9.005 5.618 5 12 5s9.45 4.005 10.482 5.761a2.43 2.43 0 0 1 0 2.478C21.45 14.995 18.382 19 12 19s-9.45-4.005-10.482-5.761a2.43 2.43 0 0 1 0-2.478M8 12a4 4 0 1 1 8 0 4 4 0 0 1-8 0m4-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4" clip-rule="evenodd"/></svg>':'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M1.81 11.727a1 1 0 0 1 1.363.378c.29.513.835 1.343 1.7 2.174a9.5 9.5 0 0 0 3.457 2.128c1.03.361 2.244.593 3.67.593s2.64-.232 3.67-.593a9.5 9.5 0 0 0 3.458-2.128 9.7 9.7 0 0 0 1.698-2.174 1 1 0 0 1 1.742.984 11.5 11.5 0 0 1-1.445 2.001l1.686 2.322a1 1 0 1 1-1.618 1.175l-1.537-2.116a11.4 11.4 0 0 1-2.453 1.48l.763 2.785a1 1 0 1 1-1.928.528l-.73-2.661c-.993.251-2.093.397-3.306.397s-2.313-.146-3.306-.397l-.73 2.661a1 1 0 1 1-1.928-.528l.763-2.786a11.4 11.4 0 0 1-2.453-1.479L2.81 18.587a1 1 0 0 1-1.618-1.175l1.686-2.322a11.5 11.5 0 0 1-1.445-2 1 1 0 0 1 .379-1.363" clip-rule="evenodd"/></svg>',iconOnly:!0,arialabel:this.passwordText(),small:!0,appearance:"light",variant:"borderless",onClick:()=>this.togglePassword()}),this.showClear()&&a("pn-button",{key:"2181adb68c152d837ef03bf9b7e0eb66eb3ea6d2",icon:c,iconOnly:!0,arialabel:this.translate("CLEAR"),small:!0,appearance:"light",variant:"borderless",onClick:()=>this.clearVal()}))),a("p",{key:"b8b1039a61a23efd24ebd71285b15cce7bfc5ec0",class:"pn-input-message",id:this.idMessage,role:this.hasErrorMessage()?"alert":null,hidden:!this.hasMessage()},this.hasHelperText()&&!this.hasError()&&a("span",{key:"4433df6b700cc40ce2ae698d2474f57163b398a1",class:"pn-input-helper"},this.helpertext),a("span",{key:"41c8fb1cbbc17b7c349922cac2ff42244a017e0c",class:"pn-input-helper-slot",hidden:!this.showHelperSlot||this.hasError()},a("slot",{key:"5628bbc8db75161d18ad3e75c259bf3eb5fc9052",name:"helpertext"})),this.hasErrorMessage()&&a("span",{key:"e41145d7fab9f3ae35dd428971c79673d0531301",class:"pn-input-error"},this.error),a("span",{key:"ae85a9420fcb449cc874eadc7a066dd772f097a9",class:"pn-input-error-slot",hidden:!this.showErrorSlot},a("slot",{key:"bdd31ab2f706cac6e243562d035361a381ecfa43",name:"error"})))))}static get watchers(){return{textPrefix:[{handleOffset:0}],textSuffix:[{handleOffset:0}],helpertext:[{handleMessage:0}],error:[{handleMessage:0}]}}static get style(){return`${t("pn-input")}{display:inline-flex;flex-direction:column}${t("pn-input")} .pn-input{--pn-input-offset-left:0em;--pn-input-offset-right:0em}${t("pn-input")} .pn-input-label{cursor:pointer;display:flex;justify-content:space-between;align-items:flex-end;font-weight:400;color:#2d2013;margin:0 0 0.25em 0;gap:0.5em;-webkit-tap-highlight-color:transparent;transition-property:color, transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-input")} .pn-input-label{transition-duration:0s;transition-delay:0s}}${t("pn-input")} .pn-input-label[data-compact]{position:absolute;top:1.5625em;left:calc(var(--pn-input-offset-left, 0px) + 0.75em + 0.0625em);margin:0;pointer-events:none;align-items:center;height:1.5em;max-width:calc(100% - (var(--pn-input-offset-left, 0px) + 0.75em) - (var(--pn-input-offset-right, 0px) + 0.75em));transform:translateY(-50%) scale(1) translateZ(0);transform-origin:0 0;transition-delay:0.2s}${t("pn-input")} .pn-input-label[data-compact]>span{font-size:1em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;line-height:1.5em}${t("pn-input")} .pn-input-label>span{font-size:0.875em}${t("pn-input")} .pn-input-group{position:relative}${t("pn-input")} .pn-input-element{width:100%;color:#2d2013;background-color:#ffffff;border:0.0625em solid #969087;border-radius:0.5em;padding:0.75em calc(0.75em + var(--pn-input-offset-right)) 0.75em calc(0.75em + var(--pn-input-offset-left));font-family:inherit;font-size:1em;font-weight:500;line-height:1.5em;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}${t("pn-input")} .pn-input-element:-webkit-autofill,${t("pn-input")} .pn-input-element:-webkit-autofill:hover,${t("pn-input")} .pn-input-element:-webkit-autofill:focus,${t("pn-input")} .pn-input-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #e0f8ff inset;-webkit-text-fill-color:#2d2013}${t("pn-input")} .pn-input-element{outline:0.2rem solid transparent;outline-offset:0.2rem}${t("pn-input")} .pn-input-element:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${t("pn-input")} .pn-input-element{transition-property:outline-color, background-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-input")} .pn-input-element{transition-duration:0s;transition-delay:0s}}${t("pn-input")} .pn-input-element[data-compact]{text-align:left;padding-top:1.125em;padding-bottom:0.375em;max-width:unset}${t("pn-input")} .pn-input-element[data-compact]::placeholder{color:transparent}${t("pn-input")} .pn-input-element[data-compact]:focus+.pn-input-label,${t("pn-input")} .pn-input-element[data-compact]:not(:placeholder-shown)+.pn-input-label{transform:translateY(-85%) scale(0.75);transition-delay:0s}${t("pn-input")} .pn-input-element::placeholder{color:#5e554a;font-weight:normal}${t("pn-input")} .pn-input-element:hover{border-color:#005d92}${t("pn-input")} .pn-input-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${t("pn-input")} .pn-input-element:read-only{border-color:#ffffff}${t("pn-input")} .pn-input-element:disabled~.pn-input-eyecandy>${t("pn-icon")}>.pn-icon-svg>path{fill:#969087}${t("pn-input")} .pn-input-element::-webkit-calendar-picker-indicator{visibility:hidden;display:none !important}${t("pn-input")} .pn-input-element::-webkit-textfield-decoration-container,${t("pn-input")} .pn-input-element::-webkit-search-cancel-button,${t("pn-input")} .pn-input-element::-webkit-inner-spin-button,${t("pn-input")} .pn-input-element::-webkit-outer-spin-button,${t("pn-input")} .pn-input-element::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}${t("pn-input")} .pn-input-element[type=number]{appearance:textfield}${t("pn-input")} .pn-input-eyecandy{position:absolute;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;gap:0.5em;height:1.5em}${t("pn-input")} .pn-input-eyecandy[data-prefix]{left:0.75em}${t("pn-input")} .pn-input-eyecandy[data-suffix]{right:0.75em}${t("pn-input")} .pn-input-text{color:#5e554a;font-weight:400;line-height:1.5em}${t("pn-input")} .pn-input-message{color:#5e554a;font-size:0.875em;font-weight:400;margin:0.25em 0 0 0;display:flex;flex-direction:column;gap:0.25em}${t("pn-input")} .pn-input-message[hidden],${t("pn-input")} .pn-input-message>span[hidden]{display:none}${t("pn-input")} .pn-input[data-error]>.pn-input-label{color:#a70707}${t("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element{border-color:#a70707}${t("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element:hover{border-color:#500715}${t("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element:focus-visible{background-color:#ffffff;border-color:#a70707;outline-color:#a70707}${t("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element:-webkit-autofill,${t("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element:-webkit-autofill:hover,${t("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element:-webkit-autofill:focus,${t("pn-input")} .pn-input[data-error]>.pn-input-group>.pn-input-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #fef7f6 inset;-webkit-text-fill-color:#2d2013}${t("pn-input")} .pn-input[data-error]>.pn-input-message[role=alert]{color:#a70707}${t("pn-input")} .pn-input[data-valid]>.pn-input-label{color:#005e41}${t("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element{border-color:#005e41}${t("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element:hover{border-color:#002f24}${t("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element:focus-visible{background-color:#ffffff;border-color:#005e41;outline-color:#005e41}${t("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element:-webkit-autofill,${t("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element:-webkit-autofill:hover,${t("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element:-webkit-autofill:focus,${t("pn-input")} .pn-input[data-valid]>.pn-input-group>.pn-input-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #edfbf3 inset;-webkit-text-fill-color:#2d2013}`}},[772,"pn-input",{label:[1],helpertext:[1],inputid:[1],value:[1025],language:[1],compact:[4],icon:[1],textPrefix:[1,"text-prefix"],textSuffix:[1,"text-suffix"],type:[1025],name:[1],placeholder:[1],autocomplete:[1],maxlength:[2],inputmode:[1],list:[1],pattern:[1],min:[8],max:[8],step:[8],arialabel:[1],ariacontrols:[1],required:[4],disabled:[4],readonly:[4],valid:[4],invalid:[4],error:[1],offsetLeft:[32],offsetRight:[32],showHelperSlot:[32],showErrorSlot:[32],showPassword:[32]},void 0,{textPrefix:[{handleOffset:0}],textSuffix:[{handleOffset:0}],helpertext:[{handleMessage:0}],error:[{handleMessage:0}]}]);function g(){"undefined"!=typeof customElements&&["pn-input","pn-button","pn-icon","pn-spinner"].forEach((e=>{switch(e){case"pn-input":customElements.get(t(t(e)))||customElements.define(t(t(e)),b);break;case"pn-button":customElements.get(t(t(e)))||d();break;case"pn-icon":customElements.get(t(t(e)))||h();break;case"pn-spinner":customElements.get(t(t(e)))||f()}}))}export{b as P,g as d}
@@ -2,4 +2,4 @@
2
2
  * Built with Stencil
3
3
  * By PostNord.
4
4
  */
5
- import{transformTag as e,proxyCustomElement as t,Mixin as i,createEvent as n,h as l,Host as o}from"@stencil/core/internal/client";import{a as s}from"./index2.js";import{a as c}from"./alert_exclamation_circle.js";import{c as r}from"./chevron_down.js";import{c as p}from"./close.js";import{u as a,k as u,o as d,j as h,e as m}from"./helpers.js";import{d as b}from"./pn-icon2.js";const f={SELECT_AN_OPTION:{en:"Select an option",sv:"Välj ett alternativ",da:"Vælg en mulighed",fi:"Valitse vaihtoehto",no:"Velg et alternativ"},SELECT_ALL_OPTIONS:{en:"Select all options",sv:"Välj alla alternativ",da:"Vælg alle muligheder",fi:"Valitse kaikki vaihtoehdot",no:"Velg alle alternativer"},SELECT_FOUND_OPTIONS:{en:"Select {number} options",sv:"Välj {number} alternativ",da:"Vælg {number} muligheder",fi:"Valitse {number} vaihtoehtoa",no:"Velg {number} alternativer"},SELECTED_OPTIONS:{en:"Selected options.",sv:"Valda alternativ.",da:"Valgte muligheder.",fi:"Valitut vaihtoehdot.",no:"Valgte alternativer."},BUTTON_OPEN:{en:"Open list",sv:"Öppna listan",da:"Open list",fi:"Open list",no:"Open list"},BUTTON_CLOSE:{en:"Close list",sv:"Stäng listan",da:"Close list",fi:"Close list",no:"Close list"},REMOVE:{en:"Remove",sv:"Ta bort",da:"Remove",fi:"Remove",no:"Remove"},REMOVED:{en:"Removed",sv:"Tog bort",da:"Fjernet",fi:"Poistettu",no:"Fjernet"},MORE_OPTION:{en:"more option.",sv:"alternativ till.",da:"mulighed mere.",fi:"vaihtoehto lisää.",no:"alternativ til."},MORE_OPTIONS:{en:"more options.",sv:"fler alternativ.",da:"more options.",fi:"more options.",no:"more options."},SEARCH:{en:"Search",sv:"Sök",da:"Søg",fi:"Hae",no:"Søk"},RESULTS_FOUND:{en:"options found",sv:"alternativ hittades",da:"muligheder fundet",fi:"vaihtoehtoja löytyi",no:"alternativer funnet"},NO_SEARCH_RESULTS:{en:"No options found",sv:"Inga alternativ hittades",da:"Ingen muligheder fundet",fi:"Vaihtoehtoja ei löytynyt",no:"Finner ingen alternativer"},NO_OPTIONS:{en:"No options available",sv:"Inga alternativ tillgängliga",da:"Ingen tilgængelige muligheder",fi:"Ei vaihtoehtoja",no:"Ingen tilgjengelige alternativer"}},g=t(class extends(i(s)){constructor(e){super(!1),!1!==e&&this.__registerHost(),this.toggleSelect=n(this,"toggleSelect",7),this.allOptions=n(this,"allOptions",7),this.selectedOption=n(this,"selectedOption",7),this.selectedAllOptions=n(this,"selectedAllOptions",7),this.searchInput=n(this,"searchInput",7)}id="pn-multiselect-"+a();idLegend=this.id+"-legend";idButton=this.id+"-button";idOptions=this.id+"-options";idHelper=this.id+"-text";idChips=this.id+"-chips";idSr=this.id+"-sr";elGroup;elButton;elInput;elList;elChips;srTimer;get hostElement(){return this}isSearching=!1;open=!1;upwards=!1;srMessage;label;helpertext;placeholder;name;selectId=this.id;selectName;icon;language=null;options;selectAll=!1;allValue="pn_multiselect_all";search=!1;searchQuery="";itemCount=5;maxHeight;top=!1;bottom=!1;required=!1;disabled=!1;invalid=!1;error;handleOpen(){this.open?(this.addGlobalEventListeners(),this.handleDirection(),this.handleMaxHeight(),this.handleWidth()):this.removeGlobalEventListeners(),this.dropdownHandler()}handleSearch(){this.search||(this.options=[...this.options.map((e=>{const t={...e,hide:!1};return t?.group?.length&&t.group.map((e=>({...e,hide:!1}))),t}))])}handleSearchQuery(){this.search&&"string"==typeof this.searchQuery&&this.handleInputSearch()}handleSelectId(){const e=this.selectId;this.idLegend=e+"-legend",this.idButton=e+"-button",this.idOptions=e+"-options",this.idHelper=e+"-text",this.idChips=e+"-chips",this.idSr=e+"-sr"}handleResize(){this.open&&(this.toggleOpen(!1),this.elList.style.removeProperty("--pn-select-options-width"),this.elList.style.removeProperty("--pn-select-max-height"))}toggleSelect;allOptions;selectedOption;selectedAllOptions;searchInput;async componentWillLoad(){this.handleSelectId(),null===this.language&&await u(this.hostElement)}componentDidLoad(){this.searchQuery?.length&&this.handleSearchQuery()}globalEvents=e=>{const t=e.target,i=t?.closest(this.hostElement.localName);i||this.toggleOpen(!1)};addGlobalEventListeners(){this.hostElement.getRootNode().addEventListener("click",this.globalEvents)}removeGlobalEventListeners(){this.hostElement.getRootNode().removeEventListener("click",this.globalEvents)}dropdownHandler(){this.open?this.openDropdown(this.elList):this.closeDropdown(this.elList)}emitEvents(e,t){if(this.allOptions.emit(this.options),e)return this.selectedOption.emit(e);const i={checked:t,searching:this.isSearching};this.search&&this.optionsTotal()!==this.optionsSearch().length&&(i.query=this.searchQuery,i.found=this.optionsSearch()),this.selectedAllOptions.emit(i)}optionsChecked(){const e=this.options?.reduce(((e,t)=>{const i=t.group?[...t.group.filter((({checked:e})=>e))]:[];return t.checked&&e.push(t),i?.length&&e.push(...i),e}),[]);return e}optionsTotal(){return this.options?.reduce(((e,t)=>e+(t?.group?.length?t.group.length+1:1)),0)}optionsIndex(e){const t=({group:t=[]})=>t?.findIndex((({value:t})=>t===e)),i=this.options.findIndex((i=>i.value===e||-1!==t(i)));return{indexGroup:i,indexNested:t(this.options?.[i])}}optionsCheckedTotal(){return this.optionsChecked()?.length}optionsCheckedPreview(){return this.optionsChecked()?.slice(0,this.itemCount)}optionsCheckedLabels(){return this.optionsChecked()?.map((({label:e})=>e))?.join(", ")}optionsSearch(){const e=this.options?.reduce(((e,t)=>{const i=t.group?[...t.group.filter((({hide:e})=>!e))]:[];return t.hide||e.push(t),i?.length&&e.push(...i),e}),[]);return e}noResults(){return 0===this.optionsSearch()?.length}isIndeterminate(e){const t=this.options?.[e];if(t?.group?.length){const e=t.group.every((({checked:e})=>e)),i=t.group.every((({checked:e})=>!e));return!(e||i)}return!1}optionSelect({val:e,checked:t,chip:i}){if(e===this.allValue)return this.optionSelectAll(t);const n=this.options,{indexGroup:l,indexNested:o}=this.optionsIndex(e),s=n[l]?.group,c=s?.[o];if(c?.value){n[l].group[o].checked=t;const e=s?.every((({checked:e})=>e));n[l].checked=!!e}else n[l].checked=t,s?.length&&(n[l].group=s?.map((e=>({...e,checked:t}))));const r=-1===o?n[l]:n[l].group[o];this.emitEvents(r),this.options=[...n],"number"==typeof i&&(this.handleSrMesssage(`${this.translate("REMOVED")} ${r.label}`),requestAnimationFrame((()=>{const e=i===this.optionsCheckedTotal()?i-1:i,t=Array.from(this.elChips.children)?.[e];t?.querySelector("button").focus({preventScroll:!0})})))}optionSelectAll(e){this.options=[...this.options.map((t=>{const i={...t,checked:this.isSearching&&t.hide?t.checked:e};i.group&&(i.group=[...i.group.map((t=>({...t,checked:this.isSearching&&t.hide?t.checked:e})))]);const n=i?.group?.every((({checked:e})=>e));return i?.group?.length&&(i.checked=n),i}))],this.emitEvents(null,e)}optionSelected(e){return!!this.optionsChecked()?.find((({value:t,checked:i})=>t===e&&i))}translate(e){const t=f?.[e]?.[this.language||m];return t.includes("{number}")?t.replace("{number}",this.optionsSearch().length):t}getRect(e){return e?.getBoundingClientRect()}ripple({clientX:e,clientY:t,target:i}){const n=0===e&&0===t,l=i.nextElementSibling,{x:o,width:s,y:c,top:r}=this.getRect(l);d(n?{clientX:o+s-24,clientY:c-r}:{clientX:e,clientY:t},l)}handleSrMesssage(e){this.srMessage=e,clearTimeout(this.srTimer),this.srTimer=setTimeout((()=>this.srMessage=null),2e3)}handleDirection(){if(this.top)return this.upwards=!0;if(this.bottom)return this.upwards=!1;const{bottom:e,top:t}=this.getRect(this.elInput),i=window.innerHeight-e-16;this.upwards=(t-16)/2>i}handleMaxHeight(){if(this.maxHeight)return this.elGroup.style.setProperty("--pn-select-max-height",this.maxHeight);const{bottom:e,top:t}=this.getRect(this.elInput),i=this.upwards?t:e,n=h(),l=this.upwards?n+16:16,o=this.upwards?i-l:window.innerHeight-i-l;this.elGroup.style.setProperty("--pn-select-max-height",Math.ceil(o)+"px")}handleWidth(){const{width:e}=this.getRect(this.elInput);this.elGroup.style.setProperty("--pn-select-options-width",Math.ceil(e)+"px")}setFocus(){this.search?this.elInput.focus({preventScroll:!0}):this.elButton.focus({preventScroll:!0})}hasError(){return this.invalid||!!this.error}hasMessage(){return!!this.helpertext||!!this.error}toggleOpen(e){"boolean"==typeof e&&e===this.open||(this.open=e??!this.open,this.toggleSelect.emit({open:this.open}))}handleInputKeyboard(e){e.stopImmediatePropagation();const{code:t}=e;if("Escape"===t)return this.toggleOpen(!1);!this.open&&t.match(/^(Space|Enter)$|Arrow|^Key.*$/)&&this.toggleOpen()}setSearchQuery(e){this.open||this.toggleOpen(!0),this.searchQuery=e}handleInputSearch(){if(this.isEmpty())return;const e=this.searchQuery,t=({label:t,helpertext:i,value:n})=>`${t} ${i} ${n}`.trim().toLowerCase().includes(e.toLowerCase()),i=this.options.map((e=>{const i=e?.group?.map((e=>({...e,hide:!t(e)})))||[],n=t(e)||i?.some((({hide:e})=>!e));return e.hide=!n,e?.group?.length&&(e.group=[...i]),e}));this.isSearching=""!==e,this.options=[...i],this.searchInput.emit({query:e,found:this.optionsSearch()})}getListItem(e){const{value:t}=this.options[e];return this.elList.querySelector(`.pn-multiselect-option-input[value='${t}']`)}getOptionIndex(e,t,i){const n=this.optionsTotal()-1;if("End"===i)return n;if("Home"===i)return 0;const l=this.options.findIndex((({value:t})=>t===e))+t.find((e=>"number"==typeof e));return l>=n?n:l<=0?0:l}checkboxNav(e,t){const{code:i}=e,n="Tab"===i,l="Space"===i,o="Enter"===i,s="Escape"===i,c=["ArrowUp"===i&&-1,"ArrowDown"===i&&1,"PageUp"===i&&-10,"PageDown"===i&&10,"Home"===i&&0,"End"===i&&this.optionsTotal()-1,n,l,o,s];if(!c.some((e=>"number"==typeof e||e)))return;if(n||l||o)return;if(e.stopImmediatePropagation(),e.preventDefault(),s)return this.setFocus(),this.toggleOpen(!1);const r=this.getOptionIndex(t,c,i);return this.getListItem(r)?.focus()}handleBlur(e){const t=e.target,i=e.relatedTarget;"pn-multiselect-chip-button"===(i||t)?.className&&this.toggleOpen(!1)}handleLabel(){this.disabled||this.setFocus()}isEmpty(){return 0===(this.options?.length||0)}showSelectAll(){return this.selectAll&&!this.isEmpty()&&!this.noResults()}showEmptyOption(){return this.isSearching&&this.noResults()||this.isEmpty()}getPlaceholder(){return this.placeholder||this.translate(this.search?"SEARCH":"SELECT_AN_OPTION")}handleChange({target:e}){const{value:t,checked:i}=e;this.optionSelect({val:t,checked:i})}additonalOptions(){const e=this.optionsCheckedTotal()-this.itemCount;return`${e} ${this.translate("MORE_OPTION"+(1===e?"":"S"))}`}describedBy(){const e=[this.search&&this.idChips,this.srMessage&&this.idSr,!!this.helpertext&&this.idHelper].filter(Boolean);return e.length?e.join(" "):null}renderOption({label:e,value:t,checked:i,helpertext:n,icon:o,id:s=`${this.selectId}-${t||e}`,invalid:c,disabled:r,hide:p,group:a},u,d){return l("li",{class:"pn-multiselect-option",key:s,hidden:p},l("input",{type:"checkbox",id:s,class:"pn-multiselect-option-input",checked:i??this.optionSelected(t),indeterminate:void 0===d&&this.isIndeterminate(u),name:this.name,value:t,disabled:this.disabled||r,required:this.required,"aria-invalid":c?"true":null,"aria-describedby":n?s+"-helper":null,onClick:e=>this.ripple(e),onKeyDown:e=>this.checkboxNav(e,t),onBlur:e=>this.handleBlur(e)}),l("div",{class:"pn-multiselect-option-content"},!!o&&l("pn-icon",{icon:o,color:"blue900"}),l("div",{class:"pn-multiselect-option-text"},l("label",{class:"pn-multiselect-option-label",htmlFor:s},l("span",null,e)),n&&l("p",{class:"pn-multiselect-option-helper",id:s+"-helper"},n)),l("div",{class:"pn-multiselect-option-checkbox"},l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},l("polyline",{class:"pn-multiselect-option-checkbox-checkmark-path",points:"4,12 9,17 20,6","stroke-width":"3"}),l("polyline",{class:"pn-multiselect-option-checkbox-indeterminate-path",points:"4,12 20,12","stroke-width":"3"})))),a?.length&&l("ul",{class:"pn-multiselect-optgroup"},a?.map(((e,t)=>this.renderOption(e,u,t)))))}renderOptions(){return l("ul",{id:this.idOptions,class:"pn-multiselect-options","data-open":this.open,"data-upwards":this.upwards,onChange:e=>this.handleChange(e),style:{height:"0px"},ref:e=>this.elList=e},this.showSelectAll()&&this.renderOption({label:this.translate(`SELECT_${this.isSearching?"FOUND":"ALL"}_OPTIONS`),value:this.allValue,checked:this.optionsTotal()===this.optionsCheckedTotal()}),this.options?.map(((e,t)=>this.renderOption(e,t))),this.showEmptyOption()&&l("li",{class:"pn-multiselect-option"},l("div",{class:"pn-multiselect-option-content",role:"alert"},l("div",{class:"pn-multiselect-option-text"},l("span",{class:"pn-multiselect-option-label"},this.translate(this.isEmpty()?"NO_OPTIONS":"NO_SEARCH_RESULTS"))))))}renderChips(){return l("ul",{id:this.idChips,class:"pn-multiselect-chips","aria-label":this.translate("SELECTED_OPTIONS"),ref:e=>this.elChips=e},this.optionsCheckedPreview()?.map((({label:e,value:t},i)=>l("li",{class:"pn-multiselect-chip","aria-setsize":this.optionsCheckedTotal(),"aria-posinset":i+1,key:`${e}-${t}`},l("span",{class:"pn-multiselect-chip-label"},e),l("button",{type:"button",class:"pn-multiselect-chip-button","aria-label":`${this.translate("REMOVE")} ${e}`,onClick:()=>this.optionSelect({val:t,checked:!1,chip:i})},l("pn-icon",{icon:p,small:!0,color:"blue700"}))))),this.optionsCheckedTotal()>this.itemCount&&l("li",{class:"pn-multiselect-chip","data-count":!0},l("span",{class:"pn-multiselect-chip-label"},"+ ",this.additonalOptions())))}render(){return l(o,{key:"9b25af2f368c47c8820ae000ed1389215cd952a2"},l("fieldset",{key:"3aa70d5b8d62ee84616afe853c2ea746c991fc67",class:"pn-multiselect","data-icon":!!this.icon,"data-error":this.hasError(),disabled:this.disabled},this.label&&l("legend",{key:"2e1bd83a8c6cb64bc9da287c70abcffccb334cbb",id:this.idLegend,class:"pn-multiselect-label",onClick:()=>this.handleLabel()},l("span",{key:"1d3073c63643320b9b9fde625832d89e41edaa35"},this.label),!!this.optionsChecked()?.length&&l("span",{key:"316c9d892808df273840dcac243971e5fb5d2b62"},this.optionsCheckedTotal(),"/",this.optionsTotal())),l("div",{key:"f79e79c0406ca659a6380902a6c8296df89bde97",class:"pn-multiselect-group",ref:e=>this.elGroup=e},l("div",{key:"73bc49a104f3846a41fa65f4e6e2623dba0806c2",class:"pn-multiselect-input"},!!this.icon&&l("pn-icon",{key:"a68a06de67861057dd6d853ab53b7a34d76ca7ee",class:"pn-multiselect-icon","data-custom":!0,icon:this.icon}),l("input",{key:"5df7e2ededf6e196ae47053ce650628391bc282d",tabindex:this.search?null:"-1",type:this.search?"search":"input",id:this.selectId,class:"pn-multiselect-element",value:this.search?this.searchQuery:this.optionsCheckedLabels(),name:this.selectName,placeholder:this.getPlaceholder(),required:this.search?null:this.required,"aria-labelledby":this.idLegend,"aria-describedby":this.describedBy(),"aria-controls":`${this.idOptions} ${this.search?this.idChips:""}`,"aria-invalid":this.hasError()?.toString(),disabled:this.disabled,readonly:!this.search,onClick:()=>this.search&&this.open?null:this.toggleOpen(),onKeyDown:e=>this.handleInputKeyboard(e),onBlur:e=>this.handleBlur(e),onInput:e=>this.search&&this.setSearchQuery(e.target.value),ref:e=>this.elInput=e}),this.hasError()&&l("pn-icon",{key:"5204a96efe2e88fee5d762a89b0623b1f8a163ce",class:"pn-multiselect-icon","data-error":!0,icon:c,color:"warning"}),l("button",{key:"78a487b3afc8c91e588d7922f3a2b490e9173d2f",id:this.idButton,type:"button",class:"pn-multiselect-button","aria-label":this.translate("BUTTON_"+(this.open?"CLOSE":"OPEN")),"aria-describedby":this.search?null:this.selectId,"aria-controls":this.idOptions,"aria-expanded":""+this.open,onClick:()=>this.toggleOpen(),ref:e=>this.elButton=e},l("pn-icon",{key:"061e6c886b21d559c439d2e689cfc02b328d87c9",class:"pn-multiselect-icon",icon:r,color:"blue700"}))),this.renderOptions()),this.hasMessage()&&l("p",{key:"a1c3cdabb02dfc2403dbe55cc4ce2fb38f71578c",id:this.idHelper,class:"pn-multiselect-description",role:this.error?"alert":null},l("span",{key:"3f9428b50a5d440866462e52181e13aa3b894e6a"},this.error||this.helpertext)),this.search&&this.renderChips(),l("slot",{key:"74dc717f4f662fbc53b0e73f0690a10a13feeb22"}),this.search&&l("p",{key:"85126ac7f1b59b4f2fd988bff08b5b2bcb561cbb",id:this.idSr,class:"pn-multiselect-sr-only",role:"alert","aria-live":"assertive"},this.srMessage&&l("span",{key:"45615fbfb30b133134d06c6fbee20a75a1dd61bd"},this.srMessage))))}static get watchers(){return{open:[{handleOpen:0}],search:[{handleSearch:0}],searchQuery:[{handleSearchQuery:0}],selectId:[{handleSelectId:0}]}}static get style(){return`${e("pn-multiselect")}{display:inline-block}${e("pn-multiselect")} .pn-multiselect{border:0;margin:0;padding:0}${e("pn-multiselect")} .pn-multiselect[data-icon] .pn-multiselect-element{padding-left:3em}${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element{padding-right:5.5em;border-color:#a70707}${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:hover{border-color:#500715}${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:focus-visible{background-color:#ffffff;border-color:#a70707;outline-color:#a70707}${e("pn-multiselect")} .pn-multiselect-label{cursor:pointer;display:flex;justify-content:space-between;align-items:flex-end;font-weight:400;color:#2d2013;margin:0 0 0.25em 0;gap:0.5em;-webkit-tap-highlight-color:transparent;transition-property:color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-label{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-label>span{font-size:0.875em}${e("pn-multiselect")} .pn-multiselect-label{width:100%}${e("pn-multiselect")} .pn-multiselect-sr-only{position:absolute;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);margin:-1px;white-space:nowrap}${e("pn-multiselect")} .pn-multiselect-group{position:relative;padding:0;margin:0}${e("pn-multiselect")} .pn-multiselect-input{position:relative}${e("pn-multiselect")} .pn-multiselect-input>${e("pn-icon")}{pointer-events:none;position:absolute;top:0.75em;right:3.5em}${e("pn-multiselect")} .pn-multiselect-input>${e("pn-icon")}[data-custom]{left:0.75em;right:unset}${e("pn-multiselect")} .pn-multiselect-button{cursor:pointer;position:absolute;right:0.75em;top:50%;transform:translateY(-50%);padding:0;margin:0;border:0;width:2em;height:2em;font-size:1em;border-radius:50%;background-color:transparent;-webkit-tap-highlight-color:transparent;transition-property:background-color, outline-color, border-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-button{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-button{outline:0.2rem solid transparent;outline-offset:0.2rem}${e("pn-multiselect")} .pn-multiselect-button:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-button>${e("pn-icon")}>svg>path{transition-property:transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-button>${e("pn-icon")}>svg>path{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-button>${e("pn-icon")}>svg>path{transition-delay:0.2s;transform-origin:center;transform:rotate(0deg)}${e("pn-multiselect")} .pn-multiselect-button:hover{background-color:#effbff}${e("pn-multiselect")} .pn-multiselect-button[aria-expanded=true]{background-color:#effbff}${e("pn-multiselect")} .pn-multiselect-button[aria-expanded=true]>${e("pn-icon")}>svg>path{transform:rotate(180deg);transition-delay:0s}${e("pn-multiselect")} .pn-multiselect-element{color:#2d2013;background-color:#ffffff;border:0.0625em solid #969087;border-radius:0.5em;padding:0.75em;font-family:inherit;font-size:1em;font-weight:500;line-height:1.5em;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}${e("pn-multiselect")} .pn-multiselect-element:-webkit-autofill,${e("pn-multiselect")} .pn-multiselect-element:-webkit-autofill:hover,${e("pn-multiselect")} .pn-multiselect-element:-webkit-autofill:focus,${e("pn-multiselect")} .pn-multiselect-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #e0f8ff inset;-webkit-text-fill-color:#2d2013}${e("pn-multiselect")} .pn-multiselect-element{outline:0.2rem solid transparent;outline-offset:0.2rem}${e("pn-multiselect")} .pn-multiselect-element:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-element{transition-property:outline-color, background-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-element{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-element::placeholder{color:#5e554a;font-weight:normal}${e("pn-multiselect")} .pn-multiselect-element:hover{border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-multiselect")} .pn-multiselect-element{cursor:text;text-align:left;transition-delay:0.1s, 0.1s, 0s;width:100%;padding-right:3.5em;display:flex;align-items:center;justify-content:space-between;gap:0.5em;overflow:hidden;text-overflow:ellipsis}${e("pn-multiselect")} .pn-multiselect-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2;pointer-events:none}${e("pn-multiselect")} .pn-multiselect-element:disabled+.pn-multiselect-button{pointer-events:none}${e("pn-multiselect")} .pn-multiselect-element:disabled+.pn-multiselect-button path{fill:#5e554a}${e("pn-multiselect")} .pn-multiselect-element:placeholder{color:#5e554a;font-weight:normal}${e("pn-multiselect")} .pn-multiselect-element[type=input]:hover{cursor:pointer;color:#2d2013;background-color:#effbff;transition-delay:0s}${e("pn-multiselect")} .pn-multiselect-element[type=input]:hover[aria-invalid=true]{background-color:#fdefee}${e("pn-multiselect")} .pn-multiselect-element:focus-visible{transition-delay:0s}${e("pn-multiselect")} .pn-multiselect-element::-webkit-search-cancel-button,${e("pn-multiselect")} .pn-multiselect-element::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}${e("pn-multiselect")} .pn-multiselect-options{scroll-behavior:smooth;position:absolute;z-index:10;top:calc(100% + 0.5em);left:0;right:0;background-color:#ffffff;box-shadow:0em 0.075em 0.225em 0em rgba(0, 0, 0, 0.1), 0em 0.4em 0.9em 0em rgba(0, 0, 0, 0.13);border-radius:0.5em;list-style:none;margin:0;padding:0;width:var(--pn-select-options-width);max-height:var(--pn-select-max-height);overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;visibility:hidden;transform-origin:top left}${e("pn-multiselect")} .pn-multiselect-options[data-open]{visibility:visible}${e("pn-multiselect")} .pn-multiselect-options[data-upwards]{top:unset;bottom:calc(100% + 0.5em);transform-origin:bottom left;box-shadow:0 -0.0625em 0.125em rgba(0, 0, 0, 0.2)}${e("pn-multiselect")} .pn-multiselect-options[data-moving]{overflow:hidden;visibility:visible}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar{background-color:#ffffff;width:0.875em;border-radius:0.5em}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-track{background-color:#ffffff;border-radius:0.5em}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-thumb{cursor:pointer;background-color:#969087;border-radius:1em;border:0.25em solid #ffffff}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-thumb:hover{background-color:#5e554a}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-corner,${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-button{display:none}${e("pn-multiselect")} .pn-multiselect-options>${e("pn-input")}{padding:0.5em}${e("pn-multiselect")} .pn-multiselect-optgroup{list-style:none;padding:0}${e("pn-multiselect")} .pn-multiselect-optgroup>.pn-multiselect-option>.pn-multiselect-option-content{padding-left:2em}${e("pn-multiselect")} .pn-multiselect-chips{list-style:none;display:flex;flex-wrap:wrap;gap:0.5em;padding:0;margin:0.5em 0 0 0;color:#5e554a;font-weight:400}${e("pn-multiselect")} .pn-multiselect-chips:empty{display:none}${e("pn-multiselect")} .pn-multiselect-chip{margin:0;display:inline-flex;align-items:center;gap:0.25em;background-color:#ffffff;border-radius:0.5em;padding:0.125em 0.25em 0.125em 0.5em;line-height:1.5em;border:0.0625em solid #5e554a;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, outline-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-chip{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-chip:focus-within{color:#005d92;outline-color:#005d92;background-color:#effbff;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-chip[data-count]{pointer-events:none;border:0;padding-left:0;padding-right:0;background-color:unset}${e("pn-multiselect")} .pn-multiselect-chip-label{font-size:0.875em;white-space:nowrap}${e("pn-multiselect")} .pn-multiselect-chip-button{cursor:pointer;font-size:1em;padding:0.25em;height:1.5em;width:1.5em;border:0;background-color:unset;border-radius:50%;transition-property:background-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-chip-button{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-chip-button{-webkit-tap-highlight-color:transparent}${e("pn-multiselect")} .pn-multiselect-chip-button:hover{background-color:#8eddf9}${e("pn-multiselect")} .pn-multiselect-chip-button:focus{outline:0}${e("pn-multiselect")} .pn-multiselect-no-results{margin:0;padding:0.75em}${e("pn-multiselect")} .pn-multiselect-description{color:#5e554a;font-size:0.875em;font-weight:400;margin:0.25em 0 0 0;display:flex;flex-direction:column;gap:0.25em}${e("pn-multiselect")} .pn-multiselect-description[role=alert]{color:#a70707}${e("pn-multiselect")} .pn-multiselect-option{position:relative;margin:0;padding:0}${e("pn-multiselect")} .pn-multiselect-option .pn-ripple{animation:ripple 0.4s cubic-bezier(0.7, 0, 0.3, 1);position:absolute;border-radius:50%;background-color:#005d92;transform:translate(-50%, -50%) scale(0);opacity:0.1;pointer-events:none;z-index:3}@keyframes ripple{to{transform:translate(-50%, -50%) scale(1);opacity:0}}${e("pn-multiselect")} .pn-multiselect-option-input{cursor:pointer;position:absolute;opacity:0;left:0;top:0;height:100%;width:100%;margin:0;-webkit-tap-highlight-color:transparent}${e("pn-multiselect")} .pn-multiselect-option-input:disabled{pointer-events:none}${e("pn-multiselect")} .pn-multiselect-option-input:disabled+.pn-multiselect-option-content{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2;pointer-events:none}${e("pn-multiselect")} .pn-multiselect-option-input:disabled+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#f3f2f2;border-color:#969087}${e("pn-multiselect")} .pn-multiselect-option-input:disabled+.pn-multiselect-option-content path{fill:#5e554a}${e("pn-multiselect")} .pn-multiselect-option-input:disabled:checked+.pn-multiselect-option-content{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-multiselect")} .pn-multiselect-option-input:disabled:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#969087;border-color:#969087}${e("pn-multiselect")} .pn-multiselect-option-input:disabled:checked+.pn-multiselect-option-content path{fill:#5e554a}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]+.pn-multiselect-option-content .pn-ripple{background-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked+.pn-multiselect-option-content{background-color:#fdefee}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#a70707;border-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:focus-visible+.pn-multiselect-option-content{background-color:#fdefee}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#500715;border-color:#500715}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:hover+.pn-multiselect-option-content{background-color:#fef7f6}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#500715;border-color:#500715}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:hover+.pn-multiselect-option-content{background-color:#fef7f6}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#fdefee;border-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{outline-color:#a70707;background-color:#fdefee;border-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input:hover+.pn-multiselect-option-content{background-color:#effbff}${e("pn-multiselect")} .pn-multiselect-option-input:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#005d92;background-color:#e0f8ff}${e("pn-multiselect")} .pn-multiselect-option-input:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{outline-color:#005d92;background-color:#e0f8ff;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-option-input:checked+.pn-multiselect-option-content{background-color:#e0f8ff}${e("pn-multiselect")} .pn-multiselect-option-input:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#005d92;background-color:#005d92}${e("pn-multiselect")} .pn-multiselect-option-input:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox svg polyline.pn-multiselect-option-checkbox-checkmark-path{transition-delay:0.2s;stroke-dashoffset:0}${e("pn-multiselect")} .pn-multiselect-option-input:checked:hover+.pn-multiselect-option-content{background-color:#effbff}${e("pn-multiselect")} .pn-multiselect-option-input:checked:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#0d234b;background-color:#0d234b}${e("pn-multiselect")} .pn-multiselect-option-input:checked:focus-visible+.pn-multiselect-option-content{background-color:#e0f8ff}${e("pn-multiselect")} .pn-multiselect-option-input:checked:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#0d234b;background-color:#0d234b}${e("pn-multiselect")} .pn-multiselect-option-input:indeterminate+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#005d92;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-option-input:indeterminate+.pn-multiselect-option-content svg .pn-multiselect-option-checkbox-checkmark-path{stroke-dashoffset:23}${e("pn-multiselect")} .pn-multiselect-option-input:indeterminate+.pn-multiselect-option-content svg .pn-multiselect-option-checkbox-indeterminate-path{stroke-dashoffset:0}${e("pn-multiselect")} .pn-multiselect-option-input:indeterminate:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#0d234b;border-color:#0d234b}${e("pn-multiselect")} .pn-multiselect-option-content{position:relative;overflow:hidden;z-index:-1;display:flex;align-items:center;padding:0.75em 1em;gap:0.5em;background-color:#ffffff;transition-property:background-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-option-content{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-option-text{flex:1;text-overflow:ellipsis;overflow:hidden}${e("pn-multiselect")} .pn-multiselect-option-label{color:#2d2013;font-weight:400}${e("pn-multiselect")} .pn-multiselect-option-helper{color:#5e554a;margin:0}${e("pn-multiselect")} .pn-multiselect-option-checkbox{background-color:#ffffff;flex:0 0 1.5em;width:1.5em;height:1.5em;border:0.0625em solid #969087;border-radius:0.25em;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, border-color, outline-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-option-checkbox{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline{stroke:#ffffff;stroke-linecap:round;stroke-dasharray:23;transition-property:stroke-dashoffset;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline{transition-delay:0s}${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline.pn-multiselect-option-checkbox-checkmark-path{stroke-dashoffset:23}${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline.pn-multiselect-option-checkbox-indeterminate-path{stroke-dashoffset:23}`}},[772,"pn-multiselect",{label:[1],helpertext:[1],placeholder:[1],name:[1],selectId:[1,"select-id"],selectName:[1,"select-name"],icon:[1],language:[1],options:[1040],selectAll:[4,"select-all"],allValue:[1,"all-value"],search:[4],searchQuery:[1025,"search-query"],itemCount:[2,"item-count"],maxHeight:[1,"max-height"],top:[4],bottom:[4],required:[4],disabled:[4],invalid:[4],error:[1],isClosing:[32],isExpanding:[32],isSearching:[32],open:[32],upwards:[32],srMessage:[32]},[[9,"resize","handleResize"]],{open:[{handleOpen:0}],search:[{handleSearch:0}],searchQuery:[{handleSearchQuery:0}],selectId:[{handleSelectId:0}]}]),k=g,v=function(){"undefined"!=typeof customElements&&["pn-multiselect","pn-icon"].forEach((t=>{switch(t){case"pn-multiselect":customElements.get(e(e(t)))||customElements.define(e(e(t)),g);break;case"pn-icon":customElements.get(e(e(t)))||b()}}))};export{k as PnMultiselect,v as defineCustomElement}
5
+ import{transformTag as e,proxyCustomElement as t,Mixin as i,createEvent as n,h as l,Host as o}from"@stencil/core/internal/client";import{a as s}from"./index2.js";import{a as c}from"./alert_exclamation_circle.js";import{c as r}from"./chevron_down.js";import{c as a}from"./close.js";import{u as p,k as u,o as m,j as d,e as h}from"./helpers.js";import{d as f}from"./pn-icon2.js";const b={SELECT_AN_OPTION:{en:"Select an option",sv:"Välj ett alternativ",da:"Vælg en mulighed",fi:"Valitse vaihtoehto",no:"Velg et alternativ"},SELECT_ALL_OPTIONS:{en:"Select all options",sv:"Välj alla alternativ",da:"Vælg alle muligheder",fi:"Valitse kaikki vaihtoehdot",no:"Velg alle alternativer"},SELECT_FOUND_OPTIONS:{en:"Select {number} options",sv:"Välj {number} alternativ",da:"Vælg {number} muligheder",fi:"Valitse {number} vaihtoehtoa",no:"Velg {number} alternativer"},SELECTED_OPTIONS:{en:"Selected options.",sv:"Valda alternativ.",da:"Valgte muligheder.",fi:"Valitut vaihtoehdot.",no:"Valgte alternativer."},BUTTON_OPEN:{en:"Open list",sv:"Öppna listan",da:"Open list",fi:"Open list",no:"Open list"},BUTTON_CLOSE:{en:"Close list",sv:"Stäng listan",da:"Close list",fi:"Close list",no:"Close list"},REMOVE:{en:"Remove",sv:"Ta bort",da:"Remove",fi:"Remove",no:"Remove"},REMOVED:{en:"Removed",sv:"Tog bort",da:"Fjernet",fi:"Poistettu",no:"Fjernet"},MORE_OPTION:{en:"more option.",sv:"alternativ till.",da:"mulighed mere.",fi:"vaihtoehto lisää.",no:"alternativ til."},MORE_OPTIONS:{en:"more options.",sv:"fler alternativ.",da:"more options.",fi:"more options.",no:"more options."},SEARCH:{en:"Search",sv:"Sök",da:"Søg",fi:"Hae",no:"Søk"},RESULTS_FOUND:{en:"options found",sv:"alternativ hittades",da:"muligheder fundet",fi:"vaihtoehtoja löytyi",no:"alternativer funnet"},NO_SEARCH_RESULTS:{en:"No options found",sv:"Inga alternativ hittades",da:"Ingen muligheder fundet",fi:"Vaihtoehtoja ei löytynyt",no:"Finner ingen alternativer"},NO_OPTIONS:{en:"No options available",sv:"Inga alternativ tillgängliga",da:"Ingen tilgængelige muligheder",fi:"Ei vaihtoehtoja",no:"Ingen tilgjengelige alternativer"}},g=t(class extends(i(s)){constructor(e){super(!1),!1!==e&&this.__registerHost(),this.toggleSelect=n(this,"toggleSelect",7),this.allOptions=n(this,"allOptions",7),this.selectedOption=n(this,"selectedOption",7),this.selectedAllOptions=n(this,"selectedAllOptions",7),this.searchInput=n(this,"searchInput",7)}id="pn-multiselect-"+p();idLegend=this.id+"-legend";idButton=this.id+"-button";idOptions=this.id+"-options";idHelper=this.id+"-text";idChips=this.id+"-chips";idSr=this.id+"-sr";elGroup;elButton;elInput;elList;elChips;srTimer;get hostElement(){return this}isSearching=!1;open=!1;upwards=!1;srMessage;label;helpertext;placeholder;name;selectId=this.id;selectName;icon;compact=!1;language=null;options;selectAll=!1;allValue="pn_multiselect_all";search=!1;searchQuery="";itemCount=5;maxHeight;top=!1;bottom=!1;required=!1;disabled=!1;invalid=!1;error;handleOpen(){this.open?(this.addGlobalEventListeners(),this.handleDirection(),this.handleMaxHeight(),this.handleWidth()):this.removeGlobalEventListeners(),this.dropdownHandler()}handleSearch(){this.search||(this.options=[...this.options.map((e=>{const t={...e,hide:!1};return t?.group?.length&&t.group.map((e=>({...e,hide:!1}))),t}))])}handleSearchQuery(){this.search&&"string"==typeof this.searchQuery&&this.handleInputSearch()}handleSelectId(){const e=this.selectId;this.idLegend=e+"-legend",this.idButton=e+"-button",this.idOptions=e+"-options",this.idHelper=e+"-text",this.idChips=e+"-chips",this.idSr=e+"-sr"}handleResize(){this.open&&(this.toggleOpen(!1),this.elList.style.removeProperty("--pn-select-options-width"),this.elList.style.removeProperty("--pn-select-max-height"))}toggleSelect;allOptions;selectedOption;selectedAllOptions;searchInput;async componentWillLoad(){this.handleSelectId(),null===this.language&&await u(this.hostElement)}componentDidLoad(){this.searchQuery?.length&&this.handleSearchQuery()}globalEvents=e=>{const t=e.target,i=t?.closest(this.hostElement.localName);i||this.toggleOpen(!1)};addGlobalEventListeners(){this.hostElement.getRootNode().addEventListener("click",this.globalEvents)}removeGlobalEventListeners(){this.hostElement.getRootNode().removeEventListener("click",this.globalEvents)}dropdownHandler(){this.open?this.openDropdown(this.elList):this.closeDropdown(this.elList)}emitEvents(e,t){if(this.allOptions.emit(this.options),e)return this.selectedOption.emit(e);const i={checked:t,searching:this.isSearching};this.search&&this.optionsTotal()!==this.optionsSearch().length&&(i.query=this.searchQuery,i.found=this.optionsSearch()),this.selectedAllOptions.emit(i)}optionsChecked(){const e=this.options?.reduce(((e,t)=>{const i=t.group?[...t.group.filter((({checked:e})=>e))]:[];return t.checked&&e.push(t),i?.length&&e.push(...i),e}),[]);return e}optionsTotal(){return this.options?.reduce(((e,t)=>e+(t?.group?.length?t.group.length+1:1)),0)}optionsIndex(e){const t=({group:t=[]})=>t?.findIndex((({value:t})=>t===e)),i=this.options.findIndex((i=>i.value===e||-1!==t(i)));return{indexGroup:i,indexNested:t(this.options?.[i])}}optionsCheckedTotal(){return this.optionsChecked()?.length}optionsCheckedPreview(){return this.optionsChecked()?.slice(0,this.itemCount)}optionsCheckedLabels(){return this.optionsChecked()?.map((({label:e})=>e))?.join(", ")?.trim()}optionsSearch(){const e=this.options?.reduce(((e,t)=>{const i=t.group?[...t.group.filter((({hide:e})=>!e))]:[];return t.hide||e.push(t),i?.length&&e.push(...i),e}),[]);return e}noResults(){return 0===this.optionsSearch()?.length}isIndeterminate(e){const t=this.options?.[e];if(t?.group?.length){const e=t.group.every((({checked:e})=>e)),i=t.group.every((({checked:e})=>!e));return!(e||i)}return!1}optionSelect({val:e,checked:t,chip:i}){if(e===this.allValue)return this.optionSelectAll(t);const n=this.options,{indexGroup:l,indexNested:o}=this.optionsIndex(e),s=n[l]?.group,c=s?.[o];if(c?.value){n[l].group[o].checked=t;const e=s?.every((({checked:e})=>e));n[l].checked=!!e}else n[l].checked=t,s?.length&&(n[l].group=s?.map((e=>({...e,checked:t}))));const r=-1===o?n[l]:n[l].group[o];this.emitEvents(r),this.options=[...n],"number"==typeof i&&(this.handleSrMesssage(`${this.translate("REMOVED")} ${r.label}`),requestAnimationFrame((()=>{const e=i===this.optionsCheckedTotal()?i-1:i,t=Array.from(this.elChips.children)?.[e];t?.querySelector("button").focus({preventScroll:!0})})))}optionSelectAll(e){this.options=[...this.options.map((t=>{const i={...t,checked:this.isSearching&&t.hide?t.checked:e};i.group&&(i.group=[...i.group.map((t=>({...t,checked:this.isSearching&&t.hide?t.checked:e})))]);const n=i?.group?.every((({checked:e})=>e));return i?.group?.length&&(i.checked=n),i}))],this.emitEvents(null,e)}optionSelected(e){return!!this.optionsChecked()?.find((({value:t,checked:i})=>t===e&&i))}translate(e){const t=b?.[e]?.[this.language||h];return t.includes("{number}")?t.replace("{number}",this.optionsSearch().length):t}getRect(e){return e?.getBoundingClientRect()}ripple({clientX:e,clientY:t,target:i}){const n=0===e&&0===t,l=i.nextElementSibling,{x:o,width:s,y:c,top:r}=this.getRect(l);m(n?{clientX:o+s-24,clientY:c-r}:{clientX:e,clientY:t},l)}handleSrMesssage(e){this.srMessage=e,clearTimeout(this.srTimer),this.srTimer=setTimeout((()=>this.srMessage=null),2e3)}handleDirection(){if(this.top)return this.upwards=!0;if(this.bottom)return this.upwards=!1;const{bottom:e,top:t}=this.getRect(this.elInput),i=window.innerHeight-e-16;this.upwards=(t-16)/2>i}handleMaxHeight(){if(this.maxHeight)return this.elGroup.style.setProperty("--pn-select-max-height",this.maxHeight);const{bottom:e,top:t}=this.getRect(this.elInput),i=this.upwards?t:e,n=d(),l=this.upwards?n+16:16,o=this.upwards?i-l:window.innerHeight-i-l;this.elGroup.style.setProperty("--pn-select-max-height",Math.ceil(o)+"px")}handleWidth(){const{width:e}=this.getRect(this.elInput);this.elGroup.style.setProperty("--pn-select-options-width",Math.ceil(e)+"px")}setFocus(){this.search?this.elInput.focus({preventScroll:!0}):this.elButton.focus({preventScroll:!0})}hasError(){return this.invalid||!!this.error}hasMessage(){return!!this.helpertext||!!this.error}toggleOpen(e){"boolean"==typeof e&&e===this.open||(this.open=e??!this.open,this.toggleSelect.emit({open:this.open}))}handleInputKeyboard(e){e.stopImmediatePropagation();const{code:t}=e;if("Escape"===t)return this.toggleOpen(!1);!this.open&&t.match(/^(Space|Enter)$|Arrow|^Key.*$/)&&this.toggleOpen()}setSearchQuery(e){this.open||this.toggleOpen(!0),this.searchQuery=e}handleInputSearch(){if(this.isEmpty())return;const e=this.searchQuery,t=({label:t,helpertext:i,value:n})=>`${t} ${i} ${n}`.trim().toLowerCase().includes(e.toLowerCase()),i=this.options.map((e=>{const i=e?.group?.map((e=>({...e,hide:!t(e)})))||[],n=t(e)||i?.some((({hide:e})=>!e));return e.hide=!n,e?.group?.length&&(e.group=[...i]),e}));this.isSearching=""!==e,this.options=[...i],this.searchInput.emit({query:e,found:this.optionsSearch()})}getListItem(e){const{value:t}=this.options[e];return this.elList.querySelector(`.pn-multiselect-option-input[value='${t}']`)}getOptionIndex(e,t,i){const n=this.optionsTotal()-1;if("End"===i)return n;if("Home"===i)return 0;const l=this.options.findIndex((({value:t})=>t===e))+t.find((e=>"number"==typeof e));return l>=n?n:l<=0?0:l}checkboxNav(e,t){const{code:i}=e,n="Tab"===i,l="Space"===i,o="Enter"===i,s="Escape"===i,c=["ArrowUp"===i&&-1,"ArrowDown"===i&&1,"PageUp"===i&&-10,"PageDown"===i&&10,"Home"===i&&0,"End"===i&&this.optionsTotal()-1,n,l,o,s];if(!c.some((e=>"number"==typeof e||e)))return;if(n||l||o)return;if(e.stopImmediatePropagation(),e.preventDefault(),s)return this.setFocus(),this.toggleOpen(!1);const r=this.getOptionIndex(t,c,i);return this.getListItem(r)?.focus()}handleBlur(e){const t=e.target,i=e.relatedTarget;"pn-multiselect-chip-button"===(i||t)?.className&&this.toggleOpen(!1)}handleLabel(){this.disabled||this.setFocus()}isEmpty(){return 0===(this.options?.length||0)}showSelectAll(){return this.selectAll&&!this.isEmpty()&&!this.noResults()}showEmptyOption(){return this.isSearching&&this.noResults()||this.isEmpty()}getPlaceholder(){return this.placeholder||this.translate(this.search?"SEARCH":"SELECT_AN_OPTION")}handleChange({target:e}){const{value:t,checked:i}=e;this.optionSelect({val:t,checked:i})}additonalOptions(){const e=this.optionsCheckedTotal()-this.itemCount;return`${e} ${this.translate("MORE_OPTION"+(1===e?"":"S"))}`}describedBy(){const e=[this.search&&this.idChips,this.srMessage&&this.idSr,!!this.helpertext&&this.idHelper].filter(Boolean);return e.length?e.join(" "):null}renderOption({label:e,value:t,checked:i,helpertext:n,icon:o,id:s=`${this.selectId}-${t||e}`,invalid:c,disabled:r,hide:a,group:p},u,m){return l("li",{class:"pn-multiselect-option",key:s,hidden:a},l("input",{type:"checkbox",id:s,class:"pn-multiselect-option-input",checked:i??this.optionSelected(t),indeterminate:void 0===m&&this.isIndeterminate(u),name:this.name,value:t,disabled:this.disabled||r,required:this.required,"aria-invalid":c?"true":null,"aria-describedby":n?s+"-helper":null,onClick:e=>this.ripple(e),onKeyDown:e=>this.checkboxNav(e,t),onBlur:e=>this.handleBlur(e)}),l("div",{class:"pn-multiselect-option-content"},!!o&&l("pn-icon",{icon:o,color:"blue900"}),l("div",{class:"pn-multiselect-option-text"},l("label",{class:"pn-multiselect-option-label",htmlFor:s},l("span",null,e)),n&&l("p",{class:"pn-multiselect-option-helper",id:s+"-helper"},n)),l("div",{class:"pn-multiselect-option-checkbox"},l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},l("polyline",{class:"pn-multiselect-option-checkbox-checkmark-path",points:"4,12 9,17 20,6","stroke-width":"3"}),l("polyline",{class:"pn-multiselect-option-checkbox-indeterminate-path",points:"4,12 20,12","stroke-width":"3"})))),p?.length&&l("ul",{class:"pn-multiselect-optgroup"},p?.map(((e,t)=>this.renderOption(e,u,t)))))}renderOptions(){return l("ul",{id:this.idOptions,class:"pn-multiselect-options","data-open":this.open,"data-upwards":this.upwards,onChange:e=>this.handleChange(e),style:{height:"0px"},ref:e=>this.elList=e},this.showSelectAll()&&this.renderOption({label:this.translate(`SELECT_${this.isSearching?"FOUND":"ALL"}_OPTIONS`),value:this.allValue,checked:this.optionsTotal()===this.optionsCheckedTotal()}),this.options?.map(((e,t)=>this.renderOption(e,t))),this.showEmptyOption()&&l("li",{class:"pn-multiselect-option"},l("div",{class:"pn-multiselect-option-content",role:"alert"},l("div",{class:"pn-multiselect-option-text"},l("span",{class:"pn-multiselect-option-label"},this.translate(this.isEmpty()?"NO_OPTIONS":"NO_SEARCH_RESULTS"))))))}renderChips(){return l("ul",{id:this.idChips,class:"pn-multiselect-chips","aria-label":this.translate("SELECTED_OPTIONS"),ref:e=>this.elChips=e},this.optionsCheckedPreview()?.map((({label:e,value:t},i)=>l("li",{class:"pn-multiselect-chip","aria-setsize":this.optionsCheckedTotal(),"aria-posinset":i+1,key:`${e}-${t}`},l("span",{class:"pn-multiselect-chip-label"},e),l("button",{type:"button",class:"pn-multiselect-chip-button","aria-label":`${this.translate("REMOVE")} ${e}`,onClick:()=>this.optionSelect({val:t,checked:!1,chip:i})},l("pn-icon",{icon:a,small:!0,color:"blue700"}))))),this.optionsCheckedTotal()>this.itemCount&&l("li",{class:"pn-multiselect-chip","data-count":!0},l("span",{class:"pn-multiselect-chip-label"},"+ ",this.additonalOptions())))}renderLabel(e=!1){return this.label?l(e?"div":"legend",{id:e?null:this.idLegend,class:{"pn-multiselect-label":!0,"pn-multiselect-sr-only":this.compact&&!e},"data-compact":this.compact,...e?{inert:!0}:{onClick:()=>this.handleLabel()}},l("span",null,this.label),!!this.optionsChecked()?.length&&l("span",null,this.optionsCheckedTotal(),"/",this.optionsTotal())):null}render(){return l(o,{key:"55af777ec6dd7165b4d16bdad6ec784fe81b8f20"},l("fieldset",{key:"41a5e9a45b3460a96676d606c458a062efe6ab80",class:"pn-multiselect","data-icon":!!this.icon,"data-error":this.hasError(),disabled:this.disabled},this.renderLabel(),l("div",{key:"fb6874e8d17a70ec0e1e21bf3474575b01c3e669",class:"pn-multiselect-group",ref:e=>this.elGroup=e},l("div",{key:"ab6aa995337f5a80e2026d98fe69399571249c24",class:"pn-multiselect-input"},!!this.icon&&l("pn-icon",{key:"0d9495e8864e266a6ababc752781b6e9c75595c3",class:"pn-multiselect-icon","data-custom":!0,icon:this.icon}),l("input",{key:"6b5adbc27ab64b9cdb7f53a99d2f4cd9a2185e47",tabindex:this.search?null:"-1",type:this.search?"search":"input",id:this.selectId,class:"pn-multiselect-element",value:this.search?this.searchQuery:this.optionsCheckedLabels(),name:this.selectName,placeholder:this.getPlaceholder(),required:this.search?null:this.required,"aria-labelledby":this.idLegend,"aria-describedby":this.describedBy(),"aria-controls":`${this.idOptions} ${this.search?this.idChips:""}`,"aria-invalid":this.hasError()?.toString(),disabled:this.disabled,readonly:!this.search,"data-compact":this.compact,onClick:()=>this.search&&this.open?null:this.toggleOpen(),onKeyDown:e=>this.handleInputKeyboard(e),onBlur:e=>this.handleBlur(e),onInput:e=>this.search&&this.setSearchQuery(e.target.value),ref:e=>this.elInput=e}),this.compact&&this.renderLabel(!0),this.hasError()&&l("pn-icon",{key:"36e6f1e307758cdec5f9eda59413b8a0c28af78c",class:"pn-multiselect-icon","data-error":!0,icon:c,color:"warning"}),l("button",{key:"6197b7545b8646fecbd5a12e540e3011303f660c",id:this.idButton,type:"button",class:"pn-multiselect-button","aria-label":this.translate("BUTTON_"+(this.open?"CLOSE":"OPEN")),"aria-describedby":this.search?null:this.selectId,"aria-controls":this.idOptions,"aria-expanded":""+this.open,onClick:()=>this.toggleOpen(),ref:e=>this.elButton=e},l("pn-icon",{key:"f9ddba2705b7782606897f6374f5963833bde76e",class:"pn-multiselect-icon",icon:r,color:"blue700"}))),this.renderOptions()),this.hasMessage()&&l("p",{key:"d9fb544f999b9d779362f13090e9653bbd22fd4e",id:this.idHelper,class:"pn-multiselect-description",role:this.error?"alert":null},l("span",{key:"ed1426909307379ba22c06a6870ad867f5a7cdad"},this.error||this.helpertext)),this.search&&this.renderChips(),l("slot",{key:"d0bc44a9160fa4151e6f74c05fa3102189710454"}),this.search&&l("p",{key:"0d8c04c19227c1461a18ccc21a9fd7412a2f6ee1",id:this.idSr,class:"pn-multiselect-sr-only",role:"alert","aria-live":"assertive"},this.srMessage&&l("span",{key:"610fc47f9a032c6e8931745e6b6d0b418eadd5ee"},this.srMessage))))}static get watchers(){return{open:[{handleOpen:0}],search:[{handleSearch:0}],searchQuery:[{handleSearchQuery:0}],selectId:[{handleSelectId:0}]}}static get style(){return`${e("pn-multiselect")}{display:inline-block}${e("pn-multiselect")} .pn-multiselect{position:relative;border:0;margin:0;padding:0}${e("pn-multiselect")} .pn-multiselect[data-icon]{--pn-input-offset-left:2em}${e("pn-multiselect")} .pn-multiselect[data-icon] .pn-multiselect-element{padding-left:2.75em}${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-label{color:#a70707}${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-label[data-compact]{color:#2d2013}${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element{padding-right:5.5em;border-color:#a70707}${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:hover{border-color:#500715}${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:focus-visible{background-color:#ffffff;border-color:#a70707;outline-color:#a70707}${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:-webkit-autofill,${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:-webkit-autofill:hover,${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:-webkit-autofill:focus,${e("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #fef7f6 inset;-webkit-text-fill-color:#2d2013}${e("pn-multiselect")} .pn-multiselect-label{width:100%;cursor:pointer;display:flex;justify-content:space-between;align-items:flex-end;font-weight:400;color:#2d2013;margin:0 0 0.25em 0;gap:0.5em;-webkit-tap-highlight-color:transparent;transition-property:color, transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-label{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-label[data-compact]{position:absolute;top:1.5625em;left:calc(var(--pn-input-offset-left, 0px) + 0.75em + 0.0625em);margin:0;pointer-events:none;align-items:center;height:1.5em;max-width:calc(100% - (var(--pn-input-offset-left, 0px) + 0.75em) - (var(--pn-input-offset-right, 0px) + 0.75em));transform:translateY(-50%) scale(1) translateZ(0);transform-origin:0 0;transition-delay:0.2s}${e("pn-multiselect")} .pn-multiselect-label[data-compact]>span{font-size:1em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;line-height:1.5em}${e("pn-multiselect")} .pn-multiselect-label>span{font-size:0.875em}${e("pn-multiselect")} .pn-multiselect-label[data-compact]{justify-content:start}${e("pn-multiselect")} .pn-multiselect-sr-only{position:absolute;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);margin:-1px;white-space:nowrap}${e("pn-multiselect")} .pn-multiselect-group{position:relative;padding:0;margin:0}${e("pn-multiselect")} .pn-multiselect-input{position:relative}${e("pn-multiselect")} .pn-multiselect-input>${e("pn-icon")}{pointer-events:none;position:absolute;top:0.75em;right:3.5em}${e("pn-multiselect")} .pn-multiselect-input>${e("pn-icon")}[data-custom]{left:0.75em;right:unset}${e("pn-multiselect")} .pn-multiselect-button{cursor:pointer;position:absolute;right:0.75em;top:50%;transform:translateY(-50%);padding:0;margin:0;border:0;width:2em;height:2em;font-size:1em;border-radius:50%;background-color:transparent;-webkit-tap-highlight-color:transparent;transition-property:background-color, outline-color, border-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-button{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-button{outline:0.2rem solid transparent;outline-offset:0.2rem}${e("pn-multiselect")} .pn-multiselect-button:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-button>${e("pn-icon")}>svg>path{transition-property:transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-button>${e("pn-icon")}>svg>path{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-button>${e("pn-icon")}>svg>path{transition-delay:0.2s;transform-origin:center;transform:rotate(0deg)}${e("pn-multiselect")} .pn-multiselect-button:hover{background-color:#effbff}${e("pn-multiselect")} .pn-multiselect-button[aria-expanded=true]{background-color:#effbff}${e("pn-multiselect")} .pn-multiselect-button[aria-expanded=true]>${e("pn-icon")}>svg>path{transform:rotate(180deg);transition-delay:0s}${e("pn-multiselect")} .pn-multiselect-element{cursor:text;text-align:left;transition-delay:0.1s, 0.1s, 0s;width:100%;display:flex;align-items:center;justify-content:space-between;gap:0.5em;overflow:hidden;text-overflow:ellipsis;color:#2d2013;background-color:#ffffff;border:0.0625em solid #969087;border-radius:0.5em;padding:0.75em 3.5em 0.75em 0.75em;font-family:inherit;font-size:1em;font-weight:500;line-height:1.5em;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}${e("pn-multiselect")} .pn-multiselect-element:-webkit-autofill,${e("pn-multiselect")} .pn-multiselect-element:-webkit-autofill:hover,${e("pn-multiselect")} .pn-multiselect-element:-webkit-autofill:focus,${e("pn-multiselect")} .pn-multiselect-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #e0f8ff inset;-webkit-text-fill-color:#2d2013}${e("pn-multiselect")} .pn-multiselect-element{outline:0.2rem solid transparent;outline-offset:0.2rem}${e("pn-multiselect")} .pn-multiselect-element:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-element{transition-property:outline-color, background-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-element{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-element[data-compact]{text-align:left;padding-top:1.125em;padding-bottom:0.375em;max-width:unset}${e("pn-multiselect")} .pn-multiselect-element[data-compact]::placeholder{color:transparent}${e("pn-multiselect")} .pn-multiselect-element[data-compact]:focus+.pn-multiselect-label,${e("pn-multiselect")} .pn-multiselect-element[data-compact]:not(:placeholder-shown)+.pn-multiselect-label{transform:translateY(-85%) scale(0.75);transition-delay:0s}${e("pn-multiselect")} .pn-multiselect-element::placeholder{color:#5e554a;font-weight:normal}${e("pn-multiselect")} .pn-multiselect-element:hover{border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-multiselect")} .pn-multiselect-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2;pointer-events:none}${e("pn-multiselect")} .pn-multiselect-element:disabled+.pn-multiselect-button{pointer-events:none}${e("pn-multiselect")} .pn-multiselect-element:disabled+.pn-multiselect-button path{fill:#5e554a}${e("pn-multiselect")} .pn-multiselect-element:placeholder{color:#5e554a;font-weight:normal}${e("pn-multiselect")} .pn-multiselect-element[type=input]:hover{cursor:pointer;color:#2d2013;background-color:#effbff;transition-delay:0s}${e("pn-multiselect")} .pn-multiselect-element[type=input]:hover[aria-invalid=true]{background-color:#fdefee}${e("pn-multiselect")} .pn-multiselect-element:focus-visible{transition-delay:0s}${e("pn-multiselect")} .pn-multiselect-element::-webkit-search-cancel-button,${e("pn-multiselect")} .pn-multiselect-element::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}${e("pn-multiselect")} .pn-multiselect-options{scroll-behavior:smooth;position:absolute;z-index:10;top:calc(100% + 0.5em);left:0;right:0;background-color:#ffffff;box-shadow:0em 0.075em 0.225em 0em rgba(0, 0, 0, 0.1), 0em 0.4em 0.9em 0em rgba(0, 0, 0, 0.13);border-radius:0.5em;list-style:none;margin:0;padding:0;width:var(--pn-select-options-width);max-height:var(--pn-select-max-height);overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;visibility:hidden;transform-origin:top left}${e("pn-multiselect")} .pn-multiselect-options[data-open]{visibility:visible}${e("pn-multiselect")} .pn-multiselect-options[data-upwards]{top:unset;bottom:calc(100% + 0.5em);transform-origin:bottom left;box-shadow:0 -0.0625em 0.125em rgba(0, 0, 0, 0.2)}${e("pn-multiselect")} .pn-multiselect-options[data-moving]{overflow:hidden;visibility:visible}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar{background-color:#ffffff;width:0.875em;border-radius:0.5em}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-track{background-color:#ffffff;border-radius:0.5em}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-thumb{cursor:pointer;background-color:#969087;border-radius:1em;border:0.25em solid #ffffff}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-thumb:hover{background-color:#5e554a}${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-corner,${e("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-button{display:none}${e("pn-multiselect")} .pn-multiselect-options>${e("pn-input")}{padding:0.5em}${e("pn-multiselect")} .pn-multiselect-optgroup{list-style:none;padding:0}${e("pn-multiselect")} .pn-multiselect-optgroup>.pn-multiselect-option>.pn-multiselect-option-content{padding-left:2em}${e("pn-multiselect")} .pn-multiselect-chips{list-style:none;display:flex;flex-wrap:wrap;gap:0.5em;padding:0;margin:0.5em 0 0 0;color:#5e554a;font-weight:400}${e("pn-multiselect")} .pn-multiselect-chips:empty{display:none}${e("pn-multiselect")} .pn-multiselect-chip{margin:0;display:inline-flex;align-items:center;gap:0.25em;background-color:#ffffff;border-radius:0.5em;padding:0.125em 0.25em 0.125em 0.5em;line-height:1.5em;border:0.0625em solid #5e554a;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, outline-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-chip{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-chip:focus-within{color:#005d92;outline-color:#005d92;background-color:#effbff;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-chip[data-count]{pointer-events:none;border:0;padding-left:0;padding-right:0;background-color:unset}${e("pn-multiselect")} .pn-multiselect-chip-label{font-size:0.875em;white-space:nowrap}${e("pn-multiselect")} .pn-multiselect-chip-button{cursor:pointer;font-size:1em;padding:0.25em;height:1.5em;width:1.5em;border:0;background-color:unset;border-radius:50%;transition-property:background-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-chip-button{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-chip-button{-webkit-tap-highlight-color:transparent}${e("pn-multiselect")} .pn-multiselect-chip-button:hover{background-color:#8eddf9}${e("pn-multiselect")} .pn-multiselect-chip-button:focus{outline:0}${e("pn-multiselect")} .pn-multiselect-no-results{margin:0;padding:0.75em}${e("pn-multiselect")} .pn-multiselect-description{color:#5e554a;font-size:0.875em;font-weight:400;margin:0.25em 0 0 0;display:flex;flex-direction:column;gap:0.25em}${e("pn-multiselect")} .pn-multiselect-description[role=alert]{color:#a70707}${e("pn-multiselect")} .pn-multiselect-option{position:relative;margin:0;padding:0}${e("pn-multiselect")} .pn-multiselect-option .pn-ripple{animation:ripple 0.4s cubic-bezier(0.7, 0, 0.3, 1);position:absolute;border-radius:50%;background-color:#005d92;transform:translate(-50%, -50%) scale(0);opacity:0.1;pointer-events:none;z-index:3}@keyframes ripple{to{transform:translate(-50%, -50%) scale(1);opacity:0}}${e("pn-multiselect")} .pn-multiselect-option-input{cursor:pointer;position:absolute;opacity:0;left:0;top:0;height:100%;width:100%;margin:0;-webkit-tap-highlight-color:transparent}${e("pn-multiselect")} .pn-multiselect-option-input:disabled{pointer-events:none}${e("pn-multiselect")} .pn-multiselect-option-input:disabled+.pn-multiselect-option-content{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2;pointer-events:none}${e("pn-multiselect")} .pn-multiselect-option-input:disabled+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#f3f2f2;border-color:#969087}${e("pn-multiselect")} .pn-multiselect-option-input:disabled+.pn-multiselect-option-content path{fill:#5e554a}${e("pn-multiselect")} .pn-multiselect-option-input:disabled:checked+.pn-multiselect-option-content{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-multiselect")} .pn-multiselect-option-input:disabled:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#969087;border-color:#969087}${e("pn-multiselect")} .pn-multiselect-option-input:disabled:checked+.pn-multiselect-option-content path{fill:#5e554a}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]+.pn-multiselect-option-content .pn-ripple{background-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked+.pn-multiselect-option-content{background-color:#fdefee}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#a70707;border-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:focus-visible+.pn-multiselect-option-content{background-color:#fdefee}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#500715;border-color:#500715}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:hover+.pn-multiselect-option-content{background-color:#fef7f6}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#500715;border-color:#500715}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:hover+.pn-multiselect-option-content{background-color:#fef7f6}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#fdefee;border-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{outline-color:#a70707;background-color:#fdefee;border-color:#a70707}${e("pn-multiselect")} .pn-multiselect-option-input:hover+.pn-multiselect-option-content{background-color:#effbff}${e("pn-multiselect")} .pn-multiselect-option-input:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#005d92;background-color:#e0f8ff}${e("pn-multiselect")} .pn-multiselect-option-input:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{outline-color:#005d92;background-color:#e0f8ff;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-option-input:checked+.pn-multiselect-option-content{background-color:#e0f8ff}${e("pn-multiselect")} .pn-multiselect-option-input:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#005d92;background-color:#005d92}${e("pn-multiselect")} .pn-multiselect-option-input:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox svg polyline.pn-multiselect-option-checkbox-checkmark-path{transition-delay:0.2s;stroke-dashoffset:0}${e("pn-multiselect")} .pn-multiselect-option-input:checked:hover+.pn-multiselect-option-content{background-color:#effbff}${e("pn-multiselect")} .pn-multiselect-option-input:checked:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#0d234b;background-color:#0d234b}${e("pn-multiselect")} .pn-multiselect-option-input:checked:focus-visible+.pn-multiselect-option-content{background-color:#e0f8ff}${e("pn-multiselect")} .pn-multiselect-option-input:checked:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#0d234b;background-color:#0d234b}${e("pn-multiselect")} .pn-multiselect-option-input:indeterminate+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#005d92;border-color:#005d92}${e("pn-multiselect")} .pn-multiselect-option-input:indeterminate+.pn-multiselect-option-content svg .pn-multiselect-option-checkbox-checkmark-path{stroke-dashoffset:23}${e("pn-multiselect")} .pn-multiselect-option-input:indeterminate+.pn-multiselect-option-content svg .pn-multiselect-option-checkbox-indeterminate-path{stroke-dashoffset:0}${e("pn-multiselect")} .pn-multiselect-option-input:indeterminate:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#0d234b;border-color:#0d234b}${e("pn-multiselect")} .pn-multiselect-option-content{position:relative;overflow:hidden;z-index:-1;display:flex;align-items:center;padding:0.75em 1em;gap:0.5em;background-color:#ffffff;transition-property:background-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-option-content{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-option-text{flex:1;text-overflow:ellipsis;overflow:hidden}${e("pn-multiselect")} .pn-multiselect-option-helper{color:#5e554a;margin:0}${e("pn-multiselect")} .pn-multiselect-option-checkbox{background-color:#ffffff;flex:0 0 1.5em;width:1.5em;height:1.5em;border:0.0625em solid #969087;border-radius:0.25em;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, border-color, outline-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-option-checkbox{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline{stroke:#ffffff;stroke-linecap:round;stroke-dasharray:23;transition-property:stroke-dashoffset;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline{transition-duration:0s;transition-delay:0s}}${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline{transition-delay:0s}${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline.pn-multiselect-option-checkbox-checkmark-path{stroke-dashoffset:23}${e("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline.pn-multiselect-option-checkbox-indeterminate-path{stroke-dashoffset:23}`}},[772,"pn-multiselect",{label:[1],helpertext:[1],placeholder:[1],name:[1],selectId:[1,"select-id"],selectName:[1,"select-name"],icon:[1],compact:[4],language:[1],options:[1040],selectAll:[4,"select-all"],allValue:[1,"all-value"],search:[4],searchQuery:[1025,"search-query"],itemCount:[2,"item-count"],maxHeight:[1,"max-height"],top:[4],bottom:[4],required:[4],disabled:[4],invalid:[4],error:[1],isClosing:[32],isExpanding:[32],isSearching:[32],open:[32],upwards:[32],srMessage:[32]},[[9,"resize","handleResize"]],{open:[{handleOpen:0}],search:[{handleSearch:0}],searchQuery:[{handleSearchQuery:0}],selectId:[{handleSelectId:0}]}]),k=g,v=function(){"undefined"!=typeof customElements&&["pn-multiselect","pn-icon"].forEach((t=>{switch(t){case"pn-multiselect":customElements.get(e(e(t)))||customElements.define(e(e(t)),g);break;case"pn-icon":customElements.get(e(e(t)))||f()}}))};export{k as PnMultiselect,v as defineCustomElement}
@@ -2,4 +2,4 @@
2
2
  * Built with Stencil
3
3
  * By PostNord.
4
4
  */
5
- import{transformTag as e,proxyCustomElement as n,HTMLElement as t,h as r,Host as s}from"@stencil/core/internal/client";import{k as i,s as a}from"./helpers.js";import{d as c}from"./pn-button2.js";import{d as o}from"./pn-icon2.js";import{d as h}from"./pn-search-field2.js";import{d as l}from"./pn-spinner2.js";const d={SEARCH_BUTTON:{da:"Search",en:"Search",fi:"Search",no:"Search",sv:"Sök"},SEARCH_SUCCESS:{da:"Your OCR number is",en:"Your OCR number is",fi:"Your OCR number is",no:"Your OCR number is",sv:"Ditt OCR-nummer är"},ERROR_INVALID_LICENSE_NUMBER:{da:"Invalid license number",en:"Invalid license number",fi:"Invalid license number",no:"Invalid license number",sv:"Ogiltligt licensnummer"},ERROR_NO_RESULTS:{da:"The search did not generate any results",en:"The search did not generate any results",fi:"The search did not generate any results",no:"The search did not generate any results",sv:"Sökningen genererade inga träffar"},ERROR_REASON_HEADER:{da:"It may be due to:",en:"It may be due to:",fi:"It may be due to:",no:"It may be due to:",sv:"Det kan bero på:"},ERROR_REASON_ONE:{da:"We could not find that license number",en:"We could not find that license number",fi:"We could not find that license number",no:"We could not find that license number",sv:"Vi hittar inget sådant licensnummer"},ERROR_REASON_TWO:{da:"Check the information and try again.",en:"Check the information and try again.",fi:"Check the information and try again.",no:"Check the information and try again.",sv:"Kontrollera uppgifterna och försök igen."},PLACEHOLDER_TEXT:{da:"License number 6 digits",en:"License number 6 digits",fi:"License number 6 digits",no:"License number 6 digits",sv:"Licensnummer 6 tecken"}},u=n(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}get hostElement(){return this}loading=!1;error=!1;ocrNumber;searchSuccess=!1;invalidOcrNumber=!1;language=null;async componentWillLoad(){null===this.language&&await i(this.hostElement)}getTranslation(e){return d[e][this.language||a]}handleSearch(e){this.invalidOcrNumber=!1,this.searchSuccess=!1,this.error=!1;const n=this.validateOcrNumber(e.detail);n.error?this.invalidOcrNumber=!0:this.ocrNumberSearch(n.value)}async ocrNumberSearch(e){this.loading=!0,await fetch("https://portal.postnord.com/public-service/api/ocr?key="+e).then((e=>e.json())).then((e=>{this.ocrNumber=e.newOcr,this.searchSuccess=!0})).catch((()=>{this.error=!0,this.searchSuccess=!1})).finally((()=>{this.loading=!1}))}validateOcrNumber(e){const n=e?e.replace(/[ -]/gi,""):"";return{error:RegExp(/\D+/).test(n)||6!==n.length,value:n}}renderSearchResult(){if(!this.loading&&!this.error&&this.searchSuccess)return r("div",{class:"search-results"},this.getTranslation("SEARCH_SUCCESS"),": ",r("b",null,this.ocrNumber))}renderErrorMessage(){return this.invalidOcrNumber&&!this.loading?r("div",{class:"invalid-text-container"},r("p",{class:"invalid-ocr"},this.getTranslation("ERROR_INVALID_LICENSE_NUMBER"))):this.error&&!this.loading?r("div",{class:"error-text-container"},r("p",{class:"bold"},this.getTranslation("ERROR_NO_RESULTS")),r("p",{class:"bold"},this.getTranslation("ERROR_REASON_HEADER")),r("p",null,this.getTranslation("ERROR_REASON_ONE")),r("p",null,this.getTranslation("ERROR_REASON_TWO"))):void 0}render(){return r(s,{key:"7920d8492a321dbbdc3a2bde4b4439906c13e236"},r("pn-search-field",{key:"a2787206127f364a160b1a37ef084486b84b287f",loading:this.loading,label:this.getTranslation("SEARCH_BUTTON"),button:"icon",buttonLabel:this.getTranslation("SEARCH_BUTTON"),placeholder:this.getTranslation("PLACEHOLDER_TEXT"),onSearch:e=>this.handleSearch(e)}),this.renderSearchResult(),this.renderErrorMessage())}static get style(){return`${e("pn-ocr-search")} .bold{font-weight:700}${e("pn-ocr-search")} .search-results,${e("pn-ocr-search")} .error-text-container{padding:1em 0.5em}${e("pn-ocr-search")} .invalid-text-container{padding:0.5em 1em}${e("pn-ocr-search")} .invalid-text-container .invalid-ocr{color:#a70707}`}},[512,"pn-ocr-search",{language:[1],loading:[32],error:[32],ocrNumber:[32],searchSuccess:[32],invalidOcrNumber:[32]}]),m=u,R=function(){"undefined"!=typeof customElements&&["pn-ocr-search","pn-button","pn-icon","pn-search-field","pn-spinner"].forEach((n=>{switch(n){case"pn-ocr-search":customElements.get(e(e(n)))||customElements.define(e(e(n)),u);break;case"pn-button":customElements.get(e(e(n)))||c();break;case"pn-icon":customElements.get(e(e(n)))||o();break;case"pn-search-field":customElements.get(e(e(n)))||h();break;case"pn-spinner":customElements.get(e(e(n)))||l()}}))};export{m as PnOcrSearch,R as defineCustomElement}
5
+ import{transformTag as e,proxyCustomElement as n,HTMLElement as t,h as r,Host as s}from"@stencil/core/internal/client";import{k as i,s as a}from"./helpers.js";import{d as c}from"./pn-button2.js";import{d as o}from"./pn-icon2.js";import{d as h}from"./pn-search-field2.js";import{d as l}from"./pn-spinner2.js";const d={SEARCH_BUTTON:{da:"Search",en:"Search",fi:"Search",no:"Search",sv:"Sök"},SEARCH_SUCCESS:{da:"Your OCR number is",en:"Your OCR number is",fi:"Your OCR number is",no:"Your OCR number is",sv:"Ditt OCR-nummer är"},ERROR_INVALID_LICENSE_NUMBER:{da:"Invalid license number",en:"Invalid license number",fi:"Invalid license number",no:"Invalid license number",sv:"Ogiltligt licensnummer"},ERROR_NO_RESULTS:{da:"The search did not generate any results",en:"The search did not generate any results",fi:"The search did not generate any results",no:"The search did not generate any results",sv:"Sökningen genererade inga träffar"},ERROR_REASON_HEADER:{da:"It may be due to:",en:"It may be due to:",fi:"It may be due to:",no:"It may be due to:",sv:"Det kan bero på:"},ERROR_REASON_ONE:{da:"We could not find that license number",en:"We could not find that license number",fi:"We could not find that license number",no:"We could not find that license number",sv:"Vi hittar inget sådant licensnummer"},ERROR_REASON_TWO:{da:"Check the information and try again.",en:"Check the information and try again.",fi:"Check the information and try again.",no:"Check the information and try again.",sv:"Kontrollera uppgifterna och försök igen."},PLACEHOLDER_TEXT:{da:"License number 6 digits",en:"License number 6 digits",fi:"License number 6 digits",no:"License number 6 digits",sv:"Licensnummer 6 tecken"}},u=n(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}get hostElement(){return this}loading=!1;error=!1;ocrNumber;searchSuccess=!1;invalidOcrNumber=!1;language=null;async componentWillLoad(){null===this.language&&await i(this.hostElement)}getTranslation(e){return d[e][this.language||a]}handleSearch(e){this.invalidOcrNumber=!1,this.searchSuccess=!1,this.error=!1;const n=this.validateOcrNumber(e.detail);n.error?this.invalidOcrNumber=!0:this.ocrNumberSearch(n.value)}async ocrNumberSearch(e){this.loading=!0,await fetch("https://portal.postnord.com/public-service/api/ocr?key="+e).then((e=>e.json())).then((e=>{this.ocrNumber=e.newOcr,this.searchSuccess=!0})).catch((()=>{this.error=!0,this.searchSuccess=!1})).finally((()=>{this.loading=!1}))}validateOcrNumber(e){const n=e?e.replace(/[ -]/gi,""):"";return{error:RegExp(/\D+/).test(n)||6!==n.length,value:n}}renderSearchResult(){if(!this.loading&&!this.error&&this.searchSuccess)return r("div",{class:"search-results"},this.getTranslation("SEARCH_SUCCESS"),": ",r("b",null,this.ocrNumber))}renderErrorMessage(){return this.invalidOcrNumber&&!this.loading?r("div",{class:"invalid-text-container"},r("p",{class:"invalid-ocr"},this.getTranslation("ERROR_INVALID_LICENSE_NUMBER"))):this.error&&!this.loading?r("div",{class:"error-text-container"},r("p",{class:"bold"},this.getTranslation("ERROR_NO_RESULTS")),r("p",{class:"bold"},this.getTranslation("ERROR_REASON_HEADER")),r("p",null,this.getTranslation("ERROR_REASON_ONE")),r("p",null,this.getTranslation("ERROR_REASON_TWO"))):void 0}render(){return r(s,{key:"edf8696a2d3f115868f13d3bfa9c5e9c4128426c"},r("pn-search-field",{key:"b54f8575a5ebdd518e4082f78799f417448d53e9",loading:this.loading,label:this.getTranslation("SEARCH_BUTTON"),button:"icon",buttonLabel:this.getTranslation("SEARCH_BUTTON"),placeholder:this.getTranslation("PLACEHOLDER_TEXT"),onSearch:e=>this.handleSearch(e)}),this.renderSearchResult(),this.renderErrorMessage())}static get style(){return`${e("pn-ocr-search")} .bold{font-weight:700}${e("pn-ocr-search")} .search-results,${e("pn-ocr-search")} .error-text-container{padding:1em 0.5em}${e("pn-ocr-search")} .invalid-text-container{padding:0.5em 1em}${e("pn-ocr-search")} .invalid-text-container .invalid-ocr{color:#a70707}`}},[512,"pn-ocr-search",{language:[1],loading:[32],error:[32],ocrNumber:[32],searchSuccess:[32],invalidOcrNumber:[32]}]),m=u,R=function(){"undefined"!=typeof customElements&&["pn-ocr-search","pn-button","pn-icon","pn-search-field","pn-spinner"].forEach((n=>{switch(n){case"pn-ocr-search":customElements.get(e(e(n)))||customElements.define(e(e(n)),u);break;case"pn-button":customElements.get(e(e(n)))||c();break;case"pn-icon":customElements.get(e(e(n)))||o();break;case"pn-search-field":customElements.get(e(e(n)))||h();break;case"pn-spinner":customElements.get(e(e(n)))||l()}}))};export{m as PnOcrSearch,R as defineCustomElement}
@@ -2,4 +2,4 @@
2
2
  * Built with Stencil
3
3
  * By PostNord.
4
4
  */
5
- import{transformTag as e,proxyCustomElement as n,HTMLElement as t,createEvent as o,h as i}from"@stencil/core/internal/client";import{a}from"./arrow_right.js";import{d as p}from"./pn-icon2.js";const d=n(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.itemselection=o(this,"itemselection",7)}get hostElement(){return this}value;href;active=!1;itemselection;select(e){this.value&&!this.href&&e.preventDefault(),this.itemselection.emit(this.value)}setClassnames(){let e="pn-page-nav-dropdown-item ";return this.active&&(e+="pn-page-nav-dropdown-item-active "),e}getType(){return this.value?null:"button"}getTagName(){return this.value?"a":"button"}render(){const e=this.getTagName();return i("li",{key:"eac53de4645bd987bc4c1e71c5f7d0982eb4456a"},i(e,{key:"4e4e99717a8906306b2cb952a18868daa2c3a0da",href:this.href||"#",class:this.setClassnames(),type:this.getType(),onClick:e=>this.select(e),tabindex:"-1"},i("slot",{key:"ee51c12b308c7613651886bc7b421a4ab0247990"}),i("pn-icon",{key:"ddc418c5af2edb805a40ebaec120f5c06662bc64",icon:a,color:"white"})),i("hr",{key:"e49722253acc408df179e4498dd64bb00bf1fa96"}))}static get style(){return`${e("pn-page-nav-dropdown-item")}:first-of-type li>a,${e("pn-page-nav-dropdown-item")}:first-of-type li>button{border-radius:0.5em 0.5em 0 0}${e("pn-page-nav-dropdown-item")}:last-of-type li>a,${e("pn-page-nav-dropdown-item")}:last-of-type li>button{border-radius:0 0 0.5em 0.5em}${e("pn-page-nav-dropdown-item")}:last-of-type li>hr{display:none}${e("pn-page-nav-dropdown-item")} li{font-size:inherit}${e("pn-page-nav-dropdown-item")} li>*{color:#ffffff;font-size:inherit;border:none;padding:1em;margin:0;display:flex;justify-content:space-between;align-items:center;cursor:pointer;transition:background 0.15s;outline:none;width:100%;font-weight:500}${e("pn-page-nav-dropdown-item")} li>*>${e("pn-icon")}{margin-left:1em}${e("pn-page-nav-dropdown-item")} li>*.pn-page-nav-dropdown-item-active{background:#005d92}${e("pn-page-nav-dropdown-item")} li>*.pn-page-nav-dropdown-item-active:hover,${e("pn-page-nav-dropdown-item")} li>*.pn-page-nav-dropdown-item-active:focus{background:#005d92}${e("pn-page-nav-dropdown-item")} li>*:hover,${e("pn-page-nav-dropdown-item")} li>*:focus{background:#0d234b}${e("pn-page-nav-dropdown-item")} li>*:focus{box-shadow:inset 0 0 0 0.1em #005d92, inset 0 0 0 0.2em #d3cecb}${e("pn-page-nav-dropdown-item")} li>a{text-decoration:none}${e("pn-page-nav-dropdown-item")} li>button{background:none}${e("pn-page-nav-dropdown-item")} li>hr{bottom:0;padding:0;margin:0 auto;border-top:0.0625em solid #d3cecb;opacity:0.6;width:85%}`}},[772,"pn-page-nav-dropdown-item",{value:[1],href:[1],active:[4]}]),r=d,s=function(){"undefined"!=typeof customElements&&["pn-page-nav-dropdown-item","pn-icon"].forEach((n=>{switch(n){case"pn-page-nav-dropdown-item":customElements.get(e(e(n)))||customElements.define(e(e(n)),d);break;case"pn-icon":customElements.get(e(e(n)))||p()}}))};export{r as PnPageNavDropdownItem,s as defineCustomElement}
5
+ import{transformTag as e,proxyCustomElement as n,HTMLElement as t,createEvent as o,h as i}from"@stencil/core/internal/client";import{a}from"./arrow_right.js";import{d}from"./pn-icon2.js";const p=n(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.itemselection=o(this,"itemselection",7)}get hostElement(){return this}value;href;active=!1;itemselection;select(e){this.value&&!this.href&&e.preventDefault(),this.itemselection.emit(this.value)}setClassnames(){let e="pn-page-nav-dropdown-item ";return this.active&&(e+="pn-page-nav-dropdown-item-active "),e}getType(){return this.value?null:"button"}getTagName(){return this.value?"a":"button"}render(){const e=this.getTagName();return i("li",{key:"a4ca23ac5a53d78c87f2c955c3da18372a7d572d"},i(e,{key:"20639a9f58133cf65d8719943d9d11630166b8d4",href:this.href||"#",class:this.setClassnames(),type:this.getType(),onClick:e=>this.select(e),tabindex:"-1"},i("slot",{key:"5440c1e919238f6aaa55ca9df2dec18ebbce2f83"}),i("pn-icon",{key:"ff16474c7bc9fc6664c64c5b4567e88a88bd29fb",icon:a,color:"white"})),i("hr",{key:"5201ae642f54f3ad7b157762dedfddb08d865486"}))}static get style(){return`${e("pn-page-nav-dropdown-item")}:first-of-type li>a,${e("pn-page-nav-dropdown-item")}:first-of-type li>button{border-radius:0.5em 0.5em 0 0}${e("pn-page-nav-dropdown-item")}:last-of-type li>a,${e("pn-page-nav-dropdown-item")}:last-of-type li>button{border-radius:0 0 0.5em 0.5em}${e("pn-page-nav-dropdown-item")}:last-of-type li>hr{display:none}${e("pn-page-nav-dropdown-item")} li{font-size:inherit}${e("pn-page-nav-dropdown-item")} li>*{color:#ffffff;font-size:inherit;border:none;padding:1em;margin:0;display:flex;justify-content:space-between;align-items:center;cursor:pointer;transition:background 0.15s;outline:none;width:100%;font-weight:500}${e("pn-page-nav-dropdown-item")} li>*>${e("pn-icon")}{margin-left:1em}${e("pn-page-nav-dropdown-item")} li>*.pn-page-nav-dropdown-item-active{background:#005d92}${e("pn-page-nav-dropdown-item")} li>*.pn-page-nav-dropdown-item-active:hover,${e("pn-page-nav-dropdown-item")} li>*.pn-page-nav-dropdown-item-active:focus{background:#005d92}${e("pn-page-nav-dropdown-item")} li>*:hover,${e("pn-page-nav-dropdown-item")} li>*:focus{background:#0d234b}${e("pn-page-nav-dropdown-item")} li>*:focus{box-shadow:inset 0 0 0 0.1em #005d92, inset 0 0 0 0.2em #d3cecb}${e("pn-page-nav-dropdown-item")} li>a{text-decoration:none}${e("pn-page-nav-dropdown-item")} li>button{background:none}${e("pn-page-nav-dropdown-item")} li>hr{bottom:0;padding:0;margin:0 auto;border-top:0.0625em solid #d3cecb;opacity:0.6;width:85%}`}},[772,"pn-page-nav-dropdown-item",{value:[1],href:[1],active:[4]}]),r=p,s=function(){"undefined"!=typeof customElements&&["pn-page-nav-dropdown-item","pn-icon"].forEach((n=>{switch(n){case"pn-page-nav-dropdown-item":customElements.get(e(e(n)))||customElements.define(e(e(n)),p);break;case"pn-icon":customElements.get(e(e(n)))||d()}}))};export{r as PnPageNavDropdownItem,s as defineCustomElement}
@@ -2,4 +2,4 @@
2
2
  * Built with Stencil
3
3
  * By PostNord.
4
4
  */
5
- import{transformTag as e,proxyCustomElement as t,HTMLElement as n,createEvent as i,h as a,Host as o}from"@stencil/core/internal/client";import{d as s}from"./pn-icon2.js";const c=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.itemselection=i(this,"itemselection",7)}get hostElement(){return this}value;href;icon;itemselection;select(e){this.value&&!this.href&&e.preventDefault(),this.itemselection.emit(this.value)}render(){return a(o,{key:"e9e53b320719e625aaeced3b3cd9171577561139"},a("li",{key:"e3bad7efc9e26a73ca105ff16501be34b7b5c869"},a("a",{key:"b8bfdb79752254ceb115583be0c11ba7bec3f4b6",href:this.href||"#",class:"pn-page-nav-item",onClick:e=>this.select(e)},this.icon&&a("pn-icon",{key:"6d2c432d0ef078fc236fef9211765fd634b538b5",icon:this.icon,color:"white"}),a("slot",{key:"e8e9c6e72af559047c0b074854c9b371d6e0c9a0"}))))}static get style(){return`${e("pn-page-nav-item")}{position:relative;color:#ffffff;margin-right:0.5em;z-index:2;white-space:nowrap;scroll-snap-align:center;outline:none;-webkit-tap-highlight-color:transparent;transform:translateZ(0)}${e("pn-page-nav-item")} a{text-decoration:none;color:#ffffff;height:100%;width:100%;padding:0.5em;font-weight:500;border-radius:3em;border:0.0625em solid transparent;display:inline-flex;align-items:center;cursor:pointer;outline:none;transition:box-shadow 0.15s}${e("pn-page-nav-item")} a:focus{box-shadow:0 0 0 0.1em #d3cecb}${e("pn-page-nav-item")} a>${e("pn-icon")}{margin-right:0.5em}${e("pn-page-nav-item")}:last-of-type{margin-right:0}`}},[772,"pn-page-nav-item",{value:[1],href:[1],icon:[1]}]),r=c,p=function(){"undefined"!=typeof customElements&&["pn-page-nav-item","pn-icon"].forEach((t=>{switch(t){case"pn-page-nav-item":customElements.get(e(e(t)))||customElements.define(e(e(t)),c);break;case"pn-icon":customElements.get(e(e(t)))||s()}}))};export{r as PnPageNavItem,p as defineCustomElement}
5
+ import{transformTag as e,proxyCustomElement as t,HTMLElement as n,createEvent as i,h as a,Host as o}from"@stencil/core/internal/client";import{d as s}from"./pn-icon2.js";const r=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.itemselection=i(this,"itemselection",7)}get hostElement(){return this}value;href;icon;itemselection;select(e){this.value&&!this.href&&e.preventDefault(),this.itemselection.emit(this.value)}render(){return a(o,{key:"43346d6ed6211b3e6c4ee7c6dfd261112028445f"},a("li",{key:"8a191825d21ae79f3c8bf69381151b8d258a7c64"},a("a",{key:"3dab24d14cb027916343ae3b1f86ded224907ab6",href:this.href||"#",class:"pn-page-nav-item",onClick:e=>this.select(e)},this.icon&&a("pn-icon",{key:"fa382f49cb1602908dd53af48044826f934679cd",icon:this.icon,color:"white"}),a("slot",{key:"576b22e87a530ac0a8a19eaf8a094937ab227b67"}))))}static get style(){return`${e("pn-page-nav-item")}{position:relative;color:#ffffff;margin-right:0.5em;z-index:2;white-space:nowrap;scroll-snap-align:center;outline:none;-webkit-tap-highlight-color:transparent;transform:translateZ(0)}${e("pn-page-nav-item")} a{text-decoration:none;color:#ffffff;height:100%;width:100%;padding:0.5em;font-weight:500;border-radius:3em;border:0.0625em solid transparent;display:inline-flex;align-items:center;cursor:pointer;outline:none;transition:box-shadow 0.15s}${e("pn-page-nav-item")} a:focus{box-shadow:0 0 0 0.1em #d3cecb}${e("pn-page-nav-item")} a>${e("pn-icon")}{margin-right:0.5em}${e("pn-page-nav-item")}:last-of-type{margin-right:0}`}},[772,"pn-page-nav-item",{value:[1],href:[1],icon:[1]}]),c=r,p=function(){"undefined"!=typeof customElements&&["pn-page-nav-item","pn-icon"].forEach((t=>{switch(t){case"pn-page-nav-item":customElements.get(e(e(t)))||customElements.define(e(e(t)),r);break;case"pn-icon":customElements.get(e(e(t)))||s()}}))};export{c as PnPageNavItem,p as defineCustomElement}
@@ -2,4 +2,4 @@
2
2
  * Built with Stencil
3
3
  * By PostNord.
4
4
  */
5
- import{transformTag as n,proxyCustomElement as e,HTMLElement as t,createEvent as a,forceUpdate as i,h as o,Host as s}from"@stencil/core/internal/client";import{u as r}from"./helpers.js";import{a as p}from"./arrow_left.js";import{a as d}from"./arrow_right.js";import{c as h}from"./chevron_down.js";import{d as c}from"./pn-icon2.js";const l=e(class extends t{constructor(n){super(),!1!==n&&this.__registerHost(),this.navchange=a(this,"navchange",7)}mo;navContainer;navWrapper;navItems=[];dropdownButton;dropdownEl;dropdownItems;dropdownEls;eventHandler=this.keyboardEvents.bind(this);globalEventHandler=this.globalEvents.bind(this);activeBg;hoverBg;scrollRegistered=!1;get hostElement(){return this}currentSelection;showScrollArrows=!1;showLeftArrow=!1;showRightArrow=!1;dropdownOpen=!1;dropdownLinks=[];dropdownActive=!1;value;dropdown=!1;navid="pn-page-nav-"+r();navchange;changeHandler({target:e}){this.currentSelection=e.closest(""+n("pn-page-nav-item")),e.value&&(this.value=e.value),this.dropdownOpen&&(this.dropdownOpen=!1)}handleResize(){this.rerender()}valueHandler(){this.value||(this.currentSelection=null),this.calcHighlight(this.currentSelection,this.activeBg),this.navchange.emit(this.value),this.dropdownActive&&this.isDropdownItemActive()}dropdownHandler(){this.dropdownOpen?requestAnimationFrame((()=>{this.addGlobalEventListeners()})):this.removeGlobalEventListeners()}componentWillLoad(){this.dropdown&&(this.dropdownEls=Array.from(this.hostElement.querySelectorAll(""+n("pn-page-nav-dropdown-item"))),this.dropdownEls.length&&(this.dropdownActive=!0,this.initiateDropdown()))}componentDidLoad(){this.mo&&this.mo.disconnect(),this.mo=new MutationObserver((()=>{i(this.hostElement),this.setActiveNavItem(),this.rerender()})),this.mo.observe(this.hostElement,{childList:!0,subtree:!0}),this.navWrapper=this.hostElement.querySelector(".pn-page-nav"),this.navContainer=this.hostElement.querySelector(".pn-page-nav-items"),this.activeBg=this.hostElement.querySelector(".pn-pn-active"),this.hoverBg=this.hostElement.querySelector(".pn-pn-hover"),this.hostElement.addEventListener("mouseover",(({target:n})=>this.calcHighlight(n,this.hoverBg))),this.setActiveNavItem(),this.rerender()}setActiveNavItem(){this.navItems=Array.from(this.hostElement.querySelectorAll(""+n("pn-page-nav-item"))),this.navItems.forEach((n=>{this.value===n.value?this.currentSelection=n:n.removeAttribute("selected"),n.querySelector("a").addEventListener("focus",(({target:n})=>this.calcHighlight(n,this.hoverBg)))})),this.dropdownActive&&(this.dropdownItems=Array.from(this.hostElement.querySelectorAll(".pn-page-nav-dropdown-item")),this.isDropdownItemActive(),this.dropdownLinks=this.dropdownItems.map(((e,t)=>(e.setAttribute("data-index",""+t),e.closest(""+n("pn-page-nav-dropdown-item")).value))))}rerender(){requestAnimationFrame((()=>{this.calcHighlight(this.currentSelection,this.activeBg),this.scrollArrowRender()}))}calcHighlight(e,t){if(!e?.closest(""+n("pn-page-nav-item")))return void t?.classList.add("hidden");t&&t.classList.remove("hidden");const a=e.closest(""+n("pn-page-nav-item")).getBoundingClientRect(),{left:i}=this.navContainer.getBoundingClientRect(),{left:o,height:s,width:r}=a;t.style.setProperty("transform",`translate(${o-i+this.navContainer.scrollLeft}px, -50%`),t.style.setProperty("width",r+"px"),t.style.setProperty("height",s+"px")}scrollArrowRender(){if(this.navWrapper){if(this.navWrapper.scrollWidth>this.navWrapper.clientWidth){this.showScrollArrows=!0,this.scrollRegistered||(this.navWrapper.addEventListener("scroll",this.scrollArrowRender.bind(this)),this.scrollRegistered=!0);const n=Math.round(this.navWrapper.scrollWidth-this.navWrapper.scrollLeft)-this.navWrapper.clientWidth;return this.showLeftArrow=this.navWrapper.scrollLeft>0,void(this.showRightArrow=n>0)}this.showLeftArrow=!1,this.showRightArrow=!1,this.showScrollArrows=!1}}scroll(n){this.navWrapper.scroll({left:this.navWrapper.scrollLeft+n,behavior:"smooth"})}scrollArrowClasses(){let n="pn-pn-arrows ";return this.showLeftArrow&&(n+="pn-pn-left-visible "),this.showRightArrow&&(n+="pn-pn-right-visible "),n}initiateDropdown(){requestAnimationFrame((()=>{this.dropdownButton=this.hostElement.querySelector(".pn-page-nav-dropdown-button"),this.dropdownEl=this.hostElement.querySelector(".pn-page-nav-dropdown"),this.addDropdownEventListeners()}))}toggleDropdown(){this.dropdownOpen=!this.dropdownOpen}isDropdownItemActive(){this.dropdownEls.forEach((n=>{n.value&&this.value===n.value?n.setAttribute("active","true"):n.removeAttribute("active")}))}addDropdownEventListeners(){this.hostElement.addEventListener("keydown",this.eventHandler),this.hostElement.addEventListener("click",this.eventHandler)}addGlobalEventListeners(){const n=this.hostElement.getRootNode();n.addEventListener("focusin",this.globalEventHandler),n.addEventListener("keydown",this.globalEventHandler),n.addEventListener("click",this.globalEventHandler)}removeGlobalEventListeners(){const n=this.hostElement.getRootNode();n.removeEventListener("focusin",this.globalEventHandler),n.removeEventListener("keydown",this.globalEventHandler),n.removeEventListener("click",this.globalEventHandler)}keyboardEvents(n){const e=n.composedPath()[0];"keydown"===n.type&&!this.dropdownOpen&&e===this.dropdownButton&&["ArrowUp","ArrowDown"].includes(n.code)&&(this.dropdownOpen=!0,requestAnimationFrame((()=>{this.focusNextDropdownItem()})))}globalEvents(n){const e=n.composedPath()[0];"keydown"===n.type&&"Escape"===n.code&&(this.dropdownOpen=!1,this.dropdownButton.focus()),"ArrowDown"===n.code&&this.focusNextDropdownItem(),"ArrowUp"===n.code&&this.focusPrevDropdownItem(),"click"!==n.type&&"focusin"!==n.type||this.dropdownEl.contains(e)||(this.dropdownOpen=!1)}focusNextDropdownItem(){const{activeElement:n}=this.hostElement.getRootNode();if(!n.classList.contains("pn-page-nav-dropdown-item"))return void this.dropdownItems[0].focus();const e=parseInt(n.getAttribute("data-index"));e<this.dropdownItems.length-1&&this.dropdownItems[e+1].focus()}focusPrevDropdownItem(){const{activeElement:n}=this.hostElement.getRootNode();n.classList.contains("dropdown-item")||this.dropdownItems[this.dropdownItems.length-1].focus();const e=parseInt(n.getAttribute("data-index"));e>0?this.dropdownItems[e-1].focus():this.dropdownButton.focus()}dropdownButtonClasses(){let n="pn-page-nav-dropdown-button ";return this.dropdownLinks.includes(this.value)&&(n+="pn-page-nav-dropdown-active "),n}dropdownClasses(){let n="pn-page-nav-dropdown ";return this.dropdownOpen&&(n+="pn-page-nav-dropdown-open "),n}render(){return o(s,{key:"09d2c23a89225de385e48e65d485b7a0492479dc"},o("div",{key:"adc135fa9e678fe1ceab2a629ccf1a9906775328",class:"pn-page-nav-wrapper"},o("nav",{key:"1aa5d748ee904f6d96d2a7d5dd17c09c96bf7230",class:"pn-page-nav"},this.dropdownActive&&o("button",{key:"cf8a7aac890fac108cf88a30df5623f6b66dc9c2",type:"button",class:this.dropdownButtonClasses(),onClick:()=>this.toggleDropdown(),"aria-controls":"page-nav-dropdown","aria-expanded":""+this.dropdownOpen},this.dropdown,o("pn-icon",{key:"927edae4c71a918b0725c5c319ce4a802a35e2f8",icon:h,color:"white",small:!0}),o("div",{key:"d91a6109aa142c292ca2074b15e0cfa7dd70f0df",class:"pn-page-nav-divider"})),o("ul",{key:"d8921bbf3cd3144c5ac472ec113d234e30ec2f1f",class:"pn-page-nav-items"},o("slot",{key:"87ac7a2dd90ebf2a863fe3cca54150def6b44be6"}),o("li",{key:"f9504aaf7d253b406d14a3aa512e75c50433fc96",class:"pn-pn-bg pn-pn-active",role:"presentation"}),o("li",{key:"c553c1f2a35984754b442f1f086f8f89f154d1d2",class:"pn-pn-bg pn-pn-hover",role:"presentation"}))),this.showScrollArrows&&o("div",{key:"26c694779045a66bacdb2c258b2b658457ae2851",class:this.scrollArrowClasses()},o("button",{key:"9fc9a3511d158df8ad2e5ac67ca2c5995cd0d105",class:"pn-pn-arrow-left",onClick:()=>this.scroll(-120),tabindex:"-1"},o("pn-icon",{key:"ef5214f47905c67549b8d35047ff8631d60ce0d5",icon:p,color:"white"})),o("button",{key:"b74fdf8c3f49f0f3bba23a2e49ca848278114300",class:"pn-pn-arrow-right",onClick:()=>this.scroll(120),tabindex:"-1"},o("pn-icon",{key:"09a947d7ed38b3460590aafb106c77c6836f7164",icon:d,color:"blue700"})))),this.dropdownActive&&o("ul",{key:"ca675a52568b9ba2719a0dba5e6b5cfd10c4713d",id:this.navid,class:this.dropdownClasses()},o("slot",{key:"2f8a0062c2aa836d88ada88254342918a694e00f",name:"dropdown-item"})))}static get watchers(){return{value:[{valueHandler:0}],dropdownOpen:[{dropdownHandler:0}]}}static get style(){return`${n("pn-page-nav")}{display:block;position:relative;font-size:clamp(0.8em, 2vw, 1em);z-index:5}.pn-page-nav-wrapper{transform:translateZ(0);font-size:inherit;max-width:100%;overflow:hidden;position:relative;display:inline-flex;border-radius:3em}.pn-page-nav{display:flex;align-items:center;border-radius:3em;min-height:3em;background:#0d234b;border:0.0625em solid #d3cecb;position:relative;overflow-x:auto;scroll-snap-type:x mandatory}.pn-page-nav::-webkit-scrollbar{display:none}.pn-page-nav ul.pn-page-nav-items{display:flex;list-style-type:none;padding:0.25em;margin:0;position:relative}.pn-page-nav-items>.pn-pn-bg{position:absolute;top:50%;transform:translateY(-50%);will-change:transform;left:0;border-radius:3em;transition:width 0.25s cubic-bezier(0.29, 0.15, 0.24, 0.97), transform 0.25s cubic-bezier(0.29, 0.15, 0.24, 0.97), background 0.15s, opacity 0.15s, box-shadow 0.15s}.pn-page-nav-items>.pn-pn-bg.pn-pn-active{box-shadow:0px 0.3px 0.9px rgba(0, 0, 0, 0.1), 0px 1.6px 3.6px rgba(0, 0, 0, 0.13);background:#005d92;z-index:1}.pn-page-nav-items>.pn-pn-bg.pn-pn-hover{background:#ffffff;opacity:0;border:0.0625em solid transparent;z-index:0}.pn-page-nav-items>.pn-pn-bg.hidden{opacity:0}@media (hover: hover){ul.pn-page-nav-items:focus-within .pn-pn-hover,ul.pn-page-nav-items:hover .pn-pn-hover{opacity:0.12}}${n("pn-page-nav")} .pn-pn-arrows{position:absolute;top:50%;transform:translateY(-50%);left:0;height:100%;width:100%;z-index:3;display:flex;justify-content:space-between;align-items:center;pointer-events:none;padding:0.125em 0.1em}${n("pn-page-nav")} .pn-pn-arrows svg{width:1.5em}${n("pn-page-nav")} .pn-pn-arrows svg.pn-icon-svg path{fill:#005d92}${n("pn-page-nav")} .pn-pn-arrows>*{transition:transform 0.2s, opacity 0.2s, background 0.1s, box-shadow 0.1s;pointer-events:all;height:100%;aspect-ratio:1;background:#ffffff;display:flex;align-items:center;justify-content:center;outline:none;cursor:pointer;opacity:0;will-change:transform;-webkit-tap-highlight-color:transparent;border-radius:50%;border:0.0625em solid #0d234b}${n("pn-page-nav")} .pn-pn-arrows>*.pn-pn-arrow-left{transform:translateX(-100%)}${n("pn-page-nav")} .pn-pn-arrows>*.pn-pn-arrow-right{transform:translateX(100%)}@media screen and (max-width: 30em){${n("pn-page-nav")} .pn-pn-arrows>*{border:none}${n("pn-page-nav")} .pn-pn-arrows>* ${n("pn-icon")} .pn-icon-svg{width:100%;height:2em;animation:arrow 0.6s ease-in-out alternate infinite}${n("pn-page-nav")} .pn-pn-arrows>* ${n("pn-icon")} .pn-icon-svg path{fill:#ffffff}${n("pn-page-nav")} .pn-pn-arrows>*.pn-pn-arrow-left{background:linear-gradient(to left, transparent, #0d234b 60%);border-radius:50% 0 0 50%}${n("pn-page-nav")} .pn-pn-arrows>*.pn-pn-arrow-right{background:linear-gradient(to right, transparent, #0d234b 40%);border-radius:0 50% 50% 0}}${n("pn-page-nav")} .pn-pn-arrows.pn-pn-left-visible .pn-pn-arrow-left,${n("pn-page-nav")} .pn-pn-arrows.pn-pn-right-visible .pn-pn-arrow-right{opacity:1;transform:translateX(0)}@keyframes arrow{to{transform:translateX(10%)}}button.pn-page-nav-dropdown-button{font-size:1em;border-radius:3em 0 0 3em;background:#0d234b;color:#ffffff;padding:0.5em 1em 0.5em 1.5em;cursor:pointer;display:flex;align-items:center;border:none;transition:background 0.15s;outline:none;height:100%;position:relative;margin:0 0.5em 0 0;font-weight:500}button.pn-page-nav-dropdown-button ${n("pn-icon")}{margin-left:0.5em}button.pn-page-nav-dropdown-button:hover,button.pn-page-nav-dropdown-button:focus{background:#263655}button.pn-page-nav-dropdown-button:focus{box-shadow:inset 0 0 0 0.1em #005d92, inset 0 0 0 0.2em #d3cecb}button.pn-page-nav-dropdown-button.pn-page-nav-dropdown-active{background:#005d92}button.pn-page-nav-dropdown-button.pn-page-nav-dropdown-active:hover,button.pn-page-nav-dropdown-button.pn-page-nav-dropdown-active:focus{background:#005d92}.pn-page-nav-divider{height:60%;background:#d3cecb;width:0.1em;position:absolute;right:0;transform:translateX(50%)}ul.pn-page-nav-dropdown{position:absolute;left:0;top:110%;background:#0d234b;border-radius:0.5em;margin:0;padding:0;list-style-type:none;box-shadow:0px 6.4000000954px 14.3999996185px 0px rgba(0, 0, 0, 0.1294117647), 0px 1.2000000477px 3.5999999046px 0px rgba(0, 0, 0, 0.1019607843);font-size:inherit;display:none}ul.pn-page-nav-dropdown.pn-page-nav-dropdown-open{display:block}`}},[772,"pn-page-nav",{value:[1025],dropdown:[8],navid:[1],currentSelection:[32],showScrollArrows:[32],showLeftArrow:[32],showRightArrow:[32],dropdownOpen:[32],dropdownLinks:[32],dropdownActive:[32]},[[0,"itemselection","changeHandler"],[9,"resize","handleResize"]],{value:[{valueHandler:0}],dropdownOpen:[{dropdownHandler:0}]}]),g=l,v=function(){"undefined"!=typeof customElements&&["pn-page-nav","pn-icon"].forEach((e=>{switch(e){case"pn-page-nav":customElements.get(n(n(e)))||customElements.define(n(n(e)),l);break;case"pn-icon":customElements.get(n(n(e)))||c()}}))};export{g as PnPageNav,v as defineCustomElement}
5
+ import{transformTag as n,proxyCustomElement as e,HTMLElement as t,createEvent as a,forceUpdate as i,h as o,Host as s}from"@stencil/core/internal/client";import{u as r}from"./helpers.js";import{a as p}from"./arrow_left.js";import{a as d}from"./arrow_right.js";import{c as h}from"./chevron_down.js";import{d as c}from"./pn-icon2.js";const l=e(class extends t{constructor(n){super(),!1!==n&&this.__registerHost(),this.navchange=a(this,"navchange",7)}mo;navContainer;navWrapper;navItems=[];dropdownButton;dropdownEl;dropdownItems;dropdownEls;eventHandler=this.keyboardEvents.bind(this);globalEventHandler=this.globalEvents.bind(this);activeBg;hoverBg;scrollRegistered=!1;get hostElement(){return this}currentSelection;showScrollArrows=!1;showLeftArrow=!1;showRightArrow=!1;dropdownOpen=!1;dropdownLinks=[];dropdownActive=!1;value;dropdown=!1;navid="pn-page-nav-"+r();navchange;changeHandler({target:e}){this.currentSelection=e.closest(""+n("pn-page-nav-item")),e.value&&(this.value=e.value),this.dropdownOpen&&(this.dropdownOpen=!1)}handleResize(){this.rerender()}valueHandler(){this.value||(this.currentSelection=null),this.calcHighlight(this.currentSelection,this.activeBg),this.navchange.emit(this.value),this.dropdownActive&&this.isDropdownItemActive()}dropdownHandler(){this.dropdownOpen?requestAnimationFrame((()=>{this.addGlobalEventListeners()})):this.removeGlobalEventListeners()}componentWillLoad(){this.dropdown&&(this.dropdownEls=Array.from(this.hostElement.querySelectorAll(""+n("pn-page-nav-dropdown-item"))),this.dropdownEls.length&&(this.dropdownActive=!0,this.initiateDropdown()))}componentDidLoad(){this.mo&&this.mo.disconnect(),this.mo=new MutationObserver((()=>{i(this.hostElement),this.setActiveNavItem(),this.rerender()})),this.mo.observe(this.hostElement,{childList:!0,subtree:!0}),this.navWrapper=this.hostElement.querySelector(".pn-page-nav"),this.navContainer=this.hostElement.querySelector(".pn-page-nav-items"),this.activeBg=this.hostElement.querySelector(".pn-pn-active"),this.hoverBg=this.hostElement.querySelector(".pn-pn-hover"),this.hostElement.addEventListener("mouseover",(({target:n})=>this.calcHighlight(n,this.hoverBg))),this.setActiveNavItem(),this.rerender()}setActiveNavItem(){this.navItems=Array.from(this.hostElement.querySelectorAll(""+n("pn-page-nav-item"))),this.navItems.forEach((n=>{this.value===n.value?this.currentSelection=n:n.removeAttribute("selected"),n.querySelector("a").addEventListener("focus",(({target:n})=>this.calcHighlight(n,this.hoverBg)))})),this.dropdownActive&&(this.dropdownItems=Array.from(this.hostElement.querySelectorAll(".pn-page-nav-dropdown-item")),this.isDropdownItemActive(),this.dropdownLinks=this.dropdownItems.map(((e,t)=>(e.setAttribute("data-index",""+t),e.closest(""+n("pn-page-nav-dropdown-item")).value))))}rerender(){requestAnimationFrame((()=>{this.calcHighlight(this.currentSelection,this.activeBg),this.scrollArrowRender()}))}calcHighlight(e,t){if(!e?.closest(""+n("pn-page-nav-item")))return void t?.classList.add("hidden");t&&t.classList.remove("hidden");const a=e.closest(""+n("pn-page-nav-item")).getBoundingClientRect(),{left:i}=this.navContainer.getBoundingClientRect(),{left:o,height:s,width:r}=a;t.style.setProperty("transform",`translate(${o-i+this.navContainer.scrollLeft}px, -50%`),t.style.setProperty("width",r+"px"),t.style.setProperty("height",s+"px")}scrollArrowRender(){if(this.navWrapper){if(this.navWrapper.scrollWidth>this.navWrapper.clientWidth){this.showScrollArrows=!0,this.scrollRegistered||(this.navWrapper.addEventListener("scroll",this.scrollArrowRender.bind(this)),this.scrollRegistered=!0);const n=Math.round(this.navWrapper.scrollWidth-this.navWrapper.scrollLeft)-this.navWrapper.clientWidth;return this.showLeftArrow=this.navWrapper.scrollLeft>0,void(this.showRightArrow=n>0)}this.showLeftArrow=!1,this.showRightArrow=!1,this.showScrollArrows=!1}}scroll(n){this.navWrapper.scroll({left:this.navWrapper.scrollLeft+n,behavior:"smooth"})}scrollArrowClasses(){let n="pn-pn-arrows ";return this.showLeftArrow&&(n+="pn-pn-left-visible "),this.showRightArrow&&(n+="pn-pn-right-visible "),n}initiateDropdown(){requestAnimationFrame((()=>{this.dropdownButton=this.hostElement.querySelector(".pn-page-nav-dropdown-button"),this.dropdownEl=this.hostElement.querySelector(".pn-page-nav-dropdown"),this.addDropdownEventListeners()}))}toggleDropdown(){this.dropdownOpen=!this.dropdownOpen}isDropdownItemActive(){this.dropdownEls.forEach((n=>{n.value&&this.value===n.value?n.setAttribute("active","true"):n.removeAttribute("active")}))}addDropdownEventListeners(){this.hostElement.addEventListener("keydown",this.eventHandler),this.hostElement.addEventListener("click",this.eventHandler)}addGlobalEventListeners(){const n=this.hostElement.getRootNode();n.addEventListener("focusin",this.globalEventHandler),n.addEventListener("keydown",this.globalEventHandler),n.addEventListener("click",this.globalEventHandler)}removeGlobalEventListeners(){const n=this.hostElement.getRootNode();n.removeEventListener("focusin",this.globalEventHandler),n.removeEventListener("keydown",this.globalEventHandler),n.removeEventListener("click",this.globalEventHandler)}keyboardEvents(n){const e=n.composedPath()[0];"keydown"===n.type&&!this.dropdownOpen&&e===this.dropdownButton&&["ArrowUp","ArrowDown"].includes(n.code)&&(this.dropdownOpen=!0,requestAnimationFrame((()=>{this.focusNextDropdownItem()})))}globalEvents(n){const e=n.composedPath()[0];"keydown"===n.type&&"Escape"===n.code&&(this.dropdownOpen=!1,this.dropdownButton.focus()),"ArrowDown"===n.code&&this.focusNextDropdownItem(),"ArrowUp"===n.code&&this.focusPrevDropdownItem(),"click"!==n.type&&"focusin"!==n.type||this.dropdownEl.contains(e)||(this.dropdownOpen=!1)}focusNextDropdownItem(){const{activeElement:n}=this.hostElement.getRootNode();if(!n.classList.contains("pn-page-nav-dropdown-item"))return void this.dropdownItems[0].focus();const e=parseInt(n.getAttribute("data-index"));e<this.dropdownItems.length-1&&this.dropdownItems[e+1].focus()}focusPrevDropdownItem(){const{activeElement:n}=this.hostElement.getRootNode();n.classList.contains("dropdown-item")||this.dropdownItems[this.dropdownItems.length-1].focus();const e=parseInt(n.getAttribute("data-index"));e>0?this.dropdownItems[e-1].focus():this.dropdownButton.focus()}dropdownButtonClasses(){let n="pn-page-nav-dropdown-button ";return this.dropdownLinks.includes(this.value)&&(n+="pn-page-nav-dropdown-active "),n}dropdownClasses(){let n="pn-page-nav-dropdown ";return this.dropdownOpen&&(n+="pn-page-nav-dropdown-open "),n}render(){return o(s,{key:"f76a115ccea11e238d2aee5288b06675abc80b8a"},o("div",{key:"453102a432daf9b567be4f5dc415bab34b48bc84",class:"pn-page-nav-wrapper"},o("nav",{key:"9207ade4b4d6cea4c22622c91988eef2b3c812bc",class:"pn-page-nav"},this.dropdownActive&&o("button",{key:"3365178312cfe2b9d48fccbc794d2a8a857ed6f0",type:"button",class:this.dropdownButtonClasses(),onClick:()=>this.toggleDropdown(),"aria-controls":"page-nav-dropdown","aria-expanded":""+this.dropdownOpen},this.dropdown,o("pn-icon",{key:"460172b12b334e96920d185dcbc868acafc0cdcc",icon:h,color:"white",small:!0}),o("div",{key:"f16219e3070e00ebd1ab143b8803a94c44e242bc",class:"pn-page-nav-divider"})),o("ul",{key:"560ef88c95269f29b1f76ee65e3a2541fc2482ce",class:"pn-page-nav-items"},o("slot",{key:"7b1cfc89976421963cc19f958f21e29bfc796621"}),o("li",{key:"7df00d0a42fc3f48f82afdb0bbbf943229604293",class:"pn-pn-bg pn-pn-active",role:"presentation"}),o("li",{key:"68fd6cc6f9dfcb834c62105f81ff2e21b332be94",class:"pn-pn-bg pn-pn-hover",role:"presentation"}))),this.showScrollArrows&&o("div",{key:"ba26546a6fa3f750a5314dd80f80e1487b4962ec",class:this.scrollArrowClasses()},o("button",{key:"57b43598cb3288b068c3583c822be35418b28e91",class:"pn-pn-arrow-left",onClick:()=>this.scroll(-120),tabindex:"-1"},o("pn-icon",{key:"b812b5b471ba0982be6cb3bcacc84bb2f52fa0e3",icon:p,color:"white"})),o("button",{key:"70d5bffed71999aaf154f88590378496d79e7f55",class:"pn-pn-arrow-right",onClick:()=>this.scroll(120),tabindex:"-1"},o("pn-icon",{key:"a2d4319bab3a80b092321873ff66e4b421f14743",icon:d,color:"blue700"})))),this.dropdownActive&&o("ul",{key:"1e2a73e7b4d523f3feba0dc18ccc14871b551862",id:this.navid,class:this.dropdownClasses()},o("slot",{key:"20f647483c10a84de4bf2f40126b83b65b61b99f",name:"dropdown-item"})))}static get watchers(){return{value:[{valueHandler:0}],dropdownOpen:[{dropdownHandler:0}]}}static get style(){return`${n("pn-page-nav")}{display:block;position:relative;font-size:clamp(0.8em, 2vw, 1em);z-index:5}.pn-page-nav-wrapper{transform:translateZ(0);font-size:inherit;max-width:100%;overflow:hidden;position:relative;display:inline-flex;border-radius:3em}.pn-page-nav{display:flex;align-items:center;border-radius:3em;min-height:3em;background:#0d234b;border:0.0625em solid #d3cecb;position:relative;overflow-x:auto;scroll-snap-type:x mandatory}.pn-page-nav::-webkit-scrollbar{display:none}.pn-page-nav ul.pn-page-nav-items{display:flex;list-style-type:none;padding:0.25em;margin:0;position:relative}.pn-page-nav-items>.pn-pn-bg{position:absolute;top:50%;transform:translateY(-50%);will-change:transform;left:0;border-radius:3em;transition:width 0.25s cubic-bezier(0.29, 0.15, 0.24, 0.97), transform 0.25s cubic-bezier(0.29, 0.15, 0.24, 0.97), background 0.15s, opacity 0.15s, box-shadow 0.15s}.pn-page-nav-items>.pn-pn-bg.pn-pn-active{box-shadow:0px 0.3px 0.9px rgba(0, 0, 0, 0.1), 0px 1.6px 3.6px rgba(0, 0, 0, 0.13);background:#005d92;z-index:1}.pn-page-nav-items>.pn-pn-bg.pn-pn-hover{background:#ffffff;opacity:0;border:0.0625em solid transparent;z-index:0}.pn-page-nav-items>.pn-pn-bg.hidden{opacity:0}@media (hover: hover){ul.pn-page-nav-items:focus-within .pn-pn-hover,ul.pn-page-nav-items:hover .pn-pn-hover{opacity:0.12}}${n("pn-page-nav")} .pn-pn-arrows{position:absolute;top:50%;transform:translateY(-50%);left:0;height:100%;width:100%;z-index:3;display:flex;justify-content:space-between;align-items:center;pointer-events:none;padding:0.125em 0.1em}${n("pn-page-nav")} .pn-pn-arrows svg{width:1.5em}${n("pn-page-nav")} .pn-pn-arrows svg.pn-icon-svg path{fill:#005d92}${n("pn-page-nav")} .pn-pn-arrows>*{transition:transform 0.2s, opacity 0.2s, background 0.1s, box-shadow 0.1s;pointer-events:all;height:100%;aspect-ratio:1;background:#ffffff;display:flex;align-items:center;justify-content:center;outline:none;cursor:pointer;opacity:0;will-change:transform;-webkit-tap-highlight-color:transparent;border-radius:50%;border:0.0625em solid #0d234b}${n("pn-page-nav")} .pn-pn-arrows>*.pn-pn-arrow-left{transform:translateX(-100%)}${n("pn-page-nav")} .pn-pn-arrows>*.pn-pn-arrow-right{transform:translateX(100%)}@media screen and (max-width: 30em){${n("pn-page-nav")} .pn-pn-arrows>*{border:none}${n("pn-page-nav")} .pn-pn-arrows>* ${n("pn-icon")} .pn-icon-svg{width:100%;height:2em;animation:arrow 0.6s ease-in-out alternate infinite}${n("pn-page-nav")} .pn-pn-arrows>* ${n("pn-icon")} .pn-icon-svg path{fill:#ffffff}${n("pn-page-nav")} .pn-pn-arrows>*.pn-pn-arrow-left{background:linear-gradient(to left, transparent, #0d234b 60%);border-radius:50% 0 0 50%}${n("pn-page-nav")} .pn-pn-arrows>*.pn-pn-arrow-right{background:linear-gradient(to right, transparent, #0d234b 40%);border-radius:0 50% 50% 0}}${n("pn-page-nav")} .pn-pn-arrows.pn-pn-left-visible .pn-pn-arrow-left,${n("pn-page-nav")} .pn-pn-arrows.pn-pn-right-visible .pn-pn-arrow-right{opacity:1;transform:translateX(0)}@keyframes arrow{to{transform:translateX(10%)}}button.pn-page-nav-dropdown-button{font-size:1em;border-radius:3em 0 0 3em;background:#0d234b;color:#ffffff;padding:0.5em 1em 0.5em 1.5em;cursor:pointer;display:flex;align-items:center;border:none;transition:background 0.15s;outline:none;height:100%;position:relative;margin:0 0.5em 0 0;font-weight:500}button.pn-page-nav-dropdown-button ${n("pn-icon")}{margin-left:0.5em}button.pn-page-nav-dropdown-button:hover,button.pn-page-nav-dropdown-button:focus{background:#263655}button.pn-page-nav-dropdown-button:focus{box-shadow:inset 0 0 0 0.1em #005d92, inset 0 0 0 0.2em #d3cecb}button.pn-page-nav-dropdown-button.pn-page-nav-dropdown-active{background:#005d92}button.pn-page-nav-dropdown-button.pn-page-nav-dropdown-active:hover,button.pn-page-nav-dropdown-button.pn-page-nav-dropdown-active:focus{background:#005d92}.pn-page-nav-divider{height:60%;background:#d3cecb;width:0.1em;position:absolute;right:0;transform:translateX(50%)}ul.pn-page-nav-dropdown{position:absolute;left:0;top:110%;background:#0d234b;border-radius:0.5em;margin:0;padding:0;list-style-type:none;box-shadow:0px 6.4000000954px 14.3999996185px 0px rgba(0, 0, 0, 0.1294117647), 0px 1.2000000477px 3.5999999046px 0px rgba(0, 0, 0, 0.1019607843);font-size:inherit;display:none}ul.pn-page-nav-dropdown.pn-page-nav-dropdown-open{display:block}`}},[772,"pn-page-nav",{value:[1025],dropdown:[8],navid:[1],currentSelection:[32],showScrollArrows:[32],showLeftArrow:[32],showRightArrow:[32],dropdownOpen:[32],dropdownLinks:[32],dropdownActive:[32]},[[0,"itemselection","changeHandler"],[9,"resize","handleResize"]],{value:[{valueHandler:0}],dropdownOpen:[{dropdownHandler:0}]}]),b=l,g=function(){"undefined"!=typeof customElements&&["pn-page-nav","pn-icon"].forEach((e=>{switch(e){case"pn-page-nav":customElements.get(n(n(e)))||customElements.define(n(n(e)),l);break;case"pn-icon":customElements.get(n(n(e)))||c()}}))};export{b as PnPageNav,g as defineCustomElement}