@oslokommune/punkt-elements 19.7.0 → 19.9.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 (232) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/accordion-CMCCpxtz.cjs +47 -0
  3. package/dist/{accordion-BJh6X1Ek.js → accordion-Cp2o6wTY.js} +10 -9
  4. package/dist/{alert-C0PiYnot.js → alert-CAPiwi4F.js} +10 -5
  5. package/dist/alert-QfloIr-o.cjs +39 -0
  6. package/dist/{async-directive-BGoo_npW.cjs → async-directive-DpyKp6qv.cjs} +1 -1
  7. package/dist/{async-directive-DsdqP_X7.js → async-directive-yh8hG41Q.js} +2 -2
  8. package/dist/{backlink-BRqhwUr2.cjs → backlink-CsFeerTH.cjs} +1 -1
  9. package/dist/{backlink-BslFewn-.js → backlink-ogvv493Y.js} +3 -3
  10. package/dist/base-elements/input-element.d.ts +17 -0
  11. package/dist/base-elements/option-group-element.d.ts +61 -0
  12. package/dist/base-elements/polyfill-form-value.test.d.ts +0 -0
  13. package/dist/{breadcrumbs-Cr3GugPv.js → breadcrumbs-53QVnTFP.js} +2 -2
  14. package/dist/{breadcrumbs-DG4i5UCh.cjs → breadcrumbs-D03id_ha.cjs} +1 -1
  15. package/dist/{button-B78im4wB.js → button-CeRr7oIn.js} +5 -5
  16. package/dist/{button-BNVTj7nB.cjs → button-Dh97H-58.cjs} +1 -1
  17. package/dist/{calendar-TcxvS-1_.cjs → calendar-C5QwPrbk.cjs} +1 -1
  18. package/dist/{calendar-BLaRXUBl.js → calendar-D9w8M99G.js} +3 -3
  19. package/dist/{card-CaLEuumN.cjs → card--NuWdTbG.cjs} +1 -1
  20. package/dist/{card-CYKhPUNI.js → card-_PlgXmgZ.js} +6 -6
  21. package/dist/{checkbox-Tq8ESzwH.js → checkbox-G8k3vg85.js} +39 -35
  22. package/dist/checkbox-QIcdn09A.cjs +40 -0
  23. package/dist/checkbox-group-DoueGGi5.js +50 -0
  24. package/dist/checkbox-group-nLazAkcg.cjs +1 -0
  25. package/dist/checkbox-group.d.ts +1 -0
  26. package/dist/{class-map-C4hdfSfY.js → class-map-Bf-QzUpN.js} +1 -1
  27. package/dist/{class-map-Drv0_anQ.cjs → class-map-Bh6toDeV.cjs} +1 -1
  28. package/dist/{combobox-BfdvXLBz.cjs → combobox-ClXhKwR9.cjs} +1 -1
  29. package/dist/{combobox-CMpYhgln.js → combobox-Cz_rq7Mm.js} +13 -13
  30. package/dist/components/checkbox/checkbox.d.ts +1 -0
  31. package/dist/components/checkbox-group/checkbox-group-context.d.ts +5 -0
  32. package/dist/components/checkbox-group/checkbox-group.d.ts +15 -0
  33. package/dist/components/checkbox-group/checkbox-group.test.d.ts +0 -0
  34. package/dist/components/checkbox-group/index.d.ts +3 -0
  35. package/dist/components/index.d.ts +2 -0
  36. package/dist/components/messagebox/messagebox.d.ts +2 -6
  37. package/dist/components/radio-group/index.d.ts +3 -0
  38. package/dist/components/radio-group/radio-group-context.d.ts +7 -0
  39. package/dist/components/radio-group/radio-group.d.ts +14 -0
  40. package/dist/components/radio-group/radio-group.test.d.ts +0 -0
  41. package/dist/components/radiobutton/radiobutton.d.ts +1 -0
  42. package/dist/{consent-CleJMbVH.js → consent-CZMxUavj.js} +2 -2
  43. package/dist/{consent-Dl-R0iC3.cjs → consent-DimzcQxt.cjs} +1 -1
  44. package/dist/consume-Bp12si68.js +61 -0
  45. package/dist/consume-kEjgTrAp.cjs +1 -0
  46. package/dist/{datepicker-Bs7Z3EFn.js → datepicker-C7ABsx7H.js} +12 -12
  47. package/dist/{datepicker-CWHYYj-H.cjs → datepicker-usIF9WY7.cjs} +2 -2
  48. package/dist/{directive-helpers-BRrz3Bcj.cjs → directive-helpers-Bv70GjQh.cjs} +1 -1
  49. package/dist/{directive-helpers-D96YEsht.js → directive-helpers-CwxFepWh.js} +1 -1
  50. package/dist/directives/slot-content.d.ts +4 -3
  51. package/dist/docs/components/checkbox-group.d.ts +13 -0
  52. package/dist/docs/components/radio-group.d.ts +13 -0
  53. package/dist/{element-BOmr9YLv.cjs → element-C6WTyJFE.cjs} +1 -1
  54. package/dist/{element-mwwC2Rra.js → element-DBugHPKM.js} +1 -0
  55. package/dist/{element-with-slot-DQv0cbbD.js → element-with-slot-DDLS-aLw.js} +6 -3
  56. package/dist/element-with-slot-DhiAuSjM.cjs +1 -0
  57. package/dist/{fileupload-CMIFZWJ5.cjs → fileupload-2uTFjd81.cjs} +1 -1
  58. package/dist/{fileupload-BQFJx1ok.js → fileupload-BR9H6fET.js} +8 -8
  59. package/dist/{footer-DdLls3F-.js → footer-B3DMvo8-.js} +4 -4
  60. package/dist/{footer-vy9NqT65.cjs → footer-CyxRYvT-.cjs} +1 -1
  61. package/dist/{header-Cc1Cy0U3.js → header-BKeSkfB7.js} +11 -11
  62. package/dist/{header-C4Uojzoy.cjs → header-Drj3lTrv.cjs} +1 -1
  63. package/dist/{header-menu-BfkCp8jw.cjs → header-menu-B_5hCNUl.cjs} +1 -1
  64. package/dist/{header-menu-ANj5nL2M.js → header-menu-buYE90FU.js} +4 -4
  65. package/dist/{heading-zoz-QZJ9.cjs → heading-DUYOvlxs.cjs} +1 -1
  66. package/dist/{heading-CUrZvkrM.js → heading-WBB5MO9i.js} +2 -2
  67. package/dist/{helptext-BCkwSz1m.cjs → helptext-C7cyihnu.cjs} +1 -1
  68. package/dist/{helptext-DCT_9dw1.js → helptext-DadLkcoO.js} +4 -4
  69. package/dist/{icon-JigbxxF7.js → icon-Bao96Zb8.js} +1 -1
  70. package/dist/{icon-Dnv6LtPC.cjs → icon-jPhyZD1z.cjs} +1 -1
  71. package/dist/if-defined-CiML3MTM.cjs +1 -0
  72. package/dist/{if-defined-Bebu3LXY.js → if-defined-O59_I-e-.js} +1 -1
  73. package/dist/{input-element-lLzfwdim.js → input-element-BBygBEei.js} +54 -17
  74. package/dist/input-element-C4SelHLD.cjs +1 -0
  75. package/dist/{input-wrapper-J3mEKhvR.cjs → input-wrapper-BT6B3Kco.cjs} +6 -2
  76. package/dist/{input-wrapper-BoTugCvh.js → input-wrapper-DrSCuw6U.js} +12 -8
  77. package/dist/{link-LO_5_La8.cjs → link-CEP7w1et.cjs} +1 -1
  78. package/dist/{link-CmZwAw5u.js → link-CVnIn74-.js} +4 -4
  79. package/dist/{linkcard-UKsxADrP.cjs → linkcard-D8vitdrQ.cjs} +1 -1
  80. package/dist/{linkcard-CQluSyJJ.js → linkcard-IWiVvRKy.js} +4 -4
  81. package/dist/{listbox-Ct9jIV_5.js → listbox-BDesthOp.js} +4 -4
  82. package/dist/{listbox-g-vHHLkD.cjs → listbox-CvduK_YU.cjs} +1 -1
  83. package/dist/{loader-C_PH05aw.cjs → loader-B0hFoBtF.cjs} +1 -1
  84. package/dist/{loader-DzctJ9jW.js → loader-CAsUPHjl.js} +4 -4
  85. package/dist/{messagebox-DPFBuisE.js → messagebox-6_iNN5F3.js} +9 -49
  86. package/dist/messagebox-C19L2Duq.cjs +13 -0
  87. package/dist/{modal-BymjMIJi.cjs → modal-CoEPzt4p.cjs} +1 -1
  88. package/dist/{modal-CELmA0-8.js → modal-D7MolBXb.js} +5 -5
  89. package/dist/option-group-element-BIuotbRu.js +135 -0
  90. package/dist/option-group-element-BYS7s-is.cjs +23 -0
  91. package/dist/pkt-accordion.cjs +1 -1
  92. package/dist/pkt-accordion.js +1 -1
  93. package/dist/pkt-alert.cjs +1 -1
  94. package/dist/pkt-alert.js +1 -1
  95. package/dist/pkt-backlink.cjs +1 -1
  96. package/dist/pkt-backlink.js +1 -1
  97. package/dist/pkt-breadcrumbs.cjs +1 -1
  98. package/dist/pkt-breadcrumbs.js +1 -1
  99. package/dist/pkt-button.cjs +1 -1
  100. package/dist/pkt-button.js +1 -1
  101. package/dist/pkt-calendar.cjs +1 -1
  102. package/dist/pkt-calendar.js +1 -1
  103. package/dist/pkt-card.cjs +1 -1
  104. package/dist/pkt-card.js +1 -1
  105. package/dist/pkt-checkbox-group.cjs +1 -0
  106. package/dist/pkt-checkbox-group.js +2 -0
  107. package/dist/pkt-checkbox.cjs +1 -1
  108. package/dist/pkt-checkbox.js +1 -1
  109. package/dist/pkt-combobox.cjs +1 -1
  110. package/dist/pkt-combobox.js +1 -1
  111. package/dist/pkt-consent.cjs +1 -1
  112. package/dist/pkt-consent.js +1 -1
  113. package/dist/pkt-datepicker.cjs +1 -1
  114. package/dist/pkt-datepicker.js +1 -1
  115. package/dist/pkt-fileupload.cjs +1 -1
  116. package/dist/pkt-fileupload.js +1 -1
  117. package/dist/pkt-footer.cjs +1 -1
  118. package/dist/pkt-footer.js +1 -1
  119. package/dist/pkt-header-menu.cjs +1 -1
  120. package/dist/pkt-header-menu.js +1 -1
  121. package/dist/pkt-header.cjs +1 -1
  122. package/dist/pkt-header.js +1 -1
  123. package/dist/pkt-heading.cjs +1 -1
  124. package/dist/pkt-heading.js +1 -1
  125. package/dist/pkt-helptext.cjs +1 -1
  126. package/dist/pkt-helptext.js +1 -1
  127. package/dist/pkt-icon.cjs +1 -1
  128. package/dist/pkt-icon.js +1 -1
  129. package/dist/pkt-index.cjs +1 -1
  130. package/dist/pkt-index.js +37 -35
  131. package/dist/pkt-input-wrapper.cjs +1 -1
  132. package/dist/pkt-input-wrapper.js +1 -1
  133. package/dist/pkt-link.cjs +1 -1
  134. package/dist/pkt-link.js +1 -1
  135. package/dist/pkt-linkcard.cjs +1 -1
  136. package/dist/pkt-linkcard.js +1 -1
  137. package/dist/pkt-listbox.cjs +1 -1
  138. package/dist/pkt-listbox.js +1 -1
  139. package/dist/pkt-loader.cjs +1 -1
  140. package/dist/pkt-loader.js +1 -1
  141. package/dist/pkt-messagebox.cjs +1 -1
  142. package/dist/pkt-messagebox.js +1 -1
  143. package/dist/pkt-modal.cjs +1 -1
  144. package/dist/pkt-modal.js +1 -1
  145. package/dist/{pkt-options-controller-CpEZcomb.cjs → pkt-options-controller-B3vVKnAG.cjs} +1 -1
  146. package/dist/{pkt-options-controller-D7l18Iw0.js → pkt-options-controller-ClFrUWZK.js} +1 -1
  147. package/dist/pkt-progressbar.cjs +1 -1
  148. package/dist/pkt-progressbar.js +1 -1
  149. package/dist/pkt-radio-group.cjs +1 -0
  150. package/dist/pkt-radio-group.js +2 -0
  151. package/dist/pkt-radiobutton.cjs +1 -1
  152. package/dist/pkt-radiobutton.js +1 -1
  153. package/dist/pkt-searchinput.cjs +1 -1
  154. package/dist/pkt-searchinput.js +1 -1
  155. package/dist/pkt-select.cjs +1 -1
  156. package/dist/pkt-select.js +1 -1
  157. package/dist/pkt-tabs.cjs +1 -1
  158. package/dist/pkt-tabs.js +1 -1
  159. package/dist/pkt-tag.cjs +1 -1
  160. package/dist/pkt-tag.js +1 -1
  161. package/dist/pkt-textarea.cjs +1 -1
  162. package/dist/pkt-textarea.js +1 -1
  163. package/dist/pkt-textinput.cjs +1 -1
  164. package/dist/pkt-textinput.js +1 -1
  165. package/dist/pkt-timepicker.cjs +1 -1
  166. package/dist/pkt-timepicker.js +1 -1
  167. package/dist/{progressbar-CIXNSwTy.cjs → progressbar-CnX4fFfR.cjs} +1 -1
  168. package/dist/{progressbar-DH5lIBpx.js → progressbar-DZHiq7B0.js} +5 -5
  169. package/dist/provide-Cz18sYug.cjs +1 -0
  170. package/dist/provide-_MnlMGnw.js +111 -0
  171. package/dist/radio-group-kOzlGn8T.cjs +1 -0
  172. package/dist/radio-group-lhymYEZX.js +52 -0
  173. package/dist/radio-group.d.ts +1 -0
  174. package/dist/radiobutton-BgHCcDJv.cjs +38 -0
  175. package/dist/{radiobutton-l_3oGDbb.js → radiobutton-CFd8TgV9.js} +39 -35
  176. package/dist/{ref-Emu5PNxk.cjs → ref-CB7e9nMY.cjs} +1 -1
  177. package/dist/{ref-CCSGk4MP.js → ref-y_5qv9vU.js} +2 -2
  178. package/dist/{repeat-CdxGS-_3.js → repeat-CV9S4zya.js} +2 -2
  179. package/dist/{repeat-Dh9YKoeV.cjs → repeat-CnnigVcj.cjs} +1 -1
  180. package/dist/{searchinput-Co8tcq-l.js → searchinput-Bkcr3Fby.js} +4 -4
  181. package/dist/{searchinput-CbClDE-d.cjs → searchinput-Mdc9Ihld.cjs} +1 -1
  182. package/dist/{select-DYjKMmHa.js → select-B6CN2Ymq.js} +7 -7
  183. package/dist/{select-CZYQ5Dmx.cjs → select-BowvpCNa.cjs} +1 -1
  184. package/dist/shared-strings/nb.d.ts +1 -0
  185. package/dist/shared-types/index.d.ts +7 -3
  186. package/dist/shared-types/messagebox.d.ts +32 -0
  187. package/dist/shared-types/option-group.d.ts +50 -0
  188. package/dist/shared-types/skin.d.ts +1 -4
  189. package/dist/{tabs-B8blHQrL.js → tabs-DZvtVA0y.js} +9 -8
  190. package/dist/tabs-Dm8xcPRs.cjs +40 -0
  191. package/dist/{tag-Bns7Xj1O.js → tag-C33BPIOm.js} +5 -5
  192. package/dist/{tag-B5dUg7AD.cjs → tag-DyVZrqOQ.cjs} +1 -1
  193. package/dist/tests/component-registry.d.ts +4 -0
  194. package/dist/tests/option-contexts.d.ts +7 -0
  195. package/dist/{textarea-H1Lt2o6K.cjs → textarea-DoH3Il8v.cjs} +1 -1
  196. package/dist/{textarea-C2oaRlfb.js → textarea-hW0kV5gj.js} +9 -9
  197. package/dist/{textinput-C0eu70sH.js → textinput-B6G4dVuL.js} +8 -8
  198. package/dist/{textinput-C2Tx-OrN.cjs → textinput-CQknclmV.cjs} +1 -1
  199. package/dist/{timepicker-B8TwchA2.js → timepicker-Cd2QI6ua.js} +8 -8
  200. package/dist/{timepicker-DZG_gHIa.cjs → timepicker-DB3gor6g.cjs} +1 -1
  201. package/package.json +2 -2
  202. package/src/components/alert/alert.ts +1 -1
  203. package/src/components/checkbox/checkbox.test.ts +99 -0
  204. package/src/components/checkbox/checkbox.ts +14 -5
  205. package/src/components/checkbox-group/checkbox-group-context.ts +8 -0
  206. package/src/components/checkbox-group/checkbox-group.test.ts +406 -0
  207. package/src/components/checkbox-group/checkbox-group.ts +69 -0
  208. package/src/components/checkbox-group/index.ts +4 -0
  209. package/src/components/combobox/combobox.ts +1 -1
  210. package/src/components/datepicker/datepicker.ts +1 -1
  211. package/src/components/index.ts +2 -0
  212. package/src/components/input-wrapper/input-wrapper.ts +5 -1
  213. package/src/components/input-wrapper/wrapper-parity.test.ts +27 -2
  214. package/src/components/messagebox/messagebox.test.ts +1 -1
  215. package/src/components/messagebox/messagebox.ts +6 -12
  216. package/src/components/radio-group/index.ts +4 -0
  217. package/src/components/radio-group/radio-group-context.ts +8 -0
  218. package/src/components/radio-group/radio-group.test.ts +530 -0
  219. package/src/components/radio-group/radio-group.ts +65 -0
  220. package/src/components/radiobutton/radiobutton.test.ts +95 -0
  221. package/src/components/radiobutton/radiobutton.ts +11 -5
  222. package/dist/accordion-5lSFQToJ.cjs +0 -47
  223. package/dist/alert-IaZzEgyI.cjs +0 -39
  224. package/dist/checkbox-D69leWDh.cjs +0 -40
  225. package/dist/consume-BDnMAp2g.js +0 -167
  226. package/dist/consume-Le4HztPo.cjs +0 -1
  227. package/dist/element-with-slot-D7sTqOr3.cjs +0 -1
  228. package/dist/if-defined-2mkIDgOm.cjs +0 -1
  229. package/dist/input-element-CSfDGslx.cjs +0 -1
  230. package/dist/messagebox-JWKMJEFc.cjs +0 -13
  231. package/dist/radiobutton-BPr22VmL.cjs +0 -38
  232. package/dist/tabs-CjX-GWvM.cjs +0 -40
