@oslokommune/punkt-react 12.10.2 → 12.10.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 +5 -4
- package/dist/punkt-react.umd.js +59 -58
- package/package.json +3 -3
package/dist/punkt-react.es.js
CHANGED
|
@@ -1518,7 +1518,7 @@ let Ke = class extends Tt {
|
|
|
1518
1518
|
), this.internals.reportValidity());
|
|
1519
1519
|
}
|
|
1520
1520
|
firstUpdated(t) {
|
|
1521
|
-
super.firstUpdated(t), this.required && (this.internals.ariaRequired = !0), this.disabled && (this.internals.
|
|
1521
|
+
super.firstUpdated(t), this.required && (this.internals.ariaRequired = !0), this.disabled && (this.internals.ariaDisabled = !0), this.internals.setFormValue(this.value), this.manageValidity(this.inputRef.value);
|
|
1522
1522
|
}
|
|
1523
1523
|
};
|
|
1524
1524
|
Ye([
|
|
@@ -3300,13 +3300,14 @@ let Pe = class extends Tt {
|
|
|
3300
3300
|
<div class="pkt-alert__text">${hi(this.errorMessage)}</div>
|
|
3301
3301
|
</div>` : ee, m = () => z`
|
|
3302
3302
|
${u()} ${c()}
|
|
3303
|
+
${n ? z`<label for="${this.forId}" class="pkt-sr-only" aria-describedby="${i}"
|
|
3304
|
+
>${this.label}</label
|
|
3305
|
+
>` : ee}
|
|
3303
3306
|
<div class="pkt-contents" ${st(this.defaultSlot)}></div>
|
|
3304
3307
|
${d()} ${h()}
|
|
3305
3308
|
`, v = () => this.hasFieldset ? z`<fieldset class=${Ve(r)} aria-describedby="${i}">
|
|
3306
3309
|
${m()}
|
|
3307
|
-
</fieldset>` : n ? z`<div class=${Ve(r)}
|
|
3308
|
-
${m()}
|
|
3309
|
-
</div>` : z`<label
|
|
3310
|
+
</fieldset>` : n ? z`<div class=${Ve(r)}>${m()}</div>` : z`<label
|
|
3310
3311
|
class=${Ve(r)}
|
|
3311
3312
|
for="${this.forId}"
|
|
3312
3313
|
aria-describedby="${i}"
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -80,7 +80,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
80
80
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
81
|
*/const Ba=globalThis,Na=Ba.trustedTypes,ml=Na?Na.createPolicy("lit-html",{createHTML:e=>e}):void 0,Ji="$lit$",Gt=`lit$${Math.random().toFixed(9).slice(2)}$`,Xi="?"+Gt,vh=`<${Xi}>`,En=document,Lr=()=>En.createComment(""),Or=e=>e===null||typeof e!="object"&&typeof e!="function",Qi=Array.isArray,gl=e=>Qi(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Zi=`[
|
|
82
82
|
\f\r]`,Ir=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vl=/-->/g,yl=/>/g,Fn=RegExp(`>|${Zi}(?:([^\\s"'>=/]+)(${Zi}*=${Zi}*(?:[^
|
|
83
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Dl=/'/g,bl=/"/g,kl=/^(?:script|style|textarea|title)$/i,yh=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),
|
|
83
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Dl=/'/g,bl=/"/g,kl=/^(?:script|style|textarea|title)$/i,yh=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),z=yh(1),Yt=Symbol.for("lit-noChange"),ne=Symbol.for("lit-nothing"),wl=new WeakMap,An=En.createTreeWalker(En,129);function Cl(e,t){if(!Qi(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return ml!==void 0?ml.createHTML(t):t}const _l=(e,t)=>{const n=e.length-1,r=[];let i,o=t===2?"<svg>":t===3?"<math>":"",u=Ir;for(let c=0;c<n;c++){const d=e[c];let h,m,v=-1,y=0;for(;y<d.length&&(u.lastIndex=y,m=u.exec(d),m!==null);)y=u.lastIndex,u===Ir?m[1]==="!--"?u=vl:m[1]!==void 0?u=yl:m[2]!==void 0?(kl.test(m[2])&&(i=RegExp("</"+m[2],"g")),u=Fn):m[3]!==void 0&&(u=Fn):u===Fn?m[0]===">"?(u=i??Ir,v=-1):m[1]===void 0?v=-2:(v=u.lastIndex-m[2].length,h=m[1],u=m[3]===void 0?Fn:m[3]==='"'?bl:Dl):u===bl||u===Dl?u=Fn:u===vl||u===yl?u=Ir:(u=Fn,i=void 0);const b=u===Fn&&e[c+1].startsWith("/>")?" ":"";o+=u===Ir?d+vh:v>=0?(r.push(h),d.slice(0,v)+Ji+d.slice(v)+Gt+b):d+Gt+(v===-2?c:b)}return[Cl(e,o+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};let es=class Yd{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let o=0,u=0;const c=t.length-1,d=this.parts,[h,m]=_l(t,n);if(this.el=Yd.createElement(h,r),An.currentNode=this.el.content,n===2||n===3){const v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(i=An.nextNode())!==null&&d.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(const v of i.getAttributeNames())if(v.endsWith(Ji)){const y=m[u++],b=i.getAttribute(v).split(Gt),k=/([.?@])?(.*)/.exec(y);d.push({type:1,index:o,name:k[2],strings:b,ctor:k[1]==="."?Sl:k[1]==="?"?El:k[1]==="@"?Fl:Mr}),i.removeAttribute(v)}else v.startsWith(Gt)&&(d.push({type:6,index:o}),i.removeAttribute(v));if(kl.test(i.tagName)){const v=i.textContent.split(Gt),y=v.length-1;if(y>0){i.textContent=Na?Na.emptyScript:"";for(let b=0;b<y;b++)i.append(v[b],Lr()),An.nextNode(),d.push({type:2,index:++o});i.append(v[y],Lr())}}}else if(i.nodeType===8)if(i.data===Xi)d.push({type:2,index:o});else{let v=-1;for(;(v=i.data.indexOf(Gt,v+1))!==-1;)d.push({type:7,index:o}),v+=Gt.length-1}o++}}static createElement(t,n){const r=En.createElement("template");return r.innerHTML=t,r}};function $n(e,t,n=e,r){var i,o;if(t===Yt)return t;let u=r!==void 0?(i=n._$Co)==null?void 0:i[r]:n._$Cl;const c=Or(t)?void 0:t._$litDirective$;return(u==null?void 0:u.constructor)!==c&&((o=u==null?void 0:u._$AO)==null||o.call(u,!1),c===void 0?u=void 0:(u=new c(e),u._$AT(e,n,r)),r!==void 0?(n._$Co??(n._$Co=[]))[r]=u:n._$Cl=u),u!==void 0&&(t=$n(e,u._$AS(e,t.values),u,r)),t}let xl=class{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:n},parts:r}=this._$AD,i=((t==null?void 0:t.creationScope)??En).importNode(n,!0);An.currentNode=i;let o=An.nextNode(),u=0,c=0,d=r[0];for(;d!==void 0;){if(u===d.index){let h;d.type===2?h=new ja(o,o.nextSibling,this,t):d.type===1?h=new d.ctor(o,d.name,d.strings,this,t):d.type===6&&(h=new Al(o,this,t)),this._$AV.push(h),d=r[++c]}u!==(d==null?void 0:d.index)&&(o=An.nextNode(),u++)}return An.currentNode=En,i}p(t){let n=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,n),n+=r.strings.length-2):r._$AI(t[n])),n++}},ja=class Kd{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,n,r,i){this.type=2,this._$AH=ne,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=$n(this,t,n),Or(t)?t===ne||t==null||t===""?(this._$AH!==ne&&this._$AR(),this._$AH=ne):t!==this._$AH&&t!==Yt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):gl(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!==ne&&Or(this._$AH)?this._$AA.nextSibling.data=t:this.T(En.createTextNode(t)),this._$AH=t}$(t){var n;const{values:r,_$litType$:i}=t,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=es.createElement(Cl(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(r);else{const u=new xl(o,this),c=u.u(this.options);u.p(r),this.T(c),this._$AH=u}}_$AC(t){let n=wl.get(t.strings);return n===void 0&&wl.set(t.strings,n=new es(t)),n}k(t){Qi(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let r,i=0;for(const o of t)i===n.length?n.push(r=new Kd(this.O(Lr()),this.O(Lr()),this,this.options)):r=n[i],r._$AI(o),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(t=this._$AA.nextSibling,n){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,n);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var n;this._$AM===void 0&&(this._$Cv=t,(n=this._$AP)==null||n.call(this,t))}},Mr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,r,i,o){this.type=1,this._$AH=ne,this._$AN=void 0,this.element=t,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ne}_$AI(t,n=this,r,i){const o=this.strings;let u=!1;if(o===void 0)t=$n(this,t,n,0),u=!Or(t)||t!==this._$AH&&t!==Yt,u&&(this._$AH=t);else{const c=t;let d,h;for(t=o[0],d=0;d<o.length-1;d++)h=$n(this,c[r+d],n,d),h===Yt&&(h=this._$AH[d]),u||(u=!Or(h)||h!==this._$AH[d]),h===ne?t=ne:t!==ne&&(t+=(h??"")+o[d+1]),this._$AH[d]=h}u&&!i&&this.j(t)}j(t){t===ne?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Sl=class extends Mr{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ne?void 0:t}},El=class extends Mr{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ne)}},Fl=class extends Mr{constructor(t,n,r,i,o){super(t,n,r,i,o),this.type=5}_$AI(t,n=this){if((t=$n(this,t,n,0)??ne)===Yt)return;const r=this._$AH,i=t===ne&&r!==ne||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==ne&&(r===ne||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var n;typeof this._$AH=="function"?this._$AH.call(((n=this.options)==null?void 0:n.host)??this.element,t):this._$AH.handleEvent(t)}},Al=class{constructor(t,n,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){$n(this,t)}};const Dh={M:Ji,P:Gt,A:Xi,C:1,L:_l,R:xl,D:gl,V:$n,I:ja,H:Mr,N:El,U:Fl,B:Sl,F:Al},$l=Ba.litHtmlPolyfillSupport;$l==null||$l(es,ja),(Ba.litHtmlVersions??(Ba.litHtmlVersions=[])).push("3.2.1");const bh=(e,t,n)=>{const r=(n==null?void 0:n.renderBefore)??t;let i=r._$litPart$;if(i===void 0){const o=(n==null?void 0:n.renderBefore)??null;r._$litPart$=i=new ja(t.insertBefore(Lr(),o),o,void 0,n??{})}return i._$AI(e),i};/**
|
|
84
84
|
* @license
|
|
85
85
|
* Copyright 2017 Google LLC
|
|
86
86
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -92,7 +92,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
92
92
|
* @license
|
|
93
93
|
* Copyright 2017 Google LLC
|
|
94
94
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
95
|
-
*/function It(e){return O({...e,state:!0,attribute:!1})}for(var Je=[],ts=0;ts<256;++ts)Je.push((ts+256).toString(16).slice(1));function Ch(e,t=0){return(Je[e[t+0]]+Je[e[t+1]]+Je[e[t+2]]+Je[e[t+3]]+"-"+Je[e[t+4]]+Je[e[t+5]]+"-"+Je[e[t+6]]+Je[e[t+7]]+"-"+Je[e[t+8]]+Je[e[t+9]]+"-"+Je[e[t+10]]+Je[e[t+11]]+Je[e[t+12]]+Je[e[t+13]]+Je[e[t+14]]+Je[e[t+15]]).toLowerCase()}var Pa,_h=new Uint8Array(16);function xh(){if(!Pa&&(Pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pa(_h)}var Sh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Nl={randomUUID:Sh};function ns(e,t,n){if(Nl.randomUUID&&!t&&!e)return Nl.randomUUID();e=e||{};var r=e.random||(e.rng||xh)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ch(r)}const Eh={hi:"Hei!"},Fh={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Ah={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"},$h={labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},Bt={example:Eh,calendar:Fh,dates:Ah,forms:$h};var Th=Object.defineProperty,Ge=(e,t,n,r)=>{for(var i=void 0,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=u(t,n,i)||i);return i&&Th(t,n,i),i};let St=class extends Rr{constructor(){super(),this.strings=Bt}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}};Ge([O({type:Object})],St.prototype,"strings");let Ye=class extends St{constructor(){super(),this.id=ns(),this.name=this.id,this.required=!1,this.disabled=!1,this.placeholder="",this.min=null,this.max=null,this.minlength=0,this.maxlength=0,this.pattern="",this.optionalTag=!1,this.optionalText=Bt.forms.labels.optional,this.requiredTag=!1,this.requiredText=Bt.forms.labels.required,this.hasError=!1,this.errorMessage="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},Bt.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},Bt.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},Bt.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},Bt.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},Bt.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},Bt.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},Bt.forms.messages.rangeOverflow,t):t.validity.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(t){if(this.internals)if(Array.isArray(t)){const n=new FormData;t.forEach(r=>{n.append(this.name,r)}),this.internals.setFormValue(n)}else this.internals.setFormValue(t)}valueChanged(t,n){typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate())}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}firstUpdated(t){super.firstUpdated(t),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.
|
|
95
|
+
*/function It(e){return O({...e,state:!0,attribute:!1})}for(var Je=[],ts=0;ts<256;++ts)Je.push((ts+256).toString(16).slice(1));function Ch(e,t=0){return(Je[e[t+0]]+Je[e[t+1]]+Je[e[t+2]]+Je[e[t+3]]+"-"+Je[e[t+4]]+Je[e[t+5]]+"-"+Je[e[t+6]]+Je[e[t+7]]+"-"+Je[e[t+8]]+Je[e[t+9]]+"-"+Je[e[t+10]]+Je[e[t+11]]+Je[e[t+12]]+Je[e[t+13]]+Je[e[t+14]]+Je[e[t+15]]).toLowerCase()}var Pa,_h=new Uint8Array(16);function xh(){if(!Pa&&(Pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pa(_h)}var Sh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Nl={randomUUID:Sh};function ns(e,t,n){if(Nl.randomUUID&&!t&&!e)return Nl.randomUUID();e=e||{};var r=e.random||(e.rng||xh)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ch(r)}const Eh={hi:"Hei!"},Fh={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Ah={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"},$h={labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},Bt={example:Eh,calendar:Fh,dates:Ah,forms:$h};var Th=Object.defineProperty,Ge=(e,t,n,r)=>{for(var i=void 0,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=u(t,n,i)||i);return i&&Th(t,n,i),i};let St=class extends Rr{constructor(){super(),this.strings=Bt}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}};Ge([O({type:Object})],St.prototype,"strings");let Ye=class extends St{constructor(){super(),this.id=ns(),this.name=this.id,this.required=!1,this.disabled=!1,this.placeholder="",this.min=null,this.max=null,this.minlength=0,this.maxlength=0,this.pattern="",this.optionalTag=!1,this.optionalText=Bt.forms.labels.optional,this.requiredTag=!1,this.requiredText=Bt.forms.labels.required,this.hasError=!1,this.errorMessage="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},Bt.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},Bt.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},Bt.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},Bt.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},Bt.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},Bt.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},Bt.forms.messages.rangeOverflow,t):t.validity.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(t){if(this.internals)if(Array.isArray(t)){const n=new FormData;t.forEach(r=>{n.append(this.name,r)}),this.internals.setFormValue(n)}else this.internals.setFormValue(t)}valueChanged(t,n){typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate())}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}firstUpdated(t){super.firstUpdated(t),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.manageValidity(this.inputRef.value)}};Ge([O({type:String,reflect:!0})],Ye.prototype,"id"),Ge([O({type:String,reflect:!0})],Ye.prototype,"name"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"required"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"disabled"),Ge([O({type:String,reflect:!0})],Ye.prototype,"placeholder"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"min"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"max"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"minlength"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"maxlength"),Ge([O({type:String,reflect:!0})],Ye.prototype,"pattern"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"optionalTag"),Ge([O({type:String,reflect:!0})],Ye.prototype,"optionalText"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"requiredTag"),Ge([O({type:String,reflect:!0})],Ye.prototype,"requiredText"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"hasError"),Ge([O({type:String,reflect:!0})],Ye.prototype,"errorMessage"),Ge([It()],Ye.prototype,"touched");/**
|
|
96
96
|
* @license
|
|
97
97
|
* Copyright 2017 Google LLC
|
|
98
98
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -124,14 +124,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
124
124
|
* @license
|
|
125
125
|
* Copyright 2017 Google LLC
|
|
126
126
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
127
|
-
*/class is extends Ma{}is.directiveName="unsafeSVG",is.resultType=2;const Ll=qr(is);var Hh=Object.defineProperty,Uh=Object.getOwnPropertyDescriptor,Wr=(e,t,n,r)=>{for(var i=r>1?void 0:r?Uh(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Hh(t,n,i),i};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.10/icons/";const Wh=e=>new Promise(t=>setTimeout(t,e)),qa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',ss={},Vh=async(e,t)=>{let n=0;for(;ss[t+e+".svg"]==="fetching"&&(n++,!(n>50));)await Wh(50);return localStorage.getItem(t+e+".svg")?Promise.resolve(localStorage.getItem(t+e+".svg")):typeof window.pktFetch=="function"?(ss[t+e+".svg"]="fetching",Promise.resolve(window.pktFetch(t+e+".svg").then(r=>r.ok?r.text():(console.error("Missing icon: "+t+e+".svg"),qa)).then(r=>(r!==qa&&localStorage.setItem(t+e+".svg",r),ss[t+e+".svg"]="fetched",r)))):Promise.resolve(qa)};let Nn=class extends St{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=Ll(qa),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,n,r){super.attributeChangedCallback(t,n,r),(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,window.pktIconPath),this.icon=Ll(await Vh(this.name||"",this.path).then(n=>n)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return
|
|
127
|
+
*/class is extends Ma{}is.directiveName="unsafeSVG",is.resultType=2;const Ll=qr(is);var Hh=Object.defineProperty,Uh=Object.getOwnPropertyDescriptor,Wr=(e,t,n,r)=>{for(var i=r>1?void 0:r?Uh(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Hh(t,n,i),i};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.10/icons/";const Wh=e=>new Promise(t=>setTimeout(t,e)),qa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',ss={},Vh=async(e,t)=>{let n=0;for(;ss[t+e+".svg"]==="fetching"&&(n++,!(n>50));)await Wh(50);return localStorage.getItem(t+e+".svg")?Promise.resolve(localStorage.getItem(t+e+".svg")):typeof window.pktFetch=="function"?(ss[t+e+".svg"]="fetching",Promise.resolve(window.pktFetch(t+e+".svg").then(r=>r.ok?r.text():(console.error("Missing icon: "+t+e+".svg"),qa)).then(r=>(r!==qa&&localStorage.setItem(t+e+".svg",r),ss[t+e+".svg"]="fetched",r)))):Promise.resolve(qa)};let Nn=class extends St{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=Ll(qa),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,n,r){super.attributeChangedCallback(t,n,r),(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,window.pktIconPath),this.icon=Ll(await Vh(this.name||"",this.path).then(n=>n)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return z`${this.name&&this.icon}`}};Wr([O({type:String,reflect:!1})],Nn.prototype,"path",2),Wr([O({type:String,reflect:!0})],Nn.prototype,"name",2),Wr([O({type:SVGElement})],Nn.prototype,"icon",2),Wr([O({type:Array,noAccessor:!0})],Nn.prototype,"_updatedProps",2),Nn=Wr([Nt("pkt-icon")],Nn);const zh="pkt-alert",Gh=!0,Yh={onClose:{description:"React: Klikk-event for 'Lukk'-knappen"},close:{description:"Vue: Klikk-event for 'Lukk'-knappen"}},Kh={title:{name:"Tittel",description:"Tittelen som vises øverst i på meldingen",type:"string"},skin:{name:"Utseende",description:"Hvordan type melding er dette?",type:["info","success","warning","error"],default:"info"},date:{name:"Sist oppdatert",description:"Dato som vises nederst i på meldingen",type:"string"},ariaLive:{name:"aria-live",description:"Hvordan skal skjermleseren lese opp meldingen?",type:["off","polite","assertive"],default:"polite"},compact:{name:"Kompakt",description:"Gjør meldingen mindre",type:"boolean",default:!1},closeAlert:{name:"Vis 'Lukk'-knapp",description:"Viser 'Lukk'-knappen",type:"boolean",default:!1}},Jh={default:{description:"Innholdet i meldingen"}},Ha={name:zh,"css-class":"pkt-alert","dark-mode":!0,isElement:Gh,events:Yh,props:Kh,slots:Jh};var Xh=Object.defineProperty,Qh=Object.getOwnPropertyDescriptor,pn=(e,t,n,r)=>{for(var i=r>1?void 0:r?Qh(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Xh(t,n,i),i};let Mt=class extends St{constructor(){super(),this.defaultSlot=vt(),this.compact=Ha.props.compact.default,this.title="",this.skin=Ha.props.skin.default,this.ariaLive=Ha.props.ariaLive.default,this.closeAlert=Ha.props.closeAlert.default,this.date=null,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 Tn(this,this.defaultSlot),this._isClosed=!1}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed};return z`
|
|
128
128
|
<div class=${He(t)} aria-live=${this.ariaLive}>
|
|
129
129
|
<pkt-icon
|
|
130
130
|
class="pkt-alert__icon"
|
|
131
131
|
name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
|
|
132
132
|
></pkt-icon>
|
|
133
133
|
|
|
134
|
-
${this.closeAlert?
|
|
134
|
+
${this.closeAlert?z`
|
|
135
135
|
<div class="pkt-alert__close">
|
|
136
136
|
<button
|
|
137
137
|
type="button"
|
|
@@ -144,13 +144,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
144
144
|
</button>
|
|
145
145
|
</div>
|
|
146
146
|
`:ne}
|
|
147
|
-
${this.title?
|
|
147
|
+
${this.title?z`<div class="pkt-alert__title">${this.title}</div>`:ne}
|
|
148
148
|
|
|
149
149
|
<div class="pkt-alert__text" ${rt(this.defaultSlot)}></div>
|
|
150
150
|
|
|
151
|
-
${this.date?
|
|
151
|
+
${this.date?z`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:ne}
|
|
152
152
|
</div>
|
|
153
|
-
`}};pn([O({type:Boolean,reflect:!1})],Mt.prototype,"compact",2),pn([O({type:String,reflect:!0})],Mt.prototype,"title",2),pn([O({type:String,reflect:!0})],Mt.prototype,"skin",2),pn([O({type:String,reflect:!0})],Mt.prototype,"ariaLive",2),pn([O({type:Boolean,reflect:!0})],Mt.prototype,"closeAlert",2),pn([O({type:String,reflect:!0})],Mt.prototype,"date",2),pn([It()],Mt.prototype,"_isClosed",2),Mt=pn([Nt("pkt-alert")],Mt);const Ol=e=>{if(Array.isArray(e))return e;if(typeof e=="string")return e.split(",")},Zh=e=>e?new Date(e):null,ef=e=>{if(typeof e=="string")return e.split(",").map(t=>new Date(t));if(Array.isArray(e))return e.map(t=>new Date(t))},ar={csvToArray:Ol,stringToDate:Zh,stringsToDate:ef};function ot(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function jn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Il=6048e5,tf=864e5;let nf={};function Ua(){return nf}function Vr(e,t){var n,r,i,o;const u=Ua(),c=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??u.weekStartsOn??((o=(i=u.locale)==null?void 0:i.options)==null?void 0:o.weekStartsOn)??0,d=ot(e),h=d.getDay(),m=(h<c?7:0)+h-c;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function os(e,t){const n=ot(e.start),r=ot(e.end);let i=+n>+r;const o=i?+n:+r,u=i?r:n;u.setHours(0,0,0,0);let c=1;const d=[];for(;+u<=o;)d.push(ot(u)),u.setDate(u.getDate()+c),u.setHours(0,0,0,0);return i?d.reverse():d}function Ml(e,t){var n,r,i,o;const u=ot(e),c=u.getFullYear(),d=Ua(),h=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(i=d.locale)==null?void 0:i.options)==null?void 0:o.firstWeekContainsDate)??1,m=jn(e,0);m.setFullYear(c+1,0,h),m.setHours(0,0,0,0);const v=Vr(m,t),y=jn(e,0);y.setFullYear(c,0,h),y.setHours(0,0,0,0);const b=Vr(y,t);return u.getTime()>=v.getTime()?c+1:u.getTime()>=b.getTime()?c:c-1}function rf(e,t){var n,r,i,o;const u=Ua(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??u.firstWeekContainsDate??((o=(i=u.locale)==null?void 0:i.options)==null?void 0:o.firstWeekContainsDate)??1,d=Ml(e,t),h=jn(e,0);return h.setFullYear(d,0,c),h.setHours(0,0,0,0),Vr(h,t)}function Rl(e,t){const n=ot(e),r=+Vr(n,t)-+rf(n,t);return Math.round(r/Il)+1}function af(e){let t=ot(e).getDay();return t===0&&(t=7),t}const sf="pkt-calendar",of={id:{type:"string",name:"ID",description:"Unique identifier for the calendar"},currentmonth:{type:"date",converter:"stringToDate",description:"The current month to display"},selected:{type:"array",converter:"csvToArray",reflect:!0,items:{type:"date"},description:"Array of selected dates"},excludeweekdays:{type:"array",converter:"csvToArray",items:{type:"string"},description:"Array of weekdays (1-7) to exclude"},excludedates:{type:"array",converter:"stringsToDate",items:{type:"date"},description:"Array of specific dates to exclude"},earliest:{type:"date",converter:"stringToDate",default:null,description:"Earliest selectable date"},latest:{type:"date",converter:"stringToDate",default:null,description:"Latest selectable date"},weeknumbers:{type:"boolean",reflect:!0,default:!1,description:"Show week numbers in calendar"},withcontrols:{type:"boolean",reflect:!0,default:!1,description:"Show month and year navigation controls"},multiple:{type:"boolean",reflect:!0,default:!1,description:"Allow multiple date selection"},maxMultiple:{type:"number",default:4,description:"Maximum number of dates that can be selected"},range:{type:"boolean",reflect:!0,default:!1,description:"Allow date range selection"}},lf={"date-selected":{description:"Returns ISO formatted date string"}},Pn={name:sf,"css-class":"pkt-calendar",props:of,events:lf};var uf=Object.defineProperty,cf=Object.getOwnPropertyDescriptor,Se=(e,t,n,r)=>{for(var i=r>1?void 0:r?cf(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&uf(t,n,i),i};let xe=class extends St{constructor(){super(...arguments),this.multiple=Pn.props.multiple.default,this.maxMultiple=Pn.props.maxMultiple.default,this.range=Pn.props.range.default,this.weeknumbers=Pn.props.weeknumbers.default,this.withcontrols=Pn.props.withcontrols.default,this.selected=[],this.earliest=Pn.props.earliest.default,this.latest=Pn.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,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,n,r){t==="selected"&&r&&this.convertSelected(),super.attributeChangedCallback(t,n,r)}updated(t){t.has("selected")&&this.convertSelected(),super.updated(t)}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>new Date(t)),this.range&&this.selected.length===2){const t=os({start:new Date(this.selected[0]),end:new Date(this.selected[1])});if(this.inRange={},Array.isArray(t)&&t.length){const n={};for(let r=0;r<t.length;r++)n[this.formatISODate(t[r])]=this.isInRange(t[r]);this.inRange=n}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=new Date(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=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,n){var r,i,o;if(((r=t.target)==null?void 0:r.nodeName)==="INPUT"||((i=t.target)==null?void 0:i.nodeName)==="SELECT"||((o=t.target)==null?void 0:o.nodeName)==="BUTTON")return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const u=this.focusedDate?new Date(this.focusedDate):new Date(this.year,this.month,1);let c=new Date(u.setDate(u.getDate()+n));if(c){let d=this.querySelector(`div[data-date="${this.formatISODate(c)}"]`);if(d instanceof HTMLDivElement){if(d.dataset.disabled){let h=new Date(u.setDate(u.getDate()+n)),m=this.querySelector(`div[data-date="${this.formatISODate(h)}"]`);for(;m&&m instanceof HTMLDivElement&&m.dataset.disabled;)h=new Date(h.setDate(h.getDate()+n)),m=this.querySelector(`div[data-date="${this.formatISODate(h)}"]`);d=m}d instanceof HTMLDivElement&&!d.dataset.disabled&&(this.focusedDate=this.formatISODate(c),d.focus())}}}render(){return
|
|
153
|
+
`}};pn([O({type:Boolean,reflect:!1})],Mt.prototype,"compact",2),pn([O({type:String,reflect:!0})],Mt.prototype,"title",2),pn([O({type:String,reflect:!0})],Mt.prototype,"skin",2),pn([O({type:String,reflect:!0})],Mt.prototype,"ariaLive",2),pn([O({type:Boolean,reflect:!0})],Mt.prototype,"closeAlert",2),pn([O({type:String,reflect:!0})],Mt.prototype,"date",2),pn([It()],Mt.prototype,"_isClosed",2),Mt=pn([Nt("pkt-alert")],Mt);const Ol=e=>{if(Array.isArray(e))return e;if(typeof e=="string")return e.split(",")},Zh=e=>e?new Date(e):null,ef=e=>{if(typeof e=="string")return e.split(",").map(t=>new Date(t));if(Array.isArray(e))return e.map(t=>new Date(t))},ar={csvToArray:Ol,stringToDate:Zh,stringsToDate:ef};function ot(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function jn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Il=6048e5,tf=864e5;let nf={};function Ua(){return nf}function Vr(e,t){var n,r,i,o;const u=Ua(),c=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??u.weekStartsOn??((o=(i=u.locale)==null?void 0:i.options)==null?void 0:o.weekStartsOn)??0,d=ot(e),h=d.getDay(),m=(h<c?7:0)+h-c;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function os(e,t){const n=ot(e.start),r=ot(e.end);let i=+n>+r;const o=i?+n:+r,u=i?r:n;u.setHours(0,0,0,0);let c=1;const d=[];for(;+u<=o;)d.push(ot(u)),u.setDate(u.getDate()+c),u.setHours(0,0,0,0);return i?d.reverse():d}function Ml(e,t){var n,r,i,o;const u=ot(e),c=u.getFullYear(),d=Ua(),h=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(i=d.locale)==null?void 0:i.options)==null?void 0:o.firstWeekContainsDate)??1,m=jn(e,0);m.setFullYear(c+1,0,h),m.setHours(0,0,0,0);const v=Vr(m,t),y=jn(e,0);y.setFullYear(c,0,h),y.setHours(0,0,0,0);const b=Vr(y,t);return u.getTime()>=v.getTime()?c+1:u.getTime()>=b.getTime()?c:c-1}function rf(e,t){var n,r,i,o;const u=Ua(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??u.firstWeekContainsDate??((o=(i=u.locale)==null?void 0:i.options)==null?void 0:o.firstWeekContainsDate)??1,d=Ml(e,t),h=jn(e,0);return h.setFullYear(d,0,c),h.setHours(0,0,0,0),Vr(h,t)}function Rl(e,t){const n=ot(e),r=+Vr(n,t)-+rf(n,t);return Math.round(r/Il)+1}function af(e){let t=ot(e).getDay();return t===0&&(t=7),t}const sf="pkt-calendar",of={id:{type:"string",name:"ID",description:"Unique identifier for the calendar"},currentmonth:{type:"date",converter:"stringToDate",description:"The current month to display"},selected:{type:"array",converter:"csvToArray",reflect:!0,items:{type:"date"},description:"Array of selected dates"},excludeweekdays:{type:"array",converter:"csvToArray",items:{type:"string"},description:"Array of weekdays (1-7) to exclude"},excludedates:{type:"array",converter:"stringsToDate",items:{type:"date"},description:"Array of specific dates to exclude"},earliest:{type:"date",converter:"stringToDate",default:null,description:"Earliest selectable date"},latest:{type:"date",converter:"stringToDate",default:null,description:"Latest selectable date"},weeknumbers:{type:"boolean",reflect:!0,default:!1,description:"Show week numbers in calendar"},withcontrols:{type:"boolean",reflect:!0,default:!1,description:"Show month and year navigation controls"},multiple:{type:"boolean",reflect:!0,default:!1,description:"Allow multiple date selection"},maxMultiple:{type:"number",default:4,description:"Maximum number of dates that can be selected"},range:{type:"boolean",reflect:!0,default:!1,description:"Allow date range selection"}},lf={"date-selected":{description:"Returns ISO formatted date string"}},Pn={name:sf,"css-class":"pkt-calendar",props:of,events:lf};var uf=Object.defineProperty,cf=Object.getOwnPropertyDescriptor,Se=(e,t,n,r)=>{for(var i=r>1?void 0:r?cf(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&uf(t,n,i),i};let xe=class extends St{constructor(){super(...arguments),this.multiple=Pn.props.multiple.default,this.maxMultiple=Pn.props.maxMultiple.default,this.range=Pn.props.range.default,this.weeknumbers=Pn.props.weeknumbers.default,this.withcontrols=Pn.props.withcontrols.default,this.selected=[],this.earliest=Pn.props.earliest.default,this.latest=Pn.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,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,n,r){t==="selected"&&r&&this.convertSelected(),super.attributeChangedCallback(t,n,r)}updated(t){t.has("selected")&&this.convertSelected(),super.updated(t)}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>new Date(t)),this.range&&this.selected.length===2){const t=os({start:new Date(this.selected[0]),end:new Date(this.selected[1])});if(this.inRange={},Array.isArray(t)&&t.length){const n={};for(let r=0;r<t.length;r++)n[this.formatISODate(t[r])]=this.isInRange(t[r]);this.inRange=n}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=new Date(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=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,n){var r,i,o;if(((r=t.target)==null?void 0:r.nodeName)==="INPUT"||((i=t.target)==null?void 0:i.nodeName)==="SELECT"||((o=t.target)==null?void 0:o.nodeName)==="BUTTON")return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const u=this.focusedDate?new Date(this.focusedDate):new Date(this.year,this.month,1);let c=new Date(u.setDate(u.getDate()+n));if(c){let d=this.querySelector(`div[data-date="${this.formatISODate(c)}"]`);if(d instanceof HTMLDivElement){if(d.dataset.disabled){let h=new Date(u.setDate(u.getDate()+n)),m=this.querySelector(`div[data-date="${this.formatISODate(h)}"]`);for(;m&&m instanceof HTMLDivElement&&m.dataset.disabled;)h=new Date(h.setDate(h.getDate()+n)),m=this.querySelector(`div[data-date="${this.formatISODate(h)}"]`);d=m}d instanceof HTMLDivElement&&!d.dataset.disabled&&(this.focusedDate=this.formatISODate(c),d.focus())}}}render(){return z`
|
|
154
154
|
<div
|
|
155
155
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":ne}"
|
|
156
156
|
@focusout=${this.closeEvent}
|
|
@@ -200,16 +200,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
200
200
|
</tbody>
|
|
201
201
|
</table>
|
|
202
202
|
</div>
|
|
203
|
-
`}renderDayNames(){const t=[];this.weeknumbers&&t.push(
|
|
203
|
+
`}renderDayNames(){const t=[];this.weeknumbers&&t.push(z`<th><div>${this.weekString}</div></th>`);for(let n=0;n<this.dayStrings.length;n++)t.push(z`<th><div>${this.dayStrings[n]}</div></th>`);return z`<tr class="pkt-cal-week-row">
|
|
204
204
|
${t}
|
|
205
|
-
</tr>`}renderMonthNav(){let t=[];return this.withcontrols?t.push(
|
|
205
|
+
</tr>`}renderMonthNav(){let t=[];return this.withcontrols?t.push(z`<div class="pkt-cal-month-picker">
|
|
206
206
|
<label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
|
|
207
207
|
<select
|
|
208
208
|
class="pkt-input pkt-input-compact"
|
|
209
209
|
id="${this.id}-monthnav"
|
|
210
210
|
@change=${n=>{this.changeMonth(this.year,n.target.value)}}
|
|
211
211
|
>
|
|
212
|
-
${this.monthStrings.map((n,r)=>
|
|
212
|
+
${this.monthStrings.map((n,r)=>z`<option value=${r} ?selected=${this.month===r}>${n}</option>`)}
|
|
213
213
|
</select>
|
|
214
214
|
<label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
|
|
215
215
|
<input
|
|
@@ -221,9 +221,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
221
221
|
@change=${n=>{this.changeMonth(n.target.value,this.month)}}
|
|
222
222
|
.value=${this.year}
|
|
223
223
|
/>
|
|
224
|
-
</div> `):t.push(
|
|
224
|
+
</div> `):t.push(z`<div class="pkt-txt-16-medium" aria-live="polite">
|
|
225
225
|
${this.monthStrings[this.month]} ${this.year}
|
|
226
|
-
</div>`),t}renderDayView(t,n,r){var i;const o=new Date(this.year,this.month,t,12),u=this.formatISODate(o),c=u===this.formatISODate(n),d=this.selected.includes(u),h=this.isExcluded(r,o)||!d&&this.multiple&&this.maxMultiple>0&&this.selected.length>=this.maxMultiple,m=this.focusedDate?this.focusedDate===u&&!h?"0":"-1":!h&&this.tabIndexSet===0||this.tabIndexSet===t?"0":"-1";m==="0"&&(this.tabIndexSet=t),this.selectableDates.push({currentDateISO:u,isDisabled:h,tabindex:m});const v={"pkt-cal-today":c,"pkt-cal-selected":d,"pkt-cal-in-range":this.inRange[u],"pkt-cal-excluded":this.isExcluded(r,o),"pkt-cal-in-range-first":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&u===this.selected[0],"pkt-cal-in-range-last":this.range&&this.selected.length===2&&u===this.selected[1],"pkt-cal-range-hover":this.rangeHovered!==null&&u===this.formatISODate(this.rangeHovered)};return
|
|
226
|
+
</div>`),t}renderDayView(t,n,r){var i;const o=new Date(this.year,this.month,t,12),u=this.formatISODate(o),c=u===this.formatISODate(n),d=this.selected.includes(u),h=this.isExcluded(r,o)||!d&&this.multiple&&this.maxMultiple>0&&this.selected.length>=this.maxMultiple,m=this.focusedDate?this.focusedDate===u&&!h?"0":"-1":!h&&this.tabIndexSet===0||this.tabIndexSet===t?"0":"-1";m==="0"&&(this.tabIndexSet=t),this.selectableDates.push({currentDateISO:u,isDisabled:h,tabindex:m});const v={"pkt-cal-today":c,"pkt-cal-selected":d,"pkt-cal-in-range":this.inRange[u],"pkt-cal-excluded":this.isExcluded(r,o),"pkt-cal-in-range-first":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&u===this.selected[0],"pkt-cal-in-range-last":this.range&&this.selected.length===2&&u===this.selected[1],"pkt-cal-range-hover":this.rangeHovered!==null&&u===this.formatISODate(this.rangeHovered)};return z`<td class=${He(v)}>
|
|
227
227
|
<div
|
|
228
228
|
?aria-selected=${d}
|
|
229
229
|
role="gridcell"
|
|
@@ -238,61 +238,61 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
>
|
|
239
239
|
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
240
240
|
</div>
|
|
241
|
-
</td>`}renderCalendarBody(){const t=new Date,n=new Date(this.year,this.month,1,12),r=new Date(this.year,this.month+1,0,12),i=(n.getDay()+6)%7,o=r.getDate(),u=Math.ceil((o+i)/7),c=new Date(this.year,this.month,0,12).getDate();let d=1;this.week=Rl(new Date(this.year,this.month,1,12));const h=[];for(let m=0;m<u;m++){const v=[];this.weeknumbers&&v.push(
|
|
241
|
+
</td>`}renderCalendarBody(){const t=new Date,n=new Date(this.year,this.month,1,12),r=new Date(this.year,this.month+1,0,12),i=(n.getDay()+6)%7,o=r.getDate(),u=Math.ceil((o+i)/7),c=new Date(this.year,this.month,0,12).getDate();let d=1;this.week=Rl(new Date(this.year,this.month,1,12));const h=[];for(let m=0;m<u;m++){const v=[];this.weeknumbers&&v.push(z`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let y=1;y<8;y++)if(m===0&&y<i+1){const b=c-(i-y);v.push(z`<td class="pkt-cal-other">
|
|
242
242
|
<div
|
|
243
243
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
244
244
|
data-disabled="disabled"
|
|
245
245
|
>
|
|
246
246
|
<span class="pkt-btn__text pkt-txt-14-light">${b}</span>
|
|
247
247
|
</div>
|
|
248
|
-
</td>`)}else d>o?(v.push(
|
|
248
|
+
</td>`)}else d>o?(v.push(z`<td class="pkt-cal-other">
|
|
249
249
|
<div
|
|
250
250
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
251
251
|
data-disabled="disabled"
|
|
252
252
|
>
|
|
253
253
|
<span class="pkt-btn__text pkt-txt-14-light">${d-o}</span>
|
|
254
254
|
</div>
|
|
255
|
-
</td>`),d++):(v.push(this.renderDayView(d,t,y)),d++);h.push(
|
|
255
|
+
</td>`),d++):(v.push(this.renderDayView(d,t,y)),d++);h.push(z`<tr class="pkt-cal-week-row" role="row">
|
|
256
256
|
${v}
|
|
257
|
-
</tr>`)}return h}isExcluded(t,n){return this.excludeweekdays.includes(t.toString())||this.earliest&&n<new Date(this.earliest)||this.latest&&n>new Date(this.latest)?!0:this.excludedates.some(r=>typeof r=="string"?r===this.formatISODate(n):r.toDateString()===n.toDateString())}formatISODate(t){return t.toISOString().split("T")[0]}isPrevMonthAllowed(){const t=new Date(this.year,this.month,0,12);return!(this.earliest&&new Date(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,n=this.month===0?this.year-1:this.year;this.changeMonth(n,t)}isNextMonthAllowed(){const t=new Date(this.year,this.month===11?0:this.month+1,1,12);return!(this.latest&&new Date(this.latest)<t)}nextMonth(){const t=this.month===11?0:this.month+1,n=this.month===11?this.year+1:this.year;this.changeMonth(n,t)}changeMonth(t,n){this.year=t,this.month=n,this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[],this.requestUpdate()}isInRange(t){if(this.range&&this.selected.length===2){if(t>new Date(this.selected[0])&&t<new Date(this.selected[1]))return!0}else if(this.range&&this.selected.length===1&&this.rangeHovered&&t>new Date(this.selected[0])&&t<this.rangeHovered)return!0;return!1}isRangeAllowed(t){let n=!0;if(this._selected.length===1){const r=os({start:this._selected[0],end:t});if(Array.isArray(r)&&r.length)for(let i=0;i<r.length;i++)this.excludedates.forEach(o=>{o>this._selected[0]&&o<t&&(n=!1)}),this.excludeweekdays.includes(af(r[i]).toString())&&(n=!1)}return n}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(t){this.selected.includes(this.formatISODate(t))||(this.selected=[...this.selected,this.formatISODate(t)],this._selected=[...this._selected,t],this.range&&this.selected.length===2&&this.close())}removeFromSelected(t){if(this.selected.length===1)this.emptySelected();else{const n=this.selected.indexOf(this.formatISODate(t)),r=[...this.selected],i=[...this._selected];r.splice(n,1),i.splice(n,1),this.selected=r,this._selected=i}}toggleSelected(t){const n=this.formatISODate(t);this.selected.includes(n)?this.removeFromSelected(t):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(t)}handleRangeSelect(t){const n=this.formatISODate(t);return this.selected.includes(n)?this.selected.indexOf(n)===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 n=os({start:this._selected[0],end:t});if(Array.isArray(n)&&n.length)for(let r=0;r<n.length;r++)this.inRange[this.formatISODate(n[r])]=this.isInRange(n[r])}else this.rangeHovered=null}handleDateSelect(t){if(t)return this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(this.formatISODate(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=this.formatISODate(new Date),n=this.querySelector(`div[data-date="${t}"]`);if(n instanceof HTMLDivElement)this.focusedDate=t,n.focus();else{const r=this.selectableDates.find(i=>!i.isDisabled);if(r){const i=this.querySelector(`div[data-date="${r.currentDateISO}"]`);i instanceof HTMLDivElement&&(this.focusedDate=r.currentDateISO,i.focus())}}}closeEvent(t){this.contains(t.relatedTarget)||this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};Se([O({type:Boolean})],xe.prototype,"multiple",2),Se([O({type:Number})],xe.prototype,"maxMultiple",2),Se([O({type:Boolean})],xe.prototype,"range",2),Se([O({type:Boolean})],xe.prototype,"weeknumbers",2),Se([O({type:Boolean})],xe.prototype,"withcontrols",2),Se([O({converter:ar.csvToArray})],xe.prototype,"selected",2),Se([O({type:String})],xe.prototype,"earliest",2),Se([O({type:String})],xe.prototype,"latest",2),Se([O({converter:ar.stringsToDate})],xe.prototype,"excludedates",2),Se([O({converter:ar.csvToArray})],xe.prototype,"excludeweekdays",2),Se([O({converter:ar.stringToDate})],xe.prototype,"currentmonth",2),Se([O({type:Array})],xe.prototype,"dayStrings",2),Se([O({type:Array})],xe.prototype,"monthStrings",2),Se([O({type:String})],xe.prototype,"weekString",2),Se([O({type:String})],xe.prototype,"prevMonthString",2),Se([O({type:String})],xe.prototype,"nextMonthString",2),Se([O({type:Array})],xe.prototype,"_selected",2),Se([O({type:Number})],xe.prototype,"year",2),Se([O({type:Number})],xe.prototype,"month",2),Se([O({type:Number})],xe.prototype,"week",2),Se([O({type:Date})],xe.prototype,"rangeHovered",2),Se([It()],xe.prototype,"inRange",2),Se([It()],xe.prototype,"focusedDate",2),Se([It()],xe.prototype,"selectableDates",2),Se([It()],xe.prototype,"currentmonthtouched",2),Se([It()],xe.prototype,"tabIndexSet",2),xe=Se([Nt("pkt-calendar")],xe);const pf="pkt-tag",df=!0,hf={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"string",required:!1},skin:{required:!1,default:"blue",type:["blue","green","red","beige","yellow","gray","blue-light"]},textStyle:{required:!1,default:"normal-text",type:["thin-text","normal-text"]},type:{required:!1,default:"button",type:["button","submit","reset"]},ariaLabel:{type:"string",required:!1,default:"Lukk"}},ff={default:{description:"Teksten til tag"}},ir={name:pf,"css-class":"pkt-tag",isElement:df,props:hf,slots:ff};var mf=Object.defineProperty,gf=Object.getOwnPropertyDescriptor,Kt=(e,t,n,r)=>{for(var i=r>1?void 0:r?gf(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&mf(t,n,i),i};let jt=class extends St{constructor(){super(),this.defaultSlot=vt(),this.closeTag=ir.props.closeTag.default,this.size=ir.props.size.default,this.skin=ir.props.skin.default,this.textStyle=ir.props.textStyle.default,this.iconName=void 0,this.type=ir.props.type.default,this.ariaLabel=ir.props.ariaLabel.default,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 Tn(this,this.defaultSlot),this._isClosed=!1}render(){const t={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},n={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?
|
|
257
|
+
</tr>`)}return h}isExcluded(t,n){return this.excludeweekdays.includes(t.toString())||this.earliest&&n<new Date(this.earliest)||this.latest&&n>new Date(this.latest)?!0:this.excludedates.some(r=>typeof r=="string"?r===this.formatISODate(n):r.toDateString()===n.toDateString())}formatISODate(t){return t.toISOString().split("T")[0]}isPrevMonthAllowed(){const t=new Date(this.year,this.month,0,12);return!(this.earliest&&new Date(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,n=this.month===0?this.year-1:this.year;this.changeMonth(n,t)}isNextMonthAllowed(){const t=new Date(this.year,this.month===11?0:this.month+1,1,12);return!(this.latest&&new Date(this.latest)<t)}nextMonth(){const t=this.month===11?0:this.month+1,n=this.month===11?this.year+1:this.year;this.changeMonth(n,t)}changeMonth(t,n){this.year=t,this.month=n,this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[],this.requestUpdate()}isInRange(t){if(this.range&&this.selected.length===2){if(t>new Date(this.selected[0])&&t<new Date(this.selected[1]))return!0}else if(this.range&&this.selected.length===1&&this.rangeHovered&&t>new Date(this.selected[0])&&t<this.rangeHovered)return!0;return!1}isRangeAllowed(t){let n=!0;if(this._selected.length===1){const r=os({start:this._selected[0],end:t});if(Array.isArray(r)&&r.length)for(let i=0;i<r.length;i++)this.excludedates.forEach(o=>{o>this._selected[0]&&o<t&&(n=!1)}),this.excludeweekdays.includes(af(r[i]).toString())&&(n=!1)}return n}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(t){this.selected.includes(this.formatISODate(t))||(this.selected=[...this.selected,this.formatISODate(t)],this._selected=[...this._selected,t],this.range&&this.selected.length===2&&this.close())}removeFromSelected(t){if(this.selected.length===1)this.emptySelected();else{const n=this.selected.indexOf(this.formatISODate(t)),r=[...this.selected],i=[...this._selected];r.splice(n,1),i.splice(n,1),this.selected=r,this._selected=i}}toggleSelected(t){const n=this.formatISODate(t);this.selected.includes(n)?this.removeFromSelected(t):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(t)}handleRangeSelect(t){const n=this.formatISODate(t);return this.selected.includes(n)?this.selected.indexOf(n)===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 n=os({start:this._selected[0],end:t});if(Array.isArray(n)&&n.length)for(let r=0;r<n.length;r++)this.inRange[this.formatISODate(n[r])]=this.isInRange(n[r])}else this.rangeHovered=null}handleDateSelect(t){if(t)return this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(this.formatISODate(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=this.formatISODate(new Date),n=this.querySelector(`div[data-date="${t}"]`);if(n instanceof HTMLDivElement)this.focusedDate=t,n.focus();else{const r=this.selectableDates.find(i=>!i.isDisabled);if(r){const i=this.querySelector(`div[data-date="${r.currentDateISO}"]`);i instanceof HTMLDivElement&&(this.focusedDate=r.currentDateISO,i.focus())}}}closeEvent(t){this.contains(t.relatedTarget)||this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};Se([O({type:Boolean})],xe.prototype,"multiple",2),Se([O({type:Number})],xe.prototype,"maxMultiple",2),Se([O({type:Boolean})],xe.prototype,"range",2),Se([O({type:Boolean})],xe.prototype,"weeknumbers",2),Se([O({type:Boolean})],xe.prototype,"withcontrols",2),Se([O({converter:ar.csvToArray})],xe.prototype,"selected",2),Se([O({type:String})],xe.prototype,"earliest",2),Se([O({type:String})],xe.prototype,"latest",2),Se([O({converter:ar.stringsToDate})],xe.prototype,"excludedates",2),Se([O({converter:ar.csvToArray})],xe.prototype,"excludeweekdays",2),Se([O({converter:ar.stringToDate})],xe.prototype,"currentmonth",2),Se([O({type:Array})],xe.prototype,"dayStrings",2),Se([O({type:Array})],xe.prototype,"monthStrings",2),Se([O({type:String})],xe.prototype,"weekString",2),Se([O({type:String})],xe.prototype,"prevMonthString",2),Se([O({type:String})],xe.prototype,"nextMonthString",2),Se([O({type:Array})],xe.prototype,"_selected",2),Se([O({type:Number})],xe.prototype,"year",2),Se([O({type:Number})],xe.prototype,"month",2),Se([O({type:Number})],xe.prototype,"week",2),Se([O({type:Date})],xe.prototype,"rangeHovered",2),Se([It()],xe.prototype,"inRange",2),Se([It()],xe.prototype,"focusedDate",2),Se([It()],xe.prototype,"selectableDates",2),Se([It()],xe.prototype,"currentmonthtouched",2),Se([It()],xe.prototype,"tabIndexSet",2),xe=Se([Nt("pkt-calendar")],xe);const pf="pkt-tag",df=!0,hf={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"string",required:!1},skin:{required:!1,default:"blue",type:["blue","green","red","beige","yellow","gray","blue-light"]},textStyle:{required:!1,default:"normal-text",type:["thin-text","normal-text"]},type:{required:!1,default:"button",type:["button","submit","reset"]},ariaLabel:{type:"string",required:!1,default:"Lukk"}},ff={default:{description:"Teksten til tag"}},ir={name:pf,"css-class":"pkt-tag",isElement:df,props:hf,slots:ff};var mf=Object.defineProperty,gf=Object.getOwnPropertyDescriptor,Kt=(e,t,n,r)=>{for(var i=r>1?void 0:r?gf(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&mf(t,n,i),i};let jt=class extends St{constructor(){super(),this.defaultSlot=vt(),this.closeTag=ir.props.closeTag.default,this.size=ir.props.size.default,this.skin=ir.props.skin.default,this.textStyle=ir.props.textStyle.default,this.iconName=void 0,this.type=ir.props.type.default,this.ariaLabel=ir.props.ariaLabel.default,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 Tn(this,this.defaultSlot),this._isClosed=!1}render(){const t={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},n={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?z`
|
|
258
258
|
<button
|
|
259
259
|
class=${He(n)}
|
|
260
260
|
type=${this.type}
|
|
261
261
|
aria-label=${this.ariaLabel}
|
|
262
262
|
@click=${this.close}
|
|
263
263
|
>
|
|
264
|
-
${this.iconName&&
|
|
264
|
+
${this.iconName&&z`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
265
265
|
<span ${rt(this.defaultSlot)}></span>
|
|
266
266
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
267
267
|
</button>
|
|
268
|
-
`:
|
|
268
|
+
`:z`
|
|
269
269
|
<span class=${He(t)}>
|
|
270
|
-
${this.iconName&&
|
|
270
|
+
${this.iconName&&z` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
|
|
271
271
|
<span ${rt(this.defaultSlot)}></span>
|
|
272
272
|
</span>
|
|
273
|
-
`}};Kt([O({type:Boolean,reflect:!0})],jt.prototype,"closeTag",2),Kt([O({type:String,reflect:!0})],jt.prototype,"size",2),Kt([O({type:String,reflect:!0})],jt.prototype,"skin",2),Kt([O({type:String,reflect:!0})],jt.prototype,"textStyle",2),Kt([O({type:String,reflect:!0})],jt.prototype,"iconName",2),Kt([O({type:String,reflect:!0})],jt.prototype,"type",2),Kt([O({type:String,reflect:!0})],jt.prototype,"ariaLabel",2),Kt([It()],jt.prototype,"_isClosed",2),jt=Kt([Nt("pkt-tag")],jt);const vf="pkt-card",yf=!0,Df={heading:{type:"string",name:"Heading",description:"Tittel på kortet"},subheading:{type:"string",name:"Subheading",description:"Undertittel på kortet"},tags:{type:"IPktTag[]",description:"Liste av tags på kortet. Tar inn en array med IPktTag-objekter med følgende stringproperties: skin, iconName, ariaLabel, text",name:"Tags",items:{type:"object",properties:{skin:{type:["blue","green","red","yellow"],description:"Farge på tag"},iconName:{type:"string",description:"Id på ikonet du ønsker å bruke til tag"},ariaLabel:{type:"string",description:"Tekst for aria-label"},text:{type:"string",description:"Tekst på tag"}},required:["text"]}},skin:{type:["outlined","gray","blue","beige","green"],name:"Skin",description:"Farge på kortet",default:"outlined"},direction:{type:["landscape","portrait"],name:"Direction",description:"Retningen innholdet skal ligge i forhold til kortet",default:"portrait"},image:{type:"object",image:"Image",description:"Bilde på kortet. Tar inn et objekt av typen {src: string, alt: string}. src er stien til bildet, og alt er tekst for aria-label.",items:{type:"object",properties:{src:{type:"string",description:"Bilde på kortet"},alt:{type:"string",description:"Tekst for aria-label"}},required:["src","alt"]}}},bf={default:{description:"Innholdet i kortet"}},ql={name:vf,"css-class":"pkt-card",isElement:yf,props:Df,slots:bf};var kf=Object.defineProperty,wf=Object.getOwnPropertyDescriptor,Ln=(e,t,n,r)=>{for(var i=r>1?void 0:r?wf(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&kf(t,n,i),i};let Jt=class extends St{constructor(){super(),this.defaultSlot=vt(),this.skin=ql.props.skin.default,this.direction=ql.props.direction.default,this.image={src:"",alt:""},this.heading="",this.subheading="",this.tags=[],this.slotController=new Tn(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){const t={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.direction}`]:this.direction};return
|
|
273
|
+
`}};Kt([O({type:Boolean,reflect:!0})],jt.prototype,"closeTag",2),Kt([O({type:String,reflect:!0})],jt.prototype,"size",2),Kt([O({type:String,reflect:!0})],jt.prototype,"skin",2),Kt([O({type:String,reflect:!0})],jt.prototype,"textStyle",2),Kt([O({type:String,reflect:!0})],jt.prototype,"iconName",2),Kt([O({type:String,reflect:!0})],jt.prototype,"type",2),Kt([O({type:String,reflect:!0})],jt.prototype,"ariaLabel",2),Kt([It()],jt.prototype,"_isClosed",2),jt=Kt([Nt("pkt-tag")],jt);const vf="pkt-card",yf=!0,Df={heading:{type:"string",name:"Heading",description:"Tittel på kortet"},subheading:{type:"string",name:"Subheading",description:"Undertittel på kortet"},tags:{type:"IPktTag[]",description:"Liste av tags på kortet. Tar inn en array med IPktTag-objekter med følgende stringproperties: skin, iconName, ariaLabel, text",name:"Tags",items:{type:"object",properties:{skin:{type:["blue","green","red","yellow"],description:"Farge på tag"},iconName:{type:"string",description:"Id på ikonet du ønsker å bruke til tag"},ariaLabel:{type:"string",description:"Tekst for aria-label"},text:{type:"string",description:"Tekst på tag"}},required:["text"]}},skin:{type:["outlined","gray","blue","beige","green"],name:"Skin",description:"Farge på kortet",default:"outlined"},direction:{type:["landscape","portrait"],name:"Direction",description:"Retningen innholdet skal ligge i forhold til kortet",default:"portrait"},image:{type:"object",image:"Image",description:"Bilde på kortet. Tar inn et objekt av typen {src: string, alt: string}. src er stien til bildet, og alt er tekst for aria-label.",items:{type:"object",properties:{src:{type:"string",description:"Bilde på kortet"},alt:{type:"string",description:"Tekst for aria-label"}},required:["src","alt"]}}},bf={default:{description:"Innholdet i kortet"}},ql={name:vf,"css-class":"pkt-card",isElement:yf,props:Df,slots:bf};var kf=Object.defineProperty,wf=Object.getOwnPropertyDescriptor,Ln=(e,t,n,r)=>{for(var i=r>1?void 0:r?wf(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&kf(t,n,i),i};let Jt=class extends St{constructor(){super(),this.defaultSlot=vt(),this.skin=ql.props.skin.default,this.direction=ql.props.direction.default,this.image={src:"",alt:""},this.heading="",this.subheading="",this.tags=[],this.slotController=new Tn(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){const t={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.direction}`]:this.direction};return z`
|
|
274
274
|
<div class=${He(t)}>
|
|
275
|
-
${this.image.src&&
|
|
275
|
+
${this.image.src&&z`
|
|
276
276
|
<div class="pkt-card__image">
|
|
277
277
|
<img src=${this.image.src} alt=${this.image.alt||""} />
|
|
278
278
|
</div>
|
|
279
279
|
`}
|
|
280
280
|
<div class="pkt-card__wrapper">
|
|
281
|
-
${this.tags.length>0?
|
|
281
|
+
${this.tags.length>0?z`
|
|
282
282
|
<div class="pkt-card__tags">
|
|
283
|
-
${this.tags.map(n=>
|
|
283
|
+
${this.tags.map(n=>z`
|
|
284
284
|
<pkt-tag textStyle="normal-text" size="medium" skin=${n.skin}>
|
|
285
285
|
${n.text}
|
|
286
286
|
</pkt-tag>
|
|
287
287
|
`)}
|
|
288
288
|
</div>
|
|
289
289
|
`:ne}
|
|
290
|
-
${this.heading&&
|
|
291
|
-
${this.subheading&&
|
|
292
|
-
${this.defaultSlot&&
|
|
290
|
+
${this.heading&&z`<h3 class="pkt-txt-30-medium">${this.heading}</h3>`}
|
|
291
|
+
${this.subheading&&z`<p class="pkt-txt-20-light">${this.subheading}</p>`}
|
|
292
|
+
${this.defaultSlot&&z`<div class="pkt-card__content" ${rt(this.defaultSlot)}></div>`}
|
|
293
293
|
</div>
|
|
294
294
|
</div>
|
|
295
|
-
`}};Ln([O({type:String,reflect:!0})],Jt.prototype,"skin",2),Ln([O({type:String,reflect:!0})],Jt.prototype,"direction",2),Ln([O({type:Object,reflect:!0})],Jt.prototype,"image",2),Ln([O({type:String,reflect:!0})],Jt.prototype,"heading",2),Ln([O({type:String,reflect:!0})],Jt.prototype,"subheading",2),Ln([O({type:Array,reflect:!0})],Jt.prototype,"tags",2),Jt=Ln([Nt("pkt-card")],Jt);var Cf=Object.defineProperty,_f=Object.getOwnPropertyDescriptor,zr=(e,t,n,r)=>{for(var i=r>1?void 0:r?_f(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Cf(t,n,i),i};let sr=class extends St{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=vt(),this.namedSlot=vt(),this.slotController=new Tn(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return
|
|
295
|
+
`}};Ln([O({type:String,reflect:!0})],Jt.prototype,"skin",2),Ln([O({type:String,reflect:!0})],Jt.prototype,"direction",2),Ln([O({type:Object,reflect:!0})],Jt.prototype,"image",2),Ln([O({type:String,reflect:!0})],Jt.prototype,"heading",2),Ln([O({type:String,reflect:!0})],Jt.prototype,"subheading",2),Ln([O({type:Array,reflect:!0})],Jt.prototype,"tags",2),Jt=Ln([Nt("pkt-card")],Jt);var Cf=Object.defineProperty,_f=Object.getOwnPropertyDescriptor,zr=(e,t,n,r)=>{for(var i=r>1?void 0:r?_f(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Cf(t,n,i),i};let sr=class extends St{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=vt(),this.namedSlot=vt(),this.slotController=new Tn(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return z`
|
|
296
296
|
<div class="${He(e)}">
|
|
297
297
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
298
298
|
|
|
@@ -316,15 +316,15 @@ React keys must be passed directly to JSX without using spread:
|
|
|
316
316
|
Si ${Bt.example.hi}
|
|
317
317
|
</button>
|
|
318
318
|
</div>
|
|
319
|
-
`}renderList(e){return
|
|
319
|
+
`}renderList(e){return z`
|
|
320
320
|
<ul>
|
|
321
|
-
${e.map(t=>
|
|
321
|
+
${e.map(t=>z`<li>${t}</li>`)}
|
|
322
322
|
</ul>
|
|
323
|
-
`}doStuff(e){return e.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};zr([O({type:String})],sr.prototype,"string",2),zr([O({converter:Ol})],sr.prototype,"strings",2),zr([O({type:Boolean})],sr.prototype,"darkmode",2),zr([O({type:Array})],sr.prototype,"_list",2),sr=zr([Nt("pkt-component")],sr);const xf="pkt-inputwrapper",Sf={toggleHelpText:{description:"Event for å vise eller skjule hjelpetekst i dropdown"}},Ef={forId:{name:"For ID",description:"Id-en til inputfeltet som dette wrapper rundt",type:"string",required:!0},label:{name:"Merkelapp",description:"Merkelapp for inputfeltet",type:"boolean",required:!0,default:"input"},helptext:{name:"Hjelpetekst",description:"Hjelpetekst for inputfeltet",type:"string"},helptextDropdown:{name:"Hjelpetekst i dropdown",description:"Hjelpetekst som vises i ekspanderende felt",type:"string"},helptextDropdownButton:{name:"Tekst i hjelpetekst-knapp",description:"Tekst som vises i knappen for å vise hjelpetekst i dropdown",default:"Les mer <span class='pkt-sr-only'>om feltet</span>",type:"string"},counter:{name:"Teller",description:"Teller for antall tegn i inputfeltet",type:"boolean",default:!1},counterCurrent:{name:"Tellerverdi",description:"Tellerens nåværende verdi",type:"number"},counterMaxLength:{name:"Maks tegn",description:"Maks antall tegn som kan skrives i inputfeltet",type:"number"},optionalTag:{name:"Vise valgfritt-merking",description:"Viser en merking som indikerer at feltet er valgfritt",type:"boolean",default:!1},optionalText:{name:"Valgfritt-tekst",description:"Tekst som vises i valgfritt-merkingen",type:"string",default:"Valgfritt"},requiredTag:{name:"Vise påkrevd-merking",description:"Viser en merking som indikerer at feltet er påkrevd",type:"boolean",default:!1},requiredText:{name:"Påkrevd-tekst",description:"Tekst som vises i påkrevd-merkingen",type:"string",default:"Må fylles ut"},hasError:{name:"Feil",description:"Indikerer at inputfeltet har en feil",type:"boolean",default:!1},errorMessage:{name:"Feilmelding",description:"Feilmelding som vises i tilknytning til inputfeltet",type:"string"},disabled:{name:"Deaktivert",description:"Indikerer at inputfeltet er deaktivert",type:"boolean",default:!1},inline:{name:"Inline",description:"Indikerer at inputfeltet skal flyte sammen med sidens innhold",type:"boolean",default:!1},ariaDescribedby:{name:"aria-describedby",description:"Id-en til elementet som beskriver inputfeltet",type:"string"},hasFieldset:{name:"Har fieldset",description:"Indikerer at inputfeltet er en del av et fieldset",type:"boolean",default:!1},useWrapper:{name:"Bruk wrapper",description:"Indikerer om inputfeltet skal bruke en wrapper",type:"boolean",default:!0}},yt={name:xf,"css-class":"pkt-inputwrapper",events:Sf,props:Ef};var Ff=Object.defineProperty,Af=Object.getOwnPropertyDescriptor,or=(e,t,n,r)=>{for(var i=r>1?void 0:r?Af(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Ff(t,n,i),i};let On=class extends St{constructor(){super(),this.forId=ns(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=yt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){const t=()=>{this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:!this.isHelpTextOpen}})),this.isHelpTextOpen=!this.isHelpTextOpen},n={"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen};return
|
|
324
|
-
${this.helptext?
|
|
323
|
+
`}doStuff(e){return e.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};zr([O({type:String})],sr.prototype,"string",2),zr([O({converter:Ol})],sr.prototype,"strings",2),zr([O({type:Boolean})],sr.prototype,"darkmode",2),zr([O({type:Array})],sr.prototype,"_list",2),sr=zr([Nt("pkt-component")],sr);const xf="pkt-inputwrapper",Sf={toggleHelpText:{description:"Event for å vise eller skjule hjelpetekst i dropdown"}},Ef={forId:{name:"For ID",description:"Id-en til inputfeltet som dette wrapper rundt",type:"string",required:!0},label:{name:"Merkelapp",description:"Merkelapp for inputfeltet",type:"boolean",required:!0,default:"input"},helptext:{name:"Hjelpetekst",description:"Hjelpetekst for inputfeltet",type:"string"},helptextDropdown:{name:"Hjelpetekst i dropdown",description:"Hjelpetekst som vises i ekspanderende felt",type:"string"},helptextDropdownButton:{name:"Tekst i hjelpetekst-knapp",description:"Tekst som vises i knappen for å vise hjelpetekst i dropdown",default:"Les mer <span class='pkt-sr-only'>om feltet</span>",type:"string"},counter:{name:"Teller",description:"Teller for antall tegn i inputfeltet",type:"boolean",default:!1},counterCurrent:{name:"Tellerverdi",description:"Tellerens nåværende verdi",type:"number"},counterMaxLength:{name:"Maks tegn",description:"Maks antall tegn som kan skrives i inputfeltet",type:"number"},optionalTag:{name:"Vise valgfritt-merking",description:"Viser en merking som indikerer at feltet er valgfritt",type:"boolean",default:!1},optionalText:{name:"Valgfritt-tekst",description:"Tekst som vises i valgfritt-merkingen",type:"string",default:"Valgfritt"},requiredTag:{name:"Vise påkrevd-merking",description:"Viser en merking som indikerer at feltet er påkrevd",type:"boolean",default:!1},requiredText:{name:"Påkrevd-tekst",description:"Tekst som vises i påkrevd-merkingen",type:"string",default:"Må fylles ut"},hasError:{name:"Feil",description:"Indikerer at inputfeltet har en feil",type:"boolean",default:!1},errorMessage:{name:"Feilmelding",description:"Feilmelding som vises i tilknytning til inputfeltet",type:"string"},disabled:{name:"Deaktivert",description:"Indikerer at inputfeltet er deaktivert",type:"boolean",default:!1},inline:{name:"Inline",description:"Indikerer at inputfeltet skal flyte sammen med sidens innhold",type:"boolean",default:!1},ariaDescribedby:{name:"aria-describedby",description:"Id-en til elementet som beskriver inputfeltet",type:"string"},hasFieldset:{name:"Har fieldset",description:"Indikerer at inputfeltet er en del av et fieldset",type:"boolean",default:!1},useWrapper:{name:"Bruk wrapper",description:"Indikerer om inputfeltet skal bruke en wrapper",type:"boolean",default:!0}},yt={name:xf,"css-class":"pkt-inputwrapper",events:Sf,props:Ef};var Ff=Object.defineProperty,Af=Object.getOwnPropertyDescriptor,or=(e,t,n,r)=>{for(var i=r>1?void 0:r?Af(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Ff(t,n,i),i};let On=class extends St{constructor(){super(),this.forId=ns(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=yt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){const t=()=>{this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:!this.isHelpTextOpen}})),this.isHelpTextOpen=!this.isHelpTextOpen},n={"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen};return z`${this.helptext||this.helptextDropdown?z`<div>
|
|
324
|
+
${this.helptext?z`<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
325
325
|
${Ra(this.helptext)}
|
|
326
326
|
</div>`:ne}
|
|
327
|
-
${this.helptextDropdown?
|
|
327
|
+
${this.helptextDropdown?z`<div class="pkt-inputwrapper__helptext-expandable">
|
|
328
328
|
<button
|
|
329
329
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
330
330
|
type="button"
|
|
@@ -345,47 +345,48 @@ React keys must be passed directly to JSX without using spread:
|
|
|
345
345
|
* Copyright 2020 Google LLC
|
|
346
346
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
347
347
|
*/const $f=Symbol.for(""),ls=(e,...t)=>({_$litStatic$:t.reduce((n,r,i)=>n+(o=>{if(o._$litStatic$!==void 0)return o._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${o}. Use 'unsafeStatic' to pass non-literal values, but
|
|
348
|
-
take care to ensure page security.`)})(r)+e[i+1],e[0]),r:$f});var Tf=Object.defineProperty,Bf=Object.getOwnPropertyDescriptor,Ie=(e,t,n,r)=>{for(var i=r>1?void 0:r?Bf(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Tf(t,n,i),i};let Le=class extends St{constructor(){super(),this.defaultSlot=vt(),this.forId=ns(),this.label=yt.props.label.default,this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=yt.props.helptextDropdownButton.default,this.counter=yt.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.optionalTag=yt.props.optionalTag.default,this.optionalText=yt.props.optionalText.default,this.requiredTag=yt.props.requiredTag.default,this.requiredText=yt.props.requiredText.default,this.hasError=yt.props.hasError.default,this.errorMessage="",this.disabled=yt.props.disabled.default,this.inline=yt.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=yt.props.hasFieldset.default,this.useWrapper=yt.props.useWrapper.default,this.wrapperType=this.useWrapper?ls`fieldset`:this.hasDropdown?ls`div`:ls`label`,this.slotController=new Tn(this,this.defaultSlot)}render(){const e={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},t={"pkt-tag":!0,"pkt-tag--small":!0,"pkt-tag--thin-text":!0,"pkt-tag--blue-light":this.optionalTag,"pkt-tag--beige":!this.optionalTag&&this.requiredTag},n=this.helptextDropdown!=="",r={"pkt-inputwrapper__label":!0,"pkt-inputwrapper__fieldset":this.hasFieldset,"pkt-inputwrapper__legend":this.hasFieldset},i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:ne,o=()=>this.optionalTag||this.requiredTag?
|
|
348
|
+
take care to ensure page security.`)})(r)+e[i+1],e[0]),r:$f});var Tf=Object.defineProperty,Bf=Object.getOwnPropertyDescriptor,Ie=(e,t,n,r)=>{for(var i=r>1?void 0:r?Bf(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Tf(t,n,i),i};let Le=class extends St{constructor(){super(),this.defaultSlot=vt(),this.forId=ns(),this.label=yt.props.label.default,this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=yt.props.helptextDropdownButton.default,this.counter=yt.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.optionalTag=yt.props.optionalTag.default,this.optionalText=yt.props.optionalText.default,this.requiredTag=yt.props.requiredTag.default,this.requiredText=yt.props.requiredText.default,this.hasError=yt.props.hasError.default,this.errorMessage="",this.disabled=yt.props.disabled.default,this.inline=yt.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=yt.props.hasFieldset.default,this.useWrapper=yt.props.useWrapper.default,this.wrapperType=this.useWrapper?ls`fieldset`:this.hasDropdown?ls`div`:ls`label`,this.slotController=new Tn(this,this.defaultSlot)}render(){const e={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},t={"pkt-tag":!0,"pkt-tag--small":!0,"pkt-tag--thin-text":!0,"pkt-tag--blue-light":this.optionalTag,"pkt-tag--beige":!this.optionalTag&&this.requiredTag},n=this.helptextDropdown!=="",r={"pkt-inputwrapper__label":!0,"pkt-inputwrapper__fieldset":this.hasFieldset,"pkt-inputwrapper__legend":this.hasFieldset},i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:ne,o=()=>this.optionalTag||this.requiredTag?z`<span class=${He(t)}
|
|
349
349
|
>${this.optionalTag?this.optionalText:this.requiredTag?this.requiredText:ne}</span
|
|
350
|
-
>`:ne,u=()=>this.useWrapper?this.hasFieldset?
|
|
350
|
+
>`:ne,u=()=>this.useWrapper?this.hasFieldset?z`<legend class="pkt-inputwrapper__legend" id="${this.forId}-label">
|
|
351
351
|
${this.label} ${o()}
|
|
352
|
-
</legend>`:n?
|
|
352
|
+
</legend>`:n?z`<h2>${this.label} ${o()}</h2>`:z`<span>${this.label} ${o()}</span>`:z`<label for="${this.forId}" class="pkt-sr-only" aria-describedby="${i}"
|
|
353
353
|
>${this.label}</label
|
|
354
|
-
>`,c=()=>this.useWrapper&&(this.helptext||this.helptextDropdown)?
|
|
354
|
+
>`,c=()=>this.useWrapper&&(this.helptext||this.helptextDropdown)?z`
|
|
355
355
|
<pkt-helptext
|
|
356
356
|
.forId=${this.forId}
|
|
357
357
|
.helptext=${this.helptext}
|
|
358
358
|
.helptextDropdown=${this.helptextDropdown}
|
|
359
359
|
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
360
360
|
></pkt-helptext>
|
|
361
|
-
`:ne,d=()=>this.counter?
|
|
361
|
+
`:ne,d=()=>this.counter?z`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
362
362
|
${this.counterCurrent||0}
|
|
363
363
|
${this.counterMaxLength?`/${this.counterMaxLength}`:ne}
|
|
364
|
-
</div>`:ne,h=()=>this.hasError&&this.errorMessage?
|
|
364
|
+
</div>`:ne,h=()=>this.hasError&&this.errorMessage?z`<div
|
|
365
365
|
class="pkt-alert pkt-alert--error pkt-alert--compact"
|
|
366
366
|
aria-live="assertive"
|
|
367
367
|
>
|
|
368
368
|
<pkt-icon name="alert-error" class="pkt-alert__icon"></pkt-icon>
|
|
369
369
|
<div class="pkt-alert__text">${Ra(this.errorMessage)}</div>
|
|
370
|
-
</div>`:ne,m=()=>
|
|
370
|
+
</div>`:ne,m=()=>z`
|
|
371
371
|
${u()} ${c()}
|
|
372
|
+
${n?z`<label for="${this.forId}" class="pkt-sr-only" aria-describedby="${i}"
|
|
373
|
+
>${this.label}</label
|
|
374
|
+
>`:ne}
|
|
372
375
|
<div class="pkt-contents" ${rt(this.defaultSlot)}></div>
|
|
373
376
|
${d()} ${h()}
|
|
374
|
-
`,v=()=>this.hasFieldset?
|
|
377
|
+
`,v=()=>this.hasFieldset?z`<fieldset class=${He(r)} aria-describedby="${i}">
|
|
375
378
|
${m()}
|
|
376
|
-
</fieldset>`:n?
|
|
377
|
-
${m()}
|
|
378
|
-
</div>`:G`<label
|
|
379
|
+
</fieldset>`:n?z`<div class=${He(r)}>${m()}</div>`:z`<label
|
|
379
380
|
class=${He(r)}
|
|
380
381
|
for="${this.forId}"
|
|
381
382
|
aria-describedby="${i}"
|
|
382
383
|
>
|
|
383
384
|
${m()}
|
|
384
|
-
</label>`;return G`<div class=${He(e)}>${v()}</div> `}};Ie([O({type:String,reflect:!0})],Le.prototype,"forId",2),Ie([O({type:String,reflect:!0})],Le.prototype,"label",2),Ie([O({type:String,reflect:!0})],Le.prototype,"helptext",2),Ie([O({type:String,reflect:!0})],Le.prototype,"helptextDropdown",2),Ie([O({type:String,reflect:!0})],Le.prototype,"helptextDropdownButton",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"counter",2),Ie([O({type:Number,reflect:!0})],Le.prototype,"counterCurrent",2),Ie([O({type:Number,reflect:!0})],Le.prototype,"counterMaxLength",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"optionalTag",2),Ie([O({type:String,reflect:!0})],Le.prototype,"optionalText",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"requiredTag",2),Ie([O({type:String,reflect:!0})],Le.prototype,"requiredText",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"hasError",2),Ie([O({type:String,reflect:!0})],Le.prototype,"errorMessage",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"disabled",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"inline",2),Ie([O({type:String,reflect:!0})],Le.prototype,"ariaDescribedby",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"hasFieldset",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"useWrapper",2),Le=Ie([Nt("pkt-input-wrapper")],Le);function Wa(e){return Vr(e,{weekStartsOn:1})}function Hl(e){const t=ot(e),n=t.getFullYear(),r=jn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Wa(r),o=jn(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const u=Wa(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=u.getTime()?n:n-1}function Ul(e){const t=ot(e);return t.setHours(0,0,0,0),t}function Wl(e){const t=ot(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Nf(e,t){const n=Ul(e),r=Ul(t),i=+n-Wl(n),o=+r-Wl(r);return Math.round((i-o)/tf)}function jf(e){const t=Hl(e),n=jn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Wa(n)}function Pf(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Lf(e){if(!Pf(e)&&typeof e!="number")return!1;const t=ot(e);return!isNaN(Number(t))}function Of(e){const t=ot(e),n=jn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const If={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"}},Mf=(e,t,n)=>{let r;const i=If[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function us(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Rf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qf={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Hf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Uf={date:us({formats:Rf,defaultWidth:"full"}),time:us({formats:qf,defaultWidth:"full"}),dateTime:us({formats:Hf,defaultWidth:"full"})},Wf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Vf=(e,t,n,r)=>Wf[e];function Gr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const u=e.defaultFormattingWidth||e.defaultWidth,c=n!=null&&n.width?String(n.width):u;i=e.formattingValues[c]||e.formattingValues[u]}else{const u=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[c]||e.values[u]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const zf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Gf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Yf={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"]},Kf={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"]},Jf={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"}},Xf={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"}},Qf=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Zf={ordinalNumber:Qf,era:Gr({values:zf,defaultWidth:"wide"}),quarter:Gr({values:Gf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Gr({values:Yf,defaultWidth:"wide"}),day:Gr({values:Kf,defaultWidth:"wide"}),dayPeriod:Gr({values:Jf,defaultWidth:"wide",formattingValues:Xf,defaultFormattingWidth:"wide"})};function Yr(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const u=o[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(c)?tm(c,v=>v.test(u)):em(c,v=>v.test(u));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const m=t.slice(u.length);return{value:h,rest:m}}}function em(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function tm(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function nm(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let u=e.valueCallback?e.valueCallback(o[0]):o[0];u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}const rm=/^(\d+)(th|st|nd|rd)?/i,am=/\d+/i,im={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},sm={any:[/^b/i,/^(a|c)/i]},om={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lm={any:[/1/i,/2/i,/3/i,/4/i]},um={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},cm={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]},pm={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},dm={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]},hm={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},fm={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}},mm={ordinalNumber:nm({matchPattern:rm,parsePattern:am,valueCallback:e=>parseInt(e,10)}),era:Yr({matchPatterns:im,defaultMatchWidth:"wide",parsePatterns:sm,defaultParseWidth:"any"}),quarter:Yr({matchPatterns:om,defaultMatchWidth:"wide",parsePatterns:lm,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Yr({matchPatterns:um,defaultMatchWidth:"wide",parsePatterns:cm,defaultParseWidth:"any"}),day:Yr({matchPatterns:pm,defaultMatchWidth:"wide",parsePatterns:dm,defaultParseWidth:"any"}),dayPeriod:Yr({matchPatterns:hm,defaultMatchWidth:"any",parsePatterns:fm,defaultParseWidth:"any"})},gm={code:"en-US",formatDistance:Mf,formatLong:Uf,formatRelative:Vf,localize:Zf,match:mm,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vm(e){const t=ot(e);return Nf(t,Of(t))+1}function ym(e){const t=ot(e),n=+Wa(t)-+jf(t);return Math.round(n/Il)+1}function Ce(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const dn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ce(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ce(n+1,2)},d(e,t){return Ce(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ce(e.getHours()%12||12,t.length)},H(e,t){return Ce(e.getHours(),t.length)},m(e,t){return Ce(e.getMinutes(),t.length)},s(e,t){return Ce(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ce(i,t.length)}},lr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Vl={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return dn.y(e,t)},Y:function(e,t,n,r){const i=Ml(e,r),o=i>0?i:1-i;if(t==="YY"){const u=o%100;return Ce(u,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Ce(o,t.length)},R:function(e,t){const n=Hl(e);return Ce(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ce(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ce(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ce(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return dn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ce(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=Rl(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ce(i,t.length)},I:function(e,t,n){const r=ym(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ce(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):dn.d(e,t)},D:function(e,t,n){const r=vm(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ce(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Ce(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Ce(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Ce(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=lr.noon:r===0?i=lr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=lr.evening:r>=12?i=lr.afternoon:r>=4?i=lr.morning:i=lr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return dn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):dn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ce(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ce(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):dn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):dn.s(e,t)},S:function(e,t){return dn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Gl(r);case"XXXX":case"XX":return In(r);case"XXXXX":case"XXX":default:return In(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Gl(r);case"xxxx":case"xx":return In(r);case"xxxxx":case"xxx":default:return In(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zl(r,":");case"OOOO":default:return"GMT"+In(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zl(r,":");case"zzzz":default:return"GMT"+In(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Ce(r,t.length)},T:function(e,t,n){const r=e.getTime();return Ce(r,t.length)}};function zl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Ce(o,2)}function Gl(e,t){return e%60===0?(e>0?"-":"+")+Ce(Math.abs(e)/60,2):In(e,t)}function In(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ce(Math.trunc(r/60),2),o=Ce(r%60,2);return n+i+t+o}const Yl=(e,t)=>{switch(e){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"})}},Kl=(e,t)=>{switch(e){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"})}},Dm=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Yl(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Yl(r,t)).replace("{{time}}",Kl(i,t))},bm={p:Kl,P:Dm},km=/^D+$/,wm=/^Y+$/,Cm=["D","DD","YY","YYYY"];function _m(e){return km.test(e)}function xm(e){return wm.test(e)}function Sm(e,t,n){const r=Em(e,t,n);if(console.warn(r),Cm.includes(e))throw new RangeError(r)}function Em(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Fm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Am=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$m=/^'([^]*?)'?$/,Tm=/''/g,Bm=/[a-zA-Z]/;function Nm(e,t,n){var r,i,o,u;const c=Ua(),d=c.locale??gm,h=c.firstWeekContainsDate??((i=(r=c.locale)==null?void 0:r.options)==null?void 0:i.firstWeekContainsDate)??1,m=c.weekStartsOn??((u=(o=c.locale)==null?void 0:o.options)==null?void 0:u.weekStartsOn)??0,v=ot(e);if(!Lf(v))throw new RangeError("Invalid time value");let y=t.match(Am).map(k=>{const x=k[0];if(x==="p"||x==="P"){const C=bm[x];return C(k,d.formatLong)}return k}).join("").match(Fm).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const x=k[0];if(x==="'")return{isToken:!1,value:jm(k)};if(Vl[x])return{isToken:!0,value:k};if(x.match(Bm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:k}});d.localize.preprocessor&&(y=d.localize.preprocessor(v,y));const b={firstWeekContainsDate:h,weekStartsOn:m,locale:d};return y.map(k=>{if(!k.isToken)return k.value;const x=k.value;(xm(x)||_m(x))&&Sm(x,t,String(e));const C=Vl[x[0]];return C(v,x,d.localize,b)}).join("")}function jm(e){const t=e.match($m);return t?t[1].replace(Tm,"'"):e}/**
|
|
385
|
+
</label>`;return z`<div class=${He(e)}>${v()}</div> `}};Ie([O({type:String,reflect:!0})],Le.prototype,"forId",2),Ie([O({type:String,reflect:!0})],Le.prototype,"label",2),Ie([O({type:String,reflect:!0})],Le.prototype,"helptext",2),Ie([O({type:String,reflect:!0})],Le.prototype,"helptextDropdown",2),Ie([O({type:String,reflect:!0})],Le.prototype,"helptextDropdownButton",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"counter",2),Ie([O({type:Number,reflect:!0})],Le.prototype,"counterCurrent",2),Ie([O({type:Number,reflect:!0})],Le.prototype,"counterMaxLength",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"optionalTag",2),Ie([O({type:String,reflect:!0})],Le.prototype,"optionalText",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"requiredTag",2),Ie([O({type:String,reflect:!0})],Le.prototype,"requiredText",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"hasError",2),Ie([O({type:String,reflect:!0})],Le.prototype,"errorMessage",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"disabled",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"inline",2),Ie([O({type:String,reflect:!0})],Le.prototype,"ariaDescribedby",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"hasFieldset",2),Ie([O({type:Boolean,reflect:!0})],Le.prototype,"useWrapper",2),Le=Ie([Nt("pkt-input-wrapper")],Le);function Wa(e){return Vr(e,{weekStartsOn:1})}function Hl(e){const t=ot(e),n=t.getFullYear(),r=jn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Wa(r),o=jn(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const u=Wa(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=u.getTime()?n:n-1}function Ul(e){const t=ot(e);return t.setHours(0,0,0,0),t}function Wl(e){const t=ot(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Nf(e,t){const n=Ul(e),r=Ul(t),i=+n-Wl(n),o=+r-Wl(r);return Math.round((i-o)/tf)}function jf(e){const t=Hl(e),n=jn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Wa(n)}function Pf(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Lf(e){if(!Pf(e)&&typeof e!="number")return!1;const t=ot(e);return!isNaN(Number(t))}function Of(e){const t=ot(e),n=jn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const If={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"}},Mf=(e,t,n)=>{let r;const i=If[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function us(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Rf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qf={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Hf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Uf={date:us({formats:Rf,defaultWidth:"full"}),time:us({formats:qf,defaultWidth:"full"}),dateTime:us({formats:Hf,defaultWidth:"full"})},Wf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Vf=(e,t,n,r)=>Wf[e];function Gr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const u=e.defaultFormattingWidth||e.defaultWidth,c=n!=null&&n.width?String(n.width):u;i=e.formattingValues[c]||e.formattingValues[u]}else{const u=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[c]||e.values[u]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const zf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Gf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Yf={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"]},Kf={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"]},Jf={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"}},Xf={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"}},Qf=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Zf={ordinalNumber:Qf,era:Gr({values:zf,defaultWidth:"wide"}),quarter:Gr({values:Gf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Gr({values:Yf,defaultWidth:"wide"}),day:Gr({values:Kf,defaultWidth:"wide"}),dayPeriod:Gr({values:Jf,defaultWidth:"wide",formattingValues:Xf,defaultFormattingWidth:"wide"})};function Yr(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const u=o[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(c)?tm(c,v=>v.test(u)):em(c,v=>v.test(u));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const m=t.slice(u.length);return{value:h,rest:m}}}function em(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function tm(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function nm(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let u=e.valueCallback?e.valueCallback(o[0]):o[0];u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}const rm=/^(\d+)(th|st|nd|rd)?/i,am=/\d+/i,im={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},sm={any:[/^b/i,/^(a|c)/i]},om={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lm={any:[/1/i,/2/i,/3/i,/4/i]},um={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},cm={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]},pm={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},dm={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]},hm={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},fm={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}},mm={ordinalNumber:nm({matchPattern:rm,parsePattern:am,valueCallback:e=>parseInt(e,10)}),era:Yr({matchPatterns:im,defaultMatchWidth:"wide",parsePatterns:sm,defaultParseWidth:"any"}),quarter:Yr({matchPatterns:om,defaultMatchWidth:"wide",parsePatterns:lm,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Yr({matchPatterns:um,defaultMatchWidth:"wide",parsePatterns:cm,defaultParseWidth:"any"}),day:Yr({matchPatterns:pm,defaultMatchWidth:"wide",parsePatterns:dm,defaultParseWidth:"any"}),dayPeriod:Yr({matchPatterns:hm,defaultMatchWidth:"any",parsePatterns:fm,defaultParseWidth:"any"})},gm={code:"en-US",formatDistance:Mf,formatLong:Uf,formatRelative:Vf,localize:Zf,match:mm,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vm(e){const t=ot(e);return Nf(t,Of(t))+1}function ym(e){const t=ot(e),n=+Wa(t)-+jf(t);return Math.round(n/Il)+1}function Ce(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const dn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ce(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ce(n+1,2)},d(e,t){return Ce(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ce(e.getHours()%12||12,t.length)},H(e,t){return Ce(e.getHours(),t.length)},m(e,t){return Ce(e.getMinutes(),t.length)},s(e,t){return Ce(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ce(i,t.length)}},lr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Vl={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return dn.y(e,t)},Y:function(e,t,n,r){const i=Ml(e,r),o=i>0?i:1-i;if(t==="YY"){const u=o%100;return Ce(u,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Ce(o,t.length)},R:function(e,t){const n=Hl(e);return Ce(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ce(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ce(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ce(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return dn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ce(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=Rl(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ce(i,t.length)},I:function(e,t,n){const r=ym(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ce(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):dn.d(e,t)},D:function(e,t,n){const r=vm(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ce(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Ce(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Ce(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Ce(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=lr.noon:r===0?i=lr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=lr.evening:r>=12?i=lr.afternoon:r>=4?i=lr.morning:i=lr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return dn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):dn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ce(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ce(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):dn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):dn.s(e,t)},S:function(e,t){return dn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Gl(r);case"XXXX":case"XX":return In(r);case"XXXXX":case"XXX":default:return In(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Gl(r);case"xxxx":case"xx":return In(r);case"xxxxx":case"xxx":default:return In(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zl(r,":");case"OOOO":default:return"GMT"+In(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zl(r,":");case"zzzz":default:return"GMT"+In(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Ce(r,t.length)},T:function(e,t,n){const r=e.getTime();return Ce(r,t.length)}};function zl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Ce(o,2)}function Gl(e,t){return e%60===0?(e>0?"-":"+")+Ce(Math.abs(e)/60,2):In(e,t)}function In(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ce(Math.trunc(r/60),2),o=Ce(r%60,2);return n+i+t+o}const Yl=(e,t)=>{switch(e){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"})}},Kl=(e,t)=>{switch(e){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"})}},Dm=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Yl(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Yl(r,t)).replace("{{time}}",Kl(i,t))},bm={p:Kl,P:Dm},km=/^D+$/,wm=/^Y+$/,Cm=["D","DD","YY","YYYY"];function _m(e){return km.test(e)}function xm(e){return wm.test(e)}function Sm(e,t,n){const r=Em(e,t,n);if(console.warn(r),Cm.includes(e))throw new RangeError(r)}function Em(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Fm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Am=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$m=/^'([^]*?)'?$/,Tm=/''/g,Bm=/[a-zA-Z]/;function Nm(e,t,n){var r,i,o,u;const c=Ua(),d=c.locale??gm,h=c.firstWeekContainsDate??((i=(r=c.locale)==null?void 0:r.options)==null?void 0:i.firstWeekContainsDate)??1,m=c.weekStartsOn??((u=(o=c.locale)==null?void 0:o.options)==null?void 0:u.weekStartsOn)??0,v=ot(e);if(!Lf(v))throw new RangeError("Invalid time value");let y=t.match(Am).map(k=>{const x=k[0];if(x==="p"||x==="P"){const C=bm[x];return C(k,d.formatLong)}return k}).join("").match(Fm).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const x=k[0];if(x==="'")return{isToken:!1,value:jm(k)};if(Vl[x])return{isToken:!0,value:k};if(x.match(Bm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:k}});d.localize.preprocessor&&(y=d.localize.preprocessor(v,y));const b={firstWeekContainsDate:h,weekStartsOn:m,locale:d};return y.map(k=>{if(!k.isToken)return k.value;const x=k.value;(xm(x)||_m(x))&&Sm(x,t,String(e));const C=Vl[x[0]];return C(v,x,d.localize,b)}).join("")}function jm(e){const t=e.match($m);return t?t[1].replace(Tm,"'"):e}/**
|
|
385
386
|
* @license
|
|
386
387
|
* Copyright 2017 Google LLC
|
|
387
388
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
388
|
-
*/const Jl=(e,t,n)=>{const r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},Pm=qr(class extends Oa{constructor(e){if(super(e),e.type!==La.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);const i=[],o=[];let u=0;for(const c of e)i[u]=r?r(c,u):u,o[u]=n(c,u),u++;return{values:o,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){const i=Lh(e),{values:o,keys:u}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=u,o;const c=this.ut??(this.ut=[]),d=[];let h,m,v=0,y=i.length-1,b=0,k=o.length-1;for(;v<=y&&b<=k;)if(i[v]===null)v++;else if(i[y]===null)y--;else if(c[v]===u[b])d[b]=Bn(i[v],o[b]),v++,b++;else if(c[y]===u[k])d[k]=Bn(i[y],o[k]),y--,k--;else if(c[v]===u[k])d[k]=Bn(i[v],o[k]),Hr(e,d[k+1],i[v]),v++,k--;else if(c[y]===u[b])d[b]=Bn(i[y],o[b]),Hr(e,i[v],i[y]),y--,b++;else if(h===void 0&&(h=Jl(u,b,k),m=Jl(c,v,y)),h.has(c[v]))if(h.has(c[y])){const x=m.get(u[b]),C=x!==void 0?i[x]:null;if(C===null){const T=Hr(e,i[v]);Bn(T,o[b]),d[b]=T}else d[b]=Bn(C,o[b]),Hr(e,i[v],C),i[x]=null;b++}else rs(i[y]),y--;else rs(i[v]),v++;for(;b<=k;){const x=Hr(e,d[k+1]);Bn(x,o[b]),d[b++]=x}for(;v<=y;){const x=i[v++];x!==null&&rs(x)}return this.ut=u,Ph(e,d),Yt}}),Lm="pkt-datepicker",Om=!0,Im={name:{type:"string",name:"Navn",description:"Navn som sendes brukes i skjema ved innsending"},label:{type:"string",name:"Etikett",description:"Tekst som vises over datovelgeren"},helptext:{type:"string",name:"Hjelpetekst",description:"Hjelpetekst som vises over datovelgeren"},helptextDropdown:{type:"string",name:"Utvidet hjelpetekst",description:"Hjelpetekst som vises i en lukket boks man kan åpne"},helptextDropdownButton:{type:"string",name:"Knappetekst for hjelpetekst",description:"Tekst som vises på knappen for å åpne/lukke utvidet hjelpetekst",default:"Les mer"},dateformat:{name:"Datoformat",description:"Datoformat for valgte datoer i flervalgsmodus",type:"string",default:"dd.MM.yyyy"},currentmonth:{name:"Nåværende måned",type:"ISOdatestring",description:"Måneden som skal vises i datovelgeren"},value:{name:"Verdi",type:"ISOdatestring",variant:"multiple",reflect:!0,description:"Kommaseparert liste av valgte datoer"},excludeweekdays:{name:"Utelat ukedager",type:"string",description:"Kommaseparert liste over ukedager (1-7) som skal ekskluderes"},excludedates:{name:"Utelat datoer",type:"ISOdatestring",variant:"multiple",description:"Kommaseparert liste over datoer som skal ekskluderes"},min:{name:"Tidligst tillatt",type:"ISOdatestring",default:null,description:"Første tillate dato i datovelgeren"},max:{name:"Senest tillatt",type:"ISOdatestring",default:null,description:"Siste tillate dato i datovelgeren"},weeknumbers:{name:"Vis ukenummer",type:"boolean",reflect:!0,default:!1,description:"Vis ukedager i datovelgerens kalender"},withcontrols:{name:"Med kontroller",type:"boolean",reflect:!0,default:!1,description:"Vis avanserte velgere for måned og år"},multiple:{name:"Flervalg",type:"boolean",reflect:!0,default:!1,description:"Tillat valg av flere enn én dato i samme velger"},maxlength:{name:"Maks antall",description:"Maks valgte datoer i flervalgsmodus",type:"number",default:4},range:{name:"Datotidsrom",type:"boolean",reflect:!0,default:!1,description:"Tillat å velge et tidsrom mellom to datoer i samme velger"},hasError:{type:"boolean",name:"Feil",description:"Viser feiltilstand for datovelgeren"},errorMessage:{type:"string",name:"Feilmelding",description:"Tekst som vises under datovelgeren ved feiltilstand"},disabled:{type:"boolean",name:"Deaktivert",default:!1,reflect:!0,description:"Er datovelgeren deaktivert?"},fullwidth:{type:"boolean",name:"Full bredde",default:!1,reflect:!0,description:"Skal datovelgeren ta opp hele bredden?"},required:{type:"boolean",name:"Påkrevd",default:!1,reflect:!0,description:"Er datovelgeren påkrevd?"},requiredTag:{type:"boolean",name:"Vise påkrevd-merking",default:!1,description:"Viser en merking som indikerer at datovelgeren er påkrevd"},requiredText:{type:"string",name:"Påkrevd-tekst",default:"Må fylles ut",description:"Tekst som vises i påkrevd-merkingen"},optionalTag:{type:"boolean",name:"Vise valgfritt-merking",default:!1,description:"Viser en merking som indikerer at datovelgeren er valgfri"},optionalText:{type:"string",name:"Valgfritt-tekst",default:"Valgfritt",description:"Tekst som vises i valgfritt-merkingen"},useWrapper:{type:"boolean",name:"Bruk wrapper",description:"Indikerer at feltet skal ha synlig label og hjelpetekst",default:!0},id:{type:"string",name:"ID",description:"Unik identifikasjon for datovelgeren"}},Mm={change:{type:"Event",description:"Returnerer valgt dato som streng i ISO-format"},"value-change":{type:"CustomEvent",description:"Returnerer en <code>array</code> med valgte datoer i ISO-format"},toggleHelpText:{type:"CustomEvent",description:"Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"}},Xt={name:Lm,"css-class":"pkt-datepicker",isElement:Om,props:Im,events:Mm};var Rm=Object.defineProperty,qm=Object.getOwnPropertyDescriptor,Ue=(e,t,n,r)=>{for(var i=r>1?void 0:r?qm(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Rm(t,n,i),i};const Xl=e=>new Promise(t=>setTimeout(t,e));let Oe=class extends Ye{constructor(){super(...arguments),this.value="",this._value=this.value?Array.isArray(this.value)?this.value:this.value.split(","):[],this.label="Datovelger",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Xt.props.helptextDropdownButton.default,this.dateformat=Xt.props.dateformat.default,this.multiple=Xt.props.multiple.default,this.maxlength=Xt.props.maxlength.default,this.range=Xt.props.range.default,this.weeknumbers=Xt.props.weeknumbers.default,this.withcontrols=Xt.props.withcontrols.default,this.fullwidth=!1,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.useWrapper=!0,this.calendarOpen=!1,this.inputRef=vt(),this.inputRefTo=vt(),this.btnRef=vt(),this.calRef=vt(),this.popupRef=vt(),this.inputClasses={"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":this.fullwidth},this.buttonClasses={"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0},this.fromISOToDate=e=>{if(!e)return null;const t=new Date(e);return t.setHours(12,0,0,0),isNaN(t.getTime())?null:t},this.fromISOtoLocal=e=>{const t=new Date(e);return isNaN(t.getTime())?"":Nm(t,this.dateformat)},this.massageDates=e=>{const t=e.map(n=>n??void 0);return this.multiple?t:this.range?t.slice(0,2):[t[0]]},this.addToSelected=e=>{const t=e.target,n=this.min?new Date(this.min):null,r=this.max?new Date(this.max):null,i=new Date(t.value.split(",")[0]);i.setHours(12,0,0,0),i&&!isNaN(i.getTime())&&(!n||i>=n)&&(!r||i<=r)&&this.calRef.value&&this.calRef.value.handleDateSelect(i),t.value=""}}async connectedCallback(){super.connectedCallback(),this.isMobileSafari=/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/),this.inputType=this.isMobileSafari?"text":"date",document&&document.body.addEventListener("click",e=>{var t,n;(t=this.inputRef)!=null&&t.value&&(n=this.btnRef)!=null&&n.value&&!this.inputRef.value.contains(e.target)&&!(this.inputRefTo.value&&this.inputRefTo.value.contains(e.target))&&!this.btnRef.value.contains(e.target)&&!e.target.closest(".pkt-calendar-popup")&&this.calendarOpen&&(this.onBlur(),this.hideCalendar())}),this.value.length&&this._value.length===0&&(this._value=Array.isArray(this.value)?this.value:this.value.split(",")),this.min=this.min||Xt.props.min.default,this.max=this.max||Xt.props.max.default,typeof this.excludedates=="string"&&(this.excludedates=this.excludedates.split(",")),typeof this.excludeweekdays=="string"&&(this.excludeweekdays=this.excludeweekdays.split(",")),(this.multiple||this.range)&&this.name&&!this.name.endsWith("[]")&&(this.name=this.name+"[]"),this.calendarOpen&&(await Xl(20),this.handleCalendarPosition())}disconnectedCallback(){super.disconnectedCallback(),document&&document.body.removeEventListener("click",e=>{var t,n;(t=this.inputRef)!=null&&t.value&&(n=this.btnRef)!=null&&n.value&&!this.inputRef.value.contains(e.target)&&!this.btnRef.value.contains(e.target)&&this.hideCalendar()})}attributeChangedCallback(e,t,n){e==="value"&&this.valueChanged(this.value,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=(n==null?void 0:n.split(","))??[]),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=(n==null?void 0:n.split(","))??[]),super.attributeChangedCallback(e,t,n)}firstUpdated(e){super.firstUpdated(e)}updated(e){if(super.updated(e),e.has("value")){if(this.range&&this._value.length===1)return;this.valueChanged(this.value,e.get("value"))}}formatISODate(e){return e.toISOString().split("T")[0]}renderInput(){return
|
|
389
|
+
*/const Jl=(e,t,n)=>{const r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},Pm=qr(class extends Oa{constructor(e){if(super(e),e.type!==La.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);const i=[],o=[];let u=0;for(const c of e)i[u]=r?r(c,u):u,o[u]=n(c,u),u++;return{values:o,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){const i=Lh(e),{values:o,keys:u}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=u,o;const c=this.ut??(this.ut=[]),d=[];let h,m,v=0,y=i.length-1,b=0,k=o.length-1;for(;v<=y&&b<=k;)if(i[v]===null)v++;else if(i[y]===null)y--;else if(c[v]===u[b])d[b]=Bn(i[v],o[b]),v++,b++;else if(c[y]===u[k])d[k]=Bn(i[y],o[k]),y--,k--;else if(c[v]===u[k])d[k]=Bn(i[v],o[k]),Hr(e,d[k+1],i[v]),v++,k--;else if(c[y]===u[b])d[b]=Bn(i[y],o[b]),Hr(e,i[v],i[y]),y--,b++;else if(h===void 0&&(h=Jl(u,b,k),m=Jl(c,v,y)),h.has(c[v]))if(h.has(c[y])){const x=m.get(u[b]),C=x!==void 0?i[x]:null;if(C===null){const T=Hr(e,i[v]);Bn(T,o[b]),d[b]=T}else d[b]=Bn(C,o[b]),Hr(e,i[v],C),i[x]=null;b++}else rs(i[y]),y--;else rs(i[v]),v++;for(;b<=k;){const x=Hr(e,d[k+1]);Bn(x,o[b]),d[b++]=x}for(;v<=y;){const x=i[v++];x!==null&&rs(x)}return this.ut=u,Ph(e,d),Yt}}),Lm="pkt-datepicker",Om=!0,Im={name:{type:"string",name:"Navn",description:"Navn som sendes brukes i skjema ved innsending"},label:{type:"string",name:"Etikett",description:"Tekst som vises over datovelgeren"},helptext:{type:"string",name:"Hjelpetekst",description:"Hjelpetekst som vises over datovelgeren"},helptextDropdown:{type:"string",name:"Utvidet hjelpetekst",description:"Hjelpetekst som vises i en lukket boks man kan åpne"},helptextDropdownButton:{type:"string",name:"Knappetekst for hjelpetekst",description:"Tekst som vises på knappen for å åpne/lukke utvidet hjelpetekst",default:"Les mer"},dateformat:{name:"Datoformat",description:"Datoformat for valgte datoer i flervalgsmodus",type:"string",default:"dd.MM.yyyy"},currentmonth:{name:"Nåværende måned",type:"ISOdatestring",description:"Måneden som skal vises i datovelgeren"},value:{name:"Verdi",type:"ISOdatestring",variant:"multiple",reflect:!0,description:"Kommaseparert liste av valgte datoer"},excludeweekdays:{name:"Utelat ukedager",type:"string",description:"Kommaseparert liste over ukedager (1-7) som skal ekskluderes"},excludedates:{name:"Utelat datoer",type:"ISOdatestring",variant:"multiple",description:"Kommaseparert liste over datoer som skal ekskluderes"},min:{name:"Tidligst tillatt",type:"ISOdatestring",default:null,description:"Første tillate dato i datovelgeren"},max:{name:"Senest tillatt",type:"ISOdatestring",default:null,description:"Siste tillate dato i datovelgeren"},weeknumbers:{name:"Vis ukenummer",type:"boolean",reflect:!0,default:!1,description:"Vis ukedager i datovelgerens kalender"},withcontrols:{name:"Med kontroller",type:"boolean",reflect:!0,default:!1,description:"Vis avanserte velgere for måned og år"},multiple:{name:"Flervalg",type:"boolean",reflect:!0,default:!1,description:"Tillat valg av flere enn én dato i samme velger"},maxlength:{name:"Maks antall",description:"Maks valgte datoer i flervalgsmodus",type:"number",default:4},range:{name:"Datotidsrom",type:"boolean",reflect:!0,default:!1,description:"Tillat å velge et tidsrom mellom to datoer i samme velger"},hasError:{type:"boolean",name:"Feil",description:"Viser feiltilstand for datovelgeren"},errorMessage:{type:"string",name:"Feilmelding",description:"Tekst som vises under datovelgeren ved feiltilstand"},disabled:{type:"boolean",name:"Deaktivert",default:!1,reflect:!0,description:"Er datovelgeren deaktivert?"},fullwidth:{type:"boolean",name:"Full bredde",default:!1,reflect:!0,description:"Skal datovelgeren ta opp hele bredden?"},required:{type:"boolean",name:"Påkrevd",default:!1,reflect:!0,description:"Er datovelgeren påkrevd?"},requiredTag:{type:"boolean",name:"Vise påkrevd-merking",default:!1,description:"Viser en merking som indikerer at datovelgeren er påkrevd"},requiredText:{type:"string",name:"Påkrevd-tekst",default:"Må fylles ut",description:"Tekst som vises i påkrevd-merkingen"},optionalTag:{type:"boolean",name:"Vise valgfritt-merking",default:!1,description:"Viser en merking som indikerer at datovelgeren er valgfri"},optionalText:{type:"string",name:"Valgfritt-tekst",default:"Valgfritt",description:"Tekst som vises i valgfritt-merkingen"},useWrapper:{type:"boolean",name:"Bruk wrapper",description:"Indikerer at feltet skal ha synlig label og hjelpetekst",default:!0},id:{type:"string",name:"ID",description:"Unik identifikasjon for datovelgeren"}},Mm={change:{type:"Event",description:"Returnerer valgt dato som streng i ISO-format"},"value-change":{type:"CustomEvent",description:"Returnerer en <code>array</code> med valgte datoer i ISO-format"},toggleHelpText:{type:"CustomEvent",description:"Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"}},Xt={name:Lm,"css-class":"pkt-datepicker",isElement:Om,props:Im,events:Mm};var Rm=Object.defineProperty,qm=Object.getOwnPropertyDescriptor,Ue=(e,t,n,r)=>{for(var i=r>1?void 0:r?qm(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Rm(t,n,i),i};const Xl=e=>new Promise(t=>setTimeout(t,e));let Oe=class extends Ye{constructor(){super(...arguments),this.value="",this._value=this.value?Array.isArray(this.value)?this.value:this.value.split(","):[],this.label="Datovelger",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Xt.props.helptextDropdownButton.default,this.dateformat=Xt.props.dateformat.default,this.multiple=Xt.props.multiple.default,this.maxlength=Xt.props.maxlength.default,this.range=Xt.props.range.default,this.weeknumbers=Xt.props.weeknumbers.default,this.withcontrols=Xt.props.withcontrols.default,this.fullwidth=!1,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.useWrapper=!0,this.calendarOpen=!1,this.inputRef=vt(),this.inputRefTo=vt(),this.btnRef=vt(),this.calRef=vt(),this.popupRef=vt(),this.inputClasses={"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":this.fullwidth},this.buttonClasses={"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0},this.fromISOToDate=e=>{if(!e)return null;const t=new Date(e);return t.setHours(12,0,0,0),isNaN(t.getTime())?null:t},this.fromISOtoLocal=e=>{const t=new Date(e);return isNaN(t.getTime())?"":Nm(t,this.dateformat)},this.massageDates=e=>{const t=e.map(n=>n??void 0);return this.multiple?t:this.range?t.slice(0,2):[t[0]]},this.addToSelected=e=>{const t=e.target,n=this.min?new Date(this.min):null,r=this.max?new Date(this.max):null,i=new Date(t.value.split(",")[0]);i.setHours(12,0,0,0),i&&!isNaN(i.getTime())&&(!n||i>=n)&&(!r||i<=r)&&this.calRef.value&&this.calRef.value.handleDateSelect(i),t.value=""}}async connectedCallback(){super.connectedCallback(),this.isMobileSafari=/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/),this.inputType=this.isMobileSafari?"text":"date",document&&document.body.addEventListener("click",e=>{var t,n;(t=this.inputRef)!=null&&t.value&&(n=this.btnRef)!=null&&n.value&&!this.inputRef.value.contains(e.target)&&!(this.inputRefTo.value&&this.inputRefTo.value.contains(e.target))&&!this.btnRef.value.contains(e.target)&&!e.target.closest(".pkt-calendar-popup")&&this.calendarOpen&&(this.onBlur(),this.hideCalendar())}),this.value.length&&this._value.length===0&&(this._value=Array.isArray(this.value)?this.value:this.value.split(",")),this.min=this.min||Xt.props.min.default,this.max=this.max||Xt.props.max.default,typeof this.excludedates=="string"&&(this.excludedates=this.excludedates.split(",")),typeof this.excludeweekdays=="string"&&(this.excludeweekdays=this.excludeweekdays.split(",")),(this.multiple||this.range)&&this.name&&!this.name.endsWith("[]")&&(this.name=this.name+"[]"),this.calendarOpen&&(await Xl(20),this.handleCalendarPosition())}disconnectedCallback(){super.disconnectedCallback(),document&&document.body.removeEventListener("click",e=>{var t,n;(t=this.inputRef)!=null&&t.value&&(n=this.btnRef)!=null&&n.value&&!this.inputRef.value.contains(e.target)&&!this.btnRef.value.contains(e.target)&&this.hideCalendar()})}attributeChangedCallback(e,t,n){e==="value"&&this.valueChanged(this.value,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=(n==null?void 0:n.split(","))??[]),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=(n==null?void 0:n.split(","))??[]),super.attributeChangedCallback(e,t,n)}firstUpdated(e){super.firstUpdated(e)}updated(e){if(super.updated(e),e.has("value")){if(this.range&&this._value.length===1)return;this.valueChanged(this.value,e.get("value"))}}formatISODate(e){return e.toISOString().split("T")[0]}renderInput(){return z`
|
|
389
390
|
<input
|
|
390
391
|
class="${He(this.inputClasses)}"
|
|
391
392
|
.type=${this.inputType}
|
|
@@ -402,7 +403,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
402
403
|
@change=${e=>{e.stopImmediatePropagation()}}
|
|
403
404
|
${rt(this.inputRef)}
|
|
404
405
|
/>
|
|
405
|
-
`}renderRangeInput(){return
|
|
406
|
+
`}renderRangeInput(){return z`
|
|
406
407
|
<div class="pkt-input-prefix">Fra</div>
|
|
407
408
|
<input
|
|
408
409
|
class=${He(this.inputClasses)}
|
|
@@ -438,7 +439,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
438
439
|
@change=${e=>{e.stopImmediatePropagation()}}
|
|
439
440
|
${rt(this.inputRefTo)}
|
|
440
441
|
/>
|
|
441
|
-
`}renderMultipleInput(){return
|
|
442
|
+
`}renderMultipleInput(){return z`
|
|
442
443
|
<input
|
|
443
444
|
class=${He(this.inputClasses)}
|
|
444
445
|
.type=${this.inputType}
|
|
@@ -454,9 +455,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
454
455
|
@change=${e=>{e.stopImmediatePropagation()}}
|
|
455
456
|
${rt(this.inputRef)}
|
|
456
457
|
/>
|
|
457
|
-
`}renderTags(){return
|
|
458
|
+
`}renderTags(){return z`
|
|
458
459
|
<div class="pkt-datepicker__tags" aria-live="polite">
|
|
459
|
-
${this._value[0]?Pm(this._value??[],e=>e,e=>
|
|
460
|
+
${this._value[0]?Pm(this._value??[],e=>e,e=>z`
|
|
460
461
|
<pkt-tag
|
|
461
462
|
.id="${this.id+e+"-tag"}"
|
|
462
463
|
closeTag
|
|
@@ -466,7 +467,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
466
467
|
>
|
|
467
468
|
`):ne}
|
|
468
469
|
</div>
|
|
469
|
-
`}renderCalendar(){return
|
|
470
|
+
`}renderCalendar(){return z`<div
|
|
470
471
|
class="pkt-calendar-popup pkt-${this.calendarOpen?"show":"hide"}"
|
|
471
472
|
@focusout=${e=>{this.calendarOpen&&this.handleFocusOut(e)}}
|
|
472
473
|
id="${this.id}-popup"
|
|
@@ -489,7 +490,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
489
490
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
490
491
|
${rt(this.calRef)}
|
|
491
492
|
></pkt-calendar>
|
|
492
|
-
</div>`}render(){return
|
|
493
|
+
</div>`}render(){return z`
|
|
493
494
|
<pkt-input-wrapper
|
|
494
495
|
label="${this.label}"
|
|
495
496
|
forId="${this.id}-input"
|
|
@@ -528,15 +529,15 @@ React keys must be passed directly to JSX without using spread:
|
|
|
528
529
|
</div>
|
|
529
530
|
</pkt-input-wrapper>
|
|
530
531
|
${this.renderCalendar()}
|
|
531
|
-
`}handleCalendarPosition(){var e;if(this.popupRef.value&&this.inputRef.value){const t=this.multiple&&!!this.maxlength,n=((e=this.inputRef.value.parentElement)==null?void 0:e.getBoundingClientRect())||this.inputRef.value.getBoundingClientRect(),r=t?n.height+30:n.height,i=this.popupRef.value.getBoundingClientRect().height;let o=t?"calc(100% - 30px)":"100%";n&&n.top+i>window.innerHeight&&n.top-i>0&&(o=`calc(100% - ${r}px - ${i}px)`),this.popupRef.value.style.top=o}}handleFocusOut(e){this.contains(e.target)||(this.onBlur(),this.hideCalendar())}async showCalendar(){var e;this.calendarOpen=!0,await Xl(20),this.handleCalendarPosition(),this.isMobileSafari&&((e=this.calRef.value)==null||e.focusOnCurrentDate())}hideCalendar(){this.calendarOpen=!1}async toggleCalendar(e){e.preventDefault(),this.calendarOpen?this.hideCalendar():this.showCalendar()}};Ue([O({type:String,reflect:!0})],Oe.prototype,"value",2),Ue([O({type:Array,reflect:!1})],Oe.prototype,"_value",2),Ue([O({type:String})],Oe.prototype,"label",2),Ue([O({type:String})],Oe.prototype,"helptext",2),Ue([O({type:String})],Oe.prototype,"helptextDropdown",2),Ue([O({type:String})],Oe.prototype,"helptextDropdownButton",2),Ue([O({type:String})],Oe.prototype,"dateformat",2),Ue([O({type:Boolean,reflect:!0})],Oe.prototype,"multiple",2),Ue([O({type:Number})],Oe.prototype,"maxlength",2),Ue([O({type:Boolean,reflect:!0})],Oe.prototype,"range",2),Ue([O({type:Boolean})],Oe.prototype,"weeknumbers",2),Ue([O({type:Boolean})],Oe.prototype,"withcontrols",2),Ue([O({type:Boolean})],Oe.prototype,"fullwidth",2),Ue([O({converter:ar.csvToArray})],Oe.prototype,"excludedates",2),Ue([O({converter:ar.csvToArray})],Oe.prototype,"excludeweekdays",2),Ue([O({type:String})],Oe.prototype,"currentmonth",2),Ue([O({type:Boolean})],Oe.prototype,"useWrapper",2),Ue([O({type:Boolean,reflect:!0})],Oe.prototype,"calendarOpen",2),Oe=Ue([Nt("pkt-datepicker")],Oe);const Hm="pkt-link",Um=!0,Wm={href:{name:"URL",description:"URL til lenken",type:"string",default:"#"},target:{name:"Mål",description:"Mål for lenken",type:["_blank","_self","_parent","_top"],default:"_self"},iconName:{name:"Ikon",description:"Ikon som skal vises ved siden av lenketeksten",type:"icon"},iconPosition:{name:"Ikonposisjon",description:"Posisjonen til ikonet i forhold til lenketeksten",type:["left","right"]},external:{name:"Ekstern lenke",description:"Vis ikon for ekstern lenke",type:"boolean",default:!1}},Vm={default:{description:"Innholdet i lenken"}},cs={name:Hm,"css-class":"pkt-link","dark-mode":!0,isElement:Um,props:Wm,slots:Vm};var zm=Object.defineProperty,Gm=Object.getOwnPropertyDescriptor,ur=(e,t,n,r)=>{for(var i=r>1?void 0:r?Gm(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&zm(t,n,i),i};let hn=class extends St{constructor(){super(),this.defaultSlot=vt(),this.href=cs.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=cs.props.external.default,this.target=cs.props.target.default,this.slotController=new Tn(this,this.defaultSlot)}render(){const e={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return
|
|
532
|
+
`}handleCalendarPosition(){var e;if(this.popupRef.value&&this.inputRef.value){const t=this.multiple&&!!this.maxlength,n=((e=this.inputRef.value.parentElement)==null?void 0:e.getBoundingClientRect())||this.inputRef.value.getBoundingClientRect(),r=t?n.height+30:n.height,i=this.popupRef.value.getBoundingClientRect().height;let o=t?"calc(100% - 30px)":"100%";n&&n.top+i>window.innerHeight&&n.top-i>0&&(o=`calc(100% - ${r}px - ${i}px)`),this.popupRef.value.style.top=o}}handleFocusOut(e){this.contains(e.target)||(this.onBlur(),this.hideCalendar())}async showCalendar(){var e;this.calendarOpen=!0,await Xl(20),this.handleCalendarPosition(),this.isMobileSafari&&((e=this.calRef.value)==null||e.focusOnCurrentDate())}hideCalendar(){this.calendarOpen=!1}async toggleCalendar(e){e.preventDefault(),this.calendarOpen?this.hideCalendar():this.showCalendar()}};Ue([O({type:String,reflect:!0})],Oe.prototype,"value",2),Ue([O({type:Array,reflect:!1})],Oe.prototype,"_value",2),Ue([O({type:String})],Oe.prototype,"label",2),Ue([O({type:String})],Oe.prototype,"helptext",2),Ue([O({type:String})],Oe.prototype,"helptextDropdown",2),Ue([O({type:String})],Oe.prototype,"helptextDropdownButton",2),Ue([O({type:String})],Oe.prototype,"dateformat",2),Ue([O({type:Boolean,reflect:!0})],Oe.prototype,"multiple",2),Ue([O({type:Number})],Oe.prototype,"maxlength",2),Ue([O({type:Boolean,reflect:!0})],Oe.prototype,"range",2),Ue([O({type:Boolean})],Oe.prototype,"weeknumbers",2),Ue([O({type:Boolean})],Oe.prototype,"withcontrols",2),Ue([O({type:Boolean})],Oe.prototype,"fullwidth",2),Ue([O({converter:ar.csvToArray})],Oe.prototype,"excludedates",2),Ue([O({converter:ar.csvToArray})],Oe.prototype,"excludeweekdays",2),Ue([O({type:String})],Oe.prototype,"currentmonth",2),Ue([O({type:Boolean})],Oe.prototype,"useWrapper",2),Ue([O({type:Boolean,reflect:!0})],Oe.prototype,"calendarOpen",2),Oe=Ue([Nt("pkt-datepicker")],Oe);const Hm="pkt-link",Um=!0,Wm={href:{name:"URL",description:"URL til lenken",type:"string",default:"#"},target:{name:"Mål",description:"Mål for lenken",type:["_blank","_self","_parent","_top"],default:"_self"},iconName:{name:"Ikon",description:"Ikon som skal vises ved siden av lenketeksten",type:"icon"},iconPosition:{name:"Ikonposisjon",description:"Posisjonen til ikonet i forhold til lenketeksten",type:["left","right"]},external:{name:"Ekstern lenke",description:"Vis ikon for ekstern lenke",type:"boolean",default:!1}},Vm={default:{description:"Innholdet i lenken"}},cs={name:Hm,"css-class":"pkt-link","dark-mode":!0,isElement:Um,props:Wm,slots:Vm};var zm=Object.defineProperty,Gm=Object.getOwnPropertyDescriptor,ur=(e,t,n,r)=>{for(var i=r>1?void 0:r?Gm(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&zm(t,n,i),i};let hn=class extends St{constructor(){super(),this.defaultSlot=vt(),this.href=cs.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=cs.props.external.default,this.target=cs.props.target.default,this.slotController=new Tn(this,this.defaultSlot)}render(){const e={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return z`<a
|
|
532
533
|
class=${He(e)}
|
|
533
534
|
href=${this.href}
|
|
534
535
|
@click=${this.handleClick}
|
|
535
536
|
.target=${this.target}
|
|
536
537
|
.rel=${this.external?"noopener noreferrer":ne}
|
|
537
|
-
>${this.iconName?
|
|
538
|
-
>`}handleClick(){this.dispatchEvent(new CustomEvent("click",{detail:"pkt-link-clicked",bubbles:!0}))}};ur([O({type:String,reflect:!0})],hn.prototype,"href",2),ur([O({type:String,reflect:!0})],hn.prototype,"iconName",2),ur([O({type:String,reflect:!0})],hn.prototype,"iconPosition",2),ur([O({type:Boolean,reflect:!0})],hn.prototype,"external",2),ur([O({type:String,reflect:!0})],hn.prototype,"target",2),hn=ur([Nt("pkt-link")],hn);const Ym="pkt-messagebox",Km=!0,Jm={onClose:{description:"React: Event som trigges når meldingsboksen lukkes"},"on-close":{description:"Vue: Event som trigges når meldingsboksen lukkes"}},Xm={title:{name:"Tittel",description:"Tittelen på meldingsboksen",type:"string"},skin:{name:"Utseende",description:"Velg farge på meldingsboksen",type:["beige","blue","red","green"],default:"beige"},compact:{name:"Kompakt",description:"Gjør meldingsboksen mindre",type:"boolean",default:!1},closable:{name:"Kan lukkes",description:"Viser lukkeknapp",type:"boolean",default:!1}},Qm={default:{description:"Innholdet i meldingsboksen"}},ps={name:Ym,"css-class":"pkt-messagebox",isElement:Km,events:Jm,props:Xm,slots:Qm};var Zm=Object.defineProperty,eg=Object.getOwnPropertyDescriptor,cr=(e,t,n,r)=>{for(var i=r>1?void 0:r?eg(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Zm(t,n,i),i};let fn=class extends St{constructor(){super(),this.defaultSlot=vt(),this.closable=ps.props.closable.default,this.compact=ps.props.compact.default,this.title="",this.skin=ps.props.skin.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0}))},this.slotController=new Tn(this,this.defaultSlot),this._isClosed=!1}render(){const e={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return
|
|
539
|
-
${this.closable?
|
|
538
|
+
>${this.iconName?z`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${rt(this.defaultSlot)}>Link</span></a
|
|
539
|
+
>`}handleClick(){this.dispatchEvent(new CustomEvent("click",{detail:"pkt-link-clicked",bubbles:!0}))}};ur([O({type:String,reflect:!0})],hn.prototype,"href",2),ur([O({type:String,reflect:!0})],hn.prototype,"iconName",2),ur([O({type:String,reflect:!0})],hn.prototype,"iconPosition",2),ur([O({type:Boolean,reflect:!0})],hn.prototype,"external",2),ur([O({type:String,reflect:!0})],hn.prototype,"target",2),hn=ur([Nt("pkt-link")],hn);const Ym="pkt-messagebox",Km=!0,Jm={onClose:{description:"React: Event som trigges når meldingsboksen lukkes"},"on-close":{description:"Vue: Event som trigges når meldingsboksen lukkes"}},Xm={title:{name:"Tittel",description:"Tittelen på meldingsboksen",type:"string"},skin:{name:"Utseende",description:"Velg farge på meldingsboksen",type:["beige","blue","red","green"],default:"beige"},compact:{name:"Kompakt",description:"Gjør meldingsboksen mindre",type:"boolean",default:!1},closable:{name:"Kan lukkes",description:"Viser lukkeknapp",type:"boolean",default:!1}},Qm={default:{description:"Innholdet i meldingsboksen"}},ps={name:Ym,"css-class":"pkt-messagebox",isElement:Km,events:Jm,props:Xm,slots:Qm};var Zm=Object.defineProperty,eg=Object.getOwnPropertyDescriptor,cr=(e,t,n,r)=>{for(var i=r>1?void 0:r?eg(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Zm(t,n,i),i};let fn=class extends St{constructor(){super(),this.defaultSlot=vt(),this.closable=ps.props.closable.default,this.compact=ps.props.compact.default,this.title="",this.skin=ps.props.skin.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0}))},this.slotController=new Tn(this,this.defaultSlot),this._isClosed=!1}render(){const e={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return z`<div class=${He(e)}>
|
|
540
|
+
${this.closable?z`<div class="pkt-messagebox__close">
|
|
540
541
|
<button
|
|
541
542
|
@click=${this.close}
|
|
542
543
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
@@ -544,7 +545,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
544
545
|
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
545
546
|
</button>
|
|
546
547
|
</div>`:ne}
|
|
547
|
-
${this.title?
|
|
548
|
+
${this.title?z`<div class="pkt-messagebox__title">${this.title}</div>`:ne}
|
|
548
549
|
<div class="pkt-messagebox__text" ${rt(this.defaultSlot)}></div>
|
|
549
550
|
</div>`}};cr([O({type:Boolean,reflect:!0})],fn.prototype,"closable",2),cr([O({type:Boolean,reflect:!0})],fn.prototype,"compact",2),cr([O({type:String,reflect:!0})],fn.prototype,"title",2),cr([O({type:String,reflect:!0})],fn.prototype,"skin",2),cr([It()],fn.prototype,"_isClosed",2),fn=cr([Nt("pkt-messagebox")],fn);const ce=Sn({tagName:"pkt-icon",elementClass:Nn,react:M,displayName:"PktIcon",events:{}});var Ql={exports:{}};/*!
|
|
550
551
|
Copyright (c) 2018 Jed Watson.
|
|
@@ -628,7 +629,7 @@ Expected it to be ${p}.`}var ae=class extends Error{constructor(s){super(me(s));
|
|
|
628
629
|
`)){if(l.length===0)continue;let p=Tt.getLeadingWhitespaceCount(l);if(p===0)return 0;l.length!==p&&p<s&&(s=p)}return s===Number.POSITIVE_INFINITY?0:s}function Jp(a,s=Mk(a)){return s===0?a:a.split(`
|
|
629
630
|
`).map(l=>l.slice(s)).join(`
|
|
630
631
|
`)}function Xp(a){return C(!1,C(!1,a,"'","'"),""",'"')}function Cn(a){return Xp(a.value)}var Rk=new Set(["template","style","script"]);function Ai(a,s){return Er(a,s)&&!Rk.has(a.fullName)}function Er(a,s){return s.parser==="vue"&&a.type==="element"&&a.parent.type==="root"&&a.fullName.toLowerCase()!=="html"}function Lo(a,s){return Er(a,s)&&(Ai(a,s)||a.attrMap.lang&&a.attrMap.lang!=="html")}function qk(a){let s=a.fullName;return s.charAt(0)==="#"||s==="slot-scope"||s==="v-slot"||s.startsWith("v-slot:")}function Hk(a,s){let l=a.parent;if(!Er(l,s))return!1;let p=l.fullName,f=a.fullName;return p==="script"&&f==="setup"||p==="style"&&f==="vars"}function Qp(a,s=a.value){return a.parent.isWhitespaceSensitive?a.parent.isIndentationSensitive?mt(s):mt(Jp(ie(s)),Ee):wn(_e,Tt.split(s))}function Zp(a,s){return Er(a,s)&&a.name==="script"}var ed=/\{\{(.+?)\}\}/su;async function Uk(a,s){let l=[];for(let[p,f]of a.split(ed).entries())if(p%2===0)l.push(mt(f));else try{l.push(ue(["{{",Fe([_e,await xt(f,s,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0})]),_e,"}}"]))}catch{l.push("{{",mt(f),"}}")}return l}function Oo({parser:a}){return(s,l,p)=>xt(Cn(p.node),s,{parser:a},un)}var Wk=Oo({parser:"__ng_action"}),Vk=Oo({parser:"__ng_binding"}),zk=Oo({parser:"__ng_directive"});function Gk(a,s){if(s.parser!=="angular")return;let{node:l}=a,p=l.fullName;if(p.startsWith("(")&&p.endsWith(")")||p.startsWith("on-"))return Wk;if(p.startsWith("[")&&p.endsWith("]")||/^bind(?:on)?-/u.test(p)||/^ng-(?:if|show|hide|class|style)$/u.test(p))return Vk;if(p.startsWith("*"))return zk;let f=Cn(l);if(/^i18n(?:-.+)?$/u.test(p))return()=>Xn(kt(Qp(l,f.trim())),!f.includes("@@"));if(ed.test(f))return D=>Uk(f,D)}var Yk=Gk;function Kk(a,s){let{node:l}=a,p=Cn(l);if(l.fullName==="class"&&!s.parentParser&&!p.includes("{{"))return()=>p.trim().split(/\s+/u).join(" ")}var Jk=Kk;function td(a){return a===" "||a===`
|
|
631
|
-
`||a==="\f"||a==="\r"||a===" "}var Xk=/^[ \t\n\r\u000c]+/,Qk=/^[, \t\n\r\u000c]+/,Zk=/^[^ \t\n\r\u000c]+/,e1=/[,]+$/,nd=/^\d+$/,t1=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function n1(a){let s=a.length,l,p,f,D,E,B=0,q;function K(pe){let Ae,Ve=pe.exec(a.substring(B));if(Ve)return[Ae]=Ve,B+=Ae.length,Ae}let W=[];for(;;){if(K(Qk),B>=s){if(W.length===0)throw new Error("Must contain one or more image candidate strings.");return W}q=B,l=K(Zk),p=[],l.slice(-1)===","?(l=l.replace(e1,""),ge()):we()}function we(){for(K(Xk),f="",D="in descriptor";;){if(E=a.charAt(B),D==="in descriptor")if(td(E))f&&(p.push(f),f="",D="after descriptor");else if(E===","){B+=1,f&&p.push(f),ge();return}else if(E==="(")f+=E,D="in parens";else if(E===""){f&&p.push(f),ge();return}else f+=E;else if(D==="in parens")if(E===")")f+=E,D="in descriptor";else if(E===""){p.push(f),ge();return}else f+=E;else if(D==="after descriptor"&&!td(E))if(E===""){ge();return}else D="in descriptor",B-=1;B+=1}}function ge(){let pe=!1,Ae,Ve,nt,st,z={},de,ze,qe,ct,Tr;for(st=0;st<p.length;st++)de=p[st],ze=de[de.length-1],qe=de.substring(0,de.length-1),ct=parseInt(qe,10),Tr=parseFloat(qe),nd.test(qe)&&ze==="w"?((Ae||Ve)&&(pe=!0),ct===0?pe=!0:Ae=ct):t1.test(qe)&&ze==="x"?((Ae||Ve||nt)&&(pe=!0),Tr<0?pe=!0:Ve=Tr):nd.test(qe)&&ze==="h"?((nt||Ve)&&(pe=!0),ct===0?pe=!0:nt=ct):pe=!0;if(!pe)z.source={value:l,startOffset:q},Ae&&(z.width={value:Ae}),Ve&&(z.density={value:Ve}),nt&&(z.height={value:nt}),W.push(z);else throw new Error(`Invalid srcset descriptor found in "${a}" at "${de}".`)}}var r1=n1;function a1(a){if(a.node.fullName==="srcset"&&(a.parent.fullName==="img"||a.parent.fullName==="source"))return()=>s1(Cn(a.node))}var rd={width:"w",height:"h",density:"x"},i1=Object.keys(rd);function s1(a){let s=r1(a),l=i1.filter(W=>s.some(we=>Object.prototype.hasOwnProperty.call(we,W)));if(l.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[p]=l,f=rd[p],D=s.map(W=>W.source.value),E=Math.max(...D.map(W=>W.length)),B=s.map(W=>W[p]?String(W[p].value):""),q=B.map(W=>{let we=W.indexOf(".");return we===-1?W.length:we}),K=Math.max(...q);return Xn(wn([",",_e],D.map((W,we)=>{let ge=[W],pe=B[we];if(pe){let Ae=E-W.length+1,Ve=K-q[we],nt=" ".repeat(Ae+Ve);ge.push(wt(nt," "),pe+f)}return ge})))}var o1=a1;function l1(a,s){let{node:l}=a,p=Cn(a.node).trim();if(l.fullName==="style"&&!s.parentParser&&!p.includes("{{"))return async f=>Xn(await f(p,{parser:"css",__isHTMLStyleAttribute:!0}))}var Io=new WeakMap;function u1(a,s){let{root:l}=a;return Io.has(l)||Io.set(l,l.children.some(p=>Zp(p,s)&&["ts","typescript"].includes(p.attrMap.lang))),Io.get(l)}var Mo=u1;function c1(a,s,l){let{node:p}=l,f=Cn(p);return xt(`type T<${f}> = any`,a,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},un)}function p1(a,s,{parseWithTs:l}){return xt(`function _(${a}) {}`,s,{parser:l?"babel-ts":"babel",__isVueBindings:!0})}function d1(a){let s=/^(?:[\w$]+|\([^)]*\))\s*=>|^function\s*\(/u,l=/^[$_a-z][\w$]*(?:\.[$_a-z][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\]|\[[$_a-z][\w$]*\])*$/iu,p=a.trim();return s.test(p)||l.test(p)}async function h1(a,s,l,p){let f=Cn(l.node),{left:D,operator:E,right:B}=f1(f),q=Mo(l,p);return[ue(await xt(`function _(${D}) {}`,a,{parser:q?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",E," ",await xt(B,a,{parser:q?"__ts_expression":"__js_expression"})]}function f1(a){let s=/(.*?)\s+(in|of)\s+(.*)/su,l=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,p=/^\(|\)$/gu,f=a.match(s);if(!f)return;let D={};if(D.for=f[3].trim(),!D.for)return;let E=C(!1,f[1].trim(),p,""),B=E.match(l);B?(D.alias=E.replace(l,""),D.iterator1=B[1].trim(),B[2]&&(D.iterator2=B[2].trim())):D.alias=E;let q=[D.alias,D.iterator1,D.iterator2];if(!q.some((K,W)=>!K&&(W===0||q.slice(W+1).some(Boolean))))return{left:q.filter(Boolean).join(","),operator:f[2],right:D.for}}function m1(a,s){if(s.parser!=="vue")return;let{node:l}=a,p=l.fullName;if(p==="v-for")return h1;if(p==="generic"&&Zp(l.parent,s))return c1;let f=Cn(l),D=Mo(a,s);if(qk(l)||Hk(l,s))return E=>p1(f,E,{parseWithTs:D});if(p.startsWith("@")||p.startsWith("v-on:"))return E=>g1(f,E,{parseWithTs:D});if(p.startsWith(":")||p.startsWith("v-bind:"))return E=>v1(f,E,{parseWithTs:D});if(p.startsWith("v-"))return E=>ad(f,E,{parseWithTs:D})}function g1(a,s,{parseWithTs:l}){return d1(a)?ad(a,s,{parseWithTs:l}):xt(a,s,{parser:l?"__vue_ts_event_binding":"__vue_event_binding"},un)}function v1(a,s,{parseWithTs:l}){return xt(a,s,{parser:l?"__vue_ts_expression":"__vue_expression"},un)}function ad(a,s,{parseWithTs:l}){return xt(a,s,{parser:l?"__ts_expression":"__js_expression"},un)}var y1=m1;function D1(a,s){let{node:l}=a;if(l.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(s.originalText.slice(l.valueSpan.start.offset,l.valueSpan.end.offset))||s.parser==="lwc"&&l.value.startsWith("{")&&l.value.endsWith("}"))return[l.rawName,"=",l.value];for(let p of[o1,l1,Jk,y1,Yk]){let f=p(a,s);if(f)return b1(f)}}}function b1(a){return async(s,l,p,f)=>{let D=await a(s,l,p,f);if(D)return D=ca(D,E=>typeof E=="string"?C(!1,E,'"',"""):E),[p.node.rawName,'="',ue(D),'"']}}var k1=D1,id=new Proxy(()=>{},{get:()=>id}),sd=id;function w1(a){return Array.isArray(a)&&a.length>0}var Ro=w1;function $i(a){return a.sourceSpan.start.offset}function Ti(a){return a.sourceSpan.end.offset}function qo(a,s){return[a.isSelfClosing?"":C1(a,s),ya(a,s)]}function C1(a,s){return a.lastChild&&ka(a.lastChild)?"":[_1(a,s),Ho(a,s)]}function ya(a,s){return(a.next?Zn(a.next):ba(a.parent))?"":[Da(a,s),Qn(a,s)]}function _1(a,s){return ba(a)?Da(a.lastChild,s):""}function Qn(a,s){return ka(a)?Ho(a.parent,s):Bi(a)?Wo(a.next):""}function Ho(a,s){if(sd(!a.isSelfClosing),od(a,s))return"";switch(a.type){case"ieConditionalComment":return"<!";case"element":if(a.hasHtmComponentClosingTag)return"<//";default:return`</${a.rawName}`}}function Da(a,s){if(od(a,s))return"";switch(a.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(a.isSelfClosing)return"/>";default:return">"}}function od(a,s){return!a.isSelfClosing&&!a.endSourceSpan&&(Te(a)||Be(a.parent,s))}function Zn(a){return a.prev&&a.prev.type!=="docType"&&a.type!=="angularControlFlowBlock"&&!We(a.prev)&&a.isLeadingSpaceSensitive&&!a.hasLeadingSpaces}function ba(a){var s;return((s=a.lastChild)==null?void 0:s.isTrailingSpaceSensitive)&&!a.lastChild.hasTrailingSpaces&&!We(Po(a.lastChild))&&!Sr(a)}function ka(a){return!a.next&&!a.hasTrailingSpaces&&a.isTrailingSpaceSensitive&&We(Po(a))}function Bi(a){return a.next&&!We(a.next)&&We(a)&&a.isTrailingSpaceSensitive&&!a.hasTrailingSpaces}function x1(a){let s=a.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return s?s[1]?s[1].split(/\s+/u):!0:!1}function Ni(a){return!a.prev&&a.isLeadingSpaceSensitive&&!a.hasLeadingSpaces}function S1(a,s,l){var p;let{node:f}=a;if(!Ro(f.attrs))return f.isSelfClosing?" ":"";let D=((p=f.prev)==null?void 0:p.type)==="comment"&&x1(f.prev.value),E=typeof D=="boolean"?()=>D:Array.isArray(D)?we=>D.includes(we.rawName):()=>!1,B=a.map(({node:we})=>E(we)?mt(s.originalText.slice($i(we),Ti(we))):l(),"attrs"),q=f.type==="element"&&f.fullName==="script"&&f.attrs.length===1&&f.attrs[0].fullName==="src"&&f.children.length===0,K=s.singleAttributePerLine&&f.attrs.length>1&&!Er(f,s)?Ee:_e,W=[Fe([q?" ":_e,wn(K,B)])];return f.firstChild&&Ni(f.firstChild)||f.isSelfClosing&&ba(f.parent)||q?W.push(f.isSelfClosing?" ":""):W.push(s.bracketSameLine?f.isSelfClosing?" ":"":f.isSelfClosing?_e:Pe),W}function E1(a){return a.firstChild&&Ni(a.firstChild)?"":Vo(a)}function Uo(a,s,l){let{node:p}=a;return[wa(p,s),S1(a,s,l),p.isSelfClosing?"":E1(p)]}function wa(a,s){return a.prev&&Bi(a.prev)?"":[er(a,s),Wo(a)]}function er(a,s){return Ni(a)?Vo(a.parent):Zn(a)?Da(a.prev,s):""}function Wo(a){switch(a.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${a.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":return a.value==="html"?"<!doctype":"<!DOCTYPE";case"angularIcuExpression":return"{";case"element":if(a.condition)return`<!--[if ${a.condition}]><!--><${a.rawName}`;default:return`<${a.rawName}`}}function Vo(a){switch(sd(!a.isSelfClosing),a.type){case"ieConditionalComment":return"]>";case"element":if(a.condition)return"><!--<![endif]-->";default:return">"}}function F1(a,s){if(!a.endSourceSpan)return"";let l=a.startSourceSpan.end.offset;a.firstChild&&Ni(a.firstChild)&&(l-=Vo(a).length);let p=a.endSourceSpan.start.offset;return a.lastChild&&ka(a.lastChild)?p+=Ho(a,s).length:ba(a)&&(p-=Da(a.lastChild,s).length),s.originalText.slice(l,p)}var ld=F1,A1=new Set(["if","else if","for","switch","case"]);function $1(a,s){let{node:l}=a;switch(l.type){case"element":if(tt(l)||l.type==="interpolation")return;if(!l.isSelfClosing&&Lo(l,s)){let p=Yp(l,s);return p?async(f,D)=>{let E=ld(l,s),B=/^\s*$/u.test(E),q="";return B||(q=await f(ie(E),{parser:p,__embeddedInHtml:!0}),B=q===""),[er(l,s),ue(Uo(a,s,D)),B?"":Ee,q,B?"":Ee,qo(l,s),Qn(l,s)]}:void 0}break;case"text":if(tt(l.parent)){let p=Yp(l.parent,s);if(p)return async f=>{let D=p==="markdown"?Jp(l.value.replace(/^[^\S\n]*\n/u,"")):l.value,E={parser:p,__embeddedInHtml:!0};if(s.parser==="html"&&p==="babel"){let B="script",{attrMap:q}=l.parent;q&&(q.type==="module"||q.type==="text/babel"&&q["data-type"]==="module")&&(B="module"),E.__babelSourceType=B}return[Ct,er(l,s),await f(D,E),Qn(l,s)]}}else if(l.parent.type==="interpolation")return async p=>{let f={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return s.parser==="angular"?f.parser="__ng_interpolation":s.parser==="vue"?f.parser=Mo(a,s)?"__vue_ts_expression":"__vue_expression":f.parser="__js_expression",[Fe([_e,await p(l.value,f)]),l.parent.next&&Zn(l.parent.next)?" ":_e]};break;case"attribute":return k1(a,s);case"front-matter":return p=>Ao(l,p);case"angularControlFlowBlockParameters":return A1.has(a.parent.name)?_i:void 0;case"angularLetDeclarationInitializer":return p=>xt(l.value,p,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var T1=$1,Ca=null;function _a(a){if(Ca!==null&&typeof Ca.property){let s=Ca;return Ca=_a.prototype=null,s}return Ca=_a.prototype=a??Object.create(null),new _a}var B1=10;for(let a=0;a<=B1;a++)_a();function N1(a){return _a(a)}function j1(a,s="type"){N1(a);function l(p){let f=p[s],D=a[f];if(!Array.isArray(D))throw Object.assign(new Error(`Missing visitor keys for '${f}'.`),{node:p});return D}return l}var P1=j1,L1={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},O1=L1,I1=P1(O1),M1=I1;function R1(a){return/^\s*<!--\s*@(?:format|prettier)\s*-->/u.test(a)}function q1(a){return`<!-- @format -->
|
|
632
|
+
`||a==="\f"||a==="\r"||a===" "}var Xk=/^[ \t\n\r\u000c]+/,Qk=/^[, \t\n\r\u000c]+/,Zk=/^[^ \t\n\r\u000c]+/,e1=/[,]+$/,nd=/^\d+$/,t1=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function n1(a){let s=a.length,l,p,f,D,E,B=0,q;function K(pe){let Ae,Ve=pe.exec(a.substring(B));if(Ve)return[Ae]=Ve,B+=Ae.length,Ae}let W=[];for(;;){if(K(Qk),B>=s){if(W.length===0)throw new Error("Must contain one or more image candidate strings.");return W}q=B,l=K(Zk),p=[],l.slice(-1)===","?(l=l.replace(e1,""),ge()):we()}function we(){for(K(Xk),f="",D="in descriptor";;){if(E=a.charAt(B),D==="in descriptor")if(td(E))f&&(p.push(f),f="",D="after descriptor");else if(E===","){B+=1,f&&p.push(f),ge();return}else if(E==="(")f+=E,D="in parens";else if(E===""){f&&p.push(f),ge();return}else f+=E;else if(D==="in parens")if(E===")")f+=E,D="in descriptor";else if(E===""){p.push(f),ge();return}else f+=E;else if(D==="after descriptor"&&!td(E))if(E===""){ge();return}else D="in descriptor",B-=1;B+=1}}function ge(){let pe=!1,Ae,Ve,nt,st,G={},de,ze,qe,ct,Tr;for(st=0;st<p.length;st++)de=p[st],ze=de[de.length-1],qe=de.substring(0,de.length-1),ct=parseInt(qe,10),Tr=parseFloat(qe),nd.test(qe)&&ze==="w"?((Ae||Ve)&&(pe=!0),ct===0?pe=!0:Ae=ct):t1.test(qe)&&ze==="x"?((Ae||Ve||nt)&&(pe=!0),Tr<0?pe=!0:Ve=Tr):nd.test(qe)&&ze==="h"?((nt||Ve)&&(pe=!0),ct===0?pe=!0:nt=ct):pe=!0;if(!pe)G.source={value:l,startOffset:q},Ae&&(G.width={value:Ae}),Ve&&(G.density={value:Ve}),nt&&(G.height={value:nt}),W.push(G);else throw new Error(`Invalid srcset descriptor found in "${a}" at "${de}".`)}}var r1=n1;function a1(a){if(a.node.fullName==="srcset"&&(a.parent.fullName==="img"||a.parent.fullName==="source"))return()=>s1(Cn(a.node))}var rd={width:"w",height:"h",density:"x"},i1=Object.keys(rd);function s1(a){let s=r1(a),l=i1.filter(W=>s.some(we=>Object.prototype.hasOwnProperty.call(we,W)));if(l.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[p]=l,f=rd[p],D=s.map(W=>W.source.value),E=Math.max(...D.map(W=>W.length)),B=s.map(W=>W[p]?String(W[p].value):""),q=B.map(W=>{let we=W.indexOf(".");return we===-1?W.length:we}),K=Math.max(...q);return Xn(wn([",",_e],D.map((W,we)=>{let ge=[W],pe=B[we];if(pe){let Ae=E-W.length+1,Ve=K-q[we],nt=" ".repeat(Ae+Ve);ge.push(wt(nt," "),pe+f)}return ge})))}var o1=a1;function l1(a,s){let{node:l}=a,p=Cn(a.node).trim();if(l.fullName==="style"&&!s.parentParser&&!p.includes("{{"))return async f=>Xn(await f(p,{parser:"css",__isHTMLStyleAttribute:!0}))}var Io=new WeakMap;function u1(a,s){let{root:l}=a;return Io.has(l)||Io.set(l,l.children.some(p=>Zp(p,s)&&["ts","typescript"].includes(p.attrMap.lang))),Io.get(l)}var Mo=u1;function c1(a,s,l){let{node:p}=l,f=Cn(p);return xt(`type T<${f}> = any`,a,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},un)}function p1(a,s,{parseWithTs:l}){return xt(`function _(${a}) {}`,s,{parser:l?"babel-ts":"babel",__isVueBindings:!0})}function d1(a){let s=/^(?:[\w$]+|\([^)]*\))\s*=>|^function\s*\(/u,l=/^[$_a-z][\w$]*(?:\.[$_a-z][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\]|\[[$_a-z][\w$]*\])*$/iu,p=a.trim();return s.test(p)||l.test(p)}async function h1(a,s,l,p){let f=Cn(l.node),{left:D,operator:E,right:B}=f1(f),q=Mo(l,p);return[ue(await xt(`function _(${D}) {}`,a,{parser:q?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",E," ",await xt(B,a,{parser:q?"__ts_expression":"__js_expression"})]}function f1(a){let s=/(.*?)\s+(in|of)\s+(.*)/su,l=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,p=/^\(|\)$/gu,f=a.match(s);if(!f)return;let D={};if(D.for=f[3].trim(),!D.for)return;let E=C(!1,f[1].trim(),p,""),B=E.match(l);B?(D.alias=E.replace(l,""),D.iterator1=B[1].trim(),B[2]&&(D.iterator2=B[2].trim())):D.alias=E;let q=[D.alias,D.iterator1,D.iterator2];if(!q.some((K,W)=>!K&&(W===0||q.slice(W+1).some(Boolean))))return{left:q.filter(Boolean).join(","),operator:f[2],right:D.for}}function m1(a,s){if(s.parser!=="vue")return;let{node:l}=a,p=l.fullName;if(p==="v-for")return h1;if(p==="generic"&&Zp(l.parent,s))return c1;let f=Cn(l),D=Mo(a,s);if(qk(l)||Hk(l,s))return E=>p1(f,E,{parseWithTs:D});if(p.startsWith("@")||p.startsWith("v-on:"))return E=>g1(f,E,{parseWithTs:D});if(p.startsWith(":")||p.startsWith("v-bind:"))return E=>v1(f,E,{parseWithTs:D});if(p.startsWith("v-"))return E=>ad(f,E,{parseWithTs:D})}function g1(a,s,{parseWithTs:l}){return d1(a)?ad(a,s,{parseWithTs:l}):xt(a,s,{parser:l?"__vue_ts_event_binding":"__vue_event_binding"},un)}function v1(a,s,{parseWithTs:l}){return xt(a,s,{parser:l?"__vue_ts_expression":"__vue_expression"},un)}function ad(a,s,{parseWithTs:l}){return xt(a,s,{parser:l?"__ts_expression":"__js_expression"},un)}var y1=m1;function D1(a,s){let{node:l}=a;if(l.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(s.originalText.slice(l.valueSpan.start.offset,l.valueSpan.end.offset))||s.parser==="lwc"&&l.value.startsWith("{")&&l.value.endsWith("}"))return[l.rawName,"=",l.value];for(let p of[o1,l1,Jk,y1,Yk]){let f=p(a,s);if(f)return b1(f)}}}function b1(a){return async(s,l,p,f)=>{let D=await a(s,l,p,f);if(D)return D=ca(D,E=>typeof E=="string"?C(!1,E,'"',"""):E),[p.node.rawName,'="',ue(D),'"']}}var k1=D1,id=new Proxy(()=>{},{get:()=>id}),sd=id;function w1(a){return Array.isArray(a)&&a.length>0}var Ro=w1;function $i(a){return a.sourceSpan.start.offset}function Ti(a){return a.sourceSpan.end.offset}function qo(a,s){return[a.isSelfClosing?"":C1(a,s),ya(a,s)]}function C1(a,s){return a.lastChild&&ka(a.lastChild)?"":[_1(a,s),Ho(a,s)]}function ya(a,s){return(a.next?Zn(a.next):ba(a.parent))?"":[Da(a,s),Qn(a,s)]}function _1(a,s){return ba(a)?Da(a.lastChild,s):""}function Qn(a,s){return ka(a)?Ho(a.parent,s):Bi(a)?Wo(a.next):""}function Ho(a,s){if(sd(!a.isSelfClosing),od(a,s))return"";switch(a.type){case"ieConditionalComment":return"<!";case"element":if(a.hasHtmComponentClosingTag)return"<//";default:return`</${a.rawName}`}}function Da(a,s){if(od(a,s))return"";switch(a.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(a.isSelfClosing)return"/>";default:return">"}}function od(a,s){return!a.isSelfClosing&&!a.endSourceSpan&&(Te(a)||Be(a.parent,s))}function Zn(a){return a.prev&&a.prev.type!=="docType"&&a.type!=="angularControlFlowBlock"&&!We(a.prev)&&a.isLeadingSpaceSensitive&&!a.hasLeadingSpaces}function ba(a){var s;return((s=a.lastChild)==null?void 0:s.isTrailingSpaceSensitive)&&!a.lastChild.hasTrailingSpaces&&!We(Po(a.lastChild))&&!Sr(a)}function ka(a){return!a.next&&!a.hasTrailingSpaces&&a.isTrailingSpaceSensitive&&We(Po(a))}function Bi(a){return a.next&&!We(a.next)&&We(a)&&a.isTrailingSpaceSensitive&&!a.hasTrailingSpaces}function x1(a){let s=a.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return s?s[1]?s[1].split(/\s+/u):!0:!1}function Ni(a){return!a.prev&&a.isLeadingSpaceSensitive&&!a.hasLeadingSpaces}function S1(a,s,l){var p;let{node:f}=a;if(!Ro(f.attrs))return f.isSelfClosing?" ":"";let D=((p=f.prev)==null?void 0:p.type)==="comment"&&x1(f.prev.value),E=typeof D=="boolean"?()=>D:Array.isArray(D)?we=>D.includes(we.rawName):()=>!1,B=a.map(({node:we})=>E(we)?mt(s.originalText.slice($i(we),Ti(we))):l(),"attrs"),q=f.type==="element"&&f.fullName==="script"&&f.attrs.length===1&&f.attrs[0].fullName==="src"&&f.children.length===0,K=s.singleAttributePerLine&&f.attrs.length>1&&!Er(f,s)?Ee:_e,W=[Fe([q?" ":_e,wn(K,B)])];return f.firstChild&&Ni(f.firstChild)||f.isSelfClosing&&ba(f.parent)||q?W.push(f.isSelfClosing?" ":""):W.push(s.bracketSameLine?f.isSelfClosing?" ":"":f.isSelfClosing?_e:Pe),W}function E1(a){return a.firstChild&&Ni(a.firstChild)?"":Vo(a)}function Uo(a,s,l){let{node:p}=a;return[wa(p,s),S1(a,s,l),p.isSelfClosing?"":E1(p)]}function wa(a,s){return a.prev&&Bi(a.prev)?"":[er(a,s),Wo(a)]}function er(a,s){return Ni(a)?Vo(a.parent):Zn(a)?Da(a.prev,s):""}function Wo(a){switch(a.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${a.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":return a.value==="html"?"<!doctype":"<!DOCTYPE";case"angularIcuExpression":return"{";case"element":if(a.condition)return`<!--[if ${a.condition}]><!--><${a.rawName}`;default:return`<${a.rawName}`}}function Vo(a){switch(sd(!a.isSelfClosing),a.type){case"ieConditionalComment":return"]>";case"element":if(a.condition)return"><!--<![endif]-->";default:return">"}}function F1(a,s){if(!a.endSourceSpan)return"";let l=a.startSourceSpan.end.offset;a.firstChild&&Ni(a.firstChild)&&(l-=Vo(a).length);let p=a.endSourceSpan.start.offset;return a.lastChild&&ka(a.lastChild)?p+=Ho(a,s).length:ba(a)&&(p-=Da(a.lastChild,s).length),s.originalText.slice(l,p)}var ld=F1,A1=new Set(["if","else if","for","switch","case"]);function $1(a,s){let{node:l}=a;switch(l.type){case"element":if(tt(l)||l.type==="interpolation")return;if(!l.isSelfClosing&&Lo(l,s)){let p=Yp(l,s);return p?async(f,D)=>{let E=ld(l,s),B=/^\s*$/u.test(E),q="";return B||(q=await f(ie(E),{parser:p,__embeddedInHtml:!0}),B=q===""),[er(l,s),ue(Uo(a,s,D)),B?"":Ee,q,B?"":Ee,qo(l,s),Qn(l,s)]}:void 0}break;case"text":if(tt(l.parent)){let p=Yp(l.parent,s);if(p)return async f=>{let D=p==="markdown"?Jp(l.value.replace(/^[^\S\n]*\n/u,"")):l.value,E={parser:p,__embeddedInHtml:!0};if(s.parser==="html"&&p==="babel"){let B="script",{attrMap:q}=l.parent;q&&(q.type==="module"||q.type==="text/babel"&&q["data-type"]==="module")&&(B="module"),E.__babelSourceType=B}return[Ct,er(l,s),await f(D,E),Qn(l,s)]}}else if(l.parent.type==="interpolation")return async p=>{let f={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return s.parser==="angular"?f.parser="__ng_interpolation":s.parser==="vue"?f.parser=Mo(a,s)?"__vue_ts_expression":"__vue_expression":f.parser="__js_expression",[Fe([_e,await p(l.value,f)]),l.parent.next&&Zn(l.parent.next)?" ":_e]};break;case"attribute":return k1(a,s);case"front-matter":return p=>Ao(l,p);case"angularControlFlowBlockParameters":return A1.has(a.parent.name)?_i:void 0;case"angularLetDeclarationInitializer":return p=>xt(l.value,p,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var T1=$1,Ca=null;function _a(a){if(Ca!==null&&typeof Ca.property){let s=Ca;return Ca=_a.prototype=null,s}return Ca=_a.prototype=a??Object.create(null),new _a}var B1=10;for(let a=0;a<=B1;a++)_a();function N1(a){return _a(a)}function j1(a,s="type"){N1(a);function l(p){let f=p[s],D=a[f];if(!Array.isArray(D))throw Object.assign(new Error(`Missing visitor keys for '${f}'.`),{node:p});return D}return l}var P1=j1,L1={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},O1=L1,I1=P1(O1),M1=I1;function R1(a){return/^\s*<!--\s*@(?:format|prettier)\s*-->/u.test(a)}function q1(a){return`<!-- @format -->
|
|
632
633
|
|
|
633
634
|
`+a}var H1=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function ud(a){let s=Ti(a);return a.type==="element"&&!a.endSourceSpan&&Ro(a.children)?Math.max(s,ud(ln(!1,a.children,-1))):s}function xa(a,s,l){let p=a.node;if(Te(p)){let f=ud(p);return[er(p,s),mt(Tt.trimEnd(s.originalText.slice($i(p)+(p.prev&&Bi(p.prev)?Wo(p).length:0),f-(p.next&&Zn(p.next)?Da(p,s).length:0)))),Qn(p,s)]}return l()}function ji(a,s){return We(a)&&We(s)?a.isTrailingSpaceSensitive?a.hasTrailingSpaces?jo(s)?Ee:_e:"":jo(s)?Ee:Pe:Bi(a)&&(Te(s)||s.firstChild||s.isSelfClosing||s.type==="element"&&s.attrs.length>0)||a.type==="element"&&a.isSelfClosing&&Zn(s)?"":!s.isLeadingSpaceSensitive||jo(s)||Zn(s)&&a.lastChild&&ka(a.lastChild)&&a.lastChild.lastChild&&ka(a.lastChild.lastChild)?Ee:s.hasLeadingSpaces?_e:Pe}function zo(a,s,l){let{node:p}=a;if(Hp(p))return[Ct,...a.map(D=>{let E=D.node,B=E.prev?ji(E.prev,E):"";return[B?[B,Fi(E.prev)?Ee:""]:"",xa(D,s,l)]},"children")];let f=p.children.map(()=>Symbol(""));return a.map((D,E)=>{let B=D.node;if(We(B)){if(B.prev&&We(B.prev)){let Ae=ji(B.prev,B);if(Ae)return Fi(B.prev)?[Ee,Ee,xa(D,s,l)]:[Ae,xa(D,s,l)]}return xa(D,s,l)}let q=[],K=[],W=[],we=[],ge=B.prev?ji(B.prev,B):"",pe=B.next?ji(B,B.next):"";return ge&&(Fi(B.prev)?q.push(Ee,Ee):ge===Ee?q.push(Ee):We(B.prev)?K.push(ge):K.push(wt("",Pe,{groupId:f[E-1]}))),pe&&(Fi(B)?We(B.next)&&we.push(Ee,Ee):pe===Ee?We(B.next)&&we.push(Ee):W.push(pe)),[...q,ue([...K,ue([xa(D,s,l),...W],{id:f[E]})]),...we]},"children")}function U1(a,s,l){let{node:p}=a,f=[];W1(a)&&f.push("} "),f.push("@",p.name),p.parameters&&f.push(" (",ue(l("parameters")),")"),f.push(" {");let D=cd(p);return p.children.length>0?(p.firstChild.hasLeadingSpaces=!0,p.lastChild.hasTrailingSpaces=!0,f.push(Fe([Ee,zo(a,s,l)])),D&&f.push(Ee,"}")):D&&f.push("}"),ue(f,{shouldBreak:!0})}function cd(a){var s,l;return!(((s=a.next)==null?void 0:s.type)==="angularControlFlowBlock"&&(l=H1.get(a.name))!=null&&l.has(a.next.name))}function W1(a){let{previous:s}=a;return(s==null?void 0:s.type)==="angularControlFlowBlock"&&!Te(s)&&!cd(s)}function V1(a,s,l){return[Fe([Pe,wn([";",_e],a.map(l,"children"))]),Pe]}function z1(a,s,l){let{node:p}=a;return[wa(p,s),ue([p.switchValue.trim(),", ",p.clause,p.cases.length>0?[",",Fe([_e,wn(_e,a.map(l,"cases"))])]:"",Pe]),ya(p,s)]}function G1(a,s,l){let{node:p}=a;return[p.value," {",ue([Fe([Pe,a.map(({node:f})=>f.type==="text"&&!Tt.trim(f.value)?"":l(),"expression")]),Pe]),"}"]}function Y1(a,s,l){let{node:p}=a;if(Be(p,s))return[er(p,s),ue(Uo(a,s,l)),mt(ld(p,s)),...qo(p,s),Qn(p,s)];let f=p.children.length===1&&(p.firstChild.type==="interpolation"||p.firstChild.type==="angularIcuExpression")&&p.firstChild.isLeadingSpaceSensitive&&!p.firstChild.hasLeadingSpaces&&p.lastChild.isTrailingSpaceSensitive&&!p.lastChild.hasTrailingSpaces,D=Symbol("element-attr-group-id"),E=W=>ue([ue(Uo(a,s,l),{id:D}),W,qo(p,s)]),B=W=>f?kn(W,{groupId:D}):(tt(p)||Ai(p,s))&&p.parent.type==="root"&&s.parser==="vue"&&!s.vueIndentScriptAndStyle?W:Fe(W),q=()=>f?wt(Pe,"",{groupId:D}):p.firstChild.hasLeadingSpaces&&p.firstChild.isLeadingSpaceSensitive?_e:p.firstChild.type==="text"&&p.isWhitespaceSensitive&&p.isIndentationSensitive?ft(Pe):Pe,K=()=>(p.next?Zn(p.next):ba(p.parent))?p.lastChild.hasTrailingSpaces&&p.lastChild.isTrailingSpaceSensitive?" ":"":f?wt(Pe,"",{groupId:D}):p.lastChild.hasTrailingSpaces&&p.lastChild.isTrailingSpaceSensitive?_e:(p.lastChild.type==="comment"||p.lastChild.type==="text"&&p.isWhitespaceSensitive&&p.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${s.tabWidth*(a.ancestors.length-1)}}$`,"u").test(p.lastChild.value)?"":Pe;return p.children.length===0?E(p.hasDanglingSpaces&&p.isDanglingSpaceSensitive?_e:""):E([Sk(p)?Ct:"",B([q(),zo(a,s,l)]),K()])}function Pi(a){return a>=9&&a<=32||a==160}function Go(a){return 48<=a&&a<=57}function Li(a){return a>=97&&a<=122||a>=65&&a<=90}function K1(a){return a>=97&&a<=102||a>=65&&a<=70||Go(a)}function Yo(a){return a===10||a===13}function pd(a){return 48<=a&&a<=55}function Ko(a){return a===39||a===34||a===96}var J1=/-+([a-z0-9])/g;function X1(a){return a.replace(J1,(...s)=>s[1].toUpperCase())}var Jo=class Jd{constructor(s,l,p,f){this.file=s,this.offset=l,this.line=p,this.col=f}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(s){let l=this.file.content,p=l.length,f=this.offset,D=this.line,E=this.col;for(;f>0&&s<0;)if(f--,s++,l.charCodeAt(f)==10){D--;let B=l.substring(0,f-1).lastIndexOf(`
|
|
634
635
|
`);E=B>0?f-B:f}else E--;for(;f<p&&s>0;){let B=l.charCodeAt(f);f++,s--,B==10?(D++,E=0):E++}return new Jd(this.file,f,D,E)}getContext(s,l){let p=this.file.content,f=this.offset;if(f!=null){f>p.length-1&&(f=p.length-1);let D=f,E=0,B=0;for(;E<s&&f>0&&(f--,E++,!(p[f]==`
|
|
@@ -642,7 +643,7 @@ If '${a}' is a directive input, make sure the directive is imported by the curre
|
|
|
642
643
|
`){let D=this._getContainer();D!=null&&D.children.length===0&&this.getTagDefinition(D.name).ignoreFirstLf&&(f=f.substring(1),l[0]={type:s.type,sourceSpan:s.sourceSpan,parts:[f]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)s=this._advance(),l.push(s),s.type===8?f+=s.parts.join("").replace(/&([^;]+);/g,Md):s.type===9?f+=s.parts[0]:f+=s.parts.join("");if(f.length>0){let D=s.sourceSpan;this._addToParent(new Ew(f,new se(p.start,D.end,p.fullStart,p.details),l))}}_closeVoidElement(){let s=this._getContainer();s instanceof _n&&this.getTagDefinition(s.name).isVoid&&this._containerStack.pop()}_consumeStartTag(s){let[l,p]=s.parts,f=[];for(;this._peek.type===14;)f.push(this._consumeAttr(this._advance()));let D=this._getElementFullName(l,p,this._getClosestParentElement()),E=!1;if(this._peek.type===2){this._advance(),E=!0;let pe=this.getTagDefinition(D);this.canSelfClose||pe.canSelfClose||Mi(D)!==null||pe.isVoid||this.errors.push(ut.create(D,s.sourceSpan,`Only void, custom and foreign elements can be self closed "${s.parts[1]}"`))}else this._peek.type===1&&(this._advance(),E=!1);let B=this._peek.sourceSpan.fullStart,q=new se(s.sourceSpan.start,B,s.sourceSpan.fullStart),K=new se(s.sourceSpan.start,B,s.sourceSpan.fullStart),W=new se(s.sourceSpan.start.moveBy(1),s.sourceSpan.end),we=new _n(D,f,[],q,K,void 0,W),ge=this._getContainer();this._pushContainer(we,ge instanceof _n&&this.getTagDefinition(ge.name).isClosedByChild(we.name)),E?this._popContainer(D,_n,q):s.type===4&&(this._popContainer(D,_n,null),this.errors.push(ut.create(D,q,`Opening tag "${D}" not terminated.`)))}_pushContainer(s,l){l&&this._containerStack.pop(),this._addToParent(s),this._containerStack.push(s)}_consumeEndTag(s){let l=this.allowHtmComponentClosingTags&&s.parts.length===0?null:this._getElementFullName(s.parts[0],s.parts[1],this._getClosestParentElement());if(l&&this.getTagDefinition(l).isVoid)this.errors.push(ut.create(l,s.sourceSpan,`Void elements do not have end tags "${s.parts[1]}"`));else if(!this._popContainer(l,_n,s.sourceSpan)){let p=`Unexpected closing tag "${l}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(ut.create(l,s.sourceSpan,p))}}_popContainer(s,l,p){let f=!1;for(let D=this._containerStack.length-1;D>=0;D--){let E=this._containerStack[D];if(Mi(E.name)?E.name===s:(s==null||E.name.toLowerCase()===s.toLowerCase())&&E instanceof l)return E.endSourceSpan=p,E.sourceSpan.end=p!==null?p.end:E.sourceSpan.end,this._containerStack.splice(D,this._containerStack.length-D),!f;(E instanceof Ar||E instanceof _n&&!this.getTagDefinition(E.name).closedByParent)&&(f=!0)}return!1}_consumeAttr(s){let l=Ri(s.parts[0],s.parts[1]),p=s.sourceSpan.end,f;this._peek.type===15&&(f=this._advance());let D="",E=[],B,q;if(this._peek.type===16)for(B=this._peek.sourceSpan,q=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let W=this._advance();E.push(W),W.type===17?D+=W.parts.join("").replace(/&([^;]+);/g,Md):W.type===9?D+=W.parts[0]:D+=W.parts.join(""),q=p=W.sourceSpan.end}this._peek.type===15&&(q=p=this._advance().sourceSpan.end);let K=B&&q&&new se((f==null?void 0:f.sourceSpan.start)??B.start,q,(f==null?void 0:f.sourceSpan.fullStart)??B.fullStart);return new Tw(l,D,new se(s.sourceSpan.start,p,s.sourceSpan.fullStart),s.sourceSpan,K,E.length>0?E:void 0,void 0)}_consumeBlockOpen(s){let l=[];for(;this._peek.type===28;){let B=this._advance();l.push(new Fd(B.parts[0],B.sourceSpan))}this._peek.type===26&&this._advance();let p=this._peek.sourceSpan.fullStart,f=new se(s.sourceSpan.start,p,s.sourceSpan.fullStart),D=new se(s.sourceSpan.start,p,s.sourceSpan.fullStart),E=new Ar(s.parts[0],l,[],f,s.sourceSpan,D);this._pushContainer(E,!1)}_consumeBlockClose(s){this._popContainer(null,Ar,s.sourceSpan)||this.errors.push(ut.create(null,s.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(s){let l=[];for(;this._peek.type===28;){let B=this._advance();l.push(new Fd(B.parts[0],B.sourceSpan))}let p=this._peek.sourceSpan.fullStart,f=new se(s.sourceSpan.start,p,s.sourceSpan.fullStart),D=new se(s.sourceSpan.start,p,s.sourceSpan.fullStart),E=new Ar(s.parts[0],l,[],f,s.sourceSpan,D);this._pushContainer(E,!1),this._popContainer(null,Ar,null),this.errors.push(ut.create(s.parts[0],f,`Incomplete block "${s.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(s){let l=s.parts[0],p,f;if(this._peek.type!==31){this.errors.push(ut.create(s.parts[0],s.sourceSpan,`Invalid @let declaration "${l}". Declaration must have a value.`));return}else p=this._advance();if(this._peek.type!==32){this.errors.push(ut.create(s.parts[0],s.sourceSpan,`Unterminated @let declaration "${l}". Declaration must be terminated with a semicolon.`));return}else f=this._advance();let D=f.sourceSpan.fullStart,E=new se(s.sourceSpan.start,D,s.sourceSpan.fullStart),B=s.sourceSpan.toString().lastIndexOf(l),q=s.sourceSpan.start.moveBy(B),K=new se(q,s.sourceSpan.end),W=new Ad(l,p.parts[0],E,K,p.sourceSpan);this._addToParent(W)}_consumeIncompleteLet(s){let l=s.parts[0]??"",p=l?` "${l}"`:"";if(l.length>0){let f=s.sourceSpan.toString().lastIndexOf(l),D=s.sourceSpan.start.moveBy(f),E=new se(D,s.sourceSpan.end),B=new se(s.sourceSpan.start,s.sourceSpan.start.moveBy(0)),q=new Ad(l,"",s.sourceSpan,E,B);this._addToParent(q)}this.errors.push(ut.create(s.parts[0],s.sourceSpan,`Incomplete @let declaration${p}. @let declarations must be written as \`@let <name> = <value>;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestParentElement(){for(let s=this._containerStack.length-1;s>-1;s--)if(this._containerStack[s]instanceof _n)return this._containerStack[s];return null}_addToParent(s){let l=this._getContainer();l===null?this.rootNodes.push(s):l.children.push(s)}_getElementFullName(s,l,p){if(s===""&&(s=this.getTagDefinition(l).implicitNamespacePrefix||"",s===""&&p!=null)){let f=Ii(p.name)[1];this.getTagDefinition(f).preventNamespaceInheritance||(s=Mi(p.name))}return Ri(s,l)}};function Id(a,s){return a.length>0&&a[a.length-1]===s}function Md(a,s){return Ui[s]!==void 0?Ui[s]||a:/^#x[a-f0-9]+$/i.test(s)?String.fromCodePoint(parseInt(s.slice(2),16)):/^#\d+$/.test(s)?String.fromCodePoint(parseInt(s.slice(1),10)):a}var eC=class extends Qw{constructor(){super(Xo)}parse(a,s,l,p=!1,f){return super.parse(a,s,l,p,f)}},tl=null,tC=()=>(tl||(tl=new eC),tl);function Rd(a,s={}){let{canSelfClose:l=!1,allowHtmComponentClosingTags:p=!1,isTagNameCaseSensitive:f=!1,getTagContentType:D,tokenizeAngularBlocks:E=!1,tokenizeAngularLetDeclaration:B=!1}=s;return tC().parse(a,"angular-html-parser",{tokenizeExpansionForms:E,interpolationConfig:void 0,canSelfClose:l,allowHtmComponentClosingTags:p,tokenizeBlocks:E,tokenizeLet:B},f,D)}function nC(a,s){let l=new SyntaxError(a+" ("+s.loc.start.line+":"+s.loc.start.column+")");return Object.assign(l,s)}var rC=nC,Ea=3;function aC(a){let s=a.slice(0,Ea);if(s!=="---"&&s!=="+++")return;let l=a.indexOf(`
|
|
643
644
|
`,Ea);if(l===-1)return;let p=a.slice(Ea,l).trim(),f=a.indexOf(`
|
|
644
645
|
${s}`,l),D=p;if(D||(D=s==="+++"?"toml":"yaml"),f===-1&&s==="---"&&D==="yaml"&&(f=a.indexOf(`
|
|
645
|
-
...`,l)),f===-1)return;let E=f+1+Ea,B=a.charAt(E+1);if(!/\s?/u.test(B))return;let q=a.slice(0,E);return{type:"front-matter",language:D,explicitLanguage:p,value:a.slice(l+1,f),startDelimiter:s,endDelimiter:q.slice(-Ea),raw:q}}function iC(a){let s=aC(a);if(!s)return{content:a};let{raw:l}=s;return{frontMatter:s,content:C(!1,l,/[^\n]/gu," ")+a.slice(l.length)}}var sC=iC,Vi={attrs:!0,children:!0,cases:!0,expression:!0},qd=new Set(["parent"]),oC=class Fa{constructor(s={}){for(let l of new Set([...qd,...Object.keys(s)]))this.setProperty(l,s[l])}setProperty(s,l){if(this[s]!==l){if(s in Vi&&(l=l.map(p=>this.createChild(p))),!qd.has(s)){this[s]=l;return}Object.defineProperty(this,s,{value:l,enumerable:!1,configurable:!0})}}map(s){let l;for(let p in Vi){let f=this[p];if(f){let D=lC(f,E=>E.map(s));l!==f&&(l||(l=new Fa({parent:this.parent})),l.setProperty(p,D))}}if(l)for(let p in this)p in Vi||(l[p]=this[p]);return s(l||this)}walk(s){for(let l in Vi){let p=this[l];if(p)for(let f=0;f<p.length;f++)p[f].walk(s)}s(this)}createChild(s){let l=s instanceof Fa?s.clone():new Fa(s);return l.setProperty("parent",this),l}insertChildBefore(s,l){this.children.splice(this.children.indexOf(s),0,this.createChild(l))}removeChild(s){this.children.splice(this.children.indexOf(s),1)}replaceChild(s,l){this.children[this.children.indexOf(s)]=this.createChild(l)}clone(){return new Fa(this)}get firstChild(){var s;return(s=this.children)==null?void 0:s[0]}get lastChild(){var s;return(s=this.children)==null?void 0:s[this.children.length-1]}get prev(){var s,l;return(l=(s=this.parent)==null?void 0:s.children)==null?void 0:l[this.parent.children.indexOf(this)-1]}get next(){var s,l;return(l=(s=this.parent)==null?void 0:s.children)==null?void 0:l[this.parent.children.indexOf(this)+1]}get rawName(){return this.hasExplicitNamespace?this.fullName:this.name}get fullName(){return this.namespace?this.namespace+":"+this.name:this.name}get attrMap(){return Object.fromEntries(this.attrs.map(s=>[s.fullName,s.value]))}};function lC(a,s){let l=a.map(s);return l.some((p,f)=>p!==a[f])?l:a}var uC=[{regex:/^(\[if([^\]]*)\]>)(.*?)<!\s*\[endif\]$/su,parse:pC},{regex:/^\[if([^\]]*)\]><!$/u,parse:dC},{regex:/^<!\s*\[endif\]$/u,parse:hC}];function cC(a,s){if(a.value)for(let{regex:l,parse:p}of uC){let f=a.value.match(l);if(f)return p(a,s,f)}return null}function pC(a,s,l){let[,p,f,D]=l,E=4+p.length,B=a.sourceSpan.start.moveBy(E),q=B.moveBy(D.length),[K,W]=(()=>{try{return[!0,s(D,B).children]}catch{return[!1,[{type:"text",value:D,sourceSpan:new se(B,q)}]]}})();return{type:"ieConditionalComment",complete:K,children:W,condition:C(!1,f.trim(),/\s+/gu," "),sourceSpan:a.sourceSpan,startSourceSpan:new se(a.sourceSpan.start,B),endSourceSpan:new se(q,a.sourceSpan.end)}}function dC(a,s,l){let[,p]=l;return{type:"ieConditionalStartComment",condition:C(!1,p.trim(),/\s+/gu," "),sourceSpan:a.sourceSpan}}function hC(a){return{type:"ieConditionalEndComment",sourceSpan:a.sourceSpan}}var nl=new Map([["*",new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alt","autocomplete","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]),fC=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);function mC(a){if(a.type==="block"){if(a.name=C(!1,a.name.toLowerCase(),/\s+/gu," ").trim(),a.type="angularControlFlowBlock",!Ro(a.parameters)){delete a.parameters;return}for(let s of a.parameters)s.type="angularControlFlowBlockParameter";a.parameters={type:"angularControlFlowBlockParameters",children:a.parameters,sourceSpan:new se(a.parameters[0].sourceSpan.start,ln(!1,a.parameters,-1).sourceSpan.end)}}}function gC(a){a.type==="letDeclaration"&&(a.type="angularLetDeclaration",a.id=a.name,a.init={type:"angularLetDeclarationInitializer",sourceSpan:new se(a.valueSpan.start,a.valueSpan.end),value:a.value},delete a.name,delete a.value)}function vC(a){(a.type==="plural"||a.type==="select")&&(a.clause=a.type,a.type="angularIcuExpression"),a.type==="expansionCase"&&(a.type="angularIcuCase")}function Hd(a,s,l){let{name:p,canSelfClose:f=!0,normalizeTagName:D=!1,normalizeAttributeName:E=!1,allowHtmComponentClosingTags:B=!1,isTagNameCaseSensitive:q=!1,shouldParseAsRawText:K}=s,{rootNodes:W,errors:we}=Rd(a,{canSelfClose:f,allowHtmComponentClosingTags:B,isTagNameCaseSensitive:q,getTagContentType:K?(...z)=>K(...z)?Ot.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:p==="angular"?!0:void 0,tokenizeAngularLetDeclaration:p==="angular"?!0:void 0});if(p==="vue"){if(W.some(qe=>qe.type==="docType"&&qe.value==="html"||qe.type==="element"&&qe.name.toLowerCase()==="html"))return Hd(a,Vd,l);let z,de=()=>z??(z=Rd(a,{canSelfClose:f,allowHtmComponentClosingTags:B,isTagNameCaseSensitive:q})),ze=qe=>de().rootNodes.find(({startSourceSpan:ct})=>ct&&ct.start.offset===qe.startSourceSpan.start.offset)??qe;for(let[qe,ct]of W.entries()){let{endSourceSpan:Tr,startSourceSpan:_C}=ct;if(Tr===null)we=de().errors,W[qe]=ze(ct);else if(yC(ct,l)){let zd=de().errors.find(Gd=>Gd.span.start.offset>_C.start.offset&&Gd.span.start.offset<Tr.end.offset);zd&&Ud(zd),W[qe]=ze(ct)}}}we.length>0&&Ud(we[0]);let ge=z=>{let de=z.name.startsWith(":")?z.name.slice(1).split(":")[0]:null,ze=z.nameSpan.toString(),qe=de!==null&&ze.startsWith(`${de}:`),ct=qe?ze.slice(de.length+1):ze;z.name=ct,z.namespace=de,z.hasExplicitNamespace=qe},pe=z=>{switch(z.type){case"element":ge(z);for(let de of z.attrs)ge(de),de.valueSpan?(de.value=de.valueSpan.toString(),/["']/u.test(de.value[0])&&(de.value=de.value.slice(1,-1))):de.value=null;break;case"comment":z.value=z.sourceSpan.toString().slice(4,-3);break;case"text":z.value=z.sourceSpan.toString();break}},Ae=(z,de)=>{let ze=z.toLowerCase();return de(ze)?ze:z},Ve=z=>{if(z.type==="element"&&(D&&(!z.namespace||z.namespace===z.tagDefinition.implicitNamespacePrefix||ve(z))&&(z.name=Ae(z.name,de=>fC.has(de))),E))for(let de of z.attrs)de.namespace||(de.name=Ae(de.name,ze=>nl.has(z.name)&&(nl.get("*").has(ze)||nl.get(z.name).has(ze))))},nt=z=>{z.sourceSpan&&z.endSourceSpan&&(z.sourceSpan=new se(z.sourceSpan.start,z.endSourceSpan.end))},st=z=>{if(z.type==="element"){let de=Xo(q?z.name:z.name.toLowerCase());!z.namespace||z.namespace===de.implicitNamespacePrefix||ve(z)?z.tagDefinition=de:z.tagDefinition=Xo("")}};return $d(new class extends jw{visitExpansionCase(z,de){p==="angular"&&this.visitChildren(de,ze=>{ze(z.expression)})}visit(z){pe(z),st(z),Ve(z),nt(z)}},W),W}function yC(a,s){var l;if(a.type!=="element"||a.name!=="template")return!1;let p=(l=a.attrs.find(f=>f.name==="lang"))==null?void 0:l.value;return!p||xr(s,{language:p})==="html"}function Ud(a){let{msg:s,span:{start:l,end:p}}=a;throw rC(s,{loc:{start:{line:l.line+1,column:l.col+1},end:{line:p.line+1,column:p.col+1}},cause:a})}function Wd(a,s,l={},p=!0){let{frontMatter:f,content:D}=p?sC(a):{frontMatter:null,content:a},E=new dd(a,l.filepath),B=new Jo(E,0,0,0),q=B.moveBy(a.length),K={type:"root",sourceSpan:new se(B,q),children:Hd(D,s,l)};if(f){let ge=new Jo(E,0,0,0),pe=ge.moveBy(f.raw.length);f.sourceSpan=new se(ge,pe),K.children.unshift(f)}let W=new oC(K),we=(ge,pe)=>{let{offset:Ae}=pe,Ve=C(!1,a.slice(0,Ae),/[^\n\r]/gu," "),nt=Wd(Ve+ge,s,l,!1);nt.sourceSpan=new se(pe,ln(!1,nt.children,-1).sourceSpan.end);let st=nt.children[0];return st.length===Ae?nt.children.shift():(st.sourceSpan=new se(st.sourceSpan.start.moveBy(Ae),st.sourceSpan.end),st.value=st.value.slice(Ae)),nt};return W.walk(ge=>{if(ge.type==="comment"){let pe=cC(ge,we);pe&&ge.parent.replaceChild(ge,pe)}mC(ge),gC(ge),vC(ge)}),W}function zi(a){return{parse:(s,l)=>Wd(s,a,l),hasPragma:R1,astFormat:"html",locStart:$i,locEnd:Ti}}var Vd={name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0},DC=zi(Vd),bC=zi({name:"angular"}),kC=zi({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(a,s,l,p){return a.toLowerCase()!=="html"&&!l&&(a!=="template"||p.some(({name:f,value:D})=>f==="lang"&&D!=="html"&&D!==""&&D!==void 0))}}),wC=zi({name:"lwc",canSelfClose:!1}),CC={html:fw};return h(k)})})(qc);var Hc=qc.exports;const vD=th({__proto__:null,default:Aa(Hc)},[Hc]);function yD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function DD(e,t){if(e==null)return{};var n,r,i=yD(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ys(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bD(e){if(Array.isArray(e))return Ys(e)}function kD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wD(e,t){if(e){if(typeof e=="string")return Ys(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ys(e,t):void 0}}function CD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
646
|
+
...`,l)),f===-1)return;let E=f+1+Ea,B=a.charAt(E+1);if(!/\s?/u.test(B))return;let q=a.slice(0,E);return{type:"front-matter",language:D,explicitLanguage:p,value:a.slice(l+1,f),startDelimiter:s,endDelimiter:q.slice(-Ea),raw:q}}function iC(a){let s=aC(a);if(!s)return{content:a};let{raw:l}=s;return{frontMatter:s,content:C(!1,l,/[^\n]/gu," ")+a.slice(l.length)}}var sC=iC,Vi={attrs:!0,children:!0,cases:!0,expression:!0},qd=new Set(["parent"]),oC=class Fa{constructor(s={}){for(let l of new Set([...qd,...Object.keys(s)]))this.setProperty(l,s[l])}setProperty(s,l){if(this[s]!==l){if(s in Vi&&(l=l.map(p=>this.createChild(p))),!qd.has(s)){this[s]=l;return}Object.defineProperty(this,s,{value:l,enumerable:!1,configurable:!0})}}map(s){let l;for(let p in Vi){let f=this[p];if(f){let D=lC(f,E=>E.map(s));l!==f&&(l||(l=new Fa({parent:this.parent})),l.setProperty(p,D))}}if(l)for(let p in this)p in Vi||(l[p]=this[p]);return s(l||this)}walk(s){for(let l in Vi){let p=this[l];if(p)for(let f=0;f<p.length;f++)p[f].walk(s)}s(this)}createChild(s){let l=s instanceof Fa?s.clone():new Fa(s);return l.setProperty("parent",this),l}insertChildBefore(s,l){this.children.splice(this.children.indexOf(s),0,this.createChild(l))}removeChild(s){this.children.splice(this.children.indexOf(s),1)}replaceChild(s,l){this.children[this.children.indexOf(s)]=this.createChild(l)}clone(){return new Fa(this)}get firstChild(){var s;return(s=this.children)==null?void 0:s[0]}get lastChild(){var s;return(s=this.children)==null?void 0:s[this.children.length-1]}get prev(){var s,l;return(l=(s=this.parent)==null?void 0:s.children)==null?void 0:l[this.parent.children.indexOf(this)-1]}get next(){var s,l;return(l=(s=this.parent)==null?void 0:s.children)==null?void 0:l[this.parent.children.indexOf(this)+1]}get rawName(){return this.hasExplicitNamespace?this.fullName:this.name}get fullName(){return this.namespace?this.namespace+":"+this.name:this.name}get attrMap(){return Object.fromEntries(this.attrs.map(s=>[s.fullName,s.value]))}};function lC(a,s){let l=a.map(s);return l.some((p,f)=>p!==a[f])?l:a}var uC=[{regex:/^(\[if([^\]]*)\]>)(.*?)<!\s*\[endif\]$/su,parse:pC},{regex:/^\[if([^\]]*)\]><!$/u,parse:dC},{regex:/^<!\s*\[endif\]$/u,parse:hC}];function cC(a,s){if(a.value)for(let{regex:l,parse:p}of uC){let f=a.value.match(l);if(f)return p(a,s,f)}return null}function pC(a,s,l){let[,p,f,D]=l,E=4+p.length,B=a.sourceSpan.start.moveBy(E),q=B.moveBy(D.length),[K,W]=(()=>{try{return[!0,s(D,B).children]}catch{return[!1,[{type:"text",value:D,sourceSpan:new se(B,q)}]]}})();return{type:"ieConditionalComment",complete:K,children:W,condition:C(!1,f.trim(),/\s+/gu," "),sourceSpan:a.sourceSpan,startSourceSpan:new se(a.sourceSpan.start,B),endSourceSpan:new se(q,a.sourceSpan.end)}}function dC(a,s,l){let[,p]=l;return{type:"ieConditionalStartComment",condition:C(!1,p.trim(),/\s+/gu," "),sourceSpan:a.sourceSpan}}function hC(a){return{type:"ieConditionalEndComment",sourceSpan:a.sourceSpan}}var nl=new Map([["*",new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alt","autocomplete","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]),fC=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);function mC(a){if(a.type==="block"){if(a.name=C(!1,a.name.toLowerCase(),/\s+/gu," ").trim(),a.type="angularControlFlowBlock",!Ro(a.parameters)){delete a.parameters;return}for(let s of a.parameters)s.type="angularControlFlowBlockParameter";a.parameters={type:"angularControlFlowBlockParameters",children:a.parameters,sourceSpan:new se(a.parameters[0].sourceSpan.start,ln(!1,a.parameters,-1).sourceSpan.end)}}}function gC(a){a.type==="letDeclaration"&&(a.type="angularLetDeclaration",a.id=a.name,a.init={type:"angularLetDeclarationInitializer",sourceSpan:new se(a.valueSpan.start,a.valueSpan.end),value:a.value},delete a.name,delete a.value)}function vC(a){(a.type==="plural"||a.type==="select")&&(a.clause=a.type,a.type="angularIcuExpression"),a.type==="expansionCase"&&(a.type="angularIcuCase")}function Hd(a,s,l){let{name:p,canSelfClose:f=!0,normalizeTagName:D=!1,normalizeAttributeName:E=!1,allowHtmComponentClosingTags:B=!1,isTagNameCaseSensitive:q=!1,shouldParseAsRawText:K}=s,{rootNodes:W,errors:we}=Rd(a,{canSelfClose:f,allowHtmComponentClosingTags:B,isTagNameCaseSensitive:q,getTagContentType:K?(...G)=>K(...G)?Ot.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:p==="angular"?!0:void 0,tokenizeAngularLetDeclaration:p==="angular"?!0:void 0});if(p==="vue"){if(W.some(qe=>qe.type==="docType"&&qe.value==="html"||qe.type==="element"&&qe.name.toLowerCase()==="html"))return Hd(a,Vd,l);let G,de=()=>G??(G=Rd(a,{canSelfClose:f,allowHtmComponentClosingTags:B,isTagNameCaseSensitive:q})),ze=qe=>de().rootNodes.find(({startSourceSpan:ct})=>ct&&ct.start.offset===qe.startSourceSpan.start.offset)??qe;for(let[qe,ct]of W.entries()){let{endSourceSpan:Tr,startSourceSpan:_C}=ct;if(Tr===null)we=de().errors,W[qe]=ze(ct);else if(yC(ct,l)){let zd=de().errors.find(Gd=>Gd.span.start.offset>_C.start.offset&&Gd.span.start.offset<Tr.end.offset);zd&&Ud(zd),W[qe]=ze(ct)}}}we.length>0&&Ud(we[0]);let ge=G=>{let de=G.name.startsWith(":")?G.name.slice(1).split(":")[0]:null,ze=G.nameSpan.toString(),qe=de!==null&&ze.startsWith(`${de}:`),ct=qe?ze.slice(de.length+1):ze;G.name=ct,G.namespace=de,G.hasExplicitNamespace=qe},pe=G=>{switch(G.type){case"element":ge(G);for(let de of G.attrs)ge(de),de.valueSpan?(de.value=de.valueSpan.toString(),/["']/u.test(de.value[0])&&(de.value=de.value.slice(1,-1))):de.value=null;break;case"comment":G.value=G.sourceSpan.toString().slice(4,-3);break;case"text":G.value=G.sourceSpan.toString();break}},Ae=(G,de)=>{let ze=G.toLowerCase();return de(ze)?ze:G},Ve=G=>{if(G.type==="element"&&(D&&(!G.namespace||G.namespace===G.tagDefinition.implicitNamespacePrefix||ve(G))&&(G.name=Ae(G.name,de=>fC.has(de))),E))for(let de of G.attrs)de.namespace||(de.name=Ae(de.name,ze=>nl.has(G.name)&&(nl.get("*").has(ze)||nl.get(G.name).has(ze))))},nt=G=>{G.sourceSpan&&G.endSourceSpan&&(G.sourceSpan=new se(G.sourceSpan.start,G.endSourceSpan.end))},st=G=>{if(G.type==="element"){let de=Xo(q?G.name:G.name.toLowerCase());!G.namespace||G.namespace===de.implicitNamespacePrefix||ve(G)?G.tagDefinition=de:G.tagDefinition=Xo("")}};return $d(new class extends jw{visitExpansionCase(G,de){p==="angular"&&this.visitChildren(de,ze=>{ze(G.expression)})}visit(G){pe(G),st(G),Ve(G),nt(G)}},W),W}function yC(a,s){var l;if(a.type!=="element"||a.name!=="template")return!1;let p=(l=a.attrs.find(f=>f.name==="lang"))==null?void 0:l.value;return!p||xr(s,{language:p})==="html"}function Ud(a){let{msg:s,span:{start:l,end:p}}=a;throw rC(s,{loc:{start:{line:l.line+1,column:l.col+1},end:{line:p.line+1,column:p.col+1}},cause:a})}function Wd(a,s,l={},p=!0){let{frontMatter:f,content:D}=p?sC(a):{frontMatter:null,content:a},E=new dd(a,l.filepath),B=new Jo(E,0,0,0),q=B.moveBy(a.length),K={type:"root",sourceSpan:new se(B,q),children:Hd(D,s,l)};if(f){let ge=new Jo(E,0,0,0),pe=ge.moveBy(f.raw.length);f.sourceSpan=new se(ge,pe),K.children.unshift(f)}let W=new oC(K),we=(ge,pe)=>{let{offset:Ae}=pe,Ve=C(!1,a.slice(0,Ae),/[^\n\r]/gu," "),nt=Wd(Ve+ge,s,l,!1);nt.sourceSpan=new se(pe,ln(!1,nt.children,-1).sourceSpan.end);let st=nt.children[0];return st.length===Ae?nt.children.shift():(st.sourceSpan=new se(st.sourceSpan.start.moveBy(Ae),st.sourceSpan.end),st.value=st.value.slice(Ae)),nt};return W.walk(ge=>{if(ge.type==="comment"){let pe=cC(ge,we);pe&&ge.parent.replaceChild(ge,pe)}mC(ge),gC(ge),vC(ge)}),W}function zi(a){return{parse:(s,l)=>Wd(s,a,l),hasPragma:R1,astFormat:"html",locStart:$i,locEnd:Ti}}var Vd={name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0},DC=zi(Vd),bC=zi({name:"angular"}),kC=zi({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(a,s,l,p){return a.toLowerCase()!=="html"&&!l&&(a!=="template"||p.some(({name:f,value:D})=>f==="lang"&&D!=="html"&&D!==""&&D!==void 0))}}),wC=zi({name:"lwc",canSelfClose:!1}),CC={html:fw};return h(k)})})(qc);var Hc=qc.exports;const vD=th({__proto__:null,default:Aa(Hc)},[Hc]);function yD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function DD(e,t){if(e==null)return{};var n,r,i=yD(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ys(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bD(e){if(Array.isArray(e))return Ys(e)}function kD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wD(e,t){if(e){if(typeof e=="string")return Ys(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ys(e,t):void 0}}function CD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
646
647
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ks(e){return bD(e)||kD(e)||wD(e)||CD()}function ra(e){"@babel/helpers - typeof";return ra=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ra(e)}function _D(e,t){if(ra(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ra(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xD(e){var t=_D(e,"string");return ra(t)=="symbol"?t:t+""}function Uc(e,t,n){return(t=xD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Js.apply(null,arguments)}function Wc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wc(Object(n),!0).forEach(function(r){Uc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SD(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Xs={};function ED(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return Xs[t]||(Xs[t]=SD(e)),Xs[t]}function FD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter(function(o){return o!=="token"}),i=ED(r);return i.reduce(function(o,u){return Dr(Dr({},o),n[u])},t)}function Vc(e){return e.join(" ")}function AD(e,t){var n=0;return function(r){return n+=1,r.map(function(i,o){return zc({node:i,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(o)})})}}function zc(e){var t=e.node,n=e.stylesheet,r=e.style,i=r===void 0?{}:r,o=e.useInlineStyles,u=e.key,c=t.properties,d=t.type,h=t.tagName,m=t.value;if(d==="text")return m;if(h){var v=AD(n,o),y;if(!o)y=Dr(Dr({},c),{},{className:Vc(c.className)});else{var b=Object.keys(n).reduce(function(T,F){return F.split(".").forEach(function(S){T.includes(S)||T.push(S)}),T},[]),k=c.className&&c.className.includes("token")?["token"]:[],x=c.className&&k.concat(c.className.filter(function(T){return!b.includes(T)}));y=Dr(Dr({},c),{},{className:Vc(x)||void 0,style:FD(c.className,Object.assign({},c.style,i),n)})}var C=v(t.children);return M.createElement(h,Js({key:u},y),C)}}const $D=function(e,t){var n=e.listLanguages();return n.indexOf(t)!==-1};var TD=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gc(Object(n),!0).forEach(function(r){Uc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var BD=/\n/g;function ND(e){return e.match(BD)}function jD(e){var t=e.lines,n=e.startingLineNumber,r=e.style;return t.map(function(i,o){var u=o+n;return M.createElement("span",{key:"line-".concat(o),className:"react-syntax-highlighter-line-number",style:typeof r=="function"?r(u):r},"".concat(u,`
|
|
647
648
|
`))})}function PD(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,i=r===void 0?{float:"left",paddingRight:"10px"}:r,o=e.numberStyle,u=o===void 0?{}:o,c=e.startingLineNumber;return M.createElement("code",{style:Object.assign({},n,i)},jD({lines:t.replace(/\n$/,"").split(`
|
|
648
649
|
`),style:u,startingLineNumber:c}))}function LD(e){return"".concat(e.toString().length,".25em")}function Yc(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Kc(e,t,n){var r={display:"inline-block",minWidth:LD(n),paddingRight:"1em",textAlign:"right",userSelect:"none"},i=typeof e=="function"?e(t):e,o=Dn(Dn({},r),i);return o}function ci(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,u=e.lineProps,c=u===void 0?{}:u,d=e.className,h=d===void 0?[]:d,m=e.showLineNumbers,v=e.wrapLongLines,y=e.wrapLines,b=y===void 0?!1:y,k=b?Dn({},typeof c=="function"?c(n):c):{};if(k.className=k.className?[].concat(Ks(k.className.trim().split(/\s+/)),Ks(h)):h,n&&o){var x=Kc(r,n,i);t.unshift(Yc(n,x))}return v&m&&(k.style=Dn({display:"flex"},k.style)),{type:"element",tagName:"span",properties:k,children:t}}function Jc(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=0;r<e.length;r++){var i=e[r];if(i.type==="text")n.push(ci({children:[i],className:Ks(new Set(t))}));else if(i.children){var o=t.concat(i.properties.className);Jc(i.children,o).forEach(function(u){return n.push(u)})}}return n}function OD(e,t,n,r,i,o,u,c,d){var h,m=Jc(e.value),v=[],y=-1,b=0;function k(_,$){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return ci({children:_,lineNumber:$,lineNumberStyle:c,largestLineNumber:u,showInlineLineNumbers:i,lineProps:n,className:P,showLineNumbers:r,wrapLongLines:d,wrapLines:t})}function x(_,$){if(r&&$&&i){var P=Kc(c,$,u);_.unshift(Yc($,P))}return _}function C(_,$){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||P.length>0?k(_,$,P):x(_,$)}for(var T=function(){var $=m[b],P=$.children[0].value,I=ND(P);if(I){var j=P.split(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.10.
|
|
3
|
+
"version": "12.10.4",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@oslokommune/punkt-assets": "^12.7.3",
|
|
50
50
|
"@oslokommune/punkt-css": "^12.10.2",
|
|
51
|
-
"@oslokommune/punkt-elements": "^12.10.
|
|
51
|
+
"@oslokommune/punkt-elements": "^12.10.4",
|
|
52
52
|
"@testing-library/jest-dom": "^6.5.0",
|
|
53
53
|
"@testing-library/react": "^16.0.1",
|
|
54
54
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
112
112
|
},
|
|
113
113
|
"license": "MIT",
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "42ad406e1aa266fc5ac7660545f337c149d463e6"
|
|
115
115
|
}
|