@oslokommune/punkt-elements 12.10.3 → 12.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/alert.d.ts +7 -0
  2. package/dist/calendar.d.ts +7 -0
  3. package/dist/card.d.ts +7 -0
  4. package/dist/{class-map-BQ1sNo2I.cjs → class-map-B9m-NycN.cjs} +1 -1
  5. package/dist/{class-map-CZx7r-TQ.js → class-map-DpN1m5lh.js} +2 -2
  6. package/dist/component-template.d.ts +7 -0
  7. package/dist/custom-element-B-TlBwRu.cjs +9 -0
  8. package/dist/{directive-Cxhakbpr.js → custom-element-CWfU4dcr.js} +18 -18
  9. package/dist/datepicker.d.ts +7 -0
  10. package/dist/element.d.ts +7 -0
  11. package/dist/helptext-0fI9cWEe.cjs +21 -0
  12. package/dist/helptext-B0Frb38k.js +70 -0
  13. package/dist/helptext.d.ts +7 -0
  14. package/dist/icon.d.ts +7 -0
  15. package/dist/index-Bb6UaG_m.cjs +108 -0
  16. package/dist/index-CBFF6OHE.cjs +27 -0
  17. package/dist/{index-DrbmKLH4.cjs → index-CqWQt14b.cjs} +1 -1
  18. package/dist/index-DHfWkUot.js +1954 -0
  19. package/dist/{index-IixgwzHL.js → index-DkLa0YLm.js} +2 -2
  20. package/dist/{index-D9GOYh7D.js → index-Dw-V4--g.js} +531 -396
  21. package/dist/index.d.ts +50 -13
  22. package/dist/input-wrapper.d.ts +7 -0
  23. package/dist/link.d.ts +7 -0
  24. package/dist/messagebox.d.ts +7 -0
  25. package/dist/modal-BDkZRwul.cjs +30 -0
  26. package/dist/modal-CZUWZuRC.js +149 -0
  27. package/dist/modal.d.ts +8 -0
  28. package/dist/pkt-alert.cjs +1 -1
  29. package/dist/pkt-alert.js +12 -12
  30. package/dist/pkt-calendar.cjs +1 -1
  31. package/dist/pkt-calendar.js +5 -5
  32. package/dist/pkt-card.cjs +1 -1
  33. package/dist/pkt-card.js +12 -12
  34. package/dist/pkt-component-template.cjs +3 -3
  35. package/dist/pkt-component-template.js +4 -4
  36. package/dist/pkt-datepicker.cjs +29 -29
  37. package/dist/pkt-datepicker.js +178 -1350
  38. package/dist/pkt-element.cjs +1 -1
  39. package/dist/pkt-element.js +1 -1
  40. package/dist/pkt-helptext.cjs +1 -1
  41. package/dist/pkt-helptext.js +1 -1
  42. package/dist/pkt-icon.cjs +1 -1
  43. package/dist/pkt-icon.js +3 -3
  44. package/dist/pkt-index.cjs +1 -1
  45. package/dist/pkt-index.js +14 -12
  46. package/dist/pkt-input-wrapper.cjs +22 -21
  47. package/dist/pkt-input-wrapper.js +29 -28
  48. package/dist/pkt-link.cjs +1 -1
  49. package/dist/pkt-link.js +5 -5
  50. package/dist/pkt-messagebox.cjs +2 -2
  51. package/dist/pkt-messagebox.js +5 -5
  52. package/dist/pkt-modal.cjs +1 -0
  53. package/dist/pkt-modal.js +6 -0
  54. package/dist/pkt-tag.cjs +2 -2
  55. package/dist/pkt-tag.js +5 -5
  56. package/dist/{ref-B160Pg_6.cjs → ref-3QXuhm6y.cjs} +1 -1
  57. package/dist/{ref-D-cAUL_h.js → ref-D5FOI49b.js} +2 -2
  58. package/dist/tag.d.ts +7 -0
  59. package/package.json +5 -4
  60. package/src/components/alert/index.ts +4 -3
  61. package/src/components/calendar/index.ts +63 -58
  62. package/src/components/card/index.ts +5 -5
  63. package/src/components/datepicker/index.ts +26 -55
  64. package/src/components/element/index.ts +33 -17
  65. package/src/components/index.ts +1 -0
  66. package/src/components/input-wrapper/index.ts +6 -3
  67. package/src/components/messagebox/index.ts +2 -1
  68. package/src/components/modal/index.ts +4 -0
  69. package/src/components/modal/modal.ts +153 -0
  70. package/dist/directive-DtixNHDT.cjs +0 -9
  71. package/dist/helptext-BI6RS6Vd.js +0 -191
  72. package/dist/helptext-Bu-TJ41c.cjs +0 -21
  73. package/dist/index-De04fSKv.cjs +0 -27
  74. package/dist/index-Dno-kFCB.cjs +0 -105
  75. package/dist/index-Dy6cGLvK.js +0 -618
package/dist/alert.d.ts CHANGED
@@ -1 +1,8 @@
1
1
  export { }
2
+
3
+
4
+ declare global {
5
+ interface Window {
6
+ pktTz: string;
7
+ }
8
+ }
@@ -1 +1,8 @@
1
1
  export { }
2
+
3
+
4
+ declare global {
5
+ interface Window {
6
+ pktTz: string;
7
+ }
8
+ }
package/dist/card.d.ts CHANGED
@@ -1 +1,8 @@
1
1
  export { }
