@oslokommune/punkt-elements 17.1.3 → 18.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/{accordion-BeLvLPrB.js → accordion-CcUosZjL.js} +27 -27
  3. package/dist/{accordion-B3GBlvUC.cjs → accordion-k0pWTG1X.cjs} +5 -5
  4. package/dist/alert-BD8YVKia.cjs +35 -0
  5. package/dist/{alert-DKK_Tb9J.js → alert-Bmaly2Yo.js} +57 -52
  6. package/dist/{async-directive-BPf6K-V2.js → async-directive-COqx0IYj.js} +5 -5
  7. package/dist/{async-directive-Da7TJpnq.cjs → async-directive-DN2eg9gA.cjs} +1 -1
  8. package/dist/{backlink-D1y26pj3.js → backlink-C_ZO-ZbR.js} +9 -9
  9. package/dist/{backlink-CMmrKTe4.cjs → backlink-Ch64Pivx.cjs} +3 -3
  10. package/dist/base-elements/element.d.ts +13 -1
  11. package/dist/base-elements/input-element.d.ts +4 -2
  12. package/dist/{breadcrumbs-CcTQ3Grm.js → breadcrumbs-CF_gAbUk.js} +16 -16
  13. package/dist/{breadcrumbs-B6JGhJgC.cjs → breadcrumbs-CzzbardP.cjs} +7 -7
  14. package/dist/{button-2-OSPJkj.js → button-C1CQSASU.js} +28 -28
  15. package/dist/{button-CE97NQIk.cjs → button-CF3dNKeI.cjs} +7 -7
  16. package/dist/{calendar-kn4SrtJy.cjs → calendar-BxF81kB9.cjs} +28 -27
  17. package/dist/{calendar-pOW3R5Pw.js → calendar-DRmxORMc.js} +82 -68
  18. package/dist/{card-CETDFkxR.cjs → card-Cg1daj05.cjs} +26 -26
  19. package/dist/{card-zQ0eKRMV.js → card-W_Jb0Tlo.js} +44 -44
  20. package/dist/{checkbox-CQNr_sEg.cjs → checkbox-BHQv8lHq.cjs} +11 -11
  21. package/dist/{checkbox-CH7NpINF.js → checkbox-BQw2dMSX.js} +23 -23
  22. package/dist/{class-map-BeimMvPv.cjs → class-map-C33ixq7O.cjs} +1 -1
  23. package/dist/{class-map-CnWCnBSX.js → class-map-wh4Yi3oj.js} +3 -3
  24. package/dist/{combobox-Bvg0UO9w.cjs → combobox-BpZow9OU.cjs} +19 -18
  25. package/dist/{combobox-CRdYYlxu.js → combobox-C9wwnUfM.js} +55 -54
  26. package/dist/components/accordion/accordion.d.ts +2 -6
  27. package/dist/components/accordion/accordionitem.d.ts +2 -8
  28. package/dist/components/alert/alert.d.ts +2 -2
  29. package/dist/components/backlink/backlink.d.ts +4 -5
  30. package/dist/components/backlink/backlink.test.d.ts +1 -1
  31. package/dist/components/breadcrumbs/breadcrumbs.d.ts +6 -7
  32. package/dist/components/breadcrumbs/index.d.ts +1 -1
  33. package/dist/components/calendar/calendar.d.ts +21 -6
  34. package/dist/components/checkbox/checkbox.d.ts +4 -2
  35. package/dist/components/combobox/combobox-base.d.ts +2 -1
  36. package/dist/components/consent/strings.d.ts +1 -85
  37. package/dist/components/datepicker/datepicker-base.d.ts +0 -3
  38. package/dist/components/datepicker/datepicker-multiple.d.ts +0 -2
  39. package/dist/components/datepicker/datepicker-range.d.ts +0 -2
  40. package/dist/components/datepicker/datepicker-single.d.ts +0 -2
  41. package/dist/components/datepicker/datepicker-utils.d.ts +2 -1
  42. package/dist/components/fileupload/fileupload-base.d.ts +7 -4
  43. package/dist/components/fileupload/fileupload-types.d.ts +5 -43
  44. package/dist/components/header/header-service.d.ts +3 -1
  45. package/dist/components/header/header.d.ts +2 -1
  46. package/dist/components/helptext/helptext.d.ts +2 -1
  47. package/dist/components/index.d.ts +3 -1
  48. package/dist/components/input-wrapper/input-wrapper.d.ts +4 -2
  49. package/dist/components/radiobutton/radiobutton.d.ts +4 -2
  50. package/dist/components/searchinput/searchinput.d.ts +2 -1
  51. package/dist/{consent-CyY3RyoC.cjs → consent-CPtr7cBw.cjs} +5 -5
  52. package/dist/{consent-DZEkhgJ1.js → consent-D8MrqGKk.js} +10 -10
  53. package/dist/controllers/strings-controller.d.ts +27 -0
  54. package/dist/{datepicker-ButIas85.js → datepicker-D4YnAtWG.js} +104 -104
  55. package/dist/{datepicker-VTqSDQk5.cjs → datepicker-DaoumZT9.cjs} +38 -37
  56. package/dist/define-component-spec-BYOSeplU.js +6 -0
  57. package/dist/define-component-spec-DBNd2FJY.cjs +1 -0
  58. package/dist/{directive-helpers-CI8YZqku.js → directive-helpers-BWSAVe00.js} +1 -1
  59. package/dist/{directive-helpers-BlAV5EQD.cjs → directive-helpers-C6J4AkFk.cjs} +1 -1
  60. package/dist/docs/components/alert.d.ts +2 -3
  61. package/dist/docs/components/fileupload.d.ts +1 -0
  62. package/dist/element-DiFhBcIl.cjs +2 -0
  63. package/dist/{element-ChsFgr_B.js → element-WEzISABa.js} +241 -100
  64. package/dist/{element-with-slot-BvG9ctC-.js → element-with-slot-BKYUx4gb.js} +4 -4
  65. package/dist/{element-with-slot-Bj7nm7fO.cjs → element-with-slot-CBK4zrdN.cjs} +1 -1
  66. package/dist/{fileupload-D5IQ9HDe.js → fileupload-DEHSETw0.js} +340 -652
  67. package/dist/fileupload-DWu6FIMv.cjs +402 -0
  68. package/dist/{footer-DrR64HiK.js → footer-BJLEw6Ab.js} +91 -91
  69. package/dist/{footer-DbYQUYNR.cjs → footer-D_yYWkQ6.cjs} +32 -32
  70. package/dist/format-B8meU8Tm.cjs +1 -0
  71. package/dist/format-BTeSVkED.js +18 -0
  72. package/dist/{header-ClgIac6n.cjs → header-B7_4Cwaq.cjs} +84 -84
  73. package/dist/{header-KvJ1mGwA.js → header-DLVq7-dM.js} +267 -264
  74. package/dist/{header-menu-hVPXsb8g.js → header-menu-BsrrTjpT.js} +75 -75
  75. package/dist/{header-menu-BAsUNKSx.cjs → header-menu-m7nOOC1g.cjs} +24 -24
  76. package/dist/{heading-g-_IUB5T.js → heading-DSArgrDK.js} +16 -16
  77. package/dist/{heading-CFmiSuCQ.cjs → heading-_RPw2UW9.cjs} +1 -1
  78. package/dist/helptext-QMVsW5g6.cjs +27 -0
  79. package/dist/{helptext-DZng1D5i.js → helptext-dtVVufNH.js} +18 -19
  80. package/dist/{icon-D-LA22xD.js → icon-DEtOSWRK.js} +17 -17
  81. package/dist/{icon-9iwd2F2l.cjs → icon-DIavy2cB.cjs} +1 -1
  82. package/dist/{if-defined-CGzIlZ9-.js → if-defined-BmnvvxtR.js} +1 -1
  83. package/dist/if-defined-Dc3xFDaM.cjs +1 -0
  84. package/dist/input-element-DQY1Rpbp.cjs +1 -0
  85. package/dist/{input-element-DBMNBplu.js → input-element-IBypGOaV.js} +121 -120
  86. package/dist/input-wrapper-CQgAL1Br.js +308 -0
  87. package/dist/input-wrapper-mJZLVXy_.cjs +58 -0
  88. package/dist/link-DwLeY37f.js +131 -0
  89. package/dist/link-yk4IXDWm.cjs +7 -0
  90. package/dist/linkcard-BinKnxQF.cjs +13 -0
  91. package/dist/{linkcard-zqbg7Oqm.js → linkcard-D5DXpmXI.js} +16 -16
  92. package/dist/{listbox-Dc4rGdPi.cjs → listbox-C5zTRNAO.cjs} +15 -15
  93. package/dist/{listbox-va_E8afs.js → listbox-C8ooO8qZ.js} +100 -99
  94. package/dist/{loader-D_RDICnw.js → loader-C3HyayzL.js} +14 -14
  95. package/dist/{loader-CMUkVJmE.cjs → loader-DHF7M5Vn.cjs} +5 -5
  96. package/dist/{messagebox-Cv8LaSxv.cjs → messagebox-DqYf6VmQ.cjs} +5 -5
  97. package/dist/{messagebox-Cw-OWDya.js → messagebox-u8i3R5QA.js} +15 -15
  98. package/dist/{modal-BtInv031.cjs → modal-CnJ9y2TQ.cjs} +8 -8
  99. package/dist/{modal-D0t_X2dX.js → modal-V-jEe0aY.js} +20 -20
  100. package/dist/pkt-accordion.cjs +1 -1
  101. package/dist/pkt-accordion.js +1 -1
  102. package/dist/pkt-alert.cjs +1 -1
  103. package/dist/pkt-alert.js +1 -1
  104. package/dist/pkt-backlink.cjs +1 -1
  105. package/dist/pkt-backlink.js +1 -1
  106. package/dist/pkt-breadcrumbs.cjs +1 -1
  107. package/dist/pkt-breadcrumbs.js +1 -1
  108. package/dist/pkt-button.cjs +1 -1
  109. package/dist/pkt-button.js +1 -1
  110. package/dist/pkt-calendar.cjs +1 -1
  111. package/dist/pkt-calendar.js +1 -1
  112. package/dist/pkt-card.cjs +1 -1
  113. package/dist/pkt-card.js +1 -1
  114. package/dist/pkt-checkbox.cjs +1 -1
  115. package/dist/pkt-checkbox.js +1 -1
  116. package/dist/pkt-combobox.cjs +1 -1
  117. package/dist/pkt-combobox.js +1 -1
  118. package/dist/pkt-consent.cjs +1 -1
  119. package/dist/pkt-consent.js +1 -1
  120. package/dist/pkt-datepicker.cjs +1 -1
  121. package/dist/pkt-datepicker.js +1 -1
  122. package/dist/pkt-fileupload.cjs +1 -1
  123. package/dist/pkt-fileupload.js +1 -1
  124. package/dist/pkt-footer.cjs +1 -1
  125. package/dist/pkt-footer.js +1 -1
  126. package/dist/pkt-header-menu.cjs +1 -1
  127. package/dist/pkt-header-menu.js +1 -1
  128. package/dist/pkt-header.cjs +1 -1
  129. package/dist/pkt-header.js +1 -1
  130. package/dist/pkt-heading.cjs +1 -1
  131. package/dist/pkt-heading.js +1 -1
  132. package/dist/pkt-helptext.cjs +1 -1
  133. package/dist/pkt-helptext.js +1 -1
  134. package/dist/pkt-icon.cjs +1 -1
  135. package/dist/pkt-icon.js +1 -1
  136. package/dist/pkt-index.cjs +1 -1
  137. package/dist/pkt-index.js +35 -34
  138. package/dist/pkt-input-wrapper.cjs +1 -1
  139. package/dist/pkt-input-wrapper.js +1 -1
  140. package/dist/pkt-link.cjs +1 -1
  141. package/dist/pkt-link.js +1 -1
  142. package/dist/pkt-linkcard.cjs +1 -1
  143. package/dist/pkt-linkcard.js +1 -1
  144. package/dist/pkt-listbox.cjs +1 -1
  145. package/dist/pkt-listbox.js +1 -1
  146. package/dist/pkt-loader.cjs +1 -1
  147. package/dist/pkt-loader.js +1 -1
  148. package/dist/pkt-messagebox.cjs +1 -1
  149. package/dist/pkt-messagebox.js +1 -1
  150. package/dist/pkt-modal.cjs +1 -1
  151. package/dist/pkt-modal.js +1 -1
  152. package/dist/{pkt-options-controller-C5EBX2T0.cjs → pkt-options-controller-BhMNCWcc.cjs} +1 -1
  153. package/dist/{pkt-options-controller-B77vH3PE.js → pkt-options-controller-CuQ6SClv.js} +1 -1
  154. package/dist/pkt-progressbar.cjs +1 -1
  155. package/dist/pkt-progressbar.js +1 -1
  156. package/dist/pkt-radiobutton.cjs +1 -1
  157. package/dist/pkt-radiobutton.js +1 -1
  158. package/dist/pkt-searchinput.cjs +1 -1
  159. package/dist/pkt-searchinput.js +1 -1
  160. package/dist/pkt-select.cjs +1 -1
  161. package/dist/pkt-select.js +1 -1
  162. package/dist/pkt-tabs.cjs +1 -1
  163. package/dist/pkt-tabs.js +1 -1
  164. package/dist/pkt-tag.cjs +1 -1
  165. package/dist/pkt-tag.js +1 -1
  166. package/dist/pkt-textarea.cjs +1 -1
  167. package/dist/pkt-textarea.js +1 -1
  168. package/dist/pkt-textinput.cjs +1 -1
  169. package/dist/pkt-textinput.js +1 -1
  170. package/dist/pkt-timepicker.cjs +1 -1
  171. package/dist/pkt-timepicker.js +1 -1
  172. package/dist/{progressbar-CbcfLerF.js → progressbar-DS4i8IWq.js} +21 -21
  173. package/dist/{progressbar-D5MmnQId.cjs → progressbar-DY5hxImR.cjs} +5 -5
  174. package/dist/{radiobutton-BUnf3EPi.js → radiobutton-BhvZztMZ.js} +24 -24
  175. package/dist/{radiobutton-DpsO1F-8.cjs → radiobutton-BswqwRnA.cjs} +8 -8
  176. package/dist/{ref-CQoEIIp0.cjs → ref-DZmN5Qgj.cjs} +1 -1
  177. package/dist/{ref-CWD6PjVd.js → ref-OU8ryfP6.js} +2 -2
  178. package/dist/{repeat-sY6B7fAT.cjs → repeat-DIa_g6WL.cjs} +1 -1
  179. package/dist/{repeat-C02g7d5S.js → repeat-Dx2H127b.js} +4 -4
  180. package/dist/{searchinput-DwnjsvJ1.js → searchinput-CJo1PpM7.js} +43 -43
  181. package/dist/searchinput-Cl46nW0r.cjs +60 -0
  182. package/dist/{select-DMre80qs.js → select-CBrjauXT.js} +21 -20
  183. package/dist/{select-BOJi6H6T.cjs → select-Dman8Skr.cjs} +4 -3
  184. package/dist/shared-strings/consent.d.ts +71 -0
  185. package/dist/shared-strings/format.d.ts +21 -0
  186. package/dist/shared-strings/index.d.ts +14 -0
  187. package/dist/shared-strings/nb.d.ts +121 -0
  188. package/dist/shared-strings/resolve.d.ts +12 -0
  189. package/dist/shared-strings/store.d.ts +27 -0
  190. package/dist/shared-strings/types.d.ts +40 -0
  191. package/dist/shared-types/accordion.d.ts +58 -0
  192. package/dist/shared-types/alert.d.ts +20 -0
  193. package/dist/shared-types/aria.d.ts +2 -1
  194. package/dist/shared-types/backlink.d.ts +23 -0
  195. package/dist/shared-types/breadcrumbs.d.ts +33 -0
  196. package/dist/shared-types/fileupload.d.ts +55 -28
  197. package/dist/shared-types/footer.d.ts +10 -0
  198. package/dist/shared-types/form-field.d.ts +45 -0
  199. package/dist/shared-types/header-footer.d.ts +2 -0
  200. package/dist/shared-types/index.d.ts +15 -6
  201. package/dist/shared-types/render-link.d.ts +22 -0
  202. package/dist/shared-types/skin.d.ts +2 -9
  203. package/dist/shared-utils/combobox/index.d.ts +1 -0
  204. package/dist/shared-utils/combobox/input-utils.d.ts +2 -1
  205. package/dist/shared-utils/combobox/messages.d.ts +7 -0
  206. package/dist/shared-utils/combobox/option-utils.d.ts +2 -1
  207. package/dist/shared-utils/combobox/selection-manager.d.ts +3 -2
  208. package/dist/{tabs-Cf9ai0FD.cjs → tabs-C1m5rSrR.cjs} +7 -7
  209. package/dist/{tabs-TvxgbrCF.js → tabs-Xu3mIedh.js} +32 -32
  210. package/dist/{tag-Ds6n1LIs.js → tag-Azkjhkeu.js} +33 -32
  211. package/dist/tag-BS6dDPxY.cjs +27 -0
  212. package/dist/tests/strings-override.test.d.ts +0 -0
  213. package/dist/{textarea-vfzIcXhX.js → textarea-D4qXcVGD.js} +30 -29
  214. package/dist/{textarea-BydiLM9Z.cjs → textarea-DftUkR6w.cjs} +3 -2
  215. package/dist/{textinput-DGdicNSx.cjs → textinput-Ar-1Sbqy.cjs} +13 -12
  216. package/dist/{textinput-CMP2jPP_.js → textinput-iCgwwNPU.js} +28 -27
  217. package/dist/{timepicker-ClwgYywH.js → timepicker-W6HVWtmA.js} +67 -64
  218. package/dist/timepicker-dpAF7h49.cjs +196 -0
  219. package/package.json +3 -3
  220. package/src/components/accordion/accordion.ts +2 -10
  221. package/src/components/accordion/accordionitem.ts +2 -9
  222. package/src/components/alert/alert.ts +19 -10
  223. package/src/components/backlink/backlink.test.ts +3 -3
  224. package/src/components/backlink/backlink.ts +5 -7
  225. package/src/components/breadcrumbs/breadcrumbs.ts +9 -10
  226. package/src/components/breadcrumbs/index.ts +1 -1
  227. package/src/components/calendar/calendar.ts +56 -26
  228. package/src/components/checkbox/checkbox.test.ts +0 -2
  229. package/src/components/checkbox/checkbox.ts +8 -4
  230. package/src/components/combobox/combobox-base.ts +2 -1
  231. package/src/components/combobox/combobox-value.ts +10 -9
  232. package/src/components/combobox/combobox.selection.test.ts +5 -1
  233. package/src/components/combobox/combobox.ts +4 -1
  234. package/src/components/consent/strings.ts +1 -125
  235. package/src/components/datepicker/date-tags.ts +4 -1
  236. package/src/components/datepicker/datepicker-base.ts +2 -6
  237. package/src/components/datepicker/datepicker-multiple.ts +0 -3
  238. package/src/components/datepicker/datepicker-range.ts +4 -7
  239. package/src/components/datepicker/datepicker-single.ts +0 -3
  240. package/src/components/datepicker/datepicker-utils.test.ts +5 -5
  241. package/src/components/datepicker/datepicker-utils.ts +6 -11
  242. package/src/components/datepicker/datepicker.ts +8 -1
  243. package/src/components/fileupload/fileupload-base.ts +29 -19
  244. package/src/components/fileupload/fileupload-renderers.ts +2 -1
  245. package/src/components/fileupload/fileupload-types.ts +5 -42
  246. package/src/components/fileupload/fileupload.test.ts +16 -0
  247. package/src/components/fileupload/fileupload.ts +19 -15
  248. package/src/components/header/header-global.ts +3 -3
  249. package/src/components/header/header-service.ts +13 -8
  250. package/src/components/header/header.ts +2 -1
  251. package/src/components/helptext/helptext.test.ts +1 -1
  252. package/src/components/helptext/helptext.ts +3 -3
  253. package/src/components/index.ts +10 -1
  254. package/src/components/input-wrapper/input-wrapper.ts +18 -10
  255. package/src/components/link/link.ts +8 -3
  256. package/src/components/listbox/listbox.ts +3 -3
  257. package/src/components/radiobutton/radiobutton.ts +8 -4
  258. package/src/components/searchinput/searchinput.ts +5 -3
  259. package/src/components/select/select.ts +1 -0
  260. package/src/components/tag/tag.ts +2 -1
  261. package/src/components/textarea/textarea.ts +1 -0
  262. package/src/components/textinput/textinput.ts +1 -0
  263. package/src/components/timepicker/timepicker.ts +23 -21
  264. package/dist/alert-Cs4Rmq_J.cjs +0 -33
  265. package/dist/element-BA8v6S7z.cjs +0 -2
  266. package/dist/fileupload-BeWiTAoW.cjs +0 -401
  267. package/dist/helptext-CTtKJcML.cjs +0 -27
  268. package/dist/if-defined-B89_ZeCj.cjs +0 -1
  269. package/dist/input-element-DYmQw-fH.cjs +0 -1
  270. package/dist/input-wrapper-BmxNvznr.js +0 -128
  271. package/dist/input-wrapper-D-fPaTbY.js +0 -176
  272. package/dist/input-wrapper-D5PR0rJn.cjs +0 -1
  273. package/dist/input-wrapper-Q-B-aBeb.cjs +0 -54
  274. package/dist/link-D-Eqm5KH.js +0 -98
  275. package/dist/link-DK7gvmnj.cjs +0 -7
  276. package/dist/linkcard-B29cmZqh.cjs +0 -13
  277. package/dist/searchinput-Bh975rjX.cjs +0 -60
  278. package/dist/tag-CzojNU7z.cjs +0 -27
  279. package/dist/timepicker-DYrnLHqN.cjs +0 -195
  280. package/dist/translations/no.json.d.ts +0 -94
@@ -1,27 +1,27 @@
1
- import { c as e, d as t, f as n, l as r, n as i, o as a, p as o, s, t as c, u as l } from "./element-ChsFgr_B.js";
1
+ import { _ as e, d as t, f as n, g as r, h as i, m as a, n as o, p as s, t as c, u as l } from "./element-WEzISABa.js";
2
2
  //#region ../../node_modules/lit-html/directives/unsafe-html.js
3
- var u = class extends r {
3
+ var u = class extends s {
4
4
  constructor(e) {
5
- if (super(e), this.it = t, e.type !== l.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
5
+ if (super(e), this.it = i, e.type !== a.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
6
6
  }
7
7
  render(e) {
8
- if (e === t || e == null) return this._t = void 0, this.it = e;
9
- if (e === n) return e;
8
+ if (e === i || e == null) return this._t = void 0, this.it = e;
9
+ if (e === r) return e;
10
10
  if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
11
11
  if (e === this.it) return this._t;
12
12
  this.it = e;
13
- let r = [e];
14
- return r.raw = r, this._t = {
13
+ let t = [e];
14
+ return t.raw = t, this._t = {
15
15
  _$litType$: this.constructor.resultType,
16
- strings: r,
16
+ strings: t,
17
17
  values: []
18
18
  };
19
19
  }
20
20
  };
21
21
  u.directiveName = "unsafeHTML", u.resultType = 1;
22
- var d = e(u), f = class extends u {};
22
+ var d = n(u), f = class extends u {};
23
23
  f.directiveName = "unsafeSVG", f.resultType = 2;
24
- var p = e(f), m = "https://punkt-cdn.oslo.kommune.no/latest/icons/";
24
+ var p = n(f), m = "https://punkt-cdn.oslo.kommune.no/latest/icons/";
25
25
  typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || m);
26
26
  var h = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>", g = {}, _ = 2, v = 1500, y = typeof Storage < "u" && typeof sessionStorage < "u", b = (e) => window.pktFetch(e).then((t) => {
27
27
  if (!t.ok) throw Error("Missing icon: " + e);
@@ -73,29 +73,29 @@ var h = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>"
73
73
  } else this._updatedProps.includes(e) || this._updatedProps.push(e);
74
74
  }
75
75
  render() {
76
- return o`${this.name && this.icon}`;
76
+ return e`${this.name && this.icon}`;
77
77
  }
78
78
  };
