@oslokommune/punkt-react 13.12.0 → 13.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/index.d.ts +6 -2
- package/dist/punkt-react.es.js +874 -855
- package/dist/punkt-react.umd.js +56 -56
- package/package.json +4 -4
- package/src/components/linkcard/LinkCard.test.tsx +0 -11
- package/src/components/linkcard/LinkCard.tsx +34 -21
package/dist/punkt-react.umd.js
CHANGED
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2018 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/const Mn=new Set(["children","localName","ref","style","className"]),Ki=new WeakMap,Gi=(s,t,e,i,a)=>{const n=a==null?void 0:a[t];n===void 0?(s[t]=e,e==null&&t in HTMLElement.prototype&&s.removeAttribute(t)):e!==i&&((r,h,d)=>{let p=Ki.get(r);p===void 0&&Ki.set(r,p=new Map);let
|
|
40
|
+
*/const Mn=new Set(["children","localName","ref","style","className"]),Ki=new WeakMap,Gi=(s,t,e,i,a)=>{const n=a==null?void 0:a[t];n===void 0?(s[t]=e,e==null&&t in HTMLElement.prototype&&s.removeAttribute(t)):e!==i&&((r,h,d)=>{let p=Ki.get(r);p===void 0&&Ki.set(r,p=new Map);let g=p.get(h);d!==void 0?g===void 0?(p.set(h,g={handleEvent:d}),r.addEventListener(h,g)):g.handleEvent=d:g!==void 0&&(p.delete(h),r.removeEventListener(h,g))})(s,n,e)},Nt=({react:s,tagName:t,elementClass:e,events:i,displayName:a})=>{const n=new Set(Object.keys(i??{})),r=s.forwardRef(((h,d)=>{const p=s.useRef(new Map),g=s.useRef(null),m={},k={};for(const[b,y]of Object.entries(h))Mn.has(b)?m[b==="className"?"class":b]=y:n.has(b)||b in e.prototype?k[b]=y:m[b]=y;return s.useLayoutEffect((()=>{if(g.current===null)return;const b=new Map;for(const y in k)Gi(g.current,y,h[y],p.current.get(y),i),p.current.delete(y),b.set(y,h[y]);for(const[y,w]of p.current)Gi(g.current,y,void 0,w,i);p.current=b})),s.useLayoutEffect((()=>{var b;(b=g.current)==null||b.removeAttribute("defer-hydration")}),[]),m.suppressHydrationWarning=!0,s.createElement(t,{...m,ref:s.useCallback((b=>{g.current=b,typeof d=="function"?d(b):d!==null&&(d.current=b)}),[d])})}));return r.displayName=a??e.name,r};/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/const qs=globalThis,zs=qs.trustedTypes,Yi=zs?zs.createPolicy("lit-html",{createHTML:s=>s}):void 0,Zi="$lit$",
|
|
44
|
+
*/const qs=globalThis,zs=qs.trustedTypes,Yi=zs?zs.createPolicy("lit-html",{createHTML:s=>s}):void 0,Zi="$lit$",fe=`lit$${Math.random().toFixed(9).slice(2)}$`,Xi="?"+fe,Dn=`<${Xi}>`,xe=document,us=()=>xe.createComment(""),fs=s=>s===null||typeof s!="object"&&typeof s!="function",ui=Array.isArray,In=s=>ui(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",fi=`[
|
|
45
45
|
\f\r]`,gs=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ji=/-->/g,Qi=/>/g,Se=RegExp(`>|${fi}(?:([^\\s"'>=/]+)(${fi}*=${fi}*(?:[^
|
|
46
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ta=/'/g,ea=/"/g,sa=/^(?:script|style|textarea|title)$/i,Ln=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),u=Ln(1),$t=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),ia=new WeakMap,Ce=xe.createTreeWalker(xe,129);function aa(s,t){if(!ui(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yi!==void 0?Yi.createHTML(t):t}const Bn=(s,t)=>{const e=s.length-1,i=[];let a,n=t===2?"<svg>":t===3?"<math>":"",r=gs;for(let h=0;h<e;h++){const d=s[h];let p,m
|
|
46
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ta=/'/g,ea=/"/g,sa=/^(?:script|style|textarea|title)$/i,Ln=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),u=Ln(1),$t=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),ia=new WeakMap,Ce=xe.createTreeWalker(xe,129);function aa(s,t){if(!ui(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yi!==void 0?Yi.createHTML(t):t}const Bn=(s,t)=>{const e=s.length-1,i=[];let a,n=t===2?"<svg>":t===3?"<math>":"",r=gs;for(let h=0;h<e;h++){const d=s[h];let p,g,m=-1,k=0;for(;k<d.length&&(r.lastIndex=k,g=r.exec(d),g!==null);)k=r.lastIndex,r===gs?g[1]==="!--"?r=Ji:g[1]!==void 0?r=Qi:g[2]!==void 0?(sa.test(g[2])&&(a=RegExp("</"+g[2],"g")),r=Se):g[3]!==void 0&&(r=Se):r===Se?g[0]===">"?(r=a??gs,m=-1):g[1]===void 0?m=-2:(m=r.lastIndex-g[2].length,p=g[1],r=g[3]===void 0?Se:g[3]==='"'?ea:ta):r===ea||r===ta?r=Se:r===Ji||r===Qi?r=gs:(r=Se,a=void 0);const b=r===Se&&s[h+1].startsWith("/>")?" ":"";n+=r===gs?d+Dn:m>=0?(i.push(p),d.slice(0,m)+Zi+d.slice(m)+fe+b):d+fe+(m===-2?h:b)}return[aa(s,n+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let gi=class Nn{constructor({strings:t,_$litType$:e},i){let a;this.parts=[];let n=0,r=0;const h=t.length-1,d=this.parts,[p,g]=Bn(t,e);if(this.el=Nn.createElement(p,i),Ce.currentNode=this.el.content,e===2||e===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(a=Ce.nextNode())!==null&&d.length<h;){if(a.nodeType===1){if(a.hasAttributes())for(const m of a.getAttributeNames())if(m.endsWith(Zi)){const k=g[r++],b=a.getAttribute(m).split(fe),y=/([.?@])?(.*)/.exec(k);d.push({type:1,index:n,name:y[2],strings:b,ctor:y[1]==="."?Vn:y[1]==="?"?jn:y[1]==="@"?Hn:Rs}),a.removeAttribute(m)}else m.startsWith(fe)&&(d.push({type:6,index:n}),a.removeAttribute(m));if(sa.test(a.tagName)){const m=a.textContent.split(fe),k=m.length-1;if(k>0){a.textContent=zs?zs.emptyScript:"";for(let b=0;b<k;b++)a.append(m[b],us()),Ce.nextNode(),d.push({type:2,index:++n});a.append(m[k],us())}}}else if(a.nodeType===8)if(a.data===Xi)d.push({type:2,index:n});else{let m=-1;for(;(m=a.data.indexOf(fe,m+1))!==-1;)d.push({type:7,index:n}),m+=fe.length-1}n++}}static createElement(t,e){const i=xe.createElement("template");return i.innerHTML=t,i}};function We(s,t,e=s,i){var a,n;if(t===$t)return t;let r=i!==void 0?(a=e._$Co)==null?void 0:a[i]:e._$Cl;const h=fs(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==h&&((n=r==null?void 0:r._$AO)==null||n.call(r,!1),h===void 0?r=void 0:(r=new h(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=We(s,r._$AS(s,t.values),r,i)),t}let Fn=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,a=((t==null?void 0:t.creationScope)??xe).importNode(e,!0);Ce.currentNode=a;let n=Ce.nextNode(),r=0,h=0,d=i[0];for(;d!==void 0;){if(r===d.index){let p;d.type===2?p=new Ws(n,n.nextSibling,this,t):d.type===1?p=new d.ctor(n,d.name,d.strings,this,t):d.type===6&&(p=new Un(n,this,t)),this._$AV.push(p),d=i[++h]}r!==(d==null?void 0:d.index)&&(n=Ce.nextNode(),r++)}return Ce.currentNode=xe,a}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},Ws=class An{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,a){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=a,this._$Cv=(a==null?void 0:a.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=We(this,t,e),fs(t)?t===$||t==null||t===""?(this._$AH!==$&&this._$AR(),this._$AH=$):t!==this._$AH&&t!==$t&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):In(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==$&&fs(this._$AH)?this._$AA.nextSibling.data=t:this.T(xe.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:a}=t,n=typeof a=="number"?this._$AC(t):(a.el===void 0&&(a.el=gi.createElement(aa(a.h,a.h[0]),this.options)),a);if(((e=this._$AH)==null?void 0:e._$AD)===n)this._$AH.p(i);else{const r=new Fn(n,this),h=r.u(this.options);r.p(i),this.T(h),this._$AH=r}}_$AC(t){let e=ia.get(t.strings);return e===void 0&&ia.set(t.strings,e=new gi(t)),e}k(t){ui(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,a=0;for(const n of t)a===e.length?e.push(i=new An(this.O(us()),this.O(us()),this,this.options)):i=e[a],i._$AI(n),a++;a<e.length&&(this._$AR(i&&i._$AB.nextSibling,a),e.length=a)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t!==this._$AB;){const a=t.nextSibling;t.remove(),t=a}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},Rs=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,a,n){this.type=1,this._$AH=$,this._$AN=void 0,this.element=t,this.name=e,this._$AM=a,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$}_$AI(t,e=this,i,a){const n=this.strings;let r=!1;if(n===void 0)t=We(this,t,e,0),r=!fs(t)||t!==this._$AH&&t!==$t,r&&(this._$AH=t);else{const h=t;let d,p;for(t=n[0],d=0;d<n.length-1;d++)p=We(this,h[i+d],e,d),p===$t&&(p=this._$AH[d]),r||(r=!fs(p)||p!==this._$AH[d]),p===$?t=$:t!==$&&(t+=(p??"")+n[d+1]),this._$AH[d]=p}r&&!a&&this.j(t)}j(t){t===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Vn=class extends Rs{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$?void 0:t}},jn=class extends Rs{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==$)}},Hn=class extends Rs{constructor(t,e,i,a,n){super(t,e,i,a,n),this.type=5}_$AI(t,e=this){if((t=We(this,t,e,0)??$)===$t)return;const i=this._$AH,a=t===$&&i!==$||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==$&&(i===$||a);a&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}},Un=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){We(this,t)}};const qn={I:Ws},na=qs.litHtmlPolyfillSupport;na==null||na(gi,Ws),(qs.litHtmlVersions??(qs.litHtmlVersions=[])).push("3.3.1");const zn=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let a=i._$litPart$;if(a===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=a=new Ws(t.insertBefore(us(),n),n,void 0,e??{})}return a._$AI(s),a};/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/const
|
|
50
|
+
*/const V=s=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(s,t)})):customElements.define(s,t)};/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2019 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright 2017 Google LLC
|
|
65
65
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
-
*/const vs=globalThis;let Ge=class extends Ke{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=zn(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return $t}};var pa;Ge._$litElement$=!0,Ge.finalized=!0,(pa=vs.litElementHydrateSupport)==null||pa.call(vs,{LitElement:Ge});const ua=vs.litElementPolyfillSupport;ua==null||ua({LitElement:Ge}),(vs.litElementVersions??(vs.litElementVersions=[])).push("4.2.1");const ir={hi:"Hei!"},ar={from:"Fra",to:"Til"},nr={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},rr={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},or={search:{placeholder:"Søk…"},labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",rangeUnderflowMin:"Verdien må være større enn eller lik {min}.",rangeOverflowMax:"Verdien må være mindre enn eller lik {max}.",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},helptext:{helptextDropdownButton:"Les mer"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},
|
|
66
|
+
*/const vs=globalThis;let Ge=class extends Ke{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=zn(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return $t}};var pa;Ge._$litElement$=!0,Ge.finalized=!0,(pa=vs.litElementHydrateSupport)==null||pa.call(vs,{LitElement:Ge});const ua=vs.litElementPolyfillSupport;ua==null||ua({LitElement:Ge}),(vs.litElementVersions??(vs.litElementVersions=[])).push("4.2.1");const ir={hi:"Hei!"},ar={from:"Fra",to:"Til"},nr={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},rr={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},or={search:{placeholder:"Søk…"},labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",rangeUnderflowMin:"Verdien må være større enn eller lik {min}.",rangeOverflowMax:"Verdien må være mindre enn eller lik {max}.",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},helptext:{helptextDropdownButton:"Les mer"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},bt={example:ir,generic:ar,calendar:nr,dates:rr,forms:or};var lr=Object.defineProperty,fa=(s,t,e,i)=>{for(var a=void 0,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=r(t,e,a)||a);return a&&lr(t,e,a),a};let Ys=class extends Ge{constructor(){super(...arguments),this.strings=bt,this.role=null}hotReplacedCallback(){this.requestUpdate()}};fa([o({type:Object})],Ys.prototype,"strings"),fa([o({type:String})],Ys.prototype,"role");let Y=class extends Ys{createRenderRoot(){return this}};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
* @license
|
|
80
80
|
* Copyright 2020 Google LLC
|
|
81
81
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
82
|
-
*/const{I:dr}=qn,ma=s=>s.strings===void 0,va=()=>document.createComment(""),ys=(s,t,e)=>{var i;const a=s._$AA.parentNode,n=t===void 0?s._$AB:t._$AA;if(e===void 0){const r=a.insertBefore(va(),n),h=a.insertBefore(va(),n);e=new dr(r,h,s,s.options)}else{const r=e._$AB.nextSibling,h=e._$AM,d=h!==s;if(d){let p;(i=e._$AQ)==null||i.call(e,s),e._$AM=s,e._$AP!==void 0&&(p=s._$AU)!==h._$AU&&e._$AP(p)}if(r!==n||d){let p=e._$AA;for(;p!==r;){const
|
|
82
|
+
*/const{I:dr}=qn,ma=s=>s.strings===void 0,va=()=>document.createComment(""),ys=(s,t,e)=>{var i;const a=s._$AA.parentNode,n=t===void 0?s._$AB:t._$AA;if(e===void 0){const r=a.insertBefore(va(),n),h=a.insertBefore(va(),n);e=new dr(r,h,s,s.options)}else{const r=e._$AB.nextSibling,h=e._$AM,d=h!==s;if(d){let p;(i=e._$AQ)==null||i.call(e,s),e._$AM=s,e._$AP!==void 0&&(p=s._$AU)!==h._$AU&&e._$AP(p)}if(r!==n||d){let p=e._$AA;for(;p!==r;){const g=p.nextSibling;a.insertBefore(p,n),p=g}}}return e},Ne=(s,t,e=s)=>(s._$AI(t,e),s),cr={},ba=(s,t=cr)=>s._$AH=t,pr=s=>s._$AH,yi=s=>{s._$AR(),s._$AA.remove()};/**
|
|
83
83
|
* @license
|
|
84
84
|
* Copyright 2017 Google LLC
|
|
85
85
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -95,11 +95,11 @@
|
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let $i=class extends Xs{};$i.directiveName="unsafeSVG",$i.resultType=2;const $a=Te($i);var br=Object.defineProperty,yr=Object.getOwnPropertyDescriptor,$s=(s,t,e,i)=>{for(var a=i>1?void 0:i?yr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&br(t,e,a),a};const _i="https://punkt-cdn.oslo.kommune.no/13.
|
|
98
|
+
*/let $i=class extends Xs{};$i.directiveName="unsafeSVG",$i.resultType=2;const $a=Te($i);var br=Object.defineProperty,yr=Object.getOwnPropertyDescriptor,$s=(s,t,e,i)=>{for(var a=i>1?void 0:i?yr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&br(t,e,a),a};const _i="https://punkt-cdn.oslo.kommune.no/13.13/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||_i);const kr=s=>new Promise(t=>setTimeout(t,s)),Qs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',wi={},$r=async(s,t)=>{let e=0;for(;wi[t+s+".svg"]==="fetching"&&(e++,!(e>50));)await kr(50);const i=typeof Storage<"u"&&typeof localStorage<"u";return i&&localStorage.getItem(t+s+".svg")?Promise.resolve(localStorage.getItem(t+s+".svg")):typeof window<"u"&&typeof window.pktFetch=="function"?(wi[t+s+".svg"]="fetching",Promise.resolve(window.pktFetch(t+s+".svg").then(a=>a.ok?a.text():(console.error("Missing icon: "+t+s+".svg"),Qs)).then(a=>(a!==Qs&&i&&localStorage.setItem(t+s+".svg",a),wi[t+s+".svg"]="fetched",a)))):Promise.resolve(Qs)};let Ae=class extends Y{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:_i,this.name="",this.icon=$a(Qs),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path=typeof window<"u"?window.pktIconPath:_i),this.icon=$a(await $r(this.name||"",this.path).then(e=>e)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return u`${this.name&&this.icon}`}};$s([o({type:String,reflect:!1})],Ae.prototype,"path",2),$s([o({type:String,reflect:!0})],Ae.prototype,"name",2),$s([o({type:SVGElement})],Ae.prototype,"icon",2),$s([o({type:Array,noAccessor:!0})],Ae.prototype,"_updatedProps",2),Ae=$s([V("pkt-icon")],Ae);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const S=s=>s??$;var _r=Object.defineProperty,wr=Object.getOwnPropertyDescriptor,_t=(s,t,e,i)=>{for(var a=i>1?void 0:i?wr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&_r(t,e,a),a};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.
|
|
102
|
+
*/const S=s=>s??$;var _r=Object.defineProperty,wr=Object.getOwnPropertyDescriptor,_t=(s,t,e,i)=>{for(var a=i>1?void 0:i?wr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&_r(t,e,a),a};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.13/animations/";let yt=class extends Y{constructor(){super(),this.defaultSlot=T(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",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 at(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",t=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(t.preventDefault(),t.stopImmediatePropagation())},!0),this.addEventListener("keydown",t=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopImmediatePropagation())},!0)}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),t==="disabled"&&i==="false"&&(this.disabled=!1),(t==="isloading"||t==="isLoading")&&i==="false"&&(this.isLoading=!1)}firstUpdated(t){super.firstUpdated(t),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const t=this.form??this.getAttribute("form")??void 0,e={"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--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return u`
|
|
103
103
|
<button
|
|
104
104
|
class=${P(e)}
|
|
105
105
|
type=${this.type}
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
<span class="pkt-btn__text" ${A(this.defaultSlot)}></span>
|
|
118
118
|
${this.variant==="icons-right-and-left"?u`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:$}
|
|
119
119
|
</button>
|
|
120
|
-
`}};_t([o({type:String})],
|
|
120
|
+
`}};_t([o({type:String})],yt.prototype,"iconName",2),_t([o({type:String})],yt.prototype,"secondIconName",2),_t([o({type:String})],yt.prototype,"mode",2),_t([o({type:String})],yt.prototype,"size",2),_t([o({type:String})],yt.prototype,"color",2),_t([o({type:String})],yt.prototype,"skin",2),_t([o({type:String})],yt.prototype,"variant",2),_t([o({type:String,reflect:!0})],yt.prototype,"state",2),_t([o({type:String,reflect:!0})],yt.prototype,"type",2),_t([o({type:String})],yt.prototype,"form",2),_t([o({type:Boolean,reflect:!0})],yt.prototype,"isLoading",2),_t([o({type:Boolean,reflect:!0})],yt.prototype,"disabled",2),_t([o({type:String})],yt.prototype,"loadingAnimationPath",2),yt=_t([V("pkt-button")],yt);const xr={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},ti={props:xr};var Sr=Object.defineProperty,Cr=Object.getOwnPropertyDescriptor,Jt=(s,t,e,i)=>{for(var a=i>1?void 0:i?Cr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Sr(t,e,a),a};let Gt=class extends Y{constructor(){super(),this.defaultSlot=T(),this.compact=ti.props.compact.default,this.title="",this.skin=ti.props.skin.default,this.ariaLive=ti.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=ti.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new at(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,e,i){t==="ariaLive"&&(this["aria-live"]=i),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&ka(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},e={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return u`
|
|
121
121
|
<div class=${P(t)} aria-live=${this["aria-live"]}>
|
|
122
122
|
<div class=${P(e)}>
|
|
123
123
|
<pkt-icon
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
${this.date?u`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:$}
|
|
150
150
|
</div>
|
|
151
151
|
</div>
|
|
152
|
-
`}};Jt([o({type:Boolean,reflect:!1})],Gt.prototype,"compact",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"title",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"skin",2),Jt([o({type:String})],Gt.prototype,"ariaLive",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"aria-live",2),Jt([o({type:Boolean,reflect:!0})],Gt.prototype,"closeAlert",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"date",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"role",2),Jt([B()],Gt.prototype,"_isClosed",2),Gt=Jt([
|
|
152
|
+
`}};Jt([o({type:Boolean,reflect:!1})],Gt.prototype,"compact",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"title",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"skin",2),Jt([o({type:String})],Gt.prototype,"ariaLive",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"aria-live",2),Jt([o({type:Boolean,reflect:!0})],Gt.prototype,"closeAlert",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"date",2),Jt([o({type:String,reflect:!0})],Gt.prototype,"role",2),Jt([B()],Gt.prototype,"_isClosed",2),Gt=Jt([V("pkt-alert")],Gt);var Tr=Object.defineProperty,Nr=Object.getOwnPropertyDescriptor,_s=(s,t,e,i)=>{for(var a=i>1?void 0:i?Nr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Tr(t,e,a),a};let Xe=class extends Ge{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(t){t.has("skin")&&this.requestUpdate(),t.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var t;if(this.name){const e=(t=this.renderRoot)==null?void 0:t.querySelector("slot");e&&e.assignedElements().forEach(i=>{i.tagName.toLowerCase()==="pkt-accordion-item"&&(i.hasAttribute("name")||i.setAttribute("name",this.name))})}}firstUpdated(){var t;const e=(t=this.renderRoot)==null?void 0:t.querySelector("slot");e&&e.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const t={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return u`
|
|
153
153
|
<div
|
|
154
154
|
part="container"
|
|
155
155
|
class=${P(t)}
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
>
|
|
159
159
|
<slot></slot>
|
|
160
160
|
</div>
|
|
161
|
-
`}};_s([o({type:String,reflect:!0,attribute:"aria-labelledby"})],Xe.prototype,"ariaLabelledBy",2),_s([o({type:Boolean,reflect:!0,attribute:"compact"})],Xe.prototype,"compact",2),_s([o({type:String,reflect:!0,attribute:"skin"})],Xe.prototype,"skin",2),_s([o({type:String,reflect:!0,attribute:"name"})],Xe.prototype,"name",2),Xe=_s([
|
|
161
|
+
`}};_s([o({type:String,reflect:!0,attribute:"aria-labelledby"})],Xe.prototype,"ariaLabelledBy",2),_s([o({type:Boolean,reflect:!0,attribute:"compact"})],Xe.prototype,"compact",2),_s([o({type:String,reflect:!0,attribute:"skin"})],Xe.prototype,"skin",2),_s([o({type:String,reflect:!0,attribute:"name"})],Xe.prototype,"name",2),Xe=_s([V("pkt-accordion")],Xe);var Ar=Object.defineProperty,Er=Object.getOwnPropertyDescriptor,Ee=(s,t,e,i)=>{for(var a=i>1?void 0:i?Er(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Ar(t,e,a),a};let ge=class extends Y{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=T(),this.defaultSlot=T(),this.slotController=new at(this,this.defaultSlot)}firstUpdated(t){this.defaultOpen&&(this.isOpen=!0)}render(){const t={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return u`
|
|
162
162
|
<details
|
|
163
163
|
class=${P(t)}
|
|
164
164
|
id=${this.id}
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
<div class="pkt-accordion-item__content-inner" ${A(this.defaultSlot)}></div>
|
|
183
183
|
</div>
|
|
184
184
|
</details>
|
|
185
|
-
`}};Ee([o({type:Boolean})],
|
|
185
|
+
`}};Ee([o({type:Boolean})],ge.prototype,"defaultOpen",2),Ee([o({type:String})],ge.prototype,"title",2),Ee([o({type:String,reflect:!0})],ge.prototype,"skin",2),Ee([o({type:Boolean,reflect:!0})],ge.prototype,"compact",2),Ee([o({type:Boolean,reflect:!0})],ge.prototype,"isOpen",2),Ee([o({type:String,reflect:!0})],ge.prototype,"name",2),ge=Ee([V("pkt-accordion-item")],ge);var Pr=Object.defineProperty,Or=Object.getOwnPropertyDescriptor,ei=(s,t,e,i)=>{for(var a=i>1?void 0:i?Or(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Pr(t,e,a),a};let Je=class extends Y{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,e,i){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,e,i)}render(){return u`<nav
|
|
186
186
|
class="pkt-back-link"
|
|
187
187
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
188
188
|
>
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
></pkt-icon
|
|
195
195
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
196
196
|
>
|
|
197
|
-
</nav>`}};ei([o({type:String})],Je.prototype,"href",2),ei([o({type:String})],Je.prototype,"text",2),ei([o({type:String})],Je.prototype,"ariaLabel",2),Je=ei([F("pkt-backlink")],Je);const _a=6048e5,Mr=864e5,wa=Symbol.for("constructDateFrom");function Qt(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&wa in s?s[wa](t):s instanceof Date?new s.constructor(t):new Date(t)}function At(s,t){return Qt(t||s,s)}function xi(s,t,e){const i=At(s,void 0);return isNaN(t)?Qt(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let Dr={};function si(){return Dr}function ws(s,t){var e,i,a,n;const r=si(),h=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??r.weekStartsOn??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.weekStartsOn)??0,d=At(s,t==null?void 0:t.in),p=d.getDay(),m=(p<h?7:0)+p-h;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function ii(s,t){return ws(s,{...t,weekStartsOn:1})}function xa(s,t){const e=At(s,void 0),i=e.getFullYear(),a=Qt(e,0);a.setFullYear(i+1,0,4),a.setHours(0,0,0,0);const n=ii(a),r=Qt(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=ii(r);return e.getTime()>=n.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Sa(s){const t=At(s),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+s-+e}function Ca(s,...t){const e=Qt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ta(s,t){const e=At(s,void 0);return e.setHours(0,0,0,0),e}function Ir(s,t,e){const[i,a]=Ca(void 0,s,t),n=Ta(i),r=Ta(a),h=+n-Sa(n),d=+r-Sa(r);return Math.round((h-d)/Mr)}function Lr(s,t){const e=xa(s),i=Qt(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ii(i)}function Br(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Fr(s){return!(!Br(s)&&typeof s!="number"||isNaN(+At(s)))}function Vr(s,t){const[e,i]=Ca(s,t.start,t.end);return{start:e,end:i}}function Si(s,t){const{start:e,end:i}=Vr(void 0,s);let a=+e>+i;const n=a?+e:+i,r=a?i:e;r.setHours(0,0,0,0);let h=1;const d=[];for(;+r<=n;)d.push(Qt(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return a?d.reverse():d}function jr(s,t){const e=At(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Hr={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"}},Ur=(s,t,e)=>{let i;const a=Hr[s];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ci(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const qr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rr={date:Ci({formats:qr,defaultWidth:"full"}),time:Ci({formats:zr,defaultWidth:"full"}),dateTime:Ci({formats:Wr,defaultWidth:"full"})},Kr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gr=(s,t,e,i)=>Kr[s];function xs(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let a;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;a=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;a=s.values[h]||s.values[r]}const n=s.argumentCallback?s.argumentCallback(t):t;return a[n]}}const Yr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zr={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xr={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"]},Jr={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"]},Qr={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"}},to={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"}},eo=(s,t)=>{const e=Number(s),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},so={ordinalNumber:eo,era:xs({values:Yr,defaultWidth:"wide"}),quarter:xs({values:Zr,defaultWidth:"wide",argumentCallback:s=>s-1}),month:xs({values:Xr,defaultWidth:"wide"}),day:xs({values:Jr,defaultWidth:"wide"}),dayPeriod:xs({values:Qr,defaultWidth:"wide",formattingValues:to,defaultFormattingWidth:"wide"})};function Ss(s){return(t,e={})=>{const i=e.width,a=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],n=t.match(a);if(!n)return null;const r=n[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(h)?ao(h,g=>g.test(r)):io(h,g=>g.test(r));let p;p=s.valueCallback?s.valueCallback(d):d,p=e.valueCallback?e.valueCallback(p):p;const m=t.slice(r.length);return{value:p,rest:m}}}function io(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function ao(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function no(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const a=i[0],n=t.match(s.parsePattern);if(!n)return null;let r=s.valueCallback?s.valueCallback(n[0]):n[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(a.length);return{value:r,rest:h}}}const ro=/^(\d+)(th|st|nd|rd)?/i,oo=/\d+/i,lo={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},ho={any:[/^b/i,/^(a|c)/i]},co={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},po={any:[/1/i,/2/i,/3/i,/4/i]},uo={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},fo={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]},go={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},mo={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]},vo={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},bo={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}},yo={ordinalNumber:no({matchPattern:ro,parsePattern:oo,valueCallback:s=>parseInt(s,10)}),era:Ss({matchPatterns:lo,defaultMatchWidth:"wide",parsePatterns:ho,defaultParseWidth:"any"}),quarter:Ss({matchPatterns:co,defaultMatchWidth:"wide",parsePatterns:po,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Ss({matchPatterns:uo,defaultMatchWidth:"wide",parsePatterns:fo,defaultParseWidth:"any"}),day:Ss({matchPatterns:go,defaultMatchWidth:"wide",parsePatterns:mo,defaultParseWidth:"any"}),dayPeriod:Ss({matchPatterns:vo,defaultMatchWidth:"any",parsePatterns:bo,defaultParseWidth:"any"})},ko={code:"en-US",formatDistance:Ur,formatLong:Rr,formatRelative:Gr,localize:so,match:yo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $o(s,t){const e=At(s,void 0);return Ir(e,jr(e))+1}function _o(s,t){const e=At(s,void 0),i=+ii(e)-+Lr(e);return Math.round(i/_a)+1}function Na(s,t){var e,i,a,n;const r=At(s,t==null?void 0:t.in),h=r.getFullYear(),d=si(),p=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((n=(a=d.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,m=Qt((t==null?void 0:t.in)||s,0);m.setFullYear(h+1,0,p),m.setHours(0,0,0,0);const g=ws(m,t),k=Qt((t==null?void 0:t.in)||s,0);k.setFullYear(h,0,p),k.setHours(0,0,0,0);const b=ws(k,t);return+r>=+g?h+1:+r>=+b?h:h-1}function wo(s,t){var e,i,a,n;const r=si(),h=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??r.firstWeekContainsDate??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,d=Na(s,t),p=Qt((t==null?void 0:t.in)||s,0);return p.setFullYear(d,0,h),p.setHours(0,0,0,0),ws(p,t)}function Aa(s,t){const e=At(s,t==null?void 0:t.in),i=+ws(e,t)-+wo(e,t);return Math.round(i/_a)+1}function W(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const ve={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return W(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):W(e+1,2)},d(s,t){return W(s.getDate(),t.length)},a(s,t){const e=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(s,t){return W(s.getHours()%12||12,t.length)},H(s,t){return W(s.getHours(),t.length)},m(s,t){return W(s.getMinutes(),t.length)},s(s,t){return W(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),a=Math.trunc(i*Math.pow(10,e-3));return W(a,t.length)}},Qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ea={G:function(s,t,e){const i=s.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(s,t,e){if(t==="yo"){const i=s.getFullYear(),a=i>0?i:1-i;return e.ordinalNumber(a,{unit:"year"})}return ve.y(s,t)},Y:function(s,t,e,i){const a=Na(s,i),n=a>0?a:1-a;if(t==="YY"){const r=n%100;return W(r,2)}return t==="Yo"?e.ordinalNumber(n,{unit:"year"}):W(n,t.length)},R:function(s,t){const e=xa(s);return W(e,t.length)},u:function(s,t){const e=s.getFullYear();return W(e,t.length)},Q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return W(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return W(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,t,e){const i=s.getMonth();switch(t){case"M":case"MM":return ve.M(s,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(s,t,e){const i=s.getMonth();switch(t){case"L":return String(i+1);case"LL":return W(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(s,t,e,i){const a=Aa(s,i);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):W(a,t.length)},I:function(s,t,e){const i=_o(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):W(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):ve.d(s,t)},D:function(s,t,e){const i=$o(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):W(i,t.length)},E:function(s,t,e){const i=s.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(s,t,e,i){const a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(n);case"ee":return W(n,2);case"eo":return e.ordinalNumber(n,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(n);case"cc":return W(n,t.length);case"co":return e.ordinalNumber(n,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return W(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(s,t,e){const i=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,t,e){const i=s.getHours();let a;switch(i===12?a=Qe.noon:i===0?a=Qe.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let a;switch(i>=17?a=Qe.evening:i>=12?a=Qe.afternoon:i>=4?a=Qe.morning:a=Qe.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(s,t,e){if(t==="ho"){let i=s.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return ve.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):ve.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):W(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):W(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):ve.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):ve.s(s,t)},S:function(s,t){return ve.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Oa(i);case"XXXX":case"XX":return Pe(i);case"XXXXX":case"XXX":default:return Pe(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return Oa(i);case"xxxx":case"xx":return Pe(i);case"xxxxx":case"xxx":default:return Pe(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pa(i,":");case"OOOO":default:return"GMT"+Pe(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pa(i,":");case"zzzz":default:return"GMT"+Pe(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return W(i,t.length)},T:function(s,t,e){return W(+s,t.length)}};function Pa(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=Math.trunc(i/60),n=i%60;return n===0?e+String(a):e+String(a)+t+W(n,2)}function Oa(s,t){return s%60===0?(s>0?"-":"+")+W(Math.abs(s)/60,2):Pe(s,t)}function Pe(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=W(Math.trunc(i/60),2),n=W(i%60,2);return e+a+t+n}const Ma=(s,t)=>{switch(s){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Da=(s,t)=>{switch(s){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},xo=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],a=e[2];if(!a)return Ma(s,t);let n;switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"});break}return n.replace("{{date}}",Ma(i,t)).replace("{{time}}",Da(a,t))},So={p:Da,P:xo},Co=/^D+$/,To=/^Y+$/,No=["D","DD","YY","YYYY"];function Ao(s){return Co.test(s)}function Eo(s){return To.test(s)}function Po(s,t,e){const i=Oo(s,t,e);if(console.warn(i),No.includes(s))throw new RangeError(i)}function Oo(s,t,e){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Mo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Do=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Io=/^'([^]*?)'?$/,Lo=/''/g,Bo=/[a-zA-Z]/;function Fo(s,t,e){var i,a,n,r;const h=si(),d=h.locale??ko,p=h.firstWeekContainsDate??((a=(i=h.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,m=h.weekStartsOn??((r=(n=h.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,g=At(s,void 0);if(!Fr(g))throw new RangeError("Invalid time value");let k=t.match(Do).map(y=>{const w=y[0];if(w==="p"||w==="P"){const C=So[w];return C(y,d.formatLong)}return y}).join("").match(Mo).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:Vo(y)};if(Ea[w])return{isToken:!0,value:y};if(w.match(Bo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});d.localize.preprocessor&&(k=d.localize.preprocessor(g,k));const b={firstWeekContainsDate:p,weekStartsOn:m,locale:d};return k.map(y=>{if(!y.isToken)return y.value;const w=y.value;(Eo(w)||Ao(w))&&Po(w,t,String(s));const C=Ea[w[0]];return C(g,w,d.localize,b)}).join("")}function Vo(s){const t=s.match(Io);return t?t[1].replace(Lo,"'"):s}function jo(s,t){const e=At(s,void 0).getDay();return e===0?7:e}function Ho(s,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const Ia={},Cs={};function Oe(s,t){try{const e=(Ia[s]||(Ia[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Cs?Cs[e]:La(e,e.split(":"))}catch{if(s in Cs)return Cs[s];const e=s==null?void 0:s.match(Uo);return e?La(s,e.slice(1)):NaN}}const Uo=/([+-]\d\d):?(\d\d)?/;function La(s,t){const e=+(t[0]||0),i=+(t[1]||0),a=+(t[2]||0)/60;return Cs[s]=e*60+i>0?e*60+i+a:e*60-i-a}let Ts=class Hs extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Oe(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Fa(this),Ti(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Hs(...e,t):new Hs(Date.now(),t)}withTimeZone(t){return new Hs(+this,t)}getTimezoneOffset(){const t=-Oe(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ti(this),+this}[Symbol.for("constructDateFrom")](t){return new Hs(+new Date(t),this.timeZone)}};const Ba=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Ba.test(s))return;const t=s.replace(Ba,"$1UTC");Ts.prototype[t]&&(s.startsWith("get")?Ts.prototype[s]=function(){return this.internal[t]()}:(Ts.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),qo(this),+this},Ts.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ti(this),+this}))});function Ti(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Oe(s.timeZone,s)*60))}function qo(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()),Fa(s)}function Fa(s){const t=Oe(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const a=-new Date(+s).getTimezoneOffset(),n=-new Date(+i).getTimezoneOffset(),r=a-n,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const d=a-e;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=a>0?p.getSeconds():(p.getSeconds()-60)%60,g=Math.round(-(Oe(s.timeZone,s)*60))%60;(g||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+g),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+g+m));const k=Oe(s.timeZone,s),b=k>0?Math.floor(k):Math.ceil(k),y=-new Date(+s).getTimezoneOffset()-b,w=b!==e,C=y-d;if(w&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const M=Oe(s.timeZone,s),N=M>0?Math.floor(M):Math.ceil(M),U=b-N;U&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+U),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+U))}}let Ni=class Us extends Ts{static tz(t,...e){return e.length?new Us(...e,t):new Us(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),a=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,a]=this.tzComponents();return`${t} GMT${e}${i}${a} (${Ho(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",i=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,i,a]}withTimeZone(t){return new Us(+this,t)}[Symbol.for("constructDateFrom")](t){return new Us(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const zo=(s=window.pktTz)=>{const t=new Ni(new Date().toISOString(),s);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function be(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[t,e,i]=s.split("-").map(Number);return new Date(t,e-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[t,e]=s.split("-").map(Number);return new Date(t,e-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 t=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${t}-${e}-${i}`},ye=s=>{if(!s)return null;const t=be(s);return isNaN(t.getTime())?null:t},Va=(s,t)=>{const e=oe(s);return isNaN(e.getTime())?"":Fo(e,t)},oe=(s="",t)=>{const e=typeof s=="string"?be(s):s;return!e||isNaN(e.getTime())?new Date:e},ke=(s,t,e=1)=>{if(typeof s!="number"||typeof t!="number"||typeof e!="number"||isNaN(s)||isNaN(t)||isNaN(e))return new Date;const i=new Date(s,t,e);return isNaN(i.getTime())?new Date:i},Ns=s=>{let t;return typeof s=="number"?t=new Ni(s,window.pktTz):t=new Ni(s,window.pktTz),t.setHours(12,0,0,0),t},Wo=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),Ro=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?oe(t):null,a=e?oe(e):null;return!(i&&s<i||a&&s>a)},Ko=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=nt(s);return t.includes(e)},Go=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ja=(s,t,e,i,a)=>!(!s||isNaN(s.getTime())||!Ro(s,t,e)||i&&Ko(s,i)||a&&Go(s,a)),Yo=(s,t,e,i,a)=>s.filter(n=>{const r=ye(n);return r&&ja(r,t,e,i,a)}),Zo=s=>s.slice().sort((t,e)=>{const i=ye(t),a=ye(e);return!i||!a?0:i.getTime()-a.getTime()}),Xo=(s,t)=>{const e=ye(s),i=ye(t);return!e||!i?!1:e<=i},Ha=s=>{if(Array.isArray(s))return s;if(typeof s=="string")return s.split(",")},Jo=s=>s?be(s):null,Qo=s=>{if(typeof s=="string")return s.split(",").map(t=>be(t));if(Array.isArray(s))return s.map(t=>be(t))},ts={csvToArray:Ha,stringToDate:Jo,stringsToDate:Qo},tl={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Me={props:tl};var el=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,K=(s,t,e,i)=>{for(var a=i>1?void 0:i?sl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&el(t,e,a),a};let R=class extends Y{constructor(){super(...arguments),this.multiple=Me.props.multiple.default,this.maxMultiple=Me.props.maxMultiple.default,this.range=Me.props.range.default,this.weeknumbers=Me.props.weeknumbers.default,this.withcontrols=Me.props.withcontrols.default,this.selected=[],this.earliest=Me.props.earliest.default,this.latest=Me.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,i){t==="selected"&&i&&this.convertSelected(),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>be(t)),this.range&&this.selected.length===2){const t=Si({start:this._selected[0],end:this._selected[1]});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let i=0;i<t.length;i++){const a=t[i],n=a>this._selected[0]&&a<this._selected[1];e[nt(a)]=n}this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=be(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?Ns(new Date):t}else this.currentmonth===null&&(this.currentmonth=Ns(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Ns(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var i,a,n,r,h;if(((i=t.target)==null?void 0:i.nodeName)==="INPUT"||((a=t.target)==null?void 0:a.nodeName)==="SELECT"||((n=t.target)==null?void 0:n.nodeName)==="BUTTON"&&!((h=(r=t.target)==null?void 0:r.dataset)!=null&&h.date))return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const d=this.focusedDate?oe(this.focusedDate):ke(this.year,this.month,1);let p=xi(d,e);if(p){let m=this.querySelector(`button[data-date="${nt(p)}"]`);if(m instanceof HTMLButtonElement){if(m.dataset.disabled){p=xi(p,e);let g=this.querySelector(`button[data-date="${nt(p)}"]`);for(;g&&g instanceof HTMLButtonElement&&g.dataset.disabled;)p=xi(p,e),g=this.querySelector(`button[data-date="${nt(p)}"]`);m=g}m instanceof HTMLButtonElement&&!m.dataset.disabled&&(this.focusedDate=nt(p),m.focus())}}}render(){return u`
|
|
197
|
+
</nav>`}};ei([o({type:String})],Je.prototype,"href",2),ei([o({type:String})],Je.prototype,"text",2),ei([o({type:String})],Je.prototype,"ariaLabel",2),Je=ei([V("pkt-backlink")],Je);const _a=6048e5,Mr=864e5,wa=Symbol.for("constructDateFrom");function Qt(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&wa in s?s[wa](t):s instanceof Date?new s.constructor(t):new Date(t)}function At(s,t){return Qt(t||s,s)}function xi(s,t,e){const i=At(s,void 0);return isNaN(t)?Qt(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let Dr={};function si(){return Dr}function ws(s,t){var e,i,a,n;const r=si(),h=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??r.weekStartsOn??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.weekStartsOn)??0,d=At(s,t==null?void 0:t.in),p=d.getDay(),g=(p<h?7:0)+p-h;return d.setDate(d.getDate()-g),d.setHours(0,0,0,0),d}function ii(s,t){return ws(s,{...t,weekStartsOn:1})}function xa(s,t){const e=At(s,void 0),i=e.getFullYear(),a=Qt(e,0);a.setFullYear(i+1,0,4),a.setHours(0,0,0,0);const n=ii(a),r=Qt(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=ii(r);return e.getTime()>=n.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Sa(s){const t=At(s),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+s-+e}function Ca(s,...t){const e=Qt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ta(s,t){const e=At(s,void 0);return e.setHours(0,0,0,0),e}function Ir(s,t,e){const[i,a]=Ca(void 0,s,t),n=Ta(i),r=Ta(a),h=+n-Sa(n),d=+r-Sa(r);return Math.round((h-d)/Mr)}function Lr(s,t){const e=xa(s),i=Qt(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ii(i)}function Br(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Fr(s){return!(!Br(s)&&typeof s!="number"||isNaN(+At(s)))}function Vr(s,t){const[e,i]=Ca(s,t.start,t.end);return{start:e,end:i}}function Si(s,t){const{start:e,end:i}=Vr(void 0,s);let a=+e>+i;const n=a?+e:+i,r=a?i:e;r.setHours(0,0,0,0);let h=1;const d=[];for(;+r<=n;)d.push(Qt(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return a?d.reverse():d}function jr(s,t){const e=At(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Hr={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"}},Ur=(s,t,e)=>{let i;const a=Hr[s];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ci(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const qr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rr={date:Ci({formats:qr,defaultWidth:"full"}),time:Ci({formats:zr,defaultWidth:"full"}),dateTime:Ci({formats:Wr,defaultWidth:"full"})},Kr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gr=(s,t,e,i)=>Kr[s];function xs(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let a;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;a=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;a=s.values[h]||s.values[r]}const n=s.argumentCallback?s.argumentCallback(t):t;return a[n]}}const Yr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zr={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xr={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"]},Jr={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"]},Qr={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"}},to={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"}},eo=(s,t)=>{const e=Number(s),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},so={ordinalNumber:eo,era:xs({values:Yr,defaultWidth:"wide"}),quarter:xs({values:Zr,defaultWidth:"wide",argumentCallback:s=>s-1}),month:xs({values:Xr,defaultWidth:"wide"}),day:xs({values:Jr,defaultWidth:"wide"}),dayPeriod:xs({values:Qr,defaultWidth:"wide",formattingValues:to,defaultFormattingWidth:"wide"})};function Ss(s){return(t,e={})=>{const i=e.width,a=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],n=t.match(a);if(!n)return null;const r=n[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(h)?ao(h,m=>m.test(r)):io(h,m=>m.test(r));let p;p=s.valueCallback?s.valueCallback(d):d,p=e.valueCallback?e.valueCallback(p):p;const g=t.slice(r.length);return{value:p,rest:g}}}function io(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function ao(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function no(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const a=i[0],n=t.match(s.parsePattern);if(!n)return null;let r=s.valueCallback?s.valueCallback(n[0]):n[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(a.length);return{value:r,rest:h}}}const ro=/^(\d+)(th|st|nd|rd)?/i,oo=/\d+/i,lo={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},ho={any:[/^b/i,/^(a|c)/i]},co={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},po={any:[/1/i,/2/i,/3/i,/4/i]},uo={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},fo={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]},go={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},mo={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]},vo={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},bo={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}},yo={ordinalNumber:no({matchPattern:ro,parsePattern:oo,valueCallback:s=>parseInt(s,10)}),era:Ss({matchPatterns:lo,defaultMatchWidth:"wide",parsePatterns:ho,defaultParseWidth:"any"}),quarter:Ss({matchPatterns:co,defaultMatchWidth:"wide",parsePatterns:po,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Ss({matchPatterns:uo,defaultMatchWidth:"wide",parsePatterns:fo,defaultParseWidth:"any"}),day:Ss({matchPatterns:go,defaultMatchWidth:"wide",parsePatterns:mo,defaultParseWidth:"any"}),dayPeriod:Ss({matchPatterns:vo,defaultMatchWidth:"any",parsePatterns:bo,defaultParseWidth:"any"})},ko={code:"en-US",formatDistance:Ur,formatLong:Rr,formatRelative:Gr,localize:so,match:yo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $o(s,t){const e=At(s,void 0);return Ir(e,jr(e))+1}function _o(s,t){const e=At(s,void 0),i=+ii(e)-+Lr(e);return Math.round(i/_a)+1}function Na(s,t){var e,i,a,n;const r=At(s,t==null?void 0:t.in),h=r.getFullYear(),d=si(),p=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((n=(a=d.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,g=Qt((t==null?void 0:t.in)||s,0);g.setFullYear(h+1,0,p),g.setHours(0,0,0,0);const m=ws(g,t),k=Qt((t==null?void 0:t.in)||s,0);k.setFullYear(h,0,p),k.setHours(0,0,0,0);const b=ws(k,t);return+r>=+m?h+1:+r>=+b?h:h-1}function wo(s,t){var e,i,a,n;const r=si(),h=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??r.firstWeekContainsDate??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,d=Na(s,t),p=Qt((t==null?void 0:t.in)||s,0);return p.setFullYear(d,0,h),p.setHours(0,0,0,0),ws(p,t)}function Aa(s,t){const e=At(s,t==null?void 0:t.in),i=+ws(e,t)-+wo(e,t);return Math.round(i/_a)+1}function W(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const me={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return W(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):W(e+1,2)},d(s,t){return W(s.getDate(),t.length)},a(s,t){const e=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(s,t){return W(s.getHours()%12||12,t.length)},H(s,t){return W(s.getHours(),t.length)},m(s,t){return W(s.getMinutes(),t.length)},s(s,t){return W(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),a=Math.trunc(i*Math.pow(10,e-3));return W(a,t.length)}},Qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ea={G:function(s,t,e){const i=s.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(s,t,e){if(t==="yo"){const i=s.getFullYear(),a=i>0?i:1-i;return e.ordinalNumber(a,{unit:"year"})}return me.y(s,t)},Y:function(s,t,e,i){const a=Na(s,i),n=a>0?a:1-a;if(t==="YY"){const r=n%100;return W(r,2)}return t==="Yo"?e.ordinalNumber(n,{unit:"year"}):W(n,t.length)},R:function(s,t){const e=xa(s);return W(e,t.length)},u:function(s,t){const e=s.getFullYear();return W(e,t.length)},Q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return W(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return W(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,t,e){const i=s.getMonth();switch(t){case"M":case"MM":return me.M(s,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(s,t,e){const i=s.getMonth();switch(t){case"L":return String(i+1);case"LL":return W(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(s,t,e,i){const a=Aa(s,i);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):W(a,t.length)},I:function(s,t,e){const i=_o(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):W(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):me.d(s,t)},D:function(s,t,e){const i=$o(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):W(i,t.length)},E:function(s,t,e){const i=s.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(s,t,e,i){const a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(n);case"ee":return W(n,2);case"eo":return e.ordinalNumber(n,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(n);case"cc":return W(n,t.length);case"co":return e.ordinalNumber(n,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return W(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(s,t,e){const i=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,t,e){const i=s.getHours();let a;switch(i===12?a=Qe.noon:i===0?a=Qe.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let a;switch(i>=17?a=Qe.evening:i>=12?a=Qe.afternoon:i>=4?a=Qe.morning:a=Qe.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(s,t,e){if(t==="ho"){let i=s.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return me.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):me.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):W(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):W(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):me.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):me.s(s,t)},S:function(s,t){return me.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Oa(i);case"XXXX":case"XX":return Pe(i);case"XXXXX":case"XXX":default:return Pe(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return Oa(i);case"xxxx":case"xx":return Pe(i);case"xxxxx":case"xxx":default:return Pe(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pa(i,":");case"OOOO":default:return"GMT"+Pe(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pa(i,":");case"zzzz":default:return"GMT"+Pe(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return W(i,t.length)},T:function(s,t,e){return W(+s,t.length)}};function Pa(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=Math.trunc(i/60),n=i%60;return n===0?e+String(a):e+String(a)+t+W(n,2)}function Oa(s,t){return s%60===0?(s>0?"-":"+")+W(Math.abs(s)/60,2):Pe(s,t)}function Pe(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=W(Math.trunc(i/60),2),n=W(i%60,2);return e+a+t+n}const Ma=(s,t)=>{switch(s){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Da=(s,t)=>{switch(s){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},xo=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],a=e[2];if(!a)return Ma(s,t);let n;switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"});break}return n.replace("{{date}}",Ma(i,t)).replace("{{time}}",Da(a,t))},So={p:Da,P:xo},Co=/^D+$/,To=/^Y+$/,No=["D","DD","YY","YYYY"];function Ao(s){return Co.test(s)}function Eo(s){return To.test(s)}function Po(s,t,e){const i=Oo(s,t,e);if(console.warn(i),No.includes(s))throw new RangeError(i)}function Oo(s,t,e){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Mo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Do=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Io=/^'([^]*?)'?$/,Lo=/''/g,Bo=/[a-zA-Z]/;function Fo(s,t,e){var i,a,n,r;const h=si(),d=h.locale??ko,p=h.firstWeekContainsDate??((a=(i=h.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,g=h.weekStartsOn??((r=(n=h.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,m=At(s,void 0);if(!Fr(m))throw new RangeError("Invalid time value");let k=t.match(Do).map(y=>{const w=y[0];if(w==="p"||w==="P"){const C=So[w];return C(y,d.formatLong)}return y}).join("").match(Mo).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:Vo(y)};if(Ea[w])return{isToken:!0,value:y};if(w.match(Bo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});d.localize.preprocessor&&(k=d.localize.preprocessor(m,k));const b={firstWeekContainsDate:p,weekStartsOn:g,locale:d};return k.map(y=>{if(!y.isToken)return y.value;const w=y.value;(Eo(w)||Ao(w))&&Po(w,t,String(s));const C=Ea[w[0]];return C(m,w,d.localize,b)}).join("")}function Vo(s){const t=s.match(Io);return t?t[1].replace(Lo,"'"):s}function jo(s,t){const e=At(s,void 0).getDay();return e===0?7:e}function Ho(s,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const Ia={},Cs={};function Oe(s,t){try{const e=(Ia[s]||(Ia[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Cs?Cs[e]:La(e,e.split(":"))}catch{if(s in Cs)return Cs[s];const e=s==null?void 0:s.match(Uo);return e?La(s,e.slice(1)):NaN}}const Uo=/([+-]\d\d):?(\d\d)?/;function La(s,t){const e=+(t[0]||0),i=+(t[1]||0),a=+(t[2]||0)/60;return Cs[s]=e*60+i>0?e*60+i+a:e*60-i-a}let Ts=class Hs extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Oe(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Fa(this),Ti(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Hs(...e,t):new Hs(Date.now(),t)}withTimeZone(t){return new Hs(+this,t)}getTimezoneOffset(){const t=-Oe(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ti(this),+this}[Symbol.for("constructDateFrom")](t){return new Hs(+new Date(t),this.timeZone)}};const Ba=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Ba.test(s))return;const t=s.replace(Ba,"$1UTC");Ts.prototype[t]&&(s.startsWith("get")?Ts.prototype[s]=function(){return this.internal[t]()}:(Ts.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),qo(this),+this},Ts.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ti(this),+this}))});function Ti(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Oe(s.timeZone,s)*60))}function qo(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()),Fa(s)}function Fa(s){const t=Oe(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const a=-new Date(+s).getTimezoneOffset(),n=-new Date(+i).getTimezoneOffset(),r=a-n,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const d=a-e;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const g=a>0?p.getSeconds():(p.getSeconds()-60)%60,m=Math.round(-(Oe(s.timeZone,s)*60))%60;(m||g)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+m+g));const k=Oe(s.timeZone,s),b=k>0?Math.floor(k):Math.ceil(k),y=-new Date(+s).getTimezoneOffset()-b,w=b!==e,C=y-d;if(w&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const M=Oe(s.timeZone,s),N=M>0?Math.floor(M):Math.ceil(M),U=b-N;U&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+U),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+U))}}let Ni=class Us extends Ts{static tz(t,...e){return e.length?new Us(...e,t):new Us(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),a=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,a]=this.tzComponents();return`${t} GMT${e}${i}${a} (${Ho(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",i=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,i,a]}withTimeZone(t){return new Us(+this,t)}[Symbol.for("constructDateFrom")](t){return new Us(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const zo=(s=window.pktTz)=>{const t=new Ni(new Date().toISOString(),s);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function ve(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[t,e,i]=s.split("-").map(Number);return new Date(t,e-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[t,e]=s.split("-").map(Number);return new Date(t,e-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 t=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${t}-${e}-${i}`},be=s=>{if(!s)return null;const t=ve(s);return isNaN(t.getTime())?null:t},Va=(s,t)=>{const e=oe(s);return isNaN(e.getTime())?"":Fo(e,t)},oe=(s="",t)=>{const e=typeof s=="string"?ve(s):s;return!e||isNaN(e.getTime())?new Date:e},ye=(s,t,e=1)=>{if(typeof s!="number"||typeof t!="number"||typeof e!="number"||isNaN(s)||isNaN(t)||isNaN(e))return new Date;const i=new Date(s,t,e);return isNaN(i.getTime())?new Date:i},Ns=s=>{let t;return typeof s=="number"?t=new Ni(s,window.pktTz):t=new Ni(s,window.pktTz),t.setHours(12,0,0,0),t},Wo=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),Ro=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?oe(t):null,a=e?oe(e):null;return!(i&&s<i||a&&s>a)},Ko=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=nt(s);return t.includes(e)},Go=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ja=(s,t,e,i,a)=>!(!s||isNaN(s.getTime())||!Ro(s,t,e)||i&&Ko(s,i)||a&&Go(s,a)),Yo=(s,t,e,i,a)=>s.filter(n=>{const r=be(n);return r&&ja(r,t,e,i,a)}),Zo=s=>s.slice().sort((t,e)=>{const i=be(t),a=be(e);return!i||!a?0:i.getTime()-a.getTime()}),Xo=(s,t)=>{const e=be(s),i=be(t);return!e||!i?!1:e<=i},Ha=s=>{if(Array.isArray(s))return s;if(typeof s=="string")return s.split(",")},Jo=s=>s?ve(s):null,Qo=s=>{if(typeof s=="string")return s.split(",").map(t=>ve(t));if(Array.isArray(s))return s.map(t=>ve(t))},ts={csvToArray:Ha,stringToDate:Jo,stringsToDate:Qo},tl={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Me={props:tl};var el=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,K=(s,t,e,i)=>{for(var a=i>1?void 0:i?sl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&el(t,e,a),a};let R=class extends Y{constructor(){super(...arguments),this.multiple=Me.props.multiple.default,this.maxMultiple=Me.props.maxMultiple.default,this.range=Me.props.range.default,this.weeknumbers=Me.props.weeknumbers.default,this.withcontrols=Me.props.withcontrols.default,this.selected=[],this.earliest=Me.props.earliest.default,this.latest=Me.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,i){t==="selected"&&i&&this.convertSelected(),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>ve(t)),this.range&&this.selected.length===2){const t=Si({start:this._selected[0],end:this._selected[1]});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let i=0;i<t.length;i++){const a=t[i],n=a>this._selected[0]&&a<this._selected[1];e[nt(a)]=n}this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=ve(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?Ns(new Date):t}else this.currentmonth===null&&(this.currentmonth=Ns(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Ns(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var i,a,n,r,h;if(((i=t.target)==null?void 0:i.nodeName)==="INPUT"||((a=t.target)==null?void 0:a.nodeName)==="SELECT"||((n=t.target)==null?void 0:n.nodeName)==="BUTTON"&&!((h=(r=t.target)==null?void 0:r.dataset)!=null&&h.date))return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const d=this.focusedDate?oe(this.focusedDate):ye(this.year,this.month,1);let p=xi(d,e);if(p){let g=this.querySelector(`button[data-date="${nt(p)}"]`);if(g instanceof HTMLButtonElement){if(g.dataset.disabled){p=xi(p,e);let m=this.querySelector(`button[data-date="${nt(p)}"]`);for(;m&&m instanceof HTMLButtonElement&&m.dataset.disabled;)p=xi(p,e),m=this.querySelector(`button[data-date="${nt(p)}"]`);g=m}g instanceof HTMLButtonElement&&!g.dataset.disabled&&(this.focusedDate=nt(p),g.focus())}}}render(){return u`
|
|
198
198
|
<div
|
|
199
199
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
200
200
|
@focusout=${this.closeEvent}
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
/>
|
|
276
276
|
</div> `):t.push(u`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
277
277
|
${this.monthStrings[this.month]} ${this.year}
|
|
278
|
-
</div>`),t}renderDayView(t,e){var i;const a=
|
|
278
|
+
</div>`),t}renderDayView(t,e){var i;const a=ye(this.year,this.month,t),n=nt(a),r=n===nt(e),h=this.selected.includes(n),d=Wo(a),p=this.isExcluded(a)||!h&&this.multiple&&this.maxMultiple>0&&this.selected.length>=this.maxMultiple,g=this.focusedDate?this.focusedDate===n&&!p?"0":"-1":!p&&this.tabIndexSet===0||this.tabIndexSet===t?"0":"-1";g==="0"&&(this.tabIndexSet=t),this.selectableDates.push({currentDateISO:n,isDisabled:p,tabindex:g});const m={"pkt-cal-today":r,"pkt-cal-selected":h,"pkt-cal-in-range":this.inRange[n],"pkt-cal-excluded":this.isExcluded(a),"pkt-cal-in-range-first":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&n===this.selected[0],"pkt-cal-in-range-last":this.range&&this.selected.length===2&&n===this.selected[1],"pkt-cal-range-hover":this.rangeHovered!==null&&n===nt(this.rangeHovered)},k={"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":h,"pkt-calendar__date--disabled":p,"pkt-calendar__date--in-range":this.inRange[n],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&n===nt(this.rangeHovered),"pkt-calendar__date--range-start":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&n===this.selected[0],"pkt-calendar__date--range-end":this.range&&this.selected.length===2&&n===this.selected[1]};return u`<td class=${P(m)}>
|
|
279
279
|
<button
|
|
280
280
|
type="button"
|
|
281
281
|
aria-pressed=${h?"true":"false"}
|
|
@@ -292,23 +292,23 @@
|
|
|
292
292
|
>
|
|
293
293
|
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
294
294
|
</button>
|
|
295
|
-
</td>`}renderCalendarBody(){const t=zo(),e=
|
|
295
|
+
</td>`}renderCalendarBody(){const t=zo(),e=ye(this.year,this.month,1),i=ye(this.year,this.month+1,0),a=(e.getDay()+6)%7,n=i.getDate(),r=Math.ceil((n+a)/7),h=ye(this.year,this.month,0).getDate();let d=1;this.week=Aa(ye(this.year,this.month,1));const p=[];for(let g=0;g<r;g++){const m=[];this.weeknumbers&&m.push(u`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let k=1;k<8;k++)if(g===0&&k<a+1){const b=h-(a-k);m.push(u`<td class="pkt-cal-other">
|
|
296
296
|
<div
|
|
297
297
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
298
298
|
data-disabled="disabled"
|
|
299
299
|
>
|
|
300
300
|
<span class="pkt-btn__text pkt-txt-14-light">${b}</span>
|
|
301
301
|
</div>
|
|
302
|
-
</td>`)}else d>n?(
|
|
302
|
+
</td>`)}else d>n?(m.push(u`<td class="pkt-cal-other">
|
|
303
303
|
<div
|
|
304
304
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
305
305
|
data-disabled="disabled"
|
|
306
306
|
>
|
|
307
307
|
<span class="pkt-btn__text pkt-txt-14-light">${d-n}</span>
|
|
308
308
|
</div>
|
|
309
|
-
</td>`),d++):(
|
|
310
|
-
${
|
|
311
|
-
</tr>`)}return p}isExcluded(t){const e=this.excludedates.map(i=>typeof i=="string"?i:nt(i));return!ja(t,this.earliest,this.latest,e,this.excludeweekdays)}isPrevMonthAllowed(){const t=
|
|
309
|
+
</td>`),d++):(m.push(this.renderDayView(d,t)),d++);p.push(u`<tr class="pkt-cal-week-row" role="row">
|
|
310
|
+
${m}
|
|
311
|
+
</tr>`)}return p}isExcluded(t){const e=this.excludedates.map(i=>typeof i=="string"?i:nt(i));return!ja(t,this.earliest,this.latest,e,this.excludeweekdays)}isPrevMonthAllowed(){const t=ye(this.year,this.month,0);return!(this.earliest&&oe(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){const t=ye(this.month===11?this.year+1:this.year,this.month===11?0:this.month+1,1);return!(this.latest&&oe(this.latest)<t)}nextMonth(){const t=this.month===11?0:this.month+1,e=this.month===11?this.year+1:this.year;this.changeMonth(e,t)}changeMonth(t,e){this.year=typeof t=="string"?parseInt(t):t,this.month=typeof e=="string"?parseInt(e):e,this.currentmonth=Ns(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}isRangeAllowed(t){let e=!0;if(this._selected.length===1){const i=Si({start:this._selected[0],end:t});if(Array.isArray(i)&&i.length)for(let a=0;a<i.length;a++)this.excludedates.forEach(n=>{n>this._selected[0]&&n<t&&(e=!1)}),this.excludeweekdays.includes(jo(i[a]).toString())&&(e=!1)}return e}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(t){this.selected.includes(nt(t))||(this.selected=[...this.selected,nt(t)],this._selected=[...this._selected,t],this.range&&this.selected.length===2&&(this.convertSelected(),this.close()))}removeFromSelected(t){if(this.selected.length===1)this.emptySelected();else{const e=this.selected.indexOf(nt(t)),i=[...this.selected],a=[...this._selected];i.splice(e,1),a.splice(e,1),this.selected=i,this._selected=a}}toggleSelected(t){const e=nt(t);this.selected.includes(e)?this.removeFromSelected(t):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(t)}handleRangeSelect(t){const e=nt(t);return this.selected.includes(e)?this.selected.indexOf(e)===0?this.emptySelected():this.removeFromSelected(t):this.selected.length>1?(this.emptySelected(),this.addToSelected(t)):(this.selected.length===1&&!this.isRangeAllowed(t)&&this.emptySelected(),this.selected.length===1&&this._selected[0]>t&&this.emptySelected(),this.addToSelected(t)),Promise.resolve()}handleRangeHover(t){if(this.range&&this._selected.length===1&&this.isRangeAllowed(t)&&this._selected[0]<t){this.rangeHovered=t,this.inRange={};const e=Si({start:this._selected[0],end:t});if(Array.isArray(e)&&e.length)for(let i=0;i<e.length;i++){const a=e[i],n=a>this._selected[0]&&a<t;this.inRange[nt(a)]=n}}else this.rangeHovered=null}handleDateSelect(t){if(t)return this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(nt(t))?this.emptySelected():(this.emptySelected(),this.addToSelected(t)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0})),Promise.resolve()}focusOnCurrentDate(){const t=nt(Ns(new Date)),e=this.querySelector(`button[data-date="${t}"]`);if(e instanceof HTMLButtonElement)this.focusedDate=t,e.focus();else{const i=this.selectableDates.find(a=>!a.isDisabled);if(i){const a=this.querySelector(`button[data-date="${i.currentDateISO}"]`);a instanceof HTMLButtonElement&&(this.focusedDate=i.currentDateISO,a.focus())}}}closeEvent(t){!this.contains(t.relatedTarget)&&!t.target.classList.contains("pkt-hide")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};K([o({type:Boolean})],R.prototype,"multiple",2),K([o({type:Number})],R.prototype,"maxMultiple",2),K([o({type:Boolean})],R.prototype,"range",2),K([o({type:Boolean})],R.prototype,"weeknumbers",2),K([o({type:Boolean})],R.prototype,"withcontrols",2),K([o({converter:ts.csvToArray})],R.prototype,"selected",2),K([o({type:String})],R.prototype,"earliest",2),K([o({type:String})],R.prototype,"latest",2),K([o({converter:ts.stringsToDate})],R.prototype,"excludedates",2),K([o({converter:ts.csvToArray})],R.prototype,"excludeweekdays",2),K([o({converter:ts.stringToDate})],R.prototype,"currentmonth",2),K([o({type:Array})],R.prototype,"dayStrings",2),K([o({type:Array})],R.prototype,"dayStringsLong",2),K([o({type:Array})],R.prototype,"monthStrings",2),K([o({type:String})],R.prototype,"weekString",2),K([o({type:String})],R.prototype,"prevMonthString",2),K([o({type:String})],R.prototype,"nextMonthString",2),K([o({type:Array})],R.prototype,"_selected",2),K([o({type:Number})],R.prototype,"year",2),K([o({type:Number})],R.prototype,"month",2),K([o({type:Number})],R.prototype,"week",2),K([o({type:Date})],R.prototype,"rangeHovered",2),K([B()],R.prototype,"inRange",2),K([B()],R.prototype,"focusedDate",2),K([B()],R.prototype,"selectableDates",2),K([B()],R.prototype,"currentmonthtouched",2),K([B()],R.prototype,"tabIndexSet",2),R=K([V("pkt-calendar")],R);const il={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},ai={props:il};var al=Object.defineProperty,nl=Object.getOwnPropertyDescriptor,te=(s,t,e,i)=>{for(var a=i>1?void 0:i?nl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&al(t,e,a),a};let qt=class extends Y{constructor(){super(),this.defaultSlot=T(),this.closeTag=ai.props.closeTag.default,this.size=ai.props.size.default,this.skin=ai.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=ai.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new at(this,this.defaultSlot),this._isClosed=!1}firstUpdated(t){var e,i;if(super.firstUpdated(t),this.closeTag&&!this.ariaLabel){const a=(i=(e=this.defaultSlot.value)==null?void 0:e.textContent)==null?void 0:i.trim();a&&(this._ariaDescription=`Klikk for å fjerne ${a}`)}}render(){const t={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},e={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?u`
|
|
312
312
|
<button
|
|
313
313
|
class=${P(e)}
|
|
314
314
|
type=${this.type}
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
${this.iconName&&u`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
326
326
|
<span ${A(this.defaultSlot)}></span>
|
|
327
327
|
</span>
|
|
328
|
-
`}};te([o({type:Boolean,reflect:!0})],qt.prototype,"closeTag",2),te([o({type:String,reflect:!0})],qt.prototype,"size",2),te([o({type:String,reflect:!0})],qt.prototype,"skin",2),te([o({type:String,reflect:!0})],qt.prototype,"textStyle",2),te([o({type:String,reflect:!0})],qt.prototype,"iconName",2),te([o({type:String})],qt.prototype,"type",2),te([o({type:String})],qt.prototype,"ariaLabel",2),te([B()],qt.prototype,"_isClosed",2),te([B()],qt.prototype,"_ariaDescription",2),qt=te([
|
|
328
|
+
`}};te([o({type:Boolean,reflect:!0})],qt.prototype,"closeTag",2),te([o({type:String,reflect:!0})],qt.prototype,"size",2),te([o({type:String,reflect:!0})],qt.prototype,"skin",2),te([o({type:String,reflect:!0})],qt.prototype,"textStyle",2),te([o({type:String,reflect:!0})],qt.prototype,"iconName",2),te([o({type:String})],qt.prototype,"type",2),te([o({type:String})],qt.prototype,"ariaLabel",2),te([B()],qt.prototype,"_isClosed",2),te([B()],qt.prototype,"_ariaDescription",2),qt=te([V("pkt-tag")],qt);var rl=Object.defineProperty,ol=Object.getOwnPropertyDescriptor,As=(s,t,e,i)=>{for(var a=i>1?void 0:i?ol(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&rl(t,e,a),a};let De=class extends Ys{constructor(){super(...arguments),this.size=void 0,this.level=2,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),t==="level"&&i&&this.setLevel(Number(i)),t==="visuallyHidden"&&(this.visuallyHidden=i!==null&&i!=="false"),(t==="size"||t==="visuallyHidden"||t==="align")&&this.updateHostClasses()}updated(t){super.updated(t),t.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel)),!this.hasAttribute("size")&&(t.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(t.has("size")||t.has("visuallyHidden")||t.has("align"))&&this.updateHostClasses()}setLevel(t){t>=1&&t<=6?(this.level=t,this.setAttribute("aria-level",String(t))):console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return u`<slot></slot>`}};As([o({type:String,reflect:!0})],De.prototype,"size",2),As([o({type:Number,reflect:!0})],De.prototype,"level",2),As([o({type:Boolean,reflect:!0})],De.prototype,"visuallyHidden",2),As([o({type:String,reflect:!0})],De.prototype,"align",2),De=As([V("pkt-heading")],De);const ll={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},es={props:ll};var hl=Object.defineProperty,dl=Object.getOwnPropertyDescriptor,pt=(s,t,e,i)=>{for(var a=i>1?void 0:i?dl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&hl(t,e,a),a};let lt=class extends Y{constructor(){super(),this.defaultSlot=T(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=es.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=es.props.padding.default,this.skin=es.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new at(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var t,e;const i={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},a=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),n=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?this.heading:"kort");return u`
|
|
329
329
|
<article
|
|
330
330
|
class=${P(i)}
|
|
331
331
|
aria-label=${S(this.clickCardLink?a:n)}
|
|
@@ -411,11 +411,11 @@
|
|
|
411
411
|
${this.metaTrail?u`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:$}
|
|
412
412
|
</footer>
|
|
413
413
|
`:$}
|
|
414
|
-
`}};pt([o({type:String})],lt.prototype,"ariaLabel",2),pt([o({type:String})],lt.prototype,"metaLead",2),pt([o({type:Boolean})],lt.prototype,"borderOnHover",2),pt([o({type:String,reflect:!0})],lt.prototype,"clickCardLink",2),pt([o({type:String})],lt.prototype,"metaTrail",2),pt([o({type:String})],lt.prototype,"layout",2),pt([o({type:String})],lt.prototype,"heading",2),pt([o({type:Number})],lt.prototype,"headinglevel",2),pt([o({type:Object})],lt.prototype,"image",2),pt([o({type:String})],lt.prototype,"imageShape",2),pt([o({type:Boolean})],lt.prototype,"openLinkInNewTab",2),pt([o({type:String})],lt.prototype,"padding",2),pt([o({type:String,converter:{fromAttribute:s=>{const t=es.props.skin.type;return s&&t.includes(s)?s:(s&&!t.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${es.props.skin.default}".`),es.props.skin.default)},toAttribute:s=>s}})],lt.prototype,"skin",2),pt([o({type:String})],lt.prototype,"subheading",2),pt([o({type:String})],lt.prototype,"tagPosition",2),pt([o({type:Array})],lt.prototype,"tags",2),lt=pt([
|
|
414
|
+
`}};pt([o({type:String})],lt.prototype,"ariaLabel",2),pt([o({type:String})],lt.prototype,"metaLead",2),pt([o({type:Boolean})],lt.prototype,"borderOnHover",2),pt([o({type:String,reflect:!0})],lt.prototype,"clickCardLink",2),pt([o({type:String})],lt.prototype,"metaTrail",2),pt([o({type:String})],lt.prototype,"layout",2),pt([o({type:String})],lt.prototype,"heading",2),pt([o({type:Number})],lt.prototype,"headinglevel",2),pt([o({type:Object})],lt.prototype,"image",2),pt([o({type:String})],lt.prototype,"imageShape",2),pt([o({type:Boolean})],lt.prototype,"openLinkInNewTab",2),pt([o({type:String})],lt.prototype,"padding",2),pt([o({type:String,converter:{fromAttribute:s=>{const t=es.props.skin.type;return s&&t.includes(s)?s:(s&&!t.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${es.props.skin.default}".`),es.props.skin.default)},toAttribute:s=>s}})],lt.prototype,"skin",2),pt([o({type:String})],lt.prototype,"subheading",2),pt([o({type:String})],lt.prototype,"tagPosition",2),pt([o({type:Array})],lt.prototype,"tags",2),lt=pt([V("pkt-card")],lt);/**
|
|
415
415
|
* @license
|
|
416
416
|
* Copyright 2017 Google LLC
|
|
417
417
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
418
|
-
*/const Ua=(s,t,e)=>{const i=new Map;for(let a=t;a<=e;a++)i.set(s[a],a);return i},Ai=Te(class extends Ye{constructor(s){if(super(s),s.type!==Kt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const a=[],n=[];let r=0;for(const h of s)a[r]=i?i(h,r):r,n[r]=e(h,r),r++;return{values:n,keys:a}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const a=pr(s),{values:n,keys:r}=this.dt(t,e,i);if(!Array.isArray(a))return this.ut=r,n;const h=this.ut??(this.ut=[]),d=[];let p,m,g=0,k=a.length-1,b=0,y=n.length-1;for(;g<=k&&b<=y;)if(a[g]===null)g++;else if(a[k]===null)k--;else if(h[g]===r[b])d[b]=Ne(a[g],n[b]),g++,b++;else if(h[k]===r[y])d[y]=Ne(a[k],n[y]),k--,y--;else if(h[g]===r[y])d[y]=Ne(a[g],n[y]),ys(s,d[y+1],a[g]),g++,y--;else if(h[k]===r[b])d[b]=Ne(a[k],n[b]),ys(s,a[g],a[k]),k--,b++;else if(p===void 0&&(p=Ua(r,b,y),m=Ua(h,g,k)),p.has(h[g]))if(p.has(h[k])){const w=m.get(r[b]),C=w!==void 0?a[w]:null;if(C===null){const M=ys(s,a[g]);Ne(M,n[b]),d[b]=M}else d[b]=Ne(C,n[b]),ys(s,a[g],C),a[w]=null;b++}else yi(a[k]),k--;else yi(a[g]),g++;for(;b<=y;){const w=ys(s,d[y+1]);Ne(w,n[b]),d[b++]=w}for(;g<=k;){const w=a[g++];w!==null&&yi(w)}return this.ut=r,ba(s,d),$t}}),qa=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),$e=()=>{const s=qa(),t=qa();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},cl={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},Et={props:cl};var pl={},za;function ul(){return za||(za=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,a=new WeakMap,n=new WeakMap,r=new WeakMap,h=new WeakMap,d=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,k=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,C={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},M=(f,c)=>{for(let v in C){c[v]=null;let _=null;const I=C[v];Object.defineProperty(c,v,{get(){return _},set(H){_=H,f.isConnected?rt(f,I,H):m.set(f,c)}})}};function N(f){const c=a.get(f),{form:v}=c;ue(f,v,c),Nt(f,c.labels)}const U=(f,c=!1)=>{const v=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(H){return a.has(H)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=v.nextNode();const I=!c||f.disabled;for(;_;)_.formDisabledCallback&&I&&Vt(_,f.disabled),_=v.nextNode()},E={attributes:!0,attributeFilter:["disabled","name"]},G=fe()?new MutationObserver(f=>{for(const c of f){const v=c.target;if(c.attributeName==="disabled"&&(v.constructor.formAssociated?Vt(v,v.hasAttribute("disabled")):v.localName==="fieldset"&&U(v)),c.attributeName==="name"&&v.constructor.formAssociated){const _=a.get(v),I=p.get(v);_.setFormValue(I)}}}):{};function J(f){f.forEach(c=>{const{addedNodes:v,removedNodes:_}=c,I=Array.from(v),H=Array.from(_);I.forEach(q=>{var Ht;if(a.has(q)&&q.constructor.formAssociated&&N(q),m.has(q)){const ft=m.get(q);Object.keys(C).filter(Ut=>ft[Ut]!==null).forEach(Ut=>{rt(q,C[Ut],ft[Ut])}),m.delete(q)}if(w.has(q)){const ft=w.get(q);rt(q,"internals-valid",ft.validity.valid.toString()),rt(q,"internals-invalid",(!ft.validity.valid).toString()),rt(q,"aria-invalid",(!ft.validity.valid).toString()),w.delete(q)}if(q.localName==="form"){const ft=d.get(q),Ut=document.createTreeWalker(q,NodeFilter.SHOW_ELEMENT,{acceptNode(qi){return a.has(qi)&&qi.constructor.formAssociated&&!(ft&&ft.has(qi))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let js=Ut.nextNode();for(;js;)N(js),js=Ut.nextNode()}q.localName==="fieldset"&&((Ht=G.observe)===null||Ht===void 0||Ht.call(G,q,E),U(q,!0))}),H.forEach(q=>{const Ht=a.get(q);Ht&&i.get(Ht)&&jt(Ht),h.has(q)&&h.get(q).disconnect()})})}function Bt(f){f.forEach(c=>{const{removedNodes:v}=c;v.forEach(_=>{const I=b.get(c.target);a.has(_)&&ze(_),I.disconnect()})})}const Ft=f=>{var c,v;const _=new MutationObserver(Bt);!((c=window==null?void 0:window.ShadyDOM)===null||c===void 0)&&c.inUse&&f.mode&&f.host&&(f=f.host),(v=_.observe)===null||v===void 0||v.call(_,f,{childList:!0}),b.set(f,_)};fe()&&new MutationObserver(J);const it={childList:!0,subtree:!0},rt=(f,c,v)=>{f.getAttribute(c)!==v&&f.setAttribute(c,v)},Vt=(f,c)=>{f.toggleAttribute("internals-disabled",c),c?rt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[c])},jt=f=>{i.get(f).forEach(c=>{c.remove()}),i.set(f,[])},ot=(f,c)=>{const v=document.createElement("input");return v.type="hidden",v.name=f.getAttribute("name"),f.after(v),i.get(c).push(v),v},L=(f,c)=>{var v;i.set(c,[]),(v=G.observe)===null||v===void 0||v.call(G,f,E)},Nt=(f,c)=>{if(c.length){Array.from(c).forEach(_=>_.addEventListener("click",f.click.bind(f)));let v=c[0].id;c[0].id||(v=`${c[0].htmlFor}_Label`,c[0].id=v),rt(f,"aria-labelledby",v)}},ne=f=>{const c=Array.from(f.elements).filter(H=>!H.tagName.includes("-")&&H.validity).map(H=>H.validity.valid),v=d.get(f)||[],_=Array.from(v).filter(H=>H.isConnected).map(H=>a.get(H).validity.valid),I=[...c,..._].includes(!1);f.toggleAttribute("internals-invalid",I),f.toggleAttribute("internals-valid",!I)},pe=f=>{ne(Rt(f.target))},re=f=>{ne(Rt(f.target))},Ue=f=>{const c=["button[type=submit]","input[type=submit]","button:not([type])"].map(v=>`${v}:not([disabled])`).map(v=>`${v}:not([form])${f.id?`,${v}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",v=>{if(v.target.closest(c)){const _=d.get(f);if(f.noValidate)return;_.size&&Array.from(_).reverse().map(I=>a.get(I).reportValidity()).includes(!1)&&v.preventDefault()}})},ds=f=>{const c=d.get(f.target);c&&c.size&&c.forEach(v=>{v.constructor.formAssociated&&v.formResetCallback&&v.formResetCallback.apply(v)})},ue=(f,c,v)=>{if(c){const _=d.get(c);if(_)_.add(f);else{const I=new Set;I.add(f),d.set(c,I),Ue(c),c.addEventListener("reset",ds),c.addEventListener("input",pe),c.addEventListener("change",re)}r.set(c,{ref:f,internals:v}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[c])},0),ne(c)}},Rt=f=>{let c=f.parentNode;return c&&c.tagName!=="FORM"&&(c=Rt(c)),c},ct=(f,c,v=DOMException)=>{if(!f.constructor.formAssociated)throw new v(c)},qe=(f,c,v)=>{const _=d.get(f);return _&&_.size&&_.forEach(I=>{a.get(I)[v]()||(c=!1)}),c},ze=f=>{if(f.constructor.formAssociated){const c=a.get(f),{labels:v,form:_}=c;Nt(f,v),ue(f,_,c)}};function fe(){return typeof MutationObserver<"u"}class Vi{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const li=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),ji=(f,c,v)=>(f.valid=hi(c),Object.keys(c).forEach(_=>f[_]=c[_]),v&&ne(v),f),hi=f=>{let c=!0;for(let v in f)v!=="valid"&&f[v]!==!1&&(c=!1);return c},cs=new WeakMap;function ps(f,c){f.toggleAttribute(c,!0),f.part&&f.part.add(c)}class Vs extends Set{static get isPolyfilled(){return!0}constructor(c){if(super(),!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");cs.set(this,c)}add(c){if(!/^--/.test(c)||typeof c!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${c} must start with '--'.`);const v=super.add(c),_=cs.get(this),I=`state${c}`;return _.isConnected?ps(_,I):setTimeout(()=>{ps(_,I)}),v}clear(){for(let[c]of this.entries())this.delete(c);super.clear()}delete(c){const v=super.delete(c),_=cs.get(this);return _.isConnected?(_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)):setTimeout(()=>{_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)}),v}}function di(f,c,v,_){if(typeof c=="function"?f!==c||!_:!c.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return v==="m"?_:v==="a"?_.call(f):_?_.value:c.get(f)}function Hi(f,c,v,_,I){if(typeof c=="function"?f!==c||!0:!c.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c.set(f,v),v}var we;class ci{constructor(c){we.set(this,void 0),Hi(this,we,c);for(let v=0;v<c.length;v++){let _=c[v];this[v]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return di(this,we,"f").length}[(we=new WeakMap,Symbol.iterator)](){return di(this,we,"f")[Symbol.iterator]()}item(c){return this[c]==null?null:this[c]}namedItem(c){return this[c]==null?null:this[c]}}function pi(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=v;const c=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function v(...H){let q=f.apply(this,H);return qe(this,q,"checkValidity")}function _(...H){let q=c.apply(this,H);return qe(this,q,"reportValidity")}const{get:I}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...H){const q=I.call(this,...H),Ht=Array.from(d.get(this)||[]);if(Ht.length===0)return q;const ft=Array.from(q).concat(Ht).sort((Ut,js)=>Ut.compareDocumentPosition?Ut.compareDocumentPosition(js)&2?1:-1:0);return new ci(ft)}})}class xn{static get isPolyfilled(){return!0}constructor(c){if(!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const v=c.getRootNode(),_=new Vi;this.states=new Vs(c),t.set(this,c),e.set(this,_),a.set(c,this),M(c,this),L(c,this),Object.seal(this),v instanceof DocumentFragment&&Ft(v)}checkValidity(){const c=t.get(this);if(ct(c,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=e.get(this);if(!v.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});c.dispatchEvent(_)}return v.valid}get form(){const c=t.get(this);ct(c,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let v;return c.constructor.formAssociated===!0&&(v=Rt(c)),v}get labels(){const c=t.get(this);ct(c,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const v=c.getAttribute("id"),_=c.getRootNode();return _&&v?_.querySelectorAll(`[for="${v}"]`):[]}reportValidity(){const c=t.get(this);if(ct(c,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=this.checkValidity(),_=k.get(this);if(_&&!c.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!v&&_&&(c.focus(),_.focus()),v}setFormValue(c){const v=t.get(this);if(ct(v,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),jt(this),c!=null&&!(c instanceof FormData)){if(v.getAttribute("name")){const _=ot(v,this);_.value=c}}else c!=null&&c instanceof FormData&&Array.from(c).reverse().forEach(([_,I])=>{if(typeof I=="string"){const H=ot(v,this);H.name=_,H.value=I}});p.set(v,c)}setValidity(c,v,_){const I=t.get(this);if(ct(I,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!c)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");k.set(this,_);const H=e.get(this),q={};for(const Ut in c)q[Ut]=c[Ut];Object.keys(q).length===0&&li(H);const Ht=Object.assign(Object.assign({},H),q);delete Ht.valid;const{valid:ft}=ji(H,Ht,this.form);if(!ft&&!v)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");n.set(this,ft?"":v),I.isConnected?(I.toggleAttribute("internals-invalid",!ft),I.toggleAttribute("internals-valid",ft),rt(I,"aria-invalid",`${!ft}`)):w.set(I,this)}get shadowRoot(){const c=t.get(this);return g.get(c)||null}get validationMessage(){const c=t.get(this);return ct(c,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get validity(){const c=t.get(this);return ct(c,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const c=t.get(this);return ct(c,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(c.disabled||c.hasAttribute("disabled")||c.hasAttribute("readonly"))}}function bd(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const c=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(c,f);const v=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in v.internals)}let Sn=!1,Cn=!1;function Ui(f){Cn||(Cn=!0,window.CustomStateSet=Vs,f&&(HTMLElement.prototype.attachInternals=function(...c){const v=f.call(this,c);return v.states=new Vs(this),v}))}function Tn(f=!0){if(!Sn){if(Sn=!0,typeof window<"u"&&(window.ElementInternals=xn),typeof CustomElementRegistry<"u"){const c=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(v,_,I){if(_.formAssociated){const H=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){y.has(this)||(y.set(this,!0),this.hasAttribute("disabled")&&Vt(this,!0)),H!=null&&H.apply(this),ze(this)}}c.call(this,v,_,I)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(a.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new xn(this)}),typeof Element<"u"){let c=function(..._){const I=v.apply(this,_);if(g.set(this,I),fe()){const H=new MutationObserver(J);window.ShadyDOM?H.observe(this,it):H.observe(I,it),h.set(this,H)}return I};const v=Element.prototype.attachShadow;Element.prototype.attachShadow=c}fe()&&typeof document<"u"&&new MutationObserver(J).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&pi(),(f||typeof window<"u"&&!window.CustomStateSet)&&Ui()}}return customElements.polyfillWrapFlushCallback||(bd()?typeof window<"u"&&!window.CustomStateSet&&Ui(HTMLElement.prototype.attachInternals):Tn(!1)),s.forceCustomStateSetPolyfill=Ui,s.forceElementInternalsPolyfill=Tn,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),pl}ul();var fl=Object.defineProperty,V=(s,t,e,i)=>{for(var a=void 0,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=r(t,e,a)||a);return a&&fl(t,e,a),a};let D=class extends Y{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=$e(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Et.props.helptextDropdownButton.default,this.label=null,this.optionalText=vt.forms.labels.optional,this.requiredText=vt.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,i,a,n,r,h,d,p,m,g,k;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},vt.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},vt.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},vt.forms.messages.invalidPattern,t):(n=t.validity)!=null&&n.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},vt.forms.messages.tooShort,t):(r=t.validity)!=null&&r.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},vt.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?vt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):vt.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},vt.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?vt.forms.messages.rangeOverflowMax.replace("{max}",(g=this.max)==null?void 0:g.toString()):vt.forms.messages.rangeOverflow,t):(k=t.validity)!=null&&k.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(a=>{const n=a;n.name===this.name&&n.value!==this.value&&n.checked&&(n.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};V([o()],D.prototype,"defaultValue"),V([o({type:Boolean,reflect:!0})],D.prototype,"disabled"),V([o({type:Boolean,reflect:!0})],D.prototype,"readonly"),V([o({type:Boolean,reflect:!0})],D.prototype,"required"),V([o({type:Number,reflect:!0})],D.prototype,"max"),V([o({type:Number,reflect:!0})],D.prototype,"maxlength"),V([o({type:Number,reflect:!0})],D.prototype,"min"),V([o({type:Number,reflect:!0})],D.prototype,"minlength"),V([o({type:Number,reflect:!0})],D.prototype,"step"),V([o({type:String})],D.prototype,"ariaDescribedBy"),V([o({type:String})],D.prototype,"ariaLabelledby"),V([o({type:String,reflect:!0})],D.prototype,"name"),V([o({type:String,reflect:!0})],D.prototype,"pattern"),V([o({type:String,reflect:!0})],D.prototype,"placeholder"),V([o({type:String,reflect:!0})],D.prototype,"id"),V([o({type:Boolean})],D.prototype,"counter"),V([o({type:Boolean})],D.prototype,"hasError"),V([o({type:Boolean})],D.prototype,"inline"),V([o({type:Boolean})],D.prototype,"hasFieldset"),V([o({type:Boolean})],D.prototype,"optionalTag"),V([o({type:Boolean})],D.prototype,"requiredTag"),V([o({type:Boolean})],D.prototype,"skipForwardTestid"),V([o({type:Boolean,reflect:!1})],D.prototype,"useWrapper"),V([o({type:Boolean,reflect:!0})],D.prototype,"fullwidth"),V([o({type:Number})],D.prototype,"counterMaxLength"),V([o({type:String})],D.prototype,"errorMessage"),V([o({type:String})],D.prototype,"helptext"),V([o({type:String})],D.prototype,"helptextDropdown"),V([o({type:String,reflect:!1})],D.prototype,"helptextDropdownButton"),V([o({type:String})],D.prototype,"label"),V([o({type:String,reflect:!1})],D.prototype,"optionalText"),V([o({type:String,reflect:!1})],D.prototype,"requiredText"),V([o({type:String,reflect:!1})],D.prototype,"tagText"),V([o({type:String,attribute:"data-testid"})],D.prototype,"dataTestid"),V([B()],D.prototype,"touched");let Wa=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(a=>{Ze(a)&&(this.addNode(a),e=!0)}),i.removedNodes.forEach(a=>{Ze(a)&&(this.nodes=this.nodes.filter(n=>n!==a),e=!0)})),i.type==="attributes"&&Ze(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var gl=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,Ie=(s,t,e,i)=>{for(var a=i>1?void 0:i?ml(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&gl(t,e,a),a};let le=class extends Y{constructor(){super(),this.defaultSlot=T(),this.forId=$e(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Et.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new at(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const a=!this.isHelpTextOpen;this.isHelpTextOpen=a,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:a}}))},e=P({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?u`<div class="pkt-inputwrapper__helptext-expandable">
|
|
418
|
+
*/const Ua=(s,t,e)=>{const i=new Map;for(let a=t;a<=e;a++)i.set(s[a],a);return i},Ai=Te(class extends Ye{constructor(s){if(super(s),s.type!==Kt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const a=[],n=[];let r=0;for(const h of s)a[r]=i?i(h,r):r,n[r]=e(h,r),r++;return{values:n,keys:a}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const a=pr(s),{values:n,keys:r}=this.dt(t,e,i);if(!Array.isArray(a))return this.ut=r,n;const h=this.ut??(this.ut=[]),d=[];let p,g,m=0,k=a.length-1,b=0,y=n.length-1;for(;m<=k&&b<=y;)if(a[m]===null)m++;else if(a[k]===null)k--;else if(h[m]===r[b])d[b]=Ne(a[m],n[b]),m++,b++;else if(h[k]===r[y])d[y]=Ne(a[k],n[y]),k--,y--;else if(h[m]===r[y])d[y]=Ne(a[m],n[y]),ys(s,d[y+1],a[m]),m++,y--;else if(h[k]===r[b])d[b]=Ne(a[k],n[b]),ys(s,a[m],a[k]),k--,b++;else if(p===void 0&&(p=Ua(r,b,y),g=Ua(h,m,k)),p.has(h[m]))if(p.has(h[k])){const w=g.get(r[b]),C=w!==void 0?a[w]:null;if(C===null){const M=ys(s,a[m]);Ne(M,n[b]),d[b]=M}else d[b]=Ne(C,n[b]),ys(s,a[m],C),a[w]=null;b++}else yi(a[k]),k--;else yi(a[m]),m++;for(;b<=y;){const w=ys(s,d[y+1]);Ne(w,n[b]),d[b++]=w}for(;m<=k;){const w=a[m++];w!==null&&yi(w)}return this.ut=r,ba(s,d),$t}}),qa=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),ke=()=>{const s=qa(),t=qa();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},cl={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},Et={props:cl};var pl={},za;function ul(){return za||(za=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,a=new WeakMap,n=new WeakMap,r=new WeakMap,h=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,k=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,C={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},M=(f,c)=>{for(let v in C){c[v]=null;let _=null;const I=C[v];Object.defineProperty(c,v,{get(){return _},set(H){_=H,f.isConnected?rt(f,I,H):g.set(f,c)}})}};function N(f){const c=a.get(f),{form:v}=c;pe(f,v,c),Tt(f,c.labels)}const U=(f,c=!1)=>{const v=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(H){return a.has(H)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=v.nextNode();const I=!c||f.disabled;for(;_;)_.formDisabledCallback&&I&&Vt(_,f.disabled),_=v.nextNode()},E={attributes:!0,attributeFilter:["disabled","name"]},G=ue()?new MutationObserver(f=>{for(const c of f){const v=c.target;if(c.attributeName==="disabled"&&(v.constructor.formAssociated?Vt(v,v.hasAttribute("disabled")):v.localName==="fieldset"&&U(v)),c.attributeName==="name"&&v.constructor.formAssociated){const _=a.get(v),I=p.get(v);_.setFormValue(I)}}}):{};function J(f){f.forEach(c=>{const{addedNodes:v,removedNodes:_}=c,I=Array.from(v),H=Array.from(_);I.forEach(q=>{var Ht;if(a.has(q)&&q.constructor.formAssociated&&N(q),g.has(q)){const ft=g.get(q);Object.keys(C).filter(Ut=>ft[Ut]!==null).forEach(Ut=>{rt(q,C[Ut],ft[Ut])}),g.delete(q)}if(w.has(q)){const ft=w.get(q);rt(q,"internals-valid",ft.validity.valid.toString()),rt(q,"internals-invalid",(!ft.validity.valid).toString()),rt(q,"aria-invalid",(!ft.validity.valid).toString()),w.delete(q)}if(q.localName==="form"){const ft=d.get(q),Ut=document.createTreeWalker(q,NodeFilter.SHOW_ELEMENT,{acceptNode(qi){return a.has(qi)&&qi.constructor.formAssociated&&!(ft&&ft.has(qi))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let js=Ut.nextNode();for(;js;)N(js),js=Ut.nextNode()}q.localName==="fieldset"&&((Ht=G.observe)===null||Ht===void 0||Ht.call(G,q,E),U(q,!0))}),H.forEach(q=>{const Ht=a.get(q);Ht&&i.get(Ht)&&jt(Ht),h.has(q)&&h.get(q).disconnect()})})}function Bt(f){f.forEach(c=>{const{removedNodes:v}=c;v.forEach(_=>{const I=b.get(c.target);a.has(_)&&ze(_),I.disconnect()})})}const Ft=f=>{var c,v;const _=new MutationObserver(Bt);!((c=window==null?void 0:window.ShadyDOM)===null||c===void 0)&&c.inUse&&f.mode&&f.host&&(f=f.host),(v=_.observe)===null||v===void 0||v.call(_,f,{childList:!0}),b.set(f,_)};ue()&&new MutationObserver(J);const it={childList:!0,subtree:!0},rt=(f,c,v)=>{f.getAttribute(c)!==v&&f.setAttribute(c,v)},Vt=(f,c)=>{f.toggleAttribute("internals-disabled",c),c?rt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[c])},jt=f=>{i.get(f).forEach(c=>{c.remove()}),i.set(f,[])},ot=(f,c)=>{const v=document.createElement("input");return v.type="hidden",v.name=f.getAttribute("name"),f.after(v),i.get(c).push(v),v},L=(f,c)=>{var v;i.set(c,[]),(v=G.observe)===null||v===void 0||v.call(G,f,E)},Tt=(f,c)=>{if(c.length){Array.from(c).forEach(_=>_.addEventListener("click",f.click.bind(f)));let v=c[0].id;c[0].id||(v=`${c[0].htmlFor}_Label`,c[0].id=v),rt(f,"aria-labelledby",v)}},ne=f=>{const c=Array.from(f.elements).filter(H=>!H.tagName.includes("-")&&H.validity).map(H=>H.validity.valid),v=d.get(f)||[],_=Array.from(v).filter(H=>H.isConnected).map(H=>a.get(H).validity.valid),I=[...c,..._].includes(!1);f.toggleAttribute("internals-invalid",I),f.toggleAttribute("internals-valid",!I)},ce=f=>{ne(Rt(f.target))},re=f=>{ne(Rt(f.target))},Ue=f=>{const c=["button[type=submit]","input[type=submit]","button:not([type])"].map(v=>`${v}:not([disabled])`).map(v=>`${v}:not([form])${f.id?`,${v}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",v=>{if(v.target.closest(c)){const _=d.get(f);if(f.noValidate)return;_.size&&Array.from(_).reverse().map(I=>a.get(I).reportValidity()).includes(!1)&&v.preventDefault()}})},ds=f=>{const c=d.get(f.target);c&&c.size&&c.forEach(v=>{v.constructor.formAssociated&&v.formResetCallback&&v.formResetCallback.apply(v)})},pe=(f,c,v)=>{if(c){const _=d.get(c);if(_)_.add(f);else{const I=new Set;I.add(f),d.set(c,I),Ue(c),c.addEventListener("reset",ds),c.addEventListener("input",ce),c.addEventListener("change",re)}r.set(c,{ref:f,internals:v}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[c])},0),ne(c)}},Rt=f=>{let c=f.parentNode;return c&&c.tagName!=="FORM"&&(c=Rt(c)),c},ct=(f,c,v=DOMException)=>{if(!f.constructor.formAssociated)throw new v(c)},qe=(f,c,v)=>{const _=d.get(f);return _&&_.size&&_.forEach(I=>{a.get(I)[v]()||(c=!1)}),c},ze=f=>{if(f.constructor.formAssociated){const c=a.get(f),{labels:v,form:_}=c;Tt(f,v),pe(f,_,c)}};function ue(){return typeof MutationObserver<"u"}class Vi{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const li=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),ji=(f,c,v)=>(f.valid=hi(c),Object.keys(c).forEach(_=>f[_]=c[_]),v&&ne(v),f),hi=f=>{let c=!0;for(let v in f)v!=="valid"&&f[v]!==!1&&(c=!1);return c},cs=new WeakMap;function ps(f,c){f.toggleAttribute(c,!0),f.part&&f.part.add(c)}class Vs extends Set{static get isPolyfilled(){return!0}constructor(c){if(super(),!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");cs.set(this,c)}add(c){if(!/^--/.test(c)||typeof c!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${c} must start with '--'.`);const v=super.add(c),_=cs.get(this),I=`state${c}`;return _.isConnected?ps(_,I):setTimeout(()=>{ps(_,I)}),v}clear(){for(let[c]of this.entries())this.delete(c);super.clear()}delete(c){const v=super.delete(c),_=cs.get(this);return _.isConnected?(_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)):setTimeout(()=>{_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)}),v}}function di(f,c,v,_){if(typeof c=="function"?f!==c||!_:!c.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return v==="m"?_:v==="a"?_.call(f):_?_.value:c.get(f)}function Hi(f,c,v,_,I){if(typeof c=="function"?f!==c||!0:!c.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c.set(f,v),v}var we;class ci{constructor(c){we.set(this,void 0),Hi(this,we,c);for(let v=0;v<c.length;v++){let _=c[v];this[v]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return di(this,we,"f").length}[(we=new WeakMap,Symbol.iterator)](){return di(this,we,"f")[Symbol.iterator]()}item(c){return this[c]==null?null:this[c]}namedItem(c){return this[c]==null?null:this[c]}}function pi(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=v;const c=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function v(...H){let q=f.apply(this,H);return qe(this,q,"checkValidity")}function _(...H){let q=c.apply(this,H);return qe(this,q,"reportValidity")}const{get:I}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...H){const q=I.call(this,...H),Ht=Array.from(d.get(this)||[]);if(Ht.length===0)return q;const ft=Array.from(q).concat(Ht).sort((Ut,js)=>Ut.compareDocumentPosition?Ut.compareDocumentPosition(js)&2?1:-1:0);return new ci(ft)}})}class xn{static get isPolyfilled(){return!0}constructor(c){if(!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const v=c.getRootNode(),_=new Vi;this.states=new Vs(c),t.set(this,c),e.set(this,_),a.set(c,this),M(c,this),L(c,this),Object.seal(this),v instanceof DocumentFragment&&Ft(v)}checkValidity(){const c=t.get(this);if(ct(c,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=e.get(this);if(!v.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});c.dispatchEvent(_)}return v.valid}get form(){const c=t.get(this);ct(c,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let v;return c.constructor.formAssociated===!0&&(v=Rt(c)),v}get labels(){const c=t.get(this);ct(c,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const v=c.getAttribute("id"),_=c.getRootNode();return _&&v?_.querySelectorAll(`[for="${v}"]`):[]}reportValidity(){const c=t.get(this);if(ct(c,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=this.checkValidity(),_=k.get(this);if(_&&!c.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!v&&_&&(c.focus(),_.focus()),v}setFormValue(c){const v=t.get(this);if(ct(v,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),jt(this),c!=null&&!(c instanceof FormData)){if(v.getAttribute("name")){const _=ot(v,this);_.value=c}}else c!=null&&c instanceof FormData&&Array.from(c).reverse().forEach(([_,I])=>{if(typeof I=="string"){const H=ot(v,this);H.name=_,H.value=I}});p.set(v,c)}setValidity(c,v,_){const I=t.get(this);if(ct(I,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!c)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");k.set(this,_);const H=e.get(this),q={};for(const Ut in c)q[Ut]=c[Ut];Object.keys(q).length===0&&li(H);const Ht=Object.assign(Object.assign({},H),q);delete Ht.valid;const{valid:ft}=ji(H,Ht,this.form);if(!ft&&!v)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");n.set(this,ft?"":v),I.isConnected?(I.toggleAttribute("internals-invalid",!ft),I.toggleAttribute("internals-valid",ft),rt(I,"aria-invalid",`${!ft}`)):w.set(I,this)}get shadowRoot(){const c=t.get(this);return m.get(c)||null}get validationMessage(){const c=t.get(this);return ct(c,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get validity(){const c=t.get(this);return ct(c,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const c=t.get(this);return ct(c,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(c.disabled||c.hasAttribute("disabled")||c.hasAttribute("readonly"))}}function vd(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const c=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(c,f);const v=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in v.internals)}let Sn=!1,Cn=!1;function Ui(f){Cn||(Cn=!0,window.CustomStateSet=Vs,f&&(HTMLElement.prototype.attachInternals=function(...c){const v=f.call(this,c);return v.states=new Vs(this),v}))}function Tn(f=!0){if(!Sn){if(Sn=!0,typeof window<"u"&&(window.ElementInternals=xn),typeof CustomElementRegistry<"u"){const c=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(v,_,I){if(_.formAssociated){const H=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){y.has(this)||(y.set(this,!0),this.hasAttribute("disabled")&&Vt(this,!0)),H!=null&&H.apply(this),ze(this)}}c.call(this,v,_,I)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(a.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new xn(this)}),typeof Element<"u"){let c=function(..._){const I=v.apply(this,_);if(m.set(this,I),ue()){const H=new MutationObserver(J);window.ShadyDOM?H.observe(this,it):H.observe(I,it),h.set(this,H)}return I};const v=Element.prototype.attachShadow;Element.prototype.attachShadow=c}ue()&&typeof document<"u"&&new MutationObserver(J).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&pi(),(f||typeof window<"u"&&!window.CustomStateSet)&&Ui()}}return customElements.polyfillWrapFlushCallback||(vd()?typeof window<"u"&&!window.CustomStateSet&&Ui(HTMLElement.prototype.attachInternals):Tn(!1)),s.forceCustomStateSetPolyfill=Ui,s.forceElementInternalsPolyfill=Tn,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),pl}ul();var fl=Object.defineProperty,j=(s,t,e,i)=>{for(var a=void 0,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=r(t,e,a)||a);return a&&fl(t,e,a),a};let D=class extends Y{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=ke(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Et.props.helptextDropdownButton.default,this.label=null,this.optionalText=bt.forms.labels.optional,this.requiredText=bt.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,i,a,n,r,h,d,p,g,m,k;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},bt.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},bt.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},bt.forms.messages.invalidPattern,t):(n=t.validity)!=null&&n.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},bt.forms.messages.tooShort,t):(r=t.validity)!=null&&r.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},bt.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?bt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):bt.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},bt.forms.messages.invalid,t):(g=t.validity)!=null&&g.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?bt.forms.messages.rangeOverflowMax.replace("{max}",(m=this.max)==null?void 0:m.toString()):bt.forms.messages.rangeOverflow,t):(k=t.validity)!=null&&k.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(a=>{const n=a;n.name===this.name&&n.value!==this.value&&n.checked&&(n.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};j([o()],D.prototype,"defaultValue"),j([o({type:Boolean,reflect:!0})],D.prototype,"disabled"),j([o({type:Boolean,reflect:!0})],D.prototype,"readonly"),j([o({type:Boolean,reflect:!0})],D.prototype,"required"),j([o({type:Number,reflect:!0})],D.prototype,"max"),j([o({type:Number,reflect:!0})],D.prototype,"maxlength"),j([o({type:Number,reflect:!0})],D.prototype,"min"),j([o({type:Number,reflect:!0})],D.prototype,"minlength"),j([o({type:Number,reflect:!0})],D.prototype,"step"),j([o({type:String})],D.prototype,"ariaDescribedBy"),j([o({type:String})],D.prototype,"ariaLabelledby"),j([o({type:String,reflect:!0})],D.prototype,"name"),j([o({type:String,reflect:!0})],D.prototype,"pattern"),j([o({type:String,reflect:!0})],D.prototype,"placeholder"),j([o({type:String,reflect:!0})],D.prototype,"id"),j([o({type:Boolean})],D.prototype,"counter"),j([o({type:Boolean})],D.prototype,"hasError"),j([o({type:Boolean})],D.prototype,"inline"),j([o({type:Boolean})],D.prototype,"hasFieldset"),j([o({type:Boolean})],D.prototype,"optionalTag"),j([o({type:Boolean})],D.prototype,"requiredTag"),j([o({type:Boolean})],D.prototype,"skipForwardTestid"),j([o({type:Boolean,reflect:!1})],D.prototype,"useWrapper"),j([o({type:Boolean,reflect:!0})],D.prototype,"fullwidth"),j([o({type:Number})],D.prototype,"counterMaxLength"),j([o({type:String})],D.prototype,"errorMessage"),j([o({type:String})],D.prototype,"helptext"),j([o({type:String})],D.prototype,"helptextDropdown"),j([o({type:String,reflect:!1})],D.prototype,"helptextDropdownButton"),j([o({type:String})],D.prototype,"label"),j([o({type:String,reflect:!1})],D.prototype,"optionalText"),j([o({type:String,reflect:!1})],D.prototype,"requiredText"),j([o({type:String,reflect:!1})],D.prototype,"tagText"),j([o({type:String,attribute:"data-testid"})],D.prototype,"dataTestid"),j([B()],D.prototype,"touched");let Wa=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(a=>{Ze(a)&&(this.addNode(a),e=!0)}),i.removedNodes.forEach(a=>{Ze(a)&&(this.nodes=this.nodes.filter(n=>n!==a),e=!0)})),i.type==="attributes"&&Ze(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var gl=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,Ie=(s,t,e,i)=>{for(var a=i>1?void 0:i?ml(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&gl(t,e,a),a};let le=class extends Y{constructor(){super(),this.defaultSlot=T(),this.forId=ke(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Et.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new at(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const a=!this.isHelpTextOpen;this.isHelpTextOpen=a,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:a}}))},e=P({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?u`<div class="pkt-inputwrapper__helptext-expandable">
|
|
419
419
|
<button
|
|
420
420
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
421
421
|
type="button"
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
${this.helptext&&Js(this.helptext)}
|
|
439
439
|
</div>
|
|
440
440
|
${i()}
|
|
441
|
-
</div>`}`}};Ie([o({type:String,reflect:!0})],le.prototype,"forId",2),Ie([o({type:String})],le.prototype,"helptext",2),Ie([o({type:String})],le.prototype,"helptextDropdown",2),Ie([o({type:String})],le.prototype,"helptextDropdownButton",2),Ie([B()],le.prototype,"isHelpTextOpen",2),Ie([B()],le.prototype,"filledSlots",2),le=Ie([
|
|
441
|
+
</div>`}`}};Ie([o({type:String,reflect:!0})],le.prototype,"forId",2),Ie([o({type:String})],le.prototype,"helptext",2),Ie([o({type:String})],le.prototype,"helptextDropdown",2),Ie([o({type:String})],le.prototype,"helptextDropdownButton",2),Ie([B()],le.prototype,"isHelpTextOpen",2),Ie([B()],le.prototype,"filledSlots",2),le=Ie([V("pkt-helptext")],le);var vl=Object.defineProperty,bl=Object.getOwnPropertyDescriptor,X=(s,t,e,i)=>{for(var a=i>1?void 0:i?bl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&vl(t,e,a),a};const yl={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}};let Z=class extends Y{constructor(){super(),this.defaultSlot=T(),this.helptextSlot=T(),this.forId=ke(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=Et.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=Et.props.optionalTag.default,this.optionalText=Et.props.optionalText.default,this.requiredTag=Et.props.requiredTag.default,this.requiredText=Et.props.requiredText.default,this.tagText=null,this.hasError=Et.props.hasError.default,this.errorMessage="",this.disabled=Et.props.disabled.default,this.inline=Et.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=Et.props.hasFieldset.default,this.role="group",this.useWrapper=Et.props.useWrapper.default,this.slotController=new at(this,this.defaultSlot,this.helptextSlot)}updated(t){super.updated(t)}render(){const t={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},e="pkt-tag pkt-tag--small pkt-tag--thin-text",i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:$,a=()=>u`
|
|
442
442
|
${this.tagText?u`<span class=${e+" pkt-tag--gray"}>${this.tagText}</span>`:$}
|
|
443
443
|
${this.optionalTag?u`<span class=${e+" pkt-tag--blue-light"}>${this.optionalText}</span>`:$}
|
|
444
444
|
${this.requiredTag?u`<span class=${e+" pkt-tag--beige"}>${this.requiredText}</span>`:$}
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
.helptext=${this.helptext}
|
|
470
470
|
.helptextDropdown=${this.helptextDropdown}
|
|
471
471
|
.helptextDropdownButton=${this.helptextDropdownButton||Et.props.helptextDropdownButton.default}
|
|
472
|
-
@toggleHelpText=${
|
|
472
|
+
@toggleHelpText=${m=>{this.toggleDropdown(m)}}
|
|
473
473
|
${A(this.helptextSlot)}
|
|
474
474
|
name="helptext"
|
|
475
475
|
></pkt-helptext>
|
|
@@ -491,9 +491,9 @@
|
|
|
491
491
|
<div class="pkt-contents" ${A(this.defaultSlot)}></div>
|
|
492
492
|
${this.counterPosition==="bottom"?h():$}
|
|
493
493
|
${d()}
|
|
494
|
-
`,
|
|
494
|
+
`,g=()=>this.hasFieldset?u`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
|
|
495
495
|
${p()}
|
|
496
|
-
</fieldset>`:u`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return u`<div class=${P(t)}>${
|
|
496
|
+
</fieldset>`:u`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return u`<div class=${P(t)}>${g()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(t){this.disabled&&(t.preventDefault(),t.stopImmediatePropagation()),this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};X([o({type:String})],Z.prototype,"forId",2),X([o({type:String})],Z.prototype,"label",2),X([o({type:String})],Z.prototype,"helptext",2),X([o({type:String})],Z.prototype,"helptextDropdown",2),X([o({type:String})],Z.prototype,"helptextDropdownButton",2),X([o({type:Boolean})],Z.prototype,"counter",2),X([o({type:Number})],Z.prototype,"counterCurrent",2),X([o({type:Number})],Z.prototype,"counterMaxLength",2),X([o({type:String})],Z.prototype,"counterError",2),X([o({type:String,reflect:!1})],Z.prototype,"counterPosition",2),X([o({type:Boolean})],Z.prototype,"optionalTag",2),X([o({type:String})],Z.prototype,"optionalText",2),X([o({type:Boolean})],Z.prototype,"requiredTag",2),X([o({type:String})],Z.prototype,"requiredText",2),X([o({type:String})],Z.prototype,"tagText",2),X([o({type:Boolean})],Z.prototype,"hasError",2),X([o({type:String})],Z.prototype,"errorMessage",2),X([o({type:Boolean})],Z.prototype,"disabled",2),X([o({type:Boolean})],Z.prototype,"inline",2),X([o({type:String})],Z.prototype,"ariaDescribedby",2),X([o({type:Boolean})],Z.prototype,"hasFieldset",2),X([o({type:String,reflect:!0})],Z.prototype,"role",2),X([o({type:Boolean,reflect:!0,converter:yl})],Z.prototype,"useWrapper",2),Z=X([V("pkt-input-wrapper")],Z);var kl=Object.defineProperty,$l=Object.getOwnPropertyDescriptor,gt=(s,t,e,i)=>{for(var a=i>1?void 0:i?$l(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&kl(t,e,a),a};let ut=class extends Y{constructor(){super(...arguments),this.id=ke(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),this.includeSearch&&!this.searchValue&&(this.searchValue=""),this.options.length>0&&this.filterOptions(),this.setAttribute("tabindex","-1"),this.addEventListener("focus",this.focusFirstOrSelectedOption)}updated(t){(t.has("options")||t.has("searchValue"))&&this.filterOptions(),super.updated(t)}attributeChangedCallback(t,e,i){(t==="options"||t==="searchValue"||t==="search-value")&&this.filterOptions(),super.attributeChangedCallback(t,e,i)}render(){return u`
|
|
497
497
|
<div
|
|
498
498
|
class=${P({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
499
499
|
role="listbox"
|
|
@@ -577,7 +577,7 @@
|
|
|
577
577
|
type="text"
|
|
578
578
|
aria-label="Søk i listen"
|
|
579
579
|
form=""
|
|
580
|
-
placeholder=${this.searchPlaceholder||
|
|
580
|
+
placeholder=${this.searchPlaceholder||bt.forms.search.placeholder}
|
|
581
581
|
@input=${this.handleSearchInput}
|
|
582
582
|
@keydown=${this.handleSearchKeydown}
|
|
583
583
|
.value=${this.searchValue}
|
|
@@ -587,7 +587,7 @@
|
|
|
587
587
|
role="searchbox"
|
|
588
588
|
/>
|
|
589
589
|
</div>
|
|
590
|
-
`:$}handleSearchInput(t){this.searchValue=t.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(t){switch(t.key){case"Enter":t.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),t.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(t){const e=t.currentTarget,i=e.dataset.value,a=e.dataset.type,n=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&a!=="new-option"&&a!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":i&&(n?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():a==="searchbox"||a==="new-option"?this.focusFirstOption():this.focusNextOption(e),t.preventDefault();break;case"ArrowUp":if(t.altKey)this.focusFirstOption();else if(e.dataset.index==="0"&&this.includeSearch){const r=this.querySelector('[role="searchbox"]');r&&r.focus()}else if(e.dataset.index==="0"&&this.customUserInput){const r=this.querySelector('[data-type="new-option"]');r&&r.focus()}else this.focusPreviousOption(e);t.preventDefault();break;case"Home":this.focusFirstOption(),t.preventDefault();break;case"End":this.focusLastOption(),t.preventDefault();break;default:(t.metaKey||t.ctrlKey)&&t.key==="a"&&(this.selectAll(),t.preventDefault()),this.isLetterOrSpace(t.key)&&(this.handleTypeAhead(t.key),t.preventDefault());break}}focusAndScrollIntoView(t){t.scrollIntoView({block:"nearest"}),window.setTimeout(()=>t.focus(),0)}focusNextOption(t){const e=t.nextElementSibling;e&&this.focusAndScrollIntoView(e)}focusPreviousOption(t){const e=t.previousElementSibling;if(t.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else e&&this.focusAndScrollIntoView(e)}focusFirstOption(){const t=this.getOptionElements()[0];t&&this.focusAndScrollIntoView(t)}focusLastOption(){const t=this.getOptionElements().pop();t&&this.focusAndScrollIntoView(t)}focusFirstOrSelectedOption(){if(this.disabled)return;const t=this.getOptionElements().find(e=>e.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const e=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(e)}else if(t)this.focusAndScrollIntoView(t);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const e=this.querySelector('[role="searchbox"]');window.setTimeout(()=>e.focus(),0)}else this.focusFirstOption()}toggleOption(t){const e=t instanceof HTMLElement?t.dataset.disabled:t.disabled;if(this.disabled||e)return;const i=t instanceof HTMLElement?t.dataset.value:t.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(t=>{var e;return(t.fulltext||t.label+t.value+(t.prefix||"")).toLowerCase().includes(((e=this.searchValue)==null?void 0:e.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(t){return/^[\p{L} ]$/u.test(t)}handleTypeAhead(t){this.typeAheadString+=t.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const e=this.getOptionElements().find(i=>{var a;return(a=i.textContent)==null?void 0:a.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};gt([o({type:String})],ut.prototype,"id",2),gt([o({type:String})],ut.prototype,"label",2),gt([o({type:Array})],ut.prototype,"options",2),gt([o({type:Boolean,reflect:!0})],ut.prototype,"isOpen",2),gt([o({type:Boolean})],ut.prototype,"disabled",2),gt([o({type:Boolean})],ut.prototype,"includeSearch",2),gt([o({type:Boolean})],ut.prototype,"isMultiSelect",2),gt([o({type:Boolean})],ut.prototype,"allowUserInput",2),gt([o({type:Boolean})],ut.prototype,"maxIsReached",2),gt([o({type:String})],ut.prototype,"customUserInput",2),gt([o({type:String})],ut.prototype,"searchPlaceholder",2),gt([o({type:String})],ut.prototype,"searchValue",2),gt([o({type:Number})],ut.prototype,"maxLength",2),gt([o({type:String})],ut.prototype,"userMessage",2),gt([B()],ut.prototype,"_filteredOptions",2),ut=gt([
|
|
590
|
+
`:$}handleSearchInput(t){this.searchValue=t.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(t){switch(t.key){case"Enter":t.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),t.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(t){const e=t.currentTarget,i=e.dataset.value,a=e.dataset.type,n=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&a!=="new-option"&&a!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":i&&(n?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():a==="searchbox"||a==="new-option"?this.focusFirstOption():this.focusNextOption(e),t.preventDefault();break;case"ArrowUp":if(t.altKey)this.focusFirstOption();else if(e.dataset.index==="0"&&this.includeSearch){const r=this.querySelector('[role="searchbox"]');r&&r.focus()}else if(e.dataset.index==="0"&&this.customUserInput){const r=this.querySelector('[data-type="new-option"]');r&&r.focus()}else this.focusPreviousOption(e);t.preventDefault();break;case"Home":this.focusFirstOption(),t.preventDefault();break;case"End":this.focusLastOption(),t.preventDefault();break;default:(t.metaKey||t.ctrlKey)&&t.key==="a"&&(this.selectAll(),t.preventDefault()),this.isLetterOrSpace(t.key)&&(this.handleTypeAhead(t.key),t.preventDefault());break}}focusAndScrollIntoView(t){t.scrollIntoView({block:"nearest"}),window.setTimeout(()=>t.focus(),0)}focusNextOption(t){const e=t.nextElementSibling;e&&this.focusAndScrollIntoView(e)}focusPreviousOption(t){const e=t.previousElementSibling;if(t.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else e&&this.focusAndScrollIntoView(e)}focusFirstOption(){const t=this.getOptionElements()[0];t&&this.focusAndScrollIntoView(t)}focusLastOption(){const t=this.getOptionElements().pop();t&&this.focusAndScrollIntoView(t)}focusFirstOrSelectedOption(){if(this.disabled)return;const t=this.getOptionElements().find(e=>e.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const e=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(e)}else if(t)this.focusAndScrollIntoView(t);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const e=this.querySelector('[role="searchbox"]');window.setTimeout(()=>e.focus(),0)}else this.focusFirstOption()}toggleOption(t){const e=t instanceof HTMLElement?t.dataset.disabled:t.disabled;if(this.disabled||e)return;const i=t instanceof HTMLElement?t.dataset.value:t.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(t=>{var e;return(t.fulltext||t.label+t.value+(t.prefix||"")).toLowerCase().includes(((e=this.searchValue)==null?void 0:e.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(t){return/^[\p{L} ]$/u.test(t)}handleTypeAhead(t){this.typeAheadString+=t.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const e=this.getOptionElements().find(i=>{var a;return(a=i.textContent)==null?void 0:a.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};gt([o({type:String})],ut.prototype,"id",2),gt([o({type:String})],ut.prototype,"label",2),gt([o({type:Array})],ut.prototype,"options",2),gt([o({type:Boolean,reflect:!0})],ut.prototype,"isOpen",2),gt([o({type:Boolean})],ut.prototype,"disabled",2),gt([o({type:Boolean})],ut.prototype,"includeSearch",2),gt([o({type:Boolean})],ut.prototype,"isMultiSelect",2),gt([o({type:Boolean})],ut.prototype,"allowUserInput",2),gt([o({type:Boolean})],ut.prototype,"maxIsReached",2),gt([o({type:String})],ut.prototype,"customUserInput",2),gt([o({type:String})],ut.prototype,"searchPlaceholder",2),gt([o({type:String})],ut.prototype,"searchValue",2),gt([o({type:Number})],ut.prototype,"maxLength",2),gt([o({type:String})],ut.prototype,"userMessage",2),gt([B()],ut.prototype,"_filteredOptions",2),ut=gt([V("pkt-listbox")],ut);const _l={displayValueAs:{default:"label"}},wl={props:_l};var xl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,tt=(s,t,e,i)=>{for(var a=i>1?void 0:i?Sl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&xl(t,e,a),a};let Q=class extends D{constructor(){super(),this.helptextSlot=T(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=wl.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=T(),this.arrowRef=T(),this.listboxRef=T(),this.focusRef=T(),this.optionTagRef=T(),this.optionsController=new Wa(this),this.slotController=new at(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t;if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const e=((t=this.options)==null?void 0:t.filter(i=>i.userAdded))||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const a={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(a.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(a.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(a.description=i.getAttribute("description")||void 0),a.fulltext=a.value+a.label+(a.prefix||""),e.push(a)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const e=(t.get("options")||this._options||[]).filter(a=>a&&a.userAdded).filter(a=>!(Array.isArray(this.options)?this.options:[]).some(n=>n.value===a.value)),i=[...e,...this.options];this._options=i,e.length>0&&(this.options=i),this._options.forEach(a=>{if(a.value&&!a.label&&(a.label=a.value),a.selected&&!this._value.includes(a.value)){const n=[...this._value];this._value=[...this._value,a.value],this.valueChanged(this._value,n)}a.fulltext=a.value+a.label+(a.prefix||""),a.selected=a.selected||this._value.includes(a.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),t==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(a=>{a.value&&!a.label&&(a.label=a.value),a.selected&&!this._value.includes(a.value)&&(this._value=[...this._value,a.value]),a.fulltext=a.value+a.label+(a.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,i)}render(){return u`
|
|
591
591
|
<pkt-input-wrapper
|
|
592
592
|
.label=${this.label}
|
|
593
593
|
.helptext=${this.helptext}
|
|
@@ -715,7 +715,7 @@
|
|
|
715
715
|
>${t.value}</span
|
|
716
716
|
>`;case"label":default:return u`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
717
717
|
>${t.label||t.value}</span
|
|
718
|
-
>`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var a;return(a=i.fulltext)==null?void 0:a.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(a=>{var n;return!a.selected&&((n=a.label)==null?void 0:n.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const a=i[0];a!=null&&a.label&&(e.value=a.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,a,n,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((n=(a=t.relatedTarget)==null?void 0:a.closest("pkt-combobox"))==null?void 0:n.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,d=this.findValueInOptions(h);!this._value.includes(h)&&!d?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;this.disabled||(t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t))}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,a;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(a=this.arrowRef.value)==null||a.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",i=e.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const a=this._value.find(h=>h.toLowerCase()===i),n=this._options.filter(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase().includes(i))??!1}),r=n.find(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((n.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(n.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!a:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case n.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const a=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,n=this._value.includes(t||a||""),r=!!a,h=((i=this._options.find(C=>C.value===t))==null?void 0:i.disabled)||!1,d=!(t!=null&&t.trim()),p=!this.multiple,m=this.multiple,g=this.isMaxItemsReached();let k=!1,b=!0,y="",w="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),y="Ny verdi lagt til",k=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),b=!1,k=!0,y="Ingen treff i søket"):n?(this.removeValue(a),k=!0):d&&p?(this.removeAllSelected(),k=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(a),k=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!g?(this.setSelected(a),k=!0):m&&g?(this._userInfoMessage="Maks antall valg nådd",b=!1,w=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,k=!0,w=t),this._isOptionsOpen=k,k||window.setTimeout(()=>{var C;(C=this.focusRef.value)==null||C.focus()},0),this._userInfoMessage=y,this._search=w||"",this.resetComboboxInput(b),m&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};tt([o({type:String,reflect:!0})],Q.prototype,"value",2),tt([o({type:Array})],Q.prototype,"options",2),tt([o({type:Array})],Q.prototype,"defaultOptions",2),tt([o({type:Boolean})],Q.prototype,"allowUserInput",2),tt([o({type:Boolean})],Q.prototype,"typeahead",2),tt([o({type:Boolean})],Q.prototype,"includeSearch",2),tt([o({type:String})],Q.prototype,"searchPlaceholder",2),tt([o({type:Boolean})],Q.prototype,"multiple",2),tt([o({type:Number})],Q.prototype,"maxlength",2),tt([o({type:String})],Q.prototype,"displayValueAs",2),tt([o({type:String})],Q.prototype,"tagPlacement",2),tt([B()],Q.prototype,"_options",2),tt([B()],Q.prototype,"_isOptionsOpen",2),tt([B()],Q.prototype,"_value",2),tt([B()],Q.prototype,"_userInfoMessage",2),tt([B()],Q.prototype,"_addValueText",2),tt([B()],Q.prototype,"_maxIsReached",2),tt([B()],Q.prototype,"_search",2),tt([B()],Q.prototype,"_inputFocus",2),tt([B()],Q.prototype,"_editingSingleValue",2),Q=tt([F("pkt-combobox")],Q);const Cl={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var Tl=Object.defineProperty,Nl=Object.getOwnPropertyDescriptor,ee=(s,t,e,i)=>{for(var a=i>1?void 0:i?Nl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Tl(t,e,a),a};let Ei=null;function Al(){return Ei||(Ei=new Promise((s,t)=>{if(document.querySelector("#oslo-consent-script")){s();return}const e=document.createElement("script");e.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",e.id="oslo-consent-script",e.onload=()=>s(),e.onerror=t,document.head.appendChild(e);const i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Ei)}let zt=class extends Y{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||Cl.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var t;super.disconnectedCallback(),this._cookieEventHandler&&((t=window.__cookieEvents)==null||t.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(t){let e;try{e=JSON.parse(t)}catch{e=t}return e}emitCookieConsents(t){const e=this.returnJsonOrObject(t.value).items.reduce((i,a)=>(i[a.name]=a.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:e,bubbles:!0,cancelable:!1}))}async firstUpdated(t){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await Al(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(t=>{if(t){const e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(t){var e;t.preventDefault(),(e=window.cookieBanner)!=null&&e.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?u`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?u`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
718
|
+
>`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var a;return(a=i.fulltext)==null?void 0:a.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(a=>{var n;return!a.selected&&((n=a.label)==null?void 0:n.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const a=i[0];a!=null&&a.label&&(e.value=a.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,a,n,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((n=(a=t.relatedTarget)==null?void 0:a.closest("pkt-combobox"))==null?void 0:n.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,d=this.findValueInOptions(h);!this._value.includes(h)&&!d?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;this.disabled||(t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t))}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,a;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(a=this.arrowRef.value)==null||a.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",i=e.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const a=this._value.find(h=>h.toLowerCase()===i),n=this._options.filter(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase().includes(i))??!1}),r=n.find(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((n.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(n.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!a:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case n.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const a=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,n=this._value.includes(t||a||""),r=!!a,h=((i=this._options.find(C=>C.value===t))==null?void 0:i.disabled)||!1,d=!(t!=null&&t.trim()),p=!this.multiple,g=this.multiple,m=this.isMaxItemsReached();let k=!1,b=!0,y="",w="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),y="Ny verdi lagt til",k=!g):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),b=!1,k=!0,y="Ingen treff i søket"):n?(this.removeValue(a),k=!0):d&&p?(this.removeAllSelected(),k=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(a),k=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):g&&!m?(this.setSelected(a),k=!0):g&&m?(this._userInfoMessage="Maks antall valg nådd",b=!1,w=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,k=!0,w=t),this._isOptionsOpen=k,k||window.setTimeout(()=>{var C;(C=this.focusRef.value)==null||C.focus()},0),this._userInfoMessage=y,this._search=w||"",this.resetComboboxInput(b),g&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};tt([o({type:String,reflect:!0})],Q.prototype,"value",2),tt([o({type:Array})],Q.prototype,"options",2),tt([o({type:Array})],Q.prototype,"defaultOptions",2),tt([o({type:Boolean})],Q.prototype,"allowUserInput",2),tt([o({type:Boolean})],Q.prototype,"typeahead",2),tt([o({type:Boolean})],Q.prototype,"includeSearch",2),tt([o({type:String})],Q.prototype,"searchPlaceholder",2),tt([o({type:Boolean})],Q.prototype,"multiple",2),tt([o({type:Number})],Q.prototype,"maxlength",2),tt([o({type:String})],Q.prototype,"displayValueAs",2),tt([o({type:String})],Q.prototype,"tagPlacement",2),tt([B()],Q.prototype,"_options",2),tt([B()],Q.prototype,"_isOptionsOpen",2),tt([B()],Q.prototype,"_value",2),tt([B()],Q.prototype,"_userInfoMessage",2),tt([B()],Q.prototype,"_addValueText",2),tt([B()],Q.prototype,"_maxIsReached",2),tt([B()],Q.prototype,"_search",2),tt([B()],Q.prototype,"_inputFocus",2),tt([B()],Q.prototype,"_editingSingleValue",2),Q=tt([V("pkt-combobox")],Q);const Cl={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var Tl=Object.defineProperty,Nl=Object.getOwnPropertyDescriptor,ee=(s,t,e,i)=>{for(var a=i>1?void 0:i?Nl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Tl(t,e,a),a};let Ei=null;function Al(){return Ei||(Ei=new Promise((s,t)=>{if(document.querySelector("#oslo-consent-script")){s();return}const e=document.createElement("script");e.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",e.id="oslo-consent-script",e.onload=()=>s(),e.onerror=t,document.head.appendChild(e);const i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Ei)}let zt=class extends Y{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||Cl.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var t;super.disconnectedCallback(),this._cookieEventHandler&&((t=window.__cookieEvents)==null||t.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(t){let e;try{e=JSON.parse(t)}catch{e=t}return e}emitCookieConsents(t){const e=this.returnJsonOrObject(t.value).items.reduce((i,a)=>(i[a.name]=a.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:e,bubbles:!0,cancelable:!1}))}async firstUpdated(t){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await Al(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(t=>{if(t){const e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(t){var e;t.preventDefault(),(e=window.cookieBanner)!=null&&e.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?u`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?u`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
719
719
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
720
720
|
${this.triggerText}
|
|
721
721
|
</a>`:this.triggerType==="icon"?u`<pkt-button
|
|
@@ -725,7 +725,7 @@
|
|
|
725
725
|
@click=${this.openModal}
|
|
726
726
|
>
|
|
727
727
|
>${this.triggerText}</pkt-button
|
|
728
|
-
>`:u`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ee([o({type:Boolean})],zt.prototype,"devMode",2),ee([o({type:String})],zt.prototype,"hotjarId",2),ee([o({type:String})],zt.prototype,"googleAnalyticsId",2),ee([o({type:String})],zt.prototype,"cookieDomain",2),ee([o({type:String})],zt.prototype,"cookieSecure",2),ee([o({type:String})],zt.prototype,"cookieExpiryDays",2),ee([o({type:String})],zt.prototype,"triggerType",2),ee([o({type:String})],zt.prototype,"triggerText",2),ee([o({type:String})],zt.prototype,"i18nLanguage",2),zt=ee([
|
|
728
|
+
>`:u`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ee([o({type:Boolean})],zt.prototype,"devMode",2),ee([o({type:String})],zt.prototype,"hotjarId",2),ee([o({type:String})],zt.prototype,"googleAnalyticsId",2),ee([o({type:String})],zt.prototype,"cookieDomain",2),ee([o({type:String})],zt.prototype,"cookieSecure",2),ee([o({type:String})],zt.prototype,"cookieExpiryDays",2),ee([o({type:String})],zt.prototype,"triggerType",2),ee([o({type:String})],zt.prototype,"triggerText",2),ee([o({type:String})],zt.prototype,"i18nLanguage",2),zt=ee([V("pkt-consent")],zt);var El=Object.defineProperty,Pl=Object.getOwnPropertyDescriptor,kt=(s,t,e,i)=>{for(var a=i>1?void 0:i?Pl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&El(t,e,a),a};let mt=class extends D{constructor(){super(...arguments),this.inputRef=T(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,e,i){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(t,e,i)}firstUpdated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(t)}updated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.updated(t)}render(){const t=P({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=P({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=P({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),a="pkt-tag pkt-tag--small pkt-tag--thin-text",n=()=>u`
|
|
729
729
|
${this.tagText?u`<span class=${a+" pkt-tag--gray"}>${this.tagText}</span>`:$}
|
|
730
730
|
${this.optionalTag?u`<span class=${a+" pkt-tag--blue-light"}>${this.optionalText}</span>`:$}
|
|
731
731
|
${this.requiredTag?u`<span class=${a+" pkt-tag--beige"}>${this.requiredText}</span>`:$}
|
|
@@ -755,7 +755,7 @@
|
|
|
755
755
|
${this.labelPosition==="right"?r():$}
|
|
756
756
|
</div>
|
|
757
757
|
</div>
|
|
758
|
-
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};
|
|
758
|
+
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};kt([o({type:String,reflect:!0})],mt.prototype,"value",2),kt([o({type:String})],mt.prototype,"checkHelptext",2),kt([o({type:Boolean})],mt.prototype,"defaultChecked",2),kt([o({type:Boolean})],mt.prototype,"hasTile",2),kt([o({type:Boolean})],mt.prototype,"isSwitch",2),kt([o({type:String})],mt.prototype,"labelPosition",2),kt([o({type:Boolean})],mt.prototype,"hideLabel",2),kt([o({type:Boolean,reflect:!0})],mt.prototype,"checked",2),kt([o({type:String,reflect:!0})],mt.prototype,"type",2),kt([o({type:String})],mt.prototype,"tagText",2),kt([o({type:Boolean})],mt.prototype,"optionalTag",2),kt([o({type:String})],mt.prototype,"optionalText",2),kt([o({type:Boolean})],mt.prototype,"requiredTag",2),kt([o({type:String})],mt.prototype,"requiredText",2),mt=kt([V("pkt-checkbox")],mt);const Ol=s=>new Promise(t=>setTimeout(t,s)),Le={isIOS(){const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)}},se={parseValue(s){return s?Array.isArray(s)?s.filter(Boolean):typeof s=="string"?s.split(",").filter(Boolean):String(s).split(",").filter(Boolean):[]},formatValue(s){return s.join(",")},normalizeNameForMultiple(s,t,e){return s?(t||e)&&!s.endsWith("[]")?s+"[]":s:null},normalizeStringArray(s){return typeof s=="string"?s.split(",").filter(Boolean):Array.isArray(s)?s:[]},validateRangeOrder(s){return!s||s.length!==2?!0:Xo(s[0],s[1])},sortDates(s){return Zo(s)},filterSelectableDates(s,t,e,i,a){return Yo(s,t,e,i,a)}},Ml={getInputType(){return Le.isIOS()?"text":"date"}},Es={submitForm(s){var t;const e=(t=s.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(s,t){const e=s==null?void 0:s.form;e?e.requestSubmit():t()},validateDateInput(s,t,e,i,a){var n,r,h,d;const p=s.value;p&&(e&&e>p?t.setValidity({rangeUnderflow:!0},((r=(n=a==null?void 0:a.forms)==null?void 0:n.messages)==null?void 0:r.rangeUnderflow)||"Value is below minimum",s):i&&i<p&&t.setValidity({rangeOverflow:!0},((d=(h=a==null?void 0:a.forms)==null?void 0:h.messages)==null?void 0:d.rangeOverflow)||"Value is above maximum",s))}},ni={addToSelected(s,t,e,i){const a=s.target;if(!a.value)return;const n=e?oe(e):null,r=i?oe(i):null,h=oe(a.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!n||h>=n)&&(!r||h<=r)&&t.value&&t.value.handleDateSelect(h),a.value=""},handleCalendarPosition(s,t,e=!1){var i;if(!s.value||!t.value)return;const a=((i=t.value.parentElement)==null?void 0:i.getBoundingClientRect())||t.value.getBoundingClientRect(),n=e?a.height+30:a.height,r=s.value.getBoundingClientRect().height;let h=e?"calc(100% - 30px)":"100%";a&&a.top+r>window.innerHeight&&a.top-r>0&&(h=`calc(100% - ${n}px - ${r}px)`),s.value.style.top=h}},Ps={getInputClasses(s,t,e,i,a,n){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":e,"pkt-datepicker--range":i,"ios-readonly-hack":a===!1&&n==="text"}},getButtonClasses(){return{"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}},getRangeLabelClasses(s){return{"pkt-input-prefix":s,"pkt-hide":!s}}},Pi={processDateSelection(s,t,e){return!t&&!e?s[0]||"":Array.isArray(s)?s.join(","):s},updateInputValues(s,t,e,i,a,n){s.value&&(i&&t!=null&&t.value?(s.value.value=e[0]??"",t.value.value=e[1]??"",n(s.value),n(t.value)):a||(s.value.value=e.length?e[0]:"",n(s.value)))},processRangeBlur(s,t,e,i,a){var n;const r=s.target;if(r.value){a(r);const h=be(r.value);h&&t[0]!==r.value&&t[1]&&(i(),(n=e==null?void 0:e.value)==null||n.handleDateSelect(h))}else t[0]&&i()}},Be={handleInputKeydown(s,t,e,i,a,n){const{key:r}=s;r===","&&(s.preventDefault(),n?n(s):a&&a()),(r==="Space"||r===" ")&&(s.preventDefault(),t(s)),r==="Enter"&&(s.preventDefault(),e?e():i?i():a&&a())},handleButtonKeydown(s,t){const{key:e}=s;(e==="Enter"||e===" "||e==="Space")&&(s.preventDefault(),t(s))}};var Dl=Object.defineProperty,Il=Object.getOwnPropertyDescriptor,Os=(s,t,e,i)=>{for(var a=i>1?void 0:i?Il(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Dl(t,e,a),a};let ss=class extends Y{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=ke()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},u`
|
|
759
759
|
<div class=${P(this.classes)} aria-live="polite">
|
|
760
760
|
${Array.isArray(this.dates)&&this.dates[0]?Ai(se.sortDates((this.dates??[]).filter(Boolean)),t=>t,t=>{var e;return u` <pkt-tag
|
|
761
761
|
id=${this.idBase+t+"-tag"}
|
|
@@ -766,7 +766,7 @@
|
|
|
766
766
|
<time datetime=${t}>${Va(t,this.dateformat)}</time>
|
|
767
767
|
</pkt-tag>`}):$}
|
|
768
768
|
</div>
|
|
769
|
-
`}};Os([o({type:Array})],ss.prototype,"dates",2),Os([o({type:String})],ss.prototype,"dateformat",2),Os([o({type:String,attribute:"class"})],ss.prototype,"className",2),Os([o({type:String,attribute:"id-base"})],ss.prototype,"idBase",2),ss=Os([
|
|
769
|
+
`}};Os([o({type:Array})],ss.prototype,"dates",2),Os([o({type:String})],ss.prototype,"dateformat",2),Os([o({type:String,attribute:"class"})],ss.prototype,"className",2),Os([o({type:String,attribute:"id-base"})],ss.prototype,"idBase",2),ss=Os([V("pkt-date-tags")],ss);const Ll={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},Ms={props:Ll};var Bl=Object.defineProperty,Fl=Object.getOwnPropertyDescriptor,Pt=(s,t,e,i)=>{for(var a=i>1?void 0:i?Fl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Bl(t,e,a),a};let wt=class extends Y{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.popupRef=T(),this.calendarRef=T(),this.handleDocumentClick=t=>{if(!this.open)return;const e=t.composedPath(),i=this.parentElement,a=this.popupRef.value;!e.includes(this)&&!e.includes(a)&&!(i&&e.includes(i))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var t;this.open=!0,(t=this.calendarRef.value)==null||t.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(t){var e;return!!t&&!!((e=this.popupRef.value)!=null&&e.contains(t))}focusOnCurrentDate(){const t=this.calendarRef.value;t&&typeof t.focusOnCurrentDate=="function"&&t.focusOnCurrentDate()}addToSelected(t,e,i){if(typeof ni.addToSelected=="function")return ni.addToSelected(t,this.calendarRef,e,i)}handleDateSelect(t){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(t)}render(){const t={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return u`
|
|
770
770
|
<div
|
|
771
771
|
class="${P(t)}"
|
|
772
772
|
${A(this.popupRef)}
|
|
@@ -791,7 +791,7 @@
|
|
|
791
791
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
792
792
|
></pkt-calendar>
|
|
793
793
|
</div>
|
|
794
|
-
`}};Pt([o({type:Boolean,reflect:!0})],wt.prototype,"open",2),Pt([o({type:Boolean})],wt.prototype,"multiple",2),Pt([o({type:Boolean})],wt.prototype,"range",2),Pt([o({type:Boolean})],wt.prototype,"weeknumbers",2),Pt([o({type:Boolean})],wt.prototype,"withcontrols",2),Pt([o({type:Number})],wt.prototype,"maxMultiple",2),Pt([o({type:Array})],wt.prototype,"selected",2),Pt([o({type:String})],wt.prototype,"earliest",2),Pt([o({type:String})],wt.prototype,"latest",2),Pt([o({type:Array})],wt.prototype,"excludedates",2),Pt([o({type:Array})],wt.prototype,"excludeweekdays",2),Pt([o({type:String})],wt.prototype,"currentmonth",2),wt=Pt([
|
|
794
|
+
`}};Pt([o({type:Boolean,reflect:!0})],wt.prototype,"open",2),Pt([o({type:Boolean})],wt.prototype,"multiple",2),Pt([o({type:Boolean})],wt.prototype,"range",2),Pt([o({type:Boolean})],wt.prototype,"weeknumbers",2),Pt([o({type:Boolean})],wt.prototype,"withcontrols",2),Pt([o({type:Number})],wt.prototype,"maxMultiple",2),Pt([o({type:Array})],wt.prototype,"selected",2),Pt([o({type:String})],wt.prototype,"earliest",2),Pt([o({type:String})],wt.prototype,"latest",2),Pt([o({type:Array})],wt.prototype,"excludedates",2),Pt([o({type:Array})],wt.prototype,"excludeweekdays",2),Pt([o({type:String})],wt.prototype,"currentmonth",2),wt=Pt([V("pkt-datepicker-popup")],wt);var Vl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Wt=(s,t,e,i)=>{for(var a=i>1?void 0:i?jl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Vl(t,e,a),a};let Ot=class extends Y{constructor(){super(...arguments),this.value="",this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=T(),this.btnRef=T()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return u`
|
|
795
795
|
<div class="pkt-input__container">
|
|
796
796
|
<input
|
|
797
797
|
class="${P(this.inputClasses)}"
|
|
@@ -825,7 +825,7 @@
|
|
|
825
825
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
826
826
|
</button>
|
|
827
827
|
</div>
|
|
828
|
-
`}};Wt([o({type:String})],Ot.prototype,"value",2),Wt([o({type:String})],Ot.prototype,"inputType",2),Wt([o({type:String})],Ot.prototype,"id",2),Wt([o({type:String})],Ot.prototype,"min",2),Wt([o({type:String})],Ot.prototype,"max",2),Wt([o({type:String})],Ot.prototype,"placeholder",2),Wt([o({type:Boolean})],Ot.prototype,"readonly",2),Wt([o({type:Boolean})],Ot.prototype,"disabled",2),Wt([o({type:Object})],Ot.prototype,"inputClasses",2),Wt([o({type:Object})],Ot.prototype,"internals",2),Wt([o({type:Object})],Ot.prototype,"strings",2),Ot=Wt([
|
|
828
|
+
`}};Wt([o({type:String})],Ot.prototype,"value",2),Wt([o({type:String})],Ot.prototype,"inputType",2),Wt([o({type:String})],Ot.prototype,"id",2),Wt([o({type:String})],Ot.prototype,"min",2),Wt([o({type:String})],Ot.prototype,"max",2),Wt([o({type:String})],Ot.prototype,"placeholder",2),Wt([o({type:Boolean})],Ot.prototype,"readonly",2),Wt([o({type:Boolean})],Ot.prototype,"disabled",2),Wt([o({type:Object})],Ot.prototype,"inputClasses",2),Wt([o({type:Object})],Ot.prototype,"internals",2),Wt([o({type:Object})],Ot.prototype,"strings",2),Ot=Wt([V("pkt-datepicker-single")],Ot);var Hl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,Mt=(s,t,e,i)=>{for(var a=i>1?void 0:i?Ul(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Hl(t,e,a),a};let xt=class extends Y{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.showRangeLabels=!1,this.inputClasses={},this.strings={generic:{from:"Fra",to:"Til"}},this.inputRef=T(),this.inputRefTo=T(),this.btnRef=T()}get inputElement(){return this.inputRef.value}get inputElementTo(){return this.inputRefTo.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){const t=Ps.getRangeLabelClasses(this.showRangeLabels);return u`
|
|
829
829
|
<div class="pkt-input__container">
|
|
830
830
|
${this.showRangeLabels?u` <div class="pkt-input-prefix">${this.strings.generic.from}</div> `:$}
|
|
831
831
|
<input
|
|
@@ -883,7 +883,7 @@
|
|
|
883
883
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
884
884
|
</button>
|
|
885
885
|
</div>
|
|
886
|
-
`}};Mt([o({type:Array})],xt.prototype,"value",2),Mt([o({type:String})],xt.prototype,"inputType",2),Mt([o({type:String})],xt.prototype,"id",2),Mt([o({type:String})],xt.prototype,"min",2),Mt([o({type:String})],xt.prototype,"max",2),Mt([o({type:String})],xt.prototype,"placeholder",2),Mt([o({type:Boolean})],xt.prototype,"readonly",2),Mt([o({type:Boolean})],xt.prototype,"disabled",2),Mt([o({type:Boolean})],xt.prototype,"showRangeLabels",2),Mt([o({type:Object})],xt.prototype,"inputClasses",2),Mt([o({type:Object})],xt.prototype,"internals",2),Mt([o({type:Object})],xt.prototype,"strings",2),xt=Mt([
|
|
886
|
+
`}};Mt([o({type:Array})],xt.prototype,"value",2),Mt([o({type:String})],xt.prototype,"inputType",2),Mt([o({type:String})],xt.prototype,"id",2),Mt([o({type:String})],xt.prototype,"min",2),Mt([o({type:String})],xt.prototype,"max",2),Mt([o({type:String})],xt.prototype,"placeholder",2),Mt([o({type:Boolean})],xt.prototype,"readonly",2),Mt([o({type:Boolean})],xt.prototype,"disabled",2),Mt([o({type:Boolean})],xt.prototype,"showRangeLabels",2),Mt([o({type:Object})],xt.prototype,"inputClasses",2),Mt([o({type:Object})],xt.prototype,"internals",2),Mt([o({type:Object})],xt.prototype,"strings",2),xt=Mt([V("pkt-datepicker-range")],xt);var ql=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,Dt=(s,t,e,i)=>{for(var a=i>1?void 0:i?zl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&ql(t,e,a),a};let St=class extends Y{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=T(),this.btnRef=T()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}dispatchAddToSelected(t){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return u`
|
|
887
887
|
<div class="pkt-input__container">
|
|
888
888
|
<input
|
|
889
889
|
class=${P(this.inputClasses)}
|
|
@@ -915,7 +915,7 @@
|
|
|
915
915
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
916
916
|
</button>
|
|
917
917
|
</div>
|
|
918
|
-
`}};Dt([o({type:Array})],St.prototype,"value",2),Dt([o({type:String})],St.prototype,"inputType",2),Dt([o({type:String})],St.prototype,"id",2),Dt([o({type:String})],St.prototype,"min",2),Dt([o({type:String})],St.prototype,"max",2),Dt([o({type:String})],St.prototype,"placeholder",2),Dt([o({type:Boolean})],St.prototype,"readonly",2),Dt([o({type:Boolean})],St.prototype,"disabled",2),Dt([o({type:Number})],St.prototype,"maxlength",2),Dt([o({type:Object})],St.prototype,"inputClasses",2),Dt([o({type:Object})],St.prototype,"internals",2),Dt([o({type:Object})],St.prototype,"strings",2),St=Dt([
|
|
918
|
+
`}};Dt([o({type:Array})],St.prototype,"value",2),Dt([o({type:String})],St.prototype,"inputType",2),Dt([o({type:String})],St.prototype,"id",2),Dt([o({type:String})],St.prototype,"min",2),Dt([o({type:String})],St.prototype,"max",2),Dt([o({type:String})],St.prototype,"placeholder",2),Dt([o({type:Boolean})],St.prototype,"readonly",2),Dt([o({type:Boolean})],St.prototype,"disabled",2),Dt([o({type:Number})],St.prototype,"maxlength",2),Dt([o({type:Object})],St.prototype,"inputClasses",2),Dt([o({type:Object})],St.prototype,"internals",2),Dt([o({type:Object})],St.prototype,"strings",2),St=Dt([V("pkt-datepicker-multiple")],St);var Wl=Object.defineProperty,Rl=Object.getOwnPropertyDescriptor,ht=(s,t,e,i)=>{for(var a=i>1?void 0:i?Rl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Wl(t,e,a),a};let et=class extends D{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=T(),this._value=[],this.label="Datovelger",this.dateformat=Ms.props.dateformat.default,this.multiple=Ms.props.multiple.default,this.maxlength=null,this.range=Ms.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=Ms.props.weeknumbers.default,this.withcontrols=Ms.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=T(),this.popupRef=T(),this.helptextSlot=T(),this.singleInputRef=T(),this.rangeInputRef=T(),this.multipleInputRef=T(),this.addToSelected=t=>{const e=this.datepickerPopupRef.value;return e&&typeof e.addToSelected=="function"?e.addToSelected(t,this.min,this.max):ni.addToSelected(t,this.calRef,this.min,this.max)},this.slotController=new at(this,this.helptextSlot)}get value(){return this._valueProperty}set value(t){const e=this._valueProperty;this._valueProperty=Array.isArray(t)?t.join(","):t||"",this.valueChanged(this._valueProperty,e),this.requestUpdate("value",e)}get inputType(){return Ml.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=se.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(t,e){if(t===e)return;const i=se.parseValue(t),a=this.multiple&&i.length>1?se.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!se.validateRangeOrder(a)){this._value=[],this._valueProperty="",super.valueChanged("",e);return}this._value=a;const n=se.formatValue(a);this._valueProperty!==n&&(this._valueProperty=n),super.valueChanged(n,e)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&this.valueChanged(i,e),t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=se.normalizeStringArray(i||"")),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=se.normalizeStringArray(i||"")),super.attributeChangedCallback(t,e,i)}updated(t){if(t.has("value")){const e=Array.isArray(this.value)?this.value.join(","):this.value,i=t.get("value"),a=Array.isArray(i)?i.join(","):i;this.valueChanged(e,a)}(t.has("multiple")||t.has("range"))&&(this.name=se.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),t.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=se.parseValue(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(t)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.inputElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.inputElement:(i=this.singleInputRef.value)==null?void 0:i.inputElement}get currentInputElementTo(){var t;if(this.range)return(t=this.rangeInputRef.value)==null?void 0:t.inputElementTo}get currentButtonElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.buttonElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.buttonElement:(i=this.singleInputRef.value)==null?void 0:i.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return u`
|
|
919
919
|
<pkt-datepicker-single
|
|
920
920
|
.value=${this._value[0]??""}
|
|
921
921
|
.inputType=${this.inputType}
|
|
@@ -958,7 +958,7 @@
|
|
|
958
958
|
@range-blur=${t=>{Pi.processRangeBlur(t.detail.event,t.detail.values,this.calRef,()=>this.clearInputValue(),e=>this.manageValidity(e))}}
|
|
959
959
|
@manage-validity=${t=>this.manageValidity(t.detail)}
|
|
960
960
|
@validate-date-input=${t=>{Es.validateDateInput(t.detail,this.internals,this.min,this.max,this.strings)}}
|
|
961
|
-
@handle-date-select=${t=>{var e,i;const a=
|
|
961
|
+
@handle-date-select=${t=>{var e,i;const a=be(t.detail);a&&this._value[1]!==nt(a)&&((i=(e=this.calRef)==null?void 0:e.value)==null||i.handleDateSelect(a))}}
|
|
962
962
|
@input-changed=${()=>{this.touched=!0}}
|
|
963
963
|
${A(this.rangeInputRef)}
|
|
964
964
|
></pkt-datepicker-range>
|
|
@@ -998,7 +998,7 @@
|
|
|
998
998
|
.latest=${this.max}
|
|
999
999
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
1000
1000
|
.excludeweekdays=${this.excludeweekdays}
|
|
1001
|
-
.currentmonth=${this.currentmonth?
|
|
1001
|
+
.currentmonth=${this.currentmonth?ve(this.currentmonth):null}
|
|
1002
1002
|
@date-selected=${t=>{this.value=Pi.processDateSelection(t.detail,this.multiple,this.range),this._value=t.detail,Pi.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,e=>this.manageValidity(e))}}
|
|
1003
1003
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
1004
1004
|
${A(this.datepickerPopupRef)}
|
|
@@ -1034,7 +1034,7 @@
|
|
|
1034
1034
|
dateformat=${this.dateformat}
|
|
1035
1035
|
strings=${this.strings}
|
|
1036
1036
|
id-base=${this.id}
|
|
1037
|
-
@date-tag-removed=${t=>{var e;const i=this.datepickerPopupRef.value,a=
|
|
1037
|
+
@date-tag-removed=${t=>{var e;const i=this.datepickerPopupRef.value,a=be(t.detail);i&&a&&typeof i.handleDateSelect=="function"?i.handleDateSelect(a):(e=this.calRef.value)==null||e.handleDateSelect(a)}}
|
|
1038
1038
|
></pkt-date-tags>`:$}
|
|
1039
1039
|
<div
|
|
1040
1040
|
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
@@ -1043,13 +1043,13 @@
|
|
|
1043
1043
|
</div>
|
|
1044
1044
|
</pkt-input-wrapper>
|
|
1045
1045
|
${this.renderCalendar()}
|
|
1046
|
-
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;ni.handleCalendarPosition(this.popupRef,this.inputRef,t)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),Le.isIOS()&&e.focusOnCurrentDate();return}await Ol(20),this.handleCalendarPosition(),Le.isIOS()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const t=this.datepickerPopupRef.value;if(this.calendarOpen=!1,t&&typeof t.hide=="function")return t.hide()}async toggleCalendar(t){t.preventDefault();const e=this.datepickerPopupRef.value;if(e&&typeof e.toggle=="function"){const i=!!e.open;e.toggle(),this.calendarOpen=!i;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value=""}};ht([o({type:String,reflect:!0})],et.prototype,"value",1),ht([o({type:Array})],et.prototype,"_value",2),ht([o({type:String,reflect:!0})],et.prototype,"label",2),ht([o({type:String})],et.prototype,"dateformat",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"multiple",2),ht([o({type:Number,reflect:!0})],et.prototype,"maxlength",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"range",2),ht([o({type:Boolean})],et.prototype,"showRangeLabels",2),ht([o({type:String,reflect:!0})],et.prototype,"min",2),ht([o({type:String,reflect:!0})],et.prototype,"max",2),ht([o({type:Boolean})],et.prototype,"weeknumbers",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"withcontrols",2),ht([o({converter:ts.csvToArray})],et.prototype,"excludedates",2),ht([o({converter:ts.csvToArray})],et.prototype,"excludeweekdays",2),ht([o({type:String})],et.prototype,"currentmonth",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"calendarOpen",2),ht([o({type:String})],et.prototype,"timezone",2),ht([B()],et.prototype,"inputClasses",2),et=ht([
|
|
1046
|
+
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;ni.handleCalendarPosition(this.popupRef,this.inputRef,t)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),Le.isIOS()&&e.focusOnCurrentDate();return}await Ol(20),this.handleCalendarPosition(),Le.isIOS()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const t=this.datepickerPopupRef.value;if(this.calendarOpen=!1,t&&typeof t.hide=="function")return t.hide()}async toggleCalendar(t){t.preventDefault();const e=this.datepickerPopupRef.value;if(e&&typeof e.toggle=="function"){const i=!!e.open;e.toggle(),this.calendarOpen=!i;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value=""}};ht([o({type:String,reflect:!0})],et.prototype,"value",1),ht([o({type:Array})],et.prototype,"_value",2),ht([o({type:String,reflect:!0})],et.prototype,"label",2),ht([o({type:String})],et.prototype,"dateformat",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"multiple",2),ht([o({type:Number,reflect:!0})],et.prototype,"maxlength",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"range",2),ht([o({type:Boolean})],et.prototype,"showRangeLabels",2),ht([o({type:String,reflect:!0})],et.prototype,"min",2),ht([o({type:String,reflect:!0})],et.prototype,"max",2),ht([o({type:Boolean})],et.prototype,"weeknumbers",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"withcontrols",2),ht([o({converter:ts.csvToArray})],et.prototype,"excludedates",2),ht([o({converter:ts.csvToArray})],et.prototype,"excludeweekdays",2),ht([o({type:String})],et.prototype,"currentmonth",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"calendarOpen",2),ht([o({type:String})],et.prototype,"timezone",2),ht([B()],et.prototype,"inputClasses",2),et=ht([V("pkt-datepicker")],et);const Kl={href:{default:"#"},target:{default:"_self"}},Ra={props:Kl};var Gl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,is=(s,t,e,i)=>{for(var a=i>1?void 0:i?Yl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Gl(t,e,a),a};let $e=class extends Y{constructor(){super(),this.defaultSlot=T(),this.href=Ra.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=Ra.props.target.default,this.slotController=new at(this,this.defaultSlot)}render(){const t={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return u`<a
|
|
1047
1047
|
class=${P(t)}
|
|
1048
1048
|
href=${this.href}
|
|
1049
1049
|
.target=${this.target}
|
|
1050
1050
|
.rel=${this.external?"noopener noreferrer":$}
|
|
1051
1051
|
>${this.iconName?u`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${A(this.defaultSlot)}>Link</span></a
|
|
1052
|
-
>`}};is([o({type:String,reflect:!0})]
|
|
1052
|
+
>`}};is([o({type:String,reflect:!0})],$e.prototype,"href",2),is([o({type:String,reflect:!0})],$e.prototype,"iconName",2),is([o({type:String,reflect:!0})],$e.prototype,"iconPosition",2),is([o({type:Boolean,reflect:!0})],$e.prototype,"external",2),is([o({type:String,reflect:!0})],$e.prototype,"target",2),$e=is([V("pkt-link")],$e);var Zl=Object.defineProperty,Xl=Object.getOwnPropertyDescriptor,Fe=(s,t,e,i)=>{for(var a=i>1?void 0:i?Xl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Zl(t,e,a),a};let _e=class extends Y{constructor(){super(),this.defaultSlot=T(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new at(this,this.defaultSlot)}render(){const t=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),e=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return u`
|
|
1053
1053
|
<a
|
|
1054
1054
|
href=${this.href}
|
|
1055
1055
|
class=${t}
|
|
@@ -1061,7 +1061,7 @@
|
|
|
1061
1061
|
|
|
1062
1062
|
<div class="pkt-linkcard__text" ${A(this.defaultSlot)}></div>
|
|
1063
1063
|
</a>
|
|
1064
|
-
`}};Fe([o({type:String,reflect:!0})],
|
|
1064
|
+
`}};Fe([o({type:String,reflect:!0})],_e.prototype,"title",2),Fe([o({type:String,reflect:!0})],_e.prototype,"href",2),Fe([o({type:String,reflect:!0})],_e.prototype,"iconName",2),Fe([o({type:Boolean,reflect:!0})],_e.prototype,"external",2),Fe([o({type:Boolean,reflect:!0})],_e.prototype,"openInNewTab",2),Fe([o({type:String,reflect:!0})],_e.prototype,"skin",2),_e=Fe([V("pkt-linkcard")],_e);var Jl=Object.defineProperty,Ql=Object.getOwnPropertyDescriptor,he=(s,t,e,i)=>{for(var a=i>1?void 0:i?Ql(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Jl(t,e,a),a};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.13/animations/";let Yt=class extends Y{constructor(){super(),this.defaultSlot=T(),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 at(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(t){t.has("delay")&&this.setupLoader()}render(){const t=P({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),e=P({"pkt-contents":!0,"pkt-hide":this.isLoading});return u`<div
|
|
1065
1065
|
role="status"
|
|
1066
1066
|
aria-live="polite"
|
|
1067
1067
|
aria-busy=${this.isLoading?"true":"false"}
|
|
@@ -1076,7 +1076,7 @@
|
|
|
1076
1076
|
${this.message&&u`<p>${this.message}</p>`}
|
|
1077
1077
|
</div>`:$}
|
|
1078
1078
|
<div class=${e} ${A(this.defaultSlot)}></div>
|
|
1079
|
-
</div>`}getVariant(t){switch(t){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};
|
|
1079
|
+
</div>`}getVariant(t){switch(t){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};he([o({type:Number})],Yt.prototype,"delay",2),he([o({type:Boolean})],Yt.prototype,"inline",2),he([o({type:Boolean})],Yt.prototype,"isLoading",2),he([o({type:String})],Yt.prototype,"message",2),he([o({type:String})],Yt.prototype,"size",2),he([o({type:String})],Yt.prototype,"variant",2),he([o({type:String})],Yt.prototype,"loadingAnimationPath",2),he([B()],Yt.prototype,"_shouldDisplayLoader",2),Yt=he([V("pkt-loader")],Yt);const th={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},Oi={props:th};var eh=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,as=(s,t,e,i)=>{for(var a=i>1?void 0:i?sh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&eh(t,e,a),a};let Ve=class extends Y{constructor(){super(),this.defaultSlot=T(),this.closable=Oi.props.closable.default,this.compact=Oi.props.compact.default,this.title="",this.skin=Oi.props.skin.default,this._isClosed=!1,this.close=s=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:s},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:s},bubbles:!0}))},this.slotController=new at(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&ka(this,"pkt-hide",this._isClosed)}render(){const s={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return u`<div class=${P(s)}>
|
|
1080
1080
|
${this.closable?u`<div class="pkt-messagebox__close">
|
|
1081
1081
|
<button
|
|
1082
1082
|
@click=${this.close}
|
|
@@ -1088,7 +1088,7 @@
|
|
|
1088
1088
|
</div>`:$}
|
|
1089
1089
|
${this.title?u`<div class="pkt-messagebox__title">${this.title}</div>`:$}
|
|
1090
1090
|
<div class="pkt-messagebox__text" ${A(this.defaultSlot)}></div>
|
|
1091
|
-
</div>`}};as([o({type:Boolean,reflect:!0})],Ve.prototype,"closable",2),as([o({type:Boolean,reflect:!0})],Ve.prototype,"compact",2),as([o({type:String,reflect:!0})],Ve.prototype,"title",2),as([o({type:String,reflect:!0})],Ve.prototype,"skin",2),as([B()],Ve.prototype,"_isClosed",2),Ve=as([
|
|
1091
|
+
</div>`}};as([o({type:Boolean,reflect:!0})],Ve.prototype,"closable",2),as([o({type:Boolean,reflect:!0})],Ve.prototype,"compact",2),as([o({type:String,reflect:!0})],Ve.prototype,"title",2),as([o({type:String,reflect:!0})],Ve.prototype,"skin",2),as([B()],Ve.prototype,"_isClosed",2),Ve=as([V("pkt-messagebox")],Ve);const ih={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},Mi={props:ih};var ah=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,Zt=(s,t,e,i)=>{for(var a=i>1?void 0:i?nh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&ah(t,e,a),a};let It=class extends Y{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=Mi.props.hideCloseButton.default,this.closeOnBackdropClick=Mi.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=Mi.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=T(),this.dialogRef=T(),this._isOpen=!1,this.close=(t,e=!1)=>{var i;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const a=document.activeElement;a&&!this.isElementInViewport(a)&&a.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),e||(i=this.dialogRef.value)==null||i.close(),this.requestUpdate()},this.showModal=(t=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const i=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var a;this.dialogRef.value&&((a=this.dialogRef.value)==null||a.focus())}),i&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:t},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new at(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(t){super.firstUpdated(t),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>md).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(t){t.key==="Escape"&&this.close(t)}handleBackdropClick(t){var e;this.closeOnBackdropClick&&t.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(t)}isElementInViewport(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const t={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},i={"pkt-modal__content":!0,"pkt-txt-18-light":!0},a=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return u`
|
|
1092
1092
|
<dialog
|
|
1093
1093
|
class=${P(t)}
|
|
1094
1094
|
${A(this.dialogRef)}
|
|
@@ -1124,11 +1124,11 @@
|
|
|
1124
1124
|
</div>
|
|
1125
1125
|
</div>
|
|
1126
1126
|
</dialog>
|
|
1127
|
-
`}};Zt([o({type:String})],It.prototype,"headingText",2),Zt([o({type:Boolean})],It.prototype,"removePadding",2),Zt([o({type:Boolean})],It.prototype,"hideCloseButton",2),Zt([o({type:Boolean})],It.prototype,"closeOnBackdropClick",2),Zt([o({type:String})],It.prototype,"closeButtonSkin",2),Zt([o({type:String})],It.prototype,"size",2),Zt([o({type:String})],It.prototype,"variant",2),Zt([o({type:String})],It.prototype,"drawerPosition",2),Zt([o({type:Boolean})],It.prototype,"transparentBackdrop",2),Zt([B()],It.prototype,"_isOpen",2),It=Zt([
|
|
1127
|
+
`}};Zt([o({type:String})],It.prototype,"headingText",2),Zt([o({type:Boolean})],It.prototype,"removePadding",2),Zt([o({type:Boolean})],It.prototype,"hideCloseButton",2),Zt([o({type:Boolean})],It.prototype,"closeOnBackdropClick",2),Zt([o({type:String})],It.prototype,"closeButtonSkin",2),Zt([o({type:String})],It.prototype,"size",2),Zt([o({type:String})],It.prototype,"variant",2),Zt([o({type:String})],It.prototype,"drawerPosition",2),Zt([o({type:Boolean})],It.prototype,"transparentBackdrop",2),Zt([B()],It.prototype,"_isOpen",2),It=Zt([V("pkt-modal")],It);/**
|
|
1128
1128
|
* @license
|
|
1129
1129
|
* Copyright 2018 Google LLC
|
|
1130
1130
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1131
|
-
*/const Ka="important",rh=" !"+Ka,oh=Te(class extends Ye{constructor(s){var t;if(super(s),s.type!==Kt.ATTRIBUTE||s.name!=="style"||((t=s.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce(((t,e)=>{const i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(s,[t]){const{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(const i in t){const a=t[i];if(a!=null){this.ft.add(i);const n=typeof a=="string"&&a.endsWith(rh);i.includes("-")||n?e.setProperty(i,n?a.slice(0,-11):a,n?Ka:""):e[i]=a}}return $t}});var lh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,dt=(s,t,e,i)=>{for(var a=i>1?void 0:i?hh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&lh(t,e,a),a};let st=class extends Y{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id
|
|
1131
|
+
*/const Ka="important",rh=" !"+Ka,oh=Te(class extends Ye{constructor(s){var t;if(super(s),s.type!==Kt.ATTRIBUTE||s.name!=="style"||((t=s.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce(((t,e)=>{const i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(s,[t]){const{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(const i in t){const a=t[i];if(a!=null){this.ft.add(i);const n=typeof a=="string"&&a.endsWith(rh);i.includes("-")||n?e.setProperty(i,n?a.slice(0,-11):a,n?Ka:""):e[i]=a}}return $t}});var lh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,dt=(s,t,e,i)=>{for(var a=i>1?void 0:i?hh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&lh(t,e,a),a};let st=class extends Y{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=ke(),this.role="progressbar",this.skin="dark-blue",this.statusPlacement="following",this.statusType="none",this.title="",this.titlePosition="left",this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.computedAriaLabelledby=null,this.computedAriaValueText="",this.labelRef=T(),this.progressBarRef=T()}firstUpdated(s){super.firstUpdated(s),this.setComputedValues(),this.syncAttributes()}updated(s){super.updated(s),s.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),s.has("id")&&this.id&&(this.progressBarId=this.id),(s.has("statusType")||s.has("id")||s.has("ariaLabelledby"))&&(this.progressbarId=this.id||ke(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(s.has("ariaValueText")||s.has("valueCurrent")||s.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const s=this.statusType!=="none",t=this.valueMax-this.valueMin,e=this.valueCurrent/t*100,i=this.statusType==="fraction"?Math.round(e):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),a=`${this.valueCurrent} av ${t}`,n=P({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),r=P({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),h=P({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),d=P({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return u` <div
|
|
1132
1132
|
class="pkt-progressbar__container"
|
|
1133
1133
|
.ref=${this.progressBarRef}
|
|
1134
1134
|
style=${oh({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${i}%`})}
|
|
@@ -1144,7 +1144,7 @@
|
|
|
1144
1144
|
${this.statusType==="percentage"?`${i}%`:a}
|
|
1145
1145
|
</span>
|
|
1146
1146
|
</div>`:$}
|
|
1147
|
-
</div>`}setComputedValues(){this.progressbarId=this.id
|
|
1147
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||ke(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""}syncAttributes(){this._handleAttribute("aria-live",this.ariaLive),this._handleAttribute("aria-valuenow",this.valueCurrent),this._handleAttribute("aria-valuemin",this.valueMin),this._handleAttribute("aria-valuemax",this.valueMax),this._handleAttribute("aria-valuetext",this.computedAriaValueText),this._handleAttribute("aria-label",this.ariaLabel),this._handleAttribute("role",this.role),this._handleAttribute("aria-atomic","true"),this._handleAttribute("id",this.progressbarId),this.ariaLabel||this._handleAttribute("aria-labelledby",this.computedAriaLabelledby)}_handleAttribute(s,t){t==null||t===""?this.removeAttribute(s):this.setAttribute(s,String(t))}};dt([o({type:String})],st.prototype,"ariaLabel",2),dt([o({type:String,reflect:!0})],st.prototype,"ariaLabelledby",2),dt([o({type:String,reflect:!0})],st.prototype,"ariaValueText",2),dt([o({type:String})],st.prototype,"ariaLive",2),dt([o({type:String,reflect:!0})],st.prototype,"id",2),dt([o({type:String})],st.prototype,"role",2),dt([o({type:String})],st.prototype,"skin",2),dt([o({type:String})],st.prototype,"statusPlacement",2),dt([o({type:String})],st.prototype,"statusType",2),dt([o({type:String,reflect:!0})],st.prototype,"title",2),dt([o({type:String})],st.prototype,"titlePosition",2),dt([o({type:Number,reflect:!0})],st.prototype,"valueCurrent",2),dt([o({type:Number})],st.prototype,"valueMax",2),dt([o({type:Number})],st.prototype,"valueMin",2),dt([B()],st.prototype,"labelWidth",2),dt([B()],st.prototype,"progressbarId",2),dt([B()],st.prototype,"computedAriaLabelledby",2),dt([B()],st.prototype,"computedAriaValueText",2),st=dt([V("pkt-progressbar")],st);var dh=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,Lt=(s,t,e,i)=>{for(var a=i>1?void 0:i?ch(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&dh(t,e,a),a};let Ct=class extends D{constructor(){super(...arguments),this.inputRef=T(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(s,t,e){s==="defaultChecked"&&(this._checked=this.defaultChecked),s==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(s,t,e)}render(){const s=P({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=P({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),e=P({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),i="pkt-tag pkt-tag--small pkt-tag--thin-text",a=()=>u`
|
|
1148
1148
|
${this.tagText?u`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:$}
|
|
1149
1149
|
${this.optionalTag?u`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:$}
|
|
1150
1150
|
${this.requiredTag?u`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:$}
|
|
@@ -1174,7 +1174,7 @@
|
|
|
1174
1174
|
${n()}
|
|
1175
1175
|
</div>
|
|
1176
1176
|
</div>
|
|
1177
|
-
`}toggleChecked(s=null){s&&s.preventDefault(),s&&s.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};Lt([o({type:String,reflect:!0})],Ct.prototype,"value",2),Lt([o({type:String})],Ct.prototype,"checkHelptext",2),Lt([o({type:Boolean})],Ct.prototype,"defaultChecked",2),Lt([o({type:Boolean})],Ct.prototype,"hasTile",2),Lt([o({type:Boolean,reflect:!0})],Ct.prototype,"checked",2),Lt([o({type:String,reflect:!0})],Ct.prototype,"type",2),Lt([o({type:String})],Ct.prototype,"tagText",2),Lt([o({type:Boolean})],Ct.prototype,"optionalTag",2),Lt([o({type:String})],Ct.prototype,"optionalText",2),Lt([o({type:Boolean})],Ct.prototype,"requiredTag",2),Lt([o({type:String})],Ct.prototype,"requiredText",2),Lt([B()],Ct.prototype,"_checked",2),Ct=Lt([
|
|
1177
|
+
`}toggleChecked(s=null){s&&s.preventDefault(),s&&s.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};Lt([o({type:String,reflect:!0})],Ct.prototype,"value",2),Lt([o({type:String})],Ct.prototype,"checkHelptext",2),Lt([o({type:Boolean})],Ct.prototype,"defaultChecked",2),Lt([o({type:Boolean})],Ct.prototype,"hasTile",2),Lt([o({type:Boolean,reflect:!0})],Ct.prototype,"checked",2),Lt([o({type:String,reflect:!0})],Ct.prototype,"type",2),Lt([o({type:String})],Ct.prototype,"tagText",2),Lt([o({type:Boolean})],Ct.prototype,"optionalTag",2),Lt([o({type:String})],Ct.prototype,"optionalText",2),Lt([o({type:Boolean})],Ct.prototype,"requiredTag",2),Lt([o({type:String})],Ct.prototype,"requiredText",2),Lt([B()],Ct.prototype,"_checked",2),Ct=Lt([V("pkt-radiobutton")],Ct);/**
|
|
1178
1178
|
* @license
|
|
1179
1179
|
* Copyright 2021 Google LLC
|
|
1180
1180
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1206,7 +1206,7 @@
|
|
|
1206
1206
|
<div class="pkt-tabs">
|
|
1207
1207
|
<div class="pkt-tabs__list" role=${t} ${A(this.defaultSlot)}></div>
|
|
1208
1208
|
</div>
|
|
1209
|
-
`}};ns([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],je.prototype,"arrowNav",2),ns([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],je.prototype,"disableArrowNav",2),ns([B()],je.prototype,"tabRefs",2),ns([B()],je.prototype,"tabCount",2),ns([fh({context:Xa}),B()],je.prototype,"context",2),je=ns([
|
|
1209
|
+
`}};ns([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],je.prototype,"arrowNav",2),ns([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],je.prototype,"disableArrowNav",2),ns([B()],je.prototype,"tabRefs",2),ns([B()],je.prototype,"tabCount",2),ns([fh({context:Xa}),B()],je.prototype,"context",2),je=ns([V("pkt-tabs")],je);var bh=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,de=(s,t,e,i)=>{for(var a=i>1?void 0:i?yh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&bh(t,e,a),a};let ie=class extends Y{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=T(),this.defaultSlot=T(),this.slotController=new at(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index)})}handleClick(){this.context&&this.context.handleClick(this.index)}handleKeyUp(t){this.context&&this.context.handleKeyUp(t,this.index)}render(){var t;const e=((t=this.context)==null?void 0:t.useArrowNav)??!0,i=this.active?"active":"",a=e?"tab":void 0,n=e?this.active:void 0,r=this.active||!e?void 0:-1,h=u`
|
|
1210
1210
|
${this.icon?u`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
|
|
1211
1211
|
<span ${A(this.defaultSlot)}></span>
|
|
1212
1212
|
${this.tag?u`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
|
|
@@ -1238,7 +1238,7 @@
|
|
|
1238
1238
|
>
|
|
1239
1239
|
${h}
|
|
1240
1240
|
</button>
|
|
1241
|
-
`}};
|
|
1241
|
+
`}};de([o({type:Boolean,reflect:!0})],ie.prototype,"active",2),de([o({type:String,reflect:!0})],ie.prototype,"href",2),de([o({type:String,reflect:!0})],ie.prototype,"icon",2),de([o({type:String,reflect:!0})],ie.prototype,"controls",2),de([o({type:String,reflect:!0})],ie.prototype,"tag",2),de([o({type:String,reflect:!0,attribute:"tag-skin"})],ie.prototype,"tagSkin",2),de([o({type:Number,reflect:!0})],ie.prototype,"index",2),de([gh({context:Xa,subscribe:!0}),o({attribute:!1})],ie.prototype,"context",2),ie=de([V("pkt-tab-item")],ie);/**
|
|
1242
1242
|
* @license
|
|
1243
1243
|
* Copyright 2020 Google LLC
|
|
1244
1244
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1287,7 +1287,7 @@
|
|
|
1287
1287
|
@focus=${i=>{this.onFocus(),i.stopImmediatePropagation()}}
|
|
1288
1288
|
@blur=${i=>{this.value=i.target.value,this.onBlur(),i.stopImmediatePropagation()}}
|
|
1289
1289
|
></textarea>
|
|
1290
|
-
</pkt-input-wrapper>`}};Ds([o({type:String,reflect:!0})],rs.prototype,"value",2),Ds([o({type:String})],rs.prototype,"autocomplete",2),Ds([o({type:Number})],rs.prototype,"rows",2),Ds([B()],rs.prototype,"counterCurrent",2),rs=Ds([
|
|
1290
|
+
</pkt-input-wrapper>`}};Ds([o({type:String,reflect:!0})],rs.prototype,"value",2),Ds([o({type:String})],rs.prototype,"autocomplete",2),Ds([o({type:Number})],rs.prototype,"rows",2),Ds([B()],rs.prototype,"counterCurrent",2),rs=Ds([V("pkt-textarea")],rs);var wh=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,ae=(s,t,e,i)=>{for(var a=i>1?void 0:i?xh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&wh(t,e,a),a};let Xt=class extends D{constructor(){super(),this.inputRef=T(),this.helptextSlot=T(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new at(this,this.helptextSlot)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}updated(t){var e;super.updated(t),t.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const t=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,e=P({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),i=this.ariaLabelledby||`${this.id}-input-label`;return u`
|
|
1291
1291
|
<pkt-input-wrapper
|
|
1292
1292
|
label="${this.label}"
|
|
1293
1293
|
?counter=${this.counter}
|
|
@@ -1356,7 +1356,7 @@
|
|
|
1356
1356
|
${!this.suffix&&t?u`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:$}
|
|
1357
1357
|
</div>
|
|
1358
1358
|
</pkt-input-wrapper>
|
|
1359
|
-
`}};ae([o({type:String,reflect:!0})],Xt.prototype,"value",2),ae([o({type:String})],Xt.prototype,"type",2),ae([o({type:Number})],Xt.prototype,"size",2),ae([o({type:String})],Xt.prototype,"autocomplete",2),ae([o({type:String})],Xt.prototype,"iconNameRight",2),ae([o({type:String})],Xt.prototype,"prefix",2),ae([o({type:String})],Xt.prototype,"suffix",2),ae([o({type:Boolean})],Xt.prototype,"omitSearchIcon",2),ae([B()],Xt.prototype,"counterCurrent",2),Xt=ae([
|
|
1359
|
+
`}};ae([o({type:String,reflect:!0})],Xt.prototype,"value",2),ae([o({type:String})],Xt.prototype,"type",2),ae([o({type:Number})],Xt.prototype,"size",2),ae([o({type:String})],Xt.prototype,"autocomplete",2),ae([o({type:String})],Xt.prototype,"iconNameRight",2),ae([o({type:String})],Xt.prototype,"prefix",2),ae([o({type:String})],Xt.prototype,"suffix",2),ae([o({type:Boolean})],Xt.prototype,"omitSearchIcon",2),ae([B()],Xt.prototype,"counterCurrent",2),Xt=ae([V("pkt-textinput")],Xt);var Sh=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,ri=(s,t,e,i)=>{for(var a=i>1?void 0:i?Ch(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Sh(t,e,a),a};let Is=class extends D{constructor(){super(),this.inputRef=T(),this.helptextSlot=T(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new Wa(this),this.slotController=new at(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(i=>{const a={value:i.hasAttribute("value")?i.getAttribute("value")??"":i.textContent??"",label:i.textContent||i.getAttribute("value")||"",disabled:i.hasAttribute("disabled"),selected:i.hasAttribute("selected"),hidden:i.hasAttribute("data-hidden")};i.getAttribute("selected")&&!this.value&&(this.value=a.value),this._options.push(a)}):(this._options=this._optionsProp,this._options.forEach(i=>{i.selected&&!this.value&&(this.value=i.value)}))}add(t,e){const i={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(i);else if(typeof e=="number")this._options.splice(e,0,i);else{const a=e.value||e.text,n=this._options.findIndex(r=>r.value===a);n>=0?this._options.splice(n,0,i):this._options.push(i)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(a=>a.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,i){var a,n;t==="options"&&(this._options=i?JSON.parse(i):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((a=this.inputRef.value)==null?void 0:a.selectedIndex):this._options.findIndex(r=>r.value===i),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.selectedOptions,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}update(t){var e,i;super.update(t),t.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(a=>a.value===this.value),this.selectedOptions=(i=this.inputRef.value)==null?void 0:i.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return u`
|
|
1360
1360
|
<pkt-input-wrapper
|
|
1361
1361
|
?counter=${this.counter}
|
|
1362
1362
|
?disabled=${this.disabled}
|
|
@@ -1404,7 +1404,7 @@
|
|
|
1404
1404
|
</select>
|
|
1405
1405
|
<div class="pkt-contents" ${A(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1406
1406
|
</pkt-input-wrapper>
|
|
1407
|
-
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};ri([o({type:Array,attribute:"options"})],Is.prototype,"_optionsProp",2),ri([o({type:String})],Is.prototype,"value",2),ri([B()],Is.prototype,"_options",2),Is=ri([
|
|
1407
|
+
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};ri([o({type:Array,attribute:"options"})],Is.prototype,"_optionsProp",2),ri([o({type:String})],Is.prototype,"value",2),ri([B()],Is.prototype,"_options",2),Is=ri([V("pkt-select")],Is);var Th=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,Ls=(s,t,e,i)=>{for(var a=i>1?void 0:i?Nh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Th(t,e,a),a};let os=class extends Y{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=T(),this.namedSlot=T(),this.slotController=new at(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(s=>{this._list.push(s.toUpperCase())}),super.connectedCallback()}render(){const s={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return u`
|
|
1408
1408
|
<div class="${P(s)}">
|
|
1409
1409
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
1410
1410
|
|
|
@@ -1425,15 +1425,15 @@
|
|
|
1425
1425
|
|
|
1426
1426
|
<h2 class="pkt-txt-22">Knapp som emitter en event</h2>
|
|
1427
1427
|
<button type="button" @click=${()=>this.handleGreeting()}>
|
|
1428
|
-
Si ${
|
|
1428
|
+
Si ${bt.example.hi}
|
|
1429
1429
|
</button>
|
|
1430
1430
|
</div>
|
|
1431
1431
|
`}renderList(s){return u`
|
|
1432
1432
|
<ul>
|
|
1433
1433
|
${s.map(t=>u`<li>${t}</li>`)}
|
|
1434
1434
|
</ul>
|
|
1435
|
-
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Ls([o({type:String})],os.prototype,"string",2),Ls([o({converter:Ha})],os.prototype,"strings",2),Ls([o({type:Boolean})],os.prototype,"darkmode",2),Ls([o({type:Array})],os.prototype,"_list",2),os=Ls([
|
|
1435
|
+
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Ls([o({type:String})],os.prototype,"string",2),Ls([o({converter:Ha})],os.prototype,"strings",2),Ls([o({type:Boolean})],os.prototype,"darkmode",2),Ls([o({type:Array})],os.prototype,"_list",2),os=Ls([V("pkt-component")],os);const F=Nt({tagName:"pkt-icon",elementClass:Ae,react:x,displayName:"PktIcon",events:{}}),Ja=x.forwardRef(({defaultOpen:s=!1,id:t,title:e,skin:i,compact:a=!1,isOpen:n,children:r,name:h,className:d,onClick:p,onToggle:g},m)=>{const[k,b]=x.useState(s),{name:y}=On(),w=h||y,C=n!==void 0?n:k;x.useEffect(()=>{n===void 0&&b(s)},[s,n]);const M=E=>{const J=E.currentTarget.open;n===void 0&&b(J),g==null||g(E)},N=E=>{setTimeout(()=>{p==null||p(E)},0)},U=["pkt-accordion-item",a&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,d].filter(Boolean).join(" ");return l.jsxs("details",{ref:m,className:U,id:t,open:C,onClick:N,name:w,onToggle:M,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(F,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),l.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${t}`,role:"region",children:l.jsx("div",{className:"pkt-accordion-item__content-inner",children:r})})]})});Ja.displayName="PktAccordionItem";function Ah(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Di={exports:{}};/*!
|
|
1436
1436
|
Copyright (c) 2018 Jed Watson.
|
|
1437
1437
|
Licensed under the MIT License (MIT), see
|
|
1438
1438
|
http://jedwatson.github.io/classnames
|
|
1439
|
-
*/var Qa;function Eh(){return Qa||(Qa=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var n="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(n=a(n,i(h)))}return n}function i(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return e.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var h in n)t.call(n,h)&&n[h]&&(r=a(r,h));return r}function a(n,r){return r?n?n+" "+r:n+r:n}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(Di)),Di.exports}var Ph=Eh();const Tt=Ah(Ph),Ii=({children:s,closeAlert:t,compact:e,title:i,date:a,ariaLive:n,"aria-live":r="polite",role:h="status",skin:d="info",...p})=>{const[m,g]=x.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":m},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!a},y=x.useCallback(()=>{g(!0),p.onClose&&p.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[p.onClose,g]),w=n||r;return l.jsx("div",{...p,"aria-live":w,role:h,className:Tt(k),children:l.jsxs("div",{className:Tt(b),children:[l.jsx(j,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(He,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:y,children:l.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&l.jsx("div",{className:"pkt-alert__title",children:i}),l.jsx("div",{className:"pkt-alert__text",children:s}),a&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",a]})]})})};Ii.displayName="PktAlert";const tn=kt({tagName:"pkt-backlink",elementClass:Je,react:x,displayName:"PktBackLink"});tn.displayName="PktBackLink";const Oh=x.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},a)=>{const n=s,r=n[n.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:n.map((d,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===n.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?l.jsxs(zi.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(j,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):l.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(j,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(zi.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(j,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(j,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.12/animations/";const He=x.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",size:a="medium",skin:n="primary",type:r="button",variant:h="label-only",state:d,color:p,isLoading:m=void 0,disabled:g=void 0,loadingAnimationPath:k=window.pktAnimationPath,...b},y)=>{const w=[t,"pkt-btn",a&&`pkt-btn--${a}`,n&&`pkt-btn--${n}`,h&&`pkt-btn--${h}`,p&&`pkt-btn--${p}`,d&&`pkt-btn--${d}`,m&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...b,"aria-busy":m||void 0,"aria-disabled":g||void 0,disabled:g,className:w,type:r,ref:y,children:[m&&l.jsx(j,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:k}),h!=="label-only"&&l.jsx(j,{className:"pkt-btn__icon",name:e}),l.jsx("span",{className:"pkt-btn__text",children:s}),h==="icons-right-and-left"&&l.jsx(j,{className:"pkt-btn__icon",name:i})]})});He.displayName="PktButton";const Mh=kt({tagName:"pkt-card",elementClass:lt,react:x,displayName:"PktCard",events:{}}),en=x.forwardRef(({children:s,...t},e)=>l.jsx(Mh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));en.displayName="PktCard";const sn=x.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:a,hasError:n=!1,className:r,isSwitch:h=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:m,checked:g,optionalTag:k,optionalText:b="Valgfritt",requiredTag:y,requiredText:w="Må fylles ut",tagText:C,...M},N)=>{const U=[r,"pkt-input-check"].filter(Boolean).join(" "),E=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),G=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),J=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Bt=()=>l.jsxs(l.Fragment,{children:[C&&l.jsx("span",{className:J+" pkt-tag--gray",children:C}),k&&l.jsx("span",{className:J+" pkt-tag--blue-light",children:b}),y&&l.jsx("span",{className:J+" pkt-tag--beige",children:w})]});return l.jsx("div",{className:U,children:l.jsxs("div",{className:G,children:[p==="left"&&l.jsxs("label",{className:E,htmlFor:s,children:[i," ",Bt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:N,className:`pkt-input-check__input-checkbox ${n?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...g!==void 0?{checked:g}:{defaultChecked:m},...M}),p==="right"&&l.jsxs("label",{className:E,htmlFor:s,children:[i," ",Bt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});sn.displayName="PktCheckbox";const Dh=kt({tagName:"pkt-combobox",elementClass:Q,react:x,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),an=x.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Dh,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));an.displayName="PktCombobox";const oi=kt({tagName:"pkt-consent",elementClass:zt,react:x,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});oi.displayName="PktConsent";const Ih=kt({tagName:"pkt-datepicker",elementClass:et,react:x,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),nn=x.forwardRef(({helptext:s,...t},e)=>l.jsx(Ih,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));nn.displayName="PktDatepicker";const Lh=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:a=!1,personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:g=null,cookieSecure:k=null,cookieExpiryDays:b=null,onToggleConsent:y=w=>{console.log(w.detail)}})=>{var C,M;const w=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:w,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:s.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&l.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((N,U)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${N.external?"pkt-link--external":""}`,href:N.href,target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(j,{className:"pkt-footer__link-icon",name:"chevron-right"}),N.text]})},`links-${U}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:t.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&l.jsx("li",{className:"pkt-footer__text",children:t.text}),(M=t.links)==null?void 0:M.map((N,U)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${N.external?"pkt-link--external":""}`,href:N.href,target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(j,{className:"pkt-footer__link-icon",name:"chevron-right"}),N.text]})},`links-${U}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),l.jsxs("ul",{className:"pkt-footer__list",children:[l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:n,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(j,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:r,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(j,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(oi,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:g,cookieSecure:k,cookieExpiryDays:b,onToggleConsent:y})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(N=>N.language).map((N,U)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:N.href,"aria-label":`til ${N.language} versjon av nettsiden`,target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:N.language})},`sociallinks-language-${U}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(N=>N.iconName).map((N,U)=>l.jsx(x.Fragment,{children:l.jsx("a",{href:N.href,"aria-label":`til ${N.iconName}`,className:"pkt-footer__social-icon-link",target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:l.jsx(j,{className:"pkt-footer__social-icon",name:N.iconName})})},`sociallinks-${U}`))})]})]})})},Bh=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:a=!1,hotjarId:n=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:g=b=>{console.log(b.detail)},className:k})=>{const b=[k,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((y,w)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${y.external?" pkt-link--external":""}`,href:y.href,target:y.openInNewTab||t?"_blank":"_self",rel:y.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(j,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),y.text]})},w)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:e,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(j,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(j,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),a&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(oi,{triggerType:"footerlink",hotjarId:n,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:g})})]})})})},Fh=x.forwardRef(({className:s,logoLink:t="https://www.oslo.kommune.no/",serviceName:e,fixed:i=!0,scrollToHide:a=!0,user:n,userMenu:r,representing:h,userOptions:d,userMenuFooter:p,canChangeRepresentation:m=!0,showMenuButton:g=!1,showLogOutButton:k=!1,openMenu:b,logOut:y,changeRepresentation:w,children:C,...M},N)=>{const U=x.useMemo(()=>typeof(n==null?void 0:n.lastLoggedIn)=="string"?n.lastLoggedIn:n!=null&&n.lastLoggedIn?new Date(n.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[n]),[E,G]=x.useState(!1),[J,Bt]=x.useState(0),[Ft,it]=x.useState(!1),rt=x.useRef(null);x.useEffect(()=>(document&&(document.addEventListener("mouseup",jt),window.addEventListener("scroll",ot)),()=>{document&&(document.removeEventListener("mouseup",jt),window.removeEventListener("scroll",ot))}));const Vt=()=>{it(!Ft)},jt=L=>{rt.current&&!rt.current.contains(L.target)&&it(!1)},ot=()=>{if(a){const L=window.pageYOffset||document.documentElement.scrollTop;if(L<0||Math.abs(L-J)<60)return;G(L>J),Bt(L)}};return l.jsxs("header",{...M,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:Tt(s,"pkt-header",{"pkt-header--fixed":i,"pkt-header--scroll-to-hide":a,"pkt-header--hidden":E}),ref:N,children:[l.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?l.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:l.jsx(j,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.12/logos/"})}):l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:l.jsx(j,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.12/logos/"})}),l.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:e})]}),l.jsx("nav",{className:"pkt-header__actions",children:l.jsxs("ul",{className:"pkt-header__actions-row",children:[g&&l.jsx("li",{children:l.jsx(He,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(n||h)&&l.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Ft&&!E?"pkt-header--open-dropdown":""}`,ref:rt,children:[l.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":Ft,onClick:Vt,children:[l.jsx(j,{name:"user",className:"pkt-btn__icon"}),l.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(h==null?void 0:h.name)||(n==null?void 0:n.name)}),l.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(h==null?void 0:h.shortname)||(n==null?void 0:n.shortname)}),l.jsx(j,{name:"chevron-thin-down",className:"pkt-btn--closed"}),l.jsx(j,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),l.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[n&&l.jsxs("li",{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:n.name}),n.lastLoggedIn&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:U})]})]}),r&&l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:r.map((L,Nt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsxs("a",{href:L.target,className:"pkt-link",children:[L.iconName&&l.jsx(j,{name:L.iconName,className:"pkt-link__icon"}),L.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:[L.iconName&&l.jsx(j,{name:L.iconName,className:"pkt-link__icon"}),L.title]})},`userMenu-${Nt}`))})}),(h||m)&&l.jsxs("li",{children:[h&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",h.orgNumber]})]}),l.jsx("ul",{className:"pkt-list mt-size-16",children:m&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:w,children:[l.jsx(j,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:(d||!k)&&l.jsxs(l.Fragment,{children:[d==null?void 0:d.map((L,Nt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsxs("a",{href:L.target,className:"pkt-link",children:[L.iconName&&l.jsx(j,{name:L.iconName,className:"pkt-link__icon"}),L.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:[L.iconName&&l.jsx(j,{name:L.iconName,className:"pkt-link__icon"}),L.title]})},`userOptions-${Nt}`)),!k&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:y,children:[l.jsx(j,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),p&&l.jsx("li",{className:"footer",children:l.jsx("ul",{className:"pkt-list-horizontal bordered",children:p.map((L,Nt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsx("a",{href:L.target,className:"pkt-link",children:L.title}):l.jsx("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:L.title})},`userMenuFooter-${Nt}`))})})]})]}),C&&l.jsx("li",{children:C}),k&&l.jsx("li",{children:l.jsx(He,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:y,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),Vh=kt({tagName:"pkt-heading",elementClass:De,react:x,displayName:"PktHeading"}),rn=x.forwardRef(({children:s,...t},e)=>l.jsx(Vh,{"data-testid":"pkt-heading",...t,ref:e,children:s}));rn.displayName="PktHeading";const jh=kt({tagName:"pkt-helptext",elementClass:le,react:x,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),on=x.forwardRef(({children:s,...t},e)=>l.jsx(jh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));on.displayName="PktHelptext";const ln=x.forwardRef(({label:s,id:t,children:e,...i},a)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:t,...i,ref:a}),e]}));ln.displayName="PktInput";const Bs=x.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:a,counter:n,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:g="Må fylles ut",tagText:k=null,hasError:b=!1,errorMessage:y,disabled:w=!1,inline:C=!1,ariaDescribedby:M,useWrapper:N=!0,children:U,className:E="",hasFieldset:G=!1,role:J="group",counterPosition:Bt="bottom"},Ft)=>{const[it,rt]=x.useState(!1),Vt=M||(e?`${s}-helptext`:void 0),jt=!!n,ot=jt&&Bt==="top",L=jt&&Bt==="bottom",Nt=()=>rt(ct=>!ct),ne=["pkt-inputwrapper",E,b?"pkt-inputwrapper--error":"",w?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),pe=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),re=()=>jt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,Ue=()=>l.jsxs(l.Fragment,{children:[k&&l.jsx("span",{className:pe+" pkt-tag--gray",children:k}),d&&l.jsx("span",{className:pe+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:pe+" pkt-tag--beige",children:g})]}),ds=()=>{const ct=l.jsxs(l.Fragment,{children:[t," ",Ue()]});return N?G?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ct}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Vt,id:`${s}-label`,children:ct}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Vt,id:`${s}-label`,children:t})},ue=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&N&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(He,{skin:"tertiary",size:"small",variant:"icon-right",iconName:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Nt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:a??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${it?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Rt=l.jsxs(l.Fragment,{children:[ds(),ue(),ot&&l.jsx(re,{}),U,L&&l.jsx(re,{}),b&&y&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(Ii,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:y})})]});return l.jsx("div",{className:ne,ref:Ft,role:J,children:G?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Vt,children:Rt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Rt})})});Bs.displayName="PktInputWrapper";const Hh=kt({tagName:"pkt-link",elementClass:_e,react:x,displayName:"PktLink"}),hn=x.forwardRef(({children:s,...t},e)=>l.jsx(Hh,{...t,ref:e,children:l.jsx("span",{className:"pkt-contents",children:s})}));hn.displayName="PktLink";const Uh=kt({tagName:"pkt-linkcard",elementClass:he,react:x,displayName:"PktLinkCard",events:{}}),dn=x.forwardRef(({children:s,...t},e)=>l.jsx(Uh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));dn.displayName="PktLinkCard";const qh=kt({tagName:"pkt-loader",elementClass:Yt,react:x,displayName:"PktLoader",events:{}}),cn=x.forwardRef(({children:s,...t},e)=>l.jsx(qh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));cn.displayName="PktLoader";const pn=({children:s,className:t,skin:e,title:i,compact:a,closable:n,onClose:r,...h})=>{const[d,p]=x.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":a,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":n,"pkt-hide":d},g=x.createRef(),k=x.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:Tt(m,t),ref:g,children:[n&&l.jsx("div",{className:'"pkt-messagebox__close"',children:l.jsx("button",{onClick:k,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(j,{name:"close",className:"pkt-link__icon"})})}),l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};pn.displayName="PktMessagebox";const zh=kt({tagName:"pkt-modal",elementClass:It,react:x,displayName:"PktModal",events:{}}),un=x.forwardRef(({children:s,...t},e)=>l.jsx(zh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));un.displayName="PktModal";const Wh=kt({tagName:"pkt-progressbar",elementClass:st,react:x,displayName:"PktProgressbar",events:{}}),fn=x.forwardRef(({children:s,...t},e)=>l.jsx(Wh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));fn.displayName="PktProgressbar";const gn=x.forwardRef(({id:s,name:t,label:e,className:i,hasTile:a=!1,disabled:n=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:g,requiredTag:k,requiredText:b,tagText:y,...w},C)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),N=["pkt-input-check__input",a?"pkt-input-check__input--tile":"",n&&a?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),U=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),E=["pkt-input-check__input-label",n?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),G=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),J=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:G+" pkt-tag--gray",children:y}),m&&l.jsx("span",{className:G+" pkt-tag--blue-light",children:g}),k&&l.jsx("span",{className:G+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:M,children:l.jsxs("div",{className:N,children:[l.jsx("input",{ref:C,id:s,type:"radio",name:t,disabled:n,className:U,...p!==void 0?{checked:p}:{defaultChecked:d},...w}),l.jsxs("label",{className:E,htmlFor:s,children:[e," ",J(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});gn.displayName="PktRadioButton";const Rh=x.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:a,name:n,placeholder:r="Søk…",suggestions:h,value:d="",action:p,method:m,onChange:g,onSearch:k,onSuggestionClick:b,...y},w)=>{const C=(E,G)=>{E?E():b&&b(G)},M=E=>{d=E.target.value},N=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let U;return p?U=E=>l.jsx("form",{role:"search",className:N,action:p,method:m,children:E}):U=E=>l.jsx("div",{role:"search",className:N,children:E}),U(l.jsxs(l.Fragment,{children:[a&&l.jsx("label",{htmlFor:a?i:void 0,className:a?"pkt-inputwrapper__label":"",children:a}),l.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${e?"pkt-input--fullwidth":""}`,type:"search",name:n||i,id:i,placeholder:r,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:w,"aria-controls":`${i}-suggestions`,onChange:g||M,onKeyUp:k&&(E=>{E.key==="Enter"&&(E.preventDefault(),k(d))}),...y}),l.jsx(He,{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:t,onClick:k&&(E=>{E.preventDefault(),k(d)}),children:a||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((E,G)=>l.jsx("li",{children:x.createElement(E.href?"a":E.onClick?"button":"div",{href:E.href,className:`pkt-searchinput__suggestion ${E.onClick?"pkt-link-button":""} ${E.href||E.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:E.onClick?"button":void 0,onClick:()=>C(E.onClick,G),onKeyUp:J=>J.key==="Enter"&&C(E.onClick,G)},l.jsxs(l.Fragment,{children:[E.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:E.title}),E.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:E.text})]}))},`search-suggestion-${G}`))})]}))}),Kh=x.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:a=!1,errorMessage:n,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:g=!1,fullwidth:k=!1,label:b,name:y,optionalTag:w=!1,optionalText:C,requiredTag:M=!1,requiredText:N,tagText:U,...E},G)=>{const J=[i,"pkt-select"].join(" ");return l.jsx(Bs,{className:J,forId:`${m}-input`,label:b,helptext:h,helptextDropdown:d,helptextDropdownButton:p,optionalTag:w,optionalText:C,requiredTag:M,requiredText:N,tagText:U,hasError:r,errorMessage:n,disabled:a,inline:g,ariaDescribedby:s,children:l.jsx("select",{ref:G,className:`pkt-input ${k?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:a,id:`${m}-input`,name:y||m,...E,children:e})})}),Gh=l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:l.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),Yh=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),l.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),Zh=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),l.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"})]}),Xh=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:Tt("pkt-step",t,`pkt-step--${e}`),"data-testid":"pkt-step",children:[l.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),l.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),l.jsx("span",{className:Tt("pkt-step__indicator"),children:e==="current"?Yh:e==="completed"?Zh:Gh}),l.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),l.jsxs("div",{className:"pkt-step__wrapper",children:[l.jsx("div",{className:"pkt-step__title",children:i}),l.jsx("div",{className:"pkt-step__content",children:s})]})]}),Jh=x.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:a=!0,orientation:n="vertical",...r},h)=>{const d=Tt(t,"pkt-stepper",n==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=x.Children.map(e,(m,g)=>x.isValidElement(m)?x.cloneElement(m,{className:Tt(m.props.className,{"pkt-step--hideStep":i&&g!==s,"pkt-step--hideContent":a&&g!==s})}):m);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:p})}),Qh=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:a,...n})=>l.jsx("table",{"data-testid":"pkt-table",className:Tt(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...n,children:a}),td=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:Tt(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),ed=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:Tt(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),sd=({className:s,children:t,...e})=>l.jsx("thead",{className:Tt(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),id=({className:s,children:t,...e})=>l.jsx("th",{className:Tt(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),ad=({className:s,children:t,...e})=>l.jsx("tr",{className:Tt(s,"pkt-table__row",{}),role:"row",...e,children:t}),nd=kt({tagName:"pkt-tag",elementClass:qt,react:Pn,displayName:"PktTag",events:{onClose:"close"}}),Li=x.forwardRef(({children:s,...t},e)=>l.jsx(nd,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Li.displayName="PktTag";const Bi=x.forwardRef(({children:s,active:t,href:e,onClick:i,icon:a,controls:n,tag:r,tagSkin:h,index:d=0},p)=>{const{arrowNav:m,registerTabRef:g,handleKeyPress:k,selectTab:b}=rd(),w={"aria-selected":m?!!t:void 0,"aria-controls":n,role:m?"tab":void 0,onKeyUp:M=>k(d,M),onClick:M=>{b(d),i==null||i(M)},tabIndex:t||!m?void 0:-1,ref:M=>{g(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},C=l.jsxs(l.Fragment,{children:[a&&l.jsx(j,{name:a,className:"pkt-icon--small"}),s,r&&l.jsx(Li,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...w,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:C}):l.jsx("button",{...w,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:C})});Bi.displayName="PktTabItem";const mn=x.createContext(null),rd=()=>{const s=x.useContext(mn);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},od=x.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:a},n)=>{const r=x.useRef([]),h=s&&!t,p=a&&x.Children.count(a)>0?x.Children.count(a):(e==null?void 0:e.length)||0;x.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=y=>{const w=e==null?void 0:e[y];w!=null&&w.action&&w.action(y),i&&i(y)},g=(y,w)=>{var C,M;h&&(w.code==="ArrowLeft"&&y!==0&&((C=r.current[y-1])==null||C.focus()),w.code==="ArrowRight"&&y<p-1&&((M=r.current[y+1])==null||M.focus()),(w.code==="ArrowDown"||w.code==="Space")&&m(y))},k=(y,w)=>{r.current[y]=w},b=e==null?void 0:e.map((y,w)=>{var C,M;return l.jsx(Bi,{active:y.active,href:y.href,onClick:()=>m(w),icon:y.icon,controls:y.controls,tag:(C=y.tag)==null?void 0:C.text,tagSkin:(M=y.tag)==null?void 0:M.skin,index:w,children:y.text},w)});return l.jsx(mn.Provider,{value:{arrowNav:h,registerTabRef:k,handleKeyPress:g,selectTab:m},children:l.jsx("div",{className:"pkt-tabs",ref:n,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:a||b})})})}),ld=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:a,className:n,disabled:r,errorMessage:h,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:g,inline:k,fullwidth:b=!1,label:y,name:w,optionalTag:C=!1,optionalText:M,requiredTag:N=!1,requiredText:U,tagText:E=null,placeholder:G,rows:J,useWrapper:Bt=!0,onChange:Ft,value:it,autoComplete:rt="off",minLength:Vt,maxLength:jt,readOnly:ot=!1,skipForwardTestid:L=!1,...Nt},ne)=>{const pe=[n,"pkt-textinput","pkt-textarea"].join(" "),re=`${s}-input`,Ue=`${re}-label`,ds=e||Ue,[ue,Rt]=x.useState(0),ct=qe=>{var ze,fe;if(i&&Rt(((fe=(ze=qe.currentTarget)==null?void 0:ze.value)==null?void 0:fe.length)||0),Ft)return Ft(qe)};return x.useEffect(()=>{it!==void 0&&Rt((it==null?void 0:it.length)||0)},[it]),l.jsx(Bs,{ariaDescribedby:t,className:pe,disabled:r,errorMessage:h,forId:re,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:g,inline:k,label:y,optionalTag:C,optionalText:M,requiredTag:N,requiredText:U,tagText:E,useWrapper:Bt,counter:i,counterCurrent:ue,counterMaxLength:a,children:l.jsx("textarea",{ref:ne,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${a&&ue>a?"pkt-input--counter-error":""}`,name:`${w||s}`,id:re,placeholder:G,disabled:r,rows:J,"aria-labelledby":ds,"aria-invalid":d,"aria-errormessage":`${s}-error`,...Nt,onChange:ct,value:it,autoComplete:rt,minLength:Vt,maxLength:jt,"data-skip-forward-testid":L?"true":void 0})})}),hd=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:a,counterMaxLength:n,className:r,disabled:h=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:g,helptextDropdownButton:k,iconNameRight:b,inline:y=!1,fullwidth:w=!1,label:C,name:M,optionalTag:N=!1,optionalText:U,requiredTag:E=!1,requiredText:G,tagText:J=null,placeholder:Bt,prefix:Ft,suffix:it,type:rt="text",useWrapper:Vt=!0,omitSearchIcon:jt=!1,value:ot,minLength:L,maxLength:Nt,min:ne,max:pe,step:re,size:Ue,readonly:ds,required:ue,dataTestid:Rt,onChange:ct,skipForwardTestid:qe=!1,...ze},fe)=>{const Vi=[r,"pkt-textinput"].join(" "),li=rt==="search"&&!b&&!jt,ji=rt==="date"&&ot?ot.slice(0,10):ot,[hi,cs]=x.useState((ot==null?void 0:ot.length)||0),ps=`${s}`,Vs=`${ps}-label`,di=e||Vs,Hi=we=>{var ci,pi;a&&cs(((pi=(ci=we.currentTarget)==null?void 0:ci.value)==null?void 0:pi.length)||0),ct&&ct(we)};return x.useEffect(()=>{ot!==void 0&&cs((ot==null?void 0:ot.length)||0)},[ot]),l.jsx(Bs,{ariaDescribedby:t,className:Vi,disabled:h,errorMessage:d,forId:ps,hasError:p,helptext:m,helptextDropdown:g,helptextDropdownButton:k,inline:y,label:C,optionalTag:N,optionalText:U,requiredTag:E,requiredText:G,tagText:J,useWrapper:Vt,counter:a,counterCurrent:hi,counterMaxLength:n,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Rt,"data-skip-forward-testid":qe?"true":void 0,children:[Ft&&l.jsx("div",{className:"pkt-input-prefix",children:Ft}),l.jsx("input",{...ze,ref:fe,className:`pkt-input ${w?"pkt-input--fullwidth":""} ${n&&hi>n?"pkt-input--counter-error":""}`,type:rt,name:`${M||s}`,value:ji,id:ps,placeholder:Bt,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":di,min:ne,max:pe,onChange:Hi,step:re,minLength:L,maxLength:Nt,size:Ue,required:ue}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(j,{className:"pkt-input-suffix-icon",name:b}),li&&l.jsx(j,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(j,{className:"pkt-input-icon",name:b}),!it&&li&&l.jsx(j,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});var ls=window.CustomEvent;(!ls||typeof ls=="object")&&(ls=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ls.prototype=window.Event.prototype);function vn(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function dd(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,a){return!(t[i]===void 0||t[i]===a)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function Fs(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 bn(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function cd(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function Fi(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function yn(s){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(e.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var a=s.querySelectorAll("*"),n=0;n<a.length&&!(a[n].tagName&&a[n].shadowRoot&&(i=yn(a[n].shadowRoot),i));n++);return i}function kn(s){return s.isConnected||document.body.contains(s)}function $n(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=z.formSubmitter;if(!e){var i=s.target,a="getRootNode"in i&&i.getRootNode()||document;e=a.activeElement}return!e||e.form!==t?null:e}function pd(s){if(!s.defaultPrevented){var t=s.target,e=z.imagemapUseValue,i=$n(s);e===null&&i&&(e=i.value);var a=Fs(t);if(a){var n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&(s.preventDefault(),e!=null?a.close(e):a.close())}}}function _n(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",pd,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,i=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),a,n=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(a),a=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,n)})}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))}_n.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&kn(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_),z.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 t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var e=document.createEvent("MouseEvents");e.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(e),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=yn(this.dialog_)),bn(document.activeElement),s&&s.focus()},updateZIndex:function(s,t){if(s<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=t},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(!kn(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!z.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");dd(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,z.needsCentering(this.dialog_)?(z.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 t=new ls("close",{bubbles:!1,cancelable:!1});vn(this.dialog_,t)}};var z={};if(z.reposition=function(s){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(t,e)+"px"},z.isInlinePositionSetByStylesheet=function(s){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],i=null;try{i=e.cssRules}catch{}if(i)for(var a=0;a<i.length;++a){var n=i[a],r=null;try{r=document.querySelectorAll(n.selectorText)}catch{}if(!(!r||!cd(r,s))){var h=n.style.getPropertyValue("top"),d=n.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},z.needsCentering=function(s){var t=window.getComputedStyle(s);return t.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!z.isInlinePositionSetByStylesheet(s)},z.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 _n(s)},z.registerDialog=function(s){s.showModal||z.forceRegisterDialog(s)},z.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(t){this.forwardTab_=void 0,t.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(t){var e=[];t.forEach(function(i){for(var a=0,n;n=i.removedNodes[a];++a){if(n instanceof Element)n.localName==="dialog"&&e.push(n);else continue;e=e.concat(n.querySelectorAll("dialog"))}}),e.length&&s(e)}))},z.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})},z.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},z.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--s,--s),t===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var a=i.dialog.parentNode||document.body;a.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},z.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Fs(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},z.DialogManager.prototype.handleFocus_=function(s){var t=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),bn(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,a=i.compareDocumentPosition(t);return a&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},z.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new ls("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&vn(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},z.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},z.DialogManager.prototype.pushDialog=function(s){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},z.DialogManager.prototype.removeDialog=function(s){var t=this.pendingDialogStack.indexOf(s);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},z.dm=new z.DialogManager,z.formSubmitter=null,z.imagemapUseValue=null,window.HTMLDialogElement===void 0){var wn=document.createElement("form");if(wn.setAttribute("method","dialog"),wn.method!=="dialog"){var hs=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(hs){var ud=hs.get;hs.get=function(){return Fi(this)?"dialog":ud.call(this)};var fd=hs.set;hs.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):fd.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",hs)}}document.addEventListener("click",function(s){if(z.formSubmitter=null,z.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!Fi(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;z.imagemapUseValue=s.offsetX+","+s.offsetY}var a=Fs(t);a&&(z.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=Fs(t);if(!e){var i=$n(s),a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&s.preventDefault()}});var gd=HTMLFormElement.prototype.submit,md=function(){if(!Fi(this))return gd.call(this);var s=Fs(this);s&&s.close()};HTMLFormElement.prototype.submit=md}const vd=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));O.PktAccordion=Ri,O.PktAccordionItem=Ja,O.PktAlert=Ii,O.PktBackLink=tn,O.PktBreadcrumbs=Oh,O.PktButton=He,O.PktCard=en,O.PktCheckbox=sn,O.PktCombobox=an,O.PktConsent=oi,O.PktDatepicker=nn,O.PktFooter=Lh,O.PktFooterSimple=Bh,O.PktHeader=Fh,O.PktHeading=rn,O.PktHelptext=on,O.PktIcon=j,O.PktInput=ln,O.PktInputWrapper=Bs,O.PktLink=hn,O.PktLinkCard=dn,O.PktLoader=cn,O.PktMessagebox=pn,O.PktModal=un,O.PktProgressbar=fn,O.PktRadioButton=gn,O.PktSearchInput=Rh,O.PktSelect=Kh,O.PktStep=Xh,O.PktStepper=Jh,O.PktTabItem=Bi,O.PktTable=Qh,O.PktTableBody=td,O.PktTableDataCell=ed,O.PktTableHeader=sd,O.PktTableHeaderCell=id,O.PktTableRow=ad,O.PktTabs=od,O.PktTag=Li,O.PktTextarea=ld,O.PktTextinput=hd,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})}));
|
|
1439
|
+
*/var Qa;function Eh(){return Qa||(Qa=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var n="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(n=a(n,i(h)))}return n}function i(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return e.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var h in n)t.call(n,h)&&n[h]&&(r=a(r,h));return r}function a(n,r){return r?n?n+" "+r:n+r:n}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(Di)),Di.exports}var Ph=Eh();const vt=Ah(Ph),Ii=({children:s,closeAlert:t,compact:e,title:i,date:a,ariaLive:n,"aria-live":r="polite",role:h="status",skin:d="info",...p})=>{const[g,m]=x.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":g},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!a},y=x.useCallback(()=>{m(!0),p.onClose&&p.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[p.onClose,m]),w=n||r;return l.jsx("div",{...p,"aria-live":w,role:h,className:vt(k),children:l.jsxs("div",{className:vt(b),children:[l.jsx(F,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(He,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:y,children:l.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&l.jsx("div",{className:"pkt-alert__title",children:i}),l.jsx("div",{className:"pkt-alert__text",children:s}),a&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",a]})]})})};Ii.displayName="PktAlert";const tn=Nt({tagName:"pkt-backlink",elementClass:Je,react:x,displayName:"PktBackLink"});tn.displayName="PktBackLink";const Oh=x.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},a)=>{const n=s,r=n[n.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:n.map((d,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===n.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?l.jsxs(zi.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(F,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):l.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(F,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(zi.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(F,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(F,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.13/animations/";const He=x.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",size:a="medium",skin:n="primary",type:r="button",variant:h="label-only",state:d,color:p,isLoading:g=void 0,disabled:m=void 0,loadingAnimationPath:k=window.pktAnimationPath,...b},y)=>{const w=[t,"pkt-btn",a&&`pkt-btn--${a}`,n&&`pkt-btn--${n}`,h&&`pkt-btn--${h}`,p&&`pkt-btn--${p}`,d&&`pkt-btn--${d}`,g&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...b,"aria-busy":g||void 0,"aria-disabled":m||void 0,disabled:m,className:w,type:r,ref:y,children:[g&&l.jsx(F,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:k}),h!=="label-only"&&l.jsx(F,{className:"pkt-btn__icon",name:e}),l.jsx("span",{className:"pkt-btn__text",children:s}),h==="icons-right-and-left"&&l.jsx(F,{className:"pkt-btn__icon",name:i})]})});He.displayName="PktButton";const Mh=Nt({tagName:"pkt-card",elementClass:lt,react:x,displayName:"PktCard",events:{}}),en=x.forwardRef(({children:s,...t},e)=>l.jsx(Mh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));en.displayName="PktCard";const sn=x.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:a,hasError:n=!1,className:r,isSwitch:h=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:g,checked:m,optionalTag:k,optionalText:b="Valgfritt",requiredTag:y,requiredText:w="Må fylles ut",tagText:C,...M},N)=>{const U=[r,"pkt-input-check"].filter(Boolean).join(" "),E=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),G=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),J=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Bt=()=>l.jsxs(l.Fragment,{children:[C&&l.jsx("span",{className:J+" pkt-tag--gray",children:C}),k&&l.jsx("span",{className:J+" pkt-tag--blue-light",children:b}),y&&l.jsx("span",{className:J+" pkt-tag--beige",children:w})]});return l.jsx("div",{className:U,children:l.jsxs("div",{className:G,children:[p==="left"&&l.jsxs("label",{className:E,htmlFor:s,children:[i," ",Bt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:N,className:`pkt-input-check__input-checkbox ${n?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...m!==void 0?{checked:m}:{defaultChecked:g},...M}),p==="right"&&l.jsxs("label",{className:E,htmlFor:s,children:[i," ",Bt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});sn.displayName="PktCheckbox";const Dh=Nt({tagName:"pkt-combobox",elementClass:Q,react:x,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),an=x.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Dh,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));an.displayName="PktCombobox";const oi=Nt({tagName:"pkt-consent",elementClass:zt,react:x,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});oi.displayName="PktConsent";const Ih=Nt({tagName:"pkt-datepicker",elementClass:et,react:x,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),nn=x.forwardRef(({helptext:s,...t},e)=>l.jsx(Ih,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));nn.displayName="PktDatepicker";const Lh=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:a=!1,personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:g=!1,cookieDomain:m=null,cookieSecure:k=null,cookieExpiryDays:b=null,onToggleConsent:y=w=>{console.log(w.detail)}})=>{var C,M;const w=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:w,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:s.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&l.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((N,U)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${N.external?"pkt-link--external":""}`,href:N.href,target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer__link-icon",name:"chevron-right"}),N.text]})},`links-${U}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:t.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&l.jsx("li",{className:"pkt-footer__text",children:t.text}),(M=t.links)==null?void 0:M.map((N,U)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${N.external?"pkt-link--external":""}`,href:N.href,target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer__link-icon",name:"chevron-right"}),N.text]})},`links-${U}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),l.jsxs("ul",{className:"pkt-footer__list",children:[l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:n,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:r,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(oi,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:g,cookieDomain:m,cookieSecure:k,cookieExpiryDays:b,onToggleConsent:y})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(N=>N.language).map((N,U)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:N.href,"aria-label":`til ${N.language} versjon av nettsiden`,target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:N.language})},`sociallinks-language-${U}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(N=>N.iconName).map((N,U)=>l.jsx(x.Fragment,{children:l.jsx("a",{href:N.href,"aria-label":`til ${N.iconName}`,className:"pkt-footer__social-icon-link",target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:l.jsx(F,{className:"pkt-footer__social-icon",name:N.iconName})})},`sociallinks-${U}`))})]})]})})},Bh=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:a=!1,hotjarId:n=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:g=null,onToggleConsent:m=b=>{console.log(b.detail)},className:k})=>{const b=[k,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((y,w)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${y.external?" pkt-link--external":""}`,href:y.href,target:y.openInNewTab||t?"_blank":"_self",rel:y.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),y.text]})},w)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:e,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),a&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(oi,{triggerType:"footerlink",hotjarId:n,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:p,cookieExpiryDays:g,onToggleConsent:m})})]})})})},Fh=x.forwardRef(({className:s,logoLink:t="https://www.oslo.kommune.no/",serviceName:e,fixed:i=!0,scrollToHide:a=!0,user:n,userMenu:r,representing:h,userOptions:d,userMenuFooter:p,canChangeRepresentation:g=!0,showMenuButton:m=!1,showLogOutButton:k=!1,openMenu:b,logOut:y,changeRepresentation:w,children:C,...M},N)=>{const U=x.useMemo(()=>typeof(n==null?void 0:n.lastLoggedIn)=="string"?n.lastLoggedIn:n!=null&&n.lastLoggedIn?new Date(n.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[n]),[E,G]=x.useState(!1),[J,Bt]=x.useState(0),[Ft,it]=x.useState(!1),rt=x.useRef(null);x.useEffect(()=>(document&&(document.addEventListener("mouseup",jt),window.addEventListener("scroll",ot)),()=>{document&&(document.removeEventListener("mouseup",jt),window.removeEventListener("scroll",ot))}));const Vt=()=>{it(!Ft)},jt=L=>{rt.current&&!rt.current.contains(L.target)&&it(!1)},ot=()=>{if(a){const L=window.pageYOffset||document.documentElement.scrollTop;if(L<0||Math.abs(L-J)<60)return;G(L>J),Bt(L)}};return l.jsxs("header",{...M,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:vt(s,"pkt-header",{"pkt-header--fixed":i,"pkt-header--scroll-to-hide":a,"pkt-header--hidden":E}),ref:N,children:[l.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?l.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:l.jsx(F,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.13/logos/"})}):l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:l.jsx(F,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.13/logos/"})}),l.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:e})]}),l.jsx("nav",{className:"pkt-header__actions",children:l.jsxs("ul",{className:"pkt-header__actions-row",children:[m&&l.jsx("li",{children:l.jsx(He,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(n||h)&&l.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Ft&&!E?"pkt-header--open-dropdown":""}`,ref:rt,children:[l.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":Ft,onClick:Vt,children:[l.jsx(F,{name:"user",className:"pkt-btn__icon"}),l.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(h==null?void 0:h.name)||(n==null?void 0:n.name)}),l.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(h==null?void 0:h.shortname)||(n==null?void 0:n.shortname)}),l.jsx(F,{name:"chevron-thin-down",className:"pkt-btn--closed"}),l.jsx(F,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),l.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[n&&l.jsxs("li",{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:n.name}),n.lastLoggedIn&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:U})]})]}),r&&l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:r.map((L,Tt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsxs("a",{href:L.target,className:"pkt-link",children:[L.iconName&&l.jsx(F,{name:L.iconName,className:"pkt-link__icon"}),L.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:[L.iconName&&l.jsx(F,{name:L.iconName,className:"pkt-link__icon"}),L.title]})},`userMenu-${Tt}`))})}),(h||g)&&l.jsxs("li",{children:[h&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",h.orgNumber]})]}),l.jsx("ul",{className:"pkt-list mt-size-16",children:g&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:w,children:[l.jsx(F,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:(d||!k)&&l.jsxs(l.Fragment,{children:[d==null?void 0:d.map((L,Tt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsxs("a",{href:L.target,className:"pkt-link",children:[L.iconName&&l.jsx(F,{name:L.iconName,className:"pkt-link__icon"}),L.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:[L.iconName&&l.jsx(F,{name:L.iconName,className:"pkt-link__icon"}),L.title]})},`userOptions-${Tt}`)),!k&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:y,children:[l.jsx(F,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),p&&l.jsx("li",{className:"footer",children:l.jsx("ul",{className:"pkt-list-horizontal bordered",children:p.map((L,Tt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsx("a",{href:L.target,className:"pkt-link",children:L.title}):l.jsx("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:L.title})},`userMenuFooter-${Tt}`))})})]})]}),C&&l.jsx("li",{children:C}),k&&l.jsx("li",{children:l.jsx(He,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:y,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),Vh=Nt({tagName:"pkt-heading",elementClass:De,react:x,displayName:"PktHeading"}),rn=x.forwardRef(({children:s,...t},e)=>l.jsx(Vh,{"data-testid":"pkt-heading",...t,ref:e,children:s}));rn.displayName="PktHeading";const jh=Nt({tagName:"pkt-helptext",elementClass:le,react:x,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),on=x.forwardRef(({children:s,...t},e)=>l.jsx(jh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));on.displayName="PktHelptext";const ln=x.forwardRef(({label:s,id:t,children:e,...i},a)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:t,...i,ref:a}),e]}));ln.displayName="PktInput";const Bs=x.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:a,counter:n,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:g=!1,requiredText:m="Må fylles ut",tagText:k=null,hasError:b=!1,errorMessage:y,disabled:w=!1,inline:C=!1,ariaDescribedby:M,useWrapper:N=!0,children:U,className:E="",hasFieldset:G=!1,role:J="group",counterPosition:Bt="bottom"},Ft)=>{const[it,rt]=x.useState(!1),Vt=M||(e?`${s}-helptext`:void 0),jt=!!n,ot=jt&&Bt==="top",L=jt&&Bt==="bottom",Tt=()=>rt(ct=>!ct),ne=["pkt-inputwrapper",E,b?"pkt-inputwrapper--error":"",w?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),ce=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),re=()=>jt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,Ue=()=>l.jsxs(l.Fragment,{children:[k&&l.jsx("span",{className:ce+" pkt-tag--gray",children:k}),d&&l.jsx("span",{className:ce+" pkt-tag--blue-light",children:p}),g&&l.jsx("span",{className:ce+" pkt-tag--beige",children:m})]}),ds=()=>{const ct=l.jsxs(l.Fragment,{children:[t," ",Ue()]});return N?G?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ct}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Vt,id:`${s}-label`,children:ct}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Vt,id:`${s}-label`,children:t})},pe=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&N&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(He,{skin:"tertiary",size:"small",variant:"icon-right",iconName:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Tt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:a??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${it?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Rt=l.jsxs(l.Fragment,{children:[ds(),pe(),ot&&l.jsx(re,{}),U,L&&l.jsx(re,{}),b&&y&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(Ii,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:y})})]});return l.jsx("div",{className:ne,ref:Ft,role:J,children:G?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Vt,children:Rt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Rt})})});Bs.displayName="PktInputWrapper";const Hh=Nt({tagName:"pkt-link",elementClass:$e,react:x,displayName:"PktLink"}),hn=x.forwardRef(({children:s,...t},e)=>l.jsx(Hh,{...t,ref:e,children:l.jsx("span",{className:"pkt-contents",children:s})}));hn.displayName="PktLink";const dn=({children:s,skin:t,title:e,href:i,iconName:a,openInNewTab:n,external:r,className:h,...d})=>{const p=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),g=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...d,href:i,className:vt(p,h),target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[a&&l.jsx(F,{className:"pkt-link__icon",name:a}),e&&l.jsx("div",{className:vt(g),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};dn.displayName="PktLinkCard";const Uh=Nt({tagName:"pkt-loader",elementClass:Yt,react:x,displayName:"PktLoader",events:{}}),cn=x.forwardRef(({children:s,...t},e)=>l.jsx(Uh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));cn.displayName="PktLoader";const pn=({children:s,className:t,skin:e,title:i,compact:a,closable:n,onClose:r,...h})=>{const[d,p]=x.useState(!1),g={"pkt-messagebox":!0,"pkt-messagebox--compact":a,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":n,"pkt-hide":d},m=x.createRef(),k=x.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:vt(g,t),ref:m,children:[n&&l.jsx("div",{className:'"pkt-messagebox__close"',children:l.jsx("button",{onClick:k,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(F,{name:"close",className:"pkt-link__icon"})})}),l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};pn.displayName="PktMessagebox";const qh=Nt({tagName:"pkt-modal",elementClass:It,react:x,displayName:"PktModal",events:{}}),un=x.forwardRef(({children:s,...t},e)=>l.jsx(qh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));un.displayName="PktModal";const zh=Nt({tagName:"pkt-progressbar",elementClass:st,react:x,displayName:"PktProgressbar",events:{}}),fn=x.forwardRef(({children:s,...t},e)=>l.jsx(zh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));fn.displayName="PktProgressbar";const gn=x.forwardRef(({id:s,name:t,label:e,className:i,hasTile:a=!1,disabled:n=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:p,optionalTag:g,optionalText:m,requiredTag:k,requiredText:b,tagText:y,...w},C)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),N=["pkt-input-check__input",a?"pkt-input-check__input--tile":"",n&&a?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),U=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),E=["pkt-input-check__input-label",n?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),G=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),J=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:G+" pkt-tag--gray",children:y}),g&&l.jsx("span",{className:G+" pkt-tag--blue-light",children:m}),k&&l.jsx("span",{className:G+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:M,children:l.jsxs("div",{className:N,children:[l.jsx("input",{ref:C,id:s,type:"radio",name:t,disabled:n,className:U,...p!==void 0?{checked:p}:{defaultChecked:d},...w}),l.jsxs("label",{className:E,htmlFor:s,children:[e," ",J(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});gn.displayName="PktRadioButton";const Wh=x.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:a,name:n,placeholder:r="Søk…",suggestions:h,value:d="",action:p,method:g,onChange:m,onSearch:k,onSuggestionClick:b,...y},w)=>{const C=(E,G)=>{E?E():b&&b(G)},M=E=>{d=E.target.value},N=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let U;return p?U=E=>l.jsx("form",{role:"search",className:N,action:p,method:g,children:E}):U=E=>l.jsx("div",{role:"search",className:N,children:E}),U(l.jsxs(l.Fragment,{children:[a&&l.jsx("label",{htmlFor:a?i:void 0,className:a?"pkt-inputwrapper__label":"",children:a}),l.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${e?"pkt-input--fullwidth":""}`,type:"search",name:n||i,id:i,placeholder:r,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:w,"aria-controls":`${i}-suggestions`,onChange:m||M,onKeyUp:k&&(E=>{E.key==="Enter"&&(E.preventDefault(),k(d))}),...y}),l.jsx(He,{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:t,onClick:k&&(E=>{E.preventDefault(),k(d)}),children:a||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((E,G)=>l.jsx("li",{children:x.createElement(E.href?"a":E.onClick?"button":"div",{href:E.href,className:`pkt-searchinput__suggestion ${E.onClick?"pkt-link-button":""} ${E.href||E.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:E.onClick?"button":void 0,onClick:()=>C(E.onClick,G),onKeyUp:J=>J.key==="Enter"&&C(E.onClick,G)},l.jsxs(l.Fragment,{children:[E.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:E.title}),E.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:E.text})]}))},`search-suggestion-${G}`))})]}))}),Rh=x.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:a=!1,errorMessage:n,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:p,id:g,inline:m=!1,fullwidth:k=!1,label:b,name:y,optionalTag:w=!1,optionalText:C,requiredTag:M=!1,requiredText:N,tagText:U,...E},G)=>{const J=[i,"pkt-select"].join(" ");return l.jsx(Bs,{className:J,forId:`${g}-input`,label:b,helptext:h,helptextDropdown:d,helptextDropdownButton:p,optionalTag:w,optionalText:C,requiredTag:M,requiredText:N,tagText:U,hasError:r,errorMessage:n,disabled:a,inline:m,ariaDescribedby:s,children:l.jsx("select",{ref:G,className:`pkt-input ${k?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${g}-error`,"aria-labelledby":t||void 0,disabled:a,id:`${g}-input`,name:y||g,...E,children:e})})}),Kh=l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:l.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),Gh=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),l.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),Yh=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),l.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"})]}),Zh=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:vt("pkt-step",t,`pkt-step--${e}`),"data-testid":"pkt-step",children:[l.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),l.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),l.jsx("span",{className:vt("pkt-step__indicator"),children:e==="current"?Gh:e==="completed"?Yh:Kh}),l.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),l.jsxs("div",{className:"pkt-step__wrapper",children:[l.jsx("div",{className:"pkt-step__title",children:i}),l.jsx("div",{className:"pkt-step__content",children:s})]})]}),Xh=x.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:a=!0,orientation:n="vertical",...r},h)=>{const d=vt(t,"pkt-stepper",n==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=x.Children.map(e,(g,m)=>x.isValidElement(g)?x.cloneElement(g,{className:vt(g.props.className,{"pkt-step--hideStep":i&&m!==s,"pkt-step--hideContent":a&&m!==s})}):g);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:p})}),Jh=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:a,...n})=>l.jsx("table",{"data-testid":"pkt-table",className:vt(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...n,children:a}),Qh=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:vt(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),td=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:vt(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),ed=({className:s,children:t,...e})=>l.jsx("thead",{className:vt(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),sd=({className:s,children:t,...e})=>l.jsx("th",{className:vt(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),id=({className:s,children:t,...e})=>l.jsx("tr",{className:vt(s,"pkt-table__row",{}),role:"row",...e,children:t}),ad=Nt({tagName:"pkt-tag",elementClass:qt,react:Pn,displayName:"PktTag",events:{onClose:"close"}}),Li=x.forwardRef(({children:s,...t},e)=>l.jsx(ad,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Li.displayName="PktTag";const Bi=x.forwardRef(({children:s,active:t,href:e,onClick:i,icon:a,controls:n,tag:r,tagSkin:h,index:d=0},p)=>{const{arrowNav:g,registerTabRef:m,handleKeyPress:k,selectTab:b}=nd(),w={"aria-selected":g?!!t:void 0,"aria-controls":n,role:g?"tab":void 0,onKeyUp:M=>k(d,M),onClick:M=>{b(d),i==null||i(M)},tabIndex:t||!g?void 0:-1,ref:M=>{m(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},C=l.jsxs(l.Fragment,{children:[a&&l.jsx(F,{name:a,className:"pkt-icon--small"}),s,r&&l.jsx(Li,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...w,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:C}):l.jsx("button",{...w,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:C})});Bi.displayName="PktTabItem";const mn=x.createContext(null),nd=()=>{const s=x.useContext(mn);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},rd=x.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:a},n)=>{const r=x.useRef([]),h=s&&!t,p=a&&x.Children.count(a)>0?x.Children.count(a):(e==null?void 0:e.length)||0;x.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const g=y=>{const w=e==null?void 0:e[y];w!=null&&w.action&&w.action(y),i&&i(y)},m=(y,w)=>{var C,M;h&&(w.code==="ArrowLeft"&&y!==0&&((C=r.current[y-1])==null||C.focus()),w.code==="ArrowRight"&&y<p-1&&((M=r.current[y+1])==null||M.focus()),(w.code==="ArrowDown"||w.code==="Space")&&g(y))},k=(y,w)=>{r.current[y]=w},b=e==null?void 0:e.map((y,w)=>{var C,M;return l.jsx(Bi,{active:y.active,href:y.href,onClick:()=>g(w),icon:y.icon,controls:y.controls,tag:(C=y.tag)==null?void 0:C.text,tagSkin:(M=y.tag)==null?void 0:M.skin,index:w,children:y.text},w)});return l.jsx(mn.Provider,{value:{arrowNav:h,registerTabRef:k,handleKeyPress:m,selectTab:g},children:l.jsx("div",{className:"pkt-tabs",ref:n,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:a||b})})})}),od=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:a,className:n,disabled:r,errorMessage:h,hasError:d,helptext:p,helptextDropdown:g,helptextDropdownButton:m,inline:k,fullwidth:b=!1,label:y,name:w,optionalTag:C=!1,optionalText:M,requiredTag:N=!1,requiredText:U,tagText:E=null,placeholder:G,rows:J,useWrapper:Bt=!0,onChange:Ft,value:it,autoComplete:rt="off",minLength:Vt,maxLength:jt,readOnly:ot=!1,skipForwardTestid:L=!1,...Tt},ne)=>{const ce=[n,"pkt-textinput","pkt-textarea"].join(" "),re=`${s}-input`,Ue=`${re}-label`,ds=e||Ue,[pe,Rt]=x.useState(0),ct=qe=>{var ze,ue;if(i&&Rt(((ue=(ze=qe.currentTarget)==null?void 0:ze.value)==null?void 0:ue.length)||0),Ft)return Ft(qe)};return x.useEffect(()=>{it!==void 0&&Rt((it==null?void 0:it.length)||0)},[it]),l.jsx(Bs,{ariaDescribedby:t,className:ce,disabled:r,errorMessage:h,forId:re,hasError:d,helptext:p,helptextDropdown:g,helptextDropdownButton:m,inline:k,label:y,optionalTag:C,optionalText:M,requiredTag:N,requiredText:U,tagText:E,useWrapper:Bt,counter:i,counterCurrent:pe,counterMaxLength:a,children:l.jsx("textarea",{ref:ne,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${a&&pe>a?"pkt-input--counter-error":""}`,name:`${w||s}`,id:re,placeholder:G,disabled:r,rows:J,"aria-labelledby":ds,"aria-invalid":d,"aria-errormessage":`${s}-error`,...Tt,onChange:ct,value:it,autoComplete:rt,minLength:Vt,maxLength:jt,"data-skip-forward-testid":L?"true":void 0})})}),ld=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:a,counterMaxLength:n,className:r,disabled:h=!1,errorMessage:d,hasError:p=!1,helptext:g,helptextDropdown:m,helptextDropdownButton:k,iconNameRight:b,inline:y=!1,fullwidth:w=!1,label:C,name:M,optionalTag:N=!1,optionalText:U,requiredTag:E=!1,requiredText:G,tagText:J=null,placeholder:Bt,prefix:Ft,suffix:it,type:rt="text",useWrapper:Vt=!0,omitSearchIcon:jt=!1,value:ot,minLength:L,maxLength:Tt,min:ne,max:ce,step:re,size:Ue,readonly:ds,required:pe,dataTestid:Rt,onChange:ct,skipForwardTestid:qe=!1,...ze},ue)=>{const Vi=[r,"pkt-textinput"].join(" "),li=rt==="search"&&!b&&!jt,ji=rt==="date"&&ot?ot.slice(0,10):ot,[hi,cs]=x.useState((ot==null?void 0:ot.length)||0),ps=`${s}`,Vs=`${ps}-label`,di=e||Vs,Hi=we=>{var ci,pi;a&&cs(((pi=(ci=we.currentTarget)==null?void 0:ci.value)==null?void 0:pi.length)||0),ct&&ct(we)};return x.useEffect(()=>{ot!==void 0&&cs((ot==null?void 0:ot.length)||0)},[ot]),l.jsx(Bs,{ariaDescribedby:t,className:Vi,disabled:h,errorMessage:d,forId:ps,hasError:p,helptext:g,helptextDropdown:m,helptextDropdownButton:k,inline:y,label:C,optionalTag:N,optionalText:U,requiredTag:E,requiredText:G,tagText:J,useWrapper:Vt,counter:a,counterCurrent:hi,counterMaxLength:n,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Rt,"data-skip-forward-testid":qe?"true":void 0,children:[Ft&&l.jsx("div",{className:"pkt-input-prefix",children:Ft}),l.jsx("input",{...ze,ref:ue,className:`pkt-input ${w?"pkt-input--fullwidth":""} ${n&&hi>n?"pkt-input--counter-error":""}`,type:rt,name:`${M||s}`,value:ji,id:ps,placeholder:Bt,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":di,min:ne,max:ce,onChange:Hi,step:re,minLength:L,maxLength:Tt,size:Ue,required:pe}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(F,{className:"pkt-input-suffix-icon",name:b}),li&&l.jsx(F,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(F,{className:"pkt-input-icon",name:b}),!it&&li&&l.jsx(F,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});var ls=window.CustomEvent;(!ls||typeof ls=="object")&&(ls=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ls.prototype=window.Event.prototype);function vn(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function hd(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,a){return!(t[i]===void 0||t[i]===a)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function Fs(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 bn(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function dd(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function Fi(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function yn(s){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(e.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var a=s.querySelectorAll("*"),n=0;n<a.length&&!(a[n].tagName&&a[n].shadowRoot&&(i=yn(a[n].shadowRoot),i));n++);return i}function kn(s){return s.isConnected||document.body.contains(s)}function $n(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=z.formSubmitter;if(!e){var i=s.target,a="getRootNode"in i&&i.getRootNode()||document;e=a.activeElement}return!e||e.form!==t?null:e}function cd(s){if(!s.defaultPrevented){var t=s.target,e=z.imagemapUseValue,i=$n(s);e===null&&i&&(e=i.value);var a=Fs(t);if(a){var n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&(s.preventDefault(),e!=null?a.close(e):a.close())}}}function _n(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",cd,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,i=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),a,n=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(a),a=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,n)})}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))}_n.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&kn(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_),z.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 t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var e=document.createEvent("MouseEvents");e.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(e),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=yn(this.dialog_)),bn(document.activeElement),s&&s.focus()},updateZIndex:function(s,t){if(s<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=t},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(!kn(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!z.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");hd(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,z.needsCentering(this.dialog_)?(z.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 t=new ls("close",{bubbles:!1,cancelable:!1});vn(this.dialog_,t)}};var z={};if(z.reposition=function(s){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(t,e)+"px"},z.isInlinePositionSetByStylesheet=function(s){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],i=null;try{i=e.cssRules}catch{}if(i)for(var a=0;a<i.length;++a){var n=i[a],r=null;try{r=document.querySelectorAll(n.selectorText)}catch{}if(!(!r||!dd(r,s))){var h=n.style.getPropertyValue("top"),d=n.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},z.needsCentering=function(s){var t=window.getComputedStyle(s);return t.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!z.isInlinePositionSetByStylesheet(s)},z.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 _n(s)},z.registerDialog=function(s){s.showModal||z.forceRegisterDialog(s)},z.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(t){this.forwardTab_=void 0,t.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(t){var e=[];t.forEach(function(i){for(var a=0,n;n=i.removedNodes[a];++a){if(n instanceof Element)n.localName==="dialog"&&e.push(n);else continue;e=e.concat(n.querySelectorAll("dialog"))}}),e.length&&s(e)}))},z.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})},z.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},z.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--s,--s),t===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var a=i.dialog.parentNode||document.body;a.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},z.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Fs(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},z.DialogManager.prototype.handleFocus_=function(s){var t=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),bn(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,a=i.compareDocumentPosition(t);return a&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},z.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new ls("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&vn(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},z.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},z.DialogManager.prototype.pushDialog=function(s){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},z.DialogManager.prototype.removeDialog=function(s){var t=this.pendingDialogStack.indexOf(s);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},z.dm=new z.DialogManager,z.formSubmitter=null,z.imagemapUseValue=null,window.HTMLDialogElement===void 0){var wn=document.createElement("form");if(wn.setAttribute("method","dialog"),wn.method!=="dialog"){var hs=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(hs){var pd=hs.get;hs.get=function(){return Fi(this)?"dialog":pd.call(this)};var ud=hs.set;hs.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):ud.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",hs)}}document.addEventListener("click",function(s){if(z.formSubmitter=null,z.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!Fi(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;z.imagemapUseValue=s.offsetX+","+s.offsetY}var a=Fs(t);a&&(z.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=Fs(t);if(!e){var i=$n(s),a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&s.preventDefault()}});var fd=HTMLFormElement.prototype.submit,gd=function(){if(!Fi(this))return fd.call(this);var s=Fs(this);s&&s.close()};HTMLFormElement.prototype.submit=gd}const md=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));O.PktAccordion=Ri,O.PktAccordionItem=Ja,O.PktAlert=Ii,O.PktBackLink=tn,O.PktBreadcrumbs=Oh,O.PktButton=He,O.PktCard=en,O.PktCheckbox=sn,O.PktCombobox=an,O.PktConsent=oi,O.PktDatepicker=nn,O.PktFooter=Lh,O.PktFooterSimple=Bh,O.PktHeader=Fh,O.PktHeading=rn,O.PktHelptext=on,O.PktIcon=F,O.PktInput=ln,O.PktInputWrapper=Bs,O.PktLink=hn,O.PktLinkCard=dn,O.PktLoader=cn,O.PktMessagebox=pn,O.PktModal=un,O.PktProgressbar=fn,O.PktRadioButton=gn,O.PktSearchInput=Wh,O.PktSelect=Rh,O.PktStep=Zh,O.PktStepper=Xh,O.PktTabItem=Bi,O.PktTable=Jh,O.PktTableBody=Qh,O.PktTableDataCell=td,O.PktTableHeader=ed,O.PktTableHeaderCell=sd,O.PktTableRow=id,O.PktTabs=rd,O.PktTag=Li,O.PktTextarea=od,O.PktTextinput=ld,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})}));
|