@oslokommune/punkt-elements 15.3.1 → 15.4.2

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 (138) hide show
  1. package/dist/{accordionitem-BbeS44TD.js → accordionitem-CHXGzgLv.js} +4 -4
  2. package/dist/accordionitem-To95GT6b.cjs +34 -0
  3. package/dist/{alert-B9flMht5.cjs → alert-BDXWFRcf.cjs} +5 -5
  4. package/dist/{alert-BpFxQviu.js → alert-BHSd2Vpj.js} +6 -6
  5. package/dist/{backlink-DfMabyBp.js → backlink-C68H4Z3b.js} +5 -5
  6. package/dist/{backlink-Bn16ZEIX.cjs → backlink-CQoNgoa-.cjs} +1 -1
  7. package/dist/{button-CKgpX5QA.js → button-CHUuxLQV.js} +10 -10
  8. package/dist/{button-BgCKV0zW.cjs → button-VWxZW89G.cjs} +7 -7
  9. package/dist/{calendar-BMarIeVp.js → calendar-DTnx3DDH.js} +22 -22
  10. package/dist/{calendar-C6xgAJ7Z.cjs → calendar-DjbO2g5L.cjs} +11 -11
  11. package/dist/{card-DI3KodEc.cjs → card-5S2r9UD1.cjs} +27 -27
  12. package/dist/{card-h8ekgJRr.js → card-CnPjrdre.js} +7 -7
  13. package/dist/{checkbox-BJ9pz3kV.js → checkbox-BSz71IeT.js} +4 -4
  14. package/dist/{checkbox-B2t7wfxe.cjs → checkbox-D98_NjcU.cjs} +9 -9
  15. package/dist/{class-map-Dt2jXOlF.js → class-map-3ADKve8g.js} +3 -3
  16. package/dist/class-map-Bokp1SoS.cjs +5 -0
  17. package/dist/{combobox-BjAvk8Y-.js → combobox-CXBYVeh-.js} +11 -11
  18. package/dist/{combobox-HNN7GTzh.cjs → combobox-CZsCRADa.cjs} +12 -12
  19. package/dist/{consent-C37tuFwZ.cjs → consent-BQLkfN3d.cjs} +3 -3
  20. package/dist/{consent-DAk2BJ7I.js → consent-knPF4PS_.js} +3 -3
  21. package/dist/{datepicker-DvcH2QD9.js → datepicker-BOW852c2.js} +13 -13
  22. package/dist/{datepicker-2bneToiA.cjs → datepicker-BqGkvUmw.cjs} +21 -21
  23. package/dist/directive-helpers-B3Vpl3xV.cjs +5 -0
  24. package/dist/directive-helpers-CyPtA1_i.js +38 -0
  25. package/dist/element-CMTfByxQ.cjs +27 -0
  26. package/dist/{element-BXsf_NlG.js → element-CV9utnHJ.js} +114 -114
  27. package/dist/{heading-CBepYb7H.cjs → heading-B0XRE0lq.cjs} +1 -1
  28. package/dist/{heading-J7dN9nRi.js → heading-D9R5UBcv.js} +1 -1
  29. package/dist/{helptext-BG1P_9j0.cjs → helptext-BjW1WdOn.cjs} +3 -3
  30. package/dist/{helptext-Cm6FLBVf.js → helptext-TFpeGJ1P.js} +5 -5
  31. package/dist/{icon-DBZvMard.js → icon-D0IQAVwS.js} +3 -3
  32. package/dist/{icon-n4-ve48P.cjs → icon-Dj0oZZSa.cjs} +3 -3
  33. package/dist/if-defined-hKKmbsI8.cjs +5 -0
  34. package/dist/{if-defined-CxHgig4I.js → if-defined-rXcLNTzN.js} +1 -1
  35. package/dist/{input-element-CbjYtVou.js → input-element-Bkv6Yxld.js} +1 -1
  36. package/dist/{input-element-BBv4xjPb.cjs → input-element-DM0tY799.cjs} +1 -1
  37. package/dist/{input-wrapper-Bwmva-69.js → input-wrapper-CaUY90qz.js} +12 -12
  38. package/dist/{input-wrapper-CJqmwe3I.cjs → input-wrapper-JU4D2TGu.cjs} +19 -19
  39. package/dist/{link-BKnT-97D.js → link-Bscfb6s9.js} +4 -4
  40. package/dist/{link-DRPFqqEn.cjs → link-CDuv1jxx.cjs} +3 -3
  41. package/dist/{linkcard-02fxYQ2g.cjs → linkcard-3WUL0CpY.cjs} +3 -3
  42. package/dist/{linkcard-C2UENcqo.js → linkcard-wNgRxJ-S.js} +4 -4
  43. package/dist/{listbox-CLtowV6W.js → listbox-CI7Wfn_e.js} +8 -8
  44. package/dist/{listbox-C_0RhGhk.cjs → listbox-TRqKskJT.cjs} +12 -12
  45. package/dist/{loader-BW-AWQiE.js → loader-BF9K1VCZ.js} +5 -5
  46. package/dist/{loader-Cj4kUNRE.cjs → loader-C1LI8Q4z.cjs} +4 -4
  47. package/dist/{messagebox-CK0sSRep.cjs → messagebox-Dmot5szX.cjs} +4 -4
  48. package/dist/{messagebox-DB8tEXrV.js → messagebox-LBEzcr6B.js} +12 -12
  49. package/dist/{modal-ClYfWW2a.js → modal-CGHWsjk8.js} +5 -5
  50. package/dist/{modal-BzVQSQy2.cjs → modal-S9MOKOaz.cjs} +6 -6
  51. package/dist/pkt-accordion.cjs +1 -1
  52. package/dist/pkt-accordion.js +2 -2
  53. package/dist/pkt-alert.cjs +1 -1
  54. package/dist/pkt-alert.js +1 -1
  55. package/dist/pkt-backlink.cjs +1 -1
  56. package/dist/pkt-backlink.js +1 -1
  57. package/dist/pkt-button.cjs +1 -1
  58. package/dist/pkt-button.js +1 -1
  59. package/dist/pkt-calendar.cjs +1 -1
  60. package/dist/pkt-calendar.js +1 -1
  61. package/dist/pkt-card.cjs +1 -1
  62. package/dist/pkt-card.js +1 -1
  63. package/dist/pkt-checkbox.cjs +1 -1
  64. package/dist/pkt-checkbox.js +1 -1
  65. package/dist/pkt-combobox.cjs +1 -1
  66. package/dist/pkt-combobox.js +1 -1
  67. package/dist/pkt-consent.cjs +1 -1
  68. package/dist/pkt-consent.js +1 -1
  69. package/dist/pkt-datepicker.cjs +1 -1
  70. package/dist/pkt-datepicker.js +2 -2
  71. package/dist/pkt-header.cjs +52 -52
  72. package/dist/pkt-header.js +9 -9
  73. package/dist/pkt-heading.cjs +1 -1
  74. package/dist/pkt-heading.js +1 -1
  75. package/dist/pkt-helptext.cjs +1 -1
  76. package/dist/pkt-helptext.js +1 -1
  77. package/dist/pkt-icon.cjs +1 -1
  78. package/dist/pkt-icon.js +1 -1
  79. package/dist/pkt-index.cjs +1 -1
  80. package/dist/pkt-index.js +26 -26
  81. package/dist/pkt-input-wrapper.cjs +1 -1
  82. package/dist/pkt-input-wrapper.js +1 -1
  83. package/dist/pkt-link.cjs +1 -1
  84. package/dist/pkt-link.js +1 -1
  85. package/dist/pkt-linkcard.cjs +1 -1
  86. package/dist/pkt-linkcard.js +1 -1
  87. package/dist/pkt-listbox.cjs +1 -1
  88. package/dist/pkt-listbox.js +1 -1
  89. package/dist/pkt-loader.cjs +1 -1
  90. package/dist/pkt-loader.js +1 -1
  91. package/dist/pkt-messagebox.cjs +1 -1
  92. package/dist/pkt-messagebox.js +1 -1
  93. package/dist/pkt-modal.cjs +1 -1
  94. package/dist/pkt-modal.js +1 -1
  95. package/dist/pkt-progressbar.cjs +1 -1
  96. package/dist/pkt-progressbar.js +2 -2
  97. package/dist/pkt-radiobutton.cjs +1 -1
  98. package/dist/pkt-radiobutton.js +1 -1
  99. package/dist/pkt-select.cjs +1 -1
  100. package/dist/pkt-select.js +1 -1
  101. package/dist/pkt-tabs.cjs +1 -1
  102. package/dist/pkt-tabs.js +2 -2
  103. package/dist/pkt-tag.cjs +1 -1
  104. package/dist/pkt-tag.js +1 -1
  105. package/dist/pkt-textarea.cjs +1 -1
  106. package/dist/pkt-textarea.js +1 -1
  107. package/dist/pkt-textinput.cjs +1 -1
  108. package/dist/pkt-textinput.js +1 -1
  109. package/dist/{progressbar-ClZOyCz9.cjs → progressbar-Bxh335uT.cjs} +5 -5
  110. package/dist/{progressbar-CJa70NEo.js → progressbar-GSA4Md1u.js} +7 -7
  111. package/dist/{radiobutton-DWoYQn8H.cjs → radiobutton-95wp024h.cjs} +7 -7
  112. package/dist/{radiobutton-CvKKNFMd.js → radiobutton-CTFAV5GU.js} +9 -9
  113. package/dist/{ref-C5iJMIE1.cjs → ref-CxLwrCxt.cjs} +3 -3
  114. package/dist/{ref-BxiKhrfa.js → ref-Dma3n3i8.js} +5 -5
  115. package/dist/repeat-C-FJ2vfy.cjs +5 -0
  116. package/dist/repeat-DnlRNf63.js +61 -0
  117. package/dist/{select-BQUp88lY.cjs → select-CZ_Lx5W6.cjs} +2 -2
  118. package/dist/{select-CFkxir_l.js → select-YLvYAQX6.js} +6 -6
  119. package/dist/{state-GDzxl12x.cjs → state-BNgpvY-A.cjs} +1 -1
  120. package/dist/{state-DgnkjP0q.js → state-l4hGZdFJ.js} +1 -1
  121. package/dist/tabitem-BKv4eN0a.cjs +65 -0
  122. package/dist/{tabitem-C8-tZyc_.js → tabitem-DQRzgAT4.js} +10 -10
  123. package/dist/{tag-DIJMJhyp.js → tag-68q0_Sn0.js} +6 -6
  124. package/dist/{tag-h0vD2Na0.cjs → tag-BnT5onW2.cjs} +4 -4
  125. package/dist/{textarea-DcCOfNlr.cjs → textarea-CuTsE1WX.cjs} +3 -3
  126. package/dist/{textarea-CMuiBUee.js → textarea-DhWH99qN.js} +16 -16
  127. package/dist/{textinput-D30TCADP.js → textinput-BCi9p0Du.js} +8 -8
  128. package/dist/{textinput-DR3aaHTH.cjs → textinput-st4Vml5J.cjs} +11 -11
  129. package/package.json +3 -3
  130. package/dist/accordionitem-DUWhTUEI.cjs +0 -34
  131. package/dist/class-map-CApIYSRo.cjs +0 -5
  132. package/dist/directive-helpers-CQef4qUQ.js +0 -38
  133. package/dist/directive-helpers-CYIEJ8pI.cjs +0 -5
  134. package/dist/element-aUzIoa1s.cjs +0 -27
  135. package/dist/if-defined-BElHLTlB.cjs +0 -5
  136. package/dist/repeat-B55jMEsG.js +0 -61
  137. package/dist/repeat-DcYSFU2y.cjs +0 -5
  138. package/dist/tabitem-DaYfUaxw.cjs +0 -65
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("./element-aUzIoa1s.cjs"),c=require("./if-defined-BElHLTlB.cjs"),d=require("./state-GDzxl12x.cjs"),r=require("./ref-C5iJMIE1.cjs"),y=require("./class-map-CApIYSRo.cjs"),O=require("./repeat-DcYSFU2y.cjs"),$=require("./input-element-BBv4xjPb.cjs"),I=require("./pkt-options-controller-BnTmkl3g.cjs"),w=require("./pkt-slot-controller-D4nKlom5.cjs");require("./input-wrapper-CJqmwe3I.cjs");require("./icon-n4-ve48P.cjs");require("./tag-h0vD2Na0.cjs");require("./listbox-C_0RhGhk.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,n=(v,t,e,i)=>{for(var s=i>1?void 0:i?A(t,e):t,a=v.length-1,l;a>=0;a--)(l=v[a])&&(s=(i?l(t,e,s):l(s))||s);return i&&s&&V(t,e,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new I.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t,e;if(super.connectedCallback(),document&&document.body.addEventListener("click",i=>{this._isOptionsOpen&&!this.contains(i.target)&&this.handleFocusOut(i)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const i=((t=this.options)==null?void 0:t.filter(s=>s.userAdded))||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((e=this.optionsController)!=null&&e.nodes&&this.optionsController.nodes.length){const i=[];this.optionsController.nodes.forEach(s=>{if(!s.textContent&&!s.getAttribute("value"))return null;const a={value:s.getAttribute("value")||s.textContent||"",label:s.textContent||s.getAttribute("value")||""};s.getAttribute("data-prefix")&&(a.prefix=s.getAttribute("data-prefix")||void 0),s.getAttribute("tagskincolor")&&(a.tagSkinColor=s.getAttribute("tagskincolor")),s.getAttribute("description")&&(a.description=s.getAttribute("description")||void 0),a.fulltext=a.value+a.label+(a.prefix||""),i.push(a)}),i.length&&(this.options=[...i],this._options=[...i])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const s=(t.get("options")||this._options||[]).filter(l=>l&&l.userAdded).filter(l=>!(Array.isArray(this.options)?this.options:[]).some(h=>h.value===l.value)),a=[...s,...this.options];this._options=a,s.length>0&&(this.options=a),this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const h=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,h)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),t==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,i)}render(){return o.x`
1
+ "use strict";const o=require("./element-CMTfByxQ.cjs"),c=require("./if-defined-hKKmbsI8.cjs"),d=require("./state-BNgpvY-A.cjs"),r=require("./ref-CxLwrCxt.cjs"),y=require("./class-map-Bokp1SoS.cjs"),O=require("./repeat-C-FJ2vfy.cjs"),$=require("./input-element-DM0tY799.cjs"),I=require("./pkt-options-controller-BnTmkl3g.cjs"),w=require("./pkt-slot-controller-D4nKlom5.cjs");require("./input-wrapper-JU4D2TGu.cjs");require("./icon-Dj0oZZSa.cjs");require("./tag-BnT5onW2.cjs");require("./listbox-TRqKskJT.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,n=(b,t,e,i)=>{for(var s=i>1?void 0:i?A(t,e):t,a=b.length-1,l;a>=0;a--)(l=b[a])&&(s=(i?l(t,e,s):l(s))||s);return i&&s&&V(t,e,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new I.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t,e;if(super.connectedCallback(),document&&document.body.addEventListener("click",i=>{this._isOptionsOpen&&!this.contains(i.target)&&this.handleFocusOut(i)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const i=((t=this.options)==null?void 0:t.filter(s=>s.userAdded))||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((e=this.optionsController)!=null&&e.nodes&&this.optionsController.nodes.length){const i=[];this.optionsController.nodes.forEach(s=>{if(!s.textContent&&!s.getAttribute("value"))return null;const a={value:s.getAttribute("value")||s.textContent||"",label:s.textContent||s.getAttribute("value")||""};s.getAttribute("data-prefix")&&(a.prefix=s.getAttribute("data-prefix")||void 0),s.getAttribute("tagskincolor")&&(a.tagSkinColor=s.getAttribute("tagskincolor")),s.getAttribute("description")&&(a.description=s.getAttribute("description")||void 0),a.fulltext=a.value+a.label+(a.prefix||""),i.push(a)}),i.length&&(this.options=[...i],this._options=[...i])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const s=(t.get("options")||this._options||[]).filter(l=>l&&l.userAdded).filter(l=>!(Array.isArray(this.options)?this.options:[]).some(h=>h.value===l.value)),a=[...s,...this.options];this._options=a,s.length>0&&(this.options=a),this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const h=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,h)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),t==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,i)}render(){return o.b`
2
2
  <pkt-input-wrapper
3
3
  .label=${this.label}
4
4
  .helptext=${this.helptext}
@@ -26,9 +26,9 @@
26
26
  tabindex="-1"
27
27
  @click=${this.handleInputClick}
28
28
  >
29
- ${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?o.x`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
29
+ ${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?o.b`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
30
30
  >${this.placeholder}</span
31
- >`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():o.E}
31
+ >`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():o.A}
32
32
  ${this.renderInputField()}
33
33
  <div
34
34
  class="pkt-btn pkt-btn--tertiary pkt-combobox__arrow"
@@ -80,11 +80,11 @@
80
80
  ></pkt-listbox>
81
81
  </div>
82
82
 
83
- ${this.tagPlacement==="outside"&&this.multiple?o.x`<div class="pkt-combobox__tags-outside">
83
+ ${this.tagPlacement==="outside"&&this.multiple?o.b`<div class="pkt-combobox__tags-outside">
84
84
  ${this.renderSingleOrMultipleValues()}
85
- </div>`:o.E}
85
+ </div>`:o.A}
86
86
  </pkt-input-wrapper>
87
- `}renderInputField(){return this.typeahead||this.allowUserInput?o.x`
87
+ `}renderInputField(){return this.typeahead||this.allowUserInput?o.b`
88
88
  <div class="pkt-combobox__input-div combobox__input">
89
89
  <input
90
90
  type="text"
@@ -104,7 +104,7 @@
104
104
  ${r.n(this.inputRef)}
105
105
  />
106
106
  </div>
107
- `:o.x`
107
+ `:o.b`
108
108
  <input
109
109
  type="hidden"
110
110
  id="${this.id}-input"
@@ -112,7 +112,7 @@
112
112
  .value=${this._value.join(",")}
113
113
  ${r.n(this.inputRef)}
114
114
  />
115
- `}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=O.c(this._value,s=>s,s=>{var h;const a=this.findValueInOptions(s),l=(h=this.options.find(u=>u.value===s))==null?void 0:h.tagSkinColor;return o.x`
115
+ `}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=O.c(this._value,s=>s,s=>{var h;const a=this.findValueInOptions(s),l=(h=this.options.find(u=>u.value===s))==null?void 0:h.tagSkinColor;return o.b`
116
116
  <pkt-tag
117
117
  skin=${l||"blue-dark"}
118
118
  ?closeTag=${!this.disabled}
@@ -120,10 +120,10 @@
120
120
  >
121
121
  ${this.renderValueTag(a)}
122
122
  </pkt-tag>
123
- `});return t?e:i}renderValueTag(t){if(!t)return"";switch(this.displayValueAs){case"prefixAndValue":return o.x`<span class="pkt-combobox__value" data-focusfix=${this.id}
123
+ `});return t?e:i}renderValueTag(t){if(!t)return"";switch(this.displayValueAs){case"prefixAndValue":return o.b`<span class="pkt-combobox__value" data-focusfix=${this.id}
124
124
  >${t.prefix||""} ${t.value}</span
125
- >`;case"value":return o.x`<span class="pkt-combobox__value" data-focusfix=${this.id}
125
+ >`;case"value":return o.b`<span class="pkt-combobox__value" data-focusfix=${this.id}
126
126
  >${t.value}</span
127
- >`;case"label":default:return o.x`<span class="pkt-combobox__value" data-focusfix=${this.id}
127
+ >`;case"label":default:return o.b`<span class="pkt-combobox__value" data-focusfix=${this.id}
128
128
  >${t.label||t.value}</span
129
- >`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var s;return(s=i.fulltext)==null?void 0:s.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(s=>{var a;return!s.selected&&((a=s.label)==null?void 0:a.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const s=i[0];s!=null&&s.label&&(e.value=s.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&(t!=null&&t.label)?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,s,a,l;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((a=(s=t.relatedTarget)==null?void 0:s.closest("pkt-combobox"))==null?void 0:a.id)!==this.id&&((l=t.target)==null?void 0:l.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,u=this.findValueInOptions(h);!this._value.includes(h)&&!u?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):u&&!this._value.includes(u.value)&&this.setSelected(u.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t)}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,s;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(s=this.arrowRef.value)==null||s.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var l;const t=((l=this.inputRef.value)==null?void 0:l.value)||this._search||"",e=t.trim().toLowerCase()||"";if(!e){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const i=this._value.find(h=>h.toLowerCase()===e),s=this._options.filter(h=>{var u;return((u=h.label)==null?void 0:u.toLowerCase().includes(e))??!1}),a=s.find(h=>{var u;return((u=h.label)==null?void 0:u.toLowerCase())===e||h.value.toLowerCase()===e});switch(!0){case((s.length===0||!a)&&this.allowUserInput):this._addValueText=t,this._userInfoMessage="";break;case(s.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!i:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case s.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var g,k;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const e=((g=this.findValueInOptions(t))==null?void 0:g.value)||null,i=this._value.includes(t||e||""),s=!!e,a=((k=this._options.find(_=>_.value===t))==null?void 0:k.disabled)||!1,l=!(t!=null&&t.trim()),h=!this.multiple,u=this.multiple,x=this.isMaxItemsReached();let p=!1,f=!0,b="",m="";a||(!s&&this.allowUserInput&&!l?(this.addNewUserValue(t),b="Ny verdi lagt til",p=!u):!s&&!this.allowUserInput?(h&&this._value[0]&&this.removeValue(this._value[0]),f=!1,p=!0,b="Ingen treff i søket"):i?(this.removeValue(e),p=!0):l&&h?(this.removeAllSelected(),p=!0):h?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(e),p=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):u&&!x?(this.setSelected(e),p=!0):u&&x?(this._userInfoMessage="Maks antall valg nådd",f=!1,m=t):(h&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",f=!1,p=!0,m=t),this._isOptionsOpen=p,p||window.setTimeout(()=>{var _;(_=this.focusRef.value)==null||_.focus()},0),this._userInfoMessage=b,this._search=m||"",this.resetComboboxInput(f),u&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";this._search=t,this.toggleValue(t)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&(e!=null&&e.label)?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};n([o.n({type:String,reflect:!0})],exports.PktCombobox.prototype,"value",2);n([o.n({type:Array})],exports.PktCombobox.prototype,"options",2);n([o.n({type:Array})],exports.PktCombobox.prototype,"defaultOptions",2);n([o.n({type:Boolean})],exports.PktCombobox.prototype,"allowUserInput",2);n([o.n({type:Boolean})],exports.PktCombobox.prototype,"typeahead",2);n([o.n({type:Boolean})],exports.PktCombobox.prototype,"includeSearch",2);n([o.n({type:String})],exports.PktCombobox.prototype,"searchPlaceholder",2);n([o.n({type:Boolean})],exports.PktCombobox.prototype,"multiple",2);n([o.n({type:Number})],exports.PktCombobox.prototype,"maxlength",2);n([o.n({type:String})],exports.PktCombobox.prototype,"displayValueAs",2);n([o.n({type:String})],exports.PktCombobox.prototype,"tagPlacement",2);n([d.r()],exports.PktCombobox.prototype,"_options",2);n([d.r()],exports.PktCombobox.prototype,"_value",2);n([d.r()],exports.PktCombobox.prototype,"_isOptionsOpen",2);n([d.r()],exports.PktCombobox.prototype,"_userInfoMessage",2);n([d.r()],exports.PktCombobox.prototype,"_addValueText",2);n([d.r()],exports.PktCombobox.prototype,"_maxIsReached",2);n([d.r()],exports.PktCombobox.prototype,"_search",2);n([d.r()],exports.PktCombobox.prototype,"_inputFocus",2);n([d.r()],exports.PktCombobox.prototype,"_editingSingleValue",2);exports.PktCombobox=n([o.t("pkt-combobox")],exports.PktCombobox);
129
+ >`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var s;return(s=i.fulltext)==null?void 0:s.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(s=>{var a;return!s.selected&&((a=s.label)==null?void 0:a.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const s=i[0];s!=null&&s.label&&(e.value=s.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&(t!=null&&t.label)?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,s,a,l;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((a=(s=t.relatedTarget)==null?void 0:s.closest("pkt-combobox"))==null?void 0:a.id)!==this.id&&((l=t.target)==null?void 0:l.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,u=this.findValueInOptions(h);!this._value.includes(h)&&!u?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):u&&!this._value.includes(u.value)&&this.setSelected(u.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t)}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,s;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(s=this.arrowRef.value)==null||s.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var l;const t=((l=this.inputRef.value)==null?void 0:l.value)||this._search||"",e=t.trim().toLowerCase()||"";if(!e){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const i=this._value.find(h=>h.toLowerCase()===e),s=this._options.filter(h=>{var u;return((u=h.label)==null?void 0:u.toLowerCase().includes(e))??!1}),a=s.find(h=>{var u;return((u=h.label)==null?void 0:u.toLowerCase())===e||h.value.toLowerCase()===e});switch(!0){case((s.length===0||!a)&&this.allowUserInput):this._addValueText=t,this._userInfoMessage="";break;case(s.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!i:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case s.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var x,k;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const e=((x=this.findValueInOptions(t))==null?void 0:x.value)||null,i=this._value.includes(t||e||""),s=!!e,a=((k=this._options.find(_=>_.value===t))==null?void 0:k.disabled)||!1,l=!(t!=null&&t.trim()),h=!this.multiple,u=this.multiple,g=this.isMaxItemsReached();let p=!1,f=!0,v="",m="";a||(!s&&this.allowUserInput&&!l?(this.addNewUserValue(t),v="Ny verdi lagt til",p=!u):!s&&!this.allowUserInput?(h&&this._value[0]&&this.removeValue(this._value[0]),f=!1,p=!0,v="Ingen treff i søket"):i?(this.removeValue(e),p=!0):l&&h?(this.removeAllSelected(),p=!0):h?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(e),p=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):u&&!g?(this.setSelected(e),p=!0):u&&g?(this._userInfoMessage="Maks antall valg nådd",f=!1,m=t):(h&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",f=!1,p=!0,m=t),this._isOptionsOpen=p,p||window.setTimeout(()=>{var _;(_=this.focusRef.value)==null||_.focus()},0),this._userInfoMessage=v,this._search=m||"",this.resetComboboxInput(f),u&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";this._search=t,this.toggleValue(t)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&(e!=null&&e.label)?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};n([o.n({type:String,reflect:!0})],exports.PktCombobox.prototype,"value",2);n([o.n({type:Array})],exports.PktCombobox.prototype,"options",2);n([o.n({type:Array})],exports.PktCombobox.prototype,"defaultOptions",2);n([o.n({type:Boolean})],exports.PktCombobox.prototype,"allowUserInput",2);n([o.n({type:Boolean})],exports.PktCombobox.prototype,"typeahead",2);n([o.n({type:Boolean})],exports.PktCombobox.prototype,"includeSearch",2);n([o.n({type:String})],exports.PktCombobox.prototype,"searchPlaceholder",2);n([o.n({type:Boolean})],exports.PktCombobox.prototype,"multiple",2);n([o.n({type:Number})],exports.PktCombobox.prototype,"maxlength",2);n([o.n({type:String})],exports.PktCombobox.prototype,"displayValueAs",2);n([o.n({type:String})],exports.PktCombobox.prototype,"tagPlacement",2);n([d.r()],exports.PktCombobox.prototype,"_options",2);n([d.r()],exports.PktCombobox.prototype,"_value",2);n([d.r()],exports.PktCombobox.prototype,"_isOptionsOpen",2);n([d.r()],exports.PktCombobox.prototype,"_userInfoMessage",2);n([d.r()],exports.PktCombobox.prototype,"_addValueText",2);n([d.r()],exports.PktCombobox.prototype,"_maxIsReached",2);n([d.r()],exports.PktCombobox.prototype,"_search",2);n([d.r()],exports.PktCombobox.prototype,"_inputFocus",2);n([d.r()],exports.PktCombobox.prototype,"_editingSingleValue",2);exports.PktCombobox=n([o.t("pkt-combobox")],exports.PktCombobox);
@@ -1,11 +1,11 @@
1
- "use strict";const o=require("./element-aUzIoa1s.cjs");require("./button-BgCKV0zW.cjs");require("./icon-n4-ve48P.cjs");const k={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,s=(r,e,t,n)=>{for(var i=n>1?void 0:n?p(e,t):e,a=r.length-1,l;a>=0;a--)(l=r[a])&&(i=(n?l(e,t,i):l(i))||i);return n&&i&&d(e,t,i),i};let c=null;function u(){return c||(c=new Promise((r,e)=>{if(document.querySelector("#oslo-consent-script")){r();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>r(),t.onerror=e,document.head.appendChild(t);const n=document.createElement("link");n.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",n.type="text/css",n.rel="stylesheet",n.id="oslo-consent-styles",document.head.appendChild(n)}),c)}exports.PktConsent=class extends o.PktElement{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||k.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const n=this.returnJsonOrObject(e.value).items.reduce((i,a)=>(i[a.name]=a.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:n,bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await u(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const n={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(n),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?o.x`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?o.x`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
1
+ "use strict";const o=require("./element-CMTfByxQ.cjs");require("./button-VWxZW89G.cjs");require("./icon-Dj0oZZSa.cjs");const k={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,s=(r,e,t,n)=>{for(var i=n>1?void 0:n?p(e,t):e,a=r.length-1,l;a>=0;a--)(l=r[a])&&(i=(n?l(e,t,i):l(i))||i);return n&&i&&d(e,t,i),i};let c=null;function u(){return c||(c=new Promise((r,e)=>{if(document.querySelector("#oslo-consent-script")){r();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>r(),t.onerror=e,document.head.appendChild(t);const n=document.createElement("link");n.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",n.type="text/css",n.rel="stylesheet",n.id="oslo-consent-styles",document.head.appendChild(n)}),c)}exports.PktConsent=class extends o.PktElement{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||k.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const n=this.returnJsonOrObject(e.value).items.reduce((i,a)=>(i[a.name]=a.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:n,bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await u(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const n={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(n),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?o.b`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?o.b`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
2
2
  <pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
3
3
  ${this.triggerText}
4
- </a>`:this.triggerType==="icon"?o.x`<pkt-button
4
+ </a>`:this.triggerType==="icon"?o.b`<pkt-button
5
5
  skin="tertiary"
6
6
  variant="icon-only"
7
7
  iconName="cookie"
8
8
  @click=${this.openModal}
9
9
  >
10
10
  >${this.triggerText}</pkt-button
11
- >`:o.x`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};s([o.n({type:Boolean})],exports.PktConsent.prototype,"devMode",2);s([o.n({type:String})],exports.PktConsent.prototype,"hotjarId",2);s([o.n({type:String})],exports.PktConsent.prototype,"googleAnalyticsId",2);s([o.n({type:String})],exports.PktConsent.prototype,"cookieDomain",2);s([o.n({type:String})],exports.PktConsent.prototype,"cookieSecure",2);s([o.n({type:String})],exports.PktConsent.prototype,"cookieExpiryDays",2);s([o.n({type:String})],exports.PktConsent.prototype,"triggerType",2);s([o.n({type:String})],exports.PktConsent.prototype,"triggerText",2);s([o.n({type:String})],exports.PktConsent.prototype,"i18nLanguage",2);exports.PktConsent=s([o.t("pkt-consent")],exports.PktConsent);
11
+ >`:o.b`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};s([o.n({type:Boolean})],exports.PktConsent.prototype,"devMode",2);s([o.n({type:String})],exports.PktConsent.prototype,"hotjarId",2);s([o.n({type:String})],exports.PktConsent.prototype,"googleAnalyticsId",2);s([o.n({type:String})],exports.PktConsent.prototype,"cookieDomain",2);s([o.n({type:String})],exports.PktConsent.prototype,"cookieSecure",2);s([o.n({type:String})],exports.PktConsent.prototype,"cookieExpiryDays",2);s([o.n({type:String})],exports.PktConsent.prototype,"triggerType",2);s([o.n({type:String})],exports.PktConsent.prototype,"triggerText",2);s([o.n({type:String})],exports.PktConsent.prototype,"i18nLanguage",2);exports.PktConsent=s([o.t("pkt-consent")],exports.PktConsent);
@@ -1,6 +1,6 @@
1
- import { P as p, x as c, n as a, t as g } from "./element-BXsf_NlG.js";
2
- import "./button-CKgpX5QA.js";
3
- import "./icon-DBZvMard.js";
1
+ import { P as p, b as c, n as a, t as g } from "./element-CV9utnHJ.js";
2
+ import "./button-CHUuxLQV.js";
3
+ import "./icon-D0IQAVwS.js";
4
4
  const u = {
5
5
  i18n: {
6
6
  nb: {
@@ -1,15 +1,15 @@
1
- import { P as L, E as D, x as h, n as r, t as x } from "./element-BXsf_NlG.js";
2
- import { r as z } from "./state-DgnkjP0q.js";
3
- import { s as H, f as N, a as Q, i as X, n as k, b as j, c as W, v as P, d as Y, p as Z, e as G } from "./calendar-BMarIeVp.js";
4
- import { P as ee } from "./input-element-CbjYtVou.js";
5
- import { e as f, n as v } from "./ref-BxiKhrfa.js";
6
- import "./icon-DBZvMard.js";
7
- import "./input-wrapper-Bwmva-69.js";
8
- import { e as $ } from "./class-map-Dt2jXOlF.js";
9
- import { c as te } from "./repeat-B55jMEsG.js";
10
- import "./tag-DIJMJhyp.js";
1
+ import { P as L, A as D, b as h, n as r, t as x } from "./element-CV9utnHJ.js";
2
+ import { r as z } from "./state-l4hGZdFJ.js";
3
+ import { s as H, f as N, a as Q, i as X, n as k, b as j, c as W, v as P, d as Y, p as Z, e as G } from "./calendar-DTnx3DDH.js";
4
+ import { P as ee } from "./input-element-Bkv6Yxld.js";
5
+ import { e as f, n as v } from "./ref-Dma3n3i8.js";
6
+ import "./icon-D0IQAVwS.js";
7
+ import "./input-wrapper-CaUY90qz.js";
8
+ import { e as $ } from "./class-map-3ADKve8g.js";
9
+ import { c as te } from "./repeat-DnlRNf63.js";
10
+ import "./tag-68q0_Sn0.js";
11
11
  import { u as se, s as ie } from "./utils-DznhwRXm.js";
12
- import { o as g } from "./if-defined-CxHgig4I.js";
12
+ import { o as g } from "./if-defined-rXcLNTzN.js";
13
13
  import { P as ae } from "./pkt-slot-controller-D7CrjM52.js";
14
14
  const J = {
15
15
  calendar: { buttonAltText: "Åpne kalender" }
@@ -1154,7 +1154,7 @@ u = p([
1154
1154
  export {
1155
1155
  w as P,
1156
1156
  u as a,
1157
- B as b,
1157
+ R as b,
1158
1158
  C as c,
1159
- R as d
1159
+ B as d
1160
1160
  };
@@ -1,15 +1,15 @@
1
- "use strict";const l=require("./element-aUzIoa1s.cjs"),I=require("./state-GDzxl12x.cjs"),u=require("./calendar-C6xgAJ7Z.cjs"),A=require("./input-element-BBv4xjPb.cjs"),o=require("./ref-C5iJMIE1.cjs");require("./icon-n4-ve48P.cjs");require("./input-wrapper-CJqmwe3I.cjs");const m=require("./class-map-CApIYSRo.cjs"),M=require("./repeat-DcYSFU2y.cjs");require("./tag-h0vD2Na0.cjs");const O=require("./utils-byXsEz1u.cjs"),g=require("./if-defined-BElHLTlB.cjs"),F=require("./pkt-slot-controller-D4nKlom5.cjs"),B={calendar:{buttonAltText:"Åpne kalender"}},j={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var L=Object.defineProperty,q=Object.getOwnPropertyDescriptor,b=(s,e,t,a)=>{for(var i=a>1?void 0:a?q(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&L(e,t,i),i};exports.PktDateTags=class extends l.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=O.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},l.x`
1
+ "use strict";const l=require("./element-CMTfByxQ.cjs"),I=require("./state-BNgpvY-A.cjs"),u=require("./calendar-DjbO2g5L.cjs"),A=require("./input-element-DM0tY799.cjs"),o=require("./ref-CxLwrCxt.cjs");require("./icon-Dj0oZZSa.cjs");require("./input-wrapper-JU4D2TGu.cjs");const m=require("./class-map-Bokp1SoS.cjs"),M=require("./repeat-C-FJ2vfy.cjs");require("./tag-BnT5onW2.cjs");const O=require("./utils-byXsEz1u.cjs"),g=require("./if-defined-hKKmbsI8.cjs"),F=require("./pkt-slot-controller-D4nKlom5.cjs"),B={calendar:{buttonAltText:"Åpne kalender"}},j={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var L=Object.defineProperty,q=Object.getOwnPropertyDescriptor,b=(s,e,t,a)=>{for(var i=a>1?void 0:a?q(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&L(e,t,i),i};exports.PktDateTags=class extends l.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=O.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},l.b`
2
2
  <div class=${m.e(this.classes)} aria-live="polite">
3
- ${Array.isArray(this.dates)&&this.dates[0]?M.c(u.sortDateStrings((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return l.x` <pkt-tag
3
+ ${Array.isArray(this.dates)&&this.dates[0]?M.c(u.sortDateStrings((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return l.b` <pkt-tag
4
4
  id=${this.idBase+e+"-tag"}
5
5
  closeTag
6
6
  @close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:e}))}}
7
7
  .ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${u.fromISOtoLocal(e,this.dateformat)}`}
8
8
  >
9
9
  <time datetime=${e}>${u.fromISOtoLocal(e,this.dateformat)}</time>
10
- </pkt-tag>`}):l.E}
10
+ </pkt-tag>`}):l.A}
11
11
  </div>
12
- `}};b([l.n({type:Array})],exports.PktDateTags.prototype,"dates",2);b([l.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);b([l.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);b([l.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=b([l.t("pkt-date-tags")],exports.PktDateTags);const V={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},$={props:V},y=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},K=()=>y()?"text":"date",U=s=>!s||s.length!==2?!0:u.isValidDateRange(s[0],s[1]),N=s=>u.sortDateStrings(s),z=(s,e,t,a,i)=>u.filterSelectableDates(s,e,t,a,i),H=(s,e,t,a,i,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":a,"ios-readonly-hack":i===!1&&r==="text"}),W=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),G=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),J=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,Q=(s,e,t=!1)=>{var p;if(!s||!e)return;const a=((p=e.parentElement)==null?void 0:p.getBoundingClientRect())||e.getBoundingClientRect(),i=t?a.height+30:a.height,r=s.getBoundingClientRect().height;let n=t?"calc(100% - 30px)":"100%";a&&a.top+r>window.innerHeight&&a.top-r>0&&(n=`calc(100% - ${i}px - ${r}px)`),s.style.top=n},X=(s,e,t,a,i,r)=>{const{key:n}=s;n===","&&(s.preventDefault(),r?r(s):i&&i()),(n==="Space"||n===" ")&&(s.preventDefault(),e(s)),n==="Enter"&&(s.preventDefault(),t?t():a?a():i&&i())},Y=(s,e)=>{const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))},S={validateRangeOrder:U,sortDates:N,filterSelectableDates:z},Z={getInputType:K},k={submitForm(s){var t;const e=(t=s.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(s,e){const t=s==null?void 0:s.form;t?t.requestSubmit():e()},validateDateInput(s,e,t,a,i){var n,p,R,E;const r=s.value;r&&(t&&t>r?e.setValidity({rangeUnderflow:!0},((p=(n=i==null?void 0:i.forms)==null?void 0:n.messages)==null?void 0:p.rangeUnderflow)||"Value is below minimum",s):a&&a<r&&e.setValidity({rangeOverflow:!0},((E=(R=i==null?void 0:i.forms)==null?void 0:R.messages)==null?void 0:E.rangeOverflow)||"Value is above maximum",s))}},w={addToSelected(s,e,t,a){const i=s.target;if(!i.value)return;const r=t?u.newDate(t):null,n=a?u.newDate(a):null,p=u.newDate(i.value.split(",")[0]);p&&!isNaN(p.getTime())&&(!r||p>=r)&&(!n||p<=n)&&e.value&&e.value.handleDateSelect(p),i.value=""},handleCalendarPosition(s,e,t=!1){Q(s.value??null,e.value??null,t)}},T={getInputClasses:H,getButtonClasses:W,getRangeLabelClasses:G},P={processDateSelection:J,updateInputValues(s,e,t,a,i,r){s.value&&(a&&(e!=null&&e.value)?(s.value.value=t[0]??"",e.value.value=t[1]??"",r(s.value),r(e.value)):i||(s.value.value=t.length?t[0]:"",r(s.value)))},processRangeBlur(s,e,t,a,i){var n;const r=s.target;if(r.value){i(r);const p=u.fromISOToDate(r.value);p&&((n=t==null?void 0:t.value)==null||n.handleDateSelect(p))}else e[0]&&a()}},C={handleInputKeydown:X,handleButtonKeydown:Y};var ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,c=(s,e,t,a)=>{for(var i=a>1?void 0:a?te(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ee(e,t,i),i};let d=class extends l.PktElement{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this._hasBeenOpened=!1,this.popupRef=o.e(),this.calendarRef=o.e(),this.handleDocumentClick=s=>{if(!this.open)return;const e=s.composedPath(),t=this.parentElement,a=this.popupRef.value;!e.includes(this)&&!e.includes(a)&&!(t&&e.includes(t))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=s=>{this.open&&s.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef}updated(s){super.updated(s),s.has("open")&&(this.open?(this._hasBeenOpened=!0,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)):(document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var s;this.open=!0,(s=this.calendarRef.value)==null||s.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(s){var e;return!!s&&!!((e=this.popupRef.value)!=null&&e.contains(s))}focusOnCurrentDate(){const s=this.calendarRef.value;s&&typeof s.focusOnCurrentDate=="function"&&s.focusOnCurrentDate()}addToSelected(s,e,t){if(this.calendarRef.value&&typeof w.addToSelected=="function")return w.addToSelected(s,this.calendarRef,e,t);const i=s.target;if(!i.value)return;const r=e?u.newDate(e):null,n=t?u.newDate(t):null,p=u.newDate(i.value.split(",")[0]);p&&!isNaN(p.getTime())&&(!r||p>=r)&&(!n||p<=n)&&this.handleDateSelect(p),i.value=""}handleDateSelect(s){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(s);const t=u.formatISODate(s),i=this.selected.indexOf(t)>=0?this.selected.filter(r=>r!==t):[...this.selected,t];this.selected=i,this.dispatchEvent(new CustomEvent("date-selected",{detail:i,bubbles:!0,composed:!0}))}render(){const s={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return l.x`
12
+ `}};b([l.n({type:Array})],exports.PktDateTags.prototype,"dates",2);b([l.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);b([l.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);b([l.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=b([l.t("pkt-date-tags")],exports.PktDateTags);const V={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},$={props:V},y=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},K=()=>y()?"text":"date",U=s=>!s||s.length!==2?!0:u.isValidDateRange(s[0],s[1]),N=s=>u.sortDateStrings(s),z=(s,e,t,a,i)=>u.filterSelectableDates(s,e,t,a,i),H=(s,e,t,a,i,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":a,"ios-readonly-hack":i===!1&&r==="text"}),W=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),G=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),J=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,Q=(s,e,t=!1)=>{var p;if(!s||!e)return;const a=((p=e.parentElement)==null?void 0:p.getBoundingClientRect())||e.getBoundingClientRect(),i=t?a.height+30:a.height,r=s.getBoundingClientRect().height;let n=t?"calc(100% - 30px)":"100%";a&&a.top+r>window.innerHeight&&a.top-r>0&&(n=`calc(100% - ${i}px - ${r}px)`),s.style.top=n},X=(s,e,t,a,i,r)=>{const{key:n}=s;n===","&&(s.preventDefault(),r?r(s):i&&i()),(n==="Space"||n===" ")&&(s.preventDefault(),e(s)),n==="Enter"&&(s.preventDefault(),t?t():a?a():i&&i())},Y=(s,e)=>{const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))},E={validateRangeOrder:U,sortDates:N,filterSelectableDates:z},Z={getInputType:K},k={submitForm(s){var t;const e=(t=s.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(s,e){const t=s==null?void 0:s.form;t?t.requestSubmit():e()},validateDateInput(s,e,t,a,i){var n,p,R,S;const r=s.value;r&&(t&&t>r?e.setValidity({rangeUnderflow:!0},((p=(n=i==null?void 0:i.forms)==null?void 0:n.messages)==null?void 0:p.rangeUnderflow)||"Value is below minimum",s):a&&a<r&&e.setValidity({rangeOverflow:!0},((S=(R=i==null?void 0:i.forms)==null?void 0:R.messages)==null?void 0:S.rangeOverflow)||"Value is above maximum",s))}},w={addToSelected(s,e,t,a){const i=s.target;if(!i.value)return;const r=t?u.newDate(t):null,n=a?u.newDate(a):null,p=u.newDate(i.value.split(",")[0]);p&&!isNaN(p.getTime())&&(!r||p>=r)&&(!n||p<=n)&&e.value&&e.value.handleDateSelect(p),i.value=""},handleCalendarPosition(s,e,t=!1){Q(s.value??null,e.value??null,t)}},T={getInputClasses:H,getButtonClasses:W,getRangeLabelClasses:G},x={processDateSelection:J,updateInputValues(s,e,t,a,i,r){s.value&&(a&&(e!=null&&e.value)?(s.value.value=t[0]??"",e.value.value=t[1]??"",r(s.value),r(e.value)):i||(s.value.value=t.length?t[0]:"",r(s.value)))},processRangeBlur(s,e,t,a,i){var n;const r=s.target;if(r.value){i(r);const p=u.fromISOToDate(r.value);p&&((n=t==null?void 0:t.value)==null||n.handleDateSelect(p))}else e[0]&&a()}},C={handleInputKeydown:X,handleButtonKeydown:Y};var ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,c=(s,e,t,a)=>{for(var i=a>1?void 0:a?te(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ee(e,t,i),i};let d=class extends l.PktElement{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this._hasBeenOpened=!1,this.popupRef=o.e(),this.calendarRef=o.e(),this.handleDocumentClick=s=>{if(!this.open)return;const e=s.composedPath(),t=this.parentElement,a=this.popupRef.value;!e.includes(this)&&!e.includes(a)&&!(t&&e.includes(t))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=s=>{this.open&&s.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef}updated(s){super.updated(s),s.has("open")&&(this.open?(this._hasBeenOpened=!0,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)):(document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var s;this.open=!0,(s=this.calendarRef.value)==null||s.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(s){var e;return!!s&&!!((e=this.popupRef.value)!=null&&e.contains(s))}focusOnCurrentDate(){const s=this.calendarRef.value;s&&typeof s.focusOnCurrentDate=="function"&&s.focusOnCurrentDate()}addToSelected(s,e,t){if(this.calendarRef.value&&typeof w.addToSelected=="function")return w.addToSelected(s,this.calendarRef,e,t);const i=s.target;if(!i.value)return;const r=e?u.newDate(e):null,n=t?u.newDate(t):null,p=u.newDate(i.value.split(",")[0]);p&&!isNaN(p.getTime())&&(!r||p>=r)&&(!n||p<=n)&&this.handleDateSelect(p),i.value=""}handleDateSelect(s){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(s);const t=u.formatISODate(s),i=this.selected.indexOf(t)>=0?this.selected.filter(r=>r!==t):[...this.selected,t];this.selected=i,this.dispatchEvent(new CustomEvent("date-selected",{detail:i,bubbles:!0,composed:!0}))}render(){const s={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return l.b`
13
13
  <div
14
14
  class="${m.e(s)}"
15
15
  ${o.n(this.popupRef)}
@@ -17,7 +17,7 @@
17
17
  ?hidden=${!this.open}
18
18
  aria-hidden="${!this.open}"
19
19
  >
20
- ${this.open||this._hasBeenOpened?l.x`<pkt-calendar
20
+ ${this.open||this._hasBeenOpened?l.b`<pkt-calendar
21
21
  ${o.n(this.calendarRef)}
22
22
  ?multiple=${this.multiple}
23
23
  ?range=${this.range}
@@ -33,9 +33,9 @@
33
33
  .today=${this.today}
34
34
  @date-selected=${e=>{this.selected=e.detail,this.dispatchEvent(new CustomEvent("date-selected",{detail:e.detail,bubbles:!0,composed:!0}))}}
35
35
  @close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
36
- ></pkt-calendar>`:l.E}
36
+ ></pkt-calendar>`:l.A}
37
37
  </div>
38
- `}};c([l.n({type:Boolean,reflect:!0})],d.prototype,"open",2);c([l.n({type:Boolean})],d.prototype,"multiple",2);c([l.n({type:Boolean})],d.prototype,"range",2);c([l.n({type:Boolean})],d.prototype,"weeknumbers",2);c([l.n({type:Boolean})],d.prototype,"withcontrols",2);c([l.n({type:Number})],d.prototype,"maxMultiple",2);c([l.n({type:Array})],d.prototype,"selected",2);c([l.n({type:String})],d.prototype,"earliest",2);c([l.n({type:String})],d.prototype,"latest",2);c([l.n({type:Array})],d.prototype,"excludedates",2);c([l.n({type:Array})],d.prototype,"excludeweekdays",2);c([l.n({type:String})],d.prototype,"currentmonth",2);c([l.n({type:String})],d.prototype,"today",2);c([I.r()],d.prototype,"_hasBeenOpened",2);d=c([l.t("pkt-datepicker-popup")],d);var se=Object.defineProperty,v=(s,e,t,a)=>{for(var i=void 0,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=n(e,t,i)||i);return i&&se(e,t,i),i};class f extends l.PktElement{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=o.e(),this.btnRef=o.e()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}renderCalendarButton(){var e;return l.x`
38
+ `}};c([l.n({type:Boolean,reflect:!0})],d.prototype,"open",2);c([l.n({type:Boolean})],d.prototype,"multiple",2);c([l.n({type:Boolean})],d.prototype,"range",2);c([l.n({type:Boolean})],d.prototype,"weeknumbers",2);c([l.n({type:Boolean})],d.prototype,"withcontrols",2);c([l.n({type:Number})],d.prototype,"maxMultiple",2);c([l.n({type:Array})],d.prototype,"selected",2);c([l.n({type:String})],d.prototype,"earliest",2);c([l.n({type:String})],d.prototype,"latest",2);c([l.n({type:Array})],d.prototype,"excludedates",2);c([l.n({type:Array})],d.prototype,"excludeweekdays",2);c([l.n({type:String})],d.prototype,"currentmonth",2);c([l.n({type:String})],d.prototype,"today",2);c([I.r()],d.prototype,"_hasBeenOpened",2);d=c([l.t("pkt-datepicker-popup")],d);var se=Object.defineProperty,v=(s,e,t,a)=>{for(var i=void 0,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=n(e,t,i)||i);return i&&se(e,t,i),i};class f extends l.PktElement{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=o.e(),this.btnRef=o.e()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}renderCalendarButton(){var e;return l.b`
39
39
  <button
40
40
  class="${m.e(T.getButtonClasses())}"
41
41
  type="button"
@@ -47,7 +47,7 @@
47
47
  <pkt-icon name="calendar"></pkt-icon>
48
48
  <span class="pkt-btn__text">${((e=this.strings.calendar)==null?void 0:e.buttonAltText)||"Åpne kalender"}</span>
49
49
  </button>
50
- `}createRenderRoot(){return this}}v([l.n({type:String})],f.prototype,"inputType");v([l.n({type:String})],f.prototype,"id");v([l.n({type:String})],f.prototype,"min");v([l.n({type:String})],f.prototype,"max");v([l.n({type:String})],f.prototype,"placeholder");v([l.n({type:Boolean})],f.prototype,"readonly");v([l.n({type:Boolean})],f.prototype,"disabled");v([l.n({type:Object})],f.prototype,"inputClasses");v([l.n({type:Object})],f.prototype,"internals");var ie=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,_=(s,e,t,a)=>{for(var i=a>1?void 0:a?ae(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ie(e,t,i),i};exports.PktDatepickerSingle=class extends f{constructor(){super(...arguments),this.value="",this.strings=B}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return l.x`
50
+ `}createRenderRoot(){return this}}v([l.n({type:String})],f.prototype,"inputType");v([l.n({type:String})],f.prototype,"id");v([l.n({type:String})],f.prototype,"min");v([l.n({type:String})],f.prototype,"max");v([l.n({type:String})],f.prototype,"placeholder");v([l.n({type:Boolean})],f.prototype,"readonly");v([l.n({type:Boolean})],f.prototype,"disabled");v([l.n({type:Object})],f.prototype,"inputClasses");v([l.n({type:Object})],f.prototype,"internals");var ie=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,_=(s,e,t,a)=>{for(var i=a>1?void 0:a?ae(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ie(e,t,i),i};exports.PktDatepickerSingle=class extends f{constructor(){super(...arguments),this.value="",this.strings=B}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return l.b`
51
51
  <div class="pkt-input__container">
52
52
  <input
53
53
  class="${m.e(this.inputClasses)}"
@@ -71,9 +71,9 @@
71
71
  />
72
72
  ${this.renderCalendarButton()}
73
73
  </div>
74
- `}};_([l.n({type:String})],exports.PktDatepickerSingle.prototype,"value",2);_([l.n({type:Object})],exports.PktDatepickerSingle.prototype,"strings",2);exports.PktDatepickerSingle=_([l.t("pkt-datepicker-single")],exports.PktDatepickerSingle);var ne=Object.defineProperty,le=Object.getOwnPropertyDescriptor,D=(s,e,t,a)=>{for(var i=a>1?void 0:a?le(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ne(e,t,i),i};exports.PktDatepickerRange=class extends f{constructor(){super(...arguments),this.value=[],this.label="",this.showRangeLabels=!1,this.strings=j,this.inputRefTo=o.e()}get inputElementTo(){return this.inputRefTo.value}render(){var t,a,i,r;const e=T.getRangeLabelClasses(this.showRangeLabels);return l.x`
74
+ `}};_([l.n({type:String})],exports.PktDatepickerSingle.prototype,"value",2);_([l.n({type:Object})],exports.PktDatepickerSingle.prototype,"strings",2);exports.PktDatepickerSingle=_([l.t("pkt-datepicker-single")],exports.PktDatepickerSingle);var ne=Object.defineProperty,le=Object.getOwnPropertyDescriptor,D=(s,e,t,a)=>{for(var i=a>1?void 0:a?le(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ne(e,t,i),i};exports.PktDatepickerRange=class extends f{constructor(){super(...arguments),this.value=[],this.label="",this.showRangeLabels=!1,this.strings=j,this.inputRefTo=o.e()}get inputElementTo(){return this.inputRefTo.value}render(){var t,a,i,r;const e=T.getRangeLabelClasses(this.showRangeLabels);return l.b`
75
75
  <div class="pkt-input__container">
76
- ${this.showRangeLabels?l.x` <div class="pkt-input-prefix">${(t=this.strings.generic)==null?void 0:t.from}</div> `:l.E}
76
+ ${this.showRangeLabels?l.b` <div class="pkt-input-prefix">${(t=this.strings.generic)==null?void 0:t.from}</div> `:l.A}
77
77
  <input
78
78
  class=${m.e(this.inputClasses)}
79
79
  .type=${this.inputType}
@@ -97,7 +97,7 @@
97
97
  <div class="${m.e(e)}" id="${this.id}-to-label">
98
98
  ${(i=this.strings.generic)==null?void 0:i.to}
99
99
  </div>
100
- ${this.showRangeLabels?l.E:l.x` <div class="pkt-input-separator">–</div> `}
100
+ ${this.showRangeLabels?l.A:l.b` <div class="pkt-input-separator">–</div> `}
101
101
  <input
102
102
  class=${m.e(this.inputClasses)}
103
103
  .type=${this.inputType}
@@ -120,7 +120,7 @@
120
120
  />
121
121
  ${this.renderCalendarButton()}
122
122
  </div>
123
- `}};D([l.n({type:Array})],exports.PktDatepickerRange.prototype,"value",2);D([l.n({type:String})],exports.PktDatepickerRange.prototype,"label",2);D([l.n({type:Boolean})],exports.PktDatepickerRange.prototype,"showRangeLabels",2);D([l.n({type:Object})],exports.PktDatepickerRange.prototype,"strings",2);exports.PktDatepickerRange=D([l.t("pkt-datepicker-range")],exports.PktDatepickerRange);var re=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,x=(s,e,t,a)=>{for(var i=a>1?void 0:a?pe(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&re(e,t,i),i};exports.PktDatepickerMultiple=class extends f{constructor(){super(...arguments),this.value=[],this.strings=B}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}render(){return l.x`
123
+ `}};D([l.n({type:Array})],exports.PktDatepickerRange.prototype,"value",2);D([l.n({type:String})],exports.PktDatepickerRange.prototype,"label",2);D([l.n({type:Boolean})],exports.PktDatepickerRange.prototype,"showRangeLabels",2);D([l.n({type:Object})],exports.PktDatepickerRange.prototype,"strings",2);exports.PktDatepickerRange=D([l.t("pkt-datepicker-range")],exports.PktDatepickerRange);var re=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,P=(s,e,t,a)=>{for(var i=a>1?void 0:a?pe(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&re(e,t,i),i};exports.PktDatepickerMultiple=class extends f{constructor(){super(...arguments),this.value=[],this.strings=B}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}render(){return l.b`
124
124
  <div class="pkt-input__container">
125
125
  <input
126
126
  class=${m.e(this.inputClasses)}
@@ -142,7 +142,7 @@
142
142
  />
143
143
  ${this.renderCalendarButton()}
144
144
  </div>
145
- `}};x([l.n({type:Array})],exports.PktDatepickerMultiple.prototype,"value",2);x([l.n({type:Number})],exports.PktDatepickerMultiple.prototype,"maxlength",2);x([l.n({type:Object})],exports.PktDatepickerMultiple.prototype,"strings",2);exports.PktDatepickerMultiple=x([l.t("pkt-datepicker-multiple")],exports.PktDatepickerMultiple);var ue=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,h=(s,e,t,a)=>{for(var i=a>1?void 0:a?oe(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ue(e,t,i),i};exports.PktDatepicker=class extends A.PktInputElement{constructor(){super(),this._valueProperty="",this._valueProcessing=!1,this.datepickerPopupRef=o.e(),this._value=[],this.label="Datovelger",this.dateformat=$.props.dateformat.default,this.multiple=$.props.multiple.default,this.maxlength=null,this.range=$.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=$.props.weeknumbers.default,this.withcontrols=$.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=o.e(),this.popupRef=o.e(),this.helptextSlot=o.e(),this.singleInputRef=o.e(),this.rangeInputRef=o.e(),this.multipleInputRef=o.e(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):w.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new F.PktSlotController(this,this.helptextSlot)}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return Z.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(!(this._valueProcessing||e===t)){this._valueProcessing=!0;try{const a=u.valueToArray(e),i=this.multiple&&a.length>1?S.filterSelectableDates(a,this.min,this.max,this.excludedates,this.excludeweekdays):a;if(this.range&&!S.validateRangeOrder(i)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=i;const r=u.arrayToCsv(i);if(this._valueProperty!==r&&(this._valueProperty=r),this.range&&i.length<2)return;super.valueChanged(r,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,a){e==="value"&&this.value!==t&&this.valueChanged(a,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=u.valueToArray(a||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=u.valueToArray(a||"")),super.attributeChangedCallback(e,t,a)}updated(e){if(e.has("value")&&(e.has("multiple")||e.has("range"))){const t=Array.isArray(this.value)?this.value.join(","):this.value,a=e.get("value"),i=Array.isArray(a)?a.join(","):a;this.valueChanged(t,i)}e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=u.valueToArray(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,a;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(a=this.singleInputRef.value)==null?void 0:a.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,a;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(a=this.singleInputRef.value)==null?void 0:a.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return l.x`
145
+ `}};P([l.n({type:Array})],exports.PktDatepickerMultiple.prototype,"value",2);P([l.n({type:Number})],exports.PktDatepickerMultiple.prototype,"maxlength",2);P([l.n({type:Object})],exports.PktDatepickerMultiple.prototype,"strings",2);exports.PktDatepickerMultiple=P([l.t("pkt-datepicker-multiple")],exports.PktDatepickerMultiple);var ue=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,h=(s,e,t,a)=>{for(var i=a>1?void 0:a?oe(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ue(e,t,i),i};exports.PktDatepicker=class extends A.PktInputElement{constructor(){super(),this._valueProperty="",this._valueProcessing=!1,this.datepickerPopupRef=o.e(),this._value=[],this.label="Datovelger",this.dateformat=$.props.dateformat.default,this.multiple=$.props.multiple.default,this.maxlength=null,this.range=$.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=$.props.weeknumbers.default,this.withcontrols=$.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=o.e(),this.popupRef=o.e(),this.helptextSlot=o.e(),this.singleInputRef=o.e(),this.rangeInputRef=o.e(),this.multipleInputRef=o.e(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):w.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new F.PktSlotController(this,this.helptextSlot)}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return Z.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(!(this._valueProcessing||e===t)){this._valueProcessing=!0;try{const a=u.valueToArray(e),i=this.multiple&&a.length>1?E.filterSelectableDates(a,this.min,this.max,this.excludedates,this.excludeweekdays):a;if(this.range&&!E.validateRangeOrder(i)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=i;const r=u.arrayToCsv(i);if(this._valueProperty!==r&&(this._valueProperty=r),this.range&&i.length<2)return;super.valueChanged(r,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,a){e==="value"&&this.value!==t&&this.valueChanged(a,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=u.valueToArray(a||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=u.valueToArray(a||"")),super.attributeChangedCallback(e,t,a)}updated(e){if(e.has("value")&&(e.has("multiple")||e.has("range"))){const t=Array.isArray(this.value)?this.value.join(","):this.value,a=e.get("value"),i=Array.isArray(a)?a.join(","):a;this.valueChanged(t,i)}e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=u.valueToArray(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,a;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(a=this.singleInputRef.value)==null?void 0:a.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,a;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(a=this.singleInputRef.value)==null?void 0:a.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return l.b`
146
146
  <pkt-datepicker-single
147
147
  .value=${this._value[0]??""}
148
148
  .inputType=${this.inputType}
@@ -164,7 +164,7 @@
164
164
  @input-changed=${()=>{this.touched=!0}}
165
165
  ${o.n(this.singleInputRef)}
166
166
  ></pkt-datepicker-single>
167
- `}renderRangeInput(){return l.x`
167
+ `}renderRangeInput(){return l.b`
168
168
  <pkt-datepicker-range
169
169
  .value=${this._value}
170
170
  .inputType=${this.inputType}
@@ -183,14 +183,14 @@
183
183
  @input-change=${()=>this.onInput()}
184
184
  @input-focus=${()=>this.onFocus()}
185
185
  @input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
186
- @range-blur=${e=>{const t=this.currentInputElement,a=this.currentInputElementTo;if(t&&a){const i=t.value,r=a.value;if(i&&r&&i>r)a.value="",this._value=[i],this.value=i;else{const n=[i,r].filter(Boolean);n.length>0&&(n[0]!==this._value[0]||n[1]!==this._value[1])&&(this._value=n,this.value=n.join(","))}}P.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),i=>this.manageValidity(i))}}
186
+ @range-blur=${e=>{const t=this.currentInputElement,a=this.currentInputElementTo;if(t&&a){const i=t.value,r=a.value;if(i&&r&&i>r)a.value="",this._value=[i],this.value=i;else{const n=[i,r].filter(Boolean);n.length>0&&(n[0]!==this._value[0]||n[1]!==this._value[1])&&(this._value=n,this.value=n.join(","))}}x.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),i=>this.manageValidity(i))}}
187
187
  @manage-validity=${e=>this.manageValidity(e.detail)}
188
188
  @validate-date-input=${e=>{k.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
189
189
  @handle-date-select=${e=>{var a,i;const t=u.fromISOToDate(e.detail);if(t){const r=u.formatISODate(t);this._value[0]!==r&&this._value[1]!==r&&((i=(a=this.calRef)==null?void 0:a.value)==null||i.handleDateSelect(t))}}}
190
190
  @input-changed=${()=>{this.touched=!0}}
191
191
  ${o.n(this.rangeInputRef)}
192
192
  ></pkt-datepicker-range>
193
- `}renderMultipleInput(){return l.x`
193
+ `}renderMultipleInput(){return l.b`
194
194
  <pkt-datepicker-multiple
195
195
  .value=${this._value}
196
196
  .inputType=${this.inputType}
@@ -212,7 +212,7 @@
212
212
  @input-changed=${()=>{this.touched=!0}}
213
213
  ${o.n(this.multipleInputRef)}
214
214
  ></pkt-datepicker-multiple>
215
- `}renderCalendar(){return l.x`
215
+ `}renderCalendar(){return l.b`
216
216
  <pkt-datepicker-popup
217
217
  class="pkt-contents"
218
218
  ?open=${this.calendarOpen}
@@ -228,11 +228,11 @@
228
228
  .excludeweekdays=${this.excludeweekdays}
229
229
  .currentmonth=${this.currentmonth?u.parseISODateString(this.currentmonth):null}
230
230
  .today=${this.today}
231
- @date-selected=${e=>{this.value=P.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,P.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
231
+ @date-selected=${e=>{this.value=x.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,x.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
232
232
  @close=${()=>{this.onBlur(),this.hideCalendar()}}
233
233
  ${o.n(this.datepickerPopupRef)}
234
234
  ></pkt-datepicker-popup>
235
- `}render(){return this.inputClasses=T.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),l.x`
235
+ `}render(){return this.inputClasses=T.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),l.b`
236
236
  <pkt-input-wrapper
237
237
  label="${this.label}"
238
238
  forId="${this.id}-input"
@@ -258,13 +258,13 @@
258
258
  class="pkt-datepicker"
259
259
  >
260
260
  <div class="pkt-contents" ${o.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
261
- ${this.multiple?l.x`<pkt-date-tags
261
+ ${this.multiple?l.b`<pkt-date-tags
262
262
  .dates=${this._value}
263
263
  dateformat=${this.dateformat}
264
264
  strings=${this.strings}
265
265
  id-base=${this.id}
266
266
  @date-tag-removed=${e=>{var i;const t=this.datepickerPopupRef.value,a=u.fromISOToDate(e.detail);t&&a&&typeof t.handleDateSelect=="function"?t.handleDateSelect(a):(i=this.calRef.value)==null||i.handleDateSelect(a)}}
267
- ></pkt-date-tags>`:l.E}
267
+ ></pkt-date-tags>`:l.A}
268
268
  <div
269
269
  class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
270
270
  >
@@ -0,0 +1,5 @@
1
+ "use strict";const l=require("./element-CMTfByxQ.cjs");/**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const{I:v}=l.j,c=t=>t,m=t=>t.strings===void 0,d=()=>document.createComment(""),u=(t,i,n)=>{var s;const $=t._$AA.parentNode,e=i===void 0?t._$AB:i._$AA;if(n===void 0){const r=$.insertBefore(d(),e),_=$.insertBefore(d(),e);n=new v(r,_,t,t.options)}else{const r=n._$AB.nextSibling,_=n._$AM,o=_!==t;if(o){let A;(s=n._$AQ)==null||s.call(n,t),n._$AM=t,n._$AP!==void 0&&(A=t._$AU)!==_._$AU&&n._$AP(A)}if(r!==e||o){let A=n._$AA;for(;A!==r;){const f=c(A).nextSibling;c($).insertBefore(A,e),A=f}}}return n},B=(t,i,n=t)=>(t._$AI(i,n),t),p={},M=(t,i=p)=>t._$AH=i,g=t=>t._$AH,a=t=>{t._$AR(),t._$AA.remove()};exports.M=g;exports.h=a;exports.p=M;exports.r=m;exports.u=B;exports.v=u;
@@ -0,0 +1,38 @@
1
+ import { j as m } from "./element-CV9utnHJ.js";
2
+ /**
3
+ * @license
4
+ * Copyright 2020 Google LLC
5
+ * SPDX-License-Identifier: BSD-3-Clause
6
+ */
7
+ const { I: l } = m, c = (t) => t, B = (t) => t.strings === void 0, f = () => document.createComment(""), g = (t, i, A) => {
8
+ var o;
9
+ const e = t._$AA.parentNode, r = i === void 0 ? t._$AB : i._$AA;
10
+ if (A === void 0) {
11
+ const _ = e.insertBefore(f(), r), $ = e.insertBefore(f(), r);
12
+ A = new l(_, $, t, t.options);
13
+ } else {
14
+ const _ = A._$AB.nextSibling, $ = A._$AM, s = $ !== t;
15
+ if (s) {
16
+ let n;
17
+ (o = A._$AQ) == null || o.call(A, t), A._$AM = t, A._$AP !== void 0 && (n = t._$AU) !== $._$AU && A._$AP(n);
18
+ }
19
+ if (_ !== r || s) {
20
+ let n = A._$AA;
21
+ for (; n !== _; ) {
22
+ const d = c(n).nextSibling;
23
+ c(e).insertBefore(n, r), n = d;
24
+ }
25
+ }
26
+ }
27
+ return A;
28
+ }, u = (t, i, A = t) => (t._$AI(i, A), t), v = {}, x = (t, i = v) => t._$AH = i, M = (t) => t._$AH, a = (t) => {
29
+ t._$AR(), t._$AA.remove();
30
+ };
31
+ export {
32
+ M,
33
+ a as h,
34
+ x as p,
35
+ B as r,
36
+ u,
37
+ g as v
38
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";/**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const C=globalThis,J=r=>r,k=C.trustedTypes,W=k?k.createPolicy("lit-html",{createHTML:r=>r}):void 0,rt="$lit$",f=`lit$${Math.random().toFixed(9).slice(2)}$`,nt="?"+f,pt=`<${nt}>`,y=document,U=()=>y.createComment(""),O=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,ut=r=>F(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",D=`[
6
+ \f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,K=/>/g,g=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),G=/'/g,Q=/"/g,ot=/^(?:script|style|textarea|title)$/i,$t=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),ft=$t(1),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),X=new WeakMap,m=y.createTreeWalker(y,129);function ht(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return W!==void 0?W.createHTML(t):t}const _t=(r,t)=>{const e=r.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",o=P;for(let a=0;a<e;a++){const h=r[a];let c,p,l=-1,u=0;for(;u<h.length&&(o.lastIndex=u,p=o.exec(h),p!==null);)u=o.lastIndex,o===P?p[1]==="!--"?o=Z:p[1]!==void 0?o=K:p[2]!==void 0?(ot.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=g):p[3]!==void 0&&(o=g):o===g?p[0]===">"?(o=i??P,l=-1):p[1]===void 0?l=-2:(l=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?g:p[3]==='"'?Q:G):o===Q||o===G?o=g:o===Z||o===K?o=P:(o=g,i=void 0);const $=o===g&&r[a+1].startsWith("/>")?" ":"";n+=o===P?h+pt:l>=0?(s.push(c),h.slice(0,l)+rt+h.slice(l)+f+$):h+f+(l===-2?a:$)}return[ht(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};let I=class at{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const a=t.length-1,h=this.parts,[c,p]=_t(t,e);if(this.el=at.createElement(c,s),m.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=m.nextNode())!==null&&h.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(rt)){const u=p[o++],$=i.getAttribute(l).split(f),M=/([.?@])?(.*)/.exec(u);h.push({type:1,index:n,name:M[2],strings:$,ctor:M[1]==="."?mt:M[1]==="?"?At:M[1]==="@"?yt:N}),i.removeAttribute(l)}else l.startsWith(f)&&(h.push({type:6,index:n}),i.removeAttribute(l));if(ot.test(i.tagName)){const l=i.textContent.split(f),u=l.length-1;if(u>0){i.textContent=k?k.emptyScript:"";for(let $=0;$<u;$++)i.append(l[$],U()),m.nextNode(),h.push({type:2,index:++n});i.append(l[u],U())}}}else if(i.nodeType===8)if(i.data===nt)h.push({type:2,index:n});else{let l=-1;for(;(l=i.data.indexOf(f,l+1))!==-1;)h.push({type:7,index:n}),l+=f.length-1}n++}}static createElement(t,e){const s=y.createElement("template");return s.innerHTML=t,s}};function b(r,t,e=r,s){var o,a;if(t===v)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=O(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=b(r,i._$AS(r,t.values),i,s)),t}class gt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??y).importNode(e,!0);m.currentNode=i;let n=m.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new w(n,n.nextSibling,this,t):h.type===1?c=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(c=new vt(n,this,t)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(n=m.nextNode(),o++)}return m.currentNode=y,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class w{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=b(this,t,e),O(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==v&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ut(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=I.createElement(ht(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{const o=new gt(i,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=X.get(t.strings);return e===void 0&&X.set(t.strings,e=new I(t)),e}k(t){F(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new w(this.O(U()),this.O(U()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const i=J(t).nextSibling;J(t).remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class N{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(n===void 0)t=b(this,t,e,0),o=!O(t)||t!==this._$AH&&t!==v,o&&(this._$AH=t);else{const a=t;let h,c;for(t=n[0],h=0;h<n.length-1;h++)c=b(this,a[s+h],e,h),c===v&&(c=this._$AH[h]),o||(o=!O(c)||c!==this._$AH[h]),c===d?t=d:t!==d&&(t+=(c??"")+n[h+1]),this._$AH[h]=c}o&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class mt extends N{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class At extends N{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class yt extends N{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=b(this,t,e,0)??d)===v)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class vt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){b(this,t)}}const Et={I:w},j=C.litHtmlPolyfillSupport;j==null||j(I,w),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.3.2");const St=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new w(t.insertBefore(U(),n),n,void 0,e??{})}return i._$AI(r),i};/**
8
+ * @license
9
+ * Copyright 2017 Google LLC
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */const bt=r=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(r,t)}):customElements.define(r,t)};/**
12
+ * @license
13
+ * Copyright 2019 Google LLC
14
+ * SPDX-License-Identifier: BSD-3-Clause
15
+ */const T=globalThis,B=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,lt=Symbol(),Y=new WeakMap;let wt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==lt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(B&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=Y.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Y.set(e,t))}return t}toString(){return this.cssText}};const Pt=r=>new wt(typeof r=="string"?r:r+"",void 0,lt),Ct=(r,t)=>{if(B)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},tt=B?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Pt(e)})(r):r;/**
16
+ * @license
17
+ * Copyright 2017 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */const{is:xt,defineProperty:Ut,getOwnPropertyDescriptor:Ot,getOwnPropertyNames:Mt,getOwnPropertySymbols:Tt,getPrototypeOf:kt}=Object,_=globalThis,et=_.trustedTypes,Ht=et?et.emptyScript:"",L=_.reactiveElementPolyfillSupport,x=(r,t)=>r,H={toAttribute(r,t){switch(t){case Boolean:r=r?Ht:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},q=(r,t)=>!xt(r,t),st={attribute:!0,type:String,converter:H,reflect:!1,useDefault:!1,hasChanged:q};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class E extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=st){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=Ot(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){const a=i==null?void 0:i.call(this);n==null||n.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??st}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=kt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const e=this.properties,s=[...Mt(e),...Tt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(tt(i))}else t!==void 0&&e.push(tt(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ct(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:H).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var n,o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const a=s.getPropertyOptions(i),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((n=a.converter)==null?void 0:n.fromAttribute)!==void 0?a.converter:H;this._$Em=i;const c=h.fromAttribute(e,a.type);this[i]=c??((o=this._$Ej)==null?void 0:o.get(i))??c,this._$Em=null}}requestUpdate(t,e,s,i=!1,n){var o;if(t!==void 0){const a=this.constructor;if(i===!1&&(n=this[t]),s??(s=a.getPropertyOptions(t)),!((s.hasChanged??q)(n,e)||s.useDefault&&s.reflect&&n===((o=this._$Ej)==null?void 0:o.get(t))&&!this.hasAttribute(a._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),n!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[n,o]of i){const{wrapped:a}=o,h=this[n];a!==!0||this._$AL.has(n)||h===void 0||this.C(n,void 0,o,h)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var n;return(n=i.hostUpdate)==null?void 0:n.call(i)}),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[x("elementProperties")]=new Map,E[x("finalized")]=new Map,L==null||L({ReactiveElement:E}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.1.2");/**
20
+ * @license
21
+ * Copyright 2017 Google LLC
22
+ * SPDX-License-Identifier: BSD-3-Clause
23
+ */const Nt={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:q},Rt=(r=Nt,t,e)=>{const{kind:s,metadata:i}=e;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((r=Object.create(r)).wrapped=!0),n.set(e.name,r),s==="accessor"){const{name:o}=e;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,h,r,!0,a)},init(a){return a!==void 0&&this.C(o,void 0,r,a),a}}}if(s==="setter"){const{name:o}=e;return function(a){const h=this[o];t.call(this,a),this.requestUpdate(o,h,r,!0,a)}}throw Error("Unsupported decorator location: "+s)};function V(r){return(t,e)=>typeof e=="object"?Rt(r,t,e):((s,i,n)=>{const o=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),o?Object.getOwnPropertyDescriptor(i,n):void 0})(r,t,e)}/**
24
+ * @license
25
+ * Copyright 2017 Google LLC
26
+ * SPDX-License-Identifier: BSD-3-Clause
27
+ */const A=globalThis;class S extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=St(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return v}}var it;S._$litElement$=!0,S.finalized=!0,(it=A.litElementHydrateSupport)==null||it.call(A,{LitElement:S});const z=A.litElementPolyfillSupport;z==null||z({LitElement:S});(A.litElementVersions??(A.litElementVersions=[])).push("4.2.2");const Dt={hi:"Hei!"},jt={from:"Fra",to:"Til"},Lt={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},zt={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},It={search:{placeholder:"Søk…"},labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",rangeUnderflowMin:"Verdien må være større enn eller lik {min}.",rangeOverflowMax:"Verdien må være mindre enn eller lik {max}.",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},helptext:{helptextDropdownButton:"Les mer"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},ct={example:Dt,generic:jt,calendar:Lt,dates:zt,forms:It};var Ft=Object.defineProperty,dt=(r,t,e,s)=>{for(var i=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(i=o(t,e,i)||i);return i&&Ft(t,e,i),i};class R extends S{constructor(){super(...arguments),this.strings=ct,this.role=null}hotReplacedCallback(){this.requestUpdate()}}dt([V({type:Object})],R.prototype,"strings");dt([V({type:String})],R.prototype,"role");class Bt extends R{createRenderRoot(){return this}}exports.A=d;exports.E=v;exports.PktElement=Bt;exports.PktShadowElement=R;exports.b=ft;exports.i=S;exports.j=Et;exports.n=V;exports.strings=ct;exports.t=bt;