@oslokommune/punkt-react 12.37.4 → 12.37.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/punkt-react.es.js +13 -4
- package/dist/punkt-react.umd.js +3 -3
- package/package.json +3 -3
package/dist/punkt-react.es.js
CHANGED
|
@@ -23111,7 +23111,7 @@ let po = class extends Gr {
|
|
|
23111
23111
|
return;
|
|
23112
23112
|
}
|
|
23113
23113
|
if (this.type === "submit" && this.internals.form) {
|
|
23114
|
-
this.internals.form.requestSubmit(
|
|
23114
|
+
this.internals.form.requestSubmit();
|
|
23115
23115
|
return;
|
|
23116
23116
|
}
|
|
23117
23117
|
if (this.type === "reset" && this.internals.form) {
|
|
@@ -26769,8 +26769,17 @@ let bf = class extends Gr {
|
|
|
26769
26769
|
this.emitCookieConsents(n);
|
|
26770
26770
|
});
|
|
26771
26771
|
}
|
|
26772
|
+
returnJsonOrObject(n) {
|
|
26773
|
+
let i;
|
|
26774
|
+
try {
|
|
26775
|
+
i = JSON.parse(n);
|
|
26776
|
+
} catch {
|
|
26777
|
+
i = n;
|
|
26778
|
+
}
|
|
26779
|
+
return i;
|
|
26780
|
+
}
|
|
26772
26781
|
emitCookieConsents(n) {
|
|
26773
|
-
const i =
|
|
26782
|
+
const i = this.returnJsonOrObject(n.value).items.reduce((l, d) => (l[d.name] = d.consent, l), {});
|
|
26774
26783
|
this.dispatchEvent(
|
|
26775
26784
|
new CustomEvent("toggle-consent", {
|
|
26776
26785
|
detail: i,
|
|
@@ -26798,7 +26807,7 @@ let bf = class extends Gr {
|
|
|
26798
26807
|
})
|
|
26799
26808
|
), window.cookieBanner.cookieConsent.validateConsentCookie().then((n) => {
|
|
26800
26809
|
if (n) {
|
|
26801
|
-
const i = { value: window.cookieBanner.cookieConsent.getConsentCookie()
|
|
26810
|
+
const i = { value: window.cookieBanner.cookieConsent.getConsentCookie() };
|
|
26802
26811
|
this.emitCookieConsents(i);
|
|
26803
26812
|
}
|
|
26804
26813
|
});
|
|
@@ -27734,7 +27743,7 @@ let ec = class extends Gr {
|
|
|
27734
27743
|
super.disconnectedCallback(), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("click", this.handleBackdropClick);
|
|
27735
27744
|
}
|
|
27736
27745
|
async firstUpdated(n) {
|
|
27737
|
-
super.firstUpdated(n), this.dialogRef.value && ("document" in window && "createElement" in document && (await import("./dialog-polyfill.esm-CbjBMXAG-Ms1CLTbS.js").then((i) => i.default)).registerDialog(this.dialogRef.value), this.dialogRef.value.addEventListener("close", () => {
|
|
27746
|
+
super.firstUpdated(n), this.dialogRef.value && !window.HTMLDialogElement && !this.dialogRef.value.showModal && ("document" in window && "createElement" in document && (await import("./dialog-polyfill.esm-CbjBMXAG-Ms1CLTbS.js").then((i) => i.default)).registerDialog(this.dialogRef.value), this.dialogRef.value.addEventListener("close", () => {
|
|
27738
27747
|
this.close(new Event("close"), !0);
|
|
27739
27748
|
}));
|
|
27740
27749
|
}
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -425,7 +425,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
425
425
|
<span class="pkt-btn__text" ${qt(this.defaultSlot)}></span>
|
|
426
426
|
${this.variant==="icons-right-and-left"?Se`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:tt}
|
|
427
427
|
</div>
|
|
428
|
-
`}updateElementClasses(){const n=new Set,i=this.getAttribute("class");n.add("pkt-btn"),i&&i.split(" ").forEach(l=>n.add(l)),this.size&&n.add(`pkt-btn--${this.size}`),this.skin&&n.add(`pkt-btn--${this.skin}`),this.variant&&n.add(`pkt-btn--${this.variant}`),this.color&&n.add(`pkt-btn--${this.color}`),this.isLoading&&n.add("pkt-btn--active"),this.state&&n.add(`pkt-btn--${this.state}`),this.disabled&&n.add("pkt-btn--disabled"),this.className=[...n].join(" ")}handleClick(n){if(this.disabled||this.isLoading){n.preventDefault(),n.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit(this);return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(n),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:n}}))}handleKeydown(n){if(!(this.disabled||this.isLoading)&&(n.key==="Enter"||n.key===" ")){n.preventDefault();const i=n.target;i&&i.click()}}};qi.formAssociated=!0,Ds([z({type:String})],qi.prototype,"iconName",2),Ds([z({type:String})],qi.prototype,"secondIconName",2),Ds([z({type:String})],qi.prototype,"mode",2),Ds([z({type:String})],qi.prototype,"size",2),Ds([z({type:String})],qi.prototype,"color",2),Ds([z({type:String})],qi.prototype,"skin",2),Ds([z({type:String})],qi.prototype,"variant",2),Ds([z({type:String})],qi.prototype,"state",2),Ds([z({type:String,reflect:!0})],qi.prototype,"type",2),Ds([z({type:Boolean})],qi.prototype,"isLoading",2),Ds([z({type:Boolean})],qi.prototype,"disabled",2),qi=Ds([dr("pkt-button")],qi);const w1=6048e5,HP=864e5,VP=36e5,D1=Symbol.for("constructDateFrom");function ul(r,n){return typeof r=="function"?r(n):r&&typeof r=="object"&&D1 in r?r[D1](n):r instanceof Date?new r.constructor(n):new Date(n)}function ki(r,n){return ul(n||r,r)}function s0(r,n,i){const l=ki(r,void 0);return isNaN(n)?ul(r,NaN):(n&&l.setDate(l.getDate()+n),l)}function qP(r,n,i){return ul(r,+ki(r)+n)}function S1(r,n,i){return qP(r,n*VP)}let WP={};function Zy(){return WP}function Ag(r,n){var i,l,c,h;const m=Zy(),D=(n==null?void 0:n.weekStartsOn)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??m.weekStartsOn??((h=(c=m.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??0,C=ki(r,n==null?void 0:n.in),T=C.getDay(),$=(T<D?7:0)+T-D;return C.setDate(C.getDate()-$),C.setHours(0,0,0,0),C}function eb(r,n){return Ag(r,{...n,weekStartsOn:1})}function C1(r,n){const i=ki(r,void 0),l=i.getFullYear(),c=ul(i,0);c.setFullYear(l+1,0,4),c.setHours(0,0,0,0);const h=eb(c),m=ul(i,0);m.setFullYear(l,0,4),m.setHours(0,0,0,0);const D=eb(m);return i.getTime()>=h.getTime()?l+1:i.getTime()>=D.getTime()?l:l-1}function x1(r){const n=ki(r),i=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return i.setUTCFullYear(n.getFullYear()),+r-+i}function _1(r,...n){const i=ul.bind(null,n.find(l=>typeof l=="object"));return n.map(i)}function l0(r,n){const i=ki(r,void 0);return i.setHours(0,0,0,0),i}function YP(r,n,i){const[l,c]=_1(void 0,r,n),h=l0(l),m=l0(c),D=+h-x1(h),C=+m-x1(m);return Math.round((D-C)/HP)}function GP(r,n){const i=C1(r),l=ul(r,0);return l.setFullYear(i,0,4),l.setHours(0,0,0,0),eb(l)}function KP(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function QP(r){return!(!KP(r)&&typeof r!="number"||isNaN(+ki(r)))}function XP(r,n){const i=ki(r,void 0);return i.setHours(23,59,59,999),i}function JP(r,n){const[i,l]=_1(r,n.start,n.end);return{start:i,end:l}}function u0(r,n){const{start:i,end:l}=JP(void 0,r);let c=+i>+l;const h=c?+i:+l,m=c?l:i;m.setHours(0,0,0,0);let D=1;const C=[];for(;+m<=h;)C.push(ul(i,m)),m.setDate(m.getDate()+D),m.setHours(0,0,0,0);return c?C.reverse():C}function ZP(r,n){const i=ki(r,void 0);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}const eN={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},tN=(r,n,i)=>{let l;const c=eN[r];return typeof c=="string"?l=c:n===1?l=c.one:l=c.other.replace("{{count}}",n.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+l:l+" ago":l};function c0(r){return(n={})=>{const i=n.width?String(n.width):r.defaultWidth;return r.formats[i]||r.formats[r.defaultWidth]}}const nN={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},rN={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},aN={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iN={date:c0({formats:nN,defaultWidth:"full"}),time:c0({formats:rN,defaultWidth:"full"}),dateTime:c0({formats:aN,defaultWidth:"full"})},oN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sN=(r,n,i,l)=>oN[r];function Fg(r){return(n,i)=>{const l=i!=null&&i.context?String(i.context):"standalone";let c;if(l==="formatting"&&r.formattingValues){const m=r.defaultFormattingWidth||r.defaultWidth,D=i!=null&&i.width?String(i.width):m;c=r.formattingValues[D]||r.formattingValues[m]}else{const m=r.defaultWidth,D=i!=null&&i.width?String(i.width):r.defaultWidth;c=r.values[D]||r.values[m]}const h=r.argumentCallback?r.argumentCallback(n):n;return c[h]}}const lN={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uN={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cN={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dN={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},fN={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pN={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hN=(r,n)=>{const i=Number(r),l=i%100;if(l>20||l<10)switch(l%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},mN={ordinalNumber:hN,era:Fg({values:lN,defaultWidth:"wide"}),quarter:Fg({values:uN,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Fg({values:cN,defaultWidth:"wide"}),day:Fg({values:dN,defaultWidth:"wide"}),dayPeriod:Fg({values:fN,defaultWidth:"wide",formattingValues:pN,defaultFormattingWidth:"wide"})};function $g(r){return(n,i={})=>{const l=i.width,c=l&&r.matchPatterns[l]||r.matchPatterns[r.defaultMatchWidth],h=n.match(c);if(!h)return null;const m=h[0],D=l&&r.parsePatterns[l]||r.parsePatterns[r.defaultParseWidth],C=Array.isArray(D)?vN(D,N=>N.test(m)):gN(D,N=>N.test(m));let T;T=r.valueCallback?r.valueCallback(C):C,T=i.valueCallback?i.valueCallback(T):T;const $=n.slice(m.length);return{value:T,rest:$}}}function gN(r,n){for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&n(r[i]))return i}function vN(r,n){for(let i=0;i<r.length;i++)if(n(r[i]))return i}function yN(r){return(n,i={})=>{const l=n.match(r.matchPattern);if(!l)return null;const c=l[0],h=n.match(r.parsePattern);if(!h)return null;let m=r.valueCallback?r.valueCallback(h[0]):h[0];m=i.valueCallback?i.valueCallback(m):m;const D=n.slice(c.length);return{value:m,rest:D}}}const bN=/^(\d+)(th|st|nd|rd)?/i,kN=/\d+/i,wN={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},DN={any:[/^b/i,/^(a|c)/i]},SN={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},CN={any:[/1/i,/2/i,/3/i,/4/i]},xN={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_N={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},EN={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},TN={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},AN={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},FN={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$N={ordinalNumber:yN({matchPattern:bN,parsePattern:kN,valueCallback:r=>parseInt(r,10)}),era:$g({matchPatterns:wN,defaultMatchWidth:"wide",parsePatterns:DN,defaultParseWidth:"any"}),quarter:$g({matchPatterns:SN,defaultMatchWidth:"wide",parsePatterns:CN,defaultParseWidth:"any",valueCallback:r=>r+1}),month:$g({matchPatterns:xN,defaultMatchWidth:"wide",parsePatterns:_N,defaultParseWidth:"any"}),day:$g({matchPatterns:EN,defaultMatchWidth:"wide",parsePatterns:TN,defaultParseWidth:"any"}),dayPeriod:$g({matchPatterns:AN,defaultMatchWidth:"any",parsePatterns:FN,defaultParseWidth:"any"})},PN={code:"en-US",formatDistance:tN,formatLong:iN,formatRelative:sN,localize:mN,match:$N,options:{weekStartsOn:0,firstWeekContainsDate:1}};function NN(r,n){const i=ki(r,void 0);return YP(i,ZP(i))+1}function ON(r,n){const i=ki(r,void 0),l=+eb(i)-+GP(i);return Math.round(l/w1)+1}function E1(r,n){var i,l,c,h;const m=ki(r,n==null?void 0:n.in),D=m.getFullYear(),C=Zy(),T=(n==null?void 0:n.firstWeekContainsDate)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??C.firstWeekContainsDate??((h=(c=C.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,$=ul((n==null?void 0:n.in)||r,0);$.setFullYear(D+1,0,T),$.setHours(0,0,0,0);const N=Ag($,n),O=ul((n==null?void 0:n.in)||r,0);O.setFullYear(D,0,T),O.setHours(0,0,0,0);const R=Ag(O,n);return+m>=+N?D+1:+m>=+R?D:D-1}function RN(r,n){var i,l,c,h;const m=Zy(),D=(n==null?void 0:n.firstWeekContainsDate)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??m.firstWeekContainsDate??((h=(c=m.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,C=E1(r,n),T=ul((n==null?void 0:n.in)||r,0);return T.setFullYear(C,0,D),T.setHours(0,0,0,0),Ag(T,n)}function T1(r,n){const i=ki(r,n==null?void 0:n.in),l=+Ag(i,n)-+RN(i,n);return Math.round(l/w1)+1}function ar(r,n){const i=r<0?"-":"",l=Math.abs(r).toString().padStart(n,"0");return i+l}const kd={y(r,n){const i=r.getFullYear(),l=i>0?i:1-i;return ar(n==="yy"?l%100:l,n.length)},M(r,n){const i=r.getMonth();return n==="M"?String(i+1):ar(i+1,2)},d(r,n){return ar(r.getDate(),n.length)},a(r,n){const i=r.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h(r,n){return ar(r.getHours()%12||12,n.length)},H(r,n){return ar(r.getHours(),n.length)},m(r,n){return ar(r.getMinutes(),n.length)},s(r,n){return ar(r.getSeconds(),n.length)},S(r,n){const i=n.length,l=r.getMilliseconds(),c=Math.trunc(l*Math.pow(10,i-3));return ar(c,n.length)}},xh={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},A1={G:function(r,n,i){const l=r.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return i.era(l,{width:"abbreviated"});case"GGGGG":return i.era(l,{width:"narrow"});case"GGGG":default:return i.era(l,{width:"wide"})}},y:function(r,n,i){if(n==="yo"){const l=r.getFullYear(),c=l>0?l:1-l;return i.ordinalNumber(c,{unit:"year"})}return kd.y(r,n)},Y:function(r,n,i,l){const c=E1(r,l),h=c>0?c:1-c;if(n==="YY"){const m=h%100;return ar(m,2)}return n==="Yo"?i.ordinalNumber(h,{unit:"year"}):ar(h,n.length)},R:function(r,n){const i=C1(r);return ar(i,n.length)},u:function(r,n){const i=r.getFullYear();return ar(i,n.length)},Q:function(r,n,i){const l=Math.ceil((r.getMonth()+1)/3);switch(n){case"Q":return String(l);case"QQ":return ar(l,2);case"Qo":return i.ordinalNumber(l,{unit:"quarter"});case"QQQ":return i.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(l,{width:"wide",context:"formatting"})}},q:function(r,n,i){const l=Math.ceil((r.getMonth()+1)/3);switch(n){case"q":return String(l);case"qq":return ar(l,2);case"qo":return i.ordinalNumber(l,{unit:"quarter"});case"qqq":return i.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(l,{width:"wide",context:"standalone"})}},M:function(r,n,i){const l=r.getMonth();switch(n){case"M":case"MM":return kd.M(r,n);case"Mo":return i.ordinalNumber(l+1,{unit:"month"});case"MMM":return i.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(l,{width:"wide",context:"formatting"})}},L:function(r,n,i){const l=r.getMonth();switch(n){case"L":return String(l+1);case"LL":return ar(l+1,2);case"Lo":return i.ordinalNumber(l+1,{unit:"month"});case"LLL":return i.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(l,{width:"wide",context:"standalone"})}},w:function(r,n,i,l){const c=T1(r,l);return n==="wo"?i.ordinalNumber(c,{unit:"week"}):ar(c,n.length)},I:function(r,n,i){const l=ON(r);return n==="Io"?i.ordinalNumber(l,{unit:"week"}):ar(l,n.length)},d:function(r,n,i){return n==="do"?i.ordinalNumber(r.getDate(),{unit:"date"}):kd.d(r,n)},D:function(r,n,i){const l=NN(r);return n==="Do"?i.ordinalNumber(l,{unit:"dayOfYear"}):ar(l,n.length)},E:function(r,n,i){const l=r.getDay();switch(n){case"E":case"EE":case"EEE":return i.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(l,{width:"short",context:"formatting"});case"EEEE":default:return i.day(l,{width:"wide",context:"formatting"})}},e:function(r,n,i,l){const c=r.getDay(),h=(c-l.weekStartsOn+8)%7||7;switch(n){case"e":return String(h);case"ee":return ar(h,2);case"eo":return i.ordinalNumber(h,{unit:"day"});case"eee":return i.day(c,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(c,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(c,{width:"short",context:"formatting"});case"eeee":default:return i.day(c,{width:"wide",context:"formatting"})}},c:function(r,n,i,l){const c=r.getDay(),h=(c-l.weekStartsOn+8)%7||7;switch(n){case"c":return String(h);case"cc":return ar(h,n.length);case"co":return i.ordinalNumber(h,{unit:"day"});case"ccc":return i.day(c,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(c,{width:"narrow",context:"standalone"});case"cccccc":return i.day(c,{width:"short",context:"standalone"});case"cccc":default:return i.day(c,{width:"wide",context:"standalone"})}},i:function(r,n,i){const l=r.getDay(),c=l===0?7:l;switch(n){case"i":return String(c);case"ii":return ar(c,n.length);case"io":return i.ordinalNumber(c,{unit:"day"});case"iii":return i.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(l,{width:"short",context:"formatting"});case"iiii":default:return i.day(l,{width:"wide",context:"formatting"})}},a:function(r,n,i){const l=r.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return i.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(r,n,i){const l=r.getHours();let c;switch(l===12?c=xh.noon:l===0?c=xh.midnight:c=l/12>=1?"pm":"am",n){case"b":case"bb":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(c,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(c,{width:"wide",context:"formatting"})}},B:function(r,n,i){const l=r.getHours();let c;switch(l>=17?c=xh.evening:l>=12?c=xh.afternoon:l>=4?c=xh.morning:c=xh.night,n){case"B":case"BB":case"BBB":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(c,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(c,{width:"wide",context:"formatting"})}},h:function(r,n,i){if(n==="ho"){let l=r.getHours()%12;return l===0&&(l=12),i.ordinalNumber(l,{unit:"hour"})}return kd.h(r,n)},H:function(r,n,i){return n==="Ho"?i.ordinalNumber(r.getHours(),{unit:"hour"}):kd.H(r,n)},K:function(r,n,i){const l=r.getHours()%12;return n==="Ko"?i.ordinalNumber(l,{unit:"hour"}):ar(l,n.length)},k:function(r,n,i){let l=r.getHours();return l===0&&(l=24),n==="ko"?i.ordinalNumber(l,{unit:"hour"}):ar(l,n.length)},m:function(r,n,i){return n==="mo"?i.ordinalNumber(r.getMinutes(),{unit:"minute"}):kd.m(r,n)},s:function(r,n,i){return n==="so"?i.ordinalNumber(r.getSeconds(),{unit:"second"}):kd.s(r,n)},S:function(r,n){return kd.S(r,n)},X:function(r,n,i){const l=r.getTimezoneOffset();if(l===0)return"Z";switch(n){case"X":return $1(l);case"XXXX":case"XX":return Lf(l);case"XXXXX":case"XXX":default:return Lf(l,":")}},x:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"x":return $1(l);case"xxxx":case"xx":return Lf(l);case"xxxxx":case"xxx":default:return Lf(l,":")}},O:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+F1(l,":");case"OOOO":default:return"GMT"+Lf(l,":")}},z:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+F1(l,":");case"zzzz":default:return"GMT"+Lf(l,":")}},t:function(r,n,i){const l=Math.trunc(+r/1e3);return ar(l,n.length)},T:function(r,n,i){return ar(+r,n.length)}};function F1(r,n=""){const i=r>0?"-":"+",l=Math.abs(r),c=Math.trunc(l/60),h=l%60;return h===0?i+String(c):i+String(c)+n+ar(h,2)}function $1(r,n){return r%60===0?(r>0?"-":"+")+ar(Math.abs(r)/60,2):Lf(r,n)}function Lf(r,n=""){const i=r>0?"-":"+",l=Math.abs(r),c=ar(Math.trunc(l/60),2),h=ar(l%60,2);return i+c+n+h}const P1=(r,n)=>{switch(r){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},N1=(r,n)=>{switch(r){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},LN=(r,n)=>{const i=r.match(/(P+)(p+)?/)||[],l=i[1],c=i[2];if(!c)return P1(r,n);let h;switch(l){case"P":h=n.dateTime({width:"short"});break;case"PP":h=n.dateTime({width:"medium"});break;case"PPP":h=n.dateTime({width:"long"});break;case"PPPP":default:h=n.dateTime({width:"full"});break}return h.replace("{{date}}",P1(l,n)).replace("{{time}}",N1(c,n))},BN={p:N1,P:LN},MN=/^D+$/,IN=/^Y+$/,jN=["D","DD","YY","YYYY"];function zN(r){return MN.test(r)}function UN(r){return IN.test(r)}function HN(r,n,i){const l=VN(r,n,i);if(console.warn(l),jN.includes(r))throw new RangeError(l)}function VN(r,n,i){const l=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${n}\`) for formatting ${l} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const qN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YN=/^'([^]*?)'?$/,GN=/''/g,KN=/[a-zA-Z]/;function QN(r,n,i){var l,c,h,m;const D=Zy(),C=D.locale??PN,T=D.firstWeekContainsDate??((c=(l=D.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??1,$=D.weekStartsOn??((m=(h=D.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,N=ki(r,void 0);if(!QP(N))throw new RangeError("Invalid time value");let O=n.match(WN).map(I=>{const K=I[0];if(K==="p"||K==="P"){const Y=BN[K];return Y(I,C.formatLong)}return I}).join("").match(qN).map(I=>{if(I==="''")return{isToken:!1,value:"'"};const K=I[0];if(K==="'")return{isToken:!1,value:XN(I)};if(A1[K])return{isToken:!0,value:I};if(K.match(KN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+K+"`");return{isToken:!1,value:I}});C.localize.preprocessor&&(O=C.localize.preprocessor(N,O));const R={firstWeekContainsDate:T,weekStartsOn:$,locale:C};return O.map(I=>{if(!I.isToken)return I.value;const K=I.value;(UN(K)||zN(K))&&HN(K,n,String(r));const Y=A1[K[0]];return Y(N,K,C.localize,R)}).join("")}function XN(r){const n=r.match(YN);return n?n[1].replace(GN,"'"):r}function JN(r,n){const i=ki(r,void 0).getDay();return i===0?7:i}function ZN(r,n,i){const l=ki(r,void 0);return l.setHours(n),l}const O1={},Pg={};function Ng(r,n){try{const i=(O1[r]||(O1[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(n).split("GMT")[1]||"";return i in Pg?Pg[i]:R1(i,i.split(":"))}catch{if(r in Pg)return Pg[r];const i=r==null?void 0:r.match(e3);return i?R1(r,i.slice(1)):NaN}}const e3=/([+-]\d\d):?(\d\d)?/;function R1(r,n){const i=+n[0],l=+(n[1]||0);return Pg[r]=i>0?i*60+l:i*60-l}let Og=class Oy extends Date{constructor(...n){super(),n.length>1&&typeof n[n.length-1]=="string"&&(this.timeZone=n.pop()),this.internal=new Date,isNaN(Ng(this.timeZone,this))?this.setTime(NaN):n.length?typeof n[0]=="number"&&(n.length===1||n.length===2&&typeof n[1]!="number")?this.setTime(n[0]):typeof n[0]=="string"?this.setTime(+new Date(n[0])):n[0]instanceof Date?this.setTime(+n[0]):(this.setTime(+new Date(...n)),B1(this),d0(this)):this.setTime(Date.now())}static tz(n,...i){return i.length?new Oy(...i,n):new Oy(Date.now(),n)}withTimeZone(n){return new Oy(+this,n)}getTimezoneOffset(){return-Ng(this.timeZone,this)}setTime(n){return Date.prototype.setTime.apply(this,arguments),d0(this),+this}[Symbol.for("constructDateFrom")](n){return new Oy(+new Date(n),this.timeZone)}};const L1=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!L1.test(r))return;const n=r.replace(L1,"$1UTC");Og.prototype[n]&&(r.startsWith("get")?Og.prototype[r]=function(){return this.internal[n]()}:(Og.prototype[r]=function(){return Date.prototype[n].apply(this.internal,arguments),t3(this),+this},Og.prototype[n]=function(){return Date.prototype[n].apply(this,arguments),d0(this),+this}))});function d0(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function t3(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),B1(r)}function B1(r){const n=Ng(r.timeZone,r),i=new Date(+r);i.setUTCHours(i.getUTCHours()-1);const l=-new Date(+r).getTimezoneOffset(),c=-new Date(+i).getTimezoneOffset(),h=l-c,m=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();h&&m&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+h);const D=l-n;D&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+D);const C=Ng(r.timeZone,r),T=-new Date(+r).getTimezoneOffset()-C,$=C!==n,N=T-D;if($&&N){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+N);const O=Ng(r.timeZone,r),R=C-O;R&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+R),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+R))}}let tb=class Ry extends Og{static tz(n,...i){return i.length?new Ry(...i,n):new Ry(Date.now(),n)}toISOString(){const[n,i,l]=this.tzComponents(),c=`${n}${i}:${l}`;return this.internal.toISOString().slice(0,-1)+c}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[n,i,l,c]=this.internal.toUTCString().split(" ");return`${n==null?void 0:n.slice(0,-1)} ${l} ${i} ${c}`}toTimeString(){const n=this.internal.toUTCString().split(" ")[4],[i,l,c]=this.tzComponents();return`${n} GMT${i}${l}${c} (${n3(this.timeZone,this)})`}toLocaleString(n,i){return Date.prototype.toLocaleString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}toLocaleDateString(n,i){return Date.prototype.toLocaleDateString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}toLocaleTimeString(n,i){return Date.prototype.toLocaleTimeString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}tzComponents(){const n=this.getTimezoneOffset(),i=n>0?"-":"+",l=String(Math.floor(Math.abs(n)/60)).padStart(2,"0"),c=String(Math.abs(n)%60).padStart(2,"0");return[i,l,c]}withTimeZone(n){return new Ry(+this,n)}[Symbol.for("constructDateFrom")](n){return new Ry(+new Date(n),this.timeZone)}};function n3(r,n){return new Intl.DateTimeFormat("en-GB",{timeZone:r,timeZoneName:"long"}).format(n).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Ha=r=>r.toISOString().split("T")[0],f0=r=>{if(!r)return null;const n=S1(new tb(r,window.pktTz),12);return isNaN(n.getTime())?null:n},M1=(r,n)=>{const i=Qr(r);return isNaN(i.getTime())?"":QN(i,n)},Qr=(r="",n)=>{const i=r===""||!r?new Date:r;return n?new tb(n==="end"?XP(i):l0(i),window.pktTz):ZN(new tb(i.toString(),window.pktTz),12)},wd=(r,n,i=1)=>S1(new tb(r,n,i,window.pktTz),12),r3=r=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(r),I1=r=>{if(Array.isArray(r))return r;if(typeof r=="string")return r.split(",")},a3=r=>r?new Date(r):null,i3=r=>{if(typeof r=="string")return r.split(",").map(n=>new Date(n));if(Array.isArray(r))return r.map(n=>new Date(n))},_h={csvToArray:I1,stringToDate:a3,stringsToDate:i3},o3={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Bf={props:o3};var s3=Object.defineProperty,l3=Object.getOwnPropertyDescriptor,fr=(r,n,i,l)=>{for(var c=l>1?void 0:l?l3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&s3(n,i,c),c};let ir=class extends Hr{constructor(){super(...arguments),this.multiple=Bf.props.multiple.default,this.maxMultiple=Bf.props.maxMultiple.default,this.range=Bf.props.range.default,this.weeknumbers=Bf.props.weeknumbers.default,this.withcontrols=Bf.props.withcontrols.default,this.selected=[],this.earliest=Bf.props.earliest.default,this.latest=Bf.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(n,i,l){n==="selected"&&l&&this.convertSelected(),super.attributeChangedCallback(n,i,l)}updated(n){super.updated(n),n.has("selected")&&this.convertSelected()}firstUpdated(n){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(n=>Qr(n)),this.range&&this.selected.length===2){const n=u0({start:Qr(this.selected[0]),end:Qr(this.selected[1])});if(this.inRange={},Array.isArray(n)&&n.length){const i={};for(let l=0;l<n.length;l++)i[Ha(n[l])]=this.isInRange(n[l]);this.inRange=i}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=Qr(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=Qr()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(n){switch(n.key){case"ArrowLeft":this.handleArrowKey(n,-1);break;case"ArrowRight":this.handleArrowKey(n,1);break;case"ArrowUp":this.handleArrowKey(n,-7);break;case"ArrowDown":this.handleArrowKey(n,7);break}}handleArrowKey(n,i){var l,c,h;if(((l=n.target)==null?void 0:l.nodeName)==="INPUT"||((c=n.target)==null?void 0:c.nodeName)==="SELECT"||((h=n.target)==null?void 0:h.nodeName)==="BUTTON")return;n.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const m=this.focusedDate?Qr(this.focusedDate):wd(this.year,this.month,1);let D=s0(m,i);if(D){let C=this.querySelector(`div[data-date="${Ha(D)}"]`);if(C instanceof HTMLDivElement){if(C.dataset.disabled){D=s0(D,i);let T=this.querySelector(`div[data-date="${Ha(D)}"]`);for(;T&&T instanceof HTMLDivElement&&T.dataset.disabled;)D=s0(D,i),T=this.querySelector(`div[data-date="${Ha(D)}"]`);C=T}C instanceof HTMLDivElement&&!C.dataset.disabled&&(this.focusedDate=Ha(D),C.focus())}}}render(){return Se`
|
|
428
|
+
`}updateElementClasses(){const n=new Set,i=this.getAttribute("class");n.add("pkt-btn"),i&&i.split(" ").forEach(l=>n.add(l)),this.size&&n.add(`pkt-btn--${this.size}`),this.skin&&n.add(`pkt-btn--${this.skin}`),this.variant&&n.add(`pkt-btn--${this.variant}`),this.color&&n.add(`pkt-btn--${this.color}`),this.isLoading&&n.add("pkt-btn--active"),this.state&&n.add(`pkt-btn--${this.state}`),this.disabled&&n.add("pkt-btn--disabled"),this.className=[...n].join(" ")}handleClick(n){if(this.disabled||this.isLoading){n.preventDefault(),n.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit();return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(n),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:n}}))}handleKeydown(n){if(!(this.disabled||this.isLoading)&&(n.key==="Enter"||n.key===" ")){n.preventDefault();const i=n.target;i&&i.click()}}};qi.formAssociated=!0,Ds([z({type:String})],qi.prototype,"iconName",2),Ds([z({type:String})],qi.prototype,"secondIconName",2),Ds([z({type:String})],qi.prototype,"mode",2),Ds([z({type:String})],qi.prototype,"size",2),Ds([z({type:String})],qi.prototype,"color",2),Ds([z({type:String})],qi.prototype,"skin",2),Ds([z({type:String})],qi.prototype,"variant",2),Ds([z({type:String})],qi.prototype,"state",2),Ds([z({type:String,reflect:!0})],qi.prototype,"type",2),Ds([z({type:Boolean})],qi.prototype,"isLoading",2),Ds([z({type:Boolean})],qi.prototype,"disabled",2),qi=Ds([dr("pkt-button")],qi);const w1=6048e5,HP=864e5,VP=36e5,D1=Symbol.for("constructDateFrom");function ul(r,n){return typeof r=="function"?r(n):r&&typeof r=="object"&&D1 in r?r[D1](n):r instanceof Date?new r.constructor(n):new Date(n)}function ki(r,n){return ul(n||r,r)}function s0(r,n,i){const l=ki(r,void 0);return isNaN(n)?ul(r,NaN):(n&&l.setDate(l.getDate()+n),l)}function qP(r,n,i){return ul(r,+ki(r)+n)}function S1(r,n,i){return qP(r,n*VP)}let WP={};function Zy(){return WP}function Ag(r,n){var i,l,c,h;const m=Zy(),D=(n==null?void 0:n.weekStartsOn)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??m.weekStartsOn??((h=(c=m.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??0,C=ki(r,n==null?void 0:n.in),T=C.getDay(),$=(T<D?7:0)+T-D;return C.setDate(C.getDate()-$),C.setHours(0,0,0,0),C}function eb(r,n){return Ag(r,{...n,weekStartsOn:1})}function C1(r,n){const i=ki(r,void 0),l=i.getFullYear(),c=ul(i,0);c.setFullYear(l+1,0,4),c.setHours(0,0,0,0);const h=eb(c),m=ul(i,0);m.setFullYear(l,0,4),m.setHours(0,0,0,0);const D=eb(m);return i.getTime()>=h.getTime()?l+1:i.getTime()>=D.getTime()?l:l-1}function x1(r){const n=ki(r),i=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return i.setUTCFullYear(n.getFullYear()),+r-+i}function _1(r,...n){const i=ul.bind(null,n.find(l=>typeof l=="object"));return n.map(i)}function l0(r,n){const i=ki(r,void 0);return i.setHours(0,0,0,0),i}function YP(r,n,i){const[l,c]=_1(void 0,r,n),h=l0(l),m=l0(c),D=+h-x1(h),C=+m-x1(m);return Math.round((D-C)/HP)}function GP(r,n){const i=C1(r),l=ul(r,0);return l.setFullYear(i,0,4),l.setHours(0,0,0,0),eb(l)}function KP(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function QP(r){return!(!KP(r)&&typeof r!="number"||isNaN(+ki(r)))}function XP(r,n){const i=ki(r,void 0);return i.setHours(23,59,59,999),i}function JP(r,n){const[i,l]=_1(r,n.start,n.end);return{start:i,end:l}}function u0(r,n){const{start:i,end:l}=JP(void 0,r);let c=+i>+l;const h=c?+i:+l,m=c?l:i;m.setHours(0,0,0,0);let D=1;const C=[];for(;+m<=h;)C.push(ul(i,m)),m.setDate(m.getDate()+D),m.setHours(0,0,0,0);return c?C.reverse():C}function ZP(r,n){const i=ki(r,void 0);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}const eN={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},tN=(r,n,i)=>{let l;const c=eN[r];return typeof c=="string"?l=c:n===1?l=c.one:l=c.other.replace("{{count}}",n.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+l:l+" ago":l};function c0(r){return(n={})=>{const i=n.width?String(n.width):r.defaultWidth;return r.formats[i]||r.formats[r.defaultWidth]}}const nN={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},rN={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},aN={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iN={date:c0({formats:nN,defaultWidth:"full"}),time:c0({formats:rN,defaultWidth:"full"}),dateTime:c0({formats:aN,defaultWidth:"full"})},oN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sN=(r,n,i,l)=>oN[r];function Fg(r){return(n,i)=>{const l=i!=null&&i.context?String(i.context):"standalone";let c;if(l==="formatting"&&r.formattingValues){const m=r.defaultFormattingWidth||r.defaultWidth,D=i!=null&&i.width?String(i.width):m;c=r.formattingValues[D]||r.formattingValues[m]}else{const m=r.defaultWidth,D=i!=null&&i.width?String(i.width):r.defaultWidth;c=r.values[D]||r.values[m]}const h=r.argumentCallback?r.argumentCallback(n):n;return c[h]}}const lN={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uN={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cN={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dN={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},fN={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pN={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hN=(r,n)=>{const i=Number(r),l=i%100;if(l>20||l<10)switch(l%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},mN={ordinalNumber:hN,era:Fg({values:lN,defaultWidth:"wide"}),quarter:Fg({values:uN,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Fg({values:cN,defaultWidth:"wide"}),day:Fg({values:dN,defaultWidth:"wide"}),dayPeriod:Fg({values:fN,defaultWidth:"wide",formattingValues:pN,defaultFormattingWidth:"wide"})};function $g(r){return(n,i={})=>{const l=i.width,c=l&&r.matchPatterns[l]||r.matchPatterns[r.defaultMatchWidth],h=n.match(c);if(!h)return null;const m=h[0],D=l&&r.parsePatterns[l]||r.parsePatterns[r.defaultParseWidth],C=Array.isArray(D)?vN(D,N=>N.test(m)):gN(D,N=>N.test(m));let T;T=r.valueCallback?r.valueCallback(C):C,T=i.valueCallback?i.valueCallback(T):T;const $=n.slice(m.length);return{value:T,rest:$}}}function gN(r,n){for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&n(r[i]))return i}function vN(r,n){for(let i=0;i<r.length;i++)if(n(r[i]))return i}function yN(r){return(n,i={})=>{const l=n.match(r.matchPattern);if(!l)return null;const c=l[0],h=n.match(r.parsePattern);if(!h)return null;let m=r.valueCallback?r.valueCallback(h[0]):h[0];m=i.valueCallback?i.valueCallback(m):m;const D=n.slice(c.length);return{value:m,rest:D}}}const bN=/^(\d+)(th|st|nd|rd)?/i,kN=/\d+/i,wN={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},DN={any:[/^b/i,/^(a|c)/i]},SN={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},CN={any:[/1/i,/2/i,/3/i,/4/i]},xN={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_N={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},EN={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},TN={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},AN={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},FN={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$N={ordinalNumber:yN({matchPattern:bN,parsePattern:kN,valueCallback:r=>parseInt(r,10)}),era:$g({matchPatterns:wN,defaultMatchWidth:"wide",parsePatterns:DN,defaultParseWidth:"any"}),quarter:$g({matchPatterns:SN,defaultMatchWidth:"wide",parsePatterns:CN,defaultParseWidth:"any",valueCallback:r=>r+1}),month:$g({matchPatterns:xN,defaultMatchWidth:"wide",parsePatterns:_N,defaultParseWidth:"any"}),day:$g({matchPatterns:EN,defaultMatchWidth:"wide",parsePatterns:TN,defaultParseWidth:"any"}),dayPeriod:$g({matchPatterns:AN,defaultMatchWidth:"any",parsePatterns:FN,defaultParseWidth:"any"})},PN={code:"en-US",formatDistance:tN,formatLong:iN,formatRelative:sN,localize:mN,match:$N,options:{weekStartsOn:0,firstWeekContainsDate:1}};function NN(r,n){const i=ki(r,void 0);return YP(i,ZP(i))+1}function ON(r,n){const i=ki(r,void 0),l=+eb(i)-+GP(i);return Math.round(l/w1)+1}function E1(r,n){var i,l,c,h;const m=ki(r,n==null?void 0:n.in),D=m.getFullYear(),C=Zy(),T=(n==null?void 0:n.firstWeekContainsDate)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??C.firstWeekContainsDate??((h=(c=C.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,$=ul((n==null?void 0:n.in)||r,0);$.setFullYear(D+1,0,T),$.setHours(0,0,0,0);const N=Ag($,n),O=ul((n==null?void 0:n.in)||r,0);O.setFullYear(D,0,T),O.setHours(0,0,0,0);const R=Ag(O,n);return+m>=+N?D+1:+m>=+R?D:D-1}function RN(r,n){var i,l,c,h;const m=Zy(),D=(n==null?void 0:n.firstWeekContainsDate)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??m.firstWeekContainsDate??((h=(c=m.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,C=E1(r,n),T=ul((n==null?void 0:n.in)||r,0);return T.setFullYear(C,0,D),T.setHours(0,0,0,0),Ag(T,n)}function T1(r,n){const i=ki(r,n==null?void 0:n.in),l=+Ag(i,n)-+RN(i,n);return Math.round(l/w1)+1}function ar(r,n){const i=r<0?"-":"",l=Math.abs(r).toString().padStart(n,"0");return i+l}const kd={y(r,n){const i=r.getFullYear(),l=i>0?i:1-i;return ar(n==="yy"?l%100:l,n.length)},M(r,n){const i=r.getMonth();return n==="M"?String(i+1):ar(i+1,2)},d(r,n){return ar(r.getDate(),n.length)},a(r,n){const i=r.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h(r,n){return ar(r.getHours()%12||12,n.length)},H(r,n){return ar(r.getHours(),n.length)},m(r,n){return ar(r.getMinutes(),n.length)},s(r,n){return ar(r.getSeconds(),n.length)},S(r,n){const i=n.length,l=r.getMilliseconds(),c=Math.trunc(l*Math.pow(10,i-3));return ar(c,n.length)}},xh={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},A1={G:function(r,n,i){const l=r.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return i.era(l,{width:"abbreviated"});case"GGGGG":return i.era(l,{width:"narrow"});case"GGGG":default:return i.era(l,{width:"wide"})}},y:function(r,n,i){if(n==="yo"){const l=r.getFullYear(),c=l>0?l:1-l;return i.ordinalNumber(c,{unit:"year"})}return kd.y(r,n)},Y:function(r,n,i,l){const c=E1(r,l),h=c>0?c:1-c;if(n==="YY"){const m=h%100;return ar(m,2)}return n==="Yo"?i.ordinalNumber(h,{unit:"year"}):ar(h,n.length)},R:function(r,n){const i=C1(r);return ar(i,n.length)},u:function(r,n){const i=r.getFullYear();return ar(i,n.length)},Q:function(r,n,i){const l=Math.ceil((r.getMonth()+1)/3);switch(n){case"Q":return String(l);case"QQ":return ar(l,2);case"Qo":return i.ordinalNumber(l,{unit:"quarter"});case"QQQ":return i.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(l,{width:"wide",context:"formatting"})}},q:function(r,n,i){const l=Math.ceil((r.getMonth()+1)/3);switch(n){case"q":return String(l);case"qq":return ar(l,2);case"qo":return i.ordinalNumber(l,{unit:"quarter"});case"qqq":return i.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(l,{width:"wide",context:"standalone"})}},M:function(r,n,i){const l=r.getMonth();switch(n){case"M":case"MM":return kd.M(r,n);case"Mo":return i.ordinalNumber(l+1,{unit:"month"});case"MMM":return i.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(l,{width:"wide",context:"formatting"})}},L:function(r,n,i){const l=r.getMonth();switch(n){case"L":return String(l+1);case"LL":return ar(l+1,2);case"Lo":return i.ordinalNumber(l+1,{unit:"month"});case"LLL":return i.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(l,{width:"wide",context:"standalone"})}},w:function(r,n,i,l){const c=T1(r,l);return n==="wo"?i.ordinalNumber(c,{unit:"week"}):ar(c,n.length)},I:function(r,n,i){const l=ON(r);return n==="Io"?i.ordinalNumber(l,{unit:"week"}):ar(l,n.length)},d:function(r,n,i){return n==="do"?i.ordinalNumber(r.getDate(),{unit:"date"}):kd.d(r,n)},D:function(r,n,i){const l=NN(r);return n==="Do"?i.ordinalNumber(l,{unit:"dayOfYear"}):ar(l,n.length)},E:function(r,n,i){const l=r.getDay();switch(n){case"E":case"EE":case"EEE":return i.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(l,{width:"short",context:"formatting"});case"EEEE":default:return i.day(l,{width:"wide",context:"formatting"})}},e:function(r,n,i,l){const c=r.getDay(),h=(c-l.weekStartsOn+8)%7||7;switch(n){case"e":return String(h);case"ee":return ar(h,2);case"eo":return i.ordinalNumber(h,{unit:"day"});case"eee":return i.day(c,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(c,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(c,{width:"short",context:"formatting"});case"eeee":default:return i.day(c,{width:"wide",context:"formatting"})}},c:function(r,n,i,l){const c=r.getDay(),h=(c-l.weekStartsOn+8)%7||7;switch(n){case"c":return String(h);case"cc":return ar(h,n.length);case"co":return i.ordinalNumber(h,{unit:"day"});case"ccc":return i.day(c,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(c,{width:"narrow",context:"standalone"});case"cccccc":return i.day(c,{width:"short",context:"standalone"});case"cccc":default:return i.day(c,{width:"wide",context:"standalone"})}},i:function(r,n,i){const l=r.getDay(),c=l===0?7:l;switch(n){case"i":return String(c);case"ii":return ar(c,n.length);case"io":return i.ordinalNumber(c,{unit:"day"});case"iii":return i.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(l,{width:"short",context:"formatting"});case"iiii":default:return i.day(l,{width:"wide",context:"formatting"})}},a:function(r,n,i){const l=r.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return i.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(r,n,i){const l=r.getHours();let c;switch(l===12?c=xh.noon:l===0?c=xh.midnight:c=l/12>=1?"pm":"am",n){case"b":case"bb":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(c,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(c,{width:"wide",context:"formatting"})}},B:function(r,n,i){const l=r.getHours();let c;switch(l>=17?c=xh.evening:l>=12?c=xh.afternoon:l>=4?c=xh.morning:c=xh.night,n){case"B":case"BB":case"BBB":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(c,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(c,{width:"wide",context:"formatting"})}},h:function(r,n,i){if(n==="ho"){let l=r.getHours()%12;return l===0&&(l=12),i.ordinalNumber(l,{unit:"hour"})}return kd.h(r,n)},H:function(r,n,i){return n==="Ho"?i.ordinalNumber(r.getHours(),{unit:"hour"}):kd.H(r,n)},K:function(r,n,i){const l=r.getHours()%12;return n==="Ko"?i.ordinalNumber(l,{unit:"hour"}):ar(l,n.length)},k:function(r,n,i){let l=r.getHours();return l===0&&(l=24),n==="ko"?i.ordinalNumber(l,{unit:"hour"}):ar(l,n.length)},m:function(r,n,i){return n==="mo"?i.ordinalNumber(r.getMinutes(),{unit:"minute"}):kd.m(r,n)},s:function(r,n,i){return n==="so"?i.ordinalNumber(r.getSeconds(),{unit:"second"}):kd.s(r,n)},S:function(r,n){return kd.S(r,n)},X:function(r,n,i){const l=r.getTimezoneOffset();if(l===0)return"Z";switch(n){case"X":return $1(l);case"XXXX":case"XX":return Lf(l);case"XXXXX":case"XXX":default:return Lf(l,":")}},x:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"x":return $1(l);case"xxxx":case"xx":return Lf(l);case"xxxxx":case"xxx":default:return Lf(l,":")}},O:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+F1(l,":");case"OOOO":default:return"GMT"+Lf(l,":")}},z:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+F1(l,":");case"zzzz":default:return"GMT"+Lf(l,":")}},t:function(r,n,i){const l=Math.trunc(+r/1e3);return ar(l,n.length)},T:function(r,n,i){return ar(+r,n.length)}};function F1(r,n=""){const i=r>0?"-":"+",l=Math.abs(r),c=Math.trunc(l/60),h=l%60;return h===0?i+String(c):i+String(c)+n+ar(h,2)}function $1(r,n){return r%60===0?(r>0?"-":"+")+ar(Math.abs(r)/60,2):Lf(r,n)}function Lf(r,n=""){const i=r>0?"-":"+",l=Math.abs(r),c=ar(Math.trunc(l/60),2),h=ar(l%60,2);return i+c+n+h}const P1=(r,n)=>{switch(r){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},N1=(r,n)=>{switch(r){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},LN=(r,n)=>{const i=r.match(/(P+)(p+)?/)||[],l=i[1],c=i[2];if(!c)return P1(r,n);let h;switch(l){case"P":h=n.dateTime({width:"short"});break;case"PP":h=n.dateTime({width:"medium"});break;case"PPP":h=n.dateTime({width:"long"});break;case"PPPP":default:h=n.dateTime({width:"full"});break}return h.replace("{{date}}",P1(l,n)).replace("{{time}}",N1(c,n))},BN={p:N1,P:LN},MN=/^D+$/,IN=/^Y+$/,jN=["D","DD","YY","YYYY"];function zN(r){return MN.test(r)}function UN(r){return IN.test(r)}function HN(r,n,i){const l=VN(r,n,i);if(console.warn(l),jN.includes(r))throw new RangeError(l)}function VN(r,n,i){const l=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${n}\`) for formatting ${l} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const qN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YN=/^'([^]*?)'?$/,GN=/''/g,KN=/[a-zA-Z]/;function QN(r,n,i){var l,c,h,m;const D=Zy(),C=D.locale??PN,T=D.firstWeekContainsDate??((c=(l=D.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??1,$=D.weekStartsOn??((m=(h=D.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,N=ki(r,void 0);if(!QP(N))throw new RangeError("Invalid time value");let O=n.match(WN).map(I=>{const K=I[0];if(K==="p"||K==="P"){const Y=BN[K];return Y(I,C.formatLong)}return I}).join("").match(qN).map(I=>{if(I==="''")return{isToken:!1,value:"'"};const K=I[0];if(K==="'")return{isToken:!1,value:XN(I)};if(A1[K])return{isToken:!0,value:I};if(K.match(KN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+K+"`");return{isToken:!1,value:I}});C.localize.preprocessor&&(O=C.localize.preprocessor(N,O));const R={firstWeekContainsDate:T,weekStartsOn:$,locale:C};return O.map(I=>{if(!I.isToken)return I.value;const K=I.value;(UN(K)||zN(K))&&HN(K,n,String(r));const Y=A1[K[0]];return Y(N,K,C.localize,R)}).join("")}function XN(r){const n=r.match(YN);return n?n[1].replace(GN,"'"):r}function JN(r,n){const i=ki(r,void 0).getDay();return i===0?7:i}function ZN(r,n,i){const l=ki(r,void 0);return l.setHours(n),l}const O1={},Pg={};function Ng(r,n){try{const i=(O1[r]||(O1[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(n).split("GMT")[1]||"";return i in Pg?Pg[i]:R1(i,i.split(":"))}catch{if(r in Pg)return Pg[r];const i=r==null?void 0:r.match(e3);return i?R1(r,i.slice(1)):NaN}}const e3=/([+-]\d\d):?(\d\d)?/;function R1(r,n){const i=+n[0],l=+(n[1]||0);return Pg[r]=i>0?i*60+l:i*60-l}let Og=class Oy extends Date{constructor(...n){super(),n.length>1&&typeof n[n.length-1]=="string"&&(this.timeZone=n.pop()),this.internal=new Date,isNaN(Ng(this.timeZone,this))?this.setTime(NaN):n.length?typeof n[0]=="number"&&(n.length===1||n.length===2&&typeof n[1]!="number")?this.setTime(n[0]):typeof n[0]=="string"?this.setTime(+new Date(n[0])):n[0]instanceof Date?this.setTime(+n[0]):(this.setTime(+new Date(...n)),B1(this),d0(this)):this.setTime(Date.now())}static tz(n,...i){return i.length?new Oy(...i,n):new Oy(Date.now(),n)}withTimeZone(n){return new Oy(+this,n)}getTimezoneOffset(){return-Ng(this.timeZone,this)}setTime(n){return Date.prototype.setTime.apply(this,arguments),d0(this),+this}[Symbol.for("constructDateFrom")](n){return new Oy(+new Date(n),this.timeZone)}};const L1=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!L1.test(r))return;const n=r.replace(L1,"$1UTC");Og.prototype[n]&&(r.startsWith("get")?Og.prototype[r]=function(){return this.internal[n]()}:(Og.prototype[r]=function(){return Date.prototype[n].apply(this.internal,arguments),t3(this),+this},Og.prototype[n]=function(){return Date.prototype[n].apply(this,arguments),d0(this),+this}))});function d0(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function t3(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),B1(r)}function B1(r){const n=Ng(r.timeZone,r),i=new Date(+r);i.setUTCHours(i.getUTCHours()-1);const l=-new Date(+r).getTimezoneOffset(),c=-new Date(+i).getTimezoneOffset(),h=l-c,m=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();h&&m&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+h);const D=l-n;D&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+D);const C=Ng(r.timeZone,r),T=-new Date(+r).getTimezoneOffset()-C,$=C!==n,N=T-D;if($&&N){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+N);const O=Ng(r.timeZone,r),R=C-O;R&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+R),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+R))}}let tb=class Ry extends Og{static tz(n,...i){return i.length?new Ry(...i,n):new Ry(Date.now(),n)}toISOString(){const[n,i,l]=this.tzComponents(),c=`${n}${i}:${l}`;return this.internal.toISOString().slice(0,-1)+c}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[n,i,l,c]=this.internal.toUTCString().split(" ");return`${n==null?void 0:n.slice(0,-1)} ${l} ${i} ${c}`}toTimeString(){const n=this.internal.toUTCString().split(" ")[4],[i,l,c]=this.tzComponents();return`${n} GMT${i}${l}${c} (${n3(this.timeZone,this)})`}toLocaleString(n,i){return Date.prototype.toLocaleString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}toLocaleDateString(n,i){return Date.prototype.toLocaleDateString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}toLocaleTimeString(n,i){return Date.prototype.toLocaleTimeString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}tzComponents(){const n=this.getTimezoneOffset(),i=n>0?"-":"+",l=String(Math.floor(Math.abs(n)/60)).padStart(2,"0"),c=String(Math.abs(n)%60).padStart(2,"0");return[i,l,c]}withTimeZone(n){return new Ry(+this,n)}[Symbol.for("constructDateFrom")](n){return new Ry(+new Date(n),this.timeZone)}};function n3(r,n){return new Intl.DateTimeFormat("en-GB",{timeZone:r,timeZoneName:"long"}).format(n).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Ha=r=>r.toISOString().split("T")[0],f0=r=>{if(!r)return null;const n=S1(new tb(r,window.pktTz),12);return isNaN(n.getTime())?null:n},M1=(r,n)=>{const i=Qr(r);return isNaN(i.getTime())?"":QN(i,n)},Qr=(r="",n)=>{const i=r===""||!r?new Date:r;return n?new tb(n==="end"?XP(i):l0(i),window.pktTz):ZN(new tb(i.toString(),window.pktTz),12)},wd=(r,n,i=1)=>S1(new tb(r,n,i,window.pktTz),12),r3=r=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(r),I1=r=>{if(Array.isArray(r))return r;if(typeof r=="string")return r.split(",")},a3=r=>r?new Date(r):null,i3=r=>{if(typeof r=="string")return r.split(",").map(n=>new Date(n));if(Array.isArray(r))return r.map(n=>new Date(n))},_h={csvToArray:I1,stringToDate:a3,stringsToDate:i3},o3={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Bf={props:o3};var s3=Object.defineProperty,l3=Object.getOwnPropertyDescriptor,fr=(r,n,i,l)=>{for(var c=l>1?void 0:l?l3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&s3(n,i,c),c};let ir=class extends Hr{constructor(){super(...arguments),this.multiple=Bf.props.multiple.default,this.maxMultiple=Bf.props.maxMultiple.default,this.range=Bf.props.range.default,this.weeknumbers=Bf.props.weeknumbers.default,this.withcontrols=Bf.props.withcontrols.default,this.selected=[],this.earliest=Bf.props.earliest.default,this.latest=Bf.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(n,i,l){n==="selected"&&l&&this.convertSelected(),super.attributeChangedCallback(n,i,l)}updated(n){super.updated(n),n.has("selected")&&this.convertSelected()}firstUpdated(n){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(n=>Qr(n)),this.range&&this.selected.length===2){const n=u0({start:Qr(this.selected[0]),end:Qr(this.selected[1])});if(this.inRange={},Array.isArray(n)&&n.length){const i={};for(let l=0;l<n.length;l++)i[Ha(n[l])]=this.isInRange(n[l]);this.inRange=i}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=Qr(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=Qr()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(n){switch(n.key){case"ArrowLeft":this.handleArrowKey(n,-1);break;case"ArrowRight":this.handleArrowKey(n,1);break;case"ArrowUp":this.handleArrowKey(n,-7);break;case"ArrowDown":this.handleArrowKey(n,7);break}}handleArrowKey(n,i){var l,c,h;if(((l=n.target)==null?void 0:l.nodeName)==="INPUT"||((c=n.target)==null?void 0:c.nodeName)==="SELECT"||((h=n.target)==null?void 0:h.nodeName)==="BUTTON")return;n.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const m=this.focusedDate?Qr(this.focusedDate):wd(this.year,this.month,1);let D=s0(m,i);if(D){let C=this.querySelector(`div[data-date="${Ha(D)}"]`);if(C instanceof HTMLDivElement){if(C.dataset.disabled){D=s0(D,i);let T=this.querySelector(`div[data-date="${Ha(D)}"]`);for(;T&&T instanceof HTMLDivElement&&T.dataset.disabled;)D=s0(D,i),T=this.querySelector(`div[data-date="${Ha(D)}"]`);C=T}C instanceof HTMLDivElement&&!C.dataset.disabled&&(this.focusedDate=Ha(D),C.focus())}}}render(){return Se`
|
|
429
429
|
<div
|
|
430
430
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":tt}"
|
|
431
431
|
@focusout=${this.closeEvent}
|
|
@@ -862,7 +862,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
862
862
|
>
|
|
863
863
|
${this.renderValueTag(m)}
|
|
864
864
|
</pkt-tag>
|
|
865
|
-
`});return n?i:l}renderValueTag(n){if(!n)return"";switch(this.displayValueAs){case"prefixAndValue":return Se`<span data-focusfix=${this.id}>${n.prefix||""} ${n.value}</span>`;case"value":return Se`<span data-focusfix=${this.id}>${n.value}</span>`;case"label":default:return Se`<span data-focusfix=${this.id}>${n.label||n.value}</span>`}}handleInput(n){if(n.stopPropagation(),n.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const i=n.target;if(this._search=i.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(l=>{var c;return(c=l.fulltext)==null?void 0:c.toLowerCase().includes(this._search.toLowerCase())}),n.inputType!=="deleteContentBackward"){const l=this._options.filter(c=>{var h;return!c.selected&&((h=c.label)==null?void 0:h.toLowerCase().startsWith(this._search.toLowerCase()))});if(l.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const c=l[0];c!=null&&c.label&&(i.value=c.label,window.setTimeout(()=>i.setSelectionRange(this._search.length,i.value.length),0),i.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&n!=null&&n.label?n.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(n){var i,l,c,h,m;if(!this.disabled&&((l=(i=n.relatedTarget)==null?void 0:i.closest("pkt-combobox"))==null?void 0:l.id)!==this.id&&((h=(c=n.relatedTarget)==null?void 0:c.closest("pkt-combobox"))==null?void 0:h.id)!==this.id&&((m=n.target)==null?void 0:m.getAttribute("data-focusfix"))!==this.id&&n.relatedTarget!==this.focusRef.value&&n.relatedTarget!==this.inputRef.value&&n.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const D=this.inputRef.value.value;!this._value.includes(D)&&!this._options.find(C=>C.label===D)?this.allowUserInput?this.addNewUserValue(D):this.multiple||this.removeValue(this._value[0]):this._value.includes(D)||this.setSelected(D),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(n){var i,l;this.disabled||(n.currentTarget&&n.currentTarget!==this.arrowRef.value&&((i=this.inputRef.value)==null?void 0:i.type)!=="hidden"?(l=this.inputRef.value)==null||l.focus():this.handleArrowClick(n))}handleArrowClick(n){var i,l;this.disabled||n instanceof KeyboardEvent&&n.key&&n.key!=="Enter"&&n.key!==" "&&n.key!=="ArrowDown"||(n.stopImmediatePropagation(),n.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption():(l=this.arrowRef.value)==null||l.focus())}handleOptionToggled(n){this.toggleValue(n.detail)}handleSearch(n){n.stopPropagation(),this._search=n.detail.toLowerCase()}handleInputKeydown(n){var i,l,c;switch(n.key){case",":case"Enter":n.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((i=this.inputRef.value)==null?void 0:i.type)==="hidden"&&this.removeLastValue(n);break;case"Tab":case"ArrowDown":n.shiftKey||((l=this.listboxRef.value)==null||l.focusFirstOrSelectedOption(),n.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(c=this.arrowRef.value)==null||c.focus(),n.preventDefault();break}}handleTagRemove(n){this.removeSelected(n)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var n;const i=((n=this.inputRef.value)==null?void 0:n.value)||this._search||"",l=i.trim().toLowerCase()||"";if(!l){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const c=this._value.find(D=>D.toLowerCase()===l),h=this._options.filter(D=>{var C;return((C=D.label)==null?void 0:C.toLowerCase().includes(l))??!1}),m=h.find(D=>{var C;return((C=D.label)==null?void 0:C.toLowerCase())===l||D.value.toLowerCase()===l});switch(!0){case((h.length===0||!m)&&this.allowUserInput):this._addValueText=i,this._userInfoMessage="";break;case(h.length===0&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!c:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case h.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(n){return this.options.find(i=>i.value===n||i.label===n)||null}findIndexInOptions(n){return this._options.findIndex(i=>i.value===n||i.label===n)}isMaxItemsReached(){const n=this.maxlength!==null&&this._value.length>=this.maxlength;return n?this._maxIsReached=!0:this._maxIsReached=!1,n}toggleValue(n){var i,l;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const c=((i=this.findValueInOptions(n))==null?void 0:i.value)||null,h=this._value.includes(n||c||""),m=!!c,D=((l=this._options.find(Y=>Y.value===n))==null?void 0:l.disabled)||!1,C=!(n!=null&&n.trim()),T=!this.multiple,$=this.multiple,N=this.isMaxItemsReached();let O=!1,R=!0,I="",K="";D||(!m&&this.allowUserInput&&!C?(this.addNewUserValue(n),I="Ny verdi lagt til",O=!$):!m&&!this.allowUserInput?(T&&this._value[0]&&this.removeValue(this._value[0]),R=!1,O=!0,I="Ingen treff i søket"):h?(this.removeValue(c),O=!0):C&&T?(this.removeAllSelected(),O=!0):T?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(c),O=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):$&&!N?(this.setSelected(c),O=!0):$&&N?(this._userInfoMessage="Maks antall valg nådd",R=!1,K=n):(T&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",R=!1,O=!0,K=n),this._isOptionsOpen=O,O||window.setTimeout(()=>{var Y;(Y=this.focusRef.value)==null||Y.focus()},0),this._userInfoMessage=I,this._search=K||"",this.resetComboboxInput(R),$&&this.isMaxItemsReached())}setSelected(n){if(!this._value.includes(n)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=n?[...this._value,n]:this._value,this._options=this._options.map(i=>(i.value===n&&(i.selected=!0),i)),this.resetComboboxInput(!0)}}removeSelected(n){if(!n)return;this._value=this._value.filter(l=>l!==n);const i=this.findValueInOptions(n);i?(i.selected=!1,i.userAdded?(this._options=[...this._options.filter(l=>l.value!==n)],this.options=[...this.options.filter(l=>l.value!==n)]):this._options=[...this._options,i]):!n&&!this.multiple&&(this._options=this._options.map(l=>(l.selected=!1,l)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(n=>n.value),this._options=this._options.map(n=>(n.selected=!0,n)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(n=>(n.selected=!1,n)),this._options=this._options.filter(n=>!n.userAdded),this.requestUpdate()}addValue(){var n;const i=((n=this.inputRef.value)==null?void 0:n.value.trim())||"";this._search=i,this.toggleValue(i)}removeValue(n){this._value=this.multiple?this._value.filter(i=>i!==n):[],this.removeSelected(n)}addNewUserValue(n){if(!n||n.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[n],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(n)){if(this.isMaxItemsReached())return;this._value=[...this._value,n]}const i={value:n,label:n,userAdded:!0};this.options=[i,...this.options],this._options=[i,...this._options],this.setSelected(n),this.requestUpdate()}resetComboboxInput(n=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&n)if(this._search="",this.multiple)this.inputRef.value.value="";else{const i=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&i!=null&&i.label?i.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(n){if(this._value.length===0)return;n.preventDefault();const i=this._value[this._value.length-1];i&&this.removeSelected(i),this.isMaxItemsReached()}};pa([z({type:String,reflect:!0})],Xr.prototype,"value",2),pa([z({type:Array})],Xr.prototype,"options",2),pa([z({type:Boolean})],Xr.prototype,"allowUserInput",2),pa([z({type:Boolean})],Xr.prototype,"typeahead",2),pa([z({type:Boolean})],Xr.prototype,"includeSearch",2),pa([z({type:String})],Xr.prototype,"searchPlaceholder",2),pa([z({type:Boolean})],Xr.prototype,"multiple",2),pa([z({type:Number})],Xr.prototype,"maxlength",2),pa([z({type:String})],Xr.prototype,"displayValueAs",2),pa([z({type:String})],Xr.prototype,"tagPlacement",2),pa([$n()],Xr.prototype,"_options",2),pa([$n()],Xr.prototype,"_isOptionsOpen",2),pa([$n()],Xr.prototype,"_value",2),pa([$n()],Xr.prototype,"_userInfoMessage",2),pa([$n()],Xr.prototype,"_addValueText",2),pa([$n()],Xr.prototype,"_maxIsReached",2),pa([$n()],Xr.prototype,"_search",2),pa([$n()],Xr.prototype,"_inputFocus",2),pa([$n()],Xr.prototype,"_editingSingleValue",2),Xr=pa([dr("pkt-combobox")],Xr);const E3={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}},V1=globalThis,q1=V1.__cookieEvents||{events:{},on(r,n){this.events[r]||(this.events[r]=[]),this.events[r].push(n)},off(r,n){this.events[r]&&(this.events[r]=this.events[r].filter(i=>i!==n))},once(r,n){const i=l=>{this.off(r,i),n(l)};this.on(r,i)},emit(r,n){this.events[r]&&this.events[r].forEach(i=>i(n))}};V1.__cookieEvents=q1;const T3=q1;var A3=Object.defineProperty,F3=Object.getOwnPropertyDescriptor,Th=(r,n,i,l)=>{for(var c=l>1?void 0:l?F3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&A3(n,i,c),c};let Sd=class extends Hr{constructor(){super(),this.hotjarId=null,this.googleAnalyticsId=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||E3.i18n[this.i18nLanguage].contentPresentation.buttons.settings,this.googleAnalyticsId&&(window.googleAnalyticsId=this.googleAnalyticsId),this.hotjarId&&(window.hotjarId=this.hotjarId),T3.on("CookieManager.setCookie",n=>{this.emitCookieConsents(n)})}emitCookieConsents(n){const i=JSON.parse(n.value).items.reduce((l,c)=>(l[c.name]=c.consent,l),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:i,bubbles:!0,composed:!0}))}firstUpdated(n){if(!document.querySelector("#oslo-consent-script")&&window.location.hostname.toLowerCase().includes("oslo.kommune.no")){window.googleAnalyticsId=this.googleAnalyticsId,window.hotjarId=this.hotjarId;const i=document.createElement("script");i.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.js",i.id="oslo-consent-script",i.onload=()=>{this.triggerInit()},document.head.appendChild(i);const l=document.createElement("link");l.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.css",l.type="text/css",l.rel="stylesheet",l.id="oslo-consent-styles",document.head.appendChild(l)}}triggerInit(){window.document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(n=>{if(n){const i={value:window.cookieBanner.cookieConsent.getConsentCookie().items};this.emitCookieConsents(i)}})}openModal(n){n.preventDefault(),window.cookieBanner.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?Se`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?Se`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
865
|
+
`});return n?i:l}renderValueTag(n){if(!n)return"";switch(this.displayValueAs){case"prefixAndValue":return Se`<span data-focusfix=${this.id}>${n.prefix||""} ${n.value}</span>`;case"value":return Se`<span data-focusfix=${this.id}>${n.value}</span>`;case"label":default:return Se`<span data-focusfix=${this.id}>${n.label||n.value}</span>`}}handleInput(n){if(n.stopPropagation(),n.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const i=n.target;if(this._search=i.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(l=>{var c;return(c=l.fulltext)==null?void 0:c.toLowerCase().includes(this._search.toLowerCase())}),n.inputType!=="deleteContentBackward"){const l=this._options.filter(c=>{var h;return!c.selected&&((h=c.label)==null?void 0:h.toLowerCase().startsWith(this._search.toLowerCase()))});if(l.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const c=l[0];c!=null&&c.label&&(i.value=c.label,window.setTimeout(()=>i.setSelectionRange(this._search.length,i.value.length),0),i.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&n!=null&&n.label?n.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(n){var i,l,c,h,m;if(!this.disabled&&((l=(i=n.relatedTarget)==null?void 0:i.closest("pkt-combobox"))==null?void 0:l.id)!==this.id&&((h=(c=n.relatedTarget)==null?void 0:c.closest("pkt-combobox"))==null?void 0:h.id)!==this.id&&((m=n.target)==null?void 0:m.getAttribute("data-focusfix"))!==this.id&&n.relatedTarget!==this.focusRef.value&&n.relatedTarget!==this.inputRef.value&&n.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const D=this.inputRef.value.value;!this._value.includes(D)&&!this._options.find(C=>C.label===D)?this.allowUserInput?this.addNewUserValue(D):this.multiple||this.removeValue(this._value[0]):this._value.includes(D)||this.setSelected(D),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(n){var i,l;this.disabled||(n.currentTarget&&n.currentTarget!==this.arrowRef.value&&((i=this.inputRef.value)==null?void 0:i.type)!=="hidden"?(l=this.inputRef.value)==null||l.focus():this.handleArrowClick(n))}handleArrowClick(n){var i,l;this.disabled||n instanceof KeyboardEvent&&n.key&&n.key!=="Enter"&&n.key!==" "&&n.key!=="ArrowDown"||(n.stopImmediatePropagation(),n.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption():(l=this.arrowRef.value)==null||l.focus())}handleOptionToggled(n){this.toggleValue(n.detail)}handleSearch(n){n.stopPropagation(),this._search=n.detail.toLowerCase()}handleInputKeydown(n){var i,l,c;switch(n.key){case",":case"Enter":n.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((i=this.inputRef.value)==null?void 0:i.type)==="hidden"&&this.removeLastValue(n);break;case"Tab":case"ArrowDown":n.shiftKey||((l=this.listboxRef.value)==null||l.focusFirstOrSelectedOption(),n.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(c=this.arrowRef.value)==null||c.focus(),n.preventDefault();break}}handleTagRemove(n){this.removeSelected(n)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var n;const i=((n=this.inputRef.value)==null?void 0:n.value)||this._search||"",l=i.trim().toLowerCase()||"";if(!l){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const c=this._value.find(D=>D.toLowerCase()===l),h=this._options.filter(D=>{var C;return((C=D.label)==null?void 0:C.toLowerCase().includes(l))??!1}),m=h.find(D=>{var C;return((C=D.label)==null?void 0:C.toLowerCase())===l||D.value.toLowerCase()===l});switch(!0){case((h.length===0||!m)&&this.allowUserInput):this._addValueText=i,this._userInfoMessage="";break;case(h.length===0&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!c:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case h.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(n){return this.options.find(i=>i.value===n||i.label===n)||null}findIndexInOptions(n){return this._options.findIndex(i=>i.value===n||i.label===n)}isMaxItemsReached(){const n=this.maxlength!==null&&this._value.length>=this.maxlength;return n?this._maxIsReached=!0:this._maxIsReached=!1,n}toggleValue(n){var i,l;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const c=((i=this.findValueInOptions(n))==null?void 0:i.value)||null,h=this._value.includes(n||c||""),m=!!c,D=((l=this._options.find(Y=>Y.value===n))==null?void 0:l.disabled)||!1,C=!(n!=null&&n.trim()),T=!this.multiple,$=this.multiple,N=this.isMaxItemsReached();let O=!1,R=!0,I="",K="";D||(!m&&this.allowUserInput&&!C?(this.addNewUserValue(n),I="Ny verdi lagt til",O=!$):!m&&!this.allowUserInput?(T&&this._value[0]&&this.removeValue(this._value[0]),R=!1,O=!0,I="Ingen treff i søket"):h?(this.removeValue(c),O=!0):C&&T?(this.removeAllSelected(),O=!0):T?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(c),O=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):$&&!N?(this.setSelected(c),O=!0):$&&N?(this._userInfoMessage="Maks antall valg nådd",R=!1,K=n):(T&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",R=!1,O=!0,K=n),this._isOptionsOpen=O,O||window.setTimeout(()=>{var Y;(Y=this.focusRef.value)==null||Y.focus()},0),this._userInfoMessage=I,this._search=K||"",this.resetComboboxInput(R),$&&this.isMaxItemsReached())}setSelected(n){if(!this._value.includes(n)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=n?[...this._value,n]:this._value,this._options=this._options.map(i=>(i.value===n&&(i.selected=!0),i)),this.resetComboboxInput(!0)}}removeSelected(n){if(!n)return;this._value=this._value.filter(l=>l!==n);const i=this.findValueInOptions(n);i?(i.selected=!1,i.userAdded?(this._options=[...this._options.filter(l=>l.value!==n)],this.options=[...this.options.filter(l=>l.value!==n)]):this._options=[...this._options,i]):!n&&!this.multiple&&(this._options=this._options.map(l=>(l.selected=!1,l)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(n=>n.value),this._options=this._options.map(n=>(n.selected=!0,n)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(n=>(n.selected=!1,n)),this._options=this._options.filter(n=>!n.userAdded),this.requestUpdate()}addValue(){var n;const i=((n=this.inputRef.value)==null?void 0:n.value.trim())||"";this._search=i,this.toggleValue(i)}removeValue(n){this._value=this.multiple?this._value.filter(i=>i!==n):[],this.removeSelected(n)}addNewUserValue(n){if(!n||n.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[n],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(n)){if(this.isMaxItemsReached())return;this._value=[...this._value,n]}const i={value:n,label:n,userAdded:!0};this.options=[i,...this.options],this._options=[i,...this._options],this.setSelected(n),this.requestUpdate()}resetComboboxInput(n=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&n)if(this._search="",this.multiple)this.inputRef.value.value="";else{const i=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&i!=null&&i.label?i.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(n){if(this._value.length===0)return;n.preventDefault();const i=this._value[this._value.length-1];i&&this.removeSelected(i),this.isMaxItemsReached()}};pa([z({type:String,reflect:!0})],Xr.prototype,"value",2),pa([z({type:Array})],Xr.prototype,"options",2),pa([z({type:Boolean})],Xr.prototype,"allowUserInput",2),pa([z({type:Boolean})],Xr.prototype,"typeahead",2),pa([z({type:Boolean})],Xr.prototype,"includeSearch",2),pa([z({type:String})],Xr.prototype,"searchPlaceholder",2),pa([z({type:Boolean})],Xr.prototype,"multiple",2),pa([z({type:Number})],Xr.prototype,"maxlength",2),pa([z({type:String})],Xr.prototype,"displayValueAs",2),pa([z({type:String})],Xr.prototype,"tagPlacement",2),pa([$n()],Xr.prototype,"_options",2),pa([$n()],Xr.prototype,"_isOptionsOpen",2),pa([$n()],Xr.prototype,"_value",2),pa([$n()],Xr.prototype,"_userInfoMessage",2),pa([$n()],Xr.prototype,"_addValueText",2),pa([$n()],Xr.prototype,"_maxIsReached",2),pa([$n()],Xr.prototype,"_search",2),pa([$n()],Xr.prototype,"_inputFocus",2),pa([$n()],Xr.prototype,"_editingSingleValue",2),Xr=pa([dr("pkt-combobox")],Xr);const E3={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}},V1=globalThis,q1=V1.__cookieEvents||{events:{},on(r,n){this.events[r]||(this.events[r]=[]),this.events[r].push(n)},off(r,n){this.events[r]&&(this.events[r]=this.events[r].filter(i=>i!==n))},once(r,n){const i=l=>{this.off(r,i),n(l)};this.on(r,i)},emit(r,n){this.events[r]&&this.events[r].forEach(i=>i(n))}};V1.__cookieEvents=q1;const T3=q1;var A3=Object.defineProperty,F3=Object.getOwnPropertyDescriptor,Th=(r,n,i,l)=>{for(var c=l>1?void 0:l?F3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&A3(n,i,c),c};let Sd=class extends Hr{constructor(){super(),this.hotjarId=null,this.googleAnalyticsId=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||E3.i18n[this.i18nLanguage].contentPresentation.buttons.settings,this.googleAnalyticsId&&(window.googleAnalyticsId=this.googleAnalyticsId),this.hotjarId&&(window.hotjarId=this.hotjarId),T3.on("CookieManager.setCookie",n=>{this.emitCookieConsents(n)})}returnJsonOrObject(n){let i;try{i=JSON.parse(n)}catch{i=n}return i}emitCookieConsents(n){const i=this.returnJsonOrObject(n.value).items.reduce((l,c)=>(l[c.name]=c.consent,l),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:i,bubbles:!0,composed:!0}))}firstUpdated(n){if(!document.querySelector("#oslo-consent-script")&&window.location.hostname.toLowerCase().includes("oslo.kommune.no")){window.googleAnalyticsId=this.googleAnalyticsId,window.hotjarId=this.hotjarId;const i=document.createElement("script");i.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.js",i.id="oslo-consent-script",i.onload=()=>{this.triggerInit()},document.head.appendChild(i);const l=document.createElement("link");l.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.css",l.type="text/css",l.rel="stylesheet",l.id="oslo-consent-styles",document.head.appendChild(l)}}triggerInit(){window.document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(n=>{if(n){const i={value:window.cookieBanner.cookieConsent.getConsentCookie()};this.emitCookieConsents(i)}})}openModal(n){n.preventDefault(),window.cookieBanner.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?Se`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?Se`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
866
866
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
867
867
|
${this.triggerText}
|
|
868
868
|
</a>`:this.triggerType==="icon"?Se`<pkt-button
|
|
@@ -1089,7 +1089,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
1089
1089
|
</div>`:tt}
|
|
1090
1090
|
${this.title?Se`<div class="pkt-messagebox__title">${this.title}</div>`:tt}
|
|
1091
1091
|
<div class="pkt-messagebox__text" ${qt(this.defaultSlot)}></div>
|
|
1092
|
-
</div>`}};$h([z({type:Boolean,reflect:!0})],_d.prototype,"closable",2),$h([z({type:Boolean,reflect:!0})],_d.prototype,"compact",2),$h([z({type:String,reflect:!0})],_d.prototype,"title",2),$h([z({type:String,reflect:!0})],_d.prototype,"skin",2),$h([$n()],_d.prototype,"_isClosed",2),_d=$h([dr("pkt-messagebox")],_d);const G3={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},g0={props:G3};var K3=Object.defineProperty,Q3=Object.getOwnPropertyDescriptor,Ed=(r,n,i,l)=>{for(var c=l>1?void 0:l?Q3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&K3(n,i,c),c};let lu=class extends Hr{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=g0.props.hideCloseButton.default,this.closeOnBackdropClick=g0.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=g0.props.size.default,this.defaultSlot=dn(),this.dialogRef=dn(),this._isOpen=!1,this.close=(n,i=!1)=>{var l;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const c=document.activeElement;c&&!this.isElementInViewport(c)&&c.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:n},bubbles:!0,composed:!0})),i||(l=this.dialogRef.value)==null||l.close(),this.requestUpdate()},this.showModal=(n=null)=>{var i;this._isOpen=!0,(i=this.dialogRef.value)==null||i.showModal();const l=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var c;this.dialogRef.value&&((c=this.dialogRef.value)==null||c.focus())}),l&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:n},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new xa(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("click",this.handleBackdropClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(n){super.firstUpdated(n),this.dialogRef.value&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>Xj).then(i=>i.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(n){n.key==="Escape"&&this.close(n)}handleBackdropClick(n){var i;this.closeOnBackdropClick&&n.target===((i=this.dialogRef)==null?void 0:i.value)&&this.close(n)}isElementInViewport(n){const i=n.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&i.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const n={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,[`pkt-modal--${this.size}`]:this.size!==void 0},i={"pkt-modal__headingText":!0,"pkt-txt-24":!0},l={"pkt-modal__content":!0,"pkt-txt-18-light":!0},c=this.closeButtonSkin==="blue",h={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0},m={"pkt-btn":!0,[`pkt-btn--${c?"tertiary":"primary"}`]:!0,"pkt-btn--icon-only":!0,"pkt-btn--medium":!0};return Se`
|
|
1092
|
+
</div>`}};$h([z({type:Boolean,reflect:!0})],_d.prototype,"closable",2),$h([z({type:Boolean,reflect:!0})],_d.prototype,"compact",2),$h([z({type:String,reflect:!0})],_d.prototype,"title",2),$h([z({type:String,reflect:!0})],_d.prototype,"skin",2),$h([$n()],_d.prototype,"_isClosed",2),_d=$h([dr("pkt-messagebox")],_d);const G3={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},g0={props:G3};var K3=Object.defineProperty,Q3=Object.getOwnPropertyDescriptor,Ed=(r,n,i,l)=>{for(var c=l>1?void 0:l?Q3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&K3(n,i,c),c};let lu=class extends Hr{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=g0.props.hideCloseButton.default,this.closeOnBackdropClick=g0.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=g0.props.size.default,this.defaultSlot=dn(),this.dialogRef=dn(),this._isOpen=!1,this.close=(n,i=!1)=>{var l;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const c=document.activeElement;c&&!this.isElementInViewport(c)&&c.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:n},bubbles:!0,composed:!0})),i||(l=this.dialogRef.value)==null||l.close(),this.requestUpdate()},this.showModal=(n=null)=>{var i;this._isOpen=!0,(i=this.dialogRef.value)==null||i.showModal();const l=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var c;this.dialogRef.value&&((c=this.dialogRef.value)==null||c.focus())}),l&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:n},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new xa(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("click",this.handleBackdropClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(n){super.firstUpdated(n),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>Xj).then(i=>i.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(n){n.key==="Escape"&&this.close(n)}handleBackdropClick(n){var i;this.closeOnBackdropClick&&n.target===((i=this.dialogRef)==null?void 0:i.value)&&this.close(n)}isElementInViewport(n){const i=n.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&i.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const n={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,[`pkt-modal--${this.size}`]:this.size!==void 0},i={"pkt-modal__headingText":!0,"pkt-txt-24":!0},l={"pkt-modal__content":!0,"pkt-txt-18-light":!0},c=this.closeButtonSkin==="blue",h={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0},m={"pkt-btn":!0,[`pkt-btn--${c?"tertiary":"primary"}`]:!0,"pkt-btn--icon-only":!0,"pkt-btn--medium":!0};return Se`
|
|
1093
1093
|
<dialog
|
|
1094
1094
|
class=${zt(n)}
|
|
1095
1095
|
${qt(this.dialogRef)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.37.
|
|
3
|
+
"version": "12.37.6",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@lit-labs/ssr-dom-shim": "^1.2.1",
|
|
40
40
|
"@lit/react": "^1.0.7",
|
|
41
|
-
"@oslokommune/punkt-elements": "^12.37.
|
|
41
|
+
"@oslokommune/punkt-elements": "^12.37.6",
|
|
42
42
|
"angular-html-parser": "^6.0.2",
|
|
43
43
|
"html-format": "^1.1.7",
|
|
44
44
|
"prettier": "^3.3.3",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "424c529acc9bd6f1ce9063cd79e7e39bcdac27a2"
|
|
116
116
|
}
|