@oslokommune/punkt-react 14.5.4 → 15.0.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 +33 -0
- package/dist/index.d.ts +64 -21
- package/dist/punkt-react.es.js +7164 -4654
- package/dist/punkt-react.umd.js +573 -569
- package/package.json +5 -5
- package/src/components/calendar/Calendar.accessibility.test.tsx +75 -0
- package/src/components/calendar/Calendar.constraints.test.tsx +84 -0
- package/src/components/calendar/Calendar.core.test.tsx +272 -0
- package/src/components/calendar/Calendar.interaction.test.tsx +96 -0
- package/src/components/calendar/Calendar.selection.test.tsx +227 -0
- package/src/components/calendar/Calendar.tsx +54 -0
- package/src/components/calendar/CalendarGrid.tsx +192 -0
- package/src/components/calendar/CalendarNav.tsx +111 -0
- package/src/components/calendar/calendar-utils.ts +90 -0
- package/src/components/calendar/types.ts +160 -0
- package/src/components/calendar/useCalendarState.ts +426 -0
- package/src/components/datepicker/DateTags.tsx +43 -0
- package/src/components/datepicker/Datepicker.accessibility.test.tsx +404 -0
- package/src/components/datepicker/Datepicker.core.test.tsx +270 -0
- package/src/components/datepicker/Datepicker.input.test.tsx +218 -0
- package/src/components/datepicker/Datepicker.selection.test.tsx +302 -0
- package/src/components/datepicker/Datepicker.tsx +61 -79
- package/src/components/datepicker/Datepicker.validation.test.tsx +317 -0
- package/src/components/datepicker/DatepickerInputs.tsx +184 -0
- package/src/components/datepicker/DatepickerPopup.tsx +90 -0
- package/src/components/datepicker/types.ts +139 -0
- package/src/components/datepicker/useDatepickerState.ts +502 -0
- package/src/components/index.ts +1 -0
- package/src/components/datepicker/Datepicker.test.tsx +0 -395
package/dist/punkt-react.umd.js
CHANGED
|
@@ -33,108 +33,108 @@
|
|
|
33
33
|
return [];
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
(function(
|
|
36
|
+
(function(F,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-router-dom"],l):(F=typeof globalThis<"u"?globalThis:F||self,l(F["punkt-react"]={},F.ReactJsxRuntime,F.React,F.ReactRouterDOM))})(this,(function(F,l,g,Mo){"use strict";const Jn=g.createContext({}),No=()=>g.useContext(Jn),er=g.forwardRef(({compact:s=!1,skin:e="borderless",ariaLabelledBy:t,children:i,name:n,className:r},a)=>{const c=["pkt-accordion",s&&"pkt-accordion--compact",e&&`pkt-accordion--${e}`,r].filter(Boolean).join(" ");return l.jsx(Jn.Provider,{value:{name:n},children:l.jsx("div",{ref:a,className:c,"data-testid":"pkt-accordion","aria-labelledby":t||void 0,children:i})})});er.displayName="PktAccordion";/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2018 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/const
|
|
40
|
+
*/const Do=new Set(["children","localName","ref","style","className"]),tr=new WeakMap,sr=(s,e,t,i,n)=>{const r=n==null?void 0:n[e];r===void 0?(s[e]=t,t==null&&e in HTMLElement.prototype&&s.removeAttribute(e)):t!==i&&((a,c,h)=>{let p=tr.get(a);p===void 0&&tr.set(a,p=new Map);let v=p.get(c);h!==void 0?v===void 0?(p.set(c,v={handleEvent:h}),a.addEventListener(c,v)):v.handleEvent=h:v!==void 0&&(p.delete(c),a.removeEventListener(c,v))})(s,r,t)},Pt=({react:s,tagName:e,elementClass:t,events:i,displayName:n})=>{const r=new Set(Object.keys(i??{})),a=s.forwardRef(((c,h)=>{const p=s.useRef(new Map),v=s.useRef(null),b={},y={};for(const[k,m]of Object.entries(c))Do.has(k)?b[k==="className"?"class":k]=m:r.has(k)||k in t.prototype?y[k]=m:b[k]=m;return s.useLayoutEffect((()=>{if(v.current===null)return;const k=new Map;for(const m in y)sr(v.current,m,c[m],p.current.get(m),i),p.current.delete(m),k.set(m,c[m]);for(const[m,w]of p.current)sr(v.current,m,void 0,w,i);p.current=k})),s.useLayoutEffect((()=>{var k;(k=v.current)==null||k.removeAttribute("defer-hydration")}),[]),b.suppressHydrationWarning=!0,s.createElement(e,{...b,ref:s.useCallback((k=>{v.current=k,typeof h=="function"?h(k):h!==null&&(h.current=k)}),[h])})}));return a.displayName=n??t.name,a};/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/const
|
|
45
|
-
\f\r]`,
|
|
46
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g")
|
|
44
|
+
*/const Bi=globalThis,Fi=Bi.trustedTypes,ir=Fi?Fi.createPolicy("lit-html",{createHTML:s=>s}):void 0,nr="$lit$",Jt=`lit$${Math.random().toFixed(9).slice(2)}$`,rr="?"+Jt,Oo=`<${rr}>`,us=document,ti=()=>us.createComment(""),si=s=>s===null||typeof s!="object"&&typeof s!="function",pn=Array.isArray,Eo=s=>pn(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",fn=`[
|
|
45
|
+
\f\r]`,ii=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ar=/-->/g,or=/>/g,ds=RegExp(`>|${fn}(?:([^\\s"'>=/]+)(${fn}*=${fn}*(?:[^
|
|
46
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),lr=/'/g,cr=/"/g,hr=/^(?:script|style|textarea|title)$/i,Po=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),f=Po(1),ht=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),ur=new WeakMap,ps=us.createTreeWalker(us,129);function dr(s,e){if(!pn(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return ir!==void 0?ir.createHTML(e):e}const Ao=(s,e)=>{const t=s.length-1,i=[];let n,r=e===2?"<svg>":e===3?"<math>":"",a=ii;for(let c=0;c<t;c++){const h=s[c];let p,v,b=-1,y=0;for(;y<h.length&&(a.lastIndex=y,v=a.exec(h),v!==null);)y=a.lastIndex,a===ii?v[1]==="!--"?a=ar:v[1]!==void 0?a=or:v[2]!==void 0?(hr.test(v[2])&&(n=RegExp("</"+v[2],"g")),a=ds):v[3]!==void 0&&(a=ds):a===ds?v[0]===">"?(a=n??ii,b=-1):v[1]===void 0?b=-2:(b=a.lastIndex-v[2].length,p=v[1],a=v[3]===void 0?ds:v[3]==='"'?cr:lr):a===cr||a===lr?a=ds:a===ar||a===or?a=ii:(a=ds,n=void 0);const k=a===ds&&s[c+1].startsWith("/>")?" ":"";r+=a===ii?h+Oo:b>=0?(i.push(p),h.slice(0,b)+nr+h.slice(b)+Jt+k):h+Jt+(b===-2?c:k)}return[dr(s,r+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};let gn=class Co{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,a=0;const c=e.length-1,h=this.parts,[p,v]=Ao(e,t);if(this.el=Co.createElement(p,i),ps.currentNode=this.el.content,t===2||t===3){const b=this.el.content.firstChild;b.replaceWith(...b.childNodes)}for(;(n=ps.nextNode())!==null&&h.length<c;){if(n.nodeType===1){if(n.hasAttributes())for(const b of n.getAttributeNames())if(b.endsWith(nr)){const y=v[a++],k=n.getAttribute(b).split(Jt),m=/([.?@])?(.*)/.exec(y);h.push({type:1,index:r,name:m[2],strings:k,ctor:m[1]==="."?Lo:m[1]==="?"?Bo:m[1]==="@"?Fo:Vi}),n.removeAttribute(b)}else b.startsWith(Jt)&&(h.push({type:6,index:r}),n.removeAttribute(b));if(hr.test(n.tagName)){const b=n.textContent.split(Jt),y=b.length-1;if(y>0){n.textContent=Fi?Fi.emptyScript:"";for(let k=0;k<y;k++)n.append(b[k],ti()),ps.nextNode(),h.push({type:2,index:++r});n.append(b[y],ti())}}}else if(n.nodeType===8)if(n.data===rr)h.push({type:2,index:r});else{let b=-1;for(;(b=n.data.indexOf(Jt,b+1))!==-1;)h.push({type:7,index:r}),b+=Jt.length-1}r++}}static createElement(e,t){const i=us.createElement("template");return i.innerHTML=e,i}};function Os(s,e,t=s,i){var n,r;if(e===ht)return e;let a=i!==void 0?(n=t._$Co)==null?void 0:n[i]:t._$Cl;const c=si(e)?void 0:e._$litDirective$;return(a==null?void 0:a.constructor)!==c&&((r=a==null?void 0:a._$AO)==null||r.call(a,!1),c===void 0?a=void 0:(a=new c(s),a._$AT(s,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=a:t._$Cl=a),a!==void 0&&(e=Os(s,a._$AS(s,e.values),a,i)),e}let Io=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,n=((e==null?void 0:e.creationScope)??us).importNode(t,!0);ps.currentNode=n;let r=ps.nextNode(),a=0,c=0,h=i[0];for(;h!==void 0;){if(a===h.index){let p;h.type===2?p=new Hi(r,r.nextSibling,this,e):h.type===1?p=new h.ctor(r,h.name,h.strings,this,e):h.type===6&&(p=new Ho(r,this,e)),this._$AV.push(p),h=i[++c]}a!==(h==null?void 0:h.index)&&(r=ps.nextNode(),a++)}return ps.currentNode=us,n}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},Hi=class To{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,n){this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Os(this,e,t),si(e)?e===_||e==null||e===""?(this._$AH!==_&&this._$AR(),this._$AH=_):e!==this._$AH&&e!==ht&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Eo(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==_&&si(this._$AH)?this._$AA.nextSibling.data=e:this.T(us.createTextNode(e)),this._$AH=e}$(e){var t;const{values:i,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=gn.createElement(dr(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)==null?void 0:t._$AD)===r)this._$AH.p(i);else{const a=new Io(r,this),c=a.u(this.options);a.p(i),this.T(c),this._$AH=a}}_$AC(e){let t=ur.get(e.strings);return t===void 0&&ur.set(e.strings,t=new gn(e)),t}k(e){pn(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new To(this.O(ti()),this.O(ti()),this,this.options)):i=t[n],i._$AI(r),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Vi=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,n,r){this.type=1,this._$AH=_,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=_}_$AI(e,t=this,i,n){const r=this.strings;let a=!1;if(r===void 0)e=Os(this,e,t,0),a=!si(e)||e!==this._$AH&&e!==ht,a&&(this._$AH=e);else{const c=e;let h,p;for(e=r[0],h=0;h<r.length-1;h++)p=Os(this,c[i+h],t,h),p===ht&&(p=this._$AH[h]),a||(a=!si(p)||p!==this._$AH[h]),p===_?e=_:e!==_&&(e+=(p??"")+r[h+1]),this._$AH[h]=p}a&&!n&&this.j(e)}j(e){e===_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Lo=class extends Vi{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===_?void 0:e}},Bo=class extends Vi{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==_)}},Fo=class extends Vi{constructor(e,t,i,n,r){super(e,t,i,n,r),this.type=5}_$AI(e,t=this){if((e=Os(this,e,t,0)??_)===ht)return;const i=this._$AH,n=e===_&&i!==_||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==_&&(i===_||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},Ho=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Os(this,e)}};const Vo={I:Hi},pr=Bi.litHtmlPolyfillSupport;pr==null||pr(gn,Hi),(Bi.litHtmlVersions??(Bi.litHtmlVersions=[])).push("3.3.1");const jo=(s,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new Hi(e.insertBefore(ti(),r),r,void 0,t??{})}return n._$AI(s),n};/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/const
|
|
50
|
+
*/const X=s=>(e,t)=>{t!==void 0?t.addInitializer((()=>{customElements.define(s,e)})):customElements.define(s,e)};/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2019 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const
|
|
54
|
+
*/const ji=globalThis,mn=ji.ShadowRoot&&(ji.ShadyCSS===void 0||ji.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,fr=Symbol(),gr=new WeakMap;let Uo=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==fr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(mn&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=gr.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&gr.set(t,e))}return e}toString(){return this.cssText}};const Wo=s=>new Uo(typeof s=="string"?s:s+"",void 0,fr),qo=(s,e)=>{if(mn)s.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const i=document.createElement("style"),n=ji.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,s.appendChild(i)}},mr=mn?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Wo(t)})(s):s;/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/const{is:
|
|
58
|
+
*/const{is:zo,defineProperty:Yo,getOwnPropertyDescriptor:Ko,getOwnPropertyNames:Ro,getOwnPropertySymbols:Go,getPrototypeOf:Xo}=Object,Es=globalThis,vr=Es.trustedTypes,Qo=vr?vr.emptyScript:"",br=Es.reactiveElementPolyfillSupport,ni=(s,e)=>s,Ui={toAttribute(s,e){switch(e){case Boolean:s=s?Qo:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},vn=(s,e)=>!zo(s,e),yr={attribute:!0,type:String,converter:Ui,reflect:!1,useDefault:!1,hasChanged:vn};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Es.litPropertyMetadata??(Es.litPropertyMetadata=new WeakMap);let Ps=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=yr){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&Yo(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){const{get:n,set:r}=Ko(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:n,set(a){const c=n==null?void 0:n.call(this);r==null||r.call(this,a),this.requestUpdate(e,c,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??yr}static _$Ei(){if(this.hasOwnProperty(ni("elementProperties")))return;const e=Xo(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ni("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ni("properties"))){const t=this.properties,i=[...Ro(t),...Go(t)];for(const n of i)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)t.unshift(mr(n))}else e!==void 0&&t.push(mr(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach((t=>t(this)))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return qo(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach((t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach((t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var i;const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const a=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:Ui).toAttribute(t,n.type);this._$Em=e,a==null?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){var i,n;const r=this.constructor,a=r._$Eh.get(e);if(a!==void 0&&this._$Em!==a){const c=r.getPropertyOptions(a),h=typeof c.converter=="function"?{fromAttribute:c.converter}:((i=c.converter)==null?void 0:i.fromAttribute)!==void 0?c.converter:Ui;this._$Em=a;const p=h.fromAttribute(t,c.type);this[a]=p??((n=this._$Ej)==null?void 0:n.get(a))??p,this._$Em=null}}requestUpdate(e,t,i){var n;if(e!==void 0){const r=this.constructor,a=this[e];if(i??(i=r.getPropertyOptions(e)),!((i.hasChanged??vn)(a,t)||i.useDefault&&i.reflect&&a===((n=this._$Ej)==null?void 0:n.get(e))&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:n,wrapped:r},a){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),r!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,a]of this._$Ep)this[r]=a;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,a]of n){const{wrapped:c}=a,h=this[r];c!==!0||this._$AL.has(r)||h===void 0||this.C(r,void 0,a,h)}}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$EO)==null||e.forEach((n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)})),this.update(i)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach((i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(e){}firstUpdated(e){}};Ps.elementStyles=[],Ps.shadowRootOptions={mode:"open"},Ps[ni("elementProperties")]=new Map,Ps[ni("finalized")]=new Map,br==null||br({ReactiveElement:Ps}),(Es.reactiveElementVersions??(Es.reactiveElementVersions=[])).push("2.1.1");/**
|
|
59
59
|
* @license
|
|
60
60
|
* Copyright 2017 Google LLC
|
|
61
61
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const
|
|
62
|
+
*/const Zo={attribute:!0,type:String,converter:Ui,reflect:!1,hasChanged:vn},Jo=(s=Zo,e,t)=>{const{kind:i,metadata:n}=t;let r=globalThis.litPropertyMetadata.get(n);if(r===void 0&&globalThis.litPropertyMetadata.set(n,r=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),r.set(t.name,s),i==="accessor"){const{name:a}=t;return{set(c){const h=e.get.call(this);e.set.call(this,c),this.requestUpdate(a,h,s)},init(c){return c!==void 0&&this.C(a,void 0,s,c),c}}}if(i==="setter"){const{name:a}=t;return function(c){const h=this[a];e.call(this,c),this.requestUpdate(a,h,s)}}throw Error("Unsupported decorator location: "+i)};function o(s){return(e,t)=>typeof t=="object"?Jo(s,e,t):((i,n,r)=>{const a=n.hasOwnProperty(r);return n.constructor.createProperty(r,i),a?Object.getOwnPropertyDescriptor(n,r):void 0})(s,e,t)}/**
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright 2017 Google LLC
|
|
65
65
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
-
*/const
|
|
66
|
+
*/const ri=globalThis;let As=class extends Ps{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=jo(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return ht}};var kr;As._$litElement$=!0,As.finalized=!0,(kr=ri.litElementHydrateSupport)==null||kr.call(ri,{LitElement:As});const $r=ri.litElementPolyfillSupport;$r==null||$r({LitElement:As}),(ri.litElementVersions??(ri.litElementVersions=[])).push("4.2.1");const el={hi:"Hei!"},tl={from:"Fra",to:"Til"},sl={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},il={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"},nl={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."}},ut={example:el,generic:tl,calendar:sl,dates:il,forms:nl};var rl=Object.defineProperty,wr=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&rl(e,t,n),n};let Wi=class extends As{constructor(){super(...arguments),this.strings=ut,this.role=null}hotReplacedCallback(){this.requestUpdate()}};wr([o({type:Object})],Wi.prototype,"strings"),wr([o({type:String})],Wi.prototype,"role");let fe=class extends Wi{createRenderRoot(){return this}};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/const
|
|
70
|
+
*/const Tt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},fs=s=>(...e)=>({_$litDirective$:s,values:e});let Is=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2018 Google LLC
|
|
73
73
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
-
*/const
|
|
74
|
+
*/const A=fs(class extends Is{constructor(s){var e;if(super(s),s.type!==Tt.ATTRIBUTE||s.name!=="class"||((e=s.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter((e=>s[e])).join(" ")+" "}update(s,[e]){var t,i;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((r=>r!==""))));for(const r in e)e[r]&&!((t=this.nt)!=null&&t.has(r))&&this.st.add(r);return this.render(e)}const n=s.element.classList;for(const r of this.st)r in e||(n.remove(r),this.st.delete(r));for(const r in e){const a=!!e[r];a===this.st.has(r)||(i=this.nt)!=null&&i.has(r)||(a?(n.add(r),this.st.add(r)):(n.remove(r),this.st.delete(r)))}return ht}});/**
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright 2017 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
|
-
*/function
|
|
78
|
+
*/function q(s){return o({...s,state:!0,attribute:!1})}function _r(s,e){return e.some(t=>t.value===s)}function ai(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function Ls(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function al(s,e){return s.nodeType===Node.ELEMENT_NODE&&!_r(s,e)}function bn(s){var e;return s.nodeType===Node.TEXT_NODE&&((e=s.nodeValue)==null?void 0:e.trim())!==""}let Oe=class{constructor(e,...t){this.nodes=[],this.filledSlots=new Set,this.skipOptions=!1,this.updatingSlots=!1,this.needsSlotUpdate=!0,this.host=e,this.host.addController(this),this.slots=t,this.nodes=[],this.observer=new MutationObserver(i=>{this.handleMutations(i),this.handleSlotMutations(i)})}hostConnected(){this.updateNodes(),this.observer.observe(this.host,{childList:!0,subtree:!0})}hostDisconnected(){this.observer.disconnect()}hostUpdated(){this.needsSlotUpdate&&(this.needsSlotUpdate=!1,this.updateSlots())}updateNodes(){this.nodes=[],Array.from(this.host.childNodes).forEach(e=>{ai(e)||Ls(e)&&this.skipOptions||(!_r(e,this.slots)||bn(e))&&this.nodes.push(e)})}updateSlots(){if(this.updatingSlots)return;this.updatingSlots=!0;const e=new Set;this.slots.forEach(t=>{if(!t.value)return;const i=t.value.getAttribute("name");Array.from(t.value.childNodes).some(r=>{var a,c;if(r.nodeType===Node.COMMENT_NODE)return!1;if(r.nodeType===Node.TEXT_NODE)return!!((a=r.textContent)!=null&&a.trim());if(r.nodeType===Node.ELEMENT_NODE){if(ai(r))return!1;if((c=r.textContent)!=null&&c.trim())return!0}return!1})&&e.add(i);const n=this.nodes.flatMap(r=>bn(r)||r.getAttribute&&r.getAttribute("slot")==i&&!ai(r)?r:[]).filter(r=>t.value&&!t.value.contains(r)&&!r.contains(t.value));if(n.length>0)if(typeof t.value.replaceChildren!="function"){for(;t.value.firstChild;)t.value.removeChild(t.value.firstChild);t.value.append(...n)}else t.value.replaceChildren(...n)}),(this.filledSlots.size!==e.size||![...this.filledSlots].every(t=>e.has(t)))&&(this.filledSlots=e,typeof this.host.updateSlots=="function"&&this.host.updateSlots(this.filledSlots)),this.updatingSlots=!1}handleMutations(e){let t=!1;e.forEach(i=>{i.type!=="childList"||i.target!==this.host||(i.addedNodes.forEach(n=>{ai(n)||Ls(n)&&this.skipOptions||(al(n,this.slots)||bn(n))&&(this.nodes.push(n),t=!0)}),i.removedNodes.forEach(n=>{ai(n)||Ls(n)&&this.skipOptions||(this.nodes=this.nodes.filter(r=>r!==n),t=!0)}))}),t&&(this.needsSlotUpdate=!0,this.updateSlots())}handleSlotMutations(e){let t=!1;e.forEach(i=>{const n=i.target.parentElement;if(n!=null&&n.hasAttribute("slot")){const r=n.getAttribute("slot"),a=n.hasChildNodes();a&&!this.filledSlots.has(r)?(this.filledSlots.add(r),t=!0):!a&&this.filledSlots.has(r)&&(this.filledSlots.delete(r),t=!0)}}),t&&typeof this.host.updateSlots=="function"&&this.host.updateSlots(this.filledSlots)}};/**
|
|
79
79
|
* @license
|
|
80
80
|
* Copyright 2020 Google LLC
|
|
81
81
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
82
|
-
*/const{I:
|
|
82
|
+
*/const{I:ol}=Vo,xr=s=>s.strings===void 0,Sr=()=>document.createComment(""),oi=(s,e,t)=>{var i;const n=s._$AA.parentNode,r=e===void 0?s._$AB:e._$AA;if(t===void 0){const a=n.insertBefore(Sr(),r),c=n.insertBefore(Sr(),r);t=new ol(a,c,s,s.options)}else{const a=t._$AB.nextSibling,c=t._$AM,h=c!==s;if(h){let p;(i=t._$AQ)==null||i.call(t,s),t._$AM=s,t._$AP!==void 0&&(p=s._$AU)!==c._$AU&&t._$AP(p)}if(a!==r||h){let p=t._$AA;for(;p!==a;){const v=p.nextSibling;n.insertBefore(p,r),p=v}}}return t},gs=(s,e,t=s)=>(s._$AI(e,t),s),ll={},Cr=(s,e=ll)=>s._$AH=e,cl=s=>s._$AH,yn=s=>{s._$AR(),s._$AA.remove()};/**
|
|
83
83
|
* @license
|
|
84
84
|
* Copyright 2017 Google LLC
|
|
85
85
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
86
|
-
*/const
|
|
86
|
+
*/const li=(s,e)=>{var t;const i=s._$AN;if(i===void 0)return!1;for(const n of i)(t=n._$AO)==null||t.call(n,e,!1),li(n,e);return!0},qi=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while((t==null?void 0:t.size)===0)},Tr=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),dl(e)}};function hl(s){this._$AN!==void 0?(qi(this),this._$AM=s,Tr(this)):this._$AM=s}function ul(s,e=!1,t=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(i))for(let r=t;r<i.length;r++)li(i[r],!1),qi(i[r]);else i!=null&&(li(i,!1),qi(i));else li(this,s)}const dl=s=>{s.type==Tt.CHILD&&(s._$AP??(s._$AP=ul),s._$AQ??(s._$AQ=hl))};let pl=class extends Is{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),Tr(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,n;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),t&&(li(this,e),qi(this))}setValue(e){if(xr(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};/**
|
|
87
87
|
* @license
|
|
88
88
|
* Copyright 2020 Google LLC
|
|
89
89
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
90
|
-
*/const
|
|
90
|
+
*/const L=()=>new fl;let fl=class{};const kn=new WeakMap,B=fs(class extends pl{render(s){return _}update(s,[e]){var t;const i=e!==this.G;return i&&this.G!==void 0&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=(t=s.options)==null?void 0:t.host,this.rt(this.ct=s.element)),_}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=kn.get(e);t===void 0&&(t=new WeakMap,kn.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){var s,e;return typeof this.G=="function"?(s=kn.get(this.ht??globalThis))==null?void 0:s.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Mr(s,e,t){const i=s.getAttribute("class")||"",n=new Set(i.split(/\s+/).filter(Boolean));t?n.add(e):n.delete(e),s.setAttribute("class",Array.from(n).join(" "))}/**
|
|
91
91
|
* @license
|
|
92
92
|
* Copyright 2017 Google LLC
|
|
93
93
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
94
|
-
*/let
|
|
94
|
+
*/let zi=class extends Is{constructor(e){if(super(e),this.it=_,e.type!==Tt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===_||e==null)return this._t=void 0,this.it=e;if(e===ht)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};zi.directiveName="unsafeHTML",zi.resultType=1;const Yi=fs(zi);/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let
|
|
98
|
+
*/let $n=class extends zi{};$n.directiveName="unsafeSVG",$n.resultType=2;const wn=fs($n);var gl=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,ci=(s,e,t,i)=>{for(var n=i>1?void 0:i?ml(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&gl(e,t,n),n};const _n="https://punkt-cdn.oslo.kommune.no/15.0/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||_n);const hi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',ui={},vl=2,bl=1500,Nr=typeof Storage<"u"&&typeof sessionStorage<"u",yl=s=>window.pktFetch(s).then(e=>{if(!e.ok)throw new Error("Missing icon: "+s);return e.text()}),Dr=async(s,e=vl)=>{try{return await yl(s)}catch{return e>0?(await new Promise(t=>setTimeout(t,bl)),Dr(s,e-1)):(console.error("Failed to fetch icon: "+s),hi)}},kl=async(s,e)=>{const t=e+s+".svg";return Nr&&sessionStorage.getItem(t)?sessionStorage.getItem(t):t in ui?ui[t]:typeof window<"u"&&typeof window.pktFetch=="function"?(ui[t]=Dr(t).then(i=>(i!==hi&&Nr&&sessionStorage.setItem(t,i),delete ui[t],i)),ui[t]):hi};let ms=class extends fe{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:_n,this.name="",this.icon=wn(hi),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),(e==="name"||e==="path")&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has("name")||e.has("path"))&&this.getIcon(this.name)}async getIcon(e=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:_n);try{this.icon=wn(await kl(this.name||"",this.path))}catch{this.icon=wn(hi)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return f`${this.name&&this.icon}`}};ci([o({type:String,reflect:!1})],ms.prototype,"path",2),ci([o({type:String,reflect:!0})],ms.prototype,"name",2),ci([o({type:SVGElement})],ms.prototype,"icon",2),ci([o({type:Array,noAccessor:!0})],ms.prototype,"_updatedProps",2),ms=ci([X("pkt-icon")],ms);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const
|
|
102
|
+
*/const N=s=>s??_;var $l=Object.defineProperty,wl=Object.getOwnPropertyDescriptor,Ye=(s,e,t,i)=>{for(var n=i>1?void 0:i?wl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&$l(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.0/animations/";let Fe=class extends fe{constructor(){super(),this.defaultSlot=L(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new Oe(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("keydown",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="disabled"&&i==="false"&&(this.disabled=!1),(e==="isloading"||e==="isLoading")&&i==="false"&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const e=this.form??this.getAttribute("form")??void 0,t={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return f`
|
|
103
103
|
<button
|
|
104
|
-
class=${
|
|
104
|
+
class=${A(t)}
|
|
105
105
|
type=${this.type}
|
|
106
106
|
?disabled=${!!this.disabled}
|
|
107
|
-
aria-busy=${
|
|
108
|
-
aria-disabled=${
|
|
109
|
-
form=${
|
|
107
|
+
aria-busy=${N(this.isLoading?"true":void 0)}
|
|
108
|
+
aria-disabled=${N(this.disabled||this.isLoading?"true":void 0)}
|
|
109
|
+
form=${N(e)}
|
|
110
110
|
>
|
|
111
|
-
${this.isLoading?
|
|
111
|
+
${this.isLoading?f`<pkt-icon
|
|
112
112
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
113
113
|
name="spinner-blue"
|
|
114
|
-
path=${
|
|
115
|
-
></pkt-icon>`:
|
|
116
|
-
${this.variant!=="label-only"?
|
|
114
|
+
path=${N(this.loadingAnimationPath)}
|
|
115
|
+
></pkt-icon>`:_}
|
|
116
|
+
${this.variant!=="label-only"?f`<pkt-icon
|
|
117
117
|
class="pkt-btn__icon pkt-icon"
|
|
118
118
|
name=${this.iconName}
|
|
119
|
-
path=${
|
|
120
|
-
></pkt-icon>`:
|
|
121
|
-
<span class="pkt-btn__text" ${
|
|
122
|
-
${this.variant==="icons-right-and-left"?
|
|
119
|
+
path=${N(this.iconPath)}
|
|
120
|
+
></pkt-icon>`:_}
|
|
121
|
+
<span class="pkt-btn__text" ${B(this.defaultSlot)}></span>
|
|
122
|
+
${this.variant==="icons-right-and-left"?f`<pkt-icon
|
|
123
123
|
class="pkt-btn__icon"
|
|
124
124
|
name=${this.secondIconName}
|
|
125
|
-
path=${
|
|
126
|
-
></pkt-icon>`:
|
|
125
|
+
path=${N(this.secondIconPath)}
|
|
126
|
+
></pkt-icon>`:_}
|
|
127
127
|
</button>
|
|
128
|
-
`}};
|
|
129
|
-
<div class=${
|
|
130
|
-
<div class=${
|
|
128
|
+
`}};Ye([o({type:String})],Fe.prototype,"iconName",2),Ye([o({type:String})],Fe.prototype,"secondIconName",2),Ye([o({type:String})],Fe.prototype,"iconPath",2),Ye([o({type:String})],Fe.prototype,"secondIconPath",2),Ye([o({type:String})],Fe.prototype,"mode",2),Ye([o({type:String})],Fe.prototype,"size",2),Ye([o({type:Boolean,attribute:"full-width"})],Fe.prototype,"fullWidth",2),Ye([o({type:Boolean,attribute:"full-width-on-mobile"})],Fe.prototype,"fullWidthOnMobile",2),Ye([o({type:String})],Fe.prototype,"color",2),Ye([o({type:String})],Fe.prototype,"skin",2),Ye([o({type:String})],Fe.prototype,"variant",2),Ye([o({type:String,reflect:!0})],Fe.prototype,"state",2),Ye([o({type:String,reflect:!0})],Fe.prototype,"type",2),Ye([o({type:String})],Fe.prototype,"form",2),Ye([o({type:Boolean,reflect:!0})],Fe.prototype,"isLoading",2),Ye([o({type:Boolean,reflect:!0})],Fe.prototype,"disabled",2),Ye([o({type:String})],Fe.prototype,"loadingAnimationPath",2),Fe=Ye([X("pkt-button")],Fe);const _l={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Ki={props:_l};var xl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,At=(s,e,t,i)=>{for(var n=i>1?void 0:i?Sl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&xl(e,t,n),n};let Mt=class extends fe{constructor(){super(),this.defaultSlot=L(),this.compact=Ki.props.compact.default,this.title="",this.skin=Ki.props.skin.default,this.ariaLive=Ki.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Ki.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new Oe(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,t,i){e==="ariaLive"&&(this["aria-live"]=i),super.attributeChangedCallback(e,t,i)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&Mr(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},t={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return f`
|
|
129
|
+
<div class=${A(e)} aria-live=${this["aria-live"]}>
|
|
130
|
+
<div class=${A(t)}>
|
|
131
131
|
<pkt-icon
|
|
132
132
|
class="pkt-alert__icon"
|
|
133
133
|
aria-hidden="true"
|
|
134
134
|
name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
|
|
135
135
|
></pkt-icon>
|
|
136
136
|
|
|
137
|
-
${this.closeAlert?
|
|
137
|
+
${this.closeAlert?f`
|
|
138
138
|
<div class="pkt-alert__close">
|
|
139
139
|
<pkt-button
|
|
140
140
|
tabindex="0"
|
|
@@ -149,30 +149,30 @@
|
|
|
149
149
|
<span class="sr-only">Lukk</span>
|
|
150
150
|
</pkt-button>
|
|
151
151
|
</div>
|
|
152
|
-
`:
|
|
153
|
-
${this.title?
|
|
152
|
+
`:_}
|
|
153
|
+
${this.title?f`<div class="pkt-alert__title">${this.title}</div>`:_}
|
|
154
154
|
|
|
155
|
-
<div class="pkt-alert__text" ${
|
|
155
|
+
<div class="pkt-alert__text" ${B(this.defaultSlot)}></div>
|
|
156
156
|
|
|
157
|
-
${this.date?
|
|
157
|
+
${this.date?f`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:_}
|
|
158
158
|
</div>
|
|
159
159
|
</div>
|
|
160
|
-
`}};
|
|
160
|
+
`}};At([o({type:Boolean,reflect:!1})],Mt.prototype,"compact",2),At([o({type:String,reflect:!0})],Mt.prototype,"title",2),At([o({type:String,reflect:!0})],Mt.prototype,"skin",2),At([o({type:String})],Mt.prototype,"ariaLive",2),At([o({type:String,reflect:!0})],Mt.prototype,"aria-live",2),At([o({type:Boolean,reflect:!0})],Mt.prototype,"closeAlert",2),At([o({type:String,reflect:!0})],Mt.prototype,"date",2),At([o({type:String,reflect:!0})],Mt.prototype,"role",2),At([q()],Mt.prototype,"_isClosed",2),Mt=At([X("pkt-alert")],Mt);var Cl=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,di=(s,e,t,i)=>{for(var n=i>1?void 0:i?Tl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Cl(e,t,n),n};let Bs=class extends As{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(e){e.has("skin")&&this.requestUpdate(),e.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var e;if(this.name){const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.assignedElements().forEach(i=>{i.tagName.toLowerCase()==="pkt-accordion-item"&&(i.hasAttribute("name")||i.setAttribute("name",this.name))})}}firstUpdated(){var e;const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const e={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return f`
|
|
161
161
|
<div
|
|
162
162
|
part="container"
|
|
163
|
-
class=${
|
|
163
|
+
class=${A(e)}
|
|
164
164
|
data-testid="pkt-accordion"
|
|
165
165
|
aria-labelledby=${this.ariaLabelledBy}
|
|
166
166
|
>
|
|
167
167
|
<slot></slot>
|
|
168
168
|
</div>
|
|
169
|
-
`}};
|
|
169
|
+
`}};di([o({type:String,reflect:!0,attribute:"aria-labelledby"})],Bs.prototype,"ariaLabelledBy",2),di([o({type:Boolean,reflect:!0,attribute:"compact"})],Bs.prototype,"compact",2),di([o({type:String,reflect:!0,attribute:"skin"})],Bs.prototype,"skin",2),di([o({type:String,reflect:!0,attribute:"name"})],Bs.prototype,"name",2),Bs=di([X("pkt-accordion")],Bs);var Ml=Object.defineProperty,Nl=Object.getOwnPropertyDescriptor,vs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Nl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ml(e,t,n),n};let es=class extends fe{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=L(),this.defaultSlot=L(),this.slotController=new Oe(this,this.defaultSlot)}firstUpdated(e){this.defaultOpen&&(this.isOpen=!0)}render(){const e={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return f`
|
|
170
170
|
<details
|
|
171
|
-
class=${
|
|
171
|
+
class=${A(e)}
|
|
172
172
|
id=${this.id}
|
|
173
173
|
?open=${this.isOpen}
|
|
174
|
-
${
|
|
175
|
-
name=${
|
|
174
|
+
${B(this.accordionItemRef)}
|
|
175
|
+
name=${N(this.name)}
|
|
176
176
|
>
|
|
177
177
|
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
178
178
|
${this.title}
|
|
@@ -187,14 +187,14 @@
|
|
|
187
187
|
id="pkt-accordion-item__content-${this.id}"
|
|
188
188
|
role="region"
|
|
189
189
|
>
|
|
190
|
-
<div class="pkt-accordion-item__content-inner" ${
|
|
190
|
+
<div class="pkt-accordion-item__content-inner" ${B(this.defaultSlot)}></div>
|
|
191
191
|
</div>
|
|
192
192
|
</details>
|
|
193
|
-
`}};
|
|
193
|
+
`}};vs([o({type:Boolean})],es.prototype,"defaultOpen",2),vs([o({type:String})],es.prototype,"title",2),vs([o({type:String,reflect:!0})],es.prototype,"skin",2),vs([o({type:Boolean,reflect:!0})],es.prototype,"compact",2),vs([o({type:Boolean,reflect:!0})],es.prototype,"isOpen",2),vs([o({type:String,reflect:!0})],es.prototype,"name",2),es=vs([X("pkt-accordion-item")],es);var Dl=Object.defineProperty,Ol=Object.getOwnPropertyDescriptor,Ri=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ol(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Dl(e,t,n),n};let Fs=class extends fe{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(e,t,i){e==="arialabel"&&this.removeAttribute("arialabel"),e==="href"&&this.removeAttribute("href"),e==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(e,t,i)}render(){return f`<nav
|
|
194
194
|
class="pkt-back-link"
|
|
195
195
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
196
196
|
>
|
|
197
|
-
<a href=${
|
|
197
|
+
<a href=${N(this.href||"/")} class="pkt-link pkt-link--icon-left"
|
|
198
198
|
><pkt-icon
|
|
199
199
|
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
200
200
|
name="chevron-thin-left"
|
|
@@ -202,11 +202,11 @@
|
|
|
202
202
|
></pkt-icon
|
|
203
203
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
204
204
|
>
|
|
205
|
-
</nav>`}};vi([o({type:String})],hs.prototype,"href",2),vi([o({type:String})],hs.prototype,"text",2),vi([o({type:String})],hs.prototype,"ariaLabel",2),hs=vi([H("pkt-backlink")],hs);const qn=6048e5,go=864e5,Wn=Symbol.for("constructDateFrom");function le(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&Wn in s?s[Wn](t):s instanceof Date?new s.constructor(t):new Date(t)}function Bt(s,t){return le(t||s,s)}function Rn(s,t,e){const i=Bt(s,void 0);return isNaN(t)?le(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let mo={};function bi(){return mo}function Vs(s,t){var e,i,n,a;const r=bi(),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??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.weekStartsOn)??0,d=Bt(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 ki(s,t){return Vs(s,{...t,weekStartsOn:1})}function Kn(s,t){const e=Bt(s,void 0),i=e.getFullYear(),n=le(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=ki(n),r=le(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=ki(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Yn(s){const t=Bt(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 Gn(s,...t){const e=le.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Zn(s,t){const e=Bt(s,void 0);return e.setHours(0,0,0,0),e}function vo(s,t,e){const[i,n]=Gn(void 0,s,t),a=Zn(i),r=Zn(n),h=+a-Yn(a),d=+r-Yn(r);return Math.round((h-d)/go)}function bo(s,t){const e=Kn(s),i=le(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ki(i)}function ko(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function yo(s){return!(!ko(s)&&typeof s!="number"||isNaN(+Bt(s)))}function $o(s,t){const[e,i]=Gn(s,t.start,t.end);return{start:e,end:i}}function Xn(s,t){const{start:e,end:i}=$o(void 0,s);let n=+e>+i;const a=n?+e:+i,r=n?i:e;r.setHours(0,0,0,0);let h=1;const d=[];for(;+r<=a;)d.push(le(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?d.reverse():d}function _o(s,t){const e=Bt(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const wo={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"}},xo=(s,t,e)=>{let i;const n=wo[s];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ui(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const So={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Co={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},To={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},No={date:Ui({formats:So,defaultWidth:"full"}),time:Ui({formats:Co,defaultWidth:"full"}),dateTime:Ui({formats:To,defaultWidth:"full"})},Eo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Mo=(s,t,e,i)=>Eo[s];function Hs(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;n=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;n=s.values[h]||s.values[r]}const a=s.argumentCallback?s.argumentCallback(t):t;return n[a]}}const Ao={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Oo={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Po={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"]},Do={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"]},Io={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"}},Lo={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"}},Bo=(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"},Fo={ordinalNumber:Bo,era:Hs({values:Ao,defaultWidth:"wide"}),quarter:Hs({values:Oo,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Hs({values:Po,defaultWidth:"wide"}),day:Hs({values:Do,defaultWidth:"wide"}),dayPeriod:Hs({values:Io,defaultWidth:"wide",formattingValues:Lo,defaultFormattingWidth:"wide"})};function js(s){return(t,e={})=>{const i=e.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],a=t.match(n);if(!a)return null;const r=a[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(h)?Ho(h,v=>v.test(r)):Vo(h,v=>v.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 Vo(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function Ho(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function jo(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const n=i[0],a=t.match(s.parsePattern);if(!a)return null;let r=s.valueCallback?s.valueCallback(a[0]):a[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(n.length);return{value:r,rest:h}}}const Uo=/^(\d+)(th|st|nd|rd)?/i,zo=/\d+/i,qo={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},Wo={any:[/^b/i,/^(a|c)/i]},Ro={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ko={any:[/1/i,/2/i,/3/i,/4/i]},Yo={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},Go={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]},Zo={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},Xo={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]},Jo={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},Qo={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}},tl={ordinalNumber:jo({matchPattern:Uo,parsePattern:zo,valueCallback:s=>parseInt(s,10)}),era:js({matchPatterns:qo,defaultMatchWidth:"wide",parsePatterns:Wo,defaultParseWidth:"any"}),quarter:js({matchPatterns:Ro,defaultMatchWidth:"wide",parsePatterns:Ko,defaultParseWidth:"any",valueCallback:s=>s+1}),month:js({matchPatterns:Yo,defaultMatchWidth:"wide",parsePatterns:Go,defaultParseWidth:"any"}),day:js({matchPatterns:Zo,defaultMatchWidth:"wide",parsePatterns:Xo,defaultParseWidth:"any"}),dayPeriod:js({matchPatterns:Jo,defaultMatchWidth:"any",parsePatterns:Qo,defaultParseWidth:"any"})},el={code:"en-US",formatDistance:xo,formatLong:No,formatRelative:Mo,localize:Fo,match:tl,options:{weekStartsOn:0,firstWeekContainsDate:1}};function sl(s,t){const e=Bt(s,void 0);return vo(e,_o(e))+1}function il(s,t){const e=Bt(s,void 0),i=+ki(e)-+bo(e);return Math.round(i/qn)+1}function Jn(s,t){var e,i,n,a;const r=Bt(s,t==null?void 0:t.in),h=r.getFullYear(),d=bi(),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??((a=(n=d.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,m=le((t==null?void 0:t.in)||s,0);m.setFullYear(h+1,0,p),m.setHours(0,0,0,0);const v=Vs(m,t),y=le((t==null?void 0:t.in)||s,0);y.setFullYear(h,0,p),y.setHours(0,0,0,0);const $=Vs(y,t);return+r>=+v?h+1:+r>=+$?h:h-1}function nl(s,t){var e,i,n,a;const r=bi(),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??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,d=Jn(s,t),p=le((t==null?void 0:t.in)||s,0);return p.setFullYear(d,0,h),p.setHours(0,0,0,0),Vs(p,t)}function Qn(s,t){const e=Bt(s,t==null?void 0:t.in),i=+Vs(e,t)-+nl(e,t);return Math.round(i/qn)+1}function Y(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Te={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return Y(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):Y(e+1,2)},d(s,t){return Y(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 Y(s.getHours()%12||12,t.length)},H(s,t){return Y(s.getHours(),t.length)},m(s,t){return Y(s.getMinutes(),t.length)},s(s,t){return Y(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return Y(n,t.length)}},cs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ta={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(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return Te.y(s,t)},Y:function(s,t,e,i){const n=Jn(s,i),a=n>0?n:1-n;if(t==="YY"){const r=a%100;return Y(r,2)}return t==="Yo"?e.ordinalNumber(a,{unit:"year"}):Y(a,t.length)},R:function(s,t){const e=Kn(s);return Y(e,t.length)},u:function(s,t){const e=s.getFullYear();return Y(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 Y(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 Y(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 Te.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 Y(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 n=Qn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Y(n,t.length)},I:function(s,t,e){const i=il(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Y(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):Te.d(s,t)},D:function(s,t,e){const i=sl(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Y(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 n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Y(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Y(a,t.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return Y(n,t.length);case"io":return e.ordinalNumber(n,{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 n;switch(i===12?n=cs.noon:i===0?n=cs.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let n;switch(i>=17?n=cs.evening:i>=12?n=cs.afternoon:i>=4?n=cs.morning:n=cs.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{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 Te.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Te.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Y(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Y(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):Te.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Te.s(s,t)},S:function(s,t){return Te.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return sa(i);case"XXXX":case"XX":return Ue(i);case"XXXXX":case"XXX":default:return Ue(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return sa(i);case"xxxx":case"xx":return Ue(i);case"xxxxx":case"xxx":default:return Ue(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ea(i,":");case"OOOO":default:return"GMT"+Ue(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ea(i,":");case"zzzz":default:return"GMT"+Ue(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return Y(i,t.length)},T:function(s,t,e){return Y(+s,t.length)}};function ea(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),a=i%60;return a===0?e+String(n):e+String(n)+t+Y(a,2)}function sa(s,t){return s%60===0?(s>0?"-":"+")+Y(Math.abs(s)/60,2):Ue(s,t)}function Ue(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=Y(Math.trunc(i/60),2),a=Y(i%60,2);return e+n+t+a}const ia=(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"})}},na=(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"})}},al=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return ia(s,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",ia(i,t)).replace("{{time}}",na(n,t))},rl={p:na,P:al},ol=/^D+$/,ll=/^Y+$/,hl=["D","DD","YY","YYYY"];function cl(s){return ol.test(s)}function dl(s){return ll.test(s)}function ul(s,t,e){const i=pl(s,t,e);if(console.warn(i),hl.includes(s))throw new RangeError(i)}function pl(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 fl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ml=/^'([^]*?)'?$/,vl=/''/g,bl=/[a-zA-Z]/;function kl(s,t,e){var i,n,a,r;const h=bi(),d=h.locale??el,p=h.firstWeekContainsDate??((n=(i=h.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,m=h.weekStartsOn??((r=(a=h.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??0,v=Bt(s,void 0);if(!yo(v))throw new RangeError("Invalid time value");let y=t.match(gl).map(b=>{const x=b[0];if(x==="p"||x==="P"){const T=rl[x];return T(b,d.formatLong)}return b}).join("").match(fl).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const x=b[0];if(x==="'")return{isToken:!1,value:yl(b)};if(ta[x])return{isToken:!0,value:b};if(x.match(bl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:b}});d.localize.preprocessor&&(y=d.localize.preprocessor(v,y));const $={firstWeekContainsDate:p,weekStartsOn:m,locale:d};return y.map(b=>{if(!b.isToken)return b.value;const x=b.value;(dl(x)||cl(x))&&ul(x,t,String(s));const T=ta[x[0]];return T(v,x,d.localize,$)}).join("")}function yl(s){const t=s.match(ml);return t?t[1].replace(vl,"'"):s}function $l(s,t){const e=Bt(s,void 0).getDay();return e===0?7:e}function _l(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 aa={},Us={};function ze(s,t){try{const e=(aa[s]||(aa[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Us?Us[e]:ra(e,e.split(":"))}catch{if(s in Us)return Us[s];const e=s==null?void 0:s.match(wl);return e?ra(s,e.slice(1)):NaN}}const wl=/([+-]\d\d):?(\d\d)?/;function ra(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Us[s]=e*60+i>0?e*60+i+n:e*60-i-n}let zs=class ni extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ze(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)),la(this),zi(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new ni(...e,t):new ni(Date.now(),t)}withTimeZone(t){return new ni(+this,t)}getTimezoneOffset(){const t=-ze(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),zi(this),+this}[Symbol.for("constructDateFrom")](t){return new ni(+new Date(t),this.timeZone)}};const oa=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!oa.test(s))return;const t=s.replace(oa,"$1UTC");zs.prototype[t]&&(s.startsWith("get")?zs.prototype[s]=function(){return this.internal[t]()}:(zs.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),xl(this),+this},zs.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),zi(this),+this}))});function zi(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ze(s.timeZone,s)*60))}function xl(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()),la(s)}function la(s){const t=ze(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),a=-new Date(+i).getTimezoneOffset(),r=n-a,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const d=n-e;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(ze(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const y=ze(s.timeZone,s),$=y>0?Math.floor(y):Math.ceil(y),b=-new Date(+s).getTimezoneOffset()-$,x=$!==e,T=b-d;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const M=ze(s.timeZone,s),S=M>0?Math.floor(M):Math.ceil(M),B=$-S;B&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+B),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+B))}}let qi=class ai extends zs{static tz(t,...e){return e.length?new ai(...e,t):new ai(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),n=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,n]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${n}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,n]=this.tzComponents();return`${t} GMT${e}${i}${n} (${_l(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"),n=String(Math.abs(t)%60).padStart(2,"0");return[e,i,n]}withTimeZone(t){return new ai(+this,t)}[Symbol.for("constructDateFrom")](t){return new ai(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Sl=(s=window.pktTz)=>{const t=new qi(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 Ne(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 bt=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}`},Ee=s=>{if(!s)return null;const t=Ne(s);return isNaN(t.getTime())?null:t},ha=(s,t)=>{const e=me(s);return isNaN(e.getTime())?"":kl(e,t)},me=(s="",t)=>{const e=typeof s=="string"?Ne(s):s;return!e||isNaN(e.getTime())?new Date:e},qe=(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},qs=s=>{let t;return typeof s=="number"?t=new qi(s,window.pktTz):t=new qi(s,window.pktTz),t.setHours(12,0,0,0),t},Cl=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),Tl=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?me(t):null,n=e?me(e):null;return!(i&&s<i||n&&s>n)},Nl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=bt(s);return t.includes(e)},El=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ca=(s,t,e,i,n)=>!(!s||isNaN(s.getTime())||!Tl(s,t,e)||i&&Nl(s,i)||n&&El(s,n)),Ml=(s,t,e,i,n)=>s.filter(a=>{const r=Ee(a);return r&&ca(r,t,e,i,n)}),da=s=>s.slice().sort((t,e)=>{const i=Ee(t),n=Ee(e);return!i||!n?0:i.getTime()-n.getTime()}),Al=(s,t)=>{const e=Ee(s),i=Ee(t);return!e||!i?!1:e<=i},Ws=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],Ol=s=>s.join(","),Pl=s=>Ws(s),Dl=s=>s?Ne(s):null,Il=s=>{if(typeof s=="string")return s.split(",").map(t=>Ne(t));if(Array.isArray(s))return s.map(t=>Ne(t))},ds={csvToArray:Pl,stringToDate:Dl,stringsToDate:Il},Ll={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},We={props:Ll};function ua(s,t){const e=t.excludedates.map(i=>typeof i=="string"?i:bt(i));return!ca(s,t.earliest,t.latest,e,t.excludeweekdays)}function Bl(s,t,e,i){return!!(ua(s,e)||!t&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function Fl(s,t,e){const i=qe(s,t,0);return!(e&&me(e)>i)}function Vl(s,t,e){const i=qe(t===11?s+1:s,t===11?0:t+1,1);return!(e&&me(e)<i)}const Rs=7,Hl=6;function jl(s,t){const e=qe(s,t,1),i=qe(s,t+1,0),n=(e.getDay()+Hl)%Rs,a=i.getDate(),r=Math.ceil((a+n)/Rs),h=qe(s,t,0).getDate(),d=Qn(e);return{firstDayOfMonth:e,lastDayOfMonth:i,startingDay:n,numDays:a,numRows:r,numDaysPrevMonth:h,initialWeek:d}}function Ul(s,t,e,i){const{startingDay:n,numDays:a}=i;return s===0&&t<n?"prev-month":e>a?"next-month":"current-month"}function zl(s,t,e,i){const{startingDay:n,numDaysPrevMonth:a,numDays:r}=i;return s==="prev-month"?a-(n-t-1):s==="next-month"?e-r:e}function us(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(t=>Ne(t))}function pa(s,t){const e=Xn({start:s,end:t}),i={};if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n++){const a=e[n],r=a>s&&a<t;i[bt(a)]=r}return i}function fa(s,t,e,i){if(t.length!==1)return!0;const n=Xn({start:t[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let a=0;a<n.length;a++){for(const r of e)if(r>t[0]&&r<s)return!1;if(i.includes($l(n[a]).toString()))return!1}return!0}function Wi(s,t){const e=bt(s);return t.includes(e)?t:[...t,e]}function Ri(s,t){const e=bt(s),i=t.indexOf(e);if(i===-1)return t;if(t.length===1)return[];const n=[...t];return n.splice(i,1),n}function ql(s,t,e){const i=bt(s);return t.includes(i)?Ri(s,t):e>0&&t.length>=e?t:Wi(s,t)}function Wl(s,t,e){const i=bt(s),n=us(t);if(t.includes(i))return t.indexOf(i)===0?[]:Ri(s,t);if(t.length>1)return[i];if(t.length===1){if(!fa(s,n,e.excludedates,e.excludeweekdays))return[i];if(n[0]>s)return[i]}return Wi(s,t)}const Rl={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Rs,ArrowDown:Rs};function Kl(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Yl(s,t,e){let i=Rn(s,t);if(!i)return null;let n=e(`button[data-date="${bt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Rn(i,t),n=e(`button[data-date="${bt(i)}"]`),!n)return null;return i}function Gl(s){return Rl[s]??null}var Zl=Object.defineProperty,Xl=Object.getOwnPropertyDescriptor,X=(s,t,e,i)=>{for(var n=i>1?void 0:i?Xl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Zl(t,e,n),n};let G=class extends J{constructor(){super(...arguments),this.selected=[],this.multiple=We.props.multiple.default,this.maxMultiple=We.props.maxMultiple.default,this.range=We.props.range.default,this.earliest=We.props.earliest.default,this.latest=We.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=We.props.weeknumbers.default,this.withcontrols=We.props.withcontrols.default,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.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=us(this.selected),this.range&&this.selected.length===2&&(this.inRange=pa(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=Ne(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?qs(new Date):t}else this.currentmonth===null&&(this.currentmonth=qs(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=qs(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const e=Gl(t.key);e!==null&&this.handleArrowKey(t,e)}handleArrowKey(t,e){const i=t.target;if(Kl(i))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?me(this.focusedDate):qe(this.year,this.month,1),a=Yl(n,e,this.querySelector.bind(this));if(a){const r=this.querySelector(`button[data-date="${bt(a)}"]`);r instanceof HTMLButtonElement&&!r.dataset.disabled&&(this.focusedDate=bt(a),r.focus())}}render(){return u`
|
|
205
|
+
</nav>`}};Ri([o({type:String})],Fs.prototype,"href",2),Ri([o({type:String})],Fs.prototype,"text",2),Ri([o({type:String})],Fs.prototype,"ariaLabel",2),Fs=Ri([X("pkt-backlink")],Fs);const Or=6048e5,El=864e5,Er=Symbol.for("constructDateFrom");function It(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Er in s?s[Er](e):s instanceof Date?new s.constructor(e):new Date(e)}function bt(s,e){return It(e||s,s)}function Pr(s,e,t){const i=bt(s,void 0);return isNaN(e)?It(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Pl={};function Gi(){return Pl}function pi(s,e){var t,i,n,r;const a=Gi(),c=(e==null?void 0:e.weekStartsOn)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,h=bt(s,e==null?void 0:e.in),p=h.getDay(),v=(p<c?7:0)+p-c;return h.setDate(h.getDate()-v),h.setHours(0,0,0,0),h}function Xi(s,e){return pi(s,{...e,weekStartsOn:1})}function Ar(s,e){const t=bt(s,void 0),i=t.getFullYear(),n=It(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=Xi(n),a=It(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=Xi(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=c.getTime()?i:i-1}function Ir(s){const e=bt(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function Lr(s,...e){const t=It.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Br(s,e){const t=bt(s,void 0);return t.setHours(0,0,0,0),t}function Al(s,e,t){const[i,n]=Lr(void 0,s,e),r=Br(i),a=Br(n),c=+r-Ir(r),h=+a-Ir(a);return Math.round((c-h)/El)}function Il(s,e){const t=Ar(s),i=It(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),Xi(i)}function Ll(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Bl(s){return!(!Ll(s)&&typeof s!="number"||isNaN(+bt(s)))}function Fl(s,e){const[t,i]=Lr(s,e.start,e.end);return{start:t,end:i}}function Fr(s,e){const{start:t,end:i}=Fl(void 0,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let c=1;const h=[];for(;+a<=r;)h.push(It(t,a)),a.setDate(a.getDate()+c),a.setHours(0,0,0,0);return n?h.reverse():h}function Hl(s,e){const t=bt(s,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Vl={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"}},jl=(s,e,t)=>{let i;const n=Vl[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function xn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Ul={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Wl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ql={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zl={date:xn({formats:Ul,defaultWidth:"full"}),time:xn({formats:Wl,defaultWidth:"full"}),dateTime:xn({formats:ql,defaultWidth:"full"})},Yl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Kl=(s,e,t,i)=>Yl[s];function fi(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,c=t!=null&&t.width?String(t.width):a;n=s.formattingValues[c]||s.formattingValues[a]}else{const a=s.defaultWidth,c=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[c]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const Rl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Gl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xl={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"]},Ql={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"]},Zl={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"}},Jl={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"}},ec=(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},tc={ordinalNumber:ec,era:fi({values:Rl,defaultWidth:"wide"}),quarter:fi({values:Gl,defaultWidth:"wide",argumentCallback:s=>s-1}),month:fi({values:Xl,defaultWidth:"wide"}),day:fi({values:Ql,defaultWidth:"wide"}),dayPeriod:fi({values:Zl,defaultWidth:"wide",formattingValues:Jl,defaultFormattingWidth:"wide"})};function gi(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],c=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],h=Array.isArray(c)?ic(c,b=>b.test(a)):sc(c,b=>b.test(a));let p;p=s.valueCallback?s.valueCallback(h):h,p=t.valueCallback?t.valueCallback(p):p;const v=e.slice(a.length);return{value:p,rest:v}}}function sc(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function ic(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function nc(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const c=e.slice(n.length);return{value:a,rest:c}}}const rc=/^(\d+)(th|st|nd|rd)?/i,ac=/\d+/i,oc={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},lc={any:[/^b/i,/^(a|c)/i]},cc={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hc={any:[/1/i,/2/i,/3/i,/4/i]},uc={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},dc={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]},pc={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},fc={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]},gc={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},mc={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}},vc={ordinalNumber:nc({matchPattern:rc,parsePattern:ac,valueCallback:s=>parseInt(s,10)}),era:gi({matchPatterns:oc,defaultMatchWidth:"wide",parsePatterns:lc,defaultParseWidth:"any"}),quarter:gi({matchPatterns:cc,defaultMatchWidth:"wide",parsePatterns:hc,defaultParseWidth:"any",valueCallback:s=>s+1}),month:gi({matchPatterns:uc,defaultMatchWidth:"wide",parsePatterns:dc,defaultParseWidth:"any"}),day:gi({matchPatterns:pc,defaultMatchWidth:"wide",parsePatterns:fc,defaultParseWidth:"any"}),dayPeriod:gi({matchPatterns:gc,defaultMatchWidth:"any",parsePatterns:mc,defaultParseWidth:"any"})},bc={code:"en-US",formatDistance:jl,formatLong:zl,formatRelative:Kl,localize:tc,match:vc,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yc(s,e){const t=bt(s,void 0);return Al(t,Hl(t))+1}function kc(s,e){const t=bt(s,void 0),i=+Xi(t)-+Il(t);return Math.round(i/Or)+1}function Hr(s,e){var t,i,n,r;const a=bt(s,e==null?void 0:e.in),c=a.getFullYear(),h=Gi(),p=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??h.firstWeekContainsDate??((r=(n=h.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,v=It((e==null?void 0:e.in)||s,0);v.setFullYear(c+1,0,p),v.setHours(0,0,0,0);const b=pi(v,e),y=It((e==null?void 0:e.in)||s,0);y.setFullYear(c,0,p),y.setHours(0,0,0,0);const k=pi(y,e);return+a>=+b?c+1:+a>=+k?c:c-1}function $c(s,e){var t,i,n,r;const a=Gi(),c=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,h=Hr(s,e),p=It((e==null?void 0:e.in)||s,0);return p.setFullYear(h,0,c),p.setHours(0,0,0,0),pi(p,e)}function Vr(s,e){const t=bt(s,e==null?void 0:e.in),i=+pi(t,e)-+$c(t,e);return Math.round(i/Or)+1}function he(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const ts={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return he(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):he(t+1,2)},d(s,e){return he(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return he(s.getHours()%12||12,e.length)},H(s,e){return he(s.getHours(),e.length)},m(s,e){return he(s.getMinutes(),e.length)},s(s,e){return he(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return he(n,e.length)}},Hs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},jr={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return ts.y(s,e)},Y:function(s,e,t,i){const n=Hr(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return he(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):he(r,e.length)},R:function(s,e){const t=Ar(s);return he(t,e.length)},u:function(s,e){const t=s.getFullYear();return he(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return he(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return he(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return ts.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return he(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Vr(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):he(n,e.length)},I:function(s,e,t){const i=kc(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):he(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):ts.d(s,e)},D:function(s,e,t){const i=yc(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):he(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return he(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return he(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return he(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(s,e,t){const i=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,e,t){const i=s.getHours();let n;switch(i===12?n=Hs.noon:i===0?n=Hs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Hs.evening:i>=12?n=Hs.afternoon:i>=4?n=Hs.morning:n=Hs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return ts.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):ts.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):he(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):he(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):ts.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):ts.s(s,e)},S:function(s,e){return ts.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Wr(i);case"XXXX":case"XX":return bs(i);case"XXXXX":case"XXX":default:return bs(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return Wr(i);case"xxxx":case"xx":return bs(i);case"xxxxx":case"xxx":default:return bs(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ur(i,":");case"OOOO":default:return"GMT"+bs(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ur(i,":");case"zzzz":default:return"GMT"+bs(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return he(i,e.length)},T:function(s,e,t){return he(+s,e.length)}};function Ur(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+he(r,2)}function Wr(s,e){return s%60===0?(s>0?"-":"+")+he(Math.abs(s)/60,2):bs(s,e)}function bs(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=he(Math.trunc(i/60),2),r=he(i%60,2);return t+n+e+r}const qr=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},zr=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},wc=(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return qr(s,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",qr(i,e)).replace("{{time}}",zr(n,e))},_c={p:zr,P:wc},xc=/^D+$/,Sc=/^Y+$/,Cc=["D","DD","YY","YYYY"];function Tc(s){return xc.test(s)}function Mc(s){return Sc.test(s)}function Nc(s,e,t){const i=Dc(s,e,t);if(console.warn(i),Cc.includes(s))throw new RangeError(i)}function Dc(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Oc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ec=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pc=/^'([^]*?)'?$/,Ac=/''/g,Ic=/[a-zA-Z]/;function Lc(s,e,t){var i,n,r,a;const c=Gi(),h=c.locale??bc,p=c.firstWeekContainsDate??((n=(i=c.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,v=c.weekStartsOn??((a=(r=c.locale)==null?void 0:r.options)==null?void 0:a.weekStartsOn)??0,b=bt(s,void 0);if(!Bl(b))throw new RangeError("Invalid time value");let y=e.match(Ec).map(m=>{const w=m[0];if(w==="p"||w==="P"){const C=_c[w];return C(m,h.formatLong)}return m}).join("").match(Oc).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const w=m[0];if(w==="'")return{isToken:!1,value:Bc(m)};if(jr[w])return{isToken:!0,value:m};if(w.match(Ic))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:m}});h.localize.preprocessor&&(y=h.localize.preprocessor(b,y));const k={firstWeekContainsDate:p,weekStartsOn:v,locale:h};return y.map(m=>{if(!m.isToken)return m.value;const w=m.value;(Mc(w)||Tc(w))&&Nc(w,e,String(s));const C=jr[w[0]];return C(b,w,h.localize,k)}).join("")}function Bc(s){const e=s.match(Pc);return e?e[1].replace(Ac,"'"):s}function Fc(s,e){const t=bt(s,void 0).getDay();return t===0?7:t}function Hc(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const Yr={},mi={};function ys(s,e){try{const t=(Yr[s]||(Yr[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return t in mi?mi[t]:Kr(t,t.split(":"))}catch{if(s in mi)return mi[s];const t=s==null?void 0:s.match(Vc);return t?Kr(s,t.slice(1)):NaN}}const Vc=/([+-]\d\d):?(\d\d)?/;function Kr(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return mi[s]=t*60+i>0?t*60+i+n:t*60-i-n}let vi=class Ii extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ys(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Gr(this),Sn(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ii(...t,e):new Ii(Date.now(),e)}withTimeZone(e){return new Ii(+this,e)}getTimezoneOffset(){const e=-ys(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Sn(this),+this}[Symbol.for("constructDateFrom")](e){return new Ii(+new Date(e),this.timeZone)}};const Rr=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Rr.test(s))return;const e=s.replace(Rr,"$1UTC");vi.prototype[e]&&(s.startsWith("get")?vi.prototype[s]=function(){return this.internal[e]()}:(vi.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),jc(this),+this},vi.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Sn(this),+this}))});function Sn(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ys(s.timeZone,s)*60))}function jc(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()),Gr(s)}function Gr(s){const e=ys(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,c=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&c&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const h=n-t;h&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+h);const p=new Date(+s);p.setUTCSeconds(0);const v=n>0?p.getSeconds():(p.getSeconds()-60)%60,b=Math.round(-(ys(s.timeZone,s)*60))%60;(b||v)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+b+v));const y=ys(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),m=-new Date(+s).getTimezoneOffset()-k,w=k!==t,C=m-h;if(w&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const M=ys(s.timeZone,s),S=M>0?Math.floor(M):Math.ceil(M),O=k-S;O&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+O),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+O))}}let Cn=class Li extends vi{static tz(e,...t){return t.length?new Li(...t,e):new Li(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${Hc(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new Li(+this,e)}[Symbol.for("constructDateFrom")](e){return new Li(+new Date(e),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Uc=(s=window.pktTz)=>{const e=new Cn(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function zt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const He=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},ss=s=>{if(!s)return null;const e=zt(s);return isNaN(e.getTime())?null:e},Xr=(s,e)=>{const t=_t(s);return isNaN(t.getTime())?"":Lc(t,e)},_t=(s="",e)=>{const t=typeof s=="string"?zt(s):s;return!t||isNaN(t.getTime())?new Date:t},ks=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},bi=s=>{let e;return typeof s=="number"?e=new Cn(s,window.pktTz):e=new Cn(s,window.pktTz),e.setHours(12,0,0,0),e};let Tn=null,Qr;const Wc=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Tn||Qr!==e)&&(Tn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),Qr=e),Tn.format(s)},qc=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?_t(e):null,n=t?_t(t):null;return!(i&&s<i||n&&s>n)},zc=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=He(s);return e.includes(t)},Yc=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},Zr=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!qc(s,e,t)||i&&zc(s,i)||n&&Yc(s,n)),Kc=(s,e,t,i,n)=>s.filter(r=>{const a=ss(r);return a&&Zr(a,e,t,i,n)}),Jr=s=>s.slice().sort((e,t)=>{const i=ss(e),n=ss(t);return!i||!n?0:i.getTime()-n.getTime()}),Rc=(s,e)=>{const t=ss(s),i=ss(e);return!t||!i?!1:t<=i},yi=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[],Gc=s=>s.join(","),Xc=s=>yi(s),Qc=s=>s?zt(s):null,Zc=s=>{if(typeof s=="string")return s.split(",").map(e=>zt(e));if(Array.isArray(s))return s.map(e=>zt(e))},Vs={csvToArray:Xc,stringToDate:Qc,stringsToDate:Zc},Jc={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},$s={props:Jc};function ea(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:He(i));return!Zr(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function eh(s,e,t,i){return!!(ea(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function th(s,e,t){const i=ks(s,e,0);return!(t&&_t(t)>i)}function sh(s,e,t){const i=ks(e===11?s+1:s,e===11?0:e+1,1);return!(t&&_t(t)<i)}const ki=7,ih=6;function nh(s,e){const t=ks(s,e,1),i=ks(s,e+1,0),n=(t.getDay()+ih)%ki,r=i.getDate(),a=Math.ceil((r+n)/ki),c=ks(s,e,0).getDate(),h=Vr(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:c,initialWeek:h}}function rh(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function ah(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}function js(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>zt(e))}function ta(s,e){const t=Fr({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[He(r)]=a}return i}function sa(s,e,t,i){if(e.length!==1)return!0;const n=Fr({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(Fc(n[r]).toString()))return!1}return!0}function Mn(s,e){const t=He(s);return e.includes(t)?e:[...e,t]}function Nn(s,e){const t=He(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function oh(s,e,t){const i=He(s);return e.includes(i)?Nn(s,e):t>0&&e.length>=t?e:Mn(s,e)}function lh(s,e,t){const i=He(s),n=js(e);if(e.includes(i))return e.indexOf(i)===0?[]:Nn(s,e);if(e.length>1)return[i];if(e.length===1){if(!sa(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return Mn(s,e)}const ch={ArrowLeft:-1,ArrowRight:1,ArrowUp:-ki,ArrowDown:ki};function hh(s){var e;const t=s.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((e=s.dataset)!=null&&e.date)}function uh(s,e,t){let i=Pr(s,e);if(!i)return null;let n=t(`button[data-date="${He(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Pr(i,e),n=t(`button[data-date="${He(i)}"]`),!n)return null;return i}function dh(s){return ch[s]??null}var ph=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,ge=(s,e,t,i)=>{for(var n=i>1?void 0:i?fh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ph(e,t,n),n};let de=class extends fe{constructor(){super(...arguments),this.selected=[],this.multiple=$s.props.multiple.default,this.maxMultiple=$s.props.maxMultiple.default,this.range=$s.props.range.default,this.earliest=$s.props.earliest.default,this.latest=$s.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=$s.props.weeknumbers.default,this.withcontrols=$s.props.withcontrols.default,this.currentmonth=null,this.today=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.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get todayDate(){return this.today?zt(this.today):Uc()}firstUpdated(e){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(e){super.updated(e),e.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=js(this.selected),this.range&&this.selected.length===2&&(this.inRange=ta(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const e=zt(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?bi(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=bi(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=bi(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){const t=dh(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){const i=e.target;if(hh(i))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?_t(this.focusedDate):ks(this.year,this.month,1),r=uh(n,t,this.querySelector.bind(this));if(r){const a=this.querySelector(`button[data-date="${He(r)}"]`);a instanceof HTMLButtonElement&&!a.dataset.disabled&&(this.focusedDate=He(r),a.focus())}}render(){return f`
|
|
206
206
|
<div
|
|
207
207
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
208
208
|
@focusout=${this.closeEvent}
|
|
209
|
-
@keydown=${
|
|
209
|
+
@keydown=${e=>{e.key==="Escape"&&(e.preventDefault(),this.close())}}
|
|
210
210
|
>
|
|
211
211
|
<nav class="pkt-cal-month-nav">
|
|
212
212
|
${this.renderMonthNavButton("prev")}
|
|
@@ -226,33 +226,33 @@
|
|
|
226
226
|
</tbody>
|
|
227
227
|
</table>
|
|
228
228
|
</div>
|
|
229
|
-
`}renderMonthNavButton(
|
|
229
|
+
`}renderMonthNavButton(e){const t=e==="prev",i=t?this.isPrevMonthAllowed():this.isNextMonthAllowed(),n=t?this.prevMonthString:this.nextMonthString,r=t?"chevron-thin-left":"chevron-thin-right",a=t?"pkt-calendar__prev-month":"pkt-calendar__next-month",c=t?()=>this.prevMonth():()=>this.nextMonth();return f`<div>
|
|
230
230
|
<button
|
|
231
231
|
type="button"
|
|
232
232
|
aria-label="${n}"
|
|
233
|
-
@click=${()=>i&&
|
|
234
|
-
@keydown=${
|
|
235
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${
|
|
236
|
-
.data-disabled=${i?
|
|
233
|
+
@click=${()=>i&&c()}
|
|
234
|
+
@keydown=${h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i&&c())}}
|
|
235
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${a} ${i?"":"pkt-invisible"}"
|
|
236
|
+
.data-disabled=${i?_:"disabled"}
|
|
237
237
|
?aria-disabled=${!i}
|
|
238
238
|
tabindex=${i?"0":"-1"}
|
|
239
239
|
>
|
|
240
|
-
<pkt-icon class="pkt-btn__icon" name="${
|
|
240
|
+
<pkt-icon class="pkt-btn__icon" name="${r}"></pkt-icon>
|
|
241
241
|
<span class="pkt-btn__text">${n}</span>
|
|
242
242
|
</button>
|
|
243
|
-
</div>`}renderDayNames(){const
|
|
244
|
-
<div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[
|
|
245
|
-
${this.dayStrings[
|
|
243
|
+
</div>`}renderDayNames(){const e=[];this.weeknumbers&&e.push(f`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);for(let t=0;t<this.dayStrings.length;t++)e.push(f`<th>
|
|
244
|
+
<div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[t]}">
|
|
245
|
+
${this.dayStrings[t]}
|
|
246
246
|
</div>
|
|
247
|
-
</th>`);return
|
|
247
|
+
</th>`);return f`<tr class="pkt-cal-week-row">${e}</tr>`}renderMonthNav(){return this.withcontrols?f`<div class="pkt-cal-month-picker">
|
|
248
248
|
<label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
|
|
249
249
|
<select
|
|
250
250
|
aria-label="${this.strings.dates.month}"
|
|
251
251
|
class="pkt-input pkt-input-compact"
|
|
252
252
|
id="${this.id}-monthnav"
|
|
253
|
-
@change=${
|
|
253
|
+
@change=${e=>{e.stopImmediatePropagation();const t=e.target;this.changeMonth(this.year,parseInt(t.value))}}
|
|
254
254
|
>
|
|
255
|
-
${this.monthStrings.map((t
|
|
255
|
+
${this.monthStrings.map((e,t)=>f`<option value=${t} ?selected=${this.month===t}>${e}</option>`)}
|
|
256
256
|
</select>
|
|
257
257
|
<label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
|
|
258
258
|
<input
|
|
@@ -262,82 +262,82 @@
|
|
|
262
262
|
type="number"
|
|
263
263
|
size="4"
|
|
264
264
|
placeholder="0000"
|
|
265
|
-
@change=${
|
|
265
|
+
@change=${e=>{e.stopImmediatePropagation();const t=e.target;this.changeMonth(parseInt(t.value),this.month)}}
|
|
266
266
|
.value=${this.year}
|
|
267
267
|
/>
|
|
268
|
-
</div>`:
|
|
268
|
+
</div>`:f`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
269
269
|
${this.monthStrings[this.month]} ${this.year}
|
|
270
|
-
</div>`}getDayViewData(t
|
|
270
|
+
</div>`}getDayViewData(e,t){const i=ks(this.year,this.month,e),n=He(i),r=n===He(t),a=this.selected.includes(n),c=this.isDayDisabled(i,a),h=this.calculateTabIndex(n,c,e);return{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:c,ariaLabel:Wc(i),tabindex:h}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return eh(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,i){return this.focusedDate?this.focusedDate===e&&!t?"0":"-1":!t&&this.tabIndexSet===0?(this.tabIndexSet=i,"0"):this.tabIndexSet===i?"0":"-1"}getDayCellClasses(e){const{currentDateISO:t,isToday:i,isSelected:n}=e,r=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],a=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":this.rangeHovered!==null&&t===He(this.rangeHovered)}}getDayButtonClasses(e){const{currentDateISO:t,isToday:i,isSelected:n,isDisabled:r}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],c=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===He(this.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":c}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(e,t){const i=this.getDayViewData(e,t),{currentDate:n,currentDateISO:r,isSelected:a,isDisabled:c,ariaLabel:h,tabindex:p}=i;this.selectableDates.push({currentDateISO:r,isDisabled:c,tabindex:p});const v=this.getDayCellClasses(i),b=this.getDayButtonClasses(i);return f`<td class=${A(v)}>
|
|
271
271
|
<button
|
|
272
272
|
type="button"
|
|
273
|
-
aria-pressed=${
|
|
274
|
-
?disabled=${
|
|
275
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${
|
|
273
|
+
aria-pressed=${a?"true":"false"}
|
|
274
|
+
?disabled=${c}
|
|
275
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${A(b)}"
|
|
276
276
|
@mouseover=${()=>this.range&&!this.isExcluded(n)&&this.handleRangeHover(n)}
|
|
277
|
-
@focus=${()=>this.handleDayFocus(n,
|
|
278
|
-
aria-label="${
|
|
277
|
+
@focus=${()=>this.handleDayFocus(n,r)}
|
|
278
|
+
aria-label="${h}"
|
|
279
279
|
tabindex=${p}
|
|
280
|
-
data-disabled=${
|
|
281
|
-
data-date=${
|
|
280
|
+
data-disabled=${c?"disabled":_}
|
|
281
|
+
data-date=${r}
|
|
282
282
|
@keydown=${y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),this.handleDateSelect(n))}}
|
|
283
|
-
@click=${y=>{
|
|
283
|
+
@click=${y=>{c||(y.preventDefault(),this.handleDateSelect(n))}}
|
|
284
284
|
>
|
|
285
|
-
<span class="pkt-btn__text pkt-txt-14-light">${
|
|
285
|
+
<span class="pkt-btn__text pkt-txt-14-light">${e}</span>
|
|
286
286
|
</button>
|
|
287
|
-
</td>`}renderEmptyDayCell(
|
|
287
|
+
</td>`}renderEmptyDayCell(e){return f`<td class="pkt-cal-other">
|
|
288
288
|
<div
|
|
289
289
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
290
290
|
data-disabled="disabled"
|
|
291
291
|
>
|
|
292
|
-
<span class="pkt-btn__text pkt-txt-14-light">${
|
|
292
|
+
<span class="pkt-btn__text pkt-txt-14-light">${e}</span>
|
|
293
293
|
</div>
|
|
294
|
-
</td>`}renderWeekRow(
|
|
294
|
+
</td>`}renderWeekRow(e){return f`<tr class="pkt-cal-week-row" role="row">${e}</tr>`}renderCalendarBody(){const e=this.todayDate,t=nh(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let i=1;this.week=t.initialWeek;const n=[];for(let r=0;r<t.numRows;r++){const a=[];this.weeknumbers&&a.push(f`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let c=0;c<ki;c++){const h=rh(r,c,i,t);if(h==="current-month")a.push(this.renderDayView(i,e)),i++;else{const p=ah(h,c,i,t);a.push(this.renderEmptyDayCell(p)),h==="next-month"&&i++}}n.push(this.renderWeekRow(a))}return n}isExcluded(e){return ea(e,this.getDateConstraints())}isPrevMonthAllowed(){return th(this.year,this.month,this.earliest)}prevMonth(){const e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return sh(this.year,this.month,this.latest)}nextMonth(){const e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=typeof e=="string"?parseInt(e):e,this.month=typeof t=="string"?parseInt(t):t,this.currentmonth=bi(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected=="string"?this.selected.split(","):this.selected}addToSelected(e){this.selected=Mn(e,this.normalizeSelected()),this._selected=js(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=Nn(e,this.normalizeSelected()),this._selected=js(this.selected)}toggleSelected(e){this.selected=oh(e,this.normalizeSelected(),this.maxMultiple),this._selected=js(this.selected)}isRangeAllowed(e){return sa(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=lh(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=js(this.selected),this.selected.length===2?(this.convertSelected(),this.close()):this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(e){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(e)||this._selected[0]>=e){this.rangeHovered=null;return}this.rangeHovered=e,this.inRange=ta(this._selected[0],e)}handleDateSelect(e){return e&&(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(He(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0}))),Promise.resolve()}focusOnCurrentDate(){const e=He(bi(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}const i=this.selectableDates.find(n=>!n.isDisabled);if(i){const n=this.querySelector(`button[data-date="${i.currentDateISO}"]`);n instanceof HTMLButtonElement&&(this.focusedDate=i.currentDateISO,n.focus())}}closeEvent(e){!this.contains(e.relatedTarget)&&!e.target.classList.contains("pkt-invisible")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};ge([o({converter:Vs.csvToArray})],de.prototype,"selected",2),ge([o({type:Boolean})],de.prototype,"multiple",2),ge([o({type:Number,attribute:"max-multiple"})],de.prototype,"maxMultiple",2),ge([o({type:Boolean})],de.prototype,"range",2),ge([o({type:String})],de.prototype,"earliest",2),ge([o({type:String})],de.prototype,"latest",2),ge([o({converter:Vs.stringsToDate})],de.prototype,"excludedates",2),ge([o({converter:Vs.csvToArray})],de.prototype,"excludeweekdays",2),ge([o({type:Boolean})],de.prototype,"weeknumbers",2),ge([o({type:Boolean})],de.prototype,"withcontrols",2),ge([o({converter:Vs.stringToDate})],de.prototype,"currentmonth",2),ge([o({type:String})],de.prototype,"today",2),ge([o({type:Array,attribute:"day-strings"})],de.prototype,"dayStrings",2),ge([o({type:Array,attribute:"day-strings-long"})],de.prototype,"dayStringsLong",2),ge([o({type:Array,attribute:"month-strings"})],de.prototype,"monthStrings",2),ge([o({type:String,attribute:"week-string"})],de.prototype,"weekString",2),ge([o({type:String,attribute:"prev-month-string"})],de.prototype,"prevMonthString",2),ge([o({type:String,attribute:"next-month-string"})],de.prototype,"nextMonthString",2),ge([o({type:Array})],de.prototype,"_selected",2),ge([q()],de.prototype,"inRange",2),ge([o({type:Date})],de.prototype,"rangeHovered",2),ge([o({type:Number})],de.prototype,"year",2),ge([o({type:Number})],de.prototype,"month",2),ge([o({type:Number})],de.prototype,"week",2),ge([q()],de.prototype,"currentmonthtouched",2),ge([q()],de.prototype,"focusedDate",2),de=ge([X("pkt-calendar")],de);const gh={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},Qi={props:gh};var mh=Object.defineProperty,vh=Object.getOwnPropertyDescriptor,Lt=(s,e,t,i)=>{for(var n=i>1?void 0:i?vh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&mh(e,t,n),n};let Nt=class extends fe{constructor(){super(),this.defaultSlot=L(),this.closeTag=Qi.props.closeTag.default,this.size=Qi.props.size.default,this.skin=Qi.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=Qi.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!1,composed:!0}))},this.slotController=new Oe(this,this.defaultSlot),this._isClosed=!1}firstUpdated(e){var t,i;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const n=(i=(t=this.defaultSlot.value)==null?void 0:t.textContent)==null?void 0:i.trim();n&&(this._ariaDescription=`Klikk for å fjerne ${n}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},t={"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?f`
|
|
295
295
|
<button
|
|
296
|
-
class=${
|
|
296
|
+
class=${A(t)}
|
|
297
297
|
type=${this.type}
|
|
298
298
|
@click=${this.close}
|
|
299
|
-
aria-label=${
|
|
300
|
-
aria-description=${
|
|
299
|
+
aria-label=${N(this.ariaLabel||void 0)}
|
|
300
|
+
aria-description=${N(this._ariaDescription||void 0)}
|
|
301
301
|
>
|
|
302
|
-
${this.iconName&&
|
|
302
|
+
${this.iconName&&f`<pkt-icon
|
|
303
303
|
class="pkt-tag__icon"
|
|
304
304
|
name=${this.iconName}
|
|
305
305
|
aria-hidden="true"
|
|
306
306
|
></pkt-icon>`}
|
|
307
|
-
<span ${
|
|
307
|
+
<span ${B(this.defaultSlot)}></span>
|
|
308
308
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
309
309
|
</button>
|
|
310
|
-
`:
|
|
311
|
-
<span class=${
|
|
312
|
-
${this.iconName&&
|
|
310
|
+
`:f`
|
|
311
|
+
<span class=${A(e)}>
|
|
312
|
+
${this.iconName&&f`<pkt-icon
|
|
313
313
|
class="pkt-tag__icon"
|
|
314
314
|
name=${this.iconName}
|
|
315
315
|
aria-hidden="true"
|
|
316
316
|
></pkt-icon>`}
|
|
317
|
-
<span ${
|
|
317
|
+
<span ${B(this.defaultSlot)}></span>
|
|
318
318
|
</span>
|
|
319
|
-
`}};
|
|
319
|
+
`}};Lt([o({type:Boolean,reflect:!0})],Nt.prototype,"closeTag",2),Lt([o({type:String,reflect:!0})],Nt.prototype,"size",2),Lt([o({type:String,reflect:!0})],Nt.prototype,"skin",2),Lt([o({type:String,reflect:!0})],Nt.prototype,"textStyle",2),Lt([o({type:String,reflect:!0})],Nt.prototype,"iconName",2),Lt([o({type:String})],Nt.prototype,"type",2),Lt([o({type:String})],Nt.prototype,"ariaLabel",2),Lt([q()],Nt.prototype,"_isClosed",2),Lt([q()],Nt.prototype,"_ariaDescription",2),Nt=Lt([X("pkt-tag")],Nt);var bh=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,Us=(s,e,t,i)=>{for(var n=i>1?void 0:i?yh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&bh(e,t,n),n};let is=class extends Wi{constructor(){super(...arguments),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="level"&&i&&this.setLevel(Number(i)),e==="visuallyHidden"&&(this.visuallyHidden=i!==null&&i!=="false"),(e==="size"||e==="visuallyHidden"||e==="align"||e==="weight")&&this.updateHostClasses()}updated(e){super.updated(e),e.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(e.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has("size")||e.has("visuallyHidden")||e.has("align")||e.has("weight"))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute("aria-level",String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}get defaultWeightForLevel(){switch(this.level){case 1:return"regular";case 2:return"regular";case 3:return"medium";case 4:return"medium";case 5:return"medium";case 6:return"medium";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end","pkt-heading--light","pkt-heading--regular","pkt-heading--medium","pkt-heading--bold"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return f`<slot></slot>`}};Us([o({type:String,reflect:!0})],is.prototype,"size",2),Us([o({type:Number,reflect:!0})],is.prototype,"level",2),Us([o({type:String,reflect:!0})],is.prototype,"weight",2),Us([o({type:Boolean,reflect:!0})],is.prototype,"visuallyHidden",2),Us([o({type:String,reflect:!0})],is.prototype,"align",2),is=Us([X("pkt-heading")],is);const kh={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},Ws={props:kh};var $h=Object.defineProperty,wh=Object.getOwnPropertyDescriptor,Re=(s,e,t,i)=>{for(var n=i>1?void 0:i?wh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&$h(e,t,n),n};let Ve=class extends fe{constructor(){super(),this.defaultSlot=L(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=Ws.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=Ws.props.padding.default,this.skin=Ws.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new Oe(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var e,t;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},n=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),r=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?this.heading:"kort");return f`
|
|
320
320
|
<article
|
|
321
|
-
class=${
|
|
322
|
-
aria-label=${
|
|
321
|
+
class=${A(i)}
|
|
322
|
+
aria-label=${N(this.clickCardLink?n:r)}
|
|
323
323
|
>
|
|
324
324
|
${this.renderImage()}
|
|
325
325
|
<div class="pkt-card__wrapper">
|
|
326
|
-
${this.tagPosition==="top"?this.renderTags():
|
|
326
|
+
${this.tagPosition==="top"?this.renderTags():_}
|
|
327
327
|
${this.renderHeader()}
|
|
328
328
|
${this.renderSlot()}
|
|
329
|
-
${this.tagPosition==="bottom"?this.renderTags():
|
|
329
|
+
${this.tagPosition==="bottom"?this.renderTags():_}
|
|
330
330
|
${this.renderMetadata()}
|
|
331
331
|
</div>
|
|
332
332
|
</article>
|
|
333
|
-
`}renderImage(){const
|
|
334
|
-
${this.image.src&&
|
|
335
|
-
<div class=${
|
|
333
|
+
`}renderImage(){const e={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return f`
|
|
334
|
+
${this.image.src&&f`
|
|
335
|
+
<div class=${A(e)}>
|
|
336
336
|
<img src=${this.image.src} alt=${this.image.alt||""} />
|
|
337
337
|
</div>
|
|
338
338
|
`}
|
|
339
|
-
`}renderHeading(){return
|
|
340
|
-
${this.heading&&!this.clickCardLink?
|
|
339
|
+
`}renderHeading(){return f`
|
|
340
|
+
${this.heading&&!this.clickCardLink?f`
|
|
341
341
|
<pkt-heading
|
|
342
342
|
class="pkt-card__heading"
|
|
343
343
|
.level=${this.headinglevel||3}
|
|
@@ -347,9 +347,9 @@
|
|
|
347
347
|
>
|
|
348
348
|
${this.heading}
|
|
349
349
|
</pkt-heading>
|
|
350
|
-
`:
|
|
351
|
-
`}renderLinkHeading(){return
|
|
352
|
-
${this.clickCardLink?
|
|
350
|
+
`:_}
|
|
351
|
+
`}renderLinkHeading(){return f`
|
|
352
|
+
${this.clickCardLink?f`
|
|
353
353
|
<pkt-heading
|
|
354
354
|
class="pkt-card__link-heading pkt-card__heading"
|
|
355
355
|
.level=${this.headinglevel||3}
|
|
@@ -364,133 +364,133 @@
|
|
|
364
364
|
>${this.heading}</a
|
|
365
365
|
>
|
|
366
366
|
</pkt-heading>
|
|
367
|
-
`:
|
|
368
|
-
`}renderSubheading(){return
|
|
369
|
-
${this.subheading?
|
|
370
|
-
`}renderHeader(){const
|
|
371
|
-
${
|
|
367
|
+
`:_}
|
|
368
|
+
`}renderSubheading(){return f`
|
|
369
|
+
${this.subheading?f` <p class="pkt-card__subheading ">${this.subheading}</p> `:_}
|
|
370
|
+
`}renderHeader(){const e=!!this.heading||!!this.subheading;return f`
|
|
371
|
+
${e?f`
|
|
372
372
|
<header class="pkt-card__header">
|
|
373
373
|
${this.renderHeading()}
|
|
374
374
|
${this.renderLinkHeading()}
|
|
375
375
|
${this.renderSubheading()}
|
|
376
376
|
</header>
|
|
377
|
-
`:
|
|
378
|
-
`}renderTags(){const
|
|
379
|
-
${this.tags.length>0?
|
|
377
|
+
`:_}
|
|
378
|
+
`}renderTags(){const e={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return f`
|
|
379
|
+
${this.tags.length>0?f`
|
|
380
380
|
<div
|
|
381
|
-
class=${
|
|
381
|
+
class=${A(e)}
|
|
382
382
|
role="list"
|
|
383
383
|
aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
|
|
384
384
|
>
|
|
385
|
-
${this.tags.map(
|
|
385
|
+
${this.tags.map(t=>f`
|
|
386
386
|
<pkt-tag
|
|
387
387
|
role="listitem"
|
|
388
388
|
textStyle="normal-text"
|
|
389
389
|
size="medium"
|
|
390
|
-
skin=${
|
|
391
|
-
iconName=${
|
|
390
|
+
skin=${N(t.skin)}
|
|
391
|
+
iconName=${N(t.iconName)}
|
|
392
392
|
>
|
|
393
|
-
<span>${
|
|
393
|
+
<span>${t.text}</span>
|
|
394
394
|
</pkt-tag>
|
|
395
395
|
`)}
|
|
396
396
|
</div>
|
|
397
|
-
`:
|
|
398
|
-
`}renderSlot(){return
|
|
399
|
-
${this.defaultSlot&&
|
|
400
|
-
`}renderMetadata(){return
|
|
401
|
-
${this.metaLead||this.metaTrail?
|
|
397
|
+
`:_}
|
|
398
|
+
`}renderSlot(){return f`
|
|
399
|
+
${this.defaultSlot&&f`<section class="pkt-card__content" ${B(this.defaultSlot)}></section>`}
|
|
400
|
+
`}renderMetadata(){return f`
|
|
401
|
+
${this.metaLead||this.metaTrail?f`
|
|
402
402
|
<footer class="pkt-card__metadata">
|
|
403
|
-
${this.metaLead?
|
|
404
|
-
${this.metaTrail?
|
|
403
|
+
${this.metaLead?f`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:_}
|
|
404
|
+
${this.metaTrail?f`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:_}
|
|
405
405
|
</footer>
|
|
406
|
-
`:
|
|
407
|
-
`}};
|
|
406
|
+
`:_}
|
|
407
|
+
`}};Re([o({type:String})],Ve.prototype,"ariaLabel",2),Re([o({type:String})],Ve.prototype,"metaLead",2),Re([o({type:Boolean})],Ve.prototype,"borderOnHover",2),Re([o({type:String,reflect:!0})],Ve.prototype,"clickCardLink",2),Re([o({type:String})],Ve.prototype,"metaTrail",2),Re([o({type:String})],Ve.prototype,"layout",2),Re([o({type:String})],Ve.prototype,"heading",2),Re([o({type:Number})],Ve.prototype,"headinglevel",2),Re([o({type:Object})],Ve.prototype,"image",2),Re([o({type:String})],Ve.prototype,"imageShape",2),Re([o({type:Boolean})],Ve.prototype,"openLinkInNewTab",2),Re([o({type:String})],Ve.prototype,"padding",2),Re([o({type:String,converter:{fromAttribute:s=>{const e=Ws.props.skin.type;return s&&e.includes(s)?s:(s&&!e.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${Ws.props.skin.default}".`),Ws.props.skin.default)},toAttribute:s=>s}})],Ve.prototype,"skin",2),Re([o({type:String})],Ve.prototype,"subheading",2),Re([o({type:String})],Ve.prototype,"tagPosition",2),Re([o({type:Array})],Ve.prototype,"tags",2),Ve=Re([X("pkt-card")],Ve);/**
|
|
408
408
|
* @license
|
|
409
409
|
* Copyright 2017 Google LLC
|
|
410
410
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
411
|
-
*/const ga=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Ki=Fe(class extends rs{constructor(s){if(super(s),s.type!==Qt.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 n=[],a=[];let r=0;for(const h of s)n[r]=i?i(h,r):r,a[r]=e(h,r),r++;return{values:a,keys:n}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const n=Wr(s),{values:a,keys:r}=this.dt(t,e,i);if(!Array.isArray(n))return this.ut=r,a;const h=this.ut??(this.ut=[]),d=[];let p,m,v=0,y=n.length-1,$=0,b=a.length-1;for(;v<=y&&$<=b;)if(n[v]===null)v++;else if(n[y]===null)y--;else if(h[v]===r[$])d[$]=Ve(n[v],a[$]),v++,$++;else if(h[y]===r[b])d[b]=Ve(n[y],a[b]),y--,b--;else if(h[v]===r[b])d[b]=Ve(n[v],a[b]),Ps(s,d[b+1],n[v]),v++,b--;else if(h[y]===r[$])d[$]=Ve(n[y],a[$]),Ps(s,n[v],n[y]),y--,$++;else if(p===void 0&&(p=ga(r,$,b),m=ga(h,v,y)),p.has(h[v]))if(p.has(h[y])){const x=m.get(r[$]),T=x!==void 0?n[x]:null;if(T===null){const M=Ps(s,n[v]);Ve(M,a[$]),d[$]=M}else d[$]=Ve(T,a[$]),Ps(s,n[v],T),n[x]=null;$++}else Bi(n[y]),y--;else Bi(n[v]),v++;for(;$<=b;){const x=Ps(s,d[b+1]);Ve(x,a[$]),d[$++]=x}for(;v<=y;){const x=n[v++];x!==null&&Bi(x)}return this.ut=r,Vn(s,d),Et}}),ma=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),rh=s=>new Promise(t=>setTimeout(t,s)),Ae=()=>{const s=ma(),t=ma();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},At={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},oh={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}},Ft={props:oh};var lh={},va;function hh(){return va||(va=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,h=new WeakMap,d=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,$=new WeakMap,b=new WeakMap,x=new WeakMap,T={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=(g,c)=>{for(let f in T){c[f]=null;let _=null;const D=T[f];Object.defineProperty(c,f,{get(){return _},set(V){_=V,g.isConnected?mt(g,D,V):m.set(g,c)}})}};function S(g){const c=n.get(g),{form:f}=c;ae(g,f,c),Dt(g,c.labels)}const B=(g,c=!1)=>{const f=document.createTreeWalker(g,NodeFilter.SHOW_ELEMENT,{acceptNode(V){return n.has(V)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=f.nextNode();const D=!c||g.disabled;for(;_;)_.formDisabledCallback&&D&&Ut(_,g.disabled),_=f.nextNode()},E={attributes:!0,attributeFilter:["disabled","name"]},R=re()?new MutationObserver(g=>{for(const c of g){const f=c.target;if(c.attributeName==="disabled"&&(f.constructor.formAssociated?Ut(f,f.hasAttribute("disabled")):f.localName==="fieldset"&&B(f)),c.attributeName==="name"&&f.constructor.formAssociated){const _=n.get(f),D=p.get(f);_.setFormValue(D)}}}):{};function et(g){g.forEach(c=>{const{addedNodes:f,removedNodes:_}=c,D=Array.from(f),V=Array.from(_);D.forEach(j=>{var qt;if(n.has(j)&&j.constructor.formAssociated&&S(j),m.has(j)){const wt=m.get(j);Object.keys(T).filter(Wt=>wt[Wt]!==null).forEach(Wt=>{mt(j,T[Wt],wt[Wt])}),m.delete(j)}if(x.has(j)){const wt=x.get(j);mt(j,"internals-valid",wt.validity.valid.toString()),mt(j,"internals-invalid",(!wt.validity.valid).toString()),mt(j,"aria-invalid",(!wt.validity.valid).toString()),x.delete(j)}if(j.localName==="form"){const wt=d.get(j),Wt=document.createTreeWalker(j,NodeFilter.SHOW_ELEMENT,{acceptNode(dn){return n.has(dn)&&dn.constructor.formAssociated&&!(wt&&wt.has(dn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ii=Wt.nextNode();for(;ii;)S(ii),ii=Wt.nextNode()}j.localName==="fieldset"&&((qt=R.observe)===null||qt===void 0||qt.call(R,j,E),B(j,!0))}),V.forEach(j=>{const qt=n.get(j);qt&&i.get(qt)&&Yt(qt),h.has(j)&&h.get(j).disconnect()})})}function Ct(g){g.forEach(c=>{const{removedNodes:f}=c;f.forEach(_=>{const D=$.get(c.target);n.has(_)&&we(_),D.disconnect()})})}const Tt=g=>{var c,f;const _=new MutationObserver(Ct);!((c=window==null?void 0:window.ShadyDOM)===null||c===void 0)&&c.inUse&&g.mode&&g.host&&(g=g.host),(f=_.observe)===null||f===void 0||f.call(_,g,{childList:!0}),$.set(g,_)};re()&&new MutationObserver(et);const nt={childList:!0,subtree:!0},mt=(g,c,f)=>{g.getAttribute(c)!==f&&g.setAttribute(c,f)},Ut=(g,c)=>{g.toggleAttribute("internals-disabled",c),c?mt(g,"aria-disabled","true"):g.removeAttribute("aria-disabled"),g.formDisabledCallback&&g.formDisabledCallback.apply(g,[c])},Yt=g=>{i.get(g).forEach(c=>{c.remove()}),i.set(g,[])},dt=(g,c)=>{const f=document.createElement("input");return f.type="hidden",f.name=g.getAttribute("name"),g.after(f),i.get(c).push(f),f},$e=(g,c)=>{var f;i.set(c,[]),(f=R.observe)===null||f===void 0||f.call(R,g,E)},Dt=(g,c)=>{if(c.length){Array.from(c).forEach(_=>_.addEventListener("click",g.click.bind(g)));let f=c[0].id;c[0].id||(f=`${c[0].htmlFor}_Label`,c[0].id=f),mt(g,"aria-labelledby",f)}},It=g=>{const c=Array.from(g.elements).filter(V=>!V.tagName.includes("-")&&V.validity).map(V=>V.validity.valid),f=d.get(g)||[],_=Array.from(f).filter(V=>V.isConnected).map(V=>n.get(V).validity.valid),D=[...c,..._].includes(!1);g.toggleAttribute("internals-invalid",D),g.toggleAttribute("internals-valid",!D)},zt=g=>{It(Lt(g.target))},Gt=g=>{It(Lt(g.target))},z=g=>{const c=["button[type=submit]","input[type=submit]","button:not([type])"].map(f=>`${f}:not([disabled])`).map(f=>`${f}:not([form])${g.id?`,${f}[form='${g.id}']`:""}`).join(",");g.addEventListener("click",f=>{if(f.target.closest(c)){const _=d.get(g);if(g.noValidate)return;_.size&&Array.from(_).reverse().map(D=>n.get(D).reportValidity()).includes(!1)&&f.preventDefault()}})},Nt=g=>{const c=d.get(g.target);c&&c.size&&c.forEach(f=>{f.constructor.formAssociated&&f.formResetCallback&&f.formResetCallback.apply(f)})},ae=(g,c,f)=>{if(c){const _=d.get(c);if(_)_.add(g);else{const D=new Set;D.add(g),d.set(c,D),z(c),c.addEventListener("reset",Nt),c.addEventListener("input",zt),c.addEventListener("change",Gt)}r.set(c,{ref:g,internals:f}),g.constructor.formAssociated&&g.formAssociatedCallback&&setTimeout(()=>{g.formAssociatedCallback.apply(g,[c])},0),It(c)}},Lt=g=>{let c=g.parentNode;return c&&c.tagName!=="FORM"&&(c=Lt(c)),c},rt=(g,c,f=DOMException)=>{if(!g.constructor.formAssociated)throw new f(c)},_e=(g,c,f)=>{const _=d.get(g);return _&&_.size&&_.forEach(D=>{n.get(D)[f]()||(c=!1)}),c},we=g=>{if(g.constructor.formAssociated){const c=n.get(g),{labels:f,form:_}=c;Dt(g,f),ae(g,_,c)}};function re(){return typeof MutationObserver<"u"}class ei{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 _s=g=>(g.badInput=!1,g.customError=!1,g.patternMismatch=!1,g.rangeOverflow=!1,g.rangeUnderflow=!1,g.stepMismatch=!1,g.tooLong=!1,g.tooShort=!1,g.typeMismatch=!1,g.valid=!0,g.valueMissing=!1,g),ws=(g,c,f)=>(g.valid=Qe(c),Object.keys(c).forEach(_=>g[_]=c[_]),f&&It(f),g),Qe=g=>{let c=!0;for(let f in g)f!=="valid"&&g[f]!==!1&&(c=!1);return c},fe=new WeakMap;function ge(g,c){g.toggleAttribute(c,!0),g.part&&g.part.add(c)}class De extends Set{static get isPolyfilled(){return!0}constructor(c){if(super(),!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");fe.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 f=super.add(c),_=fe.get(this),D=`state${c}`;return _.isConnected?ge(_,D):setTimeout(()=>{ge(_,D)}),f}clear(){for(let[c]of this.entries())this.delete(c);super.clear()}delete(c){const f=super.delete(c),_=fe.get(this);return _.isConnected?(_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)):setTimeout(()=>{_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)}),f}}function ts(g,c,f,_){if(typeof c=="function"?g!==c||!_:!c.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?_:f==="a"?_.call(g):_?_.value:c.get(g)}function xe(g,c,f,_,D){if(typeof c=="function"?g!==c||!0:!c.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c.set(g,f),f}var Zt;class es{constructor(c){Zt.set(this,void 0),xe(this,Zt,c);for(let f=0;f<c.length;f++){let _=c[f];this[f]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return ts(this,Zt,"f").length}[(Zt=new WeakMap,Symbol.iterator)](){return ts(this,Zt,"f")[Symbol.iterator]()}item(c){return this[c]==null?null:this[c]}namedItem(c){return this[c]==null?null:this[c]}}function _t(){const g=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=f;const c=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function f(...V){let j=g.apply(this,V);return _e(this,j,"checkValidity")}function _(...V){let j=c.apply(this,V);return _e(this,j,"reportValidity")}const{get:D}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...V){const j=D.call(this,...V),qt=Array.from(d.get(this)||[]);if(qt.length===0)return j;const wt=Array.from(j).concat(qt).sort((Wt,ii)=>Wt.compareDocumentPosition?Wt.compareDocumentPosition(ii)&2?1:-1:0);return new es(wt)}})}class Xt{static get isPolyfilled(){return!0}constructor(c){if(!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const f=c.getRootNode(),_=new ei;this.states=new De(c),t.set(this,c),e.set(this,_),n.set(c,this),M(c,this),$e(c,this),Object.seal(this),f instanceof DocumentFragment&&Tt(f)}checkValidity(){const c=t.get(this);if(rt(c,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const f=e.get(this);if(!f.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});c.dispatchEvent(_)}return f.valid}get form(){const c=t.get(this);rt(c,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let f;return c.constructor.formAssociated===!0&&(f=Lt(c)),f}get labels(){const c=t.get(this);rt(c,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const f=c.getAttribute("id"),_=c.getRootNode();return _&&f?_.querySelectorAll(`[for="${f}"]`):[]}reportValidity(){const c=t.get(this);if(rt(c,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const f=this.checkValidity(),_=y.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!f&&_&&(c.focus(),_.focus()),f}setFormValue(c){const f=t.get(this);if(rt(f,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Yt(this),c!=null&&!(c instanceof FormData)){if(f.getAttribute("name")){const _=dt(f,this);_.value=c}}else c!=null&&c instanceof FormData&&Array.from(c).reverse().forEach(([_,D])=>{if(typeof D=="string"){const V=dt(f,this);V.name=_,V.value=D}});p.set(f,c)}setValidity(c,f,_){const D=t.get(this);if(rt(D,"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.");y.set(this,_);const V=e.get(this),j={};for(const Wt in c)j[Wt]=c[Wt];Object.keys(j).length===0&&_s(V);const qt=Object.assign(Object.assign({},V),j);delete qt.valid;const{valid:wt}=ws(V,qt,this.form);if(!wt&&!f)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.");a.set(this,wt?"":f),D.isConnected?(D.toggleAttribute("internals-invalid",!wt),D.toggleAttribute("internals-valid",wt),mt(D,"aria-invalid",`${!wt}`)):x.set(D,this)}get shadowRoot(){const c=t.get(this);return v.get(c)||null}get validationMessage(){const c=t.get(this);return rt(c,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const c=t.get(this);return rt(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 rt(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 cn(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class g 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,g);const f=new g;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in f.internals)}let xs=!1,si=!1;function Ss(g){si||(si=!0,window.CustomStateSet=De,g&&(HTMLElement.prototype.attachInternals=function(...c){const f=g.call(this,c);return f.states=new De(this),f}))}function Cs(g=!0){if(!xs){if(xs=!0,typeof window<"u"&&(window.ElementInternals=Xt),typeof CustomElementRegistry<"u"){const c=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(f,_,D){if(_.formAssociated){const V=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){b.has(this)||(b.set(this,!0),this.hasAttribute("disabled")&&Ut(this,!0)),V!=null&&V.apply(this),we(this)}}c.call(this,f,_,D)}}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(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new Xt(this)}),typeof Element<"u"){let c=function(..._){const D=f.apply(this,_);if(v.set(this,D),re()){const V=new MutationObserver(et);window.ShadyDOM?V.observe(this,nt):V.observe(D,nt),h.set(this,V)}return D};const f=Element.prototype.attachShadow;Element.prototype.attachShadow=c}re()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,nt),typeof HTMLFormElement<"u"&&_t(),(g||typeof window<"u"&&!window.CustomStateSet)&&Ss()}}return customElements.polyfillWrapFlushCallback||(cn()?typeof window<"u"&&!window.CustomStateSet&&Ss(HTMLElement.prototype.attachInternals):Cs(!1)),s.forceCustomStateSetPolyfill=Ss,s.forceElementInternalsPolyfill=Cs,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),lh}hh();var ch=Object.defineProperty,F=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&ch(t,e,n),n};const ba="on",Yi="--checked",$i=",";let I=class extends J{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=Ae(),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=Ft.props.helptextDropdownButton.default,this.label=null,this.optionalText=Mt.forms.labels.optional,this.requiredText=Mt.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,n,a,r,h,d,p,m,v,y;if(!t){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},Mt.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},Mt.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},Mt.forms.messages.invalidPattern,t):(a=t.validity)!=null&&a.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},Mt.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},Mt.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?Mt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):Mt.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},Mt.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?Mt.forms.messages.rangeOverflowMax.replace("{max}",(v=this.max)==null?void 0:v.toString()):Mt.forms.messages.rangeOverflow,t):(y=t.validity)!=null&&y.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)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const t=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(t).forEach(e=>{var i;if(e!==this&&e.getAttribute("name")===this.name&&e.getAttribute("value")!==this.value){const n=e;n.checked&&(n.checked=!1,n.internals&&(n.internals.setFormValue(null),(i=n.internals.states)==null||i.delete(Yi)))}})}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=String(t==="true")):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=String(t)),this.checked){const n=(typeof this.value=="string"?this.value:"")||ba;this.internals.setFormValue(n),i&&i.append(this.name,n),this.internals.states.add(Yi)}else this.internals.setFormValue(null),i&&i.delete(this.name),this.internals.states.delete(Yi);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes($i)&&(t=t.split($i)),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()))}dispatchChangeEvents(t){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.setFormValue(t),this.dispatchChangeEvents(t)}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}normalizeValue(t){return(this.range||this.multiple)&&typeof t=="string"&&t.includes($i)?t.split($i):!this.multiple&&!this.range&&Array.isArray(t)?t[0]||"":t}validate(){var t,e;(t=this.inputRef)!=null&&t.value&&this.manageValidity(this.inputRef.value),(e=this.inputRefTo)!=null&&e.value&&this.manageValidity(this.inputRefTo.value)}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}if(typeof t!="string"&&!Array.isArray(t))return;const e=this.normalizeValue(t);this.setFormValue(e),this.validate(),this.dispatchChangeEvents(e)}formResetCallback(){var t;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{"selected"in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(t=this.inputRef)!=null&&t.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const e=this.defaultValue||(this.multiple||this.range?[]:"");this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}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="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(e);const i=e?(typeof this.value=="string"?this.value:"")||ba:null;this.internals.setFormValue(i)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};F([o({type:Boolean,reflect:!0})],I.prototype,"checked"),F([o({type:Boolean})],I.prototype,"defaultChecked"),F([o({type:Boolean})],I.prototype,"multiple"),F([o({type:Boolean})],I.prototype,"range"),F([o({type:String,reflect:!0})],I.prototype,"type"),F([o()],I.prototype,"defaultValue"),F([o({type:Boolean,reflect:!0})],I.prototype,"disabled"),F([o({type:Boolean,reflect:!0})],I.prototype,"readonly"),F([o({type:Boolean,reflect:!0})],I.prototype,"required"),F([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],I.prototype,"max"),F([o({type:Number,reflect:!0})],I.prototype,"maxlength"),F([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],I.prototype,"min"),F([o({type:Number,reflect:!0})],I.prototype,"minlength"),F([o({type:Number,reflect:!0})],I.prototype,"step"),F([o({type:String})],I.prototype,"ariaDescribedBy"),F([o({type:String})],I.prototype,"ariaLabelledby"),F([o({type:String,reflect:!0})],I.prototype,"name"),F([o({type:String,reflect:!0})],I.prototype,"pattern"),F([o({type:String,reflect:!0})],I.prototype,"placeholder"),F([o({type:String,reflect:!0})],I.prototype,"id"),F([o({type:Boolean})],I.prototype,"counter"),F([o({type:Boolean})],I.prototype,"hasError"),F([o({type:Boolean})],I.prototype,"inline"),F([o({type:Boolean})],I.prototype,"hasFieldset"),F([o({type:Boolean})],I.prototype,"optionalTag"),F([o({type:Boolean})],I.prototype,"requiredTag"),F([o({type:Boolean})],I.prototype,"skipForwardTestid"),F([o({type:Boolean,reflect:!0,converter:At})],I.prototype,"useWrapper"),F([o({type:Boolean,reflect:!0})],I.prototype,"fullwidth"),F([o({type:Number})],I.prototype,"counterMaxLength"),F([o({type:String})],I.prototype,"errorMessage"),F([o({type:String})],I.prototype,"helptext"),F([o({type:String})],I.prototype,"helptextDropdown"),F([o({type:String,reflect:!1})],I.prototype,"helptextDropdownButton"),F([o({type:String})],I.prototype,"label"),F([o({type:String,reflect:!1})],I.prototype,"optionalText"),F([o({type:String,reflect:!1})],I.prototype,"requiredText"),F([o({type:String,reflect:!1})],I.prototype,"tagText"),F([o({type:String,attribute:"data-testid"})],I.prototype,"dataTestid"),F([L()],I.prototype,"touched");let ka=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.createOptions(),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.requestUpdate()}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{os(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{os(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&os(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var dh=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,Re=(s,t,e,i)=>{for(var n=i>1?void 0:i?uh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&dh(t,e,n),n};let ve=class extends J{constructor(){super(),this.defaultSlot=A(),this.forId=Ae(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Ft.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new ot(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},e=N({"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">
|
|
411
|
+
*/const ia=(s,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(s[n],n);return i},Dn=fs(class extends Is{constructor(s){if(super(s),s.type!==Tt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const n=[],r=[];let a=0;for(const c of s)n[a]=i?i(c,a):a,r[a]=t(c,a),a++;return{values:r,keys:n}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const n=cl(s),{values:r,keys:a}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=a,r;const c=this.ut??(this.ut=[]),h=[];let p,v,b=0,y=n.length-1,k=0,m=r.length-1;for(;b<=y&&k<=m;)if(n[b]===null)b++;else if(n[y]===null)y--;else if(c[b]===a[k])h[k]=gs(n[b],r[k]),b++,k++;else if(c[y]===a[m])h[m]=gs(n[y],r[m]),y--,m--;else if(c[b]===a[m])h[m]=gs(n[b],r[m]),oi(s,h[m+1],n[b]),b++,m--;else if(c[y]===a[k])h[k]=gs(n[y],r[k]),oi(s,n[b],n[y]),y--,k++;else if(p===void 0&&(p=ia(a,k,m),v=ia(c,b,y)),p.has(c[b]))if(p.has(c[y])){const w=v.get(a[k]),C=w!==void 0?n[w]:null;if(C===null){const M=oi(s,n[b]);gs(M,r[k]),h[k]=M}else h[k]=gs(C,r[k]),oi(s,n[b],C),n[w]=null;k++}else yn(n[y]),y--;else yn(n[b]),b++;for(;k<=m;){const w=oi(s,h[m+1]);gs(w,r[k]),h[k++]=w}for(;b<=y;){const w=n[b++];w!==null&&yn(w)}return this.ut=a,Cr(s,h),ht}}),na=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),_h=s=>new Promise(e=>setTimeout(e,s)),ns=()=>{const s=na(),e=na();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)},dt={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},xh={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}},yt={props:xh};var Sh={},ra;function Ch(){return ra||(ra=1,(function(){(function(s){const e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,a=new WeakMap,c=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,k=new WeakMap,m=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=(d,u)=>{for(let $ in C){u[$]=null;let x=null;const I=C[$];Object.defineProperty(u,$,{get(){return x},set(H){x=H,d.isConnected?P(d,I,H):v.set(d,u)}})}};function S(d){const u=n.get(d),{form:$}=u;Te(d,$,u),ie(d,u.labels)}const O=(d,u=!1)=>{const $=document.createTreeWalker(d,NodeFilter.SHOW_ELEMENT,{acceptNode(H){return n.has(H)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let x=$.nextNode();const I=!u||d.disabled;for(;x;)x.formDisabledCallback&&I&&R(x,d.disabled),x=$.nextNode()},T={attributes:!0,attributeFilter:["disabled","name"]},j=Me()?new MutationObserver(d=>{for(const u of d){const $=u.target;if(u.attributeName==="disabled"&&($.constructor.formAssociated?R($,$.hasAttribute("disabled")):$.localName==="fieldset"&&O($)),u.attributeName==="name"&&$.constructor.formAssociated){const x=n.get($),I=p.get($);x.setFormValue(I)}}}):{};function K(d){d.forEach(u=>{const{addedNodes:$,removedNodes:x}=u,I=Array.from($),H=Array.from(x);I.forEach(G=>{var ct;if(n.has(G)&&G.constructor.formAssociated&&S(G),v.has(G)){const qe=v.get(G);Object.keys(C).filter(et=>qe[et]!==null).forEach(et=>{P(G,C[et],qe[et])}),v.delete(G)}if(w.has(G)){const qe=w.get(G);P(G,"internals-valid",qe.validity.valid.toString()),P(G,"internals-invalid",(!qe.validity.valid).toString()),P(G,"aria-invalid",(!qe.validity.valid).toString()),w.delete(G)}if(G.localName==="form"){const qe=h.get(G),et=document.createTreeWalker(G,NodeFilter.SHOW_ELEMENT,{acceptNode(Ke){return n.has(Ke)&&Ke.constructor.formAssociated&&!(qe&&qe.has(Ke))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let Be=et.nextNode();for(;Be;)S(Be),Be=et.nextNode()}G.localName==="fieldset"&&((ct=j.observe)===null||ct===void 0||ct.call(j,G,T),O(G,!0))}),H.forEach(G=>{const ct=n.get(G);ct&&i.get(ct)&&Q(ct),c.has(G)&&c.get(G).disconnect()})})}function te(d){d.forEach(u=>{const{removedNodes:$}=u;$.forEach(x=>{const I=k.get(u.target);n.has(x)&&Le(x),I.disconnect()})})}const Ce=d=>{var u,$;const x=new MutationObserver(te);!((u=window==null?void 0:window.ShadyDOM)===null||u===void 0)&&u.inUse&&d.mode&&d.host&&(d=d.host),($=x.observe)===null||$===void 0||$.call(x,d,{childList:!0}),k.set(d,x)};Me()&&new MutationObserver(K);const U={childList:!0,subtree:!0},P=(d,u,$)=>{d.getAttribute(u)!==$&&d.setAttribute(u,$)},R=(d,u)=>{d.toggleAttribute("internals-disabled",u),u?P(d,"aria-disabled","true"):d.removeAttribute("aria-disabled"),d.formDisabledCallback&&d.formDisabledCallback.apply(d,[u])},Q=d=>{i.get(d).forEach(u=>{u.remove()}),i.set(d,[])},z=(d,u)=>{const $=document.createElement("input");return $.type="hidden",$.name=d.getAttribute("name"),d.after($),i.get(u).push($),$},Z=(d,u)=>{var $;i.set(u,[]),($=j.observe)===null||$===void 0||$.call(j,d,T)},ie=(d,u)=>{if(u.length){Array.from(u).forEach(x=>x.addEventListener("click",d.click.bind(d)));let $=u[0].id;u[0].id||($=`${u[0].htmlFor}_Label`,u[0].id=$),P(d,"aria-labelledby",$)}},pe=d=>{const u=Array.from(d.elements).filter(H=>!H.tagName.includes("-")&&H.validity).map(H=>H.validity.valid),$=h.get(d)||[],x=Array.from($).filter(H=>H.isConnected).map(H=>n.get(H).validity.valid),I=[...u,...x].includes(!1);d.toggleAttribute("internals-invalid",I),d.toggleAttribute("internals-valid",!I)},ae=d=>{pe(ce(d.target))},me=d=>{pe(ce(d.target))},W=d=>{const u=["button[type=submit]","input[type=submit]","button:not([type])"].map($=>`${$}:not([disabled])`).map($=>`${$}:not([form])${d.id?`,${$}[form='${d.id}']`:""}`).join(",");d.addEventListener("click",$=>{if($.target.closest(u)){const x=h.get(d);if(d.noValidate)return;x.size&&Array.from(x).reverse().map(I=>n.get(I).reportValidity()).includes(!1)&&$.preventDefault()}})},le=d=>{const u=h.get(d.target);u&&u.size&&u.forEach($=>{$.constructor.formAssociated&&$.formResetCallback&&$.formResetCallback.apply($)})},Te=(d,u,$)=>{if(u){const x=h.get(u);if(x)x.add(d);else{const I=new Set;I.add(d),h.set(u,I),W(u),u.addEventListener("reset",le),u.addEventListener("input",ae),u.addEventListener("change",me)}a.set(u,{ref:d,internals:$}),d.constructor.formAssociated&&d.formAssociatedCallback&&setTimeout(()=>{d.formAssociatedCallback.apply(d,[u])},0),pe(u)}},ce=d=>{let u=d.parentNode;return u&&u.tagName!=="FORM"&&(u=ce(u)),u},J=(d,u,$=DOMException)=>{if(!d.constructor.formAssociated)throw new $(u)},nt=(d,u,$)=>{const x=h.get(d);return x&&x.size&&x.forEach(I=>{n.get(I)[$]()||(u=!1)}),u},Le=d=>{if(d.constructor.formAssociated){const u=n.get(d),{labels:$,form:x}=u;ie(d,$),Te(d,x,u)}};function Me(){return typeof MutationObserver<"u"}class rt{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 lt=d=>(d.badInput=!1,d.customError=!1,d.patternMismatch=!1,d.rangeOverflow=!1,d.rangeUnderflow=!1,d.stepMismatch=!1,d.tooLong=!1,d.tooShort=!1,d.typeMismatch=!1,d.valid=!0,d.valueMissing=!1,d),ke=(d,u,$)=>(d.valid=Ne(u),Object.keys(u).forEach(x=>d[x]=u[x]),$&&pe($),d),Ne=d=>{let u=!0;for(let $ in d)$!=="valid"&&d[$]!==!1&&(u=!1);return u},Ze=new WeakMap;function Je(d,u){d.toggleAttribute(u,!0),d.part&&d.part.add(u)}class gt extends Set{static get isPolyfilled(){return!0}constructor(u){if(super(),!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Ze.set(this,u)}add(u){if(!/^--/.test(u)||typeof u!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${u} must start with '--'.`);const $=super.add(u),x=Ze.get(this),I=`state${u}`;return x.isConnected?Je(x,I):setTimeout(()=>{Je(x,I)}),$}clear(){for(let[u]of this.entries())this.delete(u);super.clear()}delete(u){const $=super.delete(u),x=Ze.get(this);return x.isConnected?(x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)):setTimeout(()=>{x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)}),$}}function ve(d,u,$,x){if(typeof u=="function"?d!==u||!x:!u.has(d))throw new TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?x:$==="a"?x.call(d):x?x.value:u.get(d)}function $e(d,u,$,x,I){if(typeof u=="function"?d!==u||!0:!u.has(d))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u.set(d,$),$}var We;class De{constructor(u){We.set(this,void 0),$e(this,We,u);for(let $=0;$<u.length;$++){let x=u[$];this[$]=x,x.hasAttribute("name")&&(this[x.getAttribute("name")]=x)}Object.freeze(this)}get length(){return ve(this,We,"f").length}[(We=new WeakMap,Symbol.iterator)](){return ve(this,We,"f")[Symbol.iterator]()}item(u){return this[u]==null?null:this[u]}namedItem(u){return this[u]==null?null:this[u]}}function xe(){const d=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=$;const u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=x;function $(...H){let G=d.apply(this,H);return nt(this,G,"checkValidity")}function x(...H){let G=u.apply(this,H);return nt(this,G,"reportValidity")}const{get:I}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...H){const G=I.call(this,...H),ct=Array.from(h.get(this)||[]);if(ct.length===0)return G;const qe=Array.from(G).concat(ct).sort((et,Be)=>et.compareDocumentPosition?et.compareDocumentPosition(Be)&2?1:-1:0);return new De(qe)}})}class at{static get isPolyfilled(){return!0}constructor(u){if(!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const $=u.getRootNode(),x=new rt;this.states=new gt(u),e.set(this,u),t.set(this,x),n.set(u,this),M(u,this),Z(u,this),Object.seal(this),$ instanceof DocumentFragment&&Ce($)}checkValidity(){const u=e.get(this);if(J(u,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const $=t.get(this);if(!$.valid){const x=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});u.dispatchEvent(x)}return $.valid}get form(){const u=e.get(this);J(u,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let $;return u.constructor.formAssociated===!0&&($=ce(u)),$}get labels(){const u=e.get(this);J(u,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const $=u.getAttribute("id"),x=u.getRootNode();return x&&$?x.querySelectorAll(`[for="${$}"]`):[]}reportValidity(){const u=e.get(this);if(J(u,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const $=this.checkValidity(),x=y.get(this);if(x&&!u.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!$&&x&&(u.focus(),x.focus()),$}setFormValue(u){const $=e.get(this);if(J($,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Q(this),u!=null&&!(u instanceof FormData)){if($.getAttribute("name")){const x=z($,this);x.value=u}}else u!=null&&u instanceof FormData&&Array.from(u).reverse().forEach(([x,I])=>{if(typeof I=="string"){const H=z($,this);H.name=x,H.value=I}});p.set($,u)}setValidity(u,$,x){const I=e.get(this);if(J(I,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!u)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");y.set(this,x);const H=t.get(this),G={};for(const et in u)G[et]=u[et];Object.keys(G).length===0&<(H);const ct=Object.assign(Object.assign({},H),G);delete ct.valid;const{valid:qe}=ke(H,ct,this.form);if(!qe&&!$)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.");r.set(this,qe?"":$),I.isConnected?(I.toggleAttribute("internals-invalid",!qe),I.toggleAttribute("internals-valid",qe),P(I,"aria-invalid",`${!qe}`)):w.set(I,this)}get shadowRoot(){const u=e.get(this);return b.get(u)||null}get validationMessage(){const u=e.get(this);return J(u,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),r.get(this)}get validity(){const u=e.get(this);return J(u,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),t.get(this)}get willValidate(){const u=e.get(this);return J(u,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(u.disabled||u.hasAttribute("disabled")||u.hasAttribute("readonly"))}}function Qt(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class d extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const u=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(u,d);const $=new d;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(x=>x in $.internals)}let mt=!1,Ct=!1;function qt(d){Ct||(Ct=!0,window.CustomStateSet=gt,d&&(HTMLElement.prototype.attachInternals=function(...u){const $=d.call(this,u);return $.states=new gt(this),$}))}function vt(d=!0){if(!mt){if(mt=!0,typeof window<"u"&&(window.ElementInternals=at),typeof CustomElementRegistry<"u"){const u=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function($,x,I){if(x.formAssociated){const H=x.prototype.connectedCallback;x.prototype.connectedCallback=function(){m.has(this)||(m.set(this,!0),this.hasAttribute("disabled")&&R(this,!0)),H!=null&&H.apply(this),Le(this)}}u.call(this,$,x,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(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new at(this)}),typeof Element<"u"){let u=function(...x){const I=$.apply(this,x);if(b.set(this,I),Me()){const H=new MutationObserver(K);window.ShadyDOM?H.observe(this,U):H.observe(I,U),c.set(this,H)}return I};const $=Element.prototype.attachShadow;Element.prototype.attachShadow=u}Me()&&typeof document<"u"&&new MutationObserver(K).observe(document.documentElement,U),typeof HTMLFormElement<"u"&&xe(),(d||typeof window<"u"&&!window.CustomStateSet)&&qt()}}return customElements.polyfillWrapFlushCallback||(Qt()?typeof window<"u"&&!window.CustomStateSet&&qt(HTMLElement.prototype.attachInternals):vt(!1)),s.forceCustomStateSetPolyfill=qt,s.forceElementInternalsPolyfill=vt,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Sh}Ch();var Th=Object.defineProperty,Y=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&Th(e,t,n),n};const aa="on",On="--checked",Zi=",";let V=class extends fe{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=ns(),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=yt.props.helptextDropdownButton.default,this.label=null,this.optionalText=ut.forms.labels.optional,this.requiredText=ut.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(e){var t,i,n,r,a,c,h,p,v,b,y;if(!e){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},ut.forms.messages.required,e):(t=e.validity)!=null&&t.typeMismatch||(i=e.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},ut.forms.messages.invalid,e):(n=e.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},ut.forms.messages.invalidPattern,e):(r=e.validity)!=null&&r.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},ut.forms.messages.tooShort,e):(a=e.validity)!=null&&a.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},ut.forms.messages.tooLong,e):(c=e.validity)!=null&&c.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?ut.forms.messages.rangeUnderflowMin.replace("{min}",(h=this.min)==null?void 0:h.toString()):ut.forms.messages.rangeUnderflow,e):(p=e.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},ut.forms.messages.invalid,e):(v=e.validity)!=null&&v.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?ut.forms.messages.rangeOverflowMax.replace("{max}",(b=this.max)==null?void 0:b.toString()):ut.forms.messages.rangeOverflow,e):(y=e.validity)!=null&&y.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){const t=new FormData;e.forEach(i=>{t.append(this.name,i)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(t=>{var i;if(t!==this&&t.getAttribute("name")===this.name&&t.getAttribute("value")!==this.value){const n=t;n.checked&&(n.checked=!1,n.internals&&(n.internals.setFormValue(null),(i=n.internals.states)==null||i.delete(On)))}})}valueChecked(e){if(!this.touched)return;const t=this.internals.form||this.closest("form"),i=t?new FormData(t):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof e=="string"?(this.checked=e==="true",this.internals.ariaChecked=String(e==="true")):typeof e=="boolean"&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){const n=(typeof this.value=="string"?this.value:"")||aa;this.internals.setFormValue(n),i&&i.append(this.name,n),this.internals.states.add(On)}else this.internals.setFormValue(null),i&&i.delete(this.name),this.internals.states.delete(On);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){(t!==this.value||t!==this._value)&&(typeof e=="string"?((this.multiple||this.range)&&e.includes(Zi)&&(e=e.split(Zi)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(t==null?void 0:t.toString())&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){const e=this.multiple||this.range?[]:"";this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e=="string"&&e.includes(Zi)?e.split(Zi):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||"":e}validate(){var e,t;(e=this.inputRef)!=null&&e.value&&this.manageValidity(this.inputRef.value),(t=this.inputRefTo)!=null&&t.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(!this.touched){this.touched=!0,e&&this.setFormValue(e);return}if(typeof e!="string"&&!Array.isArray(e))return;const t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){var e;if(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="false",this.internals.setFormValue(""),(e=this.inputRef)!=null&&e.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const t=this.defaultValue||(this.multiple||this.range?[]:"");this.value=t,this._value=Array.isArray(t)?t:[t],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(e){super.updated(e),e.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(e){if(super.firstUpdated(e),!this.form){const t=this.internals.form||this.closest("form");this.form=t}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const t=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(t);const i=t?(typeof this.value=="string"?this.value:"")||aa:null;this.internals.setFormValue(i)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};Y([o({type:Boolean,reflect:!0})],V.prototype,"checked"),Y([o({type:Boolean})],V.prototype,"defaultChecked"),Y([o({type:Boolean})],V.prototype,"multiple"),Y([o({type:Boolean})],V.prototype,"range"),Y([o({type:String,reflect:!0})],V.prototype,"type"),Y([o()],V.prototype,"defaultValue"),Y([o({type:Boolean,reflect:!0})],V.prototype,"disabled"),Y([o({type:Boolean,reflect:!0})],V.prototype,"readonly"),Y([o({type:Boolean,reflect:!0})],V.prototype,"required"),Y([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],V.prototype,"max"),Y([o({type:Number,reflect:!0})],V.prototype,"maxlength"),Y([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],V.prototype,"min"),Y([o({type:Number,reflect:!0})],V.prototype,"minlength"),Y([o({type:Number,reflect:!0})],V.prototype,"step"),Y([o({type:String})],V.prototype,"ariaDescribedBy"),Y([o({type:String})],V.prototype,"ariaLabelledby"),Y([o({type:String,reflect:!0})],V.prototype,"name"),Y([o({type:String,reflect:!0})],V.prototype,"pattern"),Y([o({type:String,reflect:!0})],V.prototype,"placeholder"),Y([o({type:String,reflect:!0})],V.prototype,"id"),Y([o({type:Boolean})],V.prototype,"counter"),Y([o({type:Boolean})],V.prototype,"hasError"),Y([o({type:Boolean})],V.prototype,"inline"),Y([o({type:Boolean})],V.prototype,"hasFieldset"),Y([o({type:Boolean})],V.prototype,"optionalTag"),Y([o({type:Boolean})],V.prototype,"requiredTag"),Y([o({type:Boolean})],V.prototype,"skipForwardTestid"),Y([o({type:Boolean,reflect:!0,converter:dt})],V.prototype,"useWrapper"),Y([o({type:Boolean,reflect:!0})],V.prototype,"fullwidth"),Y([o({type:Number})],V.prototype,"counterMaxLength"),Y([o({type:String})],V.prototype,"errorMessage"),Y([o({type:String})],V.prototype,"helptext"),Y([o({type:String})],V.prototype,"helptextDropdown"),Y([o({type:String,reflect:!1})],V.prototype,"helptextDropdownButton"),Y([o({type:String})],V.prototype,"label"),Y([o({type:String,reflect:!1})],V.prototype,"optionalText"),Y([o({type:String,reflect:!1})],V.prototype,"requiredText"),Y([o({type:String,reflect:!1})],V.prototype,"tagText"),Y([o({type:String,attribute:"data-testid"})],V.prototype,"dataTestid");let oa=class{constructor(e){this.nodes=[],this.options=[],this.host=e,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(t=>this.handleMutations(t))}hostConnected(){Array.from(this.host.childNodes).forEach(e=>{(e.nodeName==="OPTION"||e.nodeName==="DATA")&&this.addNode(e)}),this.createOptions(),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(e){(e.nodeName==="OPTION"||e.nodeName==="DATA")&&(e.hasAttribute("hidden")&&!e.hasAttribute("data-skip")&&e.setAttribute("data-hidden","true"),!e.hasAttribute("hidden")&&e.hasAttribute("data-skip")&&e.hasAttribute("data-hidden")&&e.removeAttribute("data-hidden"),e.setAttribute("class","pkt-hide"),e.setAttribute("data-skip","true"),e.setAttribute("hidden","true"),this.nodes.push(e))}createOptions(){this.options=this.nodes.map(e=>({value:e.hasAttribute("value")?e.getAttribute("value")??"":e.textContent??"",label:e.textContent||e.getAttribute("value")||"",selected:e.hasAttribute("selected"),disabled:e.hasAttribute("disabled"),hidden:e.hasAttribute("data-hidden")})),this.host.requestUpdate()}handleMutations(e){let t=!1;e.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{Ls(n)&&(this.addNode(n),t=!0)}),i.removedNodes.forEach(n=>{Ls(n)&&(this.nodes=this.nodes.filter(r=>r!==n),t=!0)})),i.type==="attributes"&&Ls(i.target)&&(this.addNode(i.target),t=!0)}),t&&this.createOptions()}};var Mh=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,ws=(s,e,t,i)=>{for(var n=i>1?void 0:i?Nh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Mh(e,t,n),n};let Yt=class extends fe{constructor(){super(),this.defaultSlot=L(),this.forId=ns(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=yt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new Oe(this,this.defaultSlot)}updateSlots(e){this.filledSlots=new Set(e)}render(){const e=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},t=A({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?f`<div class="pkt-inputwrapper__helptext-expandable">
|
|
412
412
|
<button
|
|
413
413
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
414
414
|
type="button"
|
|
415
|
-
@click=${
|
|
415
|
+
@click=${e}
|
|
416
416
|
>
|
|
417
417
|
<pkt-icon
|
|
418
418
|
class="pkt-btn__icon"
|
|
419
419
|
name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
|
|
420
420
|
></pkt-icon>
|
|
421
|
-
<span class="pkt-btn__text">${
|
|
421
|
+
<span class="pkt-btn__text">${Yi(this.helptextDropdownButton)}</span>
|
|
422
422
|
</button>
|
|
423
423
|
<div
|
|
424
|
-
class="${
|
|
424
|
+
class="${A({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
|
|
425
425
|
>
|
|
426
|
-
${
|
|
426
|
+
${Yi(this.helptextDropdown)}
|
|
427
427
|
</div>
|
|
428
|
-
</div>`:
|
|
428
|
+
</div>`:_;return f`${f`<div class="${t}">
|
|
429
429
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
430
|
-
<div class="pkt-contents" ${
|
|
431
|
-
${this.helptext&&
|
|
430
|
+
<div class="pkt-contents" ${B(this.defaultSlot)} name="helptext"></div>
|
|
431
|
+
${this.helptext&&Yi(this.helptext)}
|
|
432
432
|
</div>
|
|
433
433
|
${i()}
|
|
434
|
-
</div>`}`}};
|
|
435
|
-
${this.tagText?
|
|
436
|
-
${this.optionalTag?
|
|
437
|
-
${this.requiredTag?
|
|
438
|
-
`,
|
|
434
|
+
</div>`}`}};ws([o({type:String,reflect:!0})],Yt.prototype,"forId",2),ws([o({type:String})],Yt.prototype,"helptext",2),ws([o({type:String})],Yt.prototype,"helptextDropdown",2),ws([o({type:String})],Yt.prototype,"helptextDropdownButton",2),ws([q()],Yt.prototype,"isHelpTextOpen",2),ws([q()],Yt.prototype,"filledSlots",2),Yt=ws([X("pkt-helptext")],Yt);var Dh=Object.defineProperty,Oh=Object.getOwnPropertyDescriptor,we=(s,e,t,i)=>{for(var n=i>1?void 0:i?Oh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Dh(e,t,n),n};let be=class extends fe{constructor(){super(),this.defaultSlot=L(),this.helptextSlot=L(),this.forId=ns(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=yt.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=yt.props.optionalTag.default,this.optionalText=yt.props.optionalText.default,this.requiredTag=yt.props.requiredTag.default,this.requiredText=yt.props.requiredText.default,this.tagText=null,this.hasError=yt.props.hasError.default,this.errorMessage="",this.disabled=yt.props.disabled.default,this.inline=yt.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=yt.props.hasFieldset.default,this.role="group",this.useWrapper=yt.props.useWrapper.default,this.slotController=new Oe(this,this.defaultSlot,this.helptextSlot)}updated(e){super.updated(e)}render(){const e={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},t="pkt-tag pkt-tag--small pkt-tag--thin-text",i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:_,n=()=>f`
|
|
435
|
+
${this.tagText?f`<span class=${t+" pkt-tag--gray"}>${this.tagText}</span>`:_}
|
|
436
|
+
${this.optionalTag?f`<span class=${t+" pkt-tag--blue-light"}>${this.optionalText}</span>`:_}
|
|
437
|
+
${this.requiredTag?f`<span class=${t+" pkt-tag--beige"}>${this.requiredText}</span>`:_}
|
|
438
|
+
`,r=()=>this.useWrapper?this.hasFieldset?f`<legend
|
|
439
439
|
class="pkt-inputwrapper__legend"
|
|
440
440
|
id="${this.forId}-label"
|
|
441
441
|
@click=${this.handleLabelClick}
|
|
442
442
|
>
|
|
443
443
|
${this.label} ${n()}
|
|
444
|
-
</legend>`:
|
|
444
|
+
</legend>`:f`<label
|
|
445
445
|
class="pkt-inputwrapper__label"
|
|
446
446
|
for="${this.forId}"
|
|
447
447
|
aria-describedby="${i}"
|
|
448
448
|
id="${this.forId}-label"
|
|
449
449
|
@click=${this.handleLabelClick}
|
|
450
450
|
>${this.label}${n()}</label
|
|
451
|
-
>`:
|
|
451
|
+
>`:f`<label
|
|
452
452
|
for="${this.forId}"
|
|
453
453
|
class="pkt-sr-only"
|
|
454
454
|
aria-describedby="${i}"
|
|
455
455
|
id="${this.forId}-label"
|
|
456
456
|
>
|
|
457
457
|
${this.label}
|
|
458
|
-
</label>`,
|
|
458
|
+
</label>`,a=()=>f`
|
|
459
459
|
<pkt-helptext
|
|
460
|
-
class="${
|
|
460
|
+
class="${N(this.useWrapper?void 0:"pkt-hide")}"
|
|
461
461
|
.forId=${this.forId}
|
|
462
462
|
.helptext=${this.helptext}
|
|
463
463
|
.helptextDropdown=${this.helptextDropdown}
|
|
464
|
-
.helptextDropdownButton=${this.helptextDropdownButton||
|
|
465
|
-
@toggleHelpText=${
|
|
466
|
-
${
|
|
464
|
+
.helptextDropdownButton=${this.helptextDropdownButton||yt.props.helptextDropdownButton.default}
|
|
465
|
+
@toggleHelpText=${b=>{this.toggleDropdown(b)}}
|
|
466
|
+
${B(this.helptextSlot)}
|
|
467
467
|
name="helptext"
|
|
468
468
|
></pkt-helptext>
|
|
469
|
-
`,
|
|
470
|
-
${this.counterError?this.counterError:
|
|
471
|
-
${this.counterMaxLength?`/${this.counterMaxLength}`:
|
|
472
|
-
</div>`:
|
|
469
|
+
`,c=()=>this.counter?f`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
470
|
+
${this.counterError?this.counterError:_} ${this.counterCurrent||0}
|
|
471
|
+
${this.counterMaxLength?`/${this.counterMaxLength}`:_}
|
|
472
|
+
</div>`:_,h=()=>this.hasError&&this.errorMessage?f`<pkt-alert
|
|
473
473
|
skin="error"
|
|
474
474
|
compact
|
|
475
475
|
id=${`${this.forId}-error`}
|
|
476
476
|
aria-live="assertive"
|
|
477
477
|
aria-atomic="true"
|
|
478
478
|
>
|
|
479
|
-
${
|
|
480
|
-
</pkt-alert>`:
|
|
481
|
-
${
|
|
482
|
-
${
|
|
483
|
-
${this.counterPosition==="top"?
|
|
484
|
-
<div class="pkt-contents" ${
|
|
485
|
-
${this.counterPosition==="bottom"?
|
|
486
|
-
${
|
|
487
|
-
`,
|
|
479
|
+
${Yi(this.errorMessage)}
|
|
480
|
+
</pkt-alert>`:_,p=()=>f`
|
|
481
|
+
${r()}
|
|
482
|
+
${a()}
|
|
483
|
+
${this.counterPosition==="top"?c():_}
|
|
484
|
+
<div class="pkt-contents" ${B(this.defaultSlot)}></div>
|
|
485
|
+
${this.counterPosition==="bottom"?c():_}
|
|
486
|
+
${h()}
|
|
487
|
+
`,v=()=>this.hasFieldset?f`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
|
|
488
488
|
${p()}
|
|
489
|
-
</fieldset>`:
|
|
489
|
+
</fieldset>`:f`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return f`<div class=${A(e)}>${v()}</div> `}toggleDropdown(e){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:e.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};we([o({type:String})],be.prototype,"forId",2),we([o({type:String})],be.prototype,"label",2),we([o({type:String})],be.prototype,"helptext",2),we([o({type:String})],be.prototype,"helptextDropdown",2),we([o({type:String})],be.prototype,"helptextDropdownButton",2),we([o({type:Boolean})],be.prototype,"counter",2),we([o({type:Number})],be.prototype,"counterCurrent",2),we([o({type:Number})],be.prototype,"counterMaxLength",2),we([o({type:String})],be.prototype,"counterError",2),we([o({type:String,reflect:!1})],be.prototype,"counterPosition",2),we([o({type:Boolean})],be.prototype,"optionalTag",2),we([o({type:String})],be.prototype,"optionalText",2),we([o({type:Boolean})],be.prototype,"requiredTag",2),we([o({type:String})],be.prototype,"requiredText",2),we([o({type:String})],be.prototype,"tagText",2),we([o({type:Boolean})],be.prototype,"hasError",2),we([o({type:String})],be.prototype,"errorMessage",2),we([o({type:Boolean})],be.prototype,"disabled",2),we([o({type:Boolean})],be.prototype,"inline",2),we([o({type:String})],be.prototype,"ariaDescribedby",2),we([o({type:Boolean})],be.prototype,"hasFieldset",2),we([o({type:String,reflect:!0})],be.prototype,"role",2),we([o({type:Boolean,reflect:!0,converter:dt})],be.prototype,"useWrapper",2),be=we([X("pkt-input-wrapper")],be);var Eh=Object.defineProperty,Ph=Object.getOwnPropertyDescriptor,tt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ph(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Eh(e,t,n),n};let Ge=class extends fe{constructor(){super(...arguments),this.id=ns(),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(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,i){(e==="options"||e==="searchValue"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,i)}render(){return f`
|
|
490
490
|
<div
|
|
491
|
-
class=${
|
|
491
|
+
class=${A({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
492
492
|
role="listbox"
|
|
493
|
-
aria-label=${
|
|
493
|
+
aria-label=${N(this.label)}
|
|
494
494
|
>
|
|
495
495
|
<div class="pkt-listbox__banners">
|
|
496
496
|
${this.renderMaximumReachedBanner()} ${this.renderUserMessage()}
|
|
@@ -500,43 +500,43 @@
|
|
|
500
500
|
${this.renderList()}
|
|
501
501
|
</ul>
|
|
502
502
|
</div>
|
|
503
|
-
`}renderCheckboxOrCheckIcon(t
|
|
503
|
+
`}renderCheckboxOrCheckIcon(e,t){return this.isMultiSelect?f`
|
|
504
504
|
<input
|
|
505
505
|
class="pkt-input-check__input-checkbox"
|
|
506
506
|
type="checkbox"
|
|
507
507
|
role="presentation"
|
|
508
508
|
tabindex="-1"
|
|
509
|
-
value=${
|
|
510
|
-
.checked=${
|
|
511
|
-
aria-labelledby=${this.id+"-option-label-"+
|
|
512
|
-
?disabled=${this.disabled||
|
|
509
|
+
value=${e.value}
|
|
510
|
+
.checked=${e.selected}
|
|
511
|
+
aria-labelledby=${this.id+"-option-label-"+t}
|
|
512
|
+
?disabled=${this.disabled||e.disabled||this.maxIsReached&&!e.selected}
|
|
513
513
|
/>
|
|
514
|
-
`:
|
|
515
|
-
${
|
|
514
|
+
`:e.selected?f`<pkt-icon name="check-big"></pkt-icon>`:_}renderList(){return f`
|
|
515
|
+
${Dn(this._filteredOptions,e=>e.value,(e,t)=>f`
|
|
516
516
|
<li
|
|
517
|
-
@click=${()=>{this.toggleOption(
|
|
518
|
-
aria-selected=${
|
|
517
|
+
@click=${()=>{this.toggleOption(e)}}
|
|
518
|
+
aria-selected=${e.selected?"true":"false"}
|
|
519
519
|
@keydown=${this.handleOptionKeydown}
|
|
520
|
-
class=${
|
|
521
|
-
tabindex="${this.disabled||
|
|
522
|
-
data-index=${
|
|
523
|
-
data-value=${
|
|
524
|
-
data-selected=${
|
|
525
|
-
?data-disabled=${this.disabled||
|
|
520
|
+
class=${A({"pkt-listbox__option":!0,"pkt-listbox__option--selected":!!(!this.isMultiSelect&&e.selected),"pkt-listbox__option--checkBox":this.isMultiSelect})}
|
|
521
|
+
tabindex="${this.disabled||e.disabled?"-1":"0"}"
|
|
522
|
+
data-index=${t}
|
|
523
|
+
data-value=${e.value}
|
|
524
|
+
data-selected=${e.selected?"true":"false"}
|
|
525
|
+
?data-disabled=${this.disabled||e.disabled||this.maxIsReached&&!e.selected}
|
|
526
526
|
role="option"
|
|
527
|
-
id=${`${this.id}-${
|
|
527
|
+
id=${`${this.id}-${t}`}
|
|
528
528
|
>
|
|
529
|
-
${this.renderCheckboxOrCheckIcon(t
|
|
530
|
-
<span class="pkt-listbox__option-label" id=${this.id+"-option-label-"+
|
|
531
|
-
${
|
|
532
|
-
${
|
|
529
|
+
${this.renderCheckboxOrCheckIcon(e,t)}
|
|
530
|
+
<span class="pkt-listbox__option-label" id=${this.id+"-option-label-"+t}>
|
|
531
|
+
${e.prefix?f`<span class="pkt-listbox__option-prefix">${e.prefix}</span>`:_}
|
|
532
|
+
${e.label||e.value}
|
|
533
533
|
</span>
|
|
534
|
-
${
|
|
535
|
-
>${
|
|
536
|
-
>`:
|
|
534
|
+
${e.description?f`<span class="pkt-listbox__option-description pkt-txt-14-light"
|
|
535
|
+
>${e.description}</span
|
|
536
|
+
>`:_}
|
|
537
537
|
</li>
|
|
538
538
|
`)}
|
|
539
|
-
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?
|
|
539
|
+
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?f`
|
|
540
540
|
<div
|
|
541
541
|
class="pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option"
|
|
542
542
|
data-type="new-option"
|
|
@@ -549,18 +549,18 @@
|
|
|
549
549
|
<pkt-icon class="pkt-listbox__banner-icon" name="plus-sign" size="large"></pkt-icon>
|
|
550
550
|
Legg til “${this.customUserInput}”
|
|
551
551
|
</div>
|
|
552
|
-
`:
|
|
552
|
+
`:_}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(e=>e.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?f`
|
|
553
553
|
<div class="pkt-listbox__banner pkt-listbox__banner--maximum-reached">
|
|
554
554
|
${this._selectedOptions} av maks ${this.maxLength} mulige er valgt.
|
|
555
555
|
</div>
|
|
556
|
-
`:
|
|
556
|
+
`:_}renderUserMessage(){return this.userMessage?f`<div class="pkt-listbox__banner pkt-listbox__banner--user-message">
|
|
557
557
|
<pkt-icon
|
|
558
558
|
class="pkt-listbox__banner-icon"
|
|
559
559
|
name="exclamation-mark-circle"
|
|
560
560
|
size="large"
|
|
561
561
|
></pkt-icon>
|
|
562
562
|
${this.userMessage}
|
|
563
|
-
</div>`:
|
|
563
|
+
</div>`:_}renderSearch(){return this.includeSearch?f`
|
|
564
564
|
<div class="pkt-listbox__search">
|
|
565
565
|
<span class="pkt-listbox__search-icon">
|
|
566
566
|
<pkt-icon name="magnifying-glass-small" size="large"></pkt-icon>
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
type="text"
|
|
571
571
|
aria-label="Søk i listen"
|
|
572
572
|
form=""
|
|
573
|
-
placeholder=${this.searchPlaceholder||
|
|
573
|
+
placeholder=${this.searchPlaceholder||ut.forms.search.placeholder}
|
|
574
574
|
@input=${this.handleSearchInput}
|
|
575
575
|
@keydown=${this.handleSearchKeydown}
|
|
576
576
|
.value=${this.searchValue}
|
|
@@ -580,12 +580,12 @@
|
|
|
580
580
|
role="searchbox"
|
|
581
581
|
/>
|
|
582
582
|
</div>
|
|
583
|
-
`:
|
|
583
|
+
`:_}handleSearchInput(e){this.searchValue=e.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(e){switch(e.key){case"Enter":e.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),e.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(e){const t=e.currentTarget,i=t.dataset.value,n=t.dataset.type,r=t.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&n!=="new-option"&&n!=="searchbox"))switch(e.key){case" ":case"Enter":this.toggleOption(t),e.preventDefault();break;case"Backspace":i&&(r?this.toggleOption(t):this.closeOptions()),e.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":e.altKey?this.focusLastOption():n==="searchbox"||n==="new-option"?this.focusFirstOption():this.focusNextOption(t),e.preventDefault();break;case"ArrowUp":if(e.altKey)this.focusFirstOption();else if(t.dataset.index==="0"&&this.includeSearch){const a=this.querySelector('[role="searchbox"]');a&&a.focus()}else if(t.dataset.index==="0"&&this.customUserInput){const a=this.querySelector('[data-type="new-option"]');a&&a.focus()}else this.focusPreviousOption(t);e.preventDefault();break;case"Home":this.focusFirstOption(),e.preventDefault();break;case"End":this.focusLastOption(),e.preventDefault();break;default:(e.metaKey||e.ctrlKey)&&e.key==="a"&&(this.selectAll(),e.preventDefault()),this.isLetterOrSpace(e.key)&&(this.handleTypeAhead(e.key),e.preventDefault());break}}focusAndScrollIntoView(e){e.scrollIntoView({block:"nearest"}),window.setTimeout(()=>e.focus(),0)}focusNextOption(e){const t=e.nextElementSibling;t&&this.focusAndScrollIntoView(t)}focusPreviousOption(e){const t=e.previousElementSibling;if(e.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else t&&this.focusAndScrollIntoView(t)}focusFirstOption(){const e=this.getOptionElements()[0];e&&this.focusAndScrollIntoView(e)}focusLastOption(){const e=this.getOptionElements().pop();e&&this.focusAndScrollIntoView(e)}focusFirstOrSelectedOption(){if(this.disabled)return;const e=this.getOptionElements().find(t=>t.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const t=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(t)}else if(e)this.focusAndScrollIntoView(e);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const t=this.querySelector('[role="searchbox"]');window.setTimeout(()=>t.focus(),0)}else this.focusFirstOption()}toggleOption(e){const t=e instanceof HTMLElement?e.dataset.disabled:e.disabled;if(this.disabled||t)return;const i=e instanceof HTMLElement?e.dataset.value:e.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(e=>{var t;return(e.fulltext||e.label+e.value+(e.prefix||"")).toLowerCase().includes(((t=this.searchValue)==null?void 0:t.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(e){return/^[\p{L} ]$/u.test(e)}handleTypeAhead(e){this.typeAheadString+=e.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const t=this.getOptionElements().find(i=>{var n;return(n=i.textContent)==null?void 0:n.trim().toLowerCase().startsWith(this.typeAheadString)});t&&this.focusAndScrollIntoView(t)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};tt([o({type:String})],Ge.prototype,"id",2),tt([o({type:String})],Ge.prototype,"label",2),tt([o({type:Array})],Ge.prototype,"options",2),tt([o({type:Boolean,reflect:!0})],Ge.prototype,"isOpen",2),tt([o({type:Boolean})],Ge.prototype,"disabled",2),tt([o({type:Boolean})],Ge.prototype,"includeSearch",2),tt([o({type:Boolean})],Ge.prototype,"isMultiSelect",2),tt([o({type:Boolean})],Ge.prototype,"allowUserInput",2),tt([o({type:Boolean})],Ge.prototype,"maxIsReached",2),tt([o({type:String})],Ge.prototype,"customUserInput",2),tt([o({type:String})],Ge.prototype,"searchPlaceholder",2),tt([o({type:String})],Ge.prototype,"searchValue",2),tt([o({type:Number})],Ge.prototype,"maxLength",2),tt([o({type:String})],Ge.prototype,"userMessage",2),tt([q()],Ge.prototype,"_filteredOptions",2),Ge=tt([X("pkt-listbox")],Ge);const Ah={displayValueAs:{default:"label"}},Ih={props:Ah};var Lh=Object.defineProperty,Bh=Object.getOwnPropertyDescriptor,Ee=(s,e,t,i)=>{for(var n=i>1?void 0:i?Bh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Lh(e,t,n),n};let Se=class extends V{constructor(){super(),this.helptextSlot=L(),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=Ih.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=L(),this.arrowRef=L(),this.listboxRef=L(),this.focusRef=L(),this.optionTagRef=L(),this.optionsController=new oa(this),this.slotController=new Oe(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e,t;if(super.connectedCallback(),document&&document.body.addEventListener("click",i=>{this._isOptionsOpen&&!this.contains(i.target)&&this.handleFocusOut(i)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const i=((e=this.options)==null?void 0:e.filter(n=>n.userAdded))||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((t=this.optionsController)!=null&&t.nodes&&this.optionsController.nodes.length){const i=[];this.optionsController.nodes.forEach(n=>{if(!n.textContent&&!n.getAttribute("value"))return null;const r={value:n.getAttribute("value")||n.textContent||"",label:n.textContent||n.getAttribute("value")||""};n.getAttribute("data-prefix")&&(r.prefix=n.getAttribute("data-prefix")||void 0),n.getAttribute("tagskincolor")&&(r.tagSkinColor=n.getAttribute("tagskincolor")),n.getAttribute("description")&&(r.description=n.getAttribute("description")||void 0),r.fulltext=r.value+r.label+(r.prefix||""),i.push(r)}),i.length&&(this.options=[...i],this._options=[...i])}}updated(e){if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.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()),e.has("defaultOptions")&&this.defaultOptions.length){const t=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const t=(e.get("options")||this._options||[]).filter(n=>n&&n.userAdded).filter(n=>!(Array.isArray(this.options)?this.options:[]).some(r=>r.value===n.value)),i=[...t,...this.options];this._options=i,t.length>0&&(this.options=i),this._options.forEach(n=>{if(n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)){const r=[...this._value];this._value=[...this._value,n.value],this.valueChanged(this._value,r)}n.fulltext=n.value+n.label+(n.prefix||""),n.selected=n.selected||this._value.includes(n.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="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]])),e==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(n=>{n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)&&(this._value=[...this._value,n.value]),n.fulltext=n.value+n.label+(n.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return f`
|
|
584
584
|
<pkt-input-wrapper
|
|
585
585
|
.label=${this.label}
|
|
586
586
|
.helptext=${this.helptext}
|
|
587
|
-
.helptextDropdown=${
|
|
588
|
-
.helptextDropdownButton=${
|
|
587
|
+
.helptextDropdown=${N(this.helptextDropdown)}
|
|
588
|
+
.helptextDropdownButton=${N(this.helptextDropdownButton)}
|
|
589
589
|
?fullwidth=${this.fullwidth}
|
|
590
590
|
?hasError=${this.hasError}
|
|
591
591
|
?inline=${this.inline}
|
|
@@ -601,23 +601,23 @@
|
|
|
601
601
|
class="pkt-combobox__wrapper"
|
|
602
602
|
@labelClick=${this.handleInputClick}
|
|
603
603
|
>
|
|
604
|
-
<div class="pkt-contents" ${
|
|
604
|
+
<div class="pkt-contents" ${B(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
605
605
|
<div class="pkt-combobox" @focusout=${this.handleFocusOut}>
|
|
606
606
|
<div
|
|
607
|
-
class=${
|
|
607
|
+
class=${A({"pkt-combobox__input":!0,"pkt-combobox__input--fullwidth":this.fullwidth,"pkt-combobox__input--open":this._isOptionsOpen,"pkt-combobox__input--error":this.hasError,"pkt-combobox__input--disabled":this.disabled})}
|
|
608
608
|
tabindex="-1"
|
|
609
609
|
@click=${this.handleInputClick}
|
|
610
610
|
>
|
|
611
|
-
${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?
|
|
611
|
+
${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?f`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
|
|
612
612
|
>${this.placeholder}</span
|
|
613
|
-
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():
|
|
613
|
+
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():_}
|
|
614
614
|
${this.renderInputField()}
|
|
615
615
|
<div
|
|
616
616
|
class="pkt-btn pkt-btn--tertiary pkt-combobox__arrow"
|
|
617
617
|
@click=${this.handleArrowClick}
|
|
618
618
|
@keydown=${this.handleArrowClick}
|
|
619
619
|
id="${this.id}-arrow"
|
|
620
|
-
${
|
|
620
|
+
${B(this.arrowRef)}
|
|
621
621
|
aria-expanded=${this._isOptionsOpen}
|
|
622
622
|
aria-controls="${this.id}-listbox"
|
|
623
623
|
aria-haspopup="listbox"
|
|
@@ -628,12 +628,12 @@
|
|
|
628
628
|
tabindex="${this.disabled?"-1":"0"}"
|
|
629
629
|
>
|
|
630
630
|
<pkt-icon
|
|
631
|
-
class=${
|
|
631
|
+
class=${A({"pkt-combobox__arrow-icon":!0,"pkt-combobox__arrow-icon--open":this._isOptionsOpen})}
|
|
632
632
|
name="chevron-thin-down"
|
|
633
633
|
></pkt-icon>
|
|
634
634
|
</div>
|
|
635
635
|
<div
|
|
636
|
-
${
|
|
636
|
+
${B(this.focusRef)}
|
|
637
637
|
tabindex="-1"
|
|
638
638
|
@keydown=${this.handleArrowClick}
|
|
639
639
|
class="pkt-contents"
|
|
@@ -650,7 +650,7 @@
|
|
|
650
650
|
?isMultiSelect=${this.multiple}
|
|
651
651
|
?allowUserInput=${this.allowUserInput&&!this._maxIsReached}
|
|
652
652
|
?maxIsReached=${this._maxIsReached}
|
|
653
|
-
.customUserInput=${
|
|
653
|
+
.customUserInput=${N(this._addValueText)}
|
|
654
654
|
.userMessage=${this._userInfoMessage}
|
|
655
655
|
@search=${this.handleSearch}
|
|
656
656
|
@option-toggle=${this.handleOptionToggled}
|
|
@@ -658,15 +658,15 @@
|
|
|
658
658
|
@close-options=${()=>this._isOptionsOpen=!1}
|
|
659
659
|
.searchValue=${this._search||null}
|
|
660
660
|
.maxLength=${this.maxlength||0}
|
|
661
|
-
${
|
|
661
|
+
${B(this.listboxRef)}
|
|
662
662
|
></pkt-listbox>
|
|
663
663
|
</div>
|
|
664
664
|
|
|
665
|
-
${this.tagPlacement==="outside"&&this.multiple?
|
|
665
|
+
${this.tagPlacement==="outside"&&this.multiple?f`<div class="pkt-combobox__tags-outside">
|
|
666
666
|
${this.renderSingleOrMultipleValues()}
|
|
667
|
-
</div>`:
|
|
667
|
+
</div>`:_}
|
|
668
668
|
</pkt-input-wrapper>
|
|
669
|
-
`}renderInputField(){return this.typeahead||this.allowUserInput?
|
|
669
|
+
`}renderInputField(){return this.typeahead||this.allowUserInput?f`
|
|
670
670
|
<div class="pkt-combobox__input-div combobox__input">
|
|
671
671
|
<input
|
|
672
672
|
type="text"
|
|
@@ -678,66 +678,66 @@
|
|
|
678
678
|
@blur=${this.handleBlur}
|
|
679
679
|
autocomplete="off"
|
|
680
680
|
role="combobox"
|
|
681
|
-
aria-label=${
|
|
681
|
+
aria-label=${N(this.label)}
|
|
682
682
|
aria-autocomplete=${this.typeahead?"both":"list"}
|
|
683
683
|
aria-controls="${this.id}-listbox"
|
|
684
|
-
aria-multiselectable=${
|
|
685
|
-
aria-activedescendant=${
|
|
686
|
-
${
|
|
684
|
+
aria-multiselectable=${N(this.multiple?"true":void 0)}
|
|
685
|
+
aria-activedescendant=${N(this._value[0]&&this.findValueInOptions(this._value[0])?`${this.id}-listbox-${this.findIndexInOptions(this._value[0])}`:void 0)}
|
|
686
|
+
${B(this.inputRef)}
|
|
687
687
|
/>
|
|
688
688
|
</div>
|
|
689
|
-
`:
|
|
689
|
+
`:f`
|
|
690
690
|
<input
|
|
691
691
|
type="hidden"
|
|
692
692
|
id="${this.id}-input"
|
|
693
693
|
name=${(this.name||this.id)+"-input"}
|
|
694
694
|
.value=${this._value.join(",")}
|
|
695
|
-
${
|
|
695
|
+
${B(this.inputRef)}
|
|
696
696
|
/>
|
|
697
|
-
`}renderSingleOrMultipleValues(){const
|
|
697
|
+
`}renderSingleOrMultipleValues(){const e=!this.multiple,t=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=Dn(this._value,n=>n,n=>{var r;const a=this.findValueInOptions(n),c=(r=this.options.find(h=>h.value===n))==null?void 0:r.tagSkinColor;return f`
|
|
698
698
|
<pkt-tag
|
|
699
|
-
skin=${
|
|
699
|
+
skin=${c||"blue-dark"}
|
|
700
700
|
?closeTag=${!this.disabled}
|
|
701
701
|
@close=${()=>this.handleTagRemove(n)}
|
|
702
702
|
>
|
|
703
|
-
${this.renderValueTag(
|
|
703
|
+
${this.renderValueTag(a)}
|
|
704
704
|
</pkt-tag>
|
|
705
|
-
`});return t
|
|
706
|
-
>${
|
|
707
|
-
>`;case"value":return
|
|
708
|
-
>${
|
|
709
|
-
>`;case"label":default:return
|
|
710
|
-
>${
|
|
711
|
-
>`}}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 n;return(n=i.fulltext)==null?void 0:n.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var a;return!n.selected&&((a=n.label)==null?void 0:a.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=i[0];n!=null&&n.label&&(e.value=n.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,n,a,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((a=(n=t.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:a.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;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t)}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,n;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,(n=this.arrowRef.value)==null||n.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 n=this._value.find(h=>h.toLowerCase()===i),a=this._options.filter(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase().includes(i))??!1}),r=a.find(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((a.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(a.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!n:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case a.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 n=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,a=this._value.includes(t||n||""),r=!!n,h=((i=this._options.find(T=>T.value===t))==null?void 0:i.disabled)||!1,d=!(t!=null&&t.trim()),p=!this.multiple,m=this.multiple,v=this.isMaxItemsReached();let y=!1,$=!0,b="",x="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),b="Ny verdi lagt til",y=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),$=!1,y=!0,b="Ingen treff i søket"):a?(this.removeValue(n),y=!0):d&&p?(this.removeAllSelected(),y=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),y=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!v?(this.setSelected(n),y=!0):m&&v?(this._userInfoMessage="Maks antall valg nådd",$=!1,x=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",$=!1,y=!0,x=t),this._isOptionsOpen=y,y||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=b,this._search=x||"",this.resetComboboxInput($),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()}};lt([o({type:String,reflect:!0})],at.prototype,"value",2),lt([o({type:Array})],at.prototype,"options",2),lt([o({type:Array})],at.prototype,"defaultOptions",2),lt([o({type:Boolean})],at.prototype,"allowUserInput",2),lt([o({type:Boolean})],at.prototype,"typeahead",2),lt([o({type:Boolean})],at.prototype,"includeSearch",2),lt([o({type:String})],at.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],at.prototype,"multiple",2),lt([o({type:Number})],at.prototype,"maxlength",2),lt([o({type:String})],at.prototype,"displayValueAs",2),lt([o({type:String})],at.prototype,"tagPlacement",2),lt([L()],at.prototype,"_options",2),lt([L()],at.prototype,"_value",2),lt([L()],at.prototype,"_isOptionsOpen",2),lt([L()],at.prototype,"_userInfoMessage",2),lt([L()],at.prototype,"_addValueText",2),lt([L()],at.prototype,"_maxIsReached",2),lt([L()],at.prototype,"_search",2),lt([L()],at.prototype,"_inputFocus",2),lt([L()],at.prototype,"_editingSingleValue",2),at=lt([H("pkt-combobox")],at);const $h={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 _h=Object.defineProperty,wh=Object.getOwnPropertyDescriptor,ce=(s,t,e,i)=>{for(var n=i>1?void 0:i?wh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&_h(t,e,n),n};let Gi=null;function xh(){return Gi||(Gi=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)}),Gi)}let Rt=class extends J{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||$h.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,n)=>(i[n.name]=n.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 xh(),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}>
|
|
705
|
+
`});return e?t:i}renderValueTag(e){if(!e)return"";switch(this.displayValueAs){case"prefixAndValue":return f`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
706
|
+
>${e.prefix||""} ${e.value}</span
|
|
707
|
+
>`;case"value":return f`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
708
|
+
>${e.value}</span
|
|
709
|
+
>`;case"label":default:return f`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
710
|
+
>${e.label||e.value}</span
|
|
711
|
+
>`}}handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var n;return(n=i.fulltext)==null?void 0:n.toLowerCase().includes(this._search.toLowerCase())}),e.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var r;return!n.selected&&((r=n.label)==null?void 0:r.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=i[0];n!=null&&n.label&&(t.value=n.label,window.setTimeout(()=>t.setSelectionRange(this._search.length,t.value.length),0),t.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 e=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){var t,i,n,r,a;if(!this.disabled&&((i=(t=e.relatedTarget)==null?void 0:t.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((r=(n=e.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:r.id)!==this.id&&((a=e.target)==null?void 0:a.getAttribute("data-focusfix"))!==this.id&&e.relatedTarget!==this.focusRef.value&&e.relatedTarget!==this.inputRef.value&&e.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 c=this.inputRef.value.value,h=this.findValueInOptions(c);!this._value.includes(c)&&!h?this.allowUserInput?this.addNewUserValue(c):this.multiple||this.removeValue(this._value[0]):h&&!this._value.includes(h.value)&&this.setSelected(h.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(e){var t,i;if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.currentTarget&&e.currentTarget!==this.arrowRef.value&&((t=this.inputRef.value)==null?void 0:t.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(e)}handlePlaceholderClick(e){this.disabled||(e.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(e){var t,i;this.disabled||e instanceof KeyboardEvent&&e.key&&e.key!=="Enter"&&e.key!==" "&&e.key!=="ArrowDown"||(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(t=this.listboxRef.value)==null||t.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase()}handleInputKeydown(e){var t,i,n;switch(e.key){case",":this.multiple&&(e.preventDefault(),this.addValue());break;case"Enter":e.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((t=this.inputRef.value)==null?void 0:t.type)==="hidden"&&this.removeLastValue(e);break;case"Tab":case"ArrowDown":e.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),e.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),e.preventDefault();break}}handleTagRemove(e){this.removeSelected(e)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value)||this._search||"",i=t.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(c=>c.toLowerCase()===i),r=this._options.filter(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase().includes(i))??!1}),a=r.find(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase())===i||c.value.toLowerCase()===i});switch(!0){case((r.length===0||!a)&&this.allowUserInput):this._addValueText=t,this._userInfoMessage="";break;case(r.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!n:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case r.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(e){return this.options.find(t=>t.value===e||t.label===e)||null}findIndexInOptions(e){return this._options.findIndex(t=>t.value===e||t.label===e)}isMaxItemsReached(){const e=this.maxlength!==null&&this._value.length>=this.maxlength;return e?this._maxIsReached=!0:this._maxIsReached=!1,e}toggleValue(e){var t,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((t=this.findValueInOptions(e))==null?void 0:t.value)||null,r=this._value.includes(e||n||""),a=!!n,c=((i=this._options.find(C=>C.value===e))==null?void 0:i.disabled)||!1,h=!(e!=null&&e.trim()),p=!this.multiple,v=this.multiple,b=this.isMaxItemsReached();let y=!1,k=!0,m="",w="";c||(!a&&this.allowUserInput&&!h?(this.addNewUserValue(e),m="Ny verdi lagt til",y=!v):!a&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),k=!1,y=!0,m="Ingen treff i søket"):r?(this.removeValue(n),y=!0):h&&p?(this.removeAllSelected(),y=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),y=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):v&&!b?(this.setSelected(n),y=!0):v&&b?(this._userInfoMessage="Maks antall valg nådd",k=!1,w=e):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",k=!1,y=!0,w=e),this._isOptionsOpen=y,y||window.setTimeout(()=>{var C;(C=this.focusRef.value)==null||C.focus()},0),this._userInfoMessage=m,this._search=w||"",this.resetComboboxInput(k),v&&this.isMaxItemsReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,this._options=this._options.map(t=>(t.value===e&&(t.selected=!0),t)),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(i=>i!==e);const t=this.findValueInOptions(e);t?(t.selected=!1,t.userAdded?(this._options=[...this._options.filter(i=>i.value!==e)],this.options=[...this.options.filter(i=>i.value!==e)]):this._options=[...this._options,t]):!e&&!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(e=>e.value),this._options=this._options.map(e=>(e.selected=!0,e)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(e=>(e.selected=!1,e)),this._options=this._options.filter(e=>!e.userAdded),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";this._search=t,this.toggleValue(t)}removeValue(e){this._value=this.multiple?this._value.filter(t=>t!==e):[],this.removeSelected(e)}addNewUserValue(e){if(!e||e.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[e],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(e)){if(this.isMaxItemsReached())return;this._value=[...this._value,e]}const t={value:e,label:e,userAdded:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.setSelected(e),this.requestUpdate()}resetComboboxInput(e=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&e)if(this._search="",this.multiple)this.inputRef.value.value="";else{const t=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();const t=this._value[this._value.length-1];t&&this.removeSelected(t),this.isMaxItemsReached()}};Ee([o({type:String,reflect:!0})],Se.prototype,"value",2),Ee([o({type:Array})],Se.prototype,"options",2),Ee([o({type:Array})],Se.prototype,"defaultOptions",2),Ee([o({type:Boolean})],Se.prototype,"allowUserInput",2),Ee([o({type:Boolean})],Se.prototype,"typeahead",2),Ee([o({type:Boolean})],Se.prototype,"includeSearch",2),Ee([o({type:String})],Se.prototype,"searchPlaceholder",2),Ee([o({type:Boolean})],Se.prototype,"multiple",2),Ee([o({type:Number})],Se.prototype,"maxlength",2),Ee([o({type:String})],Se.prototype,"displayValueAs",2),Ee([o({type:String})],Se.prototype,"tagPlacement",2),Ee([q()],Se.prototype,"_options",2),Ee([q()],Se.prototype,"_value",2),Ee([q()],Se.prototype,"_isOptionsOpen",2),Ee([q()],Se.prototype,"_userInfoMessage",2),Ee([q()],Se.prototype,"_addValueText",2),Ee([q()],Se.prototype,"_maxIsReached",2),Ee([q()],Se.prototype,"_search",2),Ee([q()],Se.prototype,"_inputFocus",2),Ee([q()],Se.prototype,"_editingSingleValue",2),Se=Ee([X("pkt-combobox")],Se);const Fh={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 Hh=Object.defineProperty,Vh=Object.getOwnPropertyDescriptor,Bt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Vh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Hh(e,t,n),n};let En=null;function jh(){return En||(En=new Promise((s,e)=>{if(document.querySelector("#oslo-consent-script")){s();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>s(),t.onerror=e,document.head.appendChild(t);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)}),En)}let xt=class extends fe{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||Fh.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const t=this.returnJsonOrObject(e.value).items.reduce((i,n)=>(i[n.name]=n.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:t,bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await jh(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const t={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(t),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?f`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?f`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
712
712
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
713
713
|
${this.triggerText}
|
|
714
|
-
</a>`:this.triggerType==="icon"?
|
|
714
|
+
</a>`:this.triggerType==="icon"?f`<pkt-button
|
|
715
715
|
skin="tertiary"
|
|
716
716
|
variant="icon-only"
|
|
717
717
|
iconName="cookie"
|
|
718
718
|
@click=${this.openModal}
|
|
719
719
|
>
|
|
720
720
|
>${this.triggerText}</pkt-button
|
|
721
|
-
>`:
|
|
722
|
-
${this.tagText?
|
|
723
|
-
${this.optionalTag?
|
|
724
|
-
${this.requiredTag?
|
|
725
|
-
`,
|
|
721
|
+
>`:f`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};Bt([o({type:Boolean})],xt.prototype,"devMode",2),Bt([o({type:String})],xt.prototype,"hotjarId",2),Bt([o({type:String})],xt.prototype,"googleAnalyticsId",2),Bt([o({type:String})],xt.prototype,"cookieDomain",2),Bt([o({type:String})],xt.prototype,"cookieSecure",2),Bt([o({type:String})],xt.prototype,"cookieExpiryDays",2),Bt([o({type:String})],xt.prototype,"triggerType",2),Bt([o({type:String})],xt.prototype,"triggerText",2),Bt([o({type:String})],xt.prototype,"i18nLanguage",2),xt=Bt([X("pkt-consent")],xt);var Uh=Object.defineProperty,Wh=Object.getOwnPropertyDescriptor,st=(s,e,t,i)=>{for(var n=i>1?void 0:i?Wh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Uh(e,t,n),n};let Xe=class extends V{constructor(){super(...arguments),this.inputRef=L(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,i){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,t,i)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=A({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=A({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=A({"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}),n="pkt-tag pkt-tag--small pkt-tag--thin-text",r=()=>f`
|
|
722
|
+
${this.tagText?f`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:_}
|
|
723
|
+
${this.optionalTag?f`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:_}
|
|
724
|
+
${this.requiredTag?f`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:_}
|
|
725
|
+
`,a=()=>f`
|
|
726
726
|
<label class=${i} for=${this.id+"-internal"}>
|
|
727
|
-
${this.label} ${
|
|
728
|
-
${this.checkHelptext?
|
|
727
|
+
${this.label} ${r()}
|
|
728
|
+
${this.checkHelptext?f`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:_}
|
|
729
729
|
</label>
|
|
730
|
-
`;return
|
|
730
|
+
`;return f`
|
|
731
731
|
<div class="pkt-input-check">
|
|
732
|
-
<div class=${
|
|
733
|
-
${this.labelPosition==="left"?
|
|
732
|
+
<div class=${e}>
|
|
733
|
+
${this.labelPosition==="left"?a():_}
|
|
734
734
|
<input
|
|
735
735
|
id=${this.id+"-internal"}
|
|
736
|
-
class=${
|
|
736
|
+
class=${t}
|
|
737
737
|
type="checkbox"
|
|
738
738
|
?disabled=${this.disabled}
|
|
739
739
|
name=${this.name+"-internal"}
|
|
740
|
-
${
|
|
740
|
+
${B(this.inputRef)}
|
|
741
741
|
@change=${this.handleChange}
|
|
742
742
|
@click=${this.handleClick}
|
|
743
743
|
@blur=${this.onBlur}
|
|
@@ -745,152 +745,154 @@
|
|
|
745
745
|
?checked=${this.checked}
|
|
746
746
|
role=${this.isSwitch?"switch":"checkbox"}
|
|
747
747
|
/>
|
|
748
|
-
${this.labelPosition==="right"?
|
|
748
|
+
${this.labelPosition==="right"?a():_}
|
|
749
749
|
</div>
|
|
750
750
|
</div>
|
|
751
|
-
`}handleClick(
|
|
752
|
-
<div class=${
|
|
753
|
-
${Array.isArray(this.dates)&&this.dates[0]?
|
|
754
|
-
id=${this.idBase+
|
|
751
|
+
`}handleClick(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1}handleChange(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1;this.toggleChecked(e)}toggleChecked(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}const t=e.target;if(t&&t.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};st([o({type:String,reflect:!0})],Xe.prototype,"value",2),st([o({type:String})],Xe.prototype,"checkHelptext",2),st([o({type:Boolean})],Xe.prototype,"defaultChecked",2),st([o({type:Boolean})],Xe.prototype,"hasTile",2),st([o({type:Boolean})],Xe.prototype,"isSwitch",2),st([o({type:String})],Xe.prototype,"labelPosition",2),st([o({type:Boolean})],Xe.prototype,"hideLabel",2),st([o({type:Boolean,reflect:!0})],Xe.prototype,"checked",2),st([o({type:Boolean,reflect:!0})],Xe.prototype,"indeterminate",2),st([o({type:String,reflect:!0})],Xe.prototype,"type",2),st([o({type:String})],Xe.prototype,"tagText",2),st([o({type:Boolean})],Xe.prototype,"optionalTag",2),st([o({type:String})],Xe.prototype,"optionalText",2),st([o({type:Boolean})],Xe.prototype,"requiredTag",2),st([o({type:String})],Xe.prototype,"requiredText",2),Xe=st([X("pkt-checkbox")],Xe);const la={calendar:{buttonAltText:"Åpne kalender"}},qh={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var zh=Object.defineProperty,Yh=Object.getOwnPropertyDescriptor,$i=(s,e,t,i)=>{for(var n=i>1?void 0:i?Yh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&zh(e,t,n),n};let qs=class extends fe{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=ns()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},f`
|
|
752
|
+
<div class=${A(this.classes)} aria-live="polite">
|
|
753
|
+
${Array.isArray(this.dates)&&this.dates[0]?Dn(Jr((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return f` <pkt-tag
|
|
754
|
+
id=${this.idBase+e+"-tag"}
|
|
755
755
|
closeTag
|
|
756
|
-
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:
|
|
757
|
-
.ariaLabel=${`${(
|
|
756
|
+
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:e}))}}
|
|
757
|
+
.ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${Xr(e,this.dateformat)}`}
|
|
758
758
|
>
|
|
759
|
-
<time datetime=${
|
|
760
|
-
</pkt-tag>`}):
|
|
759
|
+
<time datetime=${e}>${Xr(e,this.dateformat)}</time>
|
|
760
|
+
</pkt-tag>`}):_}
|
|
761
761
|
</div>
|
|
762
|
-
`}}
|
|
762
|
+
`}};$i([o({type:Array})],qs.prototype,"dates",2),$i([o({type:String})],qs.prototype,"dateformat",2),$i([o({type:String,attribute:"class"})],qs.prototype,"className",2),$i([o({type:String,attribute:"id-base"})],qs.prototype,"idBase",2),qs=$i([X("pkt-date-tags")],qs);const Kh={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},wi={props:Kh},_s=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},Rh=()=>_s()?"text":"date",Gh=s=>!s||s.length!==2?!0:Rc(s[0],s[1]),Xh=s=>Jr(s),Qh=(s,e,t,i,n)=>Kc(s,e,t,i,n),Zh=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),Jh=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),eu=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),tu=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,su=(s,e,t=!1)=>{var i;if(!s||!e)return;const n=((i=e.parentElement)==null?void 0:i.getBoundingClientRect())||e.getBoundingClientRect(),r=t?n.height+30:n.height,a=s.getBoundingClientRect().height;let c=t?"calc(100% - 30px)":"100%";n&&n.top+a>window.innerHeight&&n.top-a>0&&(c=`calc(100% - ${r}px - ${a}px)`),s.style.top=c},iu=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},nu=(s,e)=>{const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))},ca={validateRangeOrder:Gh,sortDates:Xh,filterSelectableDates:Qh},ru={getInputType:Rh},_i={submitForm(s){var e;const t=(e=s.internals)==null?void 0:e.form;t&&t.requestSubmit()},submitFormOrFallback(s,e){const t=s==null?void 0:s.form;t?t.requestSubmit():e()},validateDateInput(s,e,t,i,n){var r,a,c,h;const p=s.value;p&&(t&&t>p?e.setValidity({rangeUnderflow:!0},((a=(r=n==null?void 0:n.forms)==null?void 0:r.messages)==null?void 0:a.rangeUnderflow)||"Value is below minimum",s):i&&i<p&&e.setValidity({rangeOverflow:!0},((h=(c=n==null?void 0:n.forms)==null?void 0:c.messages)==null?void 0:h.rangeOverflow)||"Value is above maximum",s))}},Ji={addToSelected(s,e,t,i){const n=s.target;if(!n.value)return;const r=t?_t(t):null,a=i?_t(i):null,c=_t(n.value.split(",")[0]);c&&!isNaN(c.getTime())&&(!r||c>=r)&&(!a||c<=a)&&e.value&&e.value.handleDateSelect(c),n.value=""},handleCalendarPosition(s,e,t=!1){su(s.value??null,e.value??null,t)}},Pn={getInputClasses:Zh,getButtonClasses:Jh,getRangeLabelClasses:eu},An={processDateSelection:tu,updateInputValues(s,e,t,i,n,r){s.value&&(i&&e!=null&&e.value?(s.value.value=t[0]??"",e.value.value=t[1]??"",r(s.value),r(e.value)):n||(s.value.value=t.length?t[0]:"",r(s.value)))},processRangeBlur(s,e,t,i,n){var r;const a=s.target;if(a.value){n(a);const c=ss(a.value);c&&((r=t==null?void 0:t.value)==null||r.handleDateSelect(c))}else e[0]&&i()}},en={handleInputKeydown:iu,handleButtonKeydown:nu};var au=Object.defineProperty,ou=Object.getOwnPropertyDescriptor,ot=(s,e,t,i)=>{for(var n=i>1?void 0:i?ou(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&au(e,t,n),n};let it=class extends fe{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this._hasBeenOpened=!1,this.popupRef=L(),this.calendarRef=L(),this.handleDocumentClick=e=>{if(!this.open)return;const t=e.composedPath(),i=this.parentElement,n=this.popupRef.value;!t.includes(this)&&!t.includes(n)&&!(i&&t.includes(i))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=e=>{this.open&&e.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef}updated(e){super.updated(e),e.has("open")&&(this.open?(this._hasBeenOpened=!0,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)):(document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var e;this.open=!0,(e=this.calendarRef.value)==null||e.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(e){var t;return!!e&&!!((t=this.popupRef.value)!=null&&t.contains(e))}focusOnCurrentDate(){const e=this.calendarRef.value;e&&typeof e.focusOnCurrentDate=="function"&&e.focusOnCurrentDate()}addToSelected(e,t,i){if(this.calendarRef.value&&typeof Ji.addToSelected=="function")return Ji.addToSelected(e,this.calendarRef,t,i);const n=e.target;if(!n.value)return;const r=t?_t(t):null,a=i?_t(i):null,c=_t(n.value.split(",")[0]);c&&!isNaN(c.getTime())&&(!r||c>=r)&&(!a||c<=a)&&this.handleDateSelect(c),n.value=""}handleDateSelect(e){const t=this.calendarRef.value;if(t&&typeof t.handleDateSelect=="function")return t.handleDateSelect(e);const i=He(e),n=this.selected.indexOf(i)>=0?this.selected.filter(r=>r!==i):[...this.selected,i];this.selected=n,this.dispatchEvent(new CustomEvent("date-selected",{detail:n,bubbles:!0,composed:!0}))}render(){const e={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return f`
|
|
763
763
|
<div
|
|
764
|
-
class="${
|
|
765
|
-
${
|
|
764
|
+
class="${A(e)}"
|
|
765
|
+
${B(this.popupRef)}
|
|
766
766
|
id="date-popup"
|
|
767
767
|
?hidden=${!this.open}
|
|
768
768
|
aria-hidden="${!this.open}"
|
|
769
769
|
>
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
770
|
+
${this.open||this._hasBeenOpened?f`<pkt-calendar
|
|
771
|
+
${B(this.calendarRef)}
|
|
772
|
+
?multiple=${this.multiple}
|
|
773
|
+
?range=${this.range}
|
|
774
|
+
?weeknumbers=${this.weeknumbers}
|
|
775
|
+
?withcontrols=${this.withcontrols}
|
|
776
|
+
.maxMultiple=${this.maxMultiple}
|
|
777
|
+
.selected=${this.selected}
|
|
778
|
+
.earliest=${this.earliest}
|
|
779
|
+
.latest=${this.latest}
|
|
780
|
+
.excludedates=${this.excludedates}
|
|
781
|
+
.excludeweekdays=${this.excludeweekdays}
|
|
782
|
+
.currentmonth=${this.currentmonth}
|
|
783
|
+
.today=${this.today}
|
|
784
|
+
@date-selected=${t=>{this.selected=t.detail,this.dispatchEvent(new CustomEvent("date-selected",{detail:t.detail,bubbles:!0,composed:!0}))}}
|
|
785
|
+
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
786
|
+
></pkt-calendar>`:_}
|
|
786
787
|
</div>
|
|
787
|
-
`}};
|
|
788
|
+
`}};ot([o({type:Boolean,reflect:!0})],it.prototype,"open",2),ot([o({type:Boolean})],it.prototype,"multiple",2),ot([o({type:Boolean})],it.prototype,"range",2),ot([o({type:Boolean})],it.prototype,"weeknumbers",2),ot([o({type:Boolean})],it.prototype,"withcontrols",2),ot([o({type:Number})],it.prototype,"maxMultiple",2),ot([o({type:Array})],it.prototype,"selected",2),ot([o({type:String})],it.prototype,"earliest",2),ot([o({type:String})],it.prototype,"latest",2),ot([o({type:Array})],it.prototype,"excludedates",2),ot([o({type:Array})],it.prototype,"excludeweekdays",2),ot([o({type:String})],it.prototype,"currentmonth",2),ot([o({type:String})],it.prototype,"today",2),ot([q()],it.prototype,"_hasBeenOpened",2),it=ot([X("pkt-datepicker-popup")],it);var lu=Object.defineProperty,Kt=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&lu(e,t,n),n};let St=class extends fe{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=L(),this.btnRef=L()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}renderCalendarButton(){var e;return f`
|
|
788
789
|
<button
|
|
789
|
-
class="${
|
|
790
|
+
class="${A(Pn.getButtonClasses())}"
|
|
790
791
|
type="button"
|
|
791
|
-
@click=${
|
|
792
|
-
@keydown=${
|
|
792
|
+
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
793
|
+
@keydown=${t=>{const{key:i}=t;(i==="Enter"||i===" "||i==="Space")&&(t.preventDefault(),this.dispatchToggleCalendar(t))}}
|
|
793
794
|
?disabled=${this.disabled}
|
|
794
795
|
${this.btnRef}
|
|
795
796
|
>
|
|
796
797
|
<pkt-icon name="calendar"></pkt-icon>
|
|
797
|
-
<span class="pkt-btn__text">${((
|
|
798
|
+
<span class="pkt-btn__text">${((e=this.strings.calendar)==null?void 0:e.buttonAltText)||"Åpne kalender"}</span>
|
|
798
799
|
</button>
|
|
799
|
-
`}createRenderRoot(){return this}};
|
|
800
|
+
`}createRenderRoot(){return this}};Kt([o({type:String})],St.prototype,"inputType"),Kt([o({type:String})],St.prototype,"id"),Kt([o({type:String})],St.prototype,"min"),Kt([o({type:String})],St.prototype,"max"),Kt([o({type:String})],St.prototype,"placeholder"),Kt([o({type:Boolean})],St.prototype,"readonly"),Kt([o({type:Boolean})],St.prototype,"disabled"),Kt([o({type:Object})],St.prototype,"inputClasses"),Kt([o({type:Object})],St.prototype,"internals");var cu=Object.defineProperty,hu=Object.getOwnPropertyDescriptor,In=(s,e,t,i)=>{for(var n=i>1?void 0:i?hu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&cu(e,t,n),n};let tn=class extends St{constructor(){super(...arguments),this.value="",this.strings=la}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return f`
|
|
800
801
|
<div class="pkt-input__container">
|
|
801
802
|
<input
|
|
802
|
-
class="${
|
|
803
|
+
class="${A(this.inputClasses)}"
|
|
803
804
|
.type=${this.inputType}
|
|
804
805
|
id="${this.id}-input"
|
|
805
806
|
.value=${this.value}
|
|
806
|
-
min=${
|
|
807
|
-
max=${
|
|
808
|
-
placeholder=${
|
|
807
|
+
min=${N(this.min)}
|
|
808
|
+
max=${N(this.max)}
|
|
809
|
+
placeholder=${N(this.placeholder)}
|
|
809
810
|
?readonly=${this.isInputReadonly}
|
|
810
811
|
aria-describedby="${this.id}-helptext"
|
|
811
|
-
@click=${
|
|
812
|
-
@touchend=${
|
|
812
|
+
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
813
|
+
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
813
814
|
?disabled=${this.disabled}
|
|
814
|
-
@keydown=${
|
|
815
|
-
@input=${
|
|
816
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
817
|
-
@blur=${
|
|
818
|
-
@change=${
|
|
819
|
-
${
|
|
815
|
+
@keydown=${e=>en.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>_i.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()})}
|
|
816
|
+
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
817
|
+
@focus=${()=>{this.dispatchFocus(),_s()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
818
|
+
@blur=${e=>{this.dispatchBlur(e),this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent("value-change",{detail:e.target.value,bubbles:!0,composed:!0}))}}
|
|
819
|
+
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
820
|
+
${B(this.inputRef)}
|
|
820
821
|
/>
|
|
821
822
|
${this.renderCalendarButton()}
|
|
822
823
|
</div>
|
|
823
|
-
`}};
|
|
824
|
+
`}};In([o({type:String})],tn.prototype,"value",2),In([o({type:Object})],tn.prototype,"strings",2),tn=In([X("pkt-datepicker-single")],tn);var uu=Object.defineProperty,du=Object.getOwnPropertyDescriptor,xi=(s,e,t,i)=>{for(var n=i>1?void 0:i?du(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&uu(e,t,n),n};let zs=class extends St{constructor(){super(...arguments),this.value=[],this.label="",this.showRangeLabels=!1,this.strings=qh,this.inputRefTo=L()}get inputElementTo(){return this.inputRefTo.value}render(){var e,t,i,n;const r=Pn.getRangeLabelClasses(this.showRangeLabels);return f`
|
|
824
825
|
<div class="pkt-input__container">
|
|
825
|
-
${this.showRangeLabels?
|
|
826
|
+
${this.showRangeLabels?f` <div class="pkt-input-prefix">${(e=this.strings.generic)==null?void 0:e.from}</div> `:_}
|
|
826
827
|
<input
|
|
827
|
-
class=${
|
|
828
|
+
class=${A(this.inputClasses)}
|
|
828
829
|
.type=${this.inputType}
|
|
829
830
|
id="${this.id}-input"
|
|
831
|
+
aria-label="${this.label} ${((t=this.strings.generic)==null?void 0:t.from)??"Fra"}"
|
|
830
832
|
.value=${this.value[0]??""}
|
|
831
|
-
min=${
|
|
832
|
-
max=${
|
|
833
|
-
placeholder=${
|
|
833
|
+
min=${N(this.min)}
|
|
834
|
+
max=${N(this.max)}
|
|
835
|
+
placeholder=${N(this.placeholder)}
|
|
834
836
|
?readonly=${this.isInputReadonly}
|
|
835
837
|
?disabled=${this.disabled}
|
|
836
|
-
@click=${
|
|
837
|
-
@touchend=${
|
|
838
|
-
@keydown=${
|
|
839
|
-
@input=${
|
|
840
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
841
|
-
@blur=${
|
|
842
|
-
@change=${
|
|
843
|
-
${
|
|
838
|
+
@click=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
|
|
839
|
+
@touchend=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
|
|
840
|
+
@keydown=${a=>en.handleInputKeydown(a,c=>this.dispatchToggleCalendar(c),()=>_i.submitFormOrFallback(this.internals,()=>{var c;return(c=this.inputRefTo.value)==null?void 0:c.focus()}),()=>{var c;return(c=this.inputRefTo.value)==null?void 0:c.focus()},()=>{var c;return(c=this.inputRef.value)==null?void 0:c.blur()})}
|
|
841
|
+
@input=${a=>{this.dispatchInput(a),a.stopImmediatePropagation()}}
|
|
842
|
+
@focus=${()=>{this.dispatchFocus(),_s()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
843
|
+
@blur=${a=>{this.dispatchBlur(a),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:a,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
844
|
+
@change=${a=>{this.dispatchChange(a),a.stopImmediatePropagation()}}
|
|
845
|
+
${B(this.inputRef)}
|
|
844
846
|
/>
|
|
845
|
-
<div class="${
|
|
846
|
-
${(
|
|
847
|
+
<div class="${A(r)}" id="${this.id}-to-label">
|
|
848
|
+
${(i=this.strings.generic)==null?void 0:i.to}
|
|
847
849
|
</div>
|
|
848
|
-
${this.showRangeLabels?
|
|
850
|
+
${this.showRangeLabels?_:f` <div class="pkt-input-separator">–</div> `}
|
|
849
851
|
<input
|
|
850
|
-
class=${
|
|
852
|
+
class=${A(this.inputClasses)}
|
|
851
853
|
.type=${this.inputType}
|
|
852
854
|
id="${this.id}-to"
|
|
853
|
-
aria-
|
|
855
|
+
aria-label="${this.label} ${((n=this.strings.generic)==null?void 0:n.to)??"Til"}"
|
|
854
856
|
.value=${this.value[1]??""}
|
|
855
|
-
min=${
|
|
856
|
-
max=${
|
|
857
|
-
placeholder=${
|
|
857
|
+
min=${N(this.min)}
|
|
858
|
+
max=${N(this.max)}
|
|
859
|
+
placeholder=${N(this.placeholder)}
|
|
858
860
|
?readonly=${this.isInputReadonly}
|
|
859
861
|
?disabled=${this.disabled}
|
|
860
|
-
@click=${
|
|
861
|
-
@touchend=${
|
|
862
|
-
@keydown=${
|
|
863
|
-
@input=${
|
|
864
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
865
|
-
@blur=${
|
|
866
|
-
@change=${
|
|
867
|
-
${
|
|
862
|
+
@click=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
|
|
863
|
+
@touchend=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
|
|
864
|
+
@keydown=${a=>en.handleInputKeydown(a,c=>this.dispatchToggleCalendar(c),()=>_i.submitFormOrFallback(this.internals,()=>{var c;return(c=this.inputRefTo.value)==null?void 0:c.blur()}),void 0,()=>{var c;return(c=this.inputRefTo.value)==null?void 0:c.blur()})}
|
|
865
|
+
@input=${a=>{this.dispatchInput(a),a.stopImmediatePropagation()}}
|
|
866
|
+
@focus=${()=>{this.dispatchFocus(),_s()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
867
|
+
@blur=${a=>{this.dispatchBlur(a),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:a,values:this.value,inputType:"to"},bubbles:!0,composed:!0}))}}
|
|
868
|
+
@change=${a=>{this.dispatchChange(a),a.stopImmediatePropagation()}}
|
|
869
|
+
${B(this.inputRefTo)}
|
|
868
870
|
/>
|
|
869
871
|
${this.renderCalendarButton()}
|
|
870
872
|
</div>
|
|
871
|
-
`}};
|
|
873
|
+
`}};xi([o({type:Array})],zs.prototype,"value",2),xi([o({type:String})],zs.prototype,"label",2),xi([o({type:Boolean})],zs.prototype,"showRangeLabels",2),xi([o({type:Object})],zs.prototype,"strings",2),zs=xi([X("pkt-datepicker-range")],zs);var pu=Object.defineProperty,fu=Object.getOwnPropertyDescriptor,sn=(s,e,t,i)=>{for(var n=i>1?void 0:i?fu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&pu(e,t,n),n};let Si=class extends St{constructor(){super(...arguments),this.value=[],this.strings=la}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}render(){return f`
|
|
872
874
|
<div class="pkt-input__container">
|
|
873
875
|
<input
|
|
874
|
-
class=${
|
|
876
|
+
class=${A(this.inputClasses)}
|
|
875
877
|
.type=${this.inputType}
|
|
876
878
|
id="${this.id}-input"
|
|
877
|
-
min=${
|
|
878
|
-
max=${
|
|
879
|
-
placeholder=${
|
|
879
|
+
min=${N(this.min)}
|
|
880
|
+
max=${N(this.max)}
|
|
881
|
+
placeholder=${N(this.placeholder)}
|
|
880
882
|
?readonly=${this.isInputReadonly}
|
|
881
883
|
?disabled=${this.isInputDisabled}
|
|
882
|
-
@click=${
|
|
883
|
-
@touchend=${
|
|
884
|
-
@blur=${
|
|
885
|
-
@input=${
|
|
886
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
887
|
-
@keydown=${
|
|
888
|
-
@change=${
|
|
889
|
-
${
|
|
884
|
+
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
885
|
+
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
886
|
+
@blur=${e=>{this.dispatchBlur(e),this.dispatchAddToSelected(e)}}
|
|
887
|
+
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
888
|
+
@focus=${()=>{this.dispatchFocus(),_s()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
889
|
+
@keydown=${e=>en.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>_i.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,void 0,t=>this.dispatchAddToSelected(t))}
|
|
890
|
+
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
891
|
+
${B(this.inputRef)}
|
|
890
892
|
/>
|
|
891
893
|
${this.renderCalendarButton()}
|
|
892
894
|
</div>
|
|
893
|
-
`}};
|
|
895
|
+
`}};sn([o({type:Array})],Si.prototype,"value",2),sn([o({type:Number})],Si.prototype,"maxlength",2),sn([o({type:Object})],Si.prototype,"strings",2),Si=sn([X("pkt-datepicker-multiple")],Si);var gu=Object.defineProperty,mu=Object.getOwnPropertyDescriptor,je=(s,e,t,i)=>{for(var n=i>1?void 0:i?mu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&gu(e,t,n),n};let Ie=class extends V{constructor(){super(),this._valueProperty="",this._valueProcessing=!1,this.datepickerPopupRef=L(),this._value=[],this.label="Datovelger",this.dateformat=wi.props.dateformat.default,this.multiple=wi.props.multiple.default,this.maxlength=null,this.range=wi.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=wi.props.weeknumbers.default,this.withcontrols=wi.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=L(),this.popupRef=L(),this.helptextSlot=L(),this.singleInputRef=L(),this.rangeInputRef=L(),this.multipleInputRef=L(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):Ji.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new Oe(this,this.helptextSlot)}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return ru.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(!(this._valueProcessing||e===t)){this._valueProcessing=!0;try{const i=yi(e),n=this.multiple&&i.length>1?ca.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!ca.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=n;const r=Gc(n);if(this._valueProperty!==r&&(this._valueProperty=r),this.range&&n.length<2)return;super.valueChanged(r,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,i){e==="value"&&this.value!==t&&this.valueChanged(i,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=yi(i||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=yi(i||"")),super.attributeChangedCallback(e,t,i)}updated(e){if(e.has("value")&&(e.has("multiple")||e.has("range"))){const t=Array.isArray(this.value)?this.value.join(","):this.value,i=e.get("value"),n=Array.isArray(i)?i.join(","):i;this.valueChanged(t,n)}e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=yi(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,i;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(i=this.singleInputRef.value)==null?void 0:i.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,i;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(i=this.singleInputRef.value)==null?void 0:i.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return f`
|
|
894
896
|
<pkt-datepicker-single
|
|
895
897
|
.value=${this._value[0]??""}
|
|
896
898
|
.inputType=${this.inputType}
|
|
@@ -903,20 +905,21 @@
|
|
|
903
905
|
.inputClasses=${this.inputClasses}
|
|
904
906
|
.internals=${this.internals}
|
|
905
907
|
.strings=${this.strings}
|
|
906
|
-
@toggle-calendar=${
|
|
908
|
+
@toggle-calendar=${e=>this.toggleCalendar(e.detail)}
|
|
907
909
|
@input-change=${()=>this.onInput()}
|
|
908
910
|
@input-focus=${()=>this.onFocus()}
|
|
909
|
-
@input-blur=${
|
|
910
|
-
@manage-validity=${
|
|
911
|
-
@value-change=${
|
|
911
|
+
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
912
|
+
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
913
|
+
@value-change=${e=>{this.value=e.detail}}
|
|
912
914
|
@input-changed=${()=>{this.touched=!0}}
|
|
913
|
-
${
|
|
915
|
+
${B(this.singleInputRef)}
|
|
914
916
|
></pkt-datepicker-single>
|
|
915
|
-
`}renderRangeInput(){return
|
|
917
|
+
`}renderRangeInput(){return f`
|
|
916
918
|
<pkt-datepicker-range
|
|
917
919
|
.value=${this._value}
|
|
918
920
|
.inputType=${this.inputType}
|
|
919
921
|
.id=${this.id}
|
|
922
|
+
.label=${this.label}
|
|
920
923
|
.min=${this.min}
|
|
921
924
|
.max=${this.max}
|
|
922
925
|
.placeholder=${this.placeholder}
|
|
@@ -926,18 +929,18 @@
|
|
|
926
929
|
.inputClasses=${this.inputClasses}
|
|
927
930
|
.internals=${this.internals}
|
|
928
931
|
.strings=${this.strings}
|
|
929
|
-
@toggle-calendar=${
|
|
932
|
+
@toggle-calendar=${e=>this.toggleCalendar(e.detail)}
|
|
930
933
|
@input-change=${()=>this.onInput()}
|
|
931
934
|
@input-focus=${()=>this.onFocus()}
|
|
932
|
-
@input-blur=${
|
|
933
|
-
@range-blur=${
|
|
934
|
-
@manage-validity=${
|
|
935
|
-
@validate-date-input=${
|
|
936
|
-
@handle-date-select=${
|
|
935
|
+
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
936
|
+
@range-blur=${e=>{const t=this.currentInputElement,i=this.currentInputElementTo;if(t&&i){const n=t.value,r=i.value;if(n&&r&&n>r)i.value="",this._value=[n],this.value=n;else{const a=[n,r].filter(Boolean);a.length>0&&(a[0]!==this._value[0]||a[1]!==this._value[1])&&(this._value=a,this.value=a.join(","))}}An.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),n=>this.manageValidity(n))}}
|
|
937
|
+
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
938
|
+
@validate-date-input=${e=>{_i.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
|
|
939
|
+
@handle-date-select=${e=>{var t,i;const n=ss(e.detail);if(n){const r=He(n);this._value[0]!==r&&this._value[1]!==r&&((i=(t=this.calRef)==null?void 0:t.value)==null||i.handleDateSelect(n))}}}
|
|
937
940
|
@input-changed=${()=>{this.touched=!0}}
|
|
938
|
-
${
|
|
941
|
+
${B(this.rangeInputRef)}
|
|
939
942
|
></pkt-datepicker-range>
|
|
940
|
-
`}renderMultipleInput(){return
|
|
943
|
+
`}renderMultipleInput(){return f`
|
|
941
944
|
<pkt-datepicker-multiple
|
|
942
945
|
.value=${this._value}
|
|
943
946
|
.inputType=${this.inputType}
|
|
@@ -951,15 +954,15 @@
|
|
|
951
954
|
.inputClasses=${this.inputClasses}
|
|
952
955
|
.internals=${this.internals}
|
|
953
956
|
.strings=${this.strings}
|
|
954
|
-
@toggle-calendar=${
|
|
957
|
+
@toggle-calendar=${e=>this.toggleCalendar(e.detail)}
|
|
955
958
|
@input-change=${()=>this.onInput()}
|
|
956
959
|
@input-focus=${()=>this.onFocus()}
|
|
957
|
-
@input-blur=${
|
|
958
|
-
@add-to-selected=${
|
|
960
|
+
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
961
|
+
@add-to-selected=${e=>this.addToSelected(e.detail)}
|
|
959
962
|
@input-changed=${()=>{this.touched=!0}}
|
|
960
|
-
${
|
|
963
|
+
${B(this.multipleInputRef)}
|
|
961
964
|
></pkt-datepicker-multiple>
|
|
962
|
-
`}renderCalendar(){return
|
|
965
|
+
`}renderCalendar(){return f`
|
|
963
966
|
<pkt-datepicker-popup
|
|
964
967
|
class="pkt-contents"
|
|
965
968
|
?open=${this.calendarOpen}
|
|
@@ -973,12 +976,13 @@
|
|
|
973
976
|
.latest=${this.max}
|
|
974
977
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
975
978
|
.excludeweekdays=${this.excludeweekdays}
|
|
976
|
-
.currentmonth=${this.currentmonth?
|
|
977
|
-
|
|
979
|
+
.currentmonth=${this.currentmonth?zt(this.currentmonth):null}
|
|
980
|
+
.today=${this.today}
|
|
981
|
+
@date-selected=${e=>{this.value=An.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,An.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
|
|
978
982
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
979
|
-
${
|
|
983
|
+
${B(this.datepickerPopupRef)}
|
|
980
984
|
></pkt-datepicker-popup>
|
|
981
|
-
`}render(){return this.inputClasses=
|
|
985
|
+
`}render(){return this.inputClasses=Pn.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),f`
|
|
982
986
|
<pkt-input-wrapper
|
|
983
987
|
label="${this.label}"
|
|
984
988
|
forId="${this.id}-input"
|
|
@@ -1003,14 +1007,14 @@
|
|
|
1003
1007
|
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
1004
1008
|
class="pkt-datepicker"
|
|
1005
1009
|
>
|
|
1006
|
-
<div class="pkt-contents" ${
|
|
1007
|
-
${this.multiple?
|
|
1010
|
+
<div class="pkt-contents" ${B(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1011
|
+
${this.multiple?f`<pkt-date-tags
|
|
1008
1012
|
.dates=${this._value}
|
|
1009
1013
|
dateformat=${this.dateformat}
|
|
1010
1014
|
strings=${this.strings}
|
|
1011
1015
|
id-base=${this.id}
|
|
1012
|
-
@date-tag-removed=${
|
|
1013
|
-
></pkt-date-tags>`:
|
|
1016
|
+
@date-tag-removed=${e=>{var t;const i=this.datepickerPopupRef.value,n=ss(e.detail);i&&n&&typeof i.handleDateSelect=="function"?i.handleDateSelect(n):(t=this.calRef.value)==null||t.handleDateSelect(n)}}
|
|
1017
|
+
></pkt-date-tags>`:_}
|
|
1014
1018
|
<div
|
|
1015
1019
|
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
1016
1020
|
>
|
|
@@ -1018,13 +1022,13 @@
|
|
|
1018
1022
|
</div>
|
|
1019
1023
|
</pkt-input-wrapper>
|
|
1020
1024
|
${this.renderCalendar()}
|
|
1021
|
-
`}handleCalendarPosition(){const
|
|
1022
|
-
class=${
|
|
1025
|
+
`}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;Ji.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var e;const t=this.datepickerPopupRef.value;if(this.calendarOpen=!0,t&&typeof t.show=="function"){t.show(),_s()&&t.focusOnCurrentDate();return}await _h(20),this.handleCalendarPosition(),_s()&&((e=this.calRef.value)==null||e.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const i=!!t.open;t.toggle(),this.calendarOpen=!i;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};je([o({type:String,reflect:!0})],Ie.prototype,"value",1),je([o({type:String,reflect:!0})],Ie.prototype,"label",2),je([o({type:String})],Ie.prototype,"dateformat",2),je([o({type:Boolean,reflect:!0})],Ie.prototype,"multiple",2),je([o({type:Number,reflect:!0})],Ie.prototype,"maxlength",2),je([o({type:Boolean,reflect:!0})],Ie.prototype,"range",2),je([o({type:Boolean,attribute:"show-range-labels"})],Ie.prototype,"showRangeLabels",2),je([o({type:String,reflect:!0})],Ie.prototype,"min",2),je([o({type:String,reflect:!0})],Ie.prototype,"max",2),je([o({type:Boolean})],Ie.prototype,"weeknumbers",2),je([o({type:Boolean,reflect:!0})],Ie.prototype,"withcontrols",2),je([o({converter:Vs.csvToArray})],Ie.prototype,"excludedates",2),je([o({converter:Vs.csvToArray})],Ie.prototype,"excludeweekdays",2),je([o({type:String})],Ie.prototype,"currentmonth",2),je([o({type:String})],Ie.prototype,"today",2),je([o({type:Boolean,reflect:!0,attribute:"calendar-open"})],Ie.prototype,"calendarOpen",2),je([o({type:String})],Ie.prototype,"timezone",2),je([q()],Ie.prototype,"inputClasses",2),Ie=je([X("pkt-datepicker")],Ie);const vu={href:{default:"#"},target:{default:"_self"}},ha={props:vu};var bu=Object.defineProperty,yu=Object.getOwnPropertyDescriptor,Ys=(s,e,t,i)=>{for(var n=i>1?void 0:i?yu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&bu(e,t,n),n};let xs=class extends fe{constructor(){super(),this.defaultSlot=L(),this.href=ha.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=ha.props.target.default,this.slotController=new Oe(this,this.defaultSlot)}render(){const e={"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 f`<a
|
|
1026
|
+
class=${A(e)}
|
|
1023
1027
|
href=${this.href}
|
|
1024
1028
|
.target=${this.target}
|
|
1025
|
-
.rel=${this.external?"noopener noreferrer":
|
|
1026
|
-
>${this.iconName?
|
|
1027
|
-
>`}};
|
|
1029
|
+
.rel=${this.external?"noopener noreferrer":_}
|
|
1030
|
+
>${this.iconName?f`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${B(this.defaultSlot)}>Link</span></a
|
|
1031
|
+
>`}};Ys([o({type:String,reflect:!0})],xs.prototype,"href",2),Ys([o({type:String,reflect:!0})],xs.prototype,"iconName",2),Ys([o({type:String,reflect:!0})],xs.prototype,"iconPosition",2),Ys([o({type:Boolean,reflect:!0})],xs.prototype,"external",2),Ys([o({type:String,reflect:!0})],xs.prototype,"target",2),xs=Ys([X("pkt-link")],xs);var ku=Object.defineProperty,$u=Object.getOwnPropertyDescriptor,Ft=(s,e,t,i)=>{for(var n=i>1?void 0:i?$u(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ku(e,t,n),n};let Dt=class extends V{constructor(){super(),this.inputRef=L(),this.helptextSlot=L(),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 Oe(this,this.helptextSlot)}attributeChangedCallback(e,t,i){e==="value"&&this.value!==t&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,t)),super.attributeChangedCallback(e,t,i)}updated(e){var t;super.updated(e),e.has("value")&&(this.counterCurrent=((t=this.value)==null?void 0:t.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const e=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,t=A({"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 f`
|
|
1028
1032
|
<pkt-input-wrapper
|
|
1029
1033
|
label="${this.label}"
|
|
1030
1034
|
?counter=${this.counter}
|
|
@@ -1049,25 +1053,25 @@
|
|
|
1049
1053
|
.tagText=${this.tagText}
|
|
1050
1054
|
class="pkt-textinput"
|
|
1051
1055
|
>
|
|
1052
|
-
<div class="pkt-contents" ${
|
|
1056
|
+
<div class="pkt-contents" ${B(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1053
1057
|
<div class="pkt-input__container">
|
|
1054
|
-
${this.prefix?
|
|
1058
|
+
${this.prefix?f`<div class="pkt-input-prefix">${this.prefix}</div>`:_}
|
|
1055
1059
|
<input
|
|
1056
|
-
${
|
|
1057
|
-
class=${
|
|
1060
|
+
${B(this.inputRef)}
|
|
1061
|
+
class=${t}
|
|
1058
1062
|
type=${this.type}
|
|
1059
1063
|
name=${(this.name||this.id)+"-input"}
|
|
1060
1064
|
id=${this.id+"-input"}
|
|
1061
|
-
placeholder=${
|
|
1065
|
+
placeholder=${N(this.placeholder)}
|
|
1062
1066
|
aria-labelledby=${i}
|
|
1063
1067
|
autocomplete=${this.autocomplete||"off"}
|
|
1064
|
-
minlength=${
|
|
1065
|
-
maxlength=${
|
|
1066
|
-
min=${
|
|
1067
|
-
max=${
|
|
1068
|
-
step=${
|
|
1068
|
+
minlength=${N(this.minlength||void 0)}
|
|
1069
|
+
maxlength=${N(this.maxlength||void 0)}
|
|
1070
|
+
min=${N(this.min||void 0)}
|
|
1071
|
+
max=${N(this.max||void 0)}
|
|
1072
|
+
step=${N(this.step||void 0)}
|
|
1069
1073
|
?readonly=${this.readonly}
|
|
1070
|
-
size=${this.size||
|
|
1074
|
+
size=${this.size||_}
|
|
1071
1075
|
.value=${this.value}
|
|
1072
1076
|
?disabled=${this.disabled}
|
|
1073
1077
|
aria-invalid=${this.hasError}
|
|
@@ -1076,88 +1080,88 @@
|
|
|
1076
1080
|
@change=${n=>{n.stopImmediatePropagation()}}
|
|
1077
1081
|
@focus=${n=>{this.onFocus(),n.stopImmediatePropagation()}}
|
|
1078
1082
|
@blur=${n=>{this.value=n.target.value,this.onBlur(),n.stopImmediatePropagation()}}
|
|
1079
|
-
@keydown=${n=>{var
|
|
1083
|
+
@keydown=${n=>{var r;if(n.key==="Enter"){const a=this.internals.form;a?a.requestSubmit():(r=this.inputRef.value)==null||r.blur()}}}
|
|
1080
1084
|
/>
|
|
1081
|
-
${this.suffix?
|
|
1085
|
+
${this.suffix?f`<div class="pkt-input-suffix">
|
|
1082
1086
|
${this.suffix}
|
|
1083
|
-
${this.iconNameRight?
|
|
1087
|
+
${this.iconNameRight?f`<pkt-icon
|
|
1084
1088
|
class="pkt-input-suffix-icon"
|
|
1085
1089
|
name=${this.iconNameRight}
|
|
1086
|
-
></pkt-icon>`:
|
|
1087
|
-
${
|
|
1090
|
+
></pkt-icon>`:_}
|
|
1091
|
+
${e?f`<pkt-icon
|
|
1088
1092
|
class="pkt-input-suffix-icon"
|
|
1089
1093
|
name="magnifying-glass-big"
|
|
1090
|
-
></pkt-icon>`:
|
|
1091
|
-
</div>`:
|
|
1092
|
-
${!this.suffix&&this.iconNameRight?
|
|
1093
|
-
${!this.suffix&&
|
|
1094
|
+
></pkt-icon>`:_}
|
|
1095
|
+
</div>`:_}
|
|
1096
|
+
${!this.suffix&&this.iconNameRight?f`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:_}
|
|
1097
|
+
${!this.suffix&&e?f`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:_}
|
|
1094
1098
|
</div>
|
|
1095
1099
|
</pkt-input-wrapper>
|
|
1096
|
-
`}};
|
|
1100
|
+
`}};Ft([o({type:String,reflect:!0})],Dt.prototype,"value",2),Ft([o({type:String})],Dt.prototype,"type",2),Ft([o({type:Number})],Dt.prototype,"size",2),Ft([o({type:String})],Dt.prototype,"autocomplete",2),Ft([o({type:String})],Dt.prototype,"iconNameRight",2),Ft([o({type:String})],Dt.prototype,"prefix",2),Ft([o({type:String})],Dt.prototype,"suffix",2),Ft([o({type:Boolean})],Dt.prototype,"omitSearchIcon",2),Ft([q()],Dt.prototype,"counterCurrent",2),Dt=Ft([X("pkt-textinput")],Dt);const wu=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},_u=s=>wu(s),xu=s=>{if(!s)return;const e=typeof s=="string"?new Date(s):s;if(!isNaN(e.getTime()))return e.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})};var Su=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,Ss=(s,e,t,i)=>{for(var n=i>1?void 0:i?Cu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Su(e,t,n),n};let rs=class extends fe{constructor(){super(...arguments),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent("change-representation",{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleMenuItemClick(e){"onClick"in e&&typeof e.onClick=="function"&&e.onClick()}renderLinkOrButton(e,t){const i="href"in e,n=A({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[t||""]:!!t});return i?f`
|
|
1097
1101
|
<pkt-link
|
|
1098
|
-
icon-name=${
|
|
1099
|
-
href=${
|
|
1102
|
+
icon-name=${e.iconName||_}
|
|
1103
|
+
href=${e.href}
|
|
1100
1104
|
aria-hidden="true"
|
|
1101
|
-
class="pkt-user-menu__link ${
|
|
1105
|
+
class="pkt-user-menu__link ${t||""}"
|
|
1102
1106
|
>
|
|
1103
|
-
${
|
|
1107
|
+
${e.title}
|
|
1104
1108
|
</pkt-link>
|
|
1105
|
-
`:
|
|
1106
|
-
<button class=${n} type="button" @click=${()=>this.handleMenuItemClick(
|
|
1107
|
-
${
|
|
1108
|
-
name=${
|
|
1109
|
+
`:f`
|
|
1110
|
+
<button class=${n} type="button" @click=${()=>this.handleMenuItemClick(e)}>
|
|
1111
|
+
${e.iconName?f`<pkt-icon
|
|
1112
|
+
name=${e.iconName}
|
|
1109
1113
|
class="pkt-link__icon"
|
|
1110
1114
|
aria-hidden="true"
|
|
1111
|
-
></pkt-icon>`:
|
|
1112
|
-
${
|
|
1115
|
+
></pkt-icon>`:_}
|
|
1116
|
+
${e.title}
|
|
1113
1117
|
</button>
|
|
1114
|
-
`}renderLinkSection(
|
|
1118
|
+
`}renderLinkSection(e){return f`
|
|
1115
1119
|
<ul class="pkt-user-menu__sublist">
|
|
1116
|
-
${
|
|
1117
|
-
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(
|
|
1120
|
+
${e.map(t=>f`
|
|
1121
|
+
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(t)}</li>
|
|
1118
1122
|
`)}
|
|
1119
1123
|
</ul>
|
|
1120
|
-
`}render(){var
|
|
1124
|
+
`}render(){var e;const t=(e=this.userMenu)==null?void 0:e.map(_u);return f`
|
|
1121
1125
|
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
1122
1126
|
<ul class="pkt-user-menu__list">
|
|
1123
1127
|
<!-- User section -->
|
|
1124
|
-
${this.user?
|
|
1128
|
+
${this.user?f`
|
|
1125
1129
|
<li class="pkt-user-menu__item">
|
|
1126
1130
|
<div class="pkt-user-menu__label">Pålogget som</div>
|
|
1127
1131
|
<div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
|
|
1128
|
-
${this.formattedLastLoggedIn?
|
|
1132
|
+
${this.formattedLastLoggedIn?f`
|
|
1129
1133
|
<div class="pkt-user-menu__last-logged-in">
|
|
1130
1134
|
Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
|
|
1131
1135
|
</div>
|
|
1132
|
-
`:
|
|
1136
|
+
`:_}
|
|
1133
1137
|
</li>
|
|
1134
|
-
`:
|
|
1138
|
+
`:_}
|
|
1135
1139
|
|
|
1136
1140
|
<!-- User menu items -->
|
|
1137
|
-
${
|
|
1138
|
-
<li class="pkt-user-menu__item">${this.renderLinkSection(
|
|
1139
|
-
`:
|
|
1141
|
+
${t&&t.length>0?f`
|
|
1142
|
+
<li class="pkt-user-menu__item">${this.renderLinkSection(t)}</li>
|
|
1143
|
+
`:_}
|
|
1140
1144
|
|
|
1141
1145
|
<!-- Representing section -->
|
|
1142
|
-
${this.representing?
|
|
1146
|
+
${this.representing?f`
|
|
1143
1147
|
<li class="pkt-user-menu__item">
|
|
1144
1148
|
<div class="pkt-user-menu__label">Representerer</div>
|
|
1145
1149
|
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
1146
|
-
${this.representing.orgNumber?
|
|
1150
|
+
${this.representing.orgNumber?f`<div class="pkt-user-menu__org-number">
|
|
1147
1151
|
Org.nr. ${this.representing.orgNumber}
|
|
1148
|
-
</div>`:
|
|
1149
|
-
${this.canChangeRepresentation?
|
|
1152
|
+
</div>`:_}
|
|
1153
|
+
${this.canChangeRepresentation?f`
|
|
1150
1154
|
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
1151
1155
|
<li class="pkt-user-menu__subitem">
|
|
1152
1156
|
${this.renderLinkOrButton({title:"Endre organisasjon",iconName:"cogwheel",onClick:()=>this.handleChangeRepresentation()})}
|
|
1153
1157
|
</li>
|
|
1154
1158
|
</ul>
|
|
1155
|
-
`:
|
|
1159
|
+
`:_}
|
|
1156
1160
|
</li>
|
|
1157
|
-
`:
|
|
1161
|
+
`:_}
|
|
1158
1162
|
|
|
1159
1163
|
<!-- Change representation without representing object -->
|
|
1160
|
-
${!this.representing&&this.canChangeRepresentation?
|
|
1164
|
+
${!this.representing&&this.canChangeRepresentation?f`
|
|
1161
1165
|
<li class="pkt-user-menu__item">
|
|
1162
1166
|
<ul class="pkt-user-menu__sublist">
|
|
1163
1167
|
<li class="pkt-user-menu__subitem">
|
|
@@ -1165,37 +1169,37 @@
|
|
|
1165
1169
|
</li>
|
|
1166
1170
|
</ul>
|
|
1167
1171
|
</li>
|
|
1168
|
-
`:
|
|
1172
|
+
`:_}
|
|
1169
1173
|
|
|
1170
1174
|
<!-- Logout -->
|
|
1171
|
-
${this.logoutOnClick?
|
|
1175
|
+
${this.logoutOnClick?f`
|
|
1172
1176
|
<li class="pkt-user-menu__item">
|
|
1173
1177
|
${this.renderLinkOrButton({title:"Logg ut",iconName:"exit",onClick:()=>this.handleLogout()})}
|
|
1174
1178
|
</li>
|
|
1175
|
-
`:
|
|
1179
|
+
`:_}
|
|
1176
1180
|
</ul>
|
|
1177
1181
|
</nav>
|
|
1178
|
-
`}};
|
|
1179
|
-
<pkt-icon name="oslologo" aria-hidden="true" path=${
|
|
1180
|
-
`;return this.logoLink&&typeof this.logoLink=="string"?
|
|
1182
|
+
`}};Ss([o({type:Object})],rs.prototype,"user",2),Ss([o({type:String,attribute:"formatted-last-logged-in"})],rs.prototype,"formattedLastLoggedIn",2),Ss([o({type:Object})],rs.prototype,"representing",2),Ss([o({type:Array,attribute:"user-menu"})],rs.prototype,"userMenu",2),Ss([o({type:Boolean,attribute:"can-change-representation",converter:dt})],rs.prototype,"canChangeRepresentation",2),Ss([o({type:Boolean,attribute:"logout-on-click",converter:dt})],rs.prototype,"logoutOnClick",2),rs=Ss([X("pkt-header-user-menu")],rs);var Tu=Object.defineProperty,Mu=Object.getOwnPropertyDescriptor,oe=(s,e,t,i)=>{for(var n=i>1?void 0:i?Mu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Tu(e,t,n),n};const Nu="https://punkt-cdn.oslo.kommune.no/15.0/logos/";let ne=class extends fe{constructor(){super(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.hasSlotContent=!1,this.alignSlotRight=!1,this.alignSearchRight=!1,this.defaultSlot=L(),this.headerRef=L(),this.userContainerRef=L(),this.slotContainerRef=L(),this.searchContainerRef=L(),this.slotContentRef=L(),this.searchMenuRef=L(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const e=window.pageYOffset||document.documentElement.scrollTop;e<0||Math.abs(e-this.lastScrollPosition)<60||(this.isHidden=e>this.lastScrollPosition,this.lastScrollPosition=e)},this.handleClickOutside=e=>{const t=e.target;this.user&&this.openMenu==="user"&&!t.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!t.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!t.closest(".pkt-header-service__search-container")&&!t.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(e,t)=>{const i=e.relatedTarget;let n;switch(t){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const r=n.value;r&&(!i||!r.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=e=>{e.key==="Escape"&&this.openMenu!=="none"&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new Oe(this,this.defaultSlot)}updateSlots(e){this.hasSlotContent=e.has(null)||e.has(void 0)}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(e){if(super.updated(e),e.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(e.has("mobileBreakpoint")||e.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),e.has("openMenu")){const t=e.get("openMenu");this.openMenu!=="none"&&(t==="none"||t===void 0)?(document.addEventListener("mousedown",this.handleClickOutside),document.addEventListener("keydown",this.handleEscapeKey),(this.openMenu==="slot"||this.openMenu==="search")&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu==="none"&&t!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(e.has("openMenu")||e.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const e=this.headerRef.value;e&&(this.componentWidth=e.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(t=>{for(const i of t)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(e))}updateIsMobile(){this.isMobile=this.componentWidth<this.mobileBreakpoint}updateIsTablet(){this.isTablet=this.componentWidth<this.tabletBreakpoint}updateScrollLock(){this.position==="fixed"&&this.isMobile&&this.openMenu!=="none"?this.lockScroll():this.unlockScroll()}lockScroll(){const e=document.body,t=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const i=window.innerWidth-t.clientWidth;i>0&&(e.style.paddingRight=`${i}px`),e.style.position="fixed",e.style.top=`-${this.savedScrollY}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",t.classList.add("is-scroll-locked")}unlockScroll(){const e=document.body,t=document.documentElement;t.classList.contains("is-scroll-locked")&&(e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),t.classList.remove("is-scroll-locked"),window.scrollTo({top:this.savedScrollY}))}setupScrollListener(){window.addEventListener("scroll",this.handleScroll)}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}checkDropdownAlignment(e){const t=e==="slot"?this.slotContainerRef:this.searchContainerRef,i=e==="slot"?this.slotContentRef:this.searchMenuRef;if(!t.value||!i.value||!this.isTablet||this.isMobile)return;const n=t.value.getBoundingClientRect(),r=i.value.offsetWidth,a=n.left+r>window.innerWidth;e==="slot"?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=e)}handleLogoClick(e){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleServiceClick(e){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(e){this.dispatchEvent(new CustomEvent("search",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchChange(e){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchInputChange(e){const t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key==="Enter"&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){var e;return xu((e=this.user)==null?void 0:e.lastLoggedIn)}get isFixed(){return this.position==="fixed"}get shouldHideOnScroll(){return this.scrollBehavior==="hide"}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement==="header"||this.logOutButtonPlacement==="both")}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement==="userMenu"||this.logOutButtonPlacement==="both")}renderLogo(){if(this.hideLogo)return _;const e=f`
|
|
1183
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${Nu}></pkt-icon>
|
|
1184
|
+
`;return this.logoLink&&typeof this.logoLink=="string"?f`
|
|
1181
1185
|
<span class="pkt-header-service__logo">
|
|
1182
1186
|
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
1183
|
-
${
|
|
1187
|
+
${e}
|
|
1184
1188
|
</a>
|
|
1185
1189
|
</span>
|
|
1186
|
-
`:this.hasAttribute("logo-link")?
|
|
1190
|
+
`:this.hasAttribute("logo-link")?f`
|
|
1187
1191
|
<span class="pkt-header-service__logo">
|
|
1188
1192
|
<button
|
|
1189
1193
|
aria-label="Tilbake til forside"
|
|
1190
1194
|
class="pkt-link-button pkt-link pkt-header-service__logo-link"
|
|
1191
1195
|
@click=${this.handleLogoClick}
|
|
1192
1196
|
>
|
|
1193
|
-
${
|
|
1197
|
+
${e}
|
|
1194
1198
|
</button>
|
|
1195
1199
|
</span>
|
|
1196
|
-
`:
|
|
1197
|
-
<span class="pkt-header-service__logo" @click=${this.handleLogoClick}>${
|
|
1198
|
-
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?
|
|
1200
|
+
`:f`
|
|
1201
|
+
<span class="pkt-header-service__logo" @click=${this.handleLogoClick}>${e}</span>
|
|
1202
|
+
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?f`
|
|
1199
1203
|
<span class="pkt-header-service__service-name">
|
|
1200
1204
|
<pkt-link
|
|
1201
1205
|
href=${this.serviceLink}
|
|
@@ -1205,7 +1209,7 @@
|
|
|
1205
1209
|
${this.serviceName}
|
|
1206
1210
|
</pkt-link>
|
|
1207
1211
|
</span>
|
|
1208
|
-
`:this.hasAttribute("service-link")?
|
|
1212
|
+
`:this.hasAttribute("service-link")?f`
|
|
1209
1213
|
<span class="pkt-header-service__service-name">
|
|
1210
1214
|
<button
|
|
1211
1215
|
class="pkt-link-button pkt-link pkt-header-service__service-link"
|
|
@@ -1214,17 +1218,17 @@
|
|
|
1214
1218
|
${this.serviceName}
|
|
1215
1219
|
</button>
|
|
1216
1220
|
</span>
|
|
1217
|
-
`:
|
|
1221
|
+
`:f`
|
|
1218
1222
|
<span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
|
|
1219
1223
|
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
1220
1224
|
</span>
|
|
1221
|
-
`:
|
|
1225
|
+
`:_}renderSlotContainer(){const e=A({"pkt-header-service__slot-container":!0,"is-open":this.openMenu==="slot"}),t=A({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return f`
|
|
1222
1226
|
<div
|
|
1223
|
-
class=${
|
|
1227
|
+
class=${e}
|
|
1224
1228
|
@focusout=${i=>this.handleFocusOut(i,"slot")}
|
|
1225
|
-
${
|
|
1229
|
+
${B(this.slotContainerRef)}
|
|
1226
1230
|
>
|
|
1227
|
-
${this.isTablet&&this.hasSlotContent?
|
|
1231
|
+
${this.isTablet&&this.hasSlotContent?f`
|
|
1228
1232
|
<pkt-button
|
|
1229
1233
|
skin="secondary"
|
|
1230
1234
|
variant=${this.slotMenuVariant}
|
|
@@ -1238,21 +1242,21 @@
|
|
|
1238
1242
|
>
|
|
1239
1243
|
${this.slotMenuText}
|
|
1240
1244
|
</pkt-button>
|
|
1241
|
-
`:
|
|
1245
|
+
`:_}
|
|
1242
1246
|
<div
|
|
1243
|
-
class=${
|
|
1247
|
+
class=${t}
|
|
1244
1248
|
id="mobile-slot-menu"
|
|
1245
|
-
role=${this.isTablet?"menu":
|
|
1246
|
-
aria-label=${this.isTablet?"Meny":
|
|
1247
|
-
${
|
|
1248
|
-
${
|
|
1249
|
+
role=${this.isTablet?"menu":_}
|
|
1250
|
+
aria-label=${this.isTablet?"Meny":_}
|
|
1251
|
+
${B(this.slotContentRef)}
|
|
1252
|
+
${B(this.defaultSlot)}
|
|
1249
1253
|
></div>
|
|
1250
1254
|
</div>
|
|
1251
|
-
`}renderSearch(){if(!this.showSearch)return
|
|
1255
|
+
`}renderSearch(){if(!this.showSearch)return _;if(this.isTablet){const e=A({"pkt-header-service__search-container":!0,"is-open":this.openMenu==="search"}),t=A({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu==="search","align-right":this.alignSearchRight});return f`
|
|
1252
1256
|
<div
|
|
1253
|
-
class=${
|
|
1257
|
+
class=${e}
|
|
1254
1258
|
@focusout=${i=>this.handleFocusOut(i,"search")}
|
|
1255
|
-
${
|
|
1259
|
+
${B(this.searchContainerRef)}
|
|
1256
1260
|
>
|
|
1257
1261
|
<pkt-button
|
|
1258
1262
|
skin="secondary"
|
|
@@ -1267,8 +1271,8 @@
|
|
|
1267
1271
|
>
|
|
1268
1272
|
Søk
|
|
1269
1273
|
</pkt-button>
|
|
1270
|
-
<div class=${
|
|
1271
|
-
${this.openMenu==="search"?
|
|
1274
|
+
<div class=${t} ${B(this.searchMenuRef)}>
|
|
1275
|
+
${this.openMenu==="search"?f`
|
|
1272
1276
|
<pkt-textinput
|
|
1273
1277
|
id="mobile-search-menu"
|
|
1274
1278
|
class="pkt-header-service__search-input"
|
|
@@ -1282,10 +1286,10 @@
|
|
|
1282
1286
|
@input=${this.handleSearchInputChange}
|
|
1283
1287
|
@keydown=${i=>{i.key==="Enter"&&this.handleSearch(i.target.value)}}
|
|
1284
1288
|
></pkt-textinput>
|
|
1285
|
-
`:
|
|
1289
|
+
`:_}
|
|
1286
1290
|
</div>
|
|
1287
1291
|
</div>
|
|
1288
|
-
`}return
|
|
1292
|
+
`}return f`
|
|
1289
1293
|
<pkt-textinput
|
|
1290
1294
|
id="header-service-search"
|
|
1291
1295
|
class="pkt-header-service__search-input"
|
|
@@ -1297,14 +1301,14 @@
|
|
|
1297
1301
|
@input=${this.handleSearchInputChange}
|
|
1298
1302
|
@keydown=${this.handleSearchKeyDown}
|
|
1299
1303
|
></pkt-textinput>
|
|
1300
|
-
`}renderUserButton(){var
|
|
1304
|
+
`}renderUserButton(){var e;if(!this.user)return _;const t=A({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu==="user"});return f`
|
|
1301
1305
|
<div
|
|
1302
1306
|
class="pkt-header-service__user-container"
|
|
1303
1307
|
@focusout=${i=>this.handleFocusOut(i,"user")}
|
|
1304
|
-
${
|
|
1308
|
+
${B(this.userContainerRef)}
|
|
1305
1309
|
>
|
|
1306
1310
|
<pkt-button
|
|
1307
|
-
class=${
|
|
1311
|
+
class=${A({"pkt-header-service__user-button":!0,"pkt-header-service__user-button--mobile":this.isMobile})}
|
|
1308
1312
|
skin="secondary"
|
|
1309
1313
|
size=${this.isMobile?"small":"medium"}
|
|
1310
1314
|
state=${this.openMenu==="user"?"active":"normal"}
|
|
@@ -1314,13 +1318,13 @@
|
|
|
1314
1318
|
@click=${()=>this.handleMenuToggle("user")}
|
|
1315
1319
|
>
|
|
1316
1320
|
<span class="pkt-sr-only">Brukermeny: </span>
|
|
1317
|
-
${((
|
|
1321
|
+
${((e=this.representing)==null?void 0:e.name)||this.user.name}
|
|
1318
1322
|
</pkt-button>
|
|
1319
|
-
${this.openMenu==="user"&&this.user?
|
|
1320
|
-
<div class=${
|
|
1323
|
+
${this.openMenu==="user"&&this.user?f`
|
|
1324
|
+
<div class=${t}>
|
|
1321
1325
|
<pkt-header-user-menu
|
|
1322
1326
|
.user=${this.user}
|
|
1323
|
-
formatted-last-logged-in=${this.formattedLastLoggedIn||
|
|
1327
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn||_}
|
|
1324
1328
|
.representing=${this.representing}
|
|
1325
1329
|
.userMenu=${this.userMenu}
|
|
1326
1330
|
?can-change-representation=${this.canChangeRepresentation}
|
|
@@ -1329,15 +1333,15 @@
|
|
|
1329
1333
|
@log-out=${this.handleLogout}
|
|
1330
1334
|
></pkt-header-user-menu>
|
|
1331
1335
|
</div>
|
|
1332
|
-
`:
|
|
1336
|
+
`:_}
|
|
1333
1337
|
</div>
|
|
1334
|
-
`}renderHeader(){const
|
|
1335
|
-
<header class=${
|
|
1336
|
-
<div class=${
|
|
1338
|
+
`}renderHeader(){const e=A({"pkt-header-service":!0,"pkt-header-service--compact":this.compact,"pkt-header-service--mobile":this.isMobile,"pkt-header-service--tablet":this.isTablet,"pkt-header-service--fixed":this.isFixed,"pkt-header-service--scroll-to-hide":this.shouldHideOnScroll,"pkt-header-service--hidden":this.isHidden}),t=A({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return f`
|
|
1339
|
+
<header class=${e} ${B(this.headerRef)}>
|
|
1340
|
+
<div class=${t}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
1337
1341
|
|
|
1338
1342
|
<div class="pkt-header-service__content">
|
|
1339
1343
|
${this.renderSlotContainer()} ${this.renderSearch()}
|
|
1340
|
-
${this.isTablet&&this.showLogoutInHeader?
|
|
1344
|
+
${this.isTablet&&this.showLogoutInHeader?f`
|
|
1341
1345
|
<pkt-button
|
|
1342
1346
|
skin="secondary"
|
|
1343
1347
|
size=${this.isMobile?"small":"medium"}
|
|
@@ -1347,12 +1351,12 @@
|
|
|
1347
1351
|
>
|
|
1348
1352
|
Logg ut
|
|
1349
1353
|
</pkt-button>
|
|
1350
|
-
`:
|
|
1354
|
+
`:_}
|
|
1351
1355
|
</div>
|
|
1352
1356
|
|
|
1353
1357
|
<div class="pkt-header-service__user">
|
|
1354
1358
|
${this.renderUserButton()}
|
|
1355
|
-
${!this.isTablet&&this.showLogoutInHeader?
|
|
1359
|
+
${!this.isTablet&&this.showLogoutInHeader?f`
|
|
1356
1360
|
<pkt-button
|
|
1357
1361
|
skin="tertiary"
|
|
1358
1362
|
size="medium"
|
|
@@ -1362,19 +1366,19 @@
|
|
|
1362
1366
|
>
|
|
1363
1367
|
Logg ut
|
|
1364
1368
|
</pkt-button>
|
|
1365
|
-
`:
|
|
1369
|
+
`:_}
|
|
1366
1370
|
</div>
|
|
1367
1371
|
</header>
|
|
1368
|
-
`}render(){const
|
|
1372
|
+
`}render(){const e=this.renderHeader();if(this.isFixed){const t=A({"pkt-header-service-spacer":!0,"pkt-header-service-spacer--compact":this.compact,"pkt-header-service-spacer--has-user":!!this.user,"pkt-header-service-spacer--mobile":this.isMobile});return f`
|
|
1369
1373
|
<div class="pkt-header-service-wrapper">
|
|
1370
|
-
${
|
|
1371
|
-
<div class=${
|
|
1374
|
+
${e}
|
|
1375
|
+
<div class=${t}></div>
|
|
1372
1376
|
</div>
|
|
1373
|
-
`}return
|
|
1377
|
+
`}return e}};oe([o({type:String,attribute:"service-name"})],ne.prototype,"serviceName",2),oe([o({type:String,attribute:"service-link"})],ne.prototype,"serviceLink",2),oe([o({type:String,attribute:"logo-link"})],ne.prototype,"logoLink",2),oe([o({type:String,attribute:"search-placeholder"})],ne.prototype,"searchPlaceholder",2),oe([o({type:String,attribute:"search-value"})],ne.prototype,"searchValue",2),oe([o({type:Number,attribute:"mobile-breakpoint"})],ne.prototype,"mobileBreakpoint",2),oe([o({type:Number,attribute:"tablet-breakpoint"})],ne.prototype,"tabletBreakpoint",2),oe([o({type:String,attribute:"opened-menu"})],ne.prototype,"openedMenu",2),oe([o({type:String,attribute:"log-out-button-placement"})],ne.prototype,"logOutButtonPlacement",2),oe([o({type:String})],ne.prototype,"position",2),oe([o({type:String,attribute:"scroll-behavior"})],ne.prototype,"scrollBehavior",2),oe([o({type:String,attribute:"slot-menu-variant"})],ne.prototype,"slotMenuVariant",2),oe([o({type:String,attribute:"slot-menu-text"})],ne.prototype,"slotMenuText",2),oe([o({type:Boolean,attribute:"hide-logo",converter:dt})],ne.prototype,"hideLogo",2),oe([o({type:Boolean,converter:dt})],ne.prototype,"compact",2),oe([o({type:Boolean,attribute:"show-search",converter:dt})],ne.prototype,"showSearch",2),oe([o({type:Boolean,attribute:"can-change-representation",converter:dt})],ne.prototype,"canChangeRepresentation",2),oe([o({type:Boolean,attribute:"has-log-out",converter:dt})],ne.prototype,"hasLogOut",2),oe([o({type:Object})],ne.prototype,"user",2),oe([o({type:Array,attribute:"user-menu"})],ne.prototype,"userMenu",2),oe([o({type:Object})],ne.prototype,"representing",2),oe([q()],ne.prototype,"isMobile",2),oe([q()],ne.prototype,"isTablet",2),oe([q()],ne.prototype,"openMenu",2),oe([q()],ne.prototype,"isHidden",2),oe([q()],ne.prototype,"componentWidth",2),oe([q()],ne.prototype,"hasSlotContent",2),oe([q()],ne.prototype,"alignSlotRight",2),oe([q()],ne.prototype,"alignSearchRight",2),ne=oe([X("pkt-header-service")],ne);var Du=Object.defineProperty,Ou=Object.getOwnPropertyDescriptor,_e=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ou(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Du(e,t,n),n};let ye=class extends fe{constructor(){super(),this.defaultSlot=L(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.slotController=new Oe(this,this.defaultSlot)}firstUpdated(e){super.firstUpdated(e),this.emitDeprecationWarnings()}emitDeprecationWarnings(){this.userMenuFooter!==void 0&&console.warn("[PktHeader] userMenuFooter is deprecated. Use userMenu instead."),this.userOptions!==void 0&&console.warn("[PktHeader] userOptions is deprecated. Use userMenu instead.")}get effectiveUserMenu(){const e=this.userMenu||[],t=this.userMenuFooter||[],i=this.userOptions||[];return t.length||i.length?[...e,...i,...t]:this.userMenu}render(){return f`
|
|
1374
1378
|
<pkt-header-service
|
|
1375
|
-
service-name=${
|
|
1376
|
-
service-link=${
|
|
1377
|
-
logo-link=${
|
|
1379
|
+
service-name=${N(this.serviceName)}
|
|
1380
|
+
service-link=${N(this.serviceLink)}
|
|
1381
|
+
logo-link=${N(this.logoLink)}
|
|
1378
1382
|
search-placeholder=${this.searchPlaceholder}
|
|
1379
1383
|
search-value=${this.searchValue}
|
|
1380
1384
|
mobile-breakpoint=${this.mobileBreakpoint}
|
|
@@ -1394,37 +1398,37 @@
|
|
|
1394
1398
|
.userMenu=${this.effectiveUserMenu}
|
|
1395
1399
|
.representing=${this.representing}
|
|
1396
1400
|
>
|
|
1397
|
-
<div class="pkt-contents" ${
|
|
1401
|
+
<div class="pkt-contents" ${B(this.defaultSlot)}></div>
|
|
1398
1402
|
</pkt-header-service>
|
|
1399
|
-
`}};
|
|
1403
|
+
`}};_e([o({type:String,attribute:"service-name"})],ye.prototype,"serviceName",2),_e([o({type:String,attribute:"service-link"})],ye.prototype,"serviceLink",2),_e([o({type:String,attribute:"logo-link"})],ye.prototype,"logoLink",2),_e([o({type:String,attribute:"search-placeholder"})],ye.prototype,"searchPlaceholder",2),_e([o({type:String,attribute:"search-value"})],ye.prototype,"searchValue",2),_e([o({type:Number,attribute:"mobile-breakpoint"})],ye.prototype,"mobileBreakpoint",2),_e([o({type:Number,attribute:"tablet-breakpoint"})],ye.prototype,"tabletBreakpoint",2),_e([o({type:String,attribute:"opened-menu"})],ye.prototype,"openedMenu",2),_e([o({type:String,attribute:"log-out-button-placement"})],ye.prototype,"logOutButtonPlacement",2),_e([o({type:String})],ye.prototype,"position",2),_e([o({type:String,attribute:"scroll-behavior"})],ye.prototype,"scrollBehavior",2),_e([o({type:String,attribute:"slot-menu-variant"})],ye.prototype,"slotMenuVariant",2),_e([o({type:String,attribute:"slot-menu-text"})],ye.prototype,"slotMenuText",2),_e([o({type:Boolean,attribute:"hide-logo",converter:dt})],ye.prototype,"hideLogo",2),_e([o({type:Boolean,converter:dt})],ye.prototype,"compact",2),_e([o({type:Boolean,attribute:"show-search",converter:dt})],ye.prototype,"showSearch",2),_e([o({type:Boolean,attribute:"can-change-representation",converter:dt})],ye.prototype,"canChangeRepresentation",2),_e([o({type:Boolean,attribute:"has-log-out",converter:dt})],ye.prototype,"hasLogOut",2),_e([o({type:Object})],ye.prototype,"user",2),_e([o({type:Array,attribute:"user-menu"})],ye.prototype,"userMenu",2),_e([o({type:Object})],ye.prototype,"representing",2),_e([o({type:Array,attribute:"user-menu-footer"})],ye.prototype,"userMenuFooter",2),_e([o({type:Array,attribute:"user-options"})],ye.prototype,"userOptions",2),ye=_e([X("pkt-header")],ye);var Eu=Object.defineProperty,Pu=Object.getOwnPropertyDescriptor,Cs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Pu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Eu(e,t,n),n};let as=class extends fe{constructor(){super(),this.defaultSlot=L(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new Oe(this,this.defaultSlot)}render(){const e=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),t=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return f`
|
|
1400
1404
|
<a
|
|
1401
1405
|
href=${this.href}
|
|
1402
|
-
class=${
|
|
1406
|
+
class=${e}
|
|
1403
1407
|
target=${this.openInNewTab?"_blank":"_self"}
|
|
1404
|
-
rel=${
|
|
1408
|
+
rel=${N(this.openInNewTab?"noopener noreferrer":void 0)}
|
|
1405
1409
|
>
|
|
1406
|
-
${this.iconName&&
|
|
1407
|
-
${this.title&&
|
|
1410
|
+
${this.iconName&&f`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
1411
|
+
${this.title&&f`<div class=${t}>${this.title}</div>`}
|
|
1408
1412
|
|
|
1409
|
-
<div class="pkt-linkcard__text" ${
|
|
1413
|
+
<div class="pkt-linkcard__text" ${B(this.defaultSlot)}></div>
|
|
1410
1414
|
</a>
|
|
1411
|
-
`}};
|
|
1415
|
+
`}};Cs([o({type:String,reflect:!0})],as.prototype,"title",2),Cs([o({type:String,reflect:!0})],as.prototype,"href",2),Cs([o({type:String,reflect:!0})],as.prototype,"iconName",2),Cs([o({type:Boolean,reflect:!0})],as.prototype,"external",2),Cs([o({type:Boolean,reflect:!0})],as.prototype,"openInNewTab",2),Cs([o({type:String,reflect:!0})],as.prototype,"skin",2),as=Cs([X("pkt-linkcard")],as);var Au=Object.defineProperty,Iu=Object.getOwnPropertyDescriptor,Rt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Iu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Au(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.0/animations/";let Ot=class extends fe{constructor(){super(),this.defaultSlot=L(),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 Oe(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=A({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=A({"pkt-contents":!0,"pkt-hide":this.isLoading});return f`<div
|
|
1412
1416
|
role="status"
|
|
1413
1417
|
aria-live="polite"
|
|
1414
1418
|
aria-busy=${this.isLoading?"true":"false"}
|
|
1415
|
-
class=${
|
|
1419
|
+
class=${e}
|
|
1416
1420
|
>
|
|
1417
|
-
${this.isLoading&&this._shouldDisplayLoader?
|
|
1421
|
+
${this.isLoading&&this._shouldDisplayLoader?f`<div class="pkt-loader__spinner">
|
|
1418
1422
|
<pkt-icon
|
|
1419
1423
|
name=${this.getVariant(this.variant)}
|
|
1420
1424
|
path=${this.loadingAnimationPath}
|
|
1421
1425
|
class="pkt-loader__svg pkt-loader__${this.variant}"
|
|
1422
1426
|
></pkt-icon>
|
|
1423
|
-
${this.message&&
|
|
1424
|
-
</div>`:
|
|
1425
|
-
<div class=${
|
|
1426
|
-
</div>`}getVariant(
|
|
1427
|
-
${this.closable?
|
|
1427
|
+
${this.message&&f`<p>${this.message}</p>`}
|
|
1428
|
+
</div>`:_}
|
|
1429
|
+
<div class=${t} ${B(this.defaultSlot)}></div>
|
|
1430
|
+
</div>`}getVariant(e){switch(e){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))}};Rt([o({type:Number})],Ot.prototype,"delay",2),Rt([o({type:Boolean})],Ot.prototype,"inline",2),Rt([o({type:Boolean})],Ot.prototype,"isLoading",2),Rt([o({type:String})],Ot.prototype,"message",2),Rt([o({type:String})],Ot.prototype,"size",2),Rt([o({type:String})],Ot.prototype,"variant",2),Rt([o({type:String})],Ot.prototype,"loadingAnimationPath",2),Rt([q()],Ot.prototype,"_shouldDisplayLoader",2),Ot=Rt([X("pkt-loader")],Ot);const Lu={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},Ln={props:Lu};var Bu=Object.defineProperty,Fu=Object.getOwnPropertyDescriptor,Ks=(s,e,t,i)=>{for(var n=i>1?void 0:i?Fu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Bu(e,t,n),n};let Ts=class extends fe{constructor(){super(),this.defaultSlot=L(),this.closable=Ln.props.closable.default,this.compact=Ln.props.compact.default,this.title="",this.skin=Ln.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 Oe(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&Mr(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 f`<div class=${A(s)}>
|
|
1431
|
+
${this.closable?f`<div class="pkt-messagebox__close">
|
|
1428
1432
|
<button
|
|
1429
1433
|
@click=${this.close}
|
|
1430
1434
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
@@ -1432,26 +1436,26 @@
|
|
|
1432
1436
|
>
|
|
1433
1437
|
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
1434
1438
|
</button>
|
|
1435
|
-
</div>`:
|
|
1436
|
-
${this.title?
|
|
1437
|
-
<div class="pkt-messagebox__text" ${
|
|
1438
|
-
</div>`}};
|
|
1439
|
+
</div>`:_}
|
|
1440
|
+
${this.title?f`<div class="pkt-messagebox__title">${this.title}</div>`:_}
|
|
1441
|
+
<div class="pkt-messagebox__text" ${B(this.defaultSlot)}></div>
|
|
1442
|
+
</div>`}};Ks([o({type:Boolean,reflect:!0})],Ts.prototype,"closable",2),Ks([o({type:Boolean,reflect:!0})],Ts.prototype,"compact",2),Ks([o({type:String,reflect:!0})],Ts.prototype,"title",2),Ks([o({type:String,reflect:!0})],Ts.prototype,"skin",2),Ks([q()],Ts.prototype,"_isClosed",2),Ts=Ks([X("pkt-messagebox")],Ts);const Hu={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},Bn={props:Hu};var Vu=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,Et=(s,e,t,i)=>{for(var n=i>1?void 0:i?ju(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Vu(e,t,n),n};let kt=class extends fe{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=Bn.props.hideCloseButton.default,this.closeOnBackdropClick=Bn.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=Bn.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=L(),this.dialogRef=L(),this._isOpen=!1,this.close=(s,e=!1)=>{var t;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const i=document.activeElement;i&&!this.isElementInViewport(i)&&i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:s},bubbles:!0,composed:!0})),e||(t=this.dialogRef.value)==null||t.close(),this.requestUpdate()},this.showModal=(s=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const t=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var i;this.dialogRef.value&&((i=this.dialogRef.value)==null||i.focus())}),t&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:s},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new Oe(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(s){super.firstUpdated(s),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>Hf).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(s){s.key==="Escape"&&this.close(s)}handleBackdropClick(s){var e;this.closeOnBackdropClick&&s.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(s)}isElementInViewport(s){const e=s.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const s={"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},t={"pkt-modal__content":!0,"pkt-txt-18-light":!0},i=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return f`
|
|
1439
1443
|
<dialog
|
|
1440
|
-
class=${
|
|
1441
|
-
${
|
|
1444
|
+
class=${A(s)}
|
|
1445
|
+
${B(this.dialogRef)}
|
|
1442
1446
|
aria-labelledby="pkt-modal__headingText"
|
|
1443
1447
|
aria-describedby="pkt-modal__content"
|
|
1444
|
-
@close=${
|
|
1448
|
+
@close=${r=>this.close(r,!0)}
|
|
1445
1449
|
>
|
|
1446
1450
|
<div class="pkt-modal__wrapper">
|
|
1447
|
-
${this.headingText||!this.hideCloseButton?
|
|
1451
|
+
${this.headingText||!this.hideCloseButton?f`<div class="pkt-modal__header">
|
|
1448
1452
|
<div class="pkt-modal__header-background"></div>
|
|
1449
|
-
${this.headingText?
|
|
1453
|
+
${this.headingText?f`<h1 id="pkt-modal__headingText" class=${A(e)}>
|
|
1450
1454
|
${this.headingText}
|
|
1451
|
-
</h1>`:
|
|
1452
|
-
${this.hideCloseButton?
|
|
1455
|
+
</h1>`:f`<div class="pkt-modal__headingText"></div>`}
|
|
1456
|
+
${this.hideCloseButton?f`<div class="pkt-modal__noCloseButton"></div>`:f`<div class="${A(n)}">
|
|
1453
1457
|
<pkt-button
|
|
1454
|
-
@click=${
|
|
1458
|
+
@click=${r=>this.close(r)}
|
|
1455
1459
|
aria-label="close"
|
|
1456
1460
|
iconname="close"
|
|
1457
1461
|
variant="icon-only"
|
|
@@ -1461,71 +1465,71 @@
|
|
|
1461
1465
|
Lukk
|
|
1462
1466
|
</pkt-button>
|
|
1463
1467
|
</div>`}
|
|
1464
|
-
</div>`:
|
|
1468
|
+
</div>`:_}
|
|
1465
1469
|
<div class="pkt-modal__container">
|
|
1466
1470
|
<div
|
|
1467
1471
|
id="pkt-modal__content"
|
|
1468
|
-
class=${
|
|
1469
|
-
${
|
|
1472
|
+
class=${A(t)}
|
|
1473
|
+
${B(this.defaultSlot)}
|
|
1470
1474
|
></div>
|
|
1471
1475
|
</div>
|
|
1472
1476
|
</div>
|
|
1473
1477
|
</dialog>
|
|
1474
|
-
`}};
|
|
1478
|
+
`}};Et([o({type:String})],kt.prototype,"headingText",2),Et([o({type:Boolean})],kt.prototype,"removePadding",2),Et([o({type:Boolean})],kt.prototype,"hideCloseButton",2),Et([o({type:Boolean})],kt.prototype,"closeOnBackdropClick",2),Et([o({type:String})],kt.prototype,"closeButtonSkin",2),Et([o({type:String})],kt.prototype,"size",2),Et([o({type:String})],kt.prototype,"variant",2),Et([o({type:String})],kt.prototype,"drawerPosition",2),Et([o({type:Boolean})],kt.prototype,"transparentBackdrop",2),Et([q()],kt.prototype,"_isOpen",2),kt=Et([X("pkt-modal")],kt);/**
|
|
1475
1479
|
* @license
|
|
1476
1480
|
* Copyright 2018 Google LLC
|
|
1477
1481
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1478
|
-
*/const
|
|
1482
|
+
*/const ua="important",Uu=" !"+ua,Wu=fs(class extends Is{constructor(s){var e;if(super(s),s.type!==Tt.ATTRIBUTE||s.name!=="style"||((e=s.strings)==null?void 0:e.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(((e,t)=>{const i=s[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(s,[e]){const{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const n=e[i];if(n!=null){this.ft.add(i);const r=typeof n=="string"&&n.endsWith(Uu);i.includes("-")||r?t.setProperty(i,r?n.slice(0,-11):n,r?ua:""):t[i]=n}}return ht}});var qu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,Ue=(s,e,t,i)=>{for(var n=i>1?void 0:i?zu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&qu(e,t,n),n};let Pe=class extends fe{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=ns(),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=L(),this.progressBarRef=L()}firstUpdated(e){super.firstUpdated(e),this.setComputedValues(),this.syncAttributes()}updated(e){super.updated(e),e.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),e.has("id")&&this.id&&(this.progressBarId=this.id),(e.has("statusType")||e.has("id")||e.has("ariaLabelledby"))&&(this.progressbarId=this.id||ns(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(e.has("ariaValueText")||e.has("valueCurrent")||e.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const e=this.statusType!=="none",t=this.valueMax-this.valueMin,i=this.valueCurrent/t*100,n=this.statusType==="fraction"?Math.round(i):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),r=`${this.valueCurrent} av ${t}`,a=A({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),c=A({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),h=A({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),p=A({"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 f` <div
|
|
1479
1483
|
class="pkt-progressbar__container"
|
|
1480
1484
|
.ref=${this.progressBarRef}
|
|
1481
|
-
style=${
|
|
1485
|
+
style=${Wu({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${n}%`})}
|
|
1482
1486
|
>
|
|
1483
|
-
${this.title?
|
|
1487
|
+
${this.title?f`<p id=${`${this.progressBarId}-title`} class=${c}>${this.title}</p>`:_}
|
|
1484
1488
|
|
|
1485
1489
|
<div class="pkt-progressbar__bar-wrapper">
|
|
1486
|
-
<div class=${
|
|
1490
|
+
<div class=${a}></div>
|
|
1487
1491
|
</div>
|
|
1488
1492
|
|
|
1489
|
-
${
|
|
1490
|
-
<span class=${p} ${
|
|
1491
|
-
${this.statusType==="percentage"?`${n}%`:
|
|
1493
|
+
${e?f`<div class=${h}>
|
|
1494
|
+
<span class=${p} ${B(this.labelRef)}>
|
|
1495
|
+
${this.statusType==="percentage"?`${n}%`:r}
|
|
1492
1496
|
</span>
|
|
1493
|
-
</div>`:
|
|
1494
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||
|
|
1495
|
-
${this.tagText?
|
|
1496
|
-
${this.optionalTag?
|
|
1497
|
-
${this.requiredTag?
|
|
1498
|
-
`,
|
|
1499
|
-
<label class=${
|
|
1497
|
+
</div>`:_}
|
|
1498
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||ns(),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(e,t){t==null||t===""?this.removeAttribute(e):this.setAttribute(e,String(t))}};Ue([o({type:String})],Pe.prototype,"ariaLabel",2),Ue([o({type:String,reflect:!0})],Pe.prototype,"ariaLabelledby",2),Ue([o({type:String,reflect:!0})],Pe.prototype,"ariaValueText",2),Ue([o({type:String})],Pe.prototype,"ariaLive",2),Ue([o({type:String,reflect:!0})],Pe.prototype,"id",2),Ue([o({type:String})],Pe.prototype,"role",2),Ue([o({type:String})],Pe.prototype,"skin",2),Ue([o({type:String})],Pe.prototype,"statusPlacement",2),Ue([o({type:String})],Pe.prototype,"statusType",2),Ue([o({type:String,reflect:!0})],Pe.prototype,"title",2),Ue([o({type:String})],Pe.prototype,"titlePosition",2),Ue([o({type:Number,reflect:!0})],Pe.prototype,"valueCurrent",2),Ue([o({type:Number})],Pe.prototype,"valueMax",2),Ue([o({type:Number})],Pe.prototype,"valueMin",2),Ue([q()],Pe.prototype,"labelWidth",2),Ue([q()],Pe.prototype,"progressbarId",2),Ue([q()],Pe.prototype,"computedAriaLabelledby",2),Ue([q()],Pe.prototype,"computedAriaValueText",2),Pe=Ue([X("pkt-progressbar")],Pe);var Yu=Object.defineProperty,Ku=Object.getOwnPropertyDescriptor,$t=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ku(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Yu(e,t,n),n};let pt=class extends V{constructor(){super(...arguments),this.inputRef=L(),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,e,t){s==="defaultChecked"&&(this._checked=this.defaultChecked),s==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(s,e,t)}render(){const s=A({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=A({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),t=A({"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",n=()=>f`
|
|
1499
|
+
${this.tagText?f`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:_}
|
|
1500
|
+
${this.optionalTag?f`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:_}
|
|
1501
|
+
${this.requiredTag?f`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:_}
|
|
1502
|
+
`,r=()=>f`
|
|
1503
|
+
<label class=${t} for=${this.id+"-internal"}>
|
|
1500
1504
|
${this.label} ${n()}
|
|
1501
|
-
${this.checkHelptext?
|
|
1505
|
+
${this.checkHelptext?f`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:_}
|
|
1502
1506
|
</label>
|
|
1503
|
-
`;return
|
|
1507
|
+
`;return f`
|
|
1504
1508
|
<div class="pkt-input-check">
|
|
1505
1509
|
<div class=${s}>
|
|
1506
1510
|
<input
|
|
1507
1511
|
id=${this.id+"-internal"}
|
|
1508
|
-
class=${
|
|
1512
|
+
class=${e}
|
|
1509
1513
|
type="radio"
|
|
1510
1514
|
role="radio"
|
|
1511
1515
|
?disabled=${this.disabled}
|
|
1512
1516
|
form=""
|
|
1513
1517
|
name=${this.name+"-internal"}
|
|
1514
|
-
${
|
|
1518
|
+
${B(this.inputRef)}
|
|
1515
1519
|
@change=${this.toggleChecked}
|
|
1516
1520
|
@input=${this.onInput}
|
|
1517
1521
|
@blur=${this.onBlur}
|
|
1518
1522
|
@focus=${this.onFocus}
|
|
1519
1523
|
?checked=${this.checked}
|
|
1520
1524
|
/>
|
|
1521
|
-
${
|
|
1525
|
+
${r()}
|
|
1522
1526
|
</div>
|
|
1523
1527
|
</div>
|
|
1524
|
-
`}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))}}
|
|
1528
|
+
`}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))}};$t([o({type:String,reflect:!0})],pt.prototype,"value",2),$t([o({type:String})],pt.prototype,"checkHelptext",2),$t([o({type:Boolean})],pt.prototype,"defaultChecked",2),$t([o({type:Boolean})],pt.prototype,"hasTile",2),$t([o({type:Boolean,reflect:!0})],pt.prototype,"checked",2),$t([o({type:String,reflect:!0})],pt.prototype,"type",2),$t([o({type:String})],pt.prototype,"tagText",2),$t([o({type:Boolean})],pt.prototype,"optionalTag",2),$t([o({type:String})],pt.prototype,"optionalText",2),$t([o({type:Boolean})],pt.prototype,"requiredTag",2),$t([o({type:String})],pt.prototype,"requiredText",2),$t([q()],pt.prototype,"_checked",2),pt=$t([X("pkt-radiobutton")],pt);/**
|
|
1525
1529
|
* @license
|
|
1526
1530
|
* Copyright 2021 Google LLC
|
|
1527
1531
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1528
|
-
*/let
|
|
1532
|
+
*/let da=class extends Event{constructor(e,t,i,n){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=i,this.subscribe=n??!1}};/**
|
|
1529
1533
|
* @license
|
|
1530
1534
|
* Copyright 2021 Google LLC
|
|
1531
1535
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1533,63 +1537,63 @@
|
|
|
1533
1537
|
* @license
|
|
1534
1538
|
* Copyright 2021 Google LLC
|
|
1535
1539
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1536
|
-
*/let
|
|
1540
|
+
*/let pa=class{constructor(e,t,i,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,a)),this.unsubscribe=a},this.host=e,t.context!==void 0){const r=t;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=t,this.callback=i,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new da(this.context,this.host,this.t,this.subscribe))}};/**
|
|
1537
1541
|
* @license
|
|
1538
1542
|
* Copyright 2021 Google LLC
|
|
1539
1543
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1540
|
-
*/class
|
|
1544
|
+
*/class Ru{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){const i=t||!Object.is(e,this.o);this.o=e,i&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:i}]of this.subscriptions)t(this.o,i)},e!==void 0&&(this.value=e)}addCallback(e,t,i){if(!i)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});const{disposer:n}=this.subscriptions.get(e);e(this.value,n)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
1541
1545
|
* @license
|
|
1542
1546
|
* Copyright 2021 Google LLC
|
|
1543
1547
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1544
|
-
*/let
|
|
1548
|
+
*/let Gu=class extends Event{constructor(e,t){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},fa=class extends Ru{constructor(e,t,i){var n,r;super(t.context!==void 0?t.initialValue:i),this.onContextRequest=a=>{if(a.context!==this.context)return;const c=a.contextTarget??a.composedPath()[0];c!==this.host&&(a.stopPropagation(),this.addCallback(a.callback,c,a.subscribe))},this.onProviderRequest=a=>{if(a.context!==this.context||(a.contextTarget??a.composedPath()[0])===this.host)return;const c=new Set;for(const[h,{consumerHost:p}]of this.subscriptions)c.has(h)||(c.add(h),p.dispatchEvent(new da(this.context,p,h,!0)));a.stopPropagation()},this.host=e,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),(r=(n=this.host).addController)==null||r.call(n,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Gu(this.context,this.host))}};/**
|
|
1545
1549
|
* @license
|
|
1546
1550
|
* Copyright 2017 Google LLC
|
|
1547
1551
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1548
|
-
*/function
|
|
1552
|
+
*/function Xu({context:s}){return(e,t)=>{const i=new WeakMap;if(typeof t=="object")return{get(){return e.get.call(this)},set(n){return i.get(this).setValue(n),e.set.call(this,n)},init(n){return i.set(this,new fa(this,{context:s,initialValue:n})),n}};{e.constructor.addInitializer((a=>{i.set(a,new fa(a,{context:s}))}));const n=Object.getOwnPropertyDescriptor(e,t);let r;if(n===void 0){const a=new WeakMap;r={get(){return a.get(this)},set(c){i.get(this).setValue(c),a.set(this,c)},configurable:!0,enumerable:!0}}else{const a=n.set;r={...n,set(c){i.get(this).setValue(c),a==null||a.call(this,c)}}}return void Object.defineProperty(e,t,r)}}}/**
|
|
1549
1553
|
* @license
|
|
1550
1554
|
* Copyright 2022 Google LLC
|
|
1551
1555
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1552
|
-
*/function
|
|
1556
|
+
*/function Qu({context:s,subscribe:e}){return(t,i)=>{typeof i=="object"?i.addInitializer((function(){new pa(this,{context:s,callback:n=>{t.set.call(this,n)},subscribe:e})})):t.constructor.addInitializer((n=>{new pa(n,{context:s,callback:r=>{n[i]=r},subscribe:e})}))}}const ga=Symbol("pkt-tabs-context");var Zu=Object.defineProperty,Ju=Object.getOwnPropertyDescriptor,Rs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ju(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Zu(e,t,n),n};let Ms=class extends fe{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=L(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new Oe(this,this.defaultSlot)}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has("arrowNav")||e.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(e,t){this.tabRefs[t]=e,this.tabCount=Math.max(this.tabCount,t+1)}handleClick(e){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){var i,n;this.useArrowNav&&(e.code==="ArrowLeft"&&t!==0&&((i=this.tabRefs[t-1])==null||i.focus()),e.code==="ArrowRight"&&t<this.tabCount-1&&((n=this.tabRefs[t+1])==null||n.focus()),(e.code==="ArrowDown"||e.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0})))}render(){const e=this.useArrowNav?"tablist":"navigation";return f`
|
|
1553
1557
|
<div class="pkt-tabs">
|
|
1554
|
-
<div class="pkt-tabs__list" role=${
|
|
1558
|
+
<div class="pkt-tabs__list" role=${e} ${B(this.defaultSlot)}></div>
|
|
1555
1559
|
</div>
|
|
1556
|
-
`}};
|
|
1557
|
-
${this.icon?
|
|
1558
|
-
<span ${
|
|
1559
|
-
${this.tag?
|
|
1560
|
-
`;return this.href?
|
|
1560
|
+
`}};Rs([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],Ms.prototype,"arrowNav",2),Rs([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],Ms.prototype,"disableArrowNav",2),Rs([q()],Ms.prototype,"tabRefs",2),Rs([q()],Ms.prototype,"tabCount",2),Rs([Xu({context:ga}),q()],Ms.prototype,"context",2),Ms=Rs([X("pkt-tabs")],Ms);var ed=Object.defineProperty,td=Object.getOwnPropertyDescriptor,Gt=(s,e,t,i)=>{for(var n=i>1?void 0:i?td(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ed(e,t,n),n};let Ht=class extends fe{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=L(),this.defaultSlot=L(),this.slotController=new Oe(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(e){this.context&&this.context.handleKeyUp(e,this.index)}render(){var e;const t=((e=this.context)==null?void 0:e.useArrowNav)??!0,i=this.active?"active":"",n=t?"tab":void 0,r=t?this.active:void 0,a=this.active||!t?void 0:-1,c=f`
|
|
1561
|
+
${this.icon?f`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
|
|
1562
|
+
<span ${B(this.defaultSlot)}></span>
|
|
1563
|
+
${this.tag?f`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
|
|
1564
|
+
`;return this.href?f`
|
|
1561
1565
|
<a
|
|
1562
|
-
${
|
|
1566
|
+
${B(this.elementRef)}
|
|
1563
1567
|
href=${this.href}
|
|
1564
1568
|
class="pkt-tabs__link ${i}"
|
|
1565
|
-
role=${
|
|
1566
|
-
aria-selected=${
|
|
1567
|
-
aria-controls=${
|
|
1568
|
-
tabindex=${
|
|
1569
|
+
role=${N(n)}
|
|
1570
|
+
aria-selected=${N(r)}
|
|
1571
|
+
aria-controls=${N(this.controls||void 0)}
|
|
1572
|
+
tabindex=${N(a)}
|
|
1569
1573
|
@click=${this.handleClick}
|
|
1570
1574
|
@keyup=${this.handleKeyUp}
|
|
1571
1575
|
>
|
|
1572
|
-
${
|
|
1576
|
+
${c}
|
|
1573
1577
|
</a>
|
|
1574
|
-
`:
|
|
1578
|
+
`:f`
|
|
1575
1579
|
<button
|
|
1576
|
-
${
|
|
1580
|
+
${B(this.elementRef)}
|
|
1577
1581
|
type="button"
|
|
1578
1582
|
class="pkt-tabs__button pkt-link-button ${i}"
|
|
1579
|
-
role=${
|
|
1580
|
-
aria-selected=${
|
|
1581
|
-
aria-controls=${
|
|
1582
|
-
tabindex=${
|
|
1583
|
+
role=${N(n)}
|
|
1584
|
+
aria-selected=${N(r)}
|
|
1585
|
+
aria-controls=${N(this.controls||void 0)}
|
|
1586
|
+
tabindex=${N(a)}
|
|
1583
1587
|
@click=${this.handleClick}
|
|
1584
1588
|
@keyup=${this.handleKeyUp}
|
|
1585
1589
|
>
|
|
1586
|
-
${
|
|
1590
|
+
${c}
|
|
1587
1591
|
</button>
|
|
1588
|
-
`}};
|
|
1592
|
+
`}};Gt([o({type:Boolean,reflect:!0})],Ht.prototype,"active",2),Gt([o({type:String,reflect:!0})],Ht.prototype,"href",2),Gt([o({type:String,reflect:!0})],Ht.prototype,"icon",2),Gt([o({type:String,reflect:!0})],Ht.prototype,"controls",2),Gt([o({type:String,reflect:!0})],Ht.prototype,"tag",2),Gt([o({type:String,reflect:!0,attribute:"tag-skin"})],Ht.prototype,"tagSkin",2),Gt([o({type:Number,reflect:!0})],Ht.prototype,"index",2),Gt([Qu({context:ga,subscribe:!0}),o({attribute:!1})],Ht.prototype,"context",2),Ht=Gt([X("pkt-tab-item")],Ht);/**
|
|
1589
1593
|
* @license
|
|
1590
1594
|
* Copyright 2020 Google LLC
|
|
1591
1595
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1592
|
-
*/const
|
|
1596
|
+
*/const sd=fs(class extends Is{constructor(s){if(super(s),s.type!==Tt.PROPERTY&&s.type!==Tt.ATTRIBUTE&&s.type!==Tt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!xr(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[e]){if(e===ht||e===_)return e;const t=s.element,i=s.name;if(s.type===Tt.PROPERTY){if(e===t[i])return ht}else if(s.type===Tt.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(i))return ht}else if(s.type===Tt.ATTRIBUTE&&t.getAttribute(i)===e+"")return ht;return Cr(s),e}});var id=Object.defineProperty,nd=Object.getOwnPropertyDescriptor,Ci=(s,e,t,i)=>{for(var n=i>1?void 0:i?nd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&id(e,t,n),n};let Gs=class extends V{constructor(){super(),this.inputRef=L(),this.helptextSlot=L(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new Oe(this,this.helptextSlot)}attributeChangedCallback(s,e,t){s==="value"&&this.value!==e&&(this.counterCurrent=t?t.length:0,this.valueChanged(t,e)),super.attributeChangedCallback(s,e,t)}updated(s){var e;super.updated(s),s.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const s=A({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),e=this.ariaLabelledby||`${this.id}-input-label`;return f`<pkt-input-wrapper
|
|
1593
1597
|
label=${this.label}
|
|
1594
1598
|
?counter=${this.counter}
|
|
1595
1599
|
?disabled=${this.disabled}
|
|
@@ -1612,29 +1616,29 @@
|
|
|
1612
1616
|
.tagText=${this.tagText}
|
|
1613
1617
|
class="pkt-textarea"
|
|
1614
1618
|
>
|
|
1615
|
-
<div class="pkt-contents" ${
|
|
1619
|
+
<div class="pkt-contents" ${B(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1616
1620
|
<textarea
|
|
1617
|
-
${
|
|
1621
|
+
${B(this.inputRef)}
|
|
1618
1622
|
class=${s}
|
|
1619
1623
|
id=${this.id+"-input"}
|
|
1620
1624
|
name=${(this.name||this.id)+"-input"}
|
|
1621
|
-
placeholder=${
|
|
1622
|
-
.value=${
|
|
1623
|
-
minlength=${
|
|
1624
|
-
maxlength=${
|
|
1625
|
+
placeholder=${N(this.placeholder)}
|
|
1626
|
+
.value=${sd(this.value)}
|
|
1627
|
+
minlength=${N(this.minlength)}
|
|
1628
|
+
maxlength=${N(this.maxlength)}
|
|
1625
1629
|
?readonly=${this.readonly}
|
|
1626
1630
|
autocomplete=${this.autocomplete}
|
|
1627
|
-
aria-labelledby=${
|
|
1631
|
+
aria-labelledby=${e}
|
|
1628
1632
|
aria-invalid=${this.hasError}
|
|
1629
1633
|
aria-errormessage=${`${this.id}-error`}
|
|
1630
1634
|
rows=${this.rows}
|
|
1631
1635
|
?disabled=${this.disabled}
|
|
1632
|
-
@input=${
|
|
1633
|
-
@change=${
|
|
1634
|
-
@focus=${
|
|
1635
|
-
@blur=${
|
|
1636
|
+
@input=${t=>{this.value=t.target.value,this.onInput(),t.stopImmediatePropagation()}}
|
|
1637
|
+
@change=${t=>{t.stopImmediatePropagation()}}
|
|
1638
|
+
@focus=${t=>{this.onFocus(),t.stopImmediatePropagation()}}
|
|
1639
|
+
@blur=${t=>{this.value=t.target.value,this.onBlur(),t.stopImmediatePropagation()}}
|
|
1636
1640
|
></textarea>
|
|
1637
|
-
</pkt-input-wrapper>`}};
|
|
1641
|
+
</pkt-input-wrapper>`}};Ci([o({type:String,reflect:!0})],Gs.prototype,"value",2),Ci([o({type:String})],Gs.prototype,"autocomplete",2),Ci([o({type:Number})],Gs.prototype,"rows",2),Ci([q()],Gs.prototype,"counterCurrent",2),Gs=Ci([X("pkt-textarea")],Gs);var rd=Object.defineProperty,ma=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&rd(e,t,n),n};let Fn=class extends V{constructor(){super(...arguments),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate("_optionsProp",this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){var e,t;const i=this._optionsProp.length>0,n=((t=(e=this.optionsController)==null?void 0:e.nodes)==null?void 0:t.length)&&this.optionsController.nodes.length>0;i?this._options=this._optionsProp:n&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};ma([o({type:Array,attribute:"options"})],Fn.prototype,"_optionsProp"),ma([q()],Fn.prototype,"_options");var ad=Object.defineProperty,od=Object.getOwnPropertyDescriptor,va=(s,e,t,i)=>{for(var n=i>1?void 0:i?od(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ad(e,t,n),n};let Hn=class extends Fn{constructor(){super(),this.inputRef=L(),this.helptextSlot=L(),this.value="",this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new oa(this),this.slotController=new Oe(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)})}add(s,e){const t={value:s.value||s.text,label:s.text||s.value,selected:s.selected,disabled:s.disabled};if(e===void 0)this._options.push(t);else if(typeof e=="number")this._options.splice(e,0,t);else{const i=e.value||e.text,n=this._options.findIndex(r=>r.value===i);n>=0?this._options.splice(n,0,t):this._options.push(t)}s.selected&&(this.value=s.value||s.text,this.selectedIndex=this._options.findIndex(i=>i.value===this.value)),this.requestUpdate()}remove(s){var e;typeof s=="number"&&(this.selectedIndex===s&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(s,1),this.requestUpdate())}item(s){var e;return(e=this.inputRef.value)==null?void 0:e.item(s)}namedItem(s){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(s)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(s,e,t){var i,n;s==="options"&&(this._options=t?JSON.parse(t):[]),s==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this._options.findIndex(r=>r.value===t),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.selectedOptions,this.valueChanged(t,e)),super.attributeChangedCallback(s,e,t)}update(s){var e,t;super.update(s),s.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)),s.has("value")&&this.value!==s.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(t=this.inputRef.value)==null?void 0:t.selectedOptions,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(s){var e;super.firstUpdated(s),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(t=>t.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const s=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return f`
|
|
1638
1642
|
<pkt-input-wrapper
|
|
1639
1643
|
?counter=${this.counter}
|
|
1640
1644
|
?disabled=${this.disabled}
|
|
@@ -1644,46 +1648,46 @@
|
|
|
1644
1648
|
?optionalTag=${this.optionalTag}
|
|
1645
1649
|
?requiredTag=${this.requiredTag}
|
|
1646
1650
|
useWrapper=${this.useWrapper}
|
|
1647
|
-
ariaDescribedBy=${
|
|
1651
|
+
ariaDescribedBy=${N(this.ariaDescribedBy)}
|
|
1648
1652
|
class="pkt-select"
|
|
1649
|
-
errorMessage=${
|
|
1653
|
+
errorMessage=${N(this.errorMessage)}
|
|
1650
1654
|
forId=${this.id+"-input"}
|
|
1651
|
-
helptext=${
|
|
1652
|
-
helptextDropdown=${
|
|
1653
|
-
helptextDropdownButton=${
|
|
1654
|
-
label=${
|
|
1655
|
-
optionalText=${
|
|
1656
|
-
requiredText=${
|
|
1657
|
-
tagText=${
|
|
1655
|
+
helptext=${N(this.helptext)}
|
|
1656
|
+
helptextDropdown=${N(this.helptextDropdown)}
|
|
1657
|
+
helptextDropdownButton=${N(this.helptextDropdownButton)}
|
|
1658
|
+
label=${N(this.label)}
|
|
1659
|
+
optionalText=${N(this.optionalText)}
|
|
1660
|
+
requiredText=${N(this.requiredText)}
|
|
1661
|
+
tagText=${N(this.tagText)}
|
|
1658
1662
|
>
|
|
1659
1663
|
<select
|
|
1660
1664
|
class=${s}
|
|
1661
1665
|
aria-invalid=${this.hasError}
|
|
1662
1666
|
aria-errormessage=${`${this.id}-error`}
|
|
1663
|
-
aria-labelledby=${
|
|
1667
|
+
aria-labelledby=${N(this.ariaLabelledby)}
|
|
1664
1668
|
?disabled=${this.disabled}
|
|
1665
1669
|
id=${this.id+"-input"}
|
|
1666
1670
|
name=${(this.name||this.id)+"-input"}
|
|
1667
1671
|
value=${this.value}
|
|
1668
|
-
@change=${
|
|
1669
|
-
@input=${
|
|
1670
|
-
@focus=${
|
|
1671
|
-
@blur=${
|
|
1672
|
-
${
|
|
1672
|
+
@change=${e=>{this.touched=!0,this.value=e.target.value,e.stopImmediatePropagation()}}
|
|
1673
|
+
@input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
|
|
1674
|
+
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
1675
|
+
@blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
|
|
1676
|
+
${B(this.inputRef)}
|
|
1673
1677
|
>
|
|
1674
|
-
${this._options.length>0?this._options.map(
|
|
1675
|
-
value=${
|
|
1676
|
-
?selected=${this.value==
|
|
1677
|
-
?disabled=${
|
|
1678
|
-
?hidden=${
|
|
1678
|
+
${this._options.length>0?this._options.map(e=>f`<option
|
|
1679
|
+
value=${e.value}
|
|
1680
|
+
?selected=${this.value==e.value||e.selected}
|
|
1681
|
+
?disabled=${e.disabled}
|
|
1682
|
+
?hidden=${e.hidden}
|
|
1679
1683
|
>
|
|
1680
|
-
${
|
|
1684
|
+
${e.label}
|
|
1681
1685
|
</option>`):""}
|
|
1682
1686
|
</select>
|
|
1683
|
-
<div class="pkt-contents" ${
|
|
1687
|
+
<div class="pkt-contents" ${B(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1684
1688
|
</pkt-input-wrapper>
|
|
1685
|
-
`}returnNumberOrNull(s){return s==null||isNaN(s)?null:s}};
|
|
1689
|
+
`}returnNumberOrNull(s){return s==null||isNaN(s)?null:s}};va([o({type:String})],Hn.prototype,"value",2),Hn=va([X("pkt-select")],Hn);const ee=Pt({tagName:"pkt-icon",elementClass:ms,react:g,displayName:"PktIcon",events:{}}),ba=g.forwardRef(({defaultOpen:s=!1,id:e,title:t,skin:i,compact:n=!1,isOpen:r,children:a,name:c,className:h,onClick:p,onToggle:v},b)=>{const[y,k]=g.useState(s),{name:m}=No(),w=c||m,C=r!==void 0?r:y;g.useEffect(()=>{r===void 0&&k(s)},[s,r]);const M=T=>{const K=T.currentTarget.open;r===void 0&&k(K),v==null||v(T)},S=T=>{setTimeout(()=>{p==null||p(T)},0)},O=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,h].filter(Boolean).join(" ");return l.jsxs("details",{ref:b,className:O,id:e,open:C,onClick:S,name:w,onToggle:M,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${e}`,children:[t,l.jsx(ee,{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-${e}`,role:"region",children:l.jsx("div",{className:"pkt-accordion-item__content-inner",children:a})})]})});ba.displayName="PktAccordionItem";function ld(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Vn={exports:{}};/*!
|
|
1686
1690
|
Copyright (c) 2018 Jed Watson.
|
|
1687
1691
|
Licensed under the MIT License (MIT), see
|
|
1688
1692
|
http://jedwatson.github.io/classnames
|
|
1689
|
-
*/var Aa;function Ic(){return Aa||(Aa=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var a="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(a=n(a,i(h)))}return a}function i(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return e.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var r="";for(var h in a)t.call(a,h)&&a[h]&&(r=n(r,h));return r}function n(a,r){return r?a?a+" "+r:a+r:a}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(nn)),nn.exports}var Lc=Ic();const Z=Dc(Lc),an=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:d="info",className:p,...m})=>{const[v,y]=w.useState(!1),$={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":v},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=w.useCallback(()=>{y(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,y]),T=a||r;return l.jsx("div",{...m,"aria-live":T,role:h,className:Z($,p),children:l.jsxs("div",{className:Z(b),children:[l.jsx(W,{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(pe,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:x,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}),n&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};an.displayName="PktAlert";const Oa=Jt({tagName:"pkt-backlink",elementClass:hs,react:w,displayName:"PktBackLink"});Oa.displayName="PktBackLink";const Pa=w.forwardRef(({breadcrumbs:s,navigationType:t,renderLink:e,className:i,...n},a)=>{const r=s,h=r[r.length-2],d=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=e||(t==="router"?({href:m,className:v,children:y,props:$})=>l.jsx(cr.Link,{to:m,className:v,...$,children:y}):({href:m,className:v,children:y,props:$})=>l.jsx("a",{href:m,className:v,...$,children:y}));return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:d,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:r.map((m,v)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:v===r.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})}):p({href:m.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:l.jsxs(l.Fragment,{children:[l.jsx(W,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})]}),props:n})},`breadcrumb-${v}`))}),p({href:h.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:l.jsxs(l.Fragment,{children:[l.jsx(W,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:h.text})]}),props:n})]})});Pa.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.5/animations/";const pe=w.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",iconPath:n,secondIconPath:a,size:r="medium",fullWidth:h=!1,fullWidthOnMobile:d=!1,skin:p="primary",type:m="button",variant:v="label-only",state:y,color:$,isLoading:b=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...M},S)=>{const B=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",d&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,$&&`pkt-btn--${$}`,y&&`pkt-btn--${y}`,b&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...M,"aria-busy":b||void 0,"aria-disabled":x||void 0,disabled:x,className:B,type:m,ref:S,children:[b&&l.jsx(W,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),v!=="label-only"&&l.jsx(W,{className:"pkt-btn__icon",name:e,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&l.jsx(W,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});pe.displayName="PktButton";const Bc=Jt({tagName:"pkt-card",elementClass:pt,react:w,displayName:"PktCard",events:{}}),Da=w.forwardRef(({children:s,...t},e)=>l.jsx(Bc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Da.displayName="PktCard";const Ia=w.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:n,hasError:a=!1,className:r,isSwitch:h=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:m,checked:v,indeterminate:y,optionalTag:$,optionalText:b="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:M,...S},B)=>{const E=w.useRef(null);w.useEffect(()=>{E.current&&y!==void 0&&(E.current.indeterminate=y)},[y]),w.useEffect(()=>{typeof B=="function"?B(E.current):B&&(B.current=E.current)},[B]);const R=[r,"pkt-input-check"].filter(Boolean).join(" "),et=["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(" "),Ct=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Tt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),nt=()=>l.jsxs(l.Fragment,{children:[M&&l.jsx("span",{className:Tt+" pkt-tag--gray",children:M}),$&&l.jsx("span",{className:Tt+" pkt-tag--blue-light",children:b}),x&&l.jsx("span",{className:Tt+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:R,children:l.jsxs("div",{className:Ct,children:[p==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",nt(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:E,className:`pkt-input-check__input-checkbox ${a?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...v!==void 0?{checked:v}:{defaultChecked:m},...S}),p==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",nt(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Ia.displayName="PktCheckbox";const Fc=Jt({tagName:"pkt-combobox",elementClass:at,react:w,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),La=w.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Fc,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));La.displayName="PktCombobox";const Ti=Jt({tagName:"pkt-consent",elementClass:Rt,react:w,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Ti.displayName="PktConsent";const Vc=Jt({tagName:"pkt-datepicker",elementClass:ht,react:w,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Ba=w.forwardRef(({helptext:s,...t},e)=>l.jsx(Vc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));Ba.displayName="PktDatepicker";const Hc=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:a="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:v=null,cookieSecure:y=null,cookieExpiryDays:$=null,onToggleConsent:b=x=>{console.log(x.detail)}})=>{var T,M;const x=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:x,"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}),(T=s.links)==null?void 0:T.map((S,B)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${B}`))]})]}),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((S,B)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${B}`))]})]}),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:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(W,{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:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Ti,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:y,cookieExpiryDays:$,onToggleConsent:b})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(S=>S.language).map((S,B)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${B}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(S=>S.iconName).map((S,B)=>l.jsx(w.Fragment,{children:l.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(W,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${B}`))})]})]})})},jc=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:a=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:v=$=>{console.log($.detail)},className:y})=>{const $=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:$,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((b,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${b.external?" pkt-link--external":""}`,href:b.href,target:b.openInNewTab||t?"_blank":"_self",rel:b.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),b.text]})},x)),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(W,{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(W,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Ti,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},Uc=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=w.useState(e);return w.useEffect(()=>{const a=s.current;if(!a)return;if(n(a.offsetWidth),typeof ResizeObserver>"u"){const h=()=>{a&&n(a.offsetWidth)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)}const r=new ResizeObserver(h=>{for(const d of h)d.borderBoxSize&&d.borderBoxSize.length>0?n(d.borderBoxSize[0].inlineSize):n(d.contentRect.width)});return r.observe(a),()=>{r.disconnect()}},[s]),i};function zc(s){const t=w.useRef(0);w.useEffect(()=>{const e=document.body,i=document.documentElement;if(s){t.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(e.style.paddingRight=`${n}px`),e.style.position="fixed",e.style.top=`-${t.current}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",i.classList.add("is-scroll-locked")}else e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current});return()=>{s&&(e.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current}))}},[s])}const Ni=({href:s,iconName:t,className:e,iconPosition:i,external:n,target:a,children:r,...h})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!t&&i==="left"||!!(t&&!i),"pkt-link--icon-right":!!t&&i==="right","pkt-link--external":n};return l.jsxs("a",{...h,className:Z(d,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(W,{name:t,className:"pkt-link__icon"}),r]})};Ni.displayName="PktLink";const qc=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Ei=({item:s,className:t})=>"href"in s?l.jsx(Ni,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:Z("pkt-user-menu__link",t),children:s.title}):l.jsxs("button",{className:Z("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",t),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&l.jsx(W,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),Wc=({links:s})=>l.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((t,e)=>l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Ei,{item:t})},e))}),Fa=w.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const d=i==null?void 0:i.map(qc);return l.jsx("nav",{className:"pkt-user-menu",ref:h,"aria-label":"Meny for innlogget bruker",children:l.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),t&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:t})]})]}),d&&d.length>0&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Wc,{links:d})}),e&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:e.name}),e.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",e.orgNumber]}),n&&a&&l.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Ei,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})]}),!e&&n&&a&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx("ul",{className:"pkt-user-menu__sublist",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Ei,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})}),r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Ei,{item:{title:"Logg ut",iconName:"exit",onClick:r}})})]})})});Fa.displayName="PktHeaderUserMenu";const Qs=w.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:y=null,hasError:$=!1,errorMessage:b,disabled:x=!1,inline:T=!1,ariaDescribedby:M,useWrapper:S=!0,children:B,className:E="",hasFieldset:R=!1,role:et="group",counterPosition:Ct="bottom"},Tt)=>{const[nt,mt]=w.useState(!1),Ut=M||(e?`${s}-helptext`:void 0),Yt=!!a,dt=Yt&&Ct==="top",$e=Yt&&Ct==="bottom",Dt=()=>mt(rt=>!rt),It=["pkt-inputwrapper",E,$?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),zt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Gt=()=>Yt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,z=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:zt+" pkt-tag--gray",children:y}),d&&l.jsx("span",{className:zt+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:zt+" pkt-tag--beige",children:v})]}),Nt=()=>{const rt=l.jsxs(l.Fragment,{children:[t," ",z()]});return S?R?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:rt}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Ut,id:`${s}-label`,children:rt}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Ut,id:`${s}-label`,children:t})},ae=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&S&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(pe,{skin:"tertiary",size:"small",variant:"icon-right",iconName:nt?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Dt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${nt?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Lt=l.jsxs(l.Fragment,{children:[Nt(),ae(),dt&&l.jsx(Gt,{}),B,$e&&l.jsx(Gt,{}),$&&b&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(an,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:b})})]});return l.jsx("div",{className:It,ref:Tt,role:et,children:R?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Ut,children:Lt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Lt})})});Qs.displayName="PktInputWrapper";const Mi=w.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:y,iconNameRight:$,inline:b=!1,fullwidth:x=!1,label:T,name:M,optionalTag:S=!1,optionalText:B,requiredTag:E=!1,requiredText:R,tagText:et=null,placeholder:Ct,prefix:Tt,suffix:nt,type:mt="text",useWrapper:Ut=!0,omitSearchIcon:Yt=!1,value:dt,minLength:$e,maxLength:Dt,min:It,max:zt,step:Gt,size:z,readonly:Nt,required:ae,dataTestid:Lt,onChange:rt,skipForwardTestid:_e=!1,...we},re)=>{const ei=[r,"pkt-textinput"].join(" "),_s=mt==="search"&&!$&&!Yt,ws=mt==="date"&&dt?dt.slice(0,10):dt,[Qe,fe]=w.useState((dt==null?void 0:dt.length)||0),ge=`${s}`,De=`${ge}-label`,ts=e||De,xe=Zt=>{var es,_t;n&&fe(((_t=(es=Zt.currentTarget)==null?void 0:es.value)==null?void 0:_t.length)||0),rt&&rt(Zt)};return w.useEffect(()=>{dt!==void 0&&fe((dt==null?void 0:dt.length)||0)},[dt]),l.jsx(Qs,{ariaDescribedby:t,className:ei,disabled:h,errorMessage:d,forId:ge,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:y,inline:b,label:T,optionalTag:S,optionalText:B,requiredTag:E,requiredText:R,tagText:et,useWrapper:Ut,counter:n,counterCurrent:Qe,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Lt,"data-skip-forward-testid":_e?"true":void 0,children:[Tt&&l.jsx("div",{className:"pkt-input-prefix",children:Tt}),l.jsx("input",{...we,ref:re,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&Qe>a?"pkt-input--counter-error":""}`,type:mt,name:`${M||s}`,value:ws,id:ge,placeholder:Ct,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":ts,min:It,max:zt,onChange:xe,step:Gt,minLength:$e,maxLength:Dt,size:z,readOnly:Nt,required:ae}),nt&&l.jsxs("p",{className:"pkt-input-suffix",children:[nt,$&&l.jsx(W,{className:"pkt-input-suffix-icon",name:$}),_s&&l.jsx(W,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!nt&&$&&l.jsx(W,{className:"pkt-input-icon",name:$}),!nt&&_s&&l.jsx(W,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});Mi.displayName="PktTextinput";const rn=w.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,className:i,compact:n=!1,"data-mode":a,logOutButtonPlacement:r="none",logOut:h,openedMenu:d,showSearch:p=!1,onSearch:m,onSearchChange:v,searchValue:y,searchPlaceholder:$="Søk",representing:b,serviceLink:x,serviceClick:T,serviceName:M,user:S,userMenu:B,userMenuFooter:E,userOptions:R,canChangeRepresentation:et=!1,changeRepresentation:Ct,hideLogo:Tt=!1,logoLink:nt,logoClick:mt,position:Ut="fixed",scrollBehavior:Yt="hide",slotMenuVariant:dt="icon-only",slotMenuText:$e="Meny"},Dt)=>{const It=Ut==="fixed",zt=Yt==="hide";w.useEffect(()=>{E&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[E]),w.useEffect(()=>{R&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[R]),w.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),b!=null&&b.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,b==null?void 0:b.shortname]);const Gt=w.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[z,Nt]=w.useState(d||"none"),[ae,Lt]=w.useState(!1),[rt,_e]=w.useState(0),[we,re]=w.useState(!1),[ei,_s]=w.useState(!1),ws=w.useRef(null),Qe=w.useRef(null),fe=w.useRef(null),ge=w.useRef(null),De=w.useRef(null),ts=w.useRef(null),xe=w.useRef(null),Zt=w.useRef(!1),es=Uc(ws),_t=es<s,Xt=es<t,cn=w.useCallback(c=>{ws.current=c,typeof Dt=="function"?Dt(c):Dt&&(Dt.current=c)},[Dt]);zc(It&&_t&&z!=="none");const xs=w.useCallback((c,f)=>{const _=c.relatedTarget;let D;switch(f){case"user":D=Qe;break;case"slot":D=fe;break;case"search":D=ge;break;default:return}const V=D.current;V&&(!_||!V.contains(_))&&Nt("none")},[]),si=w.useCallback(()=>{Zt.current&&xe.current&&document.contains(xe.current)&&xe.current.focus(),xe.current=null,Zt.current=!1},[]);w.useEffect(()=>{const c=_=>{S&&z==="user"&&!_.target.closest(".pkt-header-service__user-container")&&Nt("none"),z==="slot"&&!_.target.closest(".pkt-header-service__slot-container")&&Nt("none"),z==="search"&&!_.target.closest(".pkt-header-service__search-container")&&!_.target.closest(".pkt-header-service__search-input")&&Nt("none")},f=_=>{_.key==="Escape"&&z!=="none"&&(_.preventDefault(),Zt.current=!0,Nt("none"))};if(z!=="none")return document.addEventListener("mousedown",c),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",f)};si()},[z,S,si]),w.useEffect(()=>{const c=()=>{if(zt){const f=window.pageYOffset||document.documentElement.scrollTop;if(f<0||Math.abs(f-rt)<60)return;Lt(f>rt),_e(f)}};return document&&window.addEventListener("scroll",c),()=>{document&&window.removeEventListener("scroll",c)}},[zt,rt]);const Ss=w.useCallback(c=>{const f=c==="slot"?fe:ge,_=c==="slot"?De:ts;if(!f.current||!_.current||!Xt||_t)return;const D=f.current.getBoundingClientRect(),V=_.current.offsetWidth,j=D.left+V>window.innerWidth;c==="slot"?re(j):_s(j)},[Xt,_t]),Cs=w.useCallback(c=>{z!=="none"?Nt("none"):(xe.current=document.activeElement,Nt(c))},[z]);w.useEffect(()=>{(z==="slot"||z==="search")&&requestAnimationFrame(()=>{Ss(z)})},[z,Ss]);const g=l.jsxs("header",{className:Z("pkt-header-service",n&&"pkt-header-service--compact",_t&&"pkt-header-service--mobile",Xt&&"pkt-header-service--tablet",It&&"pkt-header-service--fixed",zt&&"pkt-header-service--scroll-to-hide",ae&&"pkt-header-service--hidden",i),"data-mode":a,ref:cn,children:[l.jsxs("div",{className:Z("pkt-header-service__logo-area",(!M||M==="")&&"pkt-header-service__logo-area--without-service"),children:[!Tt&&l.jsx("span",{className:"pkt-header-service__logo",children:nt?l.jsx("a",{href:nt,"aria-label":"Tilbake til forside",children:l.jsx(W,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.5/logos/"})}):mt?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:mt,children:l.jsx(W,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.5/logos/"})}):l.jsx(W,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.5/logos/"})}),M&&l.jsx("span",{className:"pkt-header-service__service-name",children:x?l.jsx(Ni,{href:x,className:"pkt-header-service__service-link ",children:M}):T?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:T,children:M}):l.jsx("span",{className:"pkt-header-service__service-link",children:M})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:Z("pkt-header-service__slot-container",z==="slot"&&"is-open"),onBlur:c=>xs(c,"slot"),ref:fe,children:[Xt&&e&&l.jsx(pe,{skin:"secondary",variant:dt,iconName:"menu",size:_t?"small":"medium",state:z==="slot"?"active":"normal",onClick:()=>Cs("slot"),"aria-expanded":z==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:$e}),l.jsx("div",{className:Z("pkt-header-service__slot-content",we&&"align-right"),id:"mobile-slot-menu",role:Xt?"menu":void 0,"aria-label":Xt?"Meny":void 0,ref:De,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),p&&l.jsx(l.Fragment,{children:Xt?l.jsxs("div",{className:Z("pkt-header-service__search-container",z==="search"&&"is-open"),onBlur:c=>xs(c,"search"),ref:ge,children:[l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:_t?"small":"medium",onClick:()=>Cs("search"),state:z==="search"?"active":"normal","aria-expanded":z==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:Z("pkt-header-service__mobile-menu",z==="search"&&"is-open",ei&&"align-right"),ref:ts,children:z==="search"&&l.jsx(Mi,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:y,autoFocus:!0,fullwidth:!0,onChange:c=>v==null?void 0:v(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(m==null||m(c.target.value))}})})]}):l.jsx(Mi,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:y,onChange:c=>v==null?void 0:v(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(m==null||m(c.target.value))}})}),Xt&&h&&(r==="header"||r==="both")&&l.jsx(pe,{skin:"secondary",size:_t?"small":"medium",variant:"icon-only",iconName:"exit",onClick:h,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:c=>xs(c,"user"),ref:Qe,children:[l.jsxs(pe,{className:Z("pkt-header-service__user-button",_t&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:_t?"small":"medium",state:z==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:z==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Cs("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),z==="user"&&S&&l.jsx("div",{className:Z(_t?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(Fa,{user:S,formattedLastLoggedIn:Gt,representing:b,userMenu:B,canChangeRepresentation:et,changeRepresentation:Ct,logoutOnClick:r==="userMenu"||r==="both"?h:void 0})})]}),!_t&&h&&(r==="header"||r==="both")&&l.jsx(pe,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:h,children:"Logg ut"})]})]});return It?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[g,l.jsx("div",{className:Z("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",_t&&"pkt-header-service-spacer--mobile",Xt&&"pkt-header-service-spacer--tablet")})]}):g});rn.displayName="PktHeaderService";const Va=w.forwardRef((s,t)=>l.jsx(rn,{...s,ref:t}));Va.displayName="PktHeader";const Rc=Jt({tagName:"pkt-heading",elementClass:Me,react:w,displayName:"PktHeading"}),Ha=w.forwardRef(({children:s,...t},e)=>l.jsx(Rc,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Ha.displayName="PktHeading";const Kc=Jt({tagName:"pkt-helptext",elementClass:ve,react:w,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),ja=w.forwardRef(({children:s,...t},e)=>l.jsx(Kc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));ja.displayName="PktHelptext";const Ua=w.forwardRef(({label:s,id:t,children:e,...i},n)=>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:n}),e]}));Ua.displayName="PktInput";const za=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...d})=>{const p=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...d,href:i,className:Z(p,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(W,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:Z(m),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};za.displayName="PktLinkCard";const Yc=Jt({tagName:"pkt-loader",elementClass:ie,react:w,displayName:"PktLoader",events:{}}),qa=w.forwardRef(({children:s,...t},e)=>l.jsx(Yc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));qa.displayName="PktLoader";const Wa=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[d,p]=w.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":d},v=w.createRef(),y=w.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:Z(m,t),ref:v,children:[a&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(W,{name:"close",className:"pkt-link__icon"})})}),i&&l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};Wa.displayName="PktMessagebox";const Gc=Jt({tagName:"pkt-modal",elementClass:Ht,react:w,displayName:"PktModal",events:{}}),Ra=w.forwardRef(({children:s,...t},e)=>l.jsx(Gc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ra.displayName="PktModal";const Zc=Jt({tagName:"pkt-progressbar",elementClass:ct,react:w,displayName:"PktProgressbar",events:{}}),Ka=w.forwardRef(({children:s,...t},e)=>l.jsx(Zc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ka.displayName="PktProgressbar";const Ya=w.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:v,requiredTag:y,requiredText:$,tagText:b,...x},T)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),B=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),E=["pkt-input-check__input-label",a?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),R=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),et=()=>l.jsxs(l.Fragment,{children:[b&&l.jsx("span",{className:R+" pkt-tag--gray",children:b}),m&&l.jsx("span",{className:R+" pkt-tag--blue-light",children:v}),y&&l.jsx("span",{className:R+" pkt-tag--beige",children:$})]});return l.jsx("div",{className:M,children:l.jsxs("div",{className:S,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:B,...p!==void 0?{checked:p}:{defaultChecked:d},...x}),l.jsxs("label",{className:E,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});Ya.displayName="PktRadioButton";const Ga=w.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:n,name:a,placeholder:r="Søk…",suggestions:h,value:d="",action:p,method:m,onChange:v,onSearch:y,onSuggestionClick:$,...b},x)=>{const T=(E,R)=>{E?E():$&&$(R)},M=E=>{d=E.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let B;return p?B=E=>l.jsx("form",{role:"search",className:S,action:p,method:m,children:E}):B=E=>l.jsx("div",{role:"search",className:S,children:E}),B(l.jsxs(l.Fragment,{children:[n&&l.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),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:a||i,id:i,placeholder:r,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${i}-suggestions`,onChange:v||M,onKeyUp:y&&(E=>{E.key==="Enter"&&(E.preventDefault(),y(d))}),...b}),l.jsx(pe,{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:y&&(E=>{E.preventDefault(),y(d)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((E,R)=>l.jsx("li",{children:w.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:()=>T(E.onClick,R),onKeyUp:et=>et.key==="Enter"&&T(E.onClick,R)},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-${R}`))})]}))});Ga.displayName="PktSearchInput";const Za=w.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:y=!1,label:$,name:b,optionalTag:x=!1,optionalText:T,requiredTag:M=!1,requiredText:S,tagText:B,...E},R)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(Qs,{className:et,forId:`${m}-input`,label:$,helptext:h,helptextDropdown:d,helptextDropdownButton:p,optionalTag:x,optionalText:T,requiredTag:M,requiredText:S,tagText:B,hasError:r,errorMessage:a,disabled:n,inline:v,ariaDescribedby:s,children:l.jsx("select",{ref:R,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${m}-input`,name:b||m,...E,children:e})})});Za.displayName="PktSelect";const Xc=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)"}})}),Jc=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"})]}),Qc=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"})]}),td=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:Z("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:Z("pkt-step__indicator"),children:e==="current"?Jc:e==="completed"?Qc:Xc}),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})]})]}),Xa=w.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const d=Z(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=w.Children.map(e,(m,v)=>w.isValidElement(m)?w.cloneElement(m,{className:Z(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:p})});Xa.displayName="PktStepper";const ed=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:n,...a})=>l.jsx("table",{"data-testid":"pkt-table",className:Z(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",...a,children:n}),sd=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:Z(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),id=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:Z(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),nd=({className:s,children:t,...e})=>l.jsx("thead",{className:Z(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),ad=({className:s,children:t,...e})=>l.jsx("th",{className:Z(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),rd=({className:s,children:t,...e})=>l.jsx("tr",{className:Z(s,"pkt-table__row",{}),role:"row",...e,children:t}),on=w.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:d,type:p,"aria-description":m,...v},y)=>{const[$,b]=w.useState(!1),x=w.useCallback(()=>{b(!0),d&&d()},[b]),T=w.useRef(null),[M,S]=w.useState("");w.useEffect(()=>{var et,Ct;S(((Ct=(et=T.current)==null?void 0:et.textContent)==null?void 0:Ct.trim())??"")},[s]);const B=w.useMemo(()=>{if(n&&!h)return M&&`Klikk for å fjerne ${M}`||m},[n,h,M,m]),E={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},R={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,"pkt-btn--icons-right-and-left":n&&!!r,"pkt-hide":$};return n?l.jsxs("button",{...v,className:Z(R,a),type:p,onClick:x,"aria-label":h,"aria-description":B,ref:y,children:[r&&l.jsx(W,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(W,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...v,className:Z(E,a),ref:y,children:[r&&l.jsx(W,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});on.displayName="PktTag";const ln=w.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:d=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:y,selectTab:$}=od(),x={"aria-selected":m?!!t:void 0,"aria-controls":a,role:m?"tab":void 0,onKeyUp:M=>y(d,M),onClick:M=>{$(d),i==null||i(M)},tabIndex:t||!m?void 0:-1,ref:M=>{v(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(W,{name:n,className:"pkt-icon--small"}),s,r&&l.jsx(on,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...x,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:T}):l.jsx("button",{...x,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:T})});ln.displayName="PktTabItem";const Ja=w.createContext(null),od=()=>{const s=w.useContext(Ja);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Qa=w.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=w.useRef([]),h=s&&!t,p=n&&w.Children.count(n)>0?w.Children.count(n):(e==null?void 0:e.length)||0;w.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=b=>{const x=e==null?void 0:e[b];x!=null&&x.action&&x.action(b),i&&i(b)},v=(b,x)=>{var T,M;h&&(x.code==="ArrowLeft"&&b!==0&&((T=r.current[b-1])==null||T.focus()),x.code==="ArrowRight"&&b<p-1&&((M=r.current[b+1])==null||M.focus()),(x.code==="ArrowDown"||x.code==="Space")&&m(b))},y=(b,x)=>{r.current[b]=x},$=e==null?void 0:e.map((b,x)=>{var T,M;return l.jsx(ln,{active:b.active,href:b.href,onClick:()=>m(x),icon:b.icon,controls:b.controls,tag:(T=b.tag)==null?void 0:T.text,tagSkin:(M=b.tag)==null?void 0:M.skin,index:x,children:b.text},x)});return l.jsx(Ja.Provider,{value:{arrowNav:h,registerTabRef:y,handleKeyPress:v,selectTab:m},children:l.jsx("div",{className:"pkt-tabs",ref:a,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:n||$})})})});Qa.displayName="PktTabs";const tr=w.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,fullwidth:$=!1,label:b,name:x,optionalTag:T=!1,optionalText:M,requiredTag:S=!1,requiredText:B,tagText:E=null,placeholder:R,rows:et,useWrapper:Ct=!0,onChange:Tt,value:nt,autoComplete:mt="off",minLength:Ut,maxLength:Yt,readOnly:dt,skipForwardTestid:$e=!1,...Dt},It)=>{const zt=[a,"pkt-textinput","pkt-textarea"].join(" "),Gt=`${s}-input`,z=`${Gt}-label`,Nt=e||z,[ae,Lt]=w.useState(0),rt=_e=>{var we,re;i&&Lt(((re=(we=_e.currentTarget)==null?void 0:we.value)==null?void 0:re.length)||0),Tt&&Tt(_e)};return w.useEffect(()=>{nt!==void 0&&Lt((nt==null?void 0:nt.length)||0)},[nt]),l.jsx(Qs,{ariaDescribedby:t,className:zt,disabled:r,errorMessage:h,forId:Gt,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,label:b,optionalTag:T,optionalText:M,requiredTag:S,requiredText:B,tagText:E,useWrapper:Ct,counter:i,counterCurrent:ae,counterMaxLength:n,children:l.jsx("textarea",{ref:It,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${n&&ae>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:Gt,placeholder:R,disabled:r,rows:et,"aria-labelledby":Nt,"aria-invalid":d,"aria-errormessage":`${s}-error`,...Dt,onChange:rt,value:nt,autoComplete:mt,minLength:Ut,maxLength:Yt,readOnly:dt,"data-skip-forward-testid":$e?"true":void 0})})});tr.displayName="PktTextarea";var ys=window.CustomEvent;(!ys||typeof ys=="object")&&(ys=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ys.prototype=window.Event.prototype);function er(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function ld(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,n){return!(t[i]===void 0||t[i]===n)};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 ti(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 sr(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function hd(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function hn(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function ir(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 n=s.querySelectorAll("*"),a=0;a<n.length&&!(n[a].tagName&&n[a].shadowRoot&&(i=ir(n[a].shadowRoot),i));a++);return i}function nr(s){return s.isConnected||document.body.contains(s)}function ar(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=U.formSubmitter;if(!e){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;e=n.activeElement}return!e||e.form!==t?null:e}function cd(s){if(!s.defaultPrevented){var t=s.target,e=U.imagemapUseValue,i=ar(s);e===null&&i&&(e=i.value);var n=ti(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function rr(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),n,a=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,a)})}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))}rr.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&nr(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_),U.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=ir(this.dialog_)),sr(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(!nr(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!U.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");ld(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,U.needsCentering(this.dialog_)?(U.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 ys("close",{bubbles:!1,cancelable:!1});er(this.dialog_,t)}};var U={};if(U.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"},U.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 n=0;n<i.length;++n){var a=i[n],r=null;try{r=document.querySelectorAll(a.selectorText)}catch{}if(!(!r||!hd(r,s))){var h=a.style.getPropertyValue("top"),d=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},U.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:!U.isInlinePositionSetByStylesheet(s)},U.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 rr(s)},U.registerDialog=function(s){s.showModal||U.forceRegisterDialog(s)},U.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 n=0,a;a=i.removedNodes[n];++n){if(a instanceof Element)a.localName==="dialog"&&e.push(a);else continue;e=e.concat(a.querySelectorAll("dialog"))}}),e.length&&s(e)}))},U.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})},U.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},U.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 n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},U.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=ti(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},U.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(),sr(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,n=i.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},U.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new ys("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&er(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},U.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},U.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)},U.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())},U.dm=new U.DialogManager,U.formSubmitter=null,U.imagemapUseValue=null,window.HTMLDialogElement===void 0){var or=document.createElement("form");if(or.setAttribute("method","dialog"),or.method!=="dialog"){var $s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if($s){var dd=$s.get;$s.get=function(){return hn(this)?"dialog":dd.call(this)};var ud=$s.set;$s.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):ud.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",$s)}}document.addEventListener("click",function(s){if(U.formSubmitter=null,U.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!hn(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;U.imagemapUseValue=s.offsetX+","+s.offsetY}var n=ti(t);n&&(U.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=ti(t);if(!e){var i=ar(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var pd=HTMLFormElement.prototype.submit,fd=function(){if(!hn(this))return pd.call(this);var s=ti(this);s&&s.close()};HTMLFormElement.prototype.submit=fd}const gd=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=pn,P.PktAccordionItem=Ma,P.PktAlert=an,P.PktBackLink=Oa,P.PktBreadcrumbs=Pa,P.PktButton=pe,P.PktCard=Da,P.PktCheckbox=Ia,P.PktCombobox=La,P.PktConsent=Ti,P.PktDatepicker=Ba,P.PktFooter=Hc,P.PktFooterSimple=jc,P.PktHeader=Va,P.PktHeaderService=rn,P.PktHeading=Ha,P.PktHelptext=ja,P.PktIcon=W,P.PktInput=Ua,P.PktInputWrapper=Qs,P.PktLink=Ni,P.PktLinkCard=za,P.PktLoader=qa,P.PktMessagebox=Wa,P.PktModal=Ra,P.PktProgressbar=Ka,P.PktRadioButton=Ya,P.PktSearchInput=Ga,P.PktSelect=Za,P.PktStep=td,P.PktStepper=Xa,P.PktTabItem=ln,P.PktTable=ed,P.PktTableBody=sd,P.PktTableDataCell=id,P.PktTableHeader=nd,P.PktTableHeaderCell=ad,P.PktTableRow=rd,P.PktTabs=Qa,P.PktTag=on,P.PktTextarea=tr,P.PktTextinput=Mi,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
1693
|
+
*/var ya;function cd(){return ya||(ya=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(r=n(r,i(c)))}return r}function i(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var c in r)e.call(r,c)&&r[c]&&(a=n(a,c));return a}function n(r,a){return a?r?r+" "+a:r+a:r}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(Vn)),Vn.exports}var hd=cd();const re=ld(hd),jn=({children:s,closeAlert:e,compact:t,title:i,date:n,ariaLive:r,"aria-live":a="polite",role:c="status",skin:h="info",className:p,...v})=>{const[b,y]=g.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":t,[`pkt-alert--${h}`]:h,"pkt-hide":b},m={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},w=g.useCallback(()=>{y(!0),v.onClose&&v.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[v.onClose,y]),C=r||a;return l.jsx("div",{...v,"aria-live":C,role:c,className:re(k,p),children:l.jsxs("div",{className:re(m),children:[l.jsx(ee,{className:"pkt-alert__icon","aria-hidden":"true",name:h==="info"?"alert-information":`alert-${h}`}),e&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(Vt,{tabIndex:0,"aria-label":"close",size:t?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:w,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}),n&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};jn.displayName="PktAlert";const ka=Pt({tagName:"pkt-backlink",elementClass:Fs,react:g,displayName:"PktBackLink"});ka.displayName="PktBackLink";const $a=g.forwardRef(({breadcrumbs:s,navigationType:e,renderLink:t,className:i,...n},r)=>{const a=s,c=a[a.length-2],h=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=t||(e==="router"?({href:v,className:b,children:y,props:k})=>l.jsx(Mo.Link,{to:v,className:b,...k,children:y}):({href:v,className:b,children:y,props:k})=>l.jsx("a",{href:v,className:b,...k,children:y}));return l.jsxs("nav",{ref:r,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((v,b)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:b===a.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:v.text})}):p({href:v.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:l.jsxs(l.Fragment,{children:[l.jsx(ee,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:v.text})]}),props:n})},`breadcrumb-${b}`))}),p({href:c.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:l.jsxs(l.Fragment,{children:[l.jsx(ee,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]}),props:n})]})});$a.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.0/animations/";const Vt=g.forwardRef(({children:s,className:e,iconName:t="user",secondIconName:i="user",iconPath:n,secondIconPath:r,size:a="medium",fullWidth:c=!1,fullWidthOnMobile:h=!1,skin:p="primary",type:v="button",variant:b="label-only",state:y,color:k,isLoading:m=void 0,disabled:w=void 0,loadingAnimationPath:C=window.pktAnimationPath,...M},S)=>{const O=[e,"pkt-btn",a&&`pkt-btn--${a}`,c&&"pkt-btn--full",h&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,b&&`pkt-btn--${b}`,k&&`pkt-btn--${k}`,y&&`pkt-btn--${y}`,m&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...M,"aria-busy":m||void 0,"aria-disabled":w||void 0,disabled:w,className:O,type:v,ref:S,children:[m&&l.jsx(ee,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:C}),b!=="label-only"&&l.jsx(ee,{className:"pkt-btn__icon",name:t,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),b==="icons-right-and-left"&&l.jsx(ee,{className:"pkt-btn__icon",name:i,...r&&{path:r}})]})});Vt.displayName="PktButton";const wa=6048e5,ud=864e5,_a=Symbol.for("constructDateFrom");function jt(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&_a in s?s[_a](e):s instanceof Date?new s.constructor(e):new Date(e)}function ft(s,e){return jt(e||s,s)}function xa(s,e,t){const i=ft(s,t==null?void 0:t.in);return isNaN(e)?jt(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let dd={};function nn(){return dd}function Ti(s,e){var c,h,p,v;const t=nn(),i=(e==null?void 0:e.weekStartsOn)??((h=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((v=(p=t.locale)==null?void 0:p.options)==null?void 0:v.weekStartsOn)??0,n=ft(s,e==null?void 0:e.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function rn(s,e){return Ti(s,{...e,weekStartsOn:1})}function Sa(s,e){const t=ft(s,e==null?void 0:e.in),i=t.getFullYear(),n=jt(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=rn(n),a=jt(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=rn(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=c.getTime()?i:i-1}function Ca(s){const e=ft(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function Ta(s,...e){const t=jt.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Un(s,e){const t=ft(s,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function pd(s,e,t){const[i,n]=Ta(t==null?void 0:t.in,s,e),r=Un(i),a=Un(n),c=+r-Ca(r),h=+a-Ca(a);return Math.round((c-h)/ud)}function fd(s,e){const t=Sa(s,e),i=jt(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),rn(i)}function gd(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function md(s){return!(!gd(s)&&typeof s!="number"||isNaN(+ft(s)))}function vd(s,e){const t=ft(s,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function bd(s,e){const[t,i]=Ta(s,e.start,e.end);return{start:t,end:i}}function Ma(s,e){const{start:t,end:i}=bd(e==null?void 0:e.in,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let c=1;const h=[];for(;+a<=r;)h.push(jt(t,a)),a.setDate(a.getDate()+c),a.setHours(0,0,0,0);return n?h.reverse():h}function yd(s,e){const t=ft(s,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const kd={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"}},$d=(s,e,t)=>{let i;const n=kd[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Wn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const wd={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_d={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sd={date:Wn({formats:wd,defaultWidth:"full"}),time:Wn({formats:_d,defaultWidth:"full"}),dateTime:Wn({formats:xd,defaultWidth:"full"})},Cd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Td=(s,e,t,i)=>Cd[s];function Mi(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,c=t!=null&&t.width?String(t.width):a;n=s.formattingValues[c]||s.formattingValues[a]}else{const a=s.defaultWidth,c=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[c]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const Md={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Dd={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"]},Od={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"]},Ed={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"}},Pd={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"}},Ad={ordinalNumber:(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Mi({values:Md,defaultWidth:"wide"}),quarter:Mi({values:Nd,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Mi({values:Dd,defaultWidth:"wide"}),day:Mi({values:Od,defaultWidth:"wide"}),dayPeriod:Mi({values:Ed,defaultWidth:"wide",formattingValues:Pd,defaultFormattingWidth:"wide"})};function Ni(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],c=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],h=Array.isArray(c)?Ld(c,b=>b.test(a)):Id(c,b=>b.test(a));let p;p=s.valueCallback?s.valueCallback(h):h,p=t.valueCallback?t.valueCallback(p):p;const v=e.slice(a.length);return{value:p,rest:v}}}function Id(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Ld(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function Bd(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const c=e.slice(n.length);return{value:a,rest:c}}}const Fd=/^(\d+)(th|st|nd|rd)?/i,Hd=/\d+/i,Vd={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},jd={any:[/^b/i,/^(a|c)/i]},Ud={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wd={any:[/1/i,/2/i,/3/i,/4/i]},qd={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},zd={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]},Yd={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},Kd={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]},Rd={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},Gd={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}},Xd={ordinalNumber:Bd({matchPattern:Fd,parsePattern:Hd,valueCallback:s=>parseInt(s,10)}),era:Ni({matchPatterns:Vd,defaultMatchWidth:"wide",parsePatterns:jd,defaultParseWidth:"any"}),quarter:Ni({matchPatterns:Ud,defaultMatchWidth:"wide",parsePatterns:Wd,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Ni({matchPatterns:qd,defaultMatchWidth:"wide",parsePatterns:zd,defaultParseWidth:"any"}),day:Ni({matchPatterns:Yd,defaultMatchWidth:"wide",parsePatterns:Kd,defaultParseWidth:"any"}),dayPeriod:Ni({matchPatterns:Rd,defaultMatchWidth:"any",parsePatterns:Gd,defaultParseWidth:"any"})},Qd={code:"en-US",formatDistance:$d,formatLong:Sd,formatRelative:Td,localize:Ad,match:Xd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zd(s,e){const t=ft(s,e==null?void 0:e.in);return pd(t,yd(t))+1}function Jd(s,e){const t=ft(s,e==null?void 0:e.in),i=+rn(t)-+fd(t);return Math.round(i/wa)+1}function Na(s,e){var v,b,y,k;const t=ft(s,e==null?void 0:e.in),i=t.getFullYear(),n=nn(),r=(e==null?void 0:e.firstWeekContainsDate)??((b=(v=e==null?void 0:e.locale)==null?void 0:v.options)==null?void 0:b.firstWeekContainsDate)??n.firstWeekContainsDate??((k=(y=n.locale)==null?void 0:y.options)==null?void 0:k.firstWeekContainsDate)??1,a=jt((e==null?void 0:e.in)||s,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const c=Ti(a,e),h=jt((e==null?void 0:e.in)||s,0);h.setFullYear(i,0,r),h.setHours(0,0,0,0);const p=Ti(h,e);return+t>=+c?i+1:+t>=+p?i:i-1}function ep(s,e){var c,h,p,v;const t=nn(),i=(e==null?void 0:e.firstWeekContainsDate)??((h=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??t.firstWeekContainsDate??((v=(p=t.locale)==null?void 0:p.options)==null?void 0:v.firstWeekContainsDate)??1,n=Na(s,e),r=jt((e==null?void 0:e.in)||s,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),Ti(r,e)}function Da(s,e){const t=ft(s,e==null?void 0:e.in),i=+Ti(t,e)-+ep(t,e);return Math.round(i/wa)+1}function ue(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const os={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return ue(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):ue(t+1,2)},d(s,e){return ue(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return ue(s.getHours()%12||12,e.length)},H(s,e){return ue(s.getHours(),e.length)},m(s,e){return ue(s.getMinutes(),e.length)},s(s,e){return ue(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return ue(n,e.length)}},Xs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Oa={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return os.y(s,e)},Y:function(s,e,t,i){const n=Na(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return ue(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):ue(r,e.length)},R:function(s,e){const t=Sa(s);return ue(t,e.length)},u:function(s,e){const t=s.getFullYear();return ue(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return ue(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return ue(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return os.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return ue(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Da(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):ue(n,e.length)},I:function(s,e,t){const i=Jd(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):ue(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):os.d(s,e)},D:function(s,e,t){const i=Zd(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):ue(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return ue(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return ue(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return ue(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(s,e,t){const n=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(s,e,t){const i=s.getHours();let n;switch(i===12?n=Xs.noon:i===0?n=Xs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Xs.evening:i>=12?n=Xs.afternoon:i>=4?n=Xs.morning:n=Xs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return os.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):os.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):ue(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):ue(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):os.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):os.s(s,e)},S:function(s,e){return os.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Pa(i);case"XXXX":case"XX":return Ns(i);case"XXXXX":case"XXX":default:return Ns(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return Pa(i);case"xxxx":case"xx":return Ns(i);case"xxxxx":case"xxx":default:return Ns(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ea(i,":");case"OOOO":default:return"GMT"+Ns(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ea(i,":");case"zzzz":default:return"GMT"+Ns(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return ue(i,e.length)},T:function(s,e,t){return ue(+s,e.length)}};function Ea(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+ue(r,2)}function Pa(s,e){return s%60===0?(s>0?"-":"+")+ue(Math.abs(s)/60,2):Ns(s,e)}function Ns(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=ue(Math.trunc(i/60),2),r=ue(i%60,2);return t+n+e+r}const Aa=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ia=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},tp={p:Ia,P:(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return Aa(s,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",Aa(i,e)).replace("{{time}}",Ia(n,e))}},sp=/^D+$/,ip=/^Y+$/,np=["D","DD","YY","YYYY"];function rp(s){return sp.test(s)}function ap(s){return ip.test(s)}function op(s,e,t){const i=lp(s,e,t);if(console.warn(i),np.includes(s))throw new RangeError(i)}function lp(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const cp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,hp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,up=/^'([^]*?)'?$/,dp=/''/g,pp=/[a-zA-Z]/;function fp(s,e,t){var v,b,y,k;const i=nn(),n=i.locale??Qd,r=i.firstWeekContainsDate??((b=(v=i.locale)==null?void 0:v.options)==null?void 0:b.firstWeekContainsDate)??1,a=i.weekStartsOn??((k=(y=i.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,c=ft(s,t==null?void 0:t.in);if(!md(c))throw new RangeError("Invalid time value");let h=e.match(hp).map(m=>{const w=m[0];if(w==="p"||w==="P"){const C=tp[w];return C(m,n.formatLong)}return m}).join("").match(cp).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const w=m[0];if(w==="'")return{isToken:!1,value:gp(m)};if(Oa[w])return{isToken:!0,value:m};if(w.match(pp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:m}});n.localize.preprocessor&&(h=n.localize.preprocessor(c,h));const p={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return h.map(m=>{if(!m.isToken)return m.value;const w=m.value;(ap(w)||rp(w))&&op(w,e,String(s));const C=Oa[w[0]];return C(c,w,n.localize,p)}).join("")}function gp(s){const e=s.match(up);return e?e[1].replace(dp,"'"):s}function mp(s,e){const t=ft(s,e==null?void 0:e.in).getDay();return t===0?7:t}function vp(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const qn={},Di={};function Ds(s,e){try{const i=(qn[s]||(qn[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return i in Di?Di[i]:La(i,i.split(":"))}catch{if(s in Di)return Di[s];const t=s==null?void 0:s.match(bp);return t?La(s,t.slice(1)):NaN}}const bp=/([+-]\d\d):?(\d\d)?/;function La(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return Di[s]=t*60+i>0?t*60+i+n:t*60-i-n}class Ut extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ds(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Fa(this),zn(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ut(...t,e):new Ut(Date.now(),e)}withTimeZone(e){return new Ut(+this,e)}getTimezoneOffset(){const e=-Ds(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),zn(this),+this}[Symbol.for("constructDateFrom")](e){return new Ut(+new Date(e),this.timeZone)}}const Ba=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Ba.test(s))return;const e=s.replace(Ba,"$1UTC");Ut.prototype[e]&&(s.startsWith("get")?Ut.prototype[s]=function(){return this.internal[e]()}:(Ut.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),yp(this),+this},Ut.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),zn(this),+this}))});function zn(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Ds(s.timeZone,s)*60))}function yp(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 e=Ds(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,c=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&c&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const h=n-t;h&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+h);const p=new Date(+s);p.setUTCSeconds(0);const v=n>0?p.getSeconds():(p.getSeconds()-60)%60,b=Math.round(-(Ds(s.timeZone,s)*60))%60;(b||v)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+b+v));const y=Ds(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),w=-new Date(+s).getTimezoneOffset()-k,C=k!==t,M=w-h;if(C&&M){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+M);const S=Ds(s.timeZone,s),O=S>0?Math.floor(S):Math.ceil(S),T=k-O;T&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T))}}class ls extends Ut{static tz(e,...t){return t.length?new ls(...t,e):new ls(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${vp(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new ls(+this,e)}[Symbol.for("constructDateFrom")](e){return new ls(+new Date(e),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const kp=(s=window.pktTz)=>{const e=new ls(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function Wt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const Qe=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},Oi=s=>{if(!s)return null;const e=Wt(s);return isNaN(e.getTime())?null:e},$p=(s,e)=>{const t=Xt(s);return isNaN(t.getTime())?"":fp(t,e)},Xt=(s="",e)=>{const t=typeof s=="string"?Wt(s):s;return!t||isNaN(t.getTime())?new Date:e?e==="end"?vd(t):Un(t):t},Qs=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},Ei=s=>{let e;return typeof s=="number"?e=new ls(s,window.pktTz):e=new ls(s,window.pktTz),e.setHours(12,0,0,0),e};let Yn=null,Ha;const wp=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Yn||Ha!==e)&&(Yn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),Ha=e),Yn.format(s)},_p=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Xt(e):null,n=t?Xt(t):null;return!(i&&s<i||n&&s>n)},xp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=Qe(s);return e.includes(t)},Sp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},Va=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!_p(s,e,t)||i&&xp(s,i)||n&&Sp(s,n)),Cp=(s,e,t,i,n)=>s.filter(r=>{const a=Oi(r);return a&&Va(a,e,t,i,n)}),Tp=s=>s.slice().sort((e,t)=>{const i=Oi(e),n=Oi(t);return!i||!n?0:i.getTime()-n.getTime()}),Mp=(s,e)=>{const t=Oi(s),i=Oi(e);return!t||!i?!1:t<=i};function ja(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:Qe(i));return!Va(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function Np(s,e,t,i){return!!(ja(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function Dp(s,e,t){const i=Qs(s,e,0);return!(t&&Xt(t)>i)}function Op(s,e,t){const i=Qs(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Xt(t)<i)}function Ua(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>Wt(e))}function Wa(s,e){const t=Ma({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[Qe(r)]=a}return i}function qa(s,e,t,i){if(e.length!==1)return!0;const n=Ma({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(mp(n[r]).toString()))return!1}return!0}function Kn(s,e){const t=Qe(s);return e.includes(t)?e:[...e,t]}function Rn(s,e){const t=Qe(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function za(s,e,t){const i=Qe(s);return e.includes(i)?Rn(s,e):t>0&&e.length>=t?e:Kn(s,e)}function Ep(s,e,t){const i=Qe(s),n=Ua(e);if(e.includes(i))return e.indexOf(i)===0?[]:Rn(s,e);if(e.length>1)return[i];if(e.length===1){if(!qa(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return Kn(s,e)}const Pi=7,Pp=6;function Ap(s,e){const t=Qs(s,e,1),i=Qs(s,e+1,0),n=(t.getDay()+Pp)%Pi,r=i.getDate(),a=Math.ceil((r+n)/Pi),h=Qs(s,e,0).getDate(),p=Da(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:h,initialWeek:p}}function Ip(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function Lp(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}const Bp={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Pi,ArrowDown:Pi};function Fp(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Hp(s,e,t){let i=xa(s,e);if(!i)return null;let n=t(`button[data-date="${Qe(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=xa(i,e),n=t(`button[data-date="${Qe(i)}"]`),!n)return null;return i}function Vp(s){return Bp[s]??null}const jp={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"};function Up(s){const{selected:e,multiple:t=!1,maxMultiple:i=0,range:n=!1,earliest:r=null,latest:a=null,excludedates:c,excludeweekdays:h=[],weeknumbers:p=!1,withcontrols:v=!1,currentmonth:b,today:y,strings:k,onDateSelected:m,onClose:w,id:C,className:M}=s,S=g.useId(),O=C??S,T=g.useMemo(()=>({...jp,...k}),[k]),j=g.useMemo(()=>y?Wt(y):kp(),[y]),K=g.useMemo(()=>c?c.map(d=>typeof d=="string"?Wt(d):d):[],[c]),te=e!==void 0,[Ce,U]=g.useState([]),P=te?e:Ce,R=g.useMemo(()=>Ua(P),[P]),[Q,z]=g.useState(0),[Z,ie]=g.useState(0),[pe,ae]=g.useState({}),[me,W]=g.useState(null),[le,Te]=g.useState(null),ce=g.useRef(null),J=g.useRef([]),nt=g.useRef(0),Le=g.useRef(!1),Me=g.useRef(!1),rt=g.useMemo(()=>({earliest:r,latest:a,excludedates:K,excludeweekdays:h}),[r,a,K,h]);g.useEffect(()=>{let d=null;if(b!=null&&(b instanceof Date?d=Ei(b):typeof b=="string"&&(d=Wt(b))),!d||isNaN(d.getTime()))if(P.length>0&&P[0]!==""){const u=Wt(P[P.length-1]);d=isNaN(u.getTime())?Ei(j):u}else d=Ei(j);if((!d||isNaN(d.getTime()))&&(d=Ei(j)),a){const u=typeof a=="string"?Wt(a):a;!isNaN(u.getTime())&&d>u&&(d=u)}if(r){const u=typeof r=="string"?Wt(r):r;!isNaN(u.getTime())&&d<u&&(d=u)}z(d.getFullYear()),ie(d.getMonth()),Me.current=!0},[]),g.useEffect(()=>{if(Me.current&&!Le.current&&P.length>0&&P[0]!==""){const d=Wt(P[P.length-1]);isNaN(d.getTime())||(z(d.getFullYear()),ie(d.getMonth()))}},[P]),g.useEffect(()=>{n&&R.length===2?ae(Wa(R[0],R[1])):(!n||R.length<2)&&ae({})},[n,R]);const lt=g.useCallback(d=>{te||U(d),m==null||m(d)},[te,m]),ke=g.useCallback(()=>{w==null||w()},[w]),Ne=g.useCallback((d,u)=>{z(typeof d=="string"?parseInt(d):d),ie(typeof u=="string"?parseInt(u):u),nt.current=0,Te(null),J.current=[],Le.current=!0},[]),Ze=g.useCallback(()=>{const d=Z===0?11:Z-1,u=Z===0?Q-1:Q;Ne(u,d)},[Q,Z,Ne]),Je=g.useCallback(()=>{const d=Z===11?0:Z+1,u=Z===11?Q+1:Q;Ne(u,d)},[Q,Z,Ne]),gt=g.useCallback(d=>ja(d,rt),[rt]),ve=g.useCallback((d,u)=>Np(d,u,rt,{multiple:t,maxMultiple:i,selectedCount:P.length}),[rt,t,i,P.length]),$e=g.useCallback(()=>typeof P=="string"?P.split(","):P,[P]),We=g.useCallback(d=>{if(!n||R.length!==1||!qa(d,R,K,h)||R[0]>=d){W(null);return}W(d),ae(Wa(R[0],d))},[n,R,K,h]),De=g.useCallback(d=>{if(!d)return;let u;if(n)u=Ep(d,$e(),{excludedates:K,excludeweekdays:h}),te||U(u),u.length===2?(m==null||m(u),ke()):(u.length===1&&ae({}),m==null||m(u));else if(t)u=za(d,$e(),i),lt(u);else{const $=Qe(d);P.includes($)?u=[]:u=[$],lt(u),ke()}},[n,t,i,$e,P,K,h,te,lt,ke,m]),xe=g.useCallback(d=>{const u=Kn(d,$e());te||U(u),n&&u.length===2&&(m==null||m(u),ke())},[$e,te,n,m,ke]),at=g.useCallback(d=>{const u=Rn(d,$e());te||U(u)},[$e,te]),Qt=g.useCallback(d=>{const u=za(d,$e(),i);te||U(u)},[$e,i,te]),mt=g.useCallback(()=>{var x,I;const d=Qe(Ei(j)),u=(x=ce.current)==null?void 0:x.querySelector(`button[data-date="${d}"]`);if(u instanceof HTMLButtonElement){Te(d),u.focus();return}const $=J.current.find(H=>!H.isDisabled);if($){const H=(I=ce.current)==null?void 0:I.querySelector(`button[data-date="${$.currentDateISO}"]`);H instanceof HTMLButtonElement&&(Te($.currentDateISO),H.focus())}},[]),Ct=g.useCallback((d,u)=>{const $=d.target;if(Fp($))return;if(d.preventDefault(),!le){mt();return}const x=Xt(le),I=Hp(x,u,ce.current.querySelector.bind(ce.current));if(I){const H=ce.current.querySelector(`button[data-date="${Qe(I)}"]`);H instanceof HTMLButtonElement&&!H.dataset.disabled&&(Te(Qe(I)),H.focus())}},[le,mt]),qt=g.useCallback(d=>{if(d.key==="Escape"){d.preventDefault(),ke();return}const u=Vp(d.key);u!==null&&Ct(d.nativeEvent,u)},[ke,Ct]),vt=g.useCallback(d=>{ce.current&&!ce.current.contains(d.relatedTarget)&&!d.target.classList.contains("pkt-hide")&&ke()},[ke]);return{componentId:O,strings:T,todayDate:j,year:Q,month:Z,activeSelected:P,_selected:R,inRange:pe,rangeHovered:me,focusedDate:le,range:n,multiple:t,weeknumbers:p,withcontrols:v,earliest:r,latest:a,excludedates:K,excludeweekdays:h,className:M,dateConstraints:rt,calendarRef:ce,selectableDatesRef:J,tabIndexSetRef:nt,prevMonth:Ze,nextMonth:Je,changeMonth:Ne,handleDateSelect:De,addToSelected:xe,removeFromSelected:at,toggleSelectedDate:Qt,handleRangeHover:We,isExcluded:gt,isDayDisabled:ve,focusOnCurrentDate:mt,handleKeydown:qt,handleFocusOut:vt,close:ke,setFocusedDate:Te}}const Wp=({componentId:s,strings:e,year:t,month:i,earliest:n,latest:r,withcontrols:a,prevMonth:c,nextMonth:h,changeMonth:p})=>{const v=y=>{const k=y==="prev",m=k?Dp(t,i,n):Op(t,i,r),w=k?e.prevMonth:e.nextMonth,C=k?"chevron-thin-left":"chevron-thin-right",M=k?"pkt-calendar__prev-month":"pkt-calendar__next-month",S=k?c:h;return l.jsx("div",{children:l.jsxs("button",{type:"button","aria-label":w,onClick:()=>m&&S(),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),m&&S())},className:["pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",M,!m&&"pkt-invisible"].filter(Boolean).join(" "),"data-disabled":m?void 0:"disabled","aria-disabled":!m||void 0,tabIndex:m?0:-1,children:[l.jsx(ee,{className:"pkt-btn__icon",name:C}),l.jsx("span",{className:"pkt-btn__text",children:w})]})})},b=()=>a?l.jsxs("div",{className:"pkt-cal-month-picker",children:[l.jsx("label",{htmlFor:`${s}-monthnav`,className:"pkt-hide",children:e.month}),l.jsx("select",{"aria-label":e.month,className:"pkt-input pkt-input-compact",id:`${s}-monthnav`,value:i,onChange:y=>{y.stopPropagation(),p(t,parseInt(y.target.value))},children:e.months.map((y,k)=>l.jsx("option",{value:k,children:y},k))}),l.jsx("label",{htmlFor:`${s}-yearnav`,className:"pkt-hide",children:e.year}),l.jsx("input",{"aria-label":e.year,className:"pkt-input pkt-cal-input-year pkt-input-compact",id:`${s}-yearnav`,type:"number",size:4,placeholder:"0000",value:t,onChange:y=>{y.stopPropagation(),p(parseInt(y.target.value),i)}})]}):l.jsxs("div",{className:"pkt-txt-16-medium pkt-calendar__month-title","aria-live":"polite",children:[e.months[i]," ",t]});return l.jsxs("nav",{className:"pkt-cal-month-nav",children:[v("prev"),b(),v("next")]})};function qp(s,e,t){const i=Qs(t.year,t.month,s),n=Qe(i),r=n===Qe(e),a=t.activeSelected.includes(n),c=t.isDayDisabled(i,a);let h;return t.focusedDate?h=t.focusedDate===n&&!c?"0":"-1":!c&&t.tabIndexSetRef.current===0?(t.tabIndexSetRef.current=s,h="0"):h=t.tabIndexSetRef.current===s?"0":"-1",{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:c,ariaLabel:wp(i),tabindex:h}}function zp(s,e){const{currentDateISO:t,isToday:i,isSelected:n}=s,r=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],a=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return re({"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":e.inRange[t],"pkt-cal-excluded":e.isExcluded(s.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":e.rangeHovered!==null&&t===Qe(e.rangeHovered)})}function Yp(s,e){const{currentDateISO:t,isToday:i,isSelected:n,isDisabled:r}=s,a=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],c=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return re({"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":e.inRange[t],"pkt-calendar__date--in-range-hover":e.rangeHovered!==null&&t===Qe(e.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":c})}const Kp=({state:s})=>{const{strings:e,year:t,month:i,activeSelected:n,focusedDate:r,inRange:a,rangeHovered:c,range:h,multiple:p,weeknumbers:v,selectableDatesRef:b,tabIndexSetRef:y,handleDateSelect:k,handleRangeHover:m,isExcluded:w,isDayDisabled:C,setFocusedDate:M,todayDate:S}=s,O={year:t,month:i,activeSelected:n,focusedDate:r,tabIndexSetRef:y,isDayDisabled:C},T={range:h,activeSelected:n,rangeHovered:c,inRange:a,isExcluded:w},j=()=>{const U=[];v&&U.push(l.jsx("th",{children:l.jsx("div",{className:"pkt-calendar__week-number",children:e.week})},"week-header"));for(let P=0;P<e.daysShort.length;P++)U.push(l.jsx("th",{children:l.jsx("div",{className:"pkt-calendar__day-name","aria-label":e.days[P],children:e.daysShort[P]})},`day-${P}`));return l.jsx("tr",{className:"pkt-cal-week-row",children:U})},K=(U,P)=>{const R=qp(U,P,O),{currentDate:Q,currentDateISO:z,isSelected:Z,isDisabled:ie,ariaLabel:pe,tabindex:ae}=R;b.current.push({currentDateISO:z,isDisabled:ie,tabindex:ae});const me=zp(R,T),W=Yp(R,T);return l.jsx("td",{className:me,children:l.jsx("button",{type:"button","aria-pressed":Z?"true":"false",disabled:ie,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${W}`,onMouseOver:()=>h&&!w(Q)&&m(Q),onFocus:()=>{h&&!w(Q)&&m(Q),M(z)},"aria-label":pe,tabIndex:parseInt(ae),"data-disabled":ie?"disabled":void 0,"data-date":z,onKeyDown:le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),k(Q))},onClick:le=>{ie||(le.preventDefault(),k(Q))},children:l.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:U})})},z)},te=(U,P)=>l.jsx("td",{className:"pkt-cal-other",children:l.jsx("div",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only","data-disabled":"disabled",children:l.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:U})})},P),Ce=()=>{const U=S,P=Ap(t,i);b.current=[],y.current=0;let R=1,Q=P.initialWeek;const z=[];for(let Z=0;Z<P.numRows;Z++){const ie=[];v&&ie.push(l.jsx("td",{className:"pkt-cal-week",children:Q},`week-${Q}`)),Q++;for(let pe=0;pe<Pi;pe++){const ae=Ip(Z,pe,R,P);if(ae==="current-month")ie.push(K(R,U)),R++;else{const me=Lp(ae,pe,R,P);ie.push(te(me,`${ae}-${Z}-${pe}`)),ae==="next-month"&&R++}}z.push(l.jsx("tr",{className:"pkt-cal-week-row",role:"row",children:ie},`row-${Z}`))}return z};return l.jsxs("table",{className:"pkt-cal-days pkt-txt-12-medium pkt-calendar__body",role:"grid","aria-multiselectable":h||p||void 0,children:[l.jsx("thead",{children:j()}),l.jsx("tbody",{children:Ce()})]})},Gn=g.forwardRef((s,e)=>{const t=Up(s);return g.useImperativeHandle(e,()=>({handleDateSelect:t.handleDateSelect,addToSelected:t.addToSelected,removeFromSelected:t.removeFromSelected,toggleSelected:t.toggleSelectedDate,focusOnCurrentDate:t.focusOnCurrentDate,close:t.close}),[t.handleDateSelect,t.addToSelected,t.removeFromSelected,t.toggleSelectedDate,t.focusOnCurrentDate,t.close]),l.jsxs("div",{ref:t.calendarRef,className:["pkt-calendar",t.weeknumbers&&"pkt-cal-weeknumbers",t.className].filter(Boolean).join(" "),onBlur:t.handleFocusOut,onKeyDown:t.handleKeydown,children:[l.jsx(Wp,{componentId:t.componentId,strings:t.strings,year:t.year,month:t.month,earliest:t.earliest,latest:t.latest,withcontrols:t.withcontrols,prevMonth:t.prevMonth,nextMonth:t.nextMonth,changeMonth:t.changeMonth}),l.jsx(Kp,{state:t})]})});Gn.displayName="PktCalendar";const Rp=Pt({tagName:"pkt-card",elementClass:Ve,react:g,displayName:"PktCard",events:{}}),Ya=g.forwardRef(({children:s,...e},t)=>l.jsx(Rp,{...e,ref:t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ya.displayName="PktCard";const Ka=g.forwardRef(({id:s,hasTile:e=!1,disabled:t=!1,label:i,checkHelptext:n,hasError:r=!1,className:a,isSwitch:c=!1,hideLabel:h=!1,labelPosition:p="right",defaultChecked:v,checked:b,indeterminate:y,optionalTag:k,optionalText:m="Valgfritt",requiredTag:w,requiredText:C="Må fylles ut",tagText:M,...S},O)=>{const T=g.useRef(null);g.useEffect(()=>{T.current&&y!==void 0&&(T.current.indeterminate=y)},[y]),g.useEffect(()=>{typeof O=="function"?O(T.current):O&&(O.current=T.current)},[O]);const j=[a,"pkt-input-check"].filter(Boolean).join(" "),K=["pkt-input-check__input-label",t?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,h?"pkt-sr-only":""].filter(Boolean).join(" "),te=["pkt-input-check__input",e?"pkt-input-check__input--tile":"",t&&e?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Ce=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),U=()=>l.jsxs(l.Fragment,{children:[M&&l.jsx("span",{className:Ce+" pkt-tag--gray",children:M}),k&&l.jsx("span",{className:Ce+" pkt-tag--blue-light",children:m}),w&&l.jsx("span",{className:Ce+" pkt-tag--beige",children:C})]});return l.jsx("div",{className:j,children:l.jsxs("div",{className:te,children:[p==="left"&&l.jsxs("label",{className:K,htmlFor:s,children:[i," ",U(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:c?"switch":"checkbox",ref:T,className:`pkt-input-check__input-checkbox ${r?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:t,...b!==void 0?{checked:b}:{defaultChecked:v},...S}),p==="right"&&l.jsxs("label",{className:K,htmlFor:s,children:[i," ",U(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Ka.displayName="PktCheckbox";const Gp=Pt({tagName:"pkt-combobox",elementClass:Se,react:g,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Ra=g.forwardRef(({children:s,helptext:e,...t},i)=>l.jsxs(Gp,{...t,ref:i,children:[e&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:e}),s]}));Ra.displayName="PktCombobox";const an=Pt({tagName:"pkt-consent",elementClass:xt,react:g,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});an.displayName="PktConsent";const Zs=g.forwardRef(({forId:s,label:e,helptext:t,helptextDropdown:i,helptextDropdownButton:n,counter:r,counterCurrent:a=0,counterMaxLength:c,optionalTag:h=!1,optionalText:p="Valgfritt",requiredTag:v=!1,requiredText:b="Må fylles ut",tagText:y=null,hasError:k=!1,errorMessage:m,disabled:w=!1,inline:C=!1,ariaDescribedby:M,useWrapper:S=!0,children:O,className:T="",hasFieldset:j=!1,role:K="group",counterPosition:te="bottom"},Ce)=>{const[U,P]=g.useState(!1),R=M||(t?`${s}-helptext`:void 0),Q=!!r,z=Q&&te==="top",Z=Q&&te==="bottom",ie=()=>P(J=>!J),pe=["pkt-inputwrapper",T,k?"pkt-inputwrapper--error":"",w?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),ae=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),me=()=>Q?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[a,c?`/${c}`:""]}):null,W=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:ae+" pkt-tag--gray",children:y}),h&&l.jsx("span",{className:ae+" pkt-tag--blue-light",children:p}),v&&l.jsx("span",{className:ae+" pkt-tag--beige",children:b})]}),le=()=>{const J=l.jsxs(l.Fragment,{children:[e," ",W()]});return S?j?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:J}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":R,id:`${s}-label`,children:J}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":R,id:`${s}-label`,children:e})},Te=()=>!t&&!i?null:l.jsxs(l.Fragment,{children:[t&&S&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:t}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(Vt,{skin:"tertiary",size:"small",variant:"icon-right",iconName:U?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ie,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${U?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),ce=l.jsxs(l.Fragment,{children:[le(),Te(),z&&l.jsx(me,{}),O,Z&&l.jsx(me,{}),k&&m&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(jn,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:m})})]});return l.jsx("div",{className:pe,ref:Ce,role:K,children:j?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":R,children:ce}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:ce})})});Zs.displayName="PktInputWrapper";const Ga=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},Xp=()=>Ga()?"text":"date",Qp=s=>!s||s.length!==2?!0:Mp(s[0],s[1]),Zp=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),Jp=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),ef=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),tf=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,sf=(s,e,t=!1)=>{var c;if(!s||!e)return;const i=((c=e.parentElement)==null?void 0:c.getBoundingClientRect())||e.getBoundingClientRect(),n=t?i.height+30:i.height,r=s.getBoundingClientRect().height;let a=t?"calc(100% - 30px)":"100%";i&&i.top+r>window.innerHeight&&i.top-r>0&&(a=`calc(100% - ${n}px - ${r}px)`),s.style.top=a},on=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},nf=({open:s,multiple:e=!1,range:t=!1,weeknumbers:i=!1,withcontrols:n=!1,selected:r=[],earliest:a,latest:c,excludedates:h,excludeweekdays:p,maxMultiple:v,currentmonth:b,today:y,inputRef:k,hasCounter:m=!1,onDateSelected:w,onClose:C})=>{const M=g.useRef(null),S=g.useRef(!1);s&&(S.current=!0),g.useEffect(()=>{s&&sf(M.current,(k==null?void 0:k.current)??null,m)},[s,k,m]);const O=["pkt-calendar-popup",s?"show":"hide"].join(" "),T=s||S.current;return l.jsx("div",{ref:M,className:O,hidden:!s,"aria-hidden":!s,children:T&&l.jsx(Gn,{multiple:e,range:t,weeknumbers:i,withcontrols:n,selected:r,earliest:a,latest:c,excludedates:h,excludeweekdays:p,maxMultiple:v,currentmonth:b,today:y,onDateSelected:w,onClose:C})})},ln=g.forwardRef(({children:s,skin:e,textStyle:t,size:i,closeTag:n,className:r,iconName:a,ariaLabel:c,onClose:h,type:p,"aria-description":v,...b},y)=>{const[k,m]=g.useState(!1),w=g.useCallback(()=>{m(!0),h&&h()},[m]),C=g.useRef(null),[M,S]=g.useState("");g.useEffect(()=>{var K,te;S(((te=(K=C.current)==null?void 0:K.textContent)==null?void 0:te.trim())??"")},[s]);const O=g.useMemo(()=>{if(n&&!c)return M&&`Klikk for å fjerne ${M}`||v},[n,c,M,v]),T={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${t}`]:!!t},j={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,"pkt-btn--icons-right-and-left":n&&!!a,"pkt-hide":k};return n?l.jsxs("button",{...b,className:re(j,r),type:p,onClick:w,"aria-label":c,"aria-description":O,ref:y,children:[a&&l.jsx(ee,{className:"pkt-tag__icon",name:a}),l.jsx("span",{ref:C,children:s}),l.jsx(ee,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...b,className:re(T,r),ref:y,children:[a&&l.jsx(ee,{className:"pkt-tag__icon",name:a,"aria-hidden":"true"}),l.jsx("span",{ref:C,children:s})]})});ln.displayName="PktTag";const rf=({dates:s,dateformat:e,idBase:t,strings:i,onDateRemoved:n})=>{var c;const r=Tp(s),a=((c=i==null?void 0:i.calendar)==null?void 0:c.buttonAltText)??"Slett dato";return l.jsx("div",{className:"pkt-date-tags pkt-datepicker__tags","aria-live":"polite",children:r.map(h=>{const p=$p(h,e);return l.jsx(ln,{id:`${t}${h}-tag`,closeTag:!0,ariaLabel:`${a} ${p}`,onClose:()=>n(h),children:l.jsx("time",{dateTime:h,children:p})},h)})})},af=({state:s})=>{var rt,lt,ke,Ne;const{id:e,inputId:t,values:i,dateformat:n,multiple:r,range:a,showRangeLabels:c,disabled:h,readOnly:p,required:v,label:b,name:y,placeholder:k,hasError:m,helptext:w,minStr:C,maxStr:M,inputType:S,isIOSDevice:O,strings:T,inputClasses:j,buttonClasses:K,rangeLabelClasses:te,datepickerInputsClasses:Ce,isInputDisabled:U,inputRef:P,inputRefTo:R,btnRef:Q,toggleCalendar:z,handleFocus:Z,handleSingleInputChange:ie,handleRangeFromChange:pe,handleRangeToChange:ae,handleRangeBlur:me,handleMultipleBlur:W,handleTagRemoved:le,handleSingleKeydown:Te,handleRangeFromKeydown:ce,handleRangeToKeydown:J,handleMultipleKeydown:nt,restProps:Le}=s,Me=()=>{var Ze,Je;return l.jsxs("button",{ref:Q,className:K,type:"button",onClick:z,disabled:h,"aria-label":((Ze=T.calendar)==null?void 0:Ze.buttonAltText)??"Åpne kalender",children:[l.jsx(ee,{name:"calendar"}),l.jsx("span",{className:"pkt-btn__text",children:((Je=T.calendar)==null?void 0:Je.buttonAltText)??"Åpne kalender"})]})};return r?l.jsxs(l.Fragment,{children:[l.jsx(rf,{dates:i,dateformat:n,idBase:e,strings:T,onDateRemoved:le}),l.jsx("div",{className:"pkt-datepicker__inputs",children:l.jsxs("div",{className:"pkt-input__container",children:[l.jsx("input",{...Le,ref:P,className:j,type:S,id:t,name:y??e,placeholder:k,readOnly:p||O&&!p,disabled:U,"aria-describedby":w?`${e}-helptext`:void 0,"aria-invalid":m,"aria-errormessage":m?`${e}-error`:void 0,onClick:z,onKeyDown:nt,onFocus:Z,onBlur:W}),Me()]})})]}):a?l.jsx("div",{className:Ce,children:l.jsxs("div",{className:"pkt-input__container",children:[c&&l.jsx("div",{className:"pkt-input-prefix",children:((rt=T.generic)==null?void 0:rt.from)??"Fra"}),l.jsx("input",{...Le,ref:P,className:j,type:S,id:t,name:y?`${y}-from`:`${e}-from`,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||O&&!p,disabled:h,required:v,"aria-label":`${b} ${((lt=T.generic)==null?void 0:lt.from)??"Fra"}`,"aria-describedby":w?`${e}-helptext`:void 0,"aria-invalid":m,"aria-errormessage":m?`${e}-error`:void 0,onClick:z,onKeyDown:ce,onFocus:Z,onBlur:me,onChange:pe}),l.jsx("div",{className:te,id:`${e}-to-label`,children:((ke=T.generic)==null?void 0:ke.to)??"Til"}),!c&&l.jsx("div",{className:"pkt-input-separator",children:"–"}),l.jsx("input",{ref:R,className:j,type:S,id:`${e}-to`,name:y?`${y}-to`:`${e}-to`,value:i[1]??"",min:C,max:M,readOnly:p||O&&!p,disabled:h,"aria-label":`${b} ${((Ne=T.generic)==null?void 0:Ne.to)??"Til"}`,"aria-invalid":m,onClick:z,onKeyDown:J,onFocus:Z,onBlur:me,onChange:ae}),Me()]})}):l.jsx("div",{className:"pkt-datepicker__inputs",children:l.jsxs("div",{className:"pkt-input__container",children:[l.jsx("input",{...Le,ref:P,className:j,type:S,id:t,name:y??e,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||O&&!p,disabled:h,required:v,"aria-describedby":w?`${e}-helptext`:void 0,"aria-invalid":m,"aria-errormessage":m?`${e}-error`:void 0,onClick:z,onKeyDown:Te,onFocus:Z,onBlur:void 0,onChange:ie}),Me()]})})},of={calendar:{buttonAltText:"Åpne kalender"}},lf={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}},Xa=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[];function cf(s,e){const{id:t,label:i,value:n,defaultValue:r,dateformat:a="dd.MM.yyyy",multiple:c=!1,maxlength:h,range:p=!1,showRangeLabels:v=!1,weeknumbers:b=!1,withcontrols:y=!1,excludedates:k,excludeweekdays:m,currentmonth:w,today:C,calendarOpen:M,timezone:S,fullwidth:O=!1,hasFieldset:T=!1,inline:j=!1,helptext:K,helptextDropdown:te,helptextDropdownButton:Ce,hasError:U=!1,errorMessage:P,optionalTag:R=!1,optionalText:Q,requiredTag:z=!1,requiredText:Z,tagText:ie,useWrapper:pe=!0,strings:ae,disabled:me=!1,readOnly:W=!1,required:le=!1,name:Te,min:ce,max:J,placeholder:nt,onChange:Le,onValueChange:Me,className:rt,...lt}=s,ke=g.useCallback(E=>E===void 0?[]:Xa(E),[]),Ne=n!==void 0,Ze=typeof r=="number"?void 0:r,[Je,gt]=g.useState(()=>ke(n??Ze)),ve=Ne?ke(n):Je;g.useEffect(()=>{Ne&>(ke(n))},[n,Ne,ke]);const[$e,We]=g.useState(M??!1);g.useEffect(()=>{M!==void 0&&We(M)},[M]);const De=g.useRef(null),xe=g.useRef(null),at=g.useRef(null),Qt=g.useRef(null),mt=g.useMemo(()=>Xp(),[]),Ct=g.useMemo(()=>Ga(),[]),qt=g.useMemo(()=>ae??(p?lf:of),[ae,p]),vt=typeof ce=="string"?ce:ce!==void 0?String(ce):void 0,d=typeof J=="string"?J:J!==void 0?String(J):void 0,u=g.useMemo(()=>{const E=Zp(O,v,c,p,W,mt);return Object.entries(E).filter(([,D])=>D).map(([D])=>D).join(" ")},[O,v,c,p,W,mt]),$=g.useMemo(()=>{const E=Jp();return Object.entries(E).filter(([,D])=>D).map(([D])=>D).join(" ")},[]),x=g.useMemo(()=>{const E=ef(v);return Object.entries(E).filter(([,D])=>D).map(([D])=>D).join(" ")},[v]),I=g.useMemo(()=>["pkt-datepicker__inputs",p&&v&&"pkt-input__range-inputs"].filter(Boolean).join(" "),[p,v]),H=g.useMemo(()=>{if(w)return w;if(d)return d.slice(0,7)},[w,d]),G=me||c&&h!=null&&ve.length>=h,ct=c&&h!=null,qe=`${t}-input`,et=ve.join(",");g.useEffect(()=>{S&&typeof window<"u"&&S!==window.pktTz&&(window.pktTz=S)},[S]);const Be=g.useCallback((E,D=!0)=>{Ne||gt(E),D&&(Me==null||Me(E))},[Ne,Me]),Ke=g.useCallback(E=>{if(Le){const D=new Event("change",{bubbles:!0});Object.defineProperty(D,"target",{value:{value:E.join(","),name:Te},writable:!1}),Le(D)}},[Le,Te]),Zt=g.useCallback(()=>{me||We(E=>!E)},[me]),cs=g.useCallback(()=>{We(!1)},[]);g.useEffect(()=>{if(!$e)return;const E=ze=>{var wt;const Ae=ze.target;Qt.current&&!Qt.current.contains(Ae)&&!((wt=Ae.closest)!=null&&wt.call(Ae,".pkt-calendar-popup"))&&cs()},D=ze=>{var Ae;ze.key==="Escape"&&(cs(),(Ae=De.current)==null||Ae.focus())};return document.addEventListener("click",E,!0),document.addEventListener("keydown",D),()=>{document.removeEventListener("click",E,!0),document.removeEventListener("keydown",D)}},[$e,cs]);const Vf=g.useCallback(()=>{Ct&&!$e&&We(!0)},[Ct,$e]),jf=g.useCallback(E=>{var wt;const D=tf(E,c,p),ze=Xa(D),Ae=!p||ze.length===2;Be(ze,Ae),Ae&&Ke(ze),!c&&!p&&(cs(),(wt=De.current)==null||wt.focus())},[c,p,Be,Ke,cs]),Uf=g.useCallback(()=>{var E;cs(),(E=De.current)==null||E.focus()},[cs]),Wf=g.useCallback(E=>{const D=E.target.value,ze=D?[D]:[];Be(ze),Ke(ze)},[Be,Ke]),qf=g.useCallback(E=>{const D=E.target.value,ze=ve[1]??"",Ae=[D,ze].filter(Boolean),wt=Ae.length===2;Be(Ae,wt),wt&&Ke(Ae)},[ve,Be,Ke]),zf=g.useCallback(E=>{const D=ve[0]??"",ze=E.target.value,Ae=[D,ze].filter(Boolean),wt=Ae.length===2;Be(Ae,wt),wt&&Ke(Ae)},[ve,Be,Ke]),Yf=g.useCallback(()=>{ve.length===2&&!Qp(ve)&&(Be([ve[0]]),Ke([ve[0]]))},[ve,Be,Ke]),dn=g.useCallback(E=>{const D=Xt(E),ze=vt?Xt(vt):null,Ae=d?Xt(d):null;if(D&&!isNaN(D.getTime())&&(!ze||D>=ze)&&(!Ae||D<=Ae)){const wt=Cp([...ve,E],vt,d,k,m),So=[...new Set(wt)];Be(So),Ke(So)}},[ve,vt,d,k,m,Be,Ke]),Kf=g.useCallback(E=>{const D=E.target;D.value&&(dn(D.value.split(",")[0]),D.value="")},[dn]),_o=g.useCallback(E=>{const D=E.target;D.value&&(dn(D.value.split(",")[0]),D.value="")},[dn]),Rf=g.useCallback(E=>{const D=ve.filter(ze=>ze!==E);Be(D),Ke(D)},[ve,Be,Ke]),hs=g.useCallback(E=>{const D=E==null?void 0:E.closest("form");D?D.requestSubmit():E==null||E.blur()},[]),Gf=g.useCallback(E=>{on(E.nativeEvent,()=>Zt(),()=>hs(De.current),void 0,()=>{var D;return(D=De.current)==null?void 0:D.blur()})},[Zt,hs]),Xf=g.useCallback(E=>{on(E.nativeEvent,()=>Zt(),()=>hs(De.current),()=>{var D;return(D=xe.current)==null?void 0:D.focus()},()=>{var D;return(D=De.current)==null?void 0:D.blur()})},[Zt,hs]),Qf=g.useCallback(E=>{on(E.nativeEvent,()=>Zt(),()=>hs(xe.current),void 0,()=>{var D;return(D=xe.current)==null?void 0:D.blur()})},[Zt,hs]),Zf=g.useCallback(E=>{on(E.nativeEvent,()=>Zt(),()=>hs(De.current),void 0,()=>{var D;return(D=De.current)==null?void 0:D.blur()},_o)},[Zt,hs,_o]),xo=g.useRef(et);return xo.current=et,g.useImperativeHandle(e,()=>({get value(){return xo.current},set value(E){const D=E?E.split(",").filter(Boolean):[];gt(D)},focus(){var E;(E=De.current)==null||E.focus()},blur(){var E;(E=De.current)==null||E.blur()}}),[]),{id:t,inputId:qe,label:i,values:ve,formValue:et,calendarOpen:$e,dateformat:a,multiple:c,maxlength:h,range:p,showRangeLabels:v,weeknumbers:b,withcontrols:y,excludedates:k,excludeweekdays:m,disabled:me,readOnly:W,required:le,name:Te,placeholder:nt,fullwidth:O,hasFieldset:T,inline:j,helptext:K,helptextDropdown:te,helptextDropdownButton:Ce,hasError:U,errorMessage:P,optionalTag:R,optionalText:Q,requiredTag:z,requiredText:Z,tagText:ie,useWrapper:pe,className:rt,minStr:vt,maxStr:d,effectiveCurrentMonth:H,today:C,inputType:mt,isIOSDevice:Ct,strings:qt,inputClasses:u,buttonClasses:$,rangeLabelClasses:x,datepickerInputsClasses:I,isInputDisabled:G,hasCounter:ct,inputRef:De,inputRefTo:xe,btnRef:at,wrapperRef:Qt,toggleCalendar:Zt,hideCalendar:cs,handleDateSelected:jf,handleCalendarClose:Uf,handleFocus:Vf,handleSingleInputChange:Wf,handleRangeFromChange:qf,handleRangeToChange:zf,handleRangeBlur:Yf,handleMultipleBlur:Kf,handleTagRemoved:Rf,handleSingleKeydown:Gf,handleRangeFromKeydown:Xf,handleRangeToKeydown:Qf,handleMultipleKeydown:Zf,restProps:lt}}const Qa=g.forwardRef((s,e)=>{const t=cf(s,e),i=["pkt-datepicker",t.className].filter(Boolean).join(" ");return l.jsxs("div",{className:i,children:[l.jsx(Zs,{ref:t.wrapperRef,forId:t.inputId,label:t.label,hasFieldset:t.hasFieldset,inline:t.inline,helptext:t.helptext,helptextDropdown:t.helptextDropdown,helptextDropdownButton:t.helptextDropdownButton,hasError:t.hasError,errorMessage:t.errorMessage,disabled:t.disabled,optionalTag:t.optionalTag,optionalText:t.optionalText,requiredTag:t.requiredTag,requiredText:t.requiredText,tagText:t.tagText,useWrapper:t.useWrapper,counter:t.hasCounter,counterCurrent:t.values.length,counterMaxLength:t.maxlength,children:l.jsx(af,{state:t})}),l.jsx(nf,{open:t.calendarOpen,multiple:t.multiple,range:t.range,weeknumbers:t.weeknumbers,withcontrols:t.withcontrols,selected:t.values,earliest:t.minStr,latest:t.maxStr,excludedates:t.excludedates,excludeweekdays:t.excludeweekdays,maxMultiple:t.maxlength,currentmonth:t.effectiveCurrentMonth,today:t.today,inputRef:t.inputRef,hasCounter:t.hasCounter,onDateSelected:t.handleDateSelected,onClose:t.handleCalendarClose}),t.name&&l.jsx("input",{type:"hidden",name:t.name,value:t.formValue})]})});Qa.displayName="PktDatepicker";const hf=({columnOne:s,columnTwo:e,socialLinks:t,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:c=!1,hotjarId:h=null,googleAnalyticsId:p=null,devMode:v=!1,cookieDomain:b=null,cookieSecure:y=null,cookieExpiryDays:k=null,onToggleConsent:m=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((S,O)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${O}`))]})]}),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:e.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&l.jsx("li",{className:"pkt-footer__text",children:e.text}),(M=e.links)==null?void 0:M.map((S,O)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${O}`))]})]}),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:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(ee,{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:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),c&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(an,{triggerType:"footerlink",hotjarId:h,googleAnalyticsId:p,devMode:v,cookieDomain:b,cookieSecure:y,cookieExpiryDays:k,onToggleConsent:m})})]})]})]}),t&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:t.filter(S=>S.language).map((S,O)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${O}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:t.filter(S=>S.iconName).map((S,O)=>l.jsx(g.Fragment,{children:l.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(ee,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${O}`))})]})]})})},uf=({links:s=[],openLinksInNewTab:e=!1,personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:r=null,googleAnalyticsId:a=null,devMode:c=!1,cookieDomain:h=null,cookieSecure:p=null,cookieExpiryDays:v=null,onToggleConsent:b=k=>{console.log(k.detail)},className:y})=>{const k=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:k,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((m,w)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${m.external?" pkt-link--external":""}`,href:m.href,target:m.openInNewTab||e?"_blank":"_self",rel:m.openInNewTab||e?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),m.text]})},w)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:t,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[l.jsx(ee,{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:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(an,{triggerType:"footerlink",hotjarId:r,googleAnalyticsId:a,devMode:c,cookieDomain:h,cookieSecure:p,cookieExpiryDays:v,onToggleConsent:b})})]})})})},df=(s,e)=>{const t=()=>typeof window>"u"?0:window.innerWidth,[i,n]=g.useState(t);return g.useEffect(()=>{const r=s.current;if(!r)return;if(n(r.offsetWidth),typeof ResizeObserver>"u"){const c=()=>{r&&n(r.offsetWidth)};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)}const a=new ResizeObserver(c=>{for(const h of c)h.borderBoxSize&&h.borderBoxSize.length>0?n(h.borderBoxSize[0].inlineSize):n(h.contentRect.width)});return a.observe(r),()=>{a.disconnect()}},[s]),i};function pf(s){const e=g.useRef(0);g.useEffect(()=>{const t=document.body,i=document.documentElement;if(s){e.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(t.style.paddingRight=`${n}px`),t.style.position="fixed",t.style.top=`-${e.current}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",i.classList.add("is-scroll-locked")}else t.style.removeProperty("position"),t.style.removeProperty("top"),t.style.removeProperty("left"),t.style.removeProperty("right"),t.style.removeProperty("width"),t.style.removeProperty("overflow"),t.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current});return()=>{s&&(t.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current}))}},[s])}const cn=({href:s,iconName:e,className:t,iconPosition:i,external:n,target:r,children:a,...c})=>{const h={"pkt-link":!0,"pkt-link--icon-left":!!e&&i==="left"||!!(e&&!i),"pkt-link--icon-right":!!e&&i==="right","pkt-link--external":n};return l.jsxs("a",{...c,className:re(h,t),href:s,target:r,rel:n?"noopener noreferrer":void 0,children:[e&&l.jsx(ee,{name:e,className:"pkt-link__icon"}),a]})};cn.displayName="PktLink";const ff=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},hn=({item:s,className:e})=>"href"in s?l.jsx(cn,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:re("pkt-user-menu__link",e),children:s.title}):l.jsxs("button",{className:re("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",e),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&l.jsx(ee,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),gf=({links:s})=>l.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((e,t)=>l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(hn,{item:e})},t))}),Za=g.forwardRef(({user:s,formattedLastLoggedIn:e,representing:t,userMenu:i,canChangeRepresentation:n,changeRepresentation:r,logoutOnClick:a},c)=>{const h=i==null?void 0:i.map(ff);return l.jsx("nav",{className:"pkt-user-menu",ref:c,"aria-label":"Meny for innlogget bruker",children:l.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),e&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:e})]})]}),h&&h.length>0&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(gf,{links:h})}),t&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:t.name}),t.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",t.orgNumber]}),n&&r&&l.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(hn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})]}),!t&&n&&r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx("ul",{className:"pkt-user-menu__sublist",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(hn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})}),a&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(hn,{item:{title:"Logg ut",iconName:"exit",onClick:a}})})]})})});Za.displayName="PktHeaderUserMenu";const un=g.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,autocomplete:i="off",counter:n,counterMaxLength:r,className:a,disabled:c=!1,errorMessage:h,hasError:p=!1,helptext:v,helptextDropdown:b,helptextDropdownButton:y,iconNameRight:k,inline:m=!1,fullwidth:w=!1,label:C,name:M,optionalTag:S=!1,optionalText:O,requiredTag:T=!1,requiredText:j,tagText:K=null,placeholder:te,prefix:Ce,suffix:U,type:P="text",useWrapper:R=!0,omitSearchIcon:Q=!1,value:z,minLength:Z,maxLength:ie,min:pe,max:ae,step:me,size:W,readonly:le,required:Te,dataTestid:ce,onChange:J,skipForwardTestid:nt=!1,...Le},Me)=>{const rt=[a,"pkt-textinput"].join(" "),lt=P==="search"&&!k&&!Q,ke=P==="date"&&z?z.slice(0,10):z,[Ne,Ze]=g.useState((z==null?void 0:z.length)||0),Je=`${s}`,gt=`${Je}-label`,ve=t||gt,$e=We=>{var De,xe;n&&Ze(((xe=(De=We.currentTarget)==null?void 0:De.value)==null?void 0:xe.length)||0),J&&J(We)};return g.useEffect(()=>{z!==void 0&&Ze((z==null?void 0:z.length)||0)},[z]),l.jsx(Zs,{ariaDescribedby:e,className:rt,disabled:c,errorMessage:h,forId:Je,hasError:p,helptext:v,helptextDropdown:b,helptextDropdownButton:y,inline:m,label:C,optionalTag:S,optionalText:O,requiredTag:T,requiredText:j,tagText:K,useWrapper:R,counter:n,counterCurrent:Ne,counterMaxLength:r,children:l.jsxs("div",{className:"pkt-input__container","data-testid":ce,"data-skip-forward-testid":nt?"true":void 0,children:[Ce&&l.jsx("div",{className:"pkt-input-prefix",children:Ce}),l.jsx("input",{...Le,ref:Me,className:`pkt-input ${w?"pkt-input--fullwidth":""} ${r&&Ne>r?"pkt-input--counter-error":""}`,type:P,name:`${M||s}`,value:ke,id:Je,placeholder:te,autoComplete:i,disabled:c,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":ve,min:pe,max:ae,onChange:$e,step:me,minLength:Z,maxLength:ie,size:W,readOnly:le,required:Te}),U&&l.jsxs("p",{className:"pkt-input-suffix",children:[U,k&&l.jsx(ee,{className:"pkt-input-suffix-icon",name:k}),lt&&l.jsx(ee,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!U&&k&&l.jsx(ee,{className:"pkt-input-icon",name:k}),!U&<&&l.jsx(ee,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});un.displayName="PktTextinput";const Xn=g.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:e=1280,children:t,className:i,compact:n=!1,"data-mode":r,logOutButtonPlacement:a="none",logOut:c,openedMenu:h,showSearch:p=!1,onSearch:v,onSearchChange:b,searchValue:y,searchPlaceholder:k="Søk",representing:m,serviceLink:w,serviceClick:C,serviceName:M,user:S,userMenu:O,userMenuFooter:T,userOptions:j,canChangeRepresentation:K=!1,changeRepresentation:te,hideLogo:Ce=!1,logoLink:U,logoClick:P,position:R="fixed",scrollBehavior:Q="hide",slotMenuVariant:z="icon-only",slotMenuText:Z="Meny"},ie)=>{const pe=R==="fixed",ae=Q==="hide";g.useEffect(()=>{T&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[T]),g.useEffect(()=>{j&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[j]),g.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),m!=null&&m.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,m==null?void 0:m.shortname]);const me=g.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[W,le]=g.useState(h||"none"),[Te,ce]=g.useState(!1),[J,nt]=g.useState(0),[Le,Me]=g.useState(!1),[rt,lt]=g.useState(!1),ke=g.useRef(null),Ne=g.useRef(null),Ze=g.useRef(null),Je=g.useRef(null),gt=g.useRef(null),ve=g.useRef(null),$e=g.useRef(null),We=g.useRef(!1),De=df(ke),xe=De<s,at=De<e,Qt=g.useCallback(u=>{ke.current=u,typeof ie=="function"?ie(u):ie&&(ie.current=u)},[ie]);pf(pe&&xe&&W!=="none");const mt=g.useCallback((u,$)=>{const x=u.relatedTarget;let I;switch($){case"user":I=Ne;break;case"slot":I=Ze;break;case"search":I=Je;break;default:return}const H=I.current;H&&(!x||!H.contains(x))&&le("none")},[]),Ct=g.useCallback(()=>{We.current&&$e.current&&document.contains($e.current)&&$e.current.focus(),$e.current=null,We.current=!1},[]);g.useEffect(()=>{const u=x=>{S&&W==="user"&&!x.target.closest(".pkt-header-service__user-container")&&le("none"),W==="slot"&&!x.target.closest(".pkt-header-service__slot-container")&&le("none"),W==="search"&&!x.target.closest(".pkt-header-service__search-container")&&!x.target.closest(".pkt-header-service__search-input")&&le("none")},$=x=>{x.key==="Escape"&&W!=="none"&&(x.preventDefault(),We.current=!0,le("none"))};if(W!=="none")return document.addEventListener("mousedown",u),document.addEventListener("keydown",$),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",$)};Ct()},[W,S,Ct]),g.useEffect(()=>{const u=()=>{if(ae){const $=window.pageYOffset||document.documentElement.scrollTop;if($<0||Math.abs($-J)<60)return;ce($>J),nt($)}};return document&&window.addEventListener("scroll",u),()=>{document&&window.removeEventListener("scroll",u)}},[ae,J]);const qt=g.useCallback(u=>{const $=u==="slot"?Ze:Je,x=u==="slot"?gt:ve;if(!$.current||!x.current||!at||xe)return;const I=$.current.getBoundingClientRect(),H=x.current.offsetWidth,G=I.left+H>window.innerWidth;u==="slot"?Me(G):lt(G)},[at,xe]),vt=g.useCallback(u=>{W!=="none"?le("none"):($e.current=document.activeElement,le(u))},[W]);g.useEffect(()=>{(W==="slot"||W==="search")&&requestAnimationFrame(()=>{qt(W)})},[W,qt]);const d=l.jsxs("header",{className:re("pkt-header-service",n&&"pkt-header-service--compact",xe&&"pkt-header-service--mobile",at&&"pkt-header-service--tablet",pe&&"pkt-header-service--fixed",ae&&"pkt-header-service--scroll-to-hide",Te&&"pkt-header-service--hidden",i),"data-mode":r,ref:Qt,children:[l.jsxs("div",{className:re("pkt-header-service__logo-area",(!M||M==="")&&"pkt-header-service__logo-area--without-service"),children:[!Ce&&l.jsx("span",{className:"pkt-header-service__logo",children:U?l.jsx("a",{href:U,"aria-label":"Tilbake til forside",children:l.jsx(ee,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.0/logos/"})}):P?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:P,children:l.jsx(ee,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.0/logos/"})}):l.jsx(ee,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.0/logos/"})}),M&&l.jsx("span",{className:"pkt-header-service__service-name",children:w?l.jsx(cn,{href:w,className:"pkt-header-service__service-link ",children:M}):C?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:C,children:M}):l.jsx("span",{className:"pkt-header-service__service-link",children:M})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:re("pkt-header-service__slot-container",W==="slot"&&"is-open"),onBlur:u=>mt(u,"slot"),ref:Ze,children:[at&&t&&l.jsx(Vt,{skin:"secondary",variant:z,iconName:"menu",size:xe?"small":"medium",state:W==="slot"?"active":"normal",onClick:()=>vt("slot"),"aria-expanded":W==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:Z}),l.jsx("div",{className:re("pkt-header-service__slot-content",Le&&"align-right"),id:"mobile-slot-menu",role:at?"menu":void 0,"aria-label":at?"Meny":void 0,ref:gt,children:l.jsx("div",{className:"pkt-contents",children:t})})]}),p&&l.jsx(l.Fragment,{children:at?l.jsxs("div",{className:re("pkt-header-service__search-container",W==="search"&&"is-open"),onBlur:u=>mt(u,"search"),ref:Je,children:[l.jsx(Vt,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:xe?"small":"medium",onClick:()=>vt("search"),state:W==="search"?"active":"normal","aria-expanded":W==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:re("pkt-header-service__mobile-menu",W==="search"&&"is-open",rt&&"align-right"),ref:ve,children:W==="search"&&l.jsx(un,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,autoFocus:!0,fullwidth:!0,onChange:u=>b==null?void 0:b(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(v==null||v(u.target.value))}})})]}):l.jsx(un,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,onChange:u=>b==null?void 0:b(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(v==null||v(u.target.value))}})}),at&&c&&(a==="header"||a==="both")&&l.jsx(Vt,{skin:"secondary",size:xe?"small":"medium",variant:"icon-only",iconName:"exit",onClick:c,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:u=>mt(u,"user"),ref:Ne,children:[l.jsxs(Vt,{className:re("pkt-header-service__user-button",xe&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:xe?"small":"medium",state:W==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:W==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>vt("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(m==null?void 0:m.name)||S.name]}),W==="user"&&S&&l.jsx("div",{className:re(xe?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(Za,{user:S,formattedLastLoggedIn:me,representing:m,userMenu:O,canChangeRepresentation:K,changeRepresentation:te,logoutOnClick:a==="userMenu"||a==="both"?c:void 0})})]}),!xe&&c&&(a==="header"||a==="both")&&l.jsx(Vt,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:c,children:"Logg ut"})]})]});return pe?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[d,l.jsx("div",{className:re("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",xe&&"pkt-header-service-spacer--mobile",at&&"pkt-header-service-spacer--tablet")})]}):d});Xn.displayName="PktHeaderService";const Ja=g.forwardRef((s,e)=>l.jsx(Xn,{...s,ref:e}));Ja.displayName="PktHeader";const mf=Pt({tagName:"pkt-heading",elementClass:is,react:g,displayName:"PktHeading"}),eo=g.forwardRef(({children:s,...e},t)=>l.jsx(mf,{"data-testid":"pkt-heading",...e,ref:t,children:s}));eo.displayName="PktHeading";const vf=Pt({tagName:"pkt-helptext",elementClass:Yt,react:g,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),to=g.forwardRef(({children:s,...e},t)=>l.jsx(vf,{...e,ref:t,children:l.jsx("div",{className:"pkt-contents",children:s})}));to.displayName="PktHelptext";const so=g.forwardRef(({label:s,id:e,children:t,...i},n)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:e,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:e,...i,ref:n}),t]}));so.displayName="PktInput";const io=({children:s,skin:e,title:t,href:i,iconName:n,openInNewTab:r,external:a,className:c,...h})=>{const p=["pkt-linkcard",e&&`pkt-linkcard--${e}`].filter(Boolean).join(" "),v=["pkt-linkcard__title",a&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...h,href:i,className:re(p,c),target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,children:[n&&l.jsx(ee,{className:"pkt-link__icon",name:n}),t&&l.jsx("div",{className:re(v),children:t}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};io.displayName="PktLinkCard";const bf=Pt({tagName:"pkt-loader",elementClass:Ot,react:g,displayName:"PktLoader",events:{}}),no=g.forwardRef(({children:s,...e},t)=>l.jsx(bf,{...e,ref:t,children:l.jsx("div",{className:"pkt-contents",children:s})}));no.displayName="PktLoader";const ro=({children:s,className:e,skin:t,title:i,compact:n,closable:r,onClose:a,...c})=>{const[h,p]=g.useState(!1),v={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${t}`]:t,"pkt-messagebox--closable":r,"pkt-hide":h},b=g.createRef(),y=g.useCallback(()=>{p(!0),a&&a()},[p,a]);return l.jsxs("div",{...c,className:re(v,e),ref:b,children:[r&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(ee,{name:"close",className:"pkt-link__icon"})})}),i&&l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};ro.displayName="PktMessagebox";const yf=Pt({tagName:"pkt-modal",elementClass:kt,react:g,displayName:"PktModal",events:{}}),ao=g.forwardRef(({children:s,...e},t)=>l.jsx(yf,{...e,ref:t,children:l.jsx("div",{className:"pkt-contents",children:s})}));ao.displayName="PktModal";const kf=Pt({tagName:"pkt-progressbar",elementClass:Pe,react:g,displayName:"PktProgressbar",events:{}}),oo=g.forwardRef(({children:s,...e},t)=>l.jsx(kf,{ref:t,...e,children:l.jsx("div",{className:"pkt-contents",children:s})}));oo.displayName="PktProgressbar";const lo=g.forwardRef(({id:s,name:e,label:t,className:i,hasTile:n=!1,disabled:r=!1,checkHelptext:a,hasError:c=!1,defaultChecked:h,checked:p,optionalTag:v,optionalText:b,requiredTag:y,requiredText:k,tagText:m,...w},C)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",r&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),O=["pkt-input-check__input-checkbox",c?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),T=["pkt-input-check__input-label",r?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),j=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),K=()=>l.jsxs(l.Fragment,{children:[m&&l.jsx("span",{className:j+" pkt-tag--gray",children:m}),v&&l.jsx("span",{className:j+" pkt-tag--blue-light",children:b}),y&&l.jsx("span",{className:j+" pkt-tag--beige",children:k})]});return l.jsx("div",{className:M,children:l.jsxs("div",{className:S,children:[l.jsx("input",{ref:C,id:s,type:"radio",name:e,disabled:r,className:O,...p!==void 0?{checked:p}:{defaultChecked:h},...w}),l.jsxs("label",{className:T,htmlFor:s,children:[t," ",K(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});lo.displayName="PktRadioButton";const co=g.forwardRef(({appearance:s="local",disabled:e=!1,fullwidth:t=!1,id:i,label:n,name:r,placeholder:a="Søk…",suggestions:c,value:h="",action:p,method:v,onChange:b,onSearch:y,onSuggestionClick:k,...m},w)=>{const C=(T,j)=>{T?T():k&&k(j)},M=T=>{h=T.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${t?"pkt-searchinput--fullwidth":""}`;let O;return p?O=T=>l.jsx("form",{role:"search",className:S,action:p,method:v,children:T}):O=T=>l.jsx("div",{role:"search",className:S,children:T}),O(l.jsxs(l.Fragment,{children:[n&&l.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),l.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${t?"pkt-input--fullwidth":""}`,type:"search",name:r||i,id:i,placeholder:a,defaultValue:h,disabled:e,autoComplete:"off","aria-autocomplete":"list",ref:w,"aria-controls":`${i}-suggestions`,onChange:b||M,onKeyUp:y&&(T=>{T.key==="Enter"&&(T.preventDefault(),y(h))}),...m}),l.jsx(Vt,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:e,onClick:y&&(T=>{T.preventDefault(),y(h)}),children:n||a})]}),c&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:c.map((T,j)=>l.jsx("li",{children:g.createElement(T.href?"a":T.onClick?"button":"div",{href:T.href,className:`pkt-searchinput__suggestion ${T.onClick?"pkt-link-button":""} ${T.href||T.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:T.onClick?"button":void 0,onClick:()=>C(T.onClick,j),onKeyUp:K=>K.key==="Enter"&&C(T.onClick,j)},l.jsxs(l.Fragment,{children:[T.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:T.title}),T.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:T.text})]}))},`search-suggestion-${j}`))})]}))});co.displayName="PktSearchInput";const ho=g.forwardRef(({ariaDescribedby:s,ariaLabelledby:e,children:t,className:i,disabled:n=!1,errorMessage:r,hasError:a,helptext:c,helptextDropdown:h,helptextDropdownButton:p,id:v,inline:b=!1,fullwidth:y=!1,label:k,name:m,optionalTag:w=!1,optionalText:C,requiredTag:M=!1,requiredText:S,tagText:O,...T},j)=>{const K=[i,"pkt-select"].join(" ");return l.jsx(Zs,{className:K,forId:`${v}-input`,label:k,helptext:c,helptextDropdown:h,helptextDropdownButton:p,optionalTag:w,optionalText:C,requiredTag:M,requiredText:S,tagText:O,hasError:a,errorMessage:r,disabled:n,inline:b,ariaDescribedby:s,children:l.jsx("select",{ref:j,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":a,"aria-errormessage":`${v}-error`,"aria-labelledby":e||void 0,disabled:n,id:`${v}-input`,name:m||v,...T,children:t})})});ho.displayName="PktSelect";const $f=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)"}})}),wf=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"})]}),_f=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"})]}),xf=({children:s,className:e,status:t="incomplete",title:i})=>l.jsxs("li",{className:re("pkt-step",e,`pkt-step--${t}`),"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:re("pkt-step__indicator"),children:t==="current"?wf:t==="completed"?_f:$f}),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})]})]}),uo=g.forwardRef(({activeStep:s,className:e,children:t,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:r="vertical",...a},c)=>{const h=re(e,"pkt-stepper",r==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=g.Children.map(t,(v,b)=>g.isValidElement(v)?g.cloneElement(v,{className:re(v.props.className,{"pkt-step--hideStep":i&&b!==s,"pkt-step--hideContent":n&&b!==s})}):v);return l.jsx("ol",{"data-testid":"pkt-stepper",className:h,ref:c,...a,children:p})});uo.displayName="PktStepper";const Sf=({className:s,compact:e=!1,skin:t="basic",responsiveView:i=!0,children:n,...r})=>l.jsx("table",{"data-testid":"pkt-table",className:re(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":e,"pkt-table--basic":t==="basic","pkt-table--zebra-blue":t==="zebra-blue"}),role:"table",...r,children:n}),Cf=({id:s,children:e,className:t,...i})=>l.jsx("tbody",{id:s,className:re(t,"pkt-table__body",{}),...i,role:"rowgroup",children:e}),Tf=({children:s,className:e,dataLabel:t,...i})=>l.jsx("td",{className:re(e,"pkt-table__data-cell",{}),"data-label":t,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Mf=({className:s,children:e,...t})=>l.jsx("thead",{className:re(s,"pkt-table__header",{}),role:"rowgroup",...t,children:e}),Nf=({className:s,children:e,...t})=>l.jsx("th",{className:re(s,"pkt-table__header-cell",{}),role:"columnheader",...t,children:e}),Df=({className:s,children:e,...t})=>l.jsx("tr",{className:re(s,"pkt-table__row",{}),role:"row",...t,children:e}),Qn=g.forwardRef(({children:s,active:e,href:t,onClick:i,icon:n,controls:r,tag:a,tagSkin:c,index:h=0},p)=>{const{arrowNav:v,registerTabRef:b,handleKeyPress:y,selectTab:k}=Of(),w={"aria-selected":v?!!e:void 0,"aria-controls":r,role:v?"tab":void 0,onKeyUp:M=>y(h,M),onClick:M=>{k(h),i==null||i(M)},tabIndex:e||!v?void 0:-1,ref:M=>{b(h,M),typeof p=="function"?p(M):p&&(p.current=M)}},C=l.jsxs(l.Fragment,{children:[n&&l.jsx(ee,{name:n,className:"pkt-icon--small"}),s,a&&l.jsx(ln,{skin:c,size:"small",children:a})]});return t?l.jsx("a",{...w,href:t,className:`pkt-tabs__link ${e?"active":""}`,children:C}):l.jsx("button",{...w,type:"button",className:`pkt-tabs__button pkt-link-button ${e?"active":""}`,children:C})});Qn.displayName="PktTabItem";const po=g.createContext(null),Of=()=>{const s=g.useContext(po);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},fo=g.forwardRef(({arrowNav:s=!0,disableArrowNav:e=!1,tabs:t,onTabSelected:i,children:n},r)=>{const a=g.useRef([]),c=s&&!e,p=n&&g.Children.count(n)>0?g.Children.count(n):(t==null?void 0:t.length)||0;g.useEffect(()=>{a.current=a.current.slice(0,p)},[p]);const v=m=>{const w=t==null?void 0:t[m];w!=null&&w.action&&w.action(m),i&&i(m)},b=(m,w)=>{var C,M;c&&(w.code==="ArrowLeft"&&m!==0&&((C=a.current[m-1])==null||C.focus()),w.code==="ArrowRight"&&m<p-1&&((M=a.current[m+1])==null||M.focus()),(w.code==="ArrowDown"||w.code==="Space")&&v(m))},y=(m,w)=>{a.current[m]=w},k=t==null?void 0:t.map((m,w)=>{var C,M;return l.jsx(Qn,{active:m.active,href:m.href,onClick:()=>v(w),icon:m.icon,controls:m.controls,tag:(C=m.tag)==null?void 0:C.text,tagSkin:(M=m.tag)==null?void 0:M.skin,index:w,children:m.text},w)});return l.jsx(po.Provider,{value:{arrowNav:c,registerTabRef:y,handleKeyPress:b,selectTab:v},children:l.jsx("div",{className:"pkt-tabs",ref:r,children:l.jsx("div",{className:"pkt-tabs__list",role:c?"tablist":"navigation",children:n||k})})})});fo.displayName="PktTabs";const go=g.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,counter:i,counterMaxLength:n,className:r,disabled:a,errorMessage:c,hasError:h,helptext:p,helptextDropdown:v,helptextDropdownButton:b,inline:y,fullwidth:k=!1,label:m,name:w,optionalTag:C=!1,optionalText:M,requiredTag:S=!1,requiredText:O,tagText:T=null,placeholder:j,rows:K,useWrapper:te=!0,onChange:Ce,value:U,autoComplete:P="off",minLength:R,maxLength:Q,readOnly:z,skipForwardTestid:Z=!1,...ie},pe)=>{const ae=[r,"pkt-textinput","pkt-textarea"].join(" "),me=`${s}-input`,W=`${me}-label`,le=t||W,[Te,ce]=g.useState(0),J=nt=>{var Le,Me;i&&ce(((Me=(Le=nt.currentTarget)==null?void 0:Le.value)==null?void 0:Me.length)||0),Ce&&Ce(nt)};return g.useEffect(()=>{U!==void 0&&ce((U==null?void 0:U.length)||0)},[U]),l.jsx(Zs,{ariaDescribedby:e,className:ae,disabled:a,errorMessage:c,forId:me,hasError:h,helptext:p,helptextDropdown:v,helptextDropdownButton:b,inline:y,label:m,optionalTag:C,optionalText:M,requiredTag:S,requiredText:O,tagText:T,useWrapper:te,counter:i,counterCurrent:Te,counterMaxLength:n,children:l.jsx("textarea",{ref:pe,className:`pkt-input ${k?"pkt-input--fullwidth":""} ${n&&Te>n?"pkt-input--counter-error":""}`,name:`${w||s}`,id:me,placeholder:j,disabled:a,rows:K,"aria-labelledby":le,"aria-invalid":h,"aria-errormessage":`${s}-error`,...ie,onChange:J,value:U,autoComplete:P,minLength:R,maxLength:Q,readOnly:z,"data-skip-forward-testid":Z?"true":void 0})})});go.displayName="PktTextarea";var Js=window.CustomEvent;(!Js||typeof Js=="object")&&(Js=function(s,e){e=e||{};var t=document.createEvent("CustomEvent");return t.initCustomEvent(s,!!e.bubbles,!!e.cancelable,e.detail||null),t},Js.prototype=window.Event.prototype);function mo(s,e){var t="on"+e.type.toLowerCase();return typeof s[t]=="function"&&s[t](e),s.dispatchEvent(e)}function Ef(s){for(;s&&s!==document.body;){var e=window.getComputedStyle(s),t=function(i,n){return!(e[i]===void 0||e[i]===n)};if(e.opacity<1||t("zIndex","auto")||t("transform","none")||t("mixBlendMode","normal")||t("filter","none")||t("perspective","none")||e.isolation==="isolate"||e.position==="fixed"||e.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function Ai(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 vo(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Pf(s,e){for(var t=0;t<s.length;++t)if(s[t]===e)return!0;return!1}function Zn(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function bo(s){var e=["button","input","keygen","select","textarea"],t=e.map(function(a){return a+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),r=0;r<n.length&&!(n[r].tagName&&n[r].shadowRoot&&(i=bo(n[r].shadowRoot),i));r++);return i}function yo(s){return s.isConnected||document.body.contains(s)}function ko(s){if(s.submitter)return s.submitter;var e=s.target;if(!(e instanceof HTMLFormElement))return null;var t=se.formSubmitter;if(!t){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;t=n.activeElement}return!t||t.form!==e?null:t}function Af(s){if(!s.defaultPrevented){var e=s.target,t=se.imagemapUseValue,i=ko(s);t===null&&i&&(t=i.value);var n=Ai(e);if(n){var r=i&&i.getAttribute("formmethod")||e.getAttribute("method");r==="dialog"&&(s.preventDefault(),t!=null?n.close(t):n.close())}}}function $o(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",Af,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var e=new MutationObserver(this.maybeHideModal.bind(this));e.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var t=!1,i=(function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}).bind(this),n,r=function(a){if(a.target===s){var c="DOMNodeRemoved";t|=a.type.substr(0,c.length)===c,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(a){s.addEventListener(a,r)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}$o.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&yo(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_),se.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var e=document.createElement("div");this.dialog_.insertBefore(e,this.dialog_.firstChild),e.tabIndex=-1,e.focus(),this.dialog_.removeChild(e)}var t=document.createEvent("MouseEvents");t.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(t),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=bo(this.dialog_)),vo(document.activeElement),s&&s.focus()},updateZIndex:function(s,e){if(s<e)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=e},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!yo(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!se.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Ef(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,se.needsCentering(this.dialog_)?(se.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var e=new Js("close",{bubbles:!1,cancelable:!1});mo(this.dialog_,e)}};var se={};if(se.reposition=function(s){var e=document.body.scrollTop||document.documentElement.scrollTop,t=e+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(e,t)+"px"},se.isInlinePositionSetByStylesheet=function(s){for(var e=0;e<document.styleSheets.length;++e){var t=document.styleSheets[e],i=null;try{i=t.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var r=i[n],a=null;try{a=document.querySelectorAll(r.selectorText)}catch{}if(!(!a||!Pf(a,s))){var c=r.style.getPropertyValue("top"),h=r.style.getPropertyValue("bottom");if(c&&c!=="auto"||h&&h!=="auto")return!0}}}return!1},se.needsCentering=function(s){var e=window.getComputedStyle(s);return e.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!se.isInlinePositionSetByStylesheet(s)},se.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 $o(s)},se.registerDialog=function(s){s.showModal||se.forceRegisterDialog(s)},se.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(e){this.forwardTab_=void 0,e.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(e){var t=[];e.forEach(function(i){for(var n=0,r;r=i.removedNodes[n];++n){if(r instanceof Element)r.localName==="dialog"&&t.push(r);else continue;t=t.concat(r.querySelectorAll("dialog"))}}),t.length&&s(t)}))},se.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})},se.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},se.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,e=0,t;t=this.pendingDialogStack[e];++e)t.updateZIndex(--s,--s),e===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},se.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Ai(s);){for(var e=0,t;t=this.pendingDialogStack[e];++e)if(t.dialog===s)return e===0;s=s.parentElement}return!1},se.DialogManager.prototype.handleFocus_=function(s){var e=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(e)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),vo(e),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],i=t.dialog,n=i.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e!==document.documentElement&&document.documentElement.focus()),!1}},se.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var e=new Js("cancel",{bubbles:!1,cancelable:!0}),t=this.pendingDialogStack[0];t&&mo(t.dialog,e)&&t.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},se.DialogManager.prototype.checkDOM_=function(s){var e=this.pendingDialogStack.slice();e.forEach(function(t){s.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},se.DialogManager.prototype.pushDialog=function(s){var e=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=e?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},se.DialogManager.prototype.removeDialog=function(s){var e=this.pendingDialogStack.indexOf(s);e!==-1&&(this.pendingDialogStack.splice(e,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},se.dm=new se.DialogManager,se.formSubmitter=null,se.imagemapUseValue=null,window.HTMLDialogElement===void 0){var wo=document.createElement("form");if(wo.setAttribute("method","dialog"),wo.method!=="dialog"){var ei=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(ei){var If=ei.get;ei.get=function(){return Zn(this)?"dialog":If.call(this)};var Lf=ei.set;ei.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Lf.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",ei)}}document.addEventListener("click",function(s){if(se.formSubmitter=null,se.imagemapUseValue=null,!s.defaultPrevented){var e=s.target;if("composedPath"in s){var t=s.composedPath();e=t.shift()||e}if(!(!e||!Zn(e.form))){var i=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!i){if(!(e.localName==="input"&&e.type==="image"))return;se.imagemapUseValue=s.offsetX+","+s.offsetY}var n=Ai(e);n&&(se.formSubmitter=e)}}},!1),document.addEventListener("submit",function(s){var e=s.target,t=Ai(e);if(!t){var i=ko(s),n=i&&i.getAttribute("formmethod")||e.getAttribute("method");n==="dialog"&&s.preventDefault()}});var Bf=HTMLFormElement.prototype.submit,Ff=function(){if(!Zn(this))return Bf.call(this);var s=Ai(this);s&&s.close()};HTMLFormElement.prototype.submit=Ff}const Hf=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));F.PktAccordion=er,F.PktAccordionItem=ba,F.PktAlert=jn,F.PktBackLink=ka,F.PktBreadcrumbs=$a,F.PktButton=Vt,F.PktCalendar=Gn,F.PktCard=Ya,F.PktCheckbox=Ka,F.PktCombobox=Ra,F.PktConsent=an,F.PktDatepicker=Qa,F.PktFooter=hf,F.PktFooterSimple=uf,F.PktHeader=Ja,F.PktHeaderService=Xn,F.PktHeading=eo,F.PktHelptext=to,F.PktIcon=ee,F.PktInput=so,F.PktInputWrapper=Zs,F.PktLink=cn,F.PktLinkCard=io,F.PktLoader=no,F.PktMessagebox=ro,F.PktModal=ao,F.PktProgressbar=oo,F.PktRadioButton=lo,F.PktSearchInput=co,F.PktSelect=ho,F.PktStep=xf,F.PktStepper=uo,F.PktTabItem=Qn,F.PktTable=Sf,F.PktTableBody=Cf,F.PktTableDataCell=Tf,F.PktTableHeader=Mf,F.PktTableHeaderCell=Nf,F.PktTableRow=Df,F.PktTabs=fo,F.PktTag=ln,F.PktTextarea=go,F.PktTextinput=un,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})}));
|