@oslokommune/punkt-elements 16.6.2 → 16.7.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 (146) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{accordionitem-D7sWqDM_.cjs → accordionitem-D1Agl1bB.cjs} +1 -1
  3. package/dist/{accordionitem-Cj74XruR.js → accordionitem-ZlaXvjt5.js} +5 -5
  4. package/dist/{alert-ca_hFi-u.js → alert-BuAXrnKl.js} +6 -6
  5. package/dist/{alert-C95U_RZ0.cjs → alert-DFkFNTxh.cjs} +1 -1
  6. package/dist/{async-directive-CKx6pubI.js → async-directive-CMzWMlZ5.js} +1 -1
  7. package/dist/{async-directive-B158h3ba.cjs → async-directive-DoMuclel.cjs} +1 -1
  8. package/dist/{backlink-CQoNgoa-.cjs → backlink-EiAXUUZP.cjs} +1 -1
  9. package/dist/{backlink-C68H4Z3b.js → backlink-V4DAt17e.js} +3 -3
  10. package/dist/{button-BRovt5nm.js → button-DEyvt1LI.js} +5 -5
  11. package/dist/{button-BXN_JPaH.cjs → button-DYv5Dg4M.cjs} +1 -1
  12. package/dist/{calendar-43Y_6FD8.cjs → calendar-HIE9nxcc.cjs} +1 -1
  13. package/dist/{calendar-B5Xwl8mV.js → calendar-S63oreVW.js} +4 -4
  14. package/dist/{card-DfHo45CG.cjs → card-CyeH6l1c.cjs} +1 -1
  15. package/dist/{card-DvgCTN4B.js → card-DDiLfuO4.js} +7 -7
  16. package/dist/{checkbox-mmn3v9ry.cjs → checkbox-BLlwTABj.cjs} +1 -1
  17. package/dist/{checkbox-CbIUMIYt.js → checkbox-ejBUa5qQ.js} +4 -4
  18. package/dist/{class-map-3ADKve8g.js → class-map-CEnykyO_.js} +1 -1
  19. package/dist/{class-map-Bokp1SoS.cjs → class-map-CsENJXf1.cjs} +1 -1
  20. package/dist/{combobox-CwW0md6G.js → combobox-BmxSecfE.js} +13 -13
  21. package/dist/{combobox-TKL44xnV.cjs → combobox-Hb2V-fPX.cjs} +1 -1
  22. package/dist/{consent-CgS1L1xF.js → consent-iXyx5v6J.js} +3 -3
  23. package/dist/{consent-CIhFwuFO.cjs → consent-ruWAEVXW.cjs} +1 -1
  24. package/dist/{datepicker-qRWWzmbo.js → datepicker-CZl7b8Na.js} +12 -12
  25. package/dist/{datepicker-oN9L0Wnm.cjs → datepicker-D2H7U6MS.cjs} +1 -1
  26. package/dist/{directive-helpers-B3Vpl3xV.cjs → directive-helpers-BP2WOx60.cjs} +1 -1
  27. package/dist/{directive-helpers-CyPtA1_i.js → directive-helpers-rm-28gIj.js} +1 -1
  28. package/dist/{element-CV9utnHJ.js → element-CPpT3rFQ.js} +68 -67
  29. package/dist/{element-CMTfByxQ.cjs → element-gR_VtSiD.cjs} +6 -6
  30. package/dist/{element-with-slot-1djk8KXi.js → element-with-slot-Dqk6-TRR.js} +2 -2
  31. package/dist/{element-with-slot-yT8k1Z37.cjs → element-with-slot-ZX-up7jO.cjs} +1 -1
  32. package/dist/{heading-D9R5UBcv.js → heading-CKt7cVn7.js} +1 -1
  33. package/dist/{heading-B0XRE0lq.cjs → heading-Cvz8m1xL.cjs} +1 -1
  34. package/dist/{helptext-B366oeR9.cjs → helptext-5Mzp65-F.cjs} +1 -1
  35. package/dist/{helptext-DepcDYFV.js → helptext-jIoWRcCF.js} +5 -5
  36. package/dist/{icon-D0IQAVwS.js → icon-BlKA8YuW.js} +1 -1
  37. package/dist/{icon-Dj0oZZSa.cjs → icon-Bqj9oBbl.cjs} +1 -1
  38. package/dist/{if-defined-rXcLNTzN.js → if-defined-B0krMLad.js} +1 -1
  39. package/dist/{if-defined-hKKmbsI8.cjs → if-defined-BOW3ODSj.cjs} +1 -1
  40. package/dist/index.d.ts +92 -0
  41. package/dist/{input-element-n5U38pZ1.js → input-element-8nLwuQS4.js} +3 -3
  42. package/dist/{input-element-Xe9FTi2a.cjs → input-element-DdVhUvva.cjs} +1 -1
  43. package/dist/{input-wrapper-BdFdJU-k.cjs → input-wrapper-B0MkQ0IZ.cjs} +1 -1
  44. package/dist/{input-wrapper-B__6jW4U.js → input-wrapper-B2JpK016.js} +7 -7
  45. package/dist/{link-DLjXMpvi.cjs → link-R_lNhViF.cjs} +1 -1
  46. package/dist/{link-oGYvBLYL.js → link-Z_GizclR.js} +4 -4
  47. package/dist/{linkcard-BhVIc18n.js → linkcard-BlQvdB1a.js} +4 -4
  48. package/dist/{linkcard-C20WC6Nw.cjs → linkcard-C7HbSLlX.cjs} +1 -1
  49. package/dist/{listbox-CS4WQOuf.js → listbox-BQKDZvZn.js} +5 -5
  50. package/dist/{listbox-OAVh_U7u.cjs → listbox-CGgV9MAe.cjs} +1 -1
  51. package/dist/{loader-BHt9i5Xp.js → loader-Ci3CHU8k.js} +5 -5
  52. package/dist/{loader-DxAGCcNF.cjs → loader-e2gs_1xz.cjs} +1 -1
  53. package/dist/{messagebox-DkspcMQg.js → messagebox-Bf-XMlvW.js} +5 -5
  54. package/dist/{messagebox-B8LW0PSQ.cjs → messagebox-D67w71VX.cjs} +1 -1
  55. package/dist/{modal-mWn5pjs8.cjs → modal-CyvEkbfQ.cjs} +1 -1
  56. package/dist/{modal-D3u6ueP5.js → modal-DzGe1g8Z.js} +6 -6
  57. package/dist/pkt-accordion.cjs +1 -1
  58. package/dist/pkt-accordion.js +2 -2
  59. package/dist/pkt-alert.cjs +1 -1
  60. package/dist/pkt-alert.js +1 -1
  61. package/dist/pkt-backlink.cjs +1 -1
  62. package/dist/pkt-backlink.js +1 -1
  63. package/dist/pkt-breadcrumbs.cjs +1 -1
  64. package/dist/pkt-breadcrumbs.js +2 -2
  65. package/dist/pkt-button.cjs +1 -1
  66. package/dist/pkt-button.js +1 -1
  67. package/dist/pkt-calendar.cjs +1 -1
  68. package/dist/pkt-calendar.js +1 -1
  69. package/dist/pkt-card.cjs +1 -1
  70. package/dist/pkt-card.js +1 -1
  71. package/dist/pkt-checkbox.cjs +1 -1
  72. package/dist/pkt-checkbox.js +1 -1
  73. package/dist/pkt-combobox.cjs +1 -1
  74. package/dist/pkt-combobox.js +1 -1
  75. package/dist/pkt-consent.cjs +1 -1
  76. package/dist/pkt-consent.js +1 -1
  77. package/dist/pkt-datepicker.cjs +1 -1
  78. package/dist/pkt-datepicker.js +2 -2
  79. package/dist/pkt-header.cjs +1 -1
  80. package/dist/pkt-header.js +10 -10
  81. package/dist/pkt-heading.cjs +1 -1
  82. package/dist/pkt-heading.js +1 -1
  83. package/dist/pkt-helptext.cjs +1 -1
  84. package/dist/pkt-helptext.js +1 -1
  85. package/dist/pkt-icon.cjs +1 -1
  86. package/dist/pkt-icon.js +1 -1
  87. package/dist/pkt-index.cjs +1 -1
  88. package/dist/pkt-index.js +33 -31
  89. package/dist/pkt-input-wrapper.cjs +1 -1
  90. package/dist/pkt-input-wrapper.js +1 -1
  91. package/dist/pkt-link.cjs +1 -1
  92. package/dist/pkt-link.js +1 -1
  93. package/dist/pkt-linkcard.cjs +1 -1
  94. package/dist/pkt-linkcard.js +1 -1
  95. package/dist/pkt-listbox.cjs +1 -1
  96. package/dist/pkt-listbox.js +1 -1
  97. package/dist/pkt-loader.cjs +1 -1
  98. package/dist/pkt-loader.js +1 -1
  99. package/dist/pkt-messagebox.cjs +1 -1
  100. package/dist/pkt-messagebox.js +1 -1
  101. package/dist/pkt-modal.cjs +1 -1
  102. package/dist/pkt-modal.js +1 -1
  103. package/dist/{pkt-options-controller-DIeKSpWv.cjs → pkt-options-controller-5LXbEzuk.cjs} +1 -1
  104. package/dist/{pkt-options-controller-W4ITGQy9.js → pkt-options-controller-B5YalfCb.js} +1 -1
  105. package/dist/pkt-progressbar.cjs +1 -1
  106. package/dist/pkt-progressbar.js +2 -2
  107. package/dist/pkt-radiobutton.cjs +1 -1
  108. package/dist/pkt-radiobutton.js +1 -1
  109. package/dist/pkt-select.cjs +1 -1
  110. package/dist/pkt-select.js +1 -1
  111. package/dist/pkt-tabs.cjs +1 -1
  112. package/dist/pkt-tabs.js +2 -2
  113. package/dist/pkt-tag.cjs +1 -1
  114. package/dist/pkt-tag.js +1 -1
  115. package/dist/pkt-textarea.cjs +1 -1
  116. package/dist/pkt-textarea.js +1 -1
  117. package/dist/pkt-textinput.cjs +1 -1
  118. package/dist/pkt-textinput.js +1 -1
  119. package/dist/pkt-timepicker.cjs +188 -0
  120. package/dist/pkt-timepicker.js +552 -0
  121. package/dist/{progressbar-CcX-xiPI.js → progressbar-By7e0lEI.js} +5 -5
  122. package/dist/{progressbar-CC9Qr82_.cjs → progressbar-DsJ2B9Vm.cjs} +1 -1
  123. package/dist/{radiobutton-RW3h0tJj.js → radiobutton-6frNG9J_.js} +5 -5
  124. package/dist/{radiobutton-BUDQYAH-.cjs → radiobutton-Bv-BZ1Hw.cjs} +1 -1
  125. package/dist/{ref-DBGHvw2G.js → ref-Bg_Swj5w.js} +2 -2
  126. package/dist/{ref-DahIePMT.cjs → ref-CL-Xk9Xm.cjs} +1 -1
  127. package/dist/{repeat-DnlRNf63.js → repeat-BD8TKgJb.js} +2 -2
  128. package/dist/{repeat-C-FJ2vfy.cjs → repeat-Cfq8CDlf.cjs} +1 -1
  129. package/dist/{select-iXKeM3yz.js → select-CXZt1nHS.js} +8 -8
  130. package/dist/{select-PuEeK4jQ.cjs → select-WFhS4Vfp.cjs} +1 -1
  131. package/dist/{state-l4hGZdFJ.js → state-C_1EOo3D.js} +1 -1
  132. package/dist/{state-BNgpvY-A.cjs → state-Dg-53wQ8.cjs} +1 -1
  133. package/dist/{tabitem-DZSzwag2.js → tabitem-CB8wkKmv.js} +5 -5
  134. package/dist/{tabitem-Jenus4Qd.cjs → tabitem-DZpspU4Q.cjs} +1 -1
  135. package/dist/{tag-CIWBLpjv.js → tag-BuCpqaks.js} +6 -6
  136. package/dist/{tag-DeE1OpmF.cjs → tag-X6xdjR0N.cjs} +1 -1
  137. package/dist/{textarea-DR9lVDN-.js → textarea-Bzuymclz.js} +10 -10
  138. package/dist/{textarea-DtiYQWjy.cjs → textarea-DoeHJ7HR.cjs} +1 -1
  139. package/dist/{textinput-0Bttvt9V.js → textinput-9lHjs4ce.js} +9 -9
  140. package/dist/{textinput-cKrjvbJW.cjs → textinput-BNsLd26i.cjs} +1 -1
  141. package/dist/timepicker.d.ts +1 -0
  142. package/package.json +2 -3
  143. package/src/components/index.ts +3 -0
  144. package/src/components/timepicker/index.ts +2 -0
  145. package/src/components/timepicker/timepicker.test.ts +453 -0
  146. package/src/components/timepicker/timepicker.ts +787 -0
@@ -1 +1 @@
1
- "use strict";const h=require("./element-CMTfByxQ.cjs"),y=require("./async-directive-B158h3ba.cjs"),E=require("./directive-C7oCP5Bh.cjs");function C(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function p(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function b(s){var e;return s.nodeType===Node.TEXT_NODE&&((e=s.nodeValue)==null?void 0:e.trim())!==""}const v=new WeakMap;function f(s){let e=v.get(s);return e||(e=new m(s),v.set(s,e)),e}const N=Symbol("default");function g(s){return s===void 0?N:s}function T(s,e){if(s.nodeType===Node.COMMENT_NODE)return!1;if(s.nodeType===Node.TEXT_NODE)return b(s)?(u(e,N,s),!0):!1;if(s.nodeType===Node.ELEMENT_NODE){const t=s;if(C(t)||p(t))return!1;if(t instanceof HTMLTemplateElement){const l=Array.from(t.content.childNodes),a=g(t.getAttribute("slot")??void 0);for(const i of l)u(e,a,i);return!0}const o=t.getAttribute("slot"),n=o!==null?g(o):N;return u(e,n,s),!0}return!1}function u(s,e,t){let o=s.get(e);o||(o=[],s.set(e,o)),o.push(t)}const c=class c{constructor(e){this.observer=null,this.nodesBySlot=new Map,this.directives=new Set,this.observing=!1,this.trackedNodes=new Set,this.generation=0,this.initialCollectionDone=!1,this.processingMutations=!1,this.placeholderToNode=new Map,this.nodeToPlaceholder=new Map,this.host=e}collectNodes(){if(this.initialCollectionDone)return;this.initialCollectionDone=!0,this.generation++;const e=Array.from(this.host.childNodes);for(const t of e)T(t,this.nodesBySlot)&&this.trackedNodes.add(t)}addDirective(e){this.directives.add(e),this.startObserving()}removeDirective(e){this.directives.delete(e),this.directives.size===0&&this.stopObserving()}getNodes(e){return this.nodesBySlot.get(g(e))??[]}hasContent(e){return this.getNodes(e).length>0}ensurePlaceholder(e){if(this.nodeToPlaceholder.has(e)||e.parentNode!==this.host)return;const t=document.createComment(c.PLACEHOLDER_PREFIX);this.host.insertBefore(t,e),this.placeholderToNode.set(t,e),this.nodeToPlaceholder.set(e,t)}startObserving(){this.observing||(this.observing=!0,setTimeout(()=>{this.observing&&(this.observer=new MutationObserver(e=>{this.handleMutations(e)}),this.observer.observe(this.host,{childList:!0}))},0))}stopObserving(){var e;this.observing&&(this.observing=!1,(e=this.observer)==null||e.disconnect(),this.observer=null)}handleMutations(e){var o,n,l;if(this.processingMutations)return;this.processingMutations=!0;let t=!1;for(const a of e)if(a.target===this.host){for(const i of a.removedNodes){const r=this.placeholderToNode.get(i);if(r){(o=r.parentNode)==null||o.removeChild(r),this.trackedNodes.delete(r),this.removeFromSlots(r),this.placeholderToNode.delete(i),this.nodeToPlaceholder.delete(r),t=!0;continue}if(this.trackedNodes.has(i)){this.trackedNodes.delete(i),this.removeFromSlots(i);const d=this.nodeToPlaceholder.get(i);d&&((n=d.parentNode)==null||n.removeChild(d),this.placeholderToNode.delete(d),this.nodeToPlaceholder.delete(i)),t=!0}}for(const i of a.addedNodes)this.placeholderToNode.has(i)||!this.trackedNodes.has(i)&&this.isUserContent(i)&&T(i,this.nodesBySlot)&&(this.trackedNodes.add(i),t=!0)}t&&(this.generation++,this.notifyDirectives()),(l=this.observer)==null||l.takeRecords(),this.processingMutations=!1}isUserContent(e){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return b(e);if(e.nodeType===Node.ELEMENT_NODE){const t=e;return!(C(t)||p(t))}return!1}removeFromSlots(e){for(const[t,o]of this.nodesBySlot){const n=o.indexOf(e);if(n!==-1){o.splice(n,1),o.length===0&&this.nodesBySlot.delete(t);return}}}notifyDirectives(){for(const e of this.directives)e.handleNodesChanged()}};c.PLACEHOLDER_PREFIX="pkt-slot";let m=c;class O extends y.f{constructor(e){if(super(e),this.manager=null,this.lastGeneration=-1,e.type!==E.t.CHILD)throw new Error("slotContent() can only be used in child expressions")}render(e,t){return h.E}update(e,[t,o]){return this.slotName=o,this.manager||(this.manager=f(t),this.manager.collectNodes(),this.manager.addDirective(this)),this.ensurePlaceholders(),this.getNodesOrNoChange()}handleNodesChanged(){if(!this.isConnected||!this.manager)return;this.ensurePlaceholders();const e=this.getNodesOrNoChange();e!==h.E&&this.setValue(e)}ensurePlaceholders(){if(!this.manager)return;const e=this.manager.getNodes(this.slotName);for(const t of e)this.manager.ensurePlaceholder(t)}disconnected(){var e;(e=this.manager)==null||e.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){}getNodesOrNoChange(){if(!this.manager)return h.E;const e=this.manager.generation;return e===this.lastGeneration?h.E:(this.lastGeneration=e,this.manager.getNodes(this.slotName))}}const D=E.e(O);class P extends h.PktElement{connectedCallback(){f(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return f(this).hasContent(e)}}exports.PktElementWithSlot=P;exports.isOptionElement=p;exports.slotContent=D;
1
+ "use strict";const h=require("./element-gR_VtSiD.cjs"),y=require("./async-directive-DoMuclel.cjs"),E=require("./directive-C7oCP5Bh.cjs");function C(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function p(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function b(s){var e;return s.nodeType===Node.TEXT_NODE&&((e=s.nodeValue)==null?void 0:e.trim())!==""}const v=new WeakMap;function f(s){let e=v.get(s);return e||(e=new m(s),v.set(s,e)),e}const N=Symbol("default");function g(s){return s===void 0?N:s}function T(s,e){if(s.nodeType===Node.COMMENT_NODE)return!1;if(s.nodeType===Node.TEXT_NODE)return b(s)?(u(e,N,s),!0):!1;if(s.nodeType===Node.ELEMENT_NODE){const t=s;if(C(t)||p(t))return!1;if(t instanceof HTMLTemplateElement){const l=Array.from(t.content.childNodes),a=g(t.getAttribute("slot")??void 0);for(const i of l)u(e,a,i);return!0}const o=t.getAttribute("slot"),n=o!==null?g(o):N;return u(e,n,s),!0}return!1}function u(s,e,t){let o=s.get(e);o||(o=[],s.set(e,o)),o.push(t)}const c=class c{constructor(e){this.observer=null,this.nodesBySlot=new Map,this.directives=new Set,this.observing=!1,this.trackedNodes=new Set,this.generation=0,this.initialCollectionDone=!1,this.processingMutations=!1,this.placeholderToNode=new Map,this.nodeToPlaceholder=new Map,this.host=e}collectNodes(){if(this.initialCollectionDone)return;this.initialCollectionDone=!0,this.generation++;const e=Array.from(this.host.childNodes);for(const t of e)T(t,this.nodesBySlot)&&this.trackedNodes.add(t)}addDirective(e){this.directives.add(e),this.startObserving()}removeDirective(e){this.directives.delete(e),this.directives.size===0&&this.stopObserving()}getNodes(e){return this.nodesBySlot.get(g(e))??[]}hasContent(e){return this.getNodes(e).length>0}ensurePlaceholder(e){if(this.nodeToPlaceholder.has(e)||e.parentNode!==this.host)return;const t=document.createComment(c.PLACEHOLDER_PREFIX);this.host.insertBefore(t,e),this.placeholderToNode.set(t,e),this.nodeToPlaceholder.set(e,t)}startObserving(){this.observing||(this.observing=!0,setTimeout(()=>{this.observing&&(this.observer=new MutationObserver(e=>{this.handleMutations(e)}),this.observer.observe(this.host,{childList:!0}))},0))}stopObserving(){var e;this.observing&&(this.observing=!1,(e=this.observer)==null||e.disconnect(),this.observer=null)}handleMutations(e){var o,n,l;if(this.processingMutations)return;this.processingMutations=!0;let t=!1;for(const a of e)if(a.target===this.host){for(const i of a.removedNodes){const r=this.placeholderToNode.get(i);if(r){(o=r.parentNode)==null||o.removeChild(r),this.trackedNodes.delete(r),this.removeFromSlots(r),this.placeholderToNode.delete(i),this.nodeToPlaceholder.delete(r),t=!0;continue}if(this.trackedNodes.has(i)){this.trackedNodes.delete(i),this.removeFromSlots(i);const d=this.nodeToPlaceholder.get(i);d&&((n=d.parentNode)==null||n.removeChild(d),this.placeholderToNode.delete(d),this.nodeToPlaceholder.delete(i)),t=!0}}for(const i of a.addedNodes)this.placeholderToNode.has(i)||!this.trackedNodes.has(i)&&this.isUserContent(i)&&T(i,this.nodesBySlot)&&(this.trackedNodes.add(i),t=!0)}t&&(this.generation++,this.notifyDirectives()),(l=this.observer)==null||l.takeRecords(),this.processingMutations=!1}isUserContent(e){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return b(e);if(e.nodeType===Node.ELEMENT_NODE){const t=e;return!(C(t)||p(t))}return!1}removeFromSlots(e){for(const[t,o]of this.nodesBySlot){const n=o.indexOf(e);if(n!==-1){o.splice(n,1),o.length===0&&this.nodesBySlot.delete(t);return}}}notifyDirectives(){for(const e of this.directives)e.handleNodesChanged()}};c.PLACEHOLDER_PREFIX="pkt-slot";let m=c;class O extends y.f{constructor(e){if(super(e),this.manager=null,this.lastGeneration=-1,e.type!==E.t.CHILD)throw new Error("slotContent() can only be used in child expressions")}render(e,t){return h.E}update(e,[t,o]){return this.slotName=o,this.manager||(this.manager=f(t),this.manager.collectNodes(),this.manager.addDirective(this)),this.ensurePlaceholders(),this.getNodesOrNoChange()}handleNodesChanged(){if(!this.isConnected||!this.manager)return;this.ensurePlaceholders();const e=this.getNodesOrNoChange();e!==h.E&&this.setValue(e)}ensurePlaceholders(){if(!this.manager)return;const e=this.manager.getNodes(this.slotName);for(const t of e)this.manager.ensurePlaceholder(t)}disconnected(){var e;(e=this.manager)==null||e.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){}getNodesOrNoChange(){if(!this.manager)return h.E;const e=this.manager.generation;return e===this.lastGeneration?h.E:(this.lastGeneration=e,this.manager.getNodes(this.slotName))}}const D=E.e(O);class P extends h.PktElement{connectedCallback(){f(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return f(this).hasContent(e)}}exports.PktElementWithSlot=P;exports.isOptionElement=p;exports.slotContent=D;
@@ -1,4 +1,4 @@
1
- import { a as n, b as g, n as r, t as p } from "./element-CV9utnHJ.js";
1
+ import { a as n, b as g, n as r, t as p } from "./element-CPpT3rFQ.js";
2
2
  var o = Object.defineProperty, c = Object.getOwnPropertyDescriptor, a = (e, l, t, h) => {
3
3
  for (var i = h > 1 ? void 0 : h ? c(l, t) : l, d = e.length - 1, u; d >= 0; d--)
4
4
  (u = e[d]) && (i = (h ? u(l, t, i) : u(i)) || i);
@@ -1 +1 @@
1
- "use strict";const i=require("./element-CMTfByxQ.cjs");var n=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=(r,e,l,t)=>{for(var s=t>1?void 0:t?u(e,l):e,d=r.length-1,h;d>=0;d--)(h=r[d])&&(s=(t?h(e,l,s):h(s))||s);return t&&s&&n(e,l,s),s};exports.PktHeading=class extends i.PktShadowElement{constructor(){super(...arguments),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,l,t){super.attributeChangedCallback(e,l,t),e==="level"&&t&&this.setLevel(Number(t)),e==="visuallyHidden"&&(this.visuallyHidden=t!==null&&t!=="false"),(e==="size"||e==="visuallyHidden"||e==="align"||e==="weight")&&this.updateHostClasses()}updated(e){super.updated(e),e.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(e.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has("size")||e.has("visuallyHidden")||e.has("align")||e.has("weight"))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute("aria-level",String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}get defaultWeightForLevel(){switch(this.level){case 1:return"regular";case 2:return"regular";case 3:return"medium";case 4:return"medium";case 5:return"medium";case 6:return"medium";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end","pkt-heading--light","pkt-heading--regular","pkt-heading--medium","pkt-heading--bold"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return i.b`<slot></slot>`}};a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"size",2);a([i.n({type:Number,reflect:!0})],exports.PktHeading.prototype,"level",2);a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"weight",2);a([i.n({type:Boolean,reflect:!0})],exports.PktHeading.prototype,"visuallyHidden",2);a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"align",2);exports.PktHeading=a([i.t("pkt-heading")],exports.PktHeading);
1
+ "use strict";const i=require("./element-gR_VtSiD.cjs");var n=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=(r,e,l,t)=>{for(var s=t>1?void 0:t?u(e,l):e,d=r.length-1,h;d>=0;d--)(h=r[d])&&(s=(t?h(e,l,s):h(s))||s);return t&&s&&n(e,l,s),s};exports.PktHeading=class extends i.PktShadowElement{constructor(){super(...arguments),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,l,t){super.attributeChangedCallback(e,l,t),e==="level"&&t&&this.setLevel(Number(t)),e==="visuallyHidden"&&(this.visuallyHidden=t!==null&&t!=="false"),(e==="size"||e==="visuallyHidden"||e==="align"||e==="weight")&&this.updateHostClasses()}updated(e){super.updated(e),e.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(e.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has("size")||e.has("visuallyHidden")||e.has("align")||e.has("weight"))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute("aria-level",String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}get defaultWeightForLevel(){switch(this.level){case 1:return"regular";case 2:return"regular";case 3:return"medium";case 4:return"medium";case 5:return"medium";case 6:return"medium";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end","pkt-heading--light","pkt-heading--regular","pkt-heading--medium","pkt-heading--bold"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return i.b`<slot></slot>`}};a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"size",2);a([i.n({type:Number,reflect:!0})],exports.PktHeading.prototype,"level",2);a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"weight",2);a([i.n({type:Boolean,reflect:!0})],exports.PktHeading.prototype,"visuallyHidden",2);a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"align",2);exports.PktHeading=a([i.t("pkt-heading")],exports.PktHeading);
@@ -1,4 +1,4 @@
1
- "use strict";const x=require("./element-with-slot-yT8k1Z37.cjs"),e=require("./element-CMTfByxQ.cjs"),h=require("./icon-Dj0oZZSa.cjs"),c=require("./class-map-Bokp1SoS.cjs"),u=require("./state-BNgpvY-A.cjs"),a=require("./utils-byXsEz1u.cjs"),d=require("./input-wrapper-EoSAbU-U.cjs");var k=Object.defineProperty,_=Object.getOwnPropertyDescriptor,r=(o,p,l,n)=>{for(var t=n>1?void 0:n?_(p,l):p,s=o.length-1,i;s>=0;s--)(i=o[s])&&(t=(n?i(p,l,t):i(t))||t);return n&&t&&k(p,l,t),t};exports.PktHelptext=class extends x.PktElementWithSlot{constructor(){super(...arguments),this.forId=a.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){const p=()=>{const s=!this.isHelpTextOpen;this.isHelpTextOpen=s,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:s}}))},l=c.e({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()}),n=()=>this.helptextDropdown?e.b`<div class="pkt-inputwrapper__helptext-expandable">
1
+ "use strict";const x=require("./element-with-slot-ZX-up7jO.cjs"),e=require("./element-gR_VtSiD.cjs"),h=require("./icon-Bqj9oBbl.cjs"),c=require("./class-map-CsENJXf1.cjs"),u=require("./state-Dg-53wQ8.cjs"),a=require("./utils-byXsEz1u.cjs"),d=require("./input-wrapper-EoSAbU-U.cjs");var k=Object.defineProperty,_=Object.getOwnPropertyDescriptor,r=(o,p,l,n)=>{for(var t=n>1?void 0:n?_(p,l):p,s=o.length-1,i;s>=0;s--)(i=o[s])&&(t=(n?i(p,l,t):i(t))||t);return n&&t&&k(p,l,t),t};exports.PktHelptext=class extends x.PktElementWithSlot{constructor(){super(...arguments),this.forId=a.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){const p=()=>{const s=!this.isHelpTextOpen;this.isHelpTextOpen=s,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:s}}))},l=c.e({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()}),n=()=>this.helptextDropdown?e.b`<div class="pkt-inputwrapper__helptext-expandable">
2
2
  <button
3
3
  class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
4
4
  type="button"
@@ -1,8 +1,8 @@
1
- import { P as u, s as c } from "./element-with-slot-1djk8KXi.js";
2
- import { b as a, A as _, n as i, t as m } from "./element-CV9utnHJ.js";
3
- import { o as x } from "./icon-D0IQAVwS.js";
4
- import { e as d } from "./class-map-3ADKve8g.js";
5
- import { r as w } from "./state-l4hGZdFJ.js";
1
+ import { P as u, s as c } from "./element-with-slot-Dqk6-TRR.js";
2
+ import { b as a, A as _, n as i, t as m } from "./element-CPpT3rFQ.js";
3
+ import { o as x } from "./icon-BlKA8YuW.js";
4
+ import { e as d } from "./class-map-CEnykyO_.js";
5
+ import { r as w } from "./state-C_1EOo3D.js";
6
6
  import { u as v } from "./utils-DznhwRXm.js";
7
7
  import { s as f } from "./input-wrapper-CDgenrYA.js";
8
8
  var k = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (s, p, r, o) => {
@@ -1,4 +1,4 @@
1
- import { A as y, E as P, P as k, b as I, n as p, t as _ } from "./element-CV9utnHJ.js";
1
+ import { A as y, E as P, P as k, b as I, n as p, t as _ } from "./element-CPpT3rFQ.js";
2
2
  import { e as m, i as S, t as b } from "./directive-oAbCiebi.js";
3
3
  /**
4
4
  * @license
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("./element-CMTfByxQ.cjs"),h=require("./directive-C7oCP5Bh.cjs");/**
1
+ "use strict";const s=require("./element-gR_VtSiD.cjs"),h=require("./directive-C7oCP5Bh.cjs");/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,4 +1,4 @@
1
- import { A as r } from "./element-CV9utnHJ.js";
1
+ import { A as r } from "./element-CPpT3rFQ.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-CMTfByxQ.cjs");/**
1
+ "use strict";const t=require("./element-gR_VtSiD.cjs");/**
2
2
  * @license
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
package/dist/index.d.ts CHANGED
@@ -495,6 +495,32 @@ declare interface IPktTag {
495
495
  ariaLabel?: IAriaAttributes['aria-label'] | null;
496
496
  }
497
497
 
498
+ export declare interface IPktTimepicker {
499
+ value?: string;
500
+ min?: string;
501
+ max?: string;
502
+ step?: number;
503
+ name?: string;
504
+ id?: string;
505
+ disabled?: boolean;
506
+ required?: boolean;
507
+ hidePicker?: boolean;
508
+ stepArrows?: boolean;
509
+ fullwidth?: boolean;
510
+ label?: string | null;
511
+ helptext?: string;
512
+ helptextDropdown?: string;
513
+ helptextDropdownButton?: string | null;
514
+ hasError?: boolean;
515
+ errorMessage?: string;
516
+ requiredTag?: boolean;
517
+ requiredText?: string;
518
+ optionalTag?: boolean;
519
+ optionalText?: string;
520
+ tagText?: string | null;
521
+ inline?: boolean;
522
+ }
523
+
498
524
  export declare class PktAccordion extends LitElement implements IPktAccordion {
499
525
  ariaLabelledBy: string;
500
526
  compact: boolean;
@@ -1745,10 +1771,76 @@ export declare class PktTextinput extends PktInputElement<Props_9> {
1745
1771
  render(): TemplateResult<1>;
1746
1772
  }
1747
1773
 
1774
+ export declare class PktTimepicker extends PktInputElement<Props_11> {
1775
+ hiddenInputRef: Ref<HTMLInputElement>;
1776
+ hoursInputRef: Ref<HTMLInputElement>;
1777
+ minutesInputRef: Ref<HTMLInputElement>;
1778
+ buttonRef: Ref<HTMLButtonElement>;
1779
+ /**
1780
+ * Exposes hiddenInputRef as inputRef so the base class validate() method
1781
+ * triggers our manageValidity override automatically after every onChange call.
1782
+ * The hidden input itself is never used for reporting — see manageValidity below.
1783
+ */
1784
+ get inputRef(): Ref<HTMLInputElement>;
1785
+ /**
1786
+ * Overrides the base class manageValidity to solve a focusability problem:
1787
+ * the browser requires the third argument to setValidity (the "anchor") to be
1788
+ * a visible, focusable element — it focuses that element when navigating to an
1789
+ * invalid field. Our hidden input[type=time] cannot receive focus, so passing it
1790
+ * as the anchor would silently fail with "form control is not focusable".
1791
+ */
1792
+ protected manageValidity(_input?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): void;
1793
+ value: string;
1794
+ hidePicker: boolean;
1795
+ stepArrows: boolean;
1796
+ private _hours;
1797
+ private _minutes;
1798
+ private _isOpen;
1799
+ private _hoursDigitCount;
1800
+ private _hoursFirstDigit;
1801
+ private _minutesDigitCount;
1802
+ private _minutesFirstDigit;
1803
+ private _hasFocus;
1804
+ private _setAriaInvalid;
1805
+ private _outsideClickHandler;
1806
+ private _handleComponentFocusIn;
1807
+ private _handleComponentFocusOut;
1808
+ connectedCallback(): void;
1809
+ disconnectedCallback(): void;
1810
+ protected willUpdate(changedProperties: PropertyValues): void;
1811
+ protected updated(changedProperties: PropertyValues): void;
1812
+ protected formResetCallback(): void;
1813
+ private _isValidStep;
1814
+ private _syncDisplayFromValue;
1815
+ private _syncValueFromDisplay;
1816
+ private get _minuteStep();
1817
+ private get _hourOptions();
1818
+ private get _minuteOptions();
1819
+ private _openPopup;
1820
+ private _closePopup;
1821
+ private _togglePopup;
1822
+ private _scrollToSelected;
1823
+ private _focusSelectedOrFirst;
1824
+ private _handleHoursKeydown;
1825
+ private _handleHoursBlur;
1826
+ private _handleMinutesKeydown;
1827
+ private _handleMinutesBlur;
1828
+ private _handleOptionClick;
1829
+ private _focusOptionAndSync;
1830
+ private _handlePopupKeydown;
1831
+ private _stepTime;
1832
+ private _renderOption;
1833
+ private _renderPopup;
1834
+ private _renderContainer;
1835
+ render(): TemplateResult<1>;
1836
+ }
1837
+
1748
1838
  declare type Props = ElementProps<PktElement, 'strings' | 'role'>;
1749
1839
 
1750
1840
  declare type Props_10 = ElementProps<PktOptionsInputElement, 'options'>;
1751
1841
 
1842
+ declare type Props_11 = ElementProps<PktTimepicker, 'value' | 'hidePicker' | 'stepArrows'>;
1843
+
1752
1844
  declare type Props_2 = ElementProps<PktInputElement, 'defaultValue' | 'disabled' | 'readonly' | 'required' | 'max' | 'maxlength' | 'min' | 'minlength' | 'ariaDescribedBy' | 'ariaLabelledby' | 'name' | 'pattern' | 'placeholder' | 'id' | 'counter' | 'hasError' | 'hasFieldset' | 'inline' | 'optionalTag' | 'requiredTag' | 'skipForwardTestid' | 'useWrapper' | 'fullwidth' | 'counterMaxLength' | 'errorMessage' | 'helptext' | 'helptextDropdown' | 'helptextDropdownButton' | 'label' | 'optionalText' | 'requiredText' | 'dataTestid'>;
1753
1845
 
1754
1846
  declare type Props_3 = ElementProps<PktCheckbox, 'checkHelptext' | 'defaultChecked' | 'hasTile' | 'isSwitch' | 'labelPosition' | 'hideLabel' | 'tagText' | 'optionalTag' | 'optionalText' | 'requiredTag' | 'requiredText'>;
@@ -1,8 +1,8 @@
1
- import { s as g, n as o } from "./element-CV9utnHJ.js";
1
+ import { s as g, n as o } from "./element-CPpT3rFQ.js";
2
2
  import { u as Ft } from "./utils-DznhwRXm.js";
3
3
  import { b as Tt } from "./booleanish-C9R0tdXH.js";
4
4
  import { s as xt } from "./input-wrapper-CDgenrYA.js";
5
- import { P as It } from "./element-with-slot-1djk8KXi.js";
5
+ import { P as It } from "./element-with-slot-Dqk6-TRR.js";
6
6
  var ct = {}, dt;
7
7
  function Rt() {
8
8
  return dt || (dt = 1, (function() {
@@ -659,7 +659,7 @@ class c extends It {
659
659
  */
660
660
  onChange(a) {
661
661
  if (!this.touched) {
662
- this.touched = !0, a && this.setFormValue(a);
662
+ this.touched = !0, a && this.setFormValue(a), this.validate();
663
663
  return;
664
664
  }
665
665
  if (typeof a != "string" && !Array.isArray(a))
@@ -1 +1 @@
1
- "use strict";const r=require("./element-CMTfByxQ.cjs"),Ct=require("./utils-byXsEz1u.cjs"),Ft=require("./booleanish-BKVonob4.cjs"),Tt=require("./input-wrapper-EoSAbU-U.cjs"),xt=require("./element-with-slot-yT8k1Z37.cjs");var lt={},ct;function It(){return ct||(ct=1,(function(){(function(p){const a=new WeakMap,n=new WeakMap,f=new WeakMap,u=new WeakMap,b=new WeakMap,k=new WeakMap,S=new WeakMap,g=new WeakMap,A=new WeakMap,V=new WeakMap,C=new WeakMap,F=new WeakMap,z=new WeakMap,K=new WeakMap,x=new WeakMap,I={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",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"},ht=(e,t)=>{for(let i in I){t[i]=null;let s=null;const o=I[i];Object.defineProperty(t,i,{get(){return s},set(d){s=d,e.isConnected?M(e,o,d):V.set(e,t)}})}};function j(e){const t=u.get(e),{form:i}=t;Z(e,i,t),Y(e,t.labels)}const G=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(d){return u.has(d)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=i.nextNode();const o=!t||e.disabled;for(;s;)s.formDisabledCallback&&o&&B(s,e.disabled),s=i.nextNode()},J={attributes:!0,attributeFilter:["disabled","name"]},R=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?B(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&G(i)),t.attributeName==="name"&&i.constructor.formAssociated){const s=u.get(i),o=A.get(i);s.setFormValue(o)}}}):{};function P(e){e.forEach(t=>{const{addedNodes:i,removedNodes:s}=t,o=Array.from(i),d=Array.from(s);o.forEach(h=>{var y;if(u.has(h)&&h.constructor.formAssociated&&j(h),V.has(h)){const m=V.get(h);Object.keys(I).filter(v=>m[v]!==null).forEach(v=>{M(h,I[v],m[v])}),V.delete(h)}if(x.has(h)){const m=x.get(h);M(h,"internals-valid",m.validity.valid.toString()),M(h,"internals-invalid",(!m.validity.valid).toString()),M(h,"aria-invalid",(!m.validity.valid).toString()),x.delete(h)}if(h.localName==="form"){const m=g.get(h),E=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT,{acceptNode($){return u.has($)&&$.constructor.formAssociated&&!(m&&m.has($))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let v=E.nextNode();for(;v;)j(v),v=E.nextNode()}h.localName==="fieldset"&&((y=R.observe)===null||y===void 0||y.call(R,h,J),G(h,!0))}),d.forEach(h=>{const y=u.get(h);y&&f.get(y)&&Q(y),S.has(h)&&S.get(h).disconnect()})})}function ut(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(s=>{const o=z.get(t.target);u.has(s)&&et(s),o.disconnect()})})}const ft=e=>{var t,i;const s=new MutationObserver(ut);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=s.observe)===null||i===void 0||i.call(s,e,{childList:!0}),z.set(e,s)};O()&&new MutationObserver(P);const W={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},B=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},Q=e=>{f.get(e).forEach(i=>{i.remove()}),f.set(e,[])},X=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),f.get(t).push(i),i},pt=(e,t)=>{var i;f.set(t,[]),(i=R.observe)===null||i===void 0||i.call(R,e,J)},Y=(e,t)=>{if(t.length){Array.from(t).forEach(s=>s.addEventListener("click",e.click.bind(e)));let i=t[0].id;t[0].id||(i=`${t[0].htmlFor}_Label`,t[0].id=i),M(e,"aria-labelledby",i)}},L=e=>{const t=Array.from(e.elements).filter(d=>!d.tagName.includes("-")&&d.validity).map(d=>d.validity.valid),i=g.get(e)||[],s=Array.from(i).filter(d=>d.isConnected).map(d=>u.get(d).validity.valid),o=[...t,...s].includes(!1);e.toggleAttribute("internals-invalid",o),e.toggleAttribute("internals-valid",!o)},mt=e=>{L(N(e.target))},yt=e=>{L(N(e.target))},gt=e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map(i=>`${i}:not([disabled])`).map(i=>`${i}:not([form])${e.id?`,${i}[form='${e.id}']`:""}`).join(",");e.addEventListener("click",i=>{if(i.target.closest(t)){const o=g.get(e);if(e.noValidate)return;o.size&&Array.from(o).reverse().map(y=>u.get(y).reportValidity()).includes(!1)&&i.preventDefault()}})},vt=e=>{const t=g.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},Z=(e,t,i)=>{if(t){const s=g.get(t);if(s)s.add(e);else{const o=new Set;o.add(e),g.set(t,o),gt(t),t.addEventListener("reset",vt),t.addEventListener("input",mt),t.addEventListener("change",yt)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),L(t)}},N=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=N(t)),t},w=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},tt=(e,t,i)=>{const s=g.get(e);return s&&s.size&&s.forEach(o=>{u.get(o)[i]()||(t=!1)}),t},et=e=>{if(e.constructor.formAssociated){const t=u.get(e),{labels:i,form:s}=t;Y(e,i),Z(e,s,t)}};function O(){return typeof MutationObserver<"u"}class bt{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)}}const wt=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),Et=(e,t,i)=>(e.valid=Mt(t),Object.keys(t).forEach(s=>e[s]=t[s]),i&&L(i),e),Mt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},_=new WeakMap;function it(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class H extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");_.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);const i=super.add(t),s=_.get(this),o=`state${t}`;return s.isConnected?it(s,o):setTimeout(()=>{it(s,o)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),s=_.get(this);return s.isConnected?(s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)):setTimeout(()=>{s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)}),i}}function at(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(e):s?s.value:t.get(e)}function kt(e,t,i,s,o){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var T;class Vt{constructor(t){T.set(this,void 0),kt(this,T,t);for(let i=0;i<t.length;i++){let s=t[i];this[i]=s,s.hasAttribute("name")&&(this[s.getAttribute("name")]=s)}Object.freeze(this)}get length(){return at(this,T,"f").length}[(T=new WeakMap,Symbol.iterator)](){return at(this,T,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function St(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=s;function i(...d){let h=e.apply(this,d);return tt(this,h,"checkValidity")}function s(...d){let h=t.apply(this,d);return tt(this,h,"reportValidity")}const{get:o}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...d){const h=o.call(this,...d),y=Array.from(g.get(this)||[]);if(y.length===0)return h;const m=Array.from(h).concat(y).sort((E,v)=>E.compareDocumentPosition?E.compareDocumentPosition(v)&2?1:-1:0);return new Vt(m)}})}class st{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),s=new bt;this.states=new H(t),a.set(this,t),n.set(this,s),u.set(t,this),ht(t,this),pt(t,this),Object.seal(this),i instanceof DocumentFragment&&ft(i)}checkValidity(){const t=a.get(this);if(w(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=n.get(this);if(!i.valid){const s=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(s)}return i.valid}get form(){const t=a.get(this);w(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let i;return t.constructor.formAssociated===!0&&(i=N(t)),i}get labels(){const t=a.get(this);w(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const i=t.getAttribute("id"),s=t.getRootNode();return s&&i?s.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=a.get(this);if(w(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=this.checkValidity(),s=F.get(this);if(s&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&s&&(t.focus(),s.focus()),i}setFormValue(t){const i=a.get(this);if(w(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Q(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const s=X(i,this);s.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([s,o])=>{if(typeof o=="string"){const d=X(i,this);d.name=s,d.value=o}});A.set(i,t)}setValidity(t,i,s){const o=a.get(this);if(w(o,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");F.set(this,s);const d=n.get(this),h={};for(const E in t)h[E]=t[E];Object.keys(h).length===0&&wt(d);const y=Object.assign(Object.assign({},d),h);delete y.valid;const{valid:m}=Et(d,y,this.form);if(!m&&!i)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.");b.set(this,m?"":i),o.isConnected?(o.toggleAttribute("internals-invalid",!m),o.toggleAttribute("internals-valid",m),M(o,"aria-invalid",`${!m}`)):x.set(o,this)}get shadowRoot(){const t=a.get(this),i=C.get(t);return i||null}get validationMessage(){const t=a.get(this);return w(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),b.get(this)}get validity(){const t=a.get(this);return w(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get willValidate(){const t=a.get(this);return w(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function At(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const i=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(s=>s in i.internals)}let rt=!1,nt=!1;function q(e){nt||(nt=!0,window.CustomStateSet=H,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new H(this),i}))}function ot(e=!0){if(!rt){if(rt=!0,typeof window<"u"&&(window.ElementInternals=st),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,s,o){if(s.formAssociated){const d=s.prototype.connectedCallback;s.prototype.connectedCallback=function(){K.has(this)||(K.set(this,!0),this.hasAttribute("disabled")&&B(this,!0)),d!=null&&d.apply(this),et(this)}}t.call(this,i,s,o)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new st(this)}),typeof Element<"u"){let t=function(...s){const o=i.apply(this,s);if(C.set(this,o),O()){const d=new MutationObserver(P);window.ShadyDOM?d.observe(this,W):d.observe(o,W),S.set(this,d)}return o};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(P).observe(document.documentElement,W),typeof HTMLFormElement<"u"&&St(),(e||typeof window<"u"&&!window.CustomStateSet)&&q()}}return!!customElements.polyfillWrapFlushCallback||(At()?typeof window<"u"&&!window.CustomStateSet&&q(HTMLElement.prototype.attachInternals):ot(!1)),p.forceCustomStateSetPolyfill=q,p.forceElementInternalsPolyfill=ot,Object.defineProperty(p,"__esModule",{value:!0}),p})({})})()),lt}It();var Rt=Object.defineProperty,c=(p,a,n,f)=>{for(var u=void 0,b=p.length-1,k;b>=0;b--)(k=p[b])&&(u=k(a,n,u)||u);return u&&Rt(a,n,u),u};const dt="on",U="--checked",D=",";class l extends xt.PktElementWithSlot{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=Ct.uuidish(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,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=Tt.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.strings.forms.labels.optional,this.requiredText=r.strings.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(a){var n,f,u,b,k,S,g,A,V,C,F;if(!a){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.strings.forms.messages.required,a):(n=a.validity)!=null&&n.typeMismatch||(f=a.validity)!=null&&f.badInput?this.internals.setValidity({typeMismatch:!0},r.strings.forms.messages.invalid,a):(u=a.validity)!=null&&u.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.strings.forms.messages.invalidPattern,a):(b=a.validity)!=null&&b.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.strings.forms.messages.tooShort,a):(k=a.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.strings.forms.messages.tooLong,a):(S=a.validity)!=null&&S.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.strings.forms.messages.rangeUnderflowMin.replace("{min}",(g=this.min)==null?void 0:g.toString()):r.strings.forms.messages.rangeUnderflow,a):(A=a.validity)!=null&&A.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.strings.forms.messages.invalid,a):(V=a.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.strings.forms.messages.rangeOverflowMax.replace("{max}",(C=this.max)==null?void 0:C.toString()):r.strings.forms.messages.rangeOverflow,a):(F=a.validity)!=null&&F.customError?this.internals.setValidity({customError:!0},a.validationMessage,a):this.internals.setValidity({})}setFormValue(a){if(this.internals)if(Array.isArray(a)){const n=new FormData;a.forEach(f=>{n.append(this.name,f)}),this.internals.setFormValue(n)}else this.internals.setFormValue(a)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const a=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(a).forEach(n=>{var f;if(n!==this&&n.getAttribute("name")===this.name&&n.getAttribute("value")!==this.value){const u=n;u.checked&&(u.checked=!1,u.internals&&(u.internals.setFormValue(null),(f=u.internals.states)==null||f.delete(U)))}})}valueChecked(a){if(!this.touched)return;const n=this.internals.form||this.closest("form"),f=n?new FormData(n):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof a=="string"?(this.checked=a==="true",this.internals.ariaChecked=String(a==="true")):typeof a=="boolean"&&(this.checked=a,this.internals.ariaChecked=String(a)),this.checked){const u=(typeof this.value=="string"?this.value:"")||dt;this.internals.setFormValue(u),f&&f.append(this.name,u),this.internals.states.add(U)}else this.internals.setFormValue(null),f&&f.delete(this.name),this.internals.states.delete(U);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(a,n){(n!==this.value||n!==this._value)&&(typeof a=="string"?((this.multiple||this.range)&&a.includes(D)&&(a=a.split(D)),this.value=a,this._value=Array.isArray(a)?a:[a]):Array.isArray(a)?(this.value=this.multiple||this.range?a:a[0],this._value=a):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.toString())&&this.onChange(this.value))}dispatchChangeEvents(a){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:a,bubbles:!0,composed:!0}))}clearInputValue(){const a=this.multiple||this.range?[]:"";this.value=a,this.setFormValue(a),this.dispatchChangeEvents(a)}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(a){return(this.range||this.multiple)&&typeof a=="string"&&a.includes(D)?a.split(D):!this.multiple&&!this.range&&Array.isArray(a)?a[0]||"":a}validate(){var a,n;(a=this.inputRef)!=null&&a.value&&this.manageValidity(this.inputRef.value),(n=this.inputRefTo)!=null&&n.value&&this.manageValidity(this.inputRefTo.value)}onChange(a){if(!this.touched){this.touched=!0,a&&this.setFormValue(a);return}if(typeof a!="string"&&!Array.isArray(a))return;const n=this.normalizeValue(a);this.setFormValue(n),this.validate(),this.dispatchChangeEvents(n)}formResetCallback(){var a;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(n=>{"selected"in n&&(n.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(a=this.inputRef)!=null&&a.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const n=this.defaultValue||(this.multiple||this.range?[]:"");this.value=n,this._value=Array.isArray(n)?n:[n],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(a){super.updated(a),a.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(a){if(super.firstUpdated(a),!this.form){const n=this.internals.form||this.closest("form");this.form=n}if(this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const n=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(n);const f=n?(typeof this.value=="string"?this.value:"")||dt:null;this.internals.setFormValue(f)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}}c([r.n({type:Boolean,reflect:!0})],l.prototype,"checked");c([r.n({type:Boolean})],l.prototype,"defaultChecked");c([r.n({type:Boolean})],l.prototype,"multiple");c([r.n({type:Boolean})],l.prototype,"range");c([r.n({type:String,reflect:!0})],l.prototype,"type");c([r.n()],l.prototype,"defaultValue");c([r.n({type:Boolean,reflect:!0})],l.prototype,"disabled");c([r.n({type:Boolean,reflect:!0})],l.prototype,"readonly");c([r.n({type:Boolean,reflect:!0})],l.prototype,"required");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"max");c([r.n({type:Number,reflect:!0})],l.prototype,"maxlength");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"min");c([r.n({type:Number,reflect:!0})],l.prototype,"minlength");c([r.n({type:Number,reflect:!0})],l.prototype,"step");c([r.n({type:String})],l.prototype,"ariaDescribedBy");c([r.n({type:String})],l.prototype,"ariaLabelledby");c([r.n({type:String,reflect:!0})],l.prototype,"name");c([r.n({type:String,reflect:!0})],l.prototype,"pattern");c([r.n({type:String,reflect:!0})],l.prototype,"placeholder");c([r.n({type:String,reflect:!0})],l.prototype,"id");c([r.n({type:Boolean})],l.prototype,"counter");c([r.n({type:Boolean})],l.prototype,"hasError");c([r.n({type:Boolean})],l.prototype,"inline");c([r.n({type:Boolean})],l.prototype,"hasFieldset");c([r.n({type:Boolean})],l.prototype,"optionalTag");c([r.n({type:Boolean})],l.prototype,"requiredTag");c([r.n({type:Boolean})],l.prototype,"skipForwardTestid");c([r.n({type:Boolean,reflect:!0,converter:Ft.booleanishConverter})],l.prototype,"useWrapper");c([r.n({type:Boolean,reflect:!0})],l.prototype,"fullwidth");c([r.n({type:Number})],l.prototype,"counterMaxLength");c([r.n({type:String})],l.prototype,"errorMessage");c([r.n({type:String})],l.prototype,"helptext");c([r.n({type:String})],l.prototype,"helptextDropdown");c([r.n({type:String,reflect:!1})],l.prototype,"helptextDropdownButton");c([r.n({type:String})],l.prototype,"label");c([r.n({type:String,reflect:!1})],l.prototype,"optionalText");c([r.n({type:String,reflect:!1})],l.prototype,"requiredText");c([r.n({type:String,reflect:!1})],l.prototype,"tagText");c([r.n({type:String,attribute:"data-testid"})],l.prototype,"dataTestid");exports.PktInputElement=l;
1
+ "use strict";const r=require("./element-gR_VtSiD.cjs"),Ct=require("./utils-byXsEz1u.cjs"),Ft=require("./booleanish-BKVonob4.cjs"),Tt=require("./input-wrapper-EoSAbU-U.cjs"),xt=require("./element-with-slot-ZX-up7jO.cjs");var lt={},ct;function It(){return ct||(ct=1,(function(){(function(p){const a=new WeakMap,n=new WeakMap,f=new WeakMap,u=new WeakMap,b=new WeakMap,k=new WeakMap,S=new WeakMap,g=new WeakMap,A=new WeakMap,V=new WeakMap,C=new WeakMap,F=new WeakMap,z=new WeakMap,K=new WeakMap,x=new WeakMap,I={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",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"},ht=(e,t)=>{for(let i in I){t[i]=null;let s=null;const o=I[i];Object.defineProperty(t,i,{get(){return s},set(d){s=d,e.isConnected?M(e,o,d):V.set(e,t)}})}};function j(e){const t=u.get(e),{form:i}=t;Z(e,i,t),Y(e,t.labels)}const G=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(d){return u.has(d)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=i.nextNode();const o=!t||e.disabled;for(;s;)s.formDisabledCallback&&o&&B(s,e.disabled),s=i.nextNode()},J={attributes:!0,attributeFilter:["disabled","name"]},R=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?B(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&G(i)),t.attributeName==="name"&&i.constructor.formAssociated){const s=u.get(i),o=A.get(i);s.setFormValue(o)}}}):{};function P(e){e.forEach(t=>{const{addedNodes:i,removedNodes:s}=t,o=Array.from(i),d=Array.from(s);o.forEach(h=>{var y;if(u.has(h)&&h.constructor.formAssociated&&j(h),V.has(h)){const m=V.get(h);Object.keys(I).filter(v=>m[v]!==null).forEach(v=>{M(h,I[v],m[v])}),V.delete(h)}if(x.has(h)){const m=x.get(h);M(h,"internals-valid",m.validity.valid.toString()),M(h,"internals-invalid",(!m.validity.valid).toString()),M(h,"aria-invalid",(!m.validity.valid).toString()),x.delete(h)}if(h.localName==="form"){const m=g.get(h),E=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT,{acceptNode($){return u.has($)&&$.constructor.formAssociated&&!(m&&m.has($))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let v=E.nextNode();for(;v;)j(v),v=E.nextNode()}h.localName==="fieldset"&&((y=R.observe)===null||y===void 0||y.call(R,h,J),G(h,!0))}),d.forEach(h=>{const y=u.get(h);y&&f.get(y)&&Q(y),S.has(h)&&S.get(h).disconnect()})})}function ut(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(s=>{const o=z.get(t.target);u.has(s)&&et(s),o.disconnect()})})}const ft=e=>{var t,i;const s=new MutationObserver(ut);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=s.observe)===null||i===void 0||i.call(s,e,{childList:!0}),z.set(e,s)};O()&&new MutationObserver(P);const W={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},B=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},Q=e=>{f.get(e).forEach(i=>{i.remove()}),f.set(e,[])},X=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),f.get(t).push(i),i},pt=(e,t)=>{var i;f.set(t,[]),(i=R.observe)===null||i===void 0||i.call(R,e,J)},Y=(e,t)=>{if(t.length){Array.from(t).forEach(s=>s.addEventListener("click",e.click.bind(e)));let i=t[0].id;t[0].id||(i=`${t[0].htmlFor}_Label`,t[0].id=i),M(e,"aria-labelledby",i)}},L=e=>{const t=Array.from(e.elements).filter(d=>!d.tagName.includes("-")&&d.validity).map(d=>d.validity.valid),i=g.get(e)||[],s=Array.from(i).filter(d=>d.isConnected).map(d=>u.get(d).validity.valid),o=[...t,...s].includes(!1);e.toggleAttribute("internals-invalid",o),e.toggleAttribute("internals-valid",!o)},mt=e=>{L(N(e.target))},yt=e=>{L(N(e.target))},gt=e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map(i=>`${i}:not([disabled])`).map(i=>`${i}:not([form])${e.id?`,${i}[form='${e.id}']`:""}`).join(",");e.addEventListener("click",i=>{if(i.target.closest(t)){const o=g.get(e);if(e.noValidate)return;o.size&&Array.from(o).reverse().map(y=>u.get(y).reportValidity()).includes(!1)&&i.preventDefault()}})},vt=e=>{const t=g.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},Z=(e,t,i)=>{if(t){const s=g.get(t);if(s)s.add(e);else{const o=new Set;o.add(e),g.set(t,o),gt(t),t.addEventListener("reset",vt),t.addEventListener("input",mt),t.addEventListener("change",yt)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),L(t)}},N=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=N(t)),t},w=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},tt=(e,t,i)=>{const s=g.get(e);return s&&s.size&&s.forEach(o=>{u.get(o)[i]()||(t=!1)}),t},et=e=>{if(e.constructor.formAssociated){const t=u.get(e),{labels:i,form:s}=t;Y(e,i),Z(e,s,t)}};function O(){return typeof MutationObserver<"u"}class bt{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)}}const wt=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),Et=(e,t,i)=>(e.valid=Mt(t),Object.keys(t).forEach(s=>e[s]=t[s]),i&&L(i),e),Mt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},_=new WeakMap;function it(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class H extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");_.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);const i=super.add(t),s=_.get(this),o=`state${t}`;return s.isConnected?it(s,o):setTimeout(()=>{it(s,o)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),s=_.get(this);return s.isConnected?(s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)):setTimeout(()=>{s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)}),i}}function at(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(e):s?s.value:t.get(e)}function kt(e,t,i,s,o){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var T;class Vt{constructor(t){T.set(this,void 0),kt(this,T,t);for(let i=0;i<t.length;i++){let s=t[i];this[i]=s,s.hasAttribute("name")&&(this[s.getAttribute("name")]=s)}Object.freeze(this)}get length(){return at(this,T,"f").length}[(T=new WeakMap,Symbol.iterator)](){return at(this,T,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function St(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=s;function i(...d){let h=e.apply(this,d);return tt(this,h,"checkValidity")}function s(...d){let h=t.apply(this,d);return tt(this,h,"reportValidity")}const{get:o}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...d){const h=o.call(this,...d),y=Array.from(g.get(this)||[]);if(y.length===0)return h;const m=Array.from(h).concat(y).sort((E,v)=>E.compareDocumentPosition?E.compareDocumentPosition(v)&2?1:-1:0);return new Vt(m)}})}class st{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),s=new bt;this.states=new H(t),a.set(this,t),n.set(this,s),u.set(t,this),ht(t,this),pt(t,this),Object.seal(this),i instanceof DocumentFragment&&ft(i)}checkValidity(){const t=a.get(this);if(w(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=n.get(this);if(!i.valid){const s=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(s)}return i.valid}get form(){const t=a.get(this);w(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let i;return t.constructor.formAssociated===!0&&(i=N(t)),i}get labels(){const t=a.get(this);w(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const i=t.getAttribute("id"),s=t.getRootNode();return s&&i?s.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=a.get(this);if(w(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=this.checkValidity(),s=F.get(this);if(s&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&s&&(t.focus(),s.focus()),i}setFormValue(t){const i=a.get(this);if(w(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Q(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const s=X(i,this);s.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([s,o])=>{if(typeof o=="string"){const d=X(i,this);d.name=s,d.value=o}});A.set(i,t)}setValidity(t,i,s){const o=a.get(this);if(w(o,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");F.set(this,s);const d=n.get(this),h={};for(const E in t)h[E]=t[E];Object.keys(h).length===0&&wt(d);const y=Object.assign(Object.assign({},d),h);delete y.valid;const{valid:m}=Et(d,y,this.form);if(!m&&!i)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.");b.set(this,m?"":i),o.isConnected?(o.toggleAttribute("internals-invalid",!m),o.toggleAttribute("internals-valid",m),M(o,"aria-invalid",`${!m}`)):x.set(o,this)}get shadowRoot(){const t=a.get(this),i=C.get(t);return i||null}get validationMessage(){const t=a.get(this);return w(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),b.get(this)}get validity(){const t=a.get(this);return w(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get willValidate(){const t=a.get(this);return w(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function At(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const i=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(s=>s in i.internals)}let rt=!1,nt=!1;function q(e){nt||(nt=!0,window.CustomStateSet=H,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new H(this),i}))}function ot(e=!0){if(!rt){if(rt=!0,typeof window<"u"&&(window.ElementInternals=st),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,s,o){if(s.formAssociated){const d=s.prototype.connectedCallback;s.prototype.connectedCallback=function(){K.has(this)||(K.set(this,!0),this.hasAttribute("disabled")&&B(this,!0)),d!=null&&d.apply(this),et(this)}}t.call(this,i,s,o)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new st(this)}),typeof Element<"u"){let t=function(...s){const o=i.apply(this,s);if(C.set(this,o),O()){const d=new MutationObserver(P);window.ShadyDOM?d.observe(this,W):d.observe(o,W),S.set(this,d)}return o};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(P).observe(document.documentElement,W),typeof HTMLFormElement<"u"&&St(),(e||typeof window<"u"&&!window.CustomStateSet)&&q()}}return!!customElements.polyfillWrapFlushCallback||(At()?typeof window<"u"&&!window.CustomStateSet&&q(HTMLElement.prototype.attachInternals):ot(!1)),p.forceCustomStateSetPolyfill=q,p.forceElementInternalsPolyfill=ot,Object.defineProperty(p,"__esModule",{value:!0}),p})({})})()),lt}It();var Rt=Object.defineProperty,c=(p,a,n,f)=>{for(var u=void 0,b=p.length-1,k;b>=0;b--)(k=p[b])&&(u=k(a,n,u)||u);return u&&Rt(a,n,u),u};const dt="on",U="--checked",D=",";class l extends xt.PktElementWithSlot{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=Ct.uuidish(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,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=Tt.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.strings.forms.labels.optional,this.requiredText=r.strings.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(a){var n,f,u,b,k,S,g,A,V,C,F;if(!a){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.strings.forms.messages.required,a):(n=a.validity)!=null&&n.typeMismatch||(f=a.validity)!=null&&f.badInput?this.internals.setValidity({typeMismatch:!0},r.strings.forms.messages.invalid,a):(u=a.validity)!=null&&u.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.strings.forms.messages.invalidPattern,a):(b=a.validity)!=null&&b.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.strings.forms.messages.tooShort,a):(k=a.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.strings.forms.messages.tooLong,a):(S=a.validity)!=null&&S.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.strings.forms.messages.rangeUnderflowMin.replace("{min}",(g=this.min)==null?void 0:g.toString()):r.strings.forms.messages.rangeUnderflow,a):(A=a.validity)!=null&&A.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.strings.forms.messages.invalid,a):(V=a.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.strings.forms.messages.rangeOverflowMax.replace("{max}",(C=this.max)==null?void 0:C.toString()):r.strings.forms.messages.rangeOverflow,a):(F=a.validity)!=null&&F.customError?this.internals.setValidity({customError:!0},a.validationMessage,a):this.internals.setValidity({})}setFormValue(a){if(this.internals)if(Array.isArray(a)){const n=new FormData;a.forEach(f=>{n.append(this.name,f)}),this.internals.setFormValue(n)}else this.internals.setFormValue(a)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const a=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(a).forEach(n=>{var f;if(n!==this&&n.getAttribute("name")===this.name&&n.getAttribute("value")!==this.value){const u=n;u.checked&&(u.checked=!1,u.internals&&(u.internals.setFormValue(null),(f=u.internals.states)==null||f.delete(U)))}})}valueChecked(a){if(!this.touched)return;const n=this.internals.form||this.closest("form"),f=n?new FormData(n):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof a=="string"?(this.checked=a==="true",this.internals.ariaChecked=String(a==="true")):typeof a=="boolean"&&(this.checked=a,this.internals.ariaChecked=String(a)),this.checked){const u=(typeof this.value=="string"?this.value:"")||dt;this.internals.setFormValue(u),f&&f.append(this.name,u),this.internals.states.add(U)}else this.internals.setFormValue(null),f&&f.delete(this.name),this.internals.states.delete(U);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(a,n){(n!==this.value||n!==this._value)&&(typeof a=="string"?((this.multiple||this.range)&&a.includes(D)&&(a=a.split(D)),this.value=a,this._value=Array.isArray(a)?a:[a]):Array.isArray(a)?(this.value=this.multiple||this.range?a:a[0],this._value=a):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.toString())&&this.onChange(this.value))}dispatchChangeEvents(a){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:a,bubbles:!0,composed:!0}))}clearInputValue(){const a=this.multiple||this.range?[]:"";this.value=a,this.setFormValue(a),this.dispatchChangeEvents(a)}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(a){return(this.range||this.multiple)&&typeof a=="string"&&a.includes(D)?a.split(D):!this.multiple&&!this.range&&Array.isArray(a)?a[0]||"":a}validate(){var a,n;(a=this.inputRef)!=null&&a.value&&this.manageValidity(this.inputRef.value),(n=this.inputRefTo)!=null&&n.value&&this.manageValidity(this.inputRefTo.value)}onChange(a){if(!this.touched){this.touched=!0,a&&this.setFormValue(a),this.validate();return}if(typeof a!="string"&&!Array.isArray(a))return;const n=this.normalizeValue(a);this.setFormValue(n),this.validate(),this.dispatchChangeEvents(n)}formResetCallback(){var a;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(n=>{"selected"in n&&(n.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(a=this.inputRef)!=null&&a.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const n=this.defaultValue||(this.multiple||this.range?[]:"");this.value=n,this._value=Array.isArray(n)?n:[n],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(a){super.updated(a),a.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(a){if(super.firstUpdated(a),!this.form){const n=this.internals.form||this.closest("form");this.form=n}if(this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const n=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(n);const f=n?(typeof this.value=="string"?this.value:"")||dt:null;this.internals.setFormValue(f)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}}c([r.n({type:Boolean,reflect:!0})],l.prototype,"checked");c([r.n({type:Boolean})],l.prototype,"defaultChecked");c([r.n({type:Boolean})],l.prototype,"multiple");c([r.n({type:Boolean})],l.prototype,"range");c([r.n({type:String,reflect:!0})],l.prototype,"type");c([r.n()],l.prototype,"defaultValue");c([r.n({type:Boolean,reflect:!0})],l.prototype,"disabled");c([r.n({type:Boolean,reflect:!0})],l.prototype,"readonly");c([r.n({type:Boolean,reflect:!0})],l.prototype,"required");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"max");c([r.n({type:Number,reflect:!0})],l.prototype,"maxlength");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"min");c([r.n({type:Number,reflect:!0})],l.prototype,"minlength");c([r.n({type:Number,reflect:!0})],l.prototype,"step");c([r.n({type:String})],l.prototype,"ariaDescribedBy");c([r.n({type:String})],l.prototype,"ariaLabelledby");c([r.n({type:String,reflect:!0})],l.prototype,"name");c([r.n({type:String,reflect:!0})],l.prototype,"pattern");c([r.n({type:String,reflect:!0})],l.prototype,"placeholder");c([r.n({type:String,reflect:!0})],l.prototype,"id");c([r.n({type:Boolean})],l.prototype,"counter");c([r.n({type:Boolean})],l.prototype,"hasError");c([r.n({type:Boolean})],l.prototype,"inline");c([r.n({type:Boolean})],l.prototype,"hasFieldset");c([r.n({type:Boolean})],l.prototype,"optionalTag");c([r.n({type:Boolean})],l.prototype,"requiredTag");c([r.n({type:Boolean})],l.prototype,"skipForwardTestid");c([r.n({type:Boolean,reflect:!0,converter:Ft.booleanishConverter})],l.prototype,"useWrapper");c([r.n({type:Boolean,reflect:!0})],l.prototype,"fullwidth");c([r.n({type:Number})],l.prototype,"counterMaxLength");c([r.n({type:String})],l.prototype,"errorMessage");c([r.n({type:String})],l.prototype,"helptext");c([r.n({type:String})],l.prototype,"helptextDropdown");c([r.n({type:String,reflect:!1})],l.prototype,"helptextDropdownButton");c([r.n({type:String})],l.prototype,"label");c([r.n({type:String,reflect:!1})],l.prototype,"optionalText");c([r.n({type:String,reflect:!1})],l.prototype,"requiredText");c([r.n({type:String,reflect:!1})],l.prototype,"tagText");c([r.n({type:String,attribute:"data-testid"})],l.prototype,"dataTestid");exports.PktInputElement=l;
@@ -1,4 +1,4 @@
1
- "use strict";const u=require("./element-with-slot-yT8k1Z37.cjs"),y=require("./if-defined-hKKmbsI8.cjs"),t=require("./element-CMTfByxQ.cjs"),k=require("./icon-Dj0oZZSa.cjs"),$=require("./class-map-Bokp1SoS.cjs"),f=require("./utils-byXsEz1u.cjs"),x=require("./booleanish-BKVonob4.cjs"),r=require("./input-wrapper-EoSAbU-U.cjs");require("./helptext-B366oeR9.cjs");require("./alert-C95U_RZ0.cjs");var I=Object.defineProperty,P=Object.getOwnPropertyDescriptor,e=(l,p,n,o)=>{for(var s=o>1?void 0:o?P(p,n):p,i=l.length-1,a;i>=0;i--)(a=l[i])&&(s=(o?a(p,n,s):a(s))||s);return o&&s&&I(p,n,s),s};exports.PktInputWrapper=class extends u.PktElementWithSlot{constructor(){super(...arguments),this.forId=f.uuidish(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=r.specs.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=r.specs.props.optionalTag.default,this.optionalText=r.specs.props.optionalText.default,this.requiredTag=r.specs.props.requiredTag.default,this.requiredText=r.specs.props.requiredText.default,this.tagText=null,this.hasError=r.specs.props.hasError.default,this.errorMessage="",this.disabled=r.specs.props.disabled.default,this.inline=r.specs.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=r.specs.props.hasFieldset.default,this.role="group",this.useWrapper=r.specs.props.useWrapper.default}updated(p){super.updated(p)}render(){const p={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},n="pkt-tag pkt-tag--small pkt-tag--thin-text",o=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:t.A,s=()=>t.b`
1
+ "use strict";const u=require("./element-with-slot-ZX-up7jO.cjs"),y=require("./if-defined-BOW3ODSj.cjs"),t=require("./element-gR_VtSiD.cjs"),k=require("./icon-Bqj9oBbl.cjs"),$=require("./class-map-CsENJXf1.cjs"),f=require("./utils-byXsEz1u.cjs"),x=require("./booleanish-BKVonob4.cjs"),r=require("./input-wrapper-EoSAbU-U.cjs");require("./helptext-5Mzp65-F.cjs");require("./alert-DFkFNTxh.cjs");var I=Object.defineProperty,P=Object.getOwnPropertyDescriptor,e=(l,p,n,o)=>{for(var s=o>1?void 0:o?P(p,n):p,i=l.length-1,a;i>=0;i--)(a=l[i])&&(s=(o?a(p,n,s):a(s))||s);return o&&s&&I(p,n,s),s};exports.PktInputWrapper=class extends u.PktElementWithSlot{constructor(){super(...arguments),this.forId=f.uuidish(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=r.specs.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=r.specs.props.optionalTag.default,this.optionalText=r.specs.props.optionalText.default,this.requiredTag=r.specs.props.requiredTag.default,this.requiredText=r.specs.props.requiredText.default,this.tagText=null,this.hasError=r.specs.props.hasError.default,this.errorMessage="",this.disabled=r.specs.props.disabled.default,this.inline=r.specs.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=r.specs.props.hasFieldset.default,this.role="group",this.useWrapper=r.specs.props.useWrapper.default}updated(p){super.updated(p)}render(){const p={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},n="pkt-tag pkt-tag--small pkt-tag--thin-text",o=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:t.A,s=()=>t.b`
2
2
  ${this.tagText?t.b`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:t.A}
3
3
  ${this.optionalTag?t.b`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.A}
4
4
  ${this.requiredTag?t.b`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:t.A}
@@ -1,13 +1,13 @@
1
- import { P as $, s as g } from "./element-with-slot-1djk8KXi.js";
2
- import { o as x } from "./if-defined-rXcLNTzN.js";
3
- import { A as s, b as o, n as r, t as m } from "./element-CV9utnHJ.js";
4
- import { o as k } from "./icon-D0IQAVwS.js";
5
- import { e as v } from "./class-map-3ADKve8g.js";
1
+ import { P as $, s as g } from "./element-with-slot-Dqk6-TRR.js";
2
+ import { o as x } from "./if-defined-B0krMLad.js";
3
+ import { A as s, b as o, n as r, t as m } from "./element-CPpT3rFQ.js";
4
+ import { o as k } from "./icon-BlKA8YuW.js";
5
+ import { e as v } from "./class-map-CEnykyO_.js";
6
6
  import { u as w } from "./utils-DznhwRXm.js";
7
7
  import { b as T } from "./booleanish-C9R0tdXH.js";
8
8
  import { s as p } from "./input-wrapper-CDgenrYA.js";
9
- import "./helptext-DepcDYFV.js";
10
- import "./alert-ca_hFi-u.js";
9
+ import "./helptext-jIoWRcCF.js";
10
+ import "./alert-BuAXrnKl.js";
11
11
  var E = Object.defineProperty, D = Object.getOwnPropertyDescriptor, e = (l, a, n, h) => {
12
12
  for (var i = h > 1 ? void 0 : h ? D(a, n) : a, d = l.length - 1, u; d >= 0; d--)
13
13
  (u = l[d]) && (i = (h ? u(a, n, i) : u(i)) || i);
@@ -1,4 +1,4 @@
1
- "use strict";const c=require("./element-with-slot-yT8k1Z37.cjs"),t=require("./element-CMTfByxQ.cjs"),h=require("./class-map-Bokp1SoS.cjs");require("./icon-Dj0oZZSa.cjs");const k={href:{default:"#"},target:{default:"_self"}},a={props:k};var f=Object.defineProperty,u=Object.getOwnPropertyDescriptor,i=(o,n,s,r)=>{for(var e=r>1?void 0:r?u(n,s):n,l=o.length-1,p;l>=0;l--)(p=o[l])&&(e=(r?p(n,s,e):p(e))||e);return r&&e&&f(n,s,e),e};exports.PktLink=class extends c.PktElementWithSlot{constructor(){super(...arguments),this.href=a.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=a.props.target.default}render(){const n={"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};return t.b`<a
1
+ "use strict";const c=require("./element-with-slot-ZX-up7jO.cjs"),t=require("./element-gR_VtSiD.cjs"),h=require("./class-map-CsENJXf1.cjs");require("./icon-Bqj9oBbl.cjs");const k={href:{default:"#"},target:{default:"_self"}},a={props:k};var f=Object.defineProperty,u=Object.getOwnPropertyDescriptor,i=(o,n,s,r)=>{for(var e=r>1?void 0:r?u(n,s):n,l=o.length-1,p;l>=0;l--)(p=o[l])&&(e=(r?p(n,s,e):p(e))||e);return r&&e&&f(n,s,e),e};exports.PktLink=class extends c.PktElementWithSlot{constructor(){super(...arguments),this.href=a.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=a.props.target.default}render(){const n={"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};return t.b`<a
2
2
  class=${h.e(n)}
3
3
  href=${this.href}
4
4
  .target=${this.target}
@@ -1,7 +1,7 @@
1
- import { P as h, s as m } from "./element-with-slot-1djk8KXi.js";
2
- import { A as u, b as c, n as i, t as g } from "./element-CV9utnHJ.js";
3
- import { e as P } from "./class-map-3ADKve8g.js";
4
- import "./icon-D0IQAVwS.js";
1
+ import { P as h, s as m } from "./element-with-slot-Dqk6-TRR.js";
2
+ import { A as u, b as c, n as i, t as g } from "./element-CPpT3rFQ.js";
3
+ import { e as P } from "./class-map-CEnykyO_.js";
4
+ import "./icon-BlKA8YuW.js";
5
5
  const k = { href: { default: "#" }, target: { default: "_self" } }, f = {
6
6
  props: k
7
7
  };
@@ -1,7 +1,7 @@
1
- import { b as c, n, t as f } from "./element-CV9utnHJ.js";
2
- import { P as h, s as k } from "./element-with-slot-1djk8KXi.js";
3
- import "./icon-D0IQAVwS.js";
4
- import { o as m } from "./if-defined-rXcLNTzN.js";
1
+ import { b as c, n, t as f } from "./element-CPpT3rFQ.js";
2
+ import { P as h, s as k } from "./element-with-slot-Dqk6-TRR.js";
3
+ import "./icon-BlKA8YuW.js";
4
+ import { o as m } from "./if-defined-B0krMLad.js";
5
5
  var _ = Object.defineProperty, u = Object.getOwnPropertyDescriptor, r = (o, i, l, s) => {
6
6
  for (var e = s > 1 ? void 0 : s ? u(i, l) : i, p = o.length - 1, a; p >= 0; p--)
7
7
  (a = o[p]) && (e = (s ? a(i, l, e) : a(e)) || e);
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-CMTfByxQ.cjs"),k=require("./element-with-slot-yT8k1Z37.cjs");require("./icon-Dj0oZZSa.cjs");const p=require("./if-defined-hKKmbsI8.cjs");var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(l,n,i,s)=>{for(var e=s>1?void 0:s?h(n,i):n,o=l.length-1,a;o>=0;o--)(a=l[o])&&(e=(s?a(n,i,e):a(e))||e);return s&&e&&c(n,i,e),e};exports.PktLinkCard=class extends k.PktElementWithSlot{constructor(){super(...arguments),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal"}render(){const n=["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(" ");return t.b`
1
+ "use strict";const t=require("./element-gR_VtSiD.cjs"),k=require("./element-with-slot-ZX-up7jO.cjs");require("./icon-Bqj9oBbl.cjs");const p=require("./if-defined-BOW3ODSj.cjs");var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(l,n,i,s)=>{for(var e=s>1?void 0:s?h(n,i):n,o=l.length-1,a;o>=0;o--)(a=l[o])&&(e=(s?a(n,i,e):a(e))||e);return s&&e&&c(n,i,e),e};exports.PktLinkCard=class extends k.PktElementWithSlot{constructor(){super(...arguments),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal"}render(){const n=["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(" ");return t.b`
2
2
  <a
3
3
  href=${this.href}
4
4
  class=${n}
@@ -1,8 +1,8 @@
1
- import { P as v, b as d, A as h, s as _, n as o, t as O } from "./element-CV9utnHJ.js";
2
- import { r as w } from "./state-l4hGZdFJ.js";
3
- import { o as m } from "./if-defined-rXcLNTzN.js";
4
- import { c as $ } from "./repeat-DnlRNf63.js";
5
- import { e as g } from "./class-map-3ADKve8g.js";
1
+ import { P as v, b as d, A as h, s as _, n as o, t as O } from "./element-CPpT3rFQ.js";
2
+ import { r as w } from "./state-C_1EOo3D.js";
3
+ import { o as m } from "./if-defined-B0krMLad.js";
4
+ import { c as $ } from "./repeat-BD8TKgJb.js";
5
+ import { e as g } from "./class-map-CEnykyO_.js";
6
6
  import { u as S } from "./utils-DznhwRXm.js";
7
7
  const F = (e, t) => t && (e.find((s) => s.value === t) || e.find((s) => s.label === t)) || null, H = (e, t) => {
8
8
  if (!t) return -1;
@@ -1,4 +1,4 @@
1
- "use strict";const n=require("./element-CMTfByxQ.cjs"),g=require("./state-BNgpvY-A.cjs"),p=require("./if-defined-hKKmbsI8.cjs"),m=require("./repeat-C-FJ2vfy.cjs"),f=require("./class-map-Bokp1SoS.cjs"),y=require("./utils-byXsEz1u.cjs"),v=(s,e)=>e&&(s.find(t=>t.value===e)||s.find(t=>t.label===e))||null,O=(s,e)=>{if(!e)return-1;const t=s.findIndex(i=>i.value===e);return t>=0?t:s.findIndex(i=>i.label===e)},_=(s,e)=>{if(!e)return[...s];const t=e.toLowerCase();return s.filter(i=>(i.fulltext||i.value+(i.label||"")+(i.prefix||"")).toLowerCase().includes(t))},w=s=>s.value+(s.label||"")+(s.prefix||""),$=(s,e)=>e!==null&&s>=e,L=(s,e)=>{if(!e)return{filtered:[...s],suggestion:null};const t=e.toLowerCase(),i=s.filter(o=>{var l;return(l=o.fulltext)==null?void 0:l.toLowerCase().includes(t)}),a=i.find(o=>{var l;return!o.selected&&((l=o.label)==null?void 0:l.toLowerCase().startsWith(t))})||null;return{filtered:i,suggestion:a}},S=(s,e,t,i)=>{if(!s.trim())return{addValueText:null,userInfoMessage:""};const a=s.trim().toLowerCase(),o=e.find(u=>u.toLowerCase()===a),l=t.filter(u=>{var d;return((d=u.label)==null?void 0:d.toLowerCase().includes(a))||u.value.toLowerCase().includes(a)}),k=l.find(u=>{var d;return((d=u.label)==null?void 0:d.toLowerCase())===a||u.value.toLowerCase()===a});return(l.length===0||!k)&&i?{addValueText:s,userInfoMessage:""}:l.length===0&&!i?{addValueText:null,userInfoMessage:"Ingen treff i søket"}:o?{addValueText:null,userInfoMessage:"Verdien er allerede valgt"}:{addValueText:null,userInfoMessage:""}},I=s=>/^[\p{L} ]$/u.test(s),C=(s=500)=>{let e="",t;return{append:o=>(e+=o.toLowerCase(),t!==void 0&&clearTimeout(t),t=setTimeout(()=>{e=""},s),e),reset:()=>{e="",t!==void 0&&(clearTimeout(t),t=void 0)},getBuffer:()=>e}},M=(s,e)=>{const t=e.toLowerCase();return s.findIndex(i=>{var a;return(a=i.textContent)==null?void 0:a.trim().toLowerCase().startsWith(t)})},c=s=>{s.scrollIntoView({block:"nearest"}),window.setTimeout(()=>s.focus(),0)},h=s=>Array.from(s.querySelectorAll('[role="option"]:not([data-disabled])')||[]),P=s=>{const e=s.nextElementSibling;e&&c(e)},E=(s,e,t)=>{const i=s.previousElementSibling;if(s.dataset.index==="0"&&t){const a=e.querySelector('[role="searchbox"]');a&&c(a)}else i&&c(i)},b=s=>{const e=h(s);e[0]&&c(e[0])},x=s=>{const e=h(s),t=e[e.length-1];t&&c(t)},T=(s,e)=>{if(e.disabled)return;const t=h(s);if(e.allowUserInput&&e.customUserInput){const a=s.querySelector('[data-type="new-option"]');if(a){c(a);return}}const i=t.find(a=>a.dataset.selected==="true");if(i){c(i);return}if(e.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const a=s.querySelector('[role="searchbox"]');if(a){window.setTimeout(()=>a.focus(),0);return}}t[0]&&c(t[0])};var U=Object.defineProperty,A=Object.getOwnPropertyDescriptor,r=(s,e,t,i)=>{for(var a=i>1?void 0:i?A(e,t):e,o=s.length-1,l;o>=0;o--)(l=s[o])&&(a=(i?l(e,t,a):l(a))||a);return i&&a&&U(e,t,a),a};exports.PktListbox=class extends n.PktElement{constructor(){super(...arguments),this.id=y.uuidish(),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=C(),this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),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()}updated(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,i){(e==="options"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,i)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}render(){return n.b`
1
+ "use strict";const n=require("./element-gR_VtSiD.cjs"),g=require("./state-Dg-53wQ8.cjs"),p=require("./if-defined-BOW3ODSj.cjs"),m=require("./repeat-Cfq8CDlf.cjs"),f=require("./class-map-CsENJXf1.cjs"),y=require("./utils-byXsEz1u.cjs"),v=(s,e)=>e&&(s.find(t=>t.value===e)||s.find(t=>t.label===e))||null,O=(s,e)=>{if(!e)return-1;const t=s.findIndex(i=>i.value===e);return t>=0?t:s.findIndex(i=>i.label===e)},_=(s,e)=>{if(!e)return[...s];const t=e.toLowerCase();return s.filter(i=>(i.fulltext||i.value+(i.label||"")+(i.prefix||"")).toLowerCase().includes(t))},w=s=>s.value+(s.label||"")+(s.prefix||""),$=(s,e)=>e!==null&&s>=e,L=(s,e)=>{if(!e)return{filtered:[...s],suggestion:null};const t=e.toLowerCase(),i=s.filter(o=>{var l;return(l=o.fulltext)==null?void 0:l.toLowerCase().includes(t)}),a=i.find(o=>{var l;return!o.selected&&((l=o.label)==null?void 0:l.toLowerCase().startsWith(t))})||null;return{filtered:i,suggestion:a}},S=(s,e,t,i)=>{if(!s.trim())return{addValueText:null,userInfoMessage:""};const a=s.trim().toLowerCase(),o=e.find(u=>u.toLowerCase()===a),l=t.filter(u=>{var d;return((d=u.label)==null?void 0:d.toLowerCase().includes(a))||u.value.toLowerCase().includes(a)}),k=l.find(u=>{var d;return((d=u.label)==null?void 0:d.toLowerCase())===a||u.value.toLowerCase()===a});return(l.length===0||!k)&&i?{addValueText:s,userInfoMessage:""}:l.length===0&&!i?{addValueText:null,userInfoMessage:"Ingen treff i søket"}:o?{addValueText:null,userInfoMessage:"Verdien er allerede valgt"}:{addValueText:null,userInfoMessage:""}},I=s=>/^[\p{L} ]$/u.test(s),C=(s=500)=>{let e="",t;return{append:o=>(e+=o.toLowerCase(),t!==void 0&&clearTimeout(t),t=setTimeout(()=>{e=""},s),e),reset:()=>{e="",t!==void 0&&(clearTimeout(t),t=void 0)},getBuffer:()=>e}},M=(s,e)=>{const t=e.toLowerCase();return s.findIndex(i=>{var a;return(a=i.textContent)==null?void 0:a.trim().toLowerCase().startsWith(t)})},c=s=>{s.scrollIntoView({block:"nearest"}),window.setTimeout(()=>s.focus(),0)},h=s=>Array.from(s.querySelectorAll('[role="option"]:not([data-disabled])')||[]),P=s=>{const e=s.nextElementSibling;e&&c(e)},E=(s,e,t)=>{const i=s.previousElementSibling;if(s.dataset.index==="0"&&t){const a=e.querySelector('[role="searchbox"]');a&&c(a)}else i&&c(i)},b=s=>{const e=h(s);e[0]&&c(e[0])},x=s=>{const e=h(s),t=e[e.length-1];t&&c(t)},T=(s,e)=>{if(e.disabled)return;const t=h(s);if(e.allowUserInput&&e.customUserInput){const a=s.querySelector('[data-type="new-option"]');if(a){c(a);return}}const i=t.find(a=>a.dataset.selected==="true");if(i){c(i);return}if(e.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const a=s.querySelector('[role="searchbox"]');if(a){window.setTimeout(()=>a.focus(),0);return}}t[0]&&c(t[0])};var U=Object.defineProperty,A=Object.getOwnPropertyDescriptor,r=(s,e,t,i)=>{for(var a=i>1?void 0:i?A(e,t):e,o=s.length-1,l;o>=0;o--)(l=s[o])&&(a=(i?l(e,t,a):l(a))||a);return i&&a&&U(e,t,a),a};exports.PktListbox=class extends n.PktElement{constructor(){super(...arguments),this.id=y.uuidish(),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=C(),this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),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()}updated(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,i){(e==="options"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,i)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}render(){return n.b`
2
2
  <div
3
3
  class=${f.e({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
4
4
  role=${p.o(this._hasOptions?"listbox":void 0)}
@@ -1,8 +1,8 @@
1
- import { P as u, s as m } from "./element-with-slot-1djk8KXi.js";
2
- import { e as h } from "./class-map-3ADKve8g.js";
3
- import { A as y, b as d, n as a, t as c } from "./element-CV9utnHJ.js";
4
- import { r as g } from "./state-l4hGZdFJ.js";
5
- import "./icon-D0IQAVwS.js";
1
+ import { P as u, s as m } from "./element-with-slot-Dqk6-TRR.js";
2
+ import { e as h } from "./class-map-CEnykyO_.js";
3
+ import { A as y, b as d, n as a, t as c } from "./element-CPpT3rFQ.js";
4
+ import { r as g } from "./state-C_1EOo3D.js";
5
+ import "./icon-BlKA8YuW.js";
6
6
  var v = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, e = (s, o, n, r) => {
7
7
  for (var i = r > 1 ? void 0 : r ? _(o, n) : o, p = s.length - 1, l; p >= 0; p--)
8
8
  (l = s[p]) && (i = (r ? l(o, n, i) : l(i)) || i);
@@ -1,4 +1,4 @@
1
- "use strict";const d=require("./element-with-slot-yT8k1Z37.cjs"),p=require("./class-map-Bokp1SoS.cjs"),t=require("./element-CMTfByxQ.cjs"),h=require("./state-BNgpvY-A.cjs");require("./icon-Dj0oZZSa.cjs");var u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,s=(r,e,a,o)=>{for(var i=o>1?void 0:o?c(e,a):e,n=r.length-1,l;n>=0;n--)(l=r[n])&&(i=(o?l(e,a,i):l(i))||i);return o&&i&&u(e,a,i),i};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/latest/animations/";exports.PktLoader=class extends d.PktElementWithSlot{constructor(){super(...arguments),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=p.e({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),a=p.e({"pkt-contents":!0,"pkt-hide":this.isLoading});return t.b`<div
1
+ "use strict";const d=require("./element-with-slot-ZX-up7jO.cjs"),p=require("./class-map-CsENJXf1.cjs"),t=require("./element-gR_VtSiD.cjs"),h=require("./state-Dg-53wQ8.cjs");require("./icon-Bqj9oBbl.cjs");var u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,s=(r,e,a,o)=>{for(var i=o>1?void 0:o?c(e,a):e,n=r.length-1,l;n>=0;n--)(l=r[n])&&(i=(o?l(e,a,i):l(i))||i);return o&&i&&u(e,a,i),i};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/latest/animations/";exports.PktLoader=class extends d.PktElementWithSlot{constructor(){super(...arguments),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=p.e({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),a=p.e({"pkt-contents":!0,"pkt-hide":this.isLoading});return t.b`<div
2
2
  role="status"
3
3
  aria-live="polite"
4
4
  aria-busy=${this.isLoading?"true":"false"}
@@ -1,8 +1,8 @@
1
- import { P as d, s as m } from "./element-with-slot-1djk8KXi.js";
2
- import { A as u, b as n, n as p, t as h } from "./element-CV9utnHJ.js";
3
- import { e as f } from "./class-map-3ADKve8g.js";
4
- import { r as k } from "./state-l4hGZdFJ.js";
5
- import "./icon-D0IQAVwS.js";
1
+ import { P as d, s as m } from "./element-with-slot-Dqk6-TRR.js";
2
+ import { A as u, b as n, n as p, t as h } from "./element-CPpT3rFQ.js";
3
+ import { e as f } from "./class-map-CEnykyO_.js";
4
+ import { r as k } from "./state-C_1EOo3D.js";
5
+ import "./icon-BlKA8YuW.js";
6
6
  import { u as _ } from "./classutils-RQs1k6D9.js";
7
7
  const v = { skin: { default: "beige" }, compact: { default: !1 }, closable: { default: !1 } }, b = {
8
8
  props: v
@@ -1,4 +1,4 @@
1
- "use strict";const n=require("./element-with-slot-yT8k1Z37.cjs"),e=require("./element-CMTfByxQ.cjs"),b=require("./class-map-Bokp1SoS.cjs"),u=require("./state-BNgpvY-A.cjs");require("./icon-Dj0oZZSa.cjs");const k=require("./classutils-BwNK82ZQ.cjs"),d={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},r={props:d};var h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,o=(l,t,a,i)=>{for(var s=i>1?void 0:i?g(t,a):t,c=l.length-1,p;c>=0;c--)(p=l[c])&&(s=(i?p(t,a,s):p(s))||s);return i&&s&&h(t,a,s),s};exports.PktMessagebox=class extends n.PktElementWithSlot{constructor(){super(),this.closable=r.props.closable.default,this.compact=r.props.compact.default,this.title="",this.skin=r.props.skin.default,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0}))},this._isClosed=!1}updated(t){super.updated(t),t.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return e.b`<div class=${b.e(t)}>
1
+ "use strict";const n=require("./element-with-slot-ZX-up7jO.cjs"),e=require("./element-gR_VtSiD.cjs"),b=require("./class-map-CsENJXf1.cjs"),u=require("./state-Dg-53wQ8.cjs");require("./icon-Bqj9oBbl.cjs");const k=require("./classutils-BwNK82ZQ.cjs"),d={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},r={props:d};var h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,o=(l,t,a,i)=>{for(var s=i>1?void 0:i?g(t,a):t,c=l.length-1,p;c>=0;c--)(p=l[c])&&(s=(i?p(t,a,s):p(s))||s);return i&&s&&h(t,a,s),s};exports.PktMessagebox=class extends n.PktElementWithSlot{constructor(){super(),this.closable=r.props.closable.default,this.compact=r.props.compact.default,this.title="",this.skin=r.props.skin.default,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0}))},this._isClosed=!1}updated(t){super.updated(t),t.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return e.b`<div class=${b.e(t)}>
2
2
  ${this.closable?e.b`<div class="pkt-messagebox__close">
3
3
  <button
4
4
  @click=${this.close}
@@ -1,4 +1,4 @@
1
- "use strict";const d=require("./class-map-Bokp1SoS.cjs"),o=require("./element-CMTfByxQ.cjs"),u=require("./state-BNgpvY-A.cjs"),p=require("./element-with-slot-yT8k1Z37.cjs"),h=require("./ref-DahIePMT.cjs");require("./icon-Dj0oZZSa.cjs");const k={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},c={props:k};var m=Object.defineProperty,v=Object.getOwnPropertyDescriptor,n=(r,e,t,i)=>{for(var s=i>1?void 0:i?v(e,t):e,l=r.length-1,a;l>=0;l--)(a=r[l])&&(s=(i?a(e,t,s):a(s))||s);return i&&s&&m(e,t,s),s};exports.PktModal=class extends p.PktElementWithSlot{constructor(){super(),this.open=!1,this.headingText="",this.removePadding=!1,this.hideCloseButton=c.props.hideCloseButton.default,this.closeOnBackdropClick=c.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=c.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.dialogRef=h.e(),this._isOpen=!1,this.close=(e,t=!1)=>{var s;if(!this._isOpen)return;this._isOpen=!1,this.open=!1,document.body.classList.remove("pkt-modal--open");const i=document.activeElement;i&&!this.isElementInViewport(i)&&i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),t||(s=this.dialogRef.value)==null||s.close(),this.requestUpdate()},this.showModal=(e=null)=>{var t;this._isOpen=!0,this.open=!0,(t=this.dialogRef.value)==null||t.showModal(),document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:e},bubbles:!0,composed:!0})),this.requestUpdate()},this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}updated(e){super.updated(e),e.has("open")&&(this.open&&!this._isOpen?this.showModal():!this.open&&this._isOpen&&this.close(new Event("close"),!1))}async firstUpdated(e){super.firstUpdated(e),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>require("./dialog-polyfill.esm-CPKZe7AL.cjs")).then(i=>i.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(e){e.key==="Escape"&&this.close(e)}handleBackdropClick(e){var t;this.closeOnBackdropClick&&e.target===((t=this.dialogRef)==null?void 0:t.value)&&this.close(e)}isElementInViewport(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const e={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},i={"pkt-modal__content":!0,"pkt-txt-18-light":!0},s=this.closeButtonSkin==="blue",l={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return o.b`
1
+ "use strict";const d=require("./class-map-CsENJXf1.cjs"),o=require("./element-gR_VtSiD.cjs"),u=require("./state-Dg-53wQ8.cjs"),p=require("./element-with-slot-ZX-up7jO.cjs"),h=require("./ref-CL-Xk9Xm.cjs");require("./icon-Bqj9oBbl.cjs");const k={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},c={props:k};var m=Object.defineProperty,v=Object.getOwnPropertyDescriptor,n=(r,e,t,i)=>{for(var s=i>1?void 0:i?v(e,t):e,l=r.length-1,a;l>=0;l--)(a=r[l])&&(s=(i?a(e,t,s):a(s))||s);return i&&s&&m(e,t,s),s};exports.PktModal=class extends p.PktElementWithSlot{constructor(){super(),this.open=!1,this.headingText="",this.removePadding=!1,this.hideCloseButton=c.props.hideCloseButton.default,this.closeOnBackdropClick=c.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=c.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.dialogRef=h.e(),this._isOpen=!1,this.close=(e,t=!1)=>{var s;if(!this._isOpen)return;this._isOpen=!1,this.open=!1,document.body.classList.remove("pkt-modal--open");const i=document.activeElement;i&&!this.isElementInViewport(i)&&i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),t||(s=this.dialogRef.value)==null||s.close(),this.requestUpdate()},this.showModal=(e=null)=>{var t;this._isOpen=!0,this.open=!0,(t=this.dialogRef.value)==null||t.showModal(),document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:e},bubbles:!0,composed:!0})),this.requestUpdate()},this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}updated(e){super.updated(e),e.has("open")&&(this.open&&!this._isOpen?this.showModal():!this.open&&this._isOpen&&this.close(new Event("close"),!1))}async firstUpdated(e){super.firstUpdated(e),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>require("./dialog-polyfill.esm-CPKZe7AL.cjs")).then(i=>i.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(e){e.key==="Escape"&&this.close(e)}handleBackdropClick(e){var t;this.closeOnBackdropClick&&e.target===((t=this.dialogRef)==null?void 0:t.value)&&this.close(e)}isElementInViewport(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const e={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},i={"pkt-modal__content":!0,"pkt-txt-18-light":!0},s=this.closeButtonSkin==="blue",l={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return o.b`
2
2
  <dialog
3
3
  class=${d.e(e)}
4
4
  ${h.n(this.dialogRef)}