@oslokommune/punkt-react 14.0.2 → 14.0.4
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/dist/punkt-react.es.js +3338 -3144
- package/dist/punkt-react.umd.js +385 -428
- package/package.json +5 -5
package/dist/punkt-react.umd.js
CHANGED
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
return [];
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
(function(P,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):(P=typeof globalThis<"u"?globalThis:P||self,l(P["punkt-react"]={},P.ReactJsxRuntime,P.React,P.ReactRouterDOM))})(this,(function(P,l,_,
|
|
36
|
+
(function(P,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):(P=typeof globalThis<"u"?globalThis:P||self,l(P["punkt-react"]={},P.ReactJsxRuntime,P.React,P.ReactRouterDOM))})(this,(function(P,l,_,dn){"use strict";const un=_.createContext({}),tr=()=>_.useContext(un),pn=_.forwardRef(({compact:s=!1,skin:t="borderless",ariaLabelledBy:e,children:i,name:n,className:a},r)=>{const h=["pkt-accordion",s&&"pkt-accordion--compact",t&&`pkt-accordion--${t}`,a].filter(Boolean).join(" ");return l.jsx(un.Provider,{value:{name:n},children:l.jsx("div",{ref:r,className:h,"data-testid":"pkt-accordion","aria-labelledby":e||void 0,children:i})})});pn.displayName="PktAccordion";/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2018 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/const
|
|
40
|
+
*/const er=new Set(["children","localName","ref","style","className"]),fn=new WeakMap,gn=(s,t,e,i,n)=>{const a=n==null?void 0:n[t];a===void 0?(s[t]=e,e==null&&t in HTMLElement.prototype&&s.removeAttribute(t)):e!==i&&((r,h,c)=>{let p=fn.get(r);p===void 0&&fn.set(r,p=new Map);let m=p.get(h);c!==void 0?m===void 0?(p.set(h,m={handleEvent:c}),r.addEventListener(h,m)):m.handleEvent=c:m!==void 0&&(p.delete(h),r.removeEventListener(h,m))})(s,a,e)},Jt=({react:s,tagName:t,elementClass:e,events:i,displayName:n})=>{const a=new Set(Object.keys(i??{})),r=s.forwardRef(((h,c)=>{const p=s.useRef(new Map),m=s.useRef(null),v={},$={};for(const[b,k]of Object.entries(h))er.has(b)?v[b==="className"?"class":b]=k:a.has(b)||b in e.prototype?$[b]=k:v[b]=k;return s.useLayoutEffect((()=>{if(m.current===null)return;const b=new Map;for(const k in $)gn(m.current,k,h[k],p.current.get(k),i),p.current.delete(k),b.set(k,h[k]);for(const[k,x]of p.current)gn(m.current,k,void 0,x,i);p.current=b})),s.useLayoutEffect((()=>{var b;(b=m.current)==null||b.removeAttribute("defer-hydration")}),[]),v.suppressHydrationWarning=!0,s.createElement(t,{...v,ref:s.useCallback((b=>{m.current=b,typeof c=="function"?c(b):c!==null&&(c.current=b)}),[c])})}));return r.displayName=n??e.name,r};/**
|
|
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 oi=globalThis,li=oi.trustedTypes,mn=li?li.createPolicy("lit-html",{createHTML:s=>s}):void 0,vn="$lit$",Ce=`lit$${Math.random().toFixed(9).slice(2)}$`,bn="?"+Ce,sr=`<${bn}>`,Be=document,Ns=()=>Be.createComment(""),Es=s=>s===null||typeof s!="object"&&typeof s!="function",Di=Array.isArray,ir=s=>Di(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Ii=`[
|
|
45
|
+
\f\r]`,Ms=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kn=/-->/g,yn=/>/g,Fe=RegExp(`>|${Ii}(?:([^\\s"'>=/]+)(${Ii}*=${Ii}*(?:[^
|
|
46
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),$n=/'/g,_n=/"/g,wn=/^(?:script|style|textarea|title)$/i,nr=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),d=nr(1),Dt=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),xn=new WeakMap,je=Be.createTreeWalker(Be,129);function Sn(s,t){if(!Di(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return mn!==void 0?mn.createHTML(t):t}const ar=(s,t)=>{const e=s.length-1,i=[];let n,a=t===2?"<svg>":t===3?"<math>":"",r=Ms;for(let h=0;h<e;h++){const c=s[h];let p,m,v=-1,$=0;for(;$<c.length&&(r.lastIndex=$,m=r.exec(c),m!==null);)$=r.lastIndex,r===Ms?m[1]==="!--"?r=kn:m[1]!==void 0?r=yn:m[2]!==void 0?(wn.test(m[2])&&(n=RegExp("</"+m[2],"g")),r=Fe):m[3]!==void 0&&(r=Fe):r===Fe?m[0]===">"?(r=n??Ms,v=-1):m[1]===void 0?v=-2:(v=r.lastIndex-m[2].length,p=m[1],r=m[3]===void 0?Fe:m[3]==='"'?_n:$n):r===_n||r===$n?r=Fe:r===kn||r===yn?r=Ms:(r=Fe,n=void 0);const b=r===Fe&&s[h+1].startsWith("/>")?" ":"";a+=r===Ms?c+sr:v>=0?(i.push(p),c.slice(0,v)+vn+c.slice(v)+Ce+b):c+Ce+(v===-2?h:b)}return[Sn(s,a+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let Li=class Ja{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let a=0,r=0;const h=t.length-1,c=this.parts,[p,m]=ar(t,e);if(this.el=Ja.createElement(p,i),je.currentNode=this.el.content,e===2||e===3){const v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(n=je.nextNode())!==null&&c.length<h;){if(n.nodeType===1){if(n.hasAttributes())for(const v of n.getAttributeNames())if(v.endsWith(vn)){const $=m[r++],b=n.getAttribute(v).split(Ce),k=/([.?@])?(.*)/.exec($);c.push({type:1,index:a,name:k[2],strings:b,ctor:k[1]==="."?or:k[1]==="?"?lr:k[1]==="@"?hr:ci}),n.removeAttribute(v)}else v.startsWith(Ce)&&(c.push({type:6,index:a}),n.removeAttribute(v));if(wn.test(n.tagName)){const v=n.textContent.split(Ce),$=v.length-1;if($>0){n.textContent=li?li.emptyScript:"";for(let b=0;b<$;b++)n.append(v[b],Ns()),je.nextNode(),c.push({type:2,index:++a});n.append(v[$],Ns())}}}else if(n.nodeType===8)if(n.data===bn)c.push({type:2,index:a});else{let v=-1;for(;(v=n.data.indexOf(Ce,v+1))!==-1;)c.push({type:7,index:a}),v+=Ce.length-1}a++}}static createElement(t,e){const i=Be.createElement("template");return i.innerHTML=t,i}};function ns(s,t,e=s,i){var n,a;if(t===Dt)return t;let r=i!==void 0?(n=e._$Co)==null?void 0:n[i]:e._$Cl;const h=Es(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==h&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),h===void 0?r=void 0:(r=new h(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=ns(s,r._$AS(s,t.values),r,i)),t}let rr=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,n=((t==null?void 0:t.creationScope)??Be).importNode(e,!0);je.currentNode=n;let a=je.nextNode(),r=0,h=0,c=i[0];for(;c!==void 0;){if(r===c.index){let p;c.type===2?p=new hi(a,a.nextSibling,this,t):c.type===1?p=new c.ctor(a,c.name,c.strings,this,t):c.type===6&&(p=new cr(a,this,t)),this._$AV.push(p),c=i[++h]}r!==(c==null?void 0:c.index)&&(a=je.nextNode(),r++)}return je.currentNode=Be,n}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},hi=class Qa{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ns(this,t,e),Es(t)?t===y||t==null||t===""?(this._$AH!==y&&this._$AR(),this._$AH=y):t!==this._$AH&&t!==Dt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ir(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==y&&Es(this._$AH)?this._$AA.nextSibling.data=t:this.T(Be.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,a=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Li.createElement(Sn(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)==null?void 0:e._$AD)===a)this._$AH.p(i);else{const r=new rr(a,this),h=r.u(this.options);r.p(i),this.T(h),this._$AH=r}}_$AC(t){let e=xn.get(t.strings);return e===void 0&&xn.set(t.strings,e=new Li(t)),e}k(t){Di(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const a of t)n===e.length?e.push(i=new Qa(this.O(Ns()),this.O(Ns()),this,this.options)):i=e[n],i._$AI(a),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},ci=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,a){this.type=1,this._$AH=y,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=y}_$AI(t,e=this,i,n){const a=this.strings;let r=!1;if(a===void 0)t=ns(this,t,e,0),r=!Es(t)||t!==this._$AH&&t!==Dt,r&&(this._$AH=t);else{const h=t;let c,p;for(t=a[0],c=0;c<a.length-1;c++)p=ns(this,h[i+c],e,c),p===Dt&&(p=this._$AH[c]),r||(r=!Es(p)||p!==this._$AH[c]),p===y?t=y:t!==y&&(t+=(p??"")+a[c+1]),this._$AH[c]=p}r&&!n&&this.j(t)}j(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},or=class extends ci{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===y?void 0:t}};class lr extends ci{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==y)}}let hr=class extends ci{constructor(t,e,i,n,a){super(t,e,i,n,a),this.type=5}_$AI(t,e=this){if((t=ns(this,t,e,0)??y)===Dt)return;const i=this._$AH,n=t===y&&i!==y||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==y&&(i===y||n);n&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}},cr=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){ns(this,t)}};const dr={I:hi},Cn=oi.litHtmlPolyfillSupport;Cn==null||Cn(Li,hi),(oi.litHtmlVersions??(oi.litHtmlVersions=[])).push("3.3.1");const ur=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let n=i._$litPart$;if(n===void 0){const a=(e==null?void 0:e.renderBefore)??null;i._$litPart$=n=new hi(t.insertBefore(Ns(),a),a,void 0,e??{})}return n._$AI(s),n};/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -51,90 +51,90 @@
|
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2019 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const
|
|
54
|
+
*/const di=globalThis,Bi=di.ShadowRoot&&(di.ShadyCSS===void 0||di.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Tn=Symbol(),Nn=new WeakMap;let pr=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Tn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Bi&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Nn.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Nn.set(e,t))}return t}toString(){return this.cssText}};const fr=s=>new pr(typeof s=="string"?s:s+"",void 0,Tn),gr=(s,t)=>{if(Bi)s.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const i=document.createElement("style"),n=di.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},En=Bi?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return fr(e)})(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:mr,defineProperty:vr,getOwnPropertyDescriptor:br,getOwnPropertyNames:kr,getOwnPropertySymbols:yr,getPrototypeOf:$r}=Object,as=globalThis,Mn=as.trustedTypes,_r=Mn?Mn.emptyScript:"",An=as.reactiveElementPolyfillSupport,As=(s,t)=>s,ui={toAttribute(s,t){switch(t){case Boolean:s=s?_r:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Fi=(s,t)=>!mr(s,t),On={attribute:!0,type:String,converter:ui,reflect:!1,useDefault:!1,hasChanged:Fi};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),as.litPropertyMetadata??(as.litPropertyMetadata=new WeakMap);let rs=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=On){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);n!==void 0&&vr(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:a}=br(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:n,set(r){const h=n==null?void 0:n.call(this);a==null||a.call(this,r),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??On}static _$Ei(){if(this.hasOwnProperty(As("elementProperties")))return;const t=$r(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(As("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(As("properties"))){const e=this.properties,i=[...kr(e),...yr(e)];for(const n of i)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,n]of e)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const n=this._$Eu(e,i);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const n of i)e.unshift(En(n))}else t!==void 0&&e.push(En(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gr(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var i;const n=this.constructor.elementProperties.get(t),a=this.constructor._$Eu(t,n);if(a!==void 0&&n.reflect===!0){const r=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:ui).toAttribute(e,n.type);this._$Em=t,r==null?this.removeAttribute(a):this.setAttribute(a,r),this._$Em=null}}_$AK(t,e){var i,n;const a=this.constructor,r=a._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const h=a.getPropertyOptions(r),c=typeof h.converter=="function"?{fromAttribute:h.converter}:((i=h.converter)==null?void 0:i.fromAttribute)!==void 0?h.converter:ui;this._$Em=r;const p=c.fromAttribute(e,h.type);this[r]=p??((n=this._$Ej)==null?void 0:n.get(r))??p,this._$Em=null}}requestUpdate(t,e,i){var n;if(t!==void 0){const a=this.constructor,r=this[t];if(i??(i=a.getPropertyOptions(t)),!((i.hasChanged??Fi)(r,e)||i.useDefault&&i.reflect&&r===((n=this._$Ej)==null?void 0:n.get(t))&&!this.hasAttribute(a._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:n,wrapped:a},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),a!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,r]of this._$Ep)this[a]=r;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[a,r]of n){const{wrapped:h}=r,c=this[a];h!==!0||this._$AL.has(a)||c===void 0||this.C(a,void 0,r,c)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$EO)==null||t.forEach((n=>{var a;return(a=n.hostUpdate)==null?void 0:a.call(n)})),this.update(i)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};rs.elementStyles=[],rs.shadowRootOptions={mode:"open"},rs[As("elementProperties")]=new Map,rs[As("finalized")]=new Map,An==null||An({ReactiveElement:rs}),(as.reactiveElementVersions??(as.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 wr={attribute:!0,type:String,converter:ui,reflect:!1,hasChanged:Fi},xr=(s=wr,t,e)=>{const{kind:i,metadata:n}=e;let a=globalThis.litPropertyMetadata.get(n);if(a===void 0&&globalThis.litPropertyMetadata.set(n,a=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),a.set(e.name,s),i==="accessor"){const{name:r}=e;return{set(h){const c=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,c,s)},init(h){return h!==void 0&&this.C(r,void 0,s,h),h}}}if(i==="setter"){const{name:r}=e;return function(h){const c=this[r];t.call(this,h),this.requestUpdate(r,c,s)}}throw Error("Unsupported decorator location: "+i)};function o(s){return(t,e)=>typeof e=="object"?xr(s,t,e):((i,n,a)=>{const r=n.hasOwnProperty(a);return n.constructor.createProperty(a,i),r?Object.getOwnPropertyDescriptor(n,a):void 0})(s,t,e)}/**
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright 2017 Google LLC
|
|
65
65
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
-
*/const
|
|
66
|
+
*/const Os=globalThis;let os=class extends rs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ur(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return Dt}};var Pn;os._$litElement$=!0,os.finalized=!0,(Pn=Os.litElementHydrateSupport)==null||Pn.call(Os,{LitElement:os});const Dn=Os.litElementPolyfillSupport;Dn==null||Dn({LitElement:os}),(Os.litElementVersions??(Os.litElementVersions=[])).push("4.2.1");const Sr={hi:"Hei!"},Cr={from:"Fra",to:"Til"},Tr={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Nr={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"},Er={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."}},At={example:Sr,generic:Cr,calendar:Tr,dates:Nr,forms:Er};var Mr=Object.defineProperty,In=(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&&Mr(t,e,n),n};let pi=class extends os{constructor(){super(...arguments),this.strings=At,this.role=null}hotReplacedCallback(){this.requestUpdate()}};In([o({type:Object})],pi.prototype,"strings"),In([o({type:String})],pi.prototype,"role");let X=class extends pi{createRenderRoot(){return this}};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/const
|
|
70
|
+
*/const Qt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},He=s=>(...t)=>({_$litDirective$:s,values:t});let ls=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2018 Google LLC
|
|
73
73
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
-
*/const
|
|
74
|
+
*/const N=He(class extends ls{constructor(s){var t;if(super(s),s.type!==Qt.ATTRIBUTE||s.name!=="class"||((t=s.strings)==null?void 0:t.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((t=>s[t])).join(" ")+" "}update(s,[t]){var e,i;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((a=>a!==""))));for(const a in t)t[a]&&!((e=this.nt)!=null&&e.has(a))&&this.st.add(a);return this.render(t)}const n=s.element.classList;for(const a of this.st)a in t||(n.remove(a),this.st.delete(a));for(const a in t){const r=!!t[a];r===this.st.has(a)||(i=this.nt)!=null&&i.has(a)||(r?(n.add(a),this.st.add(a)):(n.remove(a),this.st.delete(a)))}return Dt}});/**
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright 2017 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
|
-
*/function D(s){return o({...s,state:!0,attribute:!1})}function
|
|
78
|
+
*/function D(s){return o({...s,state:!0,attribute:!1})}function Ln(s,t){return t.some(e=>e.value===s)}function Ps(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function hs(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function Ar(s,t){return s.nodeType===Node.ELEMENT_NODE&&!Ln(s,t)}function ji(s){var t;return s.nodeType===Node.TEXT_NODE&&((t=s.nodeValue)==null?void 0:t.trim())!==""}let rt=class{constructor(t,...e){this.nodes=[],this.filledSlots=new Set,this.skipOptions=!1,this.updatingSlots=!1,this.host=t,this.host.addController(this),this.slots=e,this.nodes=[],this.observer=new MutationObserver(i=>this.handleMutations(i)),this.contentObserver=new MutationObserver(i=>this.handleSlotMutations(i))}hostConnected(){this.updateNodes(),this.observer.observe(this.host,{childList:!0}),this.contentObserver.observe(this.host,{childList:!0,subtree:!0})}hostDisconnected(){this.observer.disconnect(),this.contentObserver.disconnect()}hostUpdated(){this.updateSlots()}updateNodes(){this.nodes=[],Array.from(this.host.childNodes).forEach(t=>{Ps(t)||hs(t)&&this.skipOptions||(!Ln(t,this.slots)||ji(t))&&this.nodes.push(t)})}updateSlots(){if(this.updatingSlots)return;this.updatingSlots=!0;const t=new Set;this.slots.forEach(e=>{if(!e.value)return;const i=e.value.getAttribute("name");Array.from(e.value.childNodes).some(a=>{var r,h;if(a.nodeType===Node.COMMENT_NODE)return!1;if(a.nodeType===Node.TEXT_NODE)return!!((r=a.textContent)!=null&&r.trim());if(a.nodeType===Node.ELEMENT_NODE){if(Ps(a))return!1;if((h=a.textContent)!=null&&h.trim())return!0}return!1})&&t.add(i);const n=this.nodes.flatMap(a=>ji(a)||a.getAttribute&&a.getAttribute("slot")==i&&!Ps(a)?a:[]).filter(a=>e.value&&!e.value.contains(a)&&!a.contains(e.value));if(n.length>0)if(typeof e.value.replaceChildren!="function"){for(;e.value.firstChild;)e.value.removeChild(e.value.firstChild);e.value.append(...n)}else e.value.replaceChildren(...n)}),(this.filledSlots.size!==t.size||![...this.filledSlots].every(e=>t.has(e)))&&(this.filledSlots=t,typeof this.host.updateSlots=="function"&&this.host.updateSlots(this.filledSlots)),this.updatingSlots=!1}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{Ps(n)||hs(n)&&this.skipOptions||(Ar(n,this.slots)||ji(n))&&(this.nodes.push(n),e=!0)}),i.removedNodes.forEach(n=>{Ps(n)||hs(n)&&this.skipOptions||(this.nodes=this.nodes.filter(a=>a!==n),e=!0)}))}),e&&this.updateSlots()}handleSlotMutations(t){let e=!1;t.forEach(i=>{const n=i.target.parentElement;if(n!=null&&n.hasAttribute("slot")){const a=n.getAttribute("slot"),r=n.hasChildNodes();r&&!this.filledSlots.has(a)?(this.filledSlots.add(a),e=!0):!r&&this.filledSlots.has(a)&&(this.filledSlots.delete(a),e=!0)}}),e&&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:Or}=dr,Bn=s=>s.strings===void 0,Fn=()=>document.createComment(""),Ds=(s,t,e)=>{var i;const n=s._$AA.parentNode,a=t===void 0?s._$AB:t._$AA;if(e===void 0){const r=n.insertBefore(Fn(),a),h=n.insertBefore(Fn(),a);e=new Or(r,h,s,s.options)}else{const r=e._$AB.nextSibling,h=e._$AM,c=h!==s;if(c){let p;(i=e._$AQ)==null||i.call(e,s),e._$AM=s,e._$AP!==void 0&&(p=s._$AU)!==h._$AU&&e._$AP(p)}if(r!==a||c){let p=e._$AA;for(;p!==r;){const m=p.nextSibling;n.insertBefore(p,a),p=m}}}return e},Ve=(s,t,e=s)=>(s._$AI(t,e),s),Pr={},jn=(s,t=Pr)=>s._$AH=t,Dr=s=>s._$AH,Hi=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 Is=(s,t)=>{var e;const i=s._$AN;if(i===void 0)return!1;for(const n of i)(e=n._$AO)==null||e.call(n,t,!1),Is(n,t);return!0},fi=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},Hn=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),Br(t)}};function Ir(s){this._$AN!==void 0?(fi(this),this._$AM=s,Hn(this)):this._$AM=s}function Lr(s,t=!1,e=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(i))for(let a=e;a<i.length;a++)Is(i[a],!1),fi(i[a]);else i!=null&&(Is(i,!1),fi(i));else Is(this,s)}const Br=s=>{s.type==Qt.CHILD&&(s._$AP??(s._$AP=Lr),s._$AQ??(s._$AQ=Ir))};let Fr=class extends ls{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),Hn(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,n;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),e&&(Is(this,t),fi(this))}setValue(t){if(Bn(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,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 E=()=>new jr;let jr=class{};const Vi=new WeakMap,M=He(class extends Fr{render(s){return y}update(s,[t]){var e;const i=t!==this.G;return i&&this.G!==void 0&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=(e=s.options)==null?void 0:e.host,this.rt(this.ct=s.element)),y}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=Vi.get(t);e===void 0&&(e=new WeakMap,Vi.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){var s,t;return typeof this.G=="function"?(s=Vi.get(this.ht??globalThis))==null?void 0:s.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Vn(s,t,e){const i=s.getAttribute("class")||"",n=new Set(i.split(/\s+/).filter(Boolean));e?n.add(t):n.delete(t),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 gi=class extends ls{constructor(t){if(super(t),this.it=y,t.type!==Qt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===y||t==null)return this._t=void 0,this.it=t;if(t===Dt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};gi.directiveName="unsafeHTML",gi.resultType=1;const mi=He(gi);/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let
|
|
98
|
+
*/let Ui=class extends gi{};Ui.directiveName="unsafeSVG",Ui.resultType=2;const Un=He(Ui);var Hr=Object.defineProperty,Vr=Object.getOwnPropertyDescriptor,Ls=(s,t,e,i)=>{for(var n=i>1?void 0:i?Vr(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&&Hr(t,e,n),n};const zi="https://punkt-cdn.oslo.kommune.no/14.0/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||zi);const Ur=s=>new Promise(t=>setTimeout(t,s)),vi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',qi={},zr=async(s,t)=>{let e=0;for(;qi[t+s+".svg"]==="fetching"&&(e++,!(e>50));)await Ur(50);const i=typeof Storage<"u"&&typeof localStorage<"u";return i&&localStorage.getItem(t+s+".svg")?Promise.resolve(localStorage.getItem(t+s+".svg")):typeof window<"u"&&typeof window.pktFetch=="function"?(qi[t+s+".svg"]="fetching",Promise.resolve(window.pktFetch(t+s+".svg").then(n=>n.ok?n.text():(console.error("Missing icon: "+t+s+".svg"),vi)).then(n=>(n!==vi&&i&&localStorage.setItem(t+s+".svg",n),qi[t+s+".svg"]="fetched",n)))):Promise.resolve(vi)};let Ue=class extends X{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:zi,this.name="",this.icon=Un(vi),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path=typeof window<"u"?window.pktIconPath:zi),this.icon=Un(await zr(this.name||"",this.path).then(e=>e)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return d`${this.name&&this.icon}`}};Ls([o({type:String,reflect:!1})],Ue.prototype,"path",2),Ls([o({type:String,reflect:!0})],Ue.prototype,"name",2),Ls([o({type:SVGElement})],Ue.prototype,"icon",2),Ls([o({type:Array,noAccessor:!0})],Ue.prototype,"_updatedProps",2),Ue=Ls([F("pkt-icon")],Ue);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const C=s=>s??
|
|
102
|
+
*/const C=s=>s??y;var qr=Object.defineProperty,Wr=Object.getOwnPropertyDescriptor,vt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Wr(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&&qr(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.0/animations/";let pt=class extends X{constructor(){super(),this.defaultSlot=E(),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 rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",t=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(t.preventDefault(),t.stopImmediatePropagation())},!0),this.addEventListener("keydown",t=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopImmediatePropagation())},!0)}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),t==="disabled"&&i==="false"&&(this.disabled=!1),(t==="isloading"||t==="isLoading")&&i==="false"&&(this.isLoading=!1)}firstUpdated(t){super.firstUpdated(t),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const t=this.form??this.getAttribute("form")??void 0,e={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return d`
|
|
103
103
|
<button
|
|
104
|
-
class=${
|
|
104
|
+
class=${N(e)}
|
|
105
105
|
type=${this.type}
|
|
106
106
|
?disabled=${!!this.disabled}
|
|
107
107
|
aria-busy=${C(this.isLoading?"true":void 0)}
|
|
108
108
|
aria-disabled=${C(this.disabled||this.isLoading?"true":void 0)}
|
|
109
109
|
form=${C(t)}
|
|
110
110
|
>
|
|
111
|
-
${this.isLoading?
|
|
111
|
+
${this.isLoading?d`<pkt-icon
|
|
112
112
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
113
113
|
name="spinner-blue"
|
|
114
114
|
path=${C(this.loadingAnimationPath)}
|
|
115
|
-
></pkt-icon>`:
|
|
116
|
-
${this.variant!=="label-only"?
|
|
115
|
+
></pkt-icon>`:y}
|
|
116
|
+
${this.variant!=="label-only"?d`<pkt-icon
|
|
117
117
|
class="pkt-btn__icon pkt-icon"
|
|
118
118
|
name=${this.iconName}
|
|
119
119
|
path=${C(this.iconPath)}
|
|
120
|
-
></pkt-icon>`:
|
|
120
|
+
></pkt-icon>`:y}
|
|
121
121
|
<span class="pkt-btn__text" ${M(this.defaultSlot)}></span>
|
|
122
|
-
${this.variant==="icons-right-and-left"?
|
|
122
|
+
${this.variant==="icons-right-and-left"?d`<pkt-icon
|
|
123
123
|
class="pkt-btn__icon"
|
|
124
124
|
name=${this.secondIconName}
|
|
125
125
|
path=${C(this.secondIconPath)}
|
|
126
|
-
></pkt-icon>`:
|
|
126
|
+
></pkt-icon>`:y}
|
|
127
127
|
</button>
|
|
128
|
-
`}};
|
|
129
|
-
<div class=${
|
|
130
|
-
<div class=${
|
|
128
|
+
`}};vt([o({type:String})],pt.prototype,"iconName",2),vt([o({type:String})],pt.prototype,"secondIconName",2),vt([o({type:String})],pt.prototype,"iconPath",2),vt([o({type:String})],pt.prototype,"secondIconPath",2),vt([o({type:String})],pt.prototype,"mode",2),vt([o({type:String})],pt.prototype,"size",2),vt([o({type:Boolean,attribute:"full-width"})],pt.prototype,"fullWidth",2),vt([o({type:Boolean,attribute:"full-width-on-mobile"})],pt.prototype,"fullWidthOnMobile",2),vt([o({type:String})],pt.prototype,"color",2),vt([o({type:String})],pt.prototype,"skin",2),vt([o({type:String})],pt.prototype,"variant",2),vt([o({type:String,reflect:!0})],pt.prototype,"state",2),vt([o({type:String,reflect:!0})],pt.prototype,"type",2),vt([o({type:String})],pt.prototype,"form",2),vt([o({type:Boolean,reflect:!0})],pt.prototype,"isLoading",2),vt([o({type:Boolean,reflect:!0})],pt.prototype,"disabled",2),vt([o({type:String})],pt.prototype,"loadingAnimationPath",2),pt=vt([F("pkt-button")],pt);const Rr={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},bi={props:Rr};var Kr=Object.defineProperty,Yr=Object.getOwnPropertyDescriptor,oe=(s,t,e,i)=>{for(var n=i>1?void 0:i?Yr(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&&Kr(t,e,n),n};let te=class extends X{constructor(){super(),this.defaultSlot=E(),this.compact=bi.props.compact.default,this.title="",this.skin=bi.props.skin.default,this.ariaLive=bi.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=bi.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new rt(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,e,i){t==="ariaLive"&&(this["aria-live"]=i),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&Vn(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},e={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return d`
|
|
129
|
+
<div class=${N(t)} aria-live=${this["aria-live"]}>
|
|
130
|
+
<div class=${N(e)}>
|
|
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?d`
|
|
138
138
|
<div class="pkt-alert__close">
|
|
139
139
|
<pkt-button
|
|
140
140
|
tabindex="0"
|
|
@@ -149,26 +149,26 @@
|
|
|
149
149
|
<span class="sr-only">Lukk</span>
|
|
150
150
|
</pkt-button>
|
|
151
151
|
</div>
|
|
152
|
-
`:
|
|
153
|
-
${this.title?
|
|
152
|
+
`:y}
|
|
153
|
+
${this.title?d`<div class="pkt-alert__title">${this.title}</div>`:y}
|
|
154
154
|
|
|
155
155
|
<div class="pkt-alert__text" ${M(this.defaultSlot)}></div>
|
|
156
156
|
|
|
157
|
-
${this.date?
|
|
157
|
+
${this.date?d`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:y}
|
|
158
158
|
</div>
|
|
159
159
|
</div>
|
|
160
|
-
`}};
|
|
160
|
+
`}};oe([o({type:Boolean,reflect:!1})],te.prototype,"compact",2),oe([o({type:String,reflect:!0})],te.prototype,"title",2),oe([o({type:String,reflect:!0})],te.prototype,"skin",2),oe([o({type:String})],te.prototype,"ariaLive",2),oe([o({type:String,reflect:!0})],te.prototype,"aria-live",2),oe([o({type:Boolean,reflect:!0})],te.prototype,"closeAlert",2),oe([o({type:String,reflect:!0})],te.prototype,"date",2),oe([o({type:String,reflect:!0})],te.prototype,"role",2),oe([D()],te.prototype,"_isClosed",2),te=oe([F("pkt-alert")],te);var Gr=Object.defineProperty,Zr=Object.getOwnPropertyDescriptor,Bs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Zr(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&&Gr(t,e,n),n};let cs=class extends os{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(t){t.has("skin")&&this.requestUpdate(),t.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var t;if(this.name){const e=(t=this.renderRoot)==null?void 0:t.querySelector("slot");e&&e.assignedElements().forEach(i=>{i.tagName.toLowerCase()==="pkt-accordion-item"&&(i.hasAttribute("name")||i.setAttribute("name",this.name))})}}firstUpdated(){var t;const e=(t=this.renderRoot)==null?void 0:t.querySelector("slot");e&&e.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const t={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return d`
|
|
161
161
|
<div
|
|
162
162
|
part="container"
|
|
163
|
-
class=${
|
|
163
|
+
class=${N(t)}
|
|
164
164
|
data-testid="pkt-accordion"
|
|
165
165
|
aria-labelledby=${this.ariaLabelledBy}
|
|
166
166
|
>
|
|
167
167
|
<slot></slot>
|
|
168
168
|
</div>
|
|
169
|
-
`}};
|
|
169
|
+
`}};Bs([o({type:String,reflect:!0,attribute:"aria-labelledby"})],cs.prototype,"ariaLabelledBy",2),Bs([o({type:Boolean,reflect:!0,attribute:"compact"})],cs.prototype,"compact",2),Bs([o({type:String,reflect:!0,attribute:"skin"})],cs.prototype,"skin",2),Bs([o({type:String,reflect:!0,attribute:"name"})],cs.prototype,"name",2),cs=Bs([F("pkt-accordion")],cs);var Xr=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,ze=(s,t,e,i)=>{for(var n=i>1?void 0:i?Jr(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&&Xr(t,e,n),n};let Te=class extends X{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=E(),this.defaultSlot=E(),this.slotController=new rt(this,this.defaultSlot)}firstUpdated(t){this.defaultOpen&&(this.isOpen=!0)}render(){const t={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return d`
|
|
170
170
|
<details
|
|
171
|
-
class=${
|
|
171
|
+
class=${N(t)}
|
|
172
172
|
id=${this.id}
|
|
173
173
|
?open=${this.isOpen}
|
|
174
174
|
${M(this.accordionItemRef)}
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
<div class="pkt-accordion-item__content-inner" ${M(this.defaultSlot)}></div>
|
|
191
191
|
</div>
|
|
192
192
|
</details>
|
|
193
|
-
`}};
|
|
193
|
+
`}};ze([o({type:Boolean})],Te.prototype,"defaultOpen",2),ze([o({type:String})],Te.prototype,"title",2),ze([o({type:String,reflect:!0})],Te.prototype,"skin",2),ze([o({type:Boolean,reflect:!0})],Te.prototype,"compact",2),ze([o({type:Boolean,reflect:!0})],Te.prototype,"isOpen",2),ze([o({type:String,reflect:!0})],Te.prototype,"name",2),Te=ze([F("pkt-accordion-item")],Te);var Qr=Object.defineProperty,to=Object.getOwnPropertyDescriptor,ki=(s,t,e,i)=>{for(var n=i>1?void 0:i?to(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&&Qr(t,e,n),n};let ds=class extends X{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,e,i){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,e,i)}render(){return d`<nav
|
|
194
194
|
class="pkt-back-link"
|
|
195
195
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
196
196
|
>
|
|
@@ -202,44 +202,16 @@
|
|
|
202
202
|
></pkt-icon
|
|
203
203
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
204
204
|
>
|
|
205
|
-
</nav>`}};$i([o({type:String})],ms.prototype,"href",2),$i([o({type:String})],ms.prototype,"text",2),$i([o({type:String})],ms.prototype,"ariaLabel",2),ms=$i([F("pkt-backlink")],ms);const jn=6048e5,Wr=864e5,Hn=Symbol.for("constructDateFrom");function ue(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&Hn in s?s[Hn](t):s instanceof Date?new s.constructor(t):new Date(t)}function Ht(s,t){return ue(t||s,s)}function zi(s,t,e){const i=Ht(s,void 0);return isNaN(t)?ue(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let Rr={};function _i(){return Rr}function Us(s,t){var e,i,n,a;const r=_i(),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=Ht(s,t==null?void 0:t.in),u=d.getDay(),g=(u<h?7:0)+u-h;return d.setDate(d.getDate()-g),d.setHours(0,0,0,0),d}function wi(s,t){return Us(s,{...t,weekStartsOn:1})}function Vn(s,t){const e=Ht(s,void 0),i=e.getFullYear(),n=ue(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=wi(n),r=ue(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=wi(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Un(s){const t=Ht(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 zn(s,...t){const e=ue.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function qn(s,t){const e=Ht(s,void 0);return e.setHours(0,0,0,0),e}function Kr(s,t,e){const[i,n]=zn(void 0,s,t),a=qn(i),r=qn(n),h=+a-Un(a),d=+r-Un(r);return Math.round((h-d)/Wr)}function Yr(s,t){const e=Vn(s),i=ue(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),wi(i)}function Gr(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Zr(s){return!(!Gr(s)&&typeof s!="number"||isNaN(+Ht(s)))}function Xr(s,t){const[e,i]=zn(s,t.start,t.end);return{start:e,end:i}}function qi(s,t){const{start:e,end:i}=Xr(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(ue(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?d.reverse():d}function Jr(s,t){const e=Ht(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Qr={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"}},to=(s,t,e)=>{let i;const n=Qr[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 Wi(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const eo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},so={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},io={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},no={date:Wi({formats:eo,defaultWidth:"full"}),time:Wi({formats:so,defaultWidth:"full"}),dateTime:Wi({formats:io,defaultWidth:"full"})},ao={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ro=(s,t,e,i)=>ao[s];function zs(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 oo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lo={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ho={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"]},co={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"]},po={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"}},uo={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"}},fo=(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"},go={ordinalNumber:fo,era:zs({values:oo,defaultWidth:"wide"}),quarter:zs({values:lo,defaultWidth:"wide",argumentCallback:s=>s-1}),month:zs({values:ho,defaultWidth:"wide"}),day:zs({values:co,defaultWidth:"wide"}),dayPeriod:zs({values:po,defaultWidth:"wide",formattingValues:uo,defaultFormattingWidth:"wide"})};function qs(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)?vo(h,m=>m.test(r)):mo(h,m=>m.test(r));let u;u=s.valueCallback?s.valueCallback(d):d,u=e.valueCallback?e.valueCallback(u):u;const g=t.slice(r.length);return{value:u,rest:g}}}function mo(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function vo(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function bo(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 ko=/^(\d+)(th|st|nd|rd)?/i,yo=/\d+/i,$o={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},_o={any:[/^b/i,/^(a|c)/i]},wo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xo={any:[/1/i,/2/i,/3/i,/4/i]},So={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},Co={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]},To={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},Eo={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]},No={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},Mo={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}},Ao={ordinalNumber:bo({matchPattern:ko,parsePattern:yo,valueCallback:s=>parseInt(s,10)}),era:qs({matchPatterns:$o,defaultMatchWidth:"wide",parsePatterns:_o,defaultParseWidth:"any"}),quarter:qs({matchPatterns:wo,defaultMatchWidth:"wide",parsePatterns:xo,defaultParseWidth:"any",valueCallback:s=>s+1}),month:qs({matchPatterns:So,defaultMatchWidth:"wide",parsePatterns:Co,defaultParseWidth:"any"}),day:qs({matchPatterns:To,defaultMatchWidth:"wide",parsePatterns:Eo,defaultParseWidth:"any"}),dayPeriod:qs({matchPatterns:No,defaultMatchWidth:"any",parsePatterns:Mo,defaultParseWidth:"any"})},Oo={code:"en-US",formatDistance:to,formatLong:no,formatRelative:ro,localize:go,match:Ao,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Po(s,t){const e=Ht(s,void 0);return Kr(e,Jr(e))+1}function Do(s,t){const e=Ht(s,void 0),i=+wi(e)-+Yr(e);return Math.round(i/jn)+1}function Wn(s,t){var e,i,n,a;const r=Ht(s,t==null?void 0:t.in),h=r.getFullYear(),d=_i(),u=(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,g=ue((t==null?void 0:t.in)||s,0);g.setFullYear(h+1,0,u),g.setHours(0,0,0,0);const m=Us(g,t),$=ue((t==null?void 0:t.in)||s,0);$.setFullYear(h,0,u),$.setHours(0,0,0,0);const b=Us($,t);return+r>=+m?h+1:+r>=+b?h:h-1}function Io(s,t){var e,i,n,a;const r=_i(),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=Wn(s,t),u=ue((t==null?void 0:t.in)||s,0);return u.setFullYear(d,0,h),u.setHours(0,0,0,0),Us(u,t)}function Rn(s,t){const e=Ht(s,t==null?void 0:t.in),i=+Us(e,t)-+Io(e,t);return Math.round(i/jn)+1}function Y(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Oe={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)}},vs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kn={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 Oe.y(s,t)},Y:function(s,t,e,i){const n=Wn(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=Vn(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 Oe.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=Rn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Y(n,t.length)},I:function(s,t,e){const i=Do(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"}):Oe.d(s,t)},D:function(s,t,e){const i=Po(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=vs.noon:i===0?n=vs.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=vs.evening:i>=12?n=vs.afternoon:i>=4?n=vs.morning:n=vs.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 Oe.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Oe.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"}):Oe.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Oe.s(s,t)},S:function(s,t){return Oe.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Gn(i);case"XXXX":case"XX":return Ge(i);case"XXXXX":case"XXX":default:return Ge(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return Gn(i);case"xxxx":case"xx":return Ge(i);case"xxxxx":case"xxx":default:return Ge(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Yn(i,":");case"OOOO":default:return"GMT"+Ge(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Yn(i,":");case"zzzz":default:return"GMT"+Ge(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 Yn(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 Gn(s,t){return s%60===0?(s>0?"-":"+")+Y(Math.abs(s)/60,2):Ge(s,t)}function Ge(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 Zn=(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"})}},Xn=(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"})}},Lo=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return Zn(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}}",Zn(i,t)).replace("{{time}}",Xn(n,t))},Bo={p:Xn,P:Lo},Fo=/^D+$/,jo=/^Y+$/,Ho=["D","DD","YY","YYYY"];function Vo(s){return Fo.test(s)}function Uo(s){return jo.test(s)}function zo(s,t,e){const i=qo(s,t,e);if(console.warn(i),Ho.includes(s))throw new RangeError(i)}function qo(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 Wo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ro=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ko=/^'([^]*?)'?$/,Yo=/''/g,Go=/[a-zA-Z]/;function Zo(s,t,e){var i,n,a,r;const h=_i(),d=h.locale??Oo,u=h.firstWeekContainsDate??((n=(i=h.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,g=h.weekStartsOn??((r=(a=h.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??0,m=Ht(s,void 0);if(!Zr(m))throw new RangeError("Invalid time value");let $=t.match(Ro).map(y=>{const x=y[0];if(x==="p"||x==="P"){const T=Bo[x];return T(y,d.formatLong)}return y}).join("").match(Wo).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:Xo(y)};if(Kn[x])return{isToken:!0,value:y};if(x.match(Go))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:y}});d.localize.preprocessor&&($=d.localize.preprocessor(m,$));const b={firstWeekContainsDate:u,weekStartsOn:g,locale:d};return $.map(y=>{if(!y.isToken)return y.value;const x=y.value;(Uo(x)||Vo(x))&&zo(x,t,String(s));const T=Kn[x[0]];return T(m,x,d.localize,b)}).join("")}function Xo(s){const t=s.match(Ko);return t?t[1].replace(Yo,"'"):s}function Jo(s,t){const e=Ht(s,void 0).getDay();return e===0?7:e}function Qo(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 Jn={},Ws={};function Ze(s,t){try{const e=(Jn[s]||(Jn[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Ws?Ws[e]:Qn(e,e.split(":"))}catch{if(s in Ws)return Ws[s];const e=s==null?void 0:s.match(tl);return e?Qn(s,e.slice(1)):NaN}}const tl=/([+-]\d\d):?(\d\d)?/;function Qn(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Ws[s]=e*60+i>0?e*60+i+n:e*60-i-n}let Rs=class oi 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)),ea(this),Ri(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new oi(...e,t):new oi(Date.now(),t)}withTimeZone(t){return new oi(+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),Ri(this),+this}[Symbol.for("constructDateFrom")](t){return new oi(+new Date(t),this.timeZone)}};const ta=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ta.test(s))return;const t=s.replace(ta,"$1UTC");Rs.prototype[t]&&(s.startsWith("get")?Rs.prototype[s]=function(){return this.internal[t]()}:(Rs.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),el(this),+this},Rs.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ri(this),+this}))});function Ri(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Ze(s.timeZone,s)*60))}function el(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()),ea(s)}function ea(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 u=new Date(+s);u.setUTCSeconds(0);const g=n>0?u.getSeconds():(u.getSeconds()-60)%60,m=Math.round(-(Ze(s.timeZone,s)*60))%60;(m||g)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+m+g));const $=Ze(s.timeZone,s),b=$>0?Math.floor($):Math.ceil($),y=-new Date(+s).getTimezoneOffset()-b,x=b!==e,T=y-d;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const S=Ze(s.timeZone,s),A=S>0?Math.floor(S):Math.ceil(S),I=b-A;I&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+I),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+I))}}let Ki=class li extends Rs{static tz(t,...e){return e.length?new li(...e,t):new li(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} (${Qo(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 li(+this,t)}[Symbol.for("constructDateFrom")](t){return new li(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const sl=(s=window.pktTz)=>{const t=new Ki(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 Pe(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 ut=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}`},De=s=>{if(!s)return null;const t=Pe(s);return isNaN(t.getTime())?null:t},sa=(s,t)=>{const e=$e(s);return isNaN(e.getTime())?"":Zo(e,t)},$e=(s="",t)=>{const e=typeof s=="string"?Pe(s):s;return!e||isNaN(e.getTime())?new Date:e},Ie=(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},Ks=s=>{let t;return typeof s=="number"?t=new Ki(s,window.pktTz):t=new Ki(s,window.pktTz),t.setHours(12,0,0,0),t},il=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),nl=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?$e(t):null,n=e?$e(e):null;return!(i&&s<i||n&&s>n)},al=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=ut(s);return t.includes(e)},rl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ia=(s,t,e,i,n)=>!(!s||isNaN(s.getTime())||!nl(s,t,e)||i&&al(s,i)||n&&rl(s,n)),ol=(s,t,e,i,n)=>s.filter(a=>{const r=De(a);return r&&ia(r,t,e,i,n)}),na=s=>s.slice().sort((t,e)=>{const i=De(t),n=De(e);return!i||!n?0:i.getTime()-n.getTime()}),ll=(s,t)=>{const e=De(s),i=De(t);return!e||!i?!1:e<=i},Ys=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],hl=s=>s.join(","),aa=s=>Ys(s),dl=s=>s?Pe(s):null,cl=s=>{if(typeof s=="string")return s.split(",").map(t=>Pe(t));if(Array.isArray(s))return s.map(t=>Pe(t))},bs={csvToArray:aa,stringToDate:dl,stringsToDate:cl},pl={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Xe={props:pl};var ul=Object.defineProperty,fl=Object.getOwnPropertyDescriptor,J=(s,t,e,i)=>{for(var n=i>1?void 0:i?fl(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&&ul(t,e,n),n};let G=class extends R{constructor(){super(...arguments),this.multiple=Xe.props.multiple.default,this.maxMultiple=Xe.props.maxMultiple.default,this.range=Xe.props.range.default,this.weeknumbers=Xe.props.weeknumbers.default,this.withcontrols=Xe.props.withcontrols.default,this.selected=[],this.earliest=Xe.props.earliest.default,this.latest=Xe.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,i){t==="selected"&&i&&this.convertSelected(),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>Pe(t)),this.range&&this.selected.length===2){const t=qi({start:this._selected[0],end:this._selected[1]});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let i=0;i<t.length;i++){const n=t[i],a=n>this._selected[0]&&n<this._selected[1];e[ut(n)]=a}this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=Pe(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?Ks(new Date):t}else this.currentmonth===null&&(this.currentmonth=Ks(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Ks(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var i,n,a,r,h;if(((i=t.target)==null?void 0:i.nodeName)==="INPUT"||((n=t.target)==null?void 0:n.nodeName)==="SELECT"||((a=t.target)==null?void 0:a.nodeName)==="BUTTON"&&!((h=(r=t.target)==null?void 0:r.dataset)!=null&&h.date))return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const d=this.focusedDate?$e(this.focusedDate):Ie(this.year,this.month,1);let u=zi(d,e);if(u){let g=this.querySelector(`button[data-date="${ut(u)}"]`);if(g instanceof HTMLButtonElement){if(g.dataset.disabled){u=zi(u,e);let m=this.querySelector(`button[data-date="${ut(u)}"]`);for(;m&&m instanceof HTMLButtonElement&&m.dataset.disabled;)u=zi(u,e),m=this.querySelector(`button[data-date="${ut(u)}"]`);g=m}g instanceof HTMLButtonElement&&!g.dataset.disabled&&(this.focusedDate=ut(u),g.focus())}}}render(){return c`
|
|
205
|
+
</nav>`}};ki([o({type:String})],ds.prototype,"href",2),ki([o({type:String})],ds.prototype,"text",2),ki([o({type:String})],ds.prototype,"ariaLabel",2),ds=ki([F("pkt-backlink")],ds);const zn=6048e5,eo=864e5,qn=Symbol.for("constructDateFrom");function le(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&qn in s?s[qn](t):s instanceof Date?new s.constructor(t):new Date(t)}function Ft(s,t){return le(t||s,s)}function Wn(s,t,e){const i=Ft(s,void 0);return isNaN(t)?le(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let so={};function yi(){return so}function Fs(s,t){var e,i,n,a;const r=yi(),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,c=Ft(s,t==null?void 0:t.in),p=c.getDay(),m=(p<h?7:0)+p-h;return c.setDate(c.getDate()-m),c.setHours(0,0,0,0),c}function $i(s,t){return Fs(s,{...t,weekStartsOn:1})}function Rn(s,t){const e=Ft(s,void 0),i=e.getFullYear(),n=le(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=$i(n),r=le(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=$i(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Kn(s){const t=Ft(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 Yn(s,...t){const e=le.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Gn(s,t){const e=Ft(s,void 0);return e.setHours(0,0,0,0),e}function io(s,t,e){const[i,n]=Yn(void 0,s,t),a=Gn(i),r=Gn(n),h=+a-Kn(a),c=+r-Kn(r);return Math.round((h-c)/eo)}function no(s,t){const e=Rn(s),i=le(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),$i(i)}function ao(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function ro(s){return!(!ao(s)&&typeof s!="number"||isNaN(+Ft(s)))}function oo(s,t){const[e,i]=Yn(s,t.start,t.end);return{start:e,end:i}}function Zn(s,t){const{start:e,end:i}=oo(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 c=[];for(;+r<=a;)c.push(le(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?c.reverse():c}function lo(s,t){const e=Ft(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ho={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"}},co=(s,t,e)=>{let i;const n=ho[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 Wi(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const uo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},po={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fo={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},go={date:Wi({formats:uo,defaultWidth:"full"}),time:Wi({formats:po,defaultWidth:"full"}),dateTime:Wi({formats:fo,defaultWidth:"full"})},mo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vo=(s,t,e,i)=>mo[s];function js(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 bo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ko={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yo={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"]},$o={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"]},_o={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"}},wo={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"}},xo=(s,t)=>{const e=Number(s),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},So={ordinalNumber:xo,era:js({values:bo,defaultWidth:"wide"}),quarter:js({values:ko,defaultWidth:"wide",argumentCallback:s=>s-1}),month:js({values:yo,defaultWidth:"wide"}),day:js({values:$o,defaultWidth:"wide"}),dayPeriod:js({values:_o,defaultWidth:"wide",formattingValues:wo,defaultFormattingWidth:"wide"})};function Hs(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],c=Array.isArray(h)?To(h,v=>v.test(r)):Co(h,v=>v.test(r));let p;p=s.valueCallback?s.valueCallback(c):c,p=e.valueCallback?e.valueCallback(p):p;const m=t.slice(r.length);return{value:p,rest:m}}}function Co(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function To(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function No(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const 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 Eo=/^(\d+)(th|st|nd|rd)?/i,Mo=/\d+/i,Ao={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},Oo={any:[/^b/i,/^(a|c)/i]},Po={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Do={any:[/1/i,/2/i,/3/i,/4/i]},Io={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},Lo={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]},Bo={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},Fo={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},Ho={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}},Vo={ordinalNumber:No({matchPattern:Eo,parsePattern:Mo,valueCallback:s=>parseInt(s,10)}),era:Hs({matchPatterns:Ao,defaultMatchWidth:"wide",parsePatterns:Oo,defaultParseWidth:"any"}),quarter:Hs({matchPatterns:Po,defaultMatchWidth:"wide",parsePatterns:Do,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Hs({matchPatterns:Io,defaultMatchWidth:"wide",parsePatterns:Lo,defaultParseWidth:"any"}),day:Hs({matchPatterns:Bo,defaultMatchWidth:"wide",parsePatterns:Fo,defaultParseWidth:"any"}),dayPeriod:Hs({matchPatterns:jo,defaultMatchWidth:"any",parsePatterns:Ho,defaultParseWidth:"any"})},Uo={code:"en-US",formatDistance:co,formatLong:go,formatRelative:vo,localize:So,match:Vo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zo(s,t){const e=Ft(s,void 0);return io(e,lo(e))+1}function qo(s,t){const e=Ft(s,void 0),i=+$i(e)-+no(e);return Math.round(i/zn)+1}function Xn(s,t){var e,i,n,a;const r=Ft(s,t==null?void 0:t.in),h=r.getFullYear(),c=yi(),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)??c.firstWeekContainsDate??((a=(n=c.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=Fs(m,t),$=le((t==null?void 0:t.in)||s,0);$.setFullYear(h,0,p),$.setHours(0,0,0,0);const b=Fs($,t);return+r>=+v?h+1:+r>=+b?h:h-1}function Wo(s,t){var e,i,n,a;const r=yi(),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,c=Xn(s,t),p=le((t==null?void 0:t.in)||s,0);return p.setFullYear(c,0,h),p.setHours(0,0,0,0),Fs(p,t)}function Jn(s,t){const e=Ft(s,t==null?void 0:t.in),i=+Fs(e,t)-+Wo(e,t);return Math.round(i/zn)+1}function K(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Ne={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return K(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):K(e+1,2)},d(s,t){return K(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 K(s.getHours()%12||12,t.length)},H(s,t){return K(s.getHours(),t.length)},m(s,t){return K(s.getMinutes(),t.length)},s(s,t){return K(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return K(n,t.length)}},us={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Qn={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 Ne.y(s,t)},Y:function(s,t,e,i){const n=Xn(s,i),a=n>0?n:1-n;if(t==="YY"){const r=a%100;return K(r,2)}return t==="Yo"?e.ordinalNumber(a,{unit:"year"}):K(a,t.length)},R:function(s,t){const e=Rn(s);return K(e,t.length)},u:function(s,t){const e=s.getFullYear();return K(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 K(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 K(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 Ne.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 K(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=Jn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):K(n,t.length)},I:function(s,t,e){const i=qo(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):K(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):Ne.d(s,t)},D:function(s,t,e){const i=zo(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):K(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 K(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 K(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 K(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=us.noon:i===0?n=us.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=us.evening:i>=12?n=us.afternoon:i>=4?n=us.morning:n=us.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 Ne.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Ne.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):K(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):K(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):Ne.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Ne.s(s,t)},S:function(s,t){return Ne.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ea(i);case"XXXX":case"XX":return qe(i);case"XXXXX":case"XXX":default:return qe(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return ea(i);case"xxxx":case"xx":return qe(i);case"xxxxx":case"xxx":default:return qe(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ta(i,":");case"OOOO":default:return"GMT"+qe(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ta(i,":");case"zzzz":default:return"GMT"+qe(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return K(i,t.length)},T:function(s,t,e){return K(+s,t.length)}};function ta(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+K(a,2)}function ea(s,t){return s%60===0?(s>0?"-":"+")+K(Math.abs(s)/60,2):qe(s,t)}function qe(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=K(Math.trunc(i/60),2),a=K(i%60,2);return e+n+t+a}const sa=(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"})}},ia=(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"})}},Ro=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return sa(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}}",sa(i,t)).replace("{{time}}",ia(n,t))},Ko={p:ia,P:Ro},Yo=/^D+$/,Go=/^Y+$/,Zo=["D","DD","YY","YYYY"];function Xo(s){return Yo.test(s)}function Jo(s){return Go.test(s)}function Qo(s,t,e){const i=tl(s,t,e);if(console.warn(i),Zo.includes(s))throw new RangeError(i)}function tl(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 el=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,il=/^'([^]*?)'?$/,nl=/''/g,al=/[a-zA-Z]/;function rl(s,t,e){var i,n,a,r;const h=yi(),c=h.locale??Uo,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=Ft(s,void 0);if(!ro(v))throw new RangeError("Invalid time value");let $=t.match(sl).map(k=>{const x=k[0];if(x==="p"||x==="P"){const T=Ko[x];return T(k,c.formatLong)}return k}).join("").match(el).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const x=k[0];if(x==="'")return{isToken:!1,value:ol(k)};if(Qn[x])return{isToken:!0,value:k};if(x.match(al))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:k}});c.localize.preprocessor&&($=c.localize.preprocessor(v,$));const b={firstWeekContainsDate:p,weekStartsOn:m,locale:c};return $.map(k=>{if(!k.isToken)return k.value;const x=k.value;(Jo(x)||Xo(x))&&Qo(x,t,String(s));const T=Qn[x[0]];return T(v,x,c.localize,b)}).join("")}function ol(s){const t=s.match(il);return t?t[1].replace(nl,"'"):s}function ll(s,t){const e=Ft(s,void 0).getDay();return e===0?7:e}function hl(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 na={},Vs={};function We(s,t){try{const e=(na[s]||(na[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Vs?Vs[e]:aa(e,e.split(":"))}catch{if(s in Vs)return Vs[s];const e=s==null?void 0:s.match(cl);return e?aa(s,e.slice(1)):NaN}}const cl=/([+-]\d\d):?(\d\d)?/;function aa(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Vs[s]=e*60+i>0?e*60+i+n:e*60-i-n}let Us=class ai extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(We(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)),oa(this),Ri(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new ai(...e,t):new ai(Date.now(),t)}withTimeZone(t){return new ai(+this,t)}getTimezoneOffset(){const t=-We(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ri(this),+this}[Symbol.for("constructDateFrom")](t){return new ai(+new Date(t),this.timeZone)}};const ra=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ra.test(s))return;const t=s.replace(ra,"$1UTC");Us.prototype[t]&&(s.startsWith("get")?Us.prototype[s]=function(){return this.internal[t]()}:(Us.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),dl(this),+this},Us.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ri(this),+this}))});function Ri(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-We(s.timeZone,s)*60))}function dl(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()),oa(s)}function oa(s){const t=We(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 c=n-e;c&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+c);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(We(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 $=We(s.timeZone,s),b=$>0?Math.floor($):Math.ceil($),k=-new Date(+s).getTimezoneOffset()-b,x=b!==e,T=k-c;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const S=We(s.timeZone,s),A=S>0?Math.floor(S):Math.ceil(S),I=b-A;I&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+I),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+I))}}let Ki=class ri extends Us{static tz(t,...e){return e.length?new ri(...e,t):new ri(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} (${hl(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 ri(+this,t)}[Symbol.for("constructDateFrom")](t){return new ri(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const ul=(s=window.pktTz)=>{const t=new Ki(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 Ee(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}`},Me=s=>{if(!s)return null;const t=Ee(s);return isNaN(t.getTime())?null:t},la=(s,t)=>{const e=me(s);return isNaN(e.getTime())?"":rl(e,t)},me=(s="",t)=>{const e=typeof s=="string"?Ee(s):s;return!e||isNaN(e.getTime())?new Date:e},Re=(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},zs=s=>{let t;return typeof s=="number"?t=new Ki(s,window.pktTz):t=new Ki(s,window.pktTz),t.setHours(12,0,0,0),t},pl=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),fl=(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)},gl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=bt(s);return t.includes(e)},ml=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ha=(s,t,e,i,n)=>!(!s||isNaN(s.getTime())||!fl(s,t,e)||i&&gl(s,i)||n&&ml(s,n)),vl=(s,t,e,i,n)=>s.filter(a=>{const r=Me(a);return r&&ha(r,t,e,i,n)}),ca=s=>s.slice().sort((t,e)=>{const i=Me(t),n=Me(e);return!i||!n?0:i.getTime()-n.getTime()}),bl=(s,t)=>{const e=Me(s),i=Me(t);return!e||!i?!1:e<=i},qs=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],kl=s=>s.join(","),da=s=>qs(s),yl=s=>s?Ee(s):null,$l=s=>{if(typeof s=="string")return s.split(",").map(t=>Ee(t));if(Array.isArray(s))return s.map(t=>Ee(t))},ps={csvToArray:da,stringToDate:yl,stringsToDate:$l},_l={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Ke={props:_l};function ua(s,t){const e=t.excludedates.map(i=>typeof i=="string"?i:bt(i));return!ha(s,t.earliest,t.latest,e,t.excludeweekdays)}function wl(s,t,e,i){return!!(ua(s,e)||!t&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function xl(s,t,e){const i=Re(s,t,0);return!(e&&me(e)>i)}function Sl(s,t,e){const i=Re(t===11?s+1:s,t===11?0:t+1,1);return!(e&&me(e)<i)}const Ws=7,Cl=6;function Tl(s,t){const e=Re(s,t,1),i=Re(s,t+1,0),n=(e.getDay()+Cl)%Ws,a=i.getDate(),r=Math.ceil((a+n)/Ws),h=Re(s,t,0).getDate(),c=Jn(e);return{firstDayOfMonth:e,lastDayOfMonth:i,startingDay:n,numDays:a,numRows:r,numDaysPrevMonth:h,initialWeek:c}}function Nl(s,t,e,i){const{startingDay:n,numDays:a}=i;return s===0&&t<n?"prev-month":e>a?"next-month":"current-month"}function El(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 fs(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(t=>Ee(t))}function pa(s,t){const e=Zn({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=Zn({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(ll(n[a]).toString()))return!1}return!0}function Yi(s,t){const e=bt(s);return t.includes(e)?t:[...t,e]}function Gi(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 Ml(s,t,e){const i=bt(s);return t.includes(i)?Gi(s,t):e>0&&t.length>=e?t:Yi(s,t)}function Al(s,t,e){const i=bt(s),n=fs(t);if(t.includes(i))return t.indexOf(i)===0?[]:Gi(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 Yi(s,t)}const Ol={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Ws,ArrowDown:Ws};function Pl(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Dl(s,t,e){let i=Wn(s,t);if(!i)return null;let n=e(`button[data-date="${bt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Wn(i,t),n=e(`button[data-date="${bt(i)}"]`),!n)return null;return i}function Il(s){return Ol[s]??null}var Ll=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,J=(s,t,e,i)=>{for(var n=i>1?void 0:i?Bl(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&&Ll(t,e,n),n};let Y=class extends X{constructor(){super(...arguments),this.selected=[],this.multiple=Ke.props.multiple.default,this.maxMultiple=Ke.props.maxMultiple.default,this.range=Ke.props.range.default,this.earliest=Ke.props.earliest.default,this.latest=Ke.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=Ke.props.weeknumbers.default,this.withcontrols=Ke.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=fs(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=Ee(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?zs(new Date):t}else this.currentmonth===null&&(this.currentmonth=zs(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=zs(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const e=Il(t.key);e!==null&&this.handleArrowKey(t,e)}handleArrowKey(t,e){const i=t.target;if(Pl(i))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?me(this.focusedDate):Re(this.year,this.month,1),a=Dl(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 d`
|
|
206
206
|
<div
|
|
207
207
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
208
208
|
@focusout=${this.closeEvent}
|
|
209
209
|
@keydown=${t=>{t.key==="Escape"&&(t.preventDefault(),this.close())}}
|
|
210
210
|
>
|
|
211
211
|
<nav class="pkt-cal-month-nav">
|
|
212
|
-
|
|
213
|
-
<button
|
|
214
|
-
type="button"
|
|
215
|
-
aria-label="${this.prevMonthString}"
|
|
216
|
-
@click=${()=>this.isPrevMonthAllowed()&&this.prevMonth()}
|
|
217
|
-
@keydown=${t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.isPrevMonthAllowed()&&this.prevMonth())}}
|
|
218
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only pkt-calendar__prev-month ${this.isPrevMonthAllowed()?"":"pkt-hide"}"
|
|
219
|
-
.data-disabled=${this.isPrevMonthAllowed()?k:"disabled"}
|
|
220
|
-
?aria-disabled=${!this.isPrevMonthAllowed()}
|
|
221
|
-
tabindex=${this.isPrevMonthAllowed()?"0":"-1"}
|
|
222
|
-
>
|
|
223
|
-
<pkt-icon class="pkt-btn__icon" name="chevron-thin-left"></pkt-icon>
|
|
224
|
-
<span class="pkt-btn__text">${this.prevMonthString}</span>
|
|
225
|
-
</button>
|
|
226
|
-
</div>
|
|
212
|
+
${this.renderMonthNavButton("prev")}
|
|
227
213
|
${this.renderMonthNav()}
|
|
228
|
-
|
|
229
|
-
<button
|
|
230
|
-
type="button"
|
|
231
|
-
aria-label="${this.nextMonthString}"
|
|
232
|
-
@click=${()=>this.isNextMonthAllowed()&&this.nextMonth()}
|
|
233
|
-
@keydown=${t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.isNextMonthAllowed()&&this.nextMonth())}}
|
|
234
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only pkt-calendar__next-month ${this.isNextMonthAllowed()?"":"pkt-hide"}"
|
|
235
|
-
.data-disabled=${this.isNextMonthAllowed()?k:"disabled"}
|
|
236
|
-
?aria-disabled=${!this.isNextMonthAllowed()}
|
|
237
|
-
tabindex=${this.isNextMonthAllowed()?"0":"-1"}
|
|
238
|
-
>
|
|
239
|
-
<pkt-icon class="pkt-btn__icon" name="chevron-thin-right"></pkt-icon>
|
|
240
|
-
<span class="pkt-btn__text">${this.nextMonthString}</span>
|
|
241
|
-
</button>
|
|
242
|
-
</div>
|
|
214
|
+
${this.renderMonthNavButton("next")}
|
|
243
215
|
</nav>
|
|
244
216
|
<table
|
|
245
217
|
class="pkt-cal-days pkt-txt-12-medium pkt-calendar__body"
|
|
@@ -254,77 +226,80 @@
|
|
|
254
226
|
</tbody>
|
|
255
227
|
</table>
|
|
256
228
|
</div>
|
|
257
|
-
`}
|
|
229
|
+
`}renderMonthNavButton(t){const e=t==="prev",i=e?this.isPrevMonthAllowed():this.isNextMonthAllowed(),n=e?this.prevMonthString:this.nextMonthString,a=e?"chevron-thin-left":"chevron-thin-right",r=e?"pkt-calendar__prev-month":"pkt-calendar__next-month",h=e?()=>this.prevMonth():()=>this.nextMonth();return d`<div>
|
|
230
|
+
<button
|
|
231
|
+
type="button"
|
|
232
|
+
aria-label="${n}"
|
|
233
|
+
@click=${()=>i&&h()}
|
|
234
|
+
@keydown=${c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),i&&h())}}
|
|
235
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${r} ${i?"":"pkt-hide"}"
|
|
236
|
+
.data-disabled=${i?y:"disabled"}
|
|
237
|
+
?aria-disabled=${!i}
|
|
238
|
+
tabindex=${i?"0":"-1"}
|
|
239
|
+
>
|
|
240
|
+
<pkt-icon class="pkt-btn__icon" name="${a}"></pkt-icon>
|
|
241
|
+
<span class="pkt-btn__text">${n}</span>
|
|
242
|
+
</button>
|
|
243
|
+
</div>`}renderDayNames(){const t=[];this.weeknumbers&&t.push(d`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);for(let e=0;e<this.dayStrings.length;e++)t.push(d`<th>
|
|
258
244
|
<div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[e]}">
|
|
259
245
|
${this.dayStrings[e]}
|
|
260
246
|
</div>
|
|
261
|
-
</th>`);return
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
${this.monthStrings[this.month]} ${this.year}
|
|
286
|
-
</div>`),t}renderDayView(t,e){var i;const n=Ie(this.year,this.month,t),a=ut(n),r=a===ut(e),h=this.selected.includes(a),d=il(n),u=this.isExcluded(n)||!h&&this.multiple&&this.maxMultiple>0&&this.selected.length>=this.maxMultiple,g=this.focusedDate?this.focusedDate===a&&!u?"0":"-1":!u&&this.tabIndexSet===0||this.tabIndexSet===t?"0":"-1";g==="0"&&(this.tabIndexSet=t),this.selectableDates.push({currentDateISO:a,isDisabled:u,tabindex:g});const m={"pkt-cal-today":r,"pkt-cal-selected":h,"pkt-cal-in-range":this.inRange[a],"pkt-cal-excluded":this.isExcluded(n),"pkt-cal-in-range-first":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&a===this.selected[0],"pkt-cal-in-range-last":this.range&&this.selected.length===2&&a===this.selected[1],"pkt-cal-range-hover":this.rangeHovered!==null&&a===ut(this.rangeHovered)},$={"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":h,"pkt-calendar__date--disabled":u,"pkt-calendar__date--in-range":this.inRange[a],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&a===ut(this.rangeHovered),"pkt-calendar__date--range-start":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&a===this.selected[0],"pkt-calendar__date--range-end":this.range&&this.selected.length===2&&a===this.selected[1]};return c`<td class=${E(m)}>
|
|
247
|
+
</th>`);return d`<tr class="pkt-cal-week-row">${t}</tr>`}renderMonthNav(){return this.withcontrols?d`<div class="pkt-cal-month-picker">
|
|
248
|
+
<label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
|
|
249
|
+
<select
|
|
250
|
+
aria-label="${this.strings.dates.month}"
|
|
251
|
+
class="pkt-input pkt-input-compact"
|
|
252
|
+
id="${this.id}-monthnav"
|
|
253
|
+
@change=${t=>{t.stopImmediatePropagation();const e=t.target;this.changeMonth(this.year,parseInt(e.value))}}
|
|
254
|
+
>
|
|
255
|
+
${this.monthStrings.map((t,e)=>d`<option value=${e} ?selected=${this.month===e}>${t}</option>`)}
|
|
256
|
+
</select>
|
|
257
|
+
<label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
|
|
258
|
+
<input
|
|
259
|
+
aria-label="${this.strings.dates.year}"
|
|
260
|
+
class="pkt-input pkt-cal-input-year pkt-input-compact"
|
|
261
|
+
id="${this.id}-yearnav"
|
|
262
|
+
type="number"
|
|
263
|
+
size="4"
|
|
264
|
+
placeholder="0000"
|
|
265
|
+
@change=${t=>{t.stopImmediatePropagation();const e=t.target;this.changeMonth(parseInt(e.value),this.month)}}
|
|
266
|
+
.value=${this.year}
|
|
267
|
+
/>
|
|
268
|
+
</div>`:d`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
269
|
+
${this.monthStrings[this.month]} ${this.year}
|
|
270
|
+
</div>`}getDayViewData(t,e){const i=Re(this.year,this.month,t),n=bt(i),a=n===bt(e),r=this.selected.includes(n),h=this.isDayDisabled(i,r),c=this.calculateTabIndex(n,h,t);return{currentDate:i,currentDateISO:n,isToday:a,isSelected:r,isDisabled:h,ariaLabel:pl(i),tabindex:c}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(t,e){return wl(t,e,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(t,e,i){return this.focusedDate?this.focusedDate===t&&!e?"0":"-1":!e&&this.tabIndexSet===0?(this.tabIndexSet=i,"0"):this.tabIndexSet===i?"0":"-1"}getDayCellClasses(t){const{currentDateISO:e,isToday:i,isSelected:n}=t,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&e===this.selected[0],r=this.range&&this.selected.length===2&&e===this.selected[1];return{"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":this.inRange[e],"pkt-cal-excluded":this.isExcluded(t.currentDate),"pkt-cal-in-range-first":a,"pkt-cal-in-range-last":r,"pkt-cal-range-hover":this.rangeHovered!==null&&e===bt(this.rangeHovered)}}getDayButtonClasses(t){const{currentDateISO:e,isToday:i,isSelected:n,isDisabled:a}=t,r=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&e===this.selected[0],h=this.range&&this.selected.length===2&&e===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":a,"pkt-calendar__date--in-range":this.inRange[e],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&e===bt(this.rangeHovered),"pkt-calendar__date--range-start":r,"pkt-calendar__date--range-end":h}}handleDayFocus(t,e){this.range&&!this.isExcluded(t)&&this.handleRangeHover(t),this.focusedDate=e}renderDayView(t,e){const i=this.getDayViewData(t,e),{currentDate:n,currentDateISO:a,isSelected:r,isDisabled:h,ariaLabel:c,tabindex:p}=i;this.selectableDates.push({currentDateISO:a,isDisabled:h,tabindex:p});const m=this.getDayCellClasses(i),v=this.getDayButtonClasses(i);return d`<td class=${N(m)}>
|
|
287
271
|
<button
|
|
288
272
|
type="button"
|
|
289
|
-
aria-pressed=${
|
|
290
|
-
?disabled=${
|
|
291
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${
|
|
273
|
+
aria-pressed=${r?"true":"false"}
|
|
274
|
+
?disabled=${h}
|
|
275
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${N(v)}"
|
|
292
276
|
@mouseover=${()=>this.range&&!this.isExcluded(n)&&this.handleRangeHover(n)}
|
|
293
|
-
@focus=${()=>
|
|
294
|
-
aria-label="${
|
|
295
|
-
tabindex=${
|
|
296
|
-
data-disabled=${
|
|
277
|
+
@focus=${()=>this.handleDayFocus(n,a)}
|
|
278
|
+
aria-label="${c}"
|
|
279
|
+
tabindex=${p}
|
|
280
|
+
data-disabled=${h?"disabled":y}
|
|
297
281
|
data-date=${a}
|
|
298
|
-
@keydown=${
|
|
299
|
-
@click=${
|
|
282
|
+
@keydown=${$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),this.handleDateSelect(n))}}
|
|
283
|
+
@click=${$=>{h||($.preventDefault(),this.handleDateSelect(n))}}
|
|
300
284
|
>
|
|
301
285
|
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
302
286
|
</button>
|
|
303
|
-
</td>`}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
<div
|
|
312
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
313
|
-
data-disabled="disabled"
|
|
314
|
-
>
|
|
315
|
-
<span class="pkt-btn__text pkt-txt-14-light">${d-a}</span>
|
|
316
|
-
</div>
|
|
317
|
-
</td>`),d++):(m.push(this.renderDayView(d,t)),d++);u.push(c`<tr class="pkt-cal-week-row" role="row">
|
|
318
|
-
${m}
|
|
319
|
-
</tr>`)}return u}isExcluded(t){const e=this.excludedates.map(i=>typeof i=="string"?i:ut(i));return!ia(t,this.earliest,this.latest,e,this.excludeweekdays)}isPrevMonthAllowed(){const t=Ie(this.year,this.month,0);return!(this.earliest&&$e(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){const t=Ie(this.month===11?this.year+1:this.year,this.month===11?0:this.month+1,1);return!(this.latest&&$e(this.latest)<t)}nextMonth(){const t=this.month===11?0:this.month+1,e=this.month===11?this.year+1:this.year;this.changeMonth(e,t)}changeMonth(t,e){this.year=typeof t=="string"?parseInt(t):t,this.month=typeof e=="string"?parseInt(e):e,this.currentmonth=Ks(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}isRangeAllowed(t){let e=!0;if(this._selected.length===1){const i=qi({start:this._selected[0],end:t});if(Array.isArray(i)&&i.length)for(let n=0;n<i.length;n++)this.excludedates.forEach(a=>{a>this._selected[0]&&a<t&&(e=!1)}),this.excludeweekdays.includes(Jo(i[n]).toString())&&(e=!1)}return e}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(t){this.selected.includes(ut(t))||(this.selected=[...this.selected,ut(t)],this._selected=[...this._selected,t],this.range&&this.selected.length===2&&(this.convertSelected(),this.close()))}removeFromSelected(t){if(this.selected.length===1)this.emptySelected();else{const e=this.selected.indexOf(ut(t)),i=[...this.selected],n=[...this._selected];i.splice(e,1),n.splice(e,1),this.selected=i,this._selected=n}}toggleSelected(t){const e=ut(t);this.selected.includes(e)?this.removeFromSelected(t):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(t)}handleRangeSelect(t){const e=ut(t);return this.selected.includes(e)?this.selected.indexOf(e)===0?this.emptySelected():this.removeFromSelected(t):this.selected.length>1?(this.emptySelected(),this.addToSelected(t)):(this.selected.length===1&&!this.isRangeAllowed(t)&&this.emptySelected(),this.selected.length===1&&this._selected[0]>t&&this.emptySelected(),this.addToSelected(t)),Promise.resolve()}handleRangeHover(t){if(this.range&&this._selected.length===1&&this.isRangeAllowed(t)&&this._selected[0]<t){this.rangeHovered=t,this.inRange={};const e=qi({start:this._selected[0],end:t});if(Array.isArray(e)&&e.length)for(let i=0;i<e.length;i++){const n=e[i],a=n>this._selected[0]&&n<t;this.inRange[ut(n)]=a}}else this.rangeHovered=null}handleDateSelect(t){if(t)return this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(ut(t))?this.emptySelected():(this.emptySelected(),this.addToSelected(t)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0})),Promise.resolve()}focusOnCurrentDate(){const t=ut(Ks(new Date)),e=this.querySelector(`button[data-date="${t}"]`);if(e instanceof HTMLButtonElement)this.focusedDate=t,e.focus();else{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(t){!this.contains(t.relatedTarget)&&!t.target.classList.contains("pkt-hide")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};J([o({type:Boolean})],G.prototype,"multiple",2),J([o({type:Number})],G.prototype,"maxMultiple",2),J([o({type:Boolean})],G.prototype,"range",2),J([o({type:Boolean})],G.prototype,"weeknumbers",2),J([o({type:Boolean})],G.prototype,"withcontrols",2),J([o({converter:bs.csvToArray})],G.prototype,"selected",2),J([o({type:String})],G.prototype,"earliest",2),J([o({type:String})],G.prototype,"latest",2),J([o({converter:bs.stringsToDate})],G.prototype,"excludedates",2),J([o({converter:bs.csvToArray})],G.prototype,"excludeweekdays",2),J([o({converter:bs.stringToDate})],G.prototype,"currentmonth",2),J([o({type:Array})],G.prototype,"dayStrings",2),J([o({type:Array})],G.prototype,"dayStringsLong",2),J([o({type:Array})],G.prototype,"monthStrings",2),J([o({type:String})],G.prototype,"weekString",2),J([o({type:String})],G.prototype,"prevMonthString",2),J([o({type:String})],G.prototype,"nextMonthString",2),J([o({type:Array})],G.prototype,"_selected",2),J([o({type:Number})],G.prototype,"year",2),J([o({type:Number})],G.prototype,"month",2),J([o({type:Number})],G.prototype,"week",2),J([o({type:Date})],G.prototype,"rangeHovered",2),J([D()],G.prototype,"inRange",2),J([D()],G.prototype,"focusedDate",2),J([D()],G.prototype,"selectableDates",2),J([D()],G.prototype,"currentmonthtouched",2),J([D()],G.prototype,"tabIndexSet",2),G=J([F("pkt-calendar")],G);const gl={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},xi={props:gl};var ml=Object.defineProperty,vl=Object.getOwnPropertyDescriptor,fe=(s,t,e,i)=>{for(var n=i>1?void 0:i?vl(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&&ml(t,e,n),n};let re=class extends R{constructor(){super(),this.defaultSlot=N(),this.closeTag=xi.props.closeTag.default,this.size=xi.props.size.default,this.skin=xi.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=xi.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!1,composed:!0}))},this.slotController=new rt(this,this.defaultSlot),this._isClosed=!1}firstUpdated(t){var e,i;if(super.firstUpdated(t),this.closeTag&&!this.ariaLabel){const n=(i=(e=this.defaultSlot.value)==null?void 0:e.textContent)==null?void 0:i.trim();n&&(this._ariaDescription=`Klikk for å fjerne ${n}`)}}render(){const t={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},e={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?c`
|
|
287
|
+
</td>`}renderEmptyDayCell(t){return d`<td class="pkt-cal-other">
|
|
288
|
+
<div
|
|
289
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
290
|
+
data-disabled="disabled"
|
|
291
|
+
>
|
|
292
|
+
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
293
|
+
</div>
|
|
294
|
+
</td>`}renderWeekRow(t){return d`<tr class="pkt-cal-week-row" role="row">${t}</tr>`}renderCalendarBody(){const t=ul(),e=Tl(this.year,this.month);let i=1;this.week=e.initialWeek;const n=[];for(let a=0;a<e.numRows;a++){const r=[];this.weeknumbers&&r.push(d`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let h=0;h<Ws;h++){const c=Nl(a,h,i,e);if(c==="current-month")r.push(this.renderDayView(i,t)),i++;else{const p=El(c,h,i,e);r.push(this.renderEmptyDayCell(p)),c==="next-month"&&i++}}n.push(this.renderWeekRow(r))}return n}isExcluded(t){return ua(t,this.getDateConstraints())}isPrevMonthAllowed(){return xl(this.year,this.month,this.earliest)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){return Sl(this.year,this.month,this.latest)}nextMonth(){const t=this.month===11?0:this.month+1,e=this.month===11?this.year+1:this.year;this.changeMonth(e,t)}changeMonth(t,e){this.year=typeof t=="string"?parseInt(t):t,this.month=typeof e=="string"?parseInt(e):e,this.currentmonth=zs(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(t){this.selected=Yi(t,this.normalizeSelected()),this._selected=fs(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(t){this.selected=Gi(t,this.normalizeSelected()),this._selected=fs(this.selected)}toggleSelected(t){this.selected=Ml(t,this.normalizeSelected(),this.maxMultiple),this._selected=fs(this.selected)}isRangeAllowed(t){return fa(t,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(t){return this.selected=Al(t,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=fs(this.selected),this.selected.length===2?this.convertSelected():this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(t){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(t)||this._selected[0]>=t){this.rangeHovered=null;return}this.rangeHovered=t,this.inRange=pa(this._selected[0],t)}handleDateSelect(t){return t&&(this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(bt(t))?this.emptySelected():(this.emptySelected(),this.addToSelected(t)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0}))),Promise.resolve()}focusOnCurrentDate(){const t=bt(zs(new Date)),e=this.querySelector(`button[data-date="${t}"]`);if(e instanceof HTMLButtonElement){this.focusedDate=t,e.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(t){!this.contains(t.relatedTarget)&&!t.target.classList.contains("pkt-hide")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};J([o({converter:ps.csvToArray})],Y.prototype,"selected",2),J([o({type:Boolean})],Y.prototype,"multiple",2),J([o({type:Number})],Y.prototype,"maxMultiple",2),J([o({type:Boolean})],Y.prototype,"range",2),J([o({type:String})],Y.prototype,"earliest",2),J([o({type:String})],Y.prototype,"latest",2),J([o({converter:ps.stringsToDate})],Y.prototype,"excludedates",2),J([o({converter:ps.csvToArray})],Y.prototype,"excludeweekdays",2),J([o({type:Boolean})],Y.prototype,"weeknumbers",2),J([o({type:Boolean})],Y.prototype,"withcontrols",2),J([o({converter:ps.stringToDate})],Y.prototype,"currentmonth",2),J([o({type:Array})],Y.prototype,"dayStrings",2),J([o({type:Array})],Y.prototype,"dayStringsLong",2),J([o({type:Array})],Y.prototype,"monthStrings",2),J([o({type:String})],Y.prototype,"weekString",2),J([o({type:String})],Y.prototype,"prevMonthString",2),J([o({type:String})],Y.prototype,"nextMonthString",2),J([o({type:Array})],Y.prototype,"_selected",2),J([D()],Y.prototype,"inRange",2),J([o({type:Date})],Y.prototype,"rangeHovered",2),J([o({type:Number})],Y.prototype,"year",2),J([o({type:Number})],Y.prototype,"month",2),J([o({type:Number})],Y.prototype,"week",2),J([D()],Y.prototype,"currentmonthtouched",2),J([D()],Y.prototype,"focusedDate",2),J([D()],Y.prototype,"selectableDates",2),J([D()],Y.prototype,"tabIndexSet",2),Y=J([F("pkt-calendar")],Y);const Fl={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},_i={props:Fl};var jl=Object.defineProperty,Hl=Object.getOwnPropertyDescriptor,he=(s,t,e,i)=>{for(var n=i>1?void 0:i?Hl(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&&jl(t,e,n),n};let ee=class extends X{constructor(){super(),this.defaultSlot=E(),this.closeTag=_i.props.closeTag.default,this.size=_i.props.size.default,this.skin=_i.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=_i.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!1,composed:!0}))},this.slotController=new rt(this,this.defaultSlot),this._isClosed=!1}firstUpdated(t){var e,i;if(super.firstUpdated(t),this.closeTag&&!this.ariaLabel){const n=(i=(e=this.defaultSlot.value)==null?void 0:e.textContent)==null?void 0:i.trim();n&&(this._ariaDescription=`Klikk for å fjerne ${n}`)}}render(){const t={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},e={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?d`
|
|
320
295
|
<button
|
|
321
|
-
class=${
|
|
296
|
+
class=${N(e)}
|
|
322
297
|
type=${this.type}
|
|
323
298
|
@click=${this.close}
|
|
324
299
|
aria-label=${C(this.ariaLabel||void 0)}
|
|
325
300
|
aria-description=${C(this._ariaDescription||void 0)}
|
|
326
301
|
>
|
|
327
|
-
${this.iconName&&
|
|
302
|
+
${this.iconName&&d`<pkt-icon
|
|
328
303
|
class="pkt-tag__icon"
|
|
329
304
|
name=${this.iconName}
|
|
330
305
|
aria-hidden="true"
|
|
@@ -332,37 +307,37 @@
|
|
|
332
307
|
<span ${M(this.defaultSlot)}></span>
|
|
333
308
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
334
309
|
</button>
|
|
335
|
-
`:
|
|
336
|
-
<span class=${
|
|
337
|
-
${this.iconName&&
|
|
310
|
+
`:d`
|
|
311
|
+
<span class=${N(t)}>
|
|
312
|
+
${this.iconName&&d`<pkt-icon
|
|
338
313
|
class="pkt-tag__icon"
|
|
339
314
|
name=${this.iconName}
|
|
340
315
|
aria-hidden="true"
|
|
341
316
|
></pkt-icon>`}
|
|
342
317
|
<span ${M(this.defaultSlot)}></span>
|
|
343
318
|
</span>
|
|
344
|
-
`}};
|
|
319
|
+
`}};he([o({type:Boolean,reflect:!0})],ee.prototype,"closeTag",2),he([o({type:String,reflect:!0})],ee.prototype,"size",2),he([o({type:String,reflect:!0})],ee.prototype,"skin",2),he([o({type:String,reflect:!0})],ee.prototype,"textStyle",2),he([o({type:String,reflect:!0})],ee.prototype,"iconName",2),he([o({type:String})],ee.prototype,"type",2),he([o({type:String})],ee.prototype,"ariaLabel",2),he([D()],ee.prototype,"_isClosed",2),he([D()],ee.prototype,"_ariaDescription",2),ee=he([F("pkt-tag")],ee);var Vl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,gs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ul(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&&Vl(t,e,n),n};let Ae=class extends pi{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(t,e,i){super.attributeChangedCallback(t,e,i),t==="level"&&i&&this.setLevel(Number(i)),t==="visuallyHidden"&&(this.visuallyHidden=i!==null&&i!=="false"),(t==="size"||t==="visuallyHidden"||t==="align"||t==="weight")&&this.updateHostClasses()}updated(t){super.updated(t),t.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(t.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(t.has("size")||t.has("visuallyHidden")||t.has("align")||t.has("weight"))&&this.updateHostClasses()}setLevel(t){t>=1&&t<=6?(this.level=t,this.setAttribute("aria-level",String(t))):console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}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 d`<slot></slot>`}};gs([o({type:String,reflect:!0})],Ae.prototype,"size",2),gs([o({type:Number,reflect:!0})],Ae.prototype,"level",2),gs([o({type:String,reflect:!0})],Ae.prototype,"weight",2),gs([o({type:Boolean,reflect:!0})],Ae.prototype,"visuallyHidden",2),gs([o({type:String,reflect:!0})],Ae.prototype,"align",2),Ae=gs([F("pkt-heading")],Ae);const zl={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},ms={props:zl};var ql=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,$t=(s,t,e,i)=>{for(var n=i>1?void 0:i?Wl(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&&ql(t,e,n),n};let ft=class extends X{constructor(){super(),this.defaultSlot=E(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=ms.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=ms.props.padding.default,this.skin=ms.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var t,e;const i={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},n=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),a=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?this.heading:"kort");return d`
|
|
345
320
|
<article
|
|
346
|
-
class=${
|
|
321
|
+
class=${N(i)}
|
|
347
322
|
aria-label=${C(this.clickCardLink?n:a)}
|
|
348
323
|
>
|
|
349
324
|
${this.renderImage()}
|
|
350
325
|
<div class="pkt-card__wrapper">
|
|
351
|
-
${this.tagPosition==="top"?this.renderTags():
|
|
326
|
+
${this.tagPosition==="top"?this.renderTags():y}
|
|
352
327
|
${this.renderHeader()}
|
|
353
328
|
${this.renderSlot()}
|
|
354
|
-
${this.tagPosition==="bottom"?this.renderTags():
|
|
329
|
+
${this.tagPosition==="bottom"?this.renderTags():y}
|
|
355
330
|
${this.renderMetadata()}
|
|
356
331
|
</div>
|
|
357
332
|
</article>
|
|
358
|
-
`}renderImage(){const t={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return
|
|
359
|
-
${this.image.src&&
|
|
360
|
-
<div class=${
|
|
333
|
+
`}renderImage(){const t={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return d`
|
|
334
|
+
${this.image.src&&d`
|
|
335
|
+
<div class=${N(t)}>
|
|
361
336
|
<img src=${this.image.src} alt=${this.image.alt||""} />
|
|
362
337
|
</div>
|
|
363
338
|
`}
|
|
364
|
-
`}renderHeading(){return
|
|
365
|
-
${this.heading&&!this.clickCardLink?
|
|
339
|
+
`}renderHeading(){return d`
|
|
340
|
+
${this.heading&&!this.clickCardLink?d`
|
|
366
341
|
<pkt-heading
|
|
367
342
|
class="pkt-card__heading"
|
|
368
343
|
.level=${this.headinglevel||3}
|
|
@@ -372,9 +347,9 @@
|
|
|
372
347
|
>
|
|
373
348
|
${this.heading}
|
|
374
349
|
</pkt-heading>
|
|
375
|
-
`:
|
|
376
|
-
`}renderLinkHeading(){return
|
|
377
|
-
${this.clickCardLink?
|
|
350
|
+
`:y}
|
|
351
|
+
`}renderLinkHeading(){return d`
|
|
352
|
+
${this.clickCardLink?d`
|
|
378
353
|
<pkt-heading
|
|
379
354
|
class="pkt-card__link-heading pkt-card__heading"
|
|
380
355
|
.level=${this.headinglevel||3}
|
|
@@ -389,25 +364,25 @@
|
|
|
389
364
|
>${this.heading}</a
|
|
390
365
|
>
|
|
391
366
|
</pkt-heading>
|
|
392
|
-
`:
|
|
393
|
-
`}renderSubheading(){return
|
|
394
|
-
${this.subheading?
|
|
395
|
-
`}renderHeader(){const t=!!this.heading||!!this.subheading;return
|
|
396
|
-
${t?
|
|
367
|
+
`:y}
|
|
368
|
+
`}renderSubheading(){return d`
|
|
369
|
+
${this.subheading?d` <p class="pkt-card__subheading ">${this.subheading}</p> `:y}
|
|
370
|
+
`}renderHeader(){const t=!!this.heading||!!this.subheading;return d`
|
|
371
|
+
${t?d`
|
|
397
372
|
<header class="pkt-card__header">
|
|
398
373
|
${this.renderHeading()}
|
|
399
374
|
${this.renderLinkHeading()}
|
|
400
375
|
${this.renderSubheading()}
|
|
401
376
|
</header>
|
|
402
|
-
`:
|
|
403
|
-
`}renderTags(){const t={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return
|
|
404
|
-
${this.tags.length>0?
|
|
377
|
+
`:y}
|
|
378
|
+
`}renderTags(){const t={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return d`
|
|
379
|
+
${this.tags.length>0?d`
|
|
405
380
|
<div
|
|
406
|
-
class=${
|
|
381
|
+
class=${N(t)}
|
|
407
382
|
role="list"
|
|
408
383
|
aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
|
|
409
384
|
>
|
|
410
|
-
${this.tags.map(e=>
|
|
385
|
+
${this.tags.map(e=>d`
|
|
411
386
|
<pkt-tag
|
|
412
387
|
role="listitem"
|
|
413
388
|
textStyle="normal-text"
|
|
@@ -419,21 +394,21 @@
|
|
|
419
394
|
</pkt-tag>
|
|
420
395
|
`)}
|
|
421
396
|
</div>
|
|
422
|
-
`:
|
|
423
|
-
`}renderSlot(){return
|
|
424
|
-
${this.defaultSlot&&
|
|
425
|
-
`}renderMetadata(){return
|
|
426
|
-
${this.metaLead||this.metaTrail?
|
|
397
|
+
`:y}
|
|
398
|
+
`}renderSlot(){return d`
|
|
399
|
+
${this.defaultSlot&&d`<section class="pkt-card__content" ${M(this.defaultSlot)}></section>`}
|
|
400
|
+
`}renderMetadata(){return d`
|
|
401
|
+
${this.metaLead||this.metaTrail?d`
|
|
427
402
|
<footer class="pkt-card__metadata">
|
|
428
|
-
${this.metaLead?
|
|
429
|
-
${this.metaTrail?
|
|
403
|
+
${this.metaLead?d`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:y}
|
|
404
|
+
${this.metaTrail?d`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:y}
|
|
430
405
|
</footer>
|
|
431
|
-
`:
|
|
432
|
-
`}};$t([o({type:String})],
|
|
406
|
+
`:y}
|
|
407
|
+
`}};$t([o({type:String})],ft.prototype,"ariaLabel",2),$t([o({type:String})],ft.prototype,"metaLead",2),$t([o({type:Boolean})],ft.prototype,"borderOnHover",2),$t([o({type:String,reflect:!0})],ft.prototype,"clickCardLink",2),$t([o({type:String})],ft.prototype,"metaTrail",2),$t([o({type:String})],ft.prototype,"layout",2),$t([o({type:String})],ft.prototype,"heading",2),$t([o({type:Number})],ft.prototype,"headinglevel",2),$t([o({type:Object})],ft.prototype,"image",2),$t([o({type:String})],ft.prototype,"imageShape",2),$t([o({type:Boolean})],ft.prototype,"openLinkInNewTab",2),$t([o({type:String})],ft.prototype,"padding",2),$t([o({type:String,converter:{fromAttribute:s=>{const t=ms.props.skin.type;return s&&t.includes(s)?s:(s&&!t.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${ms.props.skin.default}".`),ms.props.skin.default)},toAttribute:s=>s}})],ft.prototype,"skin",2),$t([o({type:String})],ft.prototype,"subheading",2),$t([o({type:String})],ft.prototype,"tagPosition",2),$t([o({type:Array})],ft.prototype,"tags",2),ft=$t([F("pkt-card")],ft);/**
|
|
433
408
|
* @license
|
|
434
409
|
* Copyright 2017 Google LLC
|
|
435
410
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
436
|
-
*/const ra=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Yi=We(class extends us{constructor(s){if(super(s),s.type!==ne.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=xr(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 u,g,m=0,$=n.length-1,b=0,y=a.length-1;for(;m<=$&&b<=y;)if(n[m]===null)m++;else if(n[$]===null)$--;else if(h[m]===r[b])d[b]=Re(n[m],a[b]),m++,b++;else if(h[$]===r[y])d[y]=Re(n[$],a[y]),$--,y--;else if(h[m]===r[y])d[y]=Re(n[m],a[y]),Fs(s,d[y+1],n[m]),m++,y--;else if(h[$]===r[b])d[b]=Re(n[$],a[b]),Fs(s,n[m],n[$]),$--,b++;else if(u===void 0&&(u=ra(r,b,y),g=ra(h,m,$)),u.has(h[m]))if(u.has(h[$])){const x=g.get(r[b]),T=x!==void 0?n[x]:null;if(T===null){const S=Fs(s,n[m]);Re(S,a[b]),d[b]=S}else d[b]=Re(T,a[b]),Fs(s,n[m],T),n[x]=null;b++}else Fi(n[$]),$--;else Fi(n[m]),m++;for(;b<=y;){const x=Fs(s,d[y+1]);Re(x,a[b]),d[b++]=x}for(;m<=$;){const x=n[m++];x!==null&&Fi(x)}return this.ut=r,In(s,d),Dt}}),oa=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),wl=s=>new Promise(t=>setTimeout(t,s)),Be=()=>{const s=oa(),t=oa();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},xl={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}},Vt={props:xl};var Sl={},la;function Cl(){return la||(la=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,u=new WeakMap,g=new WeakMap,m=new WeakMap,$=new WeakMap,b=new WeakMap,y=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"},S=(f,p)=>{for(let v in T){p[v]=null;let w=null;const B=T[v];Object.defineProperty(p,v,{get(){return w},set(U){w=U,f.isConnected?kt(f,B,U):g.set(f,p)}})}};function A(f){const p=n.get(f),{form:v}=p;ce(f,v,p),ke(f,p.labels)}const I=(f,p=!1)=>{const v=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(U){return n.has(U)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let w=v.nextNode();const B=!p||f.disabled;for(;w;)w.formDisabledCallback&&B&&Yt(w,f.disabled),w=v.nextNode()},O={attributes:!0,attributeFilter:["disabled","name"]},K=ee()?new MutationObserver(f=>{for(const p of f){const v=p.target;if(p.attributeName==="disabled"&&(v.constructor.formAssociated?Yt(v,v.hasAttribute("disabled")):v.localName==="fieldset"&&I(v)),p.attributeName==="name"&&v.constructor.formAssociated){const w=n.get(v),B=u.get(v);w.setFormValue(B)}}}):{};function et(f){f.forEach(p=>{const{addedNodes:v,removedNodes:w}=p,B=Array.from(v),U=Array.from(w);B.forEach(z=>{var Gt;if(n.has(z)&&z.constructor.formAssociated&&A(z),g.has(z)){const St=g.get(z);Object.keys(T).filter(Zt=>St[Zt]!==null).forEach(Zt=>{kt(z,T[Zt],St[Zt])}),g.delete(z)}if(x.has(z)){const St=x.get(z);kt(z,"internals-valid",St.validity.valid.toString()),kt(z,"internals-invalid",(!St.validity.valid).toString()),kt(z,"aria-invalid",(!St.validity.valid).toString()),x.delete(z)}if(z.localName==="form"){const St=d.get(z),Zt=document.createTreeWalker(z,NodeFilter.SHOW_ELEMENT,{acceptNode(rn){return n.has(rn)&&rn.constructor.formAssociated&&!(St&&St.has(rn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ri=Zt.nextNode();for(;ri;)A(ri),ri=Zt.nextNode()}z.localName==="fieldset"&&((Gt=K.observe)===null||Gt===void 0||Gt.call(K,z,O),I(z,!0))}),U.forEach(z=>{const Gt=n.get(z);Gt&&i.get(Gt)&&Nt(Gt),h.has(z)&&h.get(z).disconnect()})})}function Ot(f){f.forEach(p=>{const{removedNodes:v}=p;v.forEach(w=>{const B=b.get(p.target);n.has(w)&&Te(w),B.disconnect()})})}const Et=f=>{var p,v;const w=new MutationObserver(Ot);!((p=window==null?void 0:window.ShadyDOM)===null||p===void 0)&&p.inUse&&f.mode&&f.host&&(f=f.host),(v=w.observe)===null||v===void 0||v.call(w,f,{childList:!0}),b.set(f,w)};ee()&&new MutationObserver(et);const it={childList:!0,subtree:!0},kt=(f,p,v)=>{f.getAttribute(p)!==v&&f.setAttribute(p,v)},Yt=(f,p)=>{f.toggleAttribute("internals-disabled",p),p?kt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[p])},Nt=f=>{i.get(f).forEach(p=>{p.remove()}),i.set(f,[])},ct=(f,p)=>{const v=document.createElement("input");return v.type="hidden",v.name=f.getAttribute("name"),f.after(v),i.get(p).push(v),v},de=(f,p)=>{var v;i.set(p,[]),(v=K.observe)===null||v===void 0||v.call(K,f,O)},ke=(f,p)=>{if(p.length){Array.from(p).forEach(w=>w.addEventListener("click",f.click.bind(f)));let v=p[0].id;p[0].id||(v=`${p[0].htmlFor}_Label`,p[0].id=v),kt(f,"aria-labelledby",v)}},V=f=>{const p=Array.from(f.elements).filter(U=>!U.tagName.includes("-")&&U.validity).map(U=>U.validity.valid),v=d.get(f)||[],w=Array.from(v).filter(U=>U.isConnected).map(U=>n.get(U).validity.valid),B=[...p,...w].includes(!1);f.toggleAttribute("internals-invalid",B),f.toggleAttribute("internals-valid",!B)},xt=f=>{V(jt(f.target))},te=f=>{V(jt(f.target))},Se=f=>{const p=["button[type=submit]","input[type=submit]","button:not([type])"].map(v=>`${v}:not([disabled])`).map(v=>`${v}:not([form])${f.id?`,${v}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",v=>{if(v.target.closest(p)){const w=d.get(f);if(f.noValidate)return;w.size&&Array.from(w).reverse().map(B=>n.get(B).reportValidity()).includes(!1)&&v.preventDefault()}})},ye=f=>{const p=d.get(f.target);p&&p.size&&p.forEach(v=>{v.constructor.formAssociated&&v.formResetCallback&&v.formResetCallback.apply(v)})},ce=(f,p,v)=>{if(p){const w=d.get(p);if(w)w.add(f);else{const B=new Set;B.add(f),d.set(p,B),Se(p),p.addEventListener("reset",ye),p.addEventListener("input",xt),p.addEventListener("change",te)}r.set(p,{ref:f,internals:v}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[p])},0),V(p)}},jt=f=>{let p=f.parentNode;return p&&p.tagName!=="FORM"&&(p=jt(p)),p},pt=(f,p,v=DOMException)=>{if(!f.constructor.formAssociated)throw new v(p)},Ce=(f,p,v)=>{const w=d.get(f);return w&&w.size&&w.forEach(B=>{n.get(B)[v]()||(p=!1)}),p},Te=f=>{if(f.constructor.formAssociated){const p=n.get(f),{labels:v,form:w}=p;ke(f,v),ce(f,w,p)}};function ee(){return typeof MutationObserver<"u"}class Ns{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 He=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),rs=(f,p,v)=>(f.valid=os(p),Object.keys(p).forEach(w=>f[w]=p[w]),v&&V(v),f),os=f=>{let p=!0;for(let v in f)v!=="valid"&&f[v]!==!1&&(p=!1);return p},Ee=new WeakMap;function se(f,p){f.toggleAttribute(p,!0),f.part&&f.part.add(p)}class Ne extends Set{static get isPolyfilled(){return!0}constructor(p){if(super(),!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Ee.set(this,p)}add(p){if(!/^--/.test(p)||typeof p!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${p} must start with '--'.`);const v=super.add(p),w=Ee.get(this),B=`state${p}`;return w.isConnected?se(w,B):setTimeout(()=>{se(w,B)}),v}clear(){for(let[p]of this.entries())this.delete(p);super.clear()}delete(p){const v=super.delete(p),w=Ee.get(this);return w.isConnected?(w.toggleAttribute(`state${p}`,!1),w.part&&w.part.remove(`state${p}`)):setTimeout(()=>{w.toggleAttribute(`state${p}`,!1),w.part&&w.part.remove(`state${p}`)}),v}}function ls(f,p,v,w){if(typeof p=="function"?f!==p||!w:!p.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return v==="m"?w:v==="a"?w.call(f):w?w.value:p.get(f)}function Mt(f,p,v,w,B){if(typeof p=="function"?f!==p||!0:!p.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return p.set(f,v),v}var yt;class Ms{constructor(p){yt.set(this,void 0),Mt(this,yt,p);for(let v=0;v<p.length;v++){let w=p[v];this[v]=w,w.hasAttribute("name")&&(this[w.getAttribute("name")]=w)}Object.freeze(this)}get length(){return ls(this,yt,"f").length}[(yt=new WeakMap,Symbol.iterator)](){return ls(this,yt,"f")[Symbol.iterator]()}item(p){return this[p]==null?null:this[p]}namedItem(p){return this[p]==null?null:this[p]}}function Ve(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=v;const p=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=w;function v(...U){let z=f.apply(this,U);return Ce(this,z,"checkValidity")}function w(...U){let z=p.apply(this,U);return Ce(this,z,"reportValidity")}const{get:B}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...U){const z=B.call(this,...U),Gt=Array.from(d.get(this)||[]);if(Gt.length===0)return z;const St=Array.from(z).concat(Gt).sort((Zt,ri)=>Zt.compareDocumentPosition?Zt.compareDocumentPosition(ri)&2?1:-1:0);return new Ms(St)}})}class ni{static get isPolyfilled(){return!0}constructor(p){if(!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const v=p.getRootNode(),w=new Ns;this.states=new Ne(p),t.set(this,p),e.set(this,w),n.set(p,this),S(p,this),de(p,this),Object.seal(this),v instanceof DocumentFragment&&Et(v)}checkValidity(){const p=t.get(this);if(pt(p,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=e.get(this);if(!v.valid){const w=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});p.dispatchEvent(w)}return v.valid}get form(){const p=t.get(this);pt(p,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let v;return p.constructor.formAssociated===!0&&(v=jt(p)),v}get labels(){const p=t.get(this);pt(p,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const v=p.getAttribute("id"),w=p.getRootNode();return w&&v?w.querySelectorAll(`[for="${v}"]`):[]}reportValidity(){const p=t.get(this);if(pt(p,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=this.checkValidity(),w=$.get(this);if(w&&!p.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!v&&w&&(p.focus(),w.focus()),v}setFormValue(p){const v=t.get(this);if(pt(v,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Nt(this),p!=null&&!(p instanceof FormData)){if(v.getAttribute("name")){const w=ct(v,this);w.value=p}}else p!=null&&p instanceof FormData&&Array.from(p).reverse().forEach(([w,B])=>{if(typeof B=="string"){const U=ct(v,this);U.name=w,U.value=B}});u.set(v,p)}setValidity(p,v,w){const B=t.get(this);if(pt(B,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!p)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");$.set(this,w);const U=e.get(this),z={};for(const Zt in p)z[Zt]=p[Zt];Object.keys(z).length===0&&He(U);const Gt=Object.assign(Object.assign({},U),z);delete Gt.valid;const{valid:St}=rs(U,Gt,this.form);if(!St&&!v)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");a.set(this,St?"":v),B.isConnected?(B.toggleAttribute("internals-invalid",!St),B.toggleAttribute("internals-valid",St),kt(B,"aria-invalid",`${!St}`)):x.set(B,this)}get shadowRoot(){const p=t.get(this);return m.get(p)||null}get validationMessage(){const p=t.get(this);return pt(p,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const p=t.get(this);return pt(p,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const p=t.get(this);return pt(p,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(p.disabled||p.hasAttribute("disabled")||p.hasAttribute("readonly"))}}function Ai(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const p=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(p,f);const v=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(w=>w in v.internals)}let As=!1,ai=!1;function j(f){ai||(ai=!0,window.CustomStateSet=Ne,f&&(HTMLElement.prototype.attachInternals=function(...p){const v=f.call(this,p);return v.states=new Ne(this),v}))}function Pt(f=!0){if(!As){if(As=!0,typeof window<"u"&&(window.ElementInternals=ni),typeof CustomElementRegistry<"u"){const p=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(v,w,B){if(w.formAssociated){const U=w.prototype.connectedCallback;w.prototype.connectedCallback=function(){y.has(this)||(y.set(this,!0),this.hasAttribute("disabled")&&Yt(this,!0)),U!=null&&U.apply(this),Te(this)}}p.call(this,v,w,B)}}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 ni(this)}),typeof Element<"u"){let p=function(...w){const B=v.apply(this,w);if(m.set(this,B),ee()){const U=new MutationObserver(et);window.ShadyDOM?U.observe(this,it):U.observe(B,it),h.set(this,U)}return B};const v=Element.prototype.attachShadow;Element.prototype.attachShadow=p}ee()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&Ve(),(f||typeof window<"u"&&!window.CustomStateSet)&&j()}}return customElements.polyfillWrapFlushCallback||(Ai()?typeof window<"u"&&!window.CustomStateSet&&j(HTMLElement.prototype.attachInternals):Pt(!1)),s.forceCustomStateSetPolyfill=j,s.forceElementInternalsPolyfill=Pt,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Sl}Cl();var Tl=Object.defineProperty,H=(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&&Tl(t,e,n),n};const El={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}};let L=class extends R{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=Be(),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=Vt.props.helptextDropdownButton.default,this.label=null,this.optionalText=At.forms.labels.optional,this.requiredText=At.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,u,g,m,$;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},At.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},At.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},At.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},At.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},At.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?At.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):At.forms.messages.rangeUnderflow,t):(u=t.validity)!=null&&u.stepMismatch?this.internals.setValidity({stepMismatch:!0},At.forms.messages.invalid,t):(g=t.validity)!=null&&g.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?At.forms.messages.rangeOverflowMax.replace("{max}",(m=this.max)==null?void 0:m.toString()):At.forms.messages.rangeOverflow,t):($=t.validity)!=null&&$.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(n=>{const a=n;a.name===this.name&&a.value!==this.value&&a.checked&&(a.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};H([o()],L.prototype,"defaultValue"),H([o({type:Boolean,reflect:!0})],L.prototype,"disabled"),H([o({type:Boolean,reflect:!0})],L.prototype,"readonly"),H([o({type:Boolean,reflect:!0})],L.prototype,"required"),H([o({type:Number,reflect:!0})],L.prototype,"max"),H([o({type:Number,reflect:!0})],L.prototype,"maxlength"),H([o({type:Number,reflect:!0})],L.prototype,"min"),H([o({type:Number,reflect:!0})],L.prototype,"minlength"),H([o({type:Number,reflect:!0})],L.prototype,"step"),H([o({type:String})],L.prototype,"ariaDescribedBy"),H([o({type:String})],L.prototype,"ariaLabelledby"),H([o({type:String,reflect:!0})],L.prototype,"name"),H([o({type:String,reflect:!0})],L.prototype,"pattern"),H([o({type:String,reflect:!0})],L.prototype,"placeholder"),H([o({type:String,reflect:!0})],L.prototype,"id"),H([o({type:Boolean})],L.prototype,"counter"),H([o({type:Boolean})],L.prototype,"hasError"),H([o({type:Boolean})],L.prototype,"inline"),H([o({type:Boolean})],L.prototype,"hasFieldset"),H([o({type:Boolean})],L.prototype,"optionalTag"),H([o({type:Boolean})],L.prototype,"requiredTag"),H([o({type:Boolean})],L.prototype,"skipForwardTestid"),H([o({type:Boolean,reflect:!0,converter:El})],L.prototype,"useWrapper"),H([o({type:Boolean,reflect:!0})],L.prototype,"fullwidth"),H([o({type:Number})],L.prototype,"counterMaxLength"),H([o({type:String})],L.prototype,"errorMessage"),H([o({type:String})],L.prototype,"helptext"),H([o({type:String})],L.prototype,"helptextDropdown"),H([o({type:String,reflect:!1})],L.prototype,"helptextDropdownButton"),H([o({type:String})],L.prototype,"label"),H([o({type:String,reflect:!1})],L.prototype,"optionalText"),H([o({type:String,reflect:!1})],L.prototype,"requiredText"),H([o({type:String,reflect:!1})],L.prototype,"tagText"),H([o({type:String,attribute:"data-testid"})],L.prototype,"dataTestid"),H([D()],L.prototype,"touched");let ha=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{fs(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{fs(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&fs(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var Nl=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,Je=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ml(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&&Nl(t,e,n),n};let _e=class extends R{constructor(){super(),this.defaultSlot=N(),this.forId=Be(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Vt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new rt(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=E({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?c`<div class="pkt-inputwrapper__helptext-expandable">
|
|
411
|
+
*/const ga=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Zi=He(class extends ls{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=Dr(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=[]),c=[];let p,m,v=0,$=n.length-1,b=0,k=a.length-1;for(;v<=$&&b<=k;)if(n[v]===null)v++;else if(n[$]===null)$--;else if(h[v]===r[b])c[b]=Ve(n[v],a[b]),v++,b++;else if(h[$]===r[k])c[k]=Ve(n[$],a[k]),$--,k--;else if(h[v]===r[k])c[k]=Ve(n[v],a[k]),Ds(s,c[k+1],n[v]),v++,k--;else if(h[$]===r[b])c[b]=Ve(n[$],a[b]),Ds(s,n[v],n[$]),$--,b++;else if(p===void 0&&(p=ga(r,b,k),m=ga(h,v,$)),p.has(h[v]))if(p.has(h[$])){const x=m.get(r[b]),T=x!==void 0?n[x]:null;if(T===null){const S=Ds(s,n[v]);Ve(S,a[b]),c[b]=S}else c[b]=Ve(T,a[b]),Ds(s,n[v],T),n[x]=null;b++}else Hi(n[$]),$--;else Hi(n[v]),v++;for(;b<=k;){const x=Ds(s,c[k+1]);Ve(x,a[b]),c[b++]=x}for(;v<=$;){const x=n[v++];x!==null&&Hi(x)}return this.ut=r,jn(s,c),Dt}}),ma=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Rl=s=>new Promise(t=>setTimeout(t,s)),Oe=()=>{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)},Kl={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}},jt={props:Kl};var Yl={},va;function Gl(){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,c=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,$=new WeakMap,b=new WeakMap,k=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"},S=(f,u)=>{for(let g in T){u[g]=null;let w=null;const B=T[g];Object.defineProperty(u,g,{get(){return w},set(U){w=U,f.isConnected?kt(f,B,U):m.set(f,u)}})}};function A(f){const u=n.get(f),{form:g}=u;re(f,g,u),fe(f,u.labels)}const I=(f,u=!1)=>{const g=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(U){return n.has(U)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let w=g.nextNode();const B=!u||f.disabled;for(;w;)w.formDisabledCallback&&B&&zt(w,f.disabled),w=g.nextNode()},O={attributes:!0,attributeFilter:["disabled","name"]},R=Zt()?new MutationObserver(f=>{for(const u of f){const g=u.target;if(u.attributeName==="disabled"&&(g.constructor.formAssociated?zt(g,g.hasAttribute("disabled")):g.localName==="fieldset"&&I(g)),u.attributeName==="name"&&g.constructor.formAssociated){const w=n.get(g),B=p.get(g);w.setFormValue(B)}}}):{};function et(f){f.forEach(u=>{const{addedNodes:g,removedNodes:w}=u,B=Array.from(g),U=Array.from(w);B.forEach(z=>{var qt;if(n.has(z)&&z.constructor.formAssociated&&A(z),m.has(z)){const St=m.get(z);Object.keys(T).filter(Wt=>St[Wt]!==null).forEach(Wt=>{kt(z,T[Wt],St[Wt])}),m.delete(z)}if(x.has(z)){const St=x.get(z);kt(z,"internals-valid",St.validity.valid.toString()),kt(z,"internals-invalid",(!St.validity.valid).toString()),kt(z,"aria-invalid",(!St.validity.valid).toString()),x.delete(z)}if(z.localName==="form"){const St=c.get(z),Wt=document.createTreeWalker(z,NodeFilter.SHOW_ELEMENT,{acceptNode(cn){return n.has(cn)&&cn.constructor.formAssociated&&!(St&&St.has(cn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ni=Wt.nextNode();for(;ni;)A(ni),ni=Wt.nextNode()}z.localName==="fieldset"&&((qt=R.observe)===null||qt===void 0||qt.call(R,z,O),I(z,!0))}),U.forEach(z=>{const qt=n.get(z);qt&&i.get(qt)&&Et(qt),h.has(z)&&h.get(z).disconnect()})})}function Ot(f){f.forEach(u=>{const{removedNodes:g}=u;g.forEach(w=>{const B=b.get(u.target);n.has(w)&&we(w),B.disconnect()})})}const Nt=f=>{var u,g;const w=new MutationObserver(Ot);!((u=window==null?void 0:window.ShadyDOM)===null||u===void 0)&&u.inUse&&f.mode&&f.host&&(f=f.host),(g=w.observe)===null||g===void 0||g.call(w,f,{childList:!0}),b.set(f,w)};Zt()&&new MutationObserver(et);const it={childList:!0,subtree:!0},kt=(f,u,g)=>{f.getAttribute(u)!==g&&f.setAttribute(u,g)},zt=(f,u)=>{f.toggleAttribute("internals-disabled",u),u?kt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[u])},Et=f=>{i.get(f).forEach(u=>{u.remove()}),i.set(f,[])},dt=(f,u)=>{const g=document.createElement("input");return g.type="hidden",g.name=f.getAttribute("name"),f.after(g),i.get(u).push(g),g},ae=(f,u)=>{var g;i.set(u,[]),(g=R.observe)===null||g===void 0||g.call(R,f,O)},fe=(f,u)=>{if(u.length){Array.from(u).forEach(w=>w.addEventListener("click",f.click.bind(f)));let g=u[0].id;u[0].id||(g=`${u[0].htmlFor}_Label`,u[0].id=g),kt(f,"aria-labelledby",g)}},V=f=>{const u=Array.from(f.elements).filter(U=>!U.tagName.includes("-")&&U.validity).map(U=>U.validity.valid),g=c.get(f)||[],w=Array.from(g).filter(U=>U.isConnected).map(U=>n.get(U).validity.valid),B=[...u,...w].includes(!1);f.toggleAttribute("internals-invalid",B),f.toggleAttribute("internals-valid",!B)},xt=f=>{V(Bt(f.target))},Gt=f=>{V(Bt(f.target))},$e=f=>{const u=["button[type=submit]","input[type=submit]","button:not([type])"].map(g=>`${g}:not([disabled])`).map(g=>`${g}:not([form])${f.id?`,${g}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",g=>{if(g.target.closest(u)){const w=c.get(f);if(f.noValidate)return;w.size&&Array.from(w).reverse().map(B=>n.get(B).reportValidity()).includes(!1)&&g.preventDefault()}})},ge=f=>{const u=c.get(f.target);u&&u.size&&u.forEach(g=>{g.constructor.formAssociated&&g.formResetCallback&&g.formResetCallback.apply(g)})},re=(f,u,g)=>{if(u){const w=c.get(u);if(w)w.add(f);else{const B=new Set;B.add(f),c.set(u,B),$e(u),u.addEventListener("reset",ge),u.addEventListener("input",xt),u.addEventListener("change",Gt)}r.set(u,{ref:f,internals:g}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[u])},0),V(u)}},Bt=f=>{let u=f.parentNode;return u&&u.tagName!=="FORM"&&(u=Bt(u)),u},ut=(f,u,g=DOMException)=>{if(!f.constructor.formAssociated)throw new g(u)},_e=(f,u,g)=>{const w=c.get(f);return w&&w.size&&w.forEach(B=>{n.get(B)[g]()||(u=!1)}),u},we=f=>{if(f.constructor.formAssociated){const u=n.get(f),{labels:g,form:w}=u;fe(f,g),re(f,w,u)}};function Zt(){return typeof MutationObserver<"u"}class Ss{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 Ie=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),es=(f,u,g)=>(f.valid=ss(u),Object.keys(u).forEach(w=>f[w]=u[w]),g&&V(g),f),ss=f=>{let u=!0;for(let g in f)g!=="valid"&&f[g]!==!1&&(u=!1);return u},xe=new WeakMap;function Xt(f,u){f.toggleAttribute(u,!0),f.part&&f.part.add(u)}class Se extends Set{static get isPolyfilled(){return!0}constructor(u){if(super(),!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");xe.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 g=super.add(u),w=xe.get(this),B=`state${u}`;return w.isConnected?Xt(w,B):setTimeout(()=>{Xt(w,B)}),g}clear(){for(let[u]of this.entries())this.delete(u);super.clear()}delete(u){const g=super.delete(u),w=xe.get(this);return w.isConnected?(w.toggleAttribute(`state${u}`,!1),w.part&&w.part.remove(`state${u}`)):setTimeout(()=>{w.toggleAttribute(`state${u}`,!1),w.part&&w.part.remove(`state${u}`)}),g}}function is(f,u,g,w){if(typeof u=="function"?f!==u||!w:!u.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?w:g==="a"?w.call(f):w?w.value:u.get(f)}function Mt(f,u,g,w,B){if(typeof u=="function"?f!==u||!0:!u.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u.set(f,g),g}var yt;class Cs{constructor(u){yt.set(this,void 0),Mt(this,yt,u);for(let g=0;g<u.length;g++){let w=u[g];this[g]=w,w.hasAttribute("name")&&(this[w.getAttribute("name")]=w)}Object.freeze(this)}get length(){return is(this,yt,"f").length}[(yt=new WeakMap,Symbol.iterator)](){return is(this,yt,"f")[Symbol.iterator]()}item(u){return this[u]==null?null:this[u]}namedItem(u){return this[u]==null?null:this[u]}}function Le(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=g;const u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=w;function g(...U){let z=f.apply(this,U);return _e(this,z,"checkValidity")}function w(...U){let z=u.apply(this,U);return _e(this,z,"reportValidity")}const{get:B}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...U){const z=B.call(this,...U),qt=Array.from(c.get(this)||[]);if(qt.length===0)return z;const St=Array.from(z).concat(qt).sort((Wt,ni)=>Wt.compareDocumentPosition?Wt.compareDocumentPosition(ni)&2?1:-1:0);return new Cs(St)}})}class si{static get isPolyfilled(){return!0}constructor(u){if(!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const g=u.getRootNode(),w=new Ss;this.states=new Se(u),t.set(this,u),e.set(this,w),n.set(u,this),S(u,this),ae(u,this),Object.seal(this),g instanceof DocumentFragment&&Nt(g)}checkValidity(){const u=t.get(this);if(ut(u,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=e.get(this);if(!g.valid){const w=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});u.dispatchEvent(w)}return g.valid}get form(){const u=t.get(this);ut(u,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let g;return u.constructor.formAssociated===!0&&(g=Bt(u)),g}get labels(){const u=t.get(this);ut(u,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const g=u.getAttribute("id"),w=u.getRootNode();return w&&g?w.querySelectorAll(`[for="${g}"]`):[]}reportValidity(){const u=t.get(this);if(ut(u,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=this.checkValidity(),w=$.get(this);if(w&&!u.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!g&&w&&(u.focus(),w.focus()),g}setFormValue(u){const g=t.get(this);if(ut(g,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Et(this),u!=null&&!(u instanceof FormData)){if(g.getAttribute("name")){const w=dt(g,this);w.value=u}}else u!=null&&u instanceof FormData&&Array.from(u).reverse().forEach(([w,B])=>{if(typeof B=="string"){const U=dt(g,this);U.name=w,U.value=B}});p.set(g,u)}setValidity(u,g,w){const B=t.get(this);if(ut(B,"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.");$.set(this,w);const U=e.get(this),z={};for(const Wt in u)z[Wt]=u[Wt];Object.keys(z).length===0&&Ie(U);const qt=Object.assign(Object.assign({},U),z);delete qt.valid;const{valid:St}=es(U,qt,this.form);if(!St&&!g)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,St?"":g),B.isConnected?(B.toggleAttribute("internals-invalid",!St),B.toggleAttribute("internals-valid",St),kt(B,"aria-invalid",`${!St}`)):x.set(B,this)}get shadowRoot(){const u=t.get(this);return v.get(u)||null}get validationMessage(){const u=t.get(this);return ut(u,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const u=t.get(this);return ut(u,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const u=t.get(this);return ut(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 Pi(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f 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,f);const g=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(w=>w in g.internals)}let Ts=!1,ii=!1;function j(f){ii||(ii=!0,window.CustomStateSet=Se,f&&(HTMLElement.prototype.attachInternals=function(...u){const g=f.call(this,u);return g.states=new Se(this),g}))}function Pt(f=!0){if(!Ts){if(Ts=!0,typeof window<"u"&&(window.ElementInternals=si),typeof CustomElementRegistry<"u"){const u=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(g,w,B){if(w.formAssociated){const U=w.prototype.connectedCallback;w.prototype.connectedCallback=function(){k.has(this)||(k.set(this,!0),this.hasAttribute("disabled")&&zt(this,!0)),U!=null&&U.apply(this),we(this)}}u.call(this,g,w,B)}}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 si(this)}),typeof Element<"u"){let u=function(...w){const B=g.apply(this,w);if(v.set(this,B),Zt()){const U=new MutationObserver(et);window.ShadyDOM?U.observe(this,it):U.observe(B,it),h.set(this,U)}return B};const g=Element.prototype.attachShadow;Element.prototype.attachShadow=u}Zt()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&Le(),(f||typeof window<"u"&&!window.CustomStateSet)&&j()}}return customElements.polyfillWrapFlushCallback||(Pi()?typeof window<"u"&&!window.CustomStateSet&&j(HTMLElement.prototype.attachInternals):Pt(!1)),s.forceCustomStateSetPolyfill=j,s.forceElementInternalsPolyfill=Pt,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Yl}Gl();var Zl=Object.defineProperty,H=(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&&Zl(t,e,n),n};const Xl={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}};let L=class extends X{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=Oe(),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=jt.props.helptextDropdownButton.default,this.label=null,this.optionalText=At.forms.labels.optional,this.requiredText=At.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,c,p,m,v,$;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},At.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},At.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},At.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},At.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},At.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?At.forms.messages.rangeUnderflowMin.replace("{min}",(c=this.min)==null?void 0:c.toString()):At.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},At.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?At.forms.messages.rangeOverflowMax.replace("{max}",(v=this.max)==null?void 0:v.toString()):At.forms.messages.rangeOverflow,t):($=t.validity)!=null&&$.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(n=>{const a=n;a.name===this.name&&a.value!==this.value&&a.checked&&(a.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};H([o()],L.prototype,"defaultValue"),H([o({type:Boolean,reflect:!0})],L.prototype,"disabled"),H([o({type:Boolean,reflect:!0})],L.prototype,"readonly"),H([o({type:Boolean,reflect:!0})],L.prototype,"required"),H([o({type:Number,reflect:!0})],L.prototype,"max"),H([o({type:Number,reflect:!0})],L.prototype,"maxlength"),H([o({type:Number,reflect:!0})],L.prototype,"min"),H([o({type:Number,reflect:!0})],L.prototype,"minlength"),H([o({type:Number,reflect:!0})],L.prototype,"step"),H([o({type:String})],L.prototype,"ariaDescribedBy"),H([o({type:String})],L.prototype,"ariaLabelledby"),H([o({type:String,reflect:!0})],L.prototype,"name"),H([o({type:String,reflect:!0})],L.prototype,"pattern"),H([o({type:String,reflect:!0})],L.prototype,"placeholder"),H([o({type:String,reflect:!0})],L.prototype,"id"),H([o({type:Boolean})],L.prototype,"counter"),H([o({type:Boolean})],L.prototype,"hasError"),H([o({type:Boolean})],L.prototype,"inline"),H([o({type:Boolean})],L.prototype,"hasFieldset"),H([o({type:Boolean})],L.prototype,"optionalTag"),H([o({type:Boolean})],L.prototype,"requiredTag"),H([o({type:Boolean})],L.prototype,"skipForwardTestid"),H([o({type:Boolean,reflect:!0,converter:Xl})],L.prototype,"useWrapper"),H([o({type:Boolean,reflect:!0})],L.prototype,"fullwidth"),H([o({type:Number})],L.prototype,"counterMaxLength"),H([o({type:String})],L.prototype,"errorMessage"),H([o({type:String})],L.prototype,"helptext"),H([o({type:String})],L.prototype,"helptextDropdown"),H([o({type:String,reflect:!1})],L.prototype,"helptextDropdownButton"),H([o({type:String})],L.prototype,"label"),H([o({type:String,reflect:!1})],L.prototype,"optionalText"),H([o({type:String,reflect:!1})],L.prototype,"requiredText"),H([o({type:String,reflect:!1})],L.prototype,"tagText"),H([o({type:String,attribute:"data-testid"})],L.prototype,"dataTestid"),H([D()],L.prototype,"touched");let ba=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{hs(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{hs(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&hs(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var Jl=Object.defineProperty,Ql=Object.getOwnPropertyDescriptor,Ye=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ql(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&&Jl(t,e,n),n};let ve=class extends X{constructor(){super(),this.defaultSlot=E(),this.forId=Oe(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=jt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new rt(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?d`<div class="pkt-inputwrapper__helptext-expandable">
|
|
437
412
|
<button
|
|
438
413
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
439
414
|
type="button"
|
|
@@ -443,77 +418,77 @@
|
|
|
443
418
|
class="pkt-btn__icon"
|
|
444
419
|
name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
|
|
445
420
|
></pkt-icon>
|
|
446
|
-
<span class="pkt-btn__text">${
|
|
421
|
+
<span class="pkt-btn__text">${mi(this.helptextDropdownButton)}</span>
|
|
447
422
|
</button>
|
|
448
423
|
<div
|
|
449
|
-
class="${
|
|
424
|
+
class="${N({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
|
|
450
425
|
>
|
|
451
|
-
${
|
|
426
|
+
${mi(this.helptextDropdown)}
|
|
452
427
|
</div>
|
|
453
|
-
</div>`:
|
|
428
|
+
</div>`:y;return d`${d`<div class="${e}">
|
|
454
429
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
455
430
|
<div class="pkt-contents" ${M(this.defaultSlot)} name="helptext"></div>
|
|
456
|
-
${this.helptext&&
|
|
431
|
+
${this.helptext&&mi(this.helptext)}
|
|
457
432
|
</div>
|
|
458
433
|
${i()}
|
|
459
|
-
</div>`}`}};
|
|
460
|
-
${this.tagText?
|
|
461
|
-
${this.optionalTag?
|
|
462
|
-
${this.requiredTag?
|
|
463
|
-
`,a=()=>this.useWrapper?this.hasFieldset?
|
|
434
|
+
</div>`}`}};Ye([o({type:String,reflect:!0})],ve.prototype,"forId",2),Ye([o({type:String})],ve.prototype,"helptext",2),Ye([o({type:String})],ve.prototype,"helptextDropdown",2),Ye([o({type:String})],ve.prototype,"helptextDropdownButton",2),Ye([D()],ve.prototype,"isHelpTextOpen",2),Ye([D()],ve.prototype,"filledSlots",2),ve=Ye([F("pkt-helptext")],ve);var th=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,st=(s,t,e,i)=>{for(var n=i>1?void 0:i?eh(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&&th(t,e,n),n};const sh={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}};let tt=class extends X{constructor(){super(),this.defaultSlot=E(),this.helptextSlot=E(),this.forId=Oe(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=jt.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=jt.props.optionalTag.default,this.optionalText=jt.props.optionalText.default,this.requiredTag=jt.props.requiredTag.default,this.requiredText=jt.props.requiredText.default,this.tagText=null,this.hasError=jt.props.hasError.default,this.errorMessage="",this.disabled=jt.props.disabled.default,this.inline=jt.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=jt.props.hasFieldset.default,this.role="group",this.useWrapper=jt.props.useWrapper.default,this.slotController=new rt(this,this.defaultSlot,this.helptextSlot)}updated(t){super.updated(t)}render(){const t={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},e="pkt-tag pkt-tag--small pkt-tag--thin-text",i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:y,n=()=>d`
|
|
435
|
+
${this.tagText?d`<span class=${e+" pkt-tag--gray"}>${this.tagText}</span>`:y}
|
|
436
|
+
${this.optionalTag?d`<span class=${e+" pkt-tag--blue-light"}>${this.optionalText}</span>`:y}
|
|
437
|
+
${this.requiredTag?d`<span class=${e+" pkt-tag--beige"}>${this.requiredText}</span>`:y}
|
|
438
|
+
`,a=()=>this.useWrapper?this.hasFieldset?d`<legend
|
|
464
439
|
class="pkt-inputwrapper__legend"
|
|
465
440
|
id="${this.forId}-label"
|
|
466
441
|
@click=${this.handleLabelClick}
|
|
467
442
|
>
|
|
468
443
|
${this.label} ${n()}
|
|
469
|
-
</legend>`:
|
|
444
|
+
</legend>`:d`<label
|
|
470
445
|
class="pkt-inputwrapper__label"
|
|
471
446
|
for="${this.forId}"
|
|
472
447
|
aria-describedby="${i}"
|
|
473
448
|
id="${this.forId}-label"
|
|
474
449
|
@click=${this.handleLabelClick}
|
|
475
450
|
>${this.label}${n()}</label
|
|
476
|
-
>`:
|
|
451
|
+
>`:d`<label
|
|
477
452
|
for="${this.forId}"
|
|
478
453
|
class="pkt-sr-only"
|
|
479
454
|
aria-describedby="${i}"
|
|
480
455
|
id="${this.forId}-label"
|
|
481
456
|
>
|
|
482
457
|
${this.label}
|
|
483
|
-
</label>`,r=()=>
|
|
458
|
+
</label>`,r=()=>d`
|
|
484
459
|
<pkt-helptext
|
|
485
460
|
class="${C(this.useWrapper?void 0:"pkt-hide")}"
|
|
486
461
|
.forId=${this.forId}
|
|
487
462
|
.helptext=${this.helptext}
|
|
488
463
|
.helptextDropdown=${this.helptextDropdown}
|
|
489
|
-
.helptextDropdownButton=${this.helptextDropdownButton||
|
|
490
|
-
@toggleHelpText=${
|
|
464
|
+
.helptextDropdownButton=${this.helptextDropdownButton||jt.props.helptextDropdownButton.default}
|
|
465
|
+
@toggleHelpText=${v=>{this.toggleDropdown(v)}}
|
|
491
466
|
${M(this.helptextSlot)}
|
|
492
467
|
name="helptext"
|
|
493
468
|
></pkt-helptext>
|
|
494
|
-
`,h=()=>this.counter?
|
|
495
|
-
${this.counterError?this.counterError:
|
|
496
|
-
${this.counterMaxLength?`/${this.counterMaxLength}`:
|
|
497
|
-
</div>`:
|
|
469
|
+
`,h=()=>this.counter?d`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
470
|
+
${this.counterError?this.counterError:y} ${this.counterCurrent||0}
|
|
471
|
+
${this.counterMaxLength?`/${this.counterMaxLength}`:y}
|
|
472
|
+
</div>`:y,c=()=>this.hasError&&this.errorMessage?d`<pkt-alert
|
|
498
473
|
skin="error"
|
|
499
474
|
compact
|
|
500
475
|
id=${`${this.forId}-error`}
|
|
501
476
|
aria-live="assertive"
|
|
502
477
|
aria-atomic="true"
|
|
503
478
|
>
|
|
504
|
-
${
|
|
505
|
-
</pkt-alert>`:
|
|
479
|
+
${mi(this.errorMessage)}
|
|
480
|
+
</pkt-alert>`:y,p=()=>d`
|
|
506
481
|
${a()}
|
|
507
482
|
${r()}
|
|
508
|
-
${this.counterPosition==="top"?h():
|
|
483
|
+
${this.counterPosition==="top"?h():y}
|
|
509
484
|
<div class="pkt-contents" ${M(this.defaultSlot)}></div>
|
|
510
|
-
${this.counterPosition==="bottom"?h():
|
|
511
|
-
${
|
|
512
|
-
`,
|
|
513
|
-
${
|
|
514
|
-
</fieldset>`:
|
|
485
|
+
${this.counterPosition==="bottom"?h():y}
|
|
486
|
+
${c()}
|
|
487
|
+
`,m=()=>this.hasFieldset?d`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
|
|
488
|
+
${p()}
|
|
489
|
+
</fieldset>`:d`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return d`<div class=${N(t)}>${m()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};st([o({type:String})],tt.prototype,"forId",2),st([o({type:String})],tt.prototype,"label",2),st([o({type:String})],tt.prototype,"helptext",2),st([o({type:String})],tt.prototype,"helptextDropdown",2),st([o({type:String})],tt.prototype,"helptextDropdownButton",2),st([o({type:Boolean})],tt.prototype,"counter",2),st([o({type:Number})],tt.prototype,"counterCurrent",2),st([o({type:Number})],tt.prototype,"counterMaxLength",2),st([o({type:String})],tt.prototype,"counterError",2),st([o({type:String,reflect:!1})],tt.prototype,"counterPosition",2),st([o({type:Boolean})],tt.prototype,"optionalTag",2),st([o({type:String})],tt.prototype,"optionalText",2),st([o({type:Boolean})],tt.prototype,"requiredTag",2),st([o({type:String})],tt.prototype,"requiredText",2),st([o({type:String})],tt.prototype,"tagText",2),st([o({type:Boolean})],tt.prototype,"hasError",2),st([o({type:String})],tt.prototype,"errorMessage",2),st([o({type:Boolean})],tt.prototype,"disabled",2),st([o({type:Boolean})],tt.prototype,"inline",2),st([o({type:String})],tt.prototype,"ariaDescribedby",2),st([o({type:Boolean})],tt.prototype,"hasFieldset",2),st([o({type:String,reflect:!0})],tt.prototype,"role",2),st([o({type:Boolean,reflect:!0,converter:sh})],tt.prototype,"useWrapper",2),tt=st([F("pkt-input-wrapper")],tt);var ih=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,Ct=(s,t,e,i)=>{for(var n=i>1?void 0:i?nh(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&&ih(t,e,n),n};let _t=class extends X{constructor(){super(...arguments),this.id=Oe(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),this.includeSearch&&!this.searchValue&&(this.searchValue=""),this.options.length>0&&this.filterOptions(),this.setAttribute("tabindex","-1"),this.addEventListener("focus",this.focusFirstOrSelectedOption)}updated(t){(t.has("options")||t.has("searchValue"))&&this.filterOptions(),super.updated(t)}attributeChangedCallback(t,e,i){(t==="options"||t==="searchValue"||t==="search-value")&&this.filterOptions(),super.attributeChangedCallback(t,e,i)}render(){return d`
|
|
515
490
|
<div
|
|
516
|
-
class=${
|
|
491
|
+
class=${N({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
517
492
|
role="listbox"
|
|
518
493
|
aria-label=${C(this.label)}
|
|
519
494
|
>
|
|
@@ -525,7 +500,7 @@
|
|
|
525
500
|
${this.renderList()}
|
|
526
501
|
</ul>
|
|
527
502
|
</div>
|
|
528
|
-
`}renderCheckboxOrCheckIcon(t,e){return this.isMultiSelect?
|
|
503
|
+
`}renderCheckboxOrCheckIcon(t,e){return this.isMultiSelect?d`
|
|
529
504
|
<input
|
|
530
505
|
class="pkt-input-check__input-checkbox"
|
|
531
506
|
type="checkbox"
|
|
@@ -536,13 +511,13 @@
|
|
|
536
511
|
aria-labelledby=${this.id+"-option-label-"+e}
|
|
537
512
|
?disabled=${this.disabled||t.disabled||this.maxIsReached&&!t.selected}
|
|
538
513
|
/>
|
|
539
|
-
`:t.selected?
|
|
540
|
-
${
|
|
514
|
+
`:t.selected?d`<pkt-icon name="check-big"></pkt-icon>`:y}renderList(){return d`
|
|
515
|
+
${Zi(this._filteredOptions,t=>t.value,(t,e)=>d`
|
|
541
516
|
<li
|
|
542
517
|
@click=${()=>{this.toggleOption(t)}}
|
|
543
518
|
aria-selected=${t.selected?"true":"false"}
|
|
544
519
|
@keydown=${this.handleOptionKeydown}
|
|
545
|
-
class=${
|
|
520
|
+
class=${N({"pkt-listbox__option":!0,"pkt-listbox__option--selected":!!(!this.isMultiSelect&&t.selected),"pkt-listbox__option--checkBox":this.isMultiSelect})}
|
|
546
521
|
tabindex="${this.disabled||t.disabled?"-1":"0"}"
|
|
547
522
|
data-index=${e}
|
|
548
523
|
data-value=${t.value}
|
|
@@ -553,15 +528,15 @@
|
|
|
553
528
|
>
|
|
554
529
|
${this.renderCheckboxOrCheckIcon(t,e)}
|
|
555
530
|
<span class="pkt-listbox__option-label" id=${this.id+"-option-label-"+e}>
|
|
556
|
-
${t.prefix?
|
|
531
|
+
${t.prefix?d`<span class="pkt-listbox__option-prefix">${t.prefix}</span>`:y}
|
|
557
532
|
${t.label||t.value}
|
|
558
533
|
</span>
|
|
559
|
-
${t.description?
|
|
534
|
+
${t.description?d`<span class="pkt-listbox__option-description pkt-txt-14-light"
|
|
560
535
|
>${t.description}</span
|
|
561
|
-
>`:
|
|
536
|
+
>`:y}
|
|
562
537
|
</li>
|
|
563
538
|
`)}
|
|
564
|
-
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?
|
|
539
|
+
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?d`
|
|
565
540
|
<div
|
|
566
541
|
class="pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option"
|
|
567
542
|
data-type="new-option"
|
|
@@ -574,18 +549,18 @@
|
|
|
574
549
|
<pkt-icon class="pkt-listbox__banner-icon" name="plus-sign" size="large"></pkt-icon>
|
|
575
550
|
Legg til “${this.customUserInput}”
|
|
576
551
|
</div>
|
|
577
|
-
`:
|
|
552
|
+
`:y}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(t=>t.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?d`
|
|
578
553
|
<div class="pkt-listbox__banner pkt-listbox__banner--maximum-reached">
|
|
579
554
|
${this._selectedOptions} av maks ${this.maxLength} mulige er valgt.
|
|
580
555
|
</div>
|
|
581
|
-
`:
|
|
556
|
+
`:y}renderUserMessage(){return this.userMessage?d`<div class="pkt-listbox__banner pkt-listbox__banner--user-message">
|
|
582
557
|
<pkt-icon
|
|
583
558
|
class="pkt-listbox__banner-icon"
|
|
584
559
|
name="exclamation-mark-circle"
|
|
585
560
|
size="large"
|
|
586
561
|
></pkt-icon>
|
|
587
562
|
${this.userMessage}
|
|
588
|
-
</div>`:
|
|
563
|
+
</div>`:y}renderSearch(){return this.includeSearch?d`
|
|
589
564
|
<div class="pkt-listbox__search">
|
|
590
565
|
<span class="pkt-listbox__search-icon">
|
|
591
566
|
<pkt-icon name="magnifying-glass-small" size="large"></pkt-icon>
|
|
@@ -605,7 +580,7 @@
|
|
|
605
580
|
role="searchbox"
|
|
606
581
|
/>
|
|
607
582
|
</div>
|
|
608
|
-
`:
|
|
583
|
+
`:y}handleSearchInput(t){this.searchValue=t.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(t){switch(t.key){case"Enter":t.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),t.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(t){const e=t.currentTarget,i=e.dataset.value,n=e.dataset.type,a=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&n!=="new-option"&&n!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":i&&(a?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():n==="searchbox"||n==="new-option"?this.focusFirstOption():this.focusNextOption(e),t.preventDefault();break;case"ArrowUp":if(t.altKey)this.focusFirstOption();else if(e.dataset.index==="0"&&this.includeSearch){const r=this.querySelector('[role="searchbox"]');r&&r.focus()}else if(e.dataset.index==="0"&&this.customUserInput){const r=this.querySelector('[data-type="new-option"]');r&&r.focus()}else this.focusPreviousOption(e);t.preventDefault();break;case"Home":this.focusFirstOption(),t.preventDefault();break;case"End":this.focusLastOption(),t.preventDefault();break;default:(t.metaKey||t.ctrlKey)&&t.key==="a"&&(this.selectAll(),t.preventDefault()),this.isLetterOrSpace(t.key)&&(this.handleTypeAhead(t.key),t.preventDefault());break}}focusAndScrollIntoView(t){t.scrollIntoView({block:"nearest"}),window.setTimeout(()=>t.focus(),0)}focusNextOption(t){const e=t.nextElementSibling;e&&this.focusAndScrollIntoView(e)}focusPreviousOption(t){const e=t.previousElementSibling;if(t.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else e&&this.focusAndScrollIntoView(e)}focusFirstOption(){const t=this.getOptionElements()[0];t&&this.focusAndScrollIntoView(t)}focusLastOption(){const t=this.getOptionElements().pop();t&&this.focusAndScrollIntoView(t)}focusFirstOrSelectedOption(){if(this.disabled)return;const t=this.getOptionElements().find(e=>e.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const e=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(e)}else if(t)this.focusAndScrollIntoView(t);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const e=this.querySelector('[role="searchbox"]');window.setTimeout(()=>e.focus(),0)}else this.focusFirstOption()}toggleOption(t){const e=t instanceof HTMLElement?t.dataset.disabled:t.disabled;if(this.disabled||e)return;const i=t instanceof HTMLElement?t.dataset.value:t.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(t=>{var e;return(t.fulltext||t.label+t.value+(t.prefix||"")).toLowerCase().includes(((e=this.searchValue)==null?void 0:e.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(t){return/^[\p{L} ]$/u.test(t)}handleTypeAhead(t){this.typeAheadString+=t.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const e=this.getOptionElements().find(i=>{var n;return(n=i.textContent)==null?void 0:n.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};Ct([o({type:String})],_t.prototype,"id",2),Ct([o({type:String})],_t.prototype,"label",2),Ct([o({type:Array})],_t.prototype,"options",2),Ct([o({type:Boolean,reflect:!0})],_t.prototype,"isOpen",2),Ct([o({type:Boolean})],_t.prototype,"disabled",2),Ct([o({type:Boolean})],_t.prototype,"includeSearch",2),Ct([o({type:Boolean})],_t.prototype,"isMultiSelect",2),Ct([o({type:Boolean})],_t.prototype,"allowUserInput",2),Ct([o({type:Boolean})],_t.prototype,"maxIsReached",2),Ct([o({type:String})],_t.prototype,"customUserInput",2),Ct([o({type:String})],_t.prototype,"searchPlaceholder",2),Ct([o({type:String})],_t.prototype,"searchValue",2),Ct([o({type:Number})],_t.prototype,"maxLength",2),Ct([o({type:String})],_t.prototype,"userMessage",2),Ct([D()],_t.prototype,"_filteredOptions",2),_t=Ct([F("pkt-listbox")],_t);const ah={displayValueAs:{default:"label"}},rh={props:ah};var oh=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,lt=(s,t,e,i)=>{for(var n=i>1?void 0:i?lh(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&&oh(t,e,n),n};let nt=class extends L{constructor(){super(),this.helptextSlot=E(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=rh.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=E(),this.arrowRef=E(),this.listboxRef=E(),this.focusRef=E(),this.optionTagRef=E(),this.optionsController=new ba(this),this.slotController=new rt(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t;if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const e=((t=this.options)==null?void 0:t.filter(i=>i.userAdded))||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const n={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(n.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(n.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(n.description=i.getAttribute("description")||void 0),n.fulltext=n.value+n.label+(n.prefix||""),e.push(n)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const e=(t.get("options")||this._options||[]).filter(n=>n&&n.userAdded).filter(n=>!(Array.isArray(this.options)?this.options:[]).some(a=>a.value===n.value)),i=[...e,...this.options];this._options=i,e.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 a=[...this._value];this._value=[...this._value,n.value],this.valueChanged(this._value,a)}n.fulltext=n.value+n.label+(n.prefix||""),n.selected=n.selected||this._value.includes(n.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),t==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(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(t,e,i)}render(){return d`
|
|
609
584
|
<pkt-input-wrapper
|
|
610
585
|
.label=${this.label}
|
|
611
586
|
.helptext=${this.helptext}
|
|
@@ -629,13 +604,13 @@
|
|
|
629
604
|
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
630
605
|
<div class="pkt-combobox" @focusout=${this.handleFocusOut}>
|
|
631
606
|
<div
|
|
632
|
-
class=${
|
|
607
|
+
class=${N({"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})}
|
|
633
608
|
tabindex="-1"
|
|
634
609
|
@click=${this.handleInputClick}
|
|
635
610
|
>
|
|
636
|
-
${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?d`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
|
|
637
612
|
>${this.placeholder}</span
|
|
638
|
-
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():
|
|
613
|
+
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():y}
|
|
639
614
|
${this.renderInputField()}
|
|
640
615
|
<div
|
|
641
616
|
class="pkt-btn pkt-btn--tertiary pkt-combobox__arrow"
|
|
@@ -653,7 +628,7 @@
|
|
|
653
628
|
tabindex="${this.disabled?"-1":"0"}"
|
|
654
629
|
>
|
|
655
630
|
<pkt-icon
|
|
656
|
-
class=${
|
|
631
|
+
class=${N({"pkt-combobox__arrow-icon":!0,"pkt-combobox__arrow-icon--open":this._isOptionsOpen})}
|
|
657
632
|
name="chevron-thin-down"
|
|
658
633
|
></pkt-icon>
|
|
659
634
|
</div>
|
|
@@ -687,11 +662,11 @@
|
|
|
687
662
|
></pkt-listbox>
|
|
688
663
|
</div>
|
|
689
664
|
|
|
690
|
-
${this.tagPlacement==="outside"&&this.multiple?
|
|
665
|
+
${this.tagPlacement==="outside"&&this.multiple?d`<div class="pkt-combobox__tags-outside">
|
|
691
666
|
${this.renderSingleOrMultipleValues()}
|
|
692
|
-
</div>`:
|
|
667
|
+
</div>`:y}
|
|
693
668
|
</pkt-input-wrapper>
|
|
694
|
-
`}renderInputField(){return this.typeahead||this.allowUserInput?
|
|
669
|
+
`}renderInputField(){return this.typeahead||this.allowUserInput?d`
|
|
695
670
|
<div class="pkt-combobox__input-div combobox__input">
|
|
696
671
|
<input
|
|
697
672
|
type="text"
|
|
@@ -711,7 +686,7 @@
|
|
|
711
686
|
${M(this.inputRef)}
|
|
712
687
|
/>
|
|
713
688
|
</div>
|
|
714
|
-
`:
|
|
689
|
+
`:d`
|
|
715
690
|
<input
|
|
716
691
|
type="hidden"
|
|
717
692
|
id="${this.id}-input"
|
|
@@ -719,7 +694,7 @@
|
|
|
719
694
|
.value=${this._value.join(",")}
|
|
720
695
|
${M(this.inputRef)}
|
|
721
696
|
/>
|
|
722
|
-
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=
|
|
697
|
+
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=Zi(this._value,n=>n,n=>{var a;const r=this.findValueInOptions(n),h=(a=this.options.find(c=>c.value===n))==null?void 0:a.tagSkinColor;return d`
|
|
723
698
|
<pkt-tag
|
|
724
699
|
skin=${h||"blue-dark"}
|
|
725
700
|
?closeTag=${!this.disabled}
|
|
@@ -727,35 +702,35 @@
|
|
|
727
702
|
>
|
|
728
703
|
${this.renderValueTag(r)}
|
|
729
704
|
</pkt-tag>
|
|
730
|
-
`});return t?e:i}renderValueTag(t){if(!t)return"";switch(this.displayValueAs){case"prefixAndValue":return
|
|
705
|
+
`});return t?e:i}renderValueTag(t){if(!t)return"";switch(this.displayValueAs){case"prefixAndValue":return d`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
731
706
|
>${t.prefix||""} ${t.value}</span
|
|
732
|
-
>`;case"value":return
|
|
707
|
+
>`;case"value":return d`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
733
708
|
>${t.value}</span
|
|
734
|
-
>`;case"label":default:return
|
|
709
|
+
>`;case"label":default:return d`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
735
710
|
>${t.label||t.value}</span
|
|
736
|
-
>`}}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()),u=!this.multiple,g=this.multiple,m=this.isMaxItemsReached();let $=!1,b=!0,y="",x="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),y="Ny verdi lagt til",$=!g):!r&&!this.allowUserInput?(u&&this._value[0]&&this.removeValue(this._value[0]),b=!1,$=!0,y="Ingen treff i søket"):a?(this.removeValue(n),$=!0):d&&u?(this.removeAllSelected(),$=!0):u?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),$=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):g&&!m?(this.setSelected(n),$=!0):g&&m?(this._userInfoMessage="Maks antall valg nådd",b=!1,x=t):(u&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,$=!0,x=t),this._isOptionsOpen=$,$||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=y,this._search=x||"",this.resetComboboxInput(b),g&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};lt([o({type:String,reflect:!0})],nt.prototype,"value",2),lt([o({type:Array})],nt.prototype,"options",2),lt([o({type:Array})],nt.prototype,"defaultOptions",2),lt([o({type:Boolean})],nt.prototype,"allowUserInput",2),lt([o({type:Boolean})],nt.prototype,"typeahead",2),lt([o({type:Boolean})],nt.prototype,"includeSearch",2),lt([o({type:String})],nt.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],nt.prototype,"multiple",2),lt([o({type:Number})],nt.prototype,"maxlength",2),lt([o({type:String})],nt.prototype,"displayValueAs",2),lt([o({type:String})],nt.prototype,"tagPlacement",2),lt([D()],nt.prototype,"_options",2),lt([D()],nt.prototype,"_isOptionsOpen",2),lt([D()],nt.prototype,"_value",2),lt([D()],nt.prototype,"_userInfoMessage",2),lt([D()],nt.prototype,"_addValueText",2),lt([D()],nt.prototype,"_maxIsReached",2),lt([D()],nt.prototype,"_search",2),lt([D()],nt.prototype,"_inputFocus",2),lt([D()],nt.prototype,"_editingSingleValue",2),nt=lt([F("pkt-combobox")],nt);const Hl={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 Vl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,ge=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ul(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&&Vl(t,e,n),n};let Gi=null;function zl(){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 Xt=class extends R{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||Hl.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 zl(),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"?c`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?c`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
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,c=this.findValueInOptions(h);!this._value.includes(h)&&!c?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):c&&!this._value.includes(c.value)&&this.setSelected(c.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 c;return((c=h.label)==null?void 0:c.toLowerCase().includes(i))??!1}),r=a.find(h=>{var c;return((c=h.label)==null?void 0:c.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,c=!(t!=null&&t.trim()),p=!this.multiple,m=this.multiple,v=this.isMaxItemsReached();let $=!1,b=!0,k="",x="";h||(!r&&this.allowUserInput&&!c?(this.addNewUserValue(t),k="Ny verdi lagt til",$=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),b=!1,$=!0,k="Ingen treff i søket"):a?(this.removeValue(n),$=!0):c&&p?(this.removeAllSelected(),$=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),$=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!v?(this.setSelected(n),$=!0):m&&v?(this._userInfoMessage="Maks antall valg nådd",b=!1,x=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,$=!0,x=t),this._isOptionsOpen=$,$||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=k,this._search=x||"",this.resetComboboxInput(b),m&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};lt([o({type:String,reflect:!0})],nt.prototype,"value",2),lt([o({type:Array})],nt.prototype,"options",2),lt([o({type:Array})],nt.prototype,"defaultOptions",2),lt([o({type:Boolean})],nt.prototype,"allowUserInput",2),lt([o({type:Boolean})],nt.prototype,"typeahead",2),lt([o({type:Boolean})],nt.prototype,"includeSearch",2),lt([o({type:String})],nt.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],nt.prototype,"multiple",2),lt([o({type:Number})],nt.prototype,"maxlength",2),lt([o({type:String})],nt.prototype,"displayValueAs",2),lt([o({type:String})],nt.prototype,"tagPlacement",2),lt([D()],nt.prototype,"_options",2),lt([D()],nt.prototype,"_isOptionsOpen",2),lt([D()],nt.prototype,"_value",2),lt([D()],nt.prototype,"_userInfoMessage",2),lt([D()],nt.prototype,"_addValueText",2),lt([D()],nt.prototype,"_maxIsReached",2),lt([D()],nt.prototype,"_search",2),lt([D()],nt.prototype,"_inputFocus",2),lt([D()],nt.prototype,"_editingSingleValue",2),nt=lt([F("pkt-combobox")],nt);const hh={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 ch=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,ce=(s,t,e,i)=>{for(var n=i>1?void 0:i?dh(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&&ch(t,e,n),n};let Xi=null;function uh(){return Xi||(Xi=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)}),Xi)}let Rt=class extends X{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||hh.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 uh(),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"?d`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?d`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
737
712
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
738
713
|
${this.triggerText}
|
|
739
|
-
</a>`:this.triggerType==="icon"?
|
|
714
|
+
</a>`:this.triggerType==="icon"?d`<pkt-button
|
|
740
715
|
skin="tertiary"
|
|
741
716
|
variant="icon-only"
|
|
742
717
|
iconName="cookie"
|
|
743
718
|
@click=${this.openModal}
|
|
744
719
|
>
|
|
745
720
|
>${this.triggerText}</pkt-button
|
|
746
|
-
>`:
|
|
747
|
-
${this.tagText?
|
|
748
|
-
${this.optionalTag?
|
|
749
|
-
${this.requiredTag?
|
|
750
|
-
`,r=()=>
|
|
721
|
+
>`:d`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ce([o({type:Boolean})],Rt.prototype,"devMode",2),ce([o({type:String})],Rt.prototype,"hotjarId",2),ce([o({type:String})],Rt.prototype,"googleAnalyticsId",2),ce([o({type:String})],Rt.prototype,"cookieDomain",2),ce([o({type:String})],Rt.prototype,"cookieSecure",2),ce([o({type:String})],Rt.prototype,"cookieExpiryDays",2),ce([o({type:String})],Rt.prototype,"triggerType",2),ce([o({type:String})],Rt.prototype,"triggerText",2),ce([o({type:String})],Rt.prototype,"i18nLanguage",2),Rt=ce([F("pkt-consent")],Rt);var ph=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,Tt=(s,t,e,i)=>{for(var n=i>1?void 0:i?fh(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&&ph(t,e,n),n};let wt=class extends L{constructor(){super(...arguments),this.inputRef=E(),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(t,e,i){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),t==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(t,e,i)}firstUpdated(t){t.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(t)}updated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),t.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),t.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(t)}render(){const t=N({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=N({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=N({"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",a=()=>d`
|
|
722
|
+
${this.tagText?d`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:y}
|
|
723
|
+
${this.optionalTag?d`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:y}
|
|
724
|
+
${this.requiredTag?d`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:y}
|
|
725
|
+
`,r=()=>d`
|
|
751
726
|
<label class=${i} for=${this.id+"-internal"}>
|
|
752
727
|
${this.label} ${a()}
|
|
753
|
-
${this.checkHelptext?
|
|
728
|
+
${this.checkHelptext?d`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:y}
|
|
754
729
|
</label>
|
|
755
|
-
`;return
|
|
730
|
+
`;return d`
|
|
756
731
|
<div class="pkt-input-check">
|
|
757
732
|
<div class=${t}>
|
|
758
|
-
${this.labelPosition==="left"?r():
|
|
733
|
+
${this.labelPosition==="left"?r():y}
|
|
759
734
|
<input
|
|
760
735
|
id=${this.id+"-internal"}
|
|
761
736
|
class=${e}
|
|
@@ -770,23 +745,23 @@
|
|
|
770
745
|
?checked=${this.checked}
|
|
771
746
|
role=${this.isSwitch?"switch":"checkbox"}
|
|
772
747
|
/>
|
|
773
|
-
${this.labelPosition==="right"?r():
|
|
748
|
+
${this.labelPosition==="right"?r():y}
|
|
774
749
|
</div>
|
|
775
750
|
</div>
|
|
776
|
-
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};Tt([o({type:String,reflect:!0})],wt.prototype,"value",2),Tt([o({type:String})],wt.prototype,"checkHelptext",2),Tt([o({type:Boolean})],wt.prototype,"defaultChecked",2),Tt([o({type:Boolean})],wt.prototype,"hasTile",2),Tt([o({type:Boolean})],wt.prototype,"isSwitch",2),Tt([o({type:String})],wt.prototype,"labelPosition",2),Tt([o({type:Boolean})],wt.prototype,"hideLabel",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"checked",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"indeterminate",2),Tt([o({type:String,reflect:!0})],wt.prototype,"type",2),Tt([o({type:String})],wt.prototype,"tagText",2),Tt([o({type:Boolean})],wt.prototype,"optionalTag",2),Tt([o({type:String})],wt.prototype,"optionalText",2),Tt([o({type:Boolean})],wt.prototype,"requiredTag",2),Tt([o({type:String})],wt.prototype,"requiredText",2),wt=Tt([F("pkt-checkbox")],wt);var
|
|
777
|
-
<div class=${
|
|
778
|
-
${Array.isArray(this.dates)&&this.dates[0]?
|
|
751
|
+
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};Tt([o({type:String,reflect:!0})],wt.prototype,"value",2),Tt([o({type:String})],wt.prototype,"checkHelptext",2),Tt([o({type:Boolean})],wt.prototype,"defaultChecked",2),Tt([o({type:Boolean})],wt.prototype,"hasTile",2),Tt([o({type:Boolean})],wt.prototype,"isSwitch",2),Tt([o({type:String})],wt.prototype,"labelPosition",2),Tt([o({type:Boolean})],wt.prototype,"hideLabel",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"checked",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"indeterminate",2),Tt([o({type:String,reflect:!0})],wt.prototype,"type",2),Tt([o({type:String})],wt.prototype,"tagText",2),Tt([o({type:Boolean})],wt.prototype,"optionalTag",2),Tt([o({type:String})],wt.prototype,"optionalText",2),Tt([o({type:Boolean})],wt.prototype,"requiredTag",2),Tt([o({type:String})],wt.prototype,"requiredText",2),wt=Tt([F("pkt-checkbox")],wt);var gh=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,Rs=(s,t,e,i)=>{for(var n=i>1?void 0:i?mh(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&&gh(t,e,n),n};let vs=class extends X{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=Oe()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},d`
|
|
752
|
+
<div class=${N(this.classes)} aria-live="polite">
|
|
753
|
+
${Array.isArray(this.dates)&&this.dates[0]?Zi(ca((this.dates??[]).filter(Boolean)),t=>t,t=>{var e;return d` <pkt-tag
|
|
779
754
|
id=${this.idBase+t+"-tag"}
|
|
780
755
|
closeTag
|
|
781
756
|
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:t}))}}
|
|
782
|
-
.ariaLabel=${`${(e=this.strings)==null?void 0:e.calendar.deleteDate} ${
|
|
757
|
+
.ariaLabel=${`${(e=this.strings)==null?void 0:e.calendar.deleteDate} ${la(t,this.dateformat)}`}
|
|
783
758
|
>
|
|
784
|
-
<time datetime=${t}>${
|
|
785
|
-
</pkt-tag>`}):
|
|
759
|
+
<time datetime=${t}>${la(t,this.dateformat)}</time>
|
|
760
|
+
</pkt-tag>`}):y}
|
|
786
761
|
</div>
|
|
787
|
-
`}};
|
|
762
|
+
`}};Rs([o({type:Array})],vs.prototype,"dates",2),Rs([o({type:String})],vs.prototype,"dateformat",2),Rs([o({type:String,attribute:"class"})],vs.prototype,"className",2),Rs([o({type:String,attribute:"id-base"})],vs.prototype,"idBase",2),vs=Rs([F("pkt-date-tags")],vs);const vh={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},Ks={props:vh},Ge=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},wi={normalizeNameForMultiple(s,t,e){return s?(t||e)&&!s.endsWith("[]")?s+"[]":s:null},validateRangeOrder(s){return!s||s.length!==2?!0:bl(s[0],s[1])},sortDates(s){return ca(s)},filterSelectableDates(s,t,e,i,n){return vl(s,t,e,i,n)}},bh={getInputType(){return Ge()?"text":"date"}},Ys={submitForm(s){var t;const e=(t=s.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(s,t){const e=s==null?void 0:s.form;e?e.requestSubmit():t()},validateDateInput(s,t,e,i,n){var a,r,h,c;const p=s.value;p&&(e&&e>p?t.setValidity({rangeUnderflow:!0},((r=(a=n==null?void 0:n.forms)==null?void 0:a.messages)==null?void 0:r.rangeUnderflow)||"Value is below minimum",s):i&&i<p&&t.setValidity({rangeOverflow:!0},((c=(h=n==null?void 0:n.forms)==null?void 0:h.messages)==null?void 0:c.rangeOverflow)||"Value is above maximum",s))}},xi={addToSelected(s,t,e,i){const n=s.target;if(!n.value)return;const a=e?me(e):null,r=i?me(i):null,h=me(n.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!a||h>=a)&&(!r||h<=r)&&t.value&&t.value.handleDateSelect(h),n.value=""},handleCalendarPosition(s,t,e=!1){var i;if(!s.value||!t.value)return;const n=((i=t.value.parentElement)==null?void 0:i.getBoundingClientRect())||t.value.getBoundingClientRect(),a=e?n.height+30:n.height,r=s.value.getBoundingClientRect().height;let h=e?"calc(100% - 30px)":"100%";n&&n.top+r>window.innerHeight&&n.top-r>0&&(h=`calc(100% - ${a}px - ${r}px)`),s.value.style.top=h}},Ji={getInputClasses(s,t,e,i,n,a){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":e,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&a==="text"}},getButtonClasses(){return{"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}},getRangeLabelClasses(s){return{"pkt-input-prefix":s,"pkt-hide":!s}}},Qi={processDateSelection(s,t,e){return!t&&!e?s[0]||"":Array.isArray(s)?s.join(","):s},updateInputValues(s,t,e,i,n,a){s.value&&(i&&t!=null&&t.value?(s.value.value=e[0]??"",t.value.value=e[1]??"",a(s.value),a(t.value)):n||(s.value.value=e.length?e[0]:"",a(s.value)))},processRangeBlur(s,t,e,i,n){var a;const r=s.target;if(r.value){n(r);const h=Me(r.value);h&&((a=e==null?void 0:e.value)==null||a.handleDateSelect(h))}else t[0]&&i()}},Si={handleInputKeydown(s,t,e,i,n,a){const{key:r}=s;r===","&&(s.preventDefault(),a?a(s):n&&n()),(r==="Space"||r===" ")&&(s.preventDefault(),t(s)),r==="Enter"&&(s.preventDefault(),e?e():i?i():n&&n())},handleButtonKeydown(s,t){const{key:e}=s;(e==="Enter"||e===" "||e==="Space")&&(s.preventDefault(),t(s))}};var kh=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,Ht=(s,t,e,i)=>{for(var n=i>1?void 0:i?yh(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&&kh(t,e,n),n};let It=class extends X{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.popupRef=E(),this.calendarRef=E(),this.handleDocumentClick=t=>{if(!this.open)return;const e=t.composedPath(),i=this.parentElement,n=this.popupRef.value;!e.includes(this)&&!e.includes(n)&&!(i&&e.includes(i))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var t;this.open=!0,(t=this.calendarRef.value)==null||t.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(t){var e;return!!t&&!!((e=this.popupRef.value)!=null&&e.contains(t))}focusOnCurrentDate(){const t=this.calendarRef.value;t&&typeof t.focusOnCurrentDate=="function"&&t.focusOnCurrentDate()}addToSelected(t,e,i){if(typeof xi.addToSelected=="function")return xi.addToSelected(t,this.calendarRef,e,i)}handleDateSelect(t){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(t)}render(){const t={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return d`
|
|
788
763
|
<div
|
|
789
|
-
class="${
|
|
764
|
+
class="${N(t)}"
|
|
790
765
|
${M(this.popupRef)}
|
|
791
766
|
id="date-popup"
|
|
792
767
|
?hidden=${!this.open}
|
|
@@ -809,10 +784,22 @@
|
|
|
809
784
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
810
785
|
></pkt-calendar>
|
|
811
786
|
</div>
|
|
812
|
-
`}};
|
|
787
|
+
`}};Ht([o({type:Boolean,reflect:!0})],It.prototype,"open",2),Ht([o({type:Boolean})],It.prototype,"multiple",2),Ht([o({type:Boolean})],It.prototype,"range",2),Ht([o({type:Boolean})],It.prototype,"weeknumbers",2),Ht([o({type:Boolean})],It.prototype,"withcontrols",2),Ht([o({type:Number})],It.prototype,"maxMultiple",2),Ht([o({type:Array})],It.prototype,"selected",2),Ht([o({type:String})],It.prototype,"earliest",2),Ht([o({type:String})],It.prototype,"latest",2),Ht([o({type:Array})],It.prototype,"excludedates",2),Ht([o({type:Array})],It.prototype,"excludeweekdays",2),Ht([o({type:String})],It.prototype,"currentmonth",2),It=Ht([F("pkt-datepicker-popup")],It);var $h=Object.defineProperty,be=(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&&$h(t,e,n),n};let Kt=class extends X{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=E(),this.btnRef=E()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}renderCalendarButton(){var t;return d`
|
|
788
|
+
<button
|
|
789
|
+
class="${N(Ji.getButtonClasses())}"
|
|
790
|
+
type="button"
|
|
791
|
+
@click=${e=>this.dispatchToggleCalendar(e)}
|
|
792
|
+
@keydown=${e=>{const{key:i}=e;(i==="Enter"||i===" "||i==="Space")&&(e.preventDefault(),this.dispatchToggleCalendar(e))}}
|
|
793
|
+
?disabled=${this.disabled}
|
|
794
|
+
${this.btnRef}
|
|
795
|
+
>
|
|
796
|
+
<pkt-icon name="calendar"></pkt-icon>
|
|
797
|
+
<span class="pkt-btn__text">${((t=this.strings.calendar)==null?void 0:t.buttonAltText)||"Åpne kalender"}</span>
|
|
798
|
+
</button>
|
|
799
|
+
`}createRenderRoot(){return this}};be([o({type:String})],Kt.prototype,"inputType"),be([o({type:String})],Kt.prototype,"id"),be([o({type:String})],Kt.prototype,"min"),be([o({type:String})],Kt.prototype,"max"),be([o({type:String})],Kt.prototype,"placeholder"),be([o({type:Boolean})],Kt.prototype,"readonly"),be([o({type:Boolean})],Kt.prototype,"disabled"),be([o({type:Object})],Kt.prototype,"inputClasses"),be([o({type:Object})],Kt.prototype,"internals");const ka={calendar:{buttonAltText:"Åpne kalender"}},_h={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var wh=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,tn=(s,t,e,i)=>{for(var n=i>1?void 0:i?xh(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&&wh(t,e,n),n};let Ci=class extends Kt{constructor(){super(...arguments),this.value="",this.strings=ka}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}render(){return d`
|
|
813
800
|
<div class="pkt-input__container">
|
|
814
801
|
<input
|
|
815
|
-
class="${
|
|
802
|
+
class="${N(this.inputClasses)}"
|
|
816
803
|
.type=${this.inputType}
|
|
817
804
|
id="${this.id}-input"
|
|
818
805
|
.value=${this.value}
|
|
@@ -824,30 +811,20 @@
|
|
|
824
811
|
@click=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
825
812
|
@touchend=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
826
813
|
?disabled=${this.disabled}
|
|
827
|
-
@keydown=${t=>
|
|
814
|
+
@keydown=${t=>Si.handleInputKeydown(t,e=>this.dispatchToggleCalendar(e),()=>Ys.submitFormOrFallback(this.internals,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()}),void 0,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()})}
|
|
828
815
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
829
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
816
|
+
@focus=${()=>{this.dispatchFocus(),Ge()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
830
817
|
@blur=${t=>{this.dispatchBlur(t),this.dispatchManageValidity(t.target),this.dispatchEvent(new CustomEvent("value-change",{detail:t.target.value,bubbles:!0,composed:!0}))}}
|
|
831
818
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
832
819
|
${M(this.inputRef)}
|
|
833
820
|
/>
|
|
834
|
-
|
|
835
|
-
class="${E(Js.getButtonClasses())}"
|
|
836
|
-
type="button"
|
|
837
|
-
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
838
|
-
@keydown=${t=>ts.handleButtonKeydown(t,e=>this.dispatchToggleCalendar(e))}
|
|
839
|
-
?disabled=${this.disabled}
|
|
840
|
-
${M(this.btnRef)}
|
|
841
|
-
>
|
|
842
|
-
<pkt-icon name="calendar"></pkt-icon>
|
|
843
|
-
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
844
|
-
</button>
|
|
821
|
+
${this.renderCalendarButton()}
|
|
845
822
|
</div>
|
|
846
|
-
`}};
|
|
823
|
+
`}};tn([o({type:String})],Ci.prototype,"value",2),tn([o({type:Object})],Ci.prototype,"strings",2),Ci=tn([F("pkt-datepicker-single")],Ci);var Sh=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,Ti=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ch(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&&Sh(t,e,n),n};let Gs=class extends Kt{constructor(){super(...arguments),this.value=[],this.showRangeLabels=!1,this.strings=_h,this.inputRefTo=E()}get inputElementTo(){return this.inputRefTo.value}render(){var t,e;const i=Ji.getRangeLabelClasses(this.showRangeLabels);return d`
|
|
847
824
|
<div class="pkt-input__container">
|
|
848
|
-
${this.showRangeLabels?
|
|
825
|
+
${this.showRangeLabels?d` <div class="pkt-input-prefix">${(t=this.strings.generic)==null?void 0:t.from}</div> `:y}
|
|
849
826
|
<input
|
|
850
|
-
class=${
|
|
827
|
+
class=${N(this.inputClasses)}
|
|
851
828
|
.type=${this.inputType}
|
|
852
829
|
id="${this.id}-input"
|
|
853
830
|
.value=${this.value[0]??""}
|
|
@@ -856,21 +833,21 @@
|
|
|
856
833
|
placeholder=${C(this.placeholder)}
|
|
857
834
|
?readonly=${this.isInputReadonly}
|
|
858
835
|
?disabled=${this.disabled}
|
|
859
|
-
@click=${
|
|
860
|
-
@touchend=${
|
|
861
|
-
@keydown=${
|
|
862
|
-
@input=${
|
|
863
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
864
|
-
@blur=${
|
|
865
|
-
@change=${
|
|
836
|
+
@click=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
837
|
+
@touchend=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
838
|
+
@keydown=${n=>Si.handleInputKeydown(n,a=>this.dispatchToggleCalendar(a),()=>Ys.submitFormOrFallback(this.internals,()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.focus()}),()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.focus()},()=>{var a;return(a=this.inputRef.value)==null?void 0:a.blur()})}
|
|
839
|
+
@input=${n=>{this.dispatchInput(n),n.stopImmediatePropagation()}}
|
|
840
|
+
@focus=${()=>{this.dispatchFocus(),Ge()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
841
|
+
@blur=${n=>{this.dispatchBlur(n),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:n,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
842
|
+
@change=${n=>{this.dispatchChange(n),n.stopImmediatePropagation()}}
|
|
866
843
|
${M(this.inputRef)}
|
|
867
844
|
/>
|
|
868
|
-
<div class="${
|
|
869
|
-
${this.strings.generic.to}
|
|
845
|
+
<div class="${N(i)}" id="${this.id}-to-label">
|
|
846
|
+
${(e=this.strings.generic)==null?void 0:e.to}
|
|
870
847
|
</div>
|
|
871
|
-
${this.showRangeLabels?
|
|
848
|
+
${this.showRangeLabels?y:d` <div class="pkt-input-separator">–</div> `}
|
|
872
849
|
<input
|
|
873
|
-
class=${
|
|
850
|
+
class=${N(this.inputClasses)}
|
|
874
851
|
.type=${this.inputType}
|
|
875
852
|
id="${this.id}-to"
|
|
876
853
|
aria-labelledby="${this.id}-to-label"
|
|
@@ -880,31 +857,21 @@
|
|
|
880
857
|
placeholder=${C(this.placeholder)}
|
|
881
858
|
?readonly=${this.isInputReadonly}
|
|
882
859
|
?disabled=${this.disabled}
|
|
883
|
-
@click=${
|
|
884
|
-
@touchend=${
|
|
885
|
-
@keydown=${
|
|
886
|
-
@input=${
|
|
887
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
888
|
-
@blur=${
|
|
889
|
-
@change=${
|
|
860
|
+
@click=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
861
|
+
@touchend=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
862
|
+
@keydown=${n=>Si.handleInputKeydown(n,a=>this.dispatchToggleCalendar(a),()=>Ys.submitFormOrFallback(this.internals,()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.blur()}),void 0,()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.blur()})}
|
|
863
|
+
@input=${n=>{this.dispatchInput(n),n.stopImmediatePropagation()}}
|
|
864
|
+
@focus=${()=>{this.dispatchFocus(),Ge()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
865
|
+
@blur=${n=>{this.dispatchBlur(n),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:n,values:this.value,inputType:"to"},bubbles:!0,composed:!0}))}}
|
|
866
|
+
@change=${n=>{this.dispatchChange(n),n.stopImmediatePropagation()}}
|
|
890
867
|
${M(this.inputRefTo)}
|
|
891
868
|
/>
|
|
892
|
-
|
|
893
|
-
class="${E(Js.getButtonClasses())}"
|
|
894
|
-
type="button"
|
|
895
|
-
@click=${e=>this.dispatchToggleCalendar(e)}
|
|
896
|
-
@keydown=${e=>ts.handleButtonKeydown(e,i=>this.dispatchToggleCalendar(i))}
|
|
897
|
-
?disabled=${this.disabled}
|
|
898
|
-
${M(this.btnRef)}
|
|
899
|
-
>
|
|
900
|
-
<pkt-icon name="calendar"></pkt-icon>
|
|
901
|
-
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
902
|
-
</button>
|
|
869
|
+
${this.renderCalendarButton()}
|
|
903
870
|
</div>
|
|
904
|
-
`}};
|
|
871
|
+
`}};Ti([o({type:Array})],Gs.prototype,"value",2),Ti([o({type:Boolean})],Gs.prototype,"showRangeLabels",2),Ti([o({type:Object})],Gs.prototype,"strings",2),Gs=Ti([F("pkt-datepicker-range")],Gs);var Th=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,Ni=(s,t,e,i)=>{for(var n=i>1?void 0:i?Nh(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&&Th(t,e,n),n};let Zs=class extends Kt{constructor(){super(...arguments),this.value=[],this.strings=ka}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(t){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:t,bubbles:!0,composed:!0}))}render(){return d`
|
|
905
872
|
<div class="pkt-input__container">
|
|
906
873
|
<input
|
|
907
|
-
class=${
|
|
874
|
+
class=${N(this.inputClasses)}
|
|
908
875
|
.type=${this.inputType}
|
|
909
876
|
id="${this.id}-input"
|
|
910
877
|
min=${C(this.min)}
|
|
@@ -916,24 +883,14 @@
|
|
|
916
883
|
@touchend=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
917
884
|
@blur=${t=>{this.dispatchBlur(t),this.dispatchAddToSelected(t)}}
|
|
918
885
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
919
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
920
|
-
@keydown=${t=>
|
|
886
|
+
@focus=${()=>{this.dispatchFocus(),Ge()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
887
|
+
@keydown=${t=>Si.handleInputKeydown(t,e=>this.dispatchToggleCalendar(e),()=>Ys.submitFormOrFallback(this.internals,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()}),void 0,void 0,e=>this.dispatchAddToSelected(e))}
|
|
921
888
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
922
889
|
${M(this.inputRef)}
|
|
923
890
|
/>
|
|
924
|
-
|
|
925
|
-
class="${E(Js.getButtonClasses())}"
|
|
926
|
-
type="button"
|
|
927
|
-
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
928
|
-
@keydown=${t=>ts.handleButtonKeydown(t,e=>this.dispatchToggleCalendar(e))}
|
|
929
|
-
?disabled=${this.disabled}
|
|
930
|
-
${M(this.btnRef)}
|
|
931
|
-
>
|
|
932
|
-
<pkt-icon name="calendar"></pkt-icon>
|
|
933
|
-
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
934
|
-
</button>
|
|
891
|
+
${this.renderCalendarButton()}
|
|
935
892
|
</div>
|
|
936
|
-
`}};
|
|
893
|
+
`}};Ni([o({type:Array})],Zs.prototype,"value",2),Ni([o({type:Number})],Zs.prototype,"maxlength",2),Ni([o({type:Object})],Zs.prototype,"strings",2),Zs=Ni([F("pkt-datepicker-multiple")],Zs);var Eh=Object.defineProperty,Mh=Object.getOwnPropertyDescriptor,gt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Mh(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&&Eh(t,e,n),n};let ht=class extends L{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=E(),this._value=[],this.label="Datovelger",this.dateformat=Ks.props.dateformat.default,this.multiple=Ks.props.multiple.default,this.maxlength=null,this.range=Ks.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=Ks.props.weeknumbers.default,this.withcontrols=Ks.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=E(),this.popupRef=E(),this.helptextSlot=E(),this.singleInputRef=E(),this.rangeInputRef=E(),this.multipleInputRef=E(),this.addToSelected=t=>{const e=this.datepickerPopupRef.value;return e&&typeof e.addToSelected=="function"?e.addToSelected(t,this.min,this.max):xi.addToSelected(t,this.calRef,this.min,this.max)},this.slotController=new rt(this,this.helptextSlot)}get value(){return this._valueProperty}set value(t){const e=this._valueProperty;this._valueProperty=Array.isArray(t)?t.join(","):t||"",this.valueChanged(this._valueProperty,e),this.requestUpdate("value",e)}get inputType(){return bh.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=wi.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(t,e){if(t===e)return;const i=qs(t),n=this.multiple&&i.length>1?wi.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!wi.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",e);return}this._value=n;const a=kl(n);this._valueProperty!==a&&(this._valueProperty=a),super.valueChanged(a,e)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&this.valueChanged(i,e),t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=qs(i||"")),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=qs(i||"")),super.attributeChangedCallback(t,e,i)}updated(t){if(t.has("value")){const e=Array.isArray(this.value)?this.value.join(","):this.value,i=t.get("value"),n=Array.isArray(i)?i.join(","):i;this.valueChanged(e,n)}(t.has("multiple")||t.has("range"))&&(this.name=wi.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),t.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=qs(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(t)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.inputElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.inputElement:(i=this.singleInputRef.value)==null?void 0:i.inputElement}get currentInputElementTo(){var t;if(this.range)return(t=this.rangeInputRef.value)==null?void 0:t.inputElementTo}get currentButtonElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.buttonElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.buttonElement:(i=this.singleInputRef.value)==null?void 0:i.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return d`
|
|
937
894
|
<pkt-datepicker-single
|
|
938
895
|
.value=${this._value[0]??""}
|
|
939
896
|
.inputType=${this.inputType}
|
|
@@ -955,7 +912,7 @@
|
|
|
955
912
|
@input-changed=${()=>{this.touched=!0}}
|
|
956
913
|
${M(this.singleInputRef)}
|
|
957
914
|
></pkt-datepicker-single>
|
|
958
|
-
`}renderRangeInput(){return
|
|
915
|
+
`}renderRangeInput(){return d`
|
|
959
916
|
<pkt-datepicker-range
|
|
960
917
|
.value=${this._value}
|
|
961
918
|
.inputType=${this.inputType}
|
|
@@ -973,14 +930,14 @@
|
|
|
973
930
|
@input-change=${()=>this.onInput()}
|
|
974
931
|
@input-focus=${()=>this.onFocus()}
|
|
975
932
|
@input-blur=${t=>{var e;(e=this.calRef.value)!=null&&e.contains(t.detail.relatedTarget)||this.onBlur()}}
|
|
976
|
-
@range-blur=${t=>{
|
|
933
|
+
@range-blur=${t=>{const e=this.currentInputElement,i=this.currentInputElementTo;if(e&&i){const n=e.value,a=i.value;if(n&&a&&n>a)i.value="",this._value=[n],this.value=n;else{const r=[n,a].filter(Boolean);r.length>0&&(r[0]!==this._value[0]||r[1]!==this._value[1])&&(this._value=r,this.value=r.join(","))}}Qi.processRangeBlur(t.detail.event,t.detail.values,this.calRef,()=>this.clearInputValue(),n=>this.manageValidity(n))}}
|
|
977
934
|
@manage-validity=${t=>this.manageValidity(t.detail)}
|
|
978
|
-
@validate-date-input=${t=>{
|
|
979
|
-
@handle-date-select=${t=>{var e,i;const n=
|
|
935
|
+
@validate-date-input=${t=>{Ys.validateDateInput(t.detail,this.internals,this.min,this.max,this.strings)}}
|
|
936
|
+
@handle-date-select=${t=>{var e,i;const n=Me(t.detail);if(n){const a=bt(n);this._value[0]!==a&&this._value[1]!==a&&((i=(e=this.calRef)==null?void 0:e.value)==null||i.handleDateSelect(n))}}}
|
|
980
937
|
@input-changed=${()=>{this.touched=!0}}
|
|
981
938
|
${M(this.rangeInputRef)}
|
|
982
939
|
></pkt-datepicker-range>
|
|
983
|
-
`}renderMultipleInput(){return
|
|
940
|
+
`}renderMultipleInput(){return d`
|
|
984
941
|
<pkt-datepicker-multiple
|
|
985
942
|
.value=${this._value}
|
|
986
943
|
.inputType=${this.inputType}
|
|
@@ -1002,7 +959,7 @@
|
|
|
1002
959
|
@input-changed=${()=>{this.touched=!0}}
|
|
1003
960
|
${M(this.multipleInputRef)}
|
|
1004
961
|
></pkt-datepicker-multiple>
|
|
1005
|
-
`}renderCalendar(){return
|
|
962
|
+
`}renderCalendar(){return d`
|
|
1006
963
|
<pkt-datepicker-popup
|
|
1007
964
|
class="pkt-contents"
|
|
1008
965
|
?open=${this.calendarOpen}
|
|
@@ -1016,12 +973,12 @@
|
|
|
1016
973
|
.latest=${this.max}
|
|
1017
974
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
1018
975
|
.excludeweekdays=${this.excludeweekdays}
|
|
1019
|
-
.currentmonth=${this.currentmonth?
|
|
1020
|
-
@date-selected=${t=>{this.value=
|
|
976
|
+
.currentmonth=${this.currentmonth?Ee(this.currentmonth):null}
|
|
977
|
+
@date-selected=${t=>{this.value=Qi.processDateSelection(t.detail,this.multiple,this.range),this._value=t.detail,Qi.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,e=>this.manageValidity(e))}}
|
|
1021
978
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
1022
979
|
${M(this.datepickerPopupRef)}
|
|
1023
980
|
></pkt-datepicker-popup>
|
|
1024
|
-
`}render(){return this.inputClasses=
|
|
981
|
+
`}render(){return this.inputClasses=Ji.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),d`
|
|
1025
982
|
<pkt-input-wrapper
|
|
1026
983
|
label="${this.label}"
|
|
1027
984
|
forId="${this.id}-input"
|
|
@@ -1047,13 +1004,13 @@
|
|
|
1047
1004
|
class="pkt-datepicker"
|
|
1048
1005
|
>
|
|
1049
1006
|
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1050
|
-
${this.multiple?
|
|
1007
|
+
${this.multiple?d`<pkt-date-tags
|
|
1051
1008
|
.dates=${this._value}
|
|
1052
1009
|
dateformat=${this.dateformat}
|
|
1053
1010
|
strings=${this.strings}
|
|
1054
1011
|
id-base=${this.id}
|
|
1055
|
-
@date-tag-removed=${t=>{var e;const i=this.datepickerPopupRef.value,n=
|
|
1056
|
-
></pkt-date-tags>`:
|
|
1012
|
+
@date-tag-removed=${t=>{var e;const i=this.datepickerPopupRef.value,n=Me(t.detail);i&&n&&typeof i.handleDateSelect=="function"?i.handleDateSelect(n):(e=this.calRef.value)==null||e.handleDateSelect(n)}}
|
|
1013
|
+
></pkt-date-tags>`:y}
|
|
1057
1014
|
<div
|
|
1058
1015
|
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
1059
1016
|
>
|
|
@@ -1061,13 +1018,13 @@
|
|
|
1061
1018
|
</div>
|
|
1062
1019
|
</pkt-input-wrapper>
|
|
1063
1020
|
${this.renderCalendar()}
|
|
1064
|
-
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;
|
|
1065
|
-
class=${
|
|
1021
|
+
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;xi.handleCalendarPosition(this.popupRef,this.inputRef,t)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),Ge()&&e.focusOnCurrentDate();return}await Rl(20),this.handleCalendarPosition(),Ge()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const t=this.datepickerPopupRef.value;if(this.calendarOpen=!1,t&&typeof t.hide=="function")return t.hide()}async toggleCalendar(t){t.preventDefault();const e=this.datepickerPopupRef.value;if(e&&typeof e.toggle=="function"){const i=!!e.open;e.toggle(),this.calendarOpen=!i;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",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}))}};gt([o({type:String,reflect:!0})],ht.prototype,"value",1),gt([o({type:Array})],ht.prototype,"_value",2),gt([o({type:String,reflect:!0})],ht.prototype,"label",2),gt([o({type:String})],ht.prototype,"dateformat",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"multiple",2),gt([o({type:Number,reflect:!0})],ht.prototype,"maxlength",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"range",2),gt([o({type:Boolean})],ht.prototype,"showRangeLabels",2),gt([o({type:String,reflect:!0})],ht.prototype,"min",2),gt([o({type:String,reflect:!0})],ht.prototype,"max",2),gt([o({type:Boolean})],ht.prototype,"weeknumbers",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"withcontrols",2),gt([o({converter:ps.csvToArray})],ht.prototype,"excludedates",2),gt([o({converter:ps.csvToArray})],ht.prototype,"excludeweekdays",2),gt([o({type:String})],ht.prototype,"currentmonth",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"calendarOpen",2),gt([o({type:String})],ht.prototype,"timezone",2),gt([D()],ht.prototype,"inputClasses",2),ht=gt([F("pkt-datepicker")],ht);const Ah={href:{default:"#"},target:{default:"_self"}},ya={props:Ah};var Oh=Object.defineProperty,Ph=Object.getOwnPropertyDescriptor,bs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ph(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&&Oh(t,e,n),n};let Ze=class extends X{constructor(){super(),this.defaultSlot=E(),this.href=ya.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=ya.props.target.default,this.slotController=new rt(this,this.defaultSlot)}render(){const t={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return d`<a
|
|
1022
|
+
class=${N(t)}
|
|
1066
1023
|
href=${this.href}
|
|
1067
1024
|
.target=${this.target}
|
|
1068
|
-
.rel=${this.external?"noopener noreferrer":
|
|
1069
|
-
>${this.iconName?
|
|
1070
|
-
>`}};
|
|
1025
|
+
.rel=${this.external?"noopener noreferrer":y}
|
|
1026
|
+
>${this.iconName?d`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${M(this.defaultSlot)}>Link</span></a
|
|
1027
|
+
>`}};bs([o({type:String,reflect:!0})],Ze.prototype,"href",2),bs([o({type:String,reflect:!0})],Ze.prototype,"iconName",2),bs([o({type:String,reflect:!0})],Ze.prototype,"iconPosition",2),bs([o({type:Boolean,reflect:!0})],Ze.prototype,"external",2),bs([o({type:String,reflect:!0})],Ze.prototype,"target",2),Ze=bs([F("pkt-link")],Ze);var Dh=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,de=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ih(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 se=class extends L{constructor(){super(),this.inputRef=E(),this.helptextSlot=E(),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 rt(this,this.helptextSlot)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}updated(t){var e;super.updated(t),t.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const t=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,e=N({"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 d`
|
|
1071
1028
|
<pkt-input-wrapper
|
|
1072
1029
|
label="${this.label}"
|
|
1073
1030
|
?counter=${this.counter}
|
|
@@ -1094,7 +1051,7 @@
|
|
|
1094
1051
|
>
|
|
1095
1052
|
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1096
1053
|
<div class="pkt-input__container">
|
|
1097
|
-
${this.prefix?
|
|
1054
|
+
${this.prefix?d`<div class="pkt-input-prefix">${this.prefix}</div>`:y}
|
|
1098
1055
|
<input
|
|
1099
1056
|
${M(this.inputRef)}
|
|
1100
1057
|
class=${e}
|
|
@@ -1110,7 +1067,7 @@
|
|
|
1110
1067
|
max=${C(this.max||void 0)}
|
|
1111
1068
|
step=${C(this.step||void 0)}
|
|
1112
1069
|
?readonly=${this.readonly}
|
|
1113
|
-
size=${this.size||
|
|
1070
|
+
size=${this.size||y}
|
|
1114
1071
|
.value=${this.value}
|
|
1115
1072
|
?disabled=${this.disabled}
|
|
1116
1073
|
aria-invalid=${this.hasError}
|
|
@@ -1121,86 +1078,86 @@
|
|
|
1121
1078
|
@blur=${n=>{this.value=n.target.value,this.onBlur(),n.stopImmediatePropagation()}}
|
|
1122
1079
|
@keydown=${n=>{var a;if(n.key==="Enter"){const r=this.internals.form;r?r.requestSubmit():(a=this.inputRef.value)==null||a.blur()}}}
|
|
1123
1080
|
/>
|
|
1124
|
-
${this.suffix?
|
|
1081
|
+
${this.suffix?d`<div class="pkt-input-suffix">
|
|
1125
1082
|
${this.suffix}
|
|
1126
|
-
${this.iconNameRight?
|
|
1083
|
+
${this.iconNameRight?d`<pkt-icon
|
|
1127
1084
|
class="pkt-input-suffix-icon"
|
|
1128
1085
|
name=${this.iconNameRight}
|
|
1129
|
-
></pkt-icon>`:
|
|
1130
|
-
${t?
|
|
1086
|
+
></pkt-icon>`:y}
|
|
1087
|
+
${t?d`<pkt-icon
|
|
1131
1088
|
class="pkt-input-suffix-icon"
|
|
1132
1089
|
name="magnifying-glass-big"
|
|
1133
|
-
></pkt-icon>`:
|
|
1134
|
-
</div>`:
|
|
1135
|
-
${!this.suffix&&this.iconNameRight?
|
|
1136
|
-
${!this.suffix&&t?
|
|
1090
|
+
></pkt-icon>`:y}
|
|
1091
|
+
</div>`:y}
|
|
1092
|
+
${!this.suffix&&this.iconNameRight?d`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:y}
|
|
1093
|
+
${!this.suffix&&t?d`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:y}
|
|
1137
1094
|
</div>
|
|
1138
1095
|
</pkt-input-wrapper>
|
|
1139
|
-
`}};
|
|
1096
|
+
`}};de([o({type:String,reflect:!0})],se.prototype,"value",2),de([o({type:String})],se.prototype,"type",2),de([o({type:Number})],se.prototype,"size",2),de([o({type:String})],se.prototype,"autocomplete",2),de([o({type:String})],se.prototype,"iconNameRight",2),de([o({type:String})],se.prototype,"prefix",2),de([o({type:String})],se.prototype,"suffix",2),de([o({type:Boolean})],se.prototype,"omitSearchIcon",2),de([D()],se.prototype,"counterCurrent",2),se=de([F("pkt-textinput")],se);const Yt={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Lh=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Bh=s=>{if(!s)return;const t=typeof s=="string"?new Date(s):s;if(!isNaN(t.getTime()))return t.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})};var Fh=Object.defineProperty,jh=Object.getOwnPropertyDescriptor,Xe=(s,t,e,i)=>{for(var n=i>1?void 0:i?jh(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&&Fh(t,e,n),n};let Pe=class extends X{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(t){"onClick"in t&&typeof t.onClick=="function"&&t.onClick()}renderLinkOrButton(t,e){const i="href"in t,n=N({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[e||""]:!!e});return i?d`
|
|
1140
1097
|
<pkt-link
|
|
1141
|
-
icon-name=${t.iconName||
|
|
1098
|
+
icon-name=${t.iconName||y}
|
|
1142
1099
|
href=${t.href}
|
|
1143
1100
|
aria-hidden="true"
|
|
1144
1101
|
class="pkt-user-menu__link ${e||""}"
|
|
1145
1102
|
>
|
|
1146
1103
|
${t.title}
|
|
1147
1104
|
</pkt-link>
|
|
1148
|
-
`:
|
|
1105
|
+
`:d`
|
|
1149
1106
|
<button class=${n} type="button" @click=${()=>this.handleMenuItemClick(t)}>
|
|
1150
|
-
${t.iconName?
|
|
1107
|
+
${t.iconName?d`<pkt-icon
|
|
1151
1108
|
name=${t.iconName}
|
|
1152
1109
|
class="pkt-link__icon"
|
|
1153
1110
|
aria-hidden="true"
|
|
1154
|
-
></pkt-icon>`:
|
|
1111
|
+
></pkt-icon>`:y}
|
|
1155
1112
|
${t.title}
|
|
1156
1113
|
</button>
|
|
1157
|
-
`}renderLinkSection(t){return
|
|
1114
|
+
`}renderLinkSection(t){return d`
|
|
1158
1115
|
<ul class="pkt-user-menu__sublist">
|
|
1159
|
-
${t.map(e=>
|
|
1116
|
+
${t.map(e=>d`
|
|
1160
1117
|
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(e)}</li>
|
|
1161
1118
|
`)}
|
|
1162
1119
|
</ul>
|
|
1163
|
-
`}render(){var t;const e=(t=this.userMenu)==null?void 0:t.map(
|
|
1120
|
+
`}render(){var t;const e=(t=this.userMenu)==null?void 0:t.map(Lh);return d`
|
|
1164
1121
|
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
1165
1122
|
<ul class="pkt-user-menu__list">
|
|
1166
1123
|
<!-- User section -->
|
|
1167
|
-
${this.user?
|
|
1124
|
+
${this.user?d`
|
|
1168
1125
|
<li class="pkt-user-menu__item">
|
|
1169
1126
|
<div class="pkt-user-menu__label">Pålogget som</div>
|
|
1170
1127
|
<div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
|
|
1171
|
-
${this.formattedLastLoggedIn?
|
|
1128
|
+
${this.formattedLastLoggedIn?d`
|
|
1172
1129
|
<div class="pkt-user-menu__last-logged-in">
|
|
1173
1130
|
Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
|
|
1174
1131
|
</div>
|
|
1175
|
-
`:
|
|
1132
|
+
`:y}
|
|
1176
1133
|
</li>
|
|
1177
|
-
`:
|
|
1134
|
+
`:y}
|
|
1178
1135
|
|
|
1179
1136
|
<!-- User menu items -->
|
|
1180
|
-
${e&&e.length>0?
|
|
1137
|
+
${e&&e.length>0?d`
|
|
1181
1138
|
<li class="pkt-user-menu__item">${this.renderLinkSection(e)}</li>
|
|
1182
|
-
`:
|
|
1139
|
+
`:y}
|
|
1183
1140
|
|
|
1184
1141
|
<!-- Representing section -->
|
|
1185
|
-
${this.representing?
|
|
1142
|
+
${this.representing?d`
|
|
1186
1143
|
<li class="pkt-user-menu__item">
|
|
1187
1144
|
<div class="pkt-user-menu__label">Representerer</div>
|
|
1188
1145
|
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
1189
|
-
${this.representing.orgNumber?
|
|
1146
|
+
${this.representing.orgNumber?d`<div class="pkt-user-menu__org-number">
|
|
1190
1147
|
Org.nr. ${this.representing.orgNumber}
|
|
1191
|
-
</div>`:
|
|
1192
|
-
${this.canChangeRepresentation?
|
|
1148
|
+
</div>`:y}
|
|
1149
|
+
${this.canChangeRepresentation?d`
|
|
1193
1150
|
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
1194
1151
|
<li class="pkt-user-menu__subitem">
|
|
1195
1152
|
${this.renderLinkOrButton({title:"Endre organisasjon",iconName:"cogwheel",onClick:()=>this.handleChangeRepresentation()})}
|
|
1196
1153
|
</li>
|
|
1197
1154
|
</ul>
|
|
1198
|
-
`:
|
|
1155
|
+
`:y}
|
|
1199
1156
|
</li>
|
|
1200
|
-
`:
|
|
1157
|
+
`:y}
|
|
1201
1158
|
|
|
1202
1159
|
<!-- Change representation without representing object -->
|
|
1203
|
-
${!this.representing&&this.canChangeRepresentation?
|
|
1160
|
+
${!this.representing&&this.canChangeRepresentation?d`
|
|
1204
1161
|
<li class="pkt-user-menu__item">
|
|
1205
1162
|
<ul class="pkt-user-menu__sublist">
|
|
1206
1163
|
<li class="pkt-user-menu__subitem">
|
|
@@ -1208,25 +1165,25 @@
|
|
|
1208
1165
|
</li>
|
|
1209
1166
|
</ul>
|
|
1210
1167
|
</li>
|
|
1211
|
-
`:
|
|
1168
|
+
`:y}
|
|
1212
1169
|
|
|
1213
1170
|
<!-- Logout -->
|
|
1214
|
-
${this.logoutOnClick?
|
|
1171
|
+
${this.logoutOnClick?d`
|
|
1215
1172
|
<li class="pkt-user-menu__item">
|
|
1216
1173
|
${this.renderLinkOrButton({title:"Logg ut",iconName:"exit",onClick:()=>this.handleLogout()})}
|
|
1217
1174
|
</li>
|
|
1218
|
-
`:
|
|
1175
|
+
`:y}
|
|
1219
1176
|
</ul>
|
|
1220
1177
|
</nav>
|
|
1221
|
-
`}};
|
|
1222
|
-
<pkt-icon name="oslologo" aria-hidden="true" path=${
|
|
1223
|
-
`;return this.logoLink&&typeof this.logoLink=="string"?
|
|
1178
|
+
`}};Xe([o({type:Object})],Pe.prototype,"user",2),Xe([o({type:String,attribute:"formatted-last-logged-in"})],Pe.prototype,"formattedLastLoggedIn",2),Xe([o({type:Object})],Pe.prototype,"representing",2),Xe([o({type:Array,attribute:"user-menu"})],Pe.prototype,"userMenu",2),Xe([o({type:Boolean,attribute:"can-change-representation",converter:Yt})],Pe.prototype,"canChangeRepresentation",2),Xe([o({type:Boolean,attribute:"logout-on-click",converter:Yt})],Pe.prototype,"logoutOnClick",2),Pe=Xe([F("pkt-header-user-menu")],Pe);var Hh=Object.defineProperty,Vh=Object.getOwnPropertyDescriptor,Q=(s,t,e,i)=>{for(var n=i>1?void 0:i?Vh(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&&Hh(t,e,n),n};const Uh="https://punkt-cdn.oslo.kommune.no/14.0/logos/";let G=class extends X{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.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=E(),this.headerRef=E(),this.userContainerRef=E(),this.slotContainerRef=E(),this.searchContainerRef=E(),this.slotContentRef=E(),this.searchMenuRef=E(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const t=window.pageYOffset||document.documentElement.scrollTop;t<0||Math.abs(t-this.lastScrollPosition)<60||(this.isHidden=t>this.lastScrollPosition,this.lastScrollPosition=t)},this.handleClickOutside=t=>{const e=t.target;this.user&&this.openMenu==="user"&&!e.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!e.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!e.closest(".pkt-header-service__search-container")&&!e.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(t,e)=>{const i=t.relatedTarget;let n;switch(e){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const a=n.value;a&&(!i||!a.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=t=>{t.key==="Escape"&&this.openMenu!=="none"&&(t.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new rt(this,this.defaultSlot)}updateSlots(t){this.hasSlotContent=t.has(null)||t.has(void 0)}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.resizeObserver)==null||t.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(t){if(super.updated(t),t.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(t.has("mobileBreakpoint")||t.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),t.has("openMenu")){const e=t.get("openMenu");this.openMenu!=="none"&&(e==="none"||e===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"&&e!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(t.has("openMenu")||t.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const t=this.headerRef.value;t&&(this.componentWidth=t.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(e=>{for(const i of e)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(t))}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 t=document.body,e=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const i=window.innerWidth-e.clientWidth;i>0&&(t.style.paddingRight=`${i}px`),t.style.position="fixed",t.style.top=`-${this.savedScrollY}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",e.classList.add("is-scroll-locked")}unlockScroll(){const t=document.body,e=document.documentElement;e.classList.contains("is-scroll-locked")&&(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"),e.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(t){const e=t==="slot"?this.slotContainerRef:this.searchContainerRef,i=t==="slot"?this.slotContentRef:this.searchMenuRef;if(!e.value||!i.value||!this.isTablet||this.isMobile)return;const n=e.value.getBoundingClientRect(),a=i.value.offsetWidth,r=n.left+a>window.innerWidth;t==="slot"?this.alignSlotRight=r:this.alignSearchRight=r}handleMenuToggle(t){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=t)}handleLogoClick(t){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleServiceClick(t){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(t){this.dispatchEvent(new CustomEvent("search",{detail:{query:t},bubbles:!0,composed:!0}))}handleSearchChange(t){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:t},bubbles:!0,composed:!0}))}handleSearchInputChange(t){const e=t.target.value;this.handleSearchChange(e)}handleSearchKeyDown(t){t.key==="Enter"&&this.handleSearch(t.target.value)}get formattedLastLoggedIn(){var t;return Bh((t=this.user)==null?void 0:t.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 y;const t=d`
|
|
1179
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${Uh}></pkt-icon>
|
|
1180
|
+
`;return this.logoLink&&typeof this.logoLink=="string"?d`
|
|
1224
1181
|
<span class="pkt-header-service__logo">
|
|
1225
1182
|
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
1226
1183
|
${t}
|
|
1227
1184
|
</a>
|
|
1228
1185
|
</span>
|
|
1229
|
-
`:this.hasAttribute("logo-link")?
|
|
1186
|
+
`:this.hasAttribute("logo-link")?d`
|
|
1230
1187
|
<span class="pkt-header-service__logo">
|
|
1231
1188
|
<button
|
|
1232
1189
|
aria-label="Tilbake til forside"
|
|
@@ -1236,9 +1193,9 @@
|
|
|
1236
1193
|
${t}
|
|
1237
1194
|
</button>
|
|
1238
1195
|
</span>
|
|
1239
|
-
`:
|
|
1196
|
+
`:d`
|
|
1240
1197
|
<span class="pkt-header-service__logo" @click=${this.handleLogoClick}>${t}</span>
|
|
1241
|
-
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?
|
|
1198
|
+
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?d`
|
|
1242
1199
|
<span class="pkt-header-service__service-name">
|
|
1243
1200
|
<pkt-link
|
|
1244
1201
|
href=${this.serviceLink}
|
|
@@ -1248,7 +1205,7 @@
|
|
|
1248
1205
|
${this.serviceName}
|
|
1249
1206
|
</pkt-link>
|
|
1250
1207
|
</span>
|
|
1251
|
-
`:this.hasAttribute("service-link")?
|
|
1208
|
+
`:this.hasAttribute("service-link")?d`
|
|
1252
1209
|
<span class="pkt-header-service__service-name">
|
|
1253
1210
|
<button
|
|
1254
1211
|
class="pkt-link-button pkt-link pkt-header-service__service-link"
|
|
@@ -1257,17 +1214,17 @@
|
|
|
1257
1214
|
${this.serviceName}
|
|
1258
1215
|
</button>
|
|
1259
1216
|
</span>
|
|
1260
|
-
`:
|
|
1217
|
+
`:d`
|
|
1261
1218
|
<span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
|
|
1262
1219
|
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
1263
1220
|
</span>
|
|
1264
|
-
`:
|
|
1221
|
+
`:y}renderSlotContainer(){const t=N({"pkt-header-service__slot-container":!0,"is-open":this.openMenu==="slot"}),e=N({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return d`
|
|
1265
1222
|
<div
|
|
1266
1223
|
class=${t}
|
|
1267
1224
|
@focusout=${i=>this.handleFocusOut(i,"slot")}
|
|
1268
1225
|
${M(this.slotContainerRef)}
|
|
1269
1226
|
>
|
|
1270
|
-
${this.isTablet&&this.hasSlotContent?
|
|
1227
|
+
${this.isTablet&&this.hasSlotContent?d`
|
|
1271
1228
|
<pkt-button
|
|
1272
1229
|
skin="secondary"
|
|
1273
1230
|
variant="icon-only"
|
|
@@ -1281,17 +1238,17 @@
|
|
|
1281
1238
|
>
|
|
1282
1239
|
Meny
|
|
1283
1240
|
</pkt-button>
|
|
1284
|
-
`:
|
|
1241
|
+
`:y}
|
|
1285
1242
|
<div
|
|
1286
1243
|
class=${e}
|
|
1287
1244
|
id="mobile-slot-menu"
|
|
1288
|
-
role=${this.isTablet?"menu":
|
|
1289
|
-
aria-label=${this.isTablet?"Meny":
|
|
1245
|
+
role=${this.isTablet?"menu":y}
|
|
1246
|
+
aria-label=${this.isTablet?"Meny":y}
|
|
1290
1247
|
${M(this.slotContentRef)}
|
|
1291
1248
|
${M(this.defaultSlot)}
|
|
1292
1249
|
></div>
|
|
1293
1250
|
</div>
|
|
1294
|
-
`}renderSearch(){if(!this.showSearch)return
|
|
1251
|
+
`}renderSearch(){if(!this.showSearch)return y;if(this.isTablet){const t=N({"pkt-header-service__search-container":!0,"is-open":this.openMenu==="search"}),e=N({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu==="search","align-right":this.alignSearchRight});return d`
|
|
1295
1252
|
<div
|
|
1296
1253
|
class=${t}
|
|
1297
1254
|
@focusout=${i=>this.handleFocusOut(i,"search")}
|
|
@@ -1311,7 +1268,7 @@
|
|
|
1311
1268
|
Søk
|
|
1312
1269
|
</pkt-button>
|
|
1313
1270
|
<div class=${e} ${M(this.searchMenuRef)}>
|
|
1314
|
-
${this.openMenu==="search"?
|
|
1271
|
+
${this.openMenu==="search"?d`
|
|
1315
1272
|
<pkt-textinput
|
|
1316
1273
|
id="mobile-search-menu"
|
|
1317
1274
|
class="pkt-header-service__search-input"
|
|
@@ -1325,10 +1282,10 @@
|
|
|
1325
1282
|
@input=${this.handleSearchInputChange}
|
|
1326
1283
|
@keydown=${i=>{i.key==="Enter"&&this.handleSearch(i.target.value)}}
|
|
1327
1284
|
></pkt-textinput>
|
|
1328
|
-
`:
|
|
1285
|
+
`:y}
|
|
1329
1286
|
</div>
|
|
1330
1287
|
</div>
|
|
1331
|
-
`}return
|
|
1288
|
+
`}return d`
|
|
1332
1289
|
<pkt-textinput
|
|
1333
1290
|
id="header-service-search"
|
|
1334
1291
|
class="pkt-header-service__search-input"
|
|
@@ -1340,14 +1297,14 @@
|
|
|
1340
1297
|
@input=${this.handleSearchInputChange}
|
|
1341
1298
|
@keydown=${this.handleSearchKeyDown}
|
|
1342
1299
|
></pkt-textinput>
|
|
1343
|
-
`}renderUserButton(){var t;if(!this.user)return
|
|
1300
|
+
`}renderUserButton(){var t;if(!this.user)return y;const e=N({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu==="user"});return d`
|
|
1344
1301
|
<div
|
|
1345
1302
|
class="pkt-header-service__user-container"
|
|
1346
1303
|
@focusout=${i=>this.handleFocusOut(i,"user")}
|
|
1347
1304
|
${M(this.userContainerRef)}
|
|
1348
1305
|
>
|
|
1349
1306
|
<pkt-button
|
|
1350
|
-
class=${
|
|
1307
|
+
class=${N({"pkt-header-service__user-button":!0,"pkt-header-service__user-button--mobile":this.isMobile})}
|
|
1351
1308
|
skin="secondary"
|
|
1352
1309
|
size=${this.isMobile?"small":"medium"}
|
|
1353
1310
|
state=${this.openMenu==="user"?"active":"normal"}
|
|
@@ -1359,11 +1316,11 @@
|
|
|
1359
1316
|
<span class="pkt-sr-only">Brukermeny: </span>
|
|
1360
1317
|
${((t=this.representing)==null?void 0:t.name)||this.user.name}
|
|
1361
1318
|
</pkt-button>
|
|
1362
|
-
${this.openMenu==="user"&&this.user?
|
|
1319
|
+
${this.openMenu==="user"&&this.user?d`
|
|
1363
1320
|
<div class=${e}>
|
|
1364
1321
|
<pkt-header-user-menu
|
|
1365
1322
|
.user=${this.user}
|
|
1366
|
-
formatted-last-logged-in=${this.formattedLastLoggedIn||
|
|
1323
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn||y}
|
|
1367
1324
|
.representing=${this.representing}
|
|
1368
1325
|
.userMenu=${this.userMenu}
|
|
1369
1326
|
?can-change-representation=${this.canChangeRepresentation}
|
|
@@ -1372,15 +1329,15 @@
|
|
|
1372
1329
|
@log-out=${this.handleLogout}
|
|
1373
1330
|
></pkt-header-user-menu>
|
|
1374
1331
|
</div>
|
|
1375
|
-
`:
|
|
1332
|
+
`:y}
|
|
1376
1333
|
</div>
|
|
1377
|
-
`}renderHeader(){const t=
|
|
1334
|
+
`}renderHeader(){const t=N({"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}),e=N({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return d`
|
|
1378
1335
|
<header class=${t} ${M(this.headerRef)}>
|
|
1379
1336
|
<div class=${e}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
1380
1337
|
|
|
1381
1338
|
<div class="pkt-header-service__content">
|
|
1382
1339
|
${this.renderSlotContainer()} ${this.renderSearch()}
|
|
1383
|
-
${this.isTablet&&this.showLogoutInHeader?
|
|
1340
|
+
${this.isTablet&&this.showLogoutInHeader?d`
|
|
1384
1341
|
<pkt-button
|
|
1385
1342
|
skin="secondary"
|
|
1386
1343
|
size=${this.isMobile?"small":"medium"}
|
|
@@ -1390,12 +1347,12 @@
|
|
|
1390
1347
|
>
|
|
1391
1348
|
Logg ut
|
|
1392
1349
|
</pkt-button>
|
|
1393
|
-
`:
|
|
1350
|
+
`:y}
|
|
1394
1351
|
</div>
|
|
1395
1352
|
|
|
1396
1353
|
<div class="pkt-header-service__user">
|
|
1397
1354
|
${this.renderUserButton()}
|
|
1398
|
-
${!this.isTablet&&this.showLogoutInHeader?
|
|
1355
|
+
${!this.isTablet&&this.showLogoutInHeader?d`
|
|
1399
1356
|
<pkt-button
|
|
1400
1357
|
skin="tertiary"
|
|
1401
1358
|
size="medium"
|
|
@@ -1405,15 +1362,15 @@
|
|
|
1405
1362
|
>
|
|
1406
1363
|
Logg ut
|
|
1407
1364
|
</pkt-button>
|
|
1408
|
-
`:
|
|
1365
|
+
`:y}
|
|
1409
1366
|
</div>
|
|
1410
1367
|
</header>
|
|
1411
|
-
`}render(){const t=this.renderHeader();if(this.isFixed){const e=
|
|
1368
|
+
`}render(){const t=this.renderHeader();if(this.isFixed){const e=N({"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 d`
|
|
1412
1369
|
<div class="pkt-header-service-wrapper">
|
|
1413
1370
|
${t}
|
|
1414
1371
|
<div class=${e}></div>
|
|
1415
1372
|
</div>
|
|
1416
|
-
`}return t}};Q([o({type:String,attribute:"service-name"})],
|
|
1373
|
+
`}return t}};Q([o({type:String,attribute:"service-name"})],G.prototype,"serviceName",2),Q([o({type:String,attribute:"service-link"})],G.prototype,"serviceLink",2),Q([o({type:String,attribute:"logo-link"})],G.prototype,"logoLink",2),Q([o({type:String,attribute:"search-placeholder"})],G.prototype,"searchPlaceholder",2),Q([o({type:String,attribute:"search-value"})],G.prototype,"searchValue",2),Q([o({type:Number,attribute:"mobile-breakpoint"})],G.prototype,"mobileBreakpoint",2),Q([o({type:Number,attribute:"tablet-breakpoint"})],G.prototype,"tabletBreakpoint",2),Q([o({type:String,attribute:"opened-menu"})],G.prototype,"openedMenu",2),Q([o({type:String,attribute:"log-out-button-placement"})],G.prototype,"logOutButtonPlacement",2),Q([o({type:String})],G.prototype,"position",2),Q([o({type:String,attribute:"scroll-behavior"})],G.prototype,"scrollBehavior",2),Q([o({type:Boolean,attribute:"hide-logo",converter:Yt})],G.prototype,"hideLogo",2),Q([o({type:Boolean,converter:Yt})],G.prototype,"compact",2),Q([o({type:Boolean,attribute:"show-search",converter:Yt})],G.prototype,"showSearch",2),Q([o({type:Boolean,attribute:"can-change-representation",converter:Yt})],G.prototype,"canChangeRepresentation",2),Q([o({type:Boolean,attribute:"has-log-out",converter:Yt})],G.prototype,"hasLogOut",2),Q([o({type:Object})],G.prototype,"user",2),Q([o({type:Array,attribute:"user-menu"})],G.prototype,"userMenu",2),Q([o({type:Object})],G.prototype,"representing",2),Q([D()],G.prototype,"isMobile",2),Q([D()],G.prototype,"isTablet",2),Q([D()],G.prototype,"openMenu",2),Q([D()],G.prototype,"isHidden",2),Q([D()],G.prototype,"componentWidth",2),Q([D()],G.prototype,"hasSlotContent",2),Q([D()],G.prototype,"alignSlotRight",2),Q([D()],G.prototype,"alignSearchRight",2),G=Q([F("pkt-header-service")],G);var zh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,ot=(s,t,e,i)=>{for(var n=i>1?void 0:i?qh(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&&zh(t,e,n),n};let at=class extends X{constructor(){super(),this.defaultSlot=E(),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.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.slotController=new rt(this,this.defaultSlot)}firstUpdated(t){super.firstUpdated(t),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 t=this.userMenu||[],e=this.userMenuFooter||[],i=this.userOptions||[];return e.length||i.length?[...t,...i,...e]:this.userMenu}render(){return d`
|
|
1417
1374
|
<pkt-header-service
|
|
1418
1375
|
service-name=${C(this.serviceName)}
|
|
1419
1376
|
service-link=${C(this.serviceLink)}
|
|
@@ -1437,35 +1394,35 @@
|
|
|
1437
1394
|
>
|
|
1438
1395
|
<div class="pkt-contents" ${M(this.defaultSlot)}></div>
|
|
1439
1396
|
</pkt-header-service>
|
|
1440
|
-
`}};ot([o({type:String,attribute:"service-name"})],at.prototype,"serviceName",2),ot([o({type:String,attribute:"service-link"})],at.prototype,"serviceLink",2),ot([o({type:String,attribute:"logo-link"})],at.prototype,"logoLink",2),ot([o({type:String,attribute:"search-placeholder"})],at.prototype,"searchPlaceholder",2),ot([o({type:String,attribute:"search-value"})],at.prototype,"searchValue",2),ot([o({type:Number,attribute:"mobile-breakpoint"})],at.prototype,"mobileBreakpoint",2),ot([o({type:Number,attribute:"tablet-breakpoint"})],at.prototype,"tabletBreakpoint",2),ot([o({type:String,attribute:"opened-menu"})],at.prototype,"openedMenu",2),ot([o({type:String,attribute:"log-out-button-placement"})],at.prototype,"logOutButtonPlacement",2),ot([o({type:String})],at.prototype,"position",2),ot([o({type:String,attribute:"scroll-behavior"})],at.prototype,"scrollBehavior",2),ot([o({type:Boolean,attribute:"hide-logo",converter:
|
|
1397
|
+
`}};ot([o({type:String,attribute:"service-name"})],at.prototype,"serviceName",2),ot([o({type:String,attribute:"service-link"})],at.prototype,"serviceLink",2),ot([o({type:String,attribute:"logo-link"})],at.prototype,"logoLink",2),ot([o({type:String,attribute:"search-placeholder"})],at.prototype,"searchPlaceholder",2),ot([o({type:String,attribute:"search-value"})],at.prototype,"searchValue",2),ot([o({type:Number,attribute:"mobile-breakpoint"})],at.prototype,"mobileBreakpoint",2),ot([o({type:Number,attribute:"tablet-breakpoint"})],at.prototype,"tabletBreakpoint",2),ot([o({type:String,attribute:"opened-menu"})],at.prototype,"openedMenu",2),ot([o({type:String,attribute:"log-out-button-placement"})],at.prototype,"logOutButtonPlacement",2),ot([o({type:String})],at.prototype,"position",2),ot([o({type:String,attribute:"scroll-behavior"})],at.prototype,"scrollBehavior",2),ot([o({type:Boolean,attribute:"hide-logo",converter:Yt})],at.prototype,"hideLogo",2),ot([o({type:Boolean,converter:Yt})],at.prototype,"compact",2),ot([o({type:Boolean,attribute:"show-search",converter:Yt})],at.prototype,"showSearch",2),ot([o({type:Boolean,attribute:"can-change-representation",converter:Yt})],at.prototype,"canChangeRepresentation",2),ot([o({type:Boolean,attribute:"has-log-out",converter:Yt})],at.prototype,"hasLogOut",2),ot([o({type:Object})],at.prototype,"user",2),ot([o({type:Array,attribute:"user-menu"})],at.prototype,"userMenu",2),ot([o({type:Object})],at.prototype,"representing",2),ot([o({type:Array,attribute:"user-menu-footer"})],at.prototype,"userMenuFooter",2),ot([o({type:Array,attribute:"user-options"})],at.prototype,"userOptions",2),at=ot([F("pkt-header")],at);var Wh=Object.defineProperty,Rh=Object.getOwnPropertyDescriptor,Je=(s,t,e,i)=>{for(var n=i>1?void 0:i?Rh(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&&Wh(t,e,n),n};let De=class extends X{constructor(){super(),this.defaultSlot=E(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new rt(this,this.defaultSlot)}render(){const t=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),e=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return d`
|
|
1441
1398
|
<a
|
|
1442
1399
|
href=${this.href}
|
|
1443
1400
|
class=${t}
|
|
1444
1401
|
target=${this.openInNewTab?"_blank":"_self"}
|
|
1445
1402
|
rel=${C(this.openInNewTab?"noopener noreferrer":void 0)}
|
|
1446
1403
|
>
|
|
1447
|
-
${this.iconName&&
|
|
1448
|
-
${this.title&&
|
|
1404
|
+
${this.iconName&&d`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
1405
|
+
${this.title&&d`<div class=${e}>${this.title}</div>`}
|
|
1449
1406
|
|
|
1450
1407
|
<div class="pkt-linkcard__text" ${M(this.defaultSlot)}></div>
|
|
1451
1408
|
</a>
|
|
1452
|
-
`}};
|
|
1409
|
+
`}};Je([o({type:String,reflect:!0})],De.prototype,"title",2),Je([o({type:String,reflect:!0})],De.prototype,"href",2),Je([o({type:String,reflect:!0})],De.prototype,"iconName",2),Je([o({type:Boolean,reflect:!0})],De.prototype,"external",2),Je([o({type:Boolean,reflect:!0})],De.prototype,"openInNewTab",2),Je([o({type:String,reflect:!0})],De.prototype,"skin",2),De=Je([F("pkt-linkcard")],De);var Kh=Object.defineProperty,Yh=Object.getOwnPropertyDescriptor,ke=(s,t,e,i)=>{for(var n=i>1?void 0:i?Yh(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&&Kh(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.0/animations/";let ie=class extends X{constructor(){super(),this.defaultSlot=E(),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 rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(t){t.has("delay")&&this.setupLoader()}render(){const t=N({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),e=N({"pkt-contents":!0,"pkt-hide":this.isLoading});return d`<div
|
|
1453
1410
|
role="status"
|
|
1454
1411
|
aria-live="polite"
|
|
1455
1412
|
aria-busy=${this.isLoading?"true":"false"}
|
|
1456
1413
|
class=${t}
|
|
1457
1414
|
>
|
|
1458
|
-
${this.isLoading&&this._shouldDisplayLoader?
|
|
1415
|
+
${this.isLoading&&this._shouldDisplayLoader?d`<div class="pkt-loader__spinner">
|
|
1459
1416
|
<pkt-icon
|
|
1460
1417
|
name=${this.getVariant(this.variant)}
|
|
1461
1418
|
path=${this.loadingAnimationPath}
|
|
1462
1419
|
class="pkt-loader__svg pkt-loader__${this.variant}"
|
|
1463
1420
|
></pkt-icon>
|
|
1464
|
-
${this.message&&
|
|
1465
|
-
</div>`:
|
|
1421
|
+
${this.message&&d`<p>${this.message}</p>`}
|
|
1422
|
+
</div>`:y}
|
|
1466
1423
|
<div class=${e} ${M(this.defaultSlot)}></div>
|
|
1467
|
-
</div>`}getVariant(t){switch(t){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};
|
|
1468
|
-
${this.closable?
|
|
1424
|
+
</div>`}getVariant(t){switch(t){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};ke([o({type:Number})],ie.prototype,"delay",2),ke([o({type:Boolean})],ie.prototype,"inline",2),ke([o({type:Boolean})],ie.prototype,"isLoading",2),ke([o({type:String})],ie.prototype,"message",2),ke([o({type:String})],ie.prototype,"size",2),ke([o({type:String})],ie.prototype,"variant",2),ke([o({type:String})],ie.prototype,"loadingAnimationPath",2),ke([D()],ie.prototype,"_shouldDisplayLoader",2),ie=ke([F("pkt-loader")],ie);const Gh={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},en={props:Gh};var Zh=Object.defineProperty,Xh=Object.getOwnPropertyDescriptor,ks=(s,t,e,i)=>{for(var n=i>1?void 0:i?Xh(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&&Zh(t,e,n),n};let Qe=class extends X{constructor(){super(),this.defaultSlot=E(),this.closable=en.props.closable.default,this.compact=en.props.compact.default,this.title="",this.skin=en.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 rt(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&Vn(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 d`<div class=${N(s)}>
|
|
1425
|
+
${this.closable?d`<div class="pkt-messagebox__close">
|
|
1469
1426
|
<button
|
|
1470
1427
|
@click=${this.close}
|
|
1471
1428
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
@@ -1473,24 +1430,24 @@
|
|
|
1473
1430
|
>
|
|
1474
1431
|
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
1475
1432
|
</button>
|
|
1476
|
-
</div>`:
|
|
1477
|
-
${this.title?
|
|
1433
|
+
</div>`:y}
|
|
1434
|
+
${this.title?d`<div class="pkt-messagebox__title">${this.title}</div>`:y}
|
|
1478
1435
|
<div class="pkt-messagebox__text" ${M(this.defaultSlot)}></div>
|
|
1479
|
-
</div>`}};
|
|
1436
|
+
</div>`}};ks([o({type:Boolean,reflect:!0})],Qe.prototype,"closable",2),ks([o({type:Boolean,reflect:!0})],Qe.prototype,"compact",2),ks([o({type:String,reflect:!0})],Qe.prototype,"title",2),ks([o({type:String,reflect:!0})],Qe.prototype,"skin",2),ks([D()],Qe.prototype,"_isClosed",2),Qe=ks([F("pkt-messagebox")],Qe);const Jh={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},sn={props:Jh};var Qh=Object.defineProperty,tc=Object.getOwnPropertyDescriptor,ne=(s,t,e,i)=>{for(var n=i>1?void 0:i?tc(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&&Qh(t,e,n),n};let Vt=class extends X{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=sn.props.hideCloseButton.default,this.closeOnBackdropClick=sn.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=sn.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=E(),this.dialogRef=E(),this._isOpen=!1,this.close=(t,e=!1)=>{var i;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const n=document.activeElement;n&&!this.isElementInViewport(n)&&n.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),e||(i=this.dialogRef.value)==null||i.close(),this.requestUpdate()},this.showModal=(t=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const i=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var n;this.dialogRef.value&&((n=this.dialogRef.value)==null||n.focus())}),i&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:t},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new rt(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(t){super.firstUpdated(t),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>cd).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(t){t.key==="Escape"&&this.close(t)}handleBackdropClick(t){var e;this.closeOnBackdropClick&&t.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(t)}isElementInViewport(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const t={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},i={"pkt-modal__content":!0,"pkt-txt-18-light":!0},n=this.closeButtonSkin==="blue",a={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return d`
|
|
1480
1437
|
<dialog
|
|
1481
|
-
class=${
|
|
1438
|
+
class=${N(t)}
|
|
1482
1439
|
${M(this.dialogRef)}
|
|
1483
1440
|
aria-labelledby="pkt-modal__headingText"
|
|
1484
1441
|
aria-describedby="pkt-modal__content"
|
|
1485
1442
|
@close=${r=>this.close(r,!0)}
|
|
1486
1443
|
>
|
|
1487
1444
|
<div class="pkt-modal__wrapper">
|
|
1488
|
-
${this.headingText||!this.hideCloseButton?
|
|
1445
|
+
${this.headingText||!this.hideCloseButton?d`<div class="pkt-modal__header">
|
|
1489
1446
|
<div class="pkt-modal__header-background"></div>
|
|
1490
|
-
${this.headingText?
|
|
1447
|
+
${this.headingText?d`<h1 id="pkt-modal__headingText" class=${N(e)}>
|
|
1491
1448
|
${this.headingText}
|
|
1492
|
-
</h1>`:
|
|
1493
|
-
${this.hideCloseButton?
|
|
1449
|
+
</h1>`:d`<div class="pkt-modal__headingText"></div>`}
|
|
1450
|
+
${this.hideCloseButton?d`<div class="pkt-modal__noCloseButton"></div>`:d`<div class="${N(a)}">
|
|
1494
1451
|
<pkt-button
|
|
1495
1452
|
@click=${r=>this.close(r)}
|
|
1496
1453
|
aria-label="close"
|
|
@@ -1502,46 +1459,46 @@
|
|
|
1502
1459
|
Lukk
|
|
1503
1460
|
</pkt-button>
|
|
1504
1461
|
</div>`}
|
|
1505
|
-
</div>`:
|
|
1462
|
+
</div>`:y}
|
|
1506
1463
|
<div class="pkt-modal__container">
|
|
1507
1464
|
<div
|
|
1508
1465
|
id="pkt-modal__content"
|
|
1509
|
-
class=${
|
|
1466
|
+
class=${N(i)}
|
|
1510
1467
|
${M(this.defaultSlot)}
|
|
1511
1468
|
></div>
|
|
1512
1469
|
</div>
|
|
1513
1470
|
</div>
|
|
1514
1471
|
</dialog>
|
|
1515
|
-
`}};
|
|
1472
|
+
`}};ne([o({type:String})],Vt.prototype,"headingText",2),ne([o({type:Boolean})],Vt.prototype,"removePadding",2),ne([o({type:Boolean})],Vt.prototype,"hideCloseButton",2),ne([o({type:Boolean})],Vt.prototype,"closeOnBackdropClick",2),ne([o({type:String})],Vt.prototype,"closeButtonSkin",2),ne([o({type:String})],Vt.prototype,"size",2),ne([o({type:String})],Vt.prototype,"variant",2),ne([o({type:String})],Vt.prototype,"drawerPosition",2),ne([o({type:Boolean})],Vt.prototype,"transparentBackdrop",2),ne([D()],Vt.prototype,"_isOpen",2),Vt=ne([F("pkt-modal")],Vt);/**
|
|
1516
1473
|
* @license
|
|
1517
1474
|
* Copyright 2018 Google LLC
|
|
1518
1475
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1519
|
-
*/const
|
|
1476
|
+
*/const $a="important",ec=" !"+$a,sc=He(class extends ls{constructor(s){var t;if(super(s),s.type!==Qt.ATTRIBUTE||s.name!=="style"||((t=s.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce(((t,e)=>{const i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(s,[t]){const{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(const i in t){const n=t[i];if(n!=null){this.ft.add(i);const a=typeof n=="string"&&n.endsWith(ec);i.includes("-")||a?e.setProperty(i,a?n.slice(0,-11):n,a?$a:""):e[i]=n}}return Dt}});var ic=Object.defineProperty,nc=Object.getOwnPropertyDescriptor,mt=(s,t,e,i)=>{for(var n=i>1?void 0:i?nc(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&&ic(t,e,n),n};let ct=class extends X{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=Oe(),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=E(),this.progressBarRef=E()}firstUpdated(s){super.firstUpdated(s),this.setComputedValues(),this.syncAttributes()}updated(s){super.updated(s),s.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),s.has("id")&&this.id&&(this.progressBarId=this.id),(s.has("statusType")||s.has("id")||s.has("ariaLabelledby"))&&(this.progressbarId=this.id||Oe(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(s.has("ariaValueText")||s.has("valueCurrent")||s.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const s=this.statusType!=="none",t=this.valueMax-this.valueMin,e=this.valueCurrent/t*100,i=this.statusType==="fraction"?Math.round(e):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),n=`${this.valueCurrent} av ${t}`,a=N({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),r=N({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),h=N({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),c=N({"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 d` <div
|
|
1520
1477
|
class="pkt-progressbar__container"
|
|
1521
1478
|
.ref=${this.progressBarRef}
|
|
1522
|
-
style=${
|
|
1479
|
+
style=${sc({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${i}%`})}
|
|
1523
1480
|
>
|
|
1524
|
-
${this.title?
|
|
1481
|
+
${this.title?d`<p id=${`${this.progressBarId}-title`} class=${r}>${this.title}</p>`:y}
|
|
1525
1482
|
|
|
1526
1483
|
<div class="pkt-progressbar__bar-wrapper">
|
|
1527
1484
|
<div class=${a}></div>
|
|
1528
1485
|
</div>
|
|
1529
1486
|
|
|
1530
|
-
${s?
|
|
1531
|
-
<span class=${
|
|
1487
|
+
${s?d`<div class=${h}>
|
|
1488
|
+
<span class=${c} ${M(this.labelRef)}>
|
|
1532
1489
|
${this.statusType==="percentage"?`${i}%`:n}
|
|
1533
1490
|
</span>
|
|
1534
|
-
</div>`:
|
|
1535
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||
|
|
1536
|
-
${this.tagText?
|
|
1537
|
-
${this.optionalTag?
|
|
1538
|
-
${this.requiredTag?
|
|
1539
|
-
`,a=()=>
|
|
1491
|
+
</div>`:y}
|
|
1492
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||Oe(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""}syncAttributes(){this._handleAttribute("aria-live",this.ariaLive),this._handleAttribute("aria-valuenow",this.valueCurrent),this._handleAttribute("aria-valuemin",this.valueMin),this._handleAttribute("aria-valuemax",this.valueMax),this._handleAttribute("aria-valuetext",this.computedAriaValueText),this._handleAttribute("aria-label",this.ariaLabel),this._handleAttribute("role",this.role),this._handleAttribute("aria-atomic","true"),this._handleAttribute("id",this.progressbarId),this.ariaLabel||this._handleAttribute("aria-labelledby",this.computedAriaLabelledby)}_handleAttribute(s,t){t==null||t===""?this.removeAttribute(s):this.setAttribute(s,String(t))}};mt([o({type:String})],ct.prototype,"ariaLabel",2),mt([o({type:String,reflect:!0})],ct.prototype,"ariaLabelledby",2),mt([o({type:String,reflect:!0})],ct.prototype,"ariaValueText",2),mt([o({type:String})],ct.prototype,"ariaLive",2),mt([o({type:String,reflect:!0})],ct.prototype,"id",2),mt([o({type:String})],ct.prototype,"role",2),mt([o({type:String})],ct.prototype,"skin",2),mt([o({type:String})],ct.prototype,"statusPlacement",2),mt([o({type:String})],ct.prototype,"statusType",2),mt([o({type:String,reflect:!0})],ct.prototype,"title",2),mt([o({type:String})],ct.prototype,"titlePosition",2),mt([o({type:Number,reflect:!0})],ct.prototype,"valueCurrent",2),mt([o({type:Number})],ct.prototype,"valueMax",2),mt([o({type:Number})],ct.prototype,"valueMin",2),mt([D()],ct.prototype,"labelWidth",2),mt([D()],ct.prototype,"progressbarId",2),mt([D()],ct.prototype,"computedAriaLabelledby",2),mt([D()],ct.prototype,"computedAriaValueText",2),ct=mt([F("pkt-progressbar")],ct);var ac=Object.defineProperty,rc=Object.getOwnPropertyDescriptor,Ut=(s,t,e,i)=>{for(var n=i>1?void 0:i?rc(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&&ac(t,e,n),n};let Lt=class extends L{constructor(){super(...arguments),this.inputRef=E(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(s,t,e){s==="defaultChecked"&&(this._checked=this.defaultChecked),s==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(s,t,e)}render(){const s=N({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=N({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),e=N({"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=()=>d`
|
|
1493
|
+
${this.tagText?d`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:y}
|
|
1494
|
+
${this.optionalTag?d`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:y}
|
|
1495
|
+
${this.requiredTag?d`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:y}
|
|
1496
|
+
`,a=()=>d`
|
|
1540
1497
|
<label class=${e} for=${this.id+"-internal"}>
|
|
1541
1498
|
${this.label} ${n()}
|
|
1542
|
-
${this.checkHelptext?
|
|
1499
|
+
${this.checkHelptext?d`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:y}
|
|
1543
1500
|
</label>
|
|
1544
|
-
`;return
|
|
1501
|
+
`;return d`
|
|
1545
1502
|
<div class="pkt-input-check">
|
|
1546
1503
|
<div class=${s}>
|
|
1547
1504
|
<input
|
|
@@ -1562,11 +1519,11 @@
|
|
|
1562
1519
|
${a()}
|
|
1563
1520
|
</div>
|
|
1564
1521
|
</div>
|
|
1565
|
-
`}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))}};
|
|
1522
|
+
`}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))}};Ut([o({type:String,reflect:!0})],Lt.prototype,"value",2),Ut([o({type:String})],Lt.prototype,"checkHelptext",2),Ut([o({type:Boolean})],Lt.prototype,"defaultChecked",2),Ut([o({type:Boolean})],Lt.prototype,"hasTile",2),Ut([o({type:Boolean,reflect:!0})],Lt.prototype,"checked",2),Ut([o({type:String,reflect:!0})],Lt.prototype,"type",2),Ut([o({type:String})],Lt.prototype,"tagText",2),Ut([o({type:Boolean})],Lt.prototype,"optionalTag",2),Ut([o({type:String})],Lt.prototype,"optionalText",2),Ut([o({type:Boolean})],Lt.prototype,"requiredTag",2),Ut([o({type:String})],Lt.prototype,"requiredText",2),Ut([D()],Lt.prototype,"_checked",2),Lt=Ut([F("pkt-radiobutton")],Lt);/**
|
|
1566
1523
|
* @license
|
|
1567
1524
|
* Copyright 2021 Google LLC
|
|
1568
1525
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1569
|
-
*/let
|
|
1526
|
+
*/let _a=class extends Event{constructor(t,e,i,n){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=i,this.subscribe=n??!1}};/**
|
|
1570
1527
|
* @license
|
|
1571
1528
|
* Copyright 2021 Google LLC
|
|
1572
1529
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1574,31 +1531,31 @@
|
|
|
1574
1531
|
* @license
|
|
1575
1532
|
* Copyright 2021 Google LLC
|
|
1576
1533
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1577
|
-
*/let
|
|
1534
|
+
*/let wa=class{constructor(t,e,i,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(a,r)=>{this.unsubscribe&&(this.unsubscribe!==r&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=a,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(a,r)),this.unsubscribe=r},this.host=t,e.context!==void 0){const a=e;this.context=a.context,this.callback=a.callback,this.subscribe=a.subscribe??!1}else this.context=e,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 _a(this.context,this.host,this.t,this.subscribe))}};/**
|
|
1578
1535
|
* @license
|
|
1579
1536
|
* Copyright 2021 Google LLC
|
|
1580
1537
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1581
|
-
*/class
|
|
1538
|
+
*/class oc{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const i=e||!Object.is(t,this.o);this.o=t,i&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:i}]of this.subscriptions)e(this.o,i)},t!==void 0&&(this.value=t)}addCallback(t,e,i){if(!i)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:n}=this.subscriptions.get(t);t(this.value,n)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
1582
1539
|
* @license
|
|
1583
1540
|
* Copyright 2021 Google LLC
|
|
1584
1541
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1585
|
-
*/let
|
|
1542
|
+
*/let lc=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},xa=class extends oc{constructor(t,e,i){var n,a;super(e.context!==void 0?e.initialValue:i),this.onContextRequest=r=>{if(r.context!==this.context)return;const h=r.contextTarget??r.composedPath()[0];h!==this.host&&(r.stopPropagation(),this.addCallback(r.callback,h,r.subscribe))},this.onProviderRequest=r=>{if(r.context!==this.context||(r.contextTarget??r.composedPath()[0])===this.host)return;const h=new Set;for(const[c,{consumerHost:p}]of this.subscriptions)h.has(c)||(h.add(c),p.dispatchEvent(new _a(this.context,p,c,!0)));r.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(a=(n=this.host).addController)==null||a.call(n,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new lc(this.context,this.host))}};/**
|
|
1586
1543
|
* @license
|
|
1587
1544
|
* Copyright 2017 Google LLC
|
|
1588
1545
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1589
|
-
*/function
|
|
1546
|
+
*/function hc({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return{get(){return t.get.call(this)},set(n){return i.get(this).setValue(n),t.set.call(this,n)},init(n){return i.set(this,new xa(this,{context:s,initialValue:n})),n}};{t.constructor.addInitializer((r=>{i.set(r,new xa(r,{context:s}))}));const n=Object.getOwnPropertyDescriptor(t,e);let a;if(n===void 0){const r=new WeakMap;a={get(){return r.get(this)},set(h){i.get(this).setValue(h),r.set(this,h)},configurable:!0,enumerable:!0}}else{const r=n.set;a={...n,set(h){i.get(this).setValue(h),r==null||r.call(this,h)}}}return void Object.defineProperty(t,e,a)}}}/**
|
|
1590
1547
|
* @license
|
|
1591
1548
|
* Copyright 2022 Google LLC
|
|
1592
1549
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1593
|
-
*/function
|
|
1550
|
+
*/function cc({context:s,subscribe:t}){return(e,i)=>{typeof i=="object"?i.addInitializer((function(){new wa(this,{context:s,callback:n=>{e.set.call(this,n)},subscribe:t})})):e.constructor.addInitializer((n=>{new wa(n,{context:s,callback:a=>{n[i]=a},subscribe:t})}))}}const Sa=Symbol("pkt-tabs-context");var dc=Object.defineProperty,uc=Object.getOwnPropertyDescriptor,ys=(s,t,e,i)=>{for(var n=i>1?void 0:i?uc(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&&dc(t,e,n),n};let ts=class extends X{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=E(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new rt(this,this.defaultSlot)}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(t){(t.has("arrowNav")||t.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(t,e){this.tabRefs[e]=t,this.tabCount=Math.max(this.tabCount,e+1)}handleClick(t){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0}))}handleKeyUp(t,e){var i,n;this.useArrowNav&&(t.code==="ArrowLeft"&&e!==0&&((i=this.tabRefs[e-1])==null||i.focus()),t.code==="ArrowRight"&&e<this.tabCount-1&&((n=this.tabRefs[e+1])==null||n.focus()),(t.code==="ArrowDown"||t.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:e},bubbles:!0,composed:!0})))}render(){const t=this.useArrowNav?"tablist":"navigation";return d`
|
|
1594
1551
|
<div class="pkt-tabs">
|
|
1595
1552
|
<div class="pkt-tabs__list" role=${t} ${M(this.defaultSlot)}></div>
|
|
1596
1553
|
</div>
|
|
1597
|
-
`}};
|
|
1598
|
-
${this.icon?
|
|
1554
|
+
`}};ys([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],ts.prototype,"arrowNav",2),ys([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],ts.prototype,"disableArrowNav",2),ys([D()],ts.prototype,"tabRefs",2),ys([D()],ts.prototype,"tabCount",2),ys([hc({context:Sa}),D()],ts.prototype,"context",2),ts=ys([F("pkt-tabs")],ts);var pc=Object.defineProperty,fc=Object.getOwnPropertyDescriptor,ye=(s,t,e,i)=>{for(var n=i>1?void 0:i?fc(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&&pc(t,e,n),n};let ue=class extends X{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=E(),this.defaultSlot=E(),this.slotController=new rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index)})}handleClick(){this.context&&this.context.handleClick(this.index)}handleKeyUp(t){this.context&&this.context.handleKeyUp(t,this.index)}render(){var t;const e=((t=this.context)==null?void 0:t.useArrowNav)??!0,i=this.active?"active":"",n=e?"tab":void 0,a=e?this.active:void 0,r=this.active||!e?void 0:-1,h=d`
|
|
1555
|
+
${this.icon?d`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
|
|
1599
1556
|
<span ${M(this.defaultSlot)}></span>
|
|
1600
|
-
${this.tag?
|
|
1601
|
-
`;return this.href?
|
|
1557
|
+
${this.tag?d`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
|
|
1558
|
+
`;return this.href?d`
|
|
1602
1559
|
<a
|
|
1603
1560
|
${M(this.elementRef)}
|
|
1604
1561
|
href=${this.href}
|
|
@@ -1612,7 +1569,7 @@
|
|
|
1612
1569
|
>
|
|
1613
1570
|
${h}
|
|
1614
1571
|
</a>
|
|
1615
|
-
`:
|
|
1572
|
+
`:d`
|
|
1616
1573
|
<button
|
|
1617
1574
|
${M(this.elementRef)}
|
|
1618
1575
|
type="button"
|
|
@@ -1626,11 +1583,11 @@
|
|
|
1626
1583
|
>
|
|
1627
1584
|
${h}
|
|
1628
1585
|
</button>
|
|
1629
|
-
`}};
|
|
1586
|
+
`}};ye([o({type:Boolean,reflect:!0})],ue.prototype,"active",2),ye([o({type:String,reflect:!0})],ue.prototype,"href",2),ye([o({type:String,reflect:!0})],ue.prototype,"icon",2),ye([o({type:String,reflect:!0})],ue.prototype,"controls",2),ye([o({type:String,reflect:!0})],ue.prototype,"tag",2),ye([o({type:String,reflect:!0,attribute:"tag-skin"})],ue.prototype,"tagSkin",2),ye([o({type:Number,reflect:!0})],ue.prototype,"index",2),ye([cc({context:Sa,subscribe:!0}),o({attribute:!1})],ue.prototype,"context",2),ue=ye([F("pkt-tab-item")],ue);/**
|
|
1630
1587
|
* @license
|
|
1631
1588
|
* Copyright 2020 Google LLC
|
|
1632
1589
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1633
|
-
*/const
|
|
1590
|
+
*/const gc=He(class extends ls{constructor(s){if(super(s),s.type!==Qt.PROPERTY&&s.type!==Qt.ATTRIBUTE&&s.type!==Qt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Bn(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[t]){if(t===Dt||t===y)return t;const e=s.element,i=s.name;if(s.type===Qt.PROPERTY){if(t===e[i])return Dt}else if(s.type===Qt.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return Dt}else if(s.type===Qt.ATTRIBUTE&&e.getAttribute(i)===t+"")return Dt;return jn(s),t}});var mc=Object.defineProperty,vc=Object.getOwnPropertyDescriptor,Xs=(s,t,e,i)=>{for(var n=i>1?void 0:i?vc(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&&mc(t,e,n),n};let $s=class extends L{constructor(){super(),this.inputRef=E(),this.helptextSlot=E(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new rt(this,this.helptextSlot)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}updated(t){var e;super.updated(t),t.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const t=N({"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 d`<pkt-input-wrapper
|
|
1634
1591
|
label=${this.label}
|
|
1635
1592
|
?counter=${this.counter}
|
|
1636
1593
|
?disabled=${this.disabled}
|
|
@@ -1660,7 +1617,7 @@
|
|
|
1660
1617
|
id=${this.id+"-input"}
|
|
1661
1618
|
name=${(this.name||this.id)+"-input"}
|
|
1662
1619
|
placeholder=${C(this.placeholder)}
|
|
1663
|
-
.value=${
|
|
1620
|
+
.value=${gc(this.value)}
|
|
1664
1621
|
minlength=${C(this.minlength)}
|
|
1665
1622
|
maxlength=${C(this.maxlength)}
|
|
1666
1623
|
?readonly=${this.readonly}
|
|
@@ -1675,7 +1632,7 @@
|
|
|
1675
1632
|
@focus=${i=>{this.onFocus(),i.stopImmediatePropagation()}}
|
|
1676
1633
|
@blur=${i=>{this.value=i.target.value,this.onBlur(),i.stopImmediatePropagation()}}
|
|
1677
1634
|
></textarea>
|
|
1678
|
-
</pkt-input-wrapper>`}};
|
|
1635
|
+
</pkt-input-wrapper>`}};Xs([o({type:String,reflect:!0})],$s.prototype,"value",2),Xs([o({type:String})],$s.prototype,"autocomplete",2),Xs([o({type:Number})],$s.prototype,"rows",2),Xs([D()],$s.prototype,"counterCurrent",2),$s=Xs([F("pkt-textarea")],$s);var bc=Object.defineProperty,kc=Object.getOwnPropertyDescriptor,Ei=(s,t,e,i)=>{for(var n=i>1?void 0:i?kc(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&&bc(t,e,n),n};let Js=class extends L{constructor(){super(),this.inputRef=E(),this.helptextSlot=E(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new ba(this),this.slotController=new rt(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(i=>{const n={value:i.hasAttribute("value")?i.getAttribute("value")??"":i.textContent??"",label:i.textContent||i.getAttribute("value")||"",disabled:i.hasAttribute("disabled"),selected:i.hasAttribute("selected"),hidden:i.hasAttribute("data-hidden")};i.getAttribute("selected")&&!this.value&&(this.value=n.value),this._options.push(n)}):(this._options=this._optionsProp,this._options.forEach(i=>{i.selected&&!this.value&&(this.value=i.value)}))}add(t,e){const i={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(i);else if(typeof e=="number")this._options.splice(e,0,i);else{const n=e.value||e.text,a=this._options.findIndex(r=>r.value===n);a>=0?this._options.splice(a,0,i):this._options.push(i)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(n=>n.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,i){var n,a;t==="options"&&(this._options=i?JSON.parse(i):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((n=this.inputRef.value)==null?void 0:n.selectedIndex):this._options.findIndex(r=>r.value===i),this.selectedOptions=(a=this.inputRef.value)==null?void 0:a.selectedOptions,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}update(t){var e,i;super.update(t),t.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(n=>n.value===this.value),this.selectedOptions=(i=this.inputRef.value)==null?void 0:i.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return d`
|
|
1679
1636
|
<pkt-input-wrapper
|
|
1680
1637
|
?counter=${this.counter}
|
|
1681
1638
|
?disabled=${this.disabled}
|
|
@@ -1712,7 +1669,7 @@
|
|
|
1712
1669
|
@blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
|
|
1713
1670
|
${M(this.inputRef)}
|
|
1714
1671
|
>
|
|
1715
|
-
${this._options.length>0?this._options.map(e=>
|
|
1672
|
+
${this._options.length>0?this._options.map(e=>d`<option
|
|
1716
1673
|
value=${e.value}
|
|
1717
1674
|
?selected=${this.value==e.value||e.selected}
|
|
1718
1675
|
?disabled=${e.disabled}
|
|
@@ -1723,8 +1680,8 @@
|
|
|
1723
1680
|
</select>
|
|
1724
1681
|
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1725
1682
|
</pkt-input-wrapper>
|
|
1726
|
-
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};
|
|
1727
|
-
<div class="${
|
|
1683
|
+
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};Ei([o({type:Array,attribute:"options"})],Js.prototype,"_optionsProp",2),Ei([o({type:String})],Js.prototype,"value",2),Ei([D()],Js.prototype,"_options",2),Js=Ei([F("pkt-select")],Js);var yc=Object.defineProperty,$c=Object.getOwnPropertyDescriptor,Qs=(s,t,e,i)=>{for(var n=i>1?void 0:i?$c(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&&yc(t,e,n),n};let _s=class extends X{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=E(),this.namedSlot=E(),this.slotController=new rt(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(s=>{this._list.push(s.toUpperCase())}),super.connectedCallback()}render(){const s={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return d`
|
|
1684
|
+
<div class="${N(s)}">
|
|
1728
1685
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
1729
1686
|
|
|
1730
1687
|
<h2 class="pkt-txt-22">Innhold fra attributter og funksjoner</h2>
|
|
@@ -1747,12 +1704,12 @@
|
|
|
1747
1704
|
Si ${At.example.hi}
|
|
1748
1705
|
</button>
|
|
1749
1706
|
</div>
|
|
1750
|
-
`}renderList(s){return
|
|
1707
|
+
`}renderList(s){return d`
|
|
1751
1708
|
<ul>
|
|
1752
|
-
${s.map(t=>
|
|
1709
|
+
${s.map(t=>d`<li>${t}</li>`)}
|
|
1753
1710
|
</ul>
|
|
1754
|
-
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};
|
|
1711
|
+
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Qs([o({type:String})],_s.prototype,"string",2),Qs([o({converter:da})],_s.prototype,"strings",2),Qs([o({type:Boolean})],_s.prototype,"darkmode",2),Qs([o({type:Array})],_s.prototype,"_list",2),_s=Qs([F("pkt-component")],_s);const q=Jt({tagName:"pkt-icon",elementClass:Ue,react:_,displayName:"PktIcon",events:{}}),Ca=_.forwardRef(({defaultOpen:s=!1,id:t,title:e,skin:i,compact:n=!1,isOpen:a,children:r,name:h,className:c,onClick:p,onToggle:m},v)=>{const[$,b]=_.useState(s),{name:k}=tr(),x=h||k,T=a!==void 0?a:$;_.useEffect(()=>{a===void 0&&b(s)},[s,a]);const S=O=>{const et=O.currentTarget.open;a===void 0&&b(et),m==null||m(O)},A=O=>{setTimeout(()=>{p==null||p(O)},0)},I=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,c].filter(Boolean).join(" ");return l.jsxs("details",{ref:v,className:I,id:t,open:T,onClick:A,name:x,onToggle:S,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(q,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),l.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${t}`,role:"region",children:l.jsx("div",{className:"pkt-accordion-item__content-inner",children:r})})]})});Ca.displayName="PktAccordionItem";function _c(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var nn={exports:{}};/*!
|
|
1755
1712
|
Copyright (c) 2018 Jed Watson.
|
|
1756
1713
|
Licensed under the MIT License (MIT), see
|
|
1757
1714
|
http://jedwatson.github.io/classnames
|
|
1758
|
-
*/var va;function Jh(){return va||(va=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})()})(Qi)),Qi.exports}var Qh=Jh();const X=Xh(Qh),tn=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:d="info",className:u,...g})=>{const[m,$]=_.useState(!1),b={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":m},y={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=_.useCallback(()=>{$(!0),g.onClose&&g.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[g.onClose,$]),T=a||r;return l.jsx("div",{...g,"aria-live":T,role:h,className:X(b,u),children:l.jsxs("div",{className:X(y),children:[l.jsx(q,{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(be,{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]})]})})};tn.displayName="PktAlert";const ba=ie({tagName:"pkt-backlink",elementClass:ms,react:_,displayName:"PktBackLink"});ba.displayName="PktBackLink";const td=_.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},n)=>{const a=s,r=a[a.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:n,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((d,u)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:u===a.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?l.jsxs(on.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):l.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${u}`))}),t==="router"?l.jsxs(on.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.0/animations/";const be=_.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:u="primary",type:g="button",variant:m="label-only",state:$,color:b,isLoading:y=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...S},A)=>{const I=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",d&&"pkt-btn--full-small",u&&`pkt-btn--${u}`,m&&`pkt-btn--${m}`,b&&`pkt-btn--${b}`,$&&`pkt-btn--${$}`,y&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...S,"aria-busy":y||void 0,"aria-disabled":x||void 0,disabled:x,className:I,type:g,ref:A,children:[y&&l.jsx(q,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),m!=="label-only"&&l.jsx(q,{className:"pkt-btn__icon",name:e,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),m==="icons-right-and-left"&&l.jsx(q,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});be.displayName="PktButton";const ed=ie({tagName:"pkt-card",elementClass:gt,react:_,displayName:"PktCard",events:{}}),ka=_.forwardRef(({children:s,...t},e)=>l.jsx(ed,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));ka.displayName="PktCard";const ya=_.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:u="right",defaultChecked:g,checked:m,indeterminate:$,optionalTag:b,optionalText:y="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:S,...A},I)=>{const O=_.useRef(null);_.useEffect(()=>{O.current&&$!==void 0&&(O.current.indeterminate=$)},[$]),_.useEffect(()=>{typeof I=="function"?I(O.current):I&&(I.current=O.current)},[I]);const K=[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--${u}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),Ot=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Et=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),it=()=>l.jsxs(l.Fragment,{children:[S&&l.jsx("span",{className:Et+" pkt-tag--gray",children:S}),b&&l.jsx("span",{className:Et+" pkt-tag--blue-light",children:y}),x&&l.jsx("span",{className:Et+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:K,children:l.jsxs("div",{className:Ot,children:[u==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:O,className:`pkt-input-check__input-checkbox ${a?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...m!==void 0?{checked:m}:{defaultChecked:g},...A}),u==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});ya.displayName="PktCheckbox";const sd=ie({tagName:"pkt-combobox",elementClass:nt,react:_,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),$a=_.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(sd,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));$a.displayName="PktCombobox";const Ei=ie({tagName:"pkt-consent",elementClass:Xt,react:_,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Ei.displayName="PktConsent";const id=ie({tagName:"pkt-datepicker",elementClass:ht,react:_,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),_a=_.forwardRef(({helptext:s,...t},e)=>l.jsx(id,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));_a.displayName="PktDatepicker";const nd=({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:u=null,devMode:g=!1,cookieDomain:m=null,cookieSecure:$=null,cookieExpiryDays:b=null,onToggleConsent:y=x=>{console.log(x.detail)}})=>{var T,S;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((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),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}),(S=t.links)==null?void 0:S.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),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(q,{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(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Ei,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:u,devMode:g,cookieDomain:m,cookieSecure:$,cookieExpiryDays:b,onToggleConsent:y})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(A=>A.language).map((A,I)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:A.href,"aria-label":`til ${A.language} versjon av nettsiden`,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:A.language})},`sociallinks-language-${I}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(A=>A.iconName).map((A,I)=>l.jsx(_.Fragment,{children:l.jsx("a",{href:A.href,"aria-label":`til ${A.iconName}`,className:"pkt-footer__social-icon-link",target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(q,{className:"pkt-footer__social-icon",name:A.iconName})})},`sociallinks-${I}`))})]})]})})},ad=({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:u=null,cookieExpiryDays:g=null,onToggleConsent:m=b=>{console.log(b.detail)},className:$})=>{const b=[$,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((y,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${y.external?" pkt-link--external":""}`,href:y.href,target:y.openInNewTab||t?"_blank":"_self",rel:y.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),y.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(q,{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(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Ei,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:u,cookieExpiryDays:g,onToggleConsent:m})})]})})})},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:X(d,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(q,{name:t,className:"pkt-link__icon"}),r]})};Ni.displayName="PktLink";const rd=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Mi=({item:s,className:t})=>"href"in s?l.jsx(Ni,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:X("pkt-user-menu__link",t),children:s.title}):l.jsxs("button",{className:X("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(q,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),od=({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(Mi,{item:t})},e))}),ld=_.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const d=i==null?void 0:i.map(rd);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(od,{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(Mi,{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(Mi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})}),r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Mi,{item:{title:"Logg ut",iconName:"exit",onClick:r}})})]})})}),si=_.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:u="Valgfritt",requiredTag:g=!1,requiredText:m="Må fylles ut",tagText:$=null,hasError:b=!1,errorMessage:y,disabled:x=!1,inline:T=!1,ariaDescribedby:S,useWrapper:A=!0,children:I,className:O="",hasFieldset:K=!1,role:et="group",counterPosition:Ot="bottom"},Et)=>{const[it,kt]=_.useState(!1),Yt=S||(e?`${s}-helptext`:void 0),Nt=!!a,ct=Nt&&Ot==="top",de=Nt&&Ot==="bottom",ke=()=>kt(pt=>!pt),V=["pkt-inputwrapper",O,b?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),xt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),te=()=>Nt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,Se=()=>l.jsxs(l.Fragment,{children:[$&&l.jsx("span",{className:xt+" pkt-tag--gray",children:$}),d&&l.jsx("span",{className:xt+" pkt-tag--blue-light",children:u}),g&&l.jsx("span",{className:xt+" pkt-tag--beige",children:m})]}),ye=()=>{const pt=l.jsxs(l.Fragment,{children:[t," ",Se()]});return A?K?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:pt}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Yt,id:`${s}-label`,children:pt}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Yt,id:`${s}-label`,children:t})},ce=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&A&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(be,{skin:"tertiary",size:"small",variant:"icon-right",iconName:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ke,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${it?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),jt=l.jsxs(l.Fragment,{children:[ye(),ce(),ct&&l.jsx(te,{}),I,de&&l.jsx(te,{}),b&&y&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(tn,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:y})})]});return l.jsx("div",{className:V,ref:Et,role:et,children:K?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Yt,children:jt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:jt})})});si.displayName="PktInputWrapper";const en=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:d,hasError:u=!1,helptext:g,helptextDropdown:m,helptextDropdownButton:$,iconNameRight:b,inline:y=!1,fullwidth:x=!1,label:T,name:S,optionalTag:A=!1,optionalText:I,requiredTag:O=!1,requiredText:K,tagText:et=null,placeholder:Ot,prefix:Et,suffix:it,type:kt="text",useWrapper:Yt=!0,omitSearchIcon:Nt=!1,value:ct,minLength:de,maxLength:ke,min:V,max:xt,step:te,size:Se,readonly:ye,required:ce,dataTestid:jt,onChange:pt,skipForwardTestid:Ce=!1,...Te},ee)=>{const Ns=[r,"pkt-textinput"].join(" "),He=kt==="search"&&!b&&!Nt,rs=kt==="date"&&ct?ct.slice(0,10):ct,[os,Ee]=_.useState((ct==null?void 0:ct.length)||0),se=`${s}`,Ne=`${se}-label`,ls=e||Ne,Mt=yt=>{var Ms,Ve;n&&Ee(((Ve=(Ms=yt.currentTarget)==null?void 0:Ms.value)==null?void 0:Ve.length)||0),pt&&pt(yt)};return _.useEffect(()=>{ct!==void 0&&Ee((ct==null?void 0:ct.length)||0)},[ct]),l.jsx(si,{ariaDescribedby:t,className:Ns,disabled:h,errorMessage:d,forId:se,hasError:u,helptext:g,helptextDropdown:m,helptextDropdownButton:$,inline:y,label:T,optionalTag:A,optionalText:I,requiredTag:O,requiredText:K,tagText:et,useWrapper:Yt,counter:n,counterCurrent:os,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":jt,"data-skip-forward-testid":Ce?"true":void 0,children:[Et&&l.jsx("div",{className:"pkt-input-prefix",children:Et}),l.jsx("input",{...Te,ref:ee,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&os>a?"pkt-input--counter-error":""}`,type:kt,name:`${S||s}`,value:rs,id:se,placeholder:Ot,autoComplete:i,disabled:h,"aria-invalid":u,"aria-errormessage":`${s}-error`,"aria-labelledby":ls,min:V,max:xt,onChange:Mt,step:te,minLength:de,maxLength:ke,size:Se,required:ce}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(q,{className:"pkt-input-suffix-icon",name:b}),He&&l.jsx(q,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(q,{className:"pkt-input-icon",name:b}),!it&&He&&l.jsx(q,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})}),hd=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=_.useState(e);return _.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 dd(s){const t=_.useRef(0);_.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 wa=_.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,compact:i=!1,"data-mode":n,logOutButtonPlacement:a="none",logOut:r,openedMenu:h,showSearch:d=!1,onSearch:u,onSearchChange:g,searchValue:m,searchPlaceholder:$="Søk",representing:b,serviceLink:y,serviceClick:x,serviceName:T,user:S,userMenu:A,userMenuFooter:I,userOptions:O,canChangeRepresentation:K=!1,changeRepresentation:et,hideLogo:Ot=!1,logoLink:Et,logoClick:it,position:kt="fixed",scrollBehavior:Yt="hide"},Nt)=>{const ct=kt==="fixed",de=Yt==="hide";_.useEffect(()=>{I&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[I]),_.useEffect(()=>{O&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[O]),_.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 ke=_.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]),[V,xt]=_.useState(h||"none"),[te,Se]=_.useState(!1),[ye,ce]=_.useState(0),[jt,pt]=_.useState(!1),[Ce,Te]=_.useState(!1),ee=_.useRef(null),Ns=_.useRef(null),He=_.useRef(null),rs=_.useRef(null),os=_.useRef(null),Ee=_.useRef(null),se=_.useRef(null),Ne=_.useRef(!1),ls=hd(ee),Mt=ls<s,yt=ls<t,Ms=_.useCallback(j=>{ee.current=j,typeof Nt=="function"?Nt(j):Nt&&(Nt.current=j)},[Nt]);dd(ct&&Mt&&V!=="none");const Ve=_.useCallback((j,Pt)=>{const f=j.relatedTarget;let p;switch(Pt){case"user":p=Ns;break;case"slot":p=He;break;case"search":p=rs;break;default:return}const v=p.current;v&&(!f||!v.contains(f))&&xt("none")},[]),ni=_.useCallback(()=>{Ne.current&&se.current&&document.contains(se.current)&&se.current.focus(),se.current=null,Ne.current=!1},[]);_.useEffect(()=>{const j=f=>{S&&V==="user"&&!f.target.closest(".pkt-header-service__user-container")&&xt("none"),V==="slot"&&!f.target.closest(".pkt-header-service__slot-container")&&xt("none"),V==="search"&&!f.target.closest(".pkt-header-service__search-container")&&!f.target.closest(".pkt-header-service__search-input")&&xt("none")},Pt=f=>{f.key==="Escape"&&V!=="none"&&(f.preventDefault(),Ne.current=!0,xt("none"))};if(V!=="none")return document.addEventListener("mousedown",j),document.addEventListener("keydown",Pt),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",Pt)};ni()},[V,S,ni]),_.useEffect(()=>{const j=()=>{if(de){const Pt=window.pageYOffset||document.documentElement.scrollTop;if(Pt<0||Math.abs(Pt-ye)<60)return;Se(Pt>ye),ce(Pt)}};return document&&window.addEventListener("scroll",j),()=>{document&&window.removeEventListener("scroll",j)}},[de,ye]);const Ai=_.useCallback(j=>{const Pt=j==="slot"?He:rs,f=j==="slot"?os:Ee;if(!Pt.current||!f.current||!yt||Mt)return;const p=Pt.current.getBoundingClientRect(),v=f.current.offsetWidth,w=p.left+v>window.innerWidth;j==="slot"?pt(w):Te(w)},[yt,Mt]),As=_.useCallback(j=>{V!=="none"?xt("none"):(se.current=document.activeElement,xt(j))},[V]);_.useEffect(()=>{(V==="slot"||V==="search")&&requestAnimationFrame(()=>{Ai(V)})},[V,Ai]);const ai=l.jsxs("header",{className:X("pkt-header-service",i&&"pkt-header-service--compact",Mt&&"pkt-header-service--mobile",yt&&"pkt-header-service--tablet",ct&&"pkt-header-service--fixed",de&&"pkt-header-service--scroll-to-hide",te&&"pkt-header-service--hidden"),"data-mode":n,ref:Ms,children:[l.jsxs("div",{className:X("pkt-header-service__logo-area",(!T||T==="")&&"pkt-header-service__logo-area--without-service"),children:[!Ot&&l.jsx("span",{className:"pkt-header-service__logo",children:Et?l.jsx("a",{href:Et,"aria-label":"Tilbake til forside",children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.0/logos/"})}):it?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:it,children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.0/logos/"})}):l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.0/logos/"})}),T&&l.jsx("span",{className:"pkt-header-service__service-name",children:y?l.jsx(Ni,{href:y,className:"pkt-header-service__service-link ",children:T}):x?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:x,children:T}):l.jsx("span",{className:"pkt-header-service__service-link",children:T})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:X("pkt-header-service__slot-container",V==="slot"&&"is-open"),onBlur:j=>Ve(j,"slot"),ref:He,children:[yt&&e&&l.jsx(be,{skin:"secondary",variant:"icon-only",iconName:"menu",size:Mt?"small":"medium",state:V==="slot"?"active":"normal",onClick:()=>As("slot"),"aria-expanded":V==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:"Meny"}),l.jsx("div",{className:X("pkt-header-service__slot-content",jt&&"align-right"),id:"mobile-slot-menu",role:yt?"menu":void 0,"aria-label":yt?"Meny":void 0,ref:os,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),d&&l.jsx(l.Fragment,{children:yt?l.jsxs("div",{className:X("pkt-header-service__search-container",V==="search"&&"is-open"),onBlur:j=>Ve(j,"search"),ref:rs,children:[l.jsx(be,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:Mt?"small":"medium",onClick:()=>As("search"),state:V==="search"?"active":"normal","aria-expanded":V==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:X("pkt-header-service__mobile-menu",V==="search"&&"is-open",Ce&&"align-right"),ref:Ee,children:V==="search"&&l.jsx(en,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:m,autoFocus:!0,fullwidth:!0,onChange:j=>g==null?void 0:g(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(u==null||u(j.target.value))}})})]}):l.jsx(en,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:m,onChange:j=>g==null?void 0:g(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(u==null||u(j.target.value))}})}),yt&&r&&(a==="header"||a==="both")&&l.jsx(be,{skin:"secondary",size:Mt?"small":"medium",variant:"icon-only",iconName:"exit",onClick:r,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:j=>Ve(j,"user"),ref:Ns,children:[l.jsxs(be,{className:X("pkt-header-service__user-button",Mt&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:Mt?"small":"medium",state:V==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:V==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>As("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),V==="user"&&S&&l.jsx("div",{className:X(Mt?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(ld,{user:S,formattedLastLoggedIn:ke,representing:b,userMenu:A,canChangeRepresentation:K,changeRepresentation:et,logoutOnClick:a==="userMenu"||a==="both"?r:void 0})})]}),!Mt&&r&&(a==="header"||a==="both")&&l.jsx(be,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:r,children:"Logg ut"})]})]});return ct?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[ai,l.jsx("div",{className:X("pkt-header-service-spacer",i&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",Mt&&"pkt-header-service-spacer--mobile",yt&&"pkt-header-service-spacer--tablet")})]}):ai}),xa=_.forwardRef((s,t)=>l.jsx(wa,{...s,ref:t}));xa.displayName="PktHeader";const cd=ie({tagName:"pkt-heading",elementClass:Le,react:_,displayName:"PktHeading"}),Sa=_.forwardRef(({children:s,...t},e)=>l.jsx(cd,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Sa.displayName="PktHeading";const pd=ie({tagName:"pkt-helptext",elementClass:_e,react:_,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),Ca=_.forwardRef(({children:s,...t},e)=>l.jsx(pd,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ca.displayName="PktHelptext";const Ta=_.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]}));Ta.displayName="PktInput";const Ea=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...d})=>{const u=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),g=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...d,href:i,className:X(u,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(q,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:X(g),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};Ea.displayName="PktLinkCard";const ud=ie({tagName:"pkt-loader",elementClass:le,react:_,displayName:"PktLoader",events:{}}),Na=_.forwardRef(({children:s,...t},e)=>l.jsx(ud,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Na.displayName="PktLoader";const Ma=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[d,u]=_.useState(!1),g={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":d},m=_.createRef(),$=_.useCallback(()=>{u(!0),r&&r()},[u,r]);return l.jsxs("div",{...h,className:X(g,t),ref:m,children:[a&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:$,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(q,{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})]})};Ma.displayName="PktMessagebox";const fd=ie({tagName:"pkt-modal",elementClass:Rt,react:_,displayName:"PktModal",events:{}}),Aa=_.forwardRef(({children:s,...t},e)=>l.jsx(fd,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Aa.displayName="PktModal";const gd=ie({tagName:"pkt-progressbar",elementClass:dt,react:_,displayName:"PktProgressbar",events:{}}),Oa=_.forwardRef(({children:s,...t},e)=>l.jsx(gd,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Oa.displayName="PktProgressbar";const Pa=_.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:u,optionalTag:g,optionalText:m,requiredTag:$,requiredText:b,tagText:y,...x},T)=>{const S=[i,"pkt-input-check"].filter(Boolean).join(" "),A=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),I=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),O=["pkt-input-check__input-label",a?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),K=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),et=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:K+" pkt-tag--gray",children:y}),g&&l.jsx("span",{className:K+" pkt-tag--blue-light",children:m}),$&&l.jsx("span",{className:K+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:S,children:l.jsxs("div",{className:A,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:I,...u!==void 0?{checked:u}:{defaultChecked:d},...x}),l.jsxs("label",{className:O,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});Pa.displayName="PktRadioButton";const md=_.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:u,method:g,onChange:m,onSearch:$,onSuggestionClick:b,...y},x)=>{const T=(O,K)=>{O?O():b&&b(K)},S=O=>{d=O.target.value},A=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let I;return u?I=O=>l.jsx("form",{role:"search",className:A,action:u,method:g,children:O}):I=O=>l.jsx("div",{role:"search",className:A,children:O}),I(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:m||S,onKeyUp:$&&(O=>{O.key==="Enter"&&(O.preventDefault(),$(d))}),...y}),l.jsx(be,{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:$&&(O=>{O.preventDefault(),$(d)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((O,K)=>l.jsx("li",{children:_.createElement(O.href?"a":O.onClick?"button":"div",{href:O.href,className:`pkt-searchinput__suggestion ${O.onClick?"pkt-link-button":""} ${O.href||O.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:O.onClick?"button":void 0,onClick:()=>T(O.onClick,K),onKeyUp:et=>et.key==="Enter"&&T(O.onClick,K)},l.jsxs(l.Fragment,{children:[O.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:O.title}),O.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:O.text})]}))},`search-suggestion-${K}`))})]}))}),vd=_.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:u,id:g,inline:m=!1,fullwidth:$=!1,label:b,name:y,optionalTag:x=!1,optionalText:T,requiredTag:S=!1,requiredText:A,tagText:I,...O},K)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(si,{className:et,forId:`${g}-input`,label:b,helptext:h,helptextDropdown:d,helptextDropdownButton:u,optionalTag:x,optionalText:T,requiredTag:S,requiredText:A,tagText:I,hasError:r,errorMessage:a,disabled:n,inline:m,ariaDescribedby:s,children:l.jsx("select",{ref:K,className:`pkt-input ${$?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${g}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${g}-input`,name:y||g,...O,children:e})})}),bd=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)"}})}),kd=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"})]}),yd=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"})]}),$d=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:X("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:X("pkt-step__indicator"),children:e==="current"?kd:e==="completed"?yd:bd}),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})]})]}),_d=_.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const d=X(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),u=_.Children.map(e,(g,m)=>_.isValidElement(g)?_.cloneElement(g,{className:X(g.props.className,{"pkt-step--hideStep":i&&m!==s,"pkt-step--hideContent":n&&m!==s})}):g);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:u})}),wd=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:n,...a})=>l.jsx("table",{"data-testid":"pkt-table",className:X(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}),xd=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:X(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Sd=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:X(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Cd=({className:s,children:t,...e})=>l.jsx("thead",{className:X(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),Td=({className:s,children:t,...e})=>l.jsx("th",{className:X(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),Ed=({className:s,children:t,...e})=>l.jsx("tr",{className:X(s,"pkt-table__row",{}),role:"row",...e,children:t}),sn=_.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:d,type:u,"aria-description":g,...m},$)=>{const[b,y]=_.useState(!1),x=_.useCallback(()=>{y(!0),d&&d()},[y]),T=_.useRef(null),[S,A]=_.useState("");_.useEffect(()=>{var et,Ot;A(((Ot=(et=T.current)==null?void 0:et.textContent)==null?void 0:Ot.trim())??"")},[s]);const I=_.useMemo(()=>{if(n&&!h)return S&&`Klikk for å fjerne ${S}`||g},[n,h,S,g]),O={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},K={"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":b};return n?l.jsxs("button",{...m,className:X(K,a),type:u,onClick:x,"aria-label":h,"aria-description":I,ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(q,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...m,className:X(O,a),ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});sn.displayName="PktTag";const nn=_.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:d=0},u)=>{const{arrowNav:g,registerTabRef:m,handleKeyPress:$,selectTab:b}=Nd(),x={"aria-selected":g?!!t:void 0,"aria-controls":a,role:g?"tab":void 0,onKeyUp:S=>$(d,S),onClick:S=>{b(d),i==null||i(S)},tabIndex:t||!g?void 0:-1,ref:S=>{m(d,S),typeof u=="function"?u(S):u&&(u.current=S)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(q,{name:n,className:"pkt-icon--small"}),s,r&&l.jsx(sn,{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})});nn.displayName="PktTabItem";const Da=_.createContext(null),Nd=()=>{const s=_.useContext(Da);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Md=_.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=_.useRef([]),h=s&&!t,u=n&&_.Children.count(n)>0?_.Children.count(n):(e==null?void 0:e.length)||0;_.useEffect(()=>{r.current=r.current.slice(0,u)},[u]);const g=y=>{const x=e==null?void 0:e[y];x!=null&&x.action&&x.action(y),i&&i(y)},m=(y,x)=>{var T,S;h&&(x.code==="ArrowLeft"&&y!==0&&((T=r.current[y-1])==null||T.focus()),x.code==="ArrowRight"&&y<u-1&&((S=r.current[y+1])==null||S.focus()),(x.code==="ArrowDown"||x.code==="Space")&&g(y))},$=(y,x)=>{r.current[y]=x},b=e==null?void 0:e.map((y,x)=>{var T,S;return l.jsx(nn,{active:y.active,href:y.href,onClick:()=>g(x),icon:y.icon,controls:y.controls,tag:(T=y.tag)==null?void 0:T.text,tagSkin:(S=y.tag)==null?void 0:S.skin,index:x,children:y.text},x)});return l.jsx(Da.Provider,{value:{arrowNav:h,registerTabRef:$,handleKeyPress:m,selectTab:g},children:l.jsx("div",{className:"pkt-tabs",ref:a,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:n||b})})})}),Ad=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:d,helptext:u,helptextDropdown:g,helptextDropdownButton:m,inline:$,fullwidth:b=!1,label:y,name:x,optionalTag:T=!1,optionalText:S,requiredTag:A=!1,requiredText:I,tagText:O=null,placeholder:K,rows:et,useWrapper:Ot=!0,onChange:Et,value:it,autoComplete:kt="off",minLength:Yt,maxLength:Nt,readOnly:ct=!1,skipForwardTestid:de=!1,...ke},V)=>{const xt=[a,"pkt-textinput","pkt-textarea"].join(" "),te=`${s}-input`,Se=`${te}-label`,ye=e||Se,[ce,jt]=_.useState(0),pt=Ce=>{var Te,ee;if(i&&jt(((ee=(Te=Ce.currentTarget)==null?void 0:Te.value)==null?void 0:ee.length)||0),Et)return Et(Ce)};return _.useEffect(()=>{it!==void 0&&jt((it==null?void 0:it.length)||0)},[it]),l.jsx(si,{ariaDescribedby:t,className:xt,disabled:r,errorMessage:h,forId:te,hasError:d,helptext:u,helptextDropdown:g,helptextDropdownButton:m,inline:$,label:y,optionalTag:T,optionalText:S,requiredTag:A,requiredText:I,tagText:O,useWrapper:Ot,counter:i,counterCurrent:ce,counterMaxLength:n,children:l.jsx("textarea",{ref:V,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${n&&ce>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:te,placeholder:K,disabled:r,rows:et,"aria-labelledby":ye,"aria-invalid":d,"aria-errormessage":`${s}-error`,...ke,onChange:pt,value:it,autoComplete:kt,minLength:Yt,maxLength:Nt,"data-skip-forward-testid":de?"true":void 0})})});var Ts=window.CustomEvent;(!Ts||typeof Ts=="object")&&(Ts=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},Ts.prototype=window.Event.prototype);function Ia(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function Od(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 ii(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function La(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Pd(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function an(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Ba(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=Ba(n[a].shadowRoot),i));a++);return i}function Fa(s){return s.isConnected||document.body.contains(s)}function ja(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=W.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 Dd(s){if(!s.defaultPrevented){var t=s.target,e=W.imagemapUseValue,i=ja(s);e===null&&i&&(e=i.value);var n=ii(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function Ha(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",Dd,!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))}Ha.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Fa(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_),W.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=Ba(this.dialog_)),La(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(!Fa(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!W.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Od(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,W.needsCentering(this.dialog_)?(W.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 Ts("close",{bubbles:!1,cancelable:!1});Ia(this.dialog_,t)}};var W={};if(W.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"},W.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||!Pd(r,s))){var h=a.style.getPropertyValue("top"),d=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},W.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:!W.isInlinePositionSetByStylesheet(s)},W.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 Ha(s)},W.registerDialog=function(s){s.showModal||W.forceRegisterDialog(s)},W.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)}))},W.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})},W.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},W.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)},W.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=ii(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},W.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(),La(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}},W.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new Ts("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&Ia(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},W.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},W.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)},W.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())},W.dm=new W.DialogManager,W.formSubmitter=null,W.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Va=document.createElement("form");if(Va.setAttribute("method","dialog"),Va.method!=="dialog"){var Es=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(Es){var Id=Es.get;Es.get=function(){return an(this)?"dialog":Id.call(this)};var Ld=Es.set;Es.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Ld.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",Es)}}document.addEventListener("click",function(s){if(W.formSubmitter=null,W.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!an(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;W.imagemapUseValue=s.offsetX+","+s.offsetY}var n=ii(t);n&&(W.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=ii(t);if(!e){var i=ja(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var Bd=HTMLFormElement.prototype.submit,Fd=function(){if(!an(this))return Bd.call(this);var s=ii(this);s&&s.close()};HTMLFormElement.prototype.submit=Fd}const jd=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=hn,P.PktAccordionItem=ma,P.PktAlert=tn,P.PktBackLink=ba,P.PktBreadcrumbs=td,P.PktButton=be,P.PktCard=ka,P.PktCheckbox=ya,P.PktCombobox=$a,P.PktConsent=Ei,P.PktDatepicker=_a,P.PktFooter=nd,P.PktFooterSimple=ad,P.PktHeader=xa,P.PktHeaderService=wa,P.PktHeading=Sa,P.PktHelptext=Ca,P.PktIcon=q,P.PktInput=Ta,P.PktInputWrapper=si,P.PktLink=Ni,P.PktLinkCard=Ea,P.PktLoader=Na,P.PktMessagebox=Ma,P.PktModal=Aa,P.PktProgressbar=Oa,P.PktRadioButton=Pa,P.PktSearchInput=md,P.PktSelect=vd,P.PktStep=$d,P.PktStepper=_d,P.PktTabItem=nn,P.PktTable=wd,P.PktTableBody=xd,P.PktTableDataCell=Sd,P.PktTableHeader=Cd,P.PktTableHeaderCell=Td,P.PktTableRow=Ed,P.PktTabs=Md,P.PktTag=sn,P.PktTextarea=Ad,P.PktTextinput=en,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
1715
|
+
*/var Ta;function wc(){return Ta||(Ta=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 xc=wc();const Z=_c(xc),an=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:c="info",className:p,...m})=>{const[v,$]=_.useState(!1),b={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${c}`]:c,"pkt-hide":v},k={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=_.useCallback(()=>{$(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,$]),T=a||r;return l.jsx("div",{...m,"aria-live":T,role:h,className:Z(b,p),children:l.jsxs("div",{className:Z(k),children:[l.jsx(q,{className:"pkt-alert__icon","aria-hidden":"true",name:c==="info"?"alert-information":`alert-${c}`}),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 Na=Jt({tagName:"pkt-backlink",elementClass:ds,react:_,displayName:"PktBackLink"});Na.displayName="PktBackLink";const Sc=_.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},n)=>{const a=s,r=a[a.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:n,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((c,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===a.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})}):t==="router"?l.jsxs(dn.Link,{to:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]}):l.jsxs("a",{href:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(dn.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.0/animations/";const pe=_.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",iconPath:n,secondIconPath:a,size:r="medium",fullWidth:h=!1,fullWidthOnMobile:c=!1,skin:p="primary",type:m="button",variant:v="label-only",state:$,color:b,isLoading:k=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...S},A)=>{const I=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",c&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,b&&`pkt-btn--${b}`,$&&`pkt-btn--${$}`,k&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...S,"aria-busy":k||void 0,"aria-disabled":x||void 0,disabled:x,className:I,type:m,ref:A,children:[k&&l.jsx(q,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),v!=="label-only"&&l.jsx(q,{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(q,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});pe.displayName="PktButton";const Cc=Jt({tagName:"pkt-card",elementClass:ft,react:_,displayName:"PktCard",events:{}}),Ea=_.forwardRef(({children:s,...t},e)=>l.jsx(Cc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ea.displayName="PktCard";const Ma=_.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:n,hasError:a=!1,className:r,isSwitch:h=!1,hideLabel:c=!1,labelPosition:p="right",defaultChecked:m,checked:v,indeterminate:$,optionalTag:b,optionalText:k="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:S,...A},I)=>{const O=_.useRef(null);_.useEffect(()=>{O.current&&$!==void 0&&(O.current.indeterminate=$)},[$]),_.useEffect(()=>{typeof I=="function"?I(O.current):I&&(I.current=O.current)},[I]);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}`,c?"pkt-sr-only":""].filter(Boolean).join(" "),Ot=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Nt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),it=()=>l.jsxs(l.Fragment,{children:[S&&l.jsx("span",{className:Nt+" pkt-tag--gray",children:S}),b&&l.jsx("span",{className:Nt+" pkt-tag--blue-light",children:k}),x&&l.jsx("span",{className:Nt+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:R,children:l.jsxs("div",{className:Ot,children:[p==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:O,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},...A}),p==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Ma.displayName="PktCheckbox";const Tc=Jt({tagName:"pkt-combobox",elementClass:nt,react:_,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Aa=_.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Tc,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));Aa.displayName="PktCombobox";const Mi=Jt({tagName:"pkt-consent",elementClass:Rt,react:_,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Mi.displayName="PktConsent";const Nc=Jt({tagName:"pkt-datepicker",elementClass:ht,react:_,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Oa=_.forwardRef(({helptext:s,...t},e)=>l.jsx(Nc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));Oa.displayName="PktDatepicker";const Ec=({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:c=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:$=null,cookieExpiryDays:b=null,onToggleConsent:k=x=>{console.log(x.detail)}})=>{var T,S;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((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),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}),(S=t.links)==null?void 0:S.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),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(q,{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(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:c,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:$,cookieExpiryDays:b,onToggleConsent:k})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(A=>A.language).map((A,I)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:A.href,"aria-label":`til ${A.language} versjon av nettsiden`,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:A.language})},`sociallinks-language-${I}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(A=>A.iconName).map((A,I)=>l.jsx(_.Fragment,{children:l.jsx("a",{href:A.href,"aria-label":`til ${A.iconName}`,className:"pkt-footer__social-icon-link",target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(q,{className:"pkt-footer__social-icon",name:A.iconName})})},`sociallinks-${I}`))})]})]})})},Mc=({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:c=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:v=b=>{console.log(b.detail)},className:$})=>{const b=[$,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((k,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${k.external?" pkt-link--external":""}`,href:k.href,target:k.openInNewTab||t?"_blank":"_self",rel:k.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),k.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(q,{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(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:c,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},Ai=({href:s,iconName:t,className:e,iconPosition:i,external:n,target:a,children:r,...h})=>{const c={"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(c,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(q,{name:t,className:"pkt-link__icon"}),r]})};Ai.displayName="PktLink";const Ac=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Oi=({item:s,className:t})=>"href"in s?l.jsx(Ai,{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(q,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),Oc=({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(Oi,{item:t})},e))}),Pc=_.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const c=i==null?void 0:i.map(Ac);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})]})]}),c&&c.length>0&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Oc,{links:c})}),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(Oi,{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(Oi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})}),r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Oi,{item:{title:"Logg ut",iconName:"exit",onClick:r}})})]})})}),ti=_.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:c=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:$=null,hasError:b=!1,errorMessage:k,disabled:x=!1,inline:T=!1,ariaDescribedby:S,useWrapper:A=!0,children:I,className:O="",hasFieldset:R=!1,role:et="group",counterPosition:Ot="bottom"},Nt)=>{const[it,kt]=_.useState(!1),zt=S||(e?`${s}-helptext`:void 0),Et=!!a,dt=Et&&Ot==="top",ae=Et&&Ot==="bottom",fe=()=>kt(ut=>!ut),V=["pkt-inputwrapper",O,b?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),xt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Gt=()=>Et?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,$e=()=>l.jsxs(l.Fragment,{children:[$&&l.jsx("span",{className:xt+" pkt-tag--gray",children:$}),c&&l.jsx("span",{className:xt+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:xt+" pkt-tag--beige",children:v})]}),ge=()=>{const ut=l.jsxs(l.Fragment,{children:[t," ",$e()]});return A?R?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ut}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":zt,id:`${s}-label`,children:ut}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":zt,id:`${s}-label`,children:t})},re=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&A&&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:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:fe,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${it?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Bt=l.jsxs(l.Fragment,{children:[ge(),re(),dt&&l.jsx(Gt,{}),I,ae&&l.jsx(Gt,{}),b&&k&&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:k})})]});return l.jsx("div",{className:V,ref:Nt,role:et,children:R?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":zt,children:Bt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Bt})})});ti.displayName="PktInputWrapper";const rn=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:c,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:$,iconNameRight:b,inline:k=!1,fullwidth:x=!1,label:T,name:S,optionalTag:A=!1,optionalText:I,requiredTag:O=!1,requiredText:R,tagText:et=null,placeholder:Ot,prefix:Nt,suffix:it,type:kt="text",useWrapper:zt=!0,omitSearchIcon:Et=!1,value:dt,minLength:ae,maxLength:fe,min:V,max:xt,step:Gt,size:$e,readonly:ge,required:re,dataTestid:Bt,onChange:ut,skipForwardTestid:_e=!1,...we},Zt)=>{const Ss=[r,"pkt-textinput"].join(" "),Ie=kt==="search"&&!b&&!Et,es=kt==="date"&&dt?dt.slice(0,10):dt,[ss,xe]=_.useState((dt==null?void 0:dt.length)||0),Xt=`${s}`,Se=`${Xt}-label`,is=e||Se,Mt=yt=>{var Cs,Le;n&&xe(((Le=(Cs=yt.currentTarget)==null?void 0:Cs.value)==null?void 0:Le.length)||0),ut&&ut(yt)};return _.useEffect(()=>{dt!==void 0&&xe((dt==null?void 0:dt.length)||0)},[dt]),l.jsx(ti,{ariaDescribedby:t,className:Ss,disabled:h,errorMessage:c,forId:Xt,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:$,inline:k,label:T,optionalTag:A,optionalText:I,requiredTag:O,requiredText:R,tagText:et,useWrapper:zt,counter:n,counterCurrent:ss,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Bt,"data-skip-forward-testid":_e?"true":void 0,children:[Nt&&l.jsx("div",{className:"pkt-input-prefix",children:Nt}),l.jsx("input",{...we,ref:Zt,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&ss>a?"pkt-input--counter-error":""}`,type:kt,name:`${S||s}`,value:es,id:Xt,placeholder:Ot,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":is,min:V,max:xt,onChange:Mt,step:Gt,minLength:ae,maxLength:fe,size:$e,required:re}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(q,{className:"pkt-input-suffix-icon",name:b}),Ie&&l.jsx(q,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(q,{className:"pkt-input-icon",name:b}),!it&&Ie&&l.jsx(q,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})}),Dc=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=_.useState(e);return _.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 c of h)c.borderBoxSize&&c.borderBoxSize.length>0?n(c.borderBoxSize[0].inlineSize):n(c.contentRect.width)});return r.observe(a),()=>{r.disconnect()}},[s]),i};function Ic(s){const t=_.useRef(0);_.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 Pa=_.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,compact:i=!1,"data-mode":n,logOutButtonPlacement:a="none",logOut:r,openedMenu:h,showSearch:c=!1,onSearch:p,onSearchChange:m,searchValue:v,searchPlaceholder:$="Søk",representing:b,serviceLink:k,serviceClick:x,serviceName:T,user:S,userMenu:A,userMenuFooter:I,userOptions:O,canChangeRepresentation:R=!1,changeRepresentation:et,hideLogo:Ot=!1,logoLink:Nt,logoClick:it,position:kt="fixed",scrollBehavior:zt="hide"},Et)=>{const dt=kt==="fixed",ae=zt==="hide";_.useEffect(()=>{I&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[I]),_.useEffect(()=>{O&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[O]),_.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 fe=_.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]),[V,xt]=_.useState(h||"none"),[Gt,$e]=_.useState(!1),[ge,re]=_.useState(0),[Bt,ut]=_.useState(!1),[_e,we]=_.useState(!1),Zt=_.useRef(null),Ss=_.useRef(null),Ie=_.useRef(null),es=_.useRef(null),ss=_.useRef(null),xe=_.useRef(null),Xt=_.useRef(null),Se=_.useRef(!1),is=Dc(Zt),Mt=is<s,yt=is<t,Cs=_.useCallback(j=>{Zt.current=j,typeof Et=="function"?Et(j):Et&&(Et.current=j)},[Et]);Ic(dt&&Mt&&V!=="none");const Le=_.useCallback((j,Pt)=>{const f=j.relatedTarget;let u;switch(Pt){case"user":u=Ss;break;case"slot":u=Ie;break;case"search":u=es;break;default:return}const g=u.current;g&&(!f||!g.contains(f))&&xt("none")},[]),si=_.useCallback(()=>{Se.current&&Xt.current&&document.contains(Xt.current)&&Xt.current.focus(),Xt.current=null,Se.current=!1},[]);_.useEffect(()=>{const j=f=>{S&&V==="user"&&!f.target.closest(".pkt-header-service__user-container")&&xt("none"),V==="slot"&&!f.target.closest(".pkt-header-service__slot-container")&&xt("none"),V==="search"&&!f.target.closest(".pkt-header-service__search-container")&&!f.target.closest(".pkt-header-service__search-input")&&xt("none")},Pt=f=>{f.key==="Escape"&&V!=="none"&&(f.preventDefault(),Se.current=!0,xt("none"))};if(V!=="none")return document.addEventListener("mousedown",j),document.addEventListener("keydown",Pt),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",Pt)};si()},[V,S,si]),_.useEffect(()=>{const j=()=>{if(ae){const Pt=window.pageYOffset||document.documentElement.scrollTop;if(Pt<0||Math.abs(Pt-ge)<60)return;$e(Pt>ge),re(Pt)}};return document&&window.addEventListener("scroll",j),()=>{document&&window.removeEventListener("scroll",j)}},[ae,ge]);const Pi=_.useCallback(j=>{const Pt=j==="slot"?Ie:es,f=j==="slot"?ss:xe;if(!Pt.current||!f.current||!yt||Mt)return;const u=Pt.current.getBoundingClientRect(),g=f.current.offsetWidth,w=u.left+g>window.innerWidth;j==="slot"?ut(w):we(w)},[yt,Mt]),Ts=_.useCallback(j=>{V!=="none"?xt("none"):(Xt.current=document.activeElement,xt(j))},[V]);_.useEffect(()=>{(V==="slot"||V==="search")&&requestAnimationFrame(()=>{Pi(V)})},[V,Pi]);const ii=l.jsxs("header",{className:Z("pkt-header-service",i&&"pkt-header-service--compact",Mt&&"pkt-header-service--mobile",yt&&"pkt-header-service--tablet",dt&&"pkt-header-service--fixed",ae&&"pkt-header-service--scroll-to-hide",Gt&&"pkt-header-service--hidden"),"data-mode":n,ref:Cs,children:[l.jsxs("div",{className:Z("pkt-header-service__logo-area",(!T||T==="")&&"pkt-header-service__logo-area--without-service"),children:[!Ot&&l.jsx("span",{className:"pkt-header-service__logo",children:Nt?l.jsx("a",{href:Nt,"aria-label":"Tilbake til forside",children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.0/logos/"})}):it?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:it,children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.0/logos/"})}):l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.0/logos/"})}),T&&l.jsx("span",{className:"pkt-header-service__service-name",children:k?l.jsx(Ai,{href:k,className:"pkt-header-service__service-link ",children:T}):x?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:x,children:T}):l.jsx("span",{className:"pkt-header-service__service-link",children:T})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:Z("pkt-header-service__slot-container",V==="slot"&&"is-open"),onBlur:j=>Le(j,"slot"),ref:Ie,children:[yt&&e&&l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"menu",size:Mt?"small":"medium",state:V==="slot"?"active":"normal",onClick:()=>Ts("slot"),"aria-expanded":V==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:"Meny"}),l.jsx("div",{className:Z("pkt-header-service__slot-content",Bt&&"align-right"),id:"mobile-slot-menu",role:yt?"menu":void 0,"aria-label":yt?"Meny":void 0,ref:ss,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),c&&l.jsx(l.Fragment,{children:yt?l.jsxs("div",{className:Z("pkt-header-service__search-container",V==="search"&&"is-open"),onBlur:j=>Le(j,"search"),ref:es,children:[l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:Mt?"small":"medium",onClick:()=>Ts("search"),state:V==="search"?"active":"normal","aria-expanded":V==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:Z("pkt-header-service__mobile-menu",V==="search"&&"is-open",_e&&"align-right"),ref:xe,children:V==="search"&&l.jsx(rn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:v,autoFocus:!0,fullwidth:!0,onChange:j=>m==null?void 0:m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(p==null||p(j.target.value))}})})]}):l.jsx(rn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:v,onChange:j=>m==null?void 0:m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(p==null||p(j.target.value))}})}),yt&&r&&(a==="header"||a==="both")&&l.jsx(pe,{skin:"secondary",size:Mt?"small":"medium",variant:"icon-only",iconName:"exit",onClick:r,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:j=>Le(j,"user"),ref:Ss,children:[l.jsxs(pe,{className:Z("pkt-header-service__user-button",Mt&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:Mt?"small":"medium",state:V==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:V==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Ts("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),V==="user"&&S&&l.jsx("div",{className:Z(Mt?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(Pc,{user:S,formattedLastLoggedIn:fe,representing:b,userMenu:A,canChangeRepresentation:R,changeRepresentation:et,logoutOnClick:a==="userMenu"||a==="both"?r:void 0})})]}),!Mt&&r&&(a==="header"||a==="both")&&l.jsx(pe,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:r,children:"Logg ut"})]})]});return dt?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[ii,l.jsx("div",{className:Z("pkt-header-service-spacer",i&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",Mt&&"pkt-header-service-spacer--mobile",yt&&"pkt-header-service-spacer--tablet")})]}):ii}),Da=_.forwardRef((s,t)=>l.jsx(Pa,{...s,ref:t}));Da.displayName="PktHeader";const Lc=Jt({tagName:"pkt-heading",elementClass:Ae,react:_,displayName:"PktHeading"}),Ia=_.forwardRef(({children:s,...t},e)=>l.jsx(Lc,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Ia.displayName="PktHeading";const Bc=Jt({tagName:"pkt-helptext",elementClass:ve,react:_,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),La=_.forwardRef(({children:s,...t},e)=>l.jsx(Bc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));La.displayName="PktHelptext";const Ba=_.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]}));Ba.displayName="PktInput";const Fa=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...c})=>{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",{...c,href:i,className:Z(p,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(q,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:Z(m),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};Fa.displayName="PktLinkCard";const Fc=Jt({tagName:"pkt-loader",elementClass:ie,react:_,displayName:"PktLoader",events:{}}),ja=_.forwardRef(({children:s,...t},e)=>l.jsx(Fc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));ja.displayName="PktLoader";const Ha=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[c,p]=_.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":c},v=_.createRef(),$=_.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:$,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(q,{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})]})};Ha.displayName="PktMessagebox";const jc=Jt({tagName:"pkt-modal",elementClass:Vt,react:_,displayName:"PktModal",events:{}}),Va=_.forwardRef(({children:s,...t},e)=>l.jsx(jc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Va.displayName="PktModal";const Hc=Jt({tagName:"pkt-progressbar",elementClass:ct,react:_,displayName:"PktProgressbar",events:{}}),Ua=_.forwardRef(({children:s,...t},e)=>l.jsx(Hc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ua.displayName="PktProgressbar";const za=_.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:c,checked:p,optionalTag:m,optionalText:v,requiredTag:$,requiredText:b,tagText:k,...x},T)=>{const S=[i,"pkt-input-check"].filter(Boolean).join(" "),A=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),I=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),O=["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:[k&&l.jsx("span",{className:R+" pkt-tag--gray",children:k}),m&&l.jsx("span",{className:R+" pkt-tag--blue-light",children:v}),$&&l.jsx("span",{className:R+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:S,children:l.jsxs("div",{className:A,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:I,...p!==void 0?{checked:p}:{defaultChecked:c},...x}),l.jsxs("label",{className:O,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});za.displayName="PktRadioButton";const Vc=_.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:n,name:a,placeholder:r="Søk…",suggestions:h,value:c="",action:p,method:m,onChange:v,onSearch:$,onSuggestionClick:b,...k},x)=>{const T=(O,R)=>{O?O():b&&b(R)},S=O=>{c=O.target.value},A=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let I;return p?I=O=>l.jsx("form",{role:"search",className:A,action:p,method:m,children:O}):I=O=>l.jsx("div",{role:"search",className:A,children:O}),I(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:c,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${i}-suggestions`,onChange:v||S,onKeyUp:$&&(O=>{O.key==="Enter"&&(O.preventDefault(),$(c))}),...k}),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:$&&(O=>{O.preventDefault(),$(c)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((O,R)=>l.jsx("li",{children:_.createElement(O.href?"a":O.onClick?"button":"div",{href:O.href,className:`pkt-searchinput__suggestion ${O.onClick?"pkt-link-button":""} ${O.href||O.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:O.onClick?"button":void 0,onClick:()=>T(O.onClick,R),onKeyUp:et=>et.key==="Enter"&&T(O.onClick,R)},l.jsxs(l.Fragment,{children:[O.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:O.title}),O.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:O.text})]}))},`search-suggestion-${R}`))})]}))}),Uc=_.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:c,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:$=!1,label:b,name:k,optionalTag:x=!1,optionalText:T,requiredTag:S=!1,requiredText:A,tagText:I,...O},R)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(ti,{className:et,forId:`${m}-input`,label:b,helptext:h,helptextDropdown:c,helptextDropdownButton:p,optionalTag:x,optionalText:T,requiredTag:S,requiredText:A,tagText:I,hasError:r,errorMessage:a,disabled:n,inline:v,ariaDescribedby:s,children:l.jsx("select",{ref:R,className:`pkt-input ${$?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${m}-input`,name:k||m,...O,children:e})})}),zc=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)"}})}),qc=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"})]}),Wc=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"})]}),Rc=({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"?qc:e==="completed"?Wc:zc}),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})]})]}),Kc=_.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const c=Z(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=_.Children.map(e,(m,v)=>_.isValidElement(m)?_.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:c,ref:h,...r,children:p})}),Yc=({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}),Gc=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:Z(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Zc=({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}),Xc=({className:s,children:t,...e})=>l.jsx("thead",{className:Z(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),Jc=({className:s,children:t,...e})=>l.jsx("th",{className:Z(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),Qc=({className:s,children:t,...e})=>l.jsx("tr",{className:Z(s,"pkt-table__row",{}),role:"row",...e,children:t}),on=_.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:c,type:p,"aria-description":m,...v},$)=>{const[b,k]=_.useState(!1),x=_.useCallback(()=>{k(!0),c&&c()},[k]),T=_.useRef(null),[S,A]=_.useState("");_.useEffect(()=>{var et,Ot;A(((Ot=(et=T.current)==null?void 0:et.textContent)==null?void 0:Ot.trim())??"")},[s]);const I=_.useMemo(()=>{if(n&&!h)return S&&`Klikk for å fjerne ${S}`||m},[n,h,S,m]),O={"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":b};return n?l.jsxs("button",{...v,className:Z(R,a),type:p,onClick:x,"aria-label":h,"aria-description":I,ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(q,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...v,className:Z(O,a),ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});on.displayName="PktTag";const ln=_.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:c=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:$,selectTab:b}=td(),x={"aria-selected":m?!!t:void 0,"aria-controls":a,role:m?"tab":void 0,onKeyUp:S=>$(c,S),onClick:S=>{b(c),i==null||i(S)},tabIndex:t||!m?void 0:-1,ref:S=>{v(c,S),typeof p=="function"?p(S):p&&(p.current=S)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(q,{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 qa=_.createContext(null),td=()=>{const s=_.useContext(qa);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},ed=_.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=_.useRef([]),h=s&&!t,p=n&&_.Children.count(n)>0?_.Children.count(n):(e==null?void 0:e.length)||0;_.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=k=>{const x=e==null?void 0:e[k];x!=null&&x.action&&x.action(k),i&&i(k)},v=(k,x)=>{var T,S;h&&(x.code==="ArrowLeft"&&k!==0&&((T=r.current[k-1])==null||T.focus()),x.code==="ArrowRight"&&k<p-1&&((S=r.current[k+1])==null||S.focus()),(x.code==="ArrowDown"||x.code==="Space")&&m(k))},$=(k,x)=>{r.current[k]=x},b=e==null?void 0:e.map((k,x)=>{var T,S;return l.jsx(ln,{active:k.active,href:k.href,onClick:()=>m(x),icon:k.icon,controls:k.controls,tag:(T=k.tag)==null?void 0:T.text,tagSkin:(S=k.tag)==null?void 0:S.skin,index:x,children:k.text},x)});return l.jsx(qa.Provider,{value:{arrowNav:h,registerTabRef:$,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||b})})})}),sd=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:c,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:$,fullwidth:b=!1,label:k,name:x,optionalTag:T=!1,optionalText:S,requiredTag:A=!1,requiredText:I,tagText:O=null,placeholder:R,rows:et,useWrapper:Ot=!0,onChange:Nt,value:it,autoComplete:kt="off",minLength:zt,maxLength:Et,readOnly:dt=!1,skipForwardTestid:ae=!1,...fe},V)=>{const xt=[a,"pkt-textinput","pkt-textarea"].join(" "),Gt=`${s}-input`,$e=`${Gt}-label`,ge=e||$e,[re,Bt]=_.useState(0),ut=_e=>{var we,Zt;if(i&&Bt(((Zt=(we=_e.currentTarget)==null?void 0:we.value)==null?void 0:Zt.length)||0),Nt)return Nt(_e)};return _.useEffect(()=>{it!==void 0&&Bt((it==null?void 0:it.length)||0)},[it]),l.jsx(ti,{ariaDescribedby:t,className:xt,disabled:r,errorMessage:h,forId:Gt,hasError:c,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:$,label:k,optionalTag:T,optionalText:S,requiredTag:A,requiredText:I,tagText:O,useWrapper:Ot,counter:i,counterCurrent:re,counterMaxLength:n,children:l.jsx("textarea",{ref:V,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${n&&re>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:Gt,placeholder:R,disabled:r,rows:et,"aria-labelledby":ge,"aria-invalid":c,"aria-errormessage":`${s}-error`,...fe,onChange:ut,value:it,autoComplete:kt,minLength:zt,maxLength:Et,"data-skip-forward-testid":ae?"true":void 0})})});var ws=window.CustomEvent;(!ws||typeof ws=="object")&&(ws=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ws.prototype=window.Event.prototype);function Wa(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function id(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 ei(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 Ra(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function nd(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 Ka(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=Ka(n[a].shadowRoot),i));a++);return i}function Ya(s){return s.isConnected||document.body.contains(s)}function Ga(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=W.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 ad(s){if(!s.defaultPrevented){var t=s.target,e=W.imagemapUseValue,i=Ga(s);e===null&&i&&(e=i.value);var n=ei(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function Za(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",ad,!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))}Za.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Ya(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_),W.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=Ka(this.dialog_)),Ra(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(!Ya(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!W.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");id(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,W.needsCentering(this.dialog_)?(W.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 ws("close",{bubbles:!1,cancelable:!1});Wa(this.dialog_,t)}};var W={};if(W.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"},W.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||!nd(r,s))){var h=a.style.getPropertyValue("top"),c=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||c&&c!=="auto")return!0}}}return!1},W.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:!W.isInlinePositionSetByStylesheet(s)},W.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 Za(s)},W.registerDialog=function(s){s.showModal||W.forceRegisterDialog(s)},W.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)}))},W.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})},W.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},W.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)},W.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=ei(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},W.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(),Ra(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}},W.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new ws("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&Wa(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},W.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},W.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)},W.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())},W.dm=new W.DialogManager,W.formSubmitter=null,W.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Xa=document.createElement("form");if(Xa.setAttribute("method","dialog"),Xa.method!=="dialog"){var xs=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(xs){var rd=xs.get;xs.get=function(){return hn(this)?"dialog":rd.call(this)};var od=xs.set;xs.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):od.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",xs)}}document.addEventListener("click",function(s){if(W.formSubmitter=null,W.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;W.imagemapUseValue=s.offsetX+","+s.offsetY}var n=ei(t);n&&(W.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=ei(t);if(!e){var i=Ga(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var ld=HTMLFormElement.prototype.submit,hd=function(){if(!hn(this))return ld.call(this);var s=ei(this);s&&s.close()};HTMLFormElement.prototype.submit=hd}const cd=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=pn,P.PktAccordionItem=Ca,P.PktAlert=an,P.PktBackLink=Na,P.PktBreadcrumbs=Sc,P.PktButton=pe,P.PktCard=Ea,P.PktCheckbox=Ma,P.PktCombobox=Aa,P.PktConsent=Mi,P.PktDatepicker=Oa,P.PktFooter=Ec,P.PktFooterSimple=Mc,P.PktHeader=Da,P.PktHeaderService=Pa,P.PktHeading=Ia,P.PktHelptext=La,P.PktIcon=q,P.PktInput=Ba,P.PktInputWrapper=ti,P.PktLink=Ai,P.PktLinkCard=Fa,P.PktLoader=ja,P.PktMessagebox=Ha,P.PktModal=Va,P.PktProgressbar=Ua,P.PktRadioButton=za,P.PktSearchInput=Vc,P.PktSelect=Uc,P.PktStep=Rc,P.PktStepper=Kc,P.PktTabItem=ln,P.PktTable=Yc,P.PktTableBody=Gc,P.PktTableDataCell=Zc,P.PktTableHeader=Xc,P.PktTableHeaderCell=Jc,P.PktTableRow=Qc,P.PktTabs=ed,P.PktTag=on,P.PktTextarea=sd,P.PktTextinput=rn,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|