@oslokommune/punkt-react 15.2.1 → 15.3.1

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [15.3.0](https://github.com/oslokommune/punkt/compare/15.2.1...15.3.0) (2026-02-19)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ * Remove classname from alert in FileUpload (#3273).
15
+
16
+
17
+ ### Bug Fixes
18
+ Ingen
19
+
20
+ ### Chores
21
+ Ingen
22
+
23
+ ---
24
+
25
+
8
26
  ## [15.2.1](https://github.com/oslokommune/punkt/compare/15.2.0...15.2.1) (2026-02-18)
9
27
 
10
28
  ### ⚠ BREAKING CHANGES
@@ -1024,7 +1024,7 @@ var Dl = Object.defineProperty, Ol = Object.getOwnPropertyDescriptor, Ln = (i, e
1024
1024
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
1025
1025
  return n && s && Dl(e, t, s), s;
1026
1026
  };
1027
- const Bs = "https://punkt-cdn.oslo.kommune.no/15.2/icons/";
1027
+ const Bs = "https://punkt-cdn.oslo.kommune.no/15.3/icons/";
1028
1028
  typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || Bs);
1029
1029
  const Nn = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', cn = {}, El = 2, Pl = 1500, Dr = typeof Storage < "u" && typeof sessionStorage < "u", Al = (i) => window.pktFetch(i).then((e) => {
1030
1030
  if (!e.ok)
@@ -1097,7 +1097,7 @@ var Il = Object.defineProperty, Ll = Object.getOwnPropertyDescriptor, st = (i, e
1097
1097
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
1098
1098
  return n && s && Il(e, t, s), s;
1099
1099
  };
