@oslokommune/punkt-elements 12.3.4 → 12.3.8
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/{class-map-QbdgvBsV.js → class-map-Cme3zDHv.js} +1 -1
- package/dist/{class-map-1LSYgumx.cjs → class-map-j1NPDnPL.cjs} +1 -1
- package/dist/{index-C7NOKSUx.cjs → index--Z_thODp.cjs} +1 -1
- package/dist/{index-CSa2k4ML.cjs → index-BoJqccWT.cjs} +5 -5
- package/dist/{index-t0H-gKGh.js → index-CQrIaUIc.js} +1 -1
- package/dist/{index-CGGB6fVA.js → index-D16hQiYU.js} +51 -50
- package/dist/{index-C9AIH4rL.js → index-D1du6BqK.js} +3 -3
- package/dist/{index-B5_qWvbO.cjs → index-xZNrDhoQ.cjs} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +4 -4
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +4 -4
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +4 -4
- package/dist/pkt-component-template.cjs +1 -1
- package/dist/pkt-component-template.js +3 -3
- package/dist/pkt-datepicker.cjs +2 -2
- package/dist/pkt-datepicker.js +32 -29
- package/dist/pkt-element.cjs +1 -1
- package/dist/pkt-element.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +2 -2
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +4 -4
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +4 -4
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +4 -4
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +4 -4
- package/dist/{ref-BK6FYWo3.cjs → ref-B5fRDLdm.cjs} +1 -1
- package/dist/{ref-v9geUvt6.js → ref-CC5SNvNX.js} +1 -1
- package/package.json +2 -2
- package/src/components/element/index.ts +16 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./index-
|
|
1
|
+
"use strict";const a=require("./index-BoJqccWT.cjs"),n=require("./directive-19_ixLKS.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2018 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./index-
|
|
1
|
+
"use strict";const o=require("./index-BoJqccWT.cjs"),n=require("./directive-19_ixLKS.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:Ut,defineProperty:Pt,getOwnPropertyDescriptor:xt,getOwnPropertyNames:Ct,getOwnPropertySymbols:Tt,getPrototypeOf:Mt}=Object,v=globalThis,et=v.trustedTypes,Ot=et?et.emptyScript:"",
|
|
9
|
+
*/const{is:Ut,defineProperty:Pt,getOwnPropertyDescriptor:xt,getOwnPropertyNames:Ct,getOwnPropertySymbols:Tt,getPrototypeOf:Mt}=Object,v=globalThis,et=v.trustedTypes,Ot=et?et.emptyScript:"",q=v.reactiveElementPolyfillSupport,T=(r,t)=>r,D={toAttribute(r,t){switch(t){case Boolean:r=r?Ot:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},K=(r,t)=>!Ut(r,t),st={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:K};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),v.litPropertyMetadata??(v.litPropertyMetadata=new WeakMap);class P extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=st){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Pt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=xt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i==null?void 0:i.call(this)},set(n){const h=i==null?void 0:i.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??st}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=Mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,s=[...Ct(e),...Tt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(tt(i))}else t!==void 0&&e.push(tt(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return wt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var o;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const n=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:D).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),h=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:D;this._$Em=i,this[i]=h.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??K)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,n]of i)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}P.elementStyles=[],P.shadowRootOptions={mode:"open"},P[T("elementProperties")]=new Map,P[T("finalized")]=new Map,q==null||q({ReactiveElement:P}),(v.reactiveElementVersions??(v.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const M=globalThis,
|
|
14
|
-
\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,rt=/-->/g,nt=/>/g,b=RegExp(`>|${
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,at=/"/g,ut=/^(?:script|style|textarea|title)$/i,kt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Nt=kt(1),w=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),ht=new WeakMap,E=S.createTreeWalker(S,129);function mt(r,t){if(!Q(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return it!==void 0?it.createHTML(t):t}const
|
|
13
|
+
*/const M=globalThis,F=M.trustedTypes,it=F?F.createPolicy("lit-html",{createHTML:r=>r}):void 0,Z="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,G="?"+_,Rt=`<${G}>`,S=document,R=()=>S.createComment(""),k=r=>r===null||typeof r!="object"&&typeof r!="function",Q=Array.isArray,pt=r=>Q(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",j=`[
|
|
14
|
+
\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,rt=/-->/g,nt=/>/g,b=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,at=/"/g,ut=/^(?:script|style|textarea|title)$/i,kt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Nt=kt(1),w=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),ht=new WeakMap,E=S.createTreeWalker(S,129);function mt(r,t){if(!Q(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return it!==void 0?it.createHTML(t):t}const ft=(r,t)=>{const e=r.length-1,s=[];let i,o=t===2?"<svg>":t===3?"<math>":"",n=C;for(let h=0;h<e;h++){const a=r[h];let p,y,l=-1,$=0;for(;$<a.length&&(n.lastIndex=$,y=n.exec(a),y!==null);)$=n.lastIndex,n===C?y[1]==="!--"?n=rt:y[1]!==void 0?n=nt:y[2]!==void 0?(ut.test(y[2])&&(i=RegExp("</"+y[2],"g")),n=b):y[3]!==void 0&&(n=b):n===b?y[0]===">"?(n=i??C,l=-1):y[1]===void 0?l=-2:(l=n.lastIndex-y[2].length,p=y[1],n=y[3]===void 0?b:y[3]==='"'?at:ot):n===at||n===ot?n=b:n===rt||n===nt?n=C:(n=b,i=void 0);const A=n===b&&r[h+1].startsWith("/>")?" ":"";o+=n===C?a+Rt:l>=0?(s.push(p),a.slice(0,l)+Z+a.slice(l)+_+A):a+_+(l===-2?h:A)}return[mt(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0;const h=t.length-1,a=this.parts,[p,y]=ft(t,e);if(this.el=N.createElement(p,s),E.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=E.nextNode())!==null&&a.length<h;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(Z)){const $=y[n++],A=i.getAttribute(l).split(_),V=/([.?@])?(.*)/.exec($);a.push({type:1,index:o,name:V[2],strings:A,ctor:V[1]==="."?gt:V[1]==="?"?$t:V[1]==="@"?_t:H}),i.removeAttribute(l)}else l.startsWith(_)&&(a.push({type:6,index:o}),i.removeAttribute(l));if(ut.test(i.tagName)){const l=i.textContent.split(_),$=l.length-1;if($>0){i.textContent=F?F.emptyScript:"";for(let A=0;A<$;A++)i.append(l[A],R()),E.nextNode(),a.push({type:2,index:++o});i.append(l[$],R())}}}else if(i.nodeType===8)if(i.data===G)a.push({type:2,index:o});else{let l=-1;for(;(l=i.data.indexOf(_,l+1))!==-1;)a.push({type:7,index:o}),l+=_.length-1}o++}}static createElement(t,e){const s=S.createElement("template");return s.innerHTML=t,s}}function U(r,t,e=r,s){var n,h;if(t===w)return t;let i=s!==void 0?(n=e.o)==null?void 0:n[s]:e.l;const o=k(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((h=i==null?void 0:i._$AO)==null||h.call(i,!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e.o??(e.o=[]))[s]=i:e.l=i),i!==void 0&&(t=U(r,i._$AS(r,t.values),i,s)),t}class yt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??S).importNode(e,!0);E.currentNode=i;let o=E.nextNode(),n=0,h=0,a=s[0];for(;a!==void 0;){if(n===a.index){let p;a.type===2?p=new x(o,o.nextSibling,this,t):a.type===1?p=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(p=new At(o,this,t)),this._$AV.push(p),a=s[++h]}n!==(a==null?void 0:a.index)&&(o=E.nextNode(),n++)}return E.currentNode=S,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class x{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this.v}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this.v=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=U(this,t,e),k(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==w&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):pt(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!==d&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(mt(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const n=new yt(i,this),h=n.u(this.options);n.p(e),this.T(h),this._$AH=n}}_$AC(t){let e=ht.get(t.strings);return e===void 0&&ht.set(t.strings,e=new N(t)),e}k(t){Q(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new x(this.O(R()),this.O(R()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const o=this.strings;let n=!1;if(o===void 0)t=U(this,t,e,0),n=!k(t)||t!==this._$AH&&t!==w,n&&(this._$AH=t);else{const h=t;let a,p;for(t=o[0],a=0;a<o.length-1;a++)p=U(this,h[s+a],e,a),p===w&&(p=this._$AH[a]),n||(n=!k(p)||p!==this._$AH[a]),p===d?t=d:t!==d&&(t+=(p??"")+o[a+1]),this._$AH[a]=p}n&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class gt extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class $t extends H{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class _t extends H{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=U(this,t,e,0)??d)===w)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class At{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){U(this,t)}}const Ht={M:Z,P:_,A:G,C:1,L:ft,R:yt,D:pt,V:U,I:x,H,N:$t,U:_t,B:gt,F:At},B=M.litHtmlPolyfillSupport;B==null||B(N,x),(M.litHtmlVersions??(M.litHtmlVersions=[])).push("3.2.0");const Vt=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new x(t.insertBefore(R(),o),o,void 0,e??{})}return i._$AI(r),i};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/function vt(r){return c({...r,state:!0,attribute:!1})}var
|
|
27
|
+
*/function vt(r){return c({...r,state:!0,attribute:!1})}var f=[];for(var J=0;J<256;++J)f.push((J+256).toString(16).slice(1));function Dt(r,t=0){return(f[r[t+0]]+f[r[t+1]]+f[r[t+2]]+f[r[t+3]]+"-"+f[r[t+4]]+f[r[t+5]]+"-"+f[r[t+6]]+f[r[t+7]]+"-"+f[r[t+8]]+f[r[t+9]]+"-"+f[r[t+10]]+f[r[t+11]]+f[r[t+12]]+f[r[t+13]]+f[r[t+14]]+f[r[t+15]]).toLowerCase()}var L,Ft=new Uint8Array(16);function qt(){if(!L&&(L=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!L))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(Ft)}var jt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const lt={randomUUID:jt};function bt(r,t,e){if(lt.randomUUID&&!t&&!r)return lt.randomUUID();r=r||{};var s=r.random||(r.rng||qt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Dt(s)}const Bt={hi:"Hei!"},zt={buttonAltText:"Åpne kalender"},Jt={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"},Wt={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."}},g={example:Bt,calendar:zt,dates:Jt,forms:Wt};var Kt=Object.defineProperty,u=(r,t,e,s)=>{for(var i=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=n(t,e,i)||i);return i&&Kt(t,e,i),i};class Y extends O{constructor(){super(),this.strings=g}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}}u([c({type:Object})],Y.prototype,"strings");class m extends Y{constructor(){super(),this.id=bt(),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=g.forms.labels.optional,this.requiredTag=!1,this.requiredText=g.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},g.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},g.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},g.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},g.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},g.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},g.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},g.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 e=new FormData;t.forEach(s=>{e.append(this.name,s)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}onInput(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("input")),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.disabled=!0,this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.manageValidity(this.inputRef.value)}}u([c({type:String,reflect:!0})],m.prototype,"id");u([c({type:String,reflect:!0})],m.prototype,"name");u([c({type:Boolean,reflect:!0})],m.prototype,"required");u([c({type:Boolean,reflect:!0})],m.prototype,"disabled");u([c({type:String,reflect:!0})],m.prototype,"placeholder");u([c({type:Number,reflect:!0})],m.prototype,"min");u([c({type:Number,reflect:!0})],m.prototype,"max");u([c({type:Number,reflect:!0})],m.prototype,"minlength");u([c({type:Number,reflect:!0})],m.prototype,"maxlength");u([c({type:String,reflect:!0})],m.prototype,"pattern");u([c({type:Boolean,reflect:!0})],m.prototype,"optionalTag");u([c({type:String,reflect:!0})],m.prototype,"optionalText");u([c({type:Boolean,reflect:!0})],m.prototype,"requiredTag");u([c({type:String,reflect:!0})],m.prototype,"requiredText");u([c({type:Boolean,reflect:!0})],m.prototype,"hasError");u([c({type:String,reflect:!0})],m.prototype,"errorMessage");u([vt()],m.prototype,"touched");exports.D=d;exports.PktElement=Y;exports.PktInputElement=m;exports.R=w;exports.ke=Nt;exports.n=c;exports.r=vt;exports.si=Ht;exports.translations=g;exports.v4=bt;
|
|
@@ -38,7 +38,7 @@ const bt = (r) => new vt(typeof r == "string" ? r : r + "", void 0, dt), St = (r
|
|
|
38
38
|
* Copyright 2017 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
40
|
*/
|
|
41
|
-
const { is: Et, defineProperty: wt, getOwnPropertyDescriptor: Ut, getOwnPropertyNames: xt, getOwnPropertySymbols: Pt, getPrototypeOf: Ct } = Object, v = globalThis, tt = v.trustedTypes, Tt = tt ? tt.emptyScript : "",
|
|
41
|
+
const { is: Et, defineProperty: wt, getOwnPropertyDescriptor: Ut, getOwnPropertyNames: xt, getOwnPropertySymbols: Pt, getPrototypeOf: Ct } = Object, v = globalThis, tt = v.trustedTypes, Tt = tt ? tt.emptyScript : "", q = v.reactiveElementPolyfillSupport, T = (r, t) => r, D = { toAttribute(r, t) {
|
|
42
42
|
switch (t) {
|
|
43
43
|
case Boolean:
|
|
44
44
|
r = r ? Tt : null;
|
|
@@ -266,26 +266,26 @@ class U extends HTMLElement {
|
|
|
266
266
|
firstUpdated(t) {
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[T("elementProperties")] = /* @__PURE__ */ new Map(), U[T("finalized")] = /* @__PURE__ */ new Map(),
|
|
269
|
+
U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[T("elementProperties")] = /* @__PURE__ */ new Map(), U[T("finalized")] = /* @__PURE__ */ new Map(), q == null || q({ ReactiveElement: U }), (v.reactiveElementVersions ?? (v.reactiveElementVersions = [])).push("2.0.4");
|
|
270
270
|
/**
|
|
271
271
|
* @license
|
|
272
272
|
* Copyright 2017 Google LLC
|
|
273
273
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
274
274
|
*/
|
|
275
|
-
const M = globalThis,
|
|
276
|
-
\f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, rt = />/g, b = RegExp(`>|${
|
|
275
|
+
const M = globalThis, F = M.trustedTypes, st = F ? F.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Z = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, G = "?" + _, Mt = `<${G}>`, E = document, R = () => E.createComment(""), N = (r) => r === null || typeof r != "object" && typeof r != "function", Q = Array.isArray, ct = (r) => Q(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", j = `[
|
|
276
|
+
\f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, rt = />/g, b = RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
|
|
277
277
|
\f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g, pt = /^(?:script|style|textarea|title)$/i, Ot = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), Kt = Ot(1), x = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), S = E.createTreeWalker(E, 129);
|
|
278
278
|
function ut(r, t) {
|
|
279
279
|
if (!Q(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
280
280
|
return st !== void 0 ? st.createHTML(t) : t;
|
|
281
281
|
}
|
|
282
|
-
const
|
|
282
|
+
const mt = (r, t) => {
|
|
283
283
|
const e = r.length - 1, s = [];
|
|
284
284
|
let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = C;
|
|
285
285
|
for (let h = 0; h < e; h++) {
|
|
286
286
|
const a = r[h];
|
|
287
|
-
let d,
|
|
288
|
-
for (; $ < a.length && (n.lastIndex = $,
|
|
287
|
+
let d, y, l = -1, $ = 0;
|
|
288
|
+
for (; $ < a.length && (n.lastIndex = $, y = n.exec(a), y !== null); ) $ = n.lastIndex, n === C ? y[1] === "!--" ? n = it : y[1] !== void 0 ? n = rt : y[2] !== void 0 ? (pt.test(y[2]) && (i = RegExp("</" + y[2], "g")), n = b) : y[3] !== void 0 && (n = b) : n === b ? y[0] === ">" ? (n = i ?? C, l = -1) : y[1] === void 0 ? l = -2 : (l = n.lastIndex - y[2].length, d = y[1], n = y[3] === void 0 ? b : y[3] === '"' ? ot : nt) : n === ot || n === nt ? n = b : n === it || n === rt ? n = C : (n = b, i = void 0);
|
|
289
289
|
const A = n === b && r[h + 1].startsWith("/>") ? " " : "";
|
|
290
290
|
o += n === C ? a + Mt : l >= 0 ? (s.push(d), a.slice(0, l) + Z + a.slice(l) + _ + A) : a + _ + (l === -2 ? h : A);
|
|
291
291
|
}
|
|
@@ -296,7 +296,7 @@ class k {
|
|
|
296
296
|
let i;
|
|
297
297
|
this.parts = [];
|
|
298
298
|
let o = 0, n = 0;
|
|
299
|
-
const h = t.length - 1, a = this.parts, [d,
|
|
299
|
+
const h = t.length - 1, a = this.parts, [d, y] = mt(t, e);
|
|
300
300
|
if (this.el = k.createElement(d, s), S.currentNode = this.el.content, e === 2 || e === 3) {
|
|
301
301
|
const l = this.el.content.firstChild;
|
|
302
302
|
l.replaceWith(...l.childNodes);
|
|
@@ -304,13 +304,13 @@ class k {
|
|
|
304
304
|
for (; (i = S.nextNode()) !== null && a.length < h; ) {
|
|
305
305
|
if (i.nodeType === 1) {
|
|
306
306
|
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(Z)) {
|
|
307
|
-
const $ =
|
|
308
|
-
a.push({ type: 1, index: o, name: V[2], strings: A, ctor: V[1] === "." ?
|
|
307
|
+
const $ = y[n++], A = i.getAttribute(l).split(_), V = /([.?@])?(.*)/.exec($);
|
|
308
|
+
a.push({ type: 1, index: o, name: V[2], strings: A, ctor: V[1] === "." ? yt : V[1] === "?" ? gt : V[1] === "@" ? $t : H }), i.removeAttribute(l);
|
|
309
309
|
} else l.startsWith(_) && (a.push({ type: 6, index: o }), i.removeAttribute(l));
|
|
310
310
|
if (pt.test(i.tagName)) {
|
|
311
311
|
const l = i.textContent.split(_), $ = l.length - 1;
|
|
312
312
|
if ($ > 0) {
|
|
313
|
-
i.textContent =
|
|
313
|
+
i.textContent = F ? F.emptyScript : "";
|
|
314
314
|
for (let A = 0; A < $; A++) i.append(l[A], R()), S.nextNode(), a.push({ type: 2, index: ++o });
|
|
315
315
|
i.append(l[$], R());
|
|
316
316
|
}
|
|
@@ -451,7 +451,7 @@ class H {
|
|
|
451
451
|
t === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
class
|
|
454
|
+
class yt extends H {
|
|
455
455
|
constructor() {
|
|
456
456
|
super(...arguments), this.type = 3;
|
|
457
457
|
}
|
|
@@ -459,7 +459,7 @@ class gt extends H {
|
|
|
459
459
|
this.element[this.name] = t === c ? void 0 : t;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
class
|
|
462
|
+
class gt extends H {
|
|
463
463
|
constructor() {
|
|
464
464
|
super(...arguments), this.type = 4;
|
|
465
465
|
}
|
|
@@ -492,8 +492,8 @@ class _t {
|
|
|
492
492
|
w(this, t);
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
const Zt = { M: Z, P: _, A: G, C: 1, L:
|
|
496
|
-
|
|
495
|
+
const Zt = { M: Z, P: _, A: G, C: 1, L: mt, R: ft, D: ct, V: w, I: P, H, N: gt, U: $t, B: yt, F: _t }, B = M.litHtmlPolyfillSupport;
|
|
496
|
+
B == null || B(k, P), (M.litHtmlVersions ?? (M.litHtmlVersions = [])).push("3.2.0");
|
|
497
497
|
const Rt = (r, t, e) => {
|
|
498
498
|
const s = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
499
499
|
let i = s._$litPart$;
|
|
@@ -578,11 +578,11 @@ function p(r) {
|
|
|
578
578
|
function Ht(r) {
|
|
579
579
|
return p({ ...r, state: !0, attribute: !1 });
|
|
580
580
|
}
|
|
581
|
-
var
|
|
581
|
+
var m = [];
|
|
582
582
|
for (var J = 0; J < 256; ++J)
|
|
583
|
-
|
|
583
|
+
m.push((J + 256).toString(16).slice(1));
|
|
584
584
|
function Vt(r, t = 0) {
|
|
585
|
-
return (
|
|
585
|
+
return (m[r[t + 0]] + m[r[t + 1]] + m[r[t + 2]] + m[r[t + 3]] + "-" + m[r[t + 4]] + m[r[t + 5]] + "-" + m[r[t + 6]] + m[r[t + 7]] + "-" + m[r[t + 8]] + m[r[t + 9]] + "-" + m[r[t + 10]] + m[r[t + 11]] + m[r[t + 12]] + m[r[t + 13]] + m[r[t + 14]] + m[r[t + 15]]).toLowerCase();
|
|
586
586
|
}
|
|
587
587
|
var L, Lt = new Uint8Array(16);
|
|
588
588
|
function It() {
|
|
@@ -594,18 +594,18 @@ var Dt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(cryp
|
|
|
594
594
|
const ht = {
|
|
595
595
|
randomUUID: Dt
|
|
596
596
|
};
|
|
597
|
-
function
|
|
597
|
+
function Ft(r, t, e) {
|
|
598
598
|
if (ht.randomUUID && !t && !r)
|
|
599
599
|
return ht.randomUUID();
|
|
600
600
|
r = r || {};
|
|
601
601
|
var s = r.random || (r.rng || It)();
|
|
602
602
|
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, Vt(s);
|
|
603
603
|
}
|
|
604
|
-
const
|
|
604
|
+
const qt = {
|
|
605
605
|
hi: "Hei!"
|
|
606
|
-
},
|
|
606
|
+
}, jt = {
|
|
607
607
|
buttonAltText: "Åpne kalender"
|
|
608
|
-
},
|
|
608
|
+
}, Bt = {
|
|
609
609
|
days: [
|
|
610
610
|
"Mandag",
|
|
611
611
|
"Tirsdag",
|
|
@@ -674,10 +674,10 @@ const jt = {
|
|
|
674
674
|
date: {
|
|
675
675
|
multiple: "Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."
|
|
676
676
|
}
|
|
677
|
-
},
|
|
678
|
-
example:
|
|
679
|
-
calendar:
|
|
680
|
-
dates:
|
|
677
|
+
}, g = {
|
|
678
|
+
example: qt,
|
|
679
|
+
calendar: jt,
|
|
680
|
+
dates: Bt,
|
|
681
681
|
forms: zt
|
|
682
682
|
};
|
|
683
683
|
var Jt = Object.defineProperty, u = (r, t, e, s) => {
|
|
@@ -690,7 +690,7 @@ class At extends O {
|
|
|
690
690
|
* Add extra stuff here whenever we decide what should be added here…
|
|
691
691
|
*/
|
|
692
692
|
constructor() {
|
|
693
|
-
super(), this.strings =
|
|
693
|
+
super(), this.strings = g;
|
|
694
694
|
}
|
|
695
695
|
/**
|
|
696
696
|
* Runs on mount, used to set up various values and whatever you need to run
|
|
@@ -716,48 +716,49 @@ u([
|
|
|
716
716
|
], At.prototype, "strings");
|
|
717
717
|
class f extends At {
|
|
718
718
|
constructor() {
|
|
719
|
-
super(), this.id =
|
|
719
|
+
super(), this.id = Ft(), 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 = g.forms.labels.optional, this.requiredTag = !1, this.requiredText = g.forms.labels.required, this.hasError = !1, this.errorMessage = "", this.touched = !1, this.internals = this.attachInternals();
|
|
720
720
|
}
|
|
721
721
|
static get formAssociated() {
|
|
722
722
|
return !0;
|
|
723
723
|
}
|
|
724
724
|
manageValidity(t) {
|
|
725
|
-
this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 },
|
|
725
|
+
this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, g.forms.messages.required, t) : t.validity.typeMismatch || t.validity.badInput ? this.internals.setValidity({ typeMismatch: !0 }, g.forms.messages.invalid, t) : t.validity.patternMismatch ? this.internals.setValidity(
|
|
726
726
|
{ patternMismatch: !0 },
|
|
727
|
-
|
|
727
|
+
g.forms.messages.invalidPattern,
|
|
728
728
|
t
|
|
729
|
-
) : t.validity.tooShort || this.minLength > 0 && this.value.length < this.minLength ? this.internals.setValidity({ tooShort: !0 },
|
|
729
|
+
) : t.validity.tooShort || this.minLength > 0 && this.value.length < this.minLength ? this.internals.setValidity({ tooShort: !0 }, g.forms.messages.tooShort, t) : t.validity.tooLong || this.maxLength > 0 && this.value.length > this.maxLength ? this.internals.setValidity({ tooLong: !0 }, g.forms.messages.tooLong, t) : t.validity.rangeUnderflow ? this.internals.setValidity(
|
|
730
730
|
{ rangeUnderflow: !0 },
|
|
731
|
-
|
|
731
|
+
g.forms.messages.rangeUnderflow,
|
|
732
732
|
t
|
|
733
733
|
) : t.validity.rangeOverflow ? this.internals.setValidity(
|
|
734
734
|
{ rangeOverflow: !0 },
|
|
735
|
-
|
|
735
|
+
g.forms.messages.rangeOverflow,
|
|
736
736
|
t
|
|
737
737
|
) : t.validity.customError ? this.internals.setValidity({ customError: !0 }, t.validationMessage, t) : this.internals.setValidity({});
|
|
738
738
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
this.touched = !0;
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
if (!(typeof t != "string" && !Array.isArray(t))) {
|
|
746
|
-
if ((this.range || this.multiple) && !Array.isArray(t) && t.includes(",") && (t = t.split(",")), !this.multiple && !this.range && Array.isArray(t) && (t = t[0]), Array.isArray(t)) {
|
|
739
|
+
setFormValue(t) {
|
|
740
|
+
if (this.internals)
|
|
741
|
+
if (Array.isArray(t)) {
|
|
747
742
|
const e = new FormData();
|
|
748
743
|
t.forEach((s) => {
|
|
749
744
|
e.append(this.name, s);
|
|
750
745
|
}), this.internals.setFormValue(e);
|
|
751
746
|
} else
|
|
752
747
|
this.internals.setFormValue(t);
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
), this.internals.reportValidity();
|
|
748
|
+
}
|
|
749
|
+
// Trigger this when you want to set the value of the input out to the form
|
|
750
|
+
onInput(t) {
|
|
751
|
+
if (!this.touched) {
|
|
752
|
+
this.touched = !0, t && this.setFormValue(t);
|
|
753
|
+
return;
|
|
760
754
|
}
|
|
755
|
+
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("input")), this.dispatchEvent(new Event("change")), this.dispatchEvent(
|
|
756
|
+
new CustomEvent("value-change", {
|
|
757
|
+
detail: t,
|
|
758
|
+
bubbles: !0,
|
|
759
|
+
composed: !0
|
|
760
|
+
})
|
|
761
|
+
), this.internals.reportValidity());
|
|
761
762
|
}
|
|
762
763
|
firstUpdated(t) {
|
|
763
764
|
super.firstUpdated(t), this.required && (this.internals.ariaRequired = !0), this.disabled && (this.internals.disabled = !0, this.internals.ariaDisabled = !0), this.internals.setFormValue(this.value), this.manageValidity(this.inputRef.value);
|
|
@@ -823,6 +824,6 @@ export {
|
|
|
823
824
|
p as n,
|
|
824
825
|
Ht as r,
|
|
825
826
|
Zt as s,
|
|
826
|
-
|
|
827
|
-
|
|
827
|
+
g as t,
|
|
828
|
+
Ft as v
|
|
828
829
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as O, P as $, k as f, D, n as c } from "./index-
|
|
1
|
+
import { r as O, P as $, k as f, D, n as c } from "./index-D16hQiYU.js";
|
|
2
2
|
import { a as b } from "./converters-DNCwIFwr.js";
|
|
3
3
|
import { t as A } from "./directive-DA0-wdk7.js";
|
|
4
|
-
import { R as I } from "./class-map-
|
|
5
|
-
import "./index-
|
|
4
|
+
import { R as I } from "./class-map-Cme3zDHv.js";
|
|
5
|
+
import "./index-CQrIaUIc.js";
|
|
6
6
|
function k(e) {
|
|
7
7
|
const t = Object.prototype.toString.call(e);
|
|
8
8
|
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) : /* @__PURE__ */ new Date(NaN);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./index-
|
|
1
|
+
"use strict";const a=require("./index-BoJqccWT.cjs"),v=require("./converters-DhM11VlY.cjs"),O=require("./directive-19_ixLKS.cjs"),_=require("./class-map-j1NPDnPL.cjs");require("./index--Z_thODp.cjs");function k(i){const e=Object.prototype.toString.call(i);return i instanceof Date||typeof i=="object"&&e==="[object Date]"?new i.constructor(+i):typeof i=="number"||e==="[object Number]"||typeof i=="string"||e==="[object String]"?new Date(i):new Date(NaN)}function w(i,e){return i instanceof Date?new i.constructor(e):new Date(e)}const x=6048e5,$=864e5;let P={};function b(){return P}function m(i,e){var h,c,d,p;const t=b(),s=(e==null?void 0:e.weekStartsOn)??((c=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((p=(d=t.locale)==null?void 0:d.options)==null?void 0:p.weekStartsOn)??0,n=k(i),r=n.getDay(),l=(r<s?7:0)+r-s;return n.setDate(n.getDate()-l),n.setHours(0,0,0,0),n}function S(i,e){const t=k(i.start),s=k(i.end);let n=+t>+s;const r=n?+t:+s,l=n?s:t;l.setHours(0,0,0,0);let h=1;const c=[];for(;+l<=r;)c.push(k(l)),l.setDate(l.getDate()+h),l.setHours(0,0,0,0);return n?c.reverse():c}function M(i,e){var p,u,f,y;const t=k(i),s=t.getFullYear(),n=b(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((y=(f=n.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??1,l=w(i,0);l.setFullYear(s+1,0,r),l.setHours(0,0,0,0);const h=m(l,e),c=w(i,0);c.setFullYear(s,0,r),c.setHours(0,0,0,0);const d=m(c,e);return t.getTime()>=h.getTime()?s+1:t.getTime()>=d.getTime()?s:s-1}function A(i,e){var h,c,d,p;const t=b(),s=(e==null?void 0:e.firstWeekContainsDate)??((c=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((p=(d=t.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??1,n=M(i,e),r=w(i,0);return r.setFullYear(n,0,s),r.setHours(0,0,0,0),m(r,e)}function D(i,e){const t=k(i),s=+m(t,e)-+A(t,e);return Math.round(s/x)+1}function I(i){let t=k(i).getDay();return t===0&&(t=7),t}const T="pkt-calendar",E={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"}},R={"date-selected":{description:"Returns ISO formatted date string"}},g={name:T,"css-class":"pkt-calendar",props:E,events:R};var W=Object.defineProperty,H=Object.getOwnPropertyDescriptor,o=(i,e,t,s)=>{for(var n=s>1?void 0:s?H(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&W(e,t,n),n};exports.PktCalendar=class extends a.PktElement{constructor(){super(),this.multiple=g.props.multiple.default,this.maxMultiple=g.props.maxMultiple.default,this.range=g.props.range.default,this.weeknumbers=g.props.weeknumbers.default,this.withcontrols=g.props.withcontrols.default,this.selected=[],this.earliest=g.props.earliest.default,this.latest=g.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=new Date,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=[]}connectedCallback(){const e=this.currentmonth;this.year=e.getFullYear(),this.month=e.getMonth(),this.week=D(new Date(this.year,this.month,1,12)),this.selected&&this.selected.length&&this.selected.forEach(t=>{this._selected.push(new Date(t))}),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(e,t,s){e==="currentmonth"&&s&&(this.currentmonth=new Date(s),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth(),this.week=D(new Date(this.year,this.month,1,12))),e==="selected"&&s&&(this._selected=[],this.selected.forEach(n=>{this._selected.push(new Date(n))})),super.attributeChangedCallback(e,t,s)}updated(e){if(e.has("selected")&&this.selected.length===2){const t=S({start:new Date(this.selected[0]),end:new Date(this.selected[1])});if(this.inRange={},Array.isArray(t)&&t.length){const s={};for(let n=0;n<t.length;n++)s[this.formatISODate(t[n])]=this.isInRange(t[n]);this.inRange=s}}super.updated(e)}firstUpdated(e){this.addEventListener("keydown",this.handleKeydown)}handleKeydown(e){switch(e.key){case"ArrowLeft":this.handleArrowKey(e,-1);break;case"ArrowRight":this.handleArrowKey(e,1);break;case"ArrowUp":this.handleArrowKey(e,-7);break;case"ArrowDown":this.handleArrowKey(e,7);break}}handleArrowKey(e,t){if(e.preventDefault(),!this.focusedDate)return;const s=new Date(this.focusedDate);let n=new Date(s.setDate(s.getDate()+t));if(n){let r=this.querySelector(`div[data-date="${this.formatISODate(n)}"]`);if(r instanceof HTMLDivElement){if(r.dataset.disabled){let l=new Date(s.setDate(s.getDate()+t)),h=this.querySelector(`div[data-date="${this.formatISODate(l)}"]`);for(;h&&h instanceof HTMLDivElement&&h.dataset.disabled;)l=new Date(l.setDate(l.getDate()+t)),h=this.querySelector(`div[data-date="${this.formatISODate(l)}"]`);r=h}r instanceof HTMLDivElement&&!r.dataset.disabled&&r.focus()}}}render(){return a.ke`
|
|
2
2
|
<div
|
|
3
3
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":a.D}"
|
|
4
4
|
@focusout=${this.closeEvent}
|
package/dist/index.d.ts
CHANGED
|
@@ -292,6 +292,7 @@ declare class PktInputElement extends PktElement {
|
|
|
292
292
|
touched: boolean;
|
|
293
293
|
constructor();
|
|
294
294
|
protected manageValidity(input: HTMLInputElement): void;
|
|
295
|
+
protected setFormValue(value: string | string[]): void;
|
|
295
296
|
protected onInput(value: string | string[]): void;
|
|
296
297
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
297
298
|
}
|
package/dist/pkt-alert.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BoJqccWT.cjs"),p=require("./ref-B5fRDLdm.cjs"),c=require("./class-map-j1NPDnPL.cjs"),k=require("./directive-19_ixLKS.cjs");require("./index--Z_thODp.cjs");var h=Object.defineProperty,u=Object.getOwnPropertyDescriptor,e=(s,r,o,i)=>{for(var l=i>1?void 0:i?u(r,o):r,a=s.length-1,n;a>=0;a--)(n=s[a])&&(l=(i?n(r,o,l):n(l))||l);return i&&l&&h(r,o,l),l};exports.PktAlert=class extends t.PktElement{constructor(){super(),this.defaultSlot=p.ii(),this.closable=!1,this.compact=!1,this.title="",this.skin="info",this.isDisplayed=!0,this.ariaLive="polite",this.closeAlert=!1,this.date="",this.slotController=new p.PktSlotController(this,this.defaultSlot)}handleClose(){this.isDisplayed=!1,this.onClose&&this.onClose()}render(){const r={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-alert--closable":this.closable};return this.isDisplayed?t.ke`
|
|
2
2
|
<div class=${c.Rt(r)} aria-live=${this.ariaLive}>
|
|
3
3
|
<pkt-icon
|
|
4
4
|
class="pkt-alert__icon"
|
package/dist/pkt-alert.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as f, D as a, k as p, n as i } from "./index-
|
|
2
|
-
import { i as d, P as k, K as u } from "./ref-
|
|
3
|
-
import { R as y } from "./class-map-
|
|
1
|
+
import { P as f, D as a, k as p, n as i } from "./index-D16hQiYU.js";
|
|
2
|
+
import { i as d, P as k, K as u } from "./ref-CC5SNvNX.js";
|
|
3
|
+
import { R as y } from "./class-map-Cme3zDHv.js";
|
|
4
4
|
import { t as v } from "./directive-DA0-wdk7.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-CQrIaUIc.js";
|
|
6
6
|
var m = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, e = (l, r, n, o) => {
|
|
7
7
|
for (var s = o > 1 ? void 0 : o ? _(r, n) : r, c = l.length - 1, h; c >= 0; c--)
|
|
8
8
|
(h = l[c]) && (s = (o ? h(r, n, s) : h(s)) || s);
|
package/dist/pkt-calendar.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-BoJqccWT.cjs");require("./converters-DhM11VlY.cjs");require("./directive-19_ixLKS.cjs");require("./class-map-j1NPDnPL.cjs");const e=require("./index-xZNrDhoQ.cjs");require("./index--Z_thODp.cjs");Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>e.PktCalendar});
|
package/dist/pkt-calendar.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-D16hQiYU.js";
|
|
2
2
|
import "./converters-DNCwIFwr.js";
|
|
3
3
|
import "./directive-DA0-wdk7.js";
|
|
4
|
-
import "./class-map-
|
|
5
|
-
import { P as e } from "./index-
|
|
6
|
-
import "./index-
|
|
4
|
+
import "./class-map-Cme3zDHv.js";
|
|
5
|
+
import { P as e } from "./index-D1du6BqK.js";
|
|
6
|
+
import "./index-CQrIaUIc.js";
|
|
7
7
|
export {
|
|
8
8
|
e as PktCalendar
|
|
9
9
|
};
|
package/dist/pkt-card.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BoJqccWT.cjs"),d=require("./ref-B5fRDLdm.cjs"),c=require("./class-map-j1NPDnPL.cjs"),g=require("./directive-19_ixLKS.cjs");require("./index--Z_thODp.cjs");require("./pkt-tag.cjs");const k="pkt-card",u=!0,h={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"]}}},m={default:{description:"Innholdet i kortet"}},l={name:k,"css-class":"pkt-card",isElement:u,props:h,slots:m};var y=Object.defineProperty,b=Object.getOwnPropertyDescriptor,r=(n,i,s,a)=>{for(var e=a>1?void 0:a?b(i,s):i,o=n.length-1,p;o>=0;o--)(p=n[o])&&(e=(a?p(i,s,e):p(e))||e);return a&&e&&y(i,s,e),e};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=d.ii(),this.skin=l.props.skin.default,this.direction=l.props.direction.default,this.image={src:"",alt:""},this.heading="",this.subheading="",this.tags=[],this.slotController=new d.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){const i={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.direction}`]:this.direction};return t.ke`
|
|
2
2
|
<div class=${c.Rt(i)}>
|
|
3
3
|
${this.image.src&&t.ke`
|
|
4
4
|
<div class="pkt-card__image">
|
package/dist/pkt-card.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as g, k as r, D as k, n as a } from "./index-
|
|
2
|
-
import { i as h, P as m, K as u } from "./ref-
|
|
3
|
-
import { R as y } from "./class-map-
|
|
1
|
+
import { P as g, k as r, D as k, n as a } from "./index-D16hQiYU.js";
|
|
2
|
+
import { i as h, P as m, K as u } from "./ref-CC5SNvNX.js";
|
|
3
|
+
import { R as y } from "./class-map-Cme3zDHv.js";
|
|
4
4
|
import { t as f } from "./directive-DA0-wdk7.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-CQrIaUIc.js";
|
|
6
6
|
import "./pkt-tag.js";
|
|
7
7
|
const b = "pkt-card", v = !0, $ = {
|
|
8
8
|
heading: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BoJqccWT.cjs"),h=require("./directive-19_ixLKS.cjs"),r=require("./ref-B5fRDLdm.cjs"),d=require("./class-map-j1NPDnPL.cjs"),c=require("./converters-DhM11VlY.cjs");var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,o=(l,t,s,i)=>{for(var n=i>1?void 0:i?m(t,s):t,a=l.length-1,p;a>=0;a--)(p=l[a])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&u(t,s,n),n};exports.PktComponent=class extends e.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=r.ii(),this.namedSlot=r.ii(),this.slotController=new r.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(t=>{this._list.push(t.toUpperCase())}),super.connectedCallback()}render(){const t={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return e.ke`
|
|
2
2
|
<div class="${d.Rt(t)}">
|
|
3
3
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as m, k as h, t as u, n } from "./index-
|
|
1
|
+
import { P as m, k as h, t as u, n } from "./index-D16hQiYU.js";
|
|
2
2
|
import { t as f } from "./directive-DA0-wdk7.js";
|
|
3
|
-
import { i as d, P as v, K as c } from "./ref-
|
|
4
|
-
import { R as g } from "./class-map-
|
|
3
|
+
import { i as d, P as v, K as c } from "./ref-CC5SNvNX.js";
|
|
4
|
+
import { R as g } from "./class-map-Cme3zDHv.js";
|
|
5
5
|
import { c as k } from "./converters-DNCwIFwr.js";
|
|
6
6
|
var S = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, i = (t, e, l, o) => {
|
|
7
7
|
for (var s = o > 1 ? void 0 : o ? $(e, l) : e, a = t.length - 1, p; a >= 0; a--)
|
package/dist/pkt-datepicker.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CSa2k4ML.cjs"),S=require("./directive-19_ixLKS.cjs"),o=require("./ref-BK6FYWo3.cjs"),M=require("./class-map-1LSYgumx.cjs"),B=require("./converters-DhM11VlY.cjs"),g=require("./index-B5_qWvbO.cjs");require("./pkt-input-wrapper.cjs");require("./index-C7NOKSUx.cjs");require("./pkt-tag.cjs");function R(n){return g.startOfWeek(n,{weekStartsOn:1})}function j(n){const t=g.toDate(n),e=t.getFullYear(),a=g.constructFrom(n,0);a.setFullYear(e+1,0,4),a.setHours(0,0,0,0);const r=R(a),i=g.constructFrom(n,0);i.setFullYear(e,0,4),i.setHours(0,0,0,0);const s=R(i);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function _(n){const t=g.toDate(n);return t.setHours(0,0,0,0),t}function E(n){const t=g.toDate(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function V(n,t){const e=_(n),a=_(t),r=+e-E(e),i=+a-E(a);return Math.round((r-i)/g.millisecondsInDay)}function L(n){const t=j(n),e=g.constructFrom(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),R(e)}function Q(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function X(n){if(!Q(n)&&typeof n!="number")return!1;const t=g.toDate(n);return!isNaN(Number(t))}function G(n){const t=g.toDate(n),e=g.constructFrom(n,0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}const K={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"}},U=(n,t,e)=>{let a;const r=K[n];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+a:a+" ago":a};function C(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const J={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},z={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Z={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tt={date:C({formats:J,defaultWidth:"full"}),time:C({formats:z,defaultWidth:"full"}),dateTime:C({formats:Z,defaultWidth:"full"})},et={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nt=(n,t,e,a)=>et[n];function T(n){return(t,e)=>{const a=e!=null&&e.context?String(e.context):"standalone";let r;if(a==="formatting"&&n.formattingValues){const s=n.defaultFormattingWidth||n.defaultWidth,h=e!=null&&e.width?String(e.width):s;r=n.formattingValues[h]||n.formattingValues[s]}else{const s=n.defaultWidth,h=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[h]||n.values[s]}const i=n.argumentCallback?n.argumentCallback(t):t;return r[i]}}const at={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},it={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"]},st={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"]},ot={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"}},ut={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"}},lt=(n,t)=>{const e=Number(n),a=e%100;if(a>20||a<10)switch(a%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},dt={ordinalNumber:lt,era:T({values:at,defaultWidth:"wide"}),quarter:T({values:rt,defaultWidth:"wide",argumentCallback:n=>n-1}),month:T({values:it,defaultWidth:"wide"}),day:T({values:st,defaultWidth:"wide"}),dayPeriod:T({values:ot,defaultWidth:"wide",formattingValues:ut,defaultFormattingWidth:"wide"})};function $(n){return(t,e={})=>{const a=e.width,r=a&&n.matchPatterns[a]||n.matchPatterns[n.defaultMatchWidth],i=t.match(r);if(!i)return null;const s=i[0],h=a&&n.parsePatterns[a]||n.parsePatterns[n.defaultParseWidth],v=Array.isArray(h)?ht(h,c=>c.test(s)):ct(h,c=>c.test(s));let w;w=n.valueCallback?n.valueCallback(v):v,w=e.valueCallback?e.valueCallback(w):w;const x=t.slice(s.length);return{value:w,rest:x}}}function ct(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function ht(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function mt(n){return(t,e={})=>{const a=t.match(n.matchPattern);if(!a)return null;const r=a[0],i=t.match(n.parsePattern);if(!i)return null;let s=n.valueCallback?n.valueCallback(i[0]):i[0];s=e.valueCallback?e.valueCallback(s):s;const h=t.slice(r.length);return{value:s,rest:h}}}const ft=/^(\d+)(th|st|nd|rd)?/i,pt=/\d+/i,gt={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},yt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wt={any:[/1/i,/2/i,/3/i,/4/i]},kt={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},bt={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]},xt={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},Dt={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]},Pt={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},Ot={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}},Mt={ordinalNumber:mt({matchPattern:ft,parsePattern:pt,valueCallback:n=>parseInt(n,10)}),era:$({matchPatterns:gt,defaultMatchWidth:"wide",parsePatterns:yt,defaultParseWidth:"any"}),quarter:$({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:wt,defaultParseWidth:"any",valueCallback:n=>n+1}),month:$({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:bt,defaultParseWidth:"any"}),day:$({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Dt,defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:Pt,defaultMatchWidth:"any",parsePatterns:Ot,defaultParseWidth:"any"})},Tt={code:"en-US",formatDistance:U,formatLong:tt,formatRelative:nt,localize:dt,match:Mt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $t(n){const t=g.toDate(n);return V(t,G(t))+1}function St(n){const t=g.toDate(n),e=+R(t)-+L(t);return Math.round(e/g.millisecondsInWeek)+1}function u(n,t){const e=n<0?"-":"",a=Math.abs(n).toString().padStart(t,"0");return e+a}const b={y(n,t){const e=n.getFullYear(),a=e>0?e:1-e;return u(t==="yy"?a%100:a,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):u(e+1,2)},d(n,t){return u(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return u(n.getHours()%12||12,t.length)},H(n,t){return u(n.getHours(),t.length)},m(n,t){return u(n.getMinutes(),t.length)},s(n,t){return u(n.getSeconds(),t.length)},S(n,t){const e=t.length,a=n.getMilliseconds(),r=Math.trunc(a*Math.pow(10,e-3));return u(r,t.length)}},O={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(n,t,e){const a=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(a,{width:"abbreviated"});case"GGGGG":return e.era(a,{width:"narrow"});case"GGGG":default:return e.era(a,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const a=n.getFullYear(),r=a>0?a:1-a;return e.ordinalNumber(r,{unit:"year"})}return b.y(n,t)},Y:function(n,t,e,a){const r=g.getWeekYear(n,a),i=r>0?r:1-r;if(t==="YY"){const s=i%100;return u(s,2)}return t==="Yo"?e.ordinalNumber(i,{unit:"year"}):u(i,t.length)},R:function(n,t){const e=j(n);return u(e,t.length)},u:function(n,t){const e=n.getFullYear();return u(e,t.length)},Q:function(n,t,e){const a=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return u(a,2);case"Qo":return e.ordinalNumber(a,{unit:"quarter"});case"QQQ":return e.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(a,{width:"wide",context:"formatting"})}},q:function(n,t,e){const a=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return u(a,2);case"qo":return e.ordinalNumber(a,{unit:"quarter"});case"qqq":return e.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(a,{width:"wide",context:"standalone"})}},M:function(n,t,e){const a=n.getMonth();switch(t){case"M":case"MM":return b.M(n,t);case"Mo":return e.ordinalNumber(a+1,{unit:"month"});case"MMM":return e.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(a,{width:"wide",context:"formatting"})}},L:function(n,t,e){const a=n.getMonth();switch(t){case"L":return String(a+1);case"LL":return u(a+1,2);case"Lo":return e.ordinalNumber(a+1,{unit:"month"});case"LLL":return e.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(a,{width:"wide",context:"standalone"})}},w:function(n,t,e,a){const r=g.getWeek(n,a);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):u(r,t.length)},I:function(n,t,e){const a=St(n);return t==="Io"?e.ordinalNumber(a,{unit:"week"}):u(a,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):b.d(n,t)},D:function(n,t,e){const a=$t(n);return t==="Do"?e.ordinalNumber(a,{unit:"dayOfYear"}):u(a,t.length)},E:function(n,t,e){const a=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(a,{width:"short",context:"formatting"});case"EEEE":default:return e.day(a,{width:"wide",context:"formatting"})}},e:function(n,t,e,a){const r=n.getDay(),i=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return u(i,2);case"eo":return e.ordinalNumber(i,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});case"eeee":default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,a){const r=n.getDay(),i=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return u(i,t.length);case"co":return e.ordinalNumber(i,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});case"cccc":default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const a=n.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return u(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(a,{width:"short",context:"formatting"});case"iiii":default:return e.day(a,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const a=n.getHours();let r;switch(a===12?r=O.noon:a===0?r=O.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const a=n.getHours();let r;switch(a>=17?r=O.evening:a>=12?r=O.afternoon:a>=4?r=O.morning:r=O.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let a=n.getHours()%12;return a===0&&(a=12),e.ordinalNumber(a,{unit:"hour"})}return b.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):b.H(n,t)},K:function(n,t,e){const a=n.getHours()%12;return t==="Ko"?e.ordinalNumber(a,{unit:"hour"}):u(a,t.length)},k:function(n,t,e){let a=n.getHours();return a===0&&(a=24),t==="ko"?e.ordinalNumber(a,{unit:"hour"}):u(a,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):b.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):b.s(n,t)},S:function(n,t){return b.S(n,t)},X:function(n,t,e){const a=n.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return F(a);case"XXXX":case"XX":return P(a);case"XXXXX":case"XXX":default:return P(a,":")}},x:function(n,t,e){const a=n.getTimezoneOffset();switch(t){case"x":return F(a);case"xxxx":case"xx":return P(a);case"xxxxx":case"xxx":default:return P(a,":")}},O:function(n,t,e){const a=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Y(a,":");case"OOOO":default:return"GMT"+P(a,":")}},z:function(n,t,e){const a=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Y(a,":");case"zzzz":default:return"GMT"+P(a,":")}},t:function(n,t,e){const a=Math.trunc(n.getTime()/1e3);return u(a,t.length)},T:function(n,t,e){const a=n.getTime();return u(a,t.length)}};function Y(n,t=""){const e=n>0?"-":"+",a=Math.abs(n),r=Math.trunc(a/60),i=a%60;return i===0?e+String(r):e+String(r)+t+u(i,2)}function F(n,t){return n%60===0?(n>0?"-":"+")+u(Math.abs(n)/60,2):P(n,t)}function P(n,t=""){const e=n>0?"-":"+",a=Math.abs(n),r=u(Math.trunc(a/60),2),i=u(a%60,2);return e+r+t+i}const I=(n,t)=>{switch(n){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"})}},H=(n,t)=>{switch(n){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"})}},Rt=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],a=e[1],r=e[2];if(!r)return I(n,t);let i;switch(a){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",I(a,t)).replace("{{time}}",H(r,t))},Ct={p:H,P:Rt},Wt=/^D+$/,_t=/^Y+$/,Et=["D","DD","YY","YYYY"];function qt(n){return Wt.test(n)}function Yt(n){return _t.test(n)}function Ft(n,t,e){const a=It(n,t,e);if(console.warn(a),Et.includes(n))throw new RangeError(a)}function It(n,t,e){const a=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${a} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Nt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,At=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bt=/^'([^]*?)'?$/,jt=/''/g,Ht=/[a-zA-Z]/;function Vt(n,t,e){var x,c,p,f;const a=g.getDefaultOptions(),r=a.locale??Tt,i=a.firstWeekContainsDate??((c=(x=a.locale)==null?void 0:x.options)==null?void 0:c.firstWeekContainsDate)??1,s=a.weekStartsOn??((f=(p=a.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,h=g.toDate(n);if(!X(h))throw new RangeError("Invalid time value");let v=t.match(At).map(d=>{const m=d[0];if(m==="p"||m==="P"){const D=Ct[m];return D(d,r.formatLong)}return d}).join("").match(Nt).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const m=d[0];if(m==="'")return{isToken:!1,value:Lt(d)};if(q[m])return{isToken:!0,value:d};if(m.match(Ht))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:d}});r.localize.preprocessor&&(v=r.localize.preprocessor(h,v));const w={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return v.map(d=>{if(!d.isToken)return d.value;const m=d.value;(Yt(m)||qt(m))&&Ft(m,t,String(n));const D=q[m[0]];return D(h,m,r.localize,w)}).join("")}function Lt(n){const t=n.match(Bt);return t?t[1].replace(jt,"'"):n}/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-BoJqccWT.cjs"),S=require("./directive-19_ixLKS.cjs"),o=require("./ref-B5fRDLdm.cjs"),M=require("./class-map-j1NPDnPL.cjs"),B=require("./converters-DhM11VlY.cjs"),g=require("./index-xZNrDhoQ.cjs");require("./pkt-input-wrapper.cjs");require("./index--Z_thODp.cjs");require("./pkt-tag.cjs");function R(n){return g.startOfWeek(n,{weekStartsOn:1})}function j(n){const t=g.toDate(n),e=t.getFullYear(),a=g.constructFrom(n,0);a.setFullYear(e+1,0,4),a.setHours(0,0,0,0);const r=R(a),i=g.constructFrom(n,0);i.setFullYear(e,0,4),i.setHours(0,0,0,0);const s=R(i);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function W(n){const t=g.toDate(n);return t.setHours(0,0,0,0),t}function _(n){const t=g.toDate(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function V(n,t){const e=W(n),a=W(t),r=+e-_(e),i=+a-_(a);return Math.round((r-i)/g.millisecondsInDay)}function L(n){const t=j(n),e=g.constructFrom(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),R(e)}function Q(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function X(n){if(!Q(n)&&typeof n!="number")return!1;const t=g.toDate(n);return!isNaN(Number(t))}function G(n){const t=g.toDate(n),e=g.constructFrom(n,0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}const K={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"}},U=(n,t,e)=>{let a;const r=K[n];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+a:a+" ago":a};function C(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const J={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},z={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Z={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tt={date:C({formats:J,defaultWidth:"full"}),time:C({formats:z,defaultWidth:"full"}),dateTime:C({formats:Z,defaultWidth:"full"})},et={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nt=(n,t,e,a)=>et[n];function T(n){return(t,e)=>{const a=e!=null&&e.context?String(e.context):"standalone";let r;if(a==="formatting"&&n.formattingValues){const s=n.defaultFormattingWidth||n.defaultWidth,h=e!=null&&e.width?String(e.width):s;r=n.formattingValues[h]||n.formattingValues[s]}else{const s=n.defaultWidth,h=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[h]||n.values[s]}const i=n.argumentCallback?n.argumentCallback(t):t;return r[i]}}const at={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},it={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"]},st={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"]},ot={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"}},ut={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"}},lt=(n,t)=>{const e=Number(n),a=e%100;if(a>20||a<10)switch(a%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},dt={ordinalNumber:lt,era:T({values:at,defaultWidth:"wide"}),quarter:T({values:rt,defaultWidth:"wide",argumentCallback:n=>n-1}),month:T({values:it,defaultWidth:"wide"}),day:T({values:st,defaultWidth:"wide"}),dayPeriod:T({values:ot,defaultWidth:"wide",formattingValues:ut,defaultFormattingWidth:"wide"})};function $(n){return(t,e={})=>{const a=e.width,r=a&&n.matchPatterns[a]||n.matchPatterns[n.defaultMatchWidth],i=t.match(r);if(!i)return null;const s=i[0],h=a&&n.parsePatterns[a]||n.parsePatterns[n.defaultParseWidth],v=Array.isArray(h)?ht(h,c=>c.test(s)):ct(h,c=>c.test(s));let w;w=n.valueCallback?n.valueCallback(v):v,w=e.valueCallback?e.valueCallback(w):w;const x=t.slice(s.length);return{value:w,rest:x}}}function ct(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function ht(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function mt(n){return(t,e={})=>{const a=t.match(n.matchPattern);if(!a)return null;const r=a[0],i=t.match(n.parsePattern);if(!i)return null;let s=n.valueCallback?n.valueCallback(i[0]):i[0];s=e.valueCallback?e.valueCallback(s):s;const h=t.slice(r.length);return{value:s,rest:h}}}const ft=/^(\d+)(th|st|nd|rd)?/i,pt=/\d+/i,gt={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},yt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wt={any:[/1/i,/2/i,/3/i,/4/i]},kt={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},bt={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]},xt={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},Dt={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]},Pt={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},Ot={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}},Mt={ordinalNumber:mt({matchPattern:ft,parsePattern:pt,valueCallback:n=>parseInt(n,10)}),era:$({matchPatterns:gt,defaultMatchWidth:"wide",parsePatterns:yt,defaultParseWidth:"any"}),quarter:$({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:wt,defaultParseWidth:"any",valueCallback:n=>n+1}),month:$({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:bt,defaultParseWidth:"any"}),day:$({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Dt,defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:Pt,defaultMatchWidth:"any",parsePatterns:Ot,defaultParseWidth:"any"})},Tt={code:"en-US",formatDistance:U,formatLong:tt,formatRelative:nt,localize:dt,match:Mt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $t(n){const t=g.toDate(n);return V(t,G(t))+1}function St(n){const t=g.toDate(n),e=+R(t)-+L(t);return Math.round(e/g.millisecondsInWeek)+1}function u(n,t){const e=n<0?"-":"",a=Math.abs(n).toString().padStart(t,"0");return e+a}const b={y(n,t){const e=n.getFullYear(),a=e>0?e:1-e;return u(t==="yy"?a%100:a,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):u(e+1,2)},d(n,t){return u(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return u(n.getHours()%12||12,t.length)},H(n,t){return u(n.getHours(),t.length)},m(n,t){return u(n.getMinutes(),t.length)},s(n,t){return u(n.getSeconds(),t.length)},S(n,t){const e=t.length,a=n.getMilliseconds(),r=Math.trunc(a*Math.pow(10,e-3));return u(r,t.length)}},O={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(n,t,e){const a=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(a,{width:"abbreviated"});case"GGGGG":return e.era(a,{width:"narrow"});case"GGGG":default:return e.era(a,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const a=n.getFullYear(),r=a>0?a:1-a;return e.ordinalNumber(r,{unit:"year"})}return b.y(n,t)},Y:function(n,t,e,a){const r=g.getWeekYear(n,a),i=r>0?r:1-r;if(t==="YY"){const s=i%100;return u(s,2)}return t==="Yo"?e.ordinalNumber(i,{unit:"year"}):u(i,t.length)},R:function(n,t){const e=j(n);return u(e,t.length)},u:function(n,t){const e=n.getFullYear();return u(e,t.length)},Q:function(n,t,e){const a=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return u(a,2);case"Qo":return e.ordinalNumber(a,{unit:"quarter"});case"QQQ":return e.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(a,{width:"wide",context:"formatting"})}},q:function(n,t,e){const a=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return u(a,2);case"qo":return e.ordinalNumber(a,{unit:"quarter"});case"qqq":return e.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(a,{width:"wide",context:"standalone"})}},M:function(n,t,e){const a=n.getMonth();switch(t){case"M":case"MM":return b.M(n,t);case"Mo":return e.ordinalNumber(a+1,{unit:"month"});case"MMM":return e.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(a,{width:"wide",context:"formatting"})}},L:function(n,t,e){const a=n.getMonth();switch(t){case"L":return String(a+1);case"LL":return u(a+1,2);case"Lo":return e.ordinalNumber(a+1,{unit:"month"});case"LLL":return e.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(a,{width:"wide",context:"standalone"})}},w:function(n,t,e,a){const r=g.getWeek(n,a);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):u(r,t.length)},I:function(n,t,e){const a=St(n);return t==="Io"?e.ordinalNumber(a,{unit:"week"}):u(a,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):b.d(n,t)},D:function(n,t,e){const a=$t(n);return t==="Do"?e.ordinalNumber(a,{unit:"dayOfYear"}):u(a,t.length)},E:function(n,t,e){const a=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(a,{width:"short",context:"formatting"});case"EEEE":default:return e.day(a,{width:"wide",context:"formatting"})}},e:function(n,t,e,a){const r=n.getDay(),i=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return u(i,2);case"eo":return e.ordinalNumber(i,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});case"eeee":default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,a){const r=n.getDay(),i=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return u(i,t.length);case"co":return e.ordinalNumber(i,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});case"cccc":default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const a=n.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return u(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(a,{width:"short",context:"formatting"});case"iiii":default:return e.day(a,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const a=n.getHours();let r;switch(a===12?r=O.noon:a===0?r=O.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const a=n.getHours();let r;switch(a>=17?r=O.evening:a>=12?r=O.afternoon:a>=4?r=O.morning:r=O.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let a=n.getHours()%12;return a===0&&(a=12),e.ordinalNumber(a,{unit:"hour"})}return b.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):b.H(n,t)},K:function(n,t,e){const a=n.getHours()%12;return t==="Ko"?e.ordinalNumber(a,{unit:"hour"}):u(a,t.length)},k:function(n,t,e){let a=n.getHours();return a===0&&(a=24),t==="ko"?e.ordinalNumber(a,{unit:"hour"}):u(a,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):b.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):b.s(n,t)},S:function(n,t){return b.S(n,t)},X:function(n,t,e){const a=n.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return F(a);case"XXXX":case"XX":return P(a);case"XXXXX":case"XXX":default:return P(a,":")}},x:function(n,t,e){const a=n.getTimezoneOffset();switch(t){case"x":return F(a);case"xxxx":case"xx":return P(a);case"xxxxx":case"xxx":default:return P(a,":")}},O:function(n,t,e){const a=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Y(a,":");case"OOOO":default:return"GMT"+P(a,":")}},z:function(n,t,e){const a=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Y(a,":");case"zzzz":default:return"GMT"+P(a,":")}},t:function(n,t,e){const a=Math.trunc(n.getTime()/1e3);return u(a,t.length)},T:function(n,t,e){const a=n.getTime();return u(a,t.length)}};function Y(n,t=""){const e=n>0?"-":"+",a=Math.abs(n),r=Math.trunc(a/60),i=a%60;return i===0?e+String(r):e+String(r)+t+u(i,2)}function F(n,t){return n%60===0?(n>0?"-":"+")+u(Math.abs(n)/60,2):P(n,t)}function P(n,t=""){const e=n>0?"-":"+",a=Math.abs(n),r=u(Math.trunc(a/60),2),i=u(a%60,2);return e+r+t+i}const I=(n,t)=>{switch(n){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"})}},H=(n,t)=>{switch(n){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"})}},Rt=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],a=e[1],r=e[2];if(!r)return I(n,t);let i;switch(a){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",I(a,t)).replace("{{time}}",H(r,t))},Ct={p:H,P:Rt},Et=/^D+$/,Wt=/^Y+$/,_t=["D","DD","YY","YYYY"];function qt(n){return Et.test(n)}function Yt(n){return Wt.test(n)}function Ft(n,t,e){const a=It(n,t,e);if(console.warn(a),_t.includes(n))throw new RangeError(a)}function It(n,t,e){const a=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${a} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Nt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,At=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bt=/^'([^]*?)'?$/,jt=/''/g,Ht=/[a-zA-Z]/;function Vt(n,t,e){var x,c,p,f;const a=g.getDefaultOptions(),r=a.locale??Tt,i=a.firstWeekContainsDate??((c=(x=a.locale)==null?void 0:x.options)==null?void 0:c.firstWeekContainsDate)??1,s=a.weekStartsOn??((f=(p=a.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,h=g.toDate(n);if(!X(h))throw new RangeError("Invalid time value");let v=t.match(At).map(d=>{const m=d[0];if(m==="p"||m==="P"){const D=Ct[m];return D(d,r.formatLong)}return d}).join("").match(Nt).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const m=d[0];if(m==="'")return{isToken:!1,value:Lt(d)};if(q[m])return{isToken:!0,value:d};if(m.match(Ht))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:d}});r.localize.preprocessor&&(v=r.localize.preprocessor(h,v));const w={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return v.map(d=>{if(!d.isToken)return d.value;const m=d.value;(Yt(m)||qt(m))&&Ft(m,t,String(n));const D=q[m[0]];return D(h,m,r.localize,w)}).join("")}function Lt(n){const t=n.match(Bt);return t?t[1].replace(jt,"'"):n}/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const N=(n,t,e)=>{const a=new Map;for(let r=t;r<=e;r++)a.set(n[r],r);return a},Qt=S.e(class extends S.i{constructor(n){if(super(n),n.type!==S.t$1.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let a;e===void 0?e=t:t!==void 0&&(a=t);const r=[],i=[];let s=0;for(const h of n)r[s]=a?a(h,s):s,i[s]=e(h,s),s++;return{values:i,keys:r}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,a]){const r=o.ut(n),{values:i,keys:s}=this.dt(t,e,a);if(!Array.isArray(r))return this.ut=s,i;const h=this.ut??(this.ut=[]),v=[];let w,x,c=0,p=r.length-1,f=0,d=i.length-1;for(;c<=p&&f<=d;)if(r[c]===null)c++;else if(r[p]===null)p--;else if(h[c]===s[f])v[f]=o.ct(r[c],i[f]),c++,f++;else if(h[p]===s[d])v[d]=o.ct(r[p],i[d]),p--,d--;else if(h[c]===s[d])v[d]=o.ct(r[c],i[d]),o.at(n,v[d+1],r[c]),c++,d--;else if(h[p]===s[f])v[f]=o.ct(r[p],i[f]),o.at(n,r[c],r[p]),p--,f++;else if(w===void 0&&(w=N(s,f,d),x=N(h,c,p)),w.has(h[c]))if(w.has(h[p])){const m=x.get(s[f]),D=m!==void 0?r[m]:null;if(D===null){const
|
|
5
|
+
*/const N=(n,t,e)=>{const a=new Map;for(let r=t;r<=e;r++)a.set(n[r],r);return a},Qt=S.e(class extends S.i{constructor(n){if(super(n),n.type!==S.t$1.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let a;e===void 0?e=t:t!==void 0&&(a=t);const r=[],i=[];let s=0;for(const h of n)r[s]=a?a(h,s):s,i[s]=e(h,s),s++;return{values:i,keys:r}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,a]){const r=o.ut(n),{values:i,keys:s}=this.dt(t,e,a);if(!Array.isArray(r))return this.ut=s,i;const h=this.ut??(this.ut=[]),v=[];let w,x,c=0,p=r.length-1,f=0,d=i.length-1;for(;c<=p&&f<=d;)if(r[c]===null)c++;else if(r[p]===null)p--;else if(h[c]===s[f])v[f]=o.ct(r[c],i[f]),c++,f++;else if(h[p]===s[d])v[d]=o.ct(r[p],i[d]),p--,d--;else if(h[c]===s[d])v[d]=o.ct(r[c],i[d]),o.at(n,v[d+1],r[c]),c++,d--;else if(h[p]===s[f])v[f]=o.ct(r[p],i[f]),o.at(n,r[c],r[p]),p--,f++;else if(w===void 0&&(w=N(s,f,d),x=N(h,c,p)),w.has(h[c]))if(w.has(h[p])){const m=x.get(s[f]),D=m!==void 0?r[m]:null;if(D===null){const E=o.at(n,r[c]);o.ct(E,i[f]),v[f]=E}else v[f]=o.ct(D,i[f]),o.at(n,r[c],D),r[m]=null;f++}else o.pt(r[p]),p--;else o.pt(r[c]),c++;for(;f<=d;){const m=o.at(n,v[d+1]);o.ct(m,i[f]),v[f++]=m}for(;c<=p;){const m=r[c++];m!==null&&o.pt(m)}return this.ut=s,o.dt(n,v),l.R}}),Xt="pkt-datepicker",Gt=!0,Kt={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"},id:{type:"string",name:"ID",description:"Unik identifikasjon for datovelgeren"}},Ut={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"}},k={name:Xt,"css-class":"pkt-datepicker",isElement:Gt,props:Kt,events:Ut};var Jt=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,y=(n,t,e,a)=>{for(var r=a>1?void 0:a?zt(t,e):t,i=n.length-1,s;i>=0;i--)(s=n[i])&&(r=(a?s(t,e,r):s(r))||r);return a&&r&&Jt(t,e,r),r};const A=n=>new Promise(t=>setTimeout(t,n));exports.PktDatepicker=class extends l.PktInputElement{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=k.props.helptextDropdownButton.default,this.dateformat=k.props.dateformat.default,this.multiple=k.props.multiple.default,this.maxlength=k.props.maxlength.default,this.range=k.props.range.default,this.weeknumbers=k.props.weeknumbers.default,this.withcontrols=k.props.withcontrols.default,this.fullwidth=!1,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=this.formatISODate(new Date),this.calendarOpen=!1,this.inputRef=o.ii(),this.inputRefTo=o.ii(),this.btnRef=o.ii(),this.calRef=o.ii(),this.popupRef=o.ii(),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=t=>{if(!t)return null;const e=new Date(t);return e.setHours(12,0,0,0),isNaN(e.getTime())?null:e},this.fromISOtoLocal=t=>{const e=new Date(t);return isNaN(e.getTime())?"":Vt(e,this.dateformat)},this.massageDates=t=>{const e=t.map(a=>a??void 0);return this.multiple?e:this.range?e.slice(0,2):[e[0]]},this.addToSelected=t=>{const e=t.target,a=this.min?new Date(this.min):null,r=this.max?new Date(this.max):null,i=new Date(e.value.split(",")[0]);i.setHours(12,0,0,0),i&&!isNaN(i.getTime())&&(!a||i>=a)&&(!r||i<=r)&&this.calRef.value&&this.calRef.value.handleDateSelect(i),e.value=""}}async connectedCallback(){super.connectedCallback(),document&&document.body.addEventListener("click",t=>{var e,a;(e=this.inputRef)!=null&&e.value&&((a=this.btnRef)!=null&&a.value)&&!this.inputRef.value.contains(t.target)&&!(this.inputRefTo.value&&this.inputRefTo.value.contains(t.target))&&!this.btnRef.value.contains(t.target)&&!t.target.closest(".pkt-calendar-popup")&&this.hideCalendar()}),this.value.length&&this._value.length===0&&(this._value=Array.isArray(this.value)?this.value:this.value.split(",")),this.min=this.min||k.props.min.default,this.max=this.max||k.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 A(20),this.handleCalendarPosition())}disconnectedCallback(){super.disconnectedCallback(),document&&document.body.removeEventListener("click",t=>{var e,a;(e=this.inputRef)!=null&&e.value&&((a=this.btnRef)!=null&&a.value)&&!this.inputRef.value.contains(t.target)&&!this.btnRef.value.contains(t.target)&&this.hideCalendar()})}attributeChangedCallback(t,e,a){t==="value"&&(this.value===""||this.value.length===0||typeof this.value>"u"?this._value=[]:this.value.length&&this._value.length===0&&(!Array.isArray(this.value)&&this.value.includes(",")&&(this.value=this.value.split(",")),this._value=Array.isArray(this.value)?this.value:this.value.split(","))),t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=(a==null?void 0:a.split(","))??[]),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=(a==null?void 0:a.split(","))??[]),super.attributeChangedCallback(t,e,a)}firstUpdated(t){super.firstUpdated(t)}updated(t){var e;if(super.updated(t),t.has("value")){if(this.range&&this._value.length===1||((e=t.get("value"))==null?void 0:e.toString())===this.value.toString())return;this.onInput(this.value)}}formatISODate(t){return t.toISOString().split("T")[0]}renderInput(){return l.ke`
|
|
6
6
|
<input
|
|
7
7
|
class="${M.Rt(this.inputClasses)}"
|
|
8
8
|
type="date"
|
package/dist/pkt-datepicker.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { R as K, a as z, k as P, D as N, n as y } from "./index-
|
|
1
|
+
import { R as K, a as z, k as P, D as N, n as y } from "./index-D16hQiYU.js";
|
|
2
2
|
import { e as Z, i as tt, a as et, t as nt } from "./directive-DA0-wdk7.js";
|
|
3
|
-
import { u as at, c as M, a as S, p as F, d as rt, i as C, K as D } from "./ref-
|
|
4
|
-
import { R } from "./class-map-
|
|
3
|
+
import { u as at, c as M, a as S, p as F, d as rt, i as C, K as D } from "./ref-CC5SNvNX.js";
|
|
4
|
+
import { R } from "./class-map-Cme3zDHv.js";
|
|
5
5
|
import { a as G } from "./converters-DNCwIFwr.js";
|
|
6
|
-
import { s as it, t as k, c as
|
|
6
|
+
import { s as it, t as k, c as _, m as st, a as ot, g as ut, b as lt, d as dt } from "./index-D1du6BqK.js";
|
|
7
7
|
import "./pkt-input-wrapper.js";
|
|
8
|
-
import "./index-
|
|
8
|
+
import "./index-CQrIaUIc.js";
|
|
9
9
|
import "./pkt-tag.js";
|
|
10
10
|
function Y(t) {
|
|
11
11
|
return it(t, { weekStartsOn: 1 });
|
|
12
12
|
}
|
|
13
13
|
function U(t) {
|
|
14
|
-
const e = k(t), n = e.getFullYear(), a =
|
|
14
|
+
const e = k(t), n = e.getFullYear(), a = _(t, 0);
|
|
15
15
|
a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
16
|
-
const r = Y(a), i =
|
|
16
|
+
const r = Y(a), i = _(t, 0);
|
|
17
17
|
i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
|
|
18
18
|
const s = Y(i);
|
|
19
19
|
return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >= s.getTime() ? n : n - 1;
|
|
@@ -41,7 +41,7 @@ function ct(t, e) {
|
|
|
41
41
|
return Math.round((r - i) / st);
|
|
42
42
|
}
|
|
43
43
|
function ht(t) {
|
|
44
|
-
const e = U(t), n =
|
|
44
|
+
const e = U(t), n = _(t, 0);
|
|
45
45
|
return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), Y(n);
|
|
46
46
|
}
|
|
47
47
|
function mt(t) {
|
|
@@ -54,7 +54,7 @@ function ft(t) {
|
|
|
54
54
|
return !isNaN(Number(e));
|
|
55
55
|
}
|
|
56
56
|
function pt(t) {
|
|
57
|
-
const e = k(t), n =
|
|
57
|
+
const e = k(t), n = _(t, 0);
|
|
58
58
|
return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
59
59
|
}
|
|
60
60
|
const gt = {
|
|
@@ -166,7 +166,7 @@ const vt = {
|
|
|
166
166
|
nextWeek: "eeee 'at' p",
|
|
167
167
|
other: "P"
|
|
168
168
|
}, Ot = (t, e, n, a) => xt[t];
|
|
169
|
-
function
|
|
169
|
+
function E(t) {
|
|
170
170
|
return (e, n) => {
|
|
171
171
|
const a = n != null && n.context ? String(n.context) : "standalone";
|
|
172
172
|
let r;
|
|
@@ -308,38 +308,38 @@ const Pt = {
|
|
|
308
308
|
return n + "th";
|
|
309
309
|
}, Rt = {
|
|
310
310
|
ordinalNumber: Ct,
|
|
311
|
-
era:
|
|
311
|
+
era: E({
|
|
312
312
|
values: Pt,
|
|
313
313
|
defaultWidth: "wide"
|
|
314
314
|
}),
|
|
315
|
-
quarter:
|
|
315
|
+
quarter: E({
|
|
316
316
|
values: Mt,
|
|
317
317
|
defaultWidth: "wide",
|
|
318
318
|
argumentCallback: (t) => t - 1
|
|
319
319
|
}),
|
|
320
|
-
month:
|
|
320
|
+
month: E({
|
|
321
321
|
values: Dt,
|
|
322
322
|
defaultWidth: "wide"
|
|
323
323
|
}),
|
|
324
|
-
day:
|
|
324
|
+
day: E({
|
|
325
325
|
values: Tt,
|
|
326
326
|
defaultWidth: "wide"
|
|
327
327
|
}),
|
|
328
|
-
dayPeriod:
|
|
328
|
+
dayPeriod: E({
|
|
329
329
|
values: $t,
|
|
330
330
|
defaultWidth: "wide",
|
|
331
331
|
formattingValues: St,
|
|
332
332
|
defaultFormattingWidth: "wide"
|
|
333
333
|
})
|
|
334
334
|
};
|
|
335
|
-
function
|
|
335
|
+
function W(t) {
|
|
336
336
|
return (e, n = {}) => {
|
|
337
337
|
const a = n.width, r = a && t.matchPatterns[a] || t.matchPatterns[t.defaultMatchWidth], i = e.match(r);
|
|
338
338
|
if (!i)
|
|
339
339
|
return null;
|
|
340
|
-
const s = i[0], d = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], g = Array.isArray(d) ?
|
|
340
|
+
const s = i[0], d = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], g = Array.isArray(d) ? Wt(d, (l) => l.test(s)) : (
|
|
341
341
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
342
|
-
|
|
342
|
+
Et(d, (l) => l.test(s))
|
|
343
343
|
);
|
|
344
344
|
let v;
|
|
345
345
|
v = t.valueCallback ? t.valueCallback(g) : g, v = n.valueCallback ? (
|
|
@@ -350,17 +350,17 @@ function _(t) {
|
|
|
350
350
|
return { value: v, rest: x };
|
|
351
351
|
};
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Et(t, e) {
|
|
354
354
|
for (const n in t)
|
|
355
355
|
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
356
356
|
return n;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function Wt(t, e) {
|
|
359
359
|
for (let n = 0; n < t.length; n++)
|
|
360
360
|
if (e(t[n]))
|
|
361
361
|
return n;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function _t(t) {
|
|
364
364
|
return (e, n = {}) => {
|
|
365
365
|
const a = e.match(t.matchPattern);
|
|
366
366
|
if (!a) return null;
|
|
@@ -440,37 +440,37 @@ const Yt = /^(\d+)(th|st|nd|rd)?/i, Ft = /\d+/i, qt = {
|
|
|
440
440
|
night: /night/i
|
|
441
441
|
}
|
|
442
442
|
}, Xt = {
|
|
443
|
-
ordinalNumber:
|
|
443
|
+
ordinalNumber: _t({
|
|
444
444
|
matchPattern: Yt,
|
|
445
445
|
parsePattern: Ft,
|
|
446
446
|
valueCallback: (t) => parseInt(t, 10)
|
|
447
447
|
}),
|
|
448
|
-
era:
|
|
448
|
+
era: W({
|
|
449
449
|
matchPatterns: qt,
|
|
450
450
|
defaultMatchWidth: "wide",
|
|
451
451
|
parsePatterns: It,
|
|
452
452
|
defaultParseWidth: "any"
|
|
453
453
|
}),
|
|
454
|
-
quarter:
|
|
454
|
+
quarter: W({
|
|
455
455
|
matchPatterns: Nt,
|
|
456
456
|
defaultMatchWidth: "wide",
|
|
457
457
|
parsePatterns: At,
|
|
458
458
|
defaultParseWidth: "any",
|
|
459
459
|
valueCallback: (t) => t + 1
|
|
460
460
|
}),
|
|
461
|
-
month:
|
|
461
|
+
month: W({
|
|
462
462
|
matchPatterns: Bt,
|
|
463
463
|
defaultMatchWidth: "wide",
|
|
464
464
|
parsePatterns: Ht,
|
|
465
465
|
defaultParseWidth: "any"
|
|
466
466
|
}),
|
|
467
|
-
day:
|
|
467
|
+
day: W({
|
|
468
468
|
matchPatterns: jt,
|
|
469
469
|
defaultMatchWidth: "wide",
|
|
470
470
|
parsePatterns: Vt,
|
|
471
471
|
defaultParseWidth: "any"
|
|
472
472
|
}),
|
|
473
|
-
dayPeriod:
|
|
473
|
+
dayPeriod: W({
|
|
474
474
|
matchPatterns: Lt,
|
|
475
475
|
defaultMatchWidth: "any",
|
|
476
476
|
parsePatterns: Qt,
|
|
@@ -1388,12 +1388,15 @@ const Q = (t, e, n) => {
|
|
|
1388
1388
|
}
|
|
1389
1389
|
}, ye = {
|
|
1390
1390
|
change: {
|
|
1391
|
-
|
|
1391
|
+
type: "Event",
|
|
1392
|
+
description: "Returnerer valgt dato som streng i ISO-format"
|
|
1392
1393
|
},
|
|
1393
|
-
"value-
|
|
1394
|
+
"value-change": {
|
|
1395
|
+
type: "CustomEvent",
|
|
1394
1396
|
description: "Returnerer en <code>array</code> med valgte datoer i ISO-format"
|
|
1395
1397
|
},
|
|
1396
1398
|
toggleHelpText: {
|
|
1399
|
+
type: "CustomEvent",
|
|
1397
1400
|
description: "Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"
|
|
1398
1401
|
}
|
|
1399
1402
|
}, w = {
|
package/dist/pkt-element.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BoJqccWT.cjs");exports.PktElement=e.PktElement;exports.PktInputElement=e.PktInputElement;
|
package/dist/pkt-element.js
CHANGED
package/dist/pkt-icon.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-BoJqccWT.cjs");require("./directive-19_ixLKS.cjs");const e=require("./index--Z_thODp.cjs");Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>e.PktIcon});
|
package/dist/pkt-icon.js
CHANGED
package/dist/pkt-index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-xZNrDhoQ.cjs"),t=require("./pkt-card.cjs"),r=require("./pkt-component-template.cjs"),n=require("./pkt-datepicker.cjs"),o=require("./index--Z_thODp.cjs"),a=require("./pkt-input-wrapper.cjs"),u=require("./pkt-link.cjs"),c=require("./pkt-messagebox.cjs"),i=require("./pkt-tag.cjs");Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>e.PktCalendar});Object.defineProperty(exports,"PktCard",{enumerable:!0,get:()=>t.PktCard});Object.defineProperty(exports,"PktComponent",{enumerable:!0,get:()=>r.PktComponent});Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>n.PktDatepicker});Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>o.PktIcon});Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>a.PktInputWrapper});Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>u.PktLink});Object.defineProperty(exports,"PktMessagebox",{enumerable:!0,get:()=>c.PktMessagebox});Object.defineProperty(exports,"PktTag",{enumerable:!0,get:()=>i.PktTag});
|
package/dist/pkt-index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as t } from "./index-
|
|
1
|
+
import { P as t } from "./index-D1du6BqK.js";
|
|
2
2
|
import { PktCard as p } from "./pkt-card.js";
|
|
3
3
|
import { PktComponent as P } from "./pkt-component-template.js";
|
|
4
4
|
import { PktDatepicker as x } from "./pkt-datepicker.js";
|
|
5
|
-
import { P as f } from "./index-
|
|
5
|
+
import { P as f } from "./index-CQrIaUIc.js";
|
|
6
6
|
import { PktInputWrapper as s } from "./pkt-input-wrapper.js";
|
|
7
7
|
import { PktLink as c } from "./pkt-link.js";
|
|
8
8
|
import { PktMessagebox as g } from "./pkt-messagebox.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BoJqccWT.cjs"),f=require("./ref-B5fRDLdm.cjs"),c=require("./index--Z_thODp.cjs"),u=require("./class-map-j1NPDnPL.cjs"),$=require("./directive-19_ixLKS.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as w, v as T, D as o, k as i, n as r } from "./index-
|
|
2
|
-
import { i as _, P as D, K as I } from "./ref-
|
|
3
|
-
import { a as f } from "./index-
|
|
4
|
-
import { R as c } from "./class-map-
|
|
1
|
+
import { P as w, v as T, D as o, k as i, n as r } from "./index-D16hQiYU.js";
|
|
2
|
+
import { i as _, P as D, K as I } from "./ref-CC5SNvNX.js";
|
|
3
|
+
import { a as f } from "./index-CQrIaUIc.js";
|
|
4
|
+
import { R as c } from "./class-map-Cme3zDHv.js";
|
|
5
5
|
import { t as S } from "./directive-DA0-wdk7.js";
|
|
6
6
|
/**
|
|
7
7
|
* @license
|
package/dist/pkt-link.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BoJqccWT.cjs"),c=require("./ref-B5fRDLdm.cjs"),k=require("./class-map-j1NPDnPL.cjs"),h=require("./directive-19_ixLKS.cjs");require("./index--Z_thODp.cjs");const f="pkt-link",u=!0,d={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}},m={default:{description:"Innholdet i lenken"}},p={name:f,"css-class":"pkt-link","dark-mode":!0,isElement:u,props:d,slots:m};var P=Object.defineProperty,y=Object.getOwnPropertyDescriptor,i=(s,n,r,o)=>{for(var t=o>1?void 0:o?y(n,r):n,l=s.length-1,a;l>=0;l--)(a=s[l])&&(t=(o?a(n,r,t):a(t))||t);return o&&t&&P(n,r,t),t};exports.PktLink=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.ii(),this.href=p.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=p.props.external.default,this.target=p.props.target.default,this.slotController=new c.PktSlotController(this,this.defaultSlot)}render(){const n={"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 e.ke`<a
|
|
2
2
|
class=${k.Rt(n)}
|
|
3
3
|
href=${this.href}
|
|
4
4
|
@click=${this.handleClick}
|
package/dist/pkt-link.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as f, k, D as h, n as i } from "./index-
|
|
2
|
-
import { i as m, P as d, K as u } from "./ref-
|
|
3
|
-
import { R as P } from "./class-map-
|
|
1
|
+
import { P as f, k, D as h, n as i } from "./index-D16hQiYU.js";
|
|
2
|
+
import { i as m, P as d, K as u } from "./ref-CC5SNvNX.js";
|
|
3
|
+
import { R as P } from "./class-map-Cme3zDHv.js";
|
|
4
4
|
import { t as y } from "./directive-DA0-wdk7.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-CQrIaUIc.js";
|
|
6
6
|
const g = "pkt-link", v = !0, _ = {
|
|
7
7
|
href: {
|
|
8
8
|
name: "URL",
|
package/dist/pkt-messagebox.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BoJqccWT.cjs"),c=require("./ref-B5fRDLdm.cjs"),p=require("./class-map-j1NPDnPL.cjs"),b=require("./directive-19_ixLKS.cjs");require("./index--Z_thODp.cjs");var k=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=(i,o,r,l)=>{for(var t=l>1?void 0:l?u(o,r):o,a=i.length-1,n;a>=0;a--)(n=i[a])&&(t=(l?n(o,r,t):n(t))||t);return l&&t&&k(o,r,t),t};exports.PktMessagebox=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.ii(),this.closable=!1,this.compact=!1,this.title="",this.skin="beige",this.isDisplayed=!0,this.slotController=new c.PktSlotController(this,this.defaultSlot)}handleClose(){this.isDisplayed=!1,this.onClose&&this.onClose()}render(){const o={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable};return this.isDisplayed?e.ke`<div class=${p.Rt(o)}>
|
|
2
2
|
${this.closable?e.ke`<div class="pkt-messagebox__close">
|
|
3
3
|
<button
|
|
4
4
|
@click=${this.handleClose}
|
package/dist/pkt-messagebox.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as m, D as c, k as h, n as o } from "./index-
|
|
2
|
-
import { i as b, P as f, K as k } from "./ref-
|
|
3
|
-
import { R as u } from "./class-map-
|
|
1
|
+
import { P as m, D as c, k as h, n as o } from "./index-D16hQiYU.js";
|
|
2
|
+
import { i as b, P as f, K as k } from "./ref-CC5SNvNX.js";
|
|
3
|
+
import { R as u } from "./class-map-Cme3zDHv.js";
|
|
4
4
|
import { t as y } from "./directive-DA0-wdk7.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-CQrIaUIc.js";
|
|
6
6
|
var d = Object.defineProperty, v = Object.getOwnPropertyDescriptor, s = (l, i, p, r) => {
|
|
7
7
|
for (var e = r > 1 ? void 0 : r ? v(i, p) : i, a = l.length - 1, n; a >= 0; a--)
|
|
8
8
|
(n = l[a]) && (e = (r ? n(i, p, e) : n(e)) || e);
|
package/dist/pkt-tag.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-j1NPDnPL.cjs"),g=require("./directive-19_ixLKS.cjs"),t=require("./index-BoJqccWT.cjs"),o=require("./ref-B5fRDLdm.cjs");require("./index--Z_thODp.cjs");const h="pkt-tag",k={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:"close"}},f={default:{description:"Teksten til tag"}},a={name:h,"css-class":"pkt-tag",props:k,slots:f};var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,e=(n,s,r,l)=>{for(var i=l>1?void 0:l?y(s,r):s,p=n.length-1,c;p>=0;p--)(c=n[p])&&(i=(l?c(s,r,i):c(i))||i);return l&&i&&d(s,r,i),i};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=o.ii(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=a.props.textStyle.default,this.iconName=void 0,this.type=a.props.type.default,this.ariaLabel=a.props.ariaLabel.default,this._isClosed=!1,this.close=s=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("onClose",{detail:{origin:s},bubbles:!0,composed:!0}))},this.slotController=new o.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const s={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},r={"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};return this.closeTag?this._isClosed?t.D:t.ke`
|
|
2
2
|
<button
|
|
3
3
|
class=${u.Rt(r)}
|
|
4
4
|
type=${this.type}
|
package/dist/pkt-tag.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as h } from "./class-map-
|
|
1
|
+
import { R as h } from "./class-map-Cme3zDHv.js";
|
|
2
2
|
import { t as y } from "./directive-DA0-wdk7.js";
|
|
3
|
-
import { r as d, P as g, k as p, D as k, n as i } from "./index-
|
|
4
|
-
import { i as m, P as b, K as f } from "./ref-
|
|
5
|
-
import "./index-
|
|
3
|
+
import { r as d, P as g, k as p, D as k, n as i } from "./index-D16hQiYU.js";
|
|
4
|
+
import { i as m, P as b, K as f } from "./ref-CC5SNvNX.js";
|
|
5
|
+
import "./index-CQrIaUIc.js";
|
|
6
6
|
const S = "pkt-tag", _ = {
|
|
7
7
|
closeTag: {
|
|
8
8
|
type: "boolean",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./index-
|
|
1
|
+
"use strict";const a=require("./index-BoJqccWT.cjs"),$=require("./directive-19_ixLKS.cjs");class p{constructor(e,...s){this.nodes=[],this.host=e,this.host.addController(this),this.slots=s,this.nodes=[]}hostConnected(){Array.from(this.host.childNodes).forEach(e=>{var s;if(e.nodeName==="#text"){if((s=e.nodeValue)!=null&&s.trim()){const i=document==null?void 0:document.createElement("template");i.content.appendChild(e),this.nodes.push(i)}}else this.nodes.push(e)})}hostUpdated(){this.slots.forEach(e=>{if(!e.value)return;const s=e.value.getAttribute("name"),i=this.nodes.flatMap(n=>n.getAttribute&&n.getAttribute("slot")==s?this.nodeFromElement(n,e):[]);i.length&&e.value.replaceChildren(...i)})}nodeFromElement(e,s){var i;return e===((i=s.value)==null?void 0:i.parentNode)?[]:e instanceof HTMLTemplateElement?Array.from(e.content.childNodes):e}}/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.8",
|
|
4
4
|
"description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
56
56
|
},
|
|
57
57
|
"license": "MIT",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "be4a7ca19fb67b079fe05d9901f891a10ebd02d4"
|
|
59
59
|
}
|
|
@@ -157,10 +157,25 @@ export class PktInputElement extends PktElement {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
protected setFormValue(value: string | string[]): void {
|
|
161
|
+
if (this.internals) {
|
|
162
|
+
if (Array.isArray(value)) {
|
|
163
|
+
const form = new FormData()
|
|
164
|
+
value.forEach((v) => {
|
|
165
|
+
form.append(this.name, v)
|
|
166
|
+
})
|
|
167
|
+
this.internals.setFormValue(form)
|
|
168
|
+
} else {
|
|
169
|
+
this.internals.setFormValue(value)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
160
174
|
// Trigger this when you want to set the value of the input out to the form
|
|
161
175
|
protected onInput(value: string | string[]): void {
|
|
162
176
|
if (!this.touched) {
|
|
163
177
|
this.touched = true
|
|
178
|
+
value && this.setFormValue(value)
|
|
164
179
|
return
|
|
165
180
|
}
|
|
166
181
|
if (typeof value !== 'string' && !Array.isArray(value)) {
|
|
@@ -175,15 +190,7 @@ export class PktInputElement extends PktElement {
|
|
|
175
190
|
value = value[0]
|
|
176
191
|
}
|
|
177
192
|
|
|
178
|
-
|
|
179
|
-
const form = new FormData()
|
|
180
|
-
value.forEach((v) => {
|
|
181
|
-
form.append(this.name, v)
|
|
182
|
-
})
|
|
183
|
-
this.internals.setFormValue(form)
|
|
184
|
-
} else {
|
|
185
|
-
this.internals.setFormValue(value)
|
|
186
|
-
}
|
|
193
|
+
this.setFormValue(value)
|
|
187
194
|
|
|
188
195
|
this.manageValidity(this.inputRef.value)
|
|
189
196
|
if (this.inputRef2) {
|