@oslokommune/punkt-elements 12.34.2 → 12.34.3
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/accordion.d.ts +0 -46
- package/dist/{accordionitem-Cg-LZy7n.js → accordionitem-Db-3WiJS.js} +3 -3
- package/dist/{accordionitem-DDnUkCJP.cjs → accordionitem-cvsySqgK.cjs} +1 -1
- package/dist/{alert-BOvwM-m4.js → alert-B5lVS6Qs.js} +5 -5
- package/dist/{alert-B3HuK30R.cjs → alert-DWIElKEZ.cjs} +1 -1
- package/dist/alert.d.ts +0 -46
- package/dist/{backlink-1p-ADrG8.cjs → backlink-HHM21crL.cjs} +1 -1
- package/dist/{backlink-fjBQGFYt.js → backlink-hvyJmwrO.js} +2 -2
- package/dist/backlink.d.ts +0 -46
- package/dist/{button-Cl6psvlo.js → button-B6uRE7uT.js} +2 -2
- package/dist/{button-5tOMyPEx.cjs → button-BNdVIhUp.cjs} +1 -1
- package/dist/button.d.ts +0 -46
- package/dist/{calendar-Bi49Yxom.js → calendar-mTDcujoj.js} +4 -4
- package/dist/{calendar-BU7DqDLG.cjs → calendar-oX4HJomV.cjs} +1 -1
- package/dist/calendar.d.ts +0 -46
- package/dist/{card-Dphjc_iO.js → card-B5zTEmH1.js} +6 -6
- package/dist/{card-a_Cs18EQ.cjs → card-BDcr3PII.cjs} +1 -1
- package/dist/card.d.ts +0 -46
- package/dist/{checkbox-bsBqWqcn.cjs → checkbox-CqatE-eX.cjs} +1 -1
- package/dist/{checkbox-nAnAn0E5.js → checkbox-CyYfA2fu.js} +4 -4
- package/dist/checkbox.d.ts +0 -46
- package/dist/{class-map-BjTUtIEl.cjs → class-map-DCyaICmy.cjs} +1 -1
- package/dist/{class-map-D4QK1bDP.js → class-map-KyMqi0fa.js} +1 -1
- package/dist/{combobox-CKmkM6tY.js → combobox-CELUAZxF.js} +129 -125
- package/dist/combobox-D9NKnao2.cjs +115 -0
- package/dist/combobox.d.ts +0 -46
- package/dist/{datepicker-DarYkBIy.js → datepicker-B6qk_tTl.js} +11 -11
- package/dist/{datepicker-DW6AdQ9X.cjs → datepicker-CskZMUib.cjs} +1 -1
- package/dist/datepicker.d.ts +0 -46
- package/dist/{directive-helpers-CVAnO9Xf.js → directive-helpers-8uS_Izwn.js} +1 -1
- package/dist/{directive-helpers-CQimZ5PA.cjs → directive-helpers-CG7Oxal3.cjs} +1 -1
- package/dist/element-BSypUpzA.cjs +238 -0
- package/dist/{element-J964Wi0N.js → element-DjjF_tEh.js} +6679 -6673
- package/dist/{helptext-qBgH0lvl.js → helptext-BLHAJ1aC.js} +5 -5
- package/dist/{helptext-OW48aGy8.cjs → helptext-CCnYxYA9.cjs} +1 -1
- package/dist/helptext.d.ts +0 -46
- package/dist/{icon-kSv2VoAB.js → icon-Beoxup8E.js} +1 -1
- package/dist/{icon-Cc4gVHxd.cjs → icon-BnKGwYjj.cjs} +1 -1
- package/dist/icon.d.ts +0 -46
- package/dist/{if-defined-DEXc_i_J.js → if-defined-BErSJCeJ.js} +1 -1
- package/dist/{if-defined-ZR_9IQ1L.cjs → if-defined-a3sotaUr.cjs} +1 -1
- package/dist/index.d.ts +0 -46
- package/dist/{input-element-BoUU9kvo.js → input-element-Bic-t96S.js} +2 -2
- package/dist/{input-element-BYE0qiMh.cjs → input-element-C9ma8cdz.cjs} +1 -1
- package/dist/{input-wrapper-CZI_ibQL.js → input-wrapper-CeeNYbDA.js} +6 -6
- package/dist/{input-wrapper-DmVnotQ2.cjs → input-wrapper-Cn929YTV.cjs} +1 -1
- package/dist/input-wrapper.d.ts +0 -46
- package/dist/{link-D1Nr-VBI.js → link-BYI8VNGd.js} +4 -4
- package/dist/{link-3uccc2MM.cjs → link-CnibgS3c.cjs} +1 -1
- package/dist/link.d.ts +0 -46
- package/dist/{linkcard-CTNdTxvV.js → linkcard--zuuAt_v.js} +3 -3
- package/dist/{linkcard-P1I3dzQb.cjs → linkcard-DPGX1kb1.cjs} +1 -1
- package/dist/linkcard.d.ts +0 -46
- package/dist/{listbox-B4tiuVzB.js → listbox-C1oYnM-t.js} +5 -5
- package/dist/{listbox-BQu6MjAp.cjs → listbox-DqpGh7eq.cjs} +1 -1
- package/dist/listbox.d.ts +0 -46
- package/dist/{loader-CM7wLajY.cjs → loader-BN4q8pSl.cjs} +1 -1
- package/dist/{loader-C0zNKIJ0.js → loader-DgIiyYBl.js} +5 -5
- package/dist/loader.d.ts +0 -46
- package/dist/{messagebox-CD8fS0Ym.cjs → messagebox-BWJr42m9.cjs} +1 -1
- package/dist/{messagebox-DyLx08sr.js → messagebox-cme5VbUM.js} +5 -5
- package/dist/messagebox.d.ts +0 -46
- package/dist/{modal-Dnv6Y4Nv.js → modal-B-varrJT.js} +5 -5
- package/dist/{modal-DOCsiHGv.cjs → modal-cPcTJriW.cjs} +1 -1
- package/dist/modal.d.ts +0 -46
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +27 -27
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{progressbar-D3sqQ5g1.js → progressbar-BKt_aj7f.js} +5 -5
- package/dist/{progressbar-BmI-K95y.cjs → progressbar-DiRfScnB.cjs} +1 -1
- package/dist/progressbar.d.ts +0 -46
- package/dist/{radiobutton-CJYNTtFF.cjs → radiobutton-CIW0FvT8.cjs} +1 -1
- package/dist/{radiobutton-Bat-fmTh.js → radiobutton-DtHuz7qn.js} +5 -5
- package/dist/radiobutton.d.ts +0 -46
- package/dist/{ref-BbKbXwub.cjs → ref-BvbyvXRH.cjs} +2 -2
- package/dist/{ref-3rhflVgg.js → ref-iIffqQAI.js} +10 -10
- package/dist/{repeat-DK_E7chz.cjs → repeat-BnuruAat.cjs} +1 -1
- package/dist/{repeat-CTBD0h6a.js → repeat-D4kMediE.js} +2 -2
- package/dist/{select-Swc0c6lZ.cjs → select-BJziJVde.cjs} +1 -1
- package/dist/{select-CVWm9dL1.js → select-DbRLz-7l.js} +6 -6
- package/dist/select.d.ts +0 -46
- package/dist/{state-y7tCw3bg.cjs → state-B5KCNjEd.cjs} +1 -1
- package/dist/{state-fdb9lRrL.js → state-BtbpSrdV.js} +1 -1
- package/dist/{tag-Dizhf3tl.js → tag-CGnj4c1Z.js} +6 -6
- package/dist/{tag-Dg2-c_OZ.cjs → tag-CgkUxA5D.cjs} +1 -1
- package/dist/tag.d.ts +0 -46
- package/dist/{textarea-DkQfMu1d.js → textarea-CiA4IzMs.js} +9 -9
- package/dist/{textarea-go_AyeP-.cjs → textarea-qX4Inr1X.cjs} +1 -1
- package/dist/textarea.d.ts +0 -46
- package/dist/{textinput-FvLq5W70.cjs → textinput-BlsgLNwW.cjs} +1 -1
- package/dist/{textinput-CyJB8IDv.js → textinput-CrxjZNEq.js} +8 -8
- package/dist/textinput.d.ts +0 -46
- package/package.json +3 -3
- package/src/components/combobox/combobox.ts +17 -3
- package/dist/combobox-DqHwVglB.cjs +0 -115
- package/dist/element-BYpg5e6C.cjs +0 -238
package/dist/accordion.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { e as y } from "./class-map-
|
|
1
|
+
import { i as k, x as u, n as s, a as f, P as _ } from "./element-DjjF_tEh.js";
|
|
2
|
+
import { e as y } from "./class-map-KyMqi0fa.js";
|
|
3
3
|
import { P as v } from "./pkt-slot-controller-DFrc5O93.js";
|
|
4
|
-
import { e as m, n as h } from "./ref-
|
|
4
|
+
import { e as m, n as h } from "./ref-iIffqQAI.js";
|
|
5
5
|
var $ = Object.defineProperty, P = Object.getOwnPropertyDescriptor, d = (e, o, c, i) => {
|
|
6
6
|
for (var t = i > 1 ? void 0 : i ? P(o, c) : o, a = e.length - 1, n; a >= 0; a--)
|
|
7
7
|
(n = e[a]) && (t = (i ? n(o, c, t) : n(t)) || t);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./element-
|
|
1
|
+
"use strict";const e=require("./element-BSypUpzA.cjs"),h=require("./class-map-DCyaICmy.cjs"),m=require("./pkt-slot-controller-plQxXRvV.cjs"),d=require("./ref-BvbyvXRH.cjs");var f=Object.defineProperty,k=Object.getOwnPropertyDescriptor,u=(o,i,n,r)=>{for(var t=r>1?void 0:r?k(i,n):i,s=o.length-1,a;s>=0;s--)(a=o[s])&&(t=(r?a(i,n,t):a(t))||t);return r&&t&&f(i,n,t),t};let l=class extends e.i{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless"}updated(o){o.has("skin")&&this.requestUpdate()}render(){const o={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return e.x`
|
|
2
2
|
<div
|
|
3
3
|
part="container"
|
|
4
4
|
class=${h.e(o)}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { e as u } from "./class-map-
|
|
2
|
-
import { P as f, E as h, x as p, n as l, a as v } from "./element-
|
|
3
|
-
import { r as k } from "./state-
|
|
1
|
+
import { e as u } from "./class-map-KyMqi0fa.js";
|
|
2
|
+
import { P as f, E as h, x as p, n as l, a as v } from "./element-DjjF_tEh.js";
|
|
3
|
+
import { r as k } from "./state-BtbpSrdV.js";
|
|
4
4
|
import { P as m } from "./pkt-slot-controller-DFrc5O93.js";
|
|
5
|
-
import { e as _, n as b } from "./ref-
|
|
5
|
+
import { e as _, n as b } from "./ref-iIffqQAI.js";
|
|
6
6
|
import { u as C } from "./classutils-RQs1k6D9.js";
|
|
7
|
-
import "./icon-
|
|
7
|
+
import "./icon-Beoxup8E.js";
|
|
8
8
|
const y = {
|
|
9
9
|
skin: {
|
|
10
10
|
default: "info"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const c=require("./class-map-
|
|
1
|
+
"use strict";const c=require("./class-map-DCyaICmy.cjs"),e=require("./element-BSypUpzA.cjs"),u=require("./state-B5KCNjEd.cjs"),h=require("./pkt-slot-controller-plQxXRvV.cjs"),d=require("./ref-BvbyvXRH.cjs"),k=require("./classutils-BwNK82ZQ.cjs");require("./icon-BnKGwYjj.cjs");const v={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},a={props:v};var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,i=(o,t,s,l)=>{for(var r=l>1?void 0:l?_(t,s):t,p=o.length-1,n;p>=0;p--)(n=o[p])&&(r=(l?n(t,s,r):n(r))||r);return l&&r&&f(t,s,r),r};exports.PktAlert=class extends e.PktElement{constructor(){super(),this.defaultSlot=d.e(),this.compact=a.props.compact.default,this.title="",this.skin=a.props.skin.default,this.ariaLive=a.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=a.props.closeAlert.default,this.date=null,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new h.PktSlotController(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,s,l){t==="ariaLive"&&(this["aria-live"]=l),super.attributeChangedCallback(t,s,l)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},s={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return e.x`
|
|
2
2
|
<div class=${c.e(t)}>
|
|
3
3
|
<div class=${c.e(s)}>
|
|
4
4
|
<pkt-icon
|
package/dist/alert.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("./element-
|
|
1
|
+
"use strict";const i=require("./element-BSypUpzA.cjs"),c=require("./if-defined-a3sotaUr.cjs");var p=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=(k,t,a,r)=>{for(var e=r>1?void 0:r?o(t,a):t,l=k.length-1,s;l>=0;l--)(s=k[l])&&(e=(r?s(t,a,e):s(e))||e);return r&&e&&p(t,a,e),e};exports.PktBackLink=class extends i.PktElement{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,a,r){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,a,r)}render(){return i.x`<nav
|
|
2
2
|
class="pkt-back-link"
|
|
3
3
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
4
4
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as c, x as k, n as o, a as f } from "./element-
|
|
2
|
-
import { o as h } from "./if-defined-
|
|
1
|
+
import { P as c, x as k, n as o, a as f } from "./element-DjjF_tEh.js";
|
|
2
|
+
import { o as h } from "./if-defined-BErSJCeJ.js";
|
|
3
3
|
var b = Object.defineProperty, u = Object.getOwnPropertyDescriptor, s = (t, r, i, l) => {
|
|
4
4
|
for (var e = l > 1 ? void 0 : l ? u(r, i) : r, n = t.length - 1, p; n >= 0; n--)
|
|
5
5
|
(p = t[n]) && (e = (l ? p(r, i, e) : p(e)) || e);
|
package/dist/backlink.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as s, P as c, E as p, x as l, a as u } from "./element-
|
|
1
|
+
import { n as s, P as c, E as p, x as l, a as u } from "./element-DjjF_tEh.js";
|
|
2
2
|
import { P as b } from "./pkt-slot-controller-DFrc5O93.js";
|
|
3
|
-
import { e as f, n as k } from "./ref-
|
|
3
|
+
import { e as f, n as k } from "./ref-iIffqQAI.js";
|
|
4
4
|
var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor, e = (t, n, r, o) => {
|
|
5
5
|
for (var a = o > 1 ? void 0 : o ? y(n, r) : n, d = t.length - 1, h; d >= 0; d--)
|
|
6
6
|
(h = t[d]) && (a = (o ? h(n, r, a) : h(a)) || a);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./element-
|
|
1
|
+
"use strict";const e=require("./element-BSypUpzA.cjs"),h=require("./pkt-slot-controller-plQxXRvV.cjs"),d=require("./ref-BvbyvXRH.cjs");var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,i=(r,t,s,o)=>{for(var n=o>1?void 0:o?u(t,s):t,a=r.length-1,l;a>=0;a--)(l=r[a])&&(n=(o?l(t,s,n):l(n))||n);return o&&n&&p(t,s,n),n};exports.PktButton=class extends e.PktElement{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=d.e(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.slotController=new h.PktSlotController(this,this.defaultSlot),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}updated(t){super.updated(t),this.setAttribute("role","button"),this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.removeAttribute("aria-disabled")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return e.x`
|
|
2
2
|
<div class="pkt-contents">
|
|
3
3
|
${this.isLoading?e.x`<pkt-icon
|
|
4
4
|
class="pkt-btn__icon pkt-btn__spinner"
|
package/dist/button.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { e as ht } from "./class-map-
|
|
2
|
-
import { P as dt, E as I, x as D, n as m, a as ft } from "./element-
|
|
3
|
-
import { r as _ } from "./state-
|
|
4
|
-
import "./icon-
|
|
1
|
+
import { e as ht } from "./class-map-KyMqi0fa.js";
|
|
2
|
+
import { P as dt, E as I, x as D, n as m, a as ft } from "./element-DjjF_tEh.js";
|
|
3
|
+
import { r as _ } from "./state-BtbpSrdV.js";
|
|
4
|
+
import "./icon-Beoxup8E.js";
|
|
5
5
|
const at = 6048e5, mt = 864e5, gt = 36e5, X = Symbol.for("constructDateFrom");
|
|
6
6
|
function S(t, e) {
|
|
7
7
|
return typeof t == "function" ? t(e) : t && typeof t == "object" && X in t ? t[X](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const lt=require("./class-map-BjTUtIEl.cjs"),o=require("./element-BYpg5e6C.cjs"),F=require("./state-y7tCw3bg.cjs");require("./icon-Cc4gVHxd.cjs");const et=6048e5,ut=864e5,ht=36e5,Q=Symbol.for("constructDateFrom");function D(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Q in n?n[Q](t):n instanceof Date?new n.constructor(t):new Date(t)}function v(n,t){return D(t||n,n)}function L(n,t,e){const r=v(n,e==null?void 0:e.in);return isNaN(t)?D(n,NaN):(t&&r.setDate(r.getDate()+t),r)}function dt(n,t,e){return D(n,+v(n)+t)}function $(n,t,e){return dt(n,t*ht)}let ft={};function _(){return ft}function A(n,t){var c,l,u,f;const e=_(),r=(t==null?void 0:t.weekStartsOn)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,a=v(n,t==null?void 0:t.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function I(n,t){return A(n,{...t,weekStartsOn:1})}function nt(n,t){const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=D(e,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=I(a),i=D(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const c=I(i);return e.getTime()>=s.getTime()?r+1:e.getTime()>=c.getTime()?r:r-1}function j(n){const t=v(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 rt(n,...t){const e=D.bind(null,t.find(r=>typeof r=="object"));return t.map(e)}function G(n,t){const e=v(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function mt(n,t,e){const[r,a]=rt(e==null?void 0:e.in,n,t),s=G(r),i=G(a),c=+s-j(s),l=+i-j(i);return Math.round((c-l)/ut)}function gt(n,t){const e=nt(n,t),r=D(n,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),I(r)}function yt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function pt(n){return!(!yt(n)&&typeof n!="number"||isNaN(+v(n)))}function wt(n,t){const[e,r]=rt(n,t.start,t.end);return{start:e,end:r}}function R(n,t){const{start:e,end:r}=wt(t==null?void 0:t.in,n);let a=+e>+r;const s=a?+e:+r,i=a?r:e;i.setHours(0,0,0,0);let c=1;const l=[];for(;+i<=s;)l.push(D(e,i)),i.setDate(i.getDate()+c),i.setHours(0,0,0,0);return a?l.reverse():l}function bt(n,t){const e=v(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const kt={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"}},vt=(n,t,e)=>{let r;const a=kt[n];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r};function U(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Dt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},St={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Mt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xt={date:U({formats:Dt,defaultWidth:"full"}),time:U({formats:St,defaultWidth:"full"}),dateTime:U({formats:Mt,defaultWidth:"full"})},Pt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tt=(n,t,e,r)=>Pt[n];function E(n){return(t,e)=>{const r=e!=null&&e.context?String(e.context):"standalone";let a;if(r==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,c=e!=null&&e.width?String(e.width):i;a=n.formattingValues[c]||n.formattingValues[i]}else{const i=n.defaultWidth,c=e!=null&&e.width?String(e.width):n.defaultWidth;a=n.values[c]||n.values[i]}const s=n.argumentCallback?n.argumentCallback(t):t;return a[s]}}const Ot={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ct={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$t={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"]},Et={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"]},Wt={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"}},Nt={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"}},Yt=(n,t)=>{const e=Number(n),r=e%100;if(r>20||r<10)switch(r%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},At={ordinalNumber:Yt,era:E({values:Ot,defaultWidth:"wide"}),quarter:E({values:Ct,defaultWidth:"wide",argumentCallback:n=>n-1}),month:E({values:$t,defaultWidth:"wide"}),day:E({values:Et,defaultWidth:"wide"}),dayPeriod:E({values:Wt,defaultWidth:"wide",formattingValues:Nt,defaultFormattingWidth:"wide"})};function W(n){return(t,e={})=>{const r=e.width,a=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],c=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(c)?Ht(c,p=>p.test(i)):Ft(c,p=>p.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const f=t.slice(i.length);return{value:u,rest:f}}}function Ft(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 It(n){return(t,e={})=>{const r=t.match(n.matchPattern);if(!r)return null;const a=r[0],s=t.match(n.parsePattern);if(!s)return null;let i=n.valueCallback?n.valueCallback(s[0]):s[0];i=e.valueCallback?e.valueCallback(i):i;const c=t.slice(a.length);return{value:i,rest:c}}}const _t=/^(\d+)(th|st|nd|rd)?/i,qt=/\d+/i,Lt={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},Rt={any:[/^b/i,/^(a|c)/i]},Ut={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zt={any:[/1/i,/2/i,/3/i,/4/i]},Bt={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},Qt={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]},jt={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},Gt={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]},Xt={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},Vt={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}},Jt={ordinalNumber:It({matchPattern:_t,parsePattern:qt,valueCallback:n=>parseInt(n,10)}),era:W({matchPatterns:Lt,defaultMatchWidth:"wide",parsePatterns:Rt,defaultParseWidth:"any"}),quarter:W({matchPatterns:Ut,defaultMatchWidth:"wide",parsePatterns:zt,defaultParseWidth:"any",valueCallback:n=>n+1}),month:W({matchPatterns:Bt,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:W({matchPatterns:jt,defaultMatchWidth:"wide",parsePatterns:Gt,defaultParseWidth:"any"}),dayPeriod:W({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:Vt,defaultParseWidth:"any"})},Kt={code:"en-US",formatDistance:vt,formatLong:xt,formatRelative:Tt,localize:At,match:Jt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zt(n,t){const e=v(n,t==null?void 0:t.in);return mt(e,bt(e))+1}function te(n,t){const e=v(n,t==null?void 0:t.in),r=+I(e)-+gt(e);return Math.round(r/et)+1}function at(n,t){var f,p,w,m;const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=_(),s=(t==null?void 0:t.firstWeekContainsDate)??((p=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(w=a.locale)==null?void 0:w.options)==null?void 0:m.firstWeekContainsDate)??1,i=D((t==null?void 0:t.in)||n,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const c=A(i,t),l=D((t==null?void 0:t.in)||n,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=A(l,t);return+e>=+c?r+1:+e>=+u?r:r-1}function ee(n,t){var c,l,u,f;const e=_(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,a=at(n,t),s=D((t==null?void 0:t.in)||n,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),A(s,t)}function st(n,t){const e=v(n,t==null?void 0:t.in),r=+A(e,t)-+ee(e,t);return Math.round(r/et)+1}function h(n,t){const e=n<0?"-":"",r=Math.abs(n).toString().padStart(t,"0");return e+r}const x={y(n,t){const e=n.getFullYear(),r=e>0?e:1-e;return h(t==="yy"?r%100:r,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):h(e+1,2)},d(n,t){return h(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 h(n.getHours()%12||12,t.length)},H(n,t){return h(n.getHours(),t.length)},m(n,t){return h(n.getMinutes(),t.length)},s(n,t){return h(n.getSeconds(),t.length)},S(n,t){const e=t.length,r=n.getMilliseconds(),a=Math.trunc(r*Math.pow(10,e-3));return h(a,t.length)}},C={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},X={G:function(n,t,e){const r=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const r=n.getFullYear(),a=r>0?r:1-r;return e.ordinalNumber(a,{unit:"year"})}return x.y(n,t)},Y:function(n,t,e,r){const a=at(n,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return h(i,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):h(s,t.length)},R:function(n,t){const e=nt(n);return h(e,t.length)},u:function(n,t){const e=n.getFullYear();return h(e,t.length)},Q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return h(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return h(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,t,e){const r=n.getMonth();switch(t){case"M":case"MM":return x.M(n,t);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(n,t,e){const r=n.getMonth();switch(t){case"L":return String(r+1);case"LL":return h(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(n,t,e,r){const a=st(n,r);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):h(a,t.length)},I:function(n,t,e){const r=te(n);return t==="Io"?e.ordinalNumber(r,{unit:"week"}):h(r,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):x.d(n,t)},D:function(n,t,e){const r=Zt(n);return t==="Do"?e.ordinalNumber(r,{unit:"dayOfYear"}):h(r,t.length)},E:function(n,t,e){const r=n.getDay();switch(t){case"E":case"EE":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"})}},e:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return h(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return h(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(n,t,e){const r=n.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return h(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(n,t,e){const a=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(n,t,e){const r=n.getHours();let a;switch(r===12?a=C.noon:r===0?a=C.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(n,t,e){const r=n.getHours();let a;switch(r>=17?a=C.evening:r>=12?a=C.afternoon:r>=4?a=C.morning:a=C.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let r=n.getHours()%12;return r===0&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return x.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):x.H(n,t)},K:function(n,t,e){const r=n.getHours()%12;return t==="Ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},k:function(n,t,e){let r=n.getHours();return r===0&&(r=24),t==="ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):x.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):x.s(n,t)},S:function(n,t){return x.S(n,t)},X:function(n,t,e){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return J(r);case"XXXX":case"XX":return O(r);case"XXXXX":case"XXX":default:return O(r,":")}},x:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"x":return J(r);case"xxxx":case"xx":return O(r);case"xxxxx":case"xxx":default:return O(r,":")}},O:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+V(r,":");case"OOOO":default:return"GMT"+O(r,":")}},z:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+V(r,":");case"zzzz":default:return"GMT"+O(r,":")}},t:function(n,t,e){const r=Math.trunc(+n/1e3);return h(r,t.length)},T:function(n,t,e){return h(+n,t.length)}};function V(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=Math.trunc(r/60),s=r%60;return s===0?e+String(a):e+String(a)+t+h(s,2)}function J(n,t){return n%60===0?(n>0?"-":"+")+h(Math.abs(n)/60,2):O(n,t)}function O(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=h(Math.trunc(r/60),2),s=h(r%60,2);return e+a+t+s}const K=(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"})}},it=(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"})}},ne=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],r=e[1],a=e[2];if(!a)return K(n,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",K(r,t)).replace("{{time}}",it(a,t))},re={p:it,P:ne},ae=/^D+$/,se=/^Y+$/,ie=["D","DD","YY","YYYY"];function oe(n){return ae.test(n)}function ce(n){return se.test(n)}function le(n,t,e){const r=ue(n,t,e);if(console.warn(r),ie.includes(n))throw new RangeError(r)}function ue(n,t,e){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const he=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,de=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fe=/^'([^]*?)'?$/,me=/''/g,ge=/[a-zA-Z]/;function ye(n,t,e){var f,p,w,m;const r=_(),a=r.locale??Kt,s=r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(w=r.locale)==null?void 0:w.options)==null?void 0:m.weekStartsOn)??0,c=v(n,e==null?void 0:e.in);if(!pt(c))throw new RangeError("Invalid time value");let l=t.match(de).map(g=>{const k=g[0];if(k==="p"||k==="P"){const q=re[k];return q(g,a.formatLong)}return g}).join("").match(he).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const k=g[0];if(k==="'")return{isToken:!1,value:pe(g)};if(X[k])return{isToken:!0,value:g};if(k.match(ge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(l=a.localize.preprocessor(c,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return l.map(g=>{if(!g.isToken)return g.value;const k=g.value;(ce(k)||oe(k))&&le(k,t,String(n));const q=X[k[0]];return q(c,k,a.localize,u)}).join("")}function pe(n){const t=n.match(fe);return t?t[1].replace(me,"'"):n}function we(n,t){const e=v(n,t==null?void 0:t.in).getDay();return e===0?7:e}const z={},N={};function Y(n,t){try{const r=(z[n]||(z[n]=new Intl.DateTimeFormat("en-GB",{timeZone:n,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in N?N[r]:Z(r,r.split(":"))}catch{if(n in N)return N[n];const e=n==null?void 0:n.match(be);return e?Z(n,e.slice(1)):NaN}}const be=/([+-]\d\d):?(\d\d)?/;function Z(n,t){const e=+t[0],r=+(t[1]||0);return N[n]=e>0?e*60+r:e*60-r}class S extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Y(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),ot(this),B(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new S(...e,t):new S(Date.now(),t)}withTimeZone(t){return new S(+this,t)}getTimezoneOffset(){return-Y(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),B(this),+this}[Symbol.for("constructDateFrom")](t){return new S(+new Date(t),this.timeZone)}}const tt=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!tt.test(n))return;const t=n.replace(tt,"$1UTC");S.prototype[t]&&(n.startsWith("get")?S.prototype[n]=function(){return this.internal[t]()}:(S.prototype[n]=function(){return Date.prototype[t].apply(this.internal,arguments),ke(this),+this},S.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),B(this),+this}))});function B(n){n.internal.setTime(+n),n.internal.setUTCMinutes(n.internal.getUTCMinutes()-n.getTimezoneOffset())}function ke(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),ot(n)}function ot(n){const t=Y(n.timeZone,n),e=new Date(+n);e.setUTCHours(e.getUTCHours()-1);const r=-new Date(+n).getTimezoneOffset(),a=-new Date(+e).getTimezoneOffset(),s=r-a,i=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();s&&i&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+s);const c=r-t;c&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+c);const l=Y(n.timeZone,n),f=-new Date(+n).getTimezoneOffset()-l,p=l!==t,w=f-c;if(p&&w){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+w);const m=Y(n.timeZone,n),g=l-m;g&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+g),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+g))}}class M extends S{static tz(t,...e){return e.length?new M(...e,t):new M(Date.now(),t)}toISOString(){const[t,e,r]=this.tzComponents(),a=`${t}${e}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,r,a]=this.tzComponents();return`${t} GMT${e}${r}${a} (${ve(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,r,a]}withTimeZone(t){return new M(+this,t)}[Symbol.for("constructDateFrom")](t){return new M(+new Date(t),this.timeZone)}}function ve(n,t){return new Intl.DateTimeFormat("en-GB",{timeZone:n,timeZoneName:"long"}).format(t).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const y=n=>n.toISOString().split("T")[0],De=n=>{if(!n)return null;const t=$(new M(n,window.pktTz),12);return isNaN(t.getTime())?null:t},Se=(n,t)=>{const e=b(n);return isNaN(e.getTime())?"":ye(e,t)},b=(n="")=>$(n===""||!n?new M(new Date,window.pktTz):new M(n,window.pktTz),12),P=(n,t,e=1)=>$(new M(n,t,e,window.pktTz),12),Me=n=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(n),ct=n=>{if(Array.isArray(n))return n;if(typeof n=="string")return n.split(",")},xe=n=>n?new Date(n):null,Pe=n=>{if(typeof n=="string")return n.split(",").map(t=>new Date(t));if(Array.isArray(n))return n.map(t=>new Date(t))},H={csvToArray:ct,stringToDate:xe,stringsToDate:Pe},Te={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},T={props:Te};var Oe=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,d=(n,t,e,r)=>{for(var a=r>1?void 0:r?Ce(t,e):t,s=n.length-1,i;s>=0;s--)(i=n[s])&&(a=(r?i(t,e,a):i(a))||a);return r&&a&&Oe(t,e,a),a};exports.PktCalendar=class extends o.PktElement{constructor(){super(...arguments),this.multiple=T.props.multiple.default,this.maxMultiple=T.props.maxMultiple.default,this.range=T.props.range.default,this.weeknumbers=T.props.weeknumbers.default,this.withcontrols=T.props.withcontrols.default,this.selected=[],this.earliest=T.props.earliest.default,this.latest=T.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,r){t==="selected"&&r&&this.convertSelected(),super.attributeChangedCallback(t,e,r)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>b(t)),this.range&&this.selected.length===2){const t=R({start:b(this.selected[0]),end:b(this.selected[1])});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let r=0;r<t.length;r++)e[y(t[r])]=this.isInRange(t[r]);this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=b(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=b()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var s,i,c;if(((s=t.target)==null?void 0:s.nodeName)==="INPUT"||((i=t.target)==null?void 0:i.nodeName)==="SELECT"||((c=t.target)==null?void 0:c.nodeName)==="BUTTON")return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const r=this.focusedDate?b(this.focusedDate):P(this.year,this.month,1);let a=L(r,e);if(a){let l=this.querySelector(`div[data-date="${y(a)}"]`);if(l instanceof HTMLDivElement){if(l.dataset.disabled){a=L(a,e);let u=this.querySelector(`div[data-date="${y(a)}"]`);for(;u&&u instanceof HTMLDivElement&&u.dataset.disabled;)a=L(a,e),u=this.querySelector(`div[data-date="${y(a)}"]`);l=u}l instanceof HTMLDivElement&&!l.dataset.disabled&&(this.focusedDate=y(a),l.focus())}}}render(){return o.x`
|
|
1
|
+
"use strict";const lt=require("./class-map-DCyaICmy.cjs"),o=require("./element-BSypUpzA.cjs"),F=require("./state-B5KCNjEd.cjs");require("./icon-BnKGwYjj.cjs");const et=6048e5,ut=864e5,ht=36e5,Q=Symbol.for("constructDateFrom");function D(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Q in n?n[Q](t):n instanceof Date?new n.constructor(t):new Date(t)}function v(n,t){return D(t||n,n)}function L(n,t,e){const r=v(n,e==null?void 0:e.in);return isNaN(t)?D(n,NaN):(t&&r.setDate(r.getDate()+t),r)}function dt(n,t,e){return D(n,+v(n)+t)}function $(n,t,e){return dt(n,t*ht)}let ft={};function _(){return ft}function A(n,t){var c,l,u,f;const e=_(),r=(t==null?void 0:t.weekStartsOn)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,a=v(n,t==null?void 0:t.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function I(n,t){return A(n,{...t,weekStartsOn:1})}function nt(n,t){const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=D(e,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=I(a),i=D(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const c=I(i);return e.getTime()>=s.getTime()?r+1:e.getTime()>=c.getTime()?r:r-1}function j(n){const t=v(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 rt(n,...t){const e=D.bind(null,t.find(r=>typeof r=="object"));return t.map(e)}function G(n,t){const e=v(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function mt(n,t,e){const[r,a]=rt(e==null?void 0:e.in,n,t),s=G(r),i=G(a),c=+s-j(s),l=+i-j(i);return Math.round((c-l)/ut)}function gt(n,t){const e=nt(n,t),r=D(n,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),I(r)}function yt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function pt(n){return!(!yt(n)&&typeof n!="number"||isNaN(+v(n)))}function wt(n,t){const[e,r]=rt(n,t.start,t.end);return{start:e,end:r}}function R(n,t){const{start:e,end:r}=wt(t==null?void 0:t.in,n);let a=+e>+r;const s=a?+e:+r,i=a?r:e;i.setHours(0,0,0,0);let c=1;const l=[];for(;+i<=s;)l.push(D(e,i)),i.setDate(i.getDate()+c),i.setHours(0,0,0,0);return a?l.reverse():l}function bt(n,t){const e=v(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const kt={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"}},vt=(n,t,e)=>{let r;const a=kt[n];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r};function U(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Dt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},St={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Mt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xt={date:U({formats:Dt,defaultWidth:"full"}),time:U({formats:St,defaultWidth:"full"}),dateTime:U({formats:Mt,defaultWidth:"full"})},Pt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tt=(n,t,e,r)=>Pt[n];function E(n){return(t,e)=>{const r=e!=null&&e.context?String(e.context):"standalone";let a;if(r==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,c=e!=null&&e.width?String(e.width):i;a=n.formattingValues[c]||n.formattingValues[i]}else{const i=n.defaultWidth,c=e!=null&&e.width?String(e.width):n.defaultWidth;a=n.values[c]||n.values[i]}const s=n.argumentCallback?n.argumentCallback(t):t;return a[s]}}const Ot={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ct={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$t={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"]},Et={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"]},Wt={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"}},Nt={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"}},Yt=(n,t)=>{const e=Number(n),r=e%100;if(r>20||r<10)switch(r%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},At={ordinalNumber:Yt,era:E({values:Ot,defaultWidth:"wide"}),quarter:E({values:Ct,defaultWidth:"wide",argumentCallback:n=>n-1}),month:E({values:$t,defaultWidth:"wide"}),day:E({values:Et,defaultWidth:"wide"}),dayPeriod:E({values:Wt,defaultWidth:"wide",formattingValues:Nt,defaultFormattingWidth:"wide"})};function W(n){return(t,e={})=>{const r=e.width,a=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],c=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(c)?Ht(c,p=>p.test(i)):Ft(c,p=>p.test(i));let u;u=n.valueCallback?n.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const f=t.slice(i.length);return{value:u,rest:f}}}function Ft(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 It(n){return(t,e={})=>{const r=t.match(n.matchPattern);if(!r)return null;const a=r[0],s=t.match(n.parsePattern);if(!s)return null;let i=n.valueCallback?n.valueCallback(s[0]):s[0];i=e.valueCallback?e.valueCallback(i):i;const c=t.slice(a.length);return{value:i,rest:c}}}const _t=/^(\d+)(th|st|nd|rd)?/i,qt=/\d+/i,Lt={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},Rt={any:[/^b/i,/^(a|c)/i]},Ut={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zt={any:[/1/i,/2/i,/3/i,/4/i]},Bt={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},Qt={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]},jt={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},Gt={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]},Xt={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},Vt={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}},Jt={ordinalNumber:It({matchPattern:_t,parsePattern:qt,valueCallback:n=>parseInt(n,10)}),era:W({matchPatterns:Lt,defaultMatchWidth:"wide",parsePatterns:Rt,defaultParseWidth:"any"}),quarter:W({matchPatterns:Ut,defaultMatchWidth:"wide",parsePatterns:zt,defaultParseWidth:"any",valueCallback:n=>n+1}),month:W({matchPatterns:Bt,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:W({matchPatterns:jt,defaultMatchWidth:"wide",parsePatterns:Gt,defaultParseWidth:"any"}),dayPeriod:W({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:Vt,defaultParseWidth:"any"})},Kt={code:"en-US",formatDistance:vt,formatLong:xt,formatRelative:Tt,localize:At,match:Jt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zt(n,t){const e=v(n,t==null?void 0:t.in);return mt(e,bt(e))+1}function te(n,t){const e=v(n,t==null?void 0:t.in),r=+I(e)-+gt(e);return Math.round(r/et)+1}function at(n,t){var f,p,w,m;const e=v(n,t==null?void 0:t.in),r=e.getFullYear(),a=_(),s=(t==null?void 0:t.firstWeekContainsDate)??((p=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(w=a.locale)==null?void 0:w.options)==null?void 0:m.firstWeekContainsDate)??1,i=D((t==null?void 0:t.in)||n,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const c=A(i,t),l=D((t==null?void 0:t.in)||n,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=A(l,t);return+e>=+c?r+1:+e>=+u?r:r-1}function ee(n,t){var c,l,u,f;const e=_(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((f=(u=e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,a=at(n,t),s=D((t==null?void 0:t.in)||n,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),A(s,t)}function st(n,t){const e=v(n,t==null?void 0:t.in),r=+A(e,t)-+ee(e,t);return Math.round(r/et)+1}function h(n,t){const e=n<0?"-":"",r=Math.abs(n).toString().padStart(t,"0");return e+r}const x={y(n,t){const e=n.getFullYear(),r=e>0?e:1-e;return h(t==="yy"?r%100:r,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):h(e+1,2)},d(n,t){return h(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 h(n.getHours()%12||12,t.length)},H(n,t){return h(n.getHours(),t.length)},m(n,t){return h(n.getMinutes(),t.length)},s(n,t){return h(n.getSeconds(),t.length)},S(n,t){const e=t.length,r=n.getMilliseconds(),a=Math.trunc(r*Math.pow(10,e-3));return h(a,t.length)}},C={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},X={G:function(n,t,e){const r=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const r=n.getFullYear(),a=r>0?r:1-r;return e.ordinalNumber(a,{unit:"year"})}return x.y(n,t)},Y:function(n,t,e,r){const a=at(n,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return h(i,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):h(s,t.length)},R:function(n,t){const e=nt(n);return h(e,t.length)},u:function(n,t){const e=n.getFullYear();return h(e,t.length)},Q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return h(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,t,e){const r=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return h(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,t,e){const r=n.getMonth();switch(t){case"M":case"MM":return x.M(n,t);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(n,t,e){const r=n.getMonth();switch(t){case"L":return String(r+1);case"LL":return h(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(n,t,e,r){const a=st(n,r);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):h(a,t.length)},I:function(n,t,e){const r=te(n);return t==="Io"?e.ordinalNumber(r,{unit:"week"}):h(r,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):x.d(n,t)},D:function(n,t,e){const r=Zt(n);return t==="Do"?e.ordinalNumber(r,{unit:"dayOfYear"}):h(r,t.length)},E:function(n,t,e){const r=n.getDay();switch(t){case"E":case"EE":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"})}},e:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return h(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(n,t,e,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return h(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(n,t,e){const r=n.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return h(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(n,t,e){const a=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(n,t,e){const r=n.getHours();let a;switch(r===12?a=C.noon:r===0?a=C.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(n,t,e){const r=n.getHours();let a;switch(r>=17?a=C.evening:r>=12?a=C.afternoon:r>=4?a=C.morning:a=C.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let r=n.getHours()%12;return r===0&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return x.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):x.H(n,t)},K:function(n,t,e){const r=n.getHours()%12;return t==="Ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},k:function(n,t,e){let r=n.getHours();return r===0&&(r=24),t==="ko"?e.ordinalNumber(r,{unit:"hour"}):h(r,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):x.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):x.s(n,t)},S:function(n,t){return x.S(n,t)},X:function(n,t,e){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return J(r);case"XXXX":case"XX":return O(r);case"XXXXX":case"XXX":default:return O(r,":")}},x:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"x":return J(r);case"xxxx":case"xx":return O(r);case"xxxxx":case"xxx":default:return O(r,":")}},O:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+V(r,":");case"OOOO":default:return"GMT"+O(r,":")}},z:function(n,t,e){const r=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+V(r,":");case"zzzz":default:return"GMT"+O(r,":")}},t:function(n,t,e){const r=Math.trunc(+n/1e3);return h(r,t.length)},T:function(n,t,e){return h(+n,t.length)}};function V(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=Math.trunc(r/60),s=r%60;return s===0?e+String(a):e+String(a)+t+h(s,2)}function J(n,t){return n%60===0?(n>0?"-":"+")+h(Math.abs(n)/60,2):O(n,t)}function O(n,t=""){const e=n>0?"-":"+",r=Math.abs(n),a=h(Math.trunc(r/60),2),s=h(r%60,2);return e+a+t+s}const K=(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"})}},it=(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"})}},ne=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],r=e[1],a=e[2];if(!a)return K(n,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",K(r,t)).replace("{{time}}",it(a,t))},re={p:it,P:ne},ae=/^D+$/,se=/^Y+$/,ie=["D","DD","YY","YYYY"];function oe(n){return ae.test(n)}function ce(n){return se.test(n)}function le(n,t,e){const r=ue(n,t,e);if(console.warn(r),ie.includes(n))throw new RangeError(r)}function ue(n,t,e){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const he=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,de=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fe=/^'([^]*?)'?$/,me=/''/g,ge=/[a-zA-Z]/;function ye(n,t,e){var f,p,w,m;const r=_(),a=r.locale??Kt,s=r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(w=r.locale)==null?void 0:w.options)==null?void 0:m.weekStartsOn)??0,c=v(n,e==null?void 0:e.in);if(!pt(c))throw new RangeError("Invalid time value");let l=t.match(de).map(g=>{const k=g[0];if(k==="p"||k==="P"){const q=re[k];return q(g,a.formatLong)}return g}).join("").match(he).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const k=g[0];if(k==="'")return{isToken:!1,value:pe(g)};if(X[k])return{isToken:!0,value:g};if(k.match(ge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(l=a.localize.preprocessor(c,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return l.map(g=>{if(!g.isToken)return g.value;const k=g.value;(ce(k)||oe(k))&&le(k,t,String(n));const q=X[k[0]];return q(c,k,a.localize,u)}).join("")}function pe(n){const t=n.match(fe);return t?t[1].replace(me,"'"):n}function we(n,t){const e=v(n,t==null?void 0:t.in).getDay();return e===0?7:e}const z={},N={};function Y(n,t){try{const r=(z[n]||(z[n]=new Intl.DateTimeFormat("en-GB",{timeZone:n,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in N?N[r]:Z(r,r.split(":"))}catch{if(n in N)return N[n];const e=n==null?void 0:n.match(be);return e?Z(n,e.slice(1)):NaN}}const be=/([+-]\d\d):?(\d\d)?/;function Z(n,t){const e=+t[0],r=+(t[1]||0);return N[n]=e>0?e*60+r:e*60-r}class S extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Y(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),ot(this),B(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new S(...e,t):new S(Date.now(),t)}withTimeZone(t){return new S(+this,t)}getTimezoneOffset(){return-Y(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),B(this),+this}[Symbol.for("constructDateFrom")](t){return new S(+new Date(t),this.timeZone)}}const tt=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!tt.test(n))return;const t=n.replace(tt,"$1UTC");S.prototype[t]&&(n.startsWith("get")?S.prototype[n]=function(){return this.internal[t]()}:(S.prototype[n]=function(){return Date.prototype[t].apply(this.internal,arguments),ke(this),+this},S.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),B(this),+this}))});function B(n){n.internal.setTime(+n),n.internal.setUTCMinutes(n.internal.getUTCMinutes()-n.getTimezoneOffset())}function ke(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),ot(n)}function ot(n){const t=Y(n.timeZone,n),e=new Date(+n);e.setUTCHours(e.getUTCHours()-1);const r=-new Date(+n).getTimezoneOffset(),a=-new Date(+e).getTimezoneOffset(),s=r-a,i=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();s&&i&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+s);const c=r-t;c&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+c);const l=Y(n.timeZone,n),f=-new Date(+n).getTimezoneOffset()-l,p=l!==t,w=f-c;if(p&&w){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+w);const m=Y(n.timeZone,n),g=l-m;g&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+g),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+g))}}class M extends S{static tz(t,...e){return e.length?new M(...e,t):new M(Date.now(),t)}toISOString(){const[t,e,r]=this.tzComponents(),a=`${t}${e}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,r,a]=this.tzComponents();return`${t} GMT${e}${r}${a} (${ve(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,r,a]}withTimeZone(t){return new M(+this,t)}[Symbol.for("constructDateFrom")](t){return new M(+new Date(t),this.timeZone)}}function ve(n,t){return new Intl.DateTimeFormat("en-GB",{timeZone:n,timeZoneName:"long"}).format(t).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const y=n=>n.toISOString().split("T")[0],De=n=>{if(!n)return null;const t=$(new M(n,window.pktTz),12);return isNaN(t.getTime())?null:t},Se=(n,t)=>{const e=b(n);return isNaN(e.getTime())?"":ye(e,t)},b=(n="")=>$(n===""||!n?new M(new Date,window.pktTz):new M(n,window.pktTz),12),P=(n,t,e=1)=>$(new M(n,t,e,window.pktTz),12),Me=n=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(n),ct=n=>{if(Array.isArray(n))return n;if(typeof n=="string")return n.split(",")},xe=n=>n?new Date(n):null,Pe=n=>{if(typeof n=="string")return n.split(",").map(t=>new Date(t));if(Array.isArray(n))return n.map(t=>new Date(t))},H={csvToArray:ct,stringToDate:xe,stringsToDate:Pe},Te={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},T={props:Te};var Oe=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,d=(n,t,e,r)=>{for(var a=r>1?void 0:r?Ce(t,e):t,s=n.length-1,i;s>=0;s--)(i=n[s])&&(a=(r?i(t,e,a):i(a))||a);return r&&a&&Oe(t,e,a),a};exports.PktCalendar=class extends o.PktElement{constructor(){super(...arguments),this.multiple=T.props.multiple.default,this.maxMultiple=T.props.maxMultiple.default,this.range=T.props.range.default,this.weeknumbers=T.props.weeknumbers.default,this.withcontrols=T.props.withcontrols.default,this.selected=[],this.earliest=T.props.earliest.default,this.latest=T.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,r){t==="selected"&&r&&this.convertSelected(),super.attributeChangedCallback(t,e,r)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>b(t)),this.range&&this.selected.length===2){const t=R({start:b(this.selected[0]),end:b(this.selected[1])});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let r=0;r<t.length;r++)e[y(t[r])]=this.isInRange(t[r]);this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=b(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=b()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var s,i,c;if(((s=t.target)==null?void 0:s.nodeName)==="INPUT"||((i=t.target)==null?void 0:i.nodeName)==="SELECT"||((c=t.target)==null?void 0:c.nodeName)==="BUTTON")return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const r=this.focusedDate?b(this.focusedDate):P(this.year,this.month,1);let a=L(r,e);if(a){let l=this.querySelector(`div[data-date="${y(a)}"]`);if(l instanceof HTMLDivElement){if(l.dataset.disabled){a=L(a,e);let u=this.querySelector(`div[data-date="${y(a)}"]`);for(;u&&u instanceof HTMLDivElement&&u.dataset.disabled;)a=L(a,e),u=this.querySelector(`div[data-date="${y(a)}"]`);l=u}l instanceof HTMLDivElement&&!l.dataset.disabled&&(this.focusedDate=y(a),l.focus())}}}render(){return o.x`
|
|
2
2
|
<div
|
|
3
3
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":o.E}"
|
|
4
4
|
@focusout=${this.closeEvent}
|
package/dist/calendar.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { e as m } from "./class-map-
|
|
2
|
-
import { o as d } from "./if-defined-
|
|
3
|
-
import { P as u, E as g, x as i, n as a, a as f } from "./element-
|
|
1
|
+
import { e as m } from "./class-map-KyMqi0fa.js";
|
|
2
|
+
import { o as d } from "./if-defined-BErSJCeJ.js";
|
|
3
|
+
import { P as u, E as g, x as i, n as a, a as f } from "./element-DjjF_tEh.js";
|
|
4
4
|
import { P as k } from "./pkt-slot-controller-DFrc5O93.js";
|
|
5
|
-
import { e as $, n as v } from "./ref-
|
|
6
|
-
import "./icon-
|
|
7
|
-
import "./tag-
|
|
5
|
+
import { e as $, n as v } from "./ref-iIffqQAI.js";
|
|
6
|
+
import "./icon-Beoxup8E.js";
|
|
7
|
+
import "./tag-CGnj4c1Z.js";
|
|
8
8
|
const y = {
|
|
9
9
|
skin: {
|
|
10
10
|
default: "outlined"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const h=require("./class-map-
|
|
1
|
+
"use strict";const h=require("./class-map-DCyaICmy.cjs"),d=require("./if-defined-a3sotaUr.cjs"),t=require("./element-BSypUpzA.cjs"),u=require("./pkt-slot-controller-plQxXRvV.cjs"),l=require("./ref-BvbyvXRH.cjs");require("./icon-BnKGwYjj.cjs");require("./tag-CgkUxA5D.cjs");const k={skin:{default:"outlined"},direction:{default:"portrait"}},p={props:k};var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,s=(n,i,e,a)=>{for(var r=a>1?void 0:a?f(i,e):i,c=n.length-1,o;c>=0;c--)(o=n[c])&&(r=(a?o(i,e,r):o(r))||r);return a&&r&&g(i,e,r),r};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=l.e(),this.skin=p.props.skin.default,this.direction=p.props.direction.default,this.image={src:"",alt:""},this.heading="",this.subheading="",this.tags=[],this.slotController=new u.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.x`
|
|
2
2
|
<div class=${h.e(i)}>
|
|
3
3
|
${this.image.src&&t.x`
|
|
4
4
|
<div class="pkt-card__image">
|
package/dist/card.d.ts
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
export { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface HTMLElementTagNameMap {
|
|
6
|
-
'pkt-icon': PktIcon;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
'pkt-combobox': PktCombobox & HTMLSelectElement;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
'pkt-listbox': PktListbox;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
|
|
27
|
-
*
|
|
28
|
-
* The component will prioritize options passed as a prop over options passed as children if both are provided.
|
|
29
|
-
* This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
|
|
30
|
-
*
|
|
31
|
-
* @slot (default) - Options to be rendered as children
|
|
32
|
-
* @prop {TSelectOption[]} options - Options to be rendered as children
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
declare global {
|
|
37
|
-
interface HTMLElementTagNameMap {
|
|
38
|
-
'pkt-select': PktSelect & HTMLSelectElement;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface Window {
|
|
45
|
-
pktTz: string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./element-
|
|
1
|
+
"use strict";const e=require("./element-BSypUpzA.cjs"),a=require("./input-element-C9ma8cdz.cjs"),k=require("./ref-BvbyvXRH.cjs"),o=require("./class-map-DCyaICmy.cjs");var r=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c=(l,t,s,h)=>{for(var i=h>1?void 0:h?u(t,s):t,n=l.length-1,p;n>=0;n--)(p=l[n])&&(i=(h?p(t,s,i):p(i))||i);return h&&i&&r(t,s,i),i};exports.PktCheckbox=class extends a.PktInputElement{constructor(){super(...arguments),this.inputRef=k.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.type="checkbox"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,s,h){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(t,s,h)}firstUpdated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(t)}render(){const t=o.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),s=o.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),h=o.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),i=()=>e.x`
|
|
2
2
|
<label class=${h} for=${this.id+"-internal"}>
|
|
3
3
|
${this.label}
|
|
4
4
|
${this.checkHelptext?e.x`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:e.E}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as n, x as r, n as s, a as d } from "./element-
|
|
2
|
-
import { P as k } from "./input-element-
|
|
3
|
-
import { e as b, n as f } from "./ref-
|
|
4
|
-
import { e as u } from "./class-map-
|
|
1
|
+
import { E as n, x as r, n as s, a as d } from "./element-DjjF_tEh.js";
|
|
2
|
+
import { P as k } from "./input-element-Bic-t96S.js";
|
|
3
|
+
import { e as b, n as f } from "./ref-iIffqQAI.js";
|
|
4
|
+
import { e as u } from "./class-map-KyMqi0fa.js";
|
|
5
5
|
var _ = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (e, h, c, l) => {
|
|
6
6
|
for (var p = l > 1 ? void 0 : l ? y(h, c) : h, a = e.length - 1, o; a >= 0; a--)
|
|
7
7
|
(o = e[a]) && (p = (l ? o(h, c, p) : o(p)) || p);
|