@oslokommune/punkt-elements 19.15.3 → 19.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/{accordion-BlsqYbJf.js → accordion-B0zAUNUV.js} +5 -5
- package/dist/{accordion-DukAa2ED.cjs → accordion-Cx-Gh3hc.cjs} +1 -1
- package/dist/{alert-CuXM6TnC.cjs → alert-BRZDpVMt.cjs} +1 -1
- package/dist/{alert-Xt26J9yX.js → alert-JnRrtTOW.js} +5 -5
- package/dist/{async-directive-yh8hG41Q.js → async-directive-C4LocQwR.js} +2 -2
- package/dist/{backlink-ogvv493Y.js → backlink-D8Rv46lA.js} +3 -3
- package/dist/{breadcrumbs-53QVnTFP.js → breadcrumbs-ybOBe_op.js} +2 -2
- package/dist/{button-BFG-7bDB.cjs → button-Ca_V13cQ.cjs} +1 -1
- package/dist/{button-DhCqyX4D.js → button-ChdHZYBF.js} +5 -5
- package/dist/{calendar-CtWc545R.js → calendar-BQCjUQvP.js} +7 -11
- package/dist/{calendar-5XCeDtZX.cjs → calendar-CFTrX0C5.cjs} +2 -2
- package/dist/{card-Diivw_vm.cjs → card-COseC8ZL.cjs} +1 -1
- package/dist/{card-DCc3wfUb.js → card-DSTEL8Kv.js} +6 -6
- package/dist/{checkbox-BDwOYcNM.js → checkbox-CKYNnLDh.js} +5 -9
- package/dist/{checkbox-BwI9QNSh.cjs → checkbox-DkFswqr-.cjs} +2 -2
- package/dist/{checkbox-group-Bum7k828.js → checkbox-group-1ghi5uHp.js} +3 -3
- package/dist/{checkbox-group-BLurd7sf.cjs → checkbox-group-lcxR3cYR.cjs} +1 -1
- package/dist/{class-map-Bf-QzUpN.js → class-map-BkEYw5uE.js} +1 -1
- package/dist/combobox-CaWnlvTX.cjs +139 -0
- package/dist/{combobox-C7tUHbG4.js → combobox-iXYiaWbN.js} +63 -96
- package/dist/components/index.d.ts +1 -0
- package/dist/components/input-wrapper/index.d.ts +1 -0
- package/dist/components/input-wrapper/input-wrapper.d.ts +13 -6
- package/dist/{consent-DBYZaCTp.cjs → consent-BwH89xk_.cjs} +1 -1
- package/dist/{consent-BUS6GEUu.js → consent-DiD0iQ5h.js} +5 -5
- package/dist/converters-CW6SN0TT.cjs +1 -0
- package/dist/{converters-CkjLSYpa.js → converters-CYgQrWVm.js} +138 -141
- package/dist/{datepicker-CJLcIDVk.js → datepicker-DTcow1ih.js} +15 -25
- package/dist/{datepicker-DmZi4CNk.cjs → datepicker-Da8SfyVG.cjs} +3 -3
- package/dist/{dialog-polyfill.esm-B-g35ove.cjs → dialog-polyfill.esm-CW51hN2p.cjs} +1 -1
- package/dist/{dialog-polyfill.esm-DHSvqor8.js → dialog-polyfill.esm-D39dWbRt.js} +2 -2
- package/dist/{directive-helpers-CwxFepWh.js → directive-helpers-BAinC437.js} +1 -1
- package/dist/{element-DBugHPKM.js → element-ckeMVgMz.js} +1 -1
- package/dist/{element-with-slot-CVmm0_IE.js → element-with-slot-C0bH0T0H.js} +27 -38
- package/dist/element-with-slot-DkyaNnm0.cjs +1 -0
- package/dist/{fileupload-DehKWas6.js → fileupload-BNAQ9tNR.js} +16 -23
- package/dist/{fileupload-A_suUEPU.cjs → fileupload-Cb1c7ul0.cjs} +3 -3
- package/dist/{footer-L2vhQTAS.js → footer-BOwcLSsz.js} +4 -4
- package/dist/{footer-C6ajmlq2.cjs → footer-Cl_Da5Iq.cjs} +1 -1
- package/dist/{header-BzAPmAsZ.cjs → header-CvER8wo6.cjs} +2 -2
- package/dist/{header-C6xhv3Ib.js → header-Cwr995oK.js} +13 -13
- package/dist/{header-menu-F3tZZ5vO.js → header-menu-CsL4DZE2.js} +5 -5
- package/dist/{header-menu-Cz7G7Q2R.cjs → header-menu-D-wOwG1V.cjs} +1 -1
- package/dist/{heading-BluavR6A.cjs → heading-D4Kkb6-N.cjs} +1 -1
- package/dist/{heading-y72aIgB8.js → heading-DhTyaJms.js} +2 -2
- package/dist/{helptext-Dujce_W9.js → helptext-DN0jjgVu.js} +4 -4
- package/dist/{helptext-Bdv80rcs.cjs → helptext-p0nwJsyf.cjs} +1 -1
- package/dist/{icon-Bao96Zb8.js → icon-CLMJYuTL.js} +1 -1
- package/dist/{if-defined-O59_I-e-.js → if-defined-D18nY_K_.js} +1 -1
- package/dist/{input-element-mTphzs9b.js → input-element-0yYtRu0p.js} +3 -3
- package/dist/{input-element-BjnKPikY.cjs → input-element-BOi7rBbw.cjs} +1 -1
- package/dist/input-wrapper-4PTk8aX3.cjs +62 -0
- package/dist/{input-wrapper-xRJo_iVf.js → input-wrapper-BSjQc4Vx.js} +29 -197
- package/dist/{link-sO401Ieh.js → link-39EvU2ng.js} +5 -5
- package/dist/{link-CRLAhYi0.cjs → link-Dj6SbcaD.cjs} +1 -1
- package/dist/{linkcard-DnZgMzqL.cjs → linkcard-BoQIfci8.cjs} +1 -1
- package/dist/{linkcard-DdmGxzAP.js → linkcard-K9vvKg1u.js} +4 -4
- package/dist/{listbox-CvduK_YU.cjs → listbox-BbdUu-IV.cjs} +3 -3
- package/dist/{listbox-BDesthOp.js → listbox-DFd-1faX.js} +15 -16
- package/dist/{loader-Zo_VSsNw.cjs → loader-BRYL5kTN.cjs} +1 -1
- package/dist/{loader-Di5kHEQ4.js → loader-MoI2VRFr.js} +4 -4
- package/dist/{messagebox-CR59jv8N.cjs → messagebox-CiOQUt0C.cjs} +1 -1
- package/dist/{messagebox-CzaFlrYz.js → messagebox-Dr-k3pnZ.js} +4 -4
- package/dist/{modal-wEEmCcUx.cjs → modal-DGiq84MG.cjs} +1 -1
- package/dist/{modal-0D0paY70.js → modal-DbzEnZNF.js} +8 -8
- package/dist/option-group-element-CH0sgVIl.cjs +23 -0
- package/dist/{option-group-element-fpMneBWa.js → option-group-element-DC364Rw_.js} +3 -3
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -2
- package/dist/pkt-backlink.js +1 -2
- package/dist/pkt-breadcrumbs.js +1 -2
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -2
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -2
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -2
- package/dist/pkt-checkbox-group.cjs +1 -1
- package/dist/pkt-checkbox-group.js +1 -2
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -2
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -2
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -2
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -2
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -2
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -2
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -2
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -2
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -2
- package/dist/pkt-icon.js +1 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +37 -37
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -2
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -2
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -2
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -2
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -2
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -2
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -2
- package/dist/{pkt-options-controller-CHosj1Oo.js → pkt-options-controller-BikFfGcZ.js} +1 -1
- package/dist/{pkt-options-controller-139UsV4h.cjs → pkt-options-controller-D1sKTkbR.cjs} +1 -1
- package/dist/pkt-progressbar.js +1 -2
- package/dist/pkt-radio-group.cjs +1 -1
- package/dist/pkt-radio-group.js +1 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -2
- package/dist/pkt-searchinput.js +1 -2
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -2
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -2
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -2
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -2
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -2
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -2
- package/dist/{progressbar-DZHiq7B0.js → progressbar-t0zgEke0.js} +5 -5
- package/dist/{radio-group-BmJ3kcba.js → radio-group-DJikniZi.js} +3 -3
- package/dist/{radio-group-Q75EtJzu.cjs → radio-group-XCYKqoLD.cjs} +1 -1
- package/dist/{radiobutton-DwDErNo5.cjs → radiobutton-DgkML7sd.cjs} +1 -1
- package/dist/{radiobutton-BK-V6Itu.js → radiobutton-PYQKVnNQ.js} +4 -4
- package/dist/{ref-y_5qv9vU.js → ref-D4OwQYdf.js} +2 -2
- package/dist/{repeat-CV9S4zya.js → repeat-BGbBqnfz.js} +2 -2
- package/dist/{scroll-lock-BALd8hF9.js → scroll-lock-CR-g54ai.js} +1 -1
- package/dist/{scroll-lock-B46ur0FF.cjs → scroll-lock-x0VxhKWZ.cjs} +1 -1
- package/dist/{searchinput-Bkcr3Fby.js → searchinput-BzYifHBf.js} +4 -4
- package/dist/{select-ByPSk9WT.js → select-CorofYxz.js} +21 -21
- package/dist/{select-CCY2_EbI.cjs → select-D8TC1msV.cjs} +14 -14
- package/dist/shared-types/icon.d.ts +2 -0
- package/dist/shared-types/index.d.ts +3 -1
- package/dist/shared-types/input-wrapper.d.ts +59 -0
- package/dist/{tabs-R1Jzzj3-.cjs → tabs-B63J6MXb.cjs} +2 -2
- package/dist/{tabs-DBW3P90Z.js → tabs-DDakCTkY.js} +7 -15
- package/dist/{tag-BMtnaJ1A.cjs → tag-6IPe9bwQ.cjs} +1 -1
- package/dist/{tag-uVXp7uP-.js → tag-BPvGZcKf.js} +5 -5
- package/dist/{textarea-DB7FMtTf.js → textarea-BZCUHjEj.js} +19 -19
- package/dist/{textarea-D9RWiR6u.cjs → textarea-BiCZBjOe.cjs} +10 -10
- package/dist/{textinput-l31MdBd4.cjs → textinput-BZPGcxZV.cjs} +12 -12
- package/dist/{textinput-Djl_yr1D.js → textinput-D_oEaI41.js} +19 -19
- package/dist/{timepicker-Bw8zkwV9.cjs → timepicker-C0d92R8u.cjs} +12 -12
- package/dist/{timepicker-D_gNCZ2v.js → timepicker-JBOeZg-7.js} +24 -32
- package/package.json +2 -2
- package/src/components/consent/consent.ts +2 -2
- package/src/components/index.ts +1 -0
- package/src/components/input-wrapper/index.ts +1 -0
- package/src/components/input-wrapper/input-wrapper.ts +36 -17
- package/src/components/input-wrapper/wrapper-parity.test.ts +4 -2
- package/dist/combobox-BsXDULXd.cjs +0 -139
- package/dist/converters-BJ9Fe0kW.cjs +0 -1
- package/dist/element-with-slot-CcJPCLgn.cjs +0 -1
- package/dist/input-wrapper-BEmV0DGo.cjs +0 -62
- package/dist/option-group-element-A2cOZRWA.cjs +0 -23
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, s as a, t as o, u as s } from "./element-
|
|
2
|
-
import { t as c } from "./class-map-
|
|
3
|
-
import { n as ee } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "./
|
|
10
|
-
import
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, s as a, t as o, u as s } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as c } from "./class-map-BkEYw5uE.js";
|
|
3
|
+
import { n as ee } from "./element-with-slot-C0bH0T0H.js";
|
|
4
|
+
import "./icon-CLMJYuTL.js";
|
|
5
|
+
import "./input-wrapper-BSjQc4Vx.js";
|
|
6
|
+
import "./calendar-BQCjUQvP.js";
|
|
7
|
+
import { t as l } from "./if-defined-D18nY_K_.js";
|
|
8
|
+
import { n as u, t as d } from "./ref-D4OwQYdf.js";
|
|
9
|
+
import { a as f, c as p, d as m, h, i as g, m as _, n as v, r as y, s as b, t as x, u as S } from "./converters-CYgQrWVm.js";
|
|
10
|
+
import "./tag-BPvGZcKf.js";
|
|
11
|
+
import { t as C } from "./repeat-BGbBqnfz.js";
|
|
11
12
|
import { n as w, t as T } from "./utils-BwF4QSrq.js";
|
|
12
|
-
import { t as E } from "./input-element-
|
|
13
|
-
import "./input-wrapper-xRJo_iVf.js";
|
|
13
|
+
import { t as E } from "./input-element-0yYtRu0p.js";
|
|
14
14
|
//#region src/components/datepicker/date-tags.ts
|
|
15
15
|
var D = class extends o {
|
|
16
16
|
constructor(...e) {
|
|
@@ -886,11 +886,7 @@ var $ = class t extends E {
|
|
|
886
886
|
}
|
|
887
887
|
deriveValue(e) {
|
|
888
888
|
let t = y(this._valueProperty), n = this.multiple && t.length > 1 ? V.filterSelectableDates(t, this.min, this.max, this.excludedates, this.excludeweekdays) : t;
|
|
889
|
-
|
|
890
|
-
this._valueProperty = "", super.valueChanged("", e), this._value = [];
|
|
891
|
-
return;
|
|
892
|
-
}
|
|
893
|
-
this._valueProperty = v(n), this.range && n.length === 1 || super.valueChanged(this._valueProperty, e), this._value = n;
|
|
889
|
+
this.range && !V.validateRangeOrder(n) ? (this._valueProperty = "", super.valueChanged("", e), this._value = []) : (this._valueProperty = v(n), this.range && n.length === 1 || super.valueChanged(this._valueProperty, e), this._value = n);
|
|
894
890
|
}
|
|
895
891
|
attributeChangedCallback(e, t, n) {
|
|
896
892
|
e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = y(n || "")), e === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = y(n || "")), super.attributeChangedCallback(e, t, n);
|
|
@@ -1132,11 +1128,7 @@ var $ = class t extends E {
|
|
|
1132
1128
|
}
|
|
1133
1129
|
async showCalendar() {
|
|
1134
1130
|
let e = this.datepickerPopupRef.value;
|
|
1135
|
-
|
|
1136
|
-
e.show(), k() && e.focusOnCurrentDate();
|
|
1137
|
-
return;
|
|
1138
|
-
}
|
|
1139
|
-
await T(20), this.handleCalendarPosition(), k() && this.calRef.value?.focusOnCurrentDate();
|
|
1131
|
+
this.calendarOpen = !0, e && typeof e.show == "function" ? (e.show(), k() && e.focusOnCurrentDate()) : (await T(20), this.handleCalendarPosition(), k() && this.calRef.value?.focusOnCurrentDate());
|
|
1140
1132
|
}
|
|
1141
1133
|
hideCalendar() {
|
|
1142
1134
|
let e = this.datepickerPopupRef.value;
|
|
@@ -1148,9 +1140,7 @@ var $ = class t extends E {
|
|
|
1148
1140
|
if (t && typeof t.toggle == "function") {
|
|
1149
1141
|
let e = !!t.open;
|
|
1150
1142
|
t.toggle(), this.calendarOpen = !e;
|
|
1151
|
-
|
|
1152
|
-
}
|
|
1153
|
-
this.calendarOpen ? this.hideCalendar() : this.showCalendar();
|
|
1143
|
+
} else this.calendarOpen ? this.hideCalendar() : this.showCalendar();
|
|
1154
1144
|
}
|
|
1155
1145
|
clearInputValue() {
|
|
1156
1146
|
this._value = [], this.value = "", this.setFormValue(this.value), this.dispatchEvent(new Event("change", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs"),require("./input-wrapper-4PTk8aX3.cjs"),require("./calendar-CFTrX0C5.cjs");const r=require("./if-defined-CiML3MTM.cjs"),i=require("./ref-CB7e9nMY.cjs"),a=require("./converters-CW6SN0TT.cjs");require("./tag-6IPe9bwQ.cjs");const o=require("./repeat-CnnigVcj.cjs"),s=require("./utils-63cRpWut.cjs"),c=require("./input-element-BOi7rBbw.cjs");var l=class extends e.t{constructor(...e){super(...e),this.dates=[],this.dateformat=`dd.MM.yyyy`,this.className=`pkt-datepicker__tags`,this.idBase=s.n()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},e._`
|
|
2
2
|
<div class=${t.t(this.classes)} aria-live="polite">
|
|
3
3
|
${Array.isArray(this.dates)&&this.dates[0]?o.t(a.h((this.dates??[]).filter(Boolean)),e=>e,t=>e._` <pkt-tag
|
|
4
4
|
id=${this.idBase+t+`-tag`}
|
|
@@ -153,7 +153,7 @@ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),
|
|
|
153
153
|
/>
|
|
154
154
|
${this.renderCalendarButton()}
|
|
155
155
|
</div>
|
|
156
|
-
`}};e.n([e.u({type:Array})],P.prototype,`value`,void 0),e.n([e.u({type:Number})],P.prototype,`maxlength`,void 0);try{e.d(`pkt-datepicker-multiple`)(P)}catch{console.warn(`Forsøker å definere <pkt-datepicker-multiple>, men den er allerede definert`)}var F=class t extends c.t{constructor(...e){super(...e),this._valueProperty=``,this.datepickerPopupRef=i.t(),this._value=[],this.label=`Datovelger`,this.dateformat=u.props.dateformat.default,this.multiple=u.props.multiple.default,this.maxlength=null,this.range=u.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=u.props.weeknumbers.default,this.withcontrols=u.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone=`Europe/Oslo`,this.inputClasses={},this.calRef=i.t(),this.popupRef=i.t(),this.singleInputRef=i.t(),this.rangeInputRef=i.t(),this.multipleInputRef=i.t(),this.addToSelected=e=>{let t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected==`function`?t.addToSelected(e,this.min,this.max):E.addToSelected(e,this.calRef,this.min,this.max)}}get value(){return this._valueProperty}set value(e){let t=this._valueProperty,n=Array.isArray(e)?e.join(`,`):e||``;n!==t&&(this._valueProperty=n,this.requestUpdate(`value`,t))}get inputType(){return w.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}valueChanged(e,t){e!==t&&(this.value=e??``,this.deriveValue(t))}deriveValue(e){let t=a.r(this._valueProperty),n=this.multiple&&t.length>1?C.filterSelectableDates(t,this.min,this.max,this.excludedates,this.excludeweekdays):t;
|
|
156
|
+
`}};e.n([e.u({type:Array})],P.prototype,`value`,void 0),e.n([e.u({type:Number})],P.prototype,`maxlength`,void 0);try{e.d(`pkt-datepicker-multiple`)(P)}catch{console.warn(`Forsøker å definere <pkt-datepicker-multiple>, men den er allerede definert`)}var F=class t extends c.t{constructor(...e){super(...e),this._valueProperty=``,this.datepickerPopupRef=i.t(),this._value=[],this.label=`Datovelger`,this.dateformat=u.props.dateformat.default,this.multiple=u.props.multiple.default,this.maxlength=null,this.range=u.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=u.props.weeknumbers.default,this.withcontrols=u.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone=`Europe/Oslo`,this.inputClasses={},this.calRef=i.t(),this.popupRef=i.t(),this.singleInputRef=i.t(),this.rangeInputRef=i.t(),this.multipleInputRef=i.t(),this.addToSelected=e=>{let t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected==`function`?t.addToSelected(e,this.min,this.max):E.addToSelected(e,this.calRef,this.min,this.max)}}get value(){return this._valueProperty}set value(e){let t=this._valueProperty,n=Array.isArray(e)?e.join(`,`):e||``;n!==t&&(this._valueProperty=n,this.requestUpdate(`value`,t))}get inputType(){return w.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}valueChanged(e,t){e!==t&&(this.value=e??``,this.deriveValue(t))}deriveValue(e){let t=a.r(this._valueProperty),n=this.multiple&&t.length>1?C.filterSelectableDates(t,this.min,this.max,this.excludedates,this.excludeweekdays):t;this.range&&!C.validateRangeOrder(n)?(this._valueProperty=``,super.valueChanged(``,e),this._value=[]):(this._valueProperty=a.n(n),this.range&&n.length===1||super.valueChanged(this._valueProperty,e),this._value=n)}attributeChangedCallback(e,t,n){e===`excludedates`&&typeof this.excludedates==`string`&&(this.excludedates=a.r(n||``)),e===`excludeweekdays`&&typeof this.excludeweekdays==`string`&&(this.excludeweekdays=a.r(n||``)),super.attributeChangedCallback(e,t,n)}static{this.DERIVED_FROM=[`value`,`multiple`,`range`,`min`,`max`,`excludedates`,`excludeweekdays`]}willUpdate(e){if(super.willUpdate(e),t.DERIVED_FROM.some(t=>e.has(t))){let t=e.get(`value`);this.deriveValue(Array.isArray(t)?t.join(`,`):t??null)}}updated(e){this.classList.add(`pkt-datepicker`),this.classList.toggle(`pkt-datepicker--fullwidth`,this.fullwidth),this.classList.toggle(`pkt-datepicker--medium`,this.inputSize===`medium`),this.classList.toggle(`pkt-datepicker--small`,this.inputSize===`small`),this.classList.toggle(`pkt-datepicker--xsmall`,this.inputSize===`xsmall`),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){return this.multiple?this.multipleInputRef.value?.inputElement:this.range?this.rangeInputRef.value?.inputElement:this.singleInputRef.value?.inputElement}get currentInputElementTo(){if(this.range)return this.rangeInputRef.value?.inputElementTo}get currentButtonElement(){return this.multiple?this.multipleInputRef.value?.buttonElement:this.range?this.rangeInputRef.value?.buttonElement:this.singleInputRef.value?.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return e._`
|
|
157
157
|
<pkt-datepicker-single
|
|
158
158
|
.value=${this._value[0]??``}
|
|
159
159
|
.inputType=${this.inputType}
|
|
@@ -291,4 +291,4 @@ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),
|
|
|
291
291
|
</div>
|
|
292
292
|
</pkt-input-wrapper>
|
|
293
293
|
${this.renderCalendar()}
|
|
294
|
-
`}handleCalendarPosition(){let e=this.multiple&&!!this.maxlength;E.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){let e=this.datepickerPopupRef.value;
|
|
294
|
+
`}handleCalendarPosition(){let e=this.multiple&&!!this.maxlength;E.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){let e=this.datepickerPopupRef.value;this.calendarOpen=!0,e&&typeof e.show==`function`?(e.show(),d()&&e.focusOnCurrentDate()):(await s.t(20),this.handleCalendarPosition(),d()&&this.calRef.value?.focusOnCurrentDate())}hideCalendar(){let e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide==`function`)return e.hide()}async toggleCalendar(e){e.preventDefault();let t=this.datepickerPopupRef.value;if(t&&typeof t.toggle==`function`){let e=!!t.open;t.toggle(),this.calendarOpen=!e}else this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value=``,this.setFormValue(this.value),this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`value-change`,{detail:this._value,bubbles:!0,composed:!0}))}};e.n([e.u({type:String,reflect:!0})],F.prototype,`value`,null),e.n([e.l()],F.prototype,`_value`,void 0),e.n([e.u({type:String,reflect:!0})],F.prototype,`label`,void 0),e.n([e.u({type:String})],F.prototype,`dateformat`,void 0),e.n([e.u({type:Boolean,reflect:!0})],F.prototype,`multiple`,void 0),e.n([e.u({type:Number,reflect:!0})],F.prototype,`maxlength`,void 0),e.n([e.u({type:Boolean,reflect:!0})],F.prototype,`range`,void 0),e.n([e.u({type:Boolean,attribute:`show-range-labels`})],F.prototype,`showRangeLabels`,void 0),e.n([e.u({type:String,reflect:!0})],F.prototype,`min`,void 0),e.n([e.u({type:String,reflect:!0})],F.prototype,`max`,void 0),e.n([e.u({type:Boolean})],F.prototype,`weeknumbers`,void 0),e.n([e.u({type:Boolean,reflect:!0})],F.prototype,`withcontrols`,void 0),e.n([e.u({converter:a.t.csvToArray})],F.prototype,`excludedates`,void 0),e.n([e.u({converter:a.t.csvToArray})],F.prototype,`excludeweekdays`,void 0),e.n([e.u({type:String})],F.prototype,`currentmonth`,void 0),e.n([e.u({type:String})],F.prototype,`today`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`calendar-open`})],F.prototype,`calendarOpen`,void 0),e.n([e.u({type:String})],F.prototype,`timezone`,void 0),e.n([e.l()],F.prototype,`inputClasses`,void 0);try{e.d(`pkt-datepicker`)(F)}catch{console.warn(`Forsøker å definere <pkt-datepicker>, men den er allerede definert`)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return F}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=window.CustomEvent;(!e||typeof e==`object`)&&(e=function(e,t){t||={};var n=document.createEvent(`CustomEvent`);return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),n},e.prototype=window.Event.prototype);function t(e,t){var n=`on`+t.type.toLowerCase();return typeof e[n]==`function`&&e[n](t),e.dispatchEvent(t)}function n(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),n=function(e,n){return t[e]!==void 0&&t[e]!==n};if(t.opacity<1||n(`zIndex`,`auto`)||n(`transform`,`none`)||n(`mixBlendMode`,`normal`)||n(`filter`,`none`)||n(`perspective`,`none`)||t.isolation===`isolate`||t.position===`fixed`||t.webkitOverflowScrolling===`touch`)return!0;e=e.parentElement}return!1}function r(e){for(;e;){if(e.localName===`dialog`)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function i(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function a(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1}function o(e){return!e||!e.hasAttribute(`method`)?!1:e.getAttribute(`method`).toLowerCase()===`dialog`}function s(e){var t=[`button`,`input`,`keygen`,`select`,`textarea`].map(function(e){return e+`:not([disabled])`});t.push(`[tabindex]:not([disabled]):not([tabindex=""])`);var n=e.querySelector(t.join(`, `));if(!n&&`attachShadow`in Element.prototype)for(var r=e.querySelectorAll(`*`),i=0;i<r.length&&!(r[i].tagName&&r[i].shadowRoot&&(n=s(r[i].shadowRoot),n));i++);return n}function c(e){return e.isConnected||document.body.contains(e)}function l(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var n=f.formSubmitter;if(!n){var r=e.target;n=(`getRootNode`in r&&r.getRootNode()||document).activeElement}return!n||n.form!==t?null:n}function u(e){if(!e.defaultPrevented){var t=e.target,n=f.imagemapUseValue,i=l(e);n===null&&i&&(n=i.value);var a=r(t);a&&(i&&i.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&(e.preventDefault(),n==null?a.close():a.close(n))}}function d(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute(`role`)||e.setAttribute(`role`,`dialog`),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),e.addEventListener(`submit`,u,!1),`returnValue`in e||(e.returnValue=``),`MutationObserver`in window)new MutationObserver(this.maybeHideModal.bind(this)).observe(e,{attributes:!0,attributeFilter:[`open`]});else{var t=!1,n=function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}.bind(this),r,i=function(i){if(i.target===e){var a=`DOMNodeRemoved`;t|=i.type.substr(0,a.length)===a,window.clearTimeout(r),r=window.setTimeout(n,0)}};[`DOMAttrModified`,`DOMNodeRemoved`,`DOMNodeRemovedFromDocument`].forEach(function(t){e.addEventListener(t,i)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,`open`)}),this.backdrop_=document.createElement(`div`),this.backdrop_.className=`backdrop`,this.backdrop_.addEventListener(`mouseup`,this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener(`mousedown`,this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener(`click`,this.backdropMouseEvent_.bind(this))}d.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute(`open`)&&c(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex=``,this.replacedStyleTop_&&=(this.dialog_.style.top=``,!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),f.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute(`open`)||this.dialog_.setAttribute(`open`,``):(this.dialog_.removeAttribute(`open`),this.maybeHideModal())},backdropMouseEvent_:function(e){if(this.dialog_.hasAttribute(`tabindex`))this.dialog_.focus();else{var t=document.createElement(`div`);this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var n=document.createEvent(`MouseEvents`);n.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(n),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector(`[autofocus]:not([disabled])`);!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),e||=s(this.dialog_),i(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw Error(`dialogZ should never be < backdropZ`);this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute(`open`))throw Error(`Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.`);if(!c(this.dialog_))throw Error(`Failed to execute 'showModal' on dialog: The element is not in a Document.`);if(!f.dm.pushDialog(this))throw Error(`Failed to execute 'showModal' on dialog: There are too many open modal dialogs.`);n(this.dialog_.parentElement)&&console.warn(`A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context`),this.setOpen(!0),this.openAsModal_=!0,f.needsCentering(this.dialog_)?(f.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(n){if(!this.dialog_.hasAttribute(`open`))throw Error(`Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.`);this.setOpen(!1),n!==void 0&&(this.dialog_.returnValue=n);var r=new e(`close`,{bubbles:!1,cancelable:!1});t(this.dialog_,r)}};var f={};if(f.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,n=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,n)+`px`},f.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var n=document.styleSheets[t],r=null;try{r=n.cssRules}catch{}if(r)for(var i=0;i<r.length;++i){var o=r[i],s=null;try{s=document.querySelectorAll(o.selectorText)}catch{}if(!(!s||!a(s,e))){var c=o.style.getPropertyValue(`top`),l=o.style.getPropertyValue(`bottom`);if(c&&c!==`auto`||l&&l!==`auto`)return!0}}}return!1},f.needsCentering=function(e){return window.getComputedStyle(e).position!==`absolute`||e.style.top!==`auto`&&e.style.top!==``||e.style.bottom!==`auto`&&e.style.bottom!==``?!1:!f.isInlinePositionSetByStylesheet(e)},f.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn(`This browser already supports <dialog>, the polyfill may not work correctly`,e),e.localName!==`dialog`)throw Error(`Failed to register dialog: The element is not a dialog.`);new d(e)},f.registerDialog=function(e){e.showModal||f.forceRegisterDialog(e)},f.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement(`div`),this.overlay.className=`_dialog_overlay`,this.overlay.addEventListener(`click`,function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,`MutationObserver`in window&&(this.mo_=new MutationObserver(function(t){var n=[];t.forEach(function(e){for(var t=0,r;r=e.removedNodes[t];++t){if(r instanceof Element)r.localName===`dialog`&&n.push(r);else continue;n=n.concat(r.querySelectorAll(`dialog`))}}),n.length&&e(n)}))},f.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener(`focus`,this.handleFocus_,!0),document.addEventListener(`keydown`,this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},f.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener(`focus`,this.handleFocus_,!0),document.removeEventListener(`keydown`,this.handleKey_),this.mo_&&this.mo_.disconnect()},f.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,n;n=this.pendingDialogStack[t];++t)n.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var r=this.pendingDialogStack[0];r?(r.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},f.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=r(e);){for(var t=0,n;n=this.pendingDialogStack[t];++t)if(n.dialog===e)return t===0;e=e.parentElement}return!1},f.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),i(t),this.forwardTab_!==void 0)){var n=this.pendingDialogStack[0];return n.dialog.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?n.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},f.DialogManager.prototype.handleKey_=function(n){if(this.forwardTab_=void 0,n.keyCode===27){n.preventDefault(),n.stopPropagation();var r=new e(`cancel`,{bubbles:!1,cancelable:!0}),i=this.pendingDialogStack[0];i&&t(i.dialog,r)&&i.dialog.close()}else n.keyCode===9&&(this.forwardTab_=!n.shiftKey)},f.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){e.indexOf(t.dialog)===-1?t.maybeHideModal():t.downgradeModal()})},f.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)},f.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},f.dm=new f.DialogManager,f.formSubmitter=null,f.imagemapUseValue=null,window.HTMLDialogElement===void 0){var p=document.createElement(`form`);if(p.setAttribute(`method`,`dialog`),p.method!==`dialog`){var m=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`method`);if(m){var h=m.get;m.get=function(){return o(this)?`dialog`:h.call(this)};var g=m.set;m.set=function(e){return typeof e==`string`&&e.toLowerCase()===`dialog`?this.setAttribute(`method`,e):g.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",m)}}document.addEventListener(`click`,function(e){if(f.formSubmitter=null,f.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if(`composedPath`in e&&(t=e.composedPath().shift()||t),!(!t||!o(t.form))){if(!(t.type===`submit`&&[`button`,`input`].indexOf(t.localName)>-1)){if(t.localName!==`input`||t.type!==`image`)return;f.imagemapUseValue=e.offsetX+`,`+e.offsetY}r(t)&&(f.formSubmitter=t)}}},!1),document.addEventListener(`submit`,function(e){var t=e.target;if(!r(t)){var n=l(e);(n&&n.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&e.preventDefault()}});var _=HTMLFormElement.prototype.submit,v=function(){if(!o(this))return _.call(this);var e=r(this);e&&e.close()};HTMLFormElement.prototype.submit=v}exports.default=f;
|
|
1
|
+
var e=window.CustomEvent;(!e||typeof e==`object`)&&(e=function(e,t){t||={};var n=document.createEvent(`CustomEvent`);return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),n},e.prototype=window.Event.prototype);function t(e,t){var n=`on`+t.type.toLowerCase();return typeof e[n]==`function`&&e[n](t),e.dispatchEvent(t)}function n(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),n=function(e,n){return t[e]!==void 0&&t[e]!==n};if(t.opacity<1||n(`zIndex`,`auto`)||n(`transform`,`none`)||n(`mixBlendMode`,`normal`)||n(`filter`,`none`)||n(`perspective`,`none`)||t.isolation===`isolate`||t.position===`fixed`||t.webkitOverflowScrolling===`touch`)return!0;e=e.parentElement}return!1}function r(e){for(;e;){if(e.localName===`dialog`)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function i(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function a(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1}function o(e){return!e||!e.hasAttribute(`method`)?!1:e.getAttribute(`method`).toLowerCase()===`dialog`}function s(e){var t=[`button`,`input`,`keygen`,`select`,`textarea`].map(function(e){return e+`:not([disabled])`});t.push(`[tabindex]:not([disabled]):not([tabindex=""])`);var n=e.querySelector(t.join(`, `));if(!n&&`attachShadow`in Element.prototype)for(var r=e.querySelectorAll(`*`),i=0;i<r.length&&!(r[i].tagName&&r[i].shadowRoot&&(n=s(r[i].shadowRoot),n));i++);return n}function c(e){return e.isConnected||document.body.contains(e)}function l(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var n=f.formSubmitter;if(!n){var r=e.target;n=(`getRootNode`in r&&r.getRootNode()||document).activeElement}return!n||n.form!==t?null:n}function u(e){if(!e.defaultPrevented){var t=e.target,n=f.imagemapUseValue,i=l(e);n===null&&i&&(n=i.value);var a=r(t);a&&(i&&i.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&(e.preventDefault(),n==null?a.close():a.close(n))}}function d(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute(`role`)||e.setAttribute(`role`,`dialog`),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),e.addEventListener(`submit`,u,!1),`returnValue`in e||(e.returnValue=``),`MutationObserver`in window)new MutationObserver(this.maybeHideModal.bind(this)).observe(e,{attributes:!0,attributeFilter:[`open`]});else{var t=!1,n=function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}.bind(this),r,i=function(i){if(i.target===e){var a=`DOMNodeRemoved`;t|=i.type.substr(0,a.length)===a,window.clearTimeout(r),r=window.setTimeout(n,0)}};[`DOMAttrModified`,`DOMNodeRemoved`,`DOMNodeRemovedFromDocument`].forEach(function(t){e.addEventListener(t,i)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,`open`)}),this.backdrop_=document.createElement(`div`),this.backdrop_.className=`backdrop`,this.backdrop_.addEventListener(`mouseup`,this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener(`mousedown`,this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener(`click`,this.backdropMouseEvent_.bind(this))}d.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute(`open`)&&c(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex=``,this.replacedStyleTop_&&=(this.dialog_.style.top=``,!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),f.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute(`open`)||this.dialog_.setAttribute(`open`,``):(this.dialog_.removeAttribute(`open`),this.maybeHideModal())},backdropMouseEvent_:function(e){if(this.dialog_.hasAttribute(`tabindex`))this.dialog_.focus();else{var t=document.createElement(`div`);this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var n=document.createEvent(`MouseEvents`);n.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(n),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector(`[autofocus]:not([disabled])`);!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),e||=s(this.dialog_),i(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw Error(`dialogZ should never be < backdropZ`);this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute(`open`))throw Error(`Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.`);if(!c(this.dialog_))throw Error(`Failed to execute 'showModal' on dialog: The element is not in a Document.`);if(!f.dm.pushDialog(this))throw Error(`Failed to execute 'showModal' on dialog: There are too many open modal dialogs.`);n(this.dialog_.parentElement)&&console.warn(`A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context`),this.setOpen(!0),this.openAsModal_=!0,f.needsCentering(this.dialog_)?(f.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(n){if(!this.dialog_.hasAttribute(`open`))throw Error(`Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.`);this.setOpen(!1),n!==void 0&&(this.dialog_.returnValue=n);var r=new e(`close`,{bubbles:!1,cancelable:!1});t(this.dialog_,r)}};var f={};if(f.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,n=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,n)+`px`},f.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var n=document.styleSheets[t],r=null;try{r=n.cssRules}catch{}if(r)for(var i=0;i<r.length;++i){var o=r[i],s=null;try{s=document.querySelectorAll(o.selectorText)}catch{}if(s&&a(s,e)){var c=o.style.getPropertyValue(`top`),l=o.style.getPropertyValue(`bottom`);if(c&&c!==`auto`||l&&l!==`auto`)return!0}}}return!1},f.needsCentering=function(e){return window.getComputedStyle(e).position!==`absolute`||e.style.top!==`auto`&&e.style.top!==``||e.style.bottom!==`auto`&&e.style.bottom!==``?!1:!f.isInlinePositionSetByStylesheet(e)},f.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn(`This browser already supports <dialog>, the polyfill may not work correctly`,e),e.localName!==`dialog`)throw Error(`Failed to register dialog: The element is not a dialog.`);new d(e)},f.registerDialog=function(e){e.showModal||f.forceRegisterDialog(e)},f.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement(`div`),this.overlay.className=`_dialog_overlay`,this.overlay.addEventListener(`click`,function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,`MutationObserver`in window&&(this.mo_=new MutationObserver(function(t){var n=[];t.forEach(function(e){for(var t=0,r;r=e.removedNodes[t];++t){if(r instanceof Element)r.localName===`dialog`&&n.push(r);else continue;n=n.concat(r.querySelectorAll(`dialog`))}}),n.length&&e(n)}))},f.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener(`focus`,this.handleFocus_,!0),document.addEventListener(`keydown`,this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},f.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener(`focus`,this.handleFocus_,!0),document.removeEventListener(`keydown`,this.handleKey_),this.mo_&&this.mo_.disconnect()},f.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,n;n=this.pendingDialogStack[t];++t)n.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var r=this.pendingDialogStack[0];r?(r.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},f.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=r(e);){for(var t=0,n;n=this.pendingDialogStack[t];++t)if(n.dialog===e)return t===0;e=e.parentElement}return!1},f.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),i(t),this.forwardTab_!==void 0)){var n=this.pendingDialogStack[0];return n.dialog.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?n.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},f.DialogManager.prototype.handleKey_=function(n){if(this.forwardTab_=void 0,n.keyCode===27){n.preventDefault(),n.stopPropagation();var r=new e(`cancel`,{bubbles:!1,cancelable:!0}),i=this.pendingDialogStack[0];i&&t(i.dialog,r)&&i.dialog.close()}else n.keyCode===9&&(this.forwardTab_=!n.shiftKey)},f.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){e.indexOf(t.dialog)===-1?t.maybeHideModal():t.downgradeModal()})},f.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)},f.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},f.dm=new f.DialogManager,f.formSubmitter=null,f.imagemapUseValue=null,window.HTMLDialogElement===void 0){var p=document.createElement(`form`);if(p.setAttribute(`method`,`dialog`),p.method!==`dialog`){var m=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`method`);if(m){var h=m.get;m.get=function(){return o(this)?`dialog`:h.call(this)};var g=m.set;m.set=function(e){return typeof e==`string`&&e.toLowerCase()===`dialog`?this.setAttribute(`method`,e):g.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",m)}}document.addEventListener(`click`,function(e){if(f.formSubmitter=null,f.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if(`composedPath`in e&&(t=e.composedPath().shift()||t),t&&o(t.form)){if(!(t.type===`submit`&&[`button`,`input`].indexOf(t.localName)>-1)){if(t.localName!==`input`||t.type!==`image`)return;f.imagemapUseValue=e.offsetX+`,`+e.offsetY}r(t)&&(f.formSubmitter=t)}}},!1),document.addEventListener(`submit`,function(e){var t=e.target;if(!r(t)){var n=l(e);(n&&n.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&e.preventDefault()}});var _=HTMLFormElement.prototype.submit,v=function(){if(!o(this))return _.call(this);var e=r(this);e&&e.close()};HTMLFormElement.prototype.submit=v}exports.default=f;
|
|
@@ -165,7 +165,7 @@ if (f.reposition = function(e) {
|
|
|
165
165
|
try {
|
|
166
166
|
s = document.querySelectorAll(o.selectorText);
|
|
167
167
|
} catch {}
|
|
168
|
-
if (
|
|
168
|
+
if (s && a(s, e)) {
|
|
169
169
|
var c = o.style.getPropertyValue("top"), l = o.style.getPropertyValue("bottom");
|
|
170
170
|
if (c && c !== "auto" || l && l !== "auto") return !0;
|
|
171
171
|
}
|
|
@@ -254,7 +254,7 @@ if (f.reposition = function(e) {
|
|
|
254
254
|
document.addEventListener("click", function(e) {
|
|
255
255
|
if (f.formSubmitter = null, f.imagemapUseValue = null, !e.defaultPrevented) {
|
|
256
256
|
var t = e.target;
|
|
257
|
-
if ("composedPath" in e && (t = e.composedPath().shift() || t),
|
|
257
|
+
if ("composedPath" in e && (t = e.composedPath().shift() || t), t && o(t.form)) {
|
|
258
258
|
if (!(t.type === "submit" && ["button", "input"].indexOf(t.localName) > -1)) {
|
|
259
259
|
if (t.localName !== "input" || t.type !== "image") return;
|
|
260
260
|
f.imagemapUseValue = e.offsetX + "," + e.offsetY;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "./element-
|
|
1
|
+
import { v as e } from "./element-ckeMVgMz.js";
|
|
2
2
|
//#region ../../node_modules/lit-html/directive-helpers.js
|
|
3
3
|
var { I: t } = e, n = (e) => e, r = (e) => e.strings === void 0, i = () => document.createComment(""), a = (e, r, a) => {
|
|
4
4
|
let o = e._$AA.parentNode, s = r === void 0 ? e._$AB : r._$AA;
|
|
@@ -881,7 +881,7 @@ var Fe = class {
|
|
|
881
881
|
}
|
|
882
882
|
};
|
|
883
883
|
//#endregion
|
|
884
|
-
//#region \0@oxc-project+runtime@0.
|
|
884
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/decorate.js
|
|
885
885
|
function Q(e, t, n, r) {
|
|
886
886
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
887
887
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as e, g as t, m as n, t as r } from "./element-
|
|
2
|
-
import { t as i } from "./async-directive-
|
|
1
|
+
import { f as e, g as t, m as n, t as r } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as i } from "./async-directive-C4LocQwR.js";
|
|
3
3
|
//#region src/controllers/pkt-slot-utils.ts
|
|
4
4
|
function a(e) {
|
|
5
5
|
return e.classList && (e.classList.contains("_dialog_overlay") || e.classList.contains("backdrop")) ? !0 : typeof e.hasAttribute == "function" && e.hasAttribute("data-skip");
|
|
@@ -74,7 +74,7 @@ function T(e) {
|
|
|
74
74
|
data: Object.getOwnPropertyDescriptor(CharacterData.prototype, "data"),
|
|
75
75
|
nodeValue: Object.getOwnPropertyDescriptor(Node.prototype, "nodeValue")
|
|
76
76
|
};
|
|
77
|
-
for (let [e, r] of Object.entries(n))
|
|
77
|
+
for (let [e, r] of Object.entries(n)) r?.get && r.set && Object.defineProperty(t, e, {
|
|
78
78
|
configurable: !0,
|
|
79
79
|
get: () => r.get.call(t),
|
|
80
80
|
set: (e) => {
|
|
@@ -233,7 +233,7 @@ var D = class e {
|
|
|
233
233
|
let o = null;
|
|
234
234
|
for (let t = r; t && !o; t = t.nextSibling) {
|
|
235
235
|
let n = this.placeholderToNode.get(t) ?? t;
|
|
236
|
-
if (
|
|
236
|
+
if (n !== e && this.trackedNodes.has(n)) {
|
|
237
237
|
if (n instanceof HTMLTemplateElement) return !1;
|
|
238
238
|
m(n) === i && (o = n);
|
|
239
239
|
}
|
|
@@ -264,9 +264,9 @@ var D = class e {
|
|
|
264
264
|
}), !0) : !1;
|
|
265
265
|
}
|
|
266
266
|
adoptText(e) {
|
|
267
|
-
|
|
267
|
+
this.initialCollectionDone && !this.trackedNodes.has(e) && (e.parentNode !== this.host || this.isInTemplate(e) || (this.flushMutations(!1), this.asOwnChange(() => {
|
|
268
268
|
this.dropMirror(e), this.insertInSlotOrder(e), this.track(e), this.handleChange();
|
|
269
|
-
}));
|
|
269
|
+
})));
|
|
270
270
|
}
|
|
271
271
|
blankTextChanged(e) {
|
|
272
272
|
let t = this.mirrorOf.get(e);
|
|
@@ -285,22 +285,21 @@ var D = class e {
|
|
|
285
285
|
syncWhitespace() {
|
|
286
286
|
if (!this.hasWhitespace) return;
|
|
287
287
|
let e = this.findContentBounds(), t = this.contentBounds, n = this.changedWhitespace;
|
|
288
|
-
if (this.contentBounds = e, this.changedWhitespace = /* @__PURE__ */ new Set(), !e)
|
|
289
|
-
for (let e of [...this.mirrorOf.keys()]) this.dropMirror(e);
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
if (this.dropMirrorsOutside(), !t) this.collectBlankBetween(e.firstAt, e.lastAt, n);
|
|
288
|
+
if (this.contentBounds = e, this.changedWhitespace = /* @__PURE__ */ new Set(), !e) for (let e of [...this.mirrorOf.keys()]) this.dropMirror(e);
|
|
293
289
|
else {
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
290
|
+
if (this.dropMirrorsOutside(), !t) this.collectBlankBetween(e.firstAt, e.lastAt, n);
|
|
291
|
+
else {
|
|
292
|
+
if (t.first !== e.first) {
|
|
293
|
+
let r = this.placeOf(t.first);
|
|
294
|
+
r && this.precedes(e.firstAt, r) ? this.collectBlankBetween(e.firstAt, r, n) : this.collectBlankBeside(e.firstAt, "nextSibling", n);
|
|
295
|
+
}
|
|
296
|
+
if (t.last !== e.last) {
|
|
297
|
+
let r = this.placeOf(t.last);
|
|
298
|
+
r && this.precedes(r, e.lastAt) ? this.collectBlankBetween(r, e.lastAt, n) : this.collectBlankBeside(e.lastAt, "previousSibling", n);
|
|
299
|
+
}
|
|
301
300
|
}
|
|
301
|
+
for (let t of n) t.parentNode === this.host && v(t) && this.isBetween(t, e) ? this.addMirror(t) : this.dropMirror(t);
|
|
302
302
|
}
|
|
303
|
-
for (let t of n) t.parentNode === this.host && v(t) && this.isBetween(t, e) ? this.addMirror(t) : this.dropMirror(t);
|
|
304
303
|
}
|
|
305
304
|
dropMirrorsOutside() {
|
|
306
305
|
let e = this.nodesBySlot.get(f) ?? [], t = [], n = (e) => {
|
|
@@ -376,7 +375,7 @@ var D = class e {
|
|
|
376
375
|
if (this.wantsObserver = !0, this.observing) return;
|
|
377
376
|
this.observing = !0;
|
|
378
377
|
let e = () => {
|
|
379
|
-
|
|
378
|
+
this.observing && typeof MutationObserver < "u" && (this.observer = new MutationObserver((e) => {
|
|
380
379
|
this.handleMutations(e);
|
|
381
380
|
}), this.observer.observe(this.host, {
|
|
382
381
|
childList: !0,
|
|
@@ -405,16 +404,11 @@ var D = class e {
|
|
|
405
404
|
for (let o of e) {
|
|
406
405
|
for (let e of o.removedNodes) {
|
|
407
406
|
let a = this.placeholderToNode.get(e);
|
|
408
|
-
if (a && e.parentNode === this.host)
|
|
409
|
-
|
|
410
|
-
continue;
|
|
411
|
-
}
|
|
412
|
-
if (a) {
|
|
407
|
+
if (a && e.parentNode === this.host) t || (this.removeFromSlots(a), this.insertInSlotOrder(a), S(a), u.has(a) && this.changedWhitespace.add(e), n = !0);
|
|
408
|
+
else if (a) {
|
|
413
409
|
if (this.placeholderToNode.delete(e), this.nodeToPlaceholder.delete(a), u.has(a) && this.mirrorOf.delete(e), t) continue;
|
|
414
410
|
S(a), this.removeContent(a), n = !0;
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
if (this.trackedNodes.has(e) && !this.host.contains(e) && !t) {
|
|
411
|
+
} else if (this.trackedNodes.has(e) && !this.host.contains(e) && !t) {
|
|
418
412
|
this.removeContent(e);
|
|
419
413
|
let t = this.forgetPlaceholder(e);
|
|
420
414
|
if (t && (r.push(t), o.target !== this.host)) {
|
|
@@ -424,18 +418,13 @@ var D = class e {
|
|
|
424
418
|
n = !0;
|
|
425
419
|
}
|
|
426
420
|
}
|
|
427
|
-
if (o.target !== this.host)
|
|
428
|
-
|
|
429
|
-
continue;
|
|
430
|
-
}
|
|
431
|
-
if (!t) {
|
|
421
|
+
if (o.target !== this.host) o.addedNodes.length && a.push(o);
|
|
422
|
+
else if (!t) {
|
|
432
423
|
for (let e of o.addedNodes) if (!this.placeholderToNode.has(e)) {
|
|
433
424
|
if (this.trackedNodes.has(e) && e.parentNode === this.host) {
|
|
434
425
|
let t = this.forgetPlaceholder(e);
|
|
435
426
|
t && S(t), this.removeFromSlots(e), this.insertInSlotOrder(e), n = !0;
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
!this.trackedNodes.has(e) && _(e) ? (this.addContent(e), n = !0) : (this.watchHostText(e), v(e) && (n = !0));
|
|
427
|
+
} else !this.trackedNodes.has(e) && _(e) ? (this.addContent(e), n = !0) : (this.watchHostText(e), v(e) && (n = !0));
|
|
439
428
|
}
|
|
440
429
|
}
|
|
441
430
|
}
|
|
@@ -481,7 +470,7 @@ var D = class e {
|
|
|
481
470
|
let e = !1;
|
|
482
471
|
for (let t of [...this.trackedNodes]) {
|
|
483
472
|
let n = this.nodeToPlaceholder.get(t), r = this.host.contains(t);
|
|
484
|
-
r
|
|
473
|
+
(!r || n && n.parentNode !== this.host) && (n && S(this.forgetPlaceholder(t)), r && S(t), this.removeContent(t), e = !0);
|
|
485
474
|
}
|
|
486
475
|
let t = this.getContentEnd();
|
|
487
476
|
for (let n = t ? this.host.firstChild : null; n && n !== t; n = n.nextSibling) this.trackedNodes.has(n) || this.placeholderToNode.has(n) || (this.watchHostText(n), _(n) && (this.addContent(n), e = !0));
|
|
@@ -559,7 +548,7 @@ var D = class e {
|
|
|
559
548
|
return this.part = e, this.host = n, this.slotName = r, this.manager || (this.manager = d(n), this.manager.collectNodes(), this.manager.addDirective(this)), this.placeNodes(), t;
|
|
560
549
|
}
|
|
561
550
|
handleNodesChanged() {
|
|
562
|
-
|
|
551
|
+
this.isConnected && this.manager && this.placeNodes();
|
|
563
552
|
}
|
|
564
553
|
disconnected() {
|
|
565
554
|
this.manager?.removeDirective(this), this.manager = null, this.lastGeneration = -1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./async-directive-DpyKp6qv.cjs");function n(e){return e.classList&&(e.classList.contains(`_dialog_overlay`)||e.classList.contains(`backdrop`))?!0:typeof e.hasAttribute==`function`&&e.hasAttribute(`data-skip`)}function r(e){return e.nodeName===`OPTION`||e.nodeName===`DATA`}function i(e){return e.nodeType===Node.TEXT_NODE&&e.nodeValue?.trim()!==``}var a=new WeakMap,o=new WeakMap,s=new WeakSet;function c(e){let t=a.get(e);return t||(t=new w(e),a.set(e,t)),t}var l=Symbol(`default`);function u(e){return e===void 0?l:e}function d(e){if(e.nodeType!==Node.ELEMENT_NODE)return l;let t=e.getAttribute(`slot`);return t===null?l:u(t)}function f(e){return Array.isArray(e)?e.map(e=>{let t=e===null?l:e;return[t,t]}):Object.entries(e).map(([e,t])=>[e,t===null?l:t])}function p(e,t){return e.length===t.length&&e.every(([e,n],r)=>t[r][0]===e&&t[r][1]===n)}function m(e){if(e.nodeType===Node.TEXT_NODE)return i(e);if(e.nodeType!==Node.ELEMENT_NODE)return!1;let t=e;return!n(t)&&!r(t)}function h(e){return e.nodeType===Node.TEXT_NODE&&!!e.nodeValue&&!i(e)}function g(e,t){if(!m(e))return!1;if(e instanceof HTMLTemplateElement){let n=d(e);for(let r of Array.from(e.content.childNodes))_(t,n,r)}else _(t,d(e),e);return!0}function _(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function v(e,t,n){Node.prototype.insertBefore.call(e,t,n)}function y(e){e.parentNode&&Node.prototype.removeChild.call(e.parentNode,e)}function b(e){return Object.getOwnPropertyDescriptor(Node.prototype,`nextSibling`).get.call(e)}function x(e,t){return e.node.compareDocumentPosition(t.node)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function S(e){if(e.nodeType!==Node.TEXT_NODE||Object.prototype.hasOwnProperty.call(e,`data`))return;let t=e,n={data:Object.getOwnPropertyDescriptor(CharacterData.prototype,`data`),nodeValue:Object.getOwnPropertyDescriptor(Node.prototype,`nodeValue`)};for(let[e,r]of Object.entries(n))r?.get&&r.set&&Object.defineProperty(t,e,{configurable:!0,get:()=>r.get.call(t),set:e=>{r.set.call(t,e),C(t)}})}function C(e){let t=o.get(e);if(t){i(e)||t.releaseText(e);return}let n=e.parentNode&&a.get(e.parentNode);n&&(i(e)?n.adoptText(e):n.blankTextChanged(e))}var w=class e{static{this.PLACEHOLDER_PREFIX=`pkt-slot`}constructor(e){this.nodesBySlot=new Map,this.trackedNodes=new Set,this.placeholderToNode=new Map,this.nodeToPlaceholder=new Map,this.mirrorOf=new Map,this.hasWhitespace=!1,this.contentBounds=null,this.changedWhitespace=new Set,this.directives=new Set,this.sources=new Map,this.subscribers=new Set,this.generation=0,this.initialCollectionDone=!1,this.inOwnChange=!1,this.rendering=!1,this.contentEnd=null,this.rootMarker=null,this.observer=null,this.observing=!1,this.wantsObserver=!1,this.followsHostRenders=!1,this.host=e,typeof e.addController==`function`&&(this.followsHostRenders=!0,e.addController({hostConnected:()=>{if(!this.wantsObserver)return;let e=!this.observing;this.startObserving(),e&&this.resync()},hostDisconnected:()=>this.stopObservingIfUnused(),hostUpdate:()=>{e.hasUpdated||this.collectLateChildren(),this.flushMutations(!1),e.hasUpdated||this.insertContentEnd(),this.rendering=!0,queueMicrotask(()=>{this.rendering=!1})},hostUpdated:()=>{this.rendering=!1,!this.rootMarker&&this.contentEnd?.parentNode===e&&(this.rootMarker=b(this.contentEnd)),this.flushMutations(!0)}}))}collectNodes(){if(this.initialCollectionDone)return;this.initialCollectionDone=!0,this.generation++;let e=Array.from(this.host.childNodes);for(let t of e)this.watchHostText(t),g(t,this.nodesBySlot)&&this.track(t);this.syncWhitespace()}collectLateChildren(){if(this.initialCollectionDone){for(let e of Array.from(this.host.childNodes))this.trackedNodes.has(e)||this.placeholderToNode.has(e)||(this.watchHostText(e),m(e)&&(this.addContent(e),this.generation++));this.syncWhitespace()}}addDirective(e){this.directives.add(e),this.startObserving()}removeDirective(e){this.directives.delete(e),this.stopObservingIfUnused()}addSource(e,t,n){let r=this.sources.get(e);r&&r.manager===t&&p(r.mapping,n)||(r&&r.manager!==t&&this.detachFrom(r.manager,e),this.sources.set(e,{manager:t,mapping:n}),t.subscribers.add(this),t.startObserving(),this.handleChange())}removeSource(e){let t=this.sources.get(e);t&&(this.sources.delete(e),this.detachFrom(t.manager,e),this.handleChange())}detachFrom(e,t){[...this.sources.entries()].some(([n,r])=>n!==t&&r.manager===e)||(e.subscribers.delete(this),e.stopObservingIfUnused())}reachableParts(e=new Set){if(e.has(this))return[];e.add(this);let t=[...this.directives];for(let n of this.subscribers)t.push(...n.reachableParts(e));return t}getNodes(e){return this.placementNodes(e).filter(e=>!s.has(e))}placementNodes(e){return this.nodesFor(u(e))}hasContent(e){return this.getNodes(e).length>0}nodesFor(e){let t=this.nodesBySlot.get(e)??[];if(this.sources.size===0)return t;let n=[];for(let{manager:t,mapping:r}of this.sources.values())for(let[i,a]of r)a===e&&n.push(...t.nodesFor(i));return n.length?[...t,...n]:t}ensurePlaceholder(e){if(this.nodeToPlaceholder.has(e))return;if(e.parentNode!==this.host){for(let{manager:t}of this.sources.values())t.ensurePlaceholder(e);return}let t=this.isInTemplate(e)?this.getContentEnd():e;v(this.host,this.createPlaceholder(e),t)}createPlaceholder(t){let n=document.createComment(e.PLACEHOLDER_PREFIX);if(t.nodeType===Node.TEXT_NODE){let e=t;Object.defineProperty(n,"data",{configurable:!0,get:()=>e.data,set:t=>{e.data=t}})}return this.placeholderToNode.set(n,t),this.nodeToPlaceholder.set(t,n),n}forgetPlaceholder(e){let t=this.nodeToPlaceholder.get(e);return t&&(this.placeholderToNode.delete(t),this.nodeToPlaceholder.delete(e)),t}placeholderOf(e){return this.trackedNodes.has(e)?this.nodeToPlaceholder.get(e):void 0}handleNow(e){if(this.rendering)return e();this.flushMutations(!1);let t=e();return this.flushMutations(!1),t}positionInHost(e){if(!e||e.parentNode===this.host)return this.rendering||e&&!this.isInTemplate(e)?e:this.getContentEnd()??e;if(this.trackedNodes.has(e))return this.nodeToPlaceholder.get(e)??e;for(let t=e.previousSibling;t;t=t.previousSibling){let e=this.placeholderOf(t);if(e)return e.nextSibling}for(let t=e.nextSibling;t;t=t.nextSibling){let e=this.placeholderOf(t);if(e)return e}return this.reachableParts().some(t=>t.parentOfPart()===e.parentNode)?this.getContentEnd():e}owns(e){return this.trackedNodes.has(e)}moveDistributed(e,t){let n=this.nodeToPlaceholder.get(e);if(this.rendering||!n||!this.trackedNodes.has(e)||!e.parentNode||e.parentNode===this.host)return!1;this.flushMutations(!1);let r=this.positionInHost(t);if(r===n||r===e)return!0;if(r&&r.parentNode!==this.host)return!1;let i=d(e),a=this.nodesBySlot.get(i);if(!a||!a.includes(e))return!1;let o=null;for(let t=r;t&&!o;t=t.nextSibling){let n=this.placeholderToNode.get(t)??t;if(n!==e&&this.trackedNodes.has(n)){if(n instanceof HTMLTemplateElement)return!1;d(n)===i&&(o=n)}}let s=a[a.length-1]===e?a[a.length-2]:a[a.length-1],c=o??s;return c&&(!c.parentNode||c.parentNode===this.host)?!1:(this.asOwnChange(()=>{v(this.host,n,r),a.splice(a.indexOf(e),1),a.splice(o?a.indexOf(o):a.length,0,e),o?v(o.parentNode,e,o):s&&v(s.parentNode,e,s.nextSibling),this.handleChange()}),!0)}replaceContent(e){if(!this.initialCollectionDone)return!1;let t=e.flatMap(e=>e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(e.childNodes):[e]);if(t.some(e=>e.contains(this.host)))return!1;this.flushMutations(!1);let n=this.getContentEnd();return n?(this.asOwnChange(()=>{let e=new Set(this.trackedNodes);for(let t of this.nodesBySlot.values())t.forEach(t=>e.add(t));for(let t of e){let e=this.forgetPlaceholder(t);e&&y(e),y(t),this.untrack(t)}for(this.nodesBySlot.clear(),this.mirrorOf.clear(),this.contentBounds=null;n.previousSibling;)y(n.previousSibling);let r=document.createDocumentFragment();r.append(...t),v(this.host,r,n);for(let e of t)this.watchHostText(e),m(e)&&this.addContent(e);this.handleChange()}),!0):!1}adoptText(e){this.initialCollectionDone&&!this.trackedNodes.has(e)&&(e.parentNode!==this.host||this.isInTemplate(e)||(this.flushMutations(!1),this.asOwnChange(()=>{this.dropMirror(e),this.insertInSlotOrder(e),this.track(e),this.handleChange()})))}blankTextChanged(e){let t=this.mirrorOf.get(e);t&&(t.data=e.data,e.data)||this.initialCollectionDone&&(e.parentNode!==this.host||this.isInTemplate(e)||(this.watchHostText(e),this.changedWhitespace.add(e),this.flushMutations(!1),this.asOwnChange(()=>this.handleChange())))}releaseText(e){if(this.flushMutations(!1),!this.trackedNodes.has(e))return;let t=this.nodeToPlaceholder.get(e);(t?t.parentNode===this.host:e.parentNode===this.host)&&this.asOwnChange(()=>{t&&(this.forgetPlaceholder(e),Node.prototype.replaceChild.call(this.host,e,t)),this.removeContent(e),this.watchHostText(e),this.handleChange()})}watchHostText(e){S(e),h(e)&&(this.hasWhitespace=!0,this.changedWhitespace.add(e))}syncWhitespace(){if(!this.hasWhitespace)return;let e=this.findContentBounds(),t=this.contentBounds,n=this.changedWhitespace;if(this.contentBounds=e,this.changedWhitespace=new Set,!e)for(let e of[...this.mirrorOf.keys()])this.dropMirror(e);else{if(this.dropMirrorsOutside(),!t)this.collectBlankBetween(e.firstAt,e.lastAt,n);else{if(t.first!==e.first){let r=this.placeOf(t.first);r&&this.precedes(e.firstAt,r)?this.collectBlankBetween(e.firstAt,r,n):this.collectBlankBeside(e.firstAt,`nextSibling`,n)}if(t.last!==e.last){let r=this.placeOf(t.last);r&&this.precedes(r,e.lastAt)?this.collectBlankBetween(r,e.lastAt,n):this.collectBlankBeside(e.lastAt,`previousSibling`,n)}}for(let t of n)t.parentNode===this.host&&h(t)&&this.isBetween(t,e)?this.addMirror(t):this.dropMirror(t)}}dropMirrorsOutside(){let e=this.nodesBySlot.get(l)??[],t=[],n=e=>{if(s.has(e))t.push(this.nodeToPlaceholder.get(e));else if(this.placeOf(e))return!1;return!0};for(let t=0;t<e.length&&n(e[t]);t++);for(let t=e.length-1;t>=0&&n(e[t]);t--);t.forEach(e=>this.dropMirror(e))}precedes(e,t){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)}collectBlankBeside(e,t,n){for(let r=e[t];r;r=r[t]){if(h(r)){n.add(r);continue}let e=this.placeholderToNode.get(r)??r;if(!s.has(e)&&this.trackedNodes.has(e))return}}findContentBounds(){let e=this.nodesBySlot.get(l)??[],t=e=>s.has(e)?null:this.placeOf(e),n,r=null,i,a=null;for(let i=0;i<e.length&&!r;i++)[n,r]=[e[i],t(e[i])];for(let n=e.length-1;n>=0&&!a;n--)[i,a]=[e[n],t(e[n])];return n&&i&&r&&a?{first:n,last:i,firstAt:r,lastAt:a}:null}placeOf(e){if(!this.trackedNodes.has(e))return null;let t=this.nodeToPlaceholder.get(e)??e;return t.parentNode===this.host?t:null}isBetween(e,{firstAt:t,lastAt:n}){return this.precedes(t,e)&&this.precedes(e,n)}collectBlankBetween(e,t,n){if(e===t)return;let[r,i]=this.precedes(e,t)?[e,t]:[t,e];for(let e=r.nextSibling;e&&e!==i;e=e.nextSibling)h(e)&&n.add(e)}addMirror(e){if(this.mirrorOf.has(e))return;let t=document.createTextNode(e.data);s.add(t),this.mirrorOf.set(e,t),this.placeholderToNode.set(e,t),this.nodeToPlaceholder.set(t,e),this.insertInSlotOrder(t)}dropMirror(e){let t=this.mirrorOf.get(e);t&&(this.mirrorOf.delete(e),this.forgetPlaceholder(t),y(t),this.removeFromSlots(t))}insertContentEnd(){this.contentEnd||(this.contentEnd=document.createComment(``),Object.defineProperty(this.contentEnd,"nextSibling",{configurable:!0,get:()=>null})),this.contentEnd.parentNode!==this.host&&v(this.host,this.contentEnd,null)}getContentEnd(){let e=this.contentEnd;return e?(e.parentNode!==this.host&&this.rootMarker?.parentNode===this.host&&v(this.host,e,this.rootMarker),e.parentNode===this.host?e:null):null}isInTemplate(e){let t=this.getContentEnd();return!t||e.parentNode!==this.host?!1:e===t||!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)}startObserving(){if(this.wantsObserver=!0,this.observing)return;this.observing=!0;let e=()=>{this.observing&&typeof MutationObserver<`u`&&(this.observer=new MutationObserver(e=>{this.handleMutations(e)}),this.observer.observe(this.host,{childList:!0,subtree:!0}))};this.followsHostRenders?e():setTimeout(e,0)}stopObserving(){this.observing&&(this.observing=!1,this.observer?.disconnect(),this.observer=null)}stopObservingIfUnused(){let e=this.directives.size===0&&this.subscribers.size===0;(!this.host.isConnected||e&&!this.followsHostRenders)&&this.stopObserving()}flushMutations(e){if(this.inOwnChange)return;let t=this.observer?.takeRecords();t?.length&&this.handleMutations(t,e)}handleMutations(e,t=!1){this.inOwnChange||this.asOwnChange(()=>this.applyMutations(e,t))}applyMutations(e,t){let n=!1,r=[],i=new Map,a=[];for(let o of e){for(let e of o.removedNodes){let a=this.placeholderToNode.get(e);if(a&&e.parentNode===this.host)t||(this.removeFromSlots(a),this.insertInSlotOrder(a),y(a),s.has(a)&&this.changedWhitespace.add(e),n=!0);else if(a){if(this.placeholderToNode.delete(e),this.nodeToPlaceholder.delete(a),s.has(a)&&this.mirrorOf.delete(e),t)continue;y(a),this.removeContent(a),n=!0}else if(this.trackedNodes.has(e)&&!this.host.contains(e)&&!t){this.removeContent(e);let t=this.forgetPlaceholder(e);if(t&&(r.push(t),o.target!==this.host)){let e=i.get(o.target)??[];e.push(t),i.set(o.target,e)}n=!0}}if(o.target!==this.host)o.addedNodes.length&&a.push(o);else if(!t){for(let e of o.addedNodes)if(!this.placeholderToNode.has(e)){if(this.trackedNodes.has(e)&&e.parentNode===this.host){let t=this.forgetPlaceholder(e);t&&y(t),this.removeFromSlots(e),this.insertInSlotOrder(e),n=!0}else!this.trackedNodes.has(e)&&m(e)?(this.addContent(e),n=!0):(this.watchHostText(e),h(e)&&(n=!0))}}}i.size&&this.adoptNodesInParts(a,i)&&(n=!0);for(let e of r)y(e);this.getContentEnd(),n&&this.handleChange()}adoptNodesInParts(e,t){let n=new Set;for(let r of e)t.has(r.target)&&r.addedNodes.forEach(e=>n.add(e));if(n.size===0)return!1;let r=this.reachableParts(),i=[];for(let e of n){if(!e.parentNode||!t.has(e.parentNode)||o.has(e)||s.has(e)||this.placeholderToNode.has(e))continue;let n=r.find(t=>t.contains(e));if(!n)continue;let a=this.hostPositionFor(e,n,t);a&&i.push({node:e,before:a.before})}if(i.length===0)return!1;let a=!1;for(let{node:e,before:t}of i.sort(x))m(e)&&!(e instanceof HTMLTemplateElement)?(v(this.host,this.createPlaceholder(e),t),this.insertInSlotOrder(e),this.track(e),a=!0):v(this.host,e,t);return a}hostPositionFor(e,t,n){let{startNode:r,endNode:i}=t.bounds();for(let t=e.nextSibling;t&&t!==i;t=t.nextSibling){let e=this.placeholderOf(t);if(e)return{before:e}}for(let t=e.previousSibling;t&&t!==r;t=t.previousSibling){let e=this.placeholderOf(t);if(e)return{before:e.nextSibling}}let a=e.parentNode?n.get(e.parentNode):void 0;return a?{before:a[0]}:null}resync(){this.asOwnChange(()=>{let e=!1;for(let t of[...this.trackedNodes]){let n=this.nodeToPlaceholder.get(t),r=this.host.contains(t);(!r||n&&n.parentNode!==this.host)&&(n&&y(this.forgetPlaceholder(t)),r&&y(t),this.removeContent(t),e=!0)}let t=this.getContentEnd();for(let n=t?this.host.firstChild:null;n&&n!==t;n=n.nextSibling)this.trackedNodes.has(n)||this.placeholderToNode.has(n)||(this.watchHostText(n),m(n)&&(this.addContent(n),e=!0));this.syncWhitespace(),this.sortSlots()&&(e=!0),e&&this.handleChange()})}sortSlots(){let e=!1;for(let t of this.nodesBySlot.values()){if(!t.every(e=>this.nodeToPlaceholder.has(e)))continue;let n=t.map(e=>({node:this.nodeToPlaceholder.get(e),real:e})).sort(x).map(({real:e})=>e);n.every((e,n)=>e===t[n])||(t.splice(0,t.length,...n),n.forEach(y),e=!0)}return e}handleChange(){this.syncWhitespace(),this.generation++,this.notifyDirectives();for(let e of this.subscribers)e.handleChange();this.host.requestUpdate()}notifyDirectives(){for(let e of this.directives)e.handleNodesChanged()}asOwnChange(e){let t=this.inOwnChange;this.inOwnChange=!0;try{e()}finally{t||(this.observer?.takeRecords(),this.inOwnChange=!1)}}addContent(e){e instanceof HTMLTemplateElement?g(e,this.nodesBySlot):this.insertInSlotOrder(e),this.track(e)}removeContent(e){this.untrack(e),this.removeFromSlots(e)}track(e){this.trackedNodes.add(e),o.set(e,this),S(e)}untrack(e){this.trackedNodes.delete(e),o.get(e)===this&&o.delete(e)}insertInSlotOrder(e){let t=d(e),n=this.nodesBySlot.get(t)??[];this.nodesBySlot.set(t,n);let r=this.nodeToPlaceholder.get(e)??e,i=e=>{let t=this.nodeToPlaceholder.get(e)??e;return!!(r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)},a=n.length;for(;a>0&&i(n[a-1]);)a--;n.splice(a,0,e)}removeFromSlots(e){for(let[t,n]of this.nodesBySlot){let r=n.indexOf(e);if(r!==-1){n.splice(r,1),n.length===0&&this.nodesBySlot.delete(t);return}}}},T=class extends t.t{constructor(t){if(super(t),this.manager=null,this.host=null,this.part=null,this.lastGeneration=-1,t.type!==e.m.CHILD)throw Error(`slotContent() can only be used in child expressions`)}render(t,n){return e.g}update(t,[n,r]){return this.part=t,this.host=n,this.slotName=r,this.manager||(this.manager=c(n),this.manager.collectNodes(),this.manager.addDirective(this)),this.placeNodes(),e.g}handleNodesChanged(){this.isConnected&&this.manager&&this.placeNodes()}disconnected(){this.manager?.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){this.host&&(this.manager=c(this.host),this.manager.addDirective(this),this.placeNodes())}contains(e){let t=this.parentOfPart();return!this.isConnected||!t?!1:this.isInsidePart(e,t,this.coversContainer(t))}bounds(){return{startNode:this.part?.startNode??null,endNode:this.part?.endNode??null}}parentOfPart(){return this.part?this.part.startNode?this.part.startNode.parentNode:this.part.parentNode:null}placeNodes(){if(!this.manager||!this.part)return;let e=this.manager.generation;if(e===this.lastGeneration)return;this.lastGeneration=e;let t=this.parentOfPart();if(!t)return;let n=this.manager.placementNodes(this.slotName),r=this.coversContainer(t),i=this.part.endNode;for(let e=n.length-1;e>=0;e--){let a=n[e];this.isInsidePart(a,t,r)||(this.manager.ensurePlaceholder(a),v(t,a,i)),i=a}}coversContainer(e){let{startNode:t,endNode:n}=this.part;return!n&&(!t||t===e.firstChild)}isInsidePart(e,t,n){if(!this.part||e.parentNode!==t)return!1;if(n)return!0;let{startNode:r,endNode:i}=this.part,a=!r||!!(r.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING),o=!i||!!(e.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING);return a&&o}},E=e.f(T),D=class extends t.t{constructor(t){if(super(t),this.target=null,this.source=null,this.mapping=[],t.type!==e.m.ELEMENT)throw Error(`forwardSlots() can only be used as an element directive`)}render(t,n){return e.g}update(t,[n,r]){let i=c(t.element);return this.target&&this.target!==i&&this.target.removeSource(this),this.target=i,this.source=c(n),this.source.collectNodes(),this.mapping=f(r),this.target.addSource(this,this.source,this.mapping),e.g}disconnected(){this.target?.removeSource(this)}reconnected(){this.target&&this.source&&this.target.addSource(this,this.source,this.mapping)}},O=e.f(D),k=new Map;function A(e){if(k.has(e))return k.get(e);let t,n=HTMLElement.prototype;for(;!t&&n;)t=Object.getOwnPropertyDescriptor(n,e),n=Object.getPrototypeOf(n);return k.set(e,t),t}function j(e,t){return t.some(t=>typeof t!=`string`&&t.contains(e))}var M=class extends e.t{connectedCallback(){c(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return c(this).hasContent(e)}appendChild(e){let t=c(this);return t.moveDistributed(e,null)?e:t.handleNow(()=>super.insertBefore(e,t.positionInHost(null)))}append(...e){if(j(this,e)){super.append(...e);return}let t=c(this);t.handleNow(()=>{let n=document.createDocumentFragment();n.append(...e),super.insertBefore(n,t.positionInHost(null))})}prepend(...e){c(this).handleNow(()=>super.prepend(...e))}insertBefore(e,t){let n=c(this);return n.moveDistributed(e,t)?e:n.handleNow(()=>super.insertBefore(e,n.positionInHost(t)))}removeChild(e){let t=c(this);return e.parentNode===this||!t.owns(e)?super.removeChild(e):t.handleNow(()=>(e.parentNode?.removeChild(e),e))}replaceChild(e,t){let n=c(this);return t.parentNode===this||!n.owns(t)?super.replaceChild(e,t):n.handleNow(()=>(super.insertBefore(e,n.positionInHost(t)),t.parentNode?.removeChild(t),t))}replaceChildren(...e){let t=e.map(e=>typeof e==`string`?document.createTextNode(e):e);c(this).replaceContent(t)||super.replaceChildren(...e)}get textContent(){return A(`textContent`).get.call(this)}set textContent(e){let t=e==null?``:String(e);c(this).replaceContent(t?[document.createTextNode(t)]:[])||A(`textContent`).set.call(this,e)}get innerHTML(){return A(`innerHTML`).get.call(this)}set innerHTML(e){let t=document.createElement(`template`);t.innerHTML=e,c(this).replaceContent(Array.from(t.content.childNodes))||A(`innerHTML`).set.call(this,e)}get innerText(){let e=A(`innerText`);return e?.get?e.get.call(this):this.textContent}set innerText(e){let t=A(`innerText`);if(!t?.set){this.textContent=e;return}let n=document.createElement(`div`);t.set.call(n,e),c(this).replaceContent(Array.from(n.childNodes))||t.set.call(this,e)}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return M}});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { _ as e, d as t, l as n, n as r, s as i, t as a, u as o } from "./element-
|
|
2
|
-
import { t as s } from "./class-map-
|
|
1
|
+
import { _ as e, d as t, l as n, n as r, s as i, t as a, u as o } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as s } from "./class-map-BkEYw5uE.js";
|
|
3
3
|
import { n as c, t as l } from "./format-BTeSVkED.js";
|
|
4
|
-
import "./alert-
|
|
5
|
-
import "./icon-
|
|
6
|
-
import
|
|
7
|
-
import { t as
|
|
4
|
+
import "./alert-JnRrtTOW.js";
|
|
5
|
+
import "./icon-CLMJYuTL.js";
|
|
6
|
+
import "./input-wrapper-BSjQc4Vx.js";
|
|
7
|
+
import { t as u } from "./if-defined-D18nY_K_.js";
|
|
8
|
+
import { t as d } from "./converters-CYgQrWVm.js";
|
|
8
9
|
import { n as f } from "./utils-BwF4QSrq.js";
|
|
9
|
-
import "./input-wrapper-xRJo_iVf.js";
|
|
10
10
|
import { r as p } from "./focus-trap-DG3pEuyJ.js";
|
|
11
|
-
import "./modal-
|
|
12
|
-
import "./progressbar-
|
|
11
|
+
import "./modal-DbzEnZNF.js";
|
|
12
|
+
import "./progressbar-t0zgEke0.js";
|
|
13
13
|
//#region ../../shared-utils/fileupload/size.ts
|
|
14
14
|
function m(e) {
|
|
15
15
|
if (e == null || e === "") return;
|
|
@@ -181,7 +181,7 @@ var j = class extends a {
|
|
|
181
181
|
let t = e.dataTransfer?.files ? Array.from(e.dataTransfer.files) : [];
|
|
182
182
|
this.addFiles(t);
|
|
183
183
|
}, this.onHostFormSubmit = (e) => {
|
|
184
|
-
|
|
184
|
+
this.required && this.uploadStrategy === "custom" && (this.getCurrentFiles().length > 0 || (this.validationErrorMessage = this.requiredSelectionMessage, e.preventDefault()));
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
get requiredSelectionMessage() {
|
|
@@ -210,7 +210,7 @@ var j = class extends a {
|
|
|
210
210
|
}
|
|
211
211
|
syncNativeInputFiles() {
|
|
212
212
|
let e = this.querySelector(`#${this.id}-input`);
|
|
213
|
-
if (
|
|
213
|
+
if (e && typeof DataTransfer < "u") try {
|
|
214
214
|
let t = new DataTransfer();
|
|
215
215
|
for (let e of this.getCurrentFiles()) e.file && t.items.add(e.file);
|
|
216
216
|
e.files = t.files;
|
|
@@ -345,7 +345,7 @@ var j = class extends a {
|
|
|
345
345
|
return this.dispatchEvent(r), n.errorMessage ? n.errorMessage : r.defaultPrevented ? this.pktStrings.get("fileupload").genericValidationRejection : null;
|
|
346
346
|
}
|
|
347
347
|
syncThumbnailUrls(e) {
|
|
348
|
-
if (
|
|
348
|
+
if (typeof URL > "u" || typeof URL.createObjectURL != "function" || typeof URL.revokeObjectURL != "function") {
|
|
349
349
|
this.thumbnailUrls = {}, this.thumbnailFileById.clear();
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
@@ -368,11 +368,7 @@ var j = class extends a {
|
|
|
368
368
|
this.thumbnailUrls = n;
|
|
369
369
|
}
|
|
370
370
|
revokeAllThumbnailUrls() {
|
|
371
|
-
|
|
372
|
-
this.thumbnailUrls = {}, this.thumbnailFileById.clear();
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
Object.values(this.thumbnailUrls).forEach((e) => URL.revokeObjectURL(e)), this.thumbnailUrls = {}, this.thumbnailFileById.clear();
|
|
371
|
+
typeof URL > "u" || typeof URL.revokeObjectURL != "function" ? (this.thumbnailUrls = {}, this.thumbnailFileById.clear()) : (Object.values(this.thumbnailUrls).forEach((e) => URL.revokeObjectURL(e)), this.thumbnailUrls = {}, this.thumbnailFileById.clear());
|
|
376
372
|
}
|
|
377
373
|
getSrUploadedMessage() {
|
|
378
374
|
if (this.addedAnnouncement) return this.addedAnnouncement;
|
|
@@ -833,7 +829,7 @@ var M = "comments", N = (e, t) => {
|
|
|
833
829
|
aria-label=${l(o.previewImage, { filename: f })}
|
|
834
830
|
?disabled=${!h}
|
|
835
831
|
@click=${() => {
|
|
836
|
-
|
|
832
|
+
h && c && c(t.fileId);
|
|
837
833
|
}}
|
|
838
834
|
>
|
|
839
835
|
<span class="pkt-btn__text">
|
|
@@ -1066,11 +1062,8 @@ var M = "comments", N = (e, t) => {
|
|
|
1066
1062
|
this.isPreviewModalOpen = !1;
|
|
1067
1063
|
}, this.onPreviewKeyDown = (e, t) => {
|
|
1068
1064
|
if (this.isPreviewModalOpen) {
|
|
1069
|
-
if (e.key === "Tab")
|
|
1070
|
-
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
switch (e.key) {
|
|
1065
|
+
if (e.key === "Tab") p(e, e.currentTarget);
|
|
1066
|
+
else switch (e.key) {
|
|
1074
1067
|
case "ArrowLeft":
|
|
1075
1068
|
e.preventDefault(), this.navigatePreview("prev", t);
|
|
1076
1069
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs");require("./alert-CuXM6TnC.cjs"),require("./icon-jPhyZD1z.cjs");const r=require("./if-defined-CiML3MTM.cjs"),i=require("./converters-BJ9Fe0kW.cjs"),a=require("./utils-63cRpWut.cjs");require("./input-wrapper-BEmV0DGo.cjs");const o=require("./focus-trap-DSv4Ifqm.cjs");require("./modal-wEEmCcUx.cjs"),require("./progressbar-CnX4fFfR.cjs");function s(e){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&e>0?e:void 0;let t=String(e).trim(),n=Number(t);if(!Number.isNaN(n)&&n>0)return n;let r=t.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!r){console.warn(`PktFileUpload: Invalid maxFileSize format "${t}". Use format like "5MB", "500KB", "1GB", or bytes.`);return}let i=parseFloat(r[1]);switch(r[2].toUpperCase()){case`B`:return i;case`KB`:return i*1024;case`MB`:return i*1024*1024;case`GB`:return i*1024*1024*1024;default:return}}function c(e){return e<1024?`${Math.round(e)} B`:e<1048576?`${Math.round(e/1024)} KB`:e<1073741824?`${Math.round(e/1048576)} MB`:`${Math.round(e/1073741824)} GB`}function l(e){return Array.isArray(e)?e.map(e=>String(e).trim().toLowerCase()).filter(Boolean):[]}function u(e){return e?e.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean):[]}function d(e,t,n){let r=e.toLowerCase().replace(/^\./,``);if(r.includes(`/`)){if(r.endsWith(`/*`)){let e=r.replace(`/*`,``);return n.startsWith(`${e}/`)}return n===r}return t===r}function f(e,t){let n=l(t);if(n.length===0)return!0;let r=e.name.split(`.`).pop()?.toLowerCase()??``,i=e.type.toLowerCase();return n.some(e=>d(e,r,i))}function p(e,t){let n=(e??``).trim();if(n)return n;let r=l(t);return r.length===0?``:r.map(e=>e.includes(`/`)||e.startsWith(`.`)?e:`.${e}`).join(`, `)}function m(e){return e.includes(`/`)?e:e.replace(/^\./,``).toUpperCase()}function h(e,t){let n=l(e);if(n.length>0)return n.map(m).join(`, `);let r=u(t);return r.length>0?r.map(m).join(`, `):``}function g(e,t,n){return((e??``).trim()||t).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`)}function _(t,n){let r=l(n.allowedFormats);if(r.length>0&&!f(t,r)){let t=r.join(`, `),i=e.s.fileupload.invalidFormat;return g(n.formatErrorMessage,i,{formats:t})}let i=s(n.maxFileSize);if(i!==void 0&&t.size>i){let t=c(i),r=e.s.fileupload.sizeTooLarge;return g(n.sizeErrorMessage,r,{maxSize:t})}if(n.onFileValidation){let e=n.onFileValidation(t);if(e)return e}return null}function v(e){let t=e.file;if(t?.type?.startsWith(`image/`))return!0;let n=e.attributes?.targetFilename||t?.name||``;return/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(n)}function y(e){return typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`}function b(e,t,n){let r={"in-progress":0,error:1,idle:2};return e.map(e=>{let r=t?.find(t=>t.fileId===e.fileId);return{...e,progress:r?.progress??(n===`form`?`done`:`queued`),errorMessage:r?.errorMessage,showProgress:r?.showProgress,lastProgress:r?.lastProgress}}).sort((e,t)=>r[y(e.progress)]-r[y(t.progress)])}function x(e,t){return!t||t<=0||e.length<=t+3?null:{head:e.slice(0,e.length-t),tail:e.slice(-t)}}function S(e,t,n){return n<=0?0:t===`prev`?e<=0?n-1:e-1:e>=n-1?0:e+1}function C(e,t){let n=e.length;if(n===0||!t||t.length===0)return{totalCount:n,uploadedCount:0,failedCount:0};let r=0,i=0;for(let n of e){let e=t.find(e=>e.fileId===n.fileId);e?.progress===`done`?r++:e?.progress===`error`&&i++}return{totalCount:n,uploadedCount:r,failedCount:i}}function w(t,n=e.s.fileupload.unknownFilename){return t.attributes?.targetFilename||t.file?.name||n}var T=class extends e.t{constructor(...e){super(...e),this.id=`pkt-fileupload-${a.n()}`,this.name=`files`,this.label=``,this.helptext=``,this.helptextDropdown=``,this.required=!1,this.multiple=!1,this.disabled=!1,this.fullwidth=!1,this.uploadStrategy=`form`,this.itemRenderer=`filename`,this.accept=``,this.allowedFormats=[],this.formatErrorMessage=``,this.sizeErrorMessage=``,this.transfers=[],this.addCommentsEnabled=!1,this.renameFilesEnabled=!1,this.extraOperations=[],this.enableImagePreview=!1,this.hasError=!1,this.errorMessage=``,this.optionalTag=!1,this.requiredTag=!1,this.tagText=null,this.truncateTail=4,this.files=[],this.isDragActive=!1,this.validationErrorMessage=null,this.addedAnnouncement=``,this.thumbnailUrls={},this.hasInitializedValue=!1,this.hasWarnedInvalidValueCombo=!1,this.thumbnailFileById=new Map,this.connectedForm=null,this.addedAnnouncementTimer=null,this.onNativeFileChange=e=>{let t=e.target;this.addFiles(t.files?Array.from(t.files):[]),this.uploadStrategy===`custom`&&(t.value=``)},this.openFileDialog=e=>{e.preventDefault(),e.stopPropagation(),!this.disabled&&this.querySelector(`#${this.id}-input`)?.click()},this.onDropZoneClick=e=>{this.disabled||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||this.querySelector(`#${this.id}-input`)?.click()},this.onDragOver=e=>{e.preventDefault(),!this.disabled&&(this.isDragActive=!0)},this.onDragLeave=()=>{this.isDragActive=!1},this.onDrop=e=>{if(e.preventDefault(),this.isDragActive=!1,this.disabled)return;let t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this.addFiles(t)},this.onHostFormSubmit=e=>{!this.required||this.uploadStrategy!==`custom`||this.getCurrentFiles().length>0||(this.validationErrorMessage=this.requiredSelectionMessage,e.preventDefault())}}get requiredSelectionMessage(){return this.pktStrings.get(`fileupload`).requiredMissing}get isControlled(){return this.value!==void 0}get hasEffectiveError(){return!!this.validationErrorMessage||this.hasError||!!this.errorMessage.trim()}get effectiveErrorMessage(){return this.validationErrorMessage??this.errorMessage??``}get hasValidationError(){return!!this.validationErrorMessage}firstUpdated(e){super.firstUpdated?.(e),this.hasInitializedValue||=(this.files=this.value??this.defaultValue??[],this.syncThumbnailUrls(this.files),!0),this.value!==void 0&&this.defaultValue!==void 0&&this.warnInvalidValueCombo()}willUpdate(e){super.willUpdate(e),this.hasInitializedValue&&this.isControlled&&(e.has(`value`)||e.has(`itemRenderer`)||e.has(`enableImagePreview`))&&(this.files=this.value??[],this.syncThumbnailUrls(this.files))}updated(e){super.updated(e),(e.has(`uploadStrategy`)||e.has(`required`)||e.has(`value`)||e.has(`form`))&&this.syncFormSubmitListener(),this.uploadStrategy===`form`&&(e.has(`value`)||e.has(`files`)||e.has(`uploadStrategy`))&&this.syncNativeInputFiles()}syncNativeInputFiles(){let e=this.querySelector(`#${this.id}-input`);if(!(!e||typeof DataTransfer>`u`))try{let t=new DataTransfer;for(let e of this.getCurrentFiles())e.file&&t.items.add(e.file);e.files=t.files}catch{}}warnInvalidValueCombo(){this.hasWarnedInvalidValueCombo||=(console.warn(`PktFileUpload: Både value og defaultValue er angitt. Komponenten kan være enten kontrollert eller ukontrollert, ikke begge. value vil bli prioritert.`),!0)}disconnectedCallback(){this.teardownFormSubmitListener(),this.addedAnnouncementTimer&&=(clearTimeout(this.addedAnnouncementTimer),null),super.disconnectedCallback(),this.revokeAllThumbnailUrls()}setAddedAnnouncement(e){this.addedAnnouncement=e,this.addedAnnouncementTimer&&clearTimeout(this.addedAnnouncementTimer),this.addedAnnouncementTimer=setTimeout(()=>{this.addedAnnouncement=``,this.addedAnnouncementTimer=null},1500)}connectedCallback(){super.connectedCallback(),this.syncFormSubmitListener()}addFiles(e){if(e.length===0)return;let t=this.multiple?e:[e[0]];for(let e of t){let t=this.validateFile(e);if(t){this.validationErrorMessage=t;return}}this.validationErrorMessage=null;let r=t.map(e=>({fileId:a.n(),file:e,attributes:{targetFilename:e.name}})),i=this.pktStrings.get(`fileupload`);this.setAddedAnnouncement(r.length===1?n.t(i.srFileAdded,{filename:r[0].attributes.targetFilename}):n.t(i.srFilesAdded,{count:r.length}));let o=this.getCurrentFiles(),s=this.multiple?[...o,...r]:[r[0]];this.commitFiles(s,`add`,r.map(e=>e.fileId)),this.uploadStrategy===`custom`&&r.forEach(e=>{this.dispatchEvent(new CustomEvent(`file-upload-requested`,{detail:{fileId:e.fileId,file:e.file,attributes:e.attributes},bubbles:!0,composed:!0}))})}getCurrentFiles(){return this.isControlled?this.value??[]:this.files}cancelTransfer(e){if(this.disabled)return;let t=this.getCurrentFiles().find(t=>t.fileId===e);t&&(this.removeFileItem(e),this.dispatchEvent(new CustomEvent(`transfer-cancelled`,{detail:{fileId:t.fileId,file:t.file,attributes:t.attributes},bubbles:!0,composed:!0})))}removeFileItem(e){if(this.disabled)return;let t=this.getCurrentFiles(),n=t.filter(t=>t.fileId!==e);n.length!==t.length&&this.commitFiles(n,`remove`,[e])}updateFileItem(e,t){let n=this.getCurrentFiles().map(n=>n.fileId===e?{...n,...t}:n);this.commitFiles(n,`update`,[e])}commitFiles(e,t,n){this.isControlled||(this.files=e,this.syncThumbnailUrls(e)),this.validationErrorMessage===this.requiredSelectionMessage&&e.length>0&&(this.validationErrorMessage=null),this.dispatchEvent(new CustomEvent(`files-changed`,{detail:{files:e,reason:t,changedFileIds:n},bubbles:!0,composed:!0}))}getThumbnailUrl(e){return this.thumbnailUrls[e.fileId]}getTransferProgress(e){let t=this.transfers.find(t=>t.fileId===e);return t?t.progress:this.uploadStrategy===`form`?`done`:`queued`}getTransferForFile(e){return this.transfers.find(t=>t.fileId===e)}isImageFile(e){return v(e)}formatFileSize(e){return c(e)}getResolvedAcceptValue(){return p(this.accept,this.allowedFormats)}getSupportedFormatsText(){return h(this.allowedFormats,this.accept)}getSortedFilesAndTransfers(){return b(this.getCurrentFiles(),this.transfers,this.uploadStrategy)}validateFile(e){let t=_(e,{allowedFormats:this.allowedFormats,maxFileSize:this.maxFileSize,formatErrorMessage:this.formatErrorMessage,sizeErrorMessage:this.sizeErrorMessage,onFileValidation:this.onFileValidation});if(t)return t;let n={file:e,errorMessage:null},r=new CustomEvent(`file-validate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r),n.errorMessage?n.errorMessage:r.defaultPrevented?this.pktStrings.get(`fileupload`).genericValidationRejection:null}syncThumbnailUrls(e){if(!(typeof URL<`u`&&typeof URL.createObjectURL==`function`&&typeof URL.revokeObjectURL==`function`)){this.thumbnailUrls={},this.thumbnailFileById.clear();return}let t=new Set(e.map(e=>e.fileId)),n={};for(let[e,n]of Object.entries(this.thumbnailUrls))t.has(e)||(URL.revokeObjectURL(n),this.thumbnailFileById.delete(e));for(let t of e){let e=this.thumbnailUrls[t.fileId],r=this.thumbnailFileById.get(t.fileId);if(!t.file||!this.isImageFile(t)){e&&(URL.revokeObjectURL(e),this.thumbnailFileById.delete(t.fileId));continue}if(e&&r===t.file){n[t.fileId]=e;continue}e&&r!==t.file&&URL.revokeObjectURL(e);let i=URL.createObjectURL(t.file);this.thumbnailFileById.set(t.fileId,t.file),n[t.fileId]=i}this.thumbnailUrls=n}revokeAllThumbnailUrls(){if(typeof URL>`u`||typeof URL.revokeObjectURL!=`function`){this.thumbnailUrls={},this.thumbnailFileById.clear();return}Object.values(this.thumbnailUrls).forEach(e=>URL.revokeObjectURL(e)),this.thumbnailUrls={},this.thumbnailFileById.clear()}getSrUploadedMessage(){if(this.addedAnnouncement)return this.addedAnnouncement;let{totalCount:e,uploadedCount:t}=C(this.getCurrentFiles(),this.transfers);if(e===0||t===0)return``;let r=this.pktStrings.get(`fileupload`);return n.t(r.srFilesUploadedOfTotal,{uploaded:t,total:e,label:n.n(e,r.fileLabelOne,r.fileLabelOther)})}getSrErrorsMessage(){let{totalCount:e,failedCount:t}=C(this.getCurrentFiles(),this.transfers);if(e===0||t===0)return``;let r=this.pktStrings.get(`fileupload`);return n.t(r.srFilesFailedOfTotal,{failed:t,total:e,label:n.n(e,r.fileLabelOne,r.fileLabelOther)})}get ownerForm(){if(this.form!==void 0){if(!this.form)return null;let e=this.ownerDocument?.getElementById(this.form);return e instanceof HTMLFormElement?e:null}return this.closest(`form`)}syncFormSubmitListener(){let e=this.ownerForm;this.connectedForm!==e&&(this.teardownFormSubmitListener(),this.connectedForm=e,this.connectedForm&&this.connectedForm.addEventListener(`submit`,this.onHostFormSubmit))}teardownFormSubmitListener(){this.connectedForm&&=(this.connectedForm.removeEventListener(`submit`,this.onHostFormSubmit),null)}};e.n([e.u({type:String})],T.prototype,`id`,void 0),e.n([e.u({type:String})],T.prototype,`name`,void 0),e.n([e.u({type:String,reflect:!0})],T.prototype,`form`,void 0),e.n([e.u({type:String})],T.prototype,`label`,void 0),e.n([e.u({type:String})],T.prototype,`helptext`,void 0),e.n([e.u({type:String,attribute:`helptext-dropdown`})],T.prototype,`helptextDropdown`,void 0),e.n([e.u({type:String,attribute:`helptext-dropdown-button`})],T.prototype,`helptextDropdownButton`,void 0),e.n([e.u({type:Boolean,reflect:!0})],T.prototype,`required`,void 0),e.n([e.u({type:Boolean,reflect:!0})],T.prototype,`multiple`,void 0),e.n([e.u({type:Boolean,reflect:!0})],T.prototype,`disabled`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`fullwidth`})],T.prototype,`fullwidth`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`upload-strategy`})],T.prototype,`uploadStrategy`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`item-renderer`})],T.prototype,`itemRenderer`,void 0),e.n([e.u({type:String})],T.prototype,`accept`,void 0),e.n([e.u({converter:i.t.csvToArray,attribute:`allowed-formats`})],T.prototype,`allowedFormats`,void 0),e.n([e.u({type:String,attribute:`format-error-message`})],T.prototype,`formatErrorMessage`,void 0),e.n([e.u({attribute:`max-file-size`})],T.prototype,`maxFileSize`,void 0),e.n([e.u({type:String,attribute:`size-error-message`})],T.prototype,`sizeErrorMessage`,void 0),e.n([e.u({attribute:!1})],T.prototype,`onFileValidation`,void 0),e.n([e.u({attribute:!1})],T.prototype,`transfers`,void 0),e.n([e.u({type:Boolean,attribute:`add-comments-enabled`})],T.prototype,`addCommentsEnabled`,void 0),e.n([e.u({type:Boolean,attribute:`rename-files-enabled`})],T.prototype,`renameFilesEnabled`,void 0),e.n([e.u({attribute:!1})],T.prototype,`extraOperations`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`enable-image-preview`})],T.prototype,`enableImagePreview`,void 0),e.n([e.u({type:Boolean,attribute:`has-error`})],T.prototype,`hasError`,void 0),e.n([e.u({type:String,attribute:`error-message`})],T.prototype,`errorMessage`,void 0),e.n([e.u({type:Boolean,attribute:`optional-tag`})],T.prototype,`optionalTag`,void 0),e.n([e.u({type:String,attribute:`optional-text`})],T.prototype,`optionalText`,void 0),e.n([e.u({type:Boolean,attribute:`required-tag`})],T.prototype,`requiredTag`,void 0),e.n([e.u({type:String,attribute:`required-text`})],T.prototype,`requiredText`,void 0),e.n([e.u({type:String,attribute:`tag-text`})],T.prototype,`tagText`,void 0),e.n([e.u({type:Number,attribute:`truncate-tail`})],T.prototype,`truncateTail`,void 0),e.n([e.u({attribute:!1})],T.prototype,`value`,void 0),e.n([e.u({attribute:!1})],T.prototype,`defaultValue`,void 0),e.n([e.l()],T.prototype,`files`,void 0),e.n([e.l()],T.prototype,`isDragActive`,void 0),e.n([e.l()],T.prototype,`validationErrorMessage`,void 0),e.n([e.l()],T.prototype,`addedAnnouncement`,void 0),e.n([e.l()],T.prototype,`thumbnailUrls`,void 0);var E=`comments`,D=(e,t)=>{let r=new Date(e);if(Number.isNaN(r.getTime()))return e;let i=String(r.getDate()).padStart(2,`0`),a=String(r.getMonth()+1).padStart(2,`0`),o=r.getFullYear(),s=String(r.getHours()).padStart(2,`0`),c=String(r.getMinutes()).padStart(2,`0`);return n.t(t.commentTimestamp,{date:`${i}.${a}.${o}`,time:`${s}:${c}`})},O=(e,t,n)=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t()),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n())},k=(e,t,n)=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},A=(e,t)=>({id:`remove`,title:t.remove,ariaLabel:t.removeFile,onClick:({file:t})=>e(t.fileId)}),j=t=>({id:`rename`,title:t.rename,ariaLabel:t.renameFile,renderInlineUI:n=>{let r=n.getAttribute(`targetFilename`)||n.file.attributes?.targetFilename||n.file.file?.name||``,i=`pkt-fileupload-rename-${n.file.fileId}`,a=()=>{let e=document.getElementById(i)?.value?.trim();e&&n.setAttribute(`targetFilename`,e),n.close()};return e._`
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs");require("./alert-BRZDpVMt.cjs"),require("./icon-jPhyZD1z.cjs"),require("./input-wrapper-4PTk8aX3.cjs");const r=require("./if-defined-CiML3MTM.cjs"),i=require("./converters-CW6SN0TT.cjs"),a=require("./utils-63cRpWut.cjs"),o=require("./focus-trap-DSv4Ifqm.cjs");require("./modal-DGiq84MG.cjs"),require("./progressbar-CnX4fFfR.cjs");function s(e){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&e>0?e:void 0;let t=String(e).trim(),n=Number(t);if(!Number.isNaN(n)&&n>0)return n;let r=t.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!r){console.warn(`PktFileUpload: Invalid maxFileSize format "${t}". Use format like "5MB", "500KB", "1GB", or bytes.`);return}let i=parseFloat(r[1]);switch(r[2].toUpperCase()){case`B`:return i;case`KB`:return i*1024;case`MB`:return i*1024*1024;case`GB`:return i*1024*1024*1024;default:return}}function c(e){return e<1024?`${Math.round(e)} B`:e<1048576?`${Math.round(e/1024)} KB`:e<1073741824?`${Math.round(e/1048576)} MB`:`${Math.round(e/1073741824)} GB`}function l(e){return Array.isArray(e)?e.map(e=>String(e).trim().toLowerCase()).filter(Boolean):[]}function u(e){return e?e.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean):[]}function d(e,t,n){let r=e.toLowerCase().replace(/^\./,``);if(r.includes(`/`)){if(r.endsWith(`/*`)){let e=r.replace(`/*`,``);return n.startsWith(`${e}/`)}return n===r}return t===r}function f(e,t){let n=l(t);if(n.length===0)return!0;let r=e.name.split(`.`).pop()?.toLowerCase()??``,i=e.type.toLowerCase();return n.some(e=>d(e,r,i))}function p(e,t){let n=(e??``).trim();if(n)return n;let r=l(t);return r.length===0?``:r.map(e=>e.includes(`/`)||e.startsWith(`.`)?e:`.${e}`).join(`, `)}function m(e){return e.includes(`/`)?e:e.replace(/^\./,``).toUpperCase()}function h(e,t){let n=l(e);if(n.length>0)return n.map(m).join(`, `);let r=u(t);return r.length>0?r.map(m).join(`, `):``}function g(e,t,n){return((e??``).trim()||t).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`)}function _(t,n){let r=l(n.allowedFormats);if(r.length>0&&!f(t,r)){let t=r.join(`, `),i=e.s.fileupload.invalidFormat;return g(n.formatErrorMessage,i,{formats:t})}let i=s(n.maxFileSize);if(i!==void 0&&t.size>i){let t=c(i),r=e.s.fileupload.sizeTooLarge;return g(n.sizeErrorMessage,r,{maxSize:t})}if(n.onFileValidation){let e=n.onFileValidation(t);if(e)return e}return null}function v(e){let t=e.file;if(t?.type?.startsWith(`image/`))return!0;let n=e.attributes?.targetFilename||t?.name||``;return/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(n)}function y(e){return typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`}function b(e,t,n){let r={"in-progress":0,error:1,idle:2};return e.map(e=>{let r=t?.find(t=>t.fileId===e.fileId);return{...e,progress:r?.progress??(n===`form`?`done`:`queued`),errorMessage:r?.errorMessage,showProgress:r?.showProgress,lastProgress:r?.lastProgress}}).sort((e,t)=>r[y(e.progress)]-r[y(t.progress)])}function x(e,t){return!t||t<=0||e.length<=t+3?null:{head:e.slice(0,e.length-t),tail:e.slice(-t)}}function S(e,t,n){return n<=0?0:t===`prev`?e<=0?n-1:e-1:e>=n-1?0:e+1}function C(e,t){let n=e.length;if(n===0||!t||t.length===0)return{totalCount:n,uploadedCount:0,failedCount:0};let r=0,i=0;for(let n of e){let e=t.find(e=>e.fileId===n.fileId);e?.progress===`done`?r++:e?.progress===`error`&&i++}return{totalCount:n,uploadedCount:r,failedCount:i}}function w(t,n=e.s.fileupload.unknownFilename){return t.attributes?.targetFilename||t.file?.name||n}var T=class extends e.t{constructor(...e){super(...e),this.id=`pkt-fileupload-${a.n()}`,this.name=`files`,this.label=``,this.helptext=``,this.helptextDropdown=``,this.required=!1,this.multiple=!1,this.disabled=!1,this.fullwidth=!1,this.uploadStrategy=`form`,this.itemRenderer=`filename`,this.accept=``,this.allowedFormats=[],this.formatErrorMessage=``,this.sizeErrorMessage=``,this.transfers=[],this.addCommentsEnabled=!1,this.renameFilesEnabled=!1,this.extraOperations=[],this.enableImagePreview=!1,this.hasError=!1,this.errorMessage=``,this.optionalTag=!1,this.requiredTag=!1,this.tagText=null,this.truncateTail=4,this.files=[],this.isDragActive=!1,this.validationErrorMessage=null,this.addedAnnouncement=``,this.thumbnailUrls={},this.hasInitializedValue=!1,this.hasWarnedInvalidValueCombo=!1,this.thumbnailFileById=new Map,this.connectedForm=null,this.addedAnnouncementTimer=null,this.onNativeFileChange=e=>{let t=e.target;this.addFiles(t.files?Array.from(t.files):[]),this.uploadStrategy===`custom`&&(t.value=``)},this.openFileDialog=e=>{e.preventDefault(),e.stopPropagation(),!this.disabled&&this.querySelector(`#${this.id}-input`)?.click()},this.onDropZoneClick=e=>{this.disabled||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||this.querySelector(`#${this.id}-input`)?.click()},this.onDragOver=e=>{e.preventDefault(),!this.disabled&&(this.isDragActive=!0)},this.onDragLeave=()=>{this.isDragActive=!1},this.onDrop=e=>{if(e.preventDefault(),this.isDragActive=!1,this.disabled)return;let t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this.addFiles(t)},this.onHostFormSubmit=e=>{this.required&&this.uploadStrategy===`custom`&&(this.getCurrentFiles().length>0||(this.validationErrorMessage=this.requiredSelectionMessage,e.preventDefault()))}}get requiredSelectionMessage(){return this.pktStrings.get(`fileupload`).requiredMissing}get isControlled(){return this.value!==void 0}get hasEffectiveError(){return!!this.validationErrorMessage||this.hasError||!!this.errorMessage.trim()}get effectiveErrorMessage(){return this.validationErrorMessage??this.errorMessage??``}get hasValidationError(){return!!this.validationErrorMessage}firstUpdated(e){super.firstUpdated?.(e),this.hasInitializedValue||=(this.files=this.value??this.defaultValue??[],this.syncThumbnailUrls(this.files),!0),this.value!==void 0&&this.defaultValue!==void 0&&this.warnInvalidValueCombo()}willUpdate(e){super.willUpdate(e),this.hasInitializedValue&&this.isControlled&&(e.has(`value`)||e.has(`itemRenderer`)||e.has(`enableImagePreview`))&&(this.files=this.value??[],this.syncThumbnailUrls(this.files))}updated(e){super.updated(e),(e.has(`uploadStrategy`)||e.has(`required`)||e.has(`value`)||e.has(`form`))&&this.syncFormSubmitListener(),this.uploadStrategy===`form`&&(e.has(`value`)||e.has(`files`)||e.has(`uploadStrategy`))&&this.syncNativeInputFiles()}syncNativeInputFiles(){let e=this.querySelector(`#${this.id}-input`);if(e&&typeof DataTransfer<`u`)try{let t=new DataTransfer;for(let e of this.getCurrentFiles())e.file&&t.items.add(e.file);e.files=t.files}catch{}}warnInvalidValueCombo(){this.hasWarnedInvalidValueCombo||=(console.warn(`PktFileUpload: Både value og defaultValue er angitt. Komponenten kan være enten kontrollert eller ukontrollert, ikke begge. value vil bli prioritert.`),!0)}disconnectedCallback(){this.teardownFormSubmitListener(),this.addedAnnouncementTimer&&=(clearTimeout(this.addedAnnouncementTimer),null),super.disconnectedCallback(),this.revokeAllThumbnailUrls()}setAddedAnnouncement(e){this.addedAnnouncement=e,this.addedAnnouncementTimer&&clearTimeout(this.addedAnnouncementTimer),this.addedAnnouncementTimer=setTimeout(()=>{this.addedAnnouncement=``,this.addedAnnouncementTimer=null},1500)}connectedCallback(){super.connectedCallback(),this.syncFormSubmitListener()}addFiles(e){if(e.length===0)return;let t=this.multiple?e:[e[0]];for(let e of t){let t=this.validateFile(e);if(t){this.validationErrorMessage=t;return}}this.validationErrorMessage=null;let r=t.map(e=>({fileId:a.n(),file:e,attributes:{targetFilename:e.name}})),i=this.pktStrings.get(`fileupload`);this.setAddedAnnouncement(r.length===1?n.t(i.srFileAdded,{filename:r[0].attributes.targetFilename}):n.t(i.srFilesAdded,{count:r.length}));let o=this.getCurrentFiles(),s=this.multiple?[...o,...r]:[r[0]];this.commitFiles(s,`add`,r.map(e=>e.fileId)),this.uploadStrategy===`custom`&&r.forEach(e=>{this.dispatchEvent(new CustomEvent(`file-upload-requested`,{detail:{fileId:e.fileId,file:e.file,attributes:e.attributes},bubbles:!0,composed:!0}))})}getCurrentFiles(){return this.isControlled?this.value??[]:this.files}cancelTransfer(e){if(this.disabled)return;let t=this.getCurrentFiles().find(t=>t.fileId===e);t&&(this.removeFileItem(e),this.dispatchEvent(new CustomEvent(`transfer-cancelled`,{detail:{fileId:t.fileId,file:t.file,attributes:t.attributes},bubbles:!0,composed:!0})))}removeFileItem(e){if(this.disabled)return;let t=this.getCurrentFiles(),n=t.filter(t=>t.fileId!==e);n.length!==t.length&&this.commitFiles(n,`remove`,[e])}updateFileItem(e,t){let n=this.getCurrentFiles().map(n=>n.fileId===e?{...n,...t}:n);this.commitFiles(n,`update`,[e])}commitFiles(e,t,n){this.isControlled||(this.files=e,this.syncThumbnailUrls(e)),this.validationErrorMessage===this.requiredSelectionMessage&&e.length>0&&(this.validationErrorMessage=null),this.dispatchEvent(new CustomEvent(`files-changed`,{detail:{files:e,reason:t,changedFileIds:n},bubbles:!0,composed:!0}))}getThumbnailUrl(e){return this.thumbnailUrls[e.fileId]}getTransferProgress(e){let t=this.transfers.find(t=>t.fileId===e);return t?t.progress:this.uploadStrategy===`form`?`done`:`queued`}getTransferForFile(e){return this.transfers.find(t=>t.fileId===e)}isImageFile(e){return v(e)}formatFileSize(e){return c(e)}getResolvedAcceptValue(){return p(this.accept,this.allowedFormats)}getSupportedFormatsText(){return h(this.allowedFormats,this.accept)}getSortedFilesAndTransfers(){return b(this.getCurrentFiles(),this.transfers,this.uploadStrategy)}validateFile(e){let t=_(e,{allowedFormats:this.allowedFormats,maxFileSize:this.maxFileSize,formatErrorMessage:this.formatErrorMessage,sizeErrorMessage:this.sizeErrorMessage,onFileValidation:this.onFileValidation});if(t)return t;let n={file:e,errorMessage:null},r=new CustomEvent(`file-validate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r),n.errorMessage?n.errorMessage:r.defaultPrevented?this.pktStrings.get(`fileupload`).genericValidationRejection:null}syncThumbnailUrls(e){if(typeof URL>`u`||typeof URL.createObjectURL!=`function`||typeof URL.revokeObjectURL!=`function`){this.thumbnailUrls={},this.thumbnailFileById.clear();return}let t=new Set(e.map(e=>e.fileId)),n={};for(let[e,n]of Object.entries(this.thumbnailUrls))t.has(e)||(URL.revokeObjectURL(n),this.thumbnailFileById.delete(e));for(let t of e){let e=this.thumbnailUrls[t.fileId],r=this.thumbnailFileById.get(t.fileId);if(!t.file||!this.isImageFile(t)){e&&(URL.revokeObjectURL(e),this.thumbnailFileById.delete(t.fileId));continue}if(e&&r===t.file){n[t.fileId]=e;continue}e&&r!==t.file&&URL.revokeObjectURL(e);let i=URL.createObjectURL(t.file);this.thumbnailFileById.set(t.fileId,t.file),n[t.fileId]=i}this.thumbnailUrls=n}revokeAllThumbnailUrls(){typeof URL>`u`||typeof URL.revokeObjectURL!=`function`?(this.thumbnailUrls={},this.thumbnailFileById.clear()):(Object.values(this.thumbnailUrls).forEach(e=>URL.revokeObjectURL(e)),this.thumbnailUrls={},this.thumbnailFileById.clear())}getSrUploadedMessage(){if(this.addedAnnouncement)return this.addedAnnouncement;let{totalCount:e,uploadedCount:t}=C(this.getCurrentFiles(),this.transfers);if(e===0||t===0)return``;let r=this.pktStrings.get(`fileupload`);return n.t(r.srFilesUploadedOfTotal,{uploaded:t,total:e,label:n.n(e,r.fileLabelOne,r.fileLabelOther)})}getSrErrorsMessage(){let{totalCount:e,failedCount:t}=C(this.getCurrentFiles(),this.transfers);if(e===0||t===0)return``;let r=this.pktStrings.get(`fileupload`);return n.t(r.srFilesFailedOfTotal,{failed:t,total:e,label:n.n(e,r.fileLabelOne,r.fileLabelOther)})}get ownerForm(){if(this.form!==void 0){if(!this.form)return null;let e=this.ownerDocument?.getElementById(this.form);return e instanceof HTMLFormElement?e:null}return this.closest(`form`)}syncFormSubmitListener(){let e=this.ownerForm;this.connectedForm!==e&&(this.teardownFormSubmitListener(),this.connectedForm=e,this.connectedForm&&this.connectedForm.addEventListener(`submit`,this.onHostFormSubmit))}teardownFormSubmitListener(){this.connectedForm&&=(this.connectedForm.removeEventListener(`submit`,this.onHostFormSubmit),null)}};e.n([e.u({type:String})],T.prototype,`id`,void 0),e.n([e.u({type:String})],T.prototype,`name`,void 0),e.n([e.u({type:String,reflect:!0})],T.prototype,`form`,void 0),e.n([e.u({type:String})],T.prototype,`label`,void 0),e.n([e.u({type:String})],T.prototype,`helptext`,void 0),e.n([e.u({type:String,attribute:`helptext-dropdown`})],T.prototype,`helptextDropdown`,void 0),e.n([e.u({type:String,attribute:`helptext-dropdown-button`})],T.prototype,`helptextDropdownButton`,void 0),e.n([e.u({type:Boolean,reflect:!0})],T.prototype,`required`,void 0),e.n([e.u({type:Boolean,reflect:!0})],T.prototype,`multiple`,void 0),e.n([e.u({type:Boolean,reflect:!0})],T.prototype,`disabled`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`fullwidth`})],T.prototype,`fullwidth`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`upload-strategy`})],T.prototype,`uploadStrategy`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`item-renderer`})],T.prototype,`itemRenderer`,void 0),e.n([e.u({type:String})],T.prototype,`accept`,void 0),e.n([e.u({converter:i.t.csvToArray,attribute:`allowed-formats`})],T.prototype,`allowedFormats`,void 0),e.n([e.u({type:String,attribute:`format-error-message`})],T.prototype,`formatErrorMessage`,void 0),e.n([e.u({attribute:`max-file-size`})],T.prototype,`maxFileSize`,void 0),e.n([e.u({type:String,attribute:`size-error-message`})],T.prototype,`sizeErrorMessage`,void 0),e.n([e.u({attribute:!1})],T.prototype,`onFileValidation`,void 0),e.n([e.u({attribute:!1})],T.prototype,`transfers`,void 0),e.n([e.u({type:Boolean,attribute:`add-comments-enabled`})],T.prototype,`addCommentsEnabled`,void 0),e.n([e.u({type:Boolean,attribute:`rename-files-enabled`})],T.prototype,`renameFilesEnabled`,void 0),e.n([e.u({attribute:!1})],T.prototype,`extraOperations`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`enable-image-preview`})],T.prototype,`enableImagePreview`,void 0),e.n([e.u({type:Boolean,attribute:`has-error`})],T.prototype,`hasError`,void 0),e.n([e.u({type:String,attribute:`error-message`})],T.prototype,`errorMessage`,void 0),e.n([e.u({type:Boolean,attribute:`optional-tag`})],T.prototype,`optionalTag`,void 0),e.n([e.u({type:String,attribute:`optional-text`})],T.prototype,`optionalText`,void 0),e.n([e.u({type:Boolean,attribute:`required-tag`})],T.prototype,`requiredTag`,void 0),e.n([e.u({type:String,attribute:`required-text`})],T.prototype,`requiredText`,void 0),e.n([e.u({type:String,attribute:`tag-text`})],T.prototype,`tagText`,void 0),e.n([e.u({type:Number,attribute:`truncate-tail`})],T.prototype,`truncateTail`,void 0),e.n([e.u({attribute:!1})],T.prototype,`value`,void 0),e.n([e.u({attribute:!1})],T.prototype,`defaultValue`,void 0),e.n([e.l()],T.prototype,`files`,void 0),e.n([e.l()],T.prototype,`isDragActive`,void 0),e.n([e.l()],T.prototype,`validationErrorMessage`,void 0),e.n([e.l()],T.prototype,`addedAnnouncement`,void 0),e.n([e.l()],T.prototype,`thumbnailUrls`,void 0);var E=`comments`,D=(e,t)=>{let r=new Date(e);if(Number.isNaN(r.getTime()))return e;let i=String(r.getDate()).padStart(2,`0`),a=String(r.getMonth()+1).padStart(2,`0`),o=r.getFullYear(),s=String(r.getHours()).padStart(2,`0`),c=String(r.getMinutes()).padStart(2,`0`);return n.t(t.commentTimestamp,{date:`${i}.${a}.${o}`,time:`${s}:${c}`})},O=(e,t,n)=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t()),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n())},k=(e,t,n)=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},A=(e,t)=>({id:`remove`,title:t.remove,ariaLabel:t.removeFile,onClick:({file:t})=>e(t.fileId)}),j=t=>({id:`rename`,title:t.rename,ariaLabel:t.renameFile,renderInlineUI:n=>{let r=n.getAttribute(`targetFilename`)||n.file.attributes?.targetFilename||n.file.file?.name||``,i=`pkt-fileupload-rename-${n.file.fileId}`,a=()=>{let e=document.getElementById(i)?.value?.trim();e&&n.setAttribute(`targetFilename`,e),n.close()};return e._`
|
|
2
2
|
<label for=${i} class="pkt-sr-only">${t.renameInputLabel}</label>
|
|
3
3
|
<input
|
|
4
4
|
id=${i}
|
|
@@ -194,7 +194,7 @@ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),
|
|
|
194
194
|
class="pkt-fileupload__queue-display__item__thumbnail__image-wrapper pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--label-only"
|
|
195
195
|
aria-label=${n.t(l.previewImage,{filename:f})}
|
|
196
196
|
?disabled=${!h}
|
|
197
|
-
@click=${()=>{
|
|
197
|
+
@click=${()=>{h&&u&&u(i.fileId)}}
|
|
198
198
|
>
|
|
199
199
|
<span class="pkt-btn__text">
|
|
200
200
|
${m?e._`<pkt-icon
|
|
@@ -255,7 +255,7 @@ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),
|
|
|
255
255
|
${w===`idle`?V({file:n,disabled:i,inputName:r,operations:l,activeOperationId:u,onActivateOperation:d,onCloseOperation:f,getFileAttribute:p,setFileAttribute:m}):null}
|
|
256
256
|
${w===`idle`?H({file:n,disabled:i,inputName:r,operations:l,activeOperationId:u,onActivateOperation:d,onCloseOperation:f,getFileAttribute:p,setFileAttribute:m}):null}
|
|
257
257
|
</li>
|
|
258
|
-
`},J=class extends T{constructor(...e){super(...e),this.activeOperationByFileId={},this.isPreviewModalOpen=!1,this.previewCurrentIndex=0,this.failedImageFileIds={},this.closePreview=()=>{this.isPreviewModalOpen=!1},this.onPreviewKeyDown=(e,t)=>{if(this.isPreviewModalOpen){if(e.key===`Tab`)
|
|
258
|
+
`},J=class extends T{constructor(...e){super(...e),this.activeOperationByFileId={},this.isPreviewModalOpen=!1,this.previewCurrentIndex=0,this.failedImageFileIds={},this.closePreview=()=>{this.isPreviewModalOpen=!1},this.onPreviewKeyDown=(e,t)=>{if(this.isPreviewModalOpen){if(e.key===`Tab`)o.r(e,e.currentTarget);else switch(e.key){case`ArrowLeft`:e.preventDefault(),this.navigatePreview(`prev`,t);break;case`ArrowRight`:e.preventDefault(),this.navigatePreview(`next`,t);break;case`Escape`:e.preventDefault(),this.closePreview()}}}}updated(e){super.updated(e),this.classList.add(`pkt-fileupload-component`)}render(){let n=this.renderContent();return e._`
|
|
259
259
|
<pkt-input-wrapper
|
|
260
260
|
.strings=${this.strings}
|
|
261
261
|
.forId=${`${this.id}-input`}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-
|
|
2
|
-
import "./consent-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-ckeMVgMz.js";
|
|
2
|
+
import "./consent-DiD0iQ5h.js";
|
|
3
3
|
import { t as s } from "./booleanish-OQJTYSrw.js";
|
|
4
4
|
import { n as c, r as l, t as u } from "./fetch-header-footer-data-Pc32etrk.js";
|
|
5
|
-
import "./icon-
|
|
6
|
-
import { t as d } from "./if-defined-
|
|
5
|
+
import "./icon-CLMJYuTL.js";
|
|
6
|
+
import { t as d } from "./if-defined-D18nY_K_.js";
|
|
7
7
|
//#region ../../shared-utils/header-footer/external-domain.ts
|
|
8
8
|
var f = "oslo.kommune.no", p = /\.(?:co|com|org|net|gov|edu|ac|kommune)\.[a-z]{2}$/i;
|
|
9
9
|
function m(e) {
|