1100
- window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/15.2/animations/";
1100
+ window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/15.3/animations/";
1101
1101
  let Ze = class extends Ce {
1102
1102
  constructor() {
1103
1103
  super(), this.defaultSlot = B(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.fullWidth = !1, this.fullWidthOnMobile = !1, this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.form = void 0, this.isLoading = !1, this.disabled = !1, this.loadingAnimationPath = window.pktAnimationPath, this.slotController = new He(this, this.defaultSlot);
@@ -7880,7 +7880,7 @@ var Vd = Object.defineProperty, Ud = Object.getOwnPropertyDescriptor, ve = (i, e
7880
7880
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
7881
7881
  return n && s && Vd(e, t, s), s;
7882
7882
  };
7883
- const Wd = "https://punkt-cdn.oslo.kommune.no/15.2/logos/";
7883
+ const Wd = "https://punkt-cdn.oslo.kommune.no/15.3/logos/";
7884
7884
  let pe = class extends Ce {
7885
7885
  constructor() {
7886
7886
  super(), this.searchPlaceholder = "Søk", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.isMobile = !1, this.isTablet = !1, this.openMenu = "none", this.isHidden = !1, this.componentWidth = typeof window < "u" ? window.innerWidth : 0, this.hasSlotContent = !1, this.alignSlotRight = !1, this.alignSearchRight = !1, this.defaultSlot = B(), this.headerRef = B(), this.userContainerRef = B(), this.slotContainerRef = B(), this.searchContainerRef = B(), this.slotContentRef = B(), this.searchMenuRef = B(), this.lastScrollPosition = 0, this.savedScrollY = 0, this.lastFocusedElement = null, this.shouldRestoreFocus = !1, this.handleScroll = () => {
@@ -8590,7 +8590,7 @@ var Gd = Object.defineProperty, Qd = Object.getOwnPropertyDescriptor, ii = (i, e
8590
8590
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
8591
8591
  return n && s && Gd(e, t, s), s;
8592
8592
  };
8593
- window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/15.2/animations/";
8593
+ window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/15.3/animations/";
8594
8594
  let Lt = class extends Ce {
8595
8595
  constructor() {
8596
8596
  super(), this.defaultSlot = B(), this.delay = 0, this.inline = !1, this.isLoading = !0, this.message = null, this.size = "medium", this.variant = "shapes", this.loadingAnimationPath = window.pktAnimationPath, this._shouldDisplayLoader = !1, this.slotController = new He(this, this.defaultSlot);
@@ -9974,7 +9974,7 @@ const Nh = fe(
9974
9974
  }
9975
9975
  );
9976
9976
  Nh.displayName = "PktBreadcrumbs";
9977
- window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/15.2/animations/";
9977
+ window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/15.3/animations/";
9978
9978
  const dt = fe(
9979
9979
  ({
9980
9980
  children: i,
@@ -14266,7 +14266,7 @@ const Ws = (i) => typeof i == "number" ? "in-progress" : i === "error" ? "error"
14266
14266
  srAnnouncementIds: Ne
14267
14267
  }
14268
14268
  ),
14269
- ae && de && /* @__PURE__ */ c(ir, { skin: "error", "aria-live": "assertive", role: "alert", compact: !0, className: "pkt-fileupload__error-alert", children: de }),
14269
+ ae && de && /* @__PURE__ */ c(ir, { skin: "error", "aria-live": "assertive", role: "alert", compact: !0, children: de }),
14270
14270
  /* @__PURE__ */ c(
14271
14271
  km,
14272
14272
  {
@@ -14916,7 +14916,7 @@ const bo = fe(
14916
14916
  {
14917
14917
  name: "oslologo",
14918
14918
  "aria-hidden": "true",
14919
- path: "https://punkt-cdn.oslo.kommune.no/15.2/logos/"
14919
+ path: "https://punkt-cdn.oslo.kommune.no/15.3/logos/"
14920
14920
  }
14921
14921
  ) }) : N ? /* @__PURE__ */ c(
14922
14922
  "button",
@@ -14929,7 +14929,7 @@ const bo = fe(
14929
14929
  {
14930
14930
  name: "oslologo",
14931
14931
  "aria-hidden": "true",
14932
- path: "https://punkt-cdn.oslo.kommune.no/15.2/logos/"
14932
+ path: "https://punkt-cdn.oslo.kommune.no/15.3/logos/"
14933
14933
  }
14934
14934
  )
14935
14935
  }
@@ -14938,7 +14938,7 @@ const bo = fe(
14938
14938
  {
14939
14939
  name: "oslologo",
14940
14940
  "aria-hidden": "true",
14941
- path: "https://punkt-cdn.oslo.kommune.no/15.2/logos/"
14941
+ path: "https://punkt-cdn.oslo.kommune.no/15.3/logos/"
14942
14942
  }
14943
14943
  ) }),
14944
14944
  M && /* @__PURE__ */ c("span", { className: "pkt-header-service__service-name", children: _ ? /* @__PURE__ */ c(cr, { href: _, className: "pkt-header-service__service-link ", children: M }) : C ? /* @__PURE__ */ c("button", { className: "pkt-link-button pkt-link pkt-header-service__service-link", onClick: C, children: M }) : /* @__PURE__ */ c("span", { className: "pkt-header-service__service-link", children: M }) })
@@ -95,11 +95,11 @@
95
95
  * @license
96
96
  * Copyright 2017 Google LLC
97
97
  * SPDX-License-Identifier: BSD-3-Clause
98
- */let Tn=class extends Yi{};Tn.directiveName="unsafeSVG",Tn.resultType=2;const Nn=fs(Tn);var Ml=Object.defineProperty,Dl=Object.getOwnPropertyDescriptor,ci=(s,e,t,i)=>{for(var n=i>1?void 0:i?Dl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ml(e,t,n),n};const Mn="https://punkt-cdn.oslo.kommune.no/15.2/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Mn);const di='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',ui={},Ol=2,El=1500,Vr=typeof Storage<"u"&&typeof sessionStorage<"u",Pl=s=>window.pktFetch(s).then(e=>{if(!e.ok)throw new Error("Missing icon: "+s);return e.text()}),Ur=async(s,e=Ol)=>{try{return await Pl(s)}catch{return e>0?(await new Promise(t=>setTimeout(t,El)),Ur(s,e-1)):(console.error("Failed to fetch icon: "+s),di)}},Al=async(s,e)=>{const t=e+s+".svg";return Vr&&sessionStorage.getItem(t)?sessionStorage.getItem(t):t in ui?ui[t]:typeof window<"u"&&typeof window.pktFetch=="function"?(ui[t]=Ur(t).then(i=>(i!==di&&Vr&&sessionStorage.setItem(t,i),delete ui[t],i)),ui[t]):di};let gs=class extends _e{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:Mn,this.name="",this.icon=Nn(di),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),(e==="name"||e==="path")&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has("name")||e.has("path"))&&this.getIcon(this.name)}async getIcon(e=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:Mn);try{this.icon=Nn(await Al(this.name||"",this.path))}catch{this.icon=Nn(di)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return b`${this.name&&this.icon}`}};ci([c({type:String,reflect:!1})],gs.prototype,"path",2),ci([c({type:String,reflect:!0})],gs.prototype,"name",2),ci([c({type:SVGElement})],gs.prototype,"icon",2),ci([c({type:Array,noAccessor:!0})],gs.prototype,"_updatedProps",2),gs=ci([se("pkt-icon")],gs);/**
98
+ */let Tn=class extends Yi{};Tn.directiveName="unsafeSVG",Tn.resultType=2;const Nn=fs(Tn);var Ml=Object.defineProperty,Dl=Object.getOwnPropertyDescriptor,ci=(s,e,t,i)=>{for(var n=i>1?void 0:i?Dl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ml(e,t,n),n};const Mn="https://punkt-cdn.oslo.kommune.no/15.3/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Mn);const di='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',ui={},Ol=2,El=1500,Vr=typeof Storage<"u"&&typeof sessionStorage<"u",Pl=s=>window.pktFetch(s).then(e=>{if(!e.ok)throw new Error("Missing icon: "+s);return e.text()}),Ur=async(s,e=Ol)=>{try{return await Pl(s)}catch{return e>0?(await new Promise(t=>setTimeout(t,El)),Ur(s,e-1)):(console.error("Failed to fetch icon: "+s),di)}},Al=async(s,e)=>{const t=e+s+".svg";return Vr&&sessionStorage.getItem(t)?sessionStorage.getItem(t):t in ui?ui[t]:typeof window<"u"&&typeof window.pktFetch=="function"?(ui[t]=Ur(t).then(i=>(i!==di&&Vr&&sessionStorage.setItem(t,i),delete ui[t],i)),ui[t]):di};let gs=class extends _e{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:Mn,this.name="",this.icon=Nn(di),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),(e==="name"||e==="path")&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has("name")||e.has("path"))&&this.getIcon(this.name)}async getIcon(e=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:Mn);try{this.icon=Nn(await Al(this.name||"",this.path))}catch{this.icon=Nn(di)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return b`${this.name&&this.icon}`}};ci([c({type:String,reflect:!1})],gs.prototype,"path",2),ci([c({type:String,reflect:!0})],gs.prototype,"name",2),ci([c({type:SVGElement})],gs.prototype,"icon",2),ci([c({type:Array,noAccessor:!0})],gs.prototype,"_updatedProps",2),gs=ci([se("pkt-icon")],gs);/**
99
99
  * @license
100
100
  * Copyright 2018 Google LLC
101
101
  * SPDX-License-Identifier: BSD-3-Clause
102
- */const A=s=>s??w;var Il=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,Ze=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ll(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Il(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.2/animations/";let je=class extends _e{constructor(){super(),this.defaultSlot=F(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new Ae(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("keydown",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="disabled"&&i==="false"&&(this.disabled=!1),(e==="isloading"||e==="isLoading")&&i==="false"&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const e=this.form??this.getAttribute("form")??void 0,t={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return b`
102
+ */const A=s=>s??w;var Il=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,Ze=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ll(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Il(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.3/animations/";let je=class extends _e{constructor(){super(),this.defaultSlot=F(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new Ae(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("keydown",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="disabled"&&i==="false"&&(this.disabled=!1),(e==="isloading"||e==="isLoading")&&i==="false"&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const e=this.form??this.getAttribute("form")??void 0,t={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return b`
103
103
  <button
104
104
  class=${L(t)}
105
105
  type=${this.type}
@@ -1179,7 +1179,7 @@
1179
1179
  `:w}
1180
1180
  </ul>
1181
1181
  </nav>
1182
- `}};Ss([c({type:Object})],ns.prototype,"user",2),Ss([c({type:String,attribute:"formatted-last-logged-in"})],ns.prototype,"formattedLastLoggedIn",2),Ss([c({type:Object})],ns.prototype,"representing",2),Ss([c({type:Array,attribute:"user-menu"})],ns.prototype,"userMenu",2),Ss([c({type:Boolean,attribute:"can-change-representation",converter:gt})],ns.prototype,"canChangeRepresentation",2),Ss([c({type:Boolean,attribute:"logout-on-click",converter:gt})],ns.prototype,"logoutOnClick",2),ns=Ss([se("pkt-header-user-menu")],ns);var Uu=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,fe=(s,e,t,i)=>{for(var n=i>1?void 0:i?ju(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Uu(e,t,n),n};const qu="https://punkt-cdn.oslo.kommune.no/15.2/logos/";let he=class extends _e{constructor(){super(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.hasSlotContent=!1,this.alignSlotRight=!1,this.alignSearchRight=!1,this.defaultSlot=F(),this.headerRef=F(),this.userContainerRef=F(),this.slotContainerRef=F(),this.searchContainerRef=F(),this.slotContentRef=F(),this.searchMenuRef=F(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const e=window.pageYOffset||document.documentElement.scrollTop;e<0||Math.abs(e-this.lastScrollPosition)<60||(this.isHidden=e>this.lastScrollPosition,this.lastScrollPosition=e)},this.handleClickOutside=e=>{const t=e.target;this.user&&this.openMenu==="user"&&!t.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!t.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!t.closest(".pkt-header-service__search-container")&&!t.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(e,t)=>{const i=e.relatedTarget;let n;switch(t){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const r=n.value;r&&(!i||!r.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=e=>{e.key==="Escape"&&this.openMenu!=="none"&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new Ae(this,this.defaultSlot)}updateSlots(e){this.hasSlotContent=e.has(null)||e.has(void 0)}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(e){if(super.updated(e),e.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(e.has("mobileBreakpoint")||e.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),e.has("openMenu")){const t=e.get("openMenu");this.openMenu!=="none"&&(t==="none"||t===void 0)?(document.addEventListener("mousedown",this.handleClickOutside),document.addEventListener("keydown",this.handleEscapeKey),(this.openMenu==="slot"||this.openMenu==="search")&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu==="none"&&t!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(e.has("openMenu")||e.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const e=this.headerRef.value;e&&(this.componentWidth=e.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(t=>{for(const i of t)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(e))}updateIsMobile(){this.isMobile=this.componentWidth<this.mobileBreakpoint}updateIsTablet(){this.isTablet=this.componentWidth<this.tabletBreakpoint}updateScrollLock(){this.position==="fixed"&&this.isMobile&&this.openMenu!=="none"?this.lockScroll():this.unlockScroll()}lockScroll(){const e=document.body,t=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const i=window.innerWidth-t.clientWidth;i>0&&(e.style.paddingRight=`${i}px`),e.style.position="fixed",e.style.top=`-${this.savedScrollY}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",t.classList.add("is-scroll-locked")}unlockScroll(){const e=document.body,t=document.documentElement;t.classList.contains("is-scroll-locked")&&(e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),t.classList.remove("is-scroll-locked"),window.scrollTo({top:this.savedScrollY}))}setupScrollListener(){window.addEventListener("scroll",this.handleScroll)}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}checkDropdownAlignment(e){const t=e==="slot"?this.slotContainerRef:this.searchContainerRef,i=e==="slot"?this.slotContentRef:this.searchMenuRef;if(!t.value||!i.value||!this.isTablet||this.isMobile)return;const n=t.value.getBoundingClientRect(),r=i.value.offsetWidth,a=n.left+r>window.innerWidth;e==="slot"?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=e)}handleLogoClick(e){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleServiceClick(e){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(e){this.dispatchEvent(new CustomEvent("search",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchChange(e){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchInputChange(e){const t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key==="Enter"&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){var e;return Fu((e=this.user)==null?void 0:e.lastLoggedIn)}get isFixed(){return this.position==="fixed"}get shouldHideOnScroll(){return this.scrollBehavior==="hide"}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement==="header"||this.logOutButtonPlacement==="both")}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement==="userMenu"||this.logOutButtonPlacement==="both")}renderLogo(){if(this.hideLogo)return w;const e=b`
1182
+ `}};Ss([c({type:Object})],ns.prototype,"user",2),Ss([c({type:String,attribute:"formatted-last-logged-in"})],ns.prototype,"formattedLastLoggedIn",2),Ss([c({type:Object})],ns.prototype,"representing",2),Ss([c({type:Array,attribute:"user-menu"})],ns.prototype,"userMenu",2),Ss([c({type:Boolean,attribute:"can-change-representation",converter:gt})],ns.prototype,"canChangeRepresentation",2),Ss([c({type:Boolean,attribute:"logout-on-click",converter:gt})],ns.prototype,"logoutOnClick",2),ns=Ss([se("pkt-header-user-menu")],ns);var Uu=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,fe=(s,e,t,i)=>{for(var n=i>1?void 0:i?ju(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Uu(e,t,n),n};const qu="https://punkt-cdn.oslo.kommune.no/15.3/logos/";let he=class extends _e{constructor(){super(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.hasSlotContent=!1,this.alignSlotRight=!1,this.alignSearchRight=!1,this.defaultSlot=F(),this.headerRef=F(),this.userContainerRef=F(),this.slotContainerRef=F(),this.searchContainerRef=F(),this.slotContentRef=F(),this.searchMenuRef=F(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const e=window.pageYOffset||document.documentElement.scrollTop;e<0||Math.abs(e-this.lastScrollPosition)<60||(this.isHidden=e>this.lastScrollPosition,this.lastScrollPosition=e)},this.handleClickOutside=e=>{const t=e.target;this.user&&this.openMenu==="user"&&!t.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!t.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!t.closest(".pkt-header-service__search-container")&&!t.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(e,t)=>{const i=e.relatedTarget;let n;switch(t){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const r=n.value;r&&(!i||!r.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=e=>{e.key==="Escape"&&this.openMenu!=="none"&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new Ae(this,this.defaultSlot)}updateSlots(e){this.hasSlotContent=e.has(null)||e.has(void 0)}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(e){if(super.updated(e),e.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(e.has("mobileBreakpoint")||e.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),e.has("openMenu")){const t=e.get("openMenu");this.openMenu!=="none"&&(t==="none"||t===void 0)?(document.addEventListener("mousedown",this.handleClickOutside),document.addEventListener("keydown",this.handleEscapeKey),(this.openMenu==="slot"||this.openMenu==="search")&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu==="none"&&t!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(e.has("openMenu")||e.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const e=this.headerRef.value;e&&(this.componentWidth=e.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(t=>{for(const i of t)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(e))}updateIsMobile(){this.isMobile=this.componentWidth<this.mobileBreakpoint}updateIsTablet(){this.isTablet=this.componentWidth<this.tabletBreakpoint}updateScrollLock(){this.position==="fixed"&&this.isMobile&&this.openMenu!=="none"?this.lockScroll():this.unlockScroll()}lockScroll(){const e=document.body,t=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const i=window.innerWidth-t.clientWidth;i>0&&(e.style.paddingRight=`${i}px`),e.style.position="fixed",e.style.top=`-${this.savedScrollY}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",t.classList.add("is-scroll-locked")}unlockScroll(){const e=document.body,t=document.documentElement;t.classList.contains("is-scroll-locked")&&(e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),t.classList.remove("is-scroll-locked"),window.scrollTo({top:this.savedScrollY}))}setupScrollListener(){window.addEventListener("scroll",this.handleScroll)}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}checkDropdownAlignment(e){const t=e==="slot"?this.slotContainerRef:this.searchContainerRef,i=e==="slot"?this.slotContentRef:this.searchMenuRef;if(!t.value||!i.value||!this.isTablet||this.isMobile)return;const n=t.value.getBoundingClientRect(),r=i.value.offsetWidth,a=n.left+r>window.innerWidth;e==="slot"?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=e)}handleLogoClick(e){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleServiceClick(e){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(e){this.dispatchEvent(new CustomEvent("search",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchChange(e){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchInputChange(e){const t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key==="Enter"&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){var e;return Fu((e=this.user)==null?void 0:e.lastLoggedIn)}get isFixed(){return this.position==="fixed"}get shouldHideOnScroll(){return this.scrollBehavior==="hide"}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement==="header"||this.logOutButtonPlacement==="both")}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement==="userMenu"||this.logOutButtonPlacement==="both")}renderLogo(){if(this.hideLogo)return w;const e=b`
1183
1183
  <pkt-icon name="oslologo" aria-hidden="true" path=${qu}></pkt-icon>
1184
1184
  `;return this.logoLink&&typeof this.logoLink=="string"?b`
1185
1185
  <span class="pkt-header-service__logo">
@@ -1412,7 +1412,7 @@
1412
1412
 
1413
1413
  <div class="pkt-linkcard__text" ${H(this.defaultSlot)}></div>
1414
1414
  </a>
1415
- `}};Cs([c({type:String,reflect:!0})],rs.prototype,"title",2),Cs([c({type:String,reflect:!0})],rs.prototype,"href",2),Cs([c({type:String,reflect:!0})],rs.prototype,"iconName",2),Cs([c({type:Boolean,reflect:!0})],rs.prototype,"external",2),Cs([c({type:Boolean,reflect:!0})],rs.prototype,"openInNewTab",2),Cs([c({type:String,reflect:!0})],rs.prototype,"skin",2),rs=Cs([se("pkt-linkcard")],rs);var Gu=Object.defineProperty,Xu=Object.getOwnPropertyDescriptor,Gt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Xu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Gu(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.2/animations/";let Et=class extends _e{constructor(){super(),this.defaultSlot=F(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1,this.slotController=new Ae(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=L({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=L({"pkt-contents":!0,"pkt-hide":this.isLoading});return b`<div
1415
+ `}};Cs([c({type:String,reflect:!0})],rs.prototype,"title",2),Cs([c({type:String,reflect:!0})],rs.prototype,"href",2),Cs([c({type:String,reflect:!0})],rs.prototype,"iconName",2),Cs([c({type:Boolean,reflect:!0})],rs.prototype,"external",2),Cs([c({type:Boolean,reflect:!0})],rs.prototype,"openInNewTab",2),Cs([c({type:String,reflect:!0})],rs.prototype,"skin",2),rs=Cs([se("pkt-linkcard")],rs);var Gu=Object.defineProperty,Xu=Object.getOwnPropertyDescriptor,Gt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Xu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Gu(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.3/animations/";let Et=class extends _e{constructor(){super(),this.defaultSlot=F(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1,this.slotController=new Ae(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=L({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=L({"pkt-contents":!0,"pkt-hide":this.isLoading});return b`<div
1416
1416
  role="status"
1417
1417
  aria-live="polite"
1418
1418
  aria-busy=${this.isLoading?"true":"false"}
@@ -1690,4 +1690,4 @@
1690
1690
  Copyright (c) 2018 Jed Watson.
1691
1691
  Licensed under the MIT License (MIT), see
1692
1692
  http://jedwatson.github.io/classnames
1693
- */var Da;function wh(){return Da||(Da=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(r=n(r,i(l)))}return r}function i(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var l in r)e.call(r,l)&&r[l]&&(a=n(a,l));return a}function n(r,a){return a?r?r+" "+a:r+a:r}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(Yn)),Yn.exports}var xh=wh();const ce=$h(xh),rn=({children:s,closeAlert:e,compact:t,title:i,date:n,ariaLive:r,"aria-live":a="polite",role:l="status",skin:d="info",className:p,...m})=>{const[v,y]=h.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":t,[`pkt-alert--${d}`]:d,"pkt-hide":v},g={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},$=h.useCallback(()=>{y(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,y]),C=r||a;return o.jsx("div",{...m,"aria-live":C,role:l,className:ce(k,p),children:o.jsxs("div",{className:ce(g),children:[o.jsx(K,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),e&&o.jsx("div",{className:"pkt-alert__close",children:o.jsx(it,{tabIndex:0,"aria-label":"close",size:t?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:$,children:o.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&o.jsx("div",{className:"pkt-alert__title",children:i}),o.jsx("div",{className:"pkt-alert__text",children:s}),n&&o.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};rn.displayName="PktAlert";const Oa=At({tagName:"pkt-backlink",elementClass:Hs,react:h,displayName:"PktBackLink"});Oa.displayName="PktBackLink";const Ea=h.forwardRef(({breadcrumbs:s,navigationType:e,renderLink:t,className:i,...n},r)=>{const a=s,l=a[a.length-2],d=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=t||(e==="router"?({href:m,className:v,children:y,props:k})=>o.jsx(jo.Link,{to:m,className:v,...k,children:y}):({href:m,className:v,children:y,props:k})=>o.jsx("a",{href:m,className:v,...k,children:y}));return o.jsxs("nav",{ref:r,"aria-label":"brødsmulemeny",className:d,children:[o.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((m,v)=>o.jsx("li",{className:"pkt-breadcrumbs__item",children:v===a.length-1?o.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})}):p({href:m.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})]}),props:n})},`breadcrumb-${v}`))}),p({href:l.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:l.text})]}),props:n})]})});Ea.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.2/animations/";const it=h.forwardRef(({children:s,className:e,iconName:t="user",secondIconName:i="user",iconPath:n,secondIconPath:r,size:a="medium",fullWidth:l=!1,fullWidthOnMobile:d=!1,skin:p="primary",type:m="button",variant:v="label-only",state:y,color:k,isLoading:g=void 0,disabled:$=void 0,loadingAnimationPath:C=window.pktAnimationPath,...M},S)=>{const E=[e,"pkt-btn",a&&`pkt-btn--${a}`,l&&"pkt-btn--full",d&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,k&&`pkt-btn--${k}`,y&&`pkt-btn--${y}`,g&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return o.jsxs("button",{...M,"aria-busy":g||void 0,"aria-disabled":$||void 0,disabled:$,className:E,type:m,ref:S,children:[g&&o.jsx(K,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:C}),v!=="label-only"&&o.jsx(K,{className:"pkt-btn__icon",name:t,...n&&{path:n}}),o.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&o.jsx(K,{className:"pkt-btn__icon",name:i,...r&&{path:r}})]})});it.displayName="PktButton";const Pa=6048e5,Sh=864e5,Aa=Symbol.for("constructDateFrom");function Ut(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Aa in s?s[Aa](e):s instanceof Date?new s.constructor(e):new Date(e)}function bt(s,e){return Ut(e||s,s)}function Ia(s,e,t){const i=bt(s,t==null?void 0:t.in);return isNaN(e)?Ut(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Ch={};function an(){return Ch}function Ti(s,e){var l,d,p,m;const t=an(),i=(e==null?void 0:e.weekStartsOn)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??t.weekStartsOn??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,n=bt(s,e==null?void 0:e.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function on(s,e){return Ti(s,{...e,weekStartsOn:1})}function La(s,e){const t=bt(s,e==null?void 0:e.in),i=t.getFullYear(),n=Ut(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=on(n),a=Ut(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=on(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Ba(s){const e=bt(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function Fa(s,...e){const t=Ut.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Kn(s,e){const t=bt(s,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function Th(s,e,t){const[i,n]=Fa(t==null?void 0:t.in,s,e),r=Kn(i),a=Kn(n),l=+r-Ba(r),d=+a-Ba(a);return Math.round((l-d)/Sh)}function Nh(s,e){const t=La(s,e),i=Ut(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),on(i)}function Mh(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Dh(s){return!(!Mh(s)&&typeof s!="number"||isNaN(+bt(s)))}function Oh(s,e){const t=bt(s,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function Eh(s,e){const[t,i]=Fa(s,e.start,e.end);return{start:t,end:i}}function Ha(s,e){const{start:t,end:i}=Eh(e==null?void 0:e.in,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let l=1;const d=[];for(;+a<=r;)d.push(Ut(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return n?d.reverse():d}function Ph(s,e){const t=bt(s,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Ah={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"}},Ih=(s,e,t)=>{let i;const n=Ah[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Gn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Lh={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bh={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Fh={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Hh={date:Gn({formats:Lh,defaultWidth:"full"}),time:Gn({formats:Bh,defaultWidth:"full"}),dateTime:Gn({formats:Fh,defaultWidth:"full"})},Vh={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Uh=(s,e,t,i)=>Vh[s];function Ni(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;n=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const jh={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qh={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wh={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"]},zh={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"]},Yh={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"}},Kh={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"}},Gh={ordinalNumber:(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Ni({values:jh,defaultWidth:"wide"}),quarter:Ni({values:qh,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Ni({values:Wh,defaultWidth:"wide"}),day:Ni({values:zh,defaultWidth:"wide"}),dayPeriod:Ni({values:Yh,defaultWidth:"wide",formattingValues:Kh,defaultFormattingWidth:"wide"})};function Mi(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],l=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(l)?Qh(l,v=>v.test(a)):Xh(l,v=>v.test(a));let p;p=s.valueCallback?s.valueCallback(d):d,p=t.valueCallback?t.valueCallback(p):p;const m=e.slice(a.length);return{value:p,rest:m}}}function Xh(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Qh(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function Zh(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(n.length);return{value:a,rest:l}}}const Jh=/^(\d+)(th|st|nd|rd)?/i,Rh=/\d+/i,ep={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},tp={any:[/^b/i,/^(a|c)/i]},sp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ip={any:[/1/i,/2/i,/3/i,/4/i]},np={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},rp={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]},ap={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},op={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]},lp={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},cp={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}},dp={ordinalNumber:Zh({matchPattern:Jh,parsePattern:Rh,valueCallback:s=>parseInt(s,10)}),era:Mi({matchPatterns:ep,defaultMatchWidth:"wide",parsePatterns:tp,defaultParseWidth:"any"}),quarter:Mi({matchPatterns:sp,defaultMatchWidth:"wide",parsePatterns:ip,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Mi({matchPatterns:np,defaultMatchWidth:"wide",parsePatterns:rp,defaultParseWidth:"any"}),day:Mi({matchPatterns:ap,defaultMatchWidth:"wide",parsePatterns:op,defaultParseWidth:"any"}),dayPeriod:Mi({matchPatterns:lp,defaultMatchWidth:"any",parsePatterns:cp,defaultParseWidth:"any"})},up={code:"en-US",formatDistance:Ih,formatLong:Hh,formatRelative:Uh,localize:Gh,match:dp,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hp(s,e){const t=bt(s,e==null?void 0:e.in);return Th(t,Ph(t))+1}function pp(s,e){const t=bt(s,e==null?void 0:e.in),i=+on(t)-+Nh(t);return Math.round(i/Pa)+1}function Va(s,e){var m,v,y,k;const t=bt(s,e==null?void 0:e.in),i=t.getFullYear(),n=an(),r=(e==null?void 0:e.firstWeekContainsDate)??((v=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??n.firstWeekContainsDate??((k=(y=n.locale)==null?void 0:y.options)==null?void 0:k.firstWeekContainsDate)??1,a=Ut((e==null?void 0:e.in)||s,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const l=Ti(a,e),d=Ut((e==null?void 0:e.in)||s,0);d.setFullYear(i,0,r),d.setHours(0,0,0,0);const p=Ti(d,e);return+t>=+l?i+1:+t>=+p?i:i-1}function fp(s,e){var l,d,p,m;const t=an(),i=(e==null?void 0:e.firstWeekContainsDate)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??t.firstWeekContainsDate??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,n=Va(s,e),r=Ut((e==null?void 0:e.in)||s,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),Ti(r,e)}function Ua(s,e){const t=bt(s,e==null?void 0:e.in),i=+Ti(t,e)-+fp(t,e);return Math.round(i/Pa)+1}function ge(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const as={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return ge(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):ge(t+1,2)},d(s,e){return ge(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return ge(s.getHours()%12||12,e.length)},H(s,e){return ge(s.getHours(),e.length)},m(s,e){return ge(s.getMinutes(),e.length)},s(s,e){return ge(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return ge(n,e.length)}},Zs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ja={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return as.y(s,e)},Y:function(s,e,t,i){const n=Va(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return ge(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):ge(r,e.length)},R:function(s,e){const t=La(s);return ge(t,e.length)},u:function(s,e){const t=s.getFullYear();return ge(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return ge(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return ge(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return as.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return ge(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Ua(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):ge(n,e.length)},I:function(s,e,t){const i=pp(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):ge(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):as.d(s,e)},D:function(s,e,t){const i=hp(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):ge(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return ge(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return ge(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return ge(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(s,e,t){const n=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(s,e,t){const i=s.getHours();let n;switch(i===12?n=Zs.noon:i===0?n=Zs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Zs.evening:i>=12?n=Zs.afternoon:i>=4?n=Zs.morning:n=Zs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return as.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):as.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):ge(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):ge(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):as.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):as.s(s,e)},S:function(s,e){return as.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Wa(i);case"XXXX":case"XX":return Ms(i);case"XXXXX":case"XXX":default:return Ms(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return Wa(i);case"xxxx":case"xx":return Ms(i);case"xxxxx":case"xxx":default:return Ms(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+qa(i,":");case"OOOO":default:return"GMT"+Ms(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+qa(i,":");case"zzzz":default:return"GMT"+Ms(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return ge(i,e.length)},T:function(s,e,t){return ge(+s,e.length)}};function qa(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+ge(r,2)}function Wa(s,e){return s%60===0?(s>0?"-":"+")+ge(Math.abs(s)/60,2):Ms(s,e)}function Ms(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=ge(Math.trunc(i/60),2),r=ge(i%60,2);return t+n+e+r}const za=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ya=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},mp={p:Ya,P:(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return za(s,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",za(i,e)).replace("{{time}}",Ya(n,e))}},gp=/^D+$/,vp=/^Y+$/,bp=["D","DD","YY","YYYY"];function yp(s){return gp.test(s)}function kp(s){return vp.test(s)}function _p(s,e,t){const i=$p(s,e,t);if(console.warn(i),bp.includes(s))throw new RangeError(i)}function $p(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const wp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sp=/^'([^]*?)'?$/,Cp=/''/g,Tp=/[a-zA-Z]/;function Np(s,e,t){var m,v,y,k;const i=an(),n=i.locale??up,r=i.firstWeekContainsDate??((v=(m=i.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??1,a=i.weekStartsOn??((k=(y=i.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=bt(s,t==null?void 0:t.in);if(!Dh(l))throw new RangeError("Invalid time value");let d=e.match(xp).map(g=>{const $=g[0];if($==="p"||$==="P"){const C=mp[$];return C(g,n.formatLong)}return g}).join("").match(wp).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const $=g[0];if($==="'")return{isToken:!1,value:Mp(g)};if(ja[$])return{isToken:!0,value:g};if($.match(Tp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:g}});n.localize.preprocessor&&(d=n.localize.preprocessor(l,d));const p={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return d.map(g=>{if(!g.isToken)return g.value;const $=g.value;(kp($)||yp($))&&_p($,e,String(s));const C=ja[$[0]];return C(l,$,n.localize,p)}).join("")}function Mp(s){const e=s.match(Sp);return e?e[1].replace(Cp,"'"):s}function Dp(s,e){const t=bt(s,e==null?void 0:e.in).getDay();return t===0?7:t}function Op(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const Xn={},Di={};function Ds(s,e){try{const i=(Xn[s]||(Xn[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return i in Di?Di[i]:Ka(i,i.split(":"))}catch{if(s in Di)return Di[s];const t=s==null?void 0:s.match(Ep);return t?Ka(s,t.slice(1)):NaN}}const Ep=/([+-]\d\d):?(\d\d)?/;function Ka(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return Di[s]=t*60+i>0?t*60+i+n:t*60-i-n}class jt extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ds(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Xa(this),Qn(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new jt(...t,e):new jt(Date.now(),e)}withTimeZone(e){return new jt(+this,e)}getTimezoneOffset(){const e=-Ds(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Qn(this),+this}[Symbol.for("constructDateFrom")](e){return new jt(+new Date(e),this.timeZone)}}const Ga=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Ga.test(s))return;const e=s.replace(Ga,"$1UTC");jt.prototype[e]&&(s.startsWith("get")?jt.prototype[s]=function(){return this.internal[e]()}:(jt.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Pp(this),+this},jt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Qn(this),+this}))});function Qn(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Ds(s.timeZone,s)*60))}function Pp(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),Xa(s)}function Xa(s){const e=Ds(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const d=n-t;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(Ds(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const y=Ds(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),$=-new Date(+s).getTimezoneOffset()-k,C=k!==t,M=$-d;if(C&&M){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+M);const S=Ds(s.timeZone,s),E=S>0?Math.floor(S):Math.ceil(S),T=k-E;T&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T))}}class os extends jt{static tz(e,...t){return t.length?new os(...t,e):new os(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${Op(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new os(+this,e)}[Symbol.for("constructDateFrom")](e){return new os(+new Date(e),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Ap=(s=window.pktTz)=>{const e=new os(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function qt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const nt=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},Oi=s=>{if(!s)return null;const e=qt(s);return isNaN(e.getTime())?null:e},Ip=(s,e)=>{const t=Qt(s);return isNaN(t.getTime())?"":Np(t,e)},Qt=(s="",e)=>{const t=typeof s=="string"?qt(s):s;return!t||isNaN(t.getTime())?new Date:e?e==="end"?Oh(t):Kn(t):t},Js=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},Ei=s=>{let e;return typeof s=="number"?e=new os(s,window.pktTz):e=new os(s,window.pktTz),e.setHours(12,0,0,0),e};let Zn=null,Qa;const Lp=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Zn||Qa!==e)&&(Zn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),Qa=e),Zn.format(s)},Bp=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Qt(e):null,n=t?Qt(t):null;return!(i&&s<i||n&&s>n)},Fp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=nt(s);return e.includes(t)},Hp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},Za=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!Bp(s,e,t)||i&&Fp(s,i)||n&&Hp(s,n)),Vp=(s,e,t,i,n)=>s.filter(r=>{const a=Oi(r);return a&&Za(a,e,t,i,n)}),Up=s=>s.slice().sort((e,t)=>{const i=Oi(e),n=Oi(t);return!i||!n?0:i.getTime()-n.getTime()}),jp=(s,e)=>{const t=Oi(s),i=Oi(e);return!t||!i?!1:t<=i};function Ja(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:nt(i));return!Za(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function qp(s,e,t,i){return!!(Ja(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function Wp(s,e,t){const i=Js(s,e,0);return!(t&&Qt(t)>i)}function zp(s,e,t){const i=Js(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Qt(t)<i)}function Ra(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>qt(e))}function eo(s,e){const t=Ha({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[nt(r)]=a}return i}function to(s,e,t,i){if(e.length!==1)return!0;const n=Ha({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(Dp(n[r]).toString()))return!1}return!0}function Jn(s,e){const t=nt(s);return e.includes(t)?e:[...e,t]}function Rn(s,e){const t=nt(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function so(s,e,t){const i=nt(s);return e.includes(i)?Rn(s,e):t>0&&e.length>=t?e:Jn(s,e)}function Yp(s,e,t){const i=nt(s),n=Ra(e);if(e.includes(i))return e.indexOf(i)===0?[]:Rn(s,e);if(e.length>1)return[i];if(e.length===1){if(!to(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return Jn(s,e)}const Pi=7,Kp=6;function Gp(s,e){const t=Js(s,e,1),i=Js(s,e+1,0),n=(t.getDay()+Kp)%Pi,r=i.getDate(),a=Math.ceil((r+n)/Pi),d=Js(s,e,0).getDate(),p=Ua(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:d,initialWeek:p}}function Xp(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function Qp(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}const Zp={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Pi,ArrowDown:Pi};function Jp(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Rp(s,e,t){let i=Ia(s,e);if(!i)return null;let n=t(`button[data-date="${nt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Ia(i,e),n=t(`button[data-date="${nt(i)}"]`),!n)return null;return i}function ef(s){return Zp[s]??null}const tf={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"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"};function sf(s){const{selected:e,multiple:t=!1,maxMultiple:i=0,range:n=!1,earliest:r=null,latest:a=null,excludedates:l,excludeweekdays:d=[],weeknumbers:p=!1,withcontrols:m=!1,currentmonth:v,today:y,strings:k,onDateSelected:g,onClose:$,id:C,className:M}=s,S=h.useId(),E=C??S,T=h.useMemo(()=>({...tf,...k}),[k]),V=h.useMemo(()=>y?qt(y):Ap(),[y]),G=h.useMemo(()=>l?l.map(f=>typeof f=="string"?qt(f):f):[],[l]),ie=e!==void 0,[we,D]=h.useState([]),N=ie?e:we,j=h.useMemo(()=>Ra(N),[N]),[J,X]=h.useState(0),[ne,ae]=h.useState(0),[pe,oe]=h.useState({}),[ve,z]=h.useState(null),[Y,Ee]=h.useState(null),le=h.useRef(null),re=h.useRef([]),Ke=h.useRef(0),He=h.useRef(!1),Ne=h.useRef(!1),Ge=h.useMemo(()=>({earliest:r,latest:a,excludedates:G,excludeweekdays:d}),[r,a,G,d]);h.useEffect(()=>{let f=null;if(v!=null&&(v instanceof Date?f=Ei(v):typeof v=="string"&&(f=qt(v))),!f||isNaN(f.getTime()))if(N.length>0&&N[0]!==""){const u=qt(N[N.length-1]);f=isNaN(u.getTime())?Ei(V):u}else f=Ei(V);if((!f||isNaN(f.getTime()))&&(f=Ei(V)),a){const u=typeof a=="string"?qt(a):a;!isNaN(u.getTime())&&f>u&&(f=u)}if(r){const u=typeof r=="string"?qt(r):r;!isNaN(u.getTime())&&f<u&&(f=u)}X(f.getFullYear()),ae(f.getMonth()),Ne.current=!0},[]),h.useEffect(()=>{if(Ne.current&&!He.current&&N.length>0&&N[0]!==""){const f=qt(N[N.length-1]);isNaN(f.getTime())||(X(f.getFullYear()),ae(f.getMonth()))}},[N]),h.useEffect(()=>{n&&j.length===2?oe(eo(j[0],j[1])):(!n||j.length<2)&&oe({})},[n,j]);const rt=h.useCallback(f=>{ie||D(f),g==null||g(f)},[ie,g]),xe=h.useCallback(()=>{$==null||$()},[$]),Se=h.useCallback((f,u)=>{X(typeof f=="string"?parseInt(f):f),ae(typeof u=="string"?parseInt(u):u),Ke.current=0,Ee(null),re.current=[],He.current=!0},[]),Pe=h.useCallback(()=>{const f=ne===0?11:ne-1,u=ne===0?J-1:J;Se(u,f)},[J,ne,Se]),Ve=h.useCallback(()=>{const f=ne===11?0:ne+1,u=ne===11?J+1:J;Se(u,f)},[J,ne,Se]),at=h.useCallback(f=>Ja(f,Ge),[Ge]),be=h.useCallback((f,u)=>qp(f,u,Ge,{multiple:t,maxMultiple:i,selectedCount:N.length}),[Ge,t,i,N.length]),ke=h.useCallback(()=>typeof N=="string"?N.split(","):N,[N]),W=h.useCallback(f=>{if(!n||j.length!==1||!to(f,j,G,d)||j[0]>=f){z(null);return}z(f),oe(eo(j[0],f))},[n,j,G,d]),de=h.useCallback(f=>{if(!f)return;let u;if(n)u=Yp(f,ke(),{excludedates:G,excludeweekdays:d}),ie||D(u),u.length===2?(g==null||g(u),xe()):(u.length===1&&oe({}),g==null||g(u));else if(t)u=so(f,ke(),i),rt(u);else{const _=nt(f);N.includes(_)?u=[]:u=[_],rt(u),xe()}},[n,t,i,ke,N,G,d,ie,rt,xe,g]),Z=h.useCallback(f=>{const u=Jn(f,ke());ie||D(u),n&&u.length===2&&(g==null||g(u),xe())},[ke,ie,n,g,xe]),te=h.useCallback(f=>{const u=Rn(f,ke());ie||D(u)},[ke,ie]),ut=h.useCallback(f=>{const u=so(f,ke(),i);ie||D(u)},[ke,i,ie]),Be=h.useCallback(()=>{var x,B;const f=nt(Ei(V)),u=(x=le.current)==null?void 0:x.querySelector(`button[data-date="${f}"]`);if(u instanceof HTMLButtonElement){Ee(f),u.focus();return}const _=re.current.find(U=>!U.isDisabled);if(_){const U=(B=le.current)==null?void 0:B.querySelector(`button[data-date="${_.currentDateISO}"]`);U instanceof HTMLButtonElement&&(Ee(_.currentDateISO),U.focus())}},[]),Ue=h.useCallback((f,u)=>{const _=f.target;if(Jp(_))return;if(f.preventDefault(),!Y){Be();return}const x=Qt(Y),B=Rp(x,u,le.current.querySelector.bind(le.current));if(B){const U=le.current.querySelector(`button[data-date="${nt(B)}"]`);U instanceof HTMLButtonElement&&!U.dataset.disabled&&(Ee(nt(B)),U.focus())}},[Y,Be]),yt=h.useCallback(f=>{if(f.key==="Escape"){f.preventDefault(),xe();return}const u=ef(f.key);u!==null&&Ue(f.nativeEvent,u)},[xe,Ue]),Wt=h.useCallback(f=>{le.current&&!le.current.contains(f.relatedTarget)&&!f.target.classList.contains("pkt-hide")&&xe()},[xe]);return{componentId:E,strings:T,todayDate:V,year:J,month:ne,activeSelected:N,_selected:j,inRange:pe,rangeHovered:ve,focusedDate:Y,range:n,multiple:t,weeknumbers:p,withcontrols:m,earliest:r,latest:a,excludedates:G,excludeweekdays:d,className:M,dateConstraints:Ge,calendarRef:le,selectableDatesRef:re,tabIndexSetRef:Ke,prevMonth:Pe,nextMonth:Ve,changeMonth:Se,handleDateSelect:de,addToSelected:Z,removeFromSelected:te,toggleSelectedDate:ut,handleRangeHover:W,isExcluded:at,isDayDisabled:be,focusOnCurrentDate:Be,handleKeydown:yt,handleFocusOut:Wt,close:xe,setFocusedDate:Ee}}const nf=({componentId:s,strings:e,year:t,month:i,earliest:n,latest:r,withcontrols:a,prevMonth:l,nextMonth:d,changeMonth:p})=>{const m=y=>{const k=y==="prev",g=k?Wp(t,i,n):zp(t,i,r),$=k?e.prevMonth:e.nextMonth,C=k?"chevron-thin-left":"chevron-thin-right",M=k?"pkt-calendar__prev-month":"pkt-calendar__next-month",S=k?l:d;return o.jsx("div",{children:o.jsxs("button",{type:"button","aria-label":$,onClick:()=>g&&S(),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g&&S())},className:["pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",M,!g&&"pkt-invisible"].filter(Boolean).join(" "),"data-disabled":g?void 0:"disabled","aria-disabled":!g||void 0,tabIndex:g?0:-1,children:[o.jsx(K,{className:"pkt-btn__icon",name:C}),o.jsx("span",{className:"pkt-btn__text",children:$})]})})},v=()=>a?o.jsxs("div",{className:"pkt-cal-month-picker",children:[o.jsx("label",{htmlFor:`${s}-monthnav`,className:"pkt-hide",children:e.month}),o.jsx("select",{"aria-label":e.month,className:"pkt-input pkt-input-compact",id:`${s}-monthnav`,value:i,onChange:y=>{y.stopPropagation(),p(t,parseInt(y.target.value))},children:e.months.map((y,k)=>o.jsx("option",{value:k,children:y},k))}),o.jsx("label",{htmlFor:`${s}-yearnav`,className:"pkt-hide",children:e.year}),o.jsx("input",{"aria-label":e.year,className:"pkt-input pkt-cal-input-year pkt-input-compact",id:`${s}-yearnav`,type:"number",size:4,placeholder:"0000",value:t,onChange:y=>{y.stopPropagation(),p(parseInt(y.target.value),i)}})]}):o.jsxs("div",{className:"pkt-txt-16-medium pkt-calendar__month-title","aria-live":"polite",children:[e.months[i]," ",t]});return o.jsxs("nav",{className:"pkt-cal-month-nav",children:[m("prev"),v(),m("next")]})};function rf(s,e,t){const i=Js(t.year,t.month,s),n=nt(i),r=n===nt(e),a=t.activeSelected.includes(n),l=t.isDayDisabled(i,a);let d;return t.focusedDate?d=t.focusedDate===n&&!l?"0":"-1":!l&&t.tabIndexSetRef.current===0?(t.tabIndexSetRef.current=s,d="0"):d=t.tabIndexSetRef.current===s?"0":"-1",{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:l,ariaLabel:Lp(i),tabindex:d}}function af(s,e){const{currentDateISO:t,isToday:i,isSelected:n}=s,r=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],a=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return ce({"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":e.inRange[t],"pkt-cal-excluded":e.isExcluded(s.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":e.rangeHovered!==null&&t===nt(e.rangeHovered)})}function of(s,e){const{currentDateISO:t,isToday:i,isSelected:n,isDisabled:r}=s,a=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],l=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return ce({"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":e.inRange[t],"pkt-calendar__date--in-range-hover":e.rangeHovered!==null&&t===nt(e.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l})}const lf=({state:s})=>{const{strings:e,year:t,month:i,activeSelected:n,focusedDate:r,inRange:a,rangeHovered:l,range:d,multiple:p,weeknumbers:m,selectableDatesRef:v,tabIndexSetRef:y,handleDateSelect:k,handleRangeHover:g,isExcluded:$,isDayDisabled:C,setFocusedDate:M,todayDate:S}=s,E={year:t,month:i,activeSelected:n,focusedDate:r,tabIndexSetRef:y,isDayDisabled:C},T={range:d,activeSelected:n,rangeHovered:l,inRange:a,isExcluded:$},V=()=>{const D=[];m&&D.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__week-number",children:e.week})},"week-header"));for(let N=0;N<e.daysShort.length;N++)D.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__day-name","aria-label":e.days[N],children:e.daysShort[N]})},`day-${N}`));return o.jsx("tr",{className:"pkt-cal-week-row",children:D})},G=(D,N)=>{const j=rf(D,N,E),{currentDate:J,currentDateISO:X,isSelected:ne,isDisabled:ae,ariaLabel:pe,tabindex:oe}=j;v.current.push({currentDateISO:X,isDisabled:ae,tabindex:oe});const ve=af(j,T),z=of(j,T);return o.jsx("td",{className:ve,children:o.jsx("button",{type:"button","aria-pressed":ne?"true":"false",disabled:ae,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${z}`,onMouseOver:()=>d&&!$(J)&&g(J),onFocus:()=>{d&&!$(J)&&g(J),M(X)},"aria-label":pe,tabIndex:parseInt(oe),"data-disabled":ae?"disabled":void 0,"data-date":X,onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),k(J))},onClick:Y=>{ae||(Y.preventDefault(),k(J))},children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:D})})},X)},ie=(D,N)=>o.jsx("td",{className:"pkt-cal-other",children:o.jsx("div",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only","data-disabled":"disabled",children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:D})})},N),we=()=>{const D=S,N=Gp(t,i);v.current=[],y.current=0;let j=1,J=N.initialWeek;const X=[];for(let ne=0;ne<N.numRows;ne++){const ae=[];m&&ae.push(o.jsx("td",{className:"pkt-cal-week",children:J},`week-${J}`)),J++;for(let pe=0;pe<Pi;pe++){const oe=Xp(ne,pe,j,N);if(oe==="current-month")ae.push(G(j,D)),j++;else{const ve=Qp(oe,pe,j,N);ae.push(ie(ve,`${oe}-${ne}-${pe}`)),oe==="next-month"&&j++}}X.push(o.jsx("tr",{className:"pkt-cal-week-row",role:"row",children:ae},`row-${ne}`))}return X};return o.jsxs("table",{className:"pkt-cal-days pkt-txt-12-medium pkt-calendar__body",role:"grid","aria-multiselectable":d||p||void 0,children:[o.jsx("thead",{children:V()}),o.jsx("tbody",{children:we()})]})},er=h.forwardRef((s,e)=>{const t=sf(s);return h.useImperativeHandle(e,()=>({handleDateSelect:t.handleDateSelect,addToSelected:t.addToSelected,removeFromSelected:t.removeFromSelected,toggleSelected:t.toggleSelectedDate,focusOnCurrentDate:t.focusOnCurrentDate,close:t.close}),[t.handleDateSelect,t.addToSelected,t.removeFromSelected,t.toggleSelectedDate,t.focusOnCurrentDate,t.close]),o.jsxs("div",{ref:t.calendarRef,className:["pkt-calendar",t.weeknumbers&&"pkt-cal-weeknumbers",t.className].filter(Boolean).join(" "),onBlur:t.handleFocusOut,onKeyDown:t.handleKeydown,children:[o.jsx(nf,{componentId:t.componentId,strings:t.strings,year:t.year,month:t.month,earliest:t.earliest,latest:t.latest,withcontrols:t.withcontrols,prevMonth:t.prevMonth,nextMonth:t.nextMonth,changeMonth:t.changeMonth}),o.jsx(lf,{state:t})]})});er.displayName="PktCalendar";const cf=At({tagName:"pkt-card",elementClass:We,react:h,displayName:"PktCard",events:{}}),io=h.forwardRef(({children:s,...e},t)=>o.jsx(cf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));io.displayName="PktCard";const no=h.forwardRef(({id:s,hasTile:e=!1,disabled:t=!1,label:i,checkHelptext:n,hasError:r=!1,className:a,isSwitch:l=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:m,checked:v,indeterminate:y,optionalTag:k,optionalText:g="Valgfritt",requiredTag:$,requiredText:C="Må fylles ut",tagText:M,...S},E)=>{const T=h.useRef(null);h.useEffect(()=>{T.current&&y!==void 0&&(T.current.indeterminate=y)},[y]),h.useEffect(()=>{typeof E=="function"?E(T.current):E&&(E.current=T.current)},[E]);const V=[a,"pkt-input-check"].filter(Boolean).join(" "),G=["pkt-input-check__input-label",t?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),ie=["pkt-input-check__input",e?"pkt-input-check__input--tile":"",t&&e?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),we=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),D=()=>o.jsxs(o.Fragment,{children:[M&&o.jsx("span",{className:we+" pkt-tag--gray",children:M}),k&&o.jsx("span",{className:we+" pkt-tag--blue-light",children:g}),$&&o.jsx("span",{className:we+" pkt-tag--beige",children:C})]});return o.jsx("div",{className:V,children:o.jsxs("div",{className:ie,children:[p==="left"&&o.jsxs("label",{className:G,htmlFor:s,children:[i," ",D(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),o.jsx("input",{role:l?"switch":"checkbox",ref:T,className:`pkt-input-check__input-checkbox ${r?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:t,...v!==void 0?{checked:v}:{defaultChecked:m},...S}),p==="right"&&o.jsxs("label",{className:G,htmlFor:s,children:[i," ",D(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});no.displayName="PktCheckbox";const df=At({tagName:"pkt-combobox",elementClass:Oe,react:h,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),ro=h.forwardRef(({children:s,helptext:e,...t},i)=>o.jsxs(df,{...t,ref:i,children:[e&&o.jsx("div",{slot:"helptext",className:"pkt-contents",children:e}),s]}));ro.displayName="PktCombobox";const ln=At({tagName:"pkt-consent",elementClass:Ct,react:h,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});ln.displayName="PktConsent";const Os=h.forwardRef(({forId:s,label:e,helptext:t,helptextDropdown:i,helptextDropdownButton:n,counter:r,counterCurrent:a=0,counterMaxLength:l,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:y=null,hasError:k=!1,errorMessage:g,disabled:$=!1,inline:C=!1,ariaDescribedby:M,useWrapper:S=!0,children:E,className:T="",hasFieldset:V=!1,role:G="group",counterPosition:ie="bottom"},we)=>{const[D,N]=h.useState(!1),j=M||(t?`${s}-helptext`:void 0),J=!!r,X=J&&ie==="top",ne=J&&ie==="bottom",ae=()=>N(re=>!re),pe=["pkt-inputwrapper",T,k?"pkt-inputwrapper--error":"",$?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),oe=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),ve=()=>J?o.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[a,l?`/${l}`:""]}):null,z=()=>o.jsxs(o.Fragment,{children:[y&&o.jsx("span",{className:oe+" pkt-tag--gray",children:y}),d&&o.jsx("span",{className:oe+" pkt-tag--blue-light",children:p}),m&&o.jsx("span",{className:oe+" pkt-tag--beige",children:v})]}),Y=()=>{const re=o.jsxs(o.Fragment,{children:[e," ",z()]});return S?V?o.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:re}):o.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":j,id:`${s}-label`,children:re}):o.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":j,id:`${s}-label`,children:e})},Ee=()=>!t&&!i?null:o.jsxs(o.Fragment,{children:[t&&S&&o.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:t}),i&&o.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[o.jsx(it,{skin:"tertiary",size:"small",variant:"icon-right",iconName:D?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ae,children:o.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),o.jsx("div",{className:`pkt-inputwrapper__helptext ${D?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),le=o.jsxs(o.Fragment,{children:[Y(),Ee(),X&&o.jsx(ve,{}),E,ne&&o.jsx(ve,{}),k&&g&&o.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:o.jsx(rn,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:g})})]});return o.jsx("div",{className:pe,ref:we,role:G,children:V?o.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":j,children:le}):o.jsx("div",{className:"pkt-inputwrapper__fieldset",children:le})})});Os.displayName="PktInputWrapper";const ao=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},uf=()=>ao()?"text":"date",hf=s=>!s||s.length!==2?!0:jp(s[0],s[1]),pf=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),ff=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),mf=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),gf=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,vf=(s,e,t=!1)=>{var l;if(!s||!e)return;const i=((l=e.parentElement)==null?void 0:l.getBoundingClientRect())||e.getBoundingClientRect(),n=t?i.height+30:i.height,r=s.getBoundingClientRect().height;let a=t?"calc(100% - 30px)":"100%";i&&i.top+r>window.innerHeight&&i.top-r>0&&(a=`calc(100% - ${n}px - ${r}px)`),s.style.top=a},cn=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},bf=({open:s,multiple:e=!1,range:t=!1,weeknumbers:i=!1,withcontrols:n=!1,selected:r=[],earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:v,today:y,inputRef:k,hasCounter:g=!1,onDateSelected:$,onClose:C})=>{const M=h.useRef(null),S=h.useRef(!1);s&&(S.current=!0),h.useEffect(()=>{s&&vf(M.current,(k==null?void 0:k.current)??null,g)},[s,k,g]);const E=["pkt-calendar-popup",s?"show":"hide"].join(" "),T=s||S.current;return o.jsx("div",{ref:M,className:E,hidden:!s,"aria-hidden":!s,children:T&&o.jsx(er,{multiple:e,range:t,weeknumbers:i,withcontrols:n,selected:r,earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:v,today:y,onDateSelected:$,onClose:C})})},dn=h.forwardRef(({children:s,skin:e,textStyle:t,size:i,closeTag:n,className:r,iconName:a,ariaLabel:l,onClose:d,type:p,"aria-description":m,...v},y)=>{const[k,g]=h.useState(!1),$=h.useCallback(()=>{g(!0),d&&d()},[d]),C=h.useRef(null),[M,S]=h.useState("");h.useEffect(()=>{var G,ie;S(((ie=(G=C.current)==null?void 0:G.textContent)==null?void 0:ie.trim())??"")},[s]);const E=h.useMemo(()=>{if(n&&!l)return M&&`Klikk for å fjerne ${M}`||m},[n,l,M,m]),T={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${t}`]:!!t},V={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,"pkt-btn--icons-right-and-left":n&&!!a,"pkt-hide":k};return n?o.jsxs("button",{...v,className:ce(V,r),type:p,onClick:$,"aria-label":l,"aria-description":E,ref:y,children:[a&&o.jsx(K,{className:"pkt-tag__icon",name:a}),o.jsx("span",{ref:C,children:s}),o.jsx(K,{className:"pkt-tag__close-btn",name:"close"})]}):o.jsxs("span",{...v,className:ce(T,r),ref:y,children:[a&&o.jsx(K,{className:"pkt-tag__icon",name:a,"aria-hidden":"true"}),o.jsx("span",{ref:C,children:s})]})});dn.displayName="PktTag";const yf=({dates:s,dateformat:e,idBase:t,strings:i,onDateRemoved:n})=>{var l;const r=Up(s),a=((l=i==null?void 0:i.calendar)==null?void 0:l.buttonAltText)??"Slett dato";return o.jsx("div",{className:"pkt-date-tags pkt-datepicker__tags","aria-live":"polite",children:r.map(d=>{const p=Ip(d,e);return o.jsx(dn,{id:`${t}${d}-tag`,closeTag:!0,ariaLabel:`${a} ${p}`,onClose:()=>n(d),children:o.jsx("time",{dateTime:d,children:p})},d)})})},kf=({state:s})=>{var Ge,rt,xe,Se;const{id:e,inputId:t,values:i,dateformat:n,multiple:r,range:a,showRangeLabels:l,disabled:d,readOnly:p,required:m,label:v,name:y,placeholder:k,hasError:g,helptext:$,minStr:C,maxStr:M,inputType:S,isIOSDevice:E,strings:T,inputClasses:V,buttonClasses:G,rangeLabelClasses:ie,datepickerInputsClasses:we,isInputDisabled:D,inputRef:N,inputRefTo:j,btnRef:J,toggleCalendar:X,handleFocus:ne,handleSingleInputChange:ae,handleRangeFromChange:pe,handleRangeToChange:oe,handleRangeBlur:ve,handleMultipleBlur:z,handleTagRemoved:Y,handleSingleKeydown:Ee,handleRangeFromKeydown:le,handleRangeToKeydown:re,handleMultipleKeydown:Ke,restProps:He}=s,Ne=()=>{var Pe,Ve;return o.jsxs("button",{ref:J,className:G,type:"button",onClick:X,disabled:d,"aria-label":((Pe=T.calendar)==null?void 0:Pe.buttonAltText)??"Åpne kalender",children:[o.jsx(K,{name:"calendar"}),o.jsx("span",{className:"pkt-btn__text",children:((Ve=T.calendar)==null?void 0:Ve.buttonAltText)??"Åpne kalender"})]})};return r?o.jsxs(o.Fragment,{children:[o.jsx(yf,{dates:i,dateformat:n,idBase:e,strings:T,onDateRemoved:Y}),o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...He,ref:N,className:V,type:S,id:t,name:y??e,placeholder:k,readOnly:p||E&&!p,disabled:D,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:X,onKeyDown:Ke,onFocus:ne,onBlur:z}),Ne()]})})]}):a?o.jsx("div",{className:we,children:o.jsxs("div",{className:"pkt-input__container",children:[l&&o.jsx("div",{className:"pkt-input-prefix",children:((Ge=T.generic)==null?void 0:Ge.from)??"Fra"}),o.jsx("input",{...He,ref:N,className:V,type:S,id:t,name:y?`${y}-from`:`${e}-from`,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||E&&!p,disabled:d,required:m,"aria-label":`${v} ${((rt=T.generic)==null?void 0:rt.from)??"Fra"}`,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:X,onKeyDown:le,onFocus:ne,onBlur:ve,onChange:pe}),o.jsx("div",{className:ie,id:`${e}-to-label`,children:((xe=T.generic)==null?void 0:xe.to)??"Til"}),!l&&o.jsx("div",{className:"pkt-input-separator",children:"–"}),o.jsx("input",{ref:j,className:V,type:S,id:`${e}-to`,name:y?`${y}-to`:`${e}-to`,value:i[1]??"",min:C,max:M,readOnly:p||E&&!p,disabled:d,"aria-label":`${v} ${((Se=T.generic)==null?void 0:Se.to)??"Til"}`,"aria-invalid":g,onClick:X,onKeyDown:re,onFocus:ne,onBlur:ve,onChange:oe}),Ne()]})}):o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...He,ref:N,className:V,type:S,id:t,name:y??e,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||E&&!p,disabled:d,required:m,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:X,onKeyDown:Ee,onFocus:ne,onBlur:void 0,onChange:ae}),Ne()]})})},_f={calendar:{buttonAltText:"Åpne kalender"}},$f={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}},oo=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[];function wf(s,e){const{id:t,label:i,value:n,defaultValue:r,dateformat:a="dd.MM.yyyy",multiple:l=!1,maxlength:d,range:p=!1,showRangeLabels:m=!1,weeknumbers:v=!1,withcontrols:y=!1,excludedates:k,excludeweekdays:g,currentmonth:$,today:C,calendarOpen:M,timezone:S,fullwidth:E=!1,hasFieldset:T=!1,inline:V=!1,helptext:G,helptextDropdown:ie,helptextDropdownButton:we,hasError:D=!1,errorMessage:N,optionalTag:j=!1,optionalText:J,requiredTag:X=!1,requiredText:ne,tagText:ae,useWrapper:pe=!0,strings:oe,disabled:ve=!1,readOnly:z=!1,required:Y=!1,name:Ee,min:le,max:re,placeholder:Ke,onChange:He,onValueChange:Ne,className:Ge,...rt}=s,xe=h.useCallback(O=>O===void 0?[]:oo(O),[]),Se=n!==void 0,Pe=typeof r=="number"?void 0:r,[Ve,at]=h.useState(()=>xe(n??Pe)),be=Se?xe(n):Ve;h.useEffect(()=>{Se&&at(xe(n))},[n,Se,xe]);const[ke,W]=h.useState(M??!1);h.useEffect(()=>{M!==void 0&&W(M)},[M]);const de=h.useRef(null),Z=h.useRef(null),te=h.useRef(null),ut=h.useRef(null),Be=h.useRef(null),Ue=h.useMemo(()=>uf(),[]),yt=h.useMemo(()=>ao(),[]),Wt=h.useMemo(()=>oe??(p?$f:_f),[oe,p]),f=typeof le=="string"?le:le!==void 0?String(le):void 0,u=typeof re=="string"?re:re!==void 0?String(re):void 0,_=h.useMemo(()=>{const O=pf(E,m,l,p,z,Ue);return Object.entries(O).filter(([,P])=>P).map(([P])=>P).join(" ")},[E,m,l,p,z,Ue]),x=h.useMemo(()=>{const O=ff();return Object.entries(O).filter(([,P])=>P).map(([P])=>P).join(" ")},[]),B=h.useMemo(()=>{const O=mf(m);return Object.entries(O).filter(([,P])=>P).map(([P])=>P).join(" ")},[m]),U=h.useMemo(()=>["pkt-datepicker__inputs",p&&m&&"pkt-input__range-inputs"].filter(Boolean).join(" "),[p,m]),ee=h.useMemo(()=>{if($)return $;if(u)return u.slice(0,7)},[$,u]),ht=ve||l&&d!=null&&be.length>=d,Xe=l&&d!=null,pt=`${t}-input`,ls=be.join(",");h.useEffect(()=>{te.current&&(te.current.value=ls)},[ls]),h.useEffect(()=>{S&&typeof window<"u"&&S!==window.pktTz&&(window.pktTz=S)},[S]);const Je=h.useCallback((O,P=!0)=>{Se||at(O),P&&(Ne==null||Ne(O))},[Se,Ne]),cr=h.useMemo(()=>{var O;return(O=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:O.set},[]),kt=h.useCallback(O=>{const P=te.current;!P||!cr||(cr.call(P,O.join(",")),P.dispatchEvent(new Event("input",{bubbles:!0})))},[cr]),Zt=h.useCallback(()=>{ve||W(O=>!O)},[ve]),cs=h.useCallback(()=>{W(!1)},[]);h.useEffect(()=>{if(!ke)return;const O=Re=>{var vn;const Qe=Re.target;Be.current&&!Be.current.contains(Qe)&&!((vn=Qe.closest)!=null&&vn.call(Qe,".pkt-calendar-popup"))&&cs()},P=Re=>{var Qe;Re.key==="Escape"&&(cs(),(Qe=de.current)==null||Qe.focus())};return document.addEventListener("click",O,!0),document.addEventListener("keydown",P),()=>{document.removeEventListener("click",O,!0),document.removeEventListener("keydown",P)}},[ke,cs]);const Vm=h.useCallback(()=>{yt&&!ke&&W(!0)},[yt,ke]),Um=h.useCallback(O=>{var Qe;const P=gf(O,l,p),Re=oo(P);Je(Re),kt(Re),!l&&!p&&(cs(),(Qe=de.current)==null||Qe.focus())},[l,p,Je,kt,cs]),jm=h.useCallback(()=>{var O;cs(),(O=de.current)==null||O.focus()},[cs]),qm=h.useCallback(O=>{const P=O.target.value,Re=P?[P]:[];Je(Re),kt(Re)},[Je,kt]),Wm=h.useCallback(O=>{const P=O.target.value,Re=be[1]??"",Qe=[P,Re].filter(Boolean);Je(Qe),kt(Qe)},[be,Je,kt]),zm=h.useCallback(O=>{const P=be[0]??"",Re=O.target.value,Qe=[P,Re].filter(Boolean);Je(Qe),kt(Qe)},[be,Je,kt]),Ym=h.useCallback(()=>{be.length===2&&!hf(be)&&(Je([be[0]]),kt([be[0]]))},[be,Je,kt]),gn=h.useCallback(O=>{const P=Qt(O),Re=f?Qt(f):null,Qe=u?Qt(u):null;if(P&&!isNaN(P.getTime())&&(!Re||P>=Re)&&(!Qe||P<=Qe)){const vn=Vp([...be,O],f,u,k,g),Ho=[...new Set(vn)];Je(Ho),kt(Ho)}},[be,f,u,k,g,Je,kt]),Km=h.useCallback(O=>{const P=O.target;P.value&&(gn(P.value.split(",")[0]),P.value="")},[gn]),Fo=h.useCallback(O=>{const P=O.target;P.value&&(gn(P.value.split(",")[0]),P.value="")},[gn]),Gm=h.useCallback(O=>{const P=be.filter(Re=>Re!==O);Je(P),kt(P)},[be,Je,kt]),ds=h.useCallback(O=>{const P=O==null?void 0:O.closest("form");P?P.requestSubmit():O==null||O.blur()},[]),Xm=h.useCallback(O=>{cn(O.nativeEvent,()=>Zt(),()=>ds(de.current),void 0,()=>{var P;return(P=de.current)==null?void 0:P.blur()})},[Zt,ds]),Qm=h.useCallback(O=>{cn(O.nativeEvent,()=>Zt(),()=>ds(de.current),()=>{var P;return(P=Z.current)==null?void 0:P.focus()},()=>{var P;return(P=de.current)==null?void 0:P.blur()})},[Zt,ds]),Zm=h.useCallback(O=>{cn(O.nativeEvent,()=>Zt(),()=>ds(Z.current),void 0,()=>{var P;return(P=Z.current)==null?void 0:P.blur()})},[Zt,ds]),Jm=h.useCallback(O=>{cn(O.nativeEvent,()=>Zt(),()=>ds(de.current),void 0,()=>{var P;return(P=de.current)==null?void 0:P.blur()},Fo)},[Zt,ds,Fo]);return h.useImperativeHandle(e,()=>({get value(){var O;return((O=te.current)==null?void 0:O.value)??""},set value(O){const P=O?O.split(",").filter(Boolean):[];at(P),te.current&&(te.current.value=O??"")},focus(){var O;(O=de.current)==null||O.focus()},blur(){var O;(O=de.current)==null||O.blur()}}),[]),{id:t,inputId:pt,label:i,values:be,calendarOpen:ke,dateformat:a,multiple:l,maxlength:d,range:p,showRangeLabels:m,weeknumbers:v,withcontrols:y,excludedates:k,excludeweekdays:g,disabled:ve,readOnly:z,required:Y,name:Ee,placeholder:Ke,fullwidth:E,hasFieldset:T,inline:V,helptext:G,helptextDropdown:ie,helptextDropdownButton:we,hasError:D,errorMessage:N,optionalTag:j,optionalText:J,requiredTag:X,requiredText:ne,tagText:ae,useWrapper:pe,className:Ge,minStr:f,maxStr:u,effectiveCurrentMonth:ee,today:C,inputType:Ue,isIOSDevice:yt,strings:Wt,inputClasses:_,buttonClasses:x,rangeLabelClasses:B,datepickerInputsClasses:U,isInputDisabled:ht,hasCounter:Xe,inputRef:de,inputRefTo:Z,changeInputRef:te,btnRef:ut,wrapperRef:Be,onChange:He,toggleCalendar:Zt,hideCalendar:cs,handleDateSelected:Um,handleCalendarClose:jm,handleFocus:Vm,handleSingleInputChange:qm,handleRangeFromChange:Wm,handleRangeToChange:zm,handleRangeBlur:Ym,handleMultipleBlur:Km,handleTagRemoved:Gm,handleSingleKeydown:Xm,handleRangeFromKeydown:Qm,handleRangeToKeydown:Zm,handleMultipleKeydown:Jm,restProps:rt}}const lo=h.forwardRef((s,e)=>{const t=wf(s,e),i=["pkt-datepicker",t.className].filter(Boolean).join(" ");return o.jsxs("div",{className:i,children:[o.jsx(Os,{ref:t.wrapperRef,forId:t.inputId,label:t.label,hasFieldset:t.hasFieldset,inline:t.inline,helptext:t.helptext,helptextDropdown:t.helptextDropdown,helptextDropdownButton:t.helptextDropdownButton,hasError:t.hasError,errorMessage:t.errorMessage,disabled:t.disabled,optionalTag:t.optionalTag,optionalText:t.optionalText,requiredTag:t.requiredTag,requiredText:t.requiredText,tagText:t.tagText,useWrapper:t.useWrapper,counter:t.hasCounter,counterCurrent:t.values.length,counterMaxLength:t.maxlength,children:o.jsx(kf,{state:t})}),o.jsx(bf,{open:t.calendarOpen,multiple:t.multiple,range:t.range,weeknumbers:t.weeknumbers,withcontrols:t.withcontrols,selected:t.values,earliest:t.minStr,latest:t.maxStr,excludedates:t.excludedates,excludeweekdays:t.excludeweekdays,maxMultiple:t.maxlength,currentmonth:t.effectiveCurrentMonth,today:t.today,inputRef:t.inputRef,hasCounter:t.hasCounter,onDateSelected:t.handleDateSelected,onClose:t.handleCalendarClose}),o.jsx("input",{ref:t.changeInputRef,type:"text",name:t.name,onChange:t.onChange,tabIndex:-1,"aria-hidden":"true",className:"pkt-visually-hidden"})]})});lo.displayName="PktDatepicker";const xf={dropFilesHere:"Slipp filene her ...",selectOrDragFiles:"Dra filer hit for å laste dem opp eller ",chooseFiles:"velg filer"},Sf={dropFilesHere:"Slipp filen her ...",selectOrDragFiles:"Dra en fil for å laste den opp eller ",chooseFiles:"velg en fil"},Cf={dropFilesHere:"Slipp bildene her ...",selectOrDragFiles:"Dra bilder hit for å laste dem opp eller ",chooseFiles:"velg fra kamerarull"},Tf={dropFilesHere:"Slipp bildet her ...",selectOrDragFiles:"Dra et bilde for å laste det opp eller ",chooseFiles:"velg fra kamerarull"},co=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Nf=()=>{const s=co(),e=co();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)};class Mf{constructor(e,t){bn(this,"fileId");bn(this,"file");bn(this,"attributes",{});this.fileId=t||Nf(),this.file=e,this.attributes={targetFilename:e.name}}}const tr=h.createContext({}),Df=h.forwardRef(({id:s,multiple:e,value:t,onFilesAdded:i=()=>{},name:n,uploadStrategy:r,accept:a=".pdf, .jpeg, .jpg, .png, .heic, .doc, .docx, .odt",isThumbnailView:l=!1,disabled:d=!1,srAnnouncementIds:p,...m},v)=>{const y=h.useRef(null),k=h.useMemo(()=>((a==null?void 0:a.split(/\s*,\s*/).map(D=>D.trim()))||[]).join(", ").toUpperCase(),[a]);h.useImperativeHandle(v,()=>y.current);const[g,$]=h.useState(!1),C=h.useMemo(()=>l?e?Cf:Tf:e?xf:Sf,[e,l]),M=h.useCallback(D=>{if(y.current)try{y.current.files=Of(D)}catch{}},[y.current,t]);h.useEffect(()=>{M(t)},[y,t]);const S=h.useCallback(D=>{const N=D.map(j=>new Mf(j));i(N),y.current&&(y.current.value="")},[i]),E=D=>{const N=D.target.files;if(N.length===0){e&&M(t);return}S(Array.from(N))},T=D=>{S(D)},V=D=>{if(D.preventDefault(),$(!1),d)return;const N=D.dataTransfer.files,j=Array.from(N);T(j)},G=D=>{D.preventDefault(),!d&&$(!0)},ie=()=>{$(!1)},we=h.useCallback(D=>{var j;d||D.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog")||(j=y.current)==null||j.click()},[d]);return o.jsxs("div",{onDrop:V,onDragOver:G,onDragLeave:ie,onClick:we,className:ce("pkt-fileupload__drop-zone",{"pkt-fileupload__drop-zone--drag-active":g,"pkt-fileupload__drop-zone--disabled":d}),children:[o.jsx("input",{...m,id:s,type:"file",ref:y,multiple:e,onChange:E,accept:a,disabled:d,name:r==="form"&&n||void 0,"aria-label":e?"Velg filer":"Velg fil"}),r==="custom"&&o.jsx(o.Fragment,{children:t==null?void 0:t.map(D=>o.jsx("input",{type:"hidden",name:n,value:D.fileId},D.fileId))}),o.jsxs("div",{className:"pkt-fileupload__drop-zone__placeholder",children:[o.jsx(K,{name:"attachment",className:"pkt-fileupload__drop-zone__placeholder__icon","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__drop-zone__placeholder__title",children:g?`${C.dropFilesHere} ...`:o.jsxs(o.Fragment,{children:[C.selectOrDragFiles," ",o.jsx("button",{className:"pkt-fileupload__drop-zone__placeholder__title__open-file-dialog",onClick:D=>{var N;D.preventDefault(),D.stopPropagation(),(N=y.current)==null||N.click()},type:"button",children:C.chooseFiles})]})}),o.jsxs("p",{className:"pkt-fileupload__drop-zone__placeholder__formats",children:["Format: ",k]})]})]})}),Of=s=>{const e=new DataTransfer;for(const t of s)e.items.add(t.file);return e.files},sr=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,counter:i,counterMaxLength:n,className:r,disabled:a,errorMessage:l,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,fullwidth:k=!1,label:g,name:$,optionalTag:C=!1,optionalText:M,requiredTag:S=!1,requiredText:E,tagText:T=null,placeholder:V,rows:G,useWrapper:ie=!0,onChange:we,value:D,autoComplete:N="off",minLength:j,maxLength:J,readOnly:X,skipForwardTestid:ne=!1,...ae},pe)=>{const oe=[r,"pkt-textinput","pkt-textarea"].join(" "),ve=`${s}-input`,z=`${ve}-label`,Y=t||z,[Ee,le]=h.useState(0),re=Ke=>{var He,Ne;i&&le(((Ne=(He=Ke.currentTarget)==null?void 0:He.value)==null?void 0:Ne.length)||0),we&&we(Ke)};return h.useEffect(()=>{D!==void 0&&le((D==null?void 0:D.length)||0)},[D]),o.jsx(Os,{ariaDescribedby:e,className:oe,disabled:a,errorMessage:l,forId:ve,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,label:g,optionalTag:C,optionalText:M,requiredTag:S,requiredText:E,tagText:T,useWrapper:ie,counter:i,counterCurrent:Ee,counterMaxLength:n,children:o.jsx("textarea",{ref:pe,className:`pkt-input ${k?"pkt-input--fullwidth":""} ${n&&Ee>n?"pkt-input--counter-error":""}`,name:`${$||s}`,id:ve,placeholder:V,disabled:a,rows:G,"aria-labelledby":Y,"aria-invalid":d,"aria-errormessage":`${s}-error`,...ae,onChange:re,value:D,autoComplete:N,minLength:j,maxLength:J,readOnly:X,"data-skip-forward-testid":ne?"true":void 0})})});sr.displayName="PktTextarea";const Ef=Symbol("comment"),Pf=s=>{const e=String(s.getDate()).padStart(2,"0"),t=String(s.getMonth()+1).padStart(2,"0"),i=s.getFullYear(),n=String(s.getHours()).padStart(2,"0"),r=String(s.getMinutes()).padStart(2,"0");return`${e}.${t}.${i} kl. ${n}:${r}`},Af=({fileItem:s,closeOperationUi:e,onAddComment:t,existingComment:i})=>{const n=h.useRef(null),r=!!i,a=()=>{var d,p;const l=(p=(d=n.current)==null?void 0:d.value)==null?void 0:p.trim();l&&t({text:l,timestamp:new Date}),e()};return h.useLayoutEffect(()=>{const l=setTimeout(()=>{var d;return(d=n.current)==null?void 0:d.focus({preventScroll:!0})},0);return()=>clearTimeout(l)},[s.fileId]),o.jsxs(o.Fragment,{children:[o.jsx(sr,{autoFocus:!0,label:r?"Rediger kommentar":"Legg til kommentar",name:`comment-${s.fileId}`,className:"pkt-fileupload__queue-display__item__comment-input",placeholder:"Skriv inn kommentar",rows:2,id:`comment-${s.fileId}`,ref:n,defaultValue:i==null?void 0:i.text}),o.jsx(it,{skin:"secondary",size:"small",onClick:a,children:r?"Lagre kommentar":"Legg til kommentar"}),o.jsx(it,{skin:"tertiary",size:"small",onClick:e,children:"Avbryt"})]})},If=({comments:s,onDeleteComment:e,onEditComment:t})=>s&&s.length>0?o.jsx("div",{className:"pkt-fileupload__queue-display__item__comments",children:s.map((i,n)=>o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment",children:[o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__content",children:[o.jsx("span",{className:"pkt-fileupload__queue-display__item__comment__text","aria-label":"Kommentar tekst",children:i.text}),o.jsx("time",{className:"pkt-fileupload__queue-display__item__comment__time",children:Pf(i.timestamp)})]}),o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__actions",children:[e&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>e(n),"aria-label":"Slett kommentar",children:o.jsx(K,{name:"trash-can"})}),t&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>t(n),"aria-label":"Rediger kommentar",children:o.jsx(K,{name:"edit"})})]})]},n))}):null,Lf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-comments`,value:s.comments?JSON.stringify(s.comments):""})},Bf=s=>{const e=s("comments"),t=(n,r)=>{e.set(n,[r])},i=(n,r)=>{const l=(e.get(n)||[]).filter((d,p)=>p!==r);e.set(n,l.length>0?l:void 0)};return{title:n=>{const r=e.get(n.fileId);return r&&r.length>0?"":"Legg til kommentar"},renderExtendedUI:(n,r)=>{const a=e.get(n.fileId),l=a==null?void 0:a[0];return o.jsx(Af,{fileItem:n,closeOperationUi:r,onAddComment:d=>t(n.fileId,d),existingComment:l})},renderContent:(n,r,a)=>{if(a)return null;const l=e.get(n.fileId);return o.jsx(If,{comments:l,onDeleteComment:d=>i(n.fileId,d),onEditComment:r?()=>r():void 0})},renderHidden:n=>o.jsx(Lf,{comments:e.get(n.fileId)},`comments${n.fileId}`),symbol:Ef}},Ff=Symbol("deleteFile"),Hf=s=>({title:"Slett",ariaLabel:"Slett fil",onClick:e=>s(e.fileId),symbol:Ff}),Vf=Symbol("renameFile"),Uf=s=>{const e=h.useRef(null),t=h.useId(),i=()=>{var n;s.onSave(((n=e.current)==null?void 0:n.value)??"")};return o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:t,className:"pkt-sr-only",children:"Endre filnavn"}),o.jsx("input",{id:t,ref:e,type:"text",autoFocus:!0,defaultValue:s.value,className:"pkt-fileupload__queue-display__item__rename-input",onKeyDown:n=>{n.key==="Enter"&&(n.preventDefault(),n.stopPropagation(),i()),n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),s.onCancel())}}),o.jsx(it,{skin:"secondary",size:"small",onClick:()=>s.onSave(e.current.value),children:"Lagre"}),o.jsx(it,{skin:"tertiary",size:"small",onClick:s.onCancel,children:"Avbryt"})]})},jf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-targetFilename`,value:s.targetFilename})},qf=s=>{const e=s("targetFilename");return{title:"Rediger",ariaLabel:"Rediger filnavn",renderInlineUI:(t,i)=>o.jsx(Uf,{value:e.get(t.fileId)||void 0,onSave:n=>{e.set(t.fileId,n),i()},onCancel:i}),renderHidden:t=>o.jsx(jf,{targetFilename:e.get(t.fileId)||t.file.name},`rename${t.fileId}`),symbol:Vf}},Wf=(s,e)=>{const t=h.useCallback((r,a,l)=>{const d=s.find(m=>m.fileId===r),p=d.attributes||{};d.attributes={...p,[a]:l},e(r,{attributes:d.attributes})},[e,s]),i=h.useCallback((r,a)=>(s.find(p=>p.fileId===r).attributes||{})[a],[s]);return{fileAttributes:h.useCallback(r=>({get:a=>i(a,r),set:(a,l)=>{t(a,r,l)}}),[i,t])}},zf=s=>{const[e,t]=h.useState(!1),[i,n]=h.useState(0),r=h.useRef(null),a=h.useCallback(p=>{var v;const m=s.findIndex(y=>y.fileId===p);m>=0&&(n(m),t(!0),(v=r.current)==null||v.showModal())},[s]),l=h.useCallback(()=>{var p;t(!1),(p=r.current)==null||p.close()},[]),d=h.useCallback(p=>{s.length!==0&&n(m=>p==="prev"?m<=0?s.length-1:m-1:m>=s.length-1?0:m+1)},[s.length]);return{isOpen:e,currentIndex:i,modalRef:r,open:a,close:l,navigate:d}},Yf=s=>{const[e,t]=h.useState({}),i=h.useCallback(a=>{const l=e[a];if(l)return s.find(d=>d.symbol===l)},[e,s]),n=h.useCallback((a,l)=>{t(d=>({...d,[a]:l.symbol}))},[]),r=h.useCallback(a=>{t(l=>{const d={...l};return delete d[a],d})},[]);return{getActivated:i,activate:n,close:r}},Kf=At({tagName:"pkt-modal",elementClass:wt,react:h,displayName:"PktModal",events:{}}),ir=h.forwardRef(({children:s,...e},t)=>o.jsx(Kf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ir.displayName="PktModal";const uo=2,Gf=s=>{const e=window.getComputedStyle(s),t=parseFloat(e.lineHeight);if(!Number.isNaN(t)&&t>0)return t;const i=parseFloat(e.fontSize);return(!Number.isNaN(i)&&i>0?i:16)*1.2},Xf=(s,e,t)=>{const i=e*t;return s.getBoundingClientRect().height>i+.5},ho=h.createContext({tail:5}),Ai=({children:s,tail:e,...t})=>{const i=s,n=h.useContext(ho),r=e!==void 0?e:n.tail||0,a=s.length<=r+3?null:s.slice(-r),l=h.useRef(null),d=h.useRef(null),[p,m]=h.useState(!1),v=h.useCallback(()=>{const k=l.current,g=d.current;if(!k||!g)return;const $=Gf(k);m(Xf(g,$,uo))},[]),y=h.useMemo(()=>new ResizeObserver(k=>{k.some(g=>g.target===l.current)&&v()}),[v]);return h.useLayoutEffect(()=>(l.current&&y.observe(l.current),v(),()=>y.disconnect()),[s,y,v]),o.jsxs("span",{ref:l,...t,"data-pkt-truncate-part":"wrapper",style:{maxWidth:"100%",width:"100%",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"end",columnGap:"0.25rem",overflow:"hidden",position:"relative",...t.style},children:[o.jsx("span",{"data-pkt-truncate-part":"first",style:{minWidth:0,display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:uo,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",overflowWrap:"anywhere"},children:i}),r!==0&&o.jsx("span",{"data-pkt-truncate-part":"tail",style:{whiteSpace:"nowrap",display:p?"inline":"none",paddingRight:"0.5rem"},"aria-hidden":!0,children:a}),o.jsx("span",{ref:d,"aria-hidden":!0,"data-pkt-truncate-part":"measure",style:{position:"absolute",top:0,left:0,width:"100%",visibility:"hidden",pointerEvents:"none",whiteSpace:"normal",overflowWrap:"anywhere"},children:s})]})},Qf=s=>{if(typeof s=="number")return s;const e=s.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!e)return console.warn(`PktFileUpload: Invalid maxFileSize format "${s}". Use format like "5MB", "500KB", or a number in bytes.`),0;const t=parseFloat(e[1]);switch(e[2].toUpperCase()){case"B":return t;case"KB":return t*1024;case"MB":return t*1024*1024;case"GB":return t*1024*1024*1024;default:return t}},un=s=>s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:s<1024*1024*1024?`${Math.round(s/(1024*1024))} MB`:`${Math.round(s/(1024*1024*1024))} GB`,nr=s=>o.jsx("button",{onClick:s.onClick,className:"pkt-fileupload__queue-display__item__cancel-button","aria-label":s.ariaLabel||"Avbryt opplasting",children:s.label||"Avbryt"}),Zf=()=>{const[s,e]=h.useState(1);return h.useEffect(()=>{const t=setInterval(()=>{e(i=>i>=3?1:i+1)},400);return()=>clearInterval(t)},[]),o.jsxs("span",{className:"pkt-fileupload__queue-display__item__loading-text","aria-label":"Laster opp fil",children:["Laster opp",".".repeat(s)]})},Jf=({cancelTransfer:s,transferItem:e})=>{const t=e.showProgress??e.progress!==0;return o.jsxs(o.Fragment,{children:[o.jsx(K,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title","aria-label":"Filnavn",children:o.jsx(Ai,{children:e.attributes.targetFilename})}),o.jsx(nr,{onClick:s}),t?o.jsxs(o.Fragment,{children:[o.jsx(mn,{valueCurrent:e.progress*100,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(e.file.size)}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__percentage","aria-hidden":"true",children:`${Math.round(e.progress*100)}%`})]}):o.jsx(Zf,{})]})},Rf=({transferItem:s,onRemove:e})=>{const t=(s.lastProgress??1)*100;return o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx(nr,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),o.jsx(mn,{valueCurrent:t,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(s.file.size)}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]})},em=({transferItem:s,onRemove:e})=>o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx(nr,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]}),tm=({transferItem:s,onRemove:e})=>s.showProgress?o.jsx(Rf,{transferItem:s,onRemove:e}):o.jsx(em,{transferItem:s,onRemove:e}),sm=({operation:s,onActivate:e,transferItem:t})=>{const i=typeof s.title=="function"?s.title(t):s.title;if(!i)return null;const n=()=>{(s.renderInlineUI||s.renderExtendedUI)&&e(t.fileId,s),s.onClick&&s.onClick(t)};return o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__operation",onClick:n,"aria-label":typeof s.ariaLabel=="function"?s.ariaLabel(t):s.ariaLabel,children:i})},po=({transferItem:s})=>o.jsxs(o.Fragment,{children:[o.jsx(K,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(s.file.size)})]}),im=({transferItem:s,onPreviewClick:e})=>{const[t,i]=h.useState(null),n=s.file;h.useEffect(()=>{if(n.type.startsWith("image/")){const l=URL.createObjectURL(n);return i(l),()=>{URL.revokeObjectURL(l)}}},[n]);const r=t&&o.jsx("img",{src:t,alt:s.attributes.targetFilename})||o.jsx(K,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"}),a=!!e;return o.jsxs("div",{className:"pkt-fileupload__queue-display__item__thumbnail",children:[o.jsxs(it,{className:"pkt-fileupload__queue-display__item__thumbnail__image-wrapper","aria-label":`Forhåndsvis bilde ${s.attributes.targetFilename}`,type:"button",skin:"secondary",onClick:e,children:[a&&o.jsx(K,{name:"expand",className:"pkt-fileupload__queue-display__item__thumbnail__expand-icon","aria-hidden":"true"}),r]}),o.jsx(Ai,{className:"pkt-fileupload__queue-display__item__thumbnail__title",children:s.attributes.targetFilename})]})},fo=h.forwardRef(({isOpen:s,images:e,currentIndex:t,onClose:i,onNavigate:n},r)=>{const[a,l]=h.useState(null),d=e[t],p=e.length>1;return h.useEffect(()=>{if(d&&d.file.type.startsWith("image/")){const m=URL.createObjectURL(d.file);return l(m),()=>URL.revokeObjectURL(m)}l(null)},[d]),h.useEffect(()=>{if(!s)return;const m=v=>{switch(v.key){case"ArrowLeft":v.preventDefault(),n("prev");break;case"ArrowRight":v.preventDefault(),n("next");break;case"Escape":v.preventDefault(),i();break}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[s,n,i]),d?o.jsx(ir,{ref:r,headingText:d.attributes.targetFilename,closeOnBackdropClick:!0,className:"pkt-fileupload__image-preview-modal",children:o.jsxs("div",{className:"pkt-fileupload__image-preview",children:[p&&o.jsx(it,{variant:"icon-only",iconName:"chevron-thin-left",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev",onClick:()=>n("prev"),"aria-label":`Forrige bilde ${t} / ${e.length}`}),o.jsx("div",{className:"pkt-fileupload__image-preview__content",children:a&&o.jsx("img",{src:a,alt:`${d.attributes.targetFilename} - ${t+1} av ${e.length}`,className:"pkt-fileupload__image-preview__image"})}),p&&o.jsxs("span",{className:"pkt-fileupload__image-preview__counter",children:[t+1," / ",e.length]}),p&&o.jsx(it,{variant:"icon-only",iconName:"chevron-thin-right",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next",onClick:()=>n("next"),"aria-label":`Neste bilde ${t+2} / ${e.length}`})]})}):null});fo.displayName="ImagePreviewModal";const rr=s=>typeof s=="number"?"in-progress":s==="error"?"error":"idle",nm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__actions",children:s.filter(n=>!e||n.symbol!==e.symbol).map(n=>o.jsx(sm,{operation:n,onActivate:t,transferItem:i},n.symbol.toString()))}),rm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx(o.Fragment,{children:s.filter(n=>n.renderContent).map(n=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__operation-content",children:n.renderContent(i,()=>t(i.fileId,n),(e==null?void 0:e.symbol)===n.symbol)},n.symbol.toString()))}),am=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:n,onClose:r,onPreviewClick:a})=>{const l=()=>r(s.fileId),p=(e==null?void 0:e.renderInlineUI)||(e==null?void 0:e.renderExtendedUI)?[]:t;return o.jsxs(o.Fragment,{children:[e!=null&&e.renderInlineUI?o.jsxs(o.Fragment,{children:[o.jsx(K,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon"}),o.jsx("div",{className:"pkt-fileupload__queue-display__item__inline-ui",children:e.renderInlineUI(s,l)})]}):o.jsx(i,{transferItem:s,queueItemOperations:t,onPreviewClick:a}),p.length>0&&o.jsx(nm,{operations:p,activatedOperation:e,onActivate:n,transferItem:s}),o.jsx(rm,{operations:t,activatedOperation:e,onActivate:n,transferItem:s}),(e==null?void 0:e.renderExtendedUI)&&o.jsx("div",{className:"pkt-fileupload__queue-display__item__expanded-operation-ui",children:e.renderExtendedUI(s,l)})]})},om=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,enableImagePreview:n,onActivate:r,onClose:a,onCancelTransfer:l,onOpenPreview:d})=>{const p=rr(s.progress),m=n&&s.progress==="done"&&s.file.type.startsWith("image/");switch(p){case"in-progress":return o.jsx(Jf,{"aria-live":"off",transferItem:s,cancelTransfer:()=>l(s.fileId)});case"error":return o.jsx(tm,{transferItem:s,onRemove:()=>l(s.fileId)});case"idle":return o.jsx(am,{transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:r,onClose:a,onPreviewClick:m?()=>d(s.fileId):void 0})}},lm=(s,e)=>h.useMemo(()=>{const t=s.map(n=>{const r=e.find(a=>a.fileId===n.fileId);return{...n,progress:(r==null?void 0:r.progress)??"queued",errorMessage:r==null?void 0:r.errorMessage,showProgress:r==null?void 0:r.showProgress,lastProgress:r==null?void 0:r.lastProgress}}),i={"in-progress":0,error:1,idle:2};return t.sort((n,r)=>i[rr(n.progress)]-i[rr(r.progress)])},[s,e]),cm=(s,e)=>h.useMemo(()=>e?s.filter(t=>t.progress==="done"&&t.file.type.startsWith("image/")):[],[s,e]),dm=({files:s,cancelTransfer:e,transfers:t=[],queueItemOperations:i=[],ItemRenderer:n=po,truncateTail:r,enableImagePreview:a=!1})=>{const l=lm(s,t),d=cm(l,a),p=Yf(i),m=zf(d);return o.jsxs(o.Fragment,{children:[o.jsx("ul",{className:"pkt-fileupload__queue-display",children:o.jsx(ho.Provider,{value:{tail:r},children:l.map(v=>o.jsxs("li",{className:ce("pkt-fileupload__queue-display__item",{"pkt-fileupload__queue-display__item--in-progress":typeof v.progress=="number",[`pkt-fileupload__queue-display__item--${v.progress}`]:typeof v.progress=="string"}),children:[i.filter(y=>y.renderHidden).map(y=>y.renderHidden(v)),o.jsx(om,{transferItem:v,activatedOperation:p.getActivated(v.fileId),operations:i,ItemRenderer:n,enableImagePreview:a,onActivate:p.activate,onClose:p.close,onCancelTransfer:e,onOpenPreview:m.open})]},v.fileId))})}),a&&d.length>0&&o.jsx(fo,{ref:m.modalRef,isOpen:m.isOpen,images:d,currentIndex:m.currentIndex,onClose:m.close,onNavigate:m.navigate})]})},mo={filename:po,thumbnail:im},go=h.forwardRef(({value:s,defaultValue:e,id:t="fileupload-id",multiple:i=!1,uploadStrategy:n="form",addCommentsEnabled:r=!1,renameFilesEnabled:a=!1,truncateTail:l,onFilesChanged:d,onFileUploadRequested:p,extraOperations:m=[],itemRenderer:v=mo.filename,fullWidth:y=!1,allowedFormats:k,formatErrorMessage:g,maxFileSize:$,sizeErrorMessage:C,onFileValidation:M,errorMessage:S,hasError:E=!1,disabled:T=!1,label:V,helptext:G,optionalTag:ie,requiredTag:we,enableImagePreview:D=!1,...N},j)=>{const J="transfers"in N?N.transfers:void 0,[X,ne]=h.useState(null),ae=E||!!X,pe=S||X,oe=$?Qf($):void 0,ve=h.useCallback(W=>{var de;if(k&&k.length>0){const Z=((de=W.name.split(".").pop())==null?void 0:de.toLowerCase())||"",te=W.type.toLowerCase();if(!k.some(Be=>{const Ue=Be.toLowerCase().replace(/^\./,"");if(Ue.includes("/")){if(Ue.endsWith("/*")){const yt=Ue.replace("/*","");return te.startsWith(yt+"/")}return te===Ue}return Z===Ue})){const Be=k.join(", "),Ue=`Ugyldig filtype. Tillatte formater: ${Be}`;return(g==null?void 0:g.replace("{formats}",Be))||Ue}}if(oe&&W.size>oe){const Z=un(oe),te=`Filen er for stor. Maks størrelse er ${Z}.`;return(C==null?void 0:C.replace("{maxSize}",Z))||te}return M?M(W):null},[k,g,oe,C,M]);s!==void 0&&e!==void 0&&console.warn("PktFileupload: Både value og defaultValue er angitt. Komponenten kan være enten 'controlled' eller 'uncontrolled', ikke begge deler. Bruk kun én av dem. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable"),s!==void 0&&d===void 0&&console.warn("PktFileupload: value-prop er angitt uten onFilesChanged-callback. Når en komponent er 'controlled', må endringer håndteres via en callback. Vennligst legg til onFilesChanged-callback for å håndtere endringer i fil-listen. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable");const Y=s!==void 0?s:e||[],Ee=typeof v=="string"?mo[v]:v,le=v==="thumbnail",re=a&&!le,Ke=r&&!le,He=h.useCallback(W=>{for(const Z of W){const te=ve(Z.file);if(te){ne(te);return}}ne(null);const de=i?[...Y,...W]:[W[0]];d&&d(de),n==="custom"&&p&&W.forEach(Z=>{p==null||p(Z)})},[d,Y,i,n,p,ve]),Ne=h.useCallback((W,de)=>{const Z=Y.map(te=>te.fileId===W?{...te,...de}:te);d&&d(Z)},[d,Y]),Ge=h.useCallback(W=>{var Z;const de=Y.filter(te=>te.fileId!==W);d&&d(de),"onTransferCancelled"in N&&N.onTransferCancelled&&((Z=N.onTransferCancelled)==null||Z.call(N,W))},[d,Y,N]),{fileAttributes:rt}=Wf(Y,Ne),xe=h.useMemo(()=>[{op:qf,enabled:re},{op:W=>Bf(W),enabled:Ke}].filter(({enabled:W})=>W).map(({op:W})=>W).concat(...m),[re,Ke]),Se=h.useMemo(()=>({uploaded:`${t}-uploaded`,errors:`${t}-errors`}),[t]),{totalCount:Pe,uploadedCount:Ve,failedCount:at}=h.useMemo(()=>{const W=Y.length;if(!J)return{totalCount:W,uploadedCount:0,failedCount:0};let de=0,Z=0;for(const te of Y){const ut=J.find(Be=>Be.fileId===te.fileId);(ut==null?void 0:ut.progress)==="done"&&de++,(ut==null?void 0:ut.progress)==="error"&&Z++}return{totalCount:W,uploadedCount:de,failedCount:Z}},[Y,J]),be=Pe===1?"fil":"filer",ke=o.jsx("div",{className:ce("pkt-fileupload",{"pkt-fileupload--full-width":y,"pkt-fileupload--error":ae,"pkt-fileupload--disabled":T}),"aria-disabled":T,...T?{inert:""}:{},children:o.jsxs(tr.Provider,{value:{name:N.name||"",multiple:!!i,id:t},children:[o.jsx("div",{id:Se.uploaded,className:"pkt-sr-only","aria-live":"polite","aria-atomic":"true",children:Pe>0&&Ve>0&&`${Ve} av ${Pe} ${be} lastet opp`}),o.jsx("div",{id:Se.errors,className:"pkt-sr-only","aria-live":"assertive","aria-atomic":"true",children:Pe>0&&at>0&&`Feil ved opplasting: ${at} av ${Pe} ${be} feilet`}),o.jsx(Df,{id:t,name:N.name||"",value:Y,onFilesAdded:He,multiple:i,uploadStrategy:n,ref:j,accept:le?".jpeg, .jpg, .png, .gif, .webp, .heic":N.accept,isThumbnailView:le,disabled:T,srAnnouncementIds:Se}),ae&&pe&&o.jsx(rn,{skin:"error","aria-live":"assertive",role:"alert",compact:!0,className:"pkt-fileupload__error-alert",children:pe}),o.jsx(dm,{files:Y,cancelTransfer:Ge,truncateTail:l,transfers:J,ItemRenderer:Ee,enableImagePreview:le&&D,queueItemOperations:xe.map(W=>W(rt)).concat(Hf(Ge))})]})});return V?o.jsx(Os,{forId:t,label:V,helptext:G,disabled:T,hasError:ae,optionalTag:ie,requiredTag:we,className:"pkt-fileupload-wrapper",children:ke}):ke});go.displayName="PktFileUpload";const um=({columnOne:s,columnTwo:e,socialLinks:t,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:l=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:y=null,cookieExpiryDays:k=null,onToggleConsent:g=$=>{console.log($.detail)}})=>{var C,M;const $=[i,"pkt-footer"].filter(Boolean).join(" ");return o.jsx("footer",{className:$,"data-mode":"dark",children:o.jsxs("div",{className:"pkt-footer__container",children:[o.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:s.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&o.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((S,E)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${E}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:e.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&o.jsx("li",{className:"pkt-footer__text",children:e.text}),(M=e.links)==null?void 0:M.map((S,E)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${E}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),o.jsxs("ul",{className:"pkt-footer__list",children:[o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),l&&o.jsx("li",{className:"pkt-footer__list-item",children:o.jsx(ln,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:y,cookieExpiryDays:k,onToggleConsent:g})})]})]})]}),t&&o.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[o.jsx("div",{className:"pkt-footer__social-languages",children:t.filter(S=>S.language).map((S,E)=>o.jsx("div",{className:"pkt-footer__social-language",children:o.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${E}`))}),o.jsx("div",{className:"pkt-footer__social-icons",children:t.filter(S=>S.iconName).map((S,E)=>o.jsx(h.Fragment,{children:o.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:o.jsx(K,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${E}`))})]})]})})},hm=({links:s=[],openLinksInNewTab:e=!1,personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:r=null,googleAnalyticsId:a=null,devMode:l=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:v=k=>{console.log(k.detail)},className:y})=>{const k=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return o.jsx("footer",{className:k,"data-mode":"dark",children:o.jsx("div",{className:"pkt-footer-simple__container",children:o.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((g,$)=>o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:`pkt-footer-simple__link ${g.external?" pkt-link--external":""}`,href:g.href,target:g.openInNewTab||e?"_blank":"_self",rel:g.openInNewTab||e?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),g.text]})},$)),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:t,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsx(ln,{triggerType:"footerlink",hotjarId:r,googleAnalyticsId:a,devMode:l,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},pm=(s,e)=>{const t=()=>typeof window>"u"?0:window.innerWidth,[i,n]=h.useState(t);return h.useEffect(()=>{const r=s.current;if(!r)return;if(n(r.offsetWidth),typeof ResizeObserver>"u"){const l=()=>{r&&n(r.offsetWidth)};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}const a=new ResizeObserver(l=>{for(const d of l)d.borderBoxSize&&d.borderBoxSize.length>0?n(d.borderBoxSize[0].inlineSize):n(d.contentRect.width)});return a.observe(r),()=>{a.disconnect()}},[s]),i};function fm(s){const e=h.useRef(0);h.useEffect(()=>{const t=document.body,i=document.documentElement;if(s){e.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(t.style.paddingRight=`${n}px`),t.style.position="fixed",t.style.top=`-${e.current}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",i.classList.add("is-scroll-locked")}else t.style.removeProperty("position"),t.style.removeProperty("top"),t.style.removeProperty("left"),t.style.removeProperty("right"),t.style.removeProperty("width"),t.style.removeProperty("overflow"),t.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current});return()=>{s&&(t.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current}))}},[s])}const hn=({href:s,iconName:e,className:t,iconPosition:i,external:n,target:r,children:a,...l})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!e&&i==="left"||!!(e&&!i),"pkt-link--icon-right":!!e&&i==="right","pkt-link--external":n};return o.jsxs("a",{...l,className:ce(d,t),href:s,target:r,rel:n?"noopener noreferrer":void 0,children:[e&&o.jsx(K,{name:e,className:"pkt-link__icon"}),a]})};hn.displayName="PktLink";const mm=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},pn=({item:s,className:e})=>"href"in s?o.jsx(hn,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:ce("pkt-user-menu__link",e),children:s.title}):o.jsxs("button",{className:ce("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",e),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&o.jsx(K,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),gm=({links:s})=>o.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((e,t)=>o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:e})},t))}),vo=h.forwardRef(({user:s,formattedLastLoggedIn:e,representing:t,userMenu:i,canChangeRepresentation:n,changeRepresentation:r,logoutOnClick:a},l)=>{const d=i==null?void 0:i.map(mm);return o.jsx("nav",{className:"pkt-user-menu",ref:l,"aria-label":"Meny for innlogget bruker",children:o.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),e&&o.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",o.jsx("time",{children:e})]})]}),d&&d.length>0&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(gm,{links:d})}),t&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:t.name}),t.orgNumber&&o.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",t.orgNumber]}),n&&r&&o.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})]}),!t&&n&&r&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx("ul",{className:"pkt-user-menu__sublist",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})}),a&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(pn,{item:{title:"Logg ut",iconName:"exit",onClick:a}})})]})})});vo.displayName="PktHeaderUserMenu";const fn=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,autocomplete:i="off",counter:n,counterMaxLength:r,className:a,disabled:l=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:y,iconNameRight:k,inline:g=!1,fullwidth:$=!1,label:C,name:M,optionalTag:S=!1,optionalText:E,requiredTag:T=!1,requiredText:V,tagText:G=null,placeholder:ie,prefix:we,suffix:D,type:N="text",useWrapper:j=!0,omitSearchIcon:J=!1,value:X,minLength:ne,maxLength:ae,min:pe,max:oe,step:ve,size:z,readonly:Y,required:Ee,dataTestid:le,onChange:re,skipForwardTestid:Ke=!1,...He},Ne)=>{const Ge=[a,"pkt-textinput"].join(" "),rt=N==="search"&&!k&&!J,xe=N==="date"&&X?X.slice(0,10):X,[Se,Pe]=h.useState((X==null?void 0:X.length)||0),Ve=`${s}`,at=`${Ve}-label`,be=t||at,ke=W=>{var de,Z;n&&Pe(((Z=(de=W.currentTarget)==null?void 0:de.value)==null?void 0:Z.length)||0),re&&re(W)};return h.useEffect(()=>{X!==void 0&&Pe((X==null?void 0:X.length)||0)},[X]),o.jsx(Os,{ariaDescribedby:e,className:Ge,disabled:l,errorMessage:d,forId:Ve,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:y,inline:g,label:C,optionalTag:S,optionalText:E,requiredTag:T,requiredText:V,tagText:G,useWrapper:j,counter:n,counterCurrent:Se,counterMaxLength:r,children:o.jsxs("div",{className:"pkt-input__container","data-testid":le,"data-skip-forward-testid":Ke?"true":void 0,children:[we&&o.jsx("div",{className:"pkt-input-prefix",children:we}),o.jsx("input",{...He,ref:Ne,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${r&&Se>r?"pkt-input--counter-error":""}`,type:N,name:`${M||s}`,value:xe,id:Ve,placeholder:ie,autoComplete:i,disabled:l,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":be,min:pe,max:oe,onChange:ke,step:ve,minLength:ne,maxLength:ae,size:z,readOnly:Y,required:Ee}),D&&o.jsxs("p",{className:"pkt-input-suffix",children:[D,k&&o.jsx(K,{className:"pkt-input-suffix-icon",name:k}),rt&&o.jsx(K,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!D&&k&&o.jsx(K,{className:"pkt-input-icon",name:k}),!D&&rt&&o.jsx(K,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});fn.displayName="PktTextinput";const ar=h.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:e=1280,children:t,className:i,compact:n=!1,"data-mode":r,logOutButtonPlacement:a="none",logOut:l,openedMenu:d,showSearch:p=!1,onSearch:m,onSearchChange:v,searchValue:y,searchPlaceholder:k="Søk",representing:g,serviceLink:$,serviceClick:C,serviceName:M,user:S,userMenu:E,userMenuFooter:T,userOptions:V,canChangeRepresentation:G=!1,changeRepresentation:ie,hideLogo:we=!1,logoLink:D,logoClick:N,position:j="fixed",scrollBehavior:J="hide",slotMenuVariant:X="icon-only",slotMenuText:ne="Meny"},ae)=>{const pe=j==="fixed",oe=J==="hide";h.useEffect(()=>{T&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[T]),h.useEffect(()=>{V&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[V]),h.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),g!=null&&g.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,g==null?void 0:g.shortname]);const ve=h.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[z,Y]=h.useState(d||"none");h.useEffect(()=>{d!==void 0&&Y(d)},[d]);const[Ee,le]=h.useState(!1),[re,Ke]=h.useState(0),[He,Ne]=h.useState(!1),[Ge,rt]=h.useState(!1),xe=h.useRef(null),Se=h.useRef(null),Pe=h.useRef(null),Ve=h.useRef(null),at=h.useRef(null),be=h.useRef(null),ke=h.useRef(null),W=h.useRef(!1),de=pm(xe),Z=de<s,te=de<e,ut=h.useCallback(u=>{xe.current=u,typeof ae=="function"?ae(u):ae&&(ae.current=u)},[ae]);fm(pe&&Z&&z!=="none");const Be=h.useCallback((u,_)=>{const x=u.relatedTarget;let B;switch(_){case"user":B=Se;break;case"slot":B=Pe;break;case"search":B=Ve;break;default:return}const U=B.current;U&&(!x||!U.contains(x))&&Y("none")},[]),Ue=h.useCallback(()=>{W.current&&ke.current&&document.contains(ke.current)&&ke.current.focus(),ke.current=null,W.current=!1},[]);h.useEffect(()=>{const u=x=>{S&&z==="user"&&!x.target.closest(".pkt-header-service__user-container")&&Y("none"),z==="slot"&&!x.target.closest(".pkt-header-service__slot-container")&&Y("none"),z==="search"&&!x.target.closest(".pkt-header-service__search-container")&&!x.target.closest(".pkt-header-service__search-input")&&Y("none")},_=x=>{x.key==="Escape"&&z!=="none"&&(x.preventDefault(),W.current=!0,Y("none"))};if(z!=="none")return document.addEventListener("mousedown",u),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",_)};Ue()},[z,S,Ue]),h.useEffect(()=>{const u=()=>{if(oe){const _=window.pageYOffset||document.documentElement.scrollTop;if(_<0||Math.abs(_-re)<60)return;le(_>re),Ke(_)}};return document&&window.addEventListener("scroll",u),()=>{document&&window.removeEventListener("scroll",u)}},[oe,re]);const yt=h.useCallback(u=>{const _=u==="slot"?Pe:Ve,x=u==="slot"?at:be;if(!_.current||!x.current||!te||Z)return;const B=_.current.getBoundingClientRect(),U=x.current.offsetWidth,ee=B.left+U>window.innerWidth;u==="slot"?Ne(ee):rt(ee)},[te,Z]),Wt=h.useCallback(u=>{z!=="none"?Y("none"):(ke.current=document.activeElement,Y(u))},[z]);h.useEffect(()=>{(z==="slot"||z==="search")&&requestAnimationFrame(()=>{yt(z)})},[z,yt]);const f=o.jsxs("header",{className:ce("pkt-header-service",n&&"pkt-header-service--compact",Z&&"pkt-header-service--mobile",te&&"pkt-header-service--tablet",pe&&"pkt-header-service--fixed",oe&&"pkt-header-service--scroll-to-hide",Ee&&"pkt-header-service--hidden",i),"data-mode":r,ref:ut,children:[o.jsxs("div",{className:ce("pkt-header-service__logo-area",(!M||M==="")&&"pkt-header-service__logo-area--without-service"),children:[!we&&o.jsx("span",{className:"pkt-header-service__logo",children:D?o.jsx("a",{href:D,"aria-label":"Tilbake til forside",children:o.jsx(K,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.2/logos/"})}):N?o.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:N,children:o.jsx(K,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.2/logos/"})}):o.jsx(K,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.2/logos/"})}),M&&o.jsx("span",{className:"pkt-header-service__service-name",children:$?o.jsx(hn,{href:$,className:"pkt-header-service__service-link ",children:M}):C?o.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:C,children:M}):o.jsx("span",{className:"pkt-header-service__service-link",children:M})})]}),o.jsxs("div",{className:"pkt-header-service__content",children:[o.jsxs("div",{className:ce("pkt-header-service__slot-container",z==="slot"&&"is-open"),onBlur:u=>Be(u,"slot"),ref:Pe,children:[te&&t&&o.jsx(it,{skin:"secondary",variant:X,iconName:"menu",size:Z?"small":"medium",state:z==="slot"?"active":"normal",onClick:()=>Wt("slot"),"aria-expanded":z==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:ne}),o.jsx("div",{className:ce("pkt-header-service__slot-content",He&&"align-right"),id:"mobile-slot-menu",role:te?"menu":void 0,"aria-label":te?"Meny":void 0,ref:at,children:o.jsx("div",{className:"pkt-contents",children:t})})]}),p&&o.jsx(o.Fragment,{children:te?o.jsxs("div",{className:ce("pkt-header-service__search-container",z==="search"&&"is-open"),onBlur:u=>Be(u,"search"),ref:Ve,children:[o.jsx(it,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:Z?"small":"medium",onClick:()=>Wt("search"),state:z==="search"?"active":"normal","aria-expanded":z==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),o.jsx("div",{className:ce("pkt-header-service__mobile-menu",z==="search"&&"is-open",Ge&&"align-right"),ref:be,children:z==="search"&&o.jsx(fn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,autoFocus:!0,fullwidth:!0,onChange:u=>v==null?void 0:v(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})})]}):o.jsx(fn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,onChange:u=>v==null?void 0:v(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})}),te&&l&&(a==="header"||a==="both")&&o.jsx(it,{skin:"secondary",size:Z?"small":"medium",variant:"icon-only",iconName:"exit",onClick:l,children:"Logg ut"})]}),o.jsxs("div",{className:"pkt-header-service__user",children:[S&&o.jsxs("div",{className:"pkt-header-service__user-container",onBlur:u=>Be(u,"user"),ref:Se,children:[o.jsxs(it,{className:ce("pkt-header-service__user-button",Z&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:Z?"small":"medium",state:z==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:z==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Wt("user"),children:[o.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(g==null?void 0:g.name)||S.name]}),z==="user"&&S&&o.jsx("div",{className:ce(Z?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:o.jsx(vo,{user:S,formattedLastLoggedIn:ve,representing:g,userMenu:E,canChangeRepresentation:G,changeRepresentation:ie,logoutOnClick:a==="userMenu"||a==="both"?l:void 0})})]}),!Z&&l&&(a==="header"||a==="both")&&o.jsx(it,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:l,children:"Logg ut"})]})]});return pe?o.jsxs("div",{className:"pkt-header-service-wrapper",children:[f,o.jsx("div",{className:ce("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",Z&&"pkt-header-service-spacer--mobile",te&&"pkt-header-service-spacer--tablet")})]}):f});ar.displayName="PktHeaderService";const bo=h.forwardRef((s,e)=>o.jsx(ar,{...s,ref:e}));bo.displayName="PktHeader";const vm=At({tagName:"pkt-heading",elementClass:ss,react:h,displayName:"PktHeading"}),yo=h.forwardRef(({children:s,...e},t)=>o.jsx(vm,{"data-testid":"pkt-heading",...e,ref:t,children:s}));yo.displayName="PktHeading";const bm=At({tagName:"pkt-helptext",elementClass:Yt,react:h,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),ko=h.forwardRef(({children:s,...e},t)=>o.jsx(bm,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ko.displayName="PktHelptext";const _o=h.forwardRef(({label:s,id:e,children:t,...i},n)=>o.jsxs("div",{className:"pkt-form-group",children:[o.jsx("label",{htmlFor:e,className:"pkt-form-label",children:s}),o.jsx("input",{className:"pkt-form-input",id:e,...i,ref:n}),t]}));_o.displayName="PktInput";const $o=({children:s,skin:e,title:t,href:i,iconName:n,openInNewTab:r,external:a,className:l,...d})=>{const p=["pkt-linkcard",e&&`pkt-linkcard--${e}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",a&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return o.jsxs("a",{...d,href:i,className:ce(p,l),target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,children:[n&&o.jsx(K,{className:"pkt-link__icon",name:n}),t&&o.jsx("div",{className:ce(m),children:t}),o.jsx("div",{className:"pkt-linkcard__text",children:s})]})};$o.displayName="PktLinkCard";const ym=At({tagName:"pkt-loader",elementClass:Et,react:h,displayName:"PktLoader",events:{}}),wo=h.forwardRef(({children:s,...e},t)=>o.jsx(ym,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));wo.displayName="PktLoader";const xo=({children:s,className:e,skin:t,title:i,compact:n,closable:r,onClose:a,...l})=>{const[d,p]=h.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${t}`]:t,"pkt-messagebox--closable":r,"pkt-hide":d},v=h.createRef(),y=h.useCallback(()=>{p(!0),a&&a()},[p,a]);return o.jsxs("div",{...l,className:ce(m,e),ref:v,children:[r&&o.jsx("div",{className:"pkt-messagebox__close",children:o.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:o.jsx(K,{name:"close",className:"pkt-link__icon"})})}),i&&o.jsx("div",{className:"pkt-messagebox__title",children:i}),o.jsx("div",{className:"pkt-messagebox__text",children:s})]})};xo.displayName="PktMessagebox";const km=At({tagName:"pkt-progressbar",elementClass:Le,react:h,displayName:"PktProgressbar",events:{}}),mn=h.forwardRef(({children:s,...e},t)=>o.jsx(km,{ref:t,...e,children:o.jsx("div",{className:"pkt-contents",children:s})}));mn.displayName="PktProgressbar";const So=h.forwardRef(({id:s,name:e,label:t,className:i,hasTile:n=!1,disabled:r=!1,checkHelptext:a,hasError:l=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:v,requiredTag:y,requiredText:k,tagText:g,...$},C)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",r&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),E=["pkt-input-check__input-checkbox",l?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),T=["pkt-input-check__input-label",r?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),V=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),G=()=>o.jsxs(o.Fragment,{children:[g&&o.jsx("span",{className:V+" pkt-tag--gray",children:g}),m&&o.jsx("span",{className:V+" pkt-tag--blue-light",children:v}),y&&o.jsx("span",{className:V+" pkt-tag--beige",children:k})]});return o.jsx("div",{className:M,children:o.jsxs("div",{className:S,children:[o.jsx("input",{ref:C,id:s,type:"radio",name:e,disabled:r,className:E,...p!==void 0?{checked:p}:{defaultChecked:d},...$}),o.jsxs("label",{className:T,htmlFor:s,children:[t," ",G(),a&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});So.displayName="PktRadioButton";const Co=h.forwardRef(({appearance:s="local",disabled:e=!1,fullwidth:t=!1,id:i,label:n,name:r,placeholder:a="Søk…",suggestions:l,value:d="",action:p,method:m,onChange:v,onSearch:y,onSuggestionClick:k,...g},$)=>{const C=(T,V)=>{T?T():k&&k(V)},M=T=>{d=T.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${t?"pkt-searchinput--fullwidth":""}`;let E;return p?E=T=>o.jsx("form",{role:"search",className:S,action:p,method:m,children:T}):E=T=>o.jsx("div",{role:"search",className:S,children:T}),E(o.jsxs(o.Fragment,{children:[n&&o.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),o.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[o.jsx("input",{className:`pkt-input ${t?"pkt-input--fullwidth":""}`,type:"search",name:r||i,id:i,placeholder:a,defaultValue:d,disabled:e,autoComplete:"off","aria-autocomplete":"list",ref:$,"aria-controls":`${i}-suggestions`,onChange:v||M,onKeyUp:y&&(T=>{T.key==="Enter"&&(T.preventDefault(),y(d))}),...g}),o.jsx(it,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:e,onClick:y&&(T=>{T.preventDefault(),y(d)}),children:n||a})]}),l&&o.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:l.map((T,V)=>o.jsx("li",{children:h.createElement(T.href?"a":T.onClick?"button":"div",{href:T.href,className:`pkt-searchinput__suggestion ${T.onClick?"pkt-link-button":""} ${T.href||T.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:T.onClick?"button":void 0,onClick:()=>C(T.onClick,V),onKeyUp:G=>G.key==="Enter"&&C(T.onClick,V)},o.jsxs(o.Fragment,{children:[T.title&&o.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:T.title}),T.text&&o.jsx("p",{className:"pkt-searchinput__suggestion-text",children:T.text})]}))},`search-suggestion-${V}`))})]}))});Co.displayName="PktSearchInput";const To=h.forwardRef(({ariaDescribedby:s,ariaLabelledby:e,children:t,className:i,disabled:n=!1,errorMessage:r,hasError:a,helptext:l,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:y=!1,label:k,name:g,optionalTag:$=!1,optionalText:C,requiredTag:M=!1,requiredText:S,tagText:E,...T},V)=>{const G=[i,"pkt-select"].join(" ");return o.jsx(Os,{className:G,forId:`${m}-input`,label:k,helptext:l,helptextDropdown:d,helptextDropdownButton:p,optionalTag:$,optionalText:C,requiredTag:M,requiredText:S,tagText:E,hasError:a,errorMessage:r,disabled:n,inline:v,ariaDescribedby:s,children:o.jsx("select",{ref:V,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":a,"aria-errormessage":`${m}-error`,"aria-labelledby":e||void 0,disabled:n,id:`${m}-input`,name:g||m,...T,children:t})})});To.displayName="PktSelect";const _m=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:o.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),$m=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),o.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),wm=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),o.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),xm=({children:s,className:e,status:t="incomplete",title:i})=>o.jsxs("li",{className:ce("pkt-step",e,`pkt-step--${t}`),"data-testid":"pkt-step",children:[o.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),o.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),o.jsx("span",{className:ce("pkt-step__indicator"),children:t==="current"?$m:t==="completed"?wm:_m}),o.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),o.jsxs("div",{className:"pkt-step__wrapper",children:[o.jsx("div",{className:"pkt-step__title",children:i}),o.jsx("div",{className:"pkt-step__content",children:s})]})]}),No=h.forwardRef(({activeStep:s,className:e,children:t,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:r="vertical",...a},l)=>{const d=ce(e,"pkt-stepper",r==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=h.Children.map(t,(m,v)=>h.isValidElement(m)?h.cloneElement(m,{className:ce(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return o.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:l,...a,children:p})});No.displayName="PktStepper";const Sm=({className:s,compact:e=!1,skin:t="basic",responsiveView:i=!0,children:n,...r})=>o.jsx("table",{"data-testid":"pkt-table",className:ce(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":e,"pkt-table--basic":t==="basic","pkt-table--zebra-blue":t==="zebra-blue"}),role:"table",...r,children:n}),Cm=({id:s,children:e,className:t,...i})=>o.jsx("tbody",{id:s,className:ce(t,"pkt-table__body",{}),...i,role:"rowgroup",children:e}),Tm=({children:s,className:e,dataLabel:t,...i})=>o.jsx("td",{className:ce(e,"pkt-table__data-cell",{}),"data-label":t,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Nm=({className:s,children:e,...t})=>o.jsx("thead",{className:ce(s,"pkt-table__header",{}),role:"rowgroup",...t,children:e}),Mm=({className:s,children:e,...t})=>o.jsx("th",{className:ce(s,"pkt-table__header-cell",{}),role:"columnheader",...t,children:e}),Dm=({className:s,children:e,...t})=>o.jsx("tr",{className:ce(s,"pkt-table__row",{}),role:"row",...t,children:e}),or=h.forwardRef(({children:s,active:e,href:t,onClick:i,icon:n,controls:r,tag:a,tagSkin:l,index:d=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:y,selectTab:k}=Om(),$={"aria-selected":m?!!e:void 0,"aria-controls":r,role:m?"tab":void 0,onKeyUp:M=>y(d,M),onClick:M=>{k(d),i==null||i(M)},tabIndex:e||!m?void 0:-1,ref:M=>{v(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},C=o.jsxs(o.Fragment,{children:[n&&o.jsx(K,{name:n,className:"pkt-icon--small"}),s,a&&o.jsx(dn,{skin:l,size:"small",children:a})]});return t?o.jsx("a",{...$,href:t,className:`pkt-tabs__link ${e?"active":""}`,children:C}):o.jsx("button",{...$,type:"button",className:`pkt-tabs__button pkt-link-button ${e?"active":""}`,children:C})});or.displayName="PktTabItem";const Mo=h.createContext(null),Om=()=>{const s=h.useContext(Mo);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Do=h.forwardRef(({arrowNav:s=!0,disableArrowNav:e=!1,tabs:t,onTabSelected:i,children:n},r)=>{const a=h.useRef([]),l=s&&!e,p=n&&h.Children.count(n)>0?h.Children.count(n):(t==null?void 0:t.length)||0;h.useEffect(()=>{a.current=a.current.slice(0,p)},[p]);const m=g=>{const $=t==null?void 0:t[g];$!=null&&$.action&&$.action(g),i&&i(g)},v=(g,$)=>{var C,M;l&&($.code==="ArrowLeft"&&g!==0&&((C=a.current[g-1])==null||C.focus()),$.code==="ArrowRight"&&g<p-1&&((M=a.current[g+1])==null||M.focus()),($.code==="ArrowDown"||$.code==="Space")&&m(g))},y=(g,$)=>{a.current[g]=$},k=t==null?void 0:t.map((g,$)=>{var C,M;return o.jsx(or,{active:g.active,href:g.href,onClick:()=>m($),icon:g.icon,controls:g.controls,tag:(C=g.tag)==null?void 0:C.text,tagSkin:(M=g.tag)==null?void 0:M.skin,index:$,children:g.text},$)});return o.jsx(Mo.Provider,{value:{arrowNav:l,registerTabRef:y,handleKeyPress:v,selectTab:m},children:o.jsx("div",{className:"pkt-tabs",ref:r,children:o.jsx("div",{className:"pkt-tabs__list",role:l?"tablist":"navigation",children:n||k})})})});Do.displayName="PktTabs";var Rs=window.CustomEvent;(!Rs||typeof Rs=="object")&&(Rs=function(s,e){e=e||{};var t=document.createEvent("CustomEvent");return t.initCustomEvent(s,!!e.bubbles,!!e.cancelable,e.detail||null),t},Rs.prototype=window.Event.prototype);function Oo(s,e){var t="on"+e.type.toLowerCase();return typeof s[t]=="function"&&s[t](e),s.dispatchEvent(e)}function Em(s){for(;s&&s!==document.body;){var e=window.getComputedStyle(s),t=function(i,n){return!(e[i]===void 0||e[i]===n)};if(e.opacity<1||t("zIndex","auto")||t("transform","none")||t("mixBlendMode","normal")||t("filter","none")||t("perspective","none")||e.isolation==="isolate"||e.position==="fixed"||e.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function Ii(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function Eo(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Pm(s,e){for(var t=0;t<s.length;++t)if(s[t]===e)return!0;return!1}function lr(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Po(s){var e=["button","input","keygen","select","textarea"],t=e.map(function(a){return a+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),r=0;r<n.length&&!(n[r].tagName&&n[r].shadowRoot&&(i=Po(n[r].shadowRoot),i));r++);return i}function Ao(s){return s.isConnected||document.body.contains(s)}function Io(s){if(s.submitter)return s.submitter;var e=s.target;if(!(e instanceof HTMLFormElement))return null;var t=ue.formSubmitter;if(!t){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;t=n.activeElement}return!t||t.form!==e?null:t}function Am(s){if(!s.defaultPrevented){var e=s.target,t=ue.imagemapUseValue,i=Io(s);t===null&&i&&(t=i.value);var n=Ii(e);if(n){var r=i&&i.getAttribute("formmethod")||e.getAttribute("method");r==="dialog"&&(s.preventDefault(),t!=null?n.close(t):n.close())}}}function Lo(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",Am,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var e=new MutationObserver(this.maybeHideModal.bind(this));e.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var t=!1,i=(function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}).bind(this),n,r=function(a){if(a.target===s){var l="DOMNodeRemoved";t|=a.type.substr(0,l.length)===l,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(a){s.addEventListener(a,r)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}Lo.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Ao(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),ue.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var e=document.createElement("div");this.dialog_.insertBefore(e,this.dialog_.firstChild),e.tabIndex=-1,e.focus(),this.dialog_.removeChild(e)}var t=document.createEvent("MouseEvents");t.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(t),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=Po(this.dialog_)),Eo(document.activeElement),s&&s.focus()},updateZIndex:function(s,e){if(s<e)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=e},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!Ao(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!ue.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Em(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,ue.needsCentering(this.dialog_)?(ue.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var e=new Rs("close",{bubbles:!1,cancelable:!1});Oo(this.dialog_,e)}};var ue={};if(ue.reposition=function(s){var e=document.body.scrollTop||document.documentElement.scrollTop,t=e+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(e,t)+"px"},ue.isInlinePositionSetByStylesheet=function(s){for(var e=0;e<document.styleSheets.length;++e){var t=document.styleSheets[e],i=null;try{i=t.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var r=i[n],a=null;try{a=document.querySelectorAll(r.selectorText)}catch{}if(!(!a||!Pm(a,s))){var l=r.style.getPropertyValue("top"),d=r.style.getPropertyValue("bottom");if(l&&l!=="auto"||d&&d!=="auto")return!0}}}return!1},ue.needsCentering=function(s){var e=window.getComputedStyle(s);return e.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!ue.isInlinePositionSetByStylesheet(s)},ue.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new Lo(s)},ue.registerDialog=function(s){s.showModal||ue.forceRegisterDialog(s)},ue.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(e){this.forwardTab_=void 0,e.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(e){var t=[];e.forEach(function(i){for(var n=0,r;r=i.removedNodes[n];++n){if(r instanceof Element)r.localName==="dialog"&&t.push(r);else continue;t=t.concat(r.querySelectorAll("dialog"))}}),t.length&&s(t)}))},ue.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},ue.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},ue.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,e=0,t;t=this.pendingDialogStack[e];++e)t.updateZIndex(--s,--s),e===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},ue.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Ii(s);){for(var e=0,t;t=this.pendingDialogStack[e];++e)if(t.dialog===s)return e===0;s=s.parentElement}return!1},ue.DialogManager.prototype.handleFocus_=function(s){var e=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(e)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),Eo(e),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],i=t.dialog,n=i.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e!==document.documentElement&&document.documentElement.focus()),!1}},ue.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var e=new Rs("cancel",{bubbles:!1,cancelable:!0}),t=this.pendingDialogStack[0];t&&Oo(t.dialog,e)&&t.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},ue.DialogManager.prototype.checkDOM_=function(s){var e=this.pendingDialogStack.slice();e.forEach(function(t){s.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},ue.DialogManager.prototype.pushDialog=function(s){var e=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=e?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},ue.DialogManager.prototype.removeDialog=function(s){var e=this.pendingDialogStack.indexOf(s);e!==-1&&(this.pendingDialogStack.splice(e,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},ue.dm=new ue.DialogManager,ue.formSubmitter=null,ue.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Bo=document.createElement("form");if(Bo.setAttribute("method","dialog"),Bo.method!=="dialog"){var ei=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(ei){var Im=ei.get;ei.get=function(){return lr(this)?"dialog":Im.call(this)};var Lm=ei.set;ei.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Lm.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",ei)}}document.addEventListener("click",function(s){if(ue.formSubmitter=null,ue.imagemapUseValue=null,!s.defaultPrevented){var e=s.target;if("composedPath"in s){var t=s.composedPath();e=t.shift()||e}if(!(!e||!lr(e.form))){var i=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!i){if(!(e.localName==="input"&&e.type==="image"))return;ue.imagemapUseValue=s.offsetX+","+s.offsetY}var n=Ii(e);n&&(ue.formSubmitter=e)}}},!1),document.addEventListener("submit",function(s){var e=s.target,t=Ii(e);if(!t){var i=Io(s),n=i&&i.getAttribute("formmethod")||e.getAttribute("method");n==="dialog"&&s.preventDefault()}});var Bm=HTMLFormElement.prototype.submit,Fm=function(){if(!lr(this))return Bm.call(this);var s=Ii(this);s&&s.close()};HTMLFormElement.prototype.submit=Fm}const Hm=Object.freeze(Object.defineProperty({__proto__:null,default:ue},Symbol.toStringTag,{value:"Module"}));I.PktAccordion=ur,I.PktAccordionItem=Ma,I.PktAlert=rn,I.PktBackLink=Oa,I.PktBreadcrumbs=Ea,I.PktButton=it,I.PktCalendar=er,I.PktCard=io,I.PktCheckbox=no,I.PktCombobox=ro,I.PktConsent=ln,I.PktDatepicker=lo,I.PktFileUpload=go,I.PktFooter=um,I.PktFooterSimple=hm,I.PktHeader=bo,I.PktHeaderService=ar,I.PktHeading=yo,I.PktHelptext=ko,I.PktIcon=K,I.PktInput=_o,I.PktInputWrapper=Os,I.PktLink=hn,I.PktLinkCard=$o,I.PktLoader=wo,I.PktMessagebox=xo,I.PktModal=ir,I.PktProgressbar=mn,I.PktRadioButton=So,I.PktSearchInput=Co,I.PktSelect=To,I.PktStep=xm,I.PktStepper=No,I.PktTabItem=or,I.PktTable=Sm,I.PktTableBody=Cm,I.PktTableDataCell=Tm,I.PktTableHeader=Nm,I.PktTableHeaderCell=Mm,I.PktTableRow=Dm,I.PktTabs=Do,I.PktTag=dn,I.PktTextarea=sr,I.PktTextinput=fn,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
1693
+ */var Da;function wh(){return Da||(Da=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(r=n(r,i(l)))}return r}function i(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var l in r)e.call(r,l)&&r[l]&&(a=n(a,l));return a}function n(r,a){return a?r?r+" "+a:r+a:r}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(Yn)),Yn.exports}var xh=wh();const ce=$h(xh),rn=({children:s,closeAlert:e,compact:t,title:i,date:n,ariaLive:r,"aria-live":a="polite",role:l="status",skin:d="info",className:p,...m})=>{const[v,y]=h.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":t,[`pkt-alert--${d}`]:d,"pkt-hide":v},g={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},$=h.useCallback(()=>{y(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,y]),C=r||a;return o.jsx("div",{...m,"aria-live":C,role:l,className:ce(k,p),children:o.jsxs("div",{className:ce(g),children:[o.jsx(K,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),e&&o.jsx("div",{className:"pkt-alert__close",children:o.jsx(it,{tabIndex:0,"aria-label":"close",size:t?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:$,children:o.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&o.jsx("div",{className:"pkt-alert__title",children:i}),o.jsx("div",{className:"pkt-alert__text",children:s}),n&&o.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};rn.displayName="PktAlert";const Oa=At({tagName:"pkt-backlink",elementClass:Hs,react:h,displayName:"PktBackLink"});Oa.displayName="PktBackLink";const Ea=h.forwardRef(({breadcrumbs:s,navigationType:e,renderLink:t,className:i,...n},r)=>{const a=s,l=a[a.length-2],d=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=t||(e==="router"?({href:m,className:v,children:y,props:k})=>o.jsx(jo.Link,{to:m,className:v,...k,children:y}):({href:m,className:v,children:y,props:k})=>o.jsx("a",{href:m,className:v,...k,children:y}));return o.jsxs("nav",{ref:r,"aria-label":"brødsmulemeny",className:d,children:[o.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((m,v)=>o.jsx("li",{className:"pkt-breadcrumbs__item",children:v===a.length-1?o.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})}):p({href:m.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})]}),props:n})},`breadcrumb-${v}`))}),p({href:l.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:l.text})]}),props:n})]})});Ea.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.3/animations/";const it=h.forwardRef(({children:s,className:e,iconName:t="user",secondIconName:i="user",iconPath:n,secondIconPath:r,size:a="medium",fullWidth:l=!1,fullWidthOnMobile:d=!1,skin:p="primary",type:m="button",variant:v="label-only",state:y,color:k,isLoading:g=void 0,disabled:$=void 0,loadingAnimationPath:C=window.pktAnimationPath,...M},S)=>{const E=[e,"pkt-btn",a&&`pkt-btn--${a}`,l&&"pkt-btn--full",d&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,k&&`pkt-btn--${k}`,y&&`pkt-btn--${y}`,g&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return o.jsxs("button",{...M,"aria-busy":g||void 0,"aria-disabled":$||void 0,disabled:$,className:E,type:m,ref:S,children:[g&&o.jsx(K,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:C}),v!=="label-only"&&o.jsx(K,{className:"pkt-btn__icon",name:t,...n&&{path:n}}),o.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&o.jsx(K,{className:"pkt-btn__icon",name:i,...r&&{path:r}})]})});it.displayName="PktButton";const Pa=6048e5,Sh=864e5,Aa=Symbol.for("constructDateFrom");function Ut(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Aa in s?s[Aa](e):s instanceof Date?new s.constructor(e):new Date(e)}function bt(s,e){return Ut(e||s,s)}function Ia(s,e,t){const i=bt(s,t==null?void 0:t.in);return isNaN(e)?Ut(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Ch={};function an(){return Ch}function Ti(s,e){var l,d,p,m;const t=an(),i=(e==null?void 0:e.weekStartsOn)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??t.weekStartsOn??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,n=bt(s,e==null?void 0:e.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function on(s,e){return Ti(s,{...e,weekStartsOn:1})}function La(s,e){const t=bt(s,e==null?void 0:e.in),i=t.getFullYear(),n=Ut(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=on(n),a=Ut(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=on(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Ba(s){const e=bt(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function Fa(s,...e){const t=Ut.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Kn(s,e){const t=bt(s,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function Th(s,e,t){const[i,n]=Fa(t==null?void 0:t.in,s,e),r=Kn(i),a=Kn(n),l=+r-Ba(r),d=+a-Ba(a);return Math.round((l-d)/Sh)}function Nh(s,e){const t=La(s,e),i=Ut(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),on(i)}function Mh(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Dh(s){return!(!Mh(s)&&typeof s!="number"||isNaN(+bt(s)))}function Oh(s,e){const t=bt(s,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function Eh(s,e){const[t,i]=Fa(s,e.start,e.end);return{start:t,end:i}}function Ha(s,e){const{start:t,end:i}=Eh(e==null?void 0:e.in,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let l=1;const d=[];for(;+a<=r;)d.push(Ut(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return n?d.reverse():d}function Ph(s,e){const t=bt(s,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Ah={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"}},Ih=(s,e,t)=>{let i;const n=Ah[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Gn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Lh={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bh={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Fh={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Hh={date:Gn({formats:Lh,defaultWidth:"full"}),time:Gn({formats:Bh,defaultWidth:"full"}),dateTime:Gn({formats:Fh,defaultWidth:"full"})},Vh={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Uh=(s,e,t,i)=>Vh[s];function Ni(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;n=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const jh={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qh={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wh={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"]},zh={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"]},Yh={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"}},Kh={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"}},Gh={ordinalNumber:(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Ni({values:jh,defaultWidth:"wide"}),quarter:Ni({values:qh,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Ni({values:Wh,defaultWidth:"wide"}),day:Ni({values:zh,defaultWidth:"wide"}),dayPeriod:Ni({values:Yh,defaultWidth:"wide",formattingValues:Kh,defaultFormattingWidth:"wide"})};function Mi(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],l=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(l)?Qh(l,v=>v.test(a)):Xh(l,v=>v.test(a));let p;p=s.valueCallback?s.valueCallback(d):d,p=t.valueCallback?t.valueCallback(p):p;const m=e.slice(a.length);return{value:p,rest:m}}}function Xh(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Qh(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function Zh(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(n.length);return{value:a,rest:l}}}const Jh=/^(\d+)(th|st|nd|rd)?/i,Rh=/\d+/i,ep={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},tp={any:[/^b/i,/^(a|c)/i]},sp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ip={any:[/1/i,/2/i,/3/i,/4/i]},np={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},rp={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]},ap={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},op={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]},lp={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},cp={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}},dp={ordinalNumber:Zh({matchPattern:Jh,parsePattern:Rh,valueCallback:s=>parseInt(s,10)}),era:Mi({matchPatterns:ep,defaultMatchWidth:"wide",parsePatterns:tp,defaultParseWidth:"any"}),quarter:Mi({matchPatterns:sp,defaultMatchWidth:"wide",parsePatterns:ip,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Mi({matchPatterns:np,defaultMatchWidth:"wide",parsePatterns:rp,defaultParseWidth:"any"}),day:Mi({matchPatterns:ap,defaultMatchWidth:"wide",parsePatterns:op,defaultParseWidth:"any"}),dayPeriod:Mi({matchPatterns:lp,defaultMatchWidth:"any",parsePatterns:cp,defaultParseWidth:"any"})},up={code:"en-US",formatDistance:Ih,formatLong:Hh,formatRelative:Uh,localize:Gh,match:dp,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hp(s,e){const t=bt(s,e==null?void 0:e.in);return Th(t,Ph(t))+1}function pp(s,e){const t=bt(s,e==null?void 0:e.in),i=+on(t)-+Nh(t);return Math.round(i/Pa)+1}function Va(s,e){var m,v,y,k;const t=bt(s,e==null?void 0:e.in),i=t.getFullYear(),n=an(),r=(e==null?void 0:e.firstWeekContainsDate)??((v=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??n.firstWeekContainsDate??((k=(y=n.locale)==null?void 0:y.options)==null?void 0:k.firstWeekContainsDate)??1,a=Ut((e==null?void 0:e.in)||s,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const l=Ti(a,e),d=Ut((e==null?void 0:e.in)||s,0);d.setFullYear(i,0,r),d.setHours(0,0,0,0);const p=Ti(d,e);return+t>=+l?i+1:+t>=+p?i:i-1}function fp(s,e){var l,d,p,m;const t=an(),i=(e==null?void 0:e.firstWeekContainsDate)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??t.firstWeekContainsDate??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,n=Va(s,e),r=Ut((e==null?void 0:e.in)||s,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),Ti(r,e)}function Ua(s,e){const t=bt(s,e==null?void 0:e.in),i=+Ti(t,e)-+fp(t,e);return Math.round(i/Pa)+1}function ge(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const as={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return ge(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):ge(t+1,2)},d(s,e){return ge(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return ge(s.getHours()%12||12,e.length)},H(s,e){return ge(s.getHours(),e.length)},m(s,e){return ge(s.getMinutes(),e.length)},s(s,e){return ge(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return ge(n,e.length)}},Zs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ja={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return as.y(s,e)},Y:function(s,e,t,i){const n=Va(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return ge(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):ge(r,e.length)},R:function(s,e){const t=La(s);return ge(t,e.length)},u:function(s,e){const t=s.getFullYear();return ge(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return ge(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return ge(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return as.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return ge(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Ua(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):ge(n,e.length)},I:function(s,e,t){const i=pp(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):ge(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):as.d(s,e)},D:function(s,e,t){const i=hp(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):ge(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return ge(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return ge(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return ge(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(s,e,t){const n=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(s,e,t){const i=s.getHours();let n;switch(i===12?n=Zs.noon:i===0?n=Zs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Zs.evening:i>=12?n=Zs.afternoon:i>=4?n=Zs.morning:n=Zs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return as.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):as.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):ge(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):ge(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):as.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):as.s(s,e)},S:function(s,e){return as.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Wa(i);case"XXXX":case"XX":return Ms(i);case"XXXXX":case"XXX":default:return Ms(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return Wa(i);case"xxxx":case"xx":return Ms(i);case"xxxxx":case"xxx":default:return Ms(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+qa(i,":");case"OOOO":default:return"GMT"+Ms(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+qa(i,":");case"zzzz":default:return"GMT"+Ms(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return ge(i,e.length)},T:function(s,e,t){return ge(+s,e.length)}};function qa(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+ge(r,2)}function Wa(s,e){return s%60===0?(s>0?"-":"+")+ge(Math.abs(s)/60,2):Ms(s,e)}function Ms(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=ge(Math.trunc(i/60),2),r=ge(i%60,2);return t+n+e+r}const za=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ya=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},mp={p:Ya,P:(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return za(s,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",za(i,e)).replace("{{time}}",Ya(n,e))}},gp=/^D+$/,vp=/^Y+$/,bp=["D","DD","YY","YYYY"];function yp(s){return gp.test(s)}function kp(s){return vp.test(s)}function _p(s,e,t){const i=$p(s,e,t);if(console.warn(i),bp.includes(s))throw new RangeError(i)}function $p(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const wp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sp=/^'([^]*?)'?$/,Cp=/''/g,Tp=/[a-zA-Z]/;function Np(s,e,t){var m,v,y,k;const i=an(),n=i.locale??up,r=i.firstWeekContainsDate??((v=(m=i.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??1,a=i.weekStartsOn??((k=(y=i.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=bt(s,t==null?void 0:t.in);if(!Dh(l))throw new RangeError("Invalid time value");let d=e.match(xp).map(g=>{const $=g[0];if($==="p"||$==="P"){const C=mp[$];return C(g,n.formatLong)}return g}).join("").match(wp).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const $=g[0];if($==="'")return{isToken:!1,value:Mp(g)};if(ja[$])return{isToken:!0,value:g};if($.match(Tp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:g}});n.localize.preprocessor&&(d=n.localize.preprocessor(l,d));const p={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return d.map(g=>{if(!g.isToken)return g.value;const $=g.value;(kp($)||yp($))&&_p($,e,String(s));const C=ja[$[0]];return C(l,$,n.localize,p)}).join("")}function Mp(s){const e=s.match(Sp);return e?e[1].replace(Cp,"'"):s}function Dp(s,e){const t=bt(s,e==null?void 0:e.in).getDay();return t===0?7:t}function Op(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const Xn={},Di={};function Ds(s,e){try{const i=(Xn[s]||(Xn[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return i in Di?Di[i]:Ka(i,i.split(":"))}catch{if(s in Di)return Di[s];const t=s==null?void 0:s.match(Ep);return t?Ka(s,t.slice(1)):NaN}}const Ep=/([+-]\d\d):?(\d\d)?/;function Ka(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return Di[s]=t*60+i>0?t*60+i+n:t*60-i-n}class jt extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ds(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Xa(this),Qn(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new jt(...t,e):new jt(Date.now(),e)}withTimeZone(e){return new jt(+this,e)}getTimezoneOffset(){const e=-Ds(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Qn(this),+this}[Symbol.for("constructDateFrom")](e){return new jt(+new Date(e),this.timeZone)}}const Ga=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Ga.test(s))return;const e=s.replace(Ga,"$1UTC");jt.prototype[e]&&(s.startsWith("get")?jt.prototype[s]=function(){return this.internal[e]()}:(jt.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Pp(this),+this},jt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Qn(this),+this}))});function Qn(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Ds(s.timeZone,s)*60))}function Pp(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),Xa(s)}function Xa(s){const e=Ds(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const d=n-t;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(Ds(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const y=Ds(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),$=-new Date(+s).getTimezoneOffset()-k,C=k!==t,M=$-d;if(C&&M){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+M);const S=Ds(s.timeZone,s),E=S>0?Math.floor(S):Math.ceil(S),T=k-E;T&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T))}}class os extends jt{static tz(e,...t){return t.length?new os(...t,e):new os(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${Op(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new os(+this,e)}[Symbol.for("constructDateFrom")](e){return new os(+new Date(e),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Ap=(s=window.pktTz)=>{const e=new os(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function qt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const nt=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},Oi=s=>{if(!s)return null;const e=qt(s);return isNaN(e.getTime())?null:e},Ip=(s,e)=>{const t=Qt(s);return isNaN(t.getTime())?"":Np(t,e)},Qt=(s="",e)=>{const t=typeof s=="string"?qt(s):s;return!t||isNaN(t.getTime())?new Date:e?e==="end"?Oh(t):Kn(t):t},Js=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},Ei=s=>{let e;return typeof s=="number"?e=new os(s,window.pktTz):e=new os(s,window.pktTz),e.setHours(12,0,0,0),e};let Zn=null,Qa;const Lp=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Zn||Qa!==e)&&(Zn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),Qa=e),Zn.format(s)},Bp=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Qt(e):null,n=t?Qt(t):null;return!(i&&s<i||n&&s>n)},Fp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=nt(s);return e.includes(t)},Hp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},Za=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!Bp(s,e,t)||i&&Fp(s,i)||n&&Hp(s,n)),Vp=(s,e,t,i,n)=>s.filter(r=>{const a=Oi(r);return a&&Za(a,e,t,i,n)}),Up=s=>s.slice().sort((e,t)=>{const i=Oi(e),n=Oi(t);return!i||!n?0:i.getTime()-n.getTime()}),jp=(s,e)=>{const t=Oi(s),i=Oi(e);return!t||!i?!1:t<=i};function Ja(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:nt(i));return!Za(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function qp(s,e,t,i){return!!(Ja(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function Wp(s,e,t){const i=Js(s,e,0);return!(t&&Qt(t)>i)}function zp(s,e,t){const i=Js(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Qt(t)<i)}function Ra(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>qt(e))}function eo(s,e){const t=Ha({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[nt(r)]=a}return i}function to(s,e,t,i){if(e.length!==1)return!0;const n=Ha({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(Dp(n[r]).toString()))return!1}return!0}function Jn(s,e){const t=nt(s);return e.includes(t)?e:[...e,t]}function Rn(s,e){const t=nt(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function so(s,e,t){const i=nt(s);return e.includes(i)?Rn(s,e):t>0&&e.length>=t?e:Jn(s,e)}function Yp(s,e,t){const i=nt(s),n=Ra(e);if(e.includes(i))return e.indexOf(i)===0?[]:Rn(s,e);if(e.length>1)return[i];if(e.length===1){if(!to(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return Jn(s,e)}const Pi=7,Kp=6;function Gp(s,e){const t=Js(s,e,1),i=Js(s,e+1,0),n=(t.getDay()+Kp)%Pi,r=i.getDate(),a=Math.ceil((r+n)/Pi),d=Js(s,e,0).getDate(),p=Ua(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:d,initialWeek:p}}function Xp(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function Qp(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}const Zp={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Pi,ArrowDown:Pi};function Jp(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Rp(s,e,t){let i=Ia(s,e);if(!i)return null;let n=t(`button[data-date="${nt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Ia(i,e),n=t(`button[data-date="${nt(i)}"]`),!n)return null;return i}function ef(s){return Zp[s]??null}const tf={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"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"};function sf(s){const{selected:e,multiple:t=!1,maxMultiple:i=0,range:n=!1,earliest:r=null,latest:a=null,excludedates:l,excludeweekdays:d=[],weeknumbers:p=!1,withcontrols:m=!1,currentmonth:v,today:y,strings:k,onDateSelected:g,onClose:$,id:C,className:M}=s,S=h.useId(),E=C??S,T=h.useMemo(()=>({...tf,...k}),[k]),V=h.useMemo(()=>y?qt(y):Ap(),[y]),G=h.useMemo(()=>l?l.map(f=>typeof f=="string"?qt(f):f):[],[l]),ie=e!==void 0,[we,D]=h.useState([]),N=ie?e:we,j=h.useMemo(()=>Ra(N),[N]),[J,X]=h.useState(0),[ne,ae]=h.useState(0),[pe,oe]=h.useState({}),[ve,z]=h.useState(null),[Y,Ee]=h.useState(null),le=h.useRef(null),re=h.useRef([]),Ke=h.useRef(0),He=h.useRef(!1),Ne=h.useRef(!1),Ge=h.useMemo(()=>({earliest:r,latest:a,excludedates:G,excludeweekdays:d}),[r,a,G,d]);h.useEffect(()=>{let f=null;if(v!=null&&(v instanceof Date?f=Ei(v):typeof v=="string"&&(f=qt(v))),!f||isNaN(f.getTime()))if(N.length>0&&N[0]!==""){const u=qt(N[N.length-1]);f=isNaN(u.getTime())?Ei(V):u}else f=Ei(V);if((!f||isNaN(f.getTime()))&&(f=Ei(V)),a){const u=typeof a=="string"?qt(a):a;!isNaN(u.getTime())&&f>u&&(f=u)}if(r){const u=typeof r=="string"?qt(r):r;!isNaN(u.getTime())&&f<u&&(f=u)}X(f.getFullYear()),ae(f.getMonth()),Ne.current=!0},[]),h.useEffect(()=>{if(Ne.current&&!He.current&&N.length>0&&N[0]!==""){const f=qt(N[N.length-1]);isNaN(f.getTime())||(X(f.getFullYear()),ae(f.getMonth()))}},[N]),h.useEffect(()=>{n&&j.length===2?oe(eo(j[0],j[1])):(!n||j.length<2)&&oe({})},[n,j]);const rt=h.useCallback(f=>{ie||D(f),g==null||g(f)},[ie,g]),xe=h.useCallback(()=>{$==null||$()},[$]),Se=h.useCallback((f,u)=>{X(typeof f=="string"?parseInt(f):f),ae(typeof u=="string"?parseInt(u):u),Ke.current=0,Ee(null),re.current=[],He.current=!0},[]),Pe=h.useCallback(()=>{const f=ne===0?11:ne-1,u=ne===0?J-1:J;Se(u,f)},[J,ne,Se]),Ve=h.useCallback(()=>{const f=ne===11?0:ne+1,u=ne===11?J+1:J;Se(u,f)},[J,ne,Se]),at=h.useCallback(f=>Ja(f,Ge),[Ge]),be=h.useCallback((f,u)=>qp(f,u,Ge,{multiple:t,maxMultiple:i,selectedCount:N.length}),[Ge,t,i,N.length]),ke=h.useCallback(()=>typeof N=="string"?N.split(","):N,[N]),W=h.useCallback(f=>{if(!n||j.length!==1||!to(f,j,G,d)||j[0]>=f){z(null);return}z(f),oe(eo(j[0],f))},[n,j,G,d]),de=h.useCallback(f=>{if(!f)return;let u;if(n)u=Yp(f,ke(),{excludedates:G,excludeweekdays:d}),ie||D(u),u.length===2?(g==null||g(u),xe()):(u.length===1&&oe({}),g==null||g(u));else if(t)u=so(f,ke(),i),rt(u);else{const _=nt(f);N.includes(_)?u=[]:u=[_],rt(u),xe()}},[n,t,i,ke,N,G,d,ie,rt,xe,g]),Z=h.useCallback(f=>{const u=Jn(f,ke());ie||D(u),n&&u.length===2&&(g==null||g(u),xe())},[ke,ie,n,g,xe]),te=h.useCallback(f=>{const u=Rn(f,ke());ie||D(u)},[ke,ie]),ut=h.useCallback(f=>{const u=so(f,ke(),i);ie||D(u)},[ke,i,ie]),Be=h.useCallback(()=>{var x,B;const f=nt(Ei(V)),u=(x=le.current)==null?void 0:x.querySelector(`button[data-date="${f}"]`);if(u instanceof HTMLButtonElement){Ee(f),u.focus();return}const _=re.current.find(U=>!U.isDisabled);if(_){const U=(B=le.current)==null?void 0:B.querySelector(`button[data-date="${_.currentDateISO}"]`);U instanceof HTMLButtonElement&&(Ee(_.currentDateISO),U.focus())}},[]),Ue=h.useCallback((f,u)=>{const _=f.target;if(Jp(_))return;if(f.preventDefault(),!Y){Be();return}const x=Qt(Y),B=Rp(x,u,le.current.querySelector.bind(le.current));if(B){const U=le.current.querySelector(`button[data-date="${nt(B)}"]`);U instanceof HTMLButtonElement&&!U.dataset.disabled&&(Ee(nt(B)),U.focus())}},[Y,Be]),yt=h.useCallback(f=>{if(f.key==="Escape"){f.preventDefault(),xe();return}const u=ef(f.key);u!==null&&Ue(f.nativeEvent,u)},[xe,Ue]),Wt=h.useCallback(f=>{le.current&&!le.current.contains(f.relatedTarget)&&!f.target.classList.contains("pkt-hide")&&xe()},[xe]);return{componentId:E,strings:T,todayDate:V,year:J,month:ne,activeSelected:N,_selected:j,inRange:pe,rangeHovered:ve,focusedDate:Y,range:n,multiple:t,weeknumbers:p,withcontrols:m,earliest:r,latest:a,excludedates:G,excludeweekdays:d,className:M,dateConstraints:Ge,calendarRef:le,selectableDatesRef:re,tabIndexSetRef:Ke,prevMonth:Pe,nextMonth:Ve,changeMonth:Se,handleDateSelect:de,addToSelected:Z,removeFromSelected:te,toggleSelectedDate:ut,handleRangeHover:W,isExcluded:at,isDayDisabled:be,focusOnCurrentDate:Be,handleKeydown:yt,handleFocusOut:Wt,close:xe,setFocusedDate:Ee}}const nf=({componentId:s,strings:e,year:t,month:i,earliest:n,latest:r,withcontrols:a,prevMonth:l,nextMonth:d,changeMonth:p})=>{const m=y=>{const k=y==="prev",g=k?Wp(t,i,n):zp(t,i,r),$=k?e.prevMonth:e.nextMonth,C=k?"chevron-thin-left":"chevron-thin-right",M=k?"pkt-calendar__prev-month":"pkt-calendar__next-month",S=k?l:d;return o.jsx("div",{children:o.jsxs("button",{type:"button","aria-label":$,onClick:()=>g&&S(),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g&&S())},className:["pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",M,!g&&"pkt-invisible"].filter(Boolean).join(" "),"data-disabled":g?void 0:"disabled","aria-disabled":!g||void 0,tabIndex:g?0:-1,children:[o.jsx(K,{className:"pkt-btn__icon",name:C}),o.jsx("span",{className:"pkt-btn__text",children:$})]})})},v=()=>a?o.jsxs("div",{className:"pkt-cal-month-picker",children:[o.jsx("label",{htmlFor:`${s}-monthnav`,className:"pkt-hide",children:e.month}),o.jsx("select",{"aria-label":e.month,className:"pkt-input pkt-input-compact",id:`${s}-monthnav`,value:i,onChange:y=>{y.stopPropagation(),p(t,parseInt(y.target.value))},children:e.months.map((y,k)=>o.jsx("option",{value:k,children:y},k))}),o.jsx("label",{htmlFor:`${s}-yearnav`,className:"pkt-hide",children:e.year}),o.jsx("input",{"aria-label":e.year,className:"pkt-input pkt-cal-input-year pkt-input-compact",id:`${s}-yearnav`,type:"number",size:4,placeholder:"0000",value:t,onChange:y=>{y.stopPropagation(),p(parseInt(y.target.value),i)}})]}):o.jsxs("div",{className:"pkt-txt-16-medium pkt-calendar__month-title","aria-live":"polite",children:[e.months[i]," ",t]});return o.jsxs("nav",{className:"pkt-cal-month-nav",children:[m("prev"),v(),m("next")]})};function rf(s,e,t){const i=Js(t.year,t.month,s),n=nt(i),r=n===nt(e),a=t.activeSelected.includes(n),l=t.isDayDisabled(i,a);let d;return t.focusedDate?d=t.focusedDate===n&&!l?"0":"-1":!l&&t.tabIndexSetRef.current===0?(t.tabIndexSetRef.current=s,d="0"):d=t.tabIndexSetRef.current===s?"0":"-1",{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:l,ariaLabel:Lp(i),tabindex:d}}function af(s,e){const{currentDateISO:t,isToday:i,isSelected:n}=s,r=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],a=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return ce({"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":e.inRange[t],"pkt-cal-excluded":e.isExcluded(s.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":e.rangeHovered!==null&&t===nt(e.rangeHovered)})}function of(s,e){const{currentDateISO:t,isToday:i,isSelected:n,isDisabled:r}=s,a=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],l=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return ce({"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":e.inRange[t],"pkt-calendar__date--in-range-hover":e.rangeHovered!==null&&t===nt(e.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l})}const lf=({state:s})=>{const{strings:e,year:t,month:i,activeSelected:n,focusedDate:r,inRange:a,rangeHovered:l,range:d,multiple:p,weeknumbers:m,selectableDatesRef:v,tabIndexSetRef:y,handleDateSelect:k,handleRangeHover:g,isExcluded:$,isDayDisabled:C,setFocusedDate:M,todayDate:S}=s,E={year:t,month:i,activeSelected:n,focusedDate:r,tabIndexSetRef:y,isDayDisabled:C},T={range:d,activeSelected:n,rangeHovered:l,inRange:a,isExcluded:$},V=()=>{const D=[];m&&D.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__week-number",children:e.week})},"week-header"));for(let N=0;N<e.daysShort.length;N++)D.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__day-name","aria-label":e.days[N],children:e.daysShort[N]})},`day-${N}`));return o.jsx("tr",{className:"pkt-cal-week-row",children:D})},G=(D,N)=>{const j=rf(D,N,E),{currentDate:J,currentDateISO:X,isSelected:ne,isDisabled:ae,ariaLabel:pe,tabindex:oe}=j;v.current.push({currentDateISO:X,isDisabled:ae,tabindex:oe});const ve=af(j,T),z=of(j,T);return o.jsx("td",{className:ve,children:o.jsx("button",{type:"button","aria-pressed":ne?"true":"false",disabled:ae,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${z}`,onMouseOver:()=>d&&!$(J)&&g(J),onFocus:()=>{d&&!$(J)&&g(J),M(X)},"aria-label":pe,tabIndex:parseInt(oe),"data-disabled":ae?"disabled":void 0,"data-date":X,onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),k(J))},onClick:Y=>{ae||(Y.preventDefault(),k(J))},children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:D})})},X)},ie=(D,N)=>o.jsx("td",{className:"pkt-cal-other",children:o.jsx("div",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only","data-disabled":"disabled",children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:D})})},N),we=()=>{const D=S,N=Gp(t,i);v.current=[],y.current=0;let j=1,J=N.initialWeek;const X=[];for(let ne=0;ne<N.numRows;ne++){const ae=[];m&&ae.push(o.jsx("td",{className:"pkt-cal-week",children:J},`week-${J}`)),J++;for(let pe=0;pe<Pi;pe++){const oe=Xp(ne,pe,j,N);if(oe==="current-month")ae.push(G(j,D)),j++;else{const ve=Qp(oe,pe,j,N);ae.push(ie(ve,`${oe}-${ne}-${pe}`)),oe==="next-month"&&j++}}X.push(o.jsx("tr",{className:"pkt-cal-week-row",role:"row",children:ae},`row-${ne}`))}return X};return o.jsxs("table",{className:"pkt-cal-days pkt-txt-12-medium pkt-calendar__body",role:"grid","aria-multiselectable":d||p||void 0,children:[o.jsx("thead",{children:V()}),o.jsx("tbody",{children:we()})]})},er=h.forwardRef((s,e)=>{const t=sf(s);return h.useImperativeHandle(e,()=>({handleDateSelect:t.handleDateSelect,addToSelected:t.addToSelected,removeFromSelected:t.removeFromSelected,toggleSelected:t.toggleSelectedDate,focusOnCurrentDate:t.focusOnCurrentDate,close:t.close}),[t.handleDateSelect,t.addToSelected,t.removeFromSelected,t.toggleSelectedDate,t.focusOnCurrentDate,t.close]),o.jsxs("div",{ref:t.calendarRef,className:["pkt-calendar",t.weeknumbers&&"pkt-cal-weeknumbers",t.className].filter(Boolean).join(" "),onBlur:t.handleFocusOut,onKeyDown:t.handleKeydown,children:[o.jsx(nf,{componentId:t.componentId,strings:t.strings,year:t.year,month:t.month,earliest:t.earliest,latest:t.latest,withcontrols:t.withcontrols,prevMonth:t.prevMonth,nextMonth:t.nextMonth,changeMonth:t.changeMonth}),o.jsx(lf,{state:t})]})});er.displayName="PktCalendar";const cf=At({tagName:"pkt-card",elementClass:We,react:h,displayName:"PktCard",events:{}}),io=h.forwardRef(({children:s,...e},t)=>o.jsx(cf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));io.displayName="PktCard";const no=h.forwardRef(({id:s,hasTile:e=!1,disabled:t=!1,label:i,checkHelptext:n,hasError:r=!1,className:a,isSwitch:l=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:m,checked:v,indeterminate:y,optionalTag:k,optionalText:g="Valgfritt",requiredTag:$,requiredText:C="Må fylles ut",tagText:M,...S},E)=>{const T=h.useRef(null);h.useEffect(()=>{T.current&&y!==void 0&&(T.current.indeterminate=y)},[y]),h.useEffect(()=>{typeof E=="function"?E(T.current):E&&(E.current=T.current)},[E]);const V=[a,"pkt-input-check"].filter(Boolean).join(" "),G=["pkt-input-check__input-label",t?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),ie=["pkt-input-check__input",e?"pkt-input-check__input--tile":"",t&&e?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),we=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),D=()=>o.jsxs(o.Fragment,{children:[M&&o.jsx("span",{className:we+" pkt-tag--gray",children:M}),k&&o.jsx("span",{className:we+" pkt-tag--blue-light",children:g}),$&&o.jsx("span",{className:we+" pkt-tag--beige",children:C})]});return o.jsx("div",{className:V,children:o.jsxs("div",{className:ie,children:[p==="left"&&o.jsxs("label",{className:G,htmlFor:s,children:[i," ",D(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),o.jsx("input",{role:l?"switch":"checkbox",ref:T,className:`pkt-input-check__input-checkbox ${r?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:t,...v!==void 0?{checked:v}:{defaultChecked:m},...S}),p==="right"&&o.jsxs("label",{className:G,htmlFor:s,children:[i," ",D(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});no.displayName="PktCheckbox";const df=At({tagName:"pkt-combobox",elementClass:Oe,react:h,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),ro=h.forwardRef(({children:s,helptext:e,...t},i)=>o.jsxs(df,{...t,ref:i,children:[e&&o.jsx("div",{slot:"helptext",className:"pkt-contents",children:e}),s]}));ro.displayName="PktCombobox";const ln=At({tagName:"pkt-consent",elementClass:Ct,react:h,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});ln.displayName="PktConsent";const Os=h.forwardRef(({forId:s,label:e,helptext:t,helptextDropdown:i,helptextDropdownButton:n,counter:r,counterCurrent:a=0,counterMaxLength:l,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:y=null,hasError:k=!1,errorMessage:g,disabled:$=!1,inline:C=!1,ariaDescribedby:M,useWrapper:S=!0,children:E,className:T="",hasFieldset:V=!1,role:G="group",counterPosition:ie="bottom"},we)=>{const[D,N]=h.useState(!1),j=M||(t?`${s}-helptext`:void 0),J=!!r,X=J&&ie==="top",ne=J&&ie==="bottom",ae=()=>N(re=>!re),pe=["pkt-inputwrapper",T,k?"pkt-inputwrapper--error":"",$?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),oe=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),ve=()=>J?o.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[a,l?`/${l}`:""]}):null,z=()=>o.jsxs(o.Fragment,{children:[y&&o.jsx("span",{className:oe+" pkt-tag--gray",children:y}),d&&o.jsx("span",{className:oe+" pkt-tag--blue-light",children:p}),m&&o.jsx("span",{className:oe+" pkt-tag--beige",children:v})]}),Y=()=>{const re=o.jsxs(o.Fragment,{children:[e," ",z()]});return S?V?o.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:re}):o.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":j,id:`${s}-label`,children:re}):o.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":j,id:`${s}-label`,children:e})},Ee=()=>!t&&!i?null:o.jsxs(o.Fragment,{children:[t&&S&&o.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:t}),i&&o.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[o.jsx(it,{skin:"tertiary",size:"small",variant:"icon-right",iconName:D?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ae,children:o.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),o.jsx("div",{className:`pkt-inputwrapper__helptext ${D?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),le=o.jsxs(o.Fragment,{children:[Y(),Ee(),X&&o.jsx(ve,{}),E,ne&&o.jsx(ve,{}),k&&g&&o.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:o.jsx(rn,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:g})})]});return o.jsx("div",{className:pe,ref:we,role:G,children:V?o.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":j,children:le}):o.jsx("div",{className:"pkt-inputwrapper__fieldset",children:le})})});Os.displayName="PktInputWrapper";const ao=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},uf=()=>ao()?"text":"date",hf=s=>!s||s.length!==2?!0:jp(s[0],s[1]),pf=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),ff=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),mf=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),gf=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,vf=(s,e,t=!1)=>{var l;if(!s||!e)return;const i=((l=e.parentElement)==null?void 0:l.getBoundingClientRect())||e.getBoundingClientRect(),n=t?i.height+30:i.height,r=s.getBoundingClientRect().height;let a=t?"calc(100% - 30px)":"100%";i&&i.top+r>window.innerHeight&&i.top-r>0&&(a=`calc(100% - ${n}px - ${r}px)`),s.style.top=a},cn=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},bf=({open:s,multiple:e=!1,range:t=!1,weeknumbers:i=!1,withcontrols:n=!1,selected:r=[],earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:v,today:y,inputRef:k,hasCounter:g=!1,onDateSelected:$,onClose:C})=>{const M=h.useRef(null),S=h.useRef(!1);s&&(S.current=!0),h.useEffect(()=>{s&&vf(M.current,(k==null?void 0:k.current)??null,g)},[s,k,g]);const E=["pkt-calendar-popup",s?"show":"hide"].join(" "),T=s||S.current;return o.jsx("div",{ref:M,className:E,hidden:!s,"aria-hidden":!s,children:T&&o.jsx(er,{multiple:e,range:t,weeknumbers:i,withcontrols:n,selected:r,earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:v,today:y,onDateSelected:$,onClose:C})})},dn=h.forwardRef(({children:s,skin:e,textStyle:t,size:i,closeTag:n,className:r,iconName:a,ariaLabel:l,onClose:d,type:p,"aria-description":m,...v},y)=>{const[k,g]=h.useState(!1),$=h.useCallback(()=>{g(!0),d&&d()},[d]),C=h.useRef(null),[M,S]=h.useState("");h.useEffect(()=>{var G,ie;S(((ie=(G=C.current)==null?void 0:G.textContent)==null?void 0:ie.trim())??"")},[s]);const E=h.useMemo(()=>{if(n&&!l)return M&&`Klikk for å fjerne ${M}`||m},[n,l,M,m]),T={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${t}`]:!!t},V={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,"pkt-btn--icons-right-and-left":n&&!!a,"pkt-hide":k};return n?o.jsxs("button",{...v,className:ce(V,r),type:p,onClick:$,"aria-label":l,"aria-description":E,ref:y,children:[a&&o.jsx(K,{className:"pkt-tag__icon",name:a}),o.jsx("span",{ref:C,children:s}),o.jsx(K,{className:"pkt-tag__close-btn",name:"close"})]}):o.jsxs("span",{...v,className:ce(T,r),ref:y,children:[a&&o.jsx(K,{className:"pkt-tag__icon",name:a,"aria-hidden":"true"}),o.jsx("span",{ref:C,children:s})]})});dn.displayName="PktTag";const yf=({dates:s,dateformat:e,idBase:t,strings:i,onDateRemoved:n})=>{var l;const r=Up(s),a=((l=i==null?void 0:i.calendar)==null?void 0:l.buttonAltText)??"Slett dato";return o.jsx("div",{className:"pkt-date-tags pkt-datepicker__tags","aria-live":"polite",children:r.map(d=>{const p=Ip(d,e);return o.jsx(dn,{id:`${t}${d}-tag`,closeTag:!0,ariaLabel:`${a} ${p}`,onClose:()=>n(d),children:o.jsx("time",{dateTime:d,children:p})},d)})})},kf=({state:s})=>{var Ge,rt,xe,Se;const{id:e,inputId:t,values:i,dateformat:n,multiple:r,range:a,showRangeLabels:l,disabled:d,readOnly:p,required:m,label:v,name:y,placeholder:k,hasError:g,helptext:$,minStr:C,maxStr:M,inputType:S,isIOSDevice:E,strings:T,inputClasses:V,buttonClasses:G,rangeLabelClasses:ie,datepickerInputsClasses:we,isInputDisabled:D,inputRef:N,inputRefTo:j,btnRef:J,toggleCalendar:X,handleFocus:ne,handleSingleInputChange:ae,handleRangeFromChange:pe,handleRangeToChange:oe,handleRangeBlur:ve,handleMultipleBlur:z,handleTagRemoved:Y,handleSingleKeydown:Ee,handleRangeFromKeydown:le,handleRangeToKeydown:re,handleMultipleKeydown:Ke,restProps:He}=s,Ne=()=>{var Pe,Ve;return o.jsxs("button",{ref:J,className:G,type:"button",onClick:X,disabled:d,"aria-label":((Pe=T.calendar)==null?void 0:Pe.buttonAltText)??"Åpne kalender",children:[o.jsx(K,{name:"calendar"}),o.jsx("span",{className:"pkt-btn__text",children:((Ve=T.calendar)==null?void 0:Ve.buttonAltText)??"Åpne kalender"})]})};return r?o.jsxs(o.Fragment,{children:[o.jsx(yf,{dates:i,dateformat:n,idBase:e,strings:T,onDateRemoved:Y}),o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...He,ref:N,className:V,type:S,id:t,name:y??e,placeholder:k,readOnly:p||E&&!p,disabled:D,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:X,onKeyDown:Ke,onFocus:ne,onBlur:z}),Ne()]})})]}):a?o.jsx("div",{className:we,children:o.jsxs("div",{className:"pkt-input__container",children:[l&&o.jsx("div",{className:"pkt-input-prefix",children:((Ge=T.generic)==null?void 0:Ge.from)??"Fra"}),o.jsx("input",{...He,ref:N,className:V,type:S,id:t,name:y?`${y}-from`:`${e}-from`,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||E&&!p,disabled:d,required:m,"aria-label":`${v} ${((rt=T.generic)==null?void 0:rt.from)??"Fra"}`,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:X,onKeyDown:le,onFocus:ne,onBlur:ve,onChange:pe}),o.jsx("div",{className:ie,id:`${e}-to-label`,children:((xe=T.generic)==null?void 0:xe.to)??"Til"}),!l&&o.jsx("div",{className:"pkt-input-separator",children:"–"}),o.jsx("input",{ref:j,className:V,type:S,id:`${e}-to`,name:y?`${y}-to`:`${e}-to`,value:i[1]??"",min:C,max:M,readOnly:p||E&&!p,disabled:d,"aria-label":`${v} ${((Se=T.generic)==null?void 0:Se.to)??"Til"}`,"aria-invalid":g,onClick:X,onKeyDown:re,onFocus:ne,onBlur:ve,onChange:oe}),Ne()]})}):o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...He,ref:N,className:V,type:S,id:t,name:y??e,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||E&&!p,disabled:d,required:m,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:X,onKeyDown:Ee,onFocus:ne,onBlur:void 0,onChange:ae}),Ne()]})})},_f={calendar:{buttonAltText:"Åpne kalender"}},$f={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}},oo=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[];function wf(s,e){const{id:t,label:i,value:n,defaultValue:r,dateformat:a="dd.MM.yyyy",multiple:l=!1,maxlength:d,range:p=!1,showRangeLabels:m=!1,weeknumbers:v=!1,withcontrols:y=!1,excludedates:k,excludeweekdays:g,currentmonth:$,today:C,calendarOpen:M,timezone:S,fullwidth:E=!1,hasFieldset:T=!1,inline:V=!1,helptext:G,helptextDropdown:ie,helptextDropdownButton:we,hasError:D=!1,errorMessage:N,optionalTag:j=!1,optionalText:J,requiredTag:X=!1,requiredText:ne,tagText:ae,useWrapper:pe=!0,strings:oe,disabled:ve=!1,readOnly:z=!1,required:Y=!1,name:Ee,min:le,max:re,placeholder:Ke,onChange:He,onValueChange:Ne,className:Ge,...rt}=s,xe=h.useCallback(O=>O===void 0?[]:oo(O),[]),Se=n!==void 0,Pe=typeof r=="number"?void 0:r,[Ve,at]=h.useState(()=>xe(n??Pe)),be=Se?xe(n):Ve;h.useEffect(()=>{Se&&at(xe(n))},[n,Se,xe]);const[ke,W]=h.useState(M??!1);h.useEffect(()=>{M!==void 0&&W(M)},[M]);const de=h.useRef(null),Z=h.useRef(null),te=h.useRef(null),ut=h.useRef(null),Be=h.useRef(null),Ue=h.useMemo(()=>uf(),[]),yt=h.useMemo(()=>ao(),[]),Wt=h.useMemo(()=>oe??(p?$f:_f),[oe,p]),f=typeof le=="string"?le:le!==void 0?String(le):void 0,u=typeof re=="string"?re:re!==void 0?String(re):void 0,_=h.useMemo(()=>{const O=pf(E,m,l,p,z,Ue);return Object.entries(O).filter(([,P])=>P).map(([P])=>P).join(" ")},[E,m,l,p,z,Ue]),x=h.useMemo(()=>{const O=ff();return Object.entries(O).filter(([,P])=>P).map(([P])=>P).join(" ")},[]),B=h.useMemo(()=>{const O=mf(m);return Object.entries(O).filter(([,P])=>P).map(([P])=>P).join(" ")},[m]),U=h.useMemo(()=>["pkt-datepicker__inputs",p&&m&&"pkt-input__range-inputs"].filter(Boolean).join(" "),[p,m]),ee=h.useMemo(()=>{if($)return $;if(u)return u.slice(0,7)},[$,u]),ht=ve||l&&d!=null&&be.length>=d,Xe=l&&d!=null,pt=`${t}-input`,ls=be.join(",");h.useEffect(()=>{te.current&&(te.current.value=ls)},[ls]),h.useEffect(()=>{S&&typeof window<"u"&&S!==window.pktTz&&(window.pktTz=S)},[S]);const Je=h.useCallback((O,P=!0)=>{Se||at(O),P&&(Ne==null||Ne(O))},[Se,Ne]),cr=h.useMemo(()=>{var O;return(O=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:O.set},[]),kt=h.useCallback(O=>{const P=te.current;!P||!cr||(cr.call(P,O.join(",")),P.dispatchEvent(new Event("input",{bubbles:!0})))},[cr]),Zt=h.useCallback(()=>{ve||W(O=>!O)},[ve]),cs=h.useCallback(()=>{W(!1)},[]);h.useEffect(()=>{if(!ke)return;const O=Re=>{var vn;const Qe=Re.target;Be.current&&!Be.current.contains(Qe)&&!((vn=Qe.closest)!=null&&vn.call(Qe,".pkt-calendar-popup"))&&cs()},P=Re=>{var Qe;Re.key==="Escape"&&(cs(),(Qe=de.current)==null||Qe.focus())};return document.addEventListener("click",O,!0),document.addEventListener("keydown",P),()=>{document.removeEventListener("click",O,!0),document.removeEventListener("keydown",P)}},[ke,cs]);const Vm=h.useCallback(()=>{yt&&!ke&&W(!0)},[yt,ke]),Um=h.useCallback(O=>{var Qe;const P=gf(O,l,p),Re=oo(P);Je(Re),kt(Re),!l&&!p&&(cs(),(Qe=de.current)==null||Qe.focus())},[l,p,Je,kt,cs]),jm=h.useCallback(()=>{var O;cs(),(O=de.current)==null||O.focus()},[cs]),qm=h.useCallback(O=>{const P=O.target.value,Re=P?[P]:[];Je(Re),kt(Re)},[Je,kt]),Wm=h.useCallback(O=>{const P=O.target.value,Re=be[1]??"",Qe=[P,Re].filter(Boolean);Je(Qe),kt(Qe)},[be,Je,kt]),zm=h.useCallback(O=>{const P=be[0]??"",Re=O.target.value,Qe=[P,Re].filter(Boolean);Je(Qe),kt(Qe)},[be,Je,kt]),Ym=h.useCallback(()=>{be.length===2&&!hf(be)&&(Je([be[0]]),kt([be[0]]))},[be,Je,kt]),gn=h.useCallback(O=>{const P=Qt(O),Re=f?Qt(f):null,Qe=u?Qt(u):null;if(P&&!isNaN(P.getTime())&&(!Re||P>=Re)&&(!Qe||P<=Qe)){const vn=Vp([...be,O],f,u,k,g),Ho=[...new Set(vn)];Je(Ho),kt(Ho)}},[be,f,u,k,g,Je,kt]),Km=h.useCallback(O=>{const P=O.target;P.value&&(gn(P.value.split(",")[0]),P.value="")},[gn]),Fo=h.useCallback(O=>{const P=O.target;P.value&&(gn(P.value.split(",")[0]),P.value="")},[gn]),Gm=h.useCallback(O=>{const P=be.filter(Re=>Re!==O);Je(P),kt(P)},[be,Je,kt]),ds=h.useCallback(O=>{const P=O==null?void 0:O.closest("form");P?P.requestSubmit():O==null||O.blur()},[]),Xm=h.useCallback(O=>{cn(O.nativeEvent,()=>Zt(),()=>ds(de.current),void 0,()=>{var P;return(P=de.current)==null?void 0:P.blur()})},[Zt,ds]),Qm=h.useCallback(O=>{cn(O.nativeEvent,()=>Zt(),()=>ds(de.current),()=>{var P;return(P=Z.current)==null?void 0:P.focus()},()=>{var P;return(P=de.current)==null?void 0:P.blur()})},[Zt,ds]),Zm=h.useCallback(O=>{cn(O.nativeEvent,()=>Zt(),()=>ds(Z.current),void 0,()=>{var P;return(P=Z.current)==null?void 0:P.blur()})},[Zt,ds]),Jm=h.useCallback(O=>{cn(O.nativeEvent,()=>Zt(),()=>ds(de.current),void 0,()=>{var P;return(P=de.current)==null?void 0:P.blur()},Fo)},[Zt,ds,Fo]);return h.useImperativeHandle(e,()=>({get value(){var O;return((O=te.current)==null?void 0:O.value)??""},set value(O){const P=O?O.split(",").filter(Boolean):[];at(P),te.current&&(te.current.value=O??"")},focus(){var O;(O=de.current)==null||O.focus()},blur(){var O;(O=de.current)==null||O.blur()}}),[]),{id:t,inputId:pt,label:i,values:be,calendarOpen:ke,dateformat:a,multiple:l,maxlength:d,range:p,showRangeLabels:m,weeknumbers:v,withcontrols:y,excludedates:k,excludeweekdays:g,disabled:ve,readOnly:z,required:Y,name:Ee,placeholder:Ke,fullwidth:E,hasFieldset:T,inline:V,helptext:G,helptextDropdown:ie,helptextDropdownButton:we,hasError:D,errorMessage:N,optionalTag:j,optionalText:J,requiredTag:X,requiredText:ne,tagText:ae,useWrapper:pe,className:Ge,minStr:f,maxStr:u,effectiveCurrentMonth:ee,today:C,inputType:Ue,isIOSDevice:yt,strings:Wt,inputClasses:_,buttonClasses:x,rangeLabelClasses:B,datepickerInputsClasses:U,isInputDisabled:ht,hasCounter:Xe,inputRef:de,inputRefTo:Z,changeInputRef:te,btnRef:ut,wrapperRef:Be,onChange:He,toggleCalendar:Zt,hideCalendar:cs,handleDateSelected:Um,handleCalendarClose:jm,handleFocus:Vm,handleSingleInputChange:qm,handleRangeFromChange:Wm,handleRangeToChange:zm,handleRangeBlur:Ym,handleMultipleBlur:Km,handleTagRemoved:Gm,handleSingleKeydown:Xm,handleRangeFromKeydown:Qm,handleRangeToKeydown:Zm,handleMultipleKeydown:Jm,restProps:rt}}const lo=h.forwardRef((s,e)=>{const t=wf(s,e),i=["pkt-datepicker",t.className].filter(Boolean).join(" ");return o.jsxs("div",{className:i,children:[o.jsx(Os,{ref:t.wrapperRef,forId:t.inputId,label:t.label,hasFieldset:t.hasFieldset,inline:t.inline,helptext:t.helptext,helptextDropdown:t.helptextDropdown,helptextDropdownButton:t.helptextDropdownButton,hasError:t.hasError,errorMessage:t.errorMessage,disabled:t.disabled,optionalTag:t.optionalTag,optionalText:t.optionalText,requiredTag:t.requiredTag,requiredText:t.requiredText,tagText:t.tagText,useWrapper:t.useWrapper,counter:t.hasCounter,counterCurrent:t.values.length,counterMaxLength:t.maxlength,children:o.jsx(kf,{state:t})}),o.jsx(bf,{open:t.calendarOpen,multiple:t.multiple,range:t.range,weeknumbers:t.weeknumbers,withcontrols:t.withcontrols,selected:t.values,earliest:t.minStr,latest:t.maxStr,excludedates:t.excludedates,excludeweekdays:t.excludeweekdays,maxMultiple:t.maxlength,currentmonth:t.effectiveCurrentMonth,today:t.today,inputRef:t.inputRef,hasCounter:t.hasCounter,onDateSelected:t.handleDateSelected,onClose:t.handleCalendarClose}),o.jsx("input",{ref:t.changeInputRef,type:"text",name:t.name,onChange:t.onChange,tabIndex:-1,"aria-hidden":"true",className:"pkt-visually-hidden"})]})});lo.displayName="PktDatepicker";const xf={dropFilesHere:"Slipp filene her ...",selectOrDragFiles:"Dra filer hit for å laste dem opp eller ",chooseFiles:"velg filer"},Sf={dropFilesHere:"Slipp filen her ...",selectOrDragFiles:"Dra en fil for å laste den opp eller ",chooseFiles:"velg en fil"},Cf={dropFilesHere:"Slipp bildene her ...",selectOrDragFiles:"Dra bilder hit for å laste dem opp eller ",chooseFiles:"velg fra kamerarull"},Tf={dropFilesHere:"Slipp bildet her ...",selectOrDragFiles:"Dra et bilde for å laste det opp eller ",chooseFiles:"velg fra kamerarull"},co=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Nf=()=>{const s=co(),e=co();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)};class Mf{constructor(e,t){bn(this,"fileId");bn(this,"file");bn(this,"attributes",{});this.fileId=t||Nf(),this.file=e,this.attributes={targetFilename:e.name}}}const tr=h.createContext({}),Df=h.forwardRef(({id:s,multiple:e,value:t,onFilesAdded:i=()=>{},name:n,uploadStrategy:r,accept:a=".pdf, .jpeg, .jpg, .png, .heic, .doc, .docx, .odt",isThumbnailView:l=!1,disabled:d=!1,srAnnouncementIds:p,...m},v)=>{const y=h.useRef(null),k=h.useMemo(()=>((a==null?void 0:a.split(/\s*,\s*/).map(D=>D.trim()))||[]).join(", ").toUpperCase(),[a]);h.useImperativeHandle(v,()=>y.current);const[g,$]=h.useState(!1),C=h.useMemo(()=>l?e?Cf:Tf:e?xf:Sf,[e,l]),M=h.useCallback(D=>{if(y.current)try{y.current.files=Of(D)}catch{}},[y.current,t]);h.useEffect(()=>{M(t)},[y,t]);const S=h.useCallback(D=>{const N=D.map(j=>new Mf(j));i(N),y.current&&(y.current.value="")},[i]),E=D=>{const N=D.target.files;if(N.length===0){e&&M(t);return}S(Array.from(N))},T=D=>{S(D)},V=D=>{if(D.preventDefault(),$(!1),d)return;const N=D.dataTransfer.files,j=Array.from(N);T(j)},G=D=>{D.preventDefault(),!d&&$(!0)},ie=()=>{$(!1)},we=h.useCallback(D=>{var j;d||D.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog")||(j=y.current)==null||j.click()},[d]);return o.jsxs("div",{onDrop:V,onDragOver:G,onDragLeave:ie,onClick:we,className:ce("pkt-fileupload__drop-zone",{"pkt-fileupload__drop-zone--drag-active":g,"pkt-fileupload__drop-zone--disabled":d}),children:[o.jsx("input",{...m,id:s,type:"file",ref:y,multiple:e,onChange:E,accept:a,disabled:d,name:r==="form"&&n||void 0,"aria-label":e?"Velg filer":"Velg fil"}),r==="custom"&&o.jsx(o.Fragment,{children:t==null?void 0:t.map(D=>o.jsx("input",{type:"hidden",name:n,value:D.fileId},D.fileId))}),o.jsxs("div",{className:"pkt-fileupload__drop-zone__placeholder",children:[o.jsx(K,{name:"attachment",className:"pkt-fileupload__drop-zone__placeholder__icon","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__drop-zone__placeholder__title",children:g?`${C.dropFilesHere} ...`:o.jsxs(o.Fragment,{children:[C.selectOrDragFiles," ",o.jsx("button",{className:"pkt-fileupload__drop-zone__placeholder__title__open-file-dialog",onClick:D=>{var N;D.preventDefault(),D.stopPropagation(),(N=y.current)==null||N.click()},type:"button",children:C.chooseFiles})]})}),o.jsxs("p",{className:"pkt-fileupload__drop-zone__placeholder__formats",children:["Format: ",k]})]})]})}),Of=s=>{const e=new DataTransfer;for(const t of s)e.items.add(t.file);return e.files},sr=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,counter:i,counterMaxLength:n,className:r,disabled:a,errorMessage:l,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,fullwidth:k=!1,label:g,name:$,optionalTag:C=!1,optionalText:M,requiredTag:S=!1,requiredText:E,tagText:T=null,placeholder:V,rows:G,useWrapper:ie=!0,onChange:we,value:D,autoComplete:N="off",minLength:j,maxLength:J,readOnly:X,skipForwardTestid:ne=!1,...ae},pe)=>{const oe=[r,"pkt-textinput","pkt-textarea"].join(" "),ve=`${s}-input`,z=`${ve}-label`,Y=t||z,[Ee,le]=h.useState(0),re=Ke=>{var He,Ne;i&&le(((Ne=(He=Ke.currentTarget)==null?void 0:He.value)==null?void 0:Ne.length)||0),we&&we(Ke)};return h.useEffect(()=>{D!==void 0&&le((D==null?void 0:D.length)||0)},[D]),o.jsx(Os,{ariaDescribedby:e,className:oe,disabled:a,errorMessage:l,forId:ve,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,label:g,optionalTag:C,optionalText:M,requiredTag:S,requiredText:E,tagText:T,useWrapper:ie,counter:i,counterCurrent:Ee,counterMaxLength:n,children:o.jsx("textarea",{ref:pe,className:`pkt-input ${k?"pkt-input--fullwidth":""} ${n&&Ee>n?"pkt-input--counter-error":""}`,name:`${$||s}`,id:ve,placeholder:V,disabled:a,rows:G,"aria-labelledby":Y,"aria-invalid":d,"aria-errormessage":`${s}-error`,...ae,onChange:re,value:D,autoComplete:N,minLength:j,maxLength:J,readOnly:X,"data-skip-forward-testid":ne?"true":void 0})})});sr.displayName="PktTextarea";const Ef=Symbol("comment"),Pf=s=>{const e=String(s.getDate()).padStart(2,"0"),t=String(s.getMonth()+1).padStart(2,"0"),i=s.getFullYear(),n=String(s.getHours()).padStart(2,"0"),r=String(s.getMinutes()).padStart(2,"0");return`${e}.${t}.${i} kl. ${n}:${r}`},Af=({fileItem:s,closeOperationUi:e,onAddComment:t,existingComment:i})=>{const n=h.useRef(null),r=!!i,a=()=>{var d,p;const l=(p=(d=n.current)==null?void 0:d.value)==null?void 0:p.trim();l&&t({text:l,timestamp:new Date}),e()};return h.useLayoutEffect(()=>{const l=setTimeout(()=>{var d;return(d=n.current)==null?void 0:d.focus({preventScroll:!0})},0);return()=>clearTimeout(l)},[s.fileId]),o.jsxs(o.Fragment,{children:[o.jsx(sr,{autoFocus:!0,label:r?"Rediger kommentar":"Legg til kommentar",name:`comment-${s.fileId}`,className:"pkt-fileupload__queue-display__item__comment-input",placeholder:"Skriv inn kommentar",rows:2,id:`comment-${s.fileId}`,ref:n,defaultValue:i==null?void 0:i.text}),o.jsx(it,{skin:"secondary",size:"small",onClick:a,children:r?"Lagre kommentar":"Legg til kommentar"}),o.jsx(it,{skin:"tertiary",size:"small",onClick:e,children:"Avbryt"})]})},If=({comments:s,onDeleteComment:e,onEditComment:t})=>s&&s.length>0?o.jsx("div",{className:"pkt-fileupload__queue-display__item__comments",children:s.map((i,n)=>o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment",children:[o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__content",children:[o.jsx("span",{className:"pkt-fileupload__queue-display__item__comment__text","aria-label":"Kommentar tekst",children:i.text}),o.jsx("time",{className:"pkt-fileupload__queue-display__item__comment__time",children:Pf(i.timestamp)})]}),o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__actions",children:[e&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>e(n),"aria-label":"Slett kommentar",children:o.jsx(K,{name:"trash-can"})}),t&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>t(n),"aria-label":"Rediger kommentar",children:o.jsx(K,{name:"edit"})})]})]},n))}):null,Lf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-comments`,value:s.comments?JSON.stringify(s.comments):""})},Bf=s=>{const e=s("comments"),t=(n,r)=>{e.set(n,[r])},i=(n,r)=>{const l=(e.get(n)||[]).filter((d,p)=>p!==r);e.set(n,l.length>0?l:void 0)};return{title:n=>{const r=e.get(n.fileId);return r&&r.length>0?"":"Legg til kommentar"},renderExtendedUI:(n,r)=>{const a=e.get(n.fileId),l=a==null?void 0:a[0];return o.jsx(Af,{fileItem:n,closeOperationUi:r,onAddComment:d=>t(n.fileId,d),existingComment:l})},renderContent:(n,r,a)=>{if(a)return null;const l=e.get(n.fileId);return o.jsx(If,{comments:l,onDeleteComment:d=>i(n.fileId,d),onEditComment:r?()=>r():void 0})},renderHidden:n=>o.jsx(Lf,{comments:e.get(n.fileId)},`comments${n.fileId}`),symbol:Ef}},Ff=Symbol("deleteFile"),Hf=s=>({title:"Slett",ariaLabel:"Slett fil",onClick:e=>s(e.fileId),symbol:Ff}),Vf=Symbol("renameFile"),Uf=s=>{const e=h.useRef(null),t=h.useId(),i=()=>{var n;s.onSave(((n=e.current)==null?void 0:n.value)??"")};return o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:t,className:"pkt-sr-only",children:"Endre filnavn"}),o.jsx("input",{id:t,ref:e,type:"text",autoFocus:!0,defaultValue:s.value,className:"pkt-fileupload__queue-display__item__rename-input",onKeyDown:n=>{n.key==="Enter"&&(n.preventDefault(),n.stopPropagation(),i()),n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),s.onCancel())}}),o.jsx(it,{skin:"secondary",size:"small",onClick:()=>s.onSave(e.current.value),children:"Lagre"}),o.jsx(it,{skin:"tertiary",size:"small",onClick:s.onCancel,children:"Avbryt"})]})},jf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-targetFilename`,value:s.targetFilename})},qf=s=>{const e=s("targetFilename");return{title:"Rediger",ariaLabel:"Rediger filnavn",renderInlineUI:(t,i)=>o.jsx(Uf,{value:e.get(t.fileId)||void 0,onSave:n=>{e.set(t.fileId,n),i()},onCancel:i}),renderHidden:t=>o.jsx(jf,{targetFilename:e.get(t.fileId)||t.file.name},`rename${t.fileId}`),symbol:Vf}},Wf=(s,e)=>{const t=h.useCallback((r,a,l)=>{const d=s.find(m=>m.fileId===r),p=d.attributes||{};d.attributes={...p,[a]:l},e(r,{attributes:d.attributes})},[e,s]),i=h.useCallback((r,a)=>(s.find(p=>p.fileId===r).attributes||{})[a],[s]);return{fileAttributes:h.useCallback(r=>({get:a=>i(a,r),set:(a,l)=>{t(a,r,l)}}),[i,t])}},zf=s=>{const[e,t]=h.useState(!1),[i,n]=h.useState(0),r=h.useRef(null),a=h.useCallback(p=>{var v;const m=s.findIndex(y=>y.fileId===p);m>=0&&(n(m),t(!0),(v=r.current)==null||v.showModal())},[s]),l=h.useCallback(()=>{var p;t(!1),(p=r.current)==null||p.close()},[]),d=h.useCallback(p=>{s.length!==0&&n(m=>p==="prev"?m<=0?s.length-1:m-1:m>=s.length-1?0:m+1)},[s.length]);return{isOpen:e,currentIndex:i,modalRef:r,open:a,close:l,navigate:d}},Yf=s=>{const[e,t]=h.useState({}),i=h.useCallback(a=>{const l=e[a];if(l)return s.find(d=>d.symbol===l)},[e,s]),n=h.useCallback((a,l)=>{t(d=>({...d,[a]:l.symbol}))},[]),r=h.useCallback(a=>{t(l=>{const d={...l};return delete d[a],d})},[]);return{getActivated:i,activate:n,close:r}},Kf=At({tagName:"pkt-modal",elementClass:wt,react:h,displayName:"PktModal",events:{}}),ir=h.forwardRef(({children:s,...e},t)=>o.jsx(Kf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ir.displayName="PktModal";const uo=2,Gf=s=>{const e=window.getComputedStyle(s),t=parseFloat(e.lineHeight);if(!Number.isNaN(t)&&t>0)return t;const i=parseFloat(e.fontSize);return(!Number.isNaN(i)&&i>0?i:16)*1.2},Xf=(s,e,t)=>{const i=e*t;return s.getBoundingClientRect().height>i+.5},ho=h.createContext({tail:5}),Ai=({children:s,tail:e,...t})=>{const i=s,n=h.useContext(ho),r=e!==void 0?e:n.tail||0,a=s.length<=r+3?null:s.slice(-r),l=h.useRef(null),d=h.useRef(null),[p,m]=h.useState(!1),v=h.useCallback(()=>{const k=l.current,g=d.current;if(!k||!g)return;const $=Gf(k);m(Xf(g,$,uo))},[]),y=h.useMemo(()=>new ResizeObserver(k=>{k.some(g=>g.target===l.current)&&v()}),[v]);return h.useLayoutEffect(()=>(l.current&&y.observe(l.current),v(),()=>y.disconnect()),[s,y,v]),o.jsxs("span",{ref:l,...t,"data-pkt-truncate-part":"wrapper",style:{maxWidth:"100%",width:"100%",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"end",columnGap:"0.25rem",overflow:"hidden",position:"relative",...t.style},children:[o.jsx("span",{"data-pkt-truncate-part":"first",style:{minWidth:0,display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:uo,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",overflowWrap:"anywhere"},children:i}),r!==0&&o.jsx("span",{"data-pkt-truncate-part":"tail",style:{whiteSpace:"nowrap",display:p?"inline":"none",paddingRight:"0.5rem"},"aria-hidden":!0,children:a}),o.jsx("span",{ref:d,"aria-hidden":!0,"data-pkt-truncate-part":"measure",style:{position:"absolute",top:0,left:0,width:"100%",visibility:"hidden",pointerEvents:"none",whiteSpace:"normal",overflowWrap:"anywhere"},children:s})]})},Qf=s=>{if(typeof s=="number")return s;const e=s.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!e)return console.warn(`PktFileUpload: Invalid maxFileSize format "${s}". Use format like "5MB", "500KB", or a number in bytes.`),0;const t=parseFloat(e[1]);switch(e[2].toUpperCase()){case"B":return t;case"KB":return t*1024;case"MB":return t*1024*1024;case"GB":return t*1024*1024*1024;default:return t}},un=s=>s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:s<1024*1024*1024?`${Math.round(s/(1024*1024))} MB`:`${Math.round(s/(1024*1024*1024))} GB`,nr=s=>o.jsx("button",{onClick:s.onClick,className:"pkt-fileupload__queue-display__item__cancel-button","aria-label":s.ariaLabel||"Avbryt opplasting",children:s.label||"Avbryt"}),Zf=()=>{const[s,e]=h.useState(1);return h.useEffect(()=>{const t=setInterval(()=>{e(i=>i>=3?1:i+1)},400);return()=>clearInterval(t)},[]),o.jsxs("span",{className:"pkt-fileupload__queue-display__item__loading-text","aria-label":"Laster opp fil",children:["Laster opp",".".repeat(s)]})},Jf=({cancelTransfer:s,transferItem:e})=>{const t=e.showProgress??e.progress!==0;return o.jsxs(o.Fragment,{children:[o.jsx(K,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title","aria-label":"Filnavn",children:o.jsx(Ai,{children:e.attributes.targetFilename})}),o.jsx(nr,{onClick:s}),t?o.jsxs(o.Fragment,{children:[o.jsx(mn,{valueCurrent:e.progress*100,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(e.file.size)}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__percentage","aria-hidden":"true",children:`${Math.round(e.progress*100)}%`})]}):o.jsx(Zf,{})]})},Rf=({transferItem:s,onRemove:e})=>{const t=(s.lastProgress??1)*100;return o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx(nr,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),o.jsx(mn,{valueCurrent:t,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(s.file.size)}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]})},em=({transferItem:s,onRemove:e})=>o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx(nr,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]}),tm=({transferItem:s,onRemove:e})=>s.showProgress?o.jsx(Rf,{transferItem:s,onRemove:e}):o.jsx(em,{transferItem:s,onRemove:e}),sm=({operation:s,onActivate:e,transferItem:t})=>{const i=typeof s.title=="function"?s.title(t):s.title;if(!i)return null;const n=()=>{(s.renderInlineUI||s.renderExtendedUI)&&e(t.fileId,s),s.onClick&&s.onClick(t)};return o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__operation",onClick:n,"aria-label":typeof s.ariaLabel=="function"?s.ariaLabel(t):s.ariaLabel,children:i})},po=({transferItem:s})=>o.jsxs(o.Fragment,{children:[o.jsx(K,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(s.file.size)})]}),im=({transferItem:s,onPreviewClick:e})=>{const[t,i]=h.useState(null),n=s.file;h.useEffect(()=>{if(n.type.startsWith("image/")){const l=URL.createObjectURL(n);return i(l),()=>{URL.revokeObjectURL(l)}}},[n]);const r=t&&o.jsx("img",{src:t,alt:s.attributes.targetFilename})||o.jsx(K,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"}),a=!!e;return o.jsxs("div",{className:"pkt-fileupload__queue-display__item__thumbnail",children:[o.jsxs(it,{className:"pkt-fileupload__queue-display__item__thumbnail__image-wrapper","aria-label":`Forhåndsvis bilde ${s.attributes.targetFilename}`,type:"button",skin:"secondary",onClick:e,children:[a&&o.jsx(K,{name:"expand",className:"pkt-fileupload__queue-display__item__thumbnail__expand-icon","aria-hidden":"true"}),r]}),o.jsx(Ai,{className:"pkt-fileupload__queue-display__item__thumbnail__title",children:s.attributes.targetFilename})]})},fo=h.forwardRef(({isOpen:s,images:e,currentIndex:t,onClose:i,onNavigate:n},r)=>{const[a,l]=h.useState(null),d=e[t],p=e.length>1;return h.useEffect(()=>{if(d&&d.file.type.startsWith("image/")){const m=URL.createObjectURL(d.file);return l(m),()=>URL.revokeObjectURL(m)}l(null)},[d]),h.useEffect(()=>{if(!s)return;const m=v=>{switch(v.key){case"ArrowLeft":v.preventDefault(),n("prev");break;case"ArrowRight":v.preventDefault(),n("next");break;case"Escape":v.preventDefault(),i();break}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[s,n,i]),d?o.jsx(ir,{ref:r,headingText:d.attributes.targetFilename,closeOnBackdropClick:!0,className:"pkt-fileupload__image-preview-modal",children:o.jsxs("div",{className:"pkt-fileupload__image-preview",children:[p&&o.jsx(it,{variant:"icon-only",iconName:"chevron-thin-left",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev",onClick:()=>n("prev"),"aria-label":`Forrige bilde ${t} / ${e.length}`}),o.jsx("div",{className:"pkt-fileupload__image-preview__content",children:a&&o.jsx("img",{src:a,alt:`${d.attributes.targetFilename} - ${t+1} av ${e.length}`,className:"pkt-fileupload__image-preview__image"})}),p&&o.jsxs("span",{className:"pkt-fileupload__image-preview__counter",children:[t+1," / ",e.length]}),p&&o.jsx(it,{variant:"icon-only",iconName:"chevron-thin-right",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next",onClick:()=>n("next"),"aria-label":`Neste bilde ${t+2} / ${e.length}`})]})}):null});fo.displayName="ImagePreviewModal";const rr=s=>typeof s=="number"?"in-progress":s==="error"?"error":"idle",nm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__actions",children:s.filter(n=>!e||n.symbol!==e.symbol).map(n=>o.jsx(sm,{operation:n,onActivate:t,transferItem:i},n.symbol.toString()))}),rm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx(o.Fragment,{children:s.filter(n=>n.renderContent).map(n=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__operation-content",children:n.renderContent(i,()=>t(i.fileId,n),(e==null?void 0:e.symbol)===n.symbol)},n.symbol.toString()))}),am=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:n,onClose:r,onPreviewClick:a})=>{const l=()=>r(s.fileId),p=(e==null?void 0:e.renderInlineUI)||(e==null?void 0:e.renderExtendedUI)?[]:t;return o.jsxs(o.Fragment,{children:[e!=null&&e.renderInlineUI?o.jsxs(o.Fragment,{children:[o.jsx(K,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon"}),o.jsx("div",{className:"pkt-fileupload__queue-display__item__inline-ui",children:e.renderInlineUI(s,l)})]}):o.jsx(i,{transferItem:s,queueItemOperations:t,onPreviewClick:a}),p.length>0&&o.jsx(nm,{operations:p,activatedOperation:e,onActivate:n,transferItem:s}),o.jsx(rm,{operations:t,activatedOperation:e,onActivate:n,transferItem:s}),(e==null?void 0:e.renderExtendedUI)&&o.jsx("div",{className:"pkt-fileupload__queue-display__item__expanded-operation-ui",children:e.renderExtendedUI(s,l)})]})},om=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,enableImagePreview:n,onActivate:r,onClose:a,onCancelTransfer:l,onOpenPreview:d})=>{const p=rr(s.progress),m=n&&s.progress==="done"&&s.file.type.startsWith("image/");switch(p){case"in-progress":return o.jsx(Jf,{"aria-live":"off",transferItem:s,cancelTransfer:()=>l(s.fileId)});case"error":return o.jsx(tm,{transferItem:s,onRemove:()=>l(s.fileId)});case"idle":return o.jsx(am,{transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:r,onClose:a,onPreviewClick:m?()=>d(s.fileId):void 0})}},lm=(s,e)=>h.useMemo(()=>{const t=s.map(n=>{const r=e.find(a=>a.fileId===n.fileId);return{...n,progress:(r==null?void 0:r.progress)??"queued",errorMessage:r==null?void 0:r.errorMessage,showProgress:r==null?void 0:r.showProgress,lastProgress:r==null?void 0:r.lastProgress}}),i={"in-progress":0,error:1,idle:2};return t.sort((n,r)=>i[rr(n.progress)]-i[rr(r.progress)])},[s,e]),cm=(s,e)=>h.useMemo(()=>e?s.filter(t=>t.progress==="done"&&t.file.type.startsWith("image/")):[],[s,e]),dm=({files:s,cancelTransfer:e,transfers:t=[],queueItemOperations:i=[],ItemRenderer:n=po,truncateTail:r,enableImagePreview:a=!1})=>{const l=lm(s,t),d=cm(l,a),p=Yf(i),m=zf(d);return o.jsxs(o.Fragment,{children:[o.jsx("ul",{className:"pkt-fileupload__queue-display",children:o.jsx(ho.Provider,{value:{tail:r},children:l.map(v=>o.jsxs("li",{className:ce("pkt-fileupload__queue-display__item",{"pkt-fileupload__queue-display__item--in-progress":typeof v.progress=="number",[`pkt-fileupload__queue-display__item--${v.progress}`]:typeof v.progress=="string"}),children:[i.filter(y=>y.renderHidden).map(y=>y.renderHidden(v)),o.jsx(om,{transferItem:v,activatedOperation:p.getActivated(v.fileId),operations:i,ItemRenderer:n,enableImagePreview:a,onActivate:p.activate,onClose:p.close,onCancelTransfer:e,onOpenPreview:m.open})]},v.fileId))})}),a&&d.length>0&&o.jsx(fo,{ref:m.modalRef,isOpen:m.isOpen,images:d,currentIndex:m.currentIndex,onClose:m.close,onNavigate:m.navigate})]})},mo={filename:po,thumbnail:im},go=h.forwardRef(({value:s,defaultValue:e,id:t="fileupload-id",multiple:i=!1,uploadStrategy:n="form",addCommentsEnabled:r=!1,renameFilesEnabled:a=!1,truncateTail:l,onFilesChanged:d,onFileUploadRequested:p,extraOperations:m=[],itemRenderer:v=mo.filename,fullWidth:y=!1,allowedFormats:k,formatErrorMessage:g,maxFileSize:$,sizeErrorMessage:C,onFileValidation:M,errorMessage:S,hasError:E=!1,disabled:T=!1,label:V,helptext:G,optionalTag:ie,requiredTag:we,enableImagePreview:D=!1,...N},j)=>{const J="transfers"in N?N.transfers:void 0,[X,ne]=h.useState(null),ae=E||!!X,pe=S||X,oe=$?Qf($):void 0,ve=h.useCallback(W=>{var de;if(k&&k.length>0){const Z=((de=W.name.split(".").pop())==null?void 0:de.toLowerCase())||"",te=W.type.toLowerCase();if(!k.some(Be=>{const Ue=Be.toLowerCase().replace(/^\./,"");if(Ue.includes("/")){if(Ue.endsWith("/*")){const yt=Ue.replace("/*","");return te.startsWith(yt+"/")}return te===Ue}return Z===Ue})){const Be=k.join(", "),Ue=`Ugyldig filtype. Tillatte formater: ${Be}`;return(g==null?void 0:g.replace("{formats}",Be))||Ue}}if(oe&&W.size>oe){const Z=un(oe),te=`Filen er for stor. Maks størrelse er ${Z}.`;return(C==null?void 0:C.replace("{maxSize}",Z))||te}return M?M(W):null},[k,g,oe,C,M]);s!==void 0&&e!==void 0&&console.warn("PktFileupload: Både value og defaultValue er angitt. Komponenten kan være enten 'controlled' eller 'uncontrolled', ikke begge deler. Bruk kun én av dem. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable"),s!==void 0&&d===void 0&&console.warn("PktFileupload: value-prop er angitt uten onFilesChanged-callback. Når en komponent er 'controlled', må endringer håndteres via en callback. Vennligst legg til onFilesChanged-callback for å håndtere endringer i fil-listen. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable");const Y=s!==void 0?s:e||[],Ee=typeof v=="string"?mo[v]:v,le=v==="thumbnail",re=a&&!le,Ke=r&&!le,He=h.useCallback(W=>{for(const Z of W){const te=ve(Z.file);if(te){ne(te);return}}ne(null);const de=i?[...Y,...W]:[W[0]];d&&d(de),n==="custom"&&p&&W.forEach(Z=>{p==null||p(Z)})},[d,Y,i,n,p,ve]),Ne=h.useCallback((W,de)=>{const Z=Y.map(te=>te.fileId===W?{...te,...de}:te);d&&d(Z)},[d,Y]),Ge=h.useCallback(W=>{var Z;const de=Y.filter(te=>te.fileId!==W);d&&d(de),"onTransferCancelled"in N&&N.onTransferCancelled&&((Z=N.onTransferCancelled)==null||Z.call(N,W))},[d,Y,N]),{fileAttributes:rt}=Wf(Y,Ne),xe=h.useMemo(()=>[{op:qf,enabled:re},{op:W=>Bf(W),enabled:Ke}].filter(({enabled:W})=>W).map(({op:W})=>W).concat(...m),[re,Ke]),Se=h.useMemo(()=>({uploaded:`${t}-uploaded`,errors:`${t}-errors`}),[t]),{totalCount:Pe,uploadedCount:Ve,failedCount:at}=h.useMemo(()=>{const W=Y.length;if(!J)return{totalCount:W,uploadedCount:0,failedCount:0};let de=0,Z=0;for(const te of Y){const ut=J.find(Be=>Be.fileId===te.fileId);(ut==null?void 0:ut.progress)==="done"&&de++,(ut==null?void 0:ut.progress)==="error"&&Z++}return{totalCount:W,uploadedCount:de,failedCount:Z}},[Y,J]),be=Pe===1?"fil":"filer",ke=o.jsx("div",{className:ce("pkt-fileupload",{"pkt-fileupload--full-width":y,"pkt-fileupload--error":ae,"pkt-fileupload--disabled":T}),"aria-disabled":T,...T?{inert:""}:{},children:o.jsxs(tr.Provider,{value:{name:N.name||"",multiple:!!i,id:t},children:[o.jsx("div",{id:Se.uploaded,className:"pkt-sr-only","aria-live":"polite","aria-atomic":"true",children:Pe>0&&Ve>0&&`${Ve} av ${Pe} ${be} lastet opp`}),o.jsx("div",{id:Se.errors,className:"pkt-sr-only","aria-live":"assertive","aria-atomic":"true",children:Pe>0&&at>0&&`Feil ved opplasting: ${at} av ${Pe} ${be} feilet`}),o.jsx(Df,{id:t,name:N.name||"",value:Y,onFilesAdded:He,multiple:i,uploadStrategy:n,ref:j,accept:le?".jpeg, .jpg, .png, .gif, .webp, .heic":N.accept,isThumbnailView:le,disabled:T,srAnnouncementIds:Se}),ae&&pe&&o.jsx(rn,{skin:"error","aria-live":"assertive",role:"alert",compact:!0,children:pe}),o.jsx(dm,{files:Y,cancelTransfer:Ge,truncateTail:l,transfers:J,ItemRenderer:Ee,enableImagePreview:le&&D,queueItemOperations:xe.map(W=>W(rt)).concat(Hf(Ge))})]})});return V?o.jsx(Os,{forId:t,label:V,helptext:G,disabled:T,hasError:ae,optionalTag:ie,requiredTag:we,className:"pkt-fileupload-wrapper",children:ke}):ke});go.displayName="PktFileUpload";const um=({columnOne:s,columnTwo:e,socialLinks:t,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:l=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:y=null,cookieExpiryDays:k=null,onToggleConsent:g=$=>{console.log($.detail)}})=>{var C,M;const $=[i,"pkt-footer"].filter(Boolean).join(" ");return o.jsx("footer",{className:$,"data-mode":"dark",children:o.jsxs("div",{className:"pkt-footer__container",children:[o.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:s.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&o.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((S,E)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${E}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:e.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&o.jsx("li",{className:"pkt-footer__text",children:e.text}),(M=e.links)==null?void 0:M.map((S,E)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${E}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),o.jsxs("ul",{className:"pkt-footer__list",children:[o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),l&&o.jsx("li",{className:"pkt-footer__list-item",children:o.jsx(ln,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:y,cookieExpiryDays:k,onToggleConsent:g})})]})]})]}),t&&o.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[o.jsx("div",{className:"pkt-footer__social-languages",children:t.filter(S=>S.language).map((S,E)=>o.jsx("div",{className:"pkt-footer__social-language",children:o.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${E}`))}),o.jsx("div",{className:"pkt-footer__social-icons",children:t.filter(S=>S.iconName).map((S,E)=>o.jsx(h.Fragment,{children:o.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:o.jsx(K,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${E}`))})]})]})})},hm=({links:s=[],openLinksInNewTab:e=!1,personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:r=null,googleAnalyticsId:a=null,devMode:l=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:v=k=>{console.log(k.detail)},className:y})=>{const k=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return o.jsx("footer",{className:k,"data-mode":"dark",children:o.jsx("div",{className:"pkt-footer-simple__container",children:o.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((g,$)=>o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:`pkt-footer-simple__link ${g.external?" pkt-link--external":""}`,href:g.href,target:g.openInNewTab||e?"_blank":"_self",rel:g.openInNewTab||e?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),g.text]})},$)),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:t,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsx(ln,{triggerType:"footerlink",hotjarId:r,googleAnalyticsId:a,devMode:l,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},pm=(s,e)=>{const t=()=>typeof window>"u"?0:window.innerWidth,[i,n]=h.useState(t);return h.useEffect(()=>{const r=s.current;if(!r)return;if(n(r.offsetWidth),typeof ResizeObserver>"u"){const l=()=>{r&&n(r.offsetWidth)};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}const a=new ResizeObserver(l=>{for(const d of l)d.borderBoxSize&&d.borderBoxSize.length>0?n(d.borderBoxSize[0].inlineSize):n(d.contentRect.width)});return a.observe(r),()=>{a.disconnect()}},[s]),i};function fm(s){const e=h.useRef(0);h.useEffect(()=>{const t=document.body,i=document.documentElement;if(s){e.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(t.style.paddingRight=`${n}px`),t.style.position="fixed",t.style.top=`-${e.current}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",i.classList.add("is-scroll-locked")}else t.style.removeProperty("position"),t.style.removeProperty("top"),t.style.removeProperty("left"),t.style.removeProperty("right"),t.style.removeProperty("width"),t.style.removeProperty("overflow"),t.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current});return()=>{s&&(t.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current}))}},[s])}const hn=({href:s,iconName:e,className:t,iconPosition:i,external:n,target:r,children:a,...l})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!e&&i==="left"||!!(e&&!i),"pkt-link--icon-right":!!e&&i==="right","pkt-link--external":n};return o.jsxs("a",{...l,className:ce(d,t),href:s,target:r,rel:n?"noopener noreferrer":void 0,children:[e&&o.jsx(K,{name:e,className:"pkt-link__icon"}),a]})};hn.displayName="PktLink";const mm=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},pn=({item:s,className:e})=>"href"in s?o.jsx(hn,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:ce("pkt-user-menu__link",e),children:s.title}):o.jsxs("button",{className:ce("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",e),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&o.jsx(K,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),gm=({links:s})=>o.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((e,t)=>o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:e})},t))}),vo=h.forwardRef(({user:s,formattedLastLoggedIn:e,representing:t,userMenu:i,canChangeRepresentation:n,changeRepresentation:r,logoutOnClick:a},l)=>{const d=i==null?void 0:i.map(mm);return o.jsx("nav",{className:"pkt-user-menu",ref:l,"aria-label":"Meny for innlogget bruker",children:o.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),e&&o.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",o.jsx("time",{children:e})]})]}),d&&d.length>0&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(gm,{links:d})}),t&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:t.name}),t.orgNumber&&o.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",t.orgNumber]}),n&&r&&o.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})]}),!t&&n&&r&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx("ul",{className:"pkt-user-menu__sublist",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})}),a&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(pn,{item:{title:"Logg ut",iconName:"exit",onClick:a}})})]})})});vo.displayName="PktHeaderUserMenu";const fn=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,autocomplete:i="off",counter:n,counterMaxLength:r,className:a,disabled:l=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:y,iconNameRight:k,inline:g=!1,fullwidth:$=!1,label:C,name:M,optionalTag:S=!1,optionalText:E,requiredTag:T=!1,requiredText:V,tagText:G=null,placeholder:ie,prefix:we,suffix:D,type:N="text",useWrapper:j=!0,omitSearchIcon:J=!1,value:X,minLength:ne,maxLength:ae,min:pe,max:oe,step:ve,size:z,readonly:Y,required:Ee,dataTestid:le,onChange:re,skipForwardTestid:Ke=!1,...He},Ne)=>{const Ge=[a,"pkt-textinput"].join(" "),rt=N==="search"&&!k&&!J,xe=N==="date"&&X?X.slice(0,10):X,[Se,Pe]=h.useState((X==null?void 0:X.length)||0),Ve=`${s}`,at=`${Ve}-label`,be=t||at,ke=W=>{var de,Z;n&&Pe(((Z=(de=W.currentTarget)==null?void 0:de.value)==null?void 0:Z.length)||0),re&&re(W)};return h.useEffect(()=>{X!==void 0&&Pe((X==null?void 0:X.length)||0)},[X]),o.jsx(Os,{ariaDescribedby:e,className:Ge,disabled:l,errorMessage:d,forId:Ve,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:y,inline:g,label:C,optionalTag:S,optionalText:E,requiredTag:T,requiredText:V,tagText:G,useWrapper:j,counter:n,counterCurrent:Se,counterMaxLength:r,children:o.jsxs("div",{className:"pkt-input__container","data-testid":le,"data-skip-forward-testid":Ke?"true":void 0,children:[we&&o.jsx("div",{className:"pkt-input-prefix",children:we}),o.jsx("input",{...He,ref:Ne,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${r&&Se>r?"pkt-input--counter-error":""}`,type:N,name:`${M||s}`,value:xe,id:Ve,placeholder:ie,autoComplete:i,disabled:l,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":be,min:pe,max:oe,onChange:ke,step:ve,minLength:ne,maxLength:ae,size:z,readOnly:Y,required:Ee}),D&&o.jsxs("p",{className:"pkt-input-suffix",children:[D,k&&o.jsx(K,{className:"pkt-input-suffix-icon",name:k}),rt&&o.jsx(K,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!D&&k&&o.jsx(K,{className:"pkt-input-icon",name:k}),!D&&rt&&o.jsx(K,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});fn.displayName="PktTextinput";const ar=h.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:e=1280,children:t,className:i,compact:n=!1,"data-mode":r,logOutButtonPlacement:a="none",logOut:l,openedMenu:d,showSearch:p=!1,onSearch:m,onSearchChange:v,searchValue:y,searchPlaceholder:k="Søk",representing:g,serviceLink:$,serviceClick:C,serviceName:M,user:S,userMenu:E,userMenuFooter:T,userOptions:V,canChangeRepresentation:G=!1,changeRepresentation:ie,hideLogo:we=!1,logoLink:D,logoClick:N,position:j="fixed",scrollBehavior:J="hide",slotMenuVariant:X="icon-only",slotMenuText:ne="Meny"},ae)=>{const pe=j==="fixed",oe=J==="hide";h.useEffect(()=>{T&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[T]),h.useEffect(()=>{V&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[V]),h.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),g!=null&&g.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,g==null?void 0:g.shortname]);const ve=h.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[z,Y]=h.useState(d||"none");h.useEffect(()=>{d!==void 0&&Y(d)},[d]);const[Ee,le]=h.useState(!1),[re,Ke]=h.useState(0),[He,Ne]=h.useState(!1),[Ge,rt]=h.useState(!1),xe=h.useRef(null),Se=h.useRef(null),Pe=h.useRef(null),Ve=h.useRef(null),at=h.useRef(null),be=h.useRef(null),ke=h.useRef(null),W=h.useRef(!1),de=pm(xe),Z=de<s,te=de<e,ut=h.useCallback(u=>{xe.current=u,typeof ae=="function"?ae(u):ae&&(ae.current=u)},[ae]);fm(pe&&Z&&z!=="none");const Be=h.useCallback((u,_)=>{const x=u.relatedTarget;let B;switch(_){case"user":B=Se;break;case"slot":B=Pe;break;case"search":B=Ve;break;default:return}const U=B.current;U&&(!x||!U.contains(x))&&Y("none")},[]),Ue=h.useCallback(()=>{W.current&&ke.current&&document.contains(ke.current)&&ke.current.focus(),ke.current=null,W.current=!1},[]);h.useEffect(()=>{const u=x=>{S&&z==="user"&&!x.target.closest(".pkt-header-service__user-container")&&Y("none"),z==="slot"&&!x.target.closest(".pkt-header-service__slot-container")&&Y("none"),z==="search"&&!x.target.closest(".pkt-header-service__search-container")&&!x.target.closest(".pkt-header-service__search-input")&&Y("none")},_=x=>{x.key==="Escape"&&z!=="none"&&(x.preventDefault(),W.current=!0,Y("none"))};if(z!=="none")return document.addEventListener("mousedown",u),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",_)};Ue()},[z,S,Ue]),h.useEffect(()=>{const u=()=>{if(oe){const _=window.pageYOffset||document.documentElement.scrollTop;if(_<0||Math.abs(_-re)<60)return;le(_>re),Ke(_)}};return document&&window.addEventListener("scroll",u),()=>{document&&window.removeEventListener("scroll",u)}},[oe,re]);const yt=h.useCallback(u=>{const _=u==="slot"?Pe:Ve,x=u==="slot"?at:be;if(!_.current||!x.current||!te||Z)return;const B=_.current.getBoundingClientRect(),U=x.current.offsetWidth,ee=B.left+U>window.innerWidth;u==="slot"?Ne(ee):rt(ee)},[te,Z]),Wt=h.useCallback(u=>{z!=="none"?Y("none"):(ke.current=document.activeElement,Y(u))},[z]);h.useEffect(()=>{(z==="slot"||z==="search")&&requestAnimationFrame(()=>{yt(z)})},[z,yt]);const f=o.jsxs("header",{className:ce("pkt-header-service",n&&"pkt-header-service--compact",Z&&"pkt-header-service--mobile",te&&"pkt-header-service--tablet",pe&&"pkt-header-service--fixed",oe&&"pkt-header-service--scroll-to-hide",Ee&&"pkt-header-service--hidden",i),"data-mode":r,ref:ut,children:[o.jsxs("div",{className:ce("pkt-header-service__logo-area",(!M||M==="")&&"pkt-header-service__logo-area--without-service"),children:[!we&&o.jsx("span",{className:"pkt-header-service__logo",children:D?o.jsx("a",{href:D,"aria-label":"Tilbake til forside",children:o.jsx(K,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.3/logos/"})}):N?o.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:N,children:o.jsx(K,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.3/logos/"})}):o.jsx(K,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.3/logos/"})}),M&&o.jsx("span",{className:"pkt-header-service__service-name",children:$?o.jsx(hn,{href:$,className:"pkt-header-service__service-link ",children:M}):C?o.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:C,children:M}):o.jsx("span",{className:"pkt-header-service__service-link",children:M})})]}),o.jsxs("div",{className:"pkt-header-service__content",children:[o.jsxs("div",{className:ce("pkt-header-service__slot-container",z==="slot"&&"is-open"),onBlur:u=>Be(u,"slot"),ref:Pe,children:[te&&t&&o.jsx(it,{skin:"secondary",variant:X,iconName:"menu",size:Z?"small":"medium",state:z==="slot"?"active":"normal",onClick:()=>Wt("slot"),"aria-expanded":z==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:ne}),o.jsx("div",{className:ce("pkt-header-service__slot-content",He&&"align-right"),id:"mobile-slot-menu",role:te?"menu":void 0,"aria-label":te?"Meny":void 0,ref:at,children:o.jsx("div",{className:"pkt-contents",children:t})})]}),p&&o.jsx(o.Fragment,{children:te?o.jsxs("div",{className:ce("pkt-header-service__search-container",z==="search"&&"is-open"),onBlur:u=>Be(u,"search"),ref:Ve,children:[o.jsx(it,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:Z?"small":"medium",onClick:()=>Wt("search"),state:z==="search"?"active":"normal","aria-expanded":z==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),o.jsx("div",{className:ce("pkt-header-service__mobile-menu",z==="search"&&"is-open",Ge&&"align-right"),ref:be,children:z==="search"&&o.jsx(fn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,autoFocus:!0,fullwidth:!0,onChange:u=>v==null?void 0:v(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})})]}):o.jsx(fn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,onChange:u=>v==null?void 0:v(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})}),te&&l&&(a==="header"||a==="both")&&o.jsx(it,{skin:"secondary",size:Z?"small":"medium",variant:"icon-only",iconName:"exit",onClick:l,children:"Logg ut"})]}),o.jsxs("div",{className:"pkt-header-service__user",children:[S&&o.jsxs("div",{className:"pkt-header-service__user-container",onBlur:u=>Be(u,"user"),ref:Se,children:[o.jsxs(it,{className:ce("pkt-header-service__user-button",Z&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:Z?"small":"medium",state:z==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:z==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Wt("user"),children:[o.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(g==null?void 0:g.name)||S.name]}),z==="user"&&S&&o.jsx("div",{className:ce(Z?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:o.jsx(vo,{user:S,formattedLastLoggedIn:ve,representing:g,userMenu:E,canChangeRepresentation:G,changeRepresentation:ie,logoutOnClick:a==="userMenu"||a==="both"?l:void 0})})]}),!Z&&l&&(a==="header"||a==="both")&&o.jsx(it,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:l,children:"Logg ut"})]})]});return pe?o.jsxs("div",{className:"pkt-header-service-wrapper",children:[f,o.jsx("div",{className:ce("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",Z&&"pkt-header-service-spacer--mobile",te&&"pkt-header-service-spacer--tablet")})]}):f});ar.displayName="PktHeaderService";const bo=h.forwardRef((s,e)=>o.jsx(ar,{...s,ref:e}));bo.displayName="PktHeader";const vm=At({tagName:"pkt-heading",elementClass:ss,react:h,displayName:"PktHeading"}),yo=h.forwardRef(({children:s,...e},t)=>o.jsx(vm,{"data-testid":"pkt-heading",...e,ref:t,children:s}));yo.displayName="PktHeading";const bm=At({tagName:"pkt-helptext",elementClass:Yt,react:h,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),ko=h.forwardRef(({children:s,...e},t)=>o.jsx(bm,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ko.displayName="PktHelptext";const _o=h.forwardRef(({label:s,id:e,children:t,...i},n)=>o.jsxs("div",{className:"pkt-form-group",children:[o.jsx("label",{htmlFor:e,className:"pkt-form-label",children:s}),o.jsx("input",{className:"pkt-form-input",id:e,...i,ref:n}),t]}));_o.displayName="PktInput";const $o=({children:s,skin:e,title:t,href:i,iconName:n,openInNewTab:r,external:a,className:l,...d})=>{const p=["pkt-linkcard",e&&`pkt-linkcard--${e}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",a&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return o.jsxs("a",{...d,href:i,className:ce(p,l),target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,children:[n&&o.jsx(K,{className:"pkt-link__icon",name:n}),t&&o.jsx("div",{className:ce(m),children:t}),o.jsx("div",{className:"pkt-linkcard__text",children:s})]})};$o.displayName="PktLinkCard";const ym=At({tagName:"pkt-loader",elementClass:Et,react:h,displayName:"PktLoader",events:{}}),wo=h.forwardRef(({children:s,...e},t)=>o.jsx(ym,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));wo.displayName="PktLoader";const xo=({children:s,className:e,skin:t,title:i,compact:n,closable:r,onClose:a,...l})=>{const[d,p]=h.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${t}`]:t,"pkt-messagebox--closable":r,"pkt-hide":d},v=h.createRef(),y=h.useCallback(()=>{p(!0),a&&a()},[p,a]);return o.jsxs("div",{...l,className:ce(m,e),ref:v,children:[r&&o.jsx("div",{className:"pkt-messagebox__close",children:o.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:o.jsx(K,{name:"close",className:"pkt-link__icon"})})}),i&&o.jsx("div",{className:"pkt-messagebox__title",children:i}),o.jsx("div",{className:"pkt-messagebox__text",children:s})]})};xo.displayName="PktMessagebox";const km=At({tagName:"pkt-progressbar",elementClass:Le,react:h,displayName:"PktProgressbar",events:{}}),mn=h.forwardRef(({children:s,...e},t)=>o.jsx(km,{ref:t,...e,children:o.jsx("div",{className:"pkt-contents",children:s})}));mn.displayName="PktProgressbar";const So=h.forwardRef(({id:s,name:e,label:t,className:i,hasTile:n=!1,disabled:r=!1,checkHelptext:a,hasError:l=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:v,requiredTag:y,requiredText:k,tagText:g,...$},C)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",r&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),E=["pkt-input-check__input-checkbox",l?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),T=["pkt-input-check__input-label",r?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),V=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),G=()=>o.jsxs(o.Fragment,{children:[g&&o.jsx("span",{className:V+" pkt-tag--gray",children:g}),m&&o.jsx("span",{className:V+" pkt-tag--blue-light",children:v}),y&&o.jsx("span",{className:V+" pkt-tag--beige",children:k})]});return o.jsx("div",{className:M,children:o.jsxs("div",{className:S,children:[o.jsx("input",{ref:C,id:s,type:"radio",name:e,disabled:r,className:E,...p!==void 0?{checked:p}:{defaultChecked:d},...$}),o.jsxs("label",{className:T,htmlFor:s,children:[t," ",G(),a&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});So.displayName="PktRadioButton";const Co=h.forwardRef(({appearance:s="local",disabled:e=!1,fullwidth:t=!1,id:i,label:n,name:r,placeholder:a="Søk…",suggestions:l,value:d="",action:p,method:m,onChange:v,onSearch:y,onSuggestionClick:k,...g},$)=>{const C=(T,V)=>{T?T():k&&k(V)},M=T=>{d=T.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${t?"pkt-searchinput--fullwidth":""}`;let E;return p?E=T=>o.jsx("form",{role:"search",className:S,action:p,method:m,children:T}):E=T=>o.jsx("div",{role:"search",className:S,children:T}),E(o.jsxs(o.Fragment,{children:[n&&o.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),o.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[o.jsx("input",{className:`pkt-input ${t?"pkt-input--fullwidth":""}`,type:"search",name:r||i,id:i,placeholder:a,defaultValue:d,disabled:e,autoComplete:"off","aria-autocomplete":"list",ref:$,"aria-controls":`${i}-suggestions`,onChange:v||M,onKeyUp:y&&(T=>{T.key==="Enter"&&(T.preventDefault(),y(d))}),...g}),o.jsx(it,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:e,onClick:y&&(T=>{T.preventDefault(),y(d)}),children:n||a})]}),l&&o.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:l.map((T,V)=>o.jsx("li",{children:h.createElement(T.href?"a":T.onClick?"button":"div",{href:T.href,className:`pkt-searchinput__suggestion ${T.onClick?"pkt-link-button":""} ${T.href||T.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:T.onClick?"button":void 0,onClick:()=>C(T.onClick,V),onKeyUp:G=>G.key==="Enter"&&C(T.onClick,V)},o.jsxs(o.Fragment,{children:[T.title&&o.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:T.title}),T.text&&o.jsx("p",{className:"pkt-searchinput__suggestion-text",children:T.text})]}))},`search-suggestion-${V}`))})]}))});Co.displayName="PktSearchInput";const To=h.forwardRef(({ariaDescribedby:s,ariaLabelledby:e,children:t,className:i,disabled:n=!1,errorMessage:r,hasError:a,helptext:l,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:y=!1,label:k,name:g,optionalTag:$=!1,optionalText:C,requiredTag:M=!1,requiredText:S,tagText:E,...T},V)=>{const G=[i,"pkt-select"].join(" ");return o.jsx(Os,{className:G,forId:`${m}-input`,label:k,helptext:l,helptextDropdown:d,helptextDropdownButton:p,optionalTag:$,optionalText:C,requiredTag:M,requiredText:S,tagText:E,hasError:a,errorMessage:r,disabled:n,inline:v,ariaDescribedby:s,children:o.jsx("select",{ref:V,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":a,"aria-errormessage":`${m}-error`,"aria-labelledby":e||void 0,disabled:n,id:`${m}-input`,name:g||m,...T,children:t})})});To.displayName="PktSelect";const _m=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:o.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),$m=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),o.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),wm=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),o.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),xm=({children:s,className:e,status:t="incomplete",title:i})=>o.jsxs("li",{className:ce("pkt-step",e,`pkt-step--${t}`),"data-testid":"pkt-step",children:[o.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),o.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),o.jsx("span",{className:ce("pkt-step__indicator"),children:t==="current"?$m:t==="completed"?wm:_m}),o.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),o.jsxs("div",{className:"pkt-step__wrapper",children:[o.jsx("div",{className:"pkt-step__title",children:i}),o.jsx("div",{className:"pkt-step__content",children:s})]})]}),No=h.forwardRef(({activeStep:s,className:e,children:t,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:r="vertical",...a},l)=>{const d=ce(e,"pkt-stepper",r==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=h.Children.map(t,(m,v)=>h.isValidElement(m)?h.cloneElement(m,{className:ce(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return o.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:l,...a,children:p})});No.displayName="PktStepper";const Sm=({className:s,compact:e=!1,skin:t="basic",responsiveView:i=!0,children:n,...r})=>o.jsx("table",{"data-testid":"pkt-table",className:ce(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":e,"pkt-table--basic":t==="basic","pkt-table--zebra-blue":t==="zebra-blue"}),role:"table",...r,children:n}),Cm=({id:s,children:e,className:t,...i})=>o.jsx("tbody",{id:s,className:ce(t,"pkt-table__body",{}),...i,role:"rowgroup",children:e}),Tm=({children:s,className:e,dataLabel:t,...i})=>o.jsx("td",{className:ce(e,"pkt-table__data-cell",{}),"data-label":t,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Nm=({className:s,children:e,...t})=>o.jsx("thead",{className:ce(s,"pkt-table__header",{}),role:"rowgroup",...t,children:e}),Mm=({className:s,children:e,...t})=>o.jsx("th",{className:ce(s,"pkt-table__header-cell",{}),role:"columnheader",...t,children:e}),Dm=({className:s,children:e,...t})=>o.jsx("tr",{className:ce(s,"pkt-table__row",{}),role:"row",...t,children:e}),or=h.forwardRef(({children:s,active:e,href:t,onClick:i,icon:n,controls:r,tag:a,tagSkin:l,index:d=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:y,selectTab:k}=Om(),$={"aria-selected":m?!!e:void 0,"aria-controls":r,role:m?"tab":void 0,onKeyUp:M=>y(d,M),onClick:M=>{k(d),i==null||i(M)},tabIndex:e||!m?void 0:-1,ref:M=>{v(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},C=o.jsxs(o.Fragment,{children:[n&&o.jsx(K,{name:n,className:"pkt-icon--small"}),s,a&&o.jsx(dn,{skin:l,size:"small",children:a})]});return t?o.jsx("a",{...$,href:t,className:`pkt-tabs__link ${e?"active":""}`,children:C}):o.jsx("button",{...$,type:"button",className:`pkt-tabs__button pkt-link-button ${e?"active":""}`,children:C})});or.displayName="PktTabItem";const Mo=h.createContext(null),Om=()=>{const s=h.useContext(Mo);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Do=h.forwardRef(({arrowNav:s=!0,disableArrowNav:e=!1,tabs:t,onTabSelected:i,children:n},r)=>{const a=h.useRef([]),l=s&&!e,p=n&&h.Children.count(n)>0?h.Children.count(n):(t==null?void 0:t.length)||0;h.useEffect(()=>{a.current=a.current.slice(0,p)},[p]);const m=g=>{const $=t==null?void 0:t[g];$!=null&&$.action&&$.action(g),i&&i(g)},v=(g,$)=>{var C,M;l&&($.code==="ArrowLeft"&&g!==0&&((C=a.current[g-1])==null||C.focus()),$.code==="ArrowRight"&&g<p-1&&((M=a.current[g+1])==null||M.focus()),($.code==="ArrowDown"||$.code==="Space")&&m(g))},y=(g,$)=>{a.current[g]=$},k=t==null?void 0:t.map((g,$)=>{var C,M;return o.jsx(or,{active:g.active,href:g.href,onClick:()=>m($),icon:g.icon,controls:g.controls,tag:(C=g.tag)==null?void 0:C.text,tagSkin:(M=g.tag)==null?void 0:M.skin,index:$,children:g.text},$)});return o.jsx(Mo.Provider,{value:{arrowNav:l,registerTabRef:y,handleKeyPress:v,selectTab:m},children:o.jsx("div",{className:"pkt-tabs",ref:r,children:o.jsx("div",{className:"pkt-tabs__list",role:l?"tablist":"navigation",children:n||k})})})});Do.displayName="PktTabs";var Rs=window.CustomEvent;(!Rs||typeof Rs=="object")&&(Rs=function(s,e){e=e||{};var t=document.createEvent("CustomEvent");return t.initCustomEvent(s,!!e.bubbles,!!e.cancelable,e.detail||null),t},Rs.prototype=window.Event.prototype);function Oo(s,e){var t="on"+e.type.toLowerCase();return typeof s[t]=="function"&&s[t](e),s.dispatchEvent(e)}function Em(s){for(;s&&s!==document.body;){var e=window.getComputedStyle(s),t=function(i,n){return!(e[i]===void 0||e[i]===n)};if(e.opacity<1||t("zIndex","auto")||t("transform","none")||t("mixBlendMode","normal")||t("filter","none")||t("perspective","none")||e.isolation==="isolate"||e.position==="fixed"||e.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function Ii(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function Eo(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Pm(s,e){for(var t=0;t<s.length;++t)if(s[t]===e)return!0;return!1}function lr(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Po(s){var e=["button","input","keygen","select","textarea"],t=e.map(function(a){return a+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),r=0;r<n.length&&!(n[r].tagName&&n[r].shadowRoot&&(i=Po(n[r].shadowRoot),i));r++);return i}function Ao(s){return s.isConnected||document.body.contains(s)}function Io(s){if(s.submitter)return s.submitter;var e=s.target;if(!(e instanceof HTMLFormElement))return null;var t=ue.formSubmitter;if(!t){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;t=n.activeElement}return!t||t.form!==e?null:t}function Am(s){if(!s.defaultPrevented){var e=s.target,t=ue.imagemapUseValue,i=Io(s);t===null&&i&&(t=i.value);var n=Ii(e);if(n){var r=i&&i.getAttribute("formmethod")||e.getAttribute("method");r==="dialog"&&(s.preventDefault(),t!=null?n.close(t):n.close())}}}function Lo(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",Am,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var e=new MutationObserver(this.maybeHideModal.bind(this));e.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var t=!1,i=(function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}).bind(this),n,r=function(a){if(a.target===s){var l="DOMNodeRemoved";t|=a.type.substr(0,l.length)===l,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(a){s.addEventListener(a,r)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}Lo.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Ao(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),ue.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var e=document.createElement("div");this.dialog_.insertBefore(e,this.dialog_.firstChild),e.tabIndex=-1,e.focus(),this.dialog_.removeChild(e)}var t=document.createEvent("MouseEvents");t.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(t),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=Po(this.dialog_)),Eo(document.activeElement),s&&s.focus()},updateZIndex:function(s,e){if(s<e)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=e},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!Ao(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!ue.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Em(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,ue.needsCentering(this.dialog_)?(ue.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var e=new Rs("close",{bubbles:!1,cancelable:!1});Oo(this.dialog_,e)}};var ue={};if(ue.reposition=function(s){var e=document.body.scrollTop||document.documentElement.scrollTop,t=e+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(e,t)+"px"},ue.isInlinePositionSetByStylesheet=function(s){for(var e=0;e<document.styleSheets.length;++e){var t=document.styleSheets[e],i=null;try{i=t.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var r=i[n],a=null;try{a=document.querySelectorAll(r.selectorText)}catch{}if(!(!a||!Pm(a,s))){var l=r.style.getPropertyValue("top"),d=r.style.getPropertyValue("bottom");if(l&&l!=="auto"||d&&d!=="auto")return!0}}}return!1},ue.needsCentering=function(s){var e=window.getComputedStyle(s);return e.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!ue.isInlinePositionSetByStylesheet(s)},ue.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new Lo(s)},ue.registerDialog=function(s){s.showModal||ue.forceRegisterDialog(s)},ue.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(e){this.forwardTab_=void 0,e.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(e){var t=[];e.forEach(function(i){for(var n=0,r;r=i.removedNodes[n];++n){if(r instanceof Element)r.localName==="dialog"&&t.push(r);else continue;t=t.concat(r.querySelectorAll("dialog"))}}),t.length&&s(t)}))},ue.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},ue.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},ue.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,e=0,t;t=this.pendingDialogStack[e];++e)t.updateZIndex(--s,--s),e===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},ue.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Ii(s);){for(var e=0,t;t=this.pendingDialogStack[e];++e)if(t.dialog===s)return e===0;s=s.parentElement}return!1},ue.DialogManager.prototype.handleFocus_=function(s){var e=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(e)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),Eo(e),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],i=t.dialog,n=i.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e!==document.documentElement&&document.documentElement.focus()),!1}},ue.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var e=new Rs("cancel",{bubbles:!1,cancelable:!0}),t=this.pendingDialogStack[0];t&&Oo(t.dialog,e)&&t.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},ue.DialogManager.prototype.checkDOM_=function(s){var e=this.pendingDialogStack.slice();e.forEach(function(t){s.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},ue.DialogManager.prototype.pushDialog=function(s){var e=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=e?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},ue.DialogManager.prototype.removeDialog=function(s){var e=this.pendingDialogStack.indexOf(s);e!==-1&&(this.pendingDialogStack.splice(e,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},ue.dm=new ue.DialogManager,ue.formSubmitter=null,ue.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Bo=document.createElement("form");if(Bo.setAttribute("method","dialog"),Bo.method!=="dialog"){var ei=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(ei){var Im=ei.get;ei.get=function(){return lr(this)?"dialog":Im.call(this)};var Lm=ei.set;ei.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Lm.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",ei)}}document.addEventListener("click",function(s){if(ue.formSubmitter=null,ue.imagemapUseValue=null,!s.defaultPrevented){var e=s.target;if("composedPath"in s){var t=s.composedPath();e=t.shift()||e}if(!(!e||!lr(e.form))){var i=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!i){if(!(e.localName==="input"&&e.type==="image"))return;ue.imagemapUseValue=s.offsetX+","+s.offsetY}var n=Ii(e);n&&(ue.formSubmitter=e)}}},!1),document.addEventListener("submit",function(s){var e=s.target,t=Ii(e);if(!t){var i=Io(s),n=i&&i.getAttribute("formmethod")||e.getAttribute("method");n==="dialog"&&s.preventDefault()}});var Bm=HTMLFormElement.prototype.submit,Fm=function(){if(!lr(this))return Bm.call(this);var s=Ii(this);s&&s.close()};HTMLFormElement.prototype.submit=Fm}const Hm=Object.freeze(Object.defineProperty({__proto__:null,default:ue},Symbol.toStringTag,{value:"Module"}));I.PktAccordion=ur,I.PktAccordionItem=Ma,I.PktAlert=rn,I.PktBackLink=Oa,I.PktBreadcrumbs=Ea,I.PktButton=it,I.PktCalendar=er,I.PktCard=io,I.PktCheckbox=no,I.PktCombobox=ro,I.PktConsent=ln,I.PktDatepicker=lo,I.PktFileUpload=go,I.PktFooter=um,I.PktFooterSimple=hm,I.PktHeader=bo,I.PktHeaderService=ar,I.PktHeading=yo,I.PktHelptext=ko,I.PktIcon=K,I.PktInput=_o,I.PktInputWrapper=Os,I.PktLink=hn,I.PktLinkCard=$o,I.PktLoader=wo,I.PktMessagebox=xo,I.PktModal=ir,I.PktProgressbar=mn,I.PktRadioButton=So,I.PktSearchInput=Co,I.PktSelect=To,I.PktStep=xm,I.PktStepper=No,I.PktTabItem=or,I.PktTable=Sm,I.PktTableBody=Cm,I.PktTableDataCell=Tm,I.PktTableHeader=Nm,I.PktTableHeaderCell=Mm,I.PktTableRow=Dm,I.PktTabs=Do,I.PktTag=dn,I.PktTextarea=sr,I.PktTextinput=fn,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "15.2.1",
3
+ "version": "15.3.1",
4
4
  "description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@lit-labs/ssr-dom-shim": "^1.2.1",
41
41
  "@lit/react": "^1.0.7",
42
- "@oslokommune/punkt-elements": "^15.2.0",
42
+ "@oslokommune/punkt-elements": "^15.3.1",
43
43
  "classnames": "^2.5.1",
44
44
  "prettier": "^3.3.3",
45
45
  "react-hook-form": "^7.53.0"
@@ -50,7 +50,7 @@
50
50
  "@eslint/eslintrc": "^3.3.3",
51
51
  "@eslint/js": "^9.37.0",
52
52
  "@oslokommune/punkt-assets": "^15.0.0",
53
- "@oslokommune/punkt-css": "^15.2.0",
53
+ "@oslokommune/punkt-css": "^15.3.1",
54
54
  "@testing-library/jest-dom": "^6.5.0",
55
55
  "@testing-library/react": "^16.0.1",
56
56
  "@testing-library/user-event": "^14.5.2",
@@ -109,5 +109,5 @@
109
109
  "url": "https://github.com/oslokommune/punkt/issues"
110
110
  },
111
111
  "license": "MIT",
112
- "gitHead": "752427d52a7f6ace1d025a726cf9199d2aeaa240"
112
+ "gitHead": "b4500307b2fb41eb76b25433aec3d99ec66f27e2"
113
113
  }
@@ -109,7 +109,7 @@ interface IBaseFileUploadProps
109
109
  /** Props for `uploadStrategy="form"` (native file input submission). */
110
110
  interface IFileInputFileUploadProps
111
111
  extends IBaseFileUploadProps,
112
- Omit<HTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'defaultValue'> {
112
+ Omit<HTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'defaultValue'> {
113
113
  uploadStrategy?: 'form'
114
114
  onFileUploadRequested?: never
115
115
  }
@@ -381,7 +381,7 @@ export const PktFileUpload: FC<IPktFileUpload> = forwardRef<HTMLInputElement, IP
381
381
  srAnnouncementIds={srAnnouncementIds}
382
382
  />
383
383
  {hasError && errorMessage && (
384
- <PktAlert skin="error" aria-live="assertive" role="alert" compact className="pkt-fileupload__error-alert">
384
+ <PktAlert skin="error" aria-live="assertive" role="alert" compact>
385
385
  {errorMessage}
386
386
  </PktAlert>
387
387
  )}