@@ -1 +1 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./element-with-slot-D7sTqOr3.cjs");var n=class extends t.t{constructor(...e){super(...e),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}willUpdate(e){super.willUpdate(e),e.has(`level`)&&(this.level<1||this.level>6)&&console.warn(`Invalid heading level: ${this.level}. Must be between 1 and 6.`),this.size===void 0&&(this.size=this.defaultSizeForLevel),this.weight===void 0&&(this.weight=this.defaultWeightForLevel)}get defaultSizeForLevel(){switch(this.level){case 1:return`xlarge`;case 2:return`large`;case 3:return`medium`;case 4:return`small`;case 5:case 6:return`xsmall`;default:return`medium`}}get defaultWeightForLevel(){switch(this.level){case 1:case 2:return`regular`;case 3:case 4:case 5:case 6:return`medium`;default:return`medium`}}get headingClasses(){return[`pkt-heading`,this.size&&`pkt-heading--${this.size}`,this.weight&&`pkt-heading--fw-${this.weight}`,this.visuallyHidden&&`pkt-sr-only`,this.align&&`pkt-heading--${this.align}`].filter(Boolean).join(` `)}render(){let n=this.headingClasses,r=t.i(this);switch(this.level>=1&&this.level<=6?this.level:2){case 1:return e._`<h1 class=${n}>${r}</h1>`;case 2:return e._`<h2 class=${n}>${r}</h2>`;case 3:return e._`<h3 class=${n}>${r}</h3>`;case 4:return e._`<h4 class=${n}>${r}</h4>`;case 5:return e._`<h5 class=${n}>${r}</h5>`;case 6:return e._`<h6 class=${n}>${r}</h6>`;default:return e._`<h2 class=${n}>${r}</h2>`}}};e.n([e.u({type:String,reflect:!0})],n.prototype,`size`,void 0),e.n([e.u({type:Number,reflect:!0})],n.prototype,`level`,void 0),e.n([e.u({type:String,reflect:!0})],n.prototype,`weight`,void 0),e.n([e.u({type:Boolean,reflect:!0})],n.prototype,`visuallyHidden`,void 0),e.n([e.u({type:String,reflect:!0})],n.prototype,`align`,void 0);try{e.d(`pkt-heading`)(n)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var r=n;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-DhiAuSjM.cjs");var n=class extends t.t{constructor(...e){super(...e),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}willUpdate(e){super.willUpdate(e),e.has(`level`)&&(this.level<1||this.level>6)&&console.warn(`Invalid heading level: ${this.level}. Must be between 1 and 6.`),this.size===void 0&&(this.size=this.defaultSizeForLevel),this.weight===void 0&&(this.weight=this.defaultWeightForLevel)}get defaultSizeForLevel(){switch(this.level){case 1:return`xlarge`;case 2:return`large`;case 3:return`medium`;case 4:return`small`;case 5:case 6:return`xsmall`;default:return`medium`}}get defaultWeightForLevel(){switch(this.level){case 1:case 2:return`regular`;case 3:case 4:case 5:case 6:return`medium`;default:return`medium`}}get headingClasses(){return[`pkt-heading`,this.size&&`pkt-heading--${this.size}`,this.weight&&`pkt-heading--fw-${this.weight}`,this.visuallyHidden&&`pkt-sr-only`,this.align&&`pkt-heading--${this.align}`].filter(Boolean).join(` `)}render(){let n=this.headingClasses,r=t.i(this);switch(this.level>=1&&this.level<=6?this.level:2){case 1:return e._`<h1 class=${n}>${r}</h1>`;case 2:return e._`<h2 class=${n}>${r}</h2>`;case 3:return e._`<h3 class=${n}>${r}</h3>`;case 4:return e._`<h4 class=${n}>${r}</h4>`;case 5:return e._`<h5 class=${n}>${r}</h5>`;case 6:return e._`<h6 class=${n}>${r}</h6>`;default:return e._`<h2 class=${n}>${r}</h2>`}}};e.n([e.u({type:String,reflect:!0})],n.prototype,`size`,void 0),e.n([e.u({type:Number,reflect:!0})],n.prototype,`level`,void 0),e.n([e.u({type:String,reflect:!0})],n.prototype,`weight`,void 0),e.n([e.u({type:Boolean,reflect:!0})],n.prototype,`visuallyHidden`,void 0),e.n([e.u({type:String,reflect:!0})],n.prototype,`align`,void 0);try{e.d(`pkt-heading`)(n)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var r=n;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -1,5 +1,5 @@
1
- import { _ as e, d as t, n, u as r } from "./element-mwwC2Rra.js";
2
- import { i, t as a } from "./element-with-slot-DQv0cbbD.js";
1
+ import { _ as e, d as t, n, u as r } from "./element-DBugHPKM.js";
2
+ import { i, t as a } from "./element-with-slot-DDLS-aLw.js";
3
3
  //#region src/components/heading/heading.ts
4
4
  var o = class extends a {
5
5
  constructor(...e) {
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./element-with-slot-D7sTqOr3.cjs"),r=require("./icon-Dnv6LtPC.cjs"),i=require("./utils-63cRpWut.cjs");var a=class extends n.t{constructor(...e){super(...e),this.forId=i.n(),this.helptext=``,this.helptextDropdown=``,this.isHelpTextOpen=!1}render(){let i=()=>{let e=!this.isHelpTextOpen;this.isHelpTextOpen=e,this.dispatchEvent(new CustomEvent(`toggleHelpText`,{bubbles:!0,detail:{isOpen:e}}))},a=t.t({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()});return e._`${e._`<div class="${a}">
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-DhiAuSjM.cjs"),r=require("./icon-jPhyZD1z.cjs"),i=require("./utils-63cRpWut.cjs");var a=class extends n.t{constructor(...e){super(...e),this.forId=i.n(),this.helptext=``,this.helptextDropdown=``,this.isHelpTextOpen=!1}render(){let i=()=>{let e=!this.isHelpTextOpen;this.isHelpTextOpen=e,this.dispatchEvent(new CustomEvent(`toggleHelpText`,{bubbles:!0,detail:{isOpen:e}}))},a=t.t({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()});return e._`${e._`<div class="${a}">
2
2
  <div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
3
3
  <div class="pkt-contents">${n.i(this)}</div>
4
4
  ${this.helptext?e._`<span>${r.r(this.helptext)}</span>`:e.h}
@@ -1,7 +1,7 @@
1
- import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-mwwC2Rra.js";
2
- import { t as o } from "./class-map-C4hdfSfY.js";
3
- import { i as s, t as c } from "./element-with-slot-DQv0cbbD.js";
4
- import { r as l } from "./icon-JigbxxF7.js";
1
+ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-DBugHPKM.js";
2
+ import { t as o } from "./class-map-Bf-QzUpN.js";
3
+ import { i as s, t as c } from "./element-with-slot-DDLS-aLw.js";
4
+ import { r as l } from "./icon-Bao96Zb8.js";
5
5
  import { n as u } from "./utils-BwF4QSrq.js";
6
6
  //#region src/components/helptext/helptext.ts
7
7
  var d = class extends c {
@@ -1,4 +1,4 @@
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-mwwC2Rra.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-DBugHPKM.js";
2
2
  var u = {
3
3
  name: "",
4
4
  path: "https://punkt-cdn.oslo.kommune.no/latest/icons/"
@@ -1 +1 @@
1
- const e=require("./element-BOmr9YLv.cjs");var t={name:``,path:`https://punkt-cdn.oslo.kommune.no/latest/icons/`},n=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:[]}}};n.directiveName=`unsafeHTML`,n.resultType=1;var r=e.f(n),i=class extends n{};i.directiveName=`unsafeSVG`,i.resultType=2;var a=e.f(i);typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||t.path);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:t.path,this.name=t.name,this.ariaHidden=null,this.ariaLabel=null,this.icon=a(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:t.path;try{this.icon=a(await p(this.name||``,this.path))}catch{this.icon=a(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 r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
1
+ const e=require("./element-C6WTyJFE.cjs");var t={name:``,path:`https://punkt-cdn.oslo.kommune.no/latest/icons/`},n=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:[]}}};n.directiveName=`unsafeHTML`,n.resultType=1;var r=e.f(n),i=class extends n{};i.directiveName=`unsafeSVG`,i.resultType=2;var a=e.f(i);typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||t.path);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:t.path,this.name=t.name,this.ariaHidden=null,this.ariaLabel=null,this.icon=a(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:t.path;try{this.icon=a(await p(this.name||``,this.path))}catch{this.icon=a(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 r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
@@ -0,0 +1 @@
1
+ const e=require("./element-C6WTyJFE.cjs");var t=t=>t??e.h;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
@@ -1,4 +1,4 @@
1
- import { h as e } from "./element-mwwC2Rra.js";
1
+ import { h as e } from "./element-DBugHPKM.js";
2
2
  //#region ../../node_modules/lit-html/directives/if-defined.js
3
3
  var t = (t) => t ?? e;
4
4
  //#endregion
@@ -1,6 +1,6 @@
1
- import { l as e, n as t, u as n } from "./element-mwwC2Rra.js";
1
+ import { l as e, n as t, u as n } from "./element-DBugHPKM.js";
2
2
  import { t as r } from "./format-BTeSVkED.js";
3
- import { t as i } from "./element-with-slot-DQv0cbbD.js";
3
+ import { t as i } from "./element-with-slot-DDLS-aLw.js";
4
4
  import { n as a, t as o } from "./booleanish-OQJTYSrw.js";
5
5
  import { n as s } from "./utils-BwF4QSrq.js";
6
6
  //#region ../../node_modules/element-internals-polyfill/dist/maps.js
@@ -462,7 +462,10 @@ function _e(e = !0) {
462
462
  customElements.polyfillWrapFlushCallback || (ge() ? typeof window < "u" && !window.CustomStateSet && Y(HTMLElement.prototype.attachInternals) : _e(!1));
463
463
  //#endregion
464
464
  //#region src/base-elements/input-element.ts
465
- var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e === "true", $ = class e extends i {
465
+ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e === "true", ye = /* @__PURE__ */ new WeakMap(), be = 0, xe = (e) => {
466
+ let t = ye.get(e);
467
+ return t || (t = e.id || `form${++be}`, ye.set(e, t)), t;
468
+ }, Se = () => !!globalThis.ElementInternals?.isPolyfilled, $ = class e extends i {
466
469
  static get formAssociated() {
467
470
  return !0;
468
471
  }
@@ -487,6 +490,18 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
487
490
  get isDisabled() {
488
491
  return this.disabled || this.formDisabled;
489
492
  }
493
+ get optionGroup() {
494
+ return this.groupContext;
495
+ }
496
+ setGroupValidity(e) {
497
+ this.groupValidityMessage !== e && (this.groupValidityMessage = e, this.inputRef?.value && this.manageValidity(this.inputRef.value));
498
+ }
499
+ syncGroupName() {
500
+ let e = this.optionGroup?.name;
501
+ if (!e) return;
502
+ let t = !this.name || this.name === this.derivedName;
503
+ t && this.name !== e && (this.name = e), t && (this.derivedName = e);
504
+ }
490
505
  effectiveCounter(e) {
491
506
  return this.counter ?? e;
492
507
  }
@@ -494,7 +509,22 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
494
509
  return this.hasFieldset ?? e;
495
510
  }
496
511
  constructor() {
497
- 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 = s(), 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.formDisabled = !1, this.touched = !1, this._initialized = !1, this._didInitDerivedState = !1, this._defaultCheckedState = !1, this.internals = this.attachInternals();
512
+ 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 = s(), 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.formDisabled = !1, this.derivedName = null, this.groupValidityMessage = "", this.touched = !1, this._initialized = !1, this.polyfillFormValue = null, this._didInitDerivedState = !1, this._defaultCheckedState = !1, this.internals = this.attachInternals();
513
+ }
514
+ connectedCallback() {
515
+ super.connectedCallback(), Se() && queueMicrotask(() => {
516
+ this.isConnected && this.polyfillFormValue && this.internals.setFormValue(this.polyfillFormValue.value);
517
+ });
518
+ }
519
+ get internalName() {
520
+ let e = this.form;
521
+ return e ? `${this.name}-internal-${xe(e)}` : `${this.name}-internal`;
522
+ }
523
+ formAssociatedCallback() {
524
+ this.requestUpdate();
525
+ }
526
+ writeFormValue(e) {
527
+ this.internals.setFormValue(e), Se() && (this.polyfillFormValue = { value: e });
498
528
  }
499
529
  manageValidity(e, t) {
500
530
  if (!e) {
@@ -502,7 +532,10 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
502
532
  return;
503
533
  }
504
534
  let n = this.pktStrings.get("validation");
505
- (this.isCheckable ? this.checkableValueMissing(t ?? this.checkableGroup()) : 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 ? r(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 ? r(n.rangeOverflowMax, { max: this.max.toString() }) : n.rangeOverflow, e) : e.validity?.customError ? this.internals.setValidity({ customError: !0 }, e.validationMessage, e) : this.internals.setValidity({});
535
+ (this.isCheckable ? this.checkableValueMissing(t ?? this.checkableGroup()) : this.required && !this.value) ? this.internals.setValidity(this.groupValidityMessage ? {
536
+ valueMissing: !0,
537
+ customError: !0
538
+ } : { valueMissing: !0 }, this.groupValidityMessage || 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 ? r(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 ? r(n.rangeOverflowMax, { max: this.max.toString() }) : n.rangeOverflow, e) : e.validity?.customError ? this.internals.setValidity({ customError: !0 }, e.validationMessage, e) : this.groupValidityMessage ? this.internals.setValidity({ customError: !0 }, this.groupValidityMessage, e) : this.internals.setValidity({});
506
539
  }
507
540
  setFormValue(e) {
508
541
  if (this.internals) {
@@ -510,8 +543,8 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
510
543
  let t = new FormData();
511
544
  e.forEach((e) => {
512
545
  t.append(this.name, e);
513
- }), this.internals.setFormValue(t);
514
- } else this.internals.setFormValue(e);
546
+ }), this.writeFormValue(t);
547
+ } else this.writeFormValue(e);
515
548
  }
516
549
  }
517
550
  radioGroupMembers() {
@@ -526,13 +559,16 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
526
559
  checkableGroup() {
527
560
  return this.type === "radio" ? [this, ...this.radioGroupMembers()] : [this];
528
561
  }
529
- checkableValueMissing(e) {
530
- return this.type === "radio" ? e.some((e) => e.required) && !e.some((e) => Q(e.checked)) : this.required && !Q(this.checked);
562
+ get isRequired() {
563
+ return this.required || this.type === "radio" && !!this.optionGroup?.required;
564
+ }
565
+ checkableValueMissing(t) {
566
+ return this.type === "radio" ? t.some((t) => t instanceof e ? t.isRequired : t.required) && !t.some((e) => Q(e.checked)) : this.required && !Q(this.checked);
531
567
  }
532
568
  syncCheckedState() {
533
569
  if (!this.internals) return;
534
570
  let e = Q(this.checked);
535
- this.internals.ariaChecked = String(e), e ? (this.internals.setFormValue((typeof this.value == "string" ? this.value : "") || X), this.internals.states?.add(ve)) : (this.internals.setFormValue(null), this.internals.states?.delete(ve)), this.inputRef?.value && this.inputRef.value.checked !== e && (this.inputRef.value.checked = e);
571
+ this.internals.ariaChecked = String(e), e ? (this.writeFormValue((typeof this.value == "string" ? this.value : "") || X), this.internals.states?.add(ve)) : (this.writeFormValue(null), this.internals.states?.delete(ve)), this.inputRef?.value && this.inputRef.value.checked !== e && (this.inputRef.value.checked = e);
536
572
  }
537
573
  validateCheckable() {
538
574
  let t = this.checkableGroup();
@@ -548,7 +584,7 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
548
584
  });
549
585
  }
550
586
  valueChecked(e) {
551
- this.touched && (this.type === "radio" && this.coordinateRadioGroup(), typeof e == "string" ? this.checked = e === "true" : typeof e == "boolean" && (this.checked = e), this.syncCheckedState(), this.validateCheckable(), this.dispatchChangeEvents(this.checked));
587
+ this.touched && (this.type === "radio" && this.coordinateRadioGroup(), typeof e == "string" ? this.checked = e === "true" : typeof e == "boolean" && (this.checked = e), this.syncCheckedState(), this.validateCheckable(), this.onInput(), this.dispatchChangeEvents(this.checked));
552
588
  }
553
589
  valueChanged(e, t) {
554
590
  let n = e;
@@ -607,29 +643,30 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
607
643
  "selected" in e && (e.selected = !1);
608
644
  }), this.checked !== void 0) this.checked = this._defaultCheckedState, this.syncCheckedState(), this.validateCheckable();
609
645
  else {
610
- this.internals.setFormValue("");
646
+ this.writeFormValue("");
611
647
  let e = this.defaultValue || (this.multiple || this.range ? [] : "");
612
648
  this.value = e, this._value = Array.isArray(e) ? e : [e], this.valueChanged(this.value, null);
613
649
  }
614
650
  this.internals.ariaInvalid = "false";
615
651
  }
616
652
  updated(e) {
617
- super.updated(e), this.isCheckable && this._initialized && (e.has("defaultChecked") && e.get("defaultChecked") !== void 0 && (this._defaultCheckedState = !!this.defaultChecked), [
653
+ super.updated(e), this.isCheckable && this._initialized && (e.has("defaultChecked") && e.get("defaultChecked") !== void 0 && (this._defaultCheckedState = !!this.defaultChecked), e.has("groupContext") && this.isRequired && (this.internals.ariaRequired = "true"), [
618
654
  "checked",
619
655
  "value",
620
656
  "required",
621
- "name"
657
+ "name",
658
+ "groupContext"
622
659
  ].some((t) => e.has(t)) && (this.syncCheckedState(), this.validateCheckable())), 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")));
623
660
  }
624
661
  willUpdate(e) {
625
- super.willUpdate(e), !this._didInitDerivedState && (this._didInitDerivedState = !0, this.defaultChecked && (this.checked = !0), this.id && !this.name && (this.name = this.id), this.value && this.defaultValue === null && (this.defaultValue = this.value), this.defaultValue !== null && !this.value && this.valueChanged(this.defaultValue, null));
662
+ super.willUpdate(e), this.syncGroupName(), !this._didInitDerivedState && (this._didInitDerivedState = !0, this.defaultChecked && (this.checked = !0), this.id && !this.name && (this.name = this.id, this.derivedName = this.id), this.value && this.defaultValue === null && (this.defaultValue = this.value), this.defaultValue !== null && !this.value && this.valueChanged(this.defaultValue, null));
626
663
  }
627
664
  firstUpdated(e) {
628
- if (super.firstUpdated(e), 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.required && (this.internals.ariaRequired = "true"), this.disabled && (this.internals.ariaDisabled = "true"), this.checked !== void 0) {
665
+ if (super.firstUpdated(e), 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.isRequired && (this.internals.ariaRequired = "true"), this.disabled && (this.internals.ariaDisabled = "true"), this.checked !== void 0) {
629
666
  let e = Q(this.checked);
630
667
  this._defaultCheckedState = e, this.internals.ariaChecked = String(e);
631
668
  let t = e ? (typeof this.value == "string" ? this.value : "") || X : null;
632
- this.internals.setFormValue(t);
669
+ this.writeFormValue(t);
633
670
  } else this.setFormValue(this.value);
634
671
  this.inputRef && this.inputRef.value && (this.inputRef.value.setAttribute("form", ""), this.isCheckable ? this.validateCheckable() : this.manageValidity(this.inputRef.value)), this.inputRefTo && this.inputRefTo.value && (this.inputRefTo.value.setAttribute("form", ""), this.manageValidity(this.inputRefTo.value)), this.updateComplete.then(() => {
635
672
  this._initialized = !0;
@@ -0,0 +1 @@
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-DhiAuSjM.cjs"),r=require("./booleanish-BF8l4scU.cjs"),i=require("./utils-63cRpWut.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(E(e.target))},te=e=>{T(E(e.target))},ne=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()}})},re=e=>{let t=f.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},ie=(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),ne(t),t.addEventListener(`reset`,re),t.addEventListener(`input`,ee),t.addEventListener(`change`,te)}u.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),T(t)}},E=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=E(t)),t},D=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},O=(e,t,n)=>{let r=f.get(e);return r&&r.size&&r.forEach(e=>{c.get(e)[n]()||(t=!1)}),t},k=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),ie(e,i,n)}return t};function A(){return typeof MutationObserver<`u`}var j={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`},ae=(e,t)=>{for(let n in j){t[n]=null;let r=null,i=j[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?b(e,i,n):m.set(e,t)}})}},oe=(e,t)=>{s.set(t,[]),F.observe?.(e,P)};function M(e){let t=c.get(e),{form:n}=t;ie(e,n,t),w(e,t.labels)}var N=(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()},P={attributes:!0,attributeFilter:[`disabled`,`name`]},F=A()?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`&&N(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=c.get(e),n=p.get(e);t.setFormValue(n)}}}):{};function I(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&&M(e),m.has(e)){let t=m.get(e);Object.keys(j).filter(e=>t[e]!==null).forEach(n=>{b(e,j[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;)M(r),r=n.nextNode()}e.localName===`fieldset`&&(F.observe?.(e,P),N(e,!0))}),i.forEach(e=>{let t=c.get(e);t&&s.get(t)&&S(t),d.has(e)&&d.get(e).disconnect()})})}function se(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=_.get(e.target);c.has(t)&&k(t),n.disconnect()})})}var ce=e=>{let t=new MutationObserver(se);window?.ShadyDOM?.inUse&&e.mode&&e.host&&(e=e.host),t.observe?.(e,{childList:!0}),_.set(e,t)};A()&&new MutationObserver(I);var L={childList:!0,subtree:!0},le=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)}},ue=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),de=(e,t,n)=>(e.valid=fe(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&T(n),e),fe=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},R=new WeakMap;function z(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}var B=class extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);R.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=R.get(this),r=`state${e}`;return n.isConnected?z(n,r):setTimeout(()=>{z(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=R.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}},pe=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},V=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)},H,me=class{constructor(e){H.set(this,void 0),pe(this,H,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 V(this,H,`f`).length}[(H=new WeakMap,Symbol.iterator)](){return V(this,H,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}};function he(){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 O(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return O(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 me(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}var U=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 le;this.states=new B(e),a.set(this,e),o.set(this,n),c.set(e,this),ae(e,this),oe(e,this),Object.seal(this),t instanceof DocumentFragment&&ce(t)}checkValidity(){let e=a.get(this);if(D(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);D(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=E(e)),t}get labels(){let e=a.get(this);D(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(D(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(D(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(D(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&&ue(i);let c={...i,...s};delete c.valid;let{valid:u}=de(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 D(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 D(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 D(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 ge(){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 W=!1,G=!1;function K(e){G||(G=!0,window.CustomStateSet=B,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new B(this),n}))}function _e(e=!0){let t=!1;if(!W){if(W=!0,typeof window<`u`&&(window.ElementInternals=U),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=k(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 U(this)}),typeof Element<`u`){function n(...t){let n=e.apply(this,t);if(h.set(this,n),A()){let e=new MutationObserver(I);window.ShadyDOM?e.observe(this,L):e.observe(n,L),d.set(this,e)}return n}let e=Element.prototype.attachShadow;Element.prototype.attachShadow=n}A()&&typeof document<`u`&&new MutationObserver(I).observe(document.documentElement,L),typeof HTMLFormElement<`u`&&he(),(e||typeof window<`u`&&!window.CustomStateSet)&&K()}}customElements.polyfillWrapFlushCallback||(ge()?typeof window<`u`&&!window.CustomStateSet&&K(HTMLElement.prototype.attachInternals):_e(!1));var q=`on`,J=`--checked`,Y=`,`,X=e=>e===!0||e===``||e===`true`,Z=new WeakMap,ve=0,ye=e=>{let t=Z.get(e);return t||(t=e.id||`form${++ve}`,Z.set(e,t)),t},Q=()=>!!globalThis.ElementInternals?.isPolyfilled,$=class e extends n.t{static get formAssociated(){return!0}get form(){let e=this.getAttribute(`form`);if(e!==null){if(!e)return null;let t=this.getRootNode(),n=typeof t.getElementById==`function`?t.getElementById(e):this.ownerDocument?.getElementById(e);return n instanceof HTMLFormElement?n:null}return this.internals?.form??this.closest(`form`)}get ariaDescribedBy(){return this.ariaDescribedby}set ariaDescribedBy(e){this.ariaDescribedby=e}formDisabledCallback(e){this.formDisabled=e}get isDisabled(){return this.disabled||this.formDisabled}get optionGroup(){return this.groupContext}setGroupValidity(e){this.groupValidityMessage!==e&&(this.groupValidityMessage=e,this.inputRef?.value&&this.manageValidity(this.inputRef.value))}syncGroupName(){let e=this.optionGroup?.name;if(!e)return;let t=!this.name||this.name===this.derivedName;t&&this.name!==e&&(this.name=e),t&&(this.derivedName=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=i.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.formDisabled=!1,this.derivedName=null,this.groupValidityMessage=``,this.touched=!1,this._initialized=!1,this.polyfillFormValue=null,this._didInitDerivedState=!1,this._defaultCheckedState=!1,this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),Q()&&queueMicrotask(()=>{this.isConnected&&this.polyfillFormValue&&this.internals.setFormValue(this.polyfillFormValue.value)})}get internalName(){let e=this.form;return e?`${this.name}-internal-${ye(e)}`:`${this.name}-internal`}formAssociatedCallback(){this.requestUpdate()}writeFormValue(e){this.internals.setFormValue(e),Q()&&(this.polyfillFormValue={value:e})}manageValidity(e,n){if(!e){console.warn(`manageValidity called without valid input element`);return}let r=this.pktStrings.get(`validation`);(this.isCheckable?this.checkableValueMissing(n??this.checkableGroup()):this.required&&!this.value)?this.internals.setValidity(this.groupValidityMessage?{valueMissing:!0,customError:!0}:{valueMissing:!0},this.groupValidityMessage||r.valueMissing,e):e.validity?.typeMismatch||e.validity?.badInput?this.internals.setValidity({typeMismatch:!0},r.typeMismatch,e):e.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.patternMismatch,e):e.validity?.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.tooShort,e):e.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.tooLong,e):e.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?t.t(r.rangeUnderflowMin,{min:this.min.toString()}):r.rangeUnderflow,e):e.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.typeMismatch,e):e.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?t.t(r.rangeOverflowMax,{max:this.max.toString()}):r.rangeOverflow,e):e.validity?.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.groupValidityMessage?this.internals.setValidity({customError:!0},this.groupValidityMessage,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.writeFormValue(t)}else this.writeFormValue(e)}}radioGroupMembers(){let e=this.getRootNode();if(typeof e.querySelectorAll!=`function`)return[];let t=this.form;return Array.from(e.querySelectorAll(`pkt-radiobutton, input[type="radio"]`)).filter(e=>e!==this&&e.getAttribute(`name`)===this.name&&e.form===t)}get isCheckable(){return this.type===`checkbox`||this.type===`radio`}checkableGroup(){return this.type===`radio`?[this,...this.radioGroupMembers()]:[this]}get isRequired(){return this.required||this.type===`radio`&&!!this.optionGroup?.required}checkableValueMissing(t){return this.type===`radio`?t.some(t=>t instanceof e?t.isRequired:t.required)&&!t.some(e=>X(e.checked)):this.required&&!X(this.checked)}syncCheckedState(){if(!this.internals)return;let e=X(this.checked);this.internals.ariaChecked=String(e),e?(this.writeFormValue((typeof this.value==`string`?this.value:``)||q),this.internals.states?.add(J)):(this.writeFormValue(null),this.internals.states?.delete(J)),this.inputRef?.value&&this.inputRef.value.checked!==e&&(this.inputRef.value.checked=e)}validateCheckable(){let t=this.checkableGroup();t.forEach(n=>{if(!(n instanceof e))return;let r=n;r.inputRef?.value&&r.manageValidity(r.inputRef.value,t)})}coordinateRadioGroup(){!this.name||this.type!==`radio`||this.radioGroupMembers().forEach(t=>{t instanceof e?X(t.checked)&&(t.checked=!1,t.syncCheckedState()):t.checked&&=!1})}valueChecked(e){this.touched&&(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?this.checked=e===`true`:typeof e==`boolean`&&(this.checked=e),this.syncCheckedState(),this.validateCheckable(),this.onInput(),this.dispatchChangeEvents(this.checked))}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(Y)&&(e=e.split(Y)),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(Y)?e.split(Y):!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=this._defaultCheckedState,this.syncCheckedState(),this.validateCheckable();else{this.writeFormValue(``);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),this.isCheckable&&this._initialized&&(e.has(`defaultChecked`)&&e.get(`defaultChecked`)!==void 0&&(this._defaultCheckedState=!!this.defaultChecked),e.has(`groupContext`)&&this.isRequired&&(this.internals.ariaRequired=`true`),[`checked`,`value`,`required`,`name`,`groupContext`].some(t=>e.has(t))&&(this.syncCheckedState(),this.validateCheckable())),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`)))}willUpdate(e){super.willUpdate(e),this.syncGroupName(),!this._didInitDerivedState&&(this._didInitDerivedState=!0,this.defaultChecked&&(this.checked=!0),this.id&&!this.name&&(this.name=this.id,this.derivedName=this.id),this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null))}firstUpdated(e){if(super.firstUpdated(e),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.isRequired&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.checked!==void 0){let e=X(this.checked);this._defaultCheckedState=e,this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||q:null;this.writeFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.isCheckable?this.validateCheckable():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:r.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:r.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:r.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),e.n([e.l()],$.prototype,`formDisabled`,void 0),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-D7sTqOr3.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./alert-IaZzEgyI.cjs");const i=require("./icon-Dnv6LtPC.cjs"),a=require("./if-defined-2mkIDgOm.cjs"),o=require("./utils-63cRpWut.cjs");require("./helptext-BCkwSz1m.cjs");const s=require("./focus-modality-controller-C1ocyv2J.cjs");var c=e=>{let t=[];return e.hasHelptext&&t.push(`${e.id}-helptext`),e.hasCounter&&t.push(`${e.id}-counter-status`),e.ariaDescribedby&&t.push(e.ariaDescribedby),t.length?t.join(` `):void 0},l=e=>`${e}-counter-status`,u=(e,t)=>!!t&&t>0&&(e??0)>t,d={name:`pkt-input-wrapper`,react:`PktInputWrapper`,"css-class":`pkt-inputwrapper`,isElement:!0,isPureReact:!0,"dark-mode":!0,events:{toggleHelpText:{description:`Event for å vise eller skjule hjelpetekst i dropdown`}},slots:{default:{description:`Innholdet i input-wrapperen, som kan være et skjemaelement eller en annen komponent`}},props:{forId:{name:`For ID`,description:`Id-en til skjemaelementet som dette wrapper rundt`,type:`string`,required:!0,category:`tech`},label:{name:`Merkelapp`,description:`Merkelapp for skjemaelementet`,type:`string`,required:!0,category:`contents`},helptext:{name:`Hjelpetekst`,description:`Hjelpetekst for skjemaelementet`,type:`string`,category:`contents`},helptextDropdown:{name:`Hjelpetekst i dropdown`,description:`Hjelpetekst som vises i ekspanderende felt`,type:`string`,category:`contents`},helptextDropdownButton:{name:`Tekst i hjelpetekst-knapp`,description:`Tekst som vises i knappen for å vise hjelpetekst i dropdown`,default:`Les mer <span class='pkt-sr-only'>om feltet</span>`,type:`string`,category:`contents`},ariaDescribedby:{name:`aria-describedby`,description:`Id-en til elementet som beskriver skjemaelementet`,type:`string`,category:`accessibility`},counter:{name:`Teller`,description:`Teller for antall tegn i skjemaelementet`,type:`boolean`,default:!1,category:`ui`},counterCurrent:{name:`Tellerverdi`,description:`Tellerens nåværende verdi`,type:`number`,category:`ui`,showIf:{counter:!0}},counterMaxLength:{name:`Maks tegn i teller`,description:`Maks antall tegn som kan skrives i skjemaelementet`,type:`number`,category:`ui`,showIf:{counter:!0}},counterPosition:{name:`Tellerplassering`,description:`Telleren sin plassering i forhold til elementet`,type:[`top`,`bottom`],default:`bottom`,category:`ui`,showIf:{counter:!0}},optionalTag:{name:`Vise valgfritt-merking`,description:`Viser en merking som indikerer at feltet er valgfritt`,type:`boolean`,default:!1,category:`ui`},optionalText:{name:`Valgfritt-tekst`,description:`Tekst som vises i valgfritt-merkingen`,type:`string`,default:`Valgfritt`,category:`contents`},requiredTag:{name:`Vise påkrevd-merking`,description:`Viser en merking som indikerer at feltet er påkrevd`,type:`boolean`,default:!1,category:`ui`},requiredText:{name:`Påkrevd-tekst`,description:`Tekst som vises i påkrevd-merkingen`,type:`string`,default:`Må fylles ut`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},hasError:{name:`Feil`,description:`Indikerer at skjemaelementet har en feil`,type:`boolean`,default:!1,category:`ui`},errorMessage:{name:`Feilmelding`,description:`Feilmelding som vises når skjemaelementet har en feil`,type:`string`,category:`contents`},disabled:{name:`Deaktivert`,description:`Indikerer at skjemaelementet er deaktivert`,type:`boolean`,default:!1,category:`tech`},inline:{name:`Inline`,description:`Indikerer at skjemaelementet skal flyte sammen med sidens innhold`,type:`boolean`,default:!1,category:`ui`},hasFieldset:{name:`Er fieldset`,description:`Indikerer at innholdet er et fieldset`,type:`boolean`,default:!1,category:`ui`},layout:{name:`Layout`,description:`Retning for alternativene i en gruppe. Avstanden mellom dem følger størrelsen (16, 12 og 8px)`,type:[`vertical`,`horizontal`],default:`vertical`,category:`ui`},useWrapper:{name:`Bruk wrapper`,description:`Indikerer om skjemaelementet skal bruke en wrapper`,type:`boolean`,displayAsFalse:!0,default:!0,category:`ui`},role:{name:`Rolle`,description:`ARIA-rolle på wrapperen. Settes ikke som standard. Bruk hasFieldset for reelle grupper.`,type:`string`,default:null,category:`accessibility`},size:{name:`Størrelse`,description:`Visuell størrelse. small: kompakt wrapper og felt (42px). xsmall: samme wrapper som small, felt 36px.`,attribute:`input-wrapper-size`,type:[`small`,`medium`,`xsmall`],default:`medium`,category:`ui`}}},f=class extends n.t{constructor(...e){super(...e),this.forId=o.n(),this.label=``,this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=d.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition=`bottom`,this.optionalTag=d.props.optionalTag.default,this.requiredTag=d.props.requiredTag.default,this.tagText=null,this.hasError=d.props.hasError.default,this.errorMessage=``,this.disabled=d.props.disabled.default,this.inline=d.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=d.props.hasFieldset.default,this.layout=d.props.layout.default,this.role=null,this.useWrapper=d.props.useWrapper.default,this.size=`medium`,this.focusModality=new s.t(this)}updated(e){super.updated(e),this.classList.add(`pkt-inputwrapper`),this.classList.toggle(`pkt-inputwrapper--error`,this.hasError),this.classList.toggle(`pkt-inputwrapper--disabled`,this.disabled),this.classList.toggle(`pkt-inputwrapper--inline`,this.inline),this.classList.toggle(`pkt-inputwrapper--medium`,this.size===`medium`),this.classList.toggle(`pkt-inputwrapper--small`,this.size===`small`),this.classList.toggle(`pkt-inputwrapper--xsmall`,this.size===`xsmall`),this.role?this.setAttribute(`aria-labelledby`,`${this.forId}-label`):this.removeAttribute(`aria-labelledby`)}render(){let r=`pkt-tag pkt-tag--small pkt-tag--thin-text`,o=!!this.helptext||this.hasSlotContent(`helptext`),s=new Set([this.ariaDescribedby||(o?`${this.forId}-helptext`:``),this.hasError&&this.errorMessage?`${this.forId}-error`:``].join(` `).split(` `).filter(Boolean)),c=s.size?[...s].join(` `):e.h,d=this.pktStrings.get(`forms`),f=()=>e._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-DhiAuSjM.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./alert-QfloIr-o.cjs");const i=require("./icon-jPhyZD1z.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./utils-63cRpWut.cjs");require("./helptext-C7cyihnu.cjs");const s=require("./focus-modality-controller-C1ocyv2J.cjs");var c=e=>{let t=[];return e.hasHelptext&&t.push(`${e.id}-helptext`),e.hasCounter&&t.push(`${e.id}-counter-status`),e.ariaDescribedby&&t.push(e.ariaDescribedby),t.length?t.join(` `):void 0},l=e=>`${e}-counter-status`,u=(e,t)=>!!t&&t>0&&(e??0)>t,d={name:`pkt-input-wrapper`,react:`PktInputWrapper`,"css-class":`pkt-inputwrapper`,isElement:!0,isPureReact:!0,"dark-mode":!0,events:{toggleHelpText:{description:`Event for å vise eller skjule hjelpetekst i dropdown`}},slots:{default:{description:`Innholdet i input-wrapperen, som kan være et skjemaelement eller en annen komponent`}},props:{forId:{name:`For ID`,description:`Id-en til skjemaelementet som dette wrapper rundt`,type:`string`,required:!0,category:`tech`},label:{name:`Merkelapp`,description:`Merkelapp for skjemaelementet`,type:`string`,required:!0,category:`contents`},helptext:{name:`Hjelpetekst`,description:`Hjelpetekst for skjemaelementet`,type:`string`,category:`contents`},helptextDropdown:{name:`Hjelpetekst i dropdown`,description:`Hjelpetekst som vises i ekspanderende felt`,type:`string`,category:`contents`},helptextDropdownButton:{name:`Tekst i hjelpetekst-knapp`,description:`Tekst som vises i knappen for å vise hjelpetekst i dropdown`,default:`Les mer <span class='pkt-sr-only'>om feltet</span>`,type:`string`,category:`contents`},ariaDescribedby:{name:`aria-describedby`,description:`Id-en til elementet som beskriver skjemaelementet`,type:`string`,category:`accessibility`},counter:{name:`Teller`,description:`Teller for antall tegn i skjemaelementet`,type:`boolean`,default:!1,category:`ui`},counterCurrent:{name:`Tellerverdi`,description:`Tellerens nåværende verdi`,type:`number`,category:`ui`,showIf:{counter:!0}},counterMaxLength:{name:`Maks tegn i teller`,description:`Maks antall tegn som kan skrives i skjemaelementet`,type:`number`,category:`ui`,showIf:{counter:!0}},counterPosition:{name:`Tellerplassering`,description:`Telleren sin plassering i forhold til elementet`,type:[`top`,`bottom`],default:`bottom`,category:`ui`,showIf:{counter:!0}},optionalTag:{name:`Vise valgfritt-merking`,description:`Viser en merking som indikerer at feltet er valgfritt`,type:`boolean`,default:!1,category:`ui`},optionalText:{name:`Valgfritt-tekst`,description:`Tekst som vises i valgfritt-merkingen`,type:`string`,default:`Valgfritt`,category:`contents`},requiredTag:{name:`Vise påkrevd-merking`,description:`Viser en merking som indikerer at feltet er påkrevd`,type:`boolean`,default:!1,category:`ui`},requiredText:{name:`Påkrevd-tekst`,description:`Tekst som vises i påkrevd-merkingen`,type:`string`,default:`Må fylles ut`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},hasError:{name:`Feil`,description:`Indikerer at skjemaelementet har en feil`,type:`boolean`,default:!1,category:`ui`},errorMessage:{name:`Feilmelding`,description:`Feilmelding som vises når skjemaelementet har en feil`,type:`string`,category:`contents`},disabled:{name:`Deaktivert`,description:`Indikerer at skjemaelementet er deaktivert. Med hasFieldset blir fieldset deaktivert, slik at alle skjemaelementene i den blir deaktivert, som med <fieldset disabled>`,type:`boolean`,default:!1,category:`tech`},inline:{name:`Inline`,description:`Indikerer at skjemaelementet skal flyte sammen med sidens innhold`,type:`boolean`,default:!1,category:`ui`},hasFieldset:{name:`Er fieldset`,description:`Indikerer at innholdet er et fieldset`,type:`boolean`,default:!1,category:`ui`},layout:{name:`Layout`,description:`Retning for alternativene i en gruppe. Avstanden mellom dem følger størrelsen (16, 12 og 8px)`,type:[`vertical`,`horizontal`],default:`vertical`,category:`ui`},useWrapper:{name:`Bruk wrapper`,description:`Indikerer om skjemaelementet skal bruke en wrapper`,type:`boolean`,displayAsFalse:!0,default:!0,category:`ui`},role:{name:`Rolle`,description:`ARIA-rolle på wrapperen. Settes ikke som standard. Bruk hasFieldset for reelle grupper.`,type:`string`,default:null,category:`accessibility`},size:{name:`Størrelse`,description:`Visuell størrelse. small: kompakt wrapper og felt (42px). xsmall: samme wrapper som small, felt 36px.`,attribute:`input-wrapper-size`,type:[`small`,`medium`,`xsmall`],default:`medium`,category:`ui`}}},f=class extends n.t{constructor(...e){super(...e),this.forId=o.n(),this.label=``,this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=d.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition=`bottom`,this.optionalTag=d.props.optionalTag.default,this.requiredTag=d.props.requiredTag.default,this.tagText=null,this.hasError=d.props.hasError.default,this.errorMessage=``,this.disabled=d.props.disabled.default,this.inline=d.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=d.props.hasFieldset.default,this.layout=d.props.layout.default,this.role=null,this.useWrapper=d.props.useWrapper.default,this.size=`medium`,this.focusModality=new s.t(this)}updated(e){super.updated(e),this.classList.add(`pkt-inputwrapper`),this.classList.toggle(`pkt-inputwrapper--error`,this.hasError),this.classList.toggle(`pkt-inputwrapper--disabled`,this.disabled),this.classList.toggle(`pkt-inputwrapper--inline`,this.inline),this.classList.toggle(`pkt-inputwrapper--medium`,this.size===`medium`),this.classList.toggle(`pkt-inputwrapper--small`,this.size===`small`),this.classList.toggle(`pkt-inputwrapper--xsmall`,this.size===`xsmall`),this.role?this.setAttribute(`aria-labelledby`,`${this.forId}-label`):this.removeAttribute(`aria-labelledby`)}render(){let r=`pkt-tag pkt-tag--small pkt-tag--thin-text`,o=!!this.helptext||this.hasSlotContent(`helptext`),s=new Set([this.ariaDescribedby||(o?`${this.forId}-helptext`:``),this.hasError&&this.errorMessage?`${this.forId}-error`:``].join(` `).split(` `).filter(Boolean)),c=s.size?[...s].join(` `):e.h,d=this.pktStrings.get(`forms`),f=()=>e._`
2
2
  ${this.tagText?e._`<span class=${r+` pkt-tag--gray`}>${this.tagText}</span>`:e.h}
3
3
  ${this.optionalTag?e._`<span class=${r+` pkt-tag--blue-light`}
4
4
  >${this.optionalText??d.optional}</span
@@ -54,6 +54,10 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./format-B8meU8Tm.cjs"),n=r
54
54
  <div class=${this.optionsClass()}>${n.i(this)}</div>
55
55
  ${this.counterPosition===`bottom`?h():e.h}
56
56
  ${g()}
57
- `;return this.hasFieldset?e._`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${c}">
57
+ `;return this.hasFieldset?e._`<fieldset
58
+ class="pkt-inputwrapper__fieldset"
59
+ aria-describedby="${c}"
60
+ ?disabled=${this.disabled}
61
+ >
58
62
  ${_()}
59
63
  </fieldset>`:e._`<div class="pkt-inputwrapper__fieldset">${_()}</div>`}optionsClass(){return!this.hasFieldset&&this.layout!==`horizontal`?`pkt-contents`:this.layout===`horizontal`?`pkt-inputwrapper__options pkt-inputwrapper__options--horizontal`:`pkt-inputwrapper__options`}toggleDropdown(e){this.dispatchEvent(new CustomEvent(`toggleHelpText`,{bubbles:!1,detail:{isOpen:e.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent(`labelClick`,{bubbles:!0,composed:!0,detail:`label clicked`}))}};e.n([e.u({type:String})],f.prototype,`forId`,void 0),e.n([e.u({type:String})],f.prototype,`label`,void 0),e.n([e.u({type:String})],f.prototype,`helptext`,void 0),e.n([e.u({type:String})],f.prototype,`helptextDropdown`,void 0),e.n([e.u({type:String})],f.prototype,`helptextDropdownButton`,void 0),e.n([e.u({type:Boolean})],f.prototype,`counter`,void 0),e.n([e.u({type:Number})],f.prototype,`counterCurrent`,void 0),e.n([e.u({type:Number})],f.prototype,`counterMaxLength`,void 0),e.n([e.u({type:String})],f.prototype,`counterError`,void 0),e.n([e.u({type:String,reflect:!1})],f.prototype,`counterPosition`,void 0),e.n([e.u({type:Boolean})],f.prototype,`optionalTag`,void 0),e.n([e.u({type:String})],f.prototype,`optionalText`,void 0),e.n([e.u({type:Boolean})],f.prototype,`requiredTag`,void 0),e.n([e.u({type:String})],f.prototype,`requiredText`,void 0),e.n([e.u({type:String})],f.prototype,`tagText`,void 0),e.n([e.u({type:Boolean})],f.prototype,`hasError`,void 0),e.n([e.u({type:String})],f.prototype,`errorMessage`,void 0),e.n([e.u({type:Boolean})],f.prototype,`disabled`,void 0),e.n([e.u({type:Boolean})],f.prototype,`inline`,void 0),e.n([e.u({type:String})],f.prototype,`ariaDescribedby`,void 0),e.n([e.u({type:Boolean})],f.prototype,`hasFieldset`,void 0),e.n([e.u({type:String})],f.prototype,`layout`,void 0),e.n([e.u({type:String,reflect:!0})],f.prototype,`role`,void 0),e.n([e.u({type:Boolean,reflect:!0,converter:r.t})],f.prototype,`useWrapper`,void 0),e.n([e.u({type:String,attribute:`input-wrapper-size`})],f.prototype,`size`,void 0);try{e.d(`pkt-input-wrapper`)(f)}catch{console.warn(`Forsøker å definere <pkt-input-wrapper>, men den er allerede definert`)}var p=f;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
@@ -1,12 +1,12 @@
1
- import { _ as e, d as t, h as n, n as r, u as i } from "./element-mwwC2Rra.js";
1
+ import { _ as e, d as t, h as n, n as r, u as i } from "./element-DBugHPKM.js";
2
2
  import { t as a } from "./format-BTeSVkED.js";
3
- import { i as o, n as s, t as c } from "./element-with-slot-DQv0cbbD.js";
3
+ import { i as o, n as s, t as c } from "./element-with-slot-DDLS-aLw.js";
4
4
  import { t as l } from "./booleanish-OQJTYSrw.js";
5
- import "./alert-C0PiYnot.js";
6
- import { r as u } from "./icon-JigbxxF7.js";
7
- import { t as d } from "./if-defined-Bebu3LXY.js";
5
+ import "./alert-CAPiwi4F.js";
6
+ import { r as u } from "./icon-Bao96Zb8.js";
7
+ import { t as d } from "./if-defined-O59_I-e-.js";
8
8
  import { n as f } from "./utils-BwF4QSrq.js";
9
- import "./helptext-DCT_9dw1.js";
9
+ import "./helptext-DadLkcoO.js";
10
10
  import { t as p } from "./focus-modality-controller-Dc2S-KqR.js";
11
11
  //#region ../../shared-utils/forms/described-by.ts
12
12
  var m = (e) => {
@@ -139,7 +139,7 @@ var m = (e) => {
139
139
  },
140
140
  disabled: {
141
141
  name: "Deaktivert",
142
- description: "Indikerer at skjemaelementet er deaktivert",
142
+ description: "Indikerer at skjemaelementet er deaktivert. Med hasFieldset blir fieldset deaktivert, slik at alle skjemaelementene i den blir deaktivert, som med <fieldset disabled>",
143
143
  type: "boolean",
144
144
  default: !1,
145
145
  category: "tech"
@@ -273,7 +273,11 @@ var m = (e) => {
273
273
  ${this.counterPosition === "bottom" ? _() : n}
274
274
  ${v()}
275
275
  `;
276
- return this.hasFieldset ? e`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${c}">
276
+ return this.hasFieldset ? e`<fieldset
277
+ class="pkt-inputwrapper__fieldset"
278
+ aria-describedby="${c}"
279
+ ?disabled=${this.disabled}
280
+ >
277
281
  ${y()}
278
282
  </fieldset>` : e`<div class="pkt-inputwrapper__fieldset">${y()}</div>`;
279
283
  }
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./element-with-slot-D7sTqOr3.cjs");require("./icon-Dnv6LtPC.cjs");const r=require("./define-component-spec-DBNd2FJY.cjs");var i={href:{type:`string`,description:`Mål-URL for lenken.`,required:!0,reactOnly:!0},className:{type:`string`,description:`CSS-klasser Punkt har satt på lenken.`,required:!0,reactOnly:!0},children:{type:`ReactNode`,description:`Innhold/label som skal rendres inni lenken.`,required:!0,reactOnly:!0},props:{type:`AnchorHTMLAttributes<HTMLAnchorElement>`,description:`Resten av anchor-attributter (f.eks. <code>onClick</code>, <code>aria-*</code>) som skal spreades på lenken.`,required:!0,reactOnly:!0}},a={name:`Egendefinert lenkekomponent`,description:`React: Funksjon for å rendre en egendefinert lenkekomponent (f.eks. Next.js Link eller React Router Link). Mottar et <code>IRenderLink</code>-objekt med href, className, children og props. Standard er et vanlig <code>&lt;a&gt;</code>-element.`,type:`(args: IRenderLink) => ReactNode`,relatedTypes:[`IRenderLink`],category:`tech`,reactOnly:!0},o={IRenderLink:{title:`IRenderLink`,description:`Objektet som sendes til <code>renderLink</code> i Link, BackLink og Breadcrumbs. Kun React — brukes til å bytte ut standard <code>&lt;a&gt;</code> med f.eks. Next.js Link eller React Router Link.`,properties:i}},s=r.t({name:`pkt-link`,react:`PktLink`,"css-class":`pkt-link`,"dark-mode":!0,isElement:!0,props:{href:{name:`URL`,description:`URL til lenken`,type:`string`,default:`#`,category:`contents`},target:{name:`Mål`,description:`Mål for lenken`,type:[`_blank`,`_self`,`_parent`,`_top`],default:`_self`,category:`tech`},iconName:{name:`Ikon`,description:`Ikon som skal vises ved siden av lenketeksten`,type:`icon`,category:`ui`},iconPosition:{name:`Ikonposisjon`,description:`Posisjonen til ikonet i forhold til lenketeksten`,type:[`left`,`right`],category:`ui`},renderLink:a},types:{...o},slots:{default:{description:`Innholdet i lenken`}}}).props,c=class extends n.t{constructor(...e){super(...e),this.href=s.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=s.target.default}render(){let r={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition===`left`||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition===`right`,"pkt-link--external":this.external},i=this.target&&this.target!==`_self`?this.target:e.h;return e._`<a
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-DhiAuSjM.cjs");require("./icon-jPhyZD1z.cjs");const r=require("./define-component-spec-DBNd2FJY.cjs");var i={href:{type:`string`,description:`Mål-URL for lenken.`,required:!0,reactOnly:!0},className:{type:`string`,description:`CSS-klasser Punkt har satt på lenken.`,required:!0,reactOnly:!0},children:{type:`ReactNode`,description:`Innhold/label som skal rendres inni lenken.`,required:!0,reactOnly:!0},props:{type:`AnchorHTMLAttributes<HTMLAnchorElement>`,description:`Resten av anchor-attributter (f.eks. <code>onClick</code>, <code>aria-*</code>) som skal spreades på lenken.`,required:!0,reactOnly:!0}},a={name:`Egendefinert lenkekomponent`,description:`React: Funksjon for å rendre en egendefinert lenkekomponent (f.eks. Next.js Link eller React Router Link). Mottar et <code>IRenderLink</code>-objekt med href, className, children og props. Standard er et vanlig <code>&lt;a&gt;</code>-element.`,type:`(args: IRenderLink) => ReactNode`,relatedTypes:[`IRenderLink`],category:`tech`,reactOnly:!0},o={IRenderLink:{title:`IRenderLink`,description:`Objektet som sendes til <code>renderLink</code> i Link, BackLink og Breadcrumbs. Kun React — brukes til å bytte ut standard <code>&lt;a&gt;</code> med f.eks. Next.js Link eller React Router Link.`,properties:i}},s=r.t({name:`pkt-link`,react:`PktLink`,"css-class":`pkt-link`,"dark-mode":!0,isElement:!0,props:{href:{name:`URL`,description:`URL til lenken`,type:`string`,default:`#`,category:`contents`},target:{name:`Mål`,description:`Mål for lenken`,type:[`_blank`,`_self`,`_parent`,`_top`],default:`_self`,category:`tech`},iconName:{name:`Ikon`,description:`Ikon som skal vises ved siden av lenketeksten`,type:`icon`,category:`ui`},iconPosition:{name:`Ikonposisjon`,description:`Posisjonen til ikonet i forhold til lenketeksten`,type:[`left`,`right`],category:`ui`},renderLink:a},types:{...o},slots:{default:{description:`Innholdet i lenken`}}}).props,c=class extends n.t{constructor(...e){super(...e),this.href=s.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=s.target.default}render(){let r={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition===`left`||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition===`right`,"pkt-link--external":this.external},i=this.target&&this.target!==`_self`?this.target:e.h;return e._`<a
2
2
  class=${t.t(r)}
3
3
  href=${this.href}
4
4
  target=${i}
@@ -1,7 +1,7 @@
1
- import { _ as e, d as t, h as n, n as r, u as i } from "./element-mwwC2Rra.js";
2
- import { t as a } from "./class-map-C4hdfSfY.js";
3
- import { i as o, t as s } from "./element-with-slot-DQv0cbbD.js";
4
- import "./icon-JigbxxF7.js";
1
+ import { _ as e, d as t, h as n, n as r, u as i } from "./element-DBugHPKM.js";
2
+ import { t as a } from "./class-map-Bf-QzUpN.js";
3
+ import { i as o, t as s } from "./element-with-slot-DDLS-aLw.js";
4
+ import "./icon-Bao96Zb8.js";
5
5
  import { t as c } from "./define-component-spec-BYOSeplU.js";
6
6
  //#endregion
7
7
  //#region src/components/link/link.ts
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./element-with-slot-D7sTqOr3.cjs");require("./icon-Dnv6LtPC.cjs");const n=require("./if-defined-2mkIDgOm.cjs");var r=class extends t.t{constructor(...e){super(...e),this.title=``,this.href=`#`,this.iconName=``,this.external=!1,this.openInNewTab=!1,this.skin=void 0}render(){let r=[`pkt-linkcard`,this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(` `),i=[`pkt-linkcard__title`,this.external&&`pkt-link pkt-link--external`].filter(Boolean).join(` `),a=this.pktStrings.get(`linkcard`),o=this.openInNewTab?a.openInNewTab:``;return e._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-DhiAuSjM.cjs");require("./icon-jPhyZD1z.cjs");const n=require("./if-defined-CiML3MTM.cjs");var r=class extends t.t{constructor(...e){super(...e),this.title=``,this.href=`#`,this.iconName=``,this.external=!1,this.openInNewTab=!1,this.skin=void 0}render(){let r=[`pkt-linkcard`,this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(` `),i=[`pkt-linkcard__title`,this.external&&`pkt-link pkt-link--external`].filter(Boolean).join(` `),a=this.pktStrings.get(`linkcard`),o=this.openInNewTab?a.openInNewTab:``;return e._`
2
2
  <a
3
3
  href=${this.href}
4
4
  class=${r}
@@ -1,7 +1,7 @@
1
- import { _ as e, d as t, n, u as r } from "./element-mwwC2Rra.js";
2
- import { i, t as a } from "./element-with-slot-DQv0cbbD.js";
3
- import "./icon-JigbxxF7.js";
4
- import { t as o } from "./if-defined-Bebu3LXY.js";
1
+ import { _ as e, d as t, n, u as r } from "./element-DBugHPKM.js";
2
+ import { i, t as a } from "./element-with-slot-DDLS-aLw.js";
3
+ import "./icon-Bao96Zb8.js";
4
+ import { t as o } from "./if-defined-O59_I-e-.js";
5
5
  //#region src/components/linkcard/linkcard.ts
6
6
  var s = class extends a {
7
7
  constructor(...e) {
@@ -1,8 +1,8 @@
1
- import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-mwwC2Rra.js";
2
- import { t as s } from "./class-map-C4hdfSfY.js";
1
+ import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-DBugHPKM.js";
2
+ import { t as s } from "./class-map-Bf-QzUpN.js";
3
3
  import { t as c } from "./format-BTeSVkED.js";
4
- import { t as l } from "./if-defined-Bebu3LXY.js";
5
- import { t as u } from "./repeat-CdxGS-_3.js";
4
+ import { t as l } from "./if-defined-O59_I-e-.js";
5
+ import { t as u } from "./repeat-CV9S4zya.js";
6
6
  import { n as d } from "./utils-BwF4QSrq.js";
7
7
  //#region ../../shared-utils/combobox/option-utils.ts
8
8
  var f = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label === t)) || null, p = (e, t) => {
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./if-defined-2mkIDgOm.cjs"),i=require("./repeat-Dh9YKoeV.cjs"),a=require("./utils-63cRpWut.cjs");var o=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,s=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},c=e=>e.value+(e.label||``)+(e.prefix||``),l=(e,t)=>(e.fulltext||c(e)).toLowerCase().includes(t),u=(e,t)=>{if(!t)return[...e];let n=t.toLowerCase();return e.filter(e=>l(e,n))},d=(e,t)=>t!==null&&e>=t,f=(e,t)=>{if(!e)return``;switch(t){case`prefixAndValue`:return`${e.prefix||``} ${e.value}`.trim();case`value`:return e.value;default:return e.label||e.value}},p=(e,t)=>{if(!t)return{filtered:[...e],suggestion:null};let n=t.toLowerCase(),r=e.filter(e=>l(e,n));return{filtered:r,suggestion:r.find(e=>!e.selected&&e.label?.toLowerCase().startsWith(n))||null}},m=(e,t,n,r)=>{if(!e.trim())return{addValueText:null,userInfoMessage:``};let i=e.trim().toLowerCase(),a=t.find(e=>e.toLowerCase()===i),o=n.filter(e=>e.label?.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)),s=o.find(e=>e.label?.toLowerCase()===i||e.value.toLowerCase()===i);return(o.length===0||!s)&&r?{addValueText:e,userInfoMessage:``}:o.length===0&&!r?{addValueText:null,userInfoMessage:`noResults`}:a?{addValueText:null,userInfoMessage:`alreadySelected`}:{addValueText:null,userInfoMessage:``}},h=e=>/^[\p{L} ]$/u.test(e),g=(e=500)=>{let t=``,n;return{append:r=>(t+=r.toLowerCase(),n!==void 0&&clearTimeout(n),n=setTimeout(()=>{t=``},e),t),reset:()=>{t=``,n!==void 0&&(clearTimeout(n),n=void 0)},getBuffer:()=>t}},_=(e,t)=>{let n=t.toLowerCase();return e.findIndex(e=>e.textContent?.trim().toLowerCase().startsWith(n))},v=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},y=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),b=e=>{let t=e.nextElementSibling;t&&v(t)},x=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&v(e)}else r&&v(r)},S=e=>{let t=y(e);t[0]&&v(t[0])},C=e=>{let t=y(e),n=t[t.length-1];n&&v(n)},w=(e,t)=>{if(t.disabled)return;let n=y(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){v(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r){v(r);return}if(t.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){let t=e.querySelector(`[role="searchbox"]`);if(t){window.setTimeout(()=>t.focus(),0);return}}n[0]&&v(n[0])},T=class extends e.t{constructor(...e){super(...e),this.id=a.n(),this._listboxId=a.n(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this.typeahead=g(),this._filteredOptions=[]}connectedCallback(){super.connectedCallback();let e=this.getAttribute(`id`);e?this.adoptHostId(e):this.id&&(this._listboxId=this.id),this.includeSearch&&!this.searchValue&&(this.searchValue=``),this.options.length>0&&this.filterOptions(),this.setAttribute(`tabindex`,`-1`),this.addEventListener(`focus`,this.focusFirstOrSelectedOption)}disconnectedCallback(){super.disconnectedCallback(),this.typeahead.reset()}attributeChangedCallback(e,t,n){(e===`options`||e===`search-value`)&&this.filterOptions(),super.attributeChangedCallback(e,t,n),e===`id`&&n&&this.adoptHostId(n)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}adoptHostId(e){this._listboxId=e,this.removeAttribute(`id`)}willUpdate(e){super.willUpdate(e),(e.has(`options`)||e.has(`searchValue`))&&this.filterOptions()}render(){return e._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./if-defined-CiML3MTM.cjs"),i=require("./repeat-CnnigVcj.cjs"),a=require("./utils-63cRpWut.cjs");var o=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,s=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},c=e=>e.value+(e.label||``)+(e.prefix||``),l=(e,t)=>(e.fulltext||c(e)).toLowerCase().includes(t),u=(e,t)=>{if(!t)return[...e];let n=t.toLowerCase();return e.filter(e=>l(e,n))},d=(e,t)=>t!==null&&e>=t,f=(e,t)=>{if(!e)return``;switch(t){case`prefixAndValue`:return`${e.prefix||``} ${e.value}`.trim();case`value`:return e.value;default:return e.label||e.value}},p=(e,t)=>{if(!t)return{filtered:[...e],suggestion:null};let n=t.toLowerCase(),r=e.filter(e=>l(e,n));return{filtered:r,suggestion:r.find(e=>!e.selected&&e.label?.toLowerCase().startsWith(n))||null}},m=(e,t,n,r)=>{if(!e.trim())return{addValueText:null,userInfoMessage:``};let i=e.trim().toLowerCase(),a=t.find(e=>e.toLowerCase()===i),o=n.filter(e=>e.label?.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)),s=o.find(e=>e.label?.toLowerCase()===i||e.value.toLowerCase()===i);return(o.length===0||!s)&&r?{addValueText:e,userInfoMessage:``}:o.length===0&&!r?{addValueText:null,userInfoMessage:`noResults`}:a?{addValueText:null,userInfoMessage:`alreadySelected`}:{addValueText:null,userInfoMessage:``}},h=e=>/^[\p{L} ]$/u.test(e),g=(e=500)=>{let t=``,n;return{append:r=>(t+=r.toLowerCase(),n!==void 0&&clearTimeout(n),n=setTimeout(()=>{t=``},e),t),reset:()=>{t=``,n!==void 0&&(clearTimeout(n),n=void 0)},getBuffer:()=>t}},_=(e,t)=>{let n=t.toLowerCase();return e.findIndex(e=>e.textContent?.trim().toLowerCase().startsWith(n))},v=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},y=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),b=e=>{let t=e.nextElementSibling;t&&v(t)},x=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&v(e)}else r&&v(r)},S=e=>{let t=y(e);t[0]&&v(t[0])},C=e=>{let t=y(e),n=t[t.length-1];n&&v(n)},w=(e,t)=>{if(t.disabled)return;let n=y(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){v(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r){v(r);return}if(t.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){let t=e.querySelector(`[role="searchbox"]`);if(t){window.setTimeout(()=>t.focus(),0);return}}n[0]&&v(n[0])},T=class extends e.t{constructor(...e){super(...e),this.id=a.n(),this._listboxId=a.n(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this.typeahead=g(),this._filteredOptions=[]}connectedCallback(){super.connectedCallback();let e=this.getAttribute(`id`);e?this.adoptHostId(e):this.id&&(this._listboxId=this.id),this.includeSearch&&!this.searchValue&&(this.searchValue=``),this.options.length>0&&this.filterOptions(),this.setAttribute(`tabindex`,`-1`),this.addEventListener(`focus`,this.focusFirstOrSelectedOption)}disconnectedCallback(){super.disconnectedCallback(),this.typeahead.reset()}attributeChangedCallback(e,t,n){(e===`options`||e===`search-value`)&&this.filterOptions(),super.attributeChangedCallback(e,t,n),e===`id`&&n&&this.adoptHostId(n)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}adoptHostId(e){this._listboxId=e,this.removeAttribute(`id`)}willUpdate(e){super.willUpdate(e),(e.has(`options`)||e.has(`searchValue`))&&this.filterOptions()}render(){return e._`
2
2
  <div
3
3
  id=${this._listboxId}
4
4
  class=${t.t({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./element-with-slot-D7sTqOr3.cjs");require("./icon-Dnv6LtPC.cjs");var r=`https://punkt-cdn.oslo.kommune.no/latest/animations/`;typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||r);var i=class extends n.t{constructor(...e){super(...e),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size=`medium`,this.variant=`rainbow`,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:r,this._shouldDisplayLoader=!1}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has(`delay`)&&this.setupLoader()}render(){let r=t.t({"pkt-loader":!0,[`pkt-loader--${this.inline?`inline`:`box`}`]:!0,[`pkt-loader--${this.size}`]:!0}),i=t.t({"pkt-contents":!0,"pkt-hide":this.isLoading});return e._`<div
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-DhiAuSjM.cjs");require("./icon-jPhyZD1z.cjs");var r=`https://punkt-cdn.oslo.kommune.no/latest/animations/`;typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||r);var i=class extends n.t{constructor(...e){super(...e),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size=`medium`,this.variant=`rainbow`,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:r,this._shouldDisplayLoader=!1}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has(`delay`)&&this.setupLoader()}render(){let r=t.t({"pkt-loader":!0,[`pkt-loader--${this.inline?`inline`:`box`}`]:!0,[`pkt-loader--${this.size}`]:!0}),i=t.t({"pkt-contents":!0,"pkt-hide":this.isLoading});return e._`<div
2
2
  role="status"
3
3
  aria-live="polite"
4
4
  aria-busy=${this.isLoading?`true`:`false`}
@@ -1,7 +1,7 @@
1
- import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-mwwC2Rra.js";
2
- import { t as o } from "./class-map-C4hdfSfY.js";
3
- import { i as s, t as c } from "./element-with-slot-DQv0cbbD.js";
4
- import "./icon-JigbxxF7.js";
1
+ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-DBugHPKM.js";
2
+ import { t as o } from "./class-map-Bf-QzUpN.js";
3
+ import { i as s, t as c } from "./element-with-slot-DDLS-aLw.js";
4
+ import "./icon-Bao96Zb8.js";
5
5
  //#region src/components/loader/loader.ts
6
6
  var l = "https://punkt-cdn.oslo.kommune.no/latest/animations/";
7
7
  typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || l);
@@ -1,56 +1,16 @@
1
- import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-mwwC2Rra.js";
2
- import { t as o } from "./class-map-C4hdfSfY.js";
3
- import { i as s, t as c } from "./element-with-slot-DQv0cbbD.js";
4
- import "./icon-JigbxxF7.js";
1
+ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-DBugHPKM.js";
2
+ import { t as o } from "./class-map-Bf-QzUpN.js";
3
+ import { i as s, t as c } from "./element-with-slot-DDLS-aLw.js";
4
+ import "./icon-Bao96Zb8.js";
5
5
  import { t as l } from "./classutils-DcYnSgfc.js";
6
+ //#region ../../shared-types/messagebox.ts
6
7
  var u = {
7
- name: "pkt-messagebox",
8
- react: "PktMessagebox",
9
- "css-class": "pkt-messagebox",
10
- isElement: !0,
11
- isPureReact: !0,
12
- events: {
13
- onClose: { description: "React: Event som trigges når meldingsboksen lukkes" },
14
- "on-close": { description: "Elements: Event som trigges når meldingsboksen lukkes" }
15
- },
16
- props: {
17
- title: {
18
- name: "Tittel",
19
- description: "Tittelen på meldingsboksen",
20
- type: "string",
21
- category: "contents"
22
- },
23
- skin: {
24
- name: "Utseende",
25
- description: "Velg farge på meldingsboksen",
26
- type: [
27
- "beige",
28
- "blue",
29
- "red",
30
- "green"
31
- ],
32
- category: "ui",
33
- default: "beige"
34
- },
35
- compact: {
36
- name: "Kompakt",
37
- description: "Gjør meldingsboksen mindre",
38
- type: "boolean",
39
- category: "ui",
40
- default: !1
41
- },
42
- closable: {
43
- name: "Kan lukkes",
44
- description: "Viser lukkeknapp",
45
- type: "boolean",
46
- category: "ui",
47
- default: !1
48
- }
49
- },
50
- slots: { default: { description: "Innholdet i meldingsboksen" } }
8
+ skin: "beige",
9
+ compact: !1,
10
+ closable: !1
51
11
  }, d = class extends c {
52
12
  constructor() {
53
- super(), this.closable = u.props.closable.default, this.compact = u.props.compact.default, this.title = "", this.skin = void 0, this._isClosed = !1, this.close = (e) => {
13
+ super(), this.closable = u.closable, this.compact = u.compact, this.title = "", this.skin = u.skin, this._isClosed = !1, this.close = (e) => {
54
14
  this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", {
55
15
  detail: { origin: e },
56
16
  bubbles: !0