79
- i([a({
79
+ o([l({
80
80
  type: String,
81
81
  reflect: !1
82
- })], C.prototype, "path", void 0), i([a({
82
+ })], C.prototype, "path", void 0), o([l({
83
83
  type: String,
84
84
  reflect: !0
85
- })], C.prototype, "name", void 0), i([a({
85
+ })], C.prototype, "name", void 0), o([l({
86
86
  type: String,
87
87
  attribute: "aria-hidden",
88
88
  reflect: !0
89
- })], C.prototype, "ariaHidden", void 0), i([a({
89
+ })], C.prototype, "ariaHidden", void 0), o([l({
90
90
  type: String,
91
91
  attribute: "aria-label",
92
92
  reflect: !0
93
- })], C.prototype, "ariaLabel", void 0), i([a({ type: SVGElement })], C.prototype, "icon", void 0), i([a({
93
+ })], C.prototype, "ariaLabel", void 0), o([l({ type: SVGElement })], C.prototype, "icon", void 0), o([l({
94
94
  type: Array,
95
95
  noAccessor: !0
96
96
  })], C.prototype, "_updatedProps", void 0);
97
97
  try {
98
- s("pkt-icon")(C);
98
+ t("pkt-icon")(C);
99
99
  } catch {
100
100
  console.warn("Forsøker å definere <pkt-icon>, men den er allerede definert");
101
101
  }
@@ -1 +1 @@
1
- const e=require("./element-BA8v6S7z.cjs");var t=class extends e.l{constructor(t){if(super(t),this.it=e.d,t.type!==e.u.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(t){if(t===e.d||t==null)return this._t=void 0,this.it=t;if(t===e.f)return t;if(typeof t!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(t===this.it)return this._t;this.it=t;let n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};t.directiveName=`unsafeHTML`,t.resultType=1;var n=e.c(t),r=class extends t{};r.directiveName=`unsafeSVG`,r.resultType=2;var i=e.c(r),a=`https://punkt-cdn.oslo.kommune.no/latest/icons/`;typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||a);var o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,s={},c=2,l=1500,u=typeof Storage<`u`&&typeof sessionStorage<`u`,d=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),f=async(e,t=c)=>{try{return await d(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,l)),f(e,t-1)):(console.error(`Failed to fetch icon: `+e),o)}},p=async(e,t)=>{let n=t+e+`.svg`;return u&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in s?s[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(s[n]=f(n).then(e=>(e!==o&&u&&sessionStorage.setItem(n,e),delete s[n],e)),s[n]):o},m=class extends e.t{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:a,this.name=``,this.ariaHidden=null,this.ariaLabel=null,this.icon=i(o),this._updatedProps=[]}get effectiveAriaHidden(){return this.ariaHidden!==null&&this.ariaHidden!==void 0?this.ariaHidden===``||this.ariaHidden===`true`:!this.ariaLabel}get effectiveAriaLabel(){return this.effectiveAriaHidden?null:this.ariaLabel||this.name||null}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-icon`)}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e===`name`||e===`path`)&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has(`name`)||e.has(`path`))&&this.getIcon(this.name),this.applyAriaToSvg()}applyAriaToSvg(){let e=this.querySelector(`svg`);if(!e)return;e.setAttribute(`aria-hidden`,String(this.effectiveAriaHidden));let t=this.effectiveAriaLabel;t?e.setAttribute(`aria-label`,t):e.removeAttribute(`aria-label`)}async getIcon(e=``){if(this._updatedProps.length>0){this.path||=typeof window<`u`?window.pktIconPath:a;try{this.icon=i(await p(this.name||``,this.path))}catch{this.icon=i(o)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return e.p`${this.name&&this.icon}`}};e.n([e.o({type:String,reflect:!1})],m.prototype,`path`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`name`,void 0),e.n([e.o({type:String,attribute:`aria-hidden`,reflect:!0})],m.prototype,`ariaHidden`,void 0),e.n([e.o({type:String,attribute:`aria-label`,reflect:!0})],m.prototype,`ariaLabel`,void 0),e.n([e.o({type:SVGElement})],m.prototype,`icon`,void 0),e.n([e.o({type:Array,noAccessor:!0})],m.prototype,`_updatedProps`,void 0);try{e.s(`pkt-icon`)(m)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var h=m;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
1
+ const e=require("./element-DiFhBcIl.cjs");var t=class extends e.p{constructor(t){if(super(t),this.it=e.h,t.type!==e.m.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(t){if(t===e.h||t==null)return this._t=void 0,this.it=t;if(t===e.g)return t;if(typeof t!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(t===this.it)return this._t;this.it=t;let n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};t.directiveName=`unsafeHTML`,t.resultType=1;var n=e.f(t),r=class extends t{};r.directiveName=`unsafeSVG`,r.resultType=2;var i=e.f(r),a=`https://punkt-cdn.oslo.kommune.no/latest/icons/`;typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||a);var o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,s={},c=2,l=1500,u=typeof Storage<`u`&&typeof sessionStorage<`u`,d=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),f=async(e,t=c)=>{try{return await d(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,l)),f(e,t-1)):(console.error(`Failed to fetch icon: `+e),o)}},p=async(e,t)=>{let n=t+e+`.svg`;return u&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in s?s[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(s[n]=f(n).then(e=>(e!==o&&u&&sessionStorage.setItem(n,e),delete s[n],e)),s[n]):o},m=class extends e.t{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:a,this.name=``,this.ariaHidden=null,this.ariaLabel=null,this.icon=i(o),this._updatedProps=[]}get effectiveAriaHidden(){return this.ariaHidden!==null&&this.ariaHidden!==void 0?this.ariaHidden===``||this.ariaHidden===`true`:!this.ariaLabel}get effectiveAriaLabel(){return this.effectiveAriaHidden?null:this.ariaLabel||this.name||null}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-icon`)}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e===`name`||e===`path`)&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has(`name`)||e.has(`path`))&&this.getIcon(this.name),this.applyAriaToSvg()}applyAriaToSvg(){let e=this.querySelector(`svg`);if(!e)return;e.setAttribute(`aria-hidden`,String(this.effectiveAriaHidden));let t=this.effectiveAriaLabel;t?e.setAttribute(`aria-label`,t):e.removeAttribute(`aria-label`)}async getIcon(e=``){if(this._updatedProps.length>0){this.path||=typeof window<`u`?window.pktIconPath:a;try{this.icon=i(await p(this.name||``,this.path))}catch{this.icon=i(o)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return e._`${this.name&&this.icon}`}};e.n([e.u({type:String,reflect:!1})],m.prototype,`path`,void 0),e.n([e.u({type:String,reflect:!0})],m.prototype,`name`,void 0),e.n([e.u({type:String,attribute:`aria-hidden`,reflect:!0})],m.prototype,`ariaHidden`,void 0),e.n([e.u({type:String,attribute:`aria-label`,reflect:!0})],m.prototype,`ariaLabel`,void 0),e.n([e.u({type:SVGElement})],m.prototype,`icon`,void 0),e.n([e.u({type:Array,noAccessor:!0})],m.prototype,`_updatedProps`,void 0);try{e.d(`pkt-icon`)(m)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var h=m;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
@@ -1,4 +1,4 @@
1
- import { d as e } from "./element-ChsFgr_B.js";
1
+ import { h as e } from "./element-WEzISABa.js";
2
2
  //#region ../../node_modules/lit-html/directives/if-defined.js
3
3
  var t = (t) => t ?? e;
4
4
  //#endregion
@@ -0,0 +1 @@
1
+ const e=require("./element-DiFhBcIl.cjs");var t=t=>t??e.h;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
@@ -0,0 +1 @@
1
+ const e=require("./element-DiFhBcIl.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-CBK4zrdN.cjs"),r=require("./utils-63cRpWut.cjs"),i=require("./booleanish-BF8l4scU.cjs");var a=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,_=new WeakMap,v=new WeakMap,y=new WeakMap,b=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},x=(e,t)=>{e.toggleAttribute(`internals-disabled`,t),t?b(e,`aria-disabled`,`true`):e.removeAttribute(`aria-disabled`),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},S=e=>{s.get(e).forEach(e=>{e.remove()}),s.set(e,[])},C=(e,t)=>{let n=document.createElement(`input`);return n.type=`hidden`,n.name=e.getAttribute(`name`),e.after(n),s.get(t).push(n),n},w=(e,t)=>{if(t.length){let n=Array.from(t);n.forEach(t=>t.addEventListener(`click`,e.click.bind(e)));let[r]=n,i=r.id;r.id||=(i=`${r.htmlFor}_Label`,i),b(e,`aria-labelledby`,i)}},T=e=>{let t=Array.from(e.elements).filter(e=>!e.tagName.includes(`-`)&&e.validity).map(e=>e.validity.valid),n=f.get(e)||[],r=Array.from(n).filter(e=>e.isConnected).map(e=>c.get(e).validity.valid),i=[...t,...r].includes(!1);e.toggleAttribute(`internals-invalid`,i),e.toggleAttribute(`internals-valid`,!i)},ee=e=>{T(O(e.target))},E=e=>{T(O(e.target))},te=e=>{let t=[`button[type=submit]`,`input[type=submit]`,`button:not([type])`].map(e=>`${e}:not([disabled])`).map(t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:``}`).join(`,`);e.addEventListener(`click`,n=>{if(n.target.closest(t)){let t=f.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map(e=>c.get(e).reportValidity()).includes(!1)&&n.preventDefault()}})},ne=e=>{let t=f.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},D=(e,t,n)=>{if(t){let r=f.get(t);if(r)r.add(e);else{let n=new Set;n.add(e),f.set(t,n),te(t),t.addEventListener(`reset`,ne),t.addEventListener(`input`,ee),t.addEventListener(`change`,E)}u.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),T(t)}},O=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=O(t)),t},k=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},A=(e,t,n)=>{let r=f.get(e);return r&&r.size&&r.forEach(e=>{c.get(e)[n]()||(t=!1)}),t},j=e=>{let t=!1;if(e.constructor.formAssociated){let n=c.get(e);n===void 0&&(e.attachInternals(),n=c.get(e),t=!0);let{labels:r,form:i}=n;w(e,r),D(e,i,n)}return t};function M(){return typeof MutationObserver<`u`}var N={ariaAtomic:`aria-atomic`,ariaAutoComplete:`aria-autocomplete`,ariaBrailleLabel:`aria-braillelabel`,ariaBrailleRoleDescription:`aria-brailleroledescription`,ariaBusy:`aria-busy`,ariaChecked:`aria-checked`,ariaColCount:`aria-colcount`,ariaColIndex:`aria-colindex`,ariaColIndexText:`aria-colindextext`,ariaColSpan:`aria-colspan`,ariaCurrent:`aria-current`,ariaDescription:`aria-description`,ariaDisabled:`aria-disabled`,ariaExpanded:`aria-expanded`,ariaHasPopup:`aria-haspopup`,ariaHidden:`aria-hidden`,ariaInvalid:`aria-invalid`,ariaKeyShortcuts:`aria-keyshortcuts`,ariaLabel:`aria-label`,ariaLevel:`aria-level`,ariaLive:`aria-live`,ariaModal:`aria-modal`,ariaMultiLine:`aria-multiline`,ariaMultiSelectable:`aria-multiselectable`,ariaOrientation:`aria-orientation`,ariaPlaceholder:`aria-placeholder`,ariaPosInSet:`aria-posinset`,ariaPressed:`aria-pressed`,ariaReadOnly:`aria-readonly`,ariaRelevant:`aria-relevant`,ariaRequired:`aria-required`,ariaRoleDescription:`aria-roledescription`,ariaRowCount:`aria-rowcount`,ariaRowIndex:`aria-rowindex`,ariaRowIndexText:`aria-rowindextext`,ariaRowSpan:`aria-rowspan`,ariaSelected:`aria-selected`,ariaSetSize:`aria-setsize`,ariaSort:`aria-sort`,ariaValueMax:`aria-valuemax`,ariaValueMin:`aria-valuemin`,ariaValueNow:`aria-valuenow`,ariaValueText:`aria-valuetext`,role:`role`},P=(e,t)=>{for(let n in N){t[n]=null;let r=null,i=N[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?b(e,i,n):m.set(e,t)}})}},re=(e,t)=>{s.set(t,[]),R.observe?.(e,L)};function F(e){let t=c.get(e),{form:n}=t;D(e,n,t),w(e,t.labels)}var I=(e,t=!1)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return c.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode(),i=!t||e.disabled;for(;r;)r.formDisabledCallback&&i&&x(r,e.disabled),r=n.nextNode()},L={attributes:!0,attributeFilter:[`disabled`,`name`]},R=M()?new MutationObserver(e=>{for(let t of e){let e=t.target;if(t.attributeName===`disabled`&&(e.constructor.formAssociated?x(e,e.hasAttribute(`disabled`)):e.localName===`fieldset`&&I(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=c.get(e),n=p.get(e);t.setFormValue(n)}}}):{};function z(e){e.forEach(e=>{let{addedNodes:t,removedNodes:n}=e,r=Array.from(t),i=Array.from(n);r.forEach(e=>{if(c.has(e)&&e.constructor.formAssociated&&F(e),m.has(e)){let t=m.get(e);Object.keys(N).filter(e=>t[e]!==null).forEach(n=>{b(e,N[n],t[n])}),m.delete(e)}if(y.has(e)){let t=y.get(e);b(e,`internals-valid`,t.validity.valid.toString()),b(e,`internals-invalid`,(!t.validity.valid).toString()),b(e,`aria-invalid`,(!t.validity.valid).toString()),y.delete(e)}if(e.localName===`form`){let t=f.get(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return c.has(e)&&e.constructor.formAssociated&&!(t&&t.has(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode();for(;r;)F(r),r=n.nextNode()}e.localName===`fieldset`&&(R.observe?.(e,L),I(e,!0))}),i.forEach(e=>{let t=c.get(e);t&&s.get(t)&&S(t),d.has(e)&&d.get(e).disconnect()})})}function ie(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=_.get(e.target);c.has(t)&&j(t),n.disconnect()})})}var ae=e=>{let t=new MutationObserver(ie);window?.ShadyDOM?.inUse&&e.mode&&e.host&&(e=e.host),t.observe?.(e,{childList:!0}),_.set(e,t)};M()&&new MutationObserver(z);var B={childList:!0,subtree:!0},oe=class{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}},se=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),ce=(e,t,n)=>(e.valid=le(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&T(n),e),le=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},V=new WeakMap;function H(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}var U=class extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);V.set(this,e)}add(e){if(!/^--/.test(e)||typeof e!=`string`)throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);let t=super.add(e),n=V.get(this),r=`state${e}`;return n.isConnected?H(n,r):setTimeout(()=>{H(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=V.get(this);return n.isConnected?(n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)):setTimeout(()=>{n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)}),t}},ue=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},W=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},G,de=class{constructor(e){G.set(this,void 0),ue(this,G,e,`f`);for(let t=0;t<e.length;t++){let n=e[t];this[t]=n,n.hasAttribute(`name`)&&(this[n.getAttribute(`name`)]=n)}Object.freeze(this)}get length(){return W(this,G,`f`).length}[(G=new WeakMap,Symbol.iterator)](){return W(this,G,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}};function fe(){let e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=n;let t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=r;function n(...t){let n=e.apply(this,t);return A(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return A(this,n,`reportValidity`)}let{get:i}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`elements`);Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...e){let t=i.call(this,...e),n=Array.from(f.get(this)||[]);return n.length===0?t:new de(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}var K=class{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);let t=e.getRootNode(),n=new oe;this.states=new U(e),a.set(this,e),o.set(this,n),c.set(e,this),P(e,this),re(e,this),Object.seal(this),t instanceof DocumentFragment&&ae(t)}checkValidity(){let e=a.get(this);if(k(e,`Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let t=o.get(this);if(!t.valid){let t=new Event(`invalid`,{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return t.valid}get form(){let e=a.get(this);k(e,`Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);let t;return e.constructor.formAssociated===!0&&(t=O(e)),t}get labels(){let e=a.get(this);k(e,`Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);let t=e.getAttribute(`id`),n=e.getRootNode();return n&&t?n.querySelectorAll(`[for="${t}"]`):[]}reportValidity(){let e=a.get(this);if(k(e,`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let t=this.checkValidity(),n=g.get(this);if(n&&!e.constructor.formAssociated)throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);return!t&&n&&(e.focus(),n.focus()),t}setFormValue(e){let t=a.get(this);if(k(t,`Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`),S(this),e!=null&&!(e instanceof FormData)){if(t.getAttribute(`name`)){let n=C(t,this);n.value=e}}else e!=null&&e instanceof FormData&&Array.from(e).reverse().forEach(([e,n])=>{if(typeof n==`string`){let r=C(t,this);r.name=e,r.value=n}});p.set(t,e)}setValidity(e,t,n){let r=a.get(this);if(k(r,`Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!e)throw TypeError(`Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.`);g.set(this,n);let i=o.get(this),s={};for(let t in e)s[t]=e[t];Object.keys(s).length===0&&se(i);let c={...i,...s};delete c.valid;let{valid:u}=ce(i,c,this.form);if(!u&&!t)throw new DOMException(`Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.`);l.set(this,u?``:t),r.isConnected?(r.toggleAttribute(`internals-invalid`,!u),r.toggleAttribute(`internals-valid`,u),b(r,`aria-invalid`,`${!u}`)):y.set(r,this)}get shadowRoot(){let e=a.get(this);return h.get(e)||null}get validationMessage(){return k(a.get(this),`Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`),l.get(this)}get validity(){return k(a.get(this),`Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`),o.get(this)}get willValidate(){let e=a.get(this);return k(e,`Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`),!(e.matches(`:disabled`)||e.disabled||e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`))}};function pe(){if(typeof window>`u`||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,``)}`;customElements.define(t,e);let n=new e;return[`shadowRoot`,`form`,`willValidate`,`validity`,`validationMessage`,`labels`,`setFormValue`,`setValidity`,`checkValidity`,`reportValidity`].every(e=>e in n.internals)}var q=!1,J=!1;function Y(e){J||(J=!0,window.CustomStateSet=U,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new U(this),n}))}function me(e=!0){let t=!1;if(!q){if(q=!0,typeof window<`u`&&(window.ElementInternals=K),typeof CustomElementRegistry<`u`){let e=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(n,r,i){if(r.formAssociated){let e=r.prototype.connectedCallback;r.prototype.connectedCallback=function(){v.has(this)||(v.set(this,!0),this.hasAttribute(`disabled`)&&x(this,!0)),e?.apply(this),t=j(this)}}e.call(this,n,r,i)}}if(typeof HTMLElement<`u`&&(HTMLElement.prototype.attachInternals=function(){if(!this.tagName)return{};if(this.tagName.indexOf(`-`)===-1)throw Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);if(c.has(this)&&!t)throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);return new K(this)}),typeof Element<`u`){function n(...t){let n=e.apply(this,t);if(h.set(this,n),M()){let e=new MutationObserver(z);window.ShadyDOM?e.observe(this,B):e.observe(n,B),d.set(this,e)}return n}let e=Element.prototype.attachShadow;Element.prototype.attachShadow=n}M()&&typeof document<`u`&&new MutationObserver(z).observe(document.documentElement,B),typeof HTMLFormElement<`u`&&fe(),(e||typeof window<`u`&&!window.CustomStateSet)&&Y()}}customElements.polyfillWrapFlushCallback||(pe()?typeof window<`u`&&!window.CustomStateSet&&Y(HTMLElement.prototype.attachInternals):me(!1));var X=`on`,Z=`--checked`,Q=`,`,$=class extends n.t{static get formAssociated(){return!0}get ariaDescribedBy(){return this.ariaDescribedby}set ariaDescribedBy(e){this.ariaDescribedby=e}effectiveCounter(e){return this.counter??e}effectiveHasFieldset(e){return this.hasFieldset??e}constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedby=null,this.ariaLabelledby=null,this.name=``,this.pattern=null,this.placeholder=null,this.id=r.n(),this.counter=null,this.hasError=!1,this.inline=!1,this.hasFieldset=null,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage=``,this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=null,this.label=null,this.tagText=null,this.inputSize=`medium`,this.dataTestid=``,this.touched=!1,this._initialized=!1,this.internals=this.attachInternals()}manageValidity(e){if(!e){console.warn(`manageValidity called without valid input element`);return}let n=this.pktStrings.get(`validation`);this.required&&!this.value?this.internals.setValidity({valueMissing:!0},n.valueMissing,e):e.validity?.typeMismatch||e.validity?.badInput?this.internals.setValidity({typeMismatch:!0},n.typeMismatch,e):e.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},n.patternMismatch,e):e.validity?.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},n.tooShort,e):e.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},n.tooLong,e):e.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?t.t(n.rangeUnderflowMin,{min:this.min.toString()}):n.rangeUnderflow,e):e.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},n.typeMismatch,e):e.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?t.t(n.rangeOverflowMax,{max:this.max.toString()}):n.rangeOverflow,e):e.validity?.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals){if(Array.isArray(e)){let t=new FormData;e.forEach(e=>{t.append(this.name,e)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}}coordinateRadioGroup(){if(!this.form||!this.name||this.type!==`radio`)return;let e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(e=>{if(e!==this&&e.getAttribute(`name`)===this.name&&e.getAttribute(`value`)!==this.value){let t=e;t.checked&&(t.checked=!1,t.internals&&(t.internals.setFormValue(null),t.internals.states?.delete(Z)))}})}valueChecked(e){if(!this.touched)return;let t=this.internals.form||this.closest(`form`),n=t?new FormData(t):null;if(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?(this.checked=e===`true`,this.internals.ariaChecked=String(e===`true`)):typeof e==`boolean`&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){let e=(typeof this.value==`string`?this.value:``)||X;this.internals.setFormValue(e),n&&n.append(this.name,e),this.internals.states.add(Z)}else this.internals.setFormValue(null),n&&n.delete(this.name),this.internals.states.delete(Z);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){let n=e;if(typeof n==`number`||typeof n==`boolean`)e=String(n);else if(n!=null&&typeof n!=`string`&&!Array.isArray(n)){let e=typeof n==`object`?n?.constructor?.name??`object`:typeof n;console.warn(`${this.localName}: value må være en streng eller et tall, men fikk ${e}. Verdien ignoreres. For dato-/tidsfelt, send en ISO-formatert streng (f.eks. "2026-07-09" eller "13:45").`)}(t!==this.value||t!==this._value)&&(typeof e==`string`?((this.multiple||this.range)&&e.includes(Q)&&(e=e.split(Q)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value=``,this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==t?.toString()&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`value-change`,{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){let e=this.multiple||this.range?[]:``;this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}onFocus(){this.dispatchEvent(new FocusEvent(`focus`,{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent(`blur`,{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e==`string`&&e.includes(Q)?e.split(Q):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||``:e}validate(){this.inputRef?.value&&this.manageValidity(this.inputRef.value),this.inputRefTo?.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(this.touched=!0,typeof e!=`string`&&!Array.isArray(e))return;let t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this._initialized&&this.dispatchChangeEvents(t)}formResetCallback(){if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{`selected`in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked=`false`,this.internals.setFormValue(``),this.inputRef?.value&&`checked`in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue(``);let e=this.defaultValue||(this.multiple||this.range?[]:``);this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid=`false`}updated(e){super.updated(e),e.has(`dataTestid`)&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute(`data-testid`)||this.setAttribute(`data-testid`,this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute(`data-testid`)))}firstUpdated(e){if(super.firstUpdated(e),!this.form){let e=this.internals.form||this.closest(`form`);this.form=e}if(this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=`true`,this.checked=!0),this.required&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){let e=this.checked===``||this.checked===`true`||this.checked===!0;this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||X:null;this.internals.setFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute(`form`,``),this.manageValidity(this.inputRefTo.value)),this.updateComplete.then(()=>{this._initialized=!0})}};e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`checked`,void 0),e.n([e.u({type:Boolean})],$.prototype,`defaultChecked`,void 0),e.n([e.u({type:Boolean})],$.prototype,`multiple`,void 0),e.n([e.u({type:Boolean})],$.prototype,`range`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`type`,void 0),e.n([e.u()],$.prototype,`defaultValue`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`readonly`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`required`,void 0),e.n([e.u({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],$.prototype,`max`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`maxlength`,void 0),e.n([e.u({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],$.prototype,`min`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`minlength`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`step`,void 0),e.n([e.u({type:String,attribute:`aria-describedby`})],$.prototype,`ariaDescribedby`,void 0),e.n([e.u({type:String,attribute:`aria-labelledby`})],$.prototype,`ariaLabelledby`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`name`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`pattern`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`placeholder`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`id`,void 0),e.n([e.u({type:Boolean,converter:i.n})],$.prototype,`counter`,void 0),e.n([e.u({type:Boolean})],$.prototype,`hasError`,void 0),e.n([e.u({type:Boolean})],$.prototype,`inline`,void 0),e.n([e.u({type:Boolean,converter:i.n})],$.prototype,`hasFieldset`,void 0),e.n([e.u({type:Boolean})],$.prototype,`optionalTag`,void 0),e.n([e.u({type:Boolean})],$.prototype,`requiredTag`,void 0),e.n([e.u({type:Boolean})],$.prototype,`skipForwardTestid`,void 0),e.n([e.u({type:Boolean,reflect:!0,converter:i.t})],$.prototype,`useWrapper`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`fullwidth`,void 0),e.n([e.u({type:Number})],$.prototype,`counterMaxLength`,void 0),e.n([e.u({type:String})],$.prototype,`errorMessage`,void 0),e.n([e.u({type:String})],$.prototype,`helptext`,void 0),e.n([e.u({type:String})],$.prototype,`helptextDropdown`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`helptextDropdownButton`,void 0),e.n([e.u({type:String})],$.prototype,`label`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`optionalText`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`requiredText`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`tagText`,void 0),e.n([e.u({type:String,attribute:`input-size`})],$.prototype,`inputSize`,void 0),e.n([e.u({type:String,attribute:`data-testid`})],$.prototype,`dataTestid`,void 0),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});