2
+
3
+
4
+ declare global {
5
+ interface Window {
6
+ pktTz: string;
7
+ }
8
+ }
@@ -1,4 +1,4 @@
1
- "use strict";const a=require("./index-De04fSKv.cjs"),r=require("./directive-DtixNHDT.cjs");/**
1
+ "use strict";const a=require("./index-CBFF6OHE.cjs"),r=require("./custom-element-B-TlBwRu.cjs");/**
2
2
  * @license
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,5 +1,5 @@
1
- import { T as a } from "./index-D9GOYh7D.js";
2
- import { e as h, i as d, a as c } from "./directive-Cxhakbpr.js";
1
+ import { T as a } from "./index-Dw-V4--g.js";
2
+ import { e as h, i as d, a as c } from "./custom-element-CWfU4dcr.js";
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2018 Google LLC
@@ -1 +1,8 @@
1
1
  export { }
2
+
3
+
4
+ declare global {
5
+ interface Window {
6
+ pktTz: string;
7
+ }
8
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";/**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},n=i=>(...t)=>({_$litDirective$:i,values:t});class ${constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const E=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};exports.e=n;exports.i=$;exports.t=E;exports.t$1=r;
@@ -3,25 +3,15 @@
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const r = (s) => (t, e) => {
7
- e !== void 0 ? e.addInitializer(() => {
8
- customElements.define(s, t);
9
- }) : customElements.define(s, t);
10
- };
11
- /**
12
- * @license
13
- * Copyright 2017 Google LLC
14
- * SPDX-License-Identifier: BSD-3-Clause
15
- */
16
- const n = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, E = (s) => (...t) => ({ _$litDirective$: s, values: t });
17
- class $ {
6
+ const r = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, n = (i) => (...t) => ({ _$litDirective$: i, values: t });
7
+ class E {
18
8
  constructor(t) {
19
9
  }
20
10
  get _$AU() {
21
11
  return this._$AM._$AU;
22
12
  }
23
- _$AT(t, e, i) {
24
- this._$Ct = t, this._$AM = e, this._$Ci = i;
13
+ _$AT(t, e, s) {
14
+ this._$Ct = t, this._$AM = e, this._$Ci = s;
25
15
  }
26
16
  _$AS(t, e) {
27
17
  return this.update(t, e);
@@ -30,9 +20,19 @@ class $ {
30
20
  return this.render(...e);
31
21
  }
32
22
  }
23
+ /**
24
+ * @license
25
+ * Copyright 2017 Google LLC
26
+ * SPDX-License-Identifier: BSD-3-Clause
27
+ */
28
+ const $ = (i) => (t, e) => {
29
+ e !== void 0 ? e.addInitializer(() => {
30
+ customElements.define(i, t);
31
+ }) : customElements.define(i, t);
32
+ };
33
33
  export {
34
- n as a,
35
- E as e,
36
- $ as i,
37
- r as t
34
+ r as a,
35
+ n as e,
36
+ E as i,
37
+ $ as t
38
38
  };
@@ -1 +1,8 @@
1
1
  export { }
2
+
3
+
4
+ declare global {
5
+ interface Window {
6
+ pktTz: string;
7
+ }
8
+ }
package/dist/element.d.ts CHANGED
@@ -1 +1,8 @@
1
1
  export { }
2
+
3
+
4
+ declare global {
5
+ interface Window {
6
+ pktTz: string;
7
+ }
8
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";const t=require("./index-CBFF6OHE.cjs"),h=require("./index-CqWQt14b.cjs"),x=require("./class-map-B9m-NycN.cjs"),c=require("./custom-element-B-TlBwRu.cjs");var u=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=(s,p,l,n)=>{for(var e=n>1?void 0:n?a(p,l):p,o=s.length-1,i;o>=0;o--)(i=s[o])&&(e=(n?i(p,l,e):i(e))||e);return n&&e&&u(p,l,e),e};exports.PktHelptext=class extends t.PktElement{constructor(){super(),this.forId=t.v4(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=t.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){const p=()=>{this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:!this.isHelpTextOpen}})),this.isHelpTextOpen=!this.isHelpTextOpen},l={"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen},n=()=>this.helptext||this.helptextDropdown?t.x`<div>
2
+ ${this.helptext?t.x`<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
3
+ ${h.o(this.helptext)}
4
+ </div>`:t.E}
5
+ ${this.helptextDropdown?t.x`<div class="pkt-inputwrapper__helptext-expandable">
6
+ <button
7
+ class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
8
+ type="button"
9
+ @click=${p}
10
+ >
11
+ <pkt-icon
12
+ class="pkt-btn__icon"
13
+ name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
14
+ ></pkt-icon>
15
+ <span class="pkt-btn__text">${h.o(this.helptextDropdownButton)}</span>
16
+ </button>
17
+ <div class="${x.e(l)}">
18
+ ${h.o(this.helptextDropdown)}
19
+ </div>
20
+ </div>`:t.E}
21
+ </div>`:t.E;return t.x`${n()}`}};r([t.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"forId",2);r([t.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"helptext",2);r([t.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"helptextDropdown",2);r([t.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"helptextDropdownButton",2);r([t.r()],exports.PktHelptext.prototype,"isHelpTextOpen",2);exports.PktHelptext=r([c.t("pkt-helptext")],exports.PktHelptext);
@@ -0,0 +1,70 @@
1
+ import { r as c, P as u, v, s as w, x as l, n as i, E as a } from "./index-Dw-V4--g.js";
2
+ import { o as d } from "./index-DkLa0YLm.js";
3
+ import { e as _ } from "./class-map-DpN1m5lh.js";
4
+ import { t as f } from "./custom-element-CWfU4dcr.js";
5
+ var b = Object.defineProperty, k = Object.getOwnPropertyDescriptor, r = (n, p, o, s) => {
6
+ for (var t = s > 1 ? void 0 : s ? k(p, o) : p, h = n.length - 1, x; h >= 0; h--)
7
+ (x = n[h]) && (t = (s ? x(p, o, t) : x(t)) || t);
8
+ return s && t && b(p, o, t), t;
9
+ };
10
+ let e = class extends u {
11
+ constructor() {
12
+ super(), this.forId = v(), this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = w.props.helptextDropdownButton.default, this.isHelpTextOpen = !1;
13
+ }
14
+ render() {
15
+ const n = () => {
16
+ this.dispatchEvent(
17
+ new CustomEvent("toggleHelpText", {
18
+ bubbles: !0,
19
+ detail: { isOpen: !this.isHelpTextOpen }
20
+ })
21
+ ), this.isHelpTextOpen = !this.isHelpTextOpen;
22
+ }, p = {
23
+ "pkt-inputwrapper__helptext": !0,
24
+ "pkt-inputwrapper__helptext-expandable-open": this.isHelpTextOpen,
25
+ "pkt-inputwrapper__helptext-expandable-closed": !this.isHelpTextOpen
26
+ };
27
+ return l`${this.helptext || this.helptextDropdown ? l`<div>
28
+ ${this.helptext ? l`<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
29
+ ${d(this.helptext)}
30
+ </div>` : a}
31
+ ${this.helptextDropdown ? l`<div class="pkt-inputwrapper__helptext-expandable">
32
+ <button
33
+ class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
34
+ type="button"
35
+ @click=${n}
36
+ >
37
+ <pkt-icon
38
+ class="pkt-btn__icon"
39
+ name="${this.isHelpTextOpen ? "chevron-thin-up" : "chevron-thin-down"}"
40
+ ></pkt-icon>
41
+ <span class="pkt-btn__text">${d(this.helptextDropdownButton)}</span>
42
+ </button>
43
+ <div class="${_(p)}">
44
+ ${d(this.helptextDropdown)}
45
+ </div>
46
+ </div>` : a}
47
+ </div>` : a}`;
48
+ }
49
+ };
50
+ r([
51
+ i({ type: String, reflect: !0 })
52
+ ], e.prototype, "forId", 2);
53
+ r([
54
+ i({ type: String, reflect: !0 })
55
+ ], e.prototype, "helptext", 2);
56
+ r([
57
+ i({ type: String, reflect: !0 })
58
+ ], e.prototype, "helptextDropdown", 2);
59
+ r([
60
+ i({ type: String, reflect: !0 })
61
+ ], e.prototype, "helptextDropdownButton", 2);
62
+ r([
63
+ c()
64
+ ], e.prototype, "isHelpTextOpen", 2);
65
+ e = r([
66
+ f("pkt-helptext")
67
+ ], e);
68
+ export {
69
+ e as P
70
+ };
@@ -1 +1,8 @@
1
1
  export { }
2
+
3
+
4
+ declare global {
5
+ interface Window {
6
+ pktTz: string;
7
+ }
8
+ }
package/dist/icon.d.ts CHANGED
@@ -1 +1,8 @@
1
1
  export { }
2
+
3
+
4
+ declare global {
5
+ interface Window {
6
+ pktTz: string;
7
+ }
8
+ }
@@ -0,0 +1,108 @@
1
+ "use strict";const o=require("./index-CBFF6OHE.cjs"),H=require("./converters-DhM11VlY.cjs"),ot=require("./custom-element-B-TlBwRu.cjs"),ct=require("./class-map-B9m-NycN.cjs");require("./index-CqWQt14b.cjs");const tt=6048e5,lt=864e5,ut=36e5,B=Symbol.for("constructDateFrom");function D(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&B in n?n[B](t):n instanceof Date?new n.constructor(t):new Date(t)}function v(n,t){return D(t||n,n)}function q(n,t,e){const r=v(n,e==null?void 0:e.in);return isNaN(t)?D(n,NaN):(t&&r.setDate(r.getDate()+t),r)}function ht(n,t,e){return D(n,+v(n)+t)}function A(n,t,e){return ht(n,t*ut)}let dt={};function _(){return dt}function Y(n,t){var c,l,u,f;const e=_(),r=(t==null?void 0:t.weekStartsOn)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,a=v(n,t==null?void 0:t.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function F(n,t){return Y(n,{...t,weekStartsOn:1})}function et(n,t){const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=D(e,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=F(a),i=D(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const c=F(i);return e.getTime()>=s.getTime()?r+1:e.getTime()>=c.getTime()?r:r-1}function Q(n){const t=v(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function nt(n,...t){const e=D.bind(null,t.find(r=>typeof r=="object"));return t.map(e)}function j(n,t){const e=v(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function ft(n,t,e){const[r,a]=nt(e==null?void 0:e.in,n,t),s=j(r),i=j(a),c=+s-Q(s),l=+i-Q(i);return Math.round((c-l)/lt)}function mt(n,t){const e=et(n,t),r=D(n,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),F(r)}function gt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function yt(n){return!(!gt(n)&&typeof n!="number"||isNaN(+v(n)))}function pt(n,t){const[e,r]=nt(n,t.start,t.end);return{start:e,end:r}}function L(n,t){const{start:e,end:r}=pt(t==null?void 0:t.in,n);let a=+e>+r;const s=a?+e:+r,i=a?r:e;i.setHours(0,0,0,0);let c=1;const l=[];for(;+i<=s;)l.push(D(e,i)),i.setDate(i.getDate()+c),i.setHours(0,0,0,0);return a?l.reverse():l}function wt(n,t){const e=v(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const bt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},kt=(n,t,e)=>{let r;const a=bt[n];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r};function R(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const vt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},St={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Mt={date:R({formats:vt,defaultWidth:"full"}),time:R({formats:Dt,defaultWidth:"full"}),dateTime:R({formats:St,defaultWidth:"full"})},xt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tt=(n,t,e,r)=>xt[n];function $(n){return(t,e)=>{const r=e!=null&&e.context?String(e.context):"standalone";let a;if(r==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,c=e!=null&&e.width?String(e.width):i;a=n.formattingValues[c]||n.formattingValues[i]}else{const i=n.defaultWidth,c=e!=null&&e.width?String(e.width):n.defaultWidth;a=n.values[c]||n.values[i]}const s=n.argumentCallback?n.argumentCallback(t):t;return a[s]}}const Pt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ot={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ct={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$t={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Et={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Nt=(n,t)=>{const e=Number(n),r=e%100;if(r>20||r<10)switch(r%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Yt={ordinalNumber:Nt,era:$({values:Pt,defaultWidth:"wide"}),quarter:$({values:Ot,defaultWidth:"wide",argumentCallback:n=>n-1}),month:$({values:Ct,defaultWidth:"wide"}),day:$({values:$t,defaultWidth:"wide"}),dayPeriod:$({values:Et,defaultWidth:"wide",formattingValues:Wt,defaultFormattingWidth:"wide"})};function E(n){return(t,e={})=>{const r=e.width,a=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],c=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(c)?Ft(c,p=>p.test(i)):At(c,p=>p.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const f=t.slice(i.length);return{value:u,rest:f}}}function At(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Ft(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Ht(n){return(t,e={})=>{const r=t.match(n.matchPattern);if(!r)return null;const a=r[0],s=t.match(n.parsePattern);if(!s)return null;let i=n.valueCallback?n.valueCallback(s[0]):s[0];i=e.valueCallback?e.valueCallback(i):i;const c=t.slice(a.length);return{value:i,rest:c}}}const _t=/^(\d+)(th|st|nd|rd)?/i,It=/\d+/i,qt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Lt={any:[/^b/i,/^(a|c)/i]},Rt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ut={any:[/1/i,/2/i,/3/i,/4/i]},zt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Bt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Qt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},jt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Gt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Xt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Vt={ordinalNumber:Ht({matchPattern:_t,parsePattern:It,valueCallback:n=>parseInt(n,10)}),era:E({matchPatterns:qt,defaultMatchWidth:"wide",parsePatterns:Lt,defaultParseWidth:"any"}),quarter:E({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:Ut,defaultParseWidth:"any",valueCallback:n=>n+1}),month:E({matchPatterns:zt,defaultMatchWidth:"wide",parsePatterns:Bt,defaultParseWidth:"any"}),day:E({matchPatterns:Qt,defaultMatchWidth:"wide",parsePatterns:jt,defaultParseWidth:"any"}),dayPeriod:E({matchPatterns:Gt,defaultMatchWidth:"any",parsePatterns:Xt,defaultParseWidth:"any"})},Jt={code:"en-US",formatDistance:kt,formatLong:Mt,formatRelative:Tt,localize:Yt,match:Vt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Kt(n,t){const e=v(n,t==null?void 0:t.in);return ft(e,wt(e))+1}function Zt(n,t){const e=v(n,t==null?void 0:t.in),r=+F(e)-+mt(e);return Math.round(r/tt)+1}function rt(n,t){var f,p,w,m;const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=_(),s=(t==null?void 0:t.firstWeekContainsDate)??((p=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(w=a.locale)==null?void 0:w.options)==null?void 0:m.firstWeekContainsDate)??1,i=D((t==null?void 0:t.in)||n,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const c=Y(i,t),l=D((t==null?void 0:t.in)||n,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=Y(l,t);return+e>=+c?r+1:+e>=+u?r:r-1}function te(n,t){var c,l,u,f;const e=_(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,a=rt(n,t),s=D((t==null?void 0:t.in)||n,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),Y(s,t)}function at(n,t){const e=v(n,t==null?void 0:t.in),r=+Y(e,t)-+te(e,t);return Math.round(r/tt)+1}function h(n,t){const e=n<0?"-":"",r=Math.abs(n).toString().padStart(t,"0");return e+r}const x={y(n,t){const e=n.getFullYear(),r=e>0?e:1-e;return h(t==="yy"?r%100:r,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):h(e+1,2)},d(n,t){return h(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return h(n.getHours()%12||12,t.length)},H(n,t){return h(n.getHours(),t.length)},m(n,t){return h(n.getMinutes(),t.length)},s(n,t){return h(n.getSeconds(),t.length)},S(n,t){const e=t.length,r=n.getMilliseconds(),a=Math.trunc(r*Math.pow(10,e-3));return h(a,t.length)}},C={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},G={G:function(n,t,e){const r=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const r=n.getFullYear(),a=r>0?r:1-r;return e.ordinalNumber(a,{unit:"year"})}return x.y(n,t)},Y:function(n,t,e,r){const a=rt(n,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return h(i,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):h(s,t.length)},R:function(n,t){const e=et(n);return h(e,t.length)},u:function(n,t){const e=n.getFullYear();return h(e,t.length)},Q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return h(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return h(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,t,e){const r=n.getMonth();switch(t){case"M":case"MM":return x.M(n,t);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(n,t,e){const r=n.getMonth();switch(t){case"L":return String(r+1);case"LL":return h(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(n,t,e,r){const a=at(n,r);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):h(a,t.length)},I:function(n,t,e){const r=Zt(n);return t==="Io"?e.ordinalNumber(r,{unit:"week"}):h(r,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):x.d(n,t)},D:function(n,t,e){const r=Kt(n);return t==="Do"?e.ordinalNumber(r,{unit:"dayOfYear"}):h(r,t.length)},E:function(n,t,e){const r=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});case"EEEE":default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return h(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return h(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(n,t,e){const r=n.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return h(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(n,t,e){const a=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(n,t,e){const r=n.getHours();let a;switch(r===12?a=C.noon:r===0?a=C.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(n,t,e){const r=n.getHours();let a;switch(r>=17?a=C.evening:r>=12?a=C.afternoon:r>=4?a=C.morning:a=C.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let r=n.getHours()%12;return r===0&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return x.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):x.H(n,t)},K:function(n,t,e){const r=n.getHours()%12;return t==="Ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},k:function(n,t,e){let r=n.getHours();return r===0&&(r=24),t==="ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):x.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):x.s(n,t)},S:function(n,t){return x.S(n,t)},X:function(n,t,e){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return V(r);case"XXXX":case"XX":return O(r);case"XXXXX":case"XXX":default:return O(r,":")}},x:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"x":return V(r);case"xxxx":case"xx":return O(r);case"xxxxx":case"xxx":default:return O(r,":")}},O:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+X(r,":");case"OOOO":default:return"GMT"+O(r,":")}},z:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+X(r,":");case"zzzz":default:return"GMT"+O(r,":")}},t:function(n,t,e){const r=Math.trunc(+n/1e3);return h(r,t.length)},T:function(n,t,e){return h(+n,t.length)}};function X(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=Math.trunc(r/60),s=r%60;return s===0?e+String(a):e+String(a)+t+h(s,2)}function V(n,t){return n%60===0?(n>0?"-":"+")+h(Math.abs(n)/60,2):O(n,t)}function O(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=h(Math.trunc(r/60),2),s=h(r%60,2);return e+a+t+s}const J=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},st=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ee=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],r=e[1],a=e[2];if(!a)return J(n,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",J(r,t)).replace("{{time}}",st(a,t))},ne={p:st,P:ee},re=/^D+$/,ae=/^Y+$/,se=["D","DD","YY","YYYY"];function ie(n){return re.test(n)}function oe(n){return ae.test(n)}function ce(n,t,e){const r=le(n,t,e);if(console.warn(r),se.includes(n))throw new RangeError(r)}function le(n,t,e){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ue=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,he=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,de=/^'([^]*?)'?$/,fe=/''/g,me=/[a-zA-Z]/;function ge(n,t,e){var f,p,w,m;const r=_(),a=r.locale??Jt,s=r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(w=r.locale)==null?void 0:w.options)==null?void 0:m.weekStartsOn)??0,c=v(n,e==null?void 0:e.in);if(!yt(c))throw new RangeError("Invalid time value");let l=t.match(he).map(g=>{const k=g[0];if(k==="p"||k==="P"){const I=ne[k];return I(g,a.formatLong)}return g}).join("").match(ue).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const k=g[0];if(k==="'")return{isToken:!1,value:ye(g)};if(G[k])return{isToken:!0,value:g};if(k.match(me))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(l=a.localize.preprocessor(c,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return l.map(g=>{if(!g.isToken)return g.value;const k=g.value;(oe(k)||ie(k))&&ce(k,t,String(n));const I=G[k[0]];return I(c,k,a.localize,u)}).join("")}function ye(n){const t=n.match(de);return t?t[1].replace(fe,"'"):n}function pe(n,t){const e=v(n,t==null?void 0:t.in).getDay();return e===0?7:e}const U={},W={};function N(n,t){try{const r=(U[n]||(U[n]=new Intl.DateTimeFormat("en-GB",{timeZone:n,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in W?W[r]:K(r,r.split(":"))}catch{if(n in W)return W[n];const e=n==null?void 0:n.match(we);return e?K(n,e.slice(1)):NaN}}const we=/([+-]\d\d):?(\d\d)?/;function K(n,t){const e=+t[0],r=+(t[1]||0);return W[n]=e>0?e*60+r:e*60-r}class S extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(N(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),it(this),z(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new S(...e,t):new S(Date.now(),t)}withTimeZone(t){return new S(+this,t)}getTimezoneOffset(){return-N(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),z(this),+this}[Symbol.for("constructDateFrom")](t){return new S(+new Date(t),this.timeZone)}}const Z=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!Z.test(n))return;const t=n.replace(Z,"$1UTC");S.prototype[t]&&(n.startsWith("get")?S.prototype[n]=function(){return this.internal[t]()}:(S.prototype[n]=function(){return Date.prototype[t].apply(this.internal,arguments),be(this),+this},S.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),z(this),+this}))});function z(n){n.internal.setTime(+n),n.internal.setUTCMinutes(n.internal.getUTCMinutes()-n.getTimezoneOffset())}function be(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),it(n)}function it(n){const t=N(n.timeZone,n),e=new Date(+n);e.setUTCHours(e.getUTCHours()-1);const r=-new Date(+n).getTimezoneOffset(),a=-new Date(+e).getTimezoneOffset(),s=r-a,i=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();s&&i&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+s);const c=r-t;c&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+c);const l=N(n.timeZone,n),f=-new Date(+n).getTimezoneOffset()-l,p=l!==t,w=f-c;if(p&&w){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+w);const m=N(n.timeZone,n),g=l-m;g&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+g),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+g))}}class M extends S{static tz(t,...e){return e.length?new M(...e,t):new M(Date.now(),t)}toISOString(){const[t,e,r]=this.tzComponents(),a=`${t}${e}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,r,a]=this.tzComponents();return`${t} GMT${e}${r}${a} (${ke(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,r,a]}withTimeZone(t){return new M(+this,t)}[Symbol.for("constructDateFrom")](t){return new M(+new Date(t),this.timeZone)}}function ke(n,t){return new Intl.DateTimeFormat("en-GB",{timeZone:n,timeZoneName:"long"}).format(t).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const y=n=>n.toISOString().split("T")[0],ve=n=>{if(!n)return null;const t=A(new M(n,window.pktTz),12);return isNaN(t.getTime())?null:t},De=(n,t)=>{const e=b(n);return isNaN(e.getTime())?"":ge(e,t)},b=(n="")=>A(n===""||!n?new M(new Date,window.pktTz):new M(n,window.pktTz),12),T=(n,t,e=1)=>A(new M(n,t,e,window.pktTz),12),Se=n=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(n),Me="pkt-calendar",xe={id:{type:"string",name:"ID",description:"Unique identifier for the calendar"},currentmonth:{type:"date",converter:"stringToDate",description:"The current month to display"},selected:{type:"array",converter:"csvToArray",reflect:!0,items:{type:"date"},description:"Array of selected dates"},excludeweekdays:{type:"array",converter:"csvToArray",items:{type:"string"},description:"Array of weekdays (1-7) to exclude"},excludedates:{type:"array",converter:"stringsToDate",items:{type:"date"},description:"Array of specific dates to exclude"},earliest:{type:"date",converter:"stringToDate",default:null,description:"Earliest selectable date"},latest:{type:"date",converter:"stringToDate",default:null,description:"Latest selectable date"},weeknumbers:{type:"boolean",reflect:!0,default:!1,description:"Show week numbers in calendar"},withcontrols:{type:"boolean",reflect:!0,default:!1,description:"Show month and year navigation controls"},multiple:{type:"boolean",reflect:!0,default:!1,description:"Allow multiple date selection"},maxMultiple:{type:"number",default:4,description:"Maximum number of dates that can be selected"},range:{type:"boolean",reflect:!0,default:!1,description:"Allow date range selection"}},Te={"date-selected":{description:"Returns ISO formatted date string"}},P={name:Me,"css-class":"pkt-calendar",props:xe,events:Te};var Pe=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,d=(n,t,e,r)=>{for(var a=r>1?void 0:r?Oe(t,e):t,s=n.length-1,i;s>=0;s--)(i=n[s])&&(a=(r?i(t,e,a):i(a))||a);return r&&a&&Pe(t,e,a),a};exports.PktCalendar=class extends o.PktElement{constructor(){super(...arguments),this.multiple=P.props.multiple.default,this.maxMultiple=P.props.maxMultiple.default,this.range=P.props.range.default,this.weeknumbers=P.props.weeknumbers.default,this.withcontrols=P.props.withcontrols.default,this.selected=[],this.earliest=P.props.earliest.default,this.latest=P.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,r){t==="selected"&&r&&this.convertSelected(),super.attributeChangedCallback(t,e,r)}updated(t){t.has("selected")&&this.convertSelected(),super.updated(t)}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>b(t)),this.range&&this.selected.length===2){const t=L({start:b(this.selected[0]),end:b(this.selected[1])});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let r=0;r<t.length;r++)e[y(t[r])]=this.isInRange(t[r]);this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=b(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=b()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var s,i,c;if(((s=t.target)==null?void 0:s.nodeName)==="INPUT"||((i=t.target)==null?void 0:i.nodeName)==="SELECT"||((c=t.target)==null?void 0:c.nodeName)==="BUTTON")return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const r=this.focusedDate?b(this.focusedDate):T(this.year,this.month,1);let a=q(r,e);if(a){let l=this.querySelector(`div[data-date="${y(a)}"]`);if(l instanceof HTMLDivElement){if(l.dataset.disabled){a=q(a,e);let u=this.querySelector(`div[data-date="${y(a)}"]`);for(;u&&u instanceof HTMLDivElement&&u.dataset.disabled;)a=q(a,e),u=this.querySelector(`div[data-date="${y(a)}"]`);l=u}l instanceof HTMLDivElement&&!l.dataset.disabled&&(this.focusedDate=y(a),l.focus())}}}render(){return o.x`
2
+ <div
3
+ class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":o.E}"
4
+ @focusout=${this.closeEvent}
5
+ @keydown=${t=>{t.key==="Escape"&&(t.preventDefault(),this.close())}}
6
+ >
7
+ <nav class="pkt-cal-month-nav">
8
+ <div>
9
+ <button
10
+ type="button"
11
+ @click=${this.isPrevMonthAllowed()&&this.prevMonth}
12
+ @keydown=${t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.isNextMonthAllowed()&&this.prevMonth())}}
13
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${this.isPrevMonthAllowed()?"":"pkt-hide"}"
14
+ .data-disabled=${this.isPrevMonthAllowed()?o.E:"disabled"}
15
+ ?aria-disabled=${!this.isPrevMonthAllowed()}
16
+ tabindex=${this.isPrevMonthAllowed()?"0":"-1"}
17
+ >
18
+ <pkt-icon class="pkt-btn__icon" name="chevron-thin-left"></pkt-icon>
19
+ <span class="pkt-btn__text">${this.prevMonthString}</span>
20
+ </button>
21
+ </div>
22
+ ${this.renderMonthNav()}
23
+ <div>
24
+ <button
25
+ type="button"
26
+ @click=${this.isNextMonthAllowed()&&this.nextMonth}
27
+ @keydown=${t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.isNextMonthAllowed()&&this.nextMonth())}}
28
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${this.isNextMonthAllowed()?"":"pkt-hide"}"
29
+ .data-disabled=${this.isNextMonthAllowed()?o.E:"disabled"}
30
+ ?aria-disabled=${!this.isNextMonthAllowed()}
31
+ tabindex=${this.isNextMonthAllowed()?"0":"-1"}
32
+ >
33
+ <pkt-icon class="pkt-btn__icon" name="chevron-thin-right"></pkt-icon>
34
+ <span class="pkt-btn__text">${this.nextMonthString}</span>
35
+ </button>
36
+ </div>
37
+ </nav>
38
+ <table
39
+ class="pkt-cal-days pkt-txt-12-medium"
40
+ role="grid"
41
+ ?aria-multiselectable=${this.range||this.multiple}
42
+ >
43
+ <thead>
44
+ ${this.renderDayNames()}
45
+ </thead>
46
+ <tbody>
47
+ ${this.renderCalendarBody()}
48
+ </tbody>
49
+ </table>
50
+ </div>
51
+ `}renderDayNames(){const t=[];this.weeknumbers&&t.push(o.x`<th><div>${this.weekString}</div></th>`);for(let e=0;e<this.dayStrings.length;e++)t.push(o.x`<th><div aria-label="${this.dayStringsLong[e]}">${this.dayStrings[e]}</div></th>`);return o.x`<tr class="pkt-cal-week-row">
52
+ ${t}
53
+ </tr>`}renderMonthNav(){let t=[];return this.withcontrols?t.push(o.x`<div class="pkt-cal-month-picker">
54
+ <label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
55
+ <select
56
+ aria-label="${this.strings.dates.month}"
57
+ class="pkt-input pkt-input-compact"
58
+ id="${this.id}-monthnav"
59
+ @change=${e=>{this.changeMonth(this.year,e.target.value)}}
60
+ >
61
+ ${this.monthStrings.map((e,r)=>o.x`<option value=${r} ?selected=${this.month===r}>${e}</option>`)}
62
+ </select>
63
+ <label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
64
+ <input
65
+ aria-label="${this.strings.dates.year}"
66
+ class="pkt-input pkt-cal-input-year pkt-input-compact"
67
+ id="${this.id}-yearnav"
68
+ type="number"
69
+ size="4"
70
+ placeholder="0000"
71
+ @change=${e=>{this.changeMonth(e.target.value,this.month)}}
72
+ .value=${this.year}
73
+ />
74
+ </div> `):t.push(o.x`<div class="pkt-txt-16-medium" aria-live="polite">
75
+ ${this.monthStrings[this.month]} ${this.year}
76
+ </div>`),t}renderDayView(t,e,r){var w;const a=T(this.year,this.month,t),s=y(a),i=s===y(e),c=this.selected.includes(s),l=Se(a),u=this.isExcluded(r,a)||!c&&this.multiple&&this.maxMultiple>0&&this.selected.length>=this.maxMultiple,f=this.focusedDate?this.focusedDate===s&&!u?"0":"-1":!u&&this.tabIndexSet===0||this.tabIndexSet===t?"0":"-1";f==="0"&&(this.tabIndexSet=t),this.selectableDates.push({currentDateISO:s,isDisabled:u,tabindex:f});const p={"pkt-cal-today":i,"pkt-cal-selected":c,"pkt-cal-in-range":this.inRange[s],"pkt-cal-excluded":this.isExcluded(r,a),"pkt-cal-in-range-first":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&s===this.selected[0],"pkt-cal-in-range-last":this.range&&this.selected.length===2&&s===this.selected[1],"pkt-cal-range-hover":this.rangeHovered!==null&&s===y(this.rangeHovered)};return o.x`<td class=${ct.e(p)}>
77
+ <div
78
+ ?aria-selected=${c}
79
+ role="gridcell"
80
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
81
+ @mouseover=${()=>this.range&&!this.isExcluded(r,a)&&this.handleRangeHover(a)}
82
+ @focus=${()=>{this.range&&!this.isExcluded(r,a)&&this.handleRangeHover(a),this.focusedDate=s}}
83
+ aria-label="${l}"
84
+ tabindex=${(w=this.selectableDates.find(m=>m.currentDateISO===s))==null?void 0:w.tabindex}
85
+ data-disabled=${u?"disabled":o.E}
86
+ data-date=${s}
87
+ @keydown=${m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),this.handleDateSelect(a))}}
88
+ @click=${m=>{u||(m.preventDefault(),this.handleDateSelect(a))}}
89
+ >
90
+ <span class="pkt-btn__text pkt-txt-14-light">${t}</span>
91
+ </div>
92
+ </td>`}renderCalendarBody(){const t=b(),e=T(this.year,this.month,1),r=T(this.year,this.month+1,0),a=(e.getDay()+6)%7,s=r.getDate(),i=Math.ceil((s+a)/7),l=T(this.year,this.month,0).getDate();let u=1;this.week=at(T(this.year,this.month,1));const f=[];for(let p=0;p<i;p++){const w=[];this.weeknumbers&&w.push(o.x`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let m=1;m<8;m++)if(p===0&&m<a+1){const g=l-(a-m);w.push(o.x`<td class="pkt-cal-other">
93
+ <div
94
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
95
+ data-disabled="disabled"
96
+ >
97
+ <span class="pkt-btn__text pkt-txt-14-light">${g}</span>
98
+ </div>
99
+ </td>`)}else u>s?(w.push(o.x`<td class="pkt-cal-other">
100
+ <div
101
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
102
+ data-disabled="disabled"
103
+ >
104
+ <span class="pkt-btn__text pkt-txt-14-light">${u-s}</span>
105
+ </div>
106
+ </td>`),u++):(w.push(this.renderDayView(u,t,m)),u++);f.push(o.x`<tr class="pkt-cal-week-row" role="row">
107
+ ${w}
108
+ </tr>`)}return f}isExcluded(t,e){return this.excludeweekdays.includes(t.toString())||this.earliest&&e<b(this.earliest)||this.latest&&e>b(this.latest)?!0:this.excludedates.some(r=>typeof r=="string"?r===y(e):r.toDateString()===e.toDateString())}isPrevMonthAllowed(){const t=T(this.year,this.month,0);return!(this.earliest&&b(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){const t=T(this.year,this.month===11?0:this.month+1,1);return!(this.latest&&b(this.latest)<t)}nextMonth(){const t=this.month===11?0:this.month+1,e=this.month===11?this.year+1:this.year;this.changeMonth(e,t)}changeMonth(t,e){this.year=t,this.month=e,this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[],this.requestUpdate()}isInRange(t){if(this.range&&this.selected.length===2){if(t>b(this.selected[0])&&t<b(this.selected[1]))return!0}else if(this.range&&this.selected.length===1&&this.rangeHovered&&t>b(this.selected[0])&&t<this.rangeHovered)return!0;return!1}isRangeAllowed(t){let e=!0;if(this._selected.length===1){const r=L({start:this._selected[0],end:t});if(Array.isArray(r)&&r.length)for(let a=0;a<r.length;a++)this.excludedates.forEach(s=>{s>this._selected[0]&&s<t&&(e=!1)}),this.excludeweekdays.includes(pe(r[a]).toString())&&(e=!1)}return e}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(t){this.selected.includes(y(t))||(this.selected=[...this.selected,y(t)],this._selected=[...this._selected,t],this.range&&this.selected.length===2&&this.close())}removeFromSelected(t){if(this.selected.length===1)this.emptySelected();else{const e=this.selected.indexOf(y(t)),r=[...this.selected],a=[...this._selected];r.splice(e,1),a.splice(e,1),this.selected=r,this._selected=a}}toggleSelected(t){const e=y(t);this.selected.includes(e)?this.removeFromSelected(t):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(t)}handleRangeSelect(t){const e=y(t);return this.selected.includes(e)?this.selected.indexOf(e)===0?this.emptySelected():this.removeFromSelected(t):this.selected.length>1?(this.emptySelected(),this.addToSelected(t)):(this.selected.length===1&&!this.isRangeAllowed(t)&&this.emptySelected(),this.selected.length===1&&this._selected[0]>t&&this.emptySelected(),this.addToSelected(t)),Promise.resolve()}handleRangeHover(t){if(this.range&&this._selected.length===1&&this.isRangeAllowed(t)&&this._selected[0]<t){this.rangeHovered=t,this.inRange={};const e=L({start:this._selected[0],end:t});if(Array.isArray(e)&&e.length)for(let r=0;r<e.length;r++)this.inRange[y(e[r])]=this.isInRange(e[r])}else this.rangeHovered=null}handleDateSelect(t){if(t)return this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(y(t))?this.emptySelected():(this.emptySelected(),this.addToSelected(t)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0})),Promise.resolve()}focusOnCurrentDate(){const t=y(b()),e=this.querySelector(`div[data-date="${t}"]`);if(e instanceof HTMLDivElement)this.focusedDate=t,e.focus();else{const r=this.selectableDates.find(a=>!a.isDisabled);if(r){const a=this.querySelector(`div[data-date="${r.currentDateISO}"]`);a instanceof HTMLDivElement&&(this.focusedDate=r.currentDateISO,a.focus())}}}closeEvent(t){this.contains(t.relatedTarget)||this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};d([o.n({type:Boolean})],exports.PktCalendar.prototype,"multiple",2);d([o.n({type:Number})],exports.PktCalendar.prototype,"maxMultiple",2);d([o.n({type:Boolean})],exports.PktCalendar.prototype,"range",2);d([o.n({type:Boolean})],exports.PktCalendar.prototype,"weeknumbers",2);d([o.n({type:Boolean})],exports.PktCalendar.prototype,"withcontrols",2);d([o.n({converter:H.converters.csvToArray})],exports.PktCalendar.prototype,"selected",2);d([o.n({type:String})],exports.PktCalendar.prototype,"earliest",2);d([o.n({type:String})],exports.PktCalendar.prototype,"latest",2);d([o.n({converter:H.converters.stringsToDate})],exports.PktCalendar.prototype,"excludedates",2);d([o.n({converter:H.converters.csvToArray})],exports.PktCalendar.prototype,"excludeweekdays",2);d([o.n({converter:H.converters.stringToDate})],exports.PktCalendar.prototype,"currentmonth",2);d([o.n({type:Array})],exports.PktCalendar.prototype,"dayStrings",2);d([o.n({type:Array})],exports.PktCalendar.prototype,"dayStringsLong",2);d([o.n({type:Array})],exports.PktCalendar.prototype,"monthStrings",2);d([o.n({type:String})],exports.PktCalendar.prototype,"weekString",2);d([o.n({type:String})],exports.PktCalendar.prototype,"prevMonthString",2);d([o.n({type:String})],exports.PktCalendar.prototype,"nextMonthString",2);d([o.n({type:Array})],exports.PktCalendar.prototype,"_selected",2);d([o.n({type:Number})],exports.PktCalendar.prototype,"year",2);d([o.n({type:Number})],exports.PktCalendar.prototype,"month",2);d([o.n({type:Number})],exports.PktCalendar.prototype,"week",2);d([o.n({type:Date})],exports.PktCalendar.prototype,"rangeHovered",2);d([o.r()],exports.PktCalendar.prototype,"inRange",2);d([o.r()],exports.PktCalendar.prototype,"focusedDate",2);d([o.r()],exports.PktCalendar.prototype,"selectableDates",2);d([o.r()],exports.PktCalendar.prototype,"currentmonthtouched",2);d([o.r()],exports.PktCalendar.prototype,"tabIndexSet",2);exports.PktCalendar=d([ot.t("pkt-calendar")],exports.PktCalendar);exports.formatISODate=y;exports.fromISOToDate=ve;exports.fromISOtoLocal=De;exports.newDate=b;
@@ -0,0 +1,27 @@
1
+ "use strict";/**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const P=globalThis,F=P.trustedTypes,Y=F?F.createPolicy("lit-html",{createHTML:r=>r}):void 0,J="$lit$",v=`lit$${Math.random().toFixed(9).slice(2)}$`,Z="?"+v,St=`<${Z}>`,S=document,O=()=>S.createComment(""),H=r=>r===null||typeof r!="object"&&typeof r!="function",K=Array.isArray,pt=r=>K(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",B=`[
6
+ \f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,et=/>/g,b=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),st=/'/g,it=/"/g,ct=/^(?:script|style|textarea|title)$/i,wt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),kt=wt(1),w=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),rt=new WeakMap,E=S.createTreeWalker(S,129);function ut(r,t){if(!K(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Y!==void 0?Y.createHTML(t):t}const mt=(r,t)=>{const e=r.length-1,s=[];let i,o=t===2?"<svg>":t===3?"<math>":"",n=C;for(let l=0;l<e;l++){const a=r[l];let m,g,h=-1,$=0;for(;$<a.length&&(n.lastIndex=$,g=n.exec(a),g!==null);)$=n.lastIndex,n===C?g[1]==="!--"?n=tt:g[1]!==void 0?n=et:g[2]!==void 0?(ct.test(g[2])&&(i=RegExp("</"+g[2],"g")),n=b):g[3]!==void 0&&(n=b):n===b?g[0]===">"?(n=i??C,h=-1):g[1]===void 0?h=-2:(h=n.lastIndex-g[2].length,m=g[1],n=g[3]===void 0?b:g[3]==='"'?it:st):n===it||n===st?n=b:n===tt||n===et?n=C:(n=b,i=void 0);const _=n===b&&r[l+1].startsWith("/>")?" ":"";o+=n===C?a+St:h>=0?(s.push(m),a.slice(0,h)+J+a.slice(h)+v+_):a+v+(h===-2?l:_)}return[ut(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class R{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0;const l=t.length-1,a=this.parts,[m,g]=mt(t,e);if(this.el=R.createElement(m,s),E.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=E.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const h of i.getAttributeNames())if(h.endsWith(J)){const $=g[n++],_=i.getAttribute(h).split(v),N=/([.?@])?(.*)/.exec($);a.push({type:1,index:o,name:N[2],strings:_,ctor:N[1]==="."?gt:N[1]==="?"?yt:N[1]==="@"?$t:V}),i.removeAttribute(h)}else h.startsWith(v)&&(a.push({type:6,index:o}),i.removeAttribute(h));if(ct.test(i.tagName)){const h=i.textContent.split(v),$=h.length-1;if($>0){i.textContent=F?F.emptyScript:"";for(let _=0;_<$;_++)i.append(h[_],O()),E.nextNode(),a.push({type:2,index:++o});i.append(h[$],O())}}}else if(i.nodeType===8)if(i.data===Z)a.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(v,h+1))!==-1;)a.push({type:7,index:o}),h+=v.length-1}o++}}static createElement(t,e){const s=S.createElement("template");return s.innerHTML=t,s}}function k(r,t,e=r,s){var n,l;if(t===w)return t;let i=s!==void 0?(n=e._$Co)==null?void 0:n[s]:e._$Cl;const o=H(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=k(r,i._$AS(r,t.values),i,s)),t}class ft{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)??S).importNode(e,!0);E.currentNode=i;let o=E.nextNode(),n=0,l=0,a=s[0];for(;a!==void 0;){if(n===a.index){let m;a.type===2?m=new U(o,o.nextSibling,this,t):a.type===1?m=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(m=new vt(o,this,t)),this._$AV.push(m),a=s[++l]}n!==(a==null?void 0:a.index)&&(o=E.nextNode(),n++)}return E.currentNode=S,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 U{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=u,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=k(this,t,e),H(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==w&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):pt(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!==u&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=R.createElement(ut(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const n=new ft(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=rt.get(t.strings);return e===void 0&&rt.set(t.strings,e=new R(t)),e}k(t){K(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new U(this.O(O()),this.O(O()),this,this.options)):s=e[i],s._$AI(o),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&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class V{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=u}_$AI(t,e=this,s,i){const o=this.strings;let n=!1;if(o===void 0)t=k(this,t,e,0),n=!H(t)||t!==this._$AH&&t!==w,n&&(this._$AH=t);else{const l=t;let a,m;for(t=o[0],a=0;a<o.length-1;a++)m=k(this,l[s+a],e,a),m===w&&(m=this._$AH[a]),n||(n=!H(m)||m!==this._$AH[a]),m===u?t=u:t!==u&&(t+=(m??"")+o[a+1]),this._$AH[a]=m}n&&!i&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class gt extends V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class yt extends V{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class $t extends V{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=k(this,t,e,0)??u)===w)return;const s=this._$AH,i=t===u&&s!==u||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==u&&(s===u||i);i&&this.element.removeEventListener(this.name,this,s),o&&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){k(this,t)}}const xt={M:J,P:v,A:Z,C:1,L:mt,R:ft,D:pt,V:k,I:U,H:V,N:yt,U:$t,B:gt,F:vt},j=P.litHtmlPolyfillSupport;j==null||j(R,U),(P.litHtmlVersions??(P.litHtmlVersions=[])).push("3.2.1");const Ut=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new U(t.insertBefore(O(),o),o,void 0,e??{})}return i._$AI(r),i};/**
8
+ * @license
9
+ * Copyright 2019 Google LLC
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */const D=globalThis,G=D.ShadowRoot&&(D.ShadyCSS===void 0||D.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_t=Symbol(),nt=new WeakMap;let Ct=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==_t)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(G&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=nt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&nt.set(e,t))}return t}toString(){return this.cssText}};const Pt=r=>new Ct(typeof r=="string"?r:r+"",void 0,_t),Tt=(r,t)=>{if(G)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=D.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},ot=G?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Pt(e)})(r):r;/**
12
+ * @license
13
+ * Copyright 2017 Google LLC
14
+ * SPDX-License-Identifier: BSD-3-Clause
15
+ */const{is:Mt,defineProperty:Ot,getOwnPropertyDescriptor:Ht,getOwnPropertyNames:Rt,getOwnPropertySymbols:Vt,getPrototypeOf:Nt}=Object,A=globalThis,at=A.trustedTypes,It=at?at.emptyScript:"",q=A.reactiveElementPolyfillSupport,T=(r,t)=>r,L={toAttribute(r,t){switch(t){case Boolean:r=r?It: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)=>!Mt(r,t),lt={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:Q};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),A.litPropertyMetadata??(A.litPropertyMetadata=new WeakMap);class x 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=lt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Ot(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=Ht(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i==null?void 0:i.call(this)},set(n){const l=i==null?void 0:i.call(this);o.call(this,n),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??lt}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=Nt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,s=[...Rt(e),...Vt(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(ot(i))}else t!==void 0&&e.push(ot(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 Tt(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)}_$EC(t,e){var o;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const n=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:L).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),l=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:L;this._$Em=i,this[i]=l.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??Q)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){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[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,n]of i)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),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)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[T("elementProperties")]=new Map,x[T("finalized")]=new Map,q==null||q({ReactiveElement:x}),(A.reactiveElementVersions??(A.reactiveElementVersions=[])).push("2.0.4");/**
16
+ * @license
17
+ * Copyright 2017 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */const Dt={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:Q},Ft=(r=Dt,t,e)=>{const{kind:s,metadata:i}=e;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){const{name:n}=e;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(n,a,r)},init(l){return l!==void 0&&this.P(n,void 0,r),l}}}if(s==="setter"){const{name:n}=e;return function(l){const a=this[n];t.call(this,l),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function d(r){return(t,e)=>typeof e=="object"?Ft(r,t,e):((s,i,o)=>{const n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}/**
20
+ * @license
21
+ * Copyright 2017 Google LLC
22
+ * SPDX-License-Identifier: BSD-3-Clause
23
+ */function At(r){return d({...r,state:!0,attribute:!1})}/**
24
+ * @license
25
+ * Copyright 2017 Google LLC
26
+ * SPDX-License-Identifier: BSD-3-Clause
27
+ */class M extends x{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=Ut(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 w}}var dt;M._$litElement$=!0,M.finalized=!0,(dt=globalThis.litElementHydrateSupport)==null||dt.call(globalThis,{LitElement:M});const z=globalThis.litElementPolyfillSupport;z==null||z({LitElement:M});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");var f=[];for(var W=0;W<256;++W)f.push((W+256).toString(16).slice(1));function Lt(r,t=0){return(f[r[t+0]]+f[r[t+1]]+f[r[t+2]]+f[r[t+3]]+"-"+f[r[t+4]]+f[r[t+5]]+"-"+f[r[t+6]]+f[r[t+7]]+"-"+f[r[t+8]]+f[r[t+9]]+"-"+f[r[t+10]]+f[r[t+11]]+f[r[t+12]]+f[r[t+13]]+f[r[t+14]]+f[r[t+15]]).toLowerCase()}var I,Bt=new Uint8Array(16);function jt(){if(!I&&(I=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!I))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return I(Bt)}var qt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const ht={randomUUID:qt};function bt(r,t,e){if(ht.randomUUID&&!t&&!r)return ht.randomUUID();r=r||{};var s=r.random||(r.rng||jt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Lt(s)}const zt={hi:"Hei!"},Wt={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Jt={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"},Zt={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",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},y={example:zt,calendar:Wt,dates:Jt,forms:Zt},Kt="pkt-inputwrapper",Gt={toggleHelpText:{description:"Event for å vise eller skjule hjelpetekst i dropdown"}},Qt={forId:{name:"For ID",description:"Id-en til inputfeltet som dette wrapper rundt",type:"string",required:!0},label:{name:"Merkelapp",description:"Merkelapp for inputfeltet",type:"boolean",required:!0,default:"input"},helptext:{name:"Hjelpetekst",description:"Hjelpetekst for inputfeltet",type:"string"},helptextDropdown:{name:"Hjelpetekst i dropdown",description:"Hjelpetekst som vises i ekspanderende felt",type:"string"},helptextDropdownButton:{name:"Tekst i hjelpetekst-knapp",description:"Tekst som vises i knappen for å vise hjelpetekst i dropdown",default:"Les mer <span class='pkt-sr-only'>om feltet</span>",type:"string"},counter:{name:"Teller",description:"Teller for antall tegn i inputfeltet",type:"boolean",default:!1},counterCurrent:{name:"Tellerverdi",description:"Tellerens nåværende verdi",type:"number"},counterMaxLength:{name:"Maks tegn",description:"Maks antall tegn som kan skrives i inputfeltet",type:"number"},optionalTag:{name:"Vise valgfritt-merking",description:"Viser en merking som indikerer at feltet er valgfritt",type:"boolean",default:!1},optionalText:{name:"Valgfritt-tekst",description:"Tekst som vises i valgfritt-merkingen",type:"string",default:"Valgfritt"},requiredTag:{name:"Vise påkrevd-merking",description:"Viser en merking som indikerer at feltet er påkrevd",type:"boolean",default:!1},requiredText:{name:"Påkrevd-tekst",description:"Tekst som vises i påkrevd-merkingen",type:"string",default:"Må fylles ut"},hasError:{name:"Feil",description:"Indikerer at inputfeltet har en feil",type:"boolean",default:!1},errorMessage:{name:"Feilmelding",description:"Feilmelding som vises i tilknytning til inputfeltet",type:"string"},disabled:{name:"Deaktivert",description:"Indikerer at inputfeltet er deaktivert",type:"boolean",default:!1},inline:{name:"Inline",description:"Indikerer at inputfeltet skal flyte sammen med sidens innhold",type:"boolean",default:!1},ariaDescribedby:{name:"aria-describedby",description:"Id-en til elementet som beskriver inputfeltet",type:"string"},hasFieldset:{name:"Har fieldset",description:"Indikerer at inputfeltet er en del av et fieldset",type:"boolean",default:!1},useWrapper:{name:"Bruk wrapper",description:"Indikerer om inputfeltet skal bruke en wrapper",type:"boolean",default:!0}},Et={name:Kt,"css-class":"pkt-inputwrapper",events:Gt,props:Qt};var Xt=Object.defineProperty,p=(r,t,e,s)=>{for(var i=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=n(t,e,i)||i);return i&&Xt(t,e,i),i};class X extends M{constructor(){super(),this.strings=y}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}}p([d({type:Object})],X.prototype,"strings");class c extends X{constructor(){super(),this.id=bt(),this.name=this.id,this.required=!1,this.disabled=!1,this.placeholder="",this.min=null,this.max=null,this.minlength=0,this.maxlength=0,this.pattern="",this.label=null,this.optionalTag=!1,this.optionalText=y.forms.labels.optional,this.requiredTag=!1,this.requiredText=y.forms.labels.required,this.hasError=!1,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Et.props.helptextDropdownButton.default,this.fullwidth=!1,this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},y.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},y.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},y.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},y.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},y.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},y.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},y.forms.messages.rangeOverflow,t):t.validity.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(s=>{e.append(this.name,s)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChanged(t,e){typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate())}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}firstUpdated(t){super.firstUpdated(t),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.inputRef.value&&this.manageValidity(this.inputRef.value)}}p([d({type:String})],c.prototype,"id");p([d({type:String})],c.prototype,"name");p([d({type:Boolean})],c.prototype,"required");p([d({type:Boolean})],c.prototype,"disabled");p([d({type:String})],c.prototype,"placeholder");p([d({type:Number})],c.prototype,"min");p([d({type:Number})],c.prototype,"max");p([d({type:Number})],c.prototype,"minlength");p([d({type:Number})],c.prototype,"maxlength");p([d({type:String})],c.prototype,"pattern");p([d({type:String})],c.prototype,"label");p([d({type:Boolean})],c.prototype,"optionalTag");p([d({type:String})],c.prototype,"optionalText");p([d({type:Boolean})],c.prototype,"requiredTag");p([d({type:String})],c.prototype,"requiredText");p([d({type:Boolean})],c.prototype,"hasError");p([d({type:String})],c.prototype,"errorMessage");p([d({type:String})],c.prototype,"helptext");p([d({type:String})],c.prototype,"helptextDropdown");p([d({type:String})],c.prototype,"helptextDropdownButton");p([d({type:Boolean})],c.prototype,"fullwidth");p([At()],c.prototype,"touched");exports.E=u;exports.PktElement=X;exports.PktInputElement=c;exports.T=w;exports.Z=xt;exports.n=d;exports.r=At;exports.specs=Et;exports.translations=y;exports.v4=bt;exports.x=kt;
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("./index-De04fSKv.cjs"),r=require("./directive-DtixNHDT.cjs");/**
1
+ "use strict";const o=require("./index-CBFF6OHE.cjs"),r=require("./custom-element-B-TlBwRu.cjs